SNROM 4 IN 1 Multicartridge

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
SNROM 4 IN 1 Multicartridge
by on (#125158)
This cartridge has no menu.
By pushing the reset button it is possible to switch the games.
Any 256KB SNROM game should work on this cartridge but their setup should be like this :

PRG1 --> 256KB --> Final Fantasy I
PRG2 --> 256KB --> Final Fantasy II
PRG3 --> 256KB --> Legend of Zelda
PRG4 --> 256KB --> Destiny of an Emperor

Needed chips :
AT27C080 --> PRG
KM62256 --> WRAM
KM6264 --> VRAM
KS5361 --> MMC1
74HC393 --> COUNTER
74HC139 --> DECODER

SNROM Schematic :

Image


Multicartrige Mapper Schematic :

Image

And a great thanks to Oliveira, he is devoting kindly his precious time for helping me.
Re: SNROM 4 IN 1 Multicartridge
by on (#125859)
I am trying to make a menu for this multicartridge, the menu itself is almost ready
The main problem is about WRAM
Since the board is SNROM, WRAM will contain save data of the games
On the other hand the menu registers are 6000~7FFF, so by selecting a game those registers will be written
As a result it can corrupt the save data
I found four solutions for protecting the WRAM save data but I am not sure which one is better to implement [Or maybe none of them! :oops: ]
I am writing this hoping to get some good advice about it

********************************************************

Solution 1 :
I found that "Legend of Zelda, The (U) (PRG1) [!].nes" on the start up have this code :
STA ($02),Y @ $6C90 A=A9
So $6C90 is a safe address and can be written before the game start up
Therefore I can use $6C90 for my multicart menu register
Because if I write anything to that address on the menu, the game itself will fill that address with correct data every time on the start up
But what about the other games, should I worry about the corruption of their save data?!

Image

********************************************************

Solution 2 :
I am using KM681000 as a WRAM, it is a 128KB * 8bit SRAM
Every game needs only 8KB WRAM for save data
I can load a complete free bank of SRAM while it is on the menu
Then I can write anything to that free bank of SRAM on the menu!
And after running the games I can load their own WRAM data

Image

********************************************************

Solution 3 :
I am using CPU R/W and WRAM CE to generate a clock signal for 161
At this point the WRAM is being written
But I can disable the WRAM on the menu by using WRAM /CE
So nothing can be written to WRAM and thus nothing can corrupt any data inside of WRAM

Image

********************************************************

Solution 4 :
This is the just a combination of all three above solutions, to make sure nothing can ever corrupt the save data on the selection menu!

Image
Re: SNROM 4 IN 1 Multicartridge
by on (#125887)
Interested in your design :) Very clever.
I'm not the best one to offer advice but I'll throw my opinion out here anyway:
With #1 you would have to depend on how each game handles WRAM, this could limit you to what title will run on this hardware.
#2 could be useful for a menu system that retains user data, this could allow for some advanced features if you wanted to expand the menu.
#3 Seems the safest and simplest handling and it may add some power on/off protection to WRAM data(?).
#2 and #3 seem the most useful; #3 is attractive because of it's simplicity so it would be more general purpose. OtoH, #2 may allow expansion for future custom menus.
Nice work
Yogi
Re: SNROM 4 IN 1 Multicartridge
by on (#125888)
@ yogi
Thank you for your advice
I ended up using this, it seems everything works fine :

Image

Also thanks to thefox on the nesdev IRC channel, he helped me to fix the music problem of "Destiny of an Emperor"
When I start the game from the menu it had bad music, but on direct start up it was good
I wrote 00 to $4000 ~ $4017 right before the game start and it fixed the problem

How to use menu patch :
1. Find "Legend of Zelda, The (U) (PRG1) [!].nes"
2. Expand it to 256KB with NFlate v1.01 (Thanks to KingMike)
3. Patch it with Lunar IPS v1.01 (Thanks to FuSoYa)
Re: SNROM 4 IN 1 Multicartridge
by on (#125980)
There is a minor problem with the cartridge which I want to fix it if possible or at least find out what can cause it :

With cold boot the menu title is show up like this :

Image


Then one reset or power off / on fix the issue :

Image

I guess it is a hardware issue.
Is it related to caps?
Or maybe SRAM?
Re: SNROM 4 IN 1 Multicartridge
by on (#125983)
Maybe it's failing to wait for the PPU before uploading the font?
Re: SNROM 4 IN 1 Multicartridge
by on (#125986)
Then how to fix it?
And somethings at cold boot it runs fine but if I wait for some seconds it tends to go crazy like that for a second and then becomes OK and repeats it randomly two or three times then become stable

Edit :
Sometimes it becomes like this :

Image

Is this related to the menu problem?

Can anyone debug my menu code and see if there is anything wrong with CHR-RAM initiation code