cbmeeks
Registered: Oct 2005 Posts: 78 |
One more KickAssembler question please
How can I pass the X, Y or A into a macro?
ldx #14
:DrawTimeXY( screenbuffer, "value of X", 0, 1)
.macro DrawTileXY( buffer, x, y, tile )
{
// save X,Y,A
sta TMP_A
stx TMP_X
sty TMP_Y
ldx #tile
lda T1,x
sta [buffer + [[y * 40] + x]]
lda T2,x
sta [buffer + [[y * 40] + x + 1]]
lda T3,x
sta [buffer + [[[y + 1] * 40] + x]]
lda T4,x
sta [buffer + [[[y + 1] * 40] + x + 1]]
// restore X,Y,A
lda TMP_A
ldx TMP_X
ldy TMP_Y
}
Thanks!
METROID
http://www.metroidclassic.com |