Talking to gba cart

Discussion in 'NDS - Emulation and Homebrew' started by gudenaurock, Dec 30, 2011.

Dec 30, 2011

Talking to gba cart by gudenaurock at 10:29 PM (492 Views / 0 Likes) 3 replies

  1. gudenaurock
    OP

    Member gudenaurock Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    2,955
    Location:
    /dev/random
    Country:
    United States
    So how do I do this?
     
  2. Dirbaio

    Member Dirbaio GBAtemp Regular

    Joined:
    Sep 26, 2010
    Messages:
    158
    Location:
    Spain
    Country:
    Spain
    If you want to read the actual game cartridge, it's easy.
    The GBA cartridge is memory-mapped to 0x08000000 when in NDS mode. You can read directly from it. For example, here's a code to read the gamecode, so you can know which game is inserted. (I haven't tested it but it should work)

    Code:
    u32 gamecode = *((vu32*)0x080000AC);
    if(gamecode == 0x12345678) {...}
    
    This code reads 4 bytes from address 0x080000AC, which is offset 0xAC in the cartridge, which according to GBATEK, has the gamecode.

    If you want to read the saved game, I dunno if it's possible. I think I read somewhere it wasn't because the DS clock speed was too fast to talk to the EEPROM or whatever.
     
    1 person likes this.
  3. CoolAs

    Newcomer CoolAs Advanced Member

    Joined:
    Oct 21, 2011
    Messages:
    75
    Country:
    Australia
    Yeah, but Pokemon DS Can read the GBA Pokemon game so you *can* read the save-game.

    Also Dirbaio, wouldn't you have to give the ARM9 rights to the card bus?
    Because you need to do that when reading a DS games eeprom, but then your trying to read something different...
     
  4. Dirbaio

    Member Dirbaio GBAtemp Regular

    Joined:
    Sep 26, 2010
    Messages:
    158
    Location:
    Spain
    Country:
    Spain
    Yeah, good point.
    http://nocash.emubase.de/gbatek.htm#dsmemorycontrolcartridgesandmainram

    In libnds, it would be

    Code:
    sysSetCartOwner(true);
    
     

Share This Page