I am sorry, as it is probably going to be duplicate question, but I tried forum and google search on the forum and did not find an answer (possibly by using wrong keywords)
So I have my nametable generated from "nesst".
And I have this following code. Obviously X register will end after the quarter of the nametable.
I can solve it by splitting my "nam" file into 4 chunks and loading them separately. Can it be done any other way?
My thought process:
Absolute addressing - limits to 255.
Indirect addressing only manipulates zero page.
There is no LDA X,Y addressing like AVR microcontroller has
So I have my nametable generated from "nesst".
Code:
TitleScreen:
.incbin "title.nam"
.incbin "title.nam"
And I have this following code. Obviously X register will end after the quarter of the nametable.
Code:
lda PPU_STATUS
lda #>PPU_ADDR_NAMETABLE1 ;define for $2000
sta PPU_ADDR
lda #<PPU_ADDR_NAMETABLE1
sta PPU_ADDR
ldx #$00
:
lda TitleScreen,x
sta PPU_DATA
inx
; magic goes here
cpx $FF ; end of my X register
bne :-
lda #>PPU_ADDR_NAMETABLE1 ;define for $2000
sta PPU_ADDR
lda #<PPU_ADDR_NAMETABLE1
sta PPU_ADDR
ldx #$00
:
lda TitleScreen,x
sta PPU_DATA
inx
; magic goes here
cpx $FF ; end of my X register
bne :-
I can solve it by splitting my "nam" file into 4 chunks and loading them separately. Can it be done any other way?
My thought process:
Absolute addressing - limits to 255.
Indirect addressing only manipulates zero page.
There is no LDA X,Y addressing like AVR microcontroller has
Code:
ldi ZH, high(Table_1) ; Initialize Z pointer
ldi ZL, low(Table_1)
lpm r16, Z ; Load constant from program
ldi ZL, low(Table_1)
lpm r16, Z ; Load constant from program