[A83] Re: Map question


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

[A83] Re: Map question




Your code here won't work, you can only directly set f with the stack, and 
you can only add hl to de or bc.  A is the Most significant byte anyway...


Never use SLA A, it's 2 bytes.  Use add a,a instead.

Suggested code?
ld a,l
ld h,0
add hl,hl
add hl,hl
add hl,hl
ld de,whatever
add hl,de

>From: Mike3465@aol.com
>Reply-To: assembly-83@lists.ticalc.org
>To: assembly-83@lists.ticalc.org
>Subject: [A83] Map question
>Date: Sat, 17 Mar 2001 17:24:23 EST
>
>
>Ok, i'm making a map program to use for an rpg I'm thinking about, and i 
>was
>wondering if i could do this:
>
>(normal code, and then some to get the tile num(0-255) into a)
>     ld f,0
>     sla a
>     sla a
>     sla a       ;same as a=a*8;
>     add hl,af   ;or should i exchange a to f? I'm not sure, i want to add 
>the
>offset of               ;the tile(a) to the tile data(hl) any help here?
>(normal code to display tile located at hl)
>
>would that work? or do i need to exchange a and f to get the right code? or
>could i just say "  add hl,a" and that work?
>
>Any help would be....helpfull
>
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com