From 81afdbe4f47ae38cc0707e5c824caacd27f1c180 Mon Sep 17 00:00:00 2001 From: ayuanx Date: Fri, 8 Jan 2010 22:56:27 +0000 Subject: [PATCH] Compilation fix for r4795 Nunchuck gravity fix for r4794 (as sanchez instructed) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4797 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/MemArena.cpp | 7 +++++-- Source/Core/VideoCommon/Src/CommandProcessor.cpp | 4 ++-- Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp | 5 ++--- Source/Plugins/Plugin_Wiimote/Src/ConfigRecordingDlg.cpp | 2 +- Source/Plugins/Plugin_Wiimote/Src/ReadWiimote.cpp | 6 +++--- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Source/Core/Common/Src/MemArena.cpp b/Source/Core/Common/Src/MemArena.cpp index 9d918243a2..f8a71e9c5c 100644 --- a/Source/Core/Common/Src/MemArena.cpp +++ b/Source/Core/Common/Src/MemArena.cpp @@ -218,6 +218,8 @@ bail: u8 *MemoryMap_Setup(const MemoryView *views, int num_views, u32 flags, MemArena *arena) { u32 total_mem = 0; + int base_attempts = 0; + for (int i = 0; i < num_views; i++) { SKIP(flags, views[i].flags); @@ -243,9 +245,10 @@ u8 *MemoryMap_Setup(const MemoryView *views, int num_views, u32 flags, MemArena // Try a whole range of possible bases. Return once we got a valid one. u32 max_base_addr = 0x7FFF0000 - 0x31000000; u8 *base = NULL; - int base_attempts = 1; + for (u32 base_addr = 0x40000; base_addr < max_base_addr; base_addr += 0x40000) { + base_attempts++; base = (u8 *)base_addr; if (Memory_TryBase(base, views, num_views, flags, arena)) { @@ -253,7 +256,7 @@ u8 *MemoryMap_Setup(const MemoryView *views, int num_views, u32 flags, MemArena base_attempts = 0; break; } - base_attempts++; + } #else // Linux32 is fine with the x64 method, although limited to 32-bit with no automirrors. diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index edcc0dc763..2e39d34cfd 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -408,11 +408,11 @@ void Write16(const u16 _Value, const u32 _Address) { // Clear old BP and initiate new BP Common::AtomicStore(fifo.bFF_Breakpoint, 0); - // AyuanX: The following is a hack + // AyuanX: The following is a hack for dual core // There is definitely some initialization problem with Dolphin (not found exact location yet) // Which prevents Metroid Prime 2 from first time booting (If you boot some other GC game first then MP2 can boot) // But somehow this instant BP hack can make MP2 boot even at first time - UpdateInterrupts(true); + if (g_VideoInitialize.bOnThread) UpdateInterrupts(true); } INFO_LOG(COMMANDPROCESSOR,"\t write to CTRL_REGISTER : %04x", _Value); diff --git a/Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp b/Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp index b85a6198d8..117b3d6556 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp @@ -109,7 +109,6 @@ void WiimoteBasicConfigDialog::ButtonClick(wxCommandEvent& event) m_RecordingConfigFrame->ShowModal(); m_RecordingConfigFrame->Destroy(); m_RecordingConfigFrame = NULL; - m_Page = g_Config.CurrentPage; break; #ifdef WIN32 case ID_BUTTONPAIRUP: @@ -250,10 +249,10 @@ void WiimoteBasicConfigDialog::CreateGUIControls() m_ButtonMapping = new wxButton(this, ID_BUTTONMAPPING, wxT("Button Mapping")); m_Recording = new wxButton(this, ID_BUTTONRECORDING, wxT("Recording")); - m_ButtonPairUp = new wxButton(this, ID_BUTTONPAIRUP, wxT("Pair Up Wiimote(s)")); + m_ButtonPairUp = new wxButton(this, ID_BUTTONPAIRUP, wxT("Wiimotes PairUp")); #ifdef WIN32 - m_ButtonPairUp->SetToolTip(wxT("Pair up your Wiimote(s) with your system.\nPress the Buttons 1 and 2 on your Wiimote before pairing up.\nThis might take a few seconds.\nIt only works if you're using Microsoft's Bluetooth stack.")); // Only working with MS BT Stack. + m_ButtonPairUp->SetToolTip(wxT("Pair up your Wiimotes with your system.\nPress the Buttons 1 and 2 on your Wiimote before pairing up.\nThis might take a few seconds.\nIt only works if you're using Microsoft's Bluetooth stack.")); // Only working with MS BT Stack. #else m_ButtonPairUp->Enable(false); #endif diff --git a/Source/Plugins/Plugin_Wiimote/Src/ConfigRecordingDlg.cpp b/Source/Plugins/Plugin_Wiimote/Src/ConfigRecordingDlg.cpp index df438bf76b..f1366b6b31 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/ConfigRecordingDlg.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/ConfigRecordingDlg.cpp @@ -98,7 +98,7 @@ void WiimoteRecordingConfigDialog::CloseClick(wxCommandEvent& event) { case ID_CLOSE: SetEvent(WiiMoteReal::g_StopThreadTemporary); //direct closing will result in crash @ReadWiimote, also dont try to waitforobject here, it will result in deadlock! because this thread is still needed to progress in the Readwiimote to get to the waitingobject @readwiimote itself..... - //Problem lies mainly in Readwiimote(), closing here leaves the thread readWiimote thread, trying to access vars which aint there anymore. + Close(); //Problem lies mainly in Readwiimote(), closing here leaves the thread readWiimote thread, trying to access vars which aint there anymore. break; case ID_APPLY: SaveFile(); diff --git a/Source/Plugins/Plugin_Wiimote/Src/ReadWiimote.cpp b/Source/Plugins/Plugin_Wiimote/Src/ReadWiimote.cpp index c435915d57..266406e4ec 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/ReadWiimote.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/ReadWiimote.cpp @@ -203,9 +203,9 @@ void handle_event(struct wiimote_t* wm) if(wm->exp.type == EXP_NUNCHUK) // Updating Nunchuck Gauges { - m_RecordingConfigFrame->m_GaugeGForceNunchuk[0]->SetValue((int)floor((nc->gforce.x * 100) + 300.5)); - m_RecordingConfigFrame->m_GaugeGForceNunchuk[1]->SetValue((int)floor((nc->gforce.y * 100) + 300.5)); - m_RecordingConfigFrame->m_GaugeGForceNunchuk[2]->SetValue((int)floor((nc->gforce.z * 100) + 300.5)); + m_RecordingConfigFrame->m_GaugeGForceNunchuk[0]->SetValue((int)floor((nc->gforce.x * 300) + 100.5)); + m_RecordingConfigFrame->m_GaugeGForceNunchuk[1]->SetValue((int)floor((nc->gforce.y * 300) + 100.5)); + m_RecordingConfigFrame->m_GaugeGForceNunchuk[2]->SetValue((int)floor((nc->gforce.z * 300) + 100.5)); m_RecordingConfigFrame->m_GaugeAccelNunchuk[0]->SetValue(nc->accel.x); m_RecordingConfigFrame->m_GaugeAccelNunchuk[1]->SetValue(nc->accel.y);