From d08fa5f0e3b6ec70c6715eba926c10a2ee85911a Mon Sep 17 00:00:00 2001 From: dborth Date: Wed, 20 May 2009 05:26:32 +0000 Subject: [PATCH] add option to disable rumble, auto-determine if HBC stub is present --- readme.txt | 6 +----- source/ngc/fceuconfig.cpp | 1 + source/ngc/fceugx.cpp | 37 ++++++++++++++++++++++++++++--------- source/ngc/fceugx.h | 1 + source/ngc/menu.cpp | 26 +++++++++++++++++++------- source/ngc/pad.cpp | 1 + 6 files changed, 51 insertions(+), 21 deletions(-) diff --git a/readme.txt b/readme.txt index f828600..33ef65c 100644 --- a/readme.txt +++ b/readme.txt @@ -220,8 +220,7 @@ Gamecube: --------- You can load FCEUGX via sdload and an SD card in slot A, or by streaming it to your Gamecube, or by booting a bootable DVD with FCEUGX on it. -This document doesn't cover how to do any of that. A good source for information -on these topics is the tehskeen forums: http://www.tehskeen.com/forums/ +This document doesn't cover how to do any of that. ---------------------------- ROMS, Preferences, and Saves: @@ -303,8 +302,5 @@ Timing - NTSC or PAL (Depends if you're running a PAL or NTSC game) FCEUGX Web Site http://code.google.com/p/fceugc - - TehSkeen Support Forums - http://www.tehskeen.net ¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤ diff --git a/source/ngc/fceuconfig.cpp b/source/ngc/fceuconfig.cpp index f51b088..a68ffbc 100644 --- a/source/ngc/fceuconfig.cpp +++ b/source/ngc/fceuconfig.cpp @@ -77,6 +77,7 @@ DefaultSettings () GCSettings.ExitAction = 0; GCSettings.MusicVolume = 40; GCSettings.SFXVolume = 40; + GCSettings.Rumble = 1; GCSettings.LoadMethod = METHOD_AUTO; // Auto, SD, DVD, USB, Network (SMB) GCSettings.SaveMethod = METHOD_AUTO; // Auto, SD, Memory Card Slot A, Memory Card Slot B, USB, Network (SMB) diff --git a/source/ngc/fceugx.cpp b/source/ngc/fceugx.cpp index a0a8c66..0fe0870 100644 --- a/source/ngc/fceugx.cpp +++ b/source/ngc/fceugx.cpp @@ -96,16 +96,26 @@ void ExitApp() { ExitCleanup(); - if(GCSettings.ExitAction == 0) // Exit to Loader + #ifdef HW_RVL + if(GCSettings.ExitAction == 0) // Auto { - #ifdef HW_RVL - exit(0); - #else - if (psoid[0] == PSOSDLOADID) - PSOReload (); - #endif + char * sig = (char *)0x80001804; + if( + sig[0] == 'S' && + sig[1] == 'T' && + sig[2] == 'U' && + sig[3] == 'B' && + sig[4] == 'H' && + sig[5] == 'A' && + sig[6] == 'X' && + sig[7] == 'X') + GCSettings.ExitAction = 3; // Exit to HBC + else + GCSettings.ExitAction = 1; // HBC not found } - else if(GCSettings.ExitAction == 1) // Exit to Menu + #endif + + if(GCSettings.ExitAction == 1) // Exit to Menu { #ifdef HW_RVL SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); @@ -114,10 +124,19 @@ void ExitApp() *SOFTRESET_ADR = 0x00000000; #endif } - else // Shutdown Wii + else if(GCSettings.ExitAction == 2) // Shutdown Wii { SYS_ResetSystem(SYS_POWEROFF, 0, 0); } + else // Exit to Loader + { + #ifdef HW_RVL + exit(0); + #else + if (psoid[0] == PSOSDLOADID) + PSOReload(); + #endif + } } #ifdef HW_RVL diff --git a/source/ngc/fceugx.h b/source/ngc/fceugx.h index 99b1e4a..67db3c6 100644 --- a/source/ngc/fceugx.h +++ b/source/ngc/fceugx.h @@ -83,6 +83,7 @@ struct SGCSettings{ int ExitAction; int MusicVolume; int SFXVolume; + int Rumble; }; void ExitApp(); diff --git a/source/ngc/menu.cpp b/source/ngc/menu.cpp index bef8236..644e0a8 100644 --- a/source/ngc/menu.cpp +++ b/source/ngc/menu.cpp @@ -3289,6 +3289,7 @@ static int MenuSettingsMenu() sprintf(options.name[i++], "Wiimote Orientation"); sprintf(options.name[i++], "Music Volume"); sprintf(options.name[i++], "Sound Effects Volume"); + sprintf(options.name[i++], "Rumble"); options.length = i; GuiText titleTxt("Settings - Menu", 28, (GXColor){255, 255, 255, 255}); @@ -3341,13 +3342,10 @@ static int MenuSettingsMenu() sprintf (options.value[0], "Return to Wii Menu"); else if (GCSettings.ExitAction == 2) sprintf (options.value[0], "Power off Wii"); - else + else if (GCSettings.ExitAction == 3) sprintf (options.value[0], "Return to Loader"); - - if (GCSettings.WiimoteOrientation == 0) - sprintf (options.value[1], "Vertical"); - else if (GCSettings.WiimoteOrientation == 1) - sprintf (options.value[1], "Horizontal"); + else + sprintf (options.value[0], "Auto"); #else // GameCube if(GCSettings.ExitAction > 1) GCSettings.ExitAction = 0; @@ -3359,8 +3357,14 @@ static int MenuSettingsMenu() options.name[1][0] = 0; // Wiimote options.name[2][0] = 0; // Music options.name[3][0] = 0; // Sound Effects + options.name[4][0] = 0; // Rumble #endif + if (GCSettings.WiimoteOrientation == 0) + sprintf (options.value[1], "Vertical"); + else if (GCSettings.WiimoteOrientation == 1) + sprintf (options.value[1], "Horizontal"); + if(GCSettings.MusicVolume > 0) sprintf(options.value[2], "%d%%", GCSettings.MusicVolume); else @@ -3371,13 +3375,18 @@ static int MenuSettingsMenu() else sprintf(options.value[3], "Mute"); + if (GCSettings.Rumble == 1) + sprintf (options.value[4], "Enabled"); + else + sprintf (options.value[4], "Disabled"); + ret = optionBrowser.GetClickedOption(); switch (ret) { case 0: GCSettings.ExitAction++; - if(GCSettings.ExitAction > 2) + if(GCSettings.ExitAction > 3) GCSettings.ExitAction = 0; break; case 1: @@ -3394,6 +3403,9 @@ static int MenuSettingsMenu() if(GCSettings.SFXVolume > 100) GCSettings.SFXVolume = 0; break; + case 4: + GCSettings.Rumble ^= 1; + break; } if(backBtn.GetState() == STATE_CLICKED) diff --git a/source/ngc/pad.cpp b/source/ngc/pad.cpp index a551679..8f65c87 100644 --- a/source/ngc/pad.cpp +++ b/source/ngc/pad.cpp @@ -189,6 +189,7 @@ void ShutoffRumble() void DoRumble(int i) { + if(!GCSettings.Rumble) return; if(rumbleRequest[i] && rumbleCount[i] < 3) { WPAD_Rumble(i, 1); // rumble on