From ac9d0538957f8ab15de1254c53bfe679e2487b71 Mon Sep 17 00:00:00 2001 From: pjgat09 Date: Mon, 20 May 2013 00:03:08 +0000 Subject: [PATCH] N64: Actually use the input for the other three controllers --- .../Consoles/Nintendo/N64/N64.cs | 48 +++++++----------- .../output/dll/mupen64plus-input-bkm.dll | Bin 9728 -> 9728 bytes libmupen64plus/mupen64plus-input-bkm/plugin.c | 9 ++-- 3 files changed, 21 insertions(+), 36 deletions(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs b/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs index 9f21571986..00dca805df 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs @@ -83,45 +83,33 @@ namespace BizHawk.Emulation.Consoles.Nintendo.N64 if (CoreComm.InputCallback != null) CoreComm.InputCallback(); IsLagFrame = false; - sbyte x = 0; - sbyte y = 0; - /* - if (Controller["P1 DPad R"]) x = 80; - if (Controller["P1 DPad L"]) x = -80; - if (Controller["P1 DPad D"]) y = -80; - if (Controller["P1 DPad U"]) y = 80; - */ - - float X_Axis = Controller.GetFloat("P1 X Axis"); - float Y_Axis = Controller.GetFloat("P1 Y Axis"); - // Analog stick right = +X // Analog stick up = +Y - x = (sbyte)X_Axis; - y = (sbyte)Y_Axis; - - api.set_buttons(0, ReadController(1), x, y); + for (int i = 0; i < 4; i++) + { + api.set_buttons(i, ReadController(i+1), (sbyte)Controller.GetFloat("P" + (i+1) + " X Axis"), (sbyte)Controller.GetFloat("P" + (i+1) + " Y Axis")); + } } public int ReadController(int num) { int buttons = 0; - if (Controller["P1 DPad R"]) buttons |= (1 << 0); - if (Controller["P1 DPad L"]) buttons |= (1 << 1); - if (Controller["P1 DPad D"]) buttons |= (1 << 2); - if (Controller["P1 DPad U"]) buttons |= (1 << 3); - if (Controller["P1 Start"]) buttons |= (1 << 4); - if (Controller["P1 Z"]) buttons |= (1 << 5); - if (Controller["P1 B"]) buttons |= (1 << 6); - if (Controller["P1 A"]) buttons |= (1 << 7); - if (Controller["P1 C Right"]) buttons |= (1 << 8); - if (Controller["P1 C Left"]) buttons |= (1 << 9); - if (Controller["P1 C Down"]) buttons |= (1 << 10); - if (Controller["P1 C Up"]) buttons |= (1 << 11); - if (Controller["P1 R"]) buttons |= (1 << 12); - if (Controller["P1 L"]) buttons |= (1 << 13); + if (Controller["P" + num + " DPad R"]) buttons |= (1 << 0); + if (Controller["P" + num + " DPad L"]) buttons |= (1 << 1); + if (Controller["P" + num + " DPad D"]) buttons |= (1 << 2); + if (Controller["P" + num + " DPad U"]) buttons |= (1 << 3); + if (Controller["P" + num + " Start"]) buttons |= (1 << 4); + if (Controller["P" + num + " Z"]) buttons |= (1 << 5); + if (Controller["P" + num + " B"]) buttons |= (1 << 6); + if (Controller["P" + num + " A"]) buttons |= (1 << 7); + if (Controller["P" + num + " C Right"]) buttons |= (1 << 8); + if (Controller["P" + num + " C Left"]) buttons |= (1 << 9); + if (Controller["P" + num + " C Down"]) buttons |= (1 << 10); + if (Controller["P" + num + " C Up"]) buttons |= (1 << 11); + if (Controller["P" + num + " R"]) buttons |= (1 << 12); + if (Controller["P" + num + " L"]) buttons |= (1 << 13); return buttons; } diff --git a/BizHawk.MultiClient/output/dll/mupen64plus-input-bkm.dll b/BizHawk.MultiClient/output/dll/mupen64plus-input-bkm.dll index 266255aa8a62bdfb283d6c66b88bafa80941f2af..bd88f202b8710a4a360df5b467275488eddf4110 100644 GIT binary patch delta 696 zcmX|7ZAcVB7@pbF>oSk_4nNks%gmz>iwtykW@m186;1qc6=GmgV)zkyCRh>G5A#4w z;wq#~vVzEtG{w-^z6^;2t)ns!%^wPx_R9)IGKfCN_D=DIcjkTGXP$@Q@p*in*2UEE zs+)yiwPpa9x&g)jz#9wu$}(NE!3>k98)&)kKFrgqSuqIeU970M)q=057OM zmkIc}7X7i=!!;7a!oSZF@QHvQ;0&Kj1(uF52m#}9m}&~f1}qrx2H}qn4lTuu{Z7E&(ccJ1OeVue z+wPE)TH^t@YjnTS;W>g600`>m9hv4vix@9%6EnnYu|O;nE5$nTlz2~kDppDjQj2s| z>XQ1T*V3poAx%k((qGAmb|H)ysz4`D18PG(s1H3s@6i~VMhoZ%`h)CPz`JoCK8nln z8Qg|D@gqEdXYm}K$KUZUY?c${EICImk$dIIMmd#~kTOz5YRO4*mRums#*?K5V=Kce9_t&5R delta 682 zcmY*VZAep57(VB2+M1hQ$7a`$fn&pdg^AsJ&OPVeyU+~LNe+>qus>1GB^88V204q& zY0K5kGLSOtgUUd2mkCNU|bo{3;?SWwq??+X2W8`+AOG+!%NVkeSu93L|UD36Ju+&01zmL00cpx zwG^=NMr}0R$F%3^C3-4MkxEP0YQlhxRC>ZzP6q5yh}Tgq7j{GmV8e1zXuGpH$T^2ml?+Plugin = PLUGIN_MEMPAK; + controller[i].control = ControlInfo.Controls + i; + controller[i].control->Plugin = PLUGIN_MEMPAK; + controller[i].control->Present = 1; } - controller[0].control->Present = 1; - DebugMessage(M64MSG_INFO, "%s version %i.%i.%i initialized.", PLUGIN_NAME, VERSION_PRINTF_SPLIT(PLUGIN_VERSION)); }