From 266f6fcd5d636ee89386d619a8d378d6dd21e36d Mon Sep 17 00:00:00 2001 From: gigaherz Date: Sun, 4 Sep 2011 01:49:34 +0000 Subject: [PATCH] Made USBsetRAM work again. Required for the following commit. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4897 96395faa-99c1-11dd-bbfe-3dabce05a288 --- bin/portable.ini | 1 + pcsx2/PluginManager.cpp | 6 ++++-- pcsx2/R5900.cpp | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/portable.ini b/bin/portable.ini index e69de29bb2..ccb32ee0b2 100644 --- a/bin/portable.ini +++ b/bin/portable.ini @@ -0,0 +1 @@ +RunWizard=0 diff --git a/pcsx2/PluginManager.cpp b/pcsx2/PluginManager.cpp index 7ea2ce9793..0fc2cba716 100644 --- a/pcsx2/PluginManager.cpp +++ b/pcsx2/PluginManager.cpp @@ -646,6 +646,7 @@ static const LegacyApi_ReqMethod s_MethMessReq_USB[] = static const LegacyApi_OptMethod s_MethMessOpt_USB[] = { { "USBasync", (vMeth**)&USBasync }, + { "USBsetRAM", (vMeth**)&USBsetRAM }, { NULL } }; @@ -1108,8 +1109,9 @@ bool SysCorePlugins::OpenPlugin_USB() if( USBopen((void*)pDsp) ) return false; USBirqCallback( usbIrq ); usbHandler = USBirqHandler(); - if( USBsetRAM != NULL ) - USBsetRAM(iopMem->Main); + // iopMem is not initialized yet. Moved elsewhere + //if( USBsetRAM != NULL ) + // USBsetRAM(iopMem->Main); return true; } diff --git a/pcsx2/R5900.cpp b/pcsx2/R5900.cpp index 9c14ab3dea..db32ba281a 100644 --- a/pcsx2/R5900.cpp +++ b/pcsx2/R5900.cpp @@ -90,6 +90,10 @@ void cpuReset() DiscSerial = L""; ElfEntry = -1; + // Probably not the right place, but it has to be done when the ram is actually initialized + if(USBsetRAM != 0) + USBsetRAM(iopMem->Main); + // FIXME: LastELF should be reset on media changes as well as on CPU resets, in // the very unlikely case that a user swaps to another media source that "looks" // the same (identical ELF names) but is actually different (devs actually could