From 3d04b20ec8e97cf575925486f480736e26415fa5 Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Mon, 29 Aug 2011 18:32:27 +0000 Subject: [PATCH] Get some PSX mode logging to work again. We currently freeze with it reading the GPU_STATUS register as all 0. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4885 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/IopHw.h | 3 +++ pcsx2/ps2/Iop/IopHwRead.cpp | 31 ++++++++++++++++++------------- pcsx2/ps2/Iop/IopHwWrite.cpp | 33 +++++++++++++++++++-------------- pcsx2/ps2/Iop/IopHw_Internal.h | 3 +++ 4 files changed, 43 insertions(+), 27 deletions(-) diff --git a/pcsx2/IopHw.h b/pcsx2/IopHw.h index 194ef1dfa2..57fd5e5a17 100644 --- a/pcsx2/IopHw.h +++ b/pcsx2/IopHw.h @@ -67,6 +67,9 @@ static const u32 HW_CDR_DATA2 = 0x1f801802, // CDROM multipurpose data register 3 HW_CDR_DATA3 = 0x1f801803, // CDROM multipurpose data register 4 + HW_PS1_GPU_DATA = 0x1f801810, // PS1 GPU DATA register + HW_PS1_GPU_STATUS = 0x1f801814, // PS1 GPU STATUS register + // SIO2 is a DMA interface for the SIO. HW_SIO2_DATAIN = 0x1F808260, diff --git a/pcsx2/ps2/Iop/IopHwRead.cpp b/pcsx2/ps2/Iop/IopHwRead.cpp index 31998d30f4..dcd822a9ad 100644 --- a/pcsx2/ps2/Iop/IopHwRead.cpp +++ b/pcsx2/ps2/Iop/IopHwRead.cpp @@ -293,20 +293,25 @@ static __fi T _HwRead_16or32_Page1( u32 addr ) break; // ------------------------------------------------------------------------ - // Legacy GPU emulation (not needed). - // The IOP emulates the GPU itself through the EE's hardware. + // Legacy GPU emulation + // - /*case 0x810: - PSXHW_LOG("GPU DATA 32bit write %lx", value); - GPU_writeData(value); return; - case 0x814: - PSXHW_LOG("GPU STATUS 32bit write %lx", value); - GPU_writeStatus(value); return; - - case 0x820: - mdecWrite0(value); break; - case 0x824: - mdecWrite1(value); break;*/ + mcase (HW_PS1_GPU_DATA): + ret = psxHu32(addr); + break; + + mcase (HW_PS1_GPU_STATUS): + ret = psxHu32(addr); + //ret = -1; // fake alive GPU :p + break; + + mcase (0x1f801820): // MDEC + ret = psxHu32(addr); + break; + + mcase (0x1f801824): // MDEC + ret = psxHu32(addr); + break; // ------------------------------------------------------------------------ diff --git a/pcsx2/ps2/Iop/IopHwWrite.cpp b/pcsx2/ps2/Iop/IopHwWrite.cpp index 01fb7fc7e1..5449547389 100644 --- a/pcsx2/ps2/Iop/IopHwWrite.cpp +++ b/pcsx2/ps2/Iop/IopHwWrite.cpp @@ -453,22 +453,27 @@ static __fi void _HwWrite_16or32_Page1( u32 addr, T val ) break; // ------------------------------------------------------------------------ - // Legacy GPU emulation (not needed). - // The IOP emulates the GPU itself through the EE's hardware. + // Legacy GPU emulation + // - /*case 0x810: - PSXHW_LOG("GPU DATA 32bit write %lx", value); - GPU_writeData(value); return; - case 0x814: - PSXHW_LOG("GPU STATUS 32bit write %lx", value); - GPU_writeStatus(value); return; + mcase (HW_PS1_GPU_DATA): + psxHu(addr) = val; // guess + //GPU_writeData(value); // really old code from PCSX? (rama) + break; + mcase (HW_PS1_GPU_STATUS): + psxHu(addr) = val; // guess + //GPU_writeStatus(value); // really old code from PCSX? (rama) + break; + mcase (0x1f801820): // MDEC + psxHu(addr) = val; // guess + //mdecWrite0(value); // really old code from PCSX? (rama) + break; + mcase (0x1f801824): // MDEC + psxHu(addr) = val; // guess + //mdecWrite1(value); // really old code from PCSX? (rama) + break; - case 0x820: - mdecWrite0(value); break; - case 0x824: - mdecWrite1(value); break;*/ - - // ------------------------------------------------------------------------ + // ------------------------------------------------------------------------ mcase(HW_DEV9_DATA): DEV9write16( addr, val ); diff --git a/pcsx2/ps2/Iop/IopHw_Internal.h b/pcsx2/ps2/Iop/IopHw_Internal.h index 2219f72544..efc50f09d0 100644 --- a/pcsx2/ps2/Iop/IopHw_Internal.h +++ b/pcsx2/ps2/Iop/IopHw_Internal.h @@ -138,6 +138,9 @@ static __ri const char* _ioplog_GetHwName( u32 addr, T val ) case HW_CDR_DATA2: return "CDROM DATA2"; case HW_CDR_DATA3: return "CDROM DATA3"; + case HW_PS1_GPU_DATA: return "PS1 GPU DATA"; + case HW_PS1_GPU_STATUS: return "PS1 GPU STATUS"; + case 0x1f80380c: return "STDOUT"; // ------------------------------------------------------------------------