NDSGBA- Button Remap

Discussion in 'Supercard' started by Canadacdn, Oct 12, 2012.

Oct 12, 2012

NDSGBA- Button Remap by Canadacdn at 9:38 PM (2,780 Views / 1 Likes) 23 replies

  1. Canadacdn
    OP

    Member Canadacdn GBAtemp Regular

    Joined:
    Jul 20, 2007
    Messages:
    147
    Location:
    Canada
    Country:
    Canada
    Has anyone figured out a way to remap the B button in NDSGBA v1.21? I'd love to be able to remap B to Y and A to B, but haven't been able to find any information on what to edit.
     
    1 person likes this.


  2. BORTZ

    Global Moderator BORTZ wtf, nintendo

    Joined:
    Dec 2, 2007
    Messages:
    10,652
    Country:
    United States
    I dont know if there is a way. Id love to be able to have more control over button remapping as well, cause my L Button is destroyed.
     
  3. PJM

    Newcomer PJM Advanced Member

    Joined:
    Apr 28, 2012
    Messages:
    87
    Location:
    NS
    Country:
    Canada
    The bad news is you would probably have to edit the source. The good news is that it sounds like a minor change to make.
     
  4. SifJar

    Member SifJar Not a pirate

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    United Kingdom
    It's not open source AFAIK, so that'd pose a bit of a problem.

    In theory it may be possible to do patch the binary by reverse engineering it and modifying it in ASM or whatever, but that'd probably be a bit tricky. I don't know what format the NDSGBA binary is in (I think perhaps PLG, but I know nothing about that format or it's structure, nor if there are tools for reverse engineering it). The DS ROM Hacking documentation by FAST6191 may prove helpful, but the tools required will be different, as the PLG format is different to NDS, and I don't think the SC DS2 CPU is ARM, which also makes a difference to reverse engineering.

    It'd probably be quite a bit of work though.
     
  5. 2ndApex

    Member 2ndApex GBAtemp Advanced Fan

    Joined:
    Jul 12, 2012
    Messages:
    672
    Country:
    United States
    Wait, the SNES emulator is open source but the GBA emulator is not?
     
  6. Rydian

    Member Rydian Resident Furvert™

    Joined:
    Feb 4, 2010
    Messages:
    27,883
    Location:
    Cave Entrance, Watching Cyan Write Letters
    Country:
    United States
    Correct. The GBA emulator appears to be the work of another author and he didn't want the source released.
     
  7. PJM

    Newcomer PJM Advanced Member

    Joined:
    Apr 28, 2012
    Messages:
    87
    Location:
    NS
    Country:
    Canada
    aww that's a shame. I was planning on changing a few things :(
     
  8. Terminator02

    Member Terminator02 ヽ( 。 ヮ゚)ノ

    Joined:
    Apr 10, 2010
    Messages:
    4,517
    Location:
    Somewhere near monkat
    Country:
    United States
    Pretty sure it's an ARM9

    Edit: I'm not sure if the DSTWO uses the exact same SOC as the iPlayer, but the iPlayer uses this.
     
  9. BassAceGold

    Member BassAceGold Testicles

    Joined:
    Aug 14, 2006
    Messages:
    494
    Country:
    Canada
    The Supercard DS2 uses a MIPS processor (JZ4740 JZ475X CPU or some variant of it) which is the same family of processors used in the Dingoo. However, with the following structure you might not even need to touch the MIPS code to create a patch.

    The structure of the plugin is as follows:

    Code:
    //this was taken from their latest SDK, not sure if its accurate or not
    typedef struct run_plugin_head_t {
    u32 cpu_code_offset;
    u32 cpu_code_len;
    u32 cpu_load_addr;
    u32 cpu_jmp_addr;
    
    u32 nds_code_offset;
    u32 nds_code_len;
    
    } Run_Plugin_Head;
    
    //this is just me guessing at this point
    //probably plugin binary data
    //probably nds binary data
    
    
    Where the DS code is stored in the ds2_firmware.dat that is patched into the plugin binary after the binary has been compiled. The ds2_firmware.dat is just an nds binary that communicates back and forth with the Supercard for some hardware stuff like input, output and time. The source for the ds2_firmware.dat is in their SDK 1.2 release.

    This is of course assuming that the NDSGBA plugin follows the same format as their released SDK. If it does, then you could extract the nds binary from the NDSGBA.plg file, patch that to swap whatever input, and then repatch the NDSGBA plugin file.
     
  10. SifJar

    Member SifJar Not a pirate

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    United Kingdom
    I'm looking at some PLG files, and I can't see how that could be right...:

    CATSFC.plg:

    Offset(h)00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
    00000000 B4 2E BB B9 92 9B 28 98 9D FB 88 CF 41 F0 8F 41 ´.»¹’›(˜.ûˆÏAð.A
    00000010 E3 58 DA BA E4 D9 5D 7A 04 3C CE 1D 7A F9 78 AA ãXÚºäÙ]z.
     
  11. suppow

    Member suppow GBAtemp Regular

    Joined:
    Jul 21, 2012
    Messages:
    293
    Country:
    United States
    seems like it would be a fairly simple addition for whoever coded the emulator in the first place, since it can already map A and B to X and Y, it'd be great to have the possibility to remap all buttons. perhaps someone should into contacting the developer(s) [?]
     
    2 people like this.
  12. SifJar

    Member SifJar Not a pirate

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    United Kingdom
    Of course it'd be simple. But there is no way of contacting the developer, as it was (probably) just the SuperCard team using a fake name with no contact details so that they couldn't be held legally responsible for not releasing source, which they should have because it used GPL code.
     
  13. suppow

    Member suppow GBAtemp Regular

    Joined:
    Jul 21, 2012
    Messages:
    293
    Country:
    United States
    is that the only GBA emulator for NDS? i dont know any other, and i'm surprissed i havent, i'd love to see a port of vba or something like that.

    edit: wasnt the emulator actually made by someone else, then ported, then updated by/for DSTWO?
     
  14. SifJar

    Member SifJar Not a pirate

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    United Kingdom
    The DS is incapable of decent GBA emulation, it's only possible at a decent speed via the DSTwo's additional processor, which can only run this one. I think it is based on VBA from memory.

    There is another GBA emulator for the DS, but it runs fairly badly from what I gather, slightly better in DSi mode but still crap.
     
  15. suppow

    Member suppow GBAtemp Regular

    Joined:
    Jul 21, 2012
    Messages:
    293
    Country:
    United States
    i find it strange that the slot-1 would have a slower stream rate than the slot-2. at first i thought flashcarts would serve as ram and just feed the game on slot-2 mode, like ngc games are loaded on the wii. but it seems the DSTWO does actual software emulation, which i guess is also the only way to remap buttons.
     
  16. nl255

    Member nl255 GBAtemp Advanced Maniac

    Joined:
    Apr 9, 2004
    Messages:
    1,998
    Country:
    To do that you would have to port the PSP GBA emulator (which is what they did to make NDSGBA in the first place). In fact, it is now possible to do the sound emulation on the DS's CPU though you would have to write the sound code yourself (I am sure Pate would be willing to help you if you run into trouble though).
     
  17. suppow

    Member suppow GBAtemp Regular

    Joined:
    Jul 21, 2012
    Messages:
    293
    Country:
    United States
    is that one open-sourced?
     
  18. nl255

    Member nl255 GBAtemp Advanced Maniac

    Joined:
    Apr 9, 2004
    Messages:
    1,998
    Country:
    Yes and if you did manage to port it (and rewrite the sound code in ARM so it could run DS side) then it would be even faster than the official NDSGBA which runs all emulation on the DSTwo CPU as it was Pate (of DS2x86 fame) who reverse engineered the dstwo-ds communication protocol (and ds2_firmware.dat) and extended it so that he could have the Adlib sound emulation run DS side and released a modified and heavily improved SDK (though his modified SDK lacks sound support).

    I am sure he would be delighted to see another active DSTwo developer as he is currently the only one really doing much with it.
     
  19. Rydian

    Member Rydian Resident Furvert™

    Joined:
    Feb 4, 2010
    Messages:
    27,883
    Location:
    Cave Entrance, Watching Cyan Write Letters
    Country:
    United States
    Yeah Pate's definitely one of the guys (if not the guy) that's made the most technical progress with the DSTwo, he's learned all about it's quirks and ups/downs.
    http://dsx86.patrickaalto.com/

    I'd of course only contact him if you get ahold of the source for the PSP version (lots of redist sites snip out the source on their downloads to save bandwidth, which has caused issues in the past with GPL materials) and have a serious interest in doing all the work, because it really would be a lot of work (DSTwo is MIPS, DS is ARM).

    That said, if you can get GBA stuff running with no frameskip, people would drool all over you.
     
  20. SifJar

    Member SifJar Not a pirate

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    United Kingdom
    But the discussion has come round to porting the PSP emulator, and the PSP is MIPS, like the DSTwo (obviously not the same processor, but similar architecture), so that should probably ease things a little.
     

Share This Page