From a6f5ac472061b1d75c5d199ab256833a51f2b52c Mon Sep 17 00:00:00 2001 From: "ramapcsx2.code" Date: Wed, 20 Mar 2013 14:50:56 +0000 Subject: [PATCH] DEV9ghzdrk: Changed the stack init hack so it is consistent on plugin resets and removed a part of it that broke OPL. Hopefully this works for all use cases, but we should fix the initial problem anyway. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5601 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/dev9ghzdrk/DEV9.cpp | 3 +++ plugins/dev9ghzdrk/Win32/smap.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/dev9ghzdrk/DEV9.cpp b/plugins/dev9ghzdrk/DEV9.cpp index 992d83043e..703ac8dd7c 100644 --- a/plugins/dev9ghzdrk/DEV9.cpp +++ b/plugins/dev9ghzdrk/DEV9.cpp @@ -168,12 +168,15 @@ void CALLBACK DEV9shutdown() { #endif } +bool tx_p_first; s32 CALLBACK DEV9open(void *pDsp) { DEV9_LOG("DEV9open\n"); LoadConf(); DEV9_LOG("open r+: %s\n", config.Hdd); config.HddSize = 8*1024; + + tx_p_first=false; // reset stack init hack so it works on game reboots iopPC = (u32*)pDsp; diff --git a/plugins/dev9ghzdrk/Win32/smap.cpp b/plugins/dev9ghzdrk/Win32/smap.cpp index 3e1d1c8c1d..b48bbb08de 100644 --- a/plugins/dev9ghzdrk/Win32/smap.cpp +++ b/plugins/dev9ghzdrk/Win32/smap.cpp @@ -107,11 +107,12 @@ void rx_process(NetPacket* pk) //note that this _is_ wrong since the IOP interrupt system is not thread safe.. but nothing i can do about that } -bool tx_p_first=false; u32 wswap(u32 d) { return (d>>16)|(d<<16); } + +extern bool tx_p_first; void tx_process() { //we loop based on count ? or just *use* it ? @@ -119,9 +120,10 @@ void tx_process() //spams// printf("tx_process : %d cnt frames !\n",cnt); //Hack needed for GT4. Game fails to init the adapter otherwise (and notices about that via IOP kprintf on bootup). + //Reseting SMAP_R_TXFIFO_FRAME_CNT to 0 however breaks OPL. Thankfully not doing that fixes the problem while GT4 still works. if (!tx_p_first) { - dev9Ru8(SMAP_R_TXFIFO_FRAME_CNT)=0; + //dev9Ru8(SMAP_R_TXFIFO_FRAME_CNT)=0; tx_p_first=true; //THIS IS A HACK.without that the stack wont init, i guess its missing e3/emac emulation .. emu_printf("WARN : First packet interrupt hack ..\n");