void DSPLLE::DoState(PointerWrap &p) { bool isHLE = false; p.Do(isHLE); if (isHLE != false && p.GetMode() == PointerWrap::MODE_READ) { Core::DisplayMessage("State is incompatible with current DSP engine. Aborting load state.", 3000); p.SetMode(PointerWrap::MODE_VERIFY); return; } p.Do(g_dsp.r); p.Do(g_dsp.pc); #if PROFILE p.Do(g_dsp.err_pc); #endif p.Do(g_dsp.cr); p.Do(g_dsp.reg_stack_ptr); p.Do(g_dsp.exceptions); p.Do(g_dsp.external_interrupt_waiting); for (int i = 0; i < 4; i++) { p.Do(g_dsp.reg_stack[i]); } p.Do(g_dsp.step_counter); p.Do(g_dsp.ifx_regs); p.Do(g_dsp.mbox[0]); p.Do(g_dsp.mbox[1]); UnWriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false); p.DoArray(g_dsp.iram, DSP_IRAM_SIZE); WriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false); if (p.GetMode() == PointerWrap::MODE_READ) DSPHost_CodeLoaded((const u8*)g_dsp.iram, DSP_IRAM_BYTE_SIZE); p.DoArray(g_dsp.dram, DSP_DRAM_SIZE); p.Do(cyclesLeft); p.Do(init_hax); p.Do(m_cycle_count); bool prevInitMixer = m_InitMixer; p.Do(m_InitMixer); if (prevInitMixer != m_InitMixer && p.GetMode() == PointerWrap::MODE_READ) { if (m_InitMixer) { InitMixer(); AudioCommon::PauseAndLock(true); } else { AudioCommon::PauseAndLock(false); soundStream->Stop(); delete soundStream; soundStream = NULL; } } }
static void gdsp_idma_in(u16 dsp_addr, u32 addr, u32 size) { UnWriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false); u8* dst = ((u8*)g_dsp.iram); for (u32 i = 0; i < size; i += 2) { *(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); if (dspjit) dspjit->ClearIRAM(); DSPAnalyzer::Analyze(); }