SuperFW: a (very much WIP) supercard firmware

davidgf

Active Member
OP
Newcomer
Joined
Mar 25, 2011
Messages
31
Trophies
1
XP
459
Country
Hey there!
So yeah, after seeing that this was pretty much possible (thanks to metroidmaniac's effort) and since this was something that I always wanted but nobody came up with, I decided to give it a shot and try it myself. I've been working on this over the past 2-3 weeks and so far it looks half-decent.

The goal is to create a firmware that is nice, easy to use, has some sane defaults and requires no PC (patches included in the FW). Ideally would be fast, have many features, and be easy to update and mess around. And open source of course! (Will be releasing the code soon!) Other cool things are: using Elm's FatFS lib (so support for FAT32 and extFAT is possible), proper font rendering and unicode support (no more ascii-only filenames!), no limits on file count/directory count, can load GB/GBC roms using goombacolor, etc. Let's make this very 2024.
So far this is a pretty much early demo. Supports many commercial games (haven't done almost any testing) with patches for WAITCNT (aka whitescreen) and EEPROM. Working on getting patches for FLASH next. Has no support for flashing, so you need chainload it from another supercard firmware.

WARNING! ACHTUNG! This is pretty much a demo, almost guaranteed to destroy your sav files, if not your SD card! Please stay away if you want something usable.
I'm posting this since I'm gonna be out for a month on vacation so I wanted to say hi and force myself to pick it up and finish it once I'm back.

The obligatory video:


That's it, below here a long explanation for those interested in the details:

I have worked a bit of gpsp over the past years, so I added some minimal supercard emulation on a branch, so I could develop this without having to test on real hardware (it's so much faster to develop this way). That's how the video was recorded. The support is very minimal, and unlikely to publish it, but I thought about adding some support to mgba, since the developers seem open to the idea.
Another cool topic is patching: I've developed some cool emulation/static-analysis based system that can find patching offsets for WAITCNT. I will be writing a post about this soon, since it is a cool idea and can be repurposed for other things. ATM it only works for the Thumb instruction set, working on adding ARM support. The firmware ships a database of patches (~80KB) and uses it to patch games. It also has support to load patches from the SDcard so updates and alternative patch databases can be distributed (without having to flash a new firmware).

And I'm going to bed, I'll post more tomorrow :)
 

Attachments

  • firmware.gba.zip
    122 KB · Views: 9

Wuigi

Well-Known Member
Member
Joined
Sep 14, 2012
Messages
728
Trophies
1
XP
1,806
Country
United States
Looks great, might this also work for a supercard miniSD?
Will the card still support passme to run DS homebrew?
 

davidgf

Active Member
OP
Newcomer
Joined
Mar 25, 2011
Messages
31
Trophies
1
XP
459
Country
I tested this in a Supercard with microsd and minisd (I do no think it is relevant, it's just the same kind of device).
I haven't added support for flashing the internal flash yet, I assume that might be tricky, given all the messages in the SCFW thread, right metroid maniac? Seems that there might be different flash manufacturers. I also want to implement this in gpsp so I can do proper testing (before I kill my carts :P)
For now I'm focusing on GBA, but I will explore any DS support as well :)

I'm also curious of adding some support for in-game menu (like the EZ flash carts have). I think it is cool how they do that (by patching the IRQ handlers in the games) and I could reuse my WAITCNT patcher for it (since it is pretty much the same kind of patching).
 
  • Like
Reactions: Wuigi and Flame

metroid maniac

An idiot with an opinion
Member
Joined
May 16, 2009
Messages
2,089
Trophies
2
XP
2,688
Country
Not having any of the carts which have been bricked, I don't know what the issue with flashing is. It seems easy enough, but I guess in practice it turns out a little different. Clones are definitely using new flash ids these days, because they aren't being recognised by the OFW installer.

Patching the IRQ handler is more regular and reliable than patching WAITCNT so that's definitely possible. I'm not sure how feasible tricky an ingame menu with save states is though, seems like it'd have a large memory footprint including the SD driver. My implementation in SCFW only handles soft reset and has no menu so it's very lean.
 
Last edited by metroid maniac,
  • Like
  • Love
Reactions: jejer and Flame

OmDRetro

Member
Newcomer
Joined
Apr 23, 2024
Messages
15
Trophies
0
XP
60
Country
Philippines
I took the risk to load your kernel and I do like the UI so far (already backed up my files just in case ~ heh).

Seems SuperFW doesn't recognize the save files from SCFW as the latter saves in the directory where the ROM file is located.

For yours, the target directory for saves appears to be found in:
  • ./SAVEGAME/{ROM FILENAME HERE}.SAV
So, I tried transferring my saves there and it works!

I assume the configs for this kernel is found here:
  • ./retrofw/
 
  • Like
Reactions: BETA215

Archeychen

Member
Newcomer
Joined
Jun 22, 2022
Messages
22
Trophies
0
Age
25
Location
Beijing
XP
125
Country
China
grate work! looks cool!

does it comes with Chinese support?

also, what's your sd r/w speed?

about the nds side, you can use mine dldi, it's heavily optimized,about 2.5MB read and 1.4MB write, IIRC


https://github.com/ArcheyChen/SuperCard-SDHC-DLDI/tree/master/source

but the code heavily use inline asm, and will not directly compile on gba

if you need any help on displaying Chinese or opt the sd card speed, please contact me.
Post automatically merged:

grate work! looks cool!

does it comes with Chinese support?

also, what's your sd r/w speed?

about the nds side, you can use mine dldi, it's heavily optimized,about 2.5MB read and 1.4MB write, IIRC


https://github.com/ArcheyChen/SuperCard-SDHC-DLDI/tree/master/source

but the code heavily use inline asm, and will not directly compile on gba

if you need any help on displaying Chinese or opt the sd card speed, please contact me.
Post automatically merged:

and ,how do you load your fw?I use Manic's loader, but according to him, to load the fully 512KB of fw, you need to toggle some regs to unlock the scsd, but we didn't find a way to 'relock' it, which will cause nds games white screen when using twlmenu++

it's really PITA to deasm it, because it's a selfcopy code in stock fw, really hard to analysis.
 
Last edited by Archeychen,

OmDRetro

Member
Newcomer
Joined
Apr 23, 2024
Messages
15
Trophies
0
XP
60
Country
Philippines
I ran davidgf's kernel by renaming the "firmware" file to kernel.gba and placed it inside the scfw folder(thus replacing the SCFW kernel).

It's practically a frankenstein-ish combination of metroid-maniac's firmware/loader & davidgf's kernel :lol:

PXL_20240504_005840372.jpg
 
  • Like
Reactions: zfreeman

Peeteris

Well-Known Member
Newcomer
Joined
Mar 7, 2017
Messages
74
Trophies
0
Age
43
XP
367
Country
Can't wait for more! Awesome job you doing here!

Pokemon Emerald not working at the moment with this, though.
 

moon_rabbit

Well-Known Member
Member
Joined
May 6, 2022
Messages
112
Trophies
0
Age
34
Location
kor
XP
258
Country
Korea, South
Currently SCFW doesn't have a database, so finding the savetype is the most time consuming thing.
With a database, like ez-flash and everdrive, it will definitely be faster.
 

davidgf

Active Member
OP
Newcomer
Joined
Mar 25, 2011
Messages
31
Trophies
1
XP
459
Country
Hey there! I'm back :)

Answering some questions now, thanks for the feedback!

Will the card still support passme to run DS homebrew?
> For now I'm focusing on GBA mode (also my NDS died and I don't have a SuperKey with me for testing)

Looks great, might this also work for a supercard miniSD?
> I think it works with all of them? I tested with several supercards (miniSd, microsd...). I have a full SD one (really old) but cannot find it now :P

Seems SuperFW doesn't recognize the save files from SCFW as the latter saves in the directory where the ROM file is located.
> There's an option to select where saves are stored (three possibilities)

does it comes with Chinese support?
> Not yet. The font was a bit too big, will try to get some ZH/JP/KR support in the next releases

also, what's your sd r/w speed?
> I think it's over ~1.2MB/s, measuring with a timer I think it's more than 10% faster than the default supercard firmware. It's pretty close to the limit I think.

how do you load your fw?
> I just manually chain-load it (using the regular SC firmware), like another game.


So the plans at the moment are roughly:

- Finish the patching code (for WAITCNT patching), and implementing a built-in patcher (for games that are not in the database)
- Tackling FLASH carts (right now only SRAM/EEPROM is supported).
- Exploring flashing the firmware into the internal flash, like SCFW does for its bootloader, with some updater tool and whatnot.
- In-game menu: explore savestate support, forced SRAM flush/write. This will also require some patch database.
- Explore DS mode, once I revive my DS (damn fuses).
- UI stuff: more character support, add some translations, some theming, etc.

I was also told that some SC have no battery? My assumption was that they all have it, so we can defer SRAM saving to the next boot. Anyone has any pointers about this?

Thanks for the feedback! Really appreciated. Stay tuned for more!
 

Apache Thunder

I have cameras in your head!
Member
Joined
Oct 7, 2007
Messages
4,459
Trophies
3
Age
36
Location
Levelland, Texas
Website
www.mariopc.co.nr
XP
6,888
Country
United States
I was also told that some SC have no battery? My assumption was that they all have it, so we can defer SRAM saving to the next boot. Anyone has any pointers about this?

I know for sure the SuperCard Lite MicroSD doesn't use a battery as I personally own one. Not sure on the others. Most models do have battery but SuperCard Lite is one of the unique ones that don't.
 

davidgf

Active Member
OP
Newcomer
Joined
Mar 25, 2011
Messages
31
Trophies
1
XP
459
Country
Thanks for the report!
I also noticed that the Lite has some quirks (I found some funny comments in SCFW and devkitpro sources) so I was wondering whether my FW was at all compatible with this particular model.
It seems it's not easy to find any more (only the regular microsd version is still available in aliexpress and similar sites, the other versions seem gone).
That means having an in-game menu will be even more important for these carts.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • SylverReZ @ SylverReZ:
    @ZeroT21, Why not stick to your other machine, no?
  • ZeroT21 @ ZeroT21:
    my other machine is old, mostly used for just browsing , some multimedia stuff as it's just old
  • ZeroT21 @ ZeroT21:
    some tasks like hacking wii mini consoles
  • SylverReZ @ SylverReZ:
    @ZeroT21, You running Windows XP in 2024?
  • K3Nv2 @ K3Nv2:
    Whore yourself out 12 times for $100 and go buy a pc
    +1
  • ZeroT21 @ ZeroT21:
    i got xp but running it off usb only, no way ima keep that
  • ZeroT21 @ ZeroT21:
    it gets hacked/corrupted if i just leave it online for an hour
  • SylverReZ @ SylverReZ:
    @ZeroT21, The Russians are after you lol.
  • K3Nv2 @ K3Nv2:
    Send me your ip I'll remotely fix it
  • ZeroT21 @ ZeroT21:
    @K3Nv2 my head needs fixing if I believe you
  • ZeroT21 @ ZeroT21:
    it's kinda fun watching it happen tho
  • K3Nv2 @ K3Nv2:
    It needs fixing for other things but your pc I can fix
  • ZeroT21 @ ZeroT21:
    over 300+ virus/trojians/worms after scanning, what did I do to deserve this attention lol
  • ZeroT21 @ ZeroT21:
    tho I find it funny when i receive other people's pc/laptops in this state
  • ZeroT21 @ ZeroT21:
    i wont be upgrading unless I cant run the games i want anymore
  • K3Nv2 @ K3Nv2:
    Spill water on it good excuse
  • ZeroT21 @ ZeroT21:
    @K3Nv2 that's like a valid option if someone else is paying for ya
  • K3Nv2 @ K3Nv2:
    Daddy's wallet
  • K3Nv2 @ K3Nv2:
    Ngl hogwarts legacy has good pooping music
  • OctoAori20 @ OctoAori20:
    That's uh-
  • OctoAori20 @ OctoAori20:
    That's certainly a Dairy Queen sign lmao
  • K3Nv2 @ K3Nv2:
    You should see his help wanted signs
    K3Nv2 @ K3Nv2: You should see his help wanted signs