Page 1 of 3

Size limits

Posted: Sun Jul 15, 2018 3:44 pm
by metalforever
Is it possible using any technique (such as perhaps implementing an SD card inside of a cart) to run a game over 8MB (incl bank switching)? For example, perhaps if a group of people were very clever, we could create a larger game and put it on a cart? Maybe an elaborate bank switching scheme could be used?

Sarah

Re: Size limits

Posted: Sun Jul 15, 2018 4:42 pm
by cero
Yes, the SSF2 mapper lets you go over the 4mb limit, and you could design a custom mapper too. Everdrives and emulators support SSF2, so you can test your game easily.

Re: Size limits

Posted: Sun Jul 15, 2018 7:26 pm
by Chilly Willy
The standard SEGA mapper (often incorrectly called the SSF2 mapper as it was the only game to use it) allows up to 32MBytes of rom via bank switching. Most available flash carts don't go that high. For example, the current Mega Everdrive only allows up to 15MB. If you make the cart yourself and use the standard mapper, you could go to 32MB. If you don't care about standards, you could easily make your own flash cart that allowed GBytes of storage. It would be silly, but quite easy to do.

Re: Size limits

Posted: Sun Jul 15, 2018 9:10 pm
by metalforever
Thank you for the answers. It wasn't clear which kind of restrictions I had to impose on the development of a homebrew game.

Re: Size limits

Posted: Mon Jul 16, 2018 5:43 am
by Sik
For the record, I'm not sure where the 32MB limit comes from (as we don't have any actual official docs from the mapper - what we know is from reverse engineering I think?). But yeah, you can use the mapper to go over 8MB easily if you have a cartridge that actually provides that much memory.

In theory you could also use your own custom mapper too if you're willing to build the cartridge (and cope with the lack of support in emulators).

Re: Size limits

Posted: Mon Jul 16, 2018 7:59 am
by Stef
As far i remember the Sega mapper allow to remap bank of 512 KB with a register of 6 or 7 bit wide (it was in an official doc) so it means 64 or 128 banks of 512KB (so 32 MB or 64 MB at max).

Re: Size limits

Posted: Mon Jul 16, 2018 11:44 am
by Miquel
If you develop your own bank switching there is no limit of size other than what technology provides.

And you can use any type of storage as long as the worst case scenario in read response is smaller than a read cycle on the 68K. In the case of SD+FAT you will need a quite big fpga-like chip, not the best option.

Or another option is to have 2/4MB of RAM and reading consciously from the SD.

Re: Size limits

Posted: Mon Jul 16, 2018 2:40 pm
by Chilly Willy
The mapper is fully documented in the 32X docs in the 32X Development Equipment section. It uses registers from $A130F1 to $A130FF as controls for eight banks of 512KB each. Bank 0 cannot be changed and it's register is a control register for save ram. The other seven use six bits to set the bank selected from the rom (or ram if using the dev cart). Six bits gives 64 banks of 512KB, or 32MB of space. While the mapper handles seven banks, SSF2 only uses banks 6 and 7, so some early flash carts don't support the full mapper spec.

Re: Size limits

Posted: Mon Jul 16, 2018 2:49 pm
by Stef
Ok so it was indeed 6 bit :p

Re: Size limits

Posted: Mon Jul 16, 2018 5:35 pm
by Chilly Willy
Yes, but they show always setting the two upper bits to 0, so they could have thought about expanding it later. That never happened, of course, and roms on the Genesis/32X never reached 32MB, much less bigger. They did reach 64MB on the N64, so if the 32X had been a run-away success ( :lol: ), it might have gotten expanded. Since there's little chance of SEGA going back and releasing something new, you could make your own mapper using all 8 bits for backwards compatibility, but allowing 128MB. What I think would be more interesting would be make the banks 7 bits, and make b7 a ram/rom select line, allowing carts to have both ram and rom that can be bank selected.

Re: Size limits

Posted: Mon Jul 16, 2018 8:45 pm
by Sik
It's possible that particular mapper only had enough pins to map 32MB. And yeah, if I recall correctly there's work to make one that can address up to 128MB (we should call it the GIGA POWER cartridge since it's 1 gigabit :v). And technically nothing prevents you from using the remaining 8 bits from the word (Mega Everdrive uses the upper bits for tagging, so it's doable).
Chilly Willy wrote:
Mon Jul 16, 2018 5:35 pm
What I think would be more interesting would be make the banks 7 bits, and make b7 a ram/rom select line, allowing carts to have both ram and rom that can be bank selected.
Or use bit 15 :​P

Re: Size limits

Posted: Tue Jul 17, 2018 1:53 pm
by Chilly Willy
Yes, I think a full word per bank would be better. They clearly wouldn't have had enough pins or gates for that at the time, but these days, why not? :D

At that point, amount of memory you can address gets silly.

Re: Size limits

Posted: Tue Apr 16, 2019 6:54 am
by mix256
Sik wrote:
Mon Jul 16, 2018 8:45 pm
And yeah, if I recall correctly there's work to make one that can address up to 128MB (we should call it the GIGA POWER cartridge since it's 1 gigabit :v).
I kind of need this, has put myself into a need-loads-of-ROM situation. Who's working on something like this?
I don't want to start on my own impl, it will most likely end up wherever Paprium is. :)

Re: Size limits

Posted: Tue Apr 16, 2019 3:13 pm
by Sik
Eh, it's just 64Mx16 Flash with the Sega mapper with 8-bit to specify the page numbers (enough to address 128MB). Any implementation that conforms to the Sega mapper interface should do (a CPLD should be good enough to implement the mapper). I'd suggest to commission such a board rather than wait on anybody.

Note that such large Flash is only available as 3.3V so remember, level shifters all over :​P Also that SGDK doesn't account for mapper support so far (not even for smaller sizes), which may be a bigger problem.


EDIT: also huh, I should probably mention that 128MB is unlikely to be cheap, so if you go with that then it better be something that's worth the size :​v (alternatively, pick a smaller size and keep the mapper, since filling up 128MB is going to be hard, I already barely manage to fill up 1MB usually)

Re: Size limits

Posted: Tue Apr 16, 2019 3:40 pm
by mix256
Sik wrote:
Tue Apr 16, 2019 3:13 pm
Eh, it's just 64Mx16 Flash with the Sega mapper with 8-bit to specify the page numbers (enough to address 128MB). Any implementation that conforms to the Sega mapper interface should do (a CPLD should be good enough to implement the mapper). I'd suggest to commission such a board rather than wait on anybody.

Note that such large Flash is only available as 3.3V so remember, level shifters all over :​P Also that SGDK doesn't account for mapper support so far (not even for smaller sizes), which may be a bigger problem.


EDIT: also huh, I should probably mention that 128MB is unlikely to be cheap, so if you go with that then it better be something that's worth the size :​v (alternatively, pick a smaller size and keep the mapper, since filling up 128MB is going to be hard, I already barely manage to fill up 1MB usually)
Thanks! I would be mapping in the extra mem at very specific situations, and it would all just be data no code. So I don't think SGDK will need to know about it. Do any emulator support 128MB, though?
Level shifters for all pins, cpld and rom might get too expensive, I guess.