From 92ef4f115638a677f2e6a1f2baff6da537b82a19 Mon Sep 17 00:00:00 2001 From: ayuanx Date: Sat, 2 Jan 2010 05:15:36 +0000 Subject: [PATCH] 1. Fixed the freeze issue in "Super Mario Galaxy" and other games, which was introduced since r4762 2. Fixed Issue 1909 Multi-Nunchuck control problem 3. Updated SYSCONF, which should enable games that require MotionPlus, such as "Wii Sports Resort" git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4773 8ced0084-cf51-0410-be5f-012b33b47a6e --- Data/User/Wii/shared2/sys/SYSCONF | Bin 16384 -> 16384 bytes .../Core/VideoCommon/Src/CommandProcessor.cpp | 5 +++-- Source/Core/VideoCommon/Src/Fifo.cpp | 5 ++--- .../Plugin_Wiimote/Src/EmuDefinitions.cpp | 2 +- .../Plugin_Wiimote/Src/EmuDefinitions.h | 2 +- Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp | 2 +- .../Plugin_Wiimote/Src/EmuSubroutines.cpp | 4 ++-- .../Plugins/Plugin_Wiimote/Src/FillReport.cpp | 6 +++--- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Data/User/Wii/shared2/sys/SYSCONF b/Data/User/Wii/shared2/sys/SYSCONF index 2209aa9adc157a7cb79aaa19402c666be7b3f85a..283c84a7e4b2015ba7f49a9c49b6d298bca14a06 100644 GIT binary patch delta 97 zcmV-n0G|JVfB}Gj0X|bhb}#@N06qk%1hoXz1l$DV1nmU&6$up-6&)3C6?_$i7nB#E z7pxbw7rht87ta^i7vLA|7x)+g7z!8`u{_Kd4Czf!Oj9mRPgY4q0kaVpohJc0le9lf D-IO0T delta 83 zcmV-Z0IdIjfB}Gj0X$Pfb}#@M06YYz1hWLv1lk1R1nUI!6$cd(6&n?86?zqe7m^pA p7pfPs7rPh47tI&e7v2}^7xowc7znXG%onpE7?LNF0UMLGKTAbs8)*Ol diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index e966b5ffcc..ba9a75ed7a 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -158,6 +158,7 @@ void Init() memset(&fifo,0,sizeof(fifo)); fifo.CPCmdIdle = 1 ; fifo.CPReadIdle = 1; + fifo.bFF_Breakpoint = 1; s_fifoIdleEvent.Init(); @@ -564,7 +565,7 @@ bool AllowIdleSkipping() // if not then lock CPUThread until GP finish a frame. void WaitForFrameFinish() { - while ((fake_GPWatchdogLastToken == fifo.Fake_GPWDToken) && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance && !fifo.bFF_Breakpoint) + while ((fake_GPWatchdogLastToken == fifo.Fake_GPWDToken) && fifo.bFF_GPReadEnable && ((!fifo.bFF_BPEnable && fifo.CPReadWriteDistance) || (fifo.bFF_BPEnable && !fifo.bFF_Breakpoint))); s_fifoIdleEvent.MsgWait(); fake_GPWatchdogLastToken = fifo.Fake_GPWDToken; @@ -605,7 +606,7 @@ void STACKALIGN GatherPipeBursted() // - CPU can write to fifo // - disable Underflow interrupt - INFO_LOG(COMMANDPROCESSOR, "(GatherPipeBursted): CPHiWatermark reached, 0x%04X, 0x%04X", fifo.CPReadWriteDistance, fifo.CPLoWatermark); + INFO_LOG(COMMANDPROCESSOR, "(GatherPipeBursted): CPHiWatermark (Hi: 0x%04x, Lo: 0x%04x) reached (RWDistance: 0x%04x)", fifo.CPHiWatermark, fifo.CPLoWatermark, fifo.CPReadWriteDistance); // Wait for GPU to catch up while (fifo.CPReadWriteDistance > fifo.CPLoWatermark && !fifo.bFF_Breakpoint) s_fifoIdleEvent.MsgWait(); diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index 3150f43120..18ce3208e2 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -164,7 +164,6 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize) CommandProcessor::UpdateInterruptsFromVideoPlugin(true); break; } - distToSend = 32; if ( readPtr >= _fifo.CPEnd) @@ -201,9 +200,9 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize) // leading the CPU thread to wait in Video_BeginField or Video_AccessEFB thus slowing things down. VideoFifo_CheckEFBAccess(); VideoFifo_CheckSwapRequest(); - - CommandProcessor::SetFifoIdleFromVideoPlugin(); } + + CommandProcessor::SetFifoIdleFromVideoPlugin(); Common::YieldCPU(); } fifo_exit_event.Set(); diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.cpp b/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.cpp index 8615f4edf6..f46c042f4b 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.cpp @@ -54,7 +54,7 @@ bool g_ReportingAuto[MAX_WIIMOTES]; // Auto report or passive report u8 g_ReportingMode[MAX_WIIMOTES]; // The reporting mode and channel id u16 g_ReportingChannel[MAX_WIIMOTES]; -wiimote_key g_ExtKey; // The extension encryption key +wiimote_key g_ExtKey[MAX_WIIMOTES]; // The extension encryption key bool g_Encryption; // Encryption on or off // Gamepad input diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.h b/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.h index 8d71cc9ee9..dfed3356db 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.h +++ b/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.h @@ -86,7 +86,7 @@ extern bool g_ReportingAuto[MAX_WIIMOTES]; extern u8 g_ReportingMode[MAX_WIIMOTES]; extern u16 g_ReportingChannel[MAX_WIIMOTES]; -extern wiimote_key g_ExtKey; // extension encryption key +extern wiimote_key g_ExtKey[MAX_WIIMOTES]; // extension encryption key extern bool g_Encryption; /* An example of a factory default first bytes of the Eeprom memory. There are differences between diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp b/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp index df461a242a..74b4d09bc1 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp @@ -481,7 +481,6 @@ void DoState(PointerWrap &p) p.DoArray(g_RegExtTmp, WIIMOTE_REG_EXT_SIZE); p.DoArray(g_RegIr, WIIMOTE_REG_IR_SIZE); - p.Do(g_ExtKey); p.Do(g_Encryption); //p.Do(NumPads); @@ -500,6 +499,7 @@ void DoState(PointerWrap &p) p.Do(g_ReportingChannel[i]); //p.Do(g_IR[i]); p.Do(g_Leds[i]); + p.Do(g_ExtKey[i]); } return; } diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp b/Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp index 8d50275e79..c5f0f5eb40 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp @@ -267,7 +267,7 @@ void WmReadData(u16 _channelID, wm_read_data* rd) memcpy(g_RegExtTmp, g_RegExt[g_ID], sizeof(g_RegExt[0])); // Encrypt g_RegExtTmp at that location - wiimote_encrypt(&g_ExtKey, &g_RegExtTmp[address & 0xffff], (address & 0xffff), (u8)size); + wiimote_encrypt(&g_ExtKey[g_ID], &g_RegExtTmp[address & 0xffff], (address & 0xffff), (u8)size); // Update the block that SendReadDataReply will eventually send to the Wii block = g_RegExtTmp; @@ -446,7 +446,7 @@ void WmWriteData(u16 _channelID, wm_write_data* wd) that we send it parts of a key, only the last full key will have an effect */ if(address >= 0x40 && address <= 0x4c) - wiimote_gen_key(&g_ExtKey, &g_RegExt[g_ID][0x40]); + wiimote_gen_key(&g_ExtKey[g_ID], &g_RegExt[g_ID][0x40]); } } diff --git a/Source/Plugins/Plugin_Wiimote/Src/FillReport.cpp b/Source/Plugins/Plugin_Wiimote/Src/FillReport.cpp index dbf1be43b8..91dfa02d9b 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/FillReport.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/FillReport.cpp @@ -815,7 +815,7 @@ void FillReportExtension(wm_extension& _ext) // Copy the data to it memcpy(Tmp, &_ext, sizeof(_ext)); // Encrypt it - wiimote_encrypt(&g_ExtKey, Tmp, 0x00, sizeof(_ext)); + wiimote_encrypt(&g_ExtKey[g_ID], Tmp, 0x00, sizeof(_ext)); // Write it back to the struct memcpy(&_ext, Tmp, sizeof(_ext)); } @@ -1077,7 +1077,7 @@ void FillReportClassicExtension(wm_classic_extension& _ext) // Copy the data to it memcpy(Tmp, &_ext, sizeof(_ext)); // Encrypt it - wiimote_encrypt(&g_ExtKey, Tmp, 0x00, sizeof(_ext)); + wiimote_encrypt(&g_ExtKey[g_ID], Tmp, 0x00, sizeof(_ext)); // Write it back to the struct memcpy(&_ext, Tmp, sizeof(_ext)); } @@ -1172,7 +1172,7 @@ void FillReportGuitarHero3Extension(wm_GH3_extension& _ext) // Copy the data to it memcpy(Tmp, &_ext, sizeof(_ext)); // Encrypt it - wiimote_encrypt(&g_ExtKey, Tmp, 0x00, sizeof(_ext)); + wiimote_encrypt(&g_ExtKey[g_ID], Tmp, 0x00, sizeof(_ext)); // Write it back to the struct memcpy(&_ext, Tmp, sizeof(_ext)); }