To Byuu, About BSNES (BankSwitching related)

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.
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post by Shiru »

MottZilla wrote:Also, making a SNES multi-cart would probably be pretty easy. It's not like there is alot to it.
Would be interesting to hear how exactly it could be done for stand alone games that weren't initially developed to be in a multicart, use Lo/Hi ROM, and potentially can't be modified by various reasons.
User avatar
Hamtaro126
Posts: 786
Joined: Thu Jan 19, 2006 5:08 pm

Post by Hamtaro126 »

When porting, It's essential to use banks. But for some NES games, It is needed period.

Like I said, The reason Hebereke MMC5 is dropped is because of mapper specific stuff, leading into corruption. Things can't be done without lots of help. a bad mess is in the rom even if I do it from scratch, when I switch banks, It freezes!
AKA SmilyMZX/AtariHacker.
User avatar
MottZilla
Posts: 2835
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

If you mix LoROM and HiROM mapping games on the same cart that complicates the design since now you need to switch alot of signals I believe, or atleast some. It also gets more complex if you need SRAM. But for regular ROM only games, particularly if they are the same size, it's not really any different from say CNROM or AxROM NES mappers. You just make a mapper for the SNES cart. It can and has been done by pirates.
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post by Shiru »

I know that it was done by pirates, that's the reason why I said that having a standart would be nice - what the pirates did is not really reusable or helpful, as it is not emulated, and not even completely reversed. Their solution, however, allowed to mix games of different size and Lo/Hi ROM mappings.
mic_
Posts: 922
Joined: Thu Oct 05, 2006 6:29 am

Post by mic_ »

When porting, It's essential to use banks. But for some NES games, It is needed period.
I don't see how this is the case.
Bankswitching is a means of addressing more data than you can fit in the CPU's address space at any given time, which on the NES is a fairly small amount. On the SNES you can address any byte in the game at any given time, and if you don't want to use absolute long addressing for performance/size concerns you can get away with using absolute addressing a lot of the time if you just organize your code and data properly.

The concept of porting (at least between systems from before the cross-platform API era) is that you should break dependencies to the original target system's hardware and find ways of implementing the same behavior using the new target system's hardware. If that means that you have to completely rewrite some parts of the code and/or reorganize the code and data, then that's what you need to do. Saying that you require NES-style bankswitching on the SNES to be able to port an NES game is a bit like saying that you also require an NES PPU because the attribute table data can't be used by the SNES PPUs.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

mic_ wrote:Bankswitching is a means of addressing more data than you can fit in the CPU's address space at any given time, which on the NES is a fairly small amount. On the SNES you can address any byte in the game at any given time
Most of the time this is true. Exceptions I can think of include the following:
  • Vector pulls (always from $00/FFE0 to $00/FFFF)
  • Direct page in ROM
  • PLA from stack in ROM
I don't know whether or not direct page in ROM or PLA from stack in ROM are used in actual games, but games certainly use vector pulls because they use interrupts. My NES multicart engine runs multiple NROM games by switching the entire $8000-$FFFF bank, which also switches the IRQ and NMI vectors. How should the vectors be switched on a Super NES if I don't know in advance what RAM the games aren't going to be using?
If that means that you have to completely rewrite some parts of the code and/or reorganize the code and data, then that's what you need to do.
I have had someone recently ask me through private messages on this forum how to make a multicart of entries to a Super NES game competition. Reorganizing the code and data isn't possible if the entries aren't distributed as source code, or if the maintainer is too occupied with other projects to do such reorganization.
mic_
Posts: 922
Joined: Thu Oct 05, 2006 6:29 am

Post by mic_ »

Sure, but I was referring to the process of porting an NES game to the SNES, which was mentioned in this thread. A multicart with SNES games is a different matter - if all else failed it could probably be done with some custom hardware (design your own mapper chip).
or if the maintainer is too occupied with other projects to do such reorganization
Then the maintainer should focus on getting those other projects finished and come back to this one when he/she can dedicate the necessary time to it. :P
Post Reply