ARDS code for swapping screens

Discussion in 'NDS - Emulation and Homebrew' started by froggestspirit, Dec 11, 2015.

  1. froggestspirit
    OP

    froggestspirit D/P/Pt Demix Guy

    Member
    1,111
    544
    Jul 28, 2011
    United States
    Hi, I'm working on making a single screen DS, and was also working on making an AR code to swap which screen displays on the single screen. This can be done by the 15th bit at 0x04000304 in ARM9.
    This is the code I came up with, but for some reason, it doesn't work:
    94000130 FFB30000 //Is Start+Select+up pressed?
    94000304 7FFF0000 //Is the 15th bit at 0x04000304 0?
    D9000000 04000304 //load the 32 bit value from 0x04000304
    D4000000 00008000 //add to it (basically set the 15th bit to 1)
    D6000000 04000304 //store it
    D2000000 00000000 //end if/clear status
    94000130 FF730000 //Is Start+Select+down pressed?
    94000304 7FFF8000 //Is the 15th bit at 0x04000304 1?
    D9000000 04000304 //load the 32 bit value from 0x04000304
    D4000000 FFFF8000 //add to it (basically set the 15th bit to 0)
    D6000000 04000304 //store it
    D2000000 00000000 //end if/clear status
    If anyone can find an error with this code, please tell me. I tried it in Mario Kart, but it should work for any game. (If mario kart DS requires an M code, this might be the problem, because I couldn't find one)

    Edit: It appears that this works in the No$GBA emulator, but not on the actual hardware (DSlite & PhatDS tested) Can anyone confirm if AR can't access this address?
     
    Last edited by froggestspirit, Dec 11, 2015