diff options
| author | Matthew Parlane <parlane@gmail.com> | 2013-01-08 20:27:34 +1300 |
|---|---|---|
| committer | Matthew Parlane <parlane@gmail.com> | 2013-01-08 20:27:34 +1300 |
| commit | 0ec7ef4b9905cbeb10f523097fbff3da50ede4f1 (patch) | |
| tree | c4e8259084901e51b6d1294e6faf5e3ba1ae7152 /Source/Core | |
| parent | 9f13e69be46b07c64bedb9b225f06fb8f738bb7e (diff) | |
| parent | 1d44d3baf5cc0702b9e042687d63c5a72fd0f6b0 (diff) | |
Merge branch 'master' into gdbstub
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Common/Src/MathUtil.h | 2 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/GCPad.cpp | 8 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/GCPadEmu.cpp | 15 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/GCPadEmu.h | 1 | ||||
| -rw-r--r-- | Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp | 16 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/resources/dolphin-emu.desktop | 9 | ||||
| -rw-r--r-- | Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/BPFunctions.cpp | 2 |
9 files changed, 40 insertions, 25 deletions
diff --git a/Source/Core/Common/Src/MathUtil.h b/Source/Core/Common/Src/MathUtil.h index c5f613ada1..a6290ff602 100644 --- a/Source/Core/Common/Src/MathUtil.h +++ b/Source/Core/Common/Src/MathUtil.h @@ -117,8 +117,6 @@ struct Rectangle Rectangle(T theLeft, T theTop, T theRight, T theBottom) : left(theLeft), top(theTop), right(theRight), bottom(theBottom) { } - - bool operator==(const Rectangle& r) { return left==r.left && top==r.top && right==r.right && bottom==r.bottom; } T GetWidth() const { return abs(right - left); } T GetHeight() const { return abs(bottom - top); } diff --git a/Source/Core/Core/Src/HW/GCPad.cpp b/Source/Core/Core/Src/HW/GCPad.cpp index 61b666af12..68ba3ab88a 100644 --- a/Source/Core/Core/Src/HW/GCPad.cpp +++ b/Source/Core/Core/Src/HW/GCPad.cpp @@ -105,6 +105,10 @@ void Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength) { ((GCPad*)g_plugin.controllers[ _numPAD ])->SetOutput(255); } + else + { + ((GCPad*)g_plugin.controllers[ _numPAD ])->SetOutput(0); + } } } @@ -123,9 +127,9 @@ void Motor(u8 _numPAD, unsigned int _uType, unsigned int _uStrength) { // TODO: this has potential to not stop rumble if user is messing with GUI at the perfect time // set rumble - if (_uType == 06) + if (_uType == 6) { - ((GCPad*)g_plugin.controllers[ _numPAD ])->SetOutput(_uStrength); + ((GCPad*)g_plugin.controllers[ _numPAD ])->SetMotor(_uStrength); } } } diff --git a/Source/Core/Core/Src/HW/GCPadEmu.cpp b/Source/Core/Core/Src/HW/GCPadEmu.cpp index 5233ed2877..a2c0c2afa9 100644 --- a/Source/Core/Core/Src/HW/GCPadEmu.cpp +++ b/Source/Core/Core/Src/HW/GCPadEmu.cpp @@ -130,15 +130,26 @@ void GCPad::GetInput(SPADStatus* const pad) } } -void GCPad::SetOutput(const u8 on) +void GCPad::SetMotor(const u8 on) { + float state = (float)on / 255; + float force = abs(state - 0.5) * 2; + if (state < 0.5) + force = -force; + // only rumble if window has focus or background input is enabled if (Host_RendererHasFocus() || m_options[0].settings[0]->value) - m_rumble->controls[0]->control_ref->State((float)on / 255); + m_rumble->controls[0]->control_ref->State(force); else m_rumble->controls[0]->control_ref->State(0); } +void GCPad::SetOutput(const u8 on) +{ + // only rumble if window has focus or background input is enabled + m_rumble->controls[0]->control_ref->State(on && (Host_RendererHasFocus() || m_options[0].settings[0]->value)); +} + void GCPad::LoadDefaults(const ControllerInterface& ciface) { #define set_control(group, num, str) (group)->controls[num]->control_ref->expression = (str) diff --git a/Source/Core/Core/Src/HW/GCPadEmu.h b/Source/Core/Core/Src/HW/GCPadEmu.h index cf0940245e..e57e6b0b68 100644 --- a/Source/Core/Core/Src/HW/GCPadEmu.h +++ b/Source/Core/Core/Src/HW/GCPadEmu.h @@ -29,6 +29,7 @@ public: GCPad(const unsigned int index); void GetInput(SPADStatus* const pad); void SetOutput(const u8 on); + void SetMotor(const u8 on); bool GetMicButton() const; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp index 47737326f4..c5ea6fcb06 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -253,15 +253,15 @@ void DoState(PointerWrap &p) u32 i; for (i=0; i<IPC_MAX_FDS; i++) { - u32 exists; + u32 exists = 0; p.Do(exists); if (exists) { - u32 isHw; + u32 isHw = 0; p.Do(isHw); if (isHw) { - u32 hwId; + u32 hwId = 0; p.Do(hwId); g_FdMap[i] = AccessDeviceByID(hwId); } diff --git a/Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp index ddfec1c328..fa9f278c29 100644 --- a/Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp @@ -246,17 +246,13 @@ bool CanSwapAdjacentOps(const CodeOp &a, const CodeOp &b) return false; } - // For now, only integer ops acceptable. - switch (b_info->type) { - case OPTYPE_INTEGER: - case OPTYPE_LOAD: - case OPTYPE_STORE: - //case OPTYPE_LOADFP: - //case OPTYPE_STOREFP: - break; - default: + // For now, only integer ops acceptable. Any instruction which can raise an + // interrupt is *not* a possible swap candidate: see [1] for an example of + // a crash caused by this error. + // + // [1] https://code.google.com/p/dolphin-emu/issues/detail?id=5864#c7 + if (b_info->type != OPTYPE_INTEGER) return false; - } // Check that we have no register collisions. // That is, check that none of b's outputs matches any of a's inputs, diff --git a/Source/Core/DolphinWX/resources/dolphin-emu.desktop b/Source/Core/DolphinWX/resources/dolphin-emu.desktop new file mode 100644 index 0000000000..f201f07f22 --- /dev/null +++ b/Source/Core/DolphinWX/resources/dolphin-emu.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=Dolphin Emulator +Comment=A Wii/GameCube Emulator +Icon=dolphin-emu +Exec=dolphin-emu +Categories=Game; + diff --git a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp index b7ac3bf82e..af6ee7e77c 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp @@ -535,11 +535,7 @@ ControlState Joystick::Hat::GetState() const void Joystick::ForceConstant::SetState(const ControlState state) { - float force = abs(state - 0.5) * 2; - if (state < 0.5) - force = -force; - - const LONG new_val = LONG(10000 * force); + const LONG new_val = LONG(10000 * state); LONG &val = params.lMagnitude; if (val != new_val) diff --git a/Source/Core/VideoCommon/Src/BPFunctions.cpp b/Source/Core/VideoCommon/Src/BPFunctions.cpp index b9a76ba7b6..cddeae3000 100644 --- a/Source/Core/VideoCommon/Src/BPFunctions.cpp +++ b/Source/Core/VideoCommon/Src/BPFunctions.cpp @@ -236,7 +236,7 @@ bool GetConfig(const int &type) case CONFIG_DISABLEFOG: return g_ActiveConfig.bDisableFog; case CONFIG_SHOWEFBREGIONS: - return g_ActiveConfig.bShowEFBCopyRegions; + return false; default: PanicAlert("GetConfig Error: Unknown Config Type!"); return false; |
