[A83] Re: quick data storage question
[Prev][Next][Index][Thread]
[A83] Re: quick data storage question
At 04:16 PM 4/10/01 -0400, you wrote:
>ds is actually the 32 bit declaration(4 bytes)
>but sence the z80 has no way of accessing all 4 bytes at once, i doubt that
>it was included in the assembler, but on higher level procs, the ds. would
>probably be ints, dw would be shorts, db would be chars/bytes.
>
>And most of the other variables tend to be combonations of the other(like
>floats are two ds combined)
>
>but, sence we have no way(that i've ever heard of, unless someone wants to
>write the code for them) to use .ds i would just keep it in mind if you want,
>or just forget it ^_^
dont confuse people.
.ds <xxxx> ; allocate xxxx bytes of memory at this point in the progarm.
This is how I use ".ds"...
If you want to have a scrollable map that is larger than the screen
dimensions, you can do:
bgBuffer: ; 10x7 tiles, of 12x12 sprites, each 8 pixels is a bit
.ds 1260 ; allocate (10*7)*12x12 /8 = 1260
clearly this is larger than the graph buffer, so i use a double buffer
here, and to generate the display screen, i only take a section of the map
I draw in bgBuffer. Here is an example: (X is visible, 0 is virtual
screen still on the bgBuffer)
0000000000
0XXXXXXXX0
0XXXXXXXX0
0XXXXXXXX0
0XXXXXXXX0
0XXXXXXXX0
0000000000
thats what ".ds" does.
-harper
References: