gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Hardware > Open-source generic flash cart library/writer

#57239 - darkfader - Fri Oct 14, 2005 2:29 pm

Is there some open-source generic flash cart library/writer utility yet?

* low-level hardware access library for x86/ARM supporting parallel port/USB linkers, DS/GBA slot etc.
* cart/flash library supporting different kinds of carts to do stuff like:
read, write, cart type detection, (optional) erase, (automatic) bankswitching, special features like SDRAM expansion.
* wrapper(?) library to access cart as block device. The library should be usable as a pre-loaded module when running on GBA/DS.
* front ends:
GBA/DS WMB/Wifi flasher, Win/MAC GUI
* On top of the block device library, there could be filesystem libraries to access SD/CF/UDISK.

This all could go under devkitpro/projects folder.


Last edited by darkfader on Thu Oct 27, 2005 11:22 am; edited 12 times in total

#57286 - Dwedit - Fri Oct 14, 2005 8:45 pm

That's asking for quite a bit... Even pogoshell doesn't have enough information to support many different flash cartirdge's bankswitching systems. So I'm guessing there's not much information out there.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#57604 - Vince - Mon Oct 17, 2005 9:11 am

Hello,

As for open-source flashers for carts, there are :
+ if2a, which is targeted at F2A/F2AU users. See http://if2a.free.fr for more info
+ ucon64, which aims at supporting a wider range of backup devices. It has support for f2a but not for F2AU. Home page here : http://ucon64.sourceforge.net/index2.html
+ there is also a cart flasher for FA Extreme for Mac users. See http://www.deadcoderssociety.tk/ for hints.

That's it for what I know. Not very much carts are supported.

Vince
_________________
Reclaim control of your F2A/F2AU with if2a !!

#57646 - SmileyDude - Mon Oct 17, 2005 4:07 pm

i was working on something like this a few years ago, but i got distracted by work :(

ideally, the library should have multiple parts -- an interface to the cart part (the flasher, GBA/DS port, whatever). And an accessing the cart itself part. I don't know how much should ideally be exposed of the lower level details. I guess ideally, the library should allow querying of the cart for it's capabilities and then the programmer can call the appropriate method to switch banks if necessary, etc, etc.

The other sticking point is that on a PC, you're not going to have direct memory access to the cart, but on the GBA/DS you do. From a programming perspective, it would be nice to have a single API for both -- i.e, something like cartMemcpy() that would handle the details of reading/writing (this would be the code that the other layers would use to access the cart). But, on the GBA/DS, this would be inefficient -- why copy from the cart when you can use it directly?

Still -- I like the idea of a library that could work on multiple platforms for accessing the different types of flash carts and linkers (heh -- you could even support plugging in a USB flasher to a PSP, PS2, or XBox :D), but it really needs a well thought out architecture/API, IMO...
_________________
dennis

#57671 - Joat - Mon Oct 17, 2005 6:41 pm

I would honestly be very happy for just a list of registers and unlock sequences, that alone is more than is publically available for most flash carts. People can then write libraries on top of this info or whatever.

I'd be glad to put all of this info up on the DS wiki if anyone has some. I've got code for visoly carts somwhere that I'll put up to start the ball rolling (when I find it, just did a clean reinstall so I need to restore my backups first).

As it stands, you have to dump and RE the multirom menu for switching information, and the multiboot stub for programming info (if it's a gba multiboot linker dealy), or the x86 program and driver (for other types).
_________________
Joat
http://www.bottledlight.com

#57705 - tepples - Mon Oct 17, 2005 9:05 pm

SmileyDude wrote:
it would be nice to have a single API for both -- i.e, something like cartMemcpy() that would handle the details of reading/writing (this would be the code that the other layers would use to access the cart). But, on the GBA/DS, this would be inefficient -- why copy from the cart when you can use it directly?

For easy portability between cart builds and GBAMP builds of a single program perhaps?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#59747 - Joat - Thu Nov 03, 2005 10:12 pm

Enjoy (and please contribute if you have information, either drop me an email or msg me on IRC or the forum):

http://www.bottledlight.com/ds/index.php/Hardware/FlashCartridges

That is almost everything I have. I didn't include the visoly parallel port interface (cartlib.c handles that, but should probably be added anyways), the f2a usb interface (if2a handles it, I think; I don't have one), or pseudcode for m3 / gbamp (chishm's lib does very well, although I will be adding the pseudocode I think).

I don't know how to flash the actual gbamp / m3 / supercard firmware (as opposed to getting to their CF interface), or how to bank in the supercard SDRAM, and of course, borden is a bitch like always and never responded to any of my mails about the EZFA. I really need to get around to dumping the multiboot flasher and REing it, maybe soon. The flasher is compressed or encrypted in the exe or stored on the Atmel (unlikely but possible), a quick hexedit of the pc client didn't turn up a gba logo.

And if anyone wants to donate some old flasher hardware not listed or un-REd, I'm not one to turn down a gift :)

What I have:
Visoly 64M Turbo
EZFA 256M
NeoFlash 512M (dunno where the last few rom bank bits are)
GBA MP v2

What I have info about:
Visoly Turbo / Non-turbo and F2A
NeoFlash (is this the same as XgFlash 1 and 2, or just 2?)
GBA MP v2 (CF only)
Supercard CF (CF only)
Supercard SD (SD only, possibly buggy, that asm was whack)
M3 (CF only)
EZF-3 (unlock and rom banking only)

Not flash cartridge related, but cartridge related still:
Anyone know how to rumble or read the tilt sensor on wario ware twisted / yoshi topsy turvy / etc..., or the sunlight sensor on Boktai, and so forth.

I'm sure stuff like this has been figured out, but I for one can never find it when I need it (not that I need any of those, since I don't have those games, but it's an example), so I'd like to stick it on the wiki as well.
_________________
Joat
http://www.bottledlight.com

#63332 - FluBBa - Mon Dec 12, 2005 1:26 am

I updated my post on the tilt sensor in the coding part of the forum.
_________________
I probably suck, my not is a programmer.

#68659 - Sicon - Thu Jan 26, 2006 8:41 am

Dr. neo released his code, http://www.neoflash.com/forum/index.php/topic,302.0.html for the windows writer I often use. You might find it useful.
_________________
http://www.fullsail.edu/