Can anyone...

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Can anyone...

Post by TmEE co.(TM) » Sat Mar 17, 2007 2:19 pm

This is directly not related to programming but is there anyone who can make a schematic of circuitry of original Sonic3 cartridge, so I can implement an SRAM accessing method on my cart which works on emulators too not just real hardware ?
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

ElBarto
Very interested
Posts: 160
Joined: Wed Dec 13, 2006 10:29 am
Contact:

Post by ElBarto » Sat Mar 17, 2007 8:39 pm

If you want I can scan you the PCB.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sat Mar 17, 2007 9:47 pm

That would help a little. If scanners could see through chips...
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Fonzie
Genny lover
Posts: 323
Joined: Tue Aug 29, 2006 11:17 am
Contact:

Post by Fonzie » Sun Mar 18, 2007 12:14 am

Sonic3 uses FRAM technology.. At least, the version i have.. So it wouldn't be any help.

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Sun Mar 18, 2007 4:02 pm

How big is the ROM on your cart? if it's 2MB (16Mbit) or less you can just map your SRAM to odd addresses starting at 0x200001 and set up your ROM header appropriately. I know of at least one game that's set up like this (Virtual Pinball or something like that) and I seem to recall that the SRAM saving works in even older emulators.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sun Mar 18, 2007 6:23 pm

I have no idea how big my game will end up, probably 4MB so I need some effective bank switching system. Be it FRAM or anything else, I just need to know how they enable RAM with 1 pulse and disable it with other. Like you need to write to a reg in MD if you want to SRAM accessible on emulators.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

8bitwizard
Very interested
Posts: 159
Joined: Sat Feb 24, 2007 11:35 pm
Location: San Antonio, TX

Post by 8bitwizard » Sun Mar 18, 2007 7:34 pm

You might also try taking apart EA carts. I know they have some with RAM that use TTL chips for address decode. I've been mostly focusing on EEPROM support, though, since they're only 8 pins and need no battery and no battery control chip.

The ones I've looked at so far are:

* Acclaim 670127 with EEPROM - uses a custom mapper chip which may be a PAL of some sort. Interesting only for seeing which signals it uses (A20, A21, /OE, /CE_L, /AS, D0, /RES, /WR_L, /WR_H, and outputs for ROM /OE, SDA, and SCL)... and as a potential source of cheap chips. (Frank Thomas Big Hurt Baseball uses a 24C65, for a whopping 8K of storage) Apparently it uses different address ranges to drive the SCL/SDA outputs, and D0 when reading SDA from the I2C bus.

* Acclaim 670116 - this one is only interesting because it uses two 32-pin ROMs. I found one in a WWF Royal Rumble cart and have already converted it to a socketed proto cart. I've looked but haven't found any more yet.

* EA P100004 with EEPROM, using only TTL chips - uses A20, A21, /OE, /CE_L, D6, D7, /WR_L, /RES, and controlling /CE on the ROM. Apparently divides the address space in half, with 2MB ROM, I2C bus at any odd address in the third meg, and nothing in the fourth meg.

Better decoding on the EA board could give more room for ROM, and if /TIME works anything like I've heard (a chip select for A130xx), there should be no need to take even one byte out of ROM for game saves.

I'm currently trying to use the EA P100004 as a basis for my own design. For my second run of proto cartridge boards, I'm adding space for an EEPROM and a GAL 16V8 with A18-A21 and even /TIME going to it so I can experiment with it to see how it works. I'm thinking it may be possible to use /TIME to talk to the EEPROM at A13000 and still allow for a full 4MB ROM. (I've also got a solder jumper bypass for ROM /CE when the GAL isn't installed.) I'm sending it out to be made sometime this week. Also, my board will have holes for both Sega and EA cartridge shells, though I don't plan to use EA shells much except maybe to cut up for socket carts.

Of course my board won't take 4MB of ROM, since I'm using two 32-pin chips (a pair of 27040 makes only 1 megabyte), but it's still good to have a plan for full 4MB plus game saves. It might even be possible to use the /TIME port as a bank select latch too.

Seriously, you should consider using an I2C serial EEPROM for game saves, if only because it's smaller and doesn't need a battery. It should be doable with a cheap and common 20-pin GAL 16V8 for decode. That's a similar number of pins as an SRAM chip including the address decode! You can also pick and choose what size you want from 128 bytes up to at least 16K. If you leave the proper pads on your board, you can even salvage the chips from old DIMM memory sticks.

When I get a board working right, I'll post a Cadsoft Eagle file for it, since that's much less trouble than shipping boards halfway around the world twice.


So now that I've mentioned it, do any of you have good information on the /TIME (B31) signal? The only boards I've found so far that use it are: Sonic & Knuckles, 171-6583B (PS-IV, Beyond Oasis), and 171-6572B (World Series Baseball 95/96/98). They all have surface-mount chips, making it that much harder to figure them out. And I don't have a Sonic 3 yet, so I can't take a picture of that.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Mon Mar 19, 2007 12:23 pm

!TIME signal is pulsed if you write to $A130F1. I myself was thinking of using an EEPROM, but I'm unable to figure out a circuit that sits between the MD and EEPROM, I can't do any tests with EEPROM chips because I managed to put VPP on my EPROM adapter into wrong place and I fried my equipment partly (totally unusable) :cry:

My current cart uses 2x 2MB Flashes, 2nd one for my game will still use 2x 2MB Flashes, but some SRAM too, or EEPROM.

I don't want to use EEPROM, because emulators don't support it wery well yet.

If I am going to use EEPROMs, I have choice between 24Cxx and 93Cxx types.

8bitWizard, have you checked the pics of my SRAM cart (available at my site's MD section) ? PCB used there is the maximum that fits into the shell.

PS: I have no original cartridges, these were never sold in Estonia
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Mon Mar 19, 2007 1:13 pm

I'm pretty sure !TIME is pulsed for any access to $A13XXX (or maybe just $A130XX). Anyway, I believe that the mapper used in SFS II The New Challengers is more or less the official mapper. Although it's the only officially licensed game that's greater than 32MBit, several other games appear to use the same mapper to handle mapping SRAM in an out of the ROM area. A description of how the mapper works can be found here: http://web.archive.org/web/200304070701 ... s/ssf2.txt
as Bart's site seems to be down at the moment.

Since you only need SRAM mapping and not ROM bankswitching, it should be fairly simple to implement. You just need to latch D0 on the !TIME signal. If the latched value is 0, the whole 4MB is ROM, but if it's 1 you map $200000 and up to the SRAM.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Mar 19, 2007 3:10 pm

Mask of Destiny wrote:I'm pretty sure !TIME is pulsed for any access to $A13XXX (or maybe just $A130XX). Anyway, I believe that the mapper used in SFS II The New Challengers is more or less the official mapper. Although it's the only officially licensed game that's greater than 32MBit, several other games appear to use the same mapper to handle mapping SRAM in an out of the ROM area. A description of how the mapper works can be found here: http://web.archive.org/web/200304070701 ... s/ssf2.txt
as Bart's site seems to be down at the moment.

Since you only need SRAM mapping and not ROM bankswitching, it should be fairly simple to implement. You just need to latch D0 on the !TIME signal. If the latched value is 0, the whole 4MB is ROM, but if it's 1 you map $200000 and up to the SRAM.
And it's what emulators expect as it's the "official" SRAM implementation ;)

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Tue Mar 20, 2007 10:26 am

That's what I'm looking for !!! Thanks guys !!! :D :D :D

Now I need to figure out the logic, shouldn't be very hard. First idea is to use 74AC374 for banking (the chip that fried in my equipment :wink: ) and 74AC00 or 74AC139 for address decoding. AC maybe HC too. I don't know if TTL chips work correctly, don't care, CMOS parts are cheaper :wink:
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Tue Mar 20, 2007 1:06 pm

My cartridge would be something like this:
Image
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Tue Mar 20, 2007 4:05 pm

That looks more or less correct to me. I think you need to pay attention to the cartridge port's !CE line though so you only get mapped to the 0x0 to 0x3FFFFF range (or 0x400000 to 0x7FFFFF if !CART_IN is left to float), but I'm not sure as it's been a while since I last read up on the cartridge signal descriptions. I think if you tie it to the !E signal on your 74AC139 to cartridge port !CE you should be all set.

Not sure which logic family is the safest bet for Genesis/Megadrive compatability. I'm pretty sure at least some of them used the high speed CMOS version of the 68K (M68HC000), but it's possible some of the early ones used the TTL part. Might be safer to go with the HCT family (high speed CMOS with TTL compatible inputs). Not really sure though (I never was any good with the electrical part of logic design).

ob1
Very interested
Posts: 463
Joined: Wed Dec 06, 2006 9:01 am
Location: Aix-en-Provence, France

Post by ob1 » Tue Mar 20, 2007 4:34 pm

anyway, wow !!! Looks impressive !!!

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed Mar 21, 2007 12:06 pm

74AC374 is little too much, 74AC74 is better choice. My testing aggregate:
Image
Official carts use CMOS parts, why shouldn't I ? HC/CHT/AC/ACT will all work, I prefer AC because it is very fast. Also when I OC my MD2, faster parts help remove instability.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Post Reply