From caf05e22ea5fbe0c26c2fe6ca400edfbb3fdf451 Mon Sep 17 00:00:00 2001 From: normmatt234 Date: Sun, 17 May 2009 05:58:08 +0000 Subject: [PATCH] Fix windows disassembler goto addressing. Clear SPI variables on reset. --- desmume/src/MMU.cpp | 6 +++++- desmume/src/windows/disView.cpp | 12 ++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index 16863ba59..27aa609ce 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -995,6 +995,9 @@ void MMU_clearMem() memset(MMU.dscard, 0, sizeof(nds_dscard) * 2); + SPI_CNT = 0; + AUX_SPI_CNT = 0; + // Enable the sound speakers T1WriteWord(MMU.ARM7_REG, 0x304, 0x0001); @@ -2595,7 +2598,8 @@ void FASTCALL _MMU_ARM9_write32(u32 adr, u32 val) default: { - LOG("CARD command: %02X\n", MEM_8(MMU.MMU_MEM[ARMCPU_ARM9], REG_GCCMDOUT)); + LOG("CARD command: %02X\t", MEM_8(MMU.MMU_MEM[ARMCPU_ARM9], REG_GCCMDOUT)); + LOG("FROM: %08X\n", NDS_ARM9.instruct_adr); MMU.dscard[ARMCPU_ARM9].address = 0; MMU.dscard[ARMCPU_ARM9].transfer_count = 0; } diff --git a/desmume/src/windows/disView.cpp b/desmume/src/windows/disView.cpp index d8e3df0e6..443188345 100644 --- a/desmume/src/windows/disView.cpp +++ b/desmume/src/windows/disView.cpp @@ -409,15 +409,15 @@ BOOL CALLBACK ViewDisasm_ARM7Proc (HWND hwnd, UINT message, WPARAM wParam, LPARA /* address to line correction */ switch (DisView7->mode) { case 0: /* auto */ - DisView7->curr_ligne = adr>>1; + DisView7->curr_ligne = adr>>2; if (DisView7->cpu->CPSR.bits.T) { DisView7->curr_ligne = adr>>1; } break ; - case 1: /* thumb */ + case 1: /* arm */ DisView7->curr_ligne = adr>>2; break ; - case 2: /* arm */ + case 2: /* thumb */ DisView7->curr_ligne = adr>>1; break ; } ; @@ -653,15 +653,15 @@ BOOL CALLBACK ViewDisasm_ARM9Proc (HWND hwnd, UINT message, WPARAM wParam, LPARA /* address to line correction */ switch (DisView9->mode) { case 0: /* auto */ - DisView9->curr_ligne = adr>>1; + DisView9->curr_ligne = adr>>2; if (DisView9->cpu->CPSR.bits.T) { DisView9->curr_ligne = adr>>1; } break ; - case 1: /* thumb */ + case 1: /* arm */ DisView9->curr_ligne = adr>>2; break ; - case 2: /* arm */ + case 2: /* thumb */ DisView9->curr_ligne = adr>>1; break ; } ;