News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Max Cartridge Size?  (Read 20169 times)

Morinis

  • Hero Member
  • *****
  • Posts: 508
  • Cupcakes and Pizza
    • View Profile
    • My YouTube
Max Cartridge Size?
« on: February 18, 2014, 10:27:24 pm »
Hello again everyone!

My question for today persists about the size of the ROM space of each console relating to the SNES and Genesis.


I know that the max ROM size for the NES is 256k (from what I have read and been told) but I can't seem to find specific details about the max ROM sizes for the SNES and Genesis.  I've read from numerous places from other hacking community websites that people can't decide that it's either 3MB or 4MB for the SNES.  Some people even say it's 5MB but eh...


Now for the Genesis, people also say the same as to the SNES maximum size and again I see people argue over of what size it can get up to.  Now I have read that if you do not have a CD or 32X, one could use that empty space for whatever a person wants to do in those areas though does this contain to EVERY Sega Genesis cartridge or just the 32X and CD mappers in specific?


I've looked through the documents section on here and can't seem to locate any info on what I need unless it's named something else.
ROM Hacker, Reviewer and Critic.

Don't Know What Else To Say So... <3 You!

Bregalad

  • Hero Member
  • *****
  • Posts: 2751
    • View Profile
Re: Max Cartridge Size?
« Reply #1 on: February 19, 2014, 02:03:01 am »
Quote
I know that the max ROM size for the NES is 256k (from what I have read and been told)
Who told you this and where have you read this ? This is wrong.

Psyklax

  • Hero Member
  • *****
  • Posts: 1112
    • View Profile
    • Psyklax Translations
Re: Max Cartridge Size?
« Reply #2 on: February 19, 2014, 03:09:09 am »
Well it certainly isn't 3MB cause there were actual released games that were bigger than that.

And yes, the NES CAN be expanded, though from what I've read it's not that easy.

I could be totally wrong, but IS there a size limit on the SNES? Can't you just keep adding stuff? After all, the console can only access one bank at a time, so you could just have more banks.

Bregalad

  • Hero Member
  • *****
  • Posts: 2751
    • View Profile
Re: Max Cartridge Size?
« Reply #3 on: February 19, 2014, 03:51:15 am »
Quote
I could be totally wrong, but IS there a size limit on the SNES?
No. All cartridge-based consoles have virtually no size limit, as by adding more hardware you could always trick the console into accessing larger ROMs (using bankswitching, virtual adresses or whathever).

If an adapter (FDS-like) was made, it would be possible to access a 25GB blu-ray with the NES.

There is still a size limit for a given hardware configuration though.

puzzledude

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
Re: Max Cartridge Size?
« Reply #4 on: February 19, 2014, 07:31:51 am »
Quote
I've read from numerous places from other hacking community websites that people can't decide that it's either 3MB or 4MB for the SNES.  Some people even say it's 5MB but eh...
Depends how you look upon things. The standard space for a SNES cart (that were produced in the largest numbers) was always under or equal to 4MB. Thus this size is highly adoptable and generally accepted maximum, which will work anywhere. BUT later special chips were made to be able to run 6MB and 8MB carts.

Today some SNES games/hacks have 12MB and could also go up to 16MB, using bank switchers etc.

16MB should be the upmost reasonable maximum, while the 4MB is the "standard" size, which is highly compatible to all devices, which run SNES games (emulators, copiers, real hardware etc).

But in theory, you could just expand this further. But the more you expand, the less it is compatible. So in theory it can just go into the GB.

From the SNES-emulator point of view, all of them will generally support only up to 4MB, as the original SNES used to, when it was first designed. Some Fusoya's emus support up to 8MB.


I recommend to you, that you don't build a SNES game over 4MB, since this is the most standard and highly compatible max-size.


Quote
I've read from numerous places from other hacking community websites that people can't decide that it's either 3MB or 4MB for the SNES.  Some people even say it's 5MB but eh...
PS, I've personally made a test SNES file of 8MB (ExLoRom format) and repointed the data into the last bank, just to see, if the data is actually working; and it did.
But I can agree, that this is a non standard way of doing things. The 3MB is of course a false maximum.
PPS Super Demo Worlds, The legend continues (SMW hack) is 6MB in size. Of course with such sizes we are dealing with a different kind of formatting and main data allocation.

FAST6191

  • Hero Member
  • *****
  • Posts: 3089
    • View Profile
Re: Max Cartridge Size?
« Reply #5 on: February 19, 2014, 07:42:16 am »
As others have said it is not a terribly useful question and will need to be qualified a lot. You also have the ROM hacking vs homebrew made from scratch concept. Theoretically I guess you could also have something with emulators in there at some level, I would struggle to find something like this for the SNES though; typically you are looking at things like N64 hi res textures, though the related concept of externally loaded palettes might apply here.

What was the largest commercial cart seen? That can be answered. However flash carts for each of the consoles will tend to exceed this.

What is the largest raw value without mappers, pages, bankswitching, memory bank controllers (GB/GBC) and similar tricks. Typically this is the address window for cart reads though it can be smaller. In the case of the megadrive/genesis most games stuck with the raw read value, some later games did have bankswitching though.

What is the largest value I can easily expand a ROM to and how would I set about it? This can also be answered though that is where homebrew vs hacking comes back in. Games are not terribly predictable programs and can read and write to arbitrary locations at arbitrary points in time. This is why mapper changes are considered one of the hardest hacks to do on the NES, made doubly so by games often doing (or, worse, having the potential to do it) odd pointer maths and related things (you can not just disassemble and search for all reads to a location as the game could add a value to a smaller value and use that as a the basis for a read, this means hunting down those edge cases or doing something and hoping it works which clashes with the aspirations towards perfection that hackers tend to need to succeed in this).

What is the largest value that can easily be made in a cart? As others have said give it enough logic and you could read exabytes on a NES. However more reasonably the things are the sum of the address window (whether mapped to the main memory bus or not) and basic onboard IO to speak to the carts. If you have a 256 kilobyte window split in two for mappers you then have 128 bytes plus 128 multiplied by the number stored in the mapper register or sent via the change mapper command (say 4 bits or 16 combinations giving you 2176 kilobytes, assuming every combination was given to storage and not say the result of some on cart logic to increase the base processing power of a console).
You could stick some crazy logic onboard the cart that says if you write this value 4 times then do some maths on the following command, indeed the electronics to do it is possibly quite basic if you left it as something like a shift register. A related concept can be seen in the 360 DVD emulators that present a series of pictures which the 360's picture viewer can read, as the emulator controls the USB it reads from it knows what is read and thus can present the relevant game. There was also a SNES video reader/playback device I saw a video of once, I imagine it did something like this.

There is also the concept of sector addressing. See anything that covers optical media for more on this, the concept is not terribly difficult though (where you might have a 1:1 relationship between bytes of data and the read here you do not and instead it will resemble something like banks).

The short version. summary
For the system you are looking at look up the specs.

The address window for the cart is your baseline unless those same specs say it is less; owing to the way binary numbers work a CD might have a sector read system capable of gigabytes but even with overburn and disabling error protection you are not going to be able to go above 850 megs or so on the physical disc. This might not be a limitation though as anybody that burned GC games (just over a gig) for the Wii (full DVD size, though in practice I think most stuck to single layer) will tell you.

For the methods of expansion most consoles are reasonably well known. The NES mappers and SNES special chips are very well documented for example, the GB/GBC memory bank controllers (MBCs) are covered nicely enough in http://nocash.emubase.de/pandocs.htm#memorybankcontrollers , seen as there are relatively few games compared to the PC and consoles the MAME/MESS lot have a lot of the more niche arcade stuff covered quite nicely, https://wiki.neogeodev.org/index.php?title=Category:Cartridge_systems has nice stuff for the neogeo, the megadrive/genesis stuff is a bit disparate when it comes to the various things used in practice but Toy Story, probably one of the more noted cases of megadrive bankswitching, has been dissected quite well by a few people. GBA homebrew (see pogoshell) and flash carts/clone multigames did exceed the 32 megabyte window, they used a cart specific page/remap and reset system, but other than an as yet undumped game (Shrek Video I believe) nothing went beyond that 32, code via the link port aka multiboot is also possible though it needs to fit in memory. The DS has a 32 bit read command, though things like the pokewalker were seen to use the "save" bus' SPI to read in data, DS homebrew has DLDI, network loaded code (download play) is common (though it has to be all in RAM) and the DS also has the 32 megs of GBA cart mapped in (read/write) memory as well.

If you are doing homebrew then the same expansion methods will probably give you the best way to set about making something. If not then you get to hardcode your assembler/compiler to deal with banks* and figure out a way to get some signal out to the cart/read controller to present a different location to the onboard reading.

*for the vast majority of things it makes sense to have one static window containing at least the main loop or an idle loop and one or more windows that can vary. This is not mandatory by any means though, you could even stick a copy of the main/idle loop in each bank and have the game never know any better (Final Fantasy 7 on the PS1 basically did this and the whole game is on each disc with only cutscenes differing). You could make a game use bounds checking to make sure it is reading from the appropriate bank/window/page, such checks naturally did not exist in normal ROMs (why NES mapper changes are hard) and would be a serious drain on CPU cycles if you tried it. The alternative of forcing a read to a hacked bank and then immediately reverting is less resource intensive but you are still at the mercy of interrupts, though that is probably more easily dealt with than hunting down every edge case in a ROM.

If you wanted to get fancy there are also things like serial ports, networking (various console hacks used this) and more for many consoles you could use to slide a bit more code in somewhere.

It appears I am in danger of waffling so I will stop here for the time being.

Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3532
    • View Profile
    • Aeon Genesis
Re: Max Cartridge Size?
« Reply #6 on: February 19, 2014, 11:46:04 am »
I recommend to you, that you don't build a SNES game over 4MB, since this is the most standard and highly compatible max-size.

This. There are released games that are larger (most notably, Tales of Phantasia and Star Ocean are 48mbits apiece, iirc) and there's an SDD1 removal hack for Star Ocean that expands the game to 96mbit (12MB) so it can be played on some flashcarts, but for compatibility, especially for compatibility with older backup units, 4MB/32mbit should be your upper cap.

But in theory, you could just expand this further. But the more you expand, the less it is compatible. So in theory it can just go into the GB.

This, however, is incorrect. At this point you're talking about grafting extra mapping controllers onto an SNES cartridge or adding extra hardware into the SNES itself, at which point the game is no longer really an SNES game. Maybe if the SNES CD add-on had actually been released, it it wasn't. The SNES can at the very most address 16MB of space, and a bunch of that is reserved for various purposes (RAM, registers, etc) so iirc the actual upper limit of useable space is somewhere around 15.2MB.

tryphon

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Max Cartridge Size?
« Reply #7 on: February 19, 2014, 11:50:13 am »

Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3532
    • View Profile
    • Aeon Genesis
Re: Max Cartridge Size?
« Reply #8 on: February 19, 2014, 11:54:13 am »
:P

There's an Ignore Users function in your profile, you know! It makes these things easier.

tryphon

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Max Cartridge Size?
« Reply #9 on: February 19, 2014, 12:04:14 pm »
But actually, I found this really funny (and I think it was intented to be) :) I didn't read the full text though, I just can't.

Nobody answered for Genesis by the way. To my knowledge, the biggest ROM ever was Pier solar (8 MB)

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7088
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Max Cartridge Size?
« Reply #10 on: February 19, 2014, 12:24:51 pm »
The "standard" limit on Genesis games is 4MB (though I know SSF2 was the largest licensed game at 5MB. While I haven't found any docs on it, I'm assuming the extra ROM was mapped in some expansion area.)
Though I looked at it doesn't seem like there's more than maybe 20 or so official Genesis games to even use more than 2MB (aside from 32X, where most of them seem to be in the 2-4MB range).
Was ROM that expensive that above that size, developers preferred the Sega CD or what?
"My watch says 30 chickens" Google, 2018

Morinis

  • Hero Member
  • *****
  • Posts: 508
  • Cupcakes and Pizza
    • View Profile
    • My YouTube
Re: Max Cartridge Size?
« Reply #11 on: February 19, 2014, 12:48:38 pm »
Who told you this and where have you read this ? This is wrong.

It was either on here from my earlier posts from joining this website or another place (can't quite remember where now) that I was told virtual ROM's of the NES can only go up to 256K and that's it.  A few of my projects for the NES I wanted to go over the suppose 'limit' in which I wanted them to be virtual releases only and not to be ported onto an actual cartridge as I'm not looking for any money profit out of any of my ROM hacks even if they turn out to be an accidental type of homebrew ROM.

Seeing a lot of different responses about this bank switching, how far can a person 'stretch' this without breaking the emulator itself?  I know some people hate the fact of certain ROM games to be emulator specific but some of my hacking projects I'd like to have them stick only to FCEUX along with whatever newer additions the FCEUX Team brings out for the said emulator/utility tool.


For the other ROM's that are expanded well beyond their limits, I don't know of any nor don't know on where to begin to look for whatever said expanded ROM on the SNES.  Got any examples to link to me so I can check them out?



For the Genesis, I became puzzled from some sort of...Sonic hack where a person(s) ported and expanded a Sonic Heroes version hack for the Genesis based with the Sonic 3 & Knuckles for it's main formula while expanding over all other main Sonic Genesis games 1-3 & Knuckles.  It's been a couple of years since I last saw the video so not sure if it's entirely accurate if the person did use the Sonic 3 & Knuckles concept.  I'll need to look it up later tonight.
ROM Hacker, Reviewer and Critic.

Don't Know What Else To Say So... <3 You!

Pennywise

  • Hero Member
  • *****
  • Posts: 2357
  • I'm curious
    • View Profile
    • Yojimbo's Translations
Re: Max Cartridge Size?
« Reply #12 on: February 19, 2014, 01:27:06 pm »
The NES has these things called mappers which are basically a term for the various kinds of physical boards all those old carts use. That's where these limitations. Let's say you make your game that's only played on emulators based on size, but someone can make their own board to play it on the NES.

FAST6191

  • Hero Member
  • *****
  • Posts: 3089
    • View Profile
Re: Max Cartridge Size?
« Reply #13 on: February 19, 2014, 01:36:22 pm »
It was either on here from my earlier posts from joining this website or another place (can't quite remember where now) that I was told virtual ROM's of the NES can only go up to 256K and that's it.  A few of my projects for the NES I wanted to go over the suppose 'limit' in which I wanted them to be virtual releases only and not to be ported onto an actual cartridge as I'm not looking for any money profit out of any of my ROM hacks even if they turn out to be an accidental type of homebrew ROM.

Seeing a lot of different responses about this bank switching, how far can a person 'stretch' this without breaking the emulator itself?  I know some people hate the fact of certain ROM games to be emulator specific but some of my hacking projects I'd like to have them stick only to FCEUX along with whatever newer additions the FCEUX Team brings out for the said emulator/utility tool.


For the other ROM's that are expanded well beyond their limits, I don't know of any nor don't know on where to begin to look for whatever said expanded ROM on the SNES.  Got any examples to link to me so I can check them out?



For the Genesis, I became puzzled from some sort of...Sonic hack where a person(s) ported and expanded a Sonic Heroes version hack for the Genesis based with the Sonic 3 & Knuckles for it's main formula while expanding over all other main Sonic Genesis games 1-3 & Knuckles.  It's been a couple of years since I last saw the video so not sure if it's entirely accurate if the person did use the Sonic 3 & Knuckles concept.  I'll need to look it up later tonight.

Even with a magic/hacked emulator designed to handle a never before seen ROM image (most are open source so you can go for it) you still have the interrupt and read issues. The idea is the game can all of a sudden decide to read a given location, if it is not what the game expects you typically get corruption, crashes and the like. You can take a game, get it to send a command that swaps a bank/page/whatever and have the emulator/ROM react accordingly. Such a thing is a basic assembly hack (it typically involves writing a value to some point in memory). The trouble is the game might then decide to stop everything else and try to load something, load a new music track or whatever, such a thing is common enough in games to the point where you have methods in the systems themselves (they are what interrupts are). There are also additional problems, not insurmountable mind you even if they are very annoying, like pointer maths.

Emulator only hacks tend to refer more to some things that were common in earlier SNES hacks where emulators might not emulate restrictions, half remembering the main one explained to me it went something like people would push old graphics data into a kind of stack and do it again and again. On a real SNES/accurate emulator this crashes/overwrites old data/fails but the older SNES emulators would instead just allocate more and more memory on PC. Granted you also have things like N64 texture replacement that are emulator only and for "good" reasons.

Bank switching. It is the generic name for the technique where a cartridge will present a different section of memory to a device, said switching being controllable from the device but not necessarily safe as far as being able to pick any point and run with it. NES mappers and SNES special chips take this a step further in some cases and instead of just having memory they might have an extra CPU which can do all sorts of fancy thing (typically audio and fancy maths useful for 3d and other things floating point gets used to sort today). This is why emulators (and some flash carts) have to be coded to handle this vs simpler consoles (like the GBA for instance) upon which the cart is typically just memory (except when it is not and adds tilt sensors, clocks, rumble and more besides). The simple answer would be you can push it to whatever mappers the emulator supports (most do not support all of them if you expand all to include the Hong Kong knockoffs and beyond).

You might be able to write a lua script that can do additional operations outside the realms of the emulator -- you set a watch on the ROM's music location and then when it loads you have the script disable the relevant audio channels and load a wave file or something.

Morinis

  • Hero Member
  • *****
  • Posts: 508
  • Cupcakes and Pizza
    • View Profile
    • My YouTube
Re: Max Cartridge Size?
« Reply #14 on: February 19, 2014, 01:43:53 pm »
Quote
Even with a magic/hacked emulator designed to handle a never before seen ROM image (most are open source so you can go for it) you still have the interrupt and read issues. The idea is the game can all of a sudden decide to read a given location, if it is not what the game expects you typically get corruption, crashes and the like. You can take a game, get it to send a command that swaps a bank/page/whatever and have the emulator/ROM react accordingly. Such a thing is a basic assembly hack (it typically involves writing a value to some point in memory). The trouble is the game might then decide to stop everything else and try to load something, load a new music track or whatever, such a thing is common enough in games to the point where you have methods in the systems themselves (they are what interrupts are). There are also additional problems, not insurmountable mind you even if they are very annoying, like pointer maths.

Ah okay then!
« Last Edit: February 19, 2014, 08:10:41 pm by Craftvania »
ROM Hacker, Reviewer and Critic.

Don't Know What Else To Say So... <3 You!

Jorpho

  • Hero Member
  • *****
  • Posts: 4762
  • The cat screams with the voice of a man.
    • View Profile
Re: Max Cartridge Size?
« Reply #15 on: February 19, 2014, 08:55:38 pm »
For the Genesis, I became puzzled from some sort of...Sonic hack where a person(s) ported and expanded a Sonic Heroes version hack for the Genesis based with the Sonic 3 & Knuckles for it's main formula while expanding over all other main Sonic Genesis games 1-3 & Knuckles.  It's been a couple of years since I last saw the video so not sure if it's entirely accurate if the person did use the Sonic 3 & Knuckles concept.  I'll need to look it up later tonight.
I think you're referring to Sonic Classic Heroes, which covered Sonic 1 and 2.
http://info.sonicretro.org/Sonic_Classic_Heroes
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Zoinkity

  • Hero Member
  • *****
  • Posts: 565
    • View Profile
Re: Max Cartridge Size?
« Reply #16 on: February 20, 2014, 08:05:21 am »
For what it's worth, BSNES does have the capacity for you to provide a hardware definition file for special cases like this.  Of course, you have to have some idea how to write one, but it is technically extensible.  Unless I'm really confused, that's how they were handling the 8Mb games before everyone else in the first place.

FinS

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • nothing much
Re: Max Cartridge Size?
« Reply #17 on: February 20, 2014, 11:58:52 am »
According to anomie's doc, the snes can address up to 0xbe0000 bytes of cart space exclusive of the mad-1.

What would be the result of bypassing the cart mapper? I would assume the snes would still access the cartridge, but would it fail to map out anything properly?

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7088
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Max Cartridge Size?
« Reply #18 on: February 21, 2014, 08:47:43 pm »
The simplest SNES PCBs lack mappers (SHVC-1A0N-xx). Just a single ROM chip and a CIC.
"My watch says 30 chickens" Google, 2018

Morinis

  • Hero Member
  • *****
  • Posts: 508
  • Cupcakes and Pizza
    • View Profile
    • My YouTube
Re: Max Cartridge Size?
« Reply #19 on: February 22, 2014, 03:16:42 pm »
I think you're referring to Sonic Classic Heroes, which covered Sonic 1 and 2.
http://info.sonicretro.org/Sonic_Classic_Heroes

Yes, that's it lol.  It's been some time since I last looked at it and wasn't aware that it was specifically only on 1 and 2.



So understanding that things CAN be expanded on virtual ROM's that have to rely on it's proper assembly coding, does the data have to be compiled in the same manner in order for it to work?  For example of what I mean is of how Konami compiled their Castlevania NES games and how Capcom compiled their Mega Man NES games in different programming formats.  If one were to expand say like Mega Man I, does the expanded banked data have to be compiled and split up like the data of the ROM you are working on or can it be compiled into a forward and strait manner?  Kinda like adding new, clean understandable and easy to follow assembly language onto the pre-existing, split up data.

I'm not sure if that's a clear example but hopefully someone understands on what I mean.
ROM Hacker, Reviewer and Critic.

Don't Know What Else To Say So... <3 You!