Merge pull request #7656 from JMC47/DanceMatFix

Fix Emulated Dance Mat
This commit is contained in:
Anthony 2019-01-07 13:48:50 -08:00 committed by GitHub
commit c73adf8d8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 17 deletions

View File

@ -40,28 +40,28 @@ int CSIDevice_DanceMat::RunBuffer(u8* buffer, int length)
u32 CSIDevice_DanceMat::MapPadStatus(const GCPadStatus& pad_status)
{
// Map the dpad to the blue arrows, the buttons to the orange arrows
// Z = + button, Start = - button
// Z = + button, Start = - button. Active Life Mats have a different layout.
u16 map = 0;
if (pad_status.button & PAD_BUTTON_UP)
map |= 0x1000;
if (pad_status.button & PAD_BUTTON_DOWN)
map |= 0x2;
if (pad_status.button & PAD_BUTTON_LEFT)
map |= 0x8;
if (pad_status.button & PAD_BUTTON_RIGHT)
if (pad_status.button & PAD_BUTTON_DOWN)
map |= 0x4;
if (pad_status.button & PAD_BUTTON_Y)
map |= 0x200;
if (pad_status.button & PAD_BUTTON_A)
map |= 0x10;
if (pad_status.button & PAD_BUTTON_B)
map |= 0x100;
if (pad_status.button & PAD_BUTTON_X)
map |= 0x800;
if (pad_status.button & PAD_TRIGGER_Z)
map |= 0x400;
if (pad_status.button & PAD_BUTTON_START)
if (pad_status.button & PAD_BUTTON_LEFT)
map |= 0x1;
if (pad_status.button & PAD_BUTTON_RIGHT)
map |= 0x2;
if (pad_status.button & PAD_BUTTON_Y)
map |= 0x400; // Only Active Life Mat has this button. Maps as + button.
if (pad_status.button & PAD_BUTTON_A)
map |= 0x100;
if (pad_status.button & PAD_BUTTON_B)
map |= 0x200;
if (pad_status.button & PAD_BUTTON_X)
map |= 0x800; // Only Active Life Mat has this button. Maps as Right Foot Right.
if (pad_status.button & PAD_TRIGGER_Z)
map |= 0x10;
if (pad_status.button & PAD_BUTTON_START)
map |= 0x1000;
return (u32)(map << 16) | 0x8080;
}