So, I'm trying to make a subroutine that can modify a given tile in a given nametable before it loads into the PPU using ASM6.
The code I have is as follows (the .org is just so I can find the subroutine in the fceuxd's debugger):
;*TODO: Implement a working version of this subroutine
.org $c500
switch_tile:
lda nametableaddr_low
clc
adc tileswitch_low
sta tileswitch_low
lda nametableaddr_high
adc tileswitch_high
sta tileswitch_high
lda newtile
ldy #$2
sta (tileswitch_low),y
rts
The most of the code works fine. In fact the only problem is at
While the debugger's disassembly shows that (tileswitch_low),y points to the correct address ($d1a9), the address is never actually written to. Going through both the hex editor and the RAM filter show that $d1a9 is unchanged from before.
Why is this so? Is is because I am trying to change a value in ROM? If so, how can I go about changing a nametable's tile?
Thanks for any and all help!
The code I have is as follows (the .org is just so I can find the subroutine in the fceuxd's debugger):
Code:
;*TODO: Implement a working version of this subroutine
.org $c500
switch_tile:
lda nametableaddr_low
clc
adc tileswitch_low
sta tileswitch_low
lda nametableaddr_high
adc tileswitch_high
sta tileswitch_high
lda newtile
ldy #$2
sta (tileswitch_low),y
rts
The most of the code works fine. In fact the only problem is at
Code:
sta (tileswitch_low),y
While the debugger's disassembly shows that (tileswitch_low),y points to the correct address ($d1a9), the address is never actually written to. Going through both the hex editor and the RAM filter show that $d1a9 is unchanged from before.
Why is this so? Is is because I am trying to change a value in ROM? If so, how can I go about changing a nametable's tile?
Thanks for any and all help!