Hacking NDSGBA- Button Remap

Canadacdn

Well-Known Member
OP
Member
Joined
Jul 20, 2007
Messages
147
Trophies
0
Location
Canada
Website
Visit site
XP
271
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.
 
  • Like
Reactions: 1 person

BORTZ

DO NOT SCREENSHOT
Supervisor
Joined
Dec 2, 2007
Messages
13,243
Trophies
3
Age
34
Location
Pittsburgh
XP
15,972
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.
 

PJM

Well-Known Member
Newcomer
Joined
Apr 28, 2012
Messages
87
Trophies
1
Location
NS
XP
208
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.
 

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
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.
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.
 

2ndApex

Well-Known Member
Member
Joined
Jul 12, 2012
Messages
677
Trophies
0
XP
419
Country
United States
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.
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.

Wait, the SNES emulator is open source but the GBA emulator is not?
 

BassAceGold

Testicles
Member
Joined
Aug 14, 2006
Messages
496
Trophies
1
XP
441
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.
 

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
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.
 

suppow

Well-Known Member
Member
Joined
Jul 21, 2012
Messages
293
Trophies
0
XP
125
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) [?]
 
  • Like
Reactions: 2 people

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
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) [?]
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.
 

suppow

Well-Known Member
Member
Joined
Jul 21, 2012
Messages
293
Trophies
0
XP
125
Country
United States
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.

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?
 

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
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.

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.
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.
 

suppow

Well-Known Member
Member
Joined
Jul 21, 2012
Messages
293
Trophies
0
XP
125
Country
United States
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.

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.
 

nl255

Well-Known Member
Member
Joined
Apr 9, 2004
Messages
2,999
Trophies
1
XP
2,761
Country
aww that's a shame. I was planning on changing a few things :(

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).
 

suppow

Well-Known Member
Member
Joined
Jul 21, 2012
Messages
293
Trophies
0
XP
125
Country
United States
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).

is that one open-sourced?
 

nl255

Well-Known Member
Member
Joined
Apr 9, 2004
Messages
2,999
Trophies
1
XP
2,761
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).

is that one open-sourced?

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.
 

Rydian

Resident Furvert™
Member
Joined
Feb 4, 2010
Messages
27,880
Trophies
0
Age
36
Location
Cave Entrance, Watching Cyan Write Letters
Website
rydian.net
XP
9,111
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.
 

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
because it really would be a lot of work (DSTwo is MIPS, DS is ARM).
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.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    A @ anotherthing: The Nintendo servers are going down in 9 days anyway.