I am making SMB2/USA use both CHRRAM and CHRROM using pirate mapper 74 (MMC3 variant) for a DDP-Style Waterfall. I wanted to make the CHRRAM load it's chr in $1800 of the PPU. The problem is it doesn't load right with any of the routines I have. They Lack the Null terminator and it's routines.
How will I load CHRRAM while ending at a certain place using this example:
I based it off of the ''Hello World CHRRAM version'' from Poultry Games's Website. If it needs any more fixes than this, then tell me.
How will I load CHRRAM while ending at a certain place using this example:
Code:
.index 8
.mem 8
.org $ae60
StartCHR:
lda #$18 ;point $2007 to address $1800.
sta $2006
lda #$00
sta $2006
charload:
lda <CHRRAM ;get low byte of chr data
sta <$80 ;store in $80
lda >CHRRAM ;get high byte of chr data
sta <$81 ;store in $81
LDY #$00 ;load y with 0
charloop:
LDA ($80),Y ;load <$80, which contains low byte of char with the contents of y, which is 0 at the moment.
STA $2007 ; store in $2007
INY ;increase y
BNE charloop ;if the V flag isn't set, keep looping
INC <$81 ;increase <$81, which has the high byte of char
LDA <$81 ;load <$81
CMP #$A0 ;if the high byte isn't FF
BNE charloop ;keep looping
RTS
CHRRAM:
.incbin "CHRRAM1.CHR"
.mem 8
.org $ae60
StartCHR:
lda #$18 ;point $2007 to address $1800.
sta $2006
lda #$00
sta $2006
charload:
lda <CHRRAM ;get low byte of chr data
sta <$80 ;store in $80
lda >CHRRAM ;get high byte of chr data
sta <$81 ;store in $81
LDY #$00 ;load y with 0
charloop:
LDA ($80),Y ;load <$80, which contains low byte of char with the contents of y, which is 0 at the moment.
STA $2007 ; store in $2007
INY ;increase y
BNE charloop ;if the V flag isn't set, keep looping
INC <$81 ;increase <$81, which has the high byte of char
LDA <$81 ;load <$81
CMP #$A0 ;if the high byte isn't FF
BNE charloop ;keep looping
RTS
CHRRAM:
.incbin "CHRRAM1.CHR"
I based it off of the ''Hello World CHRRAM version'' from Poultry Games's Website. If it needs any more fixes than this, then tell me.