I am trying to add a tile to my map, where each tile is 16x16px, making each of my gfx 2x2 tiles.
So I need to do the equivalent of
Void Drawblock(int t, int x, int y)
{
MapBuffer(32*y + x) = t*2;
MapBuffer(32*y + x+1) = t*2+1;
...etc.
}
I came up with the following...
.MACRO DrawBlock
; \1 = tile, \2 = x, \3 = y
LDA #32*\3 + \2 + MapBuffer
STA Temp
LDA #\1 ; A = tile#
ASL A ; A << 1 (A = A * 2) (Tiles are 16x16px)
LDX Temp
STA MapBuffer,X ; Map(X) = A (Should shot top left of tile at location \2,\3)
.ENDM
...BUT, I get the following error -
INPUT_NUMBER: Out of 8bit range.
ERROR: Couldn't parse "LDA".
1. What am I doing wrong?
2. Is this the correct way to attempt what I want to do?