Hey, welcome again!
This time i want to share my Mega Drive flash cart made of old BIOS chips. I made it because my Sonic cart was not working since always. I used Arduino, Python and a bit of Processing (nice to show visual info) to programm. Sorry for the bad pictures and a good reading!
I have my Mega drive since 12, (I have 20 now). One of the games I got with it was ‘Sonic the hedgehog’, but it never worked well, in the begining it bugged only in the ‘Marble Zone’ stage, and then it started to show the messages saying “illegal instruction” after reset. So i never had the chance to play the others stages than the first, but this changed this week…
So, what is the thing with these flash carts? They are flash, don’t they? I have a pile of old tech and scrap here in the house, and these days I discovered these flash memories, they are in a lot of things: DVD players, Printer boards and old computers. The memories I found were EN29F040, 39v040 and others, but only one with parallel interface was the EN29F040.
I already saw people making Game Boy flash carts, they use exactly these kind of memories, but they are smd format. The only one memory I had, was a 8 bit memory, so i needed at leats two of them as the Mega Drive uses a 16 bit data bus.
Thinking, I found out that these memories are used in some really old computers, like the giant bunch of trash we have in university. I was in there and had harvest the most memories I could, that means 6, that was the number of memories that I could find. The memories used in the these motherboards are most 256KB or 2Mbit with 8 bit data bus.
I find the following memories:
2x SST 39s020
Who designed this board maybe never thought i would do this.
Ok. Now I have the memories(flash, not childhood), but they are 8 bit memories, and the Mega Drive is a 16 bit video game, what to do now?The answer is simple: Just use two chips.
I learned that in my microprocessors classes, if you want to make a memory with a 2n bits data bus from two memories with a n data bus, just share the addresses, write, enable, and read lines between the two, simple.
The first thing I did was stack the memories and solder them in the lines we talked before, VCC and VSS, leaving only the data pins unsoldered.
The data pins aren’t soldered.
16 bit memory. Done.
The pinout for the memory i’m using:
Then desolder the faulty chip from the Sonic cartridge. That was simple.
Original and faulty chip removed, I also changed the capacitors.
Someone has already made a pinout of the Sonic chip, what a luck, In this link you can found a lot of info about genesis development.
Knowing this, i rewired every pin on the flash memory to theiir places on the original ROM. It’s not be most beautiful thing you will see today, but gave me expected results.
I used the data pins D7-D0 from one of the memories as D15-D8 on the cart.
The thing was built, but his souls was still BIOS programs, i just needed to put 4194304 new bits on their places.
Connecting the wires.
I had the cart in hands, how to test If it was working at least?
Yeah, I could use a ATmega8 in a protoboard and some 595s to control the eighteen addresses, sixteen data and three control pins. Hey! I could use only NAND gates! Just kidding, I used my Arduino Mega.
Another thing from scrap was the ISA slot that I got from a old motherboard. The ISA slot, its largest sub-slot (that word exists?) actually, has 2×31 pins and the Mega Drive cart slot has 2×32 pins, the good thing is that the last pins are a redundant ground an unconnected pin, so the ISA slot can be used fine.
I used the pins 14-29 to data, 30 -50 to addresses and 51-53 as output enable, chip enable and write enable.
Sorry for the bad photo.
I made the cart in one afternoon, thinking that I could finish the software before the day after, completely wrong, I know nothing…
I used three software pairs:
1 – Test software, the standart Firmata example on the Arduino and an adaptation of one of the Firmata examples in Processing, that let me access every word on the chip and see what was programed in the chip, if the words were equal to the ones on the ROM and test if all the lines were connected right and if they were working.
https://dragaosemchama.com/texto-de-9-meses-de-namoro-para-seu-namorado/This is the begining of the ROM header, 0x5345 can be read. That is Ascii ‘SE’ from ‘SEGA MEGA DRIVE’.
2 – Dumping software, well this was a learning trip, why not use the hardware to read ROMs? This also let me if the ROM image programmed is working. It’s composed by a Arduino code that read the words on the cart and send them as bytes to computer, and a python script to receive the bytes and save them in a file.
3 – Burning software, the burning software is composed by a python script that read a file in the ‘.bin’ format and sends them to the Arduino, and an Arduino code to receive the bytes and put them in their places on the flash.
All the codes used can be found namorada de ludmilla cantora. Please, don’t expect beauty.
To my surprise, the cart works very well, no bugs or “illegal instruction” messages as with the old chip.
Below it is a video of the thing working, I am not really good, but at least I can reach Spring yard stage now without the old bugs.