Hello all, noob here.
I've been working on a program (which hopefully will be a game someday) in NESASM3 and I'm running into a problem. I'm trying to load new data into the nametable while scrolling vertically (with vertical mirroring, which may be part of the problem, but the idea is to be able to load a new nametable during the scroll so something different will show up).
I'm able to do this loading from a known address. But I am trying to index into the map stored in the program ROM indirectly and having no luck. Here's what it looks like:
The screen scrolls but comes up with garbage, as if it's not indexing into the data properly. Like I said, I can change "lda (index_low), x" to load from something like "lda story + $60, x" and it will work (except that it just loads the same row of data over and over and doesn't go to the next row). Is this an issue with the syntax? What am I missing?
Appreciate the help!
I've been working on a program (which hopefully will be a game someday) in NESASM3 and I'm running into a problem. I'm trying to load new data into the nametable while scrolling vertically (with vertical mirroring, which may be part of the problem, but the idea is to be able to load a new nametable during the scroll so something different will show up).
I'm able to do this loading from a known address. But I am trying to index into the map stored in the program ROM indirectly and having no luck. Here's what it looks like:
Code:
.rsset $0000
index_low .rs 1
index_high .rs 1
...
.org $8000
story:
.incbin "story.txt"
...
clc
lda #LOW(story)
adc index_low
sta index_high
lda #HIGH(story)
adc index_high
sta index_high
...
ldx #0
draw_next_row:
lda (index_low), x
sta $2007
inx
cpx #32
bne draw_next_row
...
index_low .rs 1
index_high .rs 1
...
.org $8000
story:
.incbin "story.txt"
...
clc
lda #LOW(story)
adc index_low
sta index_high
lda #HIGH(story)
adc index_high
sta index_high
...
ldx #0
draw_next_row:
lda (index_low), x
sta $2007
inx
cpx #32
bne draw_next_row
...
The screen scrolls but comes up with garbage, as if it's not indexing into the data properly. Like I said, I can change "lda (index_low), x" to load from something like "lda story + $60, x" and it will work (except that it just loads the same row of data over and over and doesn't go to the next row). Is this an issue with the syntax? What am I missing?
Appreciate the help!