Does this exist?

Discussion in 'NDS - Emulation and Homebrew' started by 7iven8Nine, Jul 31, 2016.

  1. 7iven8Nine
    OP

    7iven8Nine Shrek's Memelord

    Member
    134
    47
    Nov 29, 2014
    United States
    Here
    Hey, I was wondering if something that let's me switch the input of the shoulder button exist because I broke the L button and that's the one I need. Thanks in advance.
     
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,868
    9,780
    Nov 21, 2005
    United Kingdom
    It is not an amazingly hard hack if you know assembly, and ultimately will probably fit in cheats. However if you mean "is there a tool like DSATM that will do it for me?" then no and there probably will not be.
     
  3. 7iven8Nine
    OP

    7iven8Nine Shrek's Memelord

    Member
    134
    47
    Nov 29, 2014
    United States
    Here
    Well, I need the R key so I can dump my GBA games. I have to press that button to do it. Could you point me in the direction for learning how to make a button mapper?
     
  4. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,868
    9,780
    Nov 21, 2005
    United Kingdom
    Does this homebrew have source code? That is the easier method. Though if it is Rudolph's stuff then maybe not. cory1492 made a dumping program once (part of his EZ 3 in 1 bothering tools) and he did tend to open source things, though what it does for saves I am not sure.

    Anyway general theory.
    DS buttons have some IO mapped into main memory.
    http://problemkaputt.de/gbatek.htm#dskeypad
    Strictly speaking it should be debounced (copied) every vblank into normal memory by the program in question and that is then used for operations (saves having a read 1ms and it being closed and the next being open and logic getting odd because of it). What homebrew will do might well vary. If you can run the program in an emulator then so that would help, however something nice and custom like this might be tricky (perhaps not as bad as a flash cart firmware that expects reads and whatever else)

    Most people don't remap buttons for games* but the theory is the same for things that people do remap. Two worked examples would be touchscreen hacking (usually removal of touchscreen in favour of buttons, star fox and zelda being the big two http://web.archive.org/web/20110604163902/http://crackerscrap.com/docs/sfchacktut.html for a guide for the former and http://gbatemp.net/threads/legend-of-zelda-phantom-hourglass-d-pad-patch.375388/ http://gbatemp.net/threads/legend-of-zelda-spirit-track-d-pad-patch.374773/) and the guitar hero thing (guitar hero had a GBA slot device to allow people to play, hackers then figured out it was also copied to memory and instead changed it so button states from the face buttons would hit the memory location http://gbatemp.net/threads/how-to-change-buttons-on-guitar-hero-on-tour-hack.275789/ ).
    Once you have it you can then either alter the debounced are or alter what the program checks to do a given function, both have been done and both have their perks over the other (the debounce alters everything where a simple function might only alter one thing, however if you want many things then you are editing many things or going back to the debounced stuff).

    *if some forum searcher finds this some point in the future then if it is hard coded to one control set then do the above, if there are any options at all (even if they are still bad for you) then look for the thing that handles the remapping and if they are fully remappable then why are you reading this? unless it is restricted from one button or something but that is probably a simple lock out in the buttons itself, though you might have some tricky logic if you want something from technically a different area of memory (the gbatek link has the memory locations).

    You are not the first person to suffer a dodgy shoulder key and consider the software route out, as the DS does not really have a hypervisor or anything (3ds and newer systems might be different) then in the end it is usually just easier to fix the button. The crazy option here is you head down the same path as the game autoplay/external controller people and tap the pads on the motherboard for it, that way you could have an external switch or just remap a working button.
     
  5. 7iven8Nine
    OP

    7iven8Nine Shrek's Memelord

    Member
    134
    47
    Nov 29, 2014
    United States
    Here
    Honestly, I may just fix the button. I at least know how to do that. But, I will have to take a look around and find an open source one. Thanks.
     
  6. 7iven8Nine
    OP

    7iven8Nine Shrek's Memelord

    Member
    134
    47
    Nov 29, 2014
    United States
    Here
    Alright so I got the source of GBAldr. How would I go about compiling it? I searched through the readme and found nothing.
     
  7. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,868
    9,780
    Nov 21, 2005
    United Kingdom
  8. loco365

    loco365 GBAtemp Guru

    Member
    5,458
    2,675
    Sep 1, 2010
    Out of curiosity, is this the same one as Rudolph's? I've been facing the same issue for save reading and writing and I need to fix it too.
     
  9. 7iven8Nine
    OP

    7iven8Nine Shrek's Memelord

    Member
    134
    47
    Nov 29, 2014
    United States
    Here
    The interface looks different but it does the same thing as far as I can tell.
     
  10. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,868
    9,780
    Nov 21, 2005
    United Kingdom
    If memory serves cory1492's stuff was aimed more at the 3 in 1 and thus will not handle saves terribly well, give or take SRAM. So no Flash and no eeprom (which is no small amount of the library, and in the case of flash it tends to be some of the bigger and fancier games owing to the save capacity), now there was a tool called eepinator and you also had savsender as well that could possibly do some stuff.
    http://blog.davr.org/2007/03/31/eepinator/ has a bit more.

    Rudolph came along though and just made it easy for most people so that is why we use that today, at least if you lack the nice old dumping tools *pats old EZFlash linker* or do not fancy building your own http://reinerziegler.de/GBA/gba.htm#cart reader https://hackaday.com/2010/03/18/arduino-based-multiboot-cable-for-game-boy-advance/ .
     
  11. 7iven8Nine
    OP

    7iven8Nine Shrek's Memelord

    Member
    134
    47
    Nov 29, 2014
    United States
    Here
    How exactly do I go about compiling it. I read something about a make command, but I have no idea on how to implement it within a specified folder.
    Edit: Alright I just need to know how to set the directory now. I type in cd (Whatever directory) and then I get the no such file or directory error. Is there certain syntax?
    Edit 2: I now get this output.

    USERNAME@Darthundril /c/source
    $ make
    make -C arm7
    make[1]: Entering directory `/c/source/arm7'
    main.c
    arm-none-eabi-gcc -MMD -MP -MF /c/source/arm7/build/main.d -g -Wall -O2 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -I/c/source/arm7/include -I/c/source/arm7/build -I/c/devkitPro/libnds/include -I/c/source/arm7/build -DARM7 -c /c/source/arm7/source/main.c -o main.o
    c:/source/arm7/source/main.c: In function 'gbaMode':
    c:/source/arm7/source/main.c:18:55: error: 'PM_SOUND_PWR' undeclared (first use in this function)
    writePowerManagement(0, PM_BACKLIGHT_BOTTOM | PM_SOUND_PWR);
    ^
    c:/source/arm7/source/main.c:18:55: note: each undeclared identifier is reported only once for each function it appears in
    c:/source/arm7/source/main.c: In function 'startSound':
    c:/source/arm7/source/main.c:73:112: error: 'SOUND_8BIT' undeclared (first use in this function)
    SCHANNEL_CR(channel) = SCHANNEL_ENABLE | SOUND_ONE_SHOT | SOUND_VOL(vol) | SOUND_PAN(pan) | (format==1?SOUND_8BIT:SOUND_16BIT);
    ^
    c:/source/arm7/source/main.c:73:123: error: 'SOUND_16BIT' undeclared (first use in this function)
    SCHANNEL_CR(channel) = SCHANNEL_ENABLE | SOUND_ONE_SHOT | SOUND_VOL(vol) | SOUND_PAN(pan) | (format==1?SOUND_8BIT:SOUND_16BIT);
    ^
    c:/source/arm7/source/main.c: In function 'VcountHandler':
    c:/source/arm7/source/main.c:98:19: error: too few arguments to function 'touchReadXY'
    tempPos = touchReadXY();
    ^
    In file included from c:/devkitPro/libnds/include/nds.h:289:0,
    from c:/source/arm7/source/main.c:1:
    c:/devkitPro/libnds/include/nds/arm7/touch.h:61:6: note: declared here
    void touchReadXY(touchPosition *touchPos);
    ^
    c:/source/arm7/source/main.c:99:21: error: 'touchPosition {aka struct touchPosition}' has no member named 'x'
    if ( tempPos.x == 0 || tempPos.y == 0 )
    ^
    c:/source/arm7/source/main.c:99:39: error: 'touchPosition {aka struct touchPosition}' has no member named 'y'
    if ( tempPos.x == 0 || tempPos.y == 0 )
    ^
    c:/source/arm7/source/main.c:106:24: error: 'touchPosition {aka struct touchPosition}' has no member named 'x'
    x = tempPos.x;
    ^
    c:/source/arm7/source/main.c:107:24: error: 'touchPosition {aka struct touchPosition}' has no member named 'y'
    y = tempPos.y;
    ^
    c:/source/arm7/source/main.c:134:13: error: 'IPC' undeclared (first use in this function)
    IPC->mailBusy = 1;
    ^
    c:/source/arm7/source/main.c: In function 'VblankHandler':
    c:/source/arm7/source/main.c:158:58: error: 'PM_SOUND_PWR' undeclared (first use in this function)
    writePowerManagement(0, PM_BACKLIGHT_BOTTOM| PM_SOUND_PWR);
    ^
    c:/source/arm7/source/main.c:166:5: error: unknown type name 'TransferSound'
    TransferSound *snd = IPC->soundData;
    ^
    c:/source/arm7/source/main.c:166:26: error: 'IPC' undeclared (first use in this function)
    TransferSound *snd = IPC->soundData;
    ^
    c:/source/arm7/source/main.c:171:24: error: request for member 'count' in something not a structure or union
    for (i=0; i<snd->count; i++)
    ^
    c:/source/arm7/source/main.c:176:31: error: request for member 'data' in something not a structure or union
    startSound(snd->data.rate, snd->data.data, snd->data.len, chan, snd->data.vol, snd->data.pan, snd->data.format);
    ^
    c:/source/arm7/source/main.c:176:50: error: request for member 'data' in something not a structure or union
    startSound(snd->data.rate, snd->data.data, snd->data.len, chan, snd->data.vol, snd->data.pan, snd->data.format);
    ^
    c:/source/arm7/source/main.c:176:69: error: request for member 'data' in something not a structure or union
    startSound(snd->data.rate, snd->data.data, snd->data.len, chan, snd->data.vol, snd->data.pan, snd->data.format);
    ^
    c:/source/arm7/source/main.c:176:93: error: request for member 'data' in something not a structure or union
    startSound(snd->data.rate, snd->data.data, snd->data[i].len, chan, snd->data[i].vol, snd->data[i].pan, snd->data[i].format);
    ^
    c:/source/arm7/source/main.c:176:111: error: request for member 'data' in something not a structure or union
    startSound(snd->data[i].rate, snd->data[i].data, snd->data[i].len, chan, snd->data[i].vol, snd->data[i].pan, snd->data[i].format);
    ^
    c:/source/arm7/source/main.c:176:129: error: request for member 'data' in something not a structure or union
    startSound(snd->data[i].rate, snd->data[i].data, snd->data[i].len, chan, snd->data[i].vol, snd->data[i].pan, snd->data[i].format);
    ^
    c:/source/arm7/source/main.c: In function 'main':
    c:/source/arm7/source/main.c:187:34: error: 'IPC' undeclared (first use in this function)
    rtcGetTimeAndDate((uint8 *)&(IPC->time.rtc.year)); // thanks tepples, a good interim soloution ;-)
    ^
    c:/source/arm7/source/main.c:195:5: warning: implicit declaration of function 'powerON' [-Wimplicit-function-declaration]
    powerON(POWER_SOUND);
    ^
    c:/source/arm7/source/main.c:196:5: error: 'SOUND_CR' undeclared (first use in this function)
    SOUND_CR = SOUND_ENABLE | SOUND_VOL(0x7F);
    ^
    make[2]: *** [main.o] Error 1
    make[1]: *** [build] Error 2
    make[1]: Leaving directory `/c/source/arm7'
    make: *** [arm7/source.elf] Error 2

    USERNAME@Darthundril /c/source
    $[/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i]



    Does it have something to do with setting the PATH?
     
    Last edited by 7iven8Nine, Aug 1, 2016
  12. 7iven8Nine
    OP

    7iven8Nine Shrek's Memelord

    Member
    134
    47
    Nov 29, 2014
    United States
    Here
    Okay, so its not the program I think. I just used the make command on one the examples and it worked fine. Is it possible if it can be compiled with something else and if so what could it be?
     
  13. 7iven8Nine
    OP

    7iven8Nine Shrek's Memelord

    Member
    134
    47
    Nov 29, 2014
    United States
    Here
    I went ahead and took the hardware route, but I would still like to learn how to compile this kind of stuff.
     
  14. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,868
    9,780
    Nov 21, 2005
    United Kingdom
    That looks like you have path and such all fine. What has more likely happened is you are trying to compile against the modern version of libnds when it expects the 2007 or so (not sure what year it was) version. libnds got more complex as time went on and things got renamed or needed more arguments.
    https://sourceforge.net/projects/devkitpro/files/libnds/previous/ should find you the older versions.
     
  15. Mikemk

    Mikemk GBAtemp Advanced Maniac

    Member
    1,594
    583
    Mar 26, 2015
    United States
    Not related to the discussion, but is related to the OP:
    Oftentimes, blowing [hard] upward into the shoulder buttons from the outside (not the back) will fix them.

    Do not blow into your cartridges. But Nintendo never warned us about blowing into the console itself (to my knowledge).
     
  16. 7iven8Nine
    OP

    7iven8Nine Shrek's Memelord

    Member
    134
    47
    Nov 29, 2014
    United States
    Here
    That probably would have worked if I hadn't tried to "fix" it :P

    I ended up emailing the creator and he had the versions still. I used them and it worked great.
    The next thing I'm working on is trying to compile a version of ninjhax that load "boot1.0.3dsx" instead of boot.3dsx via the cart. I wanted to make a savefile. I was trying to use the make command in the cn_bootlloader folder and I keep getting an error that goes like this:

    USERNAME@Darthundril /c/ninjhax/cn_bootloader
    $ make
    armips cn_bootloader.s
    ARMIPS Assembler v0.7d (Apr 1 2013 10:09:41) by Kingcom
    cn_bootloader.s(5) error: Included file "../build/constants.s" does not exist
    cn_bootloader.s(270) fatal error: Invalid file address cn_menuloader_loc-cn_bootloader_loc
    make: *** [cn_bootloader.bin] Error 2

    USERNAME@Darthundril /c/ninjhax/cn_bootloader

    All my paths are set up right, It just keeps saying something about a constants.s file and I have no idea where I could compile or get that.