Arduino GB/GBA flashcart possible?

Discussion in 'GBA - Flashing Hardware and Software' started by mammastuffing, Dec 16, 2015.

  1. mammastuffing
    OP

    mammastuffing GBAtemp Regular

    Member
    107
    24
    Aug 7, 2015
    Hey all,

    I'm not all too familiar with the details on how the GB/GBA works or what their clock frequencies are.
    But I'm thinking about trying to build my own Arduino, or rather ATMega328 flashcart. (Prototyping with the Arduino first). But I've a feeling there might be some restrictions seeing as the clock frequency of the ATMega328 is only 16Mhz.

    My idea would be to use shift registers to cover all pins of the GB/GBA cartridge pins. However, I realize that using shift registers I'm going to need a minimum of 8 clock cycles to read all 32 (minus vcc, gnd etc. pins) as they will be read serially to the Arduino. Probably more than 8 if we're being realistic.

    When the GBA latches addresses I would simply like to load a rom from an SD card and output the requested address in the rom to the data bus.

    What do you think? 16 Mhz insufficient or not? :P
     
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,199
    8,957
    Nov 21, 2005
    So you are planning to use the arduino to fake the storage to feed to the GBA? How much space do you think you can get from that? I ask mainly as the GBA does have a very nice serial loading mode aka multiboot that can take a few hundred kilobytes.

    The GBA is a bit of a timing/speed concerned device too -- it is why supercards are not great for the GBA. I am not sure even a modern SD is fast enough to do it justice, you could probably make something for homebrew use but trying to do commercial ROMs off it would be a nightmare.

    Oh and I should also link http://reinerziegler.de/GBA/gba.htm#homebrew flash cart
    If you wanted to use a programmable chip as a governor for other things (pages on a NOR or something) then that could work I suppose.
     
  3. mammastuffing
    OP

    mammastuffing GBAtemp Regular

    Member
    107
    24
    Aug 7, 2015
    Thanks for the reply.

    Yeah, the idea would primarily be to run commerical backups of an SD-card using an ATMega328 to fetch the data from the SD-card an supplying it to the GB/GBA. Would you mind explaining roughly what you mean by timing concerns? I'm sorry if I'm being lazy, guess I don't want to invest too much time into this if it would turn out to be pointless to begin with.
     
  4. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,199
    8,957
    Nov 21, 2005
    For the time (and kind of still now) the GBA had pretty fast access rates and very low latency for cart/ROM access, things were coded both to take advantage of this and without regard to running things more slowly -- slowdowns, crashes and more would happen if you messed up here hence the supercards having slowdowns, crashes and the need to have speed patches for many games as they did not put fast enough memory in. NAND memory of the time could not keep up and whether it still struggles I am not sure as things have improved since GBA days but not necessarily in the ways that matter here. To work around that first NOR memory was used, then increasingly large amounts of it and after that things were dumped in RAM from NAND memory and that was pointed at the GBA.
     
  5. Drud1995

    Drud1995 GBAtemp Regular

    Member
    117
    31
    Apr 18, 2012
    United States
    Magicant
    Never thought of using an Arduino for this purpose, as I have always used it for basic robotics and small hobby projects. Like Fast said, the speed is quite a problem. What might be possible for custom homebrew games, it to find out what ROM chips are used, flash a custom ROM to an EPROM using special programming tools, and solder the new chip in place of the old one in a good donor cart. I know people do this all the time with reproductions for NES and SNES.
     
  6. Jack_Sparrow

    Jack_Sparrow Ruthless Pirate

    Banned
    855
    477
    Nov 17, 2015
    United States
    The Black Pearl
    If you can get this working i'm going to buy an Arduino :)
     
  7. grossaffe

    grossaffe GBAtemp Addict

    Member
    2,706
    2,087
    May 5, 2013
    United States
    Why arduino?
     
  8. Jack_Sparrow

    Jack_Sparrow Ruthless Pirate

    Banned
    855
    477
    Nov 17, 2015
    United States
    The Black Pearl
    Why not?
     
  9. grossaffe

    grossaffe GBAtemp Addict

    Member
    2,706
    2,087
    May 5, 2013
    United States
    Because they're the playskool of microcontrollers. If you want to do a serious project in embedded systems, you'll want to start with a real microcontroller. Well, in actuality, you'll want to start by identifying your requirements and constraints and picking a microcontroller, or perhaps FPGA/CPLD, based on those criteria.
     
  10. Jack_Sparrow

    Jack_Sparrow Ruthless Pirate

    Banned
    855
    477
    Nov 17, 2015
    United States
    The Black Pearl
    Hey, if he can make it work i say let him use what he likes
     
  11. endoverend

    endoverend AKA zooksman

    pip Contributor
    GBAtemp Patron
    endoverend is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    2,843
    3,547
    Jun 6, 2013
    United States
    I recently saw this on Twitter:

    So yes it's probably possible but is no task for someone without thorough electronic engineering know-how.
     
  12. grossaffe

    grossaffe GBAtemp Addict

    Member
    2,706
    2,087
    May 5, 2013
    United States
    He is indeed perfectly within his rights to use what he likes. However, he came on here asking for help/advice, which is why I posed the question to him.
     
  13. mammastuffing
    OP

    mammastuffing GBAtemp Regular

    Member
    107
    24
    Aug 7, 2015
    Thanks for all your feedback!

    Why the Arduino? Well, it's what I have at my disposal. But I do realize the limitations with the speed and all.

    I guess the main "goal" is to not spend a lot of money and to have a fun project to work on. Let's say I instead want to make a modular eprom/eeprom flashcart (I know there are alot of them out there) I would need a programmer.
    But I don't want to spend $40-50 on a programmer, but a home made like this would should suffice I guess? http://www.ichbinzustaendig.de/dev/meeprommer-en

    I was also looking at this: https://github.com/Xyl2k/Gameboy-Color-Cartridge
    This pcb does not have room for SRAM/EEPROM for saving or a RAM chip which I've seen in some carts. Does this mean not all backups are possible to run?