In the nerdy nights tutorials, there is a comment on the 6th tutorial (http://nintendoage.com/forum/messagevie ... eadid=8172) in which someone (Zzap) loads the attribute and name tables in one loop. I'm having trouble understanding what's going on. Full code is here https://pastebin.com/f12cef2c1
Here's the part I'm having difficulties with:
Code: Select all
LDA #low(background)
STA AddrLow
LDA #high(background)
STA AddrHigh
LDX #$04 ; Loop X 4 times
LDY #$00 ; Loop Y 256 times
LoadBackgroundsLoop:
LDA [AddrLow],y
STA $2007
INY
BNE LoadBackgroundsLoop
; Outer loop
INC AddrHigh ; increment high byte of address backg to next 256 byte chunk
DEX ; one chunk done so X = X - 1.
BNE LoadBackgroundsLoop ; if X isn't zero, do again
LDA #low(background)
LDA #high(background)
What does this mean? there is no value set to low anywhere in the code. I've also never seen () used before. I understand the looping and branching in the rest of the code well enough, but those parts are baffling me. The label background precedes the tile data in bytes, I know that much. I've just never seen anything like this before so having trouble understanding what #low(background) means, especially when low hasn't been set to any value prior.
Sorry for being so inept. I'm making progress slowly after a long hiatus, really appreciate any help you guys can offer. Thank you