diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index efa5f843b..577304e07 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -2582,7 +2582,7 @@ bool NDS_FakeBoot() _MMU_write32(0x027FFE00+i*4, LE_TO_LOCAL_32(((u32*)MMU.CART_ROM)[i])); } - //firmware sets the cpus to an initial state with their respective programs entrypoints + //the firmware will be booting to these entrypoint addresses via BX (well, the arm9 at least; is unverified for the arm7) armcpu_init(&NDS_ARM7, header->ARM7exe); armcpu_init(&NDS_ARM9, header->ARM9exe); @@ -2618,11 +2618,6 @@ bool NDS_FakeBoot() TSCal.scr.width = (TSCal.scr.x2 - TSCal.scr.x1); TSCal.scr.height = (TSCal.scr.y2 - TSCal.scr.y1); - //zero 11-aug-2013 - dont think we need this. the emulator will be setting these nonstop - //_MMU_write16(REG_KEYINPUT, 0x3FF); - //_MMU_write16(REG_KEYINPUT, 0x3FF); - //_MMU_write08(REG_EXTKEYIN, 0x43); - //bitbox 4k demo is so stripped down it relies on default stack values //otherwise the arm7 will crash before making a sound //(these according to gbatek softreset bios docs) @@ -2655,7 +2650,10 @@ bool NDS_FakeBoot() const u32 kCommandline = 0x027E0000; //const u32 kCommandline = 0x027FFF84; - // + //homebrew-related stuff. + //its safe to put things in this position.. apparently nothing important is here. + //however, some games could be checking them as an anti-desmume measure, so we might have to control it with slot-1 settings to suggest booting a homebrew app + //perhaps we could automatically boot homebrew to an R4-like device. _MMU_write32(0x02FFFE70, 0x5f617267); _MMU_write32(0x02FFFE74, kCommandline); //(commandline starts here) _MMU_write32(0x02FFFE78, rompath.size()+1); diff --git a/desmume/src/armcpu.cpp b/desmume/src/armcpu.cpp index 8d45f2514..4eb3322cd 100644 --- a/desmume/src/armcpu.cpp +++ b/desmume/src/armcpu.cpp @@ -171,7 +171,7 @@ void armcpu_init(armcpu_t *armcpu, u32 adr) memcpy(&armcpu->cond_table[0], &arm_cond_table[0], sizeof(arm_cond_table)); #endif - armcpu->LDTBit = (armcpu->proc_ID==0); //Si ARM9 utiliser le syte v5 pour le load + armcpu->LDTBit = (armcpu->proc_ID==0); //set ARMv5 style bit--different for each processor armcpu->intVector = 0xFFFF0000 * (armcpu->proc_ID==0); armcpu->waitIRQ = FALSE; armcpu->halt_IE_and_IF = FALSE; @@ -202,7 +202,9 @@ void armcpu_init(armcpu_t *armcpu, u32 adr) //armcpu->R[15] = adr; //#endif - armcpu->next_instruction = adr; + //do something sensible when booting up to a thumb address + armcpu->next_instruction = adr & ~1; + armcpu->CPSR.bits.T = BIT0(adr); //#ifndef GDB_STUB armcpu_prefetch(armcpu); diff --git a/desmume/src/windows/DeSmuME_2005.vcproj b/desmume/src/windows/DeSmuME_2005.vcproj index 4716a8345..d17c37065 100644 --- a/desmume/src/windows/DeSmuME_2005.vcproj +++ b/desmume/src/windows/DeSmuME_2005.vcproj @@ -685,14 +685,6 @@ RelativePath=".\disView.h" > - - - - @@ -705,6 +697,14 @@ RelativePath=".\FirmConfig.h" > + + + + @@ -1593,6 +1593,10 @@ RelativePath="..\utils\emufat.h" > + + @@ -1601,10 +1605,6 @@ RelativePath="..\utils\fsnitro.h" > - - @@ -2520,10 +2520,6 @@ RelativePath="..\arm_instructions.cpp" > - -