summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflacs <tilkax@gmail.com>2015-07-12 06:30:50 +0200
committerflacs <tilkax@gmail.com>2015-07-12 06:30:50 +0200
commitb30ae1b9f8a49b0b19e2802ce4f91f6505cd0682 (patch)
tree2b379e351531807fefd523f51267c7da462abb99
parentb9182dec61cc45c3af8585d2cef4bc8a2a57d586 (diff)
parent6e90d1e433811ceca4bf37473ac1c76770afdf7c (diff)
Merge pull request #2730 from lioncash/undef
SI_DeviceGCController: Remedy undefined behavior regarding shifts
-rw-r--r--Source/Core/Core/HW/SI_DeviceGCController.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/Core/HW/SI_DeviceGCController.h b/Source/Core/Core/HW/SI_DeviceGCController.h
index f738ad16fd..1a341051e4 100644
--- a/Source/Core/Core/HW/SI_DeviceGCController.h
+++ b/Source/Core/Core/HW/SI_DeviceGCController.h
@@ -118,7 +118,11 @@ public:
virtual bool GetData(u32& _Hi, u32& _Low) override
{
CSIDevice_GCController::GetData(_Hi, _Low);
- _Hi &= ~PAD_USE_ORIGIN << 16;
+
+ // Unset all bits except those that represent
+ // A, B, X, Y, Start and the error bits, as they
+ // are not used.
+ _Hi &= ~0x20FFFFFF;
return true;
}
};