Non volatil game boy saves (done on Pokemon Yellow, but problem on Pokemon Gold)

wadeVillines

Active Member
Newcomer
Joined
Oct 17, 2017
Messages
30
Trophies
0
Age
31
XP
199
Country
United States
You can put photos? I dont understand all the steps because im not a good tecnicia.
The only for mbc 5 step is for all the games?

Yes, if you are using an MBC5, you should be able to just remove the RAM chip and place your FRAM. Removing the power-down chip is optional, but you can do it if you connect one end of a 10k resistor to the VCC pin of your FRAM and the other to the CE pin of FRAM. The resistor trick is totally optional, so you don't have to do it unless your power-down chip is dead or something. Honestly, it's only really useful if you're building a flash cartridge from scratch.
 
Last edited by wadeVillines,
  • Like
Reactions: gonzaloj

wadeVillines

Active Member
Newcomer
Joined
Oct 17, 2017
Messages
30
Trophies
0
Age
31
XP
199
Country
United States
Hey all, hopefully this is it. Figured out how to get the FM18W08 chip to work on both Gameboy DMG and Gameboy Color, which means it should theoretically work on the GBA as well.

For this to work, you will need to OR together these signals:
-/RAMCS from the MBC3
-CLK from the cartridge slot

The output of this OR should go to the /CE of your FRAM. Basically, if any one of these signals goes high, then /CE should also go high (inactive).

Originally, I was using a 3-input OR (RAMCS, CS, CLK), but it's a little bit overkill I think. CLK is already rising and falling every cycle, so CS isn't really needed as far as I know.

EDIT: use a 2-input OR instead of 3 (RAMCS and CLK), use that output as your FRAM /CE signal.
 
Last edited by wadeVillines,
  • Like
Reactions: migles

JS7777

Well-Known Member
Newcomer
Joined
Aug 2, 2017
Messages
58
Trophies
0
XP
239
Country
France
Great.

I made a post a while ago about that, and bennvenn told me to use with a nand gate.

By using a OR gate it will probably fix my glitch issue with Wario Land cartridge.

My post :

So, i bought a FM16W08 and i've installed it in a gameboy game : Wario Land Super Mario land 3 (MBC1 and 64kbit sram)

I've uploaded a 100% save in the cartridge.

Tried on my gameboy and works but then i got some glitches. "Wario" is invisible, impossible to play.

So i found this topic 3 month earlier and i decided to post here today.

I've contacted BeenVenn, if you don't know him check his shop https://bennvenn.myshopify.com.
He makes cartridges with fram chips but later i've noticed he makes his own mbc chip.

I've explained the problem and he told me to try to multipex the /CE signal with the cartbus /CLK signal. I've tried with a CD4011, didn't work, black nintendo logo. In the process i've swapped pin 1 and 3 by mistake so this could have damaged the MBC1.
ArUt9QS.png



Later on i found this :
https://www.reddit.com/r/Gameboy/comments/4rkoyz/bennvenns_gbgbc_high_quality_reproduction_pcb/

In a post BeenVeen says :
RAMTRON brand FRAM has an unusual requirement where the /CE line must be strobed before any read or write in order to 'precharge' the magic within, and update the address matrix (It's all in the datasheet). On the older GB ROM's the gameboy does single byte reads and writes which due to the nature of the GB bus the /CE line automatically strobes.

The GBA is a little lazy in this regard and holds the /CE line low and just increments the address bus. On a real ROM/SRAM this is a legitimate way of reading data (assuming you adhere to timings) but with the FRAM it simply repeats the same data from the address where the /CE line first became active.

Gold/Silver etc are a lot more optimised and also perform multiple RAM address reads/writes without de-asserting the /CE signal. This is why they glitch. You can fix this by multiplexing the /CE signal with the cartbus CLK(PHI) signal.

As I code my own MBC in a CPLD (An enormous amount of logic gates which I can arrange in any particular order) I can ensure the /CE signal is strobed at ever access request.



Could be great if someone tries to multiplex /CE and /CLK cartbus, even if i already did. (My cart could be damaged)

I'm gonna buy a Logic analyser soon...
 
Last edited by JS7777,

gonzaloj

Member
Newcomer
Joined
Feb 19, 2018
Messages
9
Trophies
0
Age
29
XP
54
Country
Spain
Hey all, hopefully this is it. Figured out how to get the FM18W08 chip to work on both Gameboy DMG and Gameboy Color, which means it should theoretically work on the GBA as well.

For this to work, you will need to OR together these 3 signals:
-/CS from the cartridge slot
-/RAMCS from the MBC3
-CLK from the cartridge slot

The output of this OR should go to the /CE of your FRAM. Basically, if any one of these signals goes high, then /CE should also go high (inactive).

It's worth noting that only gating the first 2 signals (CS and RAMCS) appeared to work for most games. Certain titles, like Super Mario Land 2, use RAM slightly differently and need the CLK signal as well to work. I think you could probably get away with omitting the CLK from your OR gate and still be fine for most cases, but I can't be certain without a lot more testing.
But you say before that you only hace to put the Fram fm18w08 in the Game, in What games i have to do It? Works with all mbc?
 

wadeVillines

Active Member
Newcomer
Joined
Oct 17, 2017
Messages
30
Trophies
0
Age
31
XP
199
Country
United States
But you say before that you only hace to put the Fram fm18w08 in the Game, in What games i have to do It? Works with all mbc?

In MBC5, you only have to place your FM18w08. In MBC3, you will have to OR those signals together and send the output to your FRAM /CE pin.

--------------------- MERGED ---------------------------

Great.

I made a post a while ago about that, and bennvenn told me to use with a nand gate.

By using a OR gate it will probably fix my glitch issue with Wario Land cartridge.

My post :
Wow, that post takes me back. I think I remember reading over that a looong time ago, back when I was doing my initial research and knew almost nothing.
I believe you are right, I'm 99% sure that Wario game has the same issue as Super Mario Land 2, using part of RAM as system RAM.

I need to edit my post, but I think this solution can be simplified to match what you have there. A 3-input OR doesn't seem necessary, and a 2-input OR using only CLK and RAMCS seemed to do the trick for me.
And because using an OR on those signals fixed the sprites in SML2, I'm hoping it will work for you as well.
 
Last edited by wadeVillines,
  • Like
Reactions: gonzaloj

gonzaloj

Member
Newcomer
Joined
Feb 19, 2018
Messages
9
Trophies
0
Age
29
XP
54
Country
Spain
In MBC5, you only have to place your FM18w08. In MBC3, you will have to OR those signals together and send the output to your FRAM /CE pin.

--------------------- MERGED ---------------------------


Wow, that post takes me back. I think I remember reading over that a looong time ago, back when I was doing my initial research and knew almost nothing.
I believe you are right, I'm 99% sure that Wario game has the same issue as Super Mario Land 2, using part of RAM as system RAM.

I need to edit my post, but I think this solution can be simplified to match what you have there. A 3-input OR doesn't seem necessary, and a 2-input OR using only CLK and RAMCS seemed to do the trick for me.
And because using an OR on those signals fixed the sprites in SML2, I'm hoping it will work for you as well.
you can upload some photos of the mbc 3 method?
P.D: thanks for all your discoveries, you are a amazing gamer!!!
 

wadeVillines

Active Member
Newcomer
Joined
Oct 17, 2017
Messages
30
Trophies
0
Age
31
XP
199
Country
United States
Just tested with Pokemon Prism. You will need to OR together CS, RAMCS, and CLK for this game to completely work. Without CS, the save file will corrupt and all in game sprites will have issues. Without RAMCS, the clock data on the continue screen does not update (it is supposed to update every second). There are probably more issues caused by not including RAMCS, but that is all I have found with my short tests. So, to be safe for full compatibility, I would OR together all 3 signals.

Also, I added a quick doodle of the setup. I will get around to a more detailed explanation later on. I hope to start up a blog after I design and assemble a working cartridge.
 

Attachments

  • FRAM Setup.png
    FRAM Setup.png
    7.8 KB · Views: 449
Last edited by wadeVillines,
  • Like
Reactions: gonzaloj

wadeVillines

Active Member
Newcomer
Joined
Oct 17, 2017
Messages
30
Trophies
0
Age
31
XP
199
Country
United States
What Or gate you recommend ? (number ?)

Thanks
I haven't tried out any of them (I just used some diodes to rig an OR gate), but I just bought these:
https://www.digikey.com/product-detail/en/texas-instruments/SN74LVC1G332DCKR/296-15943-6-ND/1849509

It will take a few days for them to arrive, but I don't see any issues with them. They had the shortest delay I could find at only 4.5ns and accept anywhere from 1.7V to 5V.

Using the 2-input one seemed to work for every game besides Pokemon Prism, which is doing something differently. I don't know why adding the CS line fixes it, because the RAMCS signal is specifically there for signaling the RAM. If I was more ambitious, I would dig into it and try to find out. It might be possible to patch the game to not need that extra signal, but I wouldn't know for sure. Probably more work than it's worth anyway.
 
Last edited by wadeVillines,

gonzaloj

Member
Newcomer
Joined
Feb 19, 2018
Messages
9
Trophies
0
Age
29
XP
54
Country
Spain
Hi! I I send a picture of Pkmn crystal structure todo a cypresssemiconductors worker, he say that a Fram memory FM1808B-SG in theory works with Pokemon crystal And maybe with other mbc3
 
Last edited by gonzaloj,
D

Deleted User

Guest
Hi! I I send a picture of Pkmn crystal structure todo a cypresssemiconductors worker, he say that a Fram memory FM1808B-SG in theory works with Pokemon crystal And maybe with other mbc3
Unfortunately, according to that chip's datasheet, it has the same problem as the FM18W08. "Unlike an SRAM, changing address values will have no effect on the memory operation after the address is latched."
 

wadeVillines

Active Member
Newcomer
Joined
Oct 17, 2017
Messages
30
Trophies
0
Age
31
XP
199
Country
United States
Just a small update: I completed my PCB and have been enjoying playing Pokemon Prism on it. Turns out the OR gate only needs two inputs: Clock and RAM_CS. Every game I've played on it works like a charm. Been playing it on Pokemon Stadium as well. By changing the header file of the ROM to a Pokemon ROM header, any game can be played on Pokemon Stadium's GB Tower (using the Transfer Pak).
 
  • Like
Reactions: JS7777

wadeVillines

Active Member
Newcomer
Joined
Oct 17, 2017
Messages
30
Trophies
0
Age
31
XP
199
Country
United States
Something interesting, however. I made 2 versions of this cartridge: 1 uses 3 inputs for its OR gate (CLK, RAM_CS, CS) and the other uses only 2 (CLK and RAM_CS). Commercial cartridge programmers, such as the one from J. Rodrigo, cannot program my RAM chip if it is using 2-input OR. This made me realize that these programmers don't use the CLK pin for anything at all. So, without the CS pin, the FRAM isn't getting toggled correctly. This can be fixed one of two ways: using the 3-input OR gate, or connecting the CLK pin to the CS pin on the programmer.

Note that this won't matter for MBC5 carts, since they don't use the CLK pin, either. This ONLY applies to MBC3. After this modification to the programmer, it will still work for both types, though.

One MORE thing! I didn't understand why Pokemon Red/Blue used MBC3 if they have no RTC (I thought maybe MBC5 just wasn't developed yet). However, the MBC3 has a clock input pin (system clock, not RTC clock) while the MBC5 does not. I believe this chip was used so these games could be run in double or triple speed mode when playing on Pokemon Stadium, using Doduo and Dodrio mode, respectively. Just an interesting tidbit.
 
Last edited by wadeVillines,
  • Like
Reactions: JS7777
D

Deleted User

Guest
... (I just used some diodes to rig an OR gate) ...
I'm assuming this is with all the cathodes going to the F-RAM, do I need any pullup/pulldown resistor when doing it with diodes? And will this mod still allow the RTC to work correctly (from the battery)?
 

wadeVillines

Active Member
Newcomer
Joined
Oct 17, 2017
Messages
30
Trophies
0
Age
31
XP
199
Country
United States
I'm assuming this is with all the cathodes going to the F-RAM, do I need any pullup/pulldown resistor when doing it with diodes? And will this mod still allow the RTC to work correctly (from the battery)?

Yes, it has been a while since I did this, but I remember using a 10K pulldown resistor between the diode output and ground.
 
D

Deleted User

Guest
Yes, it has been a while since I did this, but I remember using a 10K pulldown resistor between the diode output and ground.
Alright, I'll try that! I just soldered it up without the pulldown and I get dark striped square sprites.
UPDATE: It works perfectly, however... My intention here is to still have a battery, for the clock, and when that runs out I can replace it without worrying about my save. With the 10K pulldown, and a standby output from the diodes of about 2.2v... That's drawing 220μA. Not a lot for a running console, but the battery I'm using (80mAh) will only last about two weeks. And that's before I even consider the F-RAM standby current. Looks like I'm better off getting one of those OR-gates after all :P
 
Last edited by ,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    realtimesave @ realtimesave: I can't figure out how to run a game on mig switch oh well