A86: Re: Question on tile maps (Repost)


[Prev][Next][Index][Thread]

A86: Re: Question on tile maps (Repost)




When you point to something, it starts at _that byte_, not the next byte.
So HL would point to the first byte of the map, byte 0.  In assembly or C
programming, everything starts at 0.  Map + 0 = Map = first map byte.  If
the map is 16 bytes wide and you add 16 to the pointer, then you will get
the tile at the same column but on the next row.  Anyone more questions, see
the just updated tilemap section at 86 Central.

--
David Phillips <david@acz.org>
http://www.acz.org/

>if i do  the following:
>ld hl,Map1
>inc hl
>
>would hl contain the first element of the map? or when i load hl with the
map, >does it already point to the first element?  Also, <add hl,de> would
move to the >next row right? (de has 16 in it).
>