diff --git a/Source/Core/DSPCore/Src/DSPCore.cpp b/Source/Core/DSPCore/Src/DSPCore.cpp index a5319e3ce0..b42e17cac5 100644 --- a/Source/Core/DSPCore/Src/DSPCore.cpp +++ b/Source/Core/DSPCore/Src/DSPCore.cpp @@ -121,7 +121,6 @@ bool DSPCore_Init(const char *irom_filename, const char *coef_filename) g_dsp.cr = 0x804; gdsp_ifx_init(); - // Mostly keep IRAM write protected. We unprotect only when DMA-ing // in new ucodes. WriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false); diff --git a/Source/Core/DSPCore/Src/DSPHWInterface.cpp b/Source/Core/DSPCore/Src/DSPHWInterface.cpp index 3f0e702308..a4da019c24 100644 --- a/Source/Core/DSPCore/Src/DSPHWInterface.cpp +++ b/Source/Core/DSPCore/Src/DSPHWInterface.cpp @@ -236,7 +236,6 @@ u16 gdsp_ifx_read(u16 addr) void gdsp_idma_in(u16 dsp_addr, u32 addr, u32 size) { - static bool reset = true; UnWriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false); u8* dst = ((u8*)g_dsp.iram); @@ -246,17 +245,12 @@ void gdsp_idma_in(u16 dsp_addr, u32 addr, u32 size) *(u16*)&dst[dsp_addr + i] = Common::swap16(*(const u16*)&g_dsp.cpu_ram[(addr + i) & 0x0fffffff]); } WriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false); + + g_dsp.iram_crc = DSPHost_CodeLoaded(g_dsp.cpu_ram + (addr & 0x0fffffff), size); NOTICE_LOG(DSPLLE, "*** Copy new UCode from 0x%08x to 0x%04x (crc: %8x)", addr, dsp_addr, g_dsp.iram_crc); - g_dsp.iram_crc = DSPHost_CodeLoaded(g_dsp.cpu_ram + (addr & 0x0fffffff), size); - DSPAnalyzer::Analyze(); - if (reset) { - // This calls the reset functions, but it get some games stuck - // uncomment it to help with debugging - // DSPCore_SetException(EXP_RESET); - reset = false; - } + DSPAnalyzer::Analyze(); } @@ -321,7 +315,9 @@ void gdsp_do_dma() ERROR_LOG(DSPLLE, "DMA ERROR pc: %04x ctl: %04x addr: %08x da: %04x size: %04x", g_dsp.pc, ctl, addr, dsp_addr, len); exit(0); } - +#ifdef DEBUG_EXP + NOTICE_LOG(DSPLLE, "DMA pc: %04x ctl: %04x addr: %08x da: %04x size: %04x", g_dsp.pc, ctl, addr, dsp_addr, len); +#endif switch (ctl & 0x3) { case (DSP_CR_DMEM | DSP_CR_TO_CPU): diff --git a/Source/Core/DSPCore/Src/DSPInterpreter.cpp b/Source/Core/DSPCore/Src/DSPInterpreter.cpp index aa4d2905eb..91ba88c7d0 100644 --- a/Source/Core/DSPCore/Src/DSPInterpreter.cpp +++ b/Source/Core/DSPCore/Src/DSPInterpreter.cpp @@ -75,9 +75,9 @@ void Step() { DSPCore_CheckExceptions(); +#if PROFILE g_dsp.step_counter++; -#if PROFILE g_dsp.err_pc = g_dsp.pc; ProfilerAddDelta(g_dsp.err_pc, 1);