This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

CHRRAM question.

CHRRAM question.
by on (#35978)
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:

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"


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.

by on (#35979)
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.

by on (#35980)
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.
Re: CHRRAM question.
by on (#35982)
Hamtaro126 wrote:
I am making SMB2/USA use both CHRRAM and CHRROM using pirate mapper 74 (MMC3 variant)

Is that more common than a TQROM?

by on (#35985)
If you want more than 64KB of CHR ROM, you need mapper 74
and obviously this is a romhack for use in emulators only

by on (#35995)
People can hack a MMC3 to use CHRRAM and CHRROM at the same time. Just needs some scheme to do it.
Re: CHRRAM question.
by on (#36024)
Hamtaro126 wrote:
Code:
   sta <$81           ;store in $80


No comment

Also, you should "bankswtich" the CHRRAM in place, write to it is not enough.
Re: CHRRAM question.
by on (#36040)
Bregalad wrote:
Hamtaro126 wrote:
Code:
   sta <$81           ;store in $80


No comment

Also, you should "bankswtich" the CHRRAM in place, write to it is not enough.


Oops, That is fixed,

Also, I already switched it according to Disch's Mapper 74 document as Bank $08. $09 is used with it, As it is in a ''fixed'' CHR bank.

EDIT: It seems to not want to upload to the CHRRAM at all. Can anyone see what is wrong?

by on (#36047)
Code:
   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


I'm assuming you wanted:

Code:
   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?