Been reading up on SNES repos, have I got my facts straight?

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
fireaza
Posts: 35
Joined: Mon Jul 02, 2012 6:04 am

Post by fireaza »

tepples wrote:
fireaza wrote:It still boggles me that putting a second copy of half the ROM, into the ROM and doubling that (ending up with 4 copies of the back half the ROM and 2 of the front in the one ROM) doesn't break the ROM horribly.
It's called "incomplete decoding". As long as a given set of signals on the address bus produce the expected signals on the data bus, the program can't tell the difference. Have you ever heard of an "overdump"?
I have now...? ;) This comes back to the design philosophy of "if it looks good, it is good", having a final product that consists of 4 copies of the back half the ROM and 2 of the front in the one ROM doesn't "look good", but hey, that's why I study design and not programming! ;)

Turning this thread back around again, there's what hopefully should be the last remaining questions that I have (at which point I should be ready to rumble, as well as write my own "idiot's guide" for the forum detailing all that I've learned in simple terminology and steps):

1) eprom brands: important or not? I've got a choice between ST, ATMEL, MXIC and NEC, with NEC being the only familiar brand to me.

2) ROM splitting: it's it a problem that SNES ROM Utility split the ROM in what I would think isn't the ideal place?
qwertymodo
Posts: 775
Joined: Mon Jul 02, 2012 7:46 am

Post by qwertymodo »

fireaza wrote:It works out to be about $6 for both chips, vs $12 for the 29F032 and TSOP adaptor :D With regards to brands, obviously AMD is a good choice for the 27C040. For the 27C801, I've got a choice between ST, ATMEL, MXIC and NEC. NEC is the only brand I recognise there, so them maybe? They're all DIP32 with a speed of 120ns or less, so I'm not sure how much brand matters.
Brand isn't a big deal. I've used Atmel and ST parts before as well, I know Nintendo used NEC parts for various things in their consoles. Also, something to consider is if you only need 4 or 8Mbit, check out the SST39SF040 by Microchip. It's a 5V x8 parallel flash ROM in a 32 DIP or TSOP package that's still in production. It's basically the only one I know of that's still in production, most have gone to 3.3v, and it's even hard to find x8's period (thankfully there are a few selectable x8/x16's like Micron's M28W/M29W line).
qwertymodo
Posts: 775
Joined: Mon Jul 02, 2012 7:46 am

Post by qwertymodo »

As far as doubling up the file to fill the ROM, maybe I can help explain that. Think of the address lines as though they were switches. Take the highest address line and if you turn it on, you are pointing at the "top" half of the ROM and if it's off, you're pointing to the "bottom" half. Now go to the next highest line and if it's on, it points to the top half of the half selected by the highest address line, if it's off, the bottom half. You keep doing that all the way until you've switched all of your address lines the way you want and you've cut it in half enough times that now you're pointing at a single byte. Now, imagine that you're using a 16Mbit game on a 32Mbit ROM. You want the highest address line to always be off because nothing should be in the top half of the ROM. However, depending on how the chip is wired in, that address line might not be pulled to ground. If an input pin is not connected to anything, it is what is called "floating", which means it is susceptible to EM interference in the air and will appear as though you are rapidly flipping the switch on and off and you can't guarantee which it will be at any given moment. So, if you duplicate your ROM so that you have the same data in both the bottom and top half of the chip, it won't matter whether that high address line is on or off, it will read the same data regardless. The other option is to just guarantee that the high address line is always off, which is easy to do (connect the pin to ground), but if you're only putting a single ROM file on the chip anyway, why not fill it just to be safe? It's simple when you have ROMs of powers of two because of the way the address lines "cut it in half" over and over, it's a bit more complex with 12/24/28Mbit ROMs because they aren't powers of two and don't line up with the "halfway mark" so you first have to copy a small part to fill it to that point, then duplicate the entire thing from there. Does that help at all?
fireaza
Posts: 35
Joined: Mon Jul 02, 2012 6:04 am

Post by fireaza »

qwertymodo wrote:
fireaza wrote:It works out to be about $6 for both chips, vs $12 for the 29F032 and TSOP adaptor :D With regards to brands, obviously AMD is a good choice for the 27C040. For the 27C801, I've got a choice between ST, ATMEL, MXIC and NEC. NEC is the only brand I recognise there, so them maybe? They're all DIP32 with a speed of 120ns or less, so I'm not sure how much brand matters.
Brand isn't a big deal. I've used Atmel and ST parts before as well, I know Nintendo used NEC parts for various things in their consoles. Also, something to consider is if you only need 4 or 8Mbit, check out the SST39SF040 by Microchip. It's a 5V x8 parallel flash ROM in a 32 DIP or TSOP package that's still in production. It's basically the only one I know of that's still in production, most have gone to 3.3v, and it's even hard to find x8's period (thankfully there are a few selectable x8/x16's like Micron's M28W/M29W line).
Is THIS the chip you're talking about? I notice it's an eeprom, while the 8 megabit chip I was looking to use is an eprom, it's safe to mix eeproms and eproms right? Also voltage? Does the voltage requirements of eeprom/eproms very?
qwertymodo wrote:As far as doubling up the file to fill the ROM, maybe I can help explain that. Think of the address lines as though they were switches. Take the highest address line and if you turn it on, you are pointing at the "top" half of the ROM and if it's off, you're pointing to the "bottom" half. Now go to the next highest line and if it's on, it points to the top half of the half selected by the highest address line, if it's off, the bottom half. You keep doing that all the way until you've switched all of your address lines the way you want and you've cut it in half enough times that now you're pointing at a single byte. Now, imagine that you're using a 16Mbit game on a 32Mbit ROM. You want the highest address line to always be off because nothing should be in the top half of the ROM. However, depending on how the chip is wired in, that address line might not be pulled to ground. If an input pin is not connected to anything, it is what is called "floating", which means it is susceptible to EM interference in the air and will appear as though you are rapidly flipping the switch on and off and you can't guarantee which it will be at any given moment. So, if you duplicate your ROM so that you have the same data in both the bottom and top half of the chip, it won't matter whether that high address line is on or off, it will read the same data regardless. The other option is to just guarantee that the high address line is always off, which is easy to do (connect the pin to ground), but if you're only putting a single ROM file on the chip anyway, why not fill it just to be safe? It's simple when you have ROMs of powers of two because of the way the address lines "cut it in half" over and over, it's a bit more complex with 12/24/28Mbit ROMs because they aren't powers of two and don't line up with the "halfway mark" so you first have to copy a small part to fill it to that point, then duplicate the entire thing from there. Does that help at all?
That does help, thanks! I feel a more relieved about using a doubled ROM, but burning a eprom that's made up of a ROM consisting of 4 back halves and 2 front halves of a ROM still kinda freaks me out :P I think in this case, I'd definitely go for a 2 eprom configuration, assuming all non-power of 2 games used 2x mask roms :D

Just to to be sure, would altering the ROM trip the copy protection on games that have it? Take EarthBound's sadistic (it erases your saves at the end boss!) protection, at multiple points, the game checks to see if it's been altered, and the copy protection will spring into action if it has. From what you've described, the game should be reading the same data from the ROM as if there were only one copy in the eprom, but I thought I'd check!
qwertymodo
Posts: 775
Joined: Mon Jul 02, 2012 7:46 am

Post by qwertymodo »

fireaza wrote:Is THIS the chip you're talking about? I notice it's an eeprom, while the 8 megabit chip I was looking to use is an eprom, it's safe to mix eeproms and eproms right?
The SST39SF040 isn't an EEPROM, it's a Flash ROM (which, I suppose is technically an EEPROM, but you don't typically call Flash ROMs EEPROMs). Here's the official product page

That does help, thanks! I feel a more relieved about using a doubled ROM, but burning a eprom that's made up of a ROM consisting of 4 back halves and 2 front halves of a ROM still kinda freaks me out :P I think in this case, I'd definitely go for a 2 eprom configuration, assuming all non-power of 2 games used 2x mask roms :D
fireaza wrote:Just to to be sure, would altering the ROM trip the copy protection on games that have it? Take EarthBound's sadistic (it erases your saves at the end boss!) protection, at multiple points, the game checks to see if it's been altered, and the copy protection will spring into action if it has. From what you've described, the game should be reading the same data from the ROM as if there were only one copy in the eprom, but I thought I'd check!
I don't know what kind of copy protection different games have, but IIRC the typical check is for a game designed for 64K SRAM to check if 256K SRAM is present because many copiers contained that much SRAM (in order to support games that used 256K) and if it detects that there is in fact more than 64K, it assumes you are using a copier and that triggers the copy protection. Doubling the ROM will not affect this. The game will have no way of detecting it. It would be the same if you grounded the high address lines or doubled the ROM or whatever. I don't know of any copy protection that could possibly be triggered by a larger ROM as long as the upper address lines are properly dealt with. You technically aren't modifying the ROM as far as the console is concerned (as long as you do it right).
fireaza
Posts: 35
Joined: Mon Jul 02, 2012 6:04 am

Post by fireaza »

qwertymodo wrote:
fireaza wrote:Is THIS the chip you're talking about? I notice it's an eeprom, while the 8 megabit chip I was looking to use is an eprom, it's safe to mix eeproms and eproms right?
The SST39SF040 isn't an EEPROM, it's a Flash ROM (which, I suppose is technically an EEPROM, but you don't typically call Flash ROMs EEPROMs). Here's the official product page
Oh, I thought flash ROMs were eeproms since they're electronically erasable, thanks for the clarification! Either way, is it OK to use a mix of flash ROMs and eproms? And it will require the two crossed wires, just like the 27C801 correct?

And I may have ninja'ed you with that edit I made to the previous post, but what's the deal with voltage on eproms/eeproms? Is this something I should be checking when I'm looking at chips?
qwertymodo wrote:I don't know what kind of copy protection different games have, but IIRC the typical check is for a game designed for 64K SRAM to check if 256K SRAM is present because many copiers contained that much SRAM (in order to support games that used 256K) and if it detects that there is in fact more than 64K, it assumes you are using a copier and that triggers the copy protection. Doubling the ROM will not affect this. The game will have no way of detecting it. It would be the same if you grounded the high address lines or doubled the ROM or whatever. I don't know of any copy protection that could possibly be triggered by a larger ROM as long as the upper address lines are properly dealt with. You technically aren't modifying the ROM as far as the console is concerned (as long as you do it right).
That makes sense, thanks! Upon further reading, the protection I mentioned earlier all ties back to attempting to defeat the code involved in the first layer of copy protection (if there's more SRAM than there should be) if you haven't altered that code (which would be unnecessary if you're using the original SFC version of the game as the donor), then you should be sweet.

*EDIT* On the subject of ROM padding, I've been pointed to THIS PROGRAM. It looks pretty good to me! Thoughts guys?
qwertymodo
Posts: 775
Joined: Mon Jul 02, 2012 7:46 am

Post by qwertymodo »

EEPROMs were around before Flash technology, so Flash ROMs are usually considered a separate technology. EEPROMs run on 5v, where most Flash ROMs run on 3.3v. Converting a 3.3v ROM to work with the SNES (which expects 5v logic) is a real pain. However, there are a few 5v Flash ROMs (the AM29F032 being one of them, the SST39SF040 being another), just most have become obsolete in favor of the 3.3v ones. For the most part, you won't be able to use a 3.3v ROM for the SNES. You also won't be able to use an x16 ROM (so be careful there, I've made that mistake. For instance the vast majority of Microchip's parallel Flash ROM lineup is x16). I'm not sure about mixing Flash and EEPROMs, but I think it should work so long as both ROMs are faster than 120ns (the speeds shouldn't have to match so long as both are fast enough). I managed to pick up a lot of 10 AM29F032's for $40 shipped, so honestly to me it's just easier to use them rather than messing with other ROMs (at least for now... I'm in the process of trying to make a currently in-production 3.3v ROM work so I don't have to keep sourcing obsolete parts, but that's down the road a ways...).

As far as the wiring, be sure to check (and double/triple check!) the datasheets for the relevant pinouts. Just connect the correct signals together and you'll be fine.
fireaza
Posts: 35
Joined: Mon Jul 02, 2012 6:04 am

Post by fireaza »

Thanks for the info!
qwertymodo wrote:You also won't be able to use an x16 ROM (so be careful there, I've made that mistake. For instance the vast majority of Microchip's parallel Flash ROM lineup is x16).
x16? Like, 16 bit or something? That's not a term I'm familiar with (unsurprising, since I've only just recently looked into how to make SNES repros :P)

qwertymodo wrote:As far as the wiring, be sure to check (and double/triple check!) the datasheets for the relevant pinouts. Just connect the correct signals together and you'll be fine.
Does the wiring occasionally change? I was kinda hoping it would always be in this position:
Image
qwertymodo
Posts: 775
Joined: Mon Jul 02, 2012 7:46 am

Post by qwertymodo »

Yes, the wiring is different depending on the chip used. A lot of the chips use standard pinouts, but even then, the "standard" pinout can be different depending on the capacity of the chip (in the case where you have 2 different capacities with the same pin count). Check the datasheets and compare them to the relevant ROM pinout. Any pins that match up can be soldered in straight. Any that don't need to be lifted and rewired to match. Also, any input pins that exist in an EEPROM/Flash ROM but not in a Mask ROM (/WE is the only one I can think of) also need to be lifted and tied either to GND or to VCC (for instance, /WE should go to VCC to disable writing to the ROM once it's been programmed).

Also, be sure whether or not the address and data pin numbers are indexed from 0 or from 1 (basically whether or not there is an A0/D0 pin), and (for single supply voltage diagrams) Vcc=Vdd, Vss=GND
fireaza
Posts: 35
Joined: Mon Jul 02, 2012 6:04 am

Post by fireaza »

qwertymodo wrote:Yes, the wiring is different depending on the chip used. A lot of the chips use standard pinouts, but even then, the "standard" pinout can be different depending on the capacity of the chip (in the case where you have 2 different capacities with the same pin count). Check the datasheets and compare them to the relevant ROM pinout. Any pins that match up can be soldered in straight. Any that don't need to be lifted and rewired to match.
Okay, so let me get this straight. The mask ROMs in a SNES cart are consistent (I could only find two sets of pin outs, one for 32 pin, the other for 36 with the note of "This seems to be consistent with all their mask ROMs" on that site you linked to) however this may differ depending on what eprom/eeprom you choose, in which case, you would need to compare the design? In that case, does the design of a particular eprom (say, a 27C801, which requires the wiring in the above photo) stay consistent, even between brands?

qwertymodo wrote:Also, any input pins that exist in an EEPROM/Flash ROM but not in a Mask ROM (/WE is the only one I can think of) also need to be lifted and tied either to GND or to VCC (for instance, /WE should go to VCC to disable writing to the ROM once it's been programmed).
Okay, so normally both the mask ROM and an eprom would both have data pins, but on the rare occasion, you'll find games that that used mask ROMs that don't have these data pins? In this case, would the mask ROM have less pins?
qwertymodo wrote:Also, be sure whether or not the address and data pin numbers are indexed from 0 or from 1 (basically whether or not there is an A0/D0 pin), and (for single supply voltage diagrams) Vcc=Vdd, Vss=GND
As with the question in my first paragraph, would whether or not a eprom is indexed from 0 or 1 be consistent between different types and brands? If I had an eeprom that I knew was suitable, I could continue buying it without issue?
qwertymodo
Posts: 775
Joined: Mon Jul 02, 2012 7:46 am

Post by qwertymodo »

The Mask ROM is always the same. Take a look at that diagram and you'll see that even between the 32 and 36 pin versions, all of the pins are the same except the extra 4 on the one end (you can even see it marked on 36-pin boards where you could put a 32-pin one in instead if you didn't need a large ROM). As far as indexing from 0 or 1, that is purely in the diagrams and making sure you match up the pins correctly (i.e. if one diagram indexes from 0 and the other from 1, then A0 from the first diagram matches with A1 from the second, and so on. Same for the data pins). The only "extra" pins you might find on an EEPROM that don't exist on the Mask ROM are the /WE (write enable, Mask ROMs were read only, so no need for a write enable pin), and maybe a second CE (chip enable, sometimes they would have a CE and a /CE for extra protection during power-up and power-down). Read the data sheet for the EEPROM/Flash ROM you intend to use, compare it to the pinout for the Mask ROM and just connect the dots. Any pins that are in different places need to be lifted and rewired. If there are extra pins or pins named differently, try to figure out what they're for. Also, be aware that pins marked like /PIN or PIN# (the actual symbol "#", not a number) or have a line over the pin name, indicate that those pins are enabled when the signal is low, so keep that in mind with things like /WE (so you need to connect it to ground when you're programming it, but after it's programmed, connect it to +5v in order to disable writing and set it as read-only).
fireaza
Posts: 35
Joined: Mon Jul 02, 2012 6:04 am

Post by fireaza »

Okay, thanks!

I'd always been curious about that little extra bit where the mask ROMs were soldered in, the markings clearly indicate that it's for a larger mask ROM, but I've never seen on that big being used.
Post Reply