Last time, I didn't have an idea for a game, so I made slow progress, but this time I have a concept and I'm much more motivated.
I went through the Nerdy Nights tutorials again and now I also have a much better understanding of all that stuff than last time.
Since I'm planning to write some of the code in C, my first step is to convert my NESASM3 sample program into CC65 syntax. And there's where I've encountered the first problem:
In NESASM3, I had the following code to fill all the background tiles with values:
Code: Select all
LDA #LOW(background)
STA pointerLo
LDA #HIGH(background)
STA pointerHi
LDX #$00
LDY #$00
OutsideLoop:
InsideLoop:
LDA [pointerLo], y
; and so on.I changed #HIGH to .HIWORD and #LOW to .LOWORD.
Is this the correct function?
Then I changed LDA [pointerLo], y to LDA (pointerLo), y.
But now, regarding this line, the compiler tells me:
"Error: Range error"
The pointer variable is declared in the zero page:
Code: Select all
.segment "ZP"
pointerLo: .res 1
pointerHi: .res 1ca65 Test.s
(I don't link yet, I just try to create the object file for now.)
What am I doing wrong here?