Since I didn't find an NES game with a female character that matches my taste, I decided to program one myself. So, I picked up NES programming again.
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:
In CC65, this produced errors and I changed the following:
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:
And my call is simply:
ca65 Test.s
(I don't link yet, I just try to create the object file for now.)
What am I doing wrong here?
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:
LDA #LOW(background)
STA pointerLo
LDA #HIGH(background)
STA pointerHi
LDX #$00
LDY #$00
OutsideLoop:
InsideLoop:
LDA [pointerLo], y
; and so on.
STA pointerLo
LDA #HIGH(background)
STA pointerHi
LDX #$00
LDY #$00
OutsideLoop:
InsideLoop:
LDA [pointerLo], y
; and so on.
In CC65, this produced errors and I changed the following:
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:
.segment "ZP"
pointerLo: .res 1
pointerHi: .res 1
pointerLo: .res 1
pointerHi: .res 1
And my call is simply:
ca65 Test.s
(I don't link yet, I just try to create the object file for now.)
What am I doing wrong here?