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:
.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"
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.
Last edited by Hamtaro126 on Mon Aug 18, 2008 1:54 pm, edited 1 time in total.
Or you could just grab the Prototype version of SMB2?
There are a few logistical problems with your approach... 1800 is a rapidly changing bank. If you want everything else to animate, but keep the water moving fast, you'll have to put the water in a CHR area.
Last edited by Dwedit on Sun Aug 17, 2008 7:52 pm, edited 1 time in total.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Dwedit wrote:Or you could just grab the Prototype version of SMB2?
That is where the waterfall routine for CHRRAM is coming from. Before I even do that, I must load CHRRAM for the part of the bank.
I know it doesn't, Just needs one,
And I meant $1800 is the PPU address. not RAM. and as Disch's Mapper Docs said. I used CHR-RAM by deleteing CHR-ROM animation in that area and putting it in bank $08. the sprites are also in a different CHR-ROM location.
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
Since this looks like x816, I don't think you need the < for zero page mode like nesasm requires. < has a different purpose (gets low byte of an address). In either case, you still need the # to indicate immediate mode.
Also... many of your comments are wrong. I'm guessing they're hold overs from a copy/paste job and you edited the code without editing the comments?