It is currently Mon Oct 23, 2017 12:16 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: GBA Flash carts
PostPosted: Thu Jul 25, 2013 9:24 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10067
Location: Rio de Janeiro - Brazil
I recently bought a SuperCard MiniSD for use with my GBA systems (I got an EZ-Flash 3in1 for my DS) and was a bit disappointed with the fact that I have to patch ROMs in order for them to work on that device (IIRC, the EZ-Flash doesn't need any patching - I haven't used it in a while). Being used to high quality products like bunnyboy's PowerPaks or Krikzz's Everdrives, which keep things as authentic as possible, this bothers me a lot.

My goal is not just to "play games on the go", if it was I'd be satisfied with the GBA emulator in my Android phone, which runs perfectly fine. I want things to remain authentic, specially if I decide to run homebrew software on my Flash carts, so I was wondering if anyone here knows what kind of modifications the SuperCard or similar products make to the ROMs, and how they affect the software. Can they break the ROMs in any way? Introduce glitches not present in the original ROMs? Thanks.


Top
 Profile  
 
 Post subject: Re: GBA Flash carts
PostPosted: Thu Jul 25, 2013 2:01 pm 
Offline

Joined: Thu Oct 05, 2006 6:29 am
Posts: 911
I own a SuperCard CF version, and haven't noticed any issues. IIRC, the patching is done at least in part to allow things like realtime saving, which I assume that it does by installing its own interrupt handler that does whatever it needs to do and then calls the original handler. Last time I used the PC tool, I think it would look up the ROMs in some kind of database to know how to patch the them. If no match was found - e.g. if I added my own techdemos - it would say something like "Patching failed" and supposedly not modify the ROM.


Top
 Profile  
 
 Post subject: Re: GBA Flash carts
PostPosted: Thu Jul 25, 2013 2:52 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19120
Location: NE Indiana, USA (NTSC)
The GBA has its own counterpart to Super NES fast and slow ROM, the WAITCNT register. The system boots in slow ROM mode; most games switch to fast ROM early on. (There's also a super-fast mode that some advanced flash adapters support to diminish slowdown in some games; my memtestARM app for DS tests stability in this mode.) But the SuperCard's RAM controller isn't fast enough for fast ROM. Patching does four things: it disables fast ROM, it enables instruction prefetch (which sort of makes up for it), it mapper-hacks the save code to use SRAM instead of Bandai-style EEPROM or parallel flash, and it adds a keypress code to return to the adapter's menu (like a PowerPak long reset, except the GBA has no reset button). Most homebrew games and multiboot games will run fine without patching because they don't enable fast ROM and if they do save, it's to SRAM.


Top
 Profile  
 
 Post subject: Re: GBA Flash carts
PostPosted: Thu Jul 25, 2013 3:50 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10067
Location: Rio de Janeiro - Brazil
mic_ wrote:
I own a SuperCard CF version, and haven't noticed any issues.

There was a game I tried (Altered Beast, I think) with different patching options, and at least once the game booted up with corrupt graphics. I can't remember if it always booted up that way though.

Quote:
IIRC, the patching is done at least in part to allow things like realtime saving, which I assume that it does by installing its own interrupt handler that does whatever it needs to do and then calls the original handler.

I tried disabling everything, but the ROMs were still modified in some way, because they don't work without going through the patching tool first. What I'm trying to find out is what the minimum required patching does, and how it can affect the game.

Quote:
If no match was found - e.g. if I added my own techdemos - it would say something like "Patching failed" and supposedly not modify the ROM.

Have you tried copying the ROM directly? It doesn't work, does it?

tepples wrote:
But the SuperCard's RAM controller isn't fast enough for fast ROM. Patching does four things: it disables fast ROM, it enables instruction prefetch (which sort of makes up for it)

Sounds bad... I mean, even if GBA games don't make use of timed code like NES games do, messing up the timings doesn't sound exactly harmless.

Quote:
it mapper-hacks the save code to use SRAM instead of Bandai-style EEPROM or parallel flash

How does it know what kind of save each game uses? Database? Does it leave games that already use SRAM alone?

Quote:
and it adds a keypress code to return to the adapter's menu (like a PowerPak long reset, except the GBA has no reset button).

I have nothing against powering off and back on, I can totally live without this feature if that means screwing less with the games.

Quote:
Most homebrew games and multiboot games will run fine without patching because they don't enable fast ROM and if they do save, it's to SRAM.

I see... So, if someday I decide to program my own GBA software it should run unmodified as long as I don't use fast ROM or saving methods other than SRAM.


Top
 Profile  
 
 Post subject: Re: GBA Flash carts
PostPosted: Thu Jul 25, 2013 5:38 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19120
Location: NE Indiana, USA (NTSC)
tokumaru wrote:
Have you tried copying the ROM directly? It doesn't work, does it?

Everything seen on my GBA homebrew page will probably work unmodified.

Quote:
even if GBA games don't make use of timed code like NES games do, messing up the timings doesn't sound exactly harmless.

GBA games are written mostly in C, and they should be somewhat resilient to what amount to CPU speed changes.

Quote:
How does it know what kind of save each game uses?

When I was in the GBA scene, it depended on identifier strings compiled into the official flash and EEPROM save libraries. I don't know whether it has since become more database driven. It might use the SRAM identifier to add SD writeback at various points ("real-time save").

Quote:
So, if someday I decide to program my own GBA software it should run unmodified as long as I don't use fast ROM or saving methods other than SRAM.

Correct. Don't touch WAITCNT and your program will work fine on a SuperCard. For inner loops, you can always copy code to the built-in ultra-fast IWRAM. You will have to quick power cycle to save though.


Top
 Profile  
 
 Post subject: Re: GBA Flash carts
PostPosted: Tue Jul 30, 2013 1:48 pm 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2801
The SuperCard is a let down for GBA. I owned one before. As you noticed, basically all games must be patched due to the Slow RAM (or Memory Controller) in the product not being able to keep up with *normal* ROM speeds. The pre-fetch does not make up for this. Games that normally don't suffer slowdown will. Some games suffer terrible slowdowns. The SuperCard is more useful for playing NDS games. I recommend if you can find one, one of the M3 Adapters. While any GBA device requires patching the ROMs if they use something other than SRAM it's not a bit deal. SuperCard's the one that *really* requires patching not just for saving but for not crashing when the RAM can't keep up.

I'd highly recommend trying to find another product.


Top
 Profile  
 
 Post subject: Re: GBA Flash carts
PostPosted: Wed Jul 31, 2013 6:43 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10067
Location: Rio de Janeiro - Brazil
Crap. Wish I knew this sooner. Thanks MottZilla.


Top
 Profile  
 
 Post subject: Re: GBA Flash carts
PostPosted: Thu Aug 15, 2013 5:30 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3944
I have the Flash2Advance 256M (32MB), and it has hardware simulation of several different save types.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject: Re: GBA Flash carts
PostPosted: Sat Aug 17, 2013 8:06 am 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1308
Did my old 128Mbit EZ-Flash 2 do this sort of thing? It was a small NAND flash deal, I don't believe it copied the game to its own RAM in order to run like some newer devices did.


Top
 Profile  
 
 Post subject: Re: GBA Flash carts
PostPosted: Sat Aug 17, 2013 9:34 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19120
Location: NE Indiana, USA (NTSC)
A NAND device would still have to copy the game to RAM to run it. It just acts as if it were a raw NAND needing a software controller, like a SmartMedia or xD-Picture card as opposed to CF or SD. Only NOR flash is word-addressed in the way that allows for the sort of execute-in-place operation needed to run programs without copying them to RAM first. Most cards that are 512 Mbit or smaller are NOR based.


Top
 Profile  
 
 Post subject: Re: GBA Flash carts
PostPosted: Mon Aug 19, 2013 10:37 am 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1308
tepples wrote:
A NAND device would still have to copy the game to RAM to run it. It just acts as if it were a raw NAND needing a software controller, like a SmartMedia or xD-Picture card as opposed to CF or SD. Only NOR flash is word-addressed in the way that allows for the sort of execute-in-place operation needed to run programs without copying them to RAM first. Most cards that are 512 Mbit or smaller are NOR based.

I indeed had those mixed up - I believe it was an NOR cart.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group