Coolboy cart programmer

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderators: B00daW, Moderators

tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Coolboy cart programmer

Post by tepples »

Yes.

First wait for the PPU to warm up:

Code: Select all

  lda #0
  sta $2000  ; disable NMI and set video memory increment to +1
  sta $2001  ; disable rendering
  bit $2002  ; clear in case reset was pressed during vblank
vwait1:
  bit $2002
  bpl vwait1
  ; At this point you have about 30,000 cycles to burn for
  ; other mapper initialization if necessary
vwait2:
  bit $2002
  bpl vwait2
Then load a palette into CGRAM $3F00-$3F1F, load a font into CHR RAM $0000-$07FF, load some text into the nametable at $2000-$23FF or DMA a sprite display list to OAM, set the scroll position, and turn on rendering.
BennVenn
Posts: 107
Joined: Sat Mar 29, 2014 10:01 pm
Location: Australia
Contact:

Re: Coolboy cart programmer

Post by BennVenn »

Thanks guys.

I've placed nametable data in each bank though something fishy is going on with bank switching.

It is as though LSbit of 8001 doesn't do anything. Ill re read the wiki. I might not have set up the mapper correctly.
lidnariq
Posts: 10677
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Coolboy cart programmer

Post by lidnariq »

The 2KiB CHR banks on the MMC3 ignore its LSB, if that's what you're encountering. (i.e. the number you write is always an offset in 1024-byte units, not a direct bank #)
BennVenn
Posts: 107
Joined: Sat Mar 29, 2014 10:01 pm
Location: Australia
Contact:

Re: Coolboy cart programmer

Post by BennVenn »

Its with the prg banks. $06> $8000

All good, just my interpretation of the mapper. 8Kib mapped blocks. No problem.
BennVenn
Posts: 107
Joined: Sat Mar 29, 2014 10:01 pm
Location: Australia
Contact:

Re: Coolboy cart programmer

Post by BennVenn »

OK, bootstrap program swaps out the 512kbyte ROM and executes it. It displays the contents of all 64 mapped banks, no problems there.

Next up is CHR Ram verification.

Is there a way to detect mirroring? Am I just looking for mirrored address space in the PPU's address space?
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Coolboy cart programmer

Post by tepples »

Write $00 at $2000 and $01 at $2C00, then read back from $2400. It'll be $00 for horizontal mirroring (AABB) or $01 for vertical mirroring (ABAB), just like bit 0 of iNES flags 6. Untested code follows:

Code: Select all

.proc detect_mirroring
  lda #$20
  ldx #$00
  sta PPUADDR
  stx PPUADDR
  stx PPUDATA  ; vram[$2000] = $00
  lda #$2C
  sta PPUADDR
  stx PPUADDR
  lda #$01
  sta PPUDATA  ; vram[$2C00] = $01
  lda #$24
  sta PPUADDR
  stx PPUADDR
  bit PPUDATA  ; prepare read from vram[$2400]
  lda PPUDATA  ; complete the read
  rts
.endproc
But MMC3 itself has unspecified mirroring at power-on. This means a game that has been properly mapper-hacked or otherwise developed for MMC3 will set the mirroring at least in its init code. Something developed for mapper 206 (Namco 108/Tengen MIMIC-1), such as Karnov or RBI Baseball series, might need mirroring to be set up in advance because these games assume hardwired mirroring.
BennVenn
Posts: 107
Joined: Sat Mar 29, 2014 10:01 pm
Location: Australia
Contact:

Re: Coolboy cart programmer

Post by BennVenn »

OK,

My code fills all 128K CHR RAM with data from bank 0-16, then reads back and compares byte for byte the data in CHR RAM. 100% match.

So why doesn't Bugs Bunny birthday blowout or Mario2 work on this cart?

megaman 3+4 works fine. MM4 doesn't rely on CHR RAM on the cart, and MM3 is 128k/128k, H mirroring and is more or less identical to Mario2/bugs...

I'm thinking mario/bugs could be writing to a different address to swap banks? That could explain what is going wrong on these games and not others. Or it could be a mirroring thing? Forcing bad mirroring in fcuex can simulate some of the artifacts I'm seeing on the real NES which makes me think it could be related.

The NES ALU is pretty cool though, comparing a value from an indirect memory location using an 8bit pointer, with an offset.

Code: Select all

cmp ($C3),Y
All without modifying the accumulator. Very cool.

Edit:

I had a look at the mapper access of SMB2, it sets A12 inversion for all its writes. This could be the cause. I then looked into Bugs, there is absolutely nothing odd with any of its mapper access. All standard addresses, Mirroring is set to 1, 3 times throughout the startup into the game. Pretty lost in all this!

I changed all mirror writes from 1 to 0 to see the effect in the emulator. It changed the starting location of bugs in his crazy world, but otherwise completely playable.
BennVenn
Posts: 107
Joined: Sat Mar 29, 2014 10:01 pm
Location: Australia
Contact:

Re: Coolboy cart programmer

Post by BennVenn »

I got in touch with Cluster,

He has a ROM compilation generator online, super easy to use! I just built a ROM list including the trouble ROM's and get the same problem on the NES. Its satisfying to know its not my coding that is bugging out!

It must be the carts compatibility with the original front loading PAL NES. I remember reading somewhere online that there is a mod you must do, bridge one of the CHR bus lines across the 60-72 pin adaptor. I can't find it though. Does anyone know where I could find that info?

Just waiting back on cluster to test smb2 and bugs on his console to verify it is a system issue, not a ROM issue.
BennVenn
Posts: 107
Joined: Sat Mar 29, 2014 10:01 pm
Location: Australia
Contact:

Re: Coolboy cart programmer

Post by BennVenn »

Finally my 150in1 Rockman Coolboy cart (with Battery and WRAM) arrived. I noticed Mario2 worked on this cart. I thought it could have been patched so I dumped the full 32mb and re-flashed to the non-save coolboy cart.

Same fault when running on the non-save cart.

I've tried breaking and bridging all the possible jumpers on the cart with no change in the fault.

I'm going to try narrow down exactly what is going wrong with Mario2. It could be an accidental mapper CHR page swap that isn't there, or a rogue write to a register (But this doesn't occur with the save-cart). Interesting...

Otherwise, the 150-in-1 with battery save is the cart you want!

Edit: OR!!! it could be that the 150in1 has an onboard 3.3v regulator?!?!?! OR Bus collision forcing an mapper reset?
lidnariq
Posts: 10677
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Coolboy cart programmer

Post by lidnariq »

All the COOLBOY carts have to have some kind of 3V regulator; the FLASH 'PROM will rapidly die if its Vcc is above 4V.
BennVenn
Posts: 107
Joined: Sat Mar 29, 2014 10:01 pm
Location: Australia
Contact:

Re: Coolboy cart programmer

Post by BennVenn »

The 400-in-1 doesn't. It has a single diode with a fwd voltage drop of .55volts inline with VCC however there is a pad next to it which shorts it effectively passing VCC to all the IC's. I'm pretty sure these carts are designed for Pocket NES/FC systems which are 3.3v native.

I'm just adding 3 signal diodes to drop it to about 3.5volts and a cap to help with transients.

Edit: No Change. I'm thinking more bus collision/bad mapper switch
BennVenn
Posts: 107
Joined: Sat Mar 29, 2014 10:01 pm
Location: Australia
Contact:

Re: Coolboy cart programmer

Post by BennVenn »

Why do you think 'ZELDA' is written into the ROM next to the interrupt vectors?
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Coolboy cart programmer

Post by tepples »

I'd bet Doki Doki Panic was the next game that Nintendo ported from FDS to cartridge after Zelda no Densetsu. Because somebody at Nintendo forgot to change the PRG ROM footer, every authentic Game Pak of Super Mario Bros. 2: Mario Madness contains the string "ZELDA".

See The Cutting Room Floor, previous post, previous post, and previous post.
User avatar
Memblers
Site Admin
Posts: 3901
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: Coolboy cart programmer

Post by Memblers »

SMB2 needs WRAM, does the other cart have it?
BennVenn
Posts: 107
Joined: Sat Mar 29, 2014 10:01 pm
Location: Australia
Contact:

Re: Coolboy cart programmer

Post by BennVenn »

SMB2 needs WRAM, does the other cart have it?
Whaaaaat! Is it really that simple? I can't believe I overlook that!

Is that in the iNes header or something?


Ahhhh I just trapped all writes to A001 and 6000-7FFF and yeah, Bugs uses WRAM too. So simple its frustrating!
Last edited by BennVenn on Fri Jan 01, 2016 1:56 am, edited 1 time in total.
Post Reply