I'm having a completely perplexing issue that I was hoping someone on this board could help me with.
I've been working through the NES 101 tutorial, but have been using loopy's ASM6 assembler rather than NESASM.
Everything went fine until I tried to write the scrolling code.
Here's my NMI code:
I would like to use A instead of Y to store the horizontal scroll value in $2005, but if I simply uncomment the LDA that is currently commented out, the rom shows a blank screen when loaded. I can't imagine why a simple LDA instruction would cause my program to display a blank screen. It seems that using an LDA of any kind anywhere in my NMI routine causes this problem. I can use them just fine outside of NMI, but placing one inside of the NMI routine causes the program to display a blank screen.
Can anyone shed some light on this bizarre issue?
I've been working through the NES 101 tutorial, but have been using loopy's ASM6 assembler rather than NESASM.
Everything went fine until I tried to write the scrolling code.
Here's my NMI code:
Code:
NMI:
LDX scroll
BEQ IRQ
DEX
STX scroll
;LDA #$00
STY $2005
STX $2005
IRQ:
RTI
LDX scroll
BEQ IRQ
DEX
STX scroll
;LDA #$00
STY $2005
STX $2005
IRQ:
RTI
I would like to use A instead of Y to store the horizontal scroll value in $2005, but if I simply uncomment the LDA that is currently commented out, the rom shows a blank screen when loaded. I can't imagine why a simple LDA instruction would cause my program to display a blank screen. It seems that using an LDA of any kind anywhere in my NMI routine causes this problem. I can use them just fine outside of NMI, but placing one inside of the NMI routine causes the program to display a blank screen.
Can anyone shed some light on this bizarre issue?