Tile Explanation desired
Erik Friesen
Posts: 1,071
Could someone explain in what format graphics tiles are arranged? The reason for asking is that I am talking to another forum member about using the graphics driver with my 128x64 driver. My driver loads the lcd like this-
row1--byte1, byte2, byte3 and so on--
row2--byte17,byte18,byte19, and so on--
---
row64--last row byte113,byte 114, and so on--
Now if I have it right, the tiles are arranged like this(if you can visualized this)
byte1,byte2
byte3,byte4
byte5,byte6
and so on
So, I would arrange a 4x8 screen size.
But, do the tiles run up and down, and then left to right? or left to right, and then up and down?
Ok now, for example we have word screen[noparse][[/noparse]4*8]
Is screen[noparse][[/noparse]x] a pointer to the memory location of byte 0 that the graphics driver is writing to?
Are these tiles written in an interleaved style like the letters a stored in rom?
Or in what format are these arranged? Where is the color stored?
row1--byte1, byte2, byte3 and so on--
row2--byte17,byte18,byte19, and so on--
---
row64--last row byte113,byte 114, and so on--
Now if I have it right, the tiles are arranged like this(if you can visualized this)
byte1,byte2
byte3,byte4
byte5,byte6
and so on
So, I would arrange a 4x8 screen size.
But, do the tiles run up and down, and then left to right? or left to right, and then up and down?
Ok now, for example we have word screen[noparse][[/noparse]4*8]
Is screen[noparse][[/noparse]x] a pointer to the memory location of byte 0 that the graphics driver is writing to?
Are these tiles written in an interleaved style like the letters a stored in rom?
Or in what format are these arranged? Where is the color stored?
Comments
When I add $3000, then I get some action. (One tile displayed from graphics 16x16)
am I!!!
Thanks for the help
It would interesting to have a routine for graphic lcd graphics.
The routine of TV requires lots of memory dedicated to the display.
With lcd 128x64 or 256x128 does not need as much memory.
big memory for program free
·
Hi Erik, and hal2000,
It's not quite that easy, for two reasons.
should be 0 to 15 as Spin does the last number too, and would have done 0 to 16 = 17 loops
and the second reason is that the fonts are intermingled, ie 0 is intermingled with 1, and are seperated by the driver, by use of colours, so if you had text on the screen, it won't appear correctly on your display, but if it's for graphics, then it's ok.
if it's graphics, to do a 128x64 pixel do
if it's graphics, to do a 256x128 pixel do
PS, I don't have any of the kit, so can you test this, and let me know, as it's written blindly.
You will also, have to have lcdpointer already set to your buffer, and x_tiles as your graphics tv_hc setting ( it's usually set to 16 as 16 * 16PixelTiles = 256 pixels width )
Baggers.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
It is pretty slow though. It needs to be done in assembly.
······repeat·b·from·0·to·7····'across
········repeat·c·from·0·to·15··'tile·row
··········tot:=long[noparse][[/noparse]$3000+(c*4)+(b*256)+(a*64)]
··········repeat·d·from·0·to·15
············tot2:=tot2<<1+(tot&1)
············tot>>=2
··········tot2><=16
··········word[noparse][[/noparse]lcdpointer+(c*16)+(b*2)+(a*256)]:=tot2
··········tot2~
·
but you got there in the end [noparse]:)[/noparse]
also change the *4 to <<2 and *256 to <<8 etc, that'll speed it up a little bit. nowhere near as fast as asm though.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·