diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index 991f3e678..ab7bf6cdf 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -2934,6 +2934,7 @@ u32 FASTCALL _MMU_ARM9_read32(u32 adr) if((MEM_8(MMU.MMU_MEM[ARMCPU_ARM9], REG_GCCMDOUT) == 0xB7) && (MMU.dscard[ARMCPU_ARM9].address < 0x8000)) { MMU.dscard[ARMCPU_ARM9].address = (0x8000 + (MMU.dscard[ARMCPU_ARM9].address&0x1FF)); + INFO("Read below 0x8000 from: %08X\n", NDS_ARM9.instruct_adr); } val = T1ReadLong(MMU.CART_ROM, MMU.dscard[ARMCPU_ARM9].address & MMU.CART_ROM_MASK); } diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index 527a0deb9..7b8b1bb2e 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -1915,7 +1915,9 @@ void NDS_exec(s32 nb) } T1WriteWord(ARM9Mem.ARM9_REG, 6, nds.VCount); + T1WriteWord(ARM9Mem.ARM9_REG, 0x1006, nds.VCount); T1WriteWord(MMU.ARM7_REG, 6, nds.VCount); + T1WriteWord(MMU.ARM7_REG, 0x1006, nds.VCount); vmatch = T1ReadWord(ARM9Mem.ARM9_REG, 4); if(nds.VCount==((vmatch>>8)|((vmatch<<1)&(1<<8)))) diff --git a/desmume/src/addons/compactFlash.cpp b/desmume/src/addons/compactFlash.cpp index 9b2989a42..094f8a170 100644 --- a/desmume/src/addons/compactFlash.cpp +++ b/desmume/src/addons/compactFlash.cpp @@ -541,7 +541,9 @@ static BOOL cflash_init() { file_size = LSEEK_FN( disk_image, 0, SEEK_END); if (0 && file_size == -1) + { CFLASHLOG( "Error when seeking to end of disk image" ); + } else { LSEEK_FN( disk_image, 0, SEEK_SET); diff --git a/desmume/src/arm_instructions.cpp b/desmume/src/arm_instructions.cpp index 266c55cbc..a377189e7 100644 --- a/desmume/src/arm_instructions.cpp +++ b/desmume/src/arm_instructions.cpp @@ -224,7 +224,7 @@ extern volatile BOOL execute; TEMPLATE static u32 FASTCALL OP_UND() { - LOG("Undefined instruction: %08X\n", cpu->instruction); + LOG("Undefined instruction: %08X from %08X\n", cpu->instruction, cpu->instruct_adr); emu_halt(); LOG("Stopped (OP_UND)\n"); return 1; diff --git a/desmume/src/mc.cpp b/desmume/src/mc.cpp index 83cd8702a..8ca470dfd 100644 --- a/desmume/src/mc.cpp +++ b/desmume/src/mc.cpp @@ -538,6 +538,7 @@ void BackupDevice::loadfile() { //never use save files if we are in movie mode if(isMovieMode) return; + if(filename.length() ==0) return; //No sense crashing if no filename supplied FILE* inf = fopen(filename.c_str(),"rb"); if(!inf) diff --git a/desmume/src/windows/disView.cpp b/desmume/src/windows/disView.cpp index 443188345..195b1e2ef 100644 --- a/desmume/src/windows/disView.cpp +++ b/desmume/src/windows/disView.cpp @@ -587,7 +587,7 @@ BOOL CALLBACK ViewDisasm_ARM9Proc (HWND hwnd, UINT message, WPARAM wParam, LPARA DisView9->curr_ligne <<= 1 ; } else if (!(DisView9->cpu->CPSR.bits.T) && (DisView9->mode == 2)) { /* from thumb to arm, line / 2 */ - DisView9->curr_ligne >>= 1 ; + DisView9->curr_ligne >>= 2 ; } DisView9->mode = 0; InvalidateRect(GetDlgItem(hwnd, IDC_DES_BOX), NULL, FALSE); @@ -595,7 +595,7 @@ BOOL CALLBACK ViewDisasm_ARM9Proc (HWND hwnd, UINT message, WPARAM wParam, LPARA case IDC_ARM : /* address to line correction */ if ((DisView9->mode==2) || ((DisView9->mode==0) && (DisView9->cpu->CPSR.bits.T))) { - DisView9->curr_ligne >>= 1 ; + DisView9->curr_ligne >>= 2 ; } ; DisView9->mode = 1; InvalidateRect(GetDlgItem(hwnd, IDC_DES_BOX), NULL, FALSE); @@ -626,9 +626,9 @@ BOOL CALLBACK ViewDisasm_ARM9Proc (HWND hwnd, UINT message, WPARAM wParam, LPARA return 1; case IDC_STEP : // TODO: draw in DD { - int ndstep; - ndstep = GetDlgItemInt(hwnd, IDC_SETPNUM, NULL, FALSE); - NDS_exec(ndstep); + int ndstep; + ndstep = GetDlgItemInt(hwnd, IDC_SETPNUM, NULL, FALSE); + NDS_exec(ndstep); } return 1; case IDC_GO :