From 301108bfdd70af2386b4358715ae2b2823134c5b Mon Sep 17 00:00:00 2001 From: dborth Date: Thu, 7 Aug 2008 06:46:36 +0000 Subject: [PATCH] Add mouse toggle to menu --- source/ngc/menu.cpp | 25 +++++++++++++++++++------ source/ngc/snes9xGX.cpp | 5 +++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/source/ngc/menu.cpp b/source/ngc/menu.cpp index 86b5d85..098e36f 100644 --- a/source/ngc/menu.cpp +++ b/source/ngc/menu.cpp @@ -617,10 +617,11 @@ ConfigureButtons (u16 ctrlr_type) menu = oldmenu; } // end configurebuttons() -int ctlrmenucount = 8; +int ctlrmenucount = 9; char ctlrmenu[][50] = { "MultiTap", "SuperScope", + "Mouse", "Nunchuk", "Classic Controller", "Gamecube Pad", @@ -653,6 +654,11 @@ ConfigureControllers () else sprintf (ctlrmenu[1], "Superscope OFF"); + if (GCSettings.Mouse > 0) + sprintf (ctlrmenu[2], "Mouse: Pad %d", GCSettings.Mouse); + else + sprintf (ctlrmenu[2], "Mouse OFF"); + /*** Controller Config Menu ***/ ret = RunMenu (ctlrmenu, ctlrmenucount, (char*)"Configure Controllers"); @@ -669,33 +675,39 @@ ConfigureControllers () GCSettings.Superscope ++; if (GCSettings.Superscope > 4) GCSettings.Superscope = 0; + break; case 2: + GCSettings.Mouse ++; + if (GCSettings.Mouse > 4) + GCSettings.Mouse = 0; + break; + case 3: /*** Configure Nunchuk ***/ ConfigureButtons (CTRLR_NUNCHUK); break; - case 3: + case 4: /*** Configure Classic ***/ ConfigureButtons (CTRLR_CLASSIC); break; - case 4: + case 5: /*** Configure GC Pad ***/ ConfigureButtons (CTRLR_GCPAD); break; - case 5: + case 6: /*** Configure Wiimote ***/ ConfigureButtons (CTRLR_WIIMOTE); break; - case 6: + case 7: /*** Save Preferences Now ***/ quickSavePrefs(NOTSILENT); break; case -1: /*** Button B ***/ - case 7: + case 8: /*** Return ***/ quit = 1; break; @@ -806,6 +818,7 @@ mainmenu (int selectedMenu) ReInitGCVideo(); // update video after reading settings Settings.SuperScopeMaster = (GCSettings.Superscope > 0 ? true : false); // update superscope settings + Settings.MouseMaster = (GCSettings.Mouse > 0 ? true : false); // update mouse settings // update mouse/justifier info? SetControllers(); } diff --git a/source/ngc/snes9xGX.cpp b/source/ngc/snes9xGX.cpp index 782ed2e..4daefde 100644 --- a/source/ngc/snes9xGX.cpp +++ b/source/ngc/snes9xGX.cpp @@ -605,6 +605,11 @@ void SetControllers () S9xSetController (0, CTL_JOYPAD, 0, 0, 0, 0); S9xSetController (1, CTL_SUPERSCOPE, 1, 0, 0, 0); } + else if (Settings.MouseMaster == true) + { + S9xSetController (0, CTL_MOUSE, 0, 0, 0, 0); + S9xSetController (1, CTL_JOYPAD, 1, 0, 0, 0); + } else { /*** Plugin 2 Joypads by default ***/