Can someone post some code.
Say I make a pattern bitmap of 768 bytes in memory
Map
db 20,10,20,30,40----
0-31
.....
23......
Of course each one corresponds to a pattern in the pattern table
Well if I give the y and x position of the sprite I need the tile that is at that y and x position.
This is what I use to get it from VRAM but I want to move away from that and grab it directly from a pointer.
This will save on resources and speed up access
LD A, (PLAYER_Y)
AND $F8
LD H, 0
LD L, A
ADD HL, HL
ADD HL, HL
LD DE, $1800
ADD HL, DE
LD A, (PLAYER_X)
SRL A
SRL A
SRL A
OR L
LD L, A
DI
LD A,L
OUT (98h),A
LD A,H
AND 3FH
OUT (99h),A
EI
IN A, (98h)
I know L gives 0-255 and H will return 0, 1 or 2
If someone has already figured out the math then please post this.
Someone else gave me this formula so I am lost on such things.
TIA