mirror of
https://github.com/dborth/snes9xgx.git
synced 2025-01-12 11:19:07 +01:00
improvements to optionbrowser
This commit is contained in:
parent
46b39c5e3f
commit
05b9d7f417
@ -800,11 +800,13 @@ class GuiOptionBrowser : public GuiElement
|
|||||||
void ResetState();
|
void ResetState();
|
||||||
void SetFocus(int f);
|
void SetFocus(int f);
|
||||||
void Draw();
|
void Draw();
|
||||||
|
void TriggerUpdate();
|
||||||
void Update(GuiTrigger * t);
|
void Update(GuiTrigger * t);
|
||||||
GuiText * optionVal[PAGESIZE];
|
GuiText * optionVal[PAGESIZE];
|
||||||
protected:
|
protected:
|
||||||
int selectedItem;
|
int selectedItem;
|
||||||
int listOffset;
|
int listOffset;
|
||||||
|
bool listChanged;
|
||||||
|
|
||||||
OptionList * options;
|
OptionList * options;
|
||||||
int optionIndex[PAGESIZE];
|
int optionIndex[PAGESIZE];
|
||||||
|
@ -20,6 +20,7 @@ GuiOptionBrowser::GuiOptionBrowser(int w, int h, OptionList * l)
|
|||||||
options = l;
|
options = l;
|
||||||
selectable = true;
|
selectable = true;
|
||||||
listOffset = this->FindMenuItem(-1, 1);
|
listOffset = this->FindMenuItem(-1, 1);
|
||||||
|
listChanged = true; // trigger an initial list update
|
||||||
selectedItem = 0;
|
selectedItem = 0;
|
||||||
focus = 0; // allow focus
|
focus = 0; // allow focus
|
||||||
|
|
||||||
@ -76,7 +77,7 @@ GuiOptionBrowser::GuiOptionBrowser(int w, int h, OptionList * l)
|
|||||||
|
|
||||||
for(int i=0; i<PAGESIZE; i++)
|
for(int i=0; i<PAGESIZE; i++)
|
||||||
{
|
{
|
||||||
optionTxt[i] = new GuiText(options->name[i], 22, (GXColor){0, 0, 0, 0xff});
|
optionTxt[i] = new GuiText(NULL, 22, (GXColor){0, 0, 0, 0xff});
|
||||||
optionTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
optionTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
||||||
optionTxt[i]->SetPosition(8,0);
|
optionTxt[i]->SetPosition(8,0);
|
||||||
|
|
||||||
@ -228,6 +229,11 @@ void GuiOptionBrowser::Draw()
|
|||||||
this->UpdateEffects();
|
this->UpdateEffects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GuiOptionBrowser::TriggerUpdate()
|
||||||
|
{
|
||||||
|
listChanged = true;
|
||||||
|
}
|
||||||
|
|
||||||
void GuiOptionBrowser::Update(GuiTrigger * t)
|
void GuiOptionBrowser::Update(GuiTrigger * t)
|
||||||
{
|
{
|
||||||
if(state == STATE_DISABLED || !t)
|
if(state == STATE_DISABLED || !t)
|
||||||
@ -240,27 +246,34 @@ void GuiOptionBrowser::Update(GuiTrigger * t)
|
|||||||
|
|
||||||
next = listOffset;
|
next = listOffset;
|
||||||
|
|
||||||
|
if(listChanged)
|
||||||
|
{
|
||||||
|
listChanged = false;
|
||||||
|
for(int i=0; i<PAGESIZE; i++)
|
||||||
|
{
|
||||||
|
if(next >= 0)
|
||||||
|
{
|
||||||
|
if(optionBtn[i]->GetState() == STATE_DISABLED)
|
||||||
|
{
|
||||||
|
optionBtn[i]->SetVisible(true);
|
||||||
|
optionBtn[i]->SetState(STATE_DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
optionTxt[i]->SetText(options->name[next]);
|
||||||
|
optionVal[i]->SetText(options->value[next]);
|
||||||
|
optionIndex[i] = next;
|
||||||
|
next = this->FindMenuItem(next, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
optionBtn[i]->SetVisible(false);
|
||||||
|
optionBtn[i]->SetState(STATE_DISABLED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(int i=0; i<PAGESIZE; i++)
|
for(int i=0; i<PAGESIZE; i++)
|
||||||
{
|
{
|
||||||
if(next >= 0)
|
|
||||||
{
|
|
||||||
if(optionBtn[i]->GetState() == STATE_DISABLED)
|
|
||||||
{
|
|
||||||
optionBtn[i]->SetVisible(true);
|
|
||||||
optionBtn[i]->SetState(STATE_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
optionTxt[i]->SetText(options->name[next]);
|
|
||||||
optionVal[i]->SetText(options->value[next]);
|
|
||||||
optionIndex[i] = next;
|
|
||||||
next = this->FindMenuItem(next, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
optionBtn[i]->SetVisible(false);
|
|
||||||
optionBtn[i]->SetState(STATE_DISABLED);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(i != selectedItem && optionBtn[i]->GetState() == STATE_SELECTED)
|
if(i != selectedItem && optionBtn[i]->GetState() == STATE_SELECTED)
|
||||||
optionBtn[i]->ResetState();
|
optionBtn[i]->ResetState();
|
||||||
else if(focus && i == selectedItem && optionBtn[i]->GetState() == STATE_DEFAULT)
|
else if(focus && i == selectedItem && optionBtn[i]->GetState() == STATE_DEFAULT)
|
||||||
@ -292,6 +305,7 @@ void GuiOptionBrowser::Update(GuiTrigger * t)
|
|||||||
{
|
{
|
||||||
// move list down by 1
|
// move list down by 1
|
||||||
listOffset = this->FindMenuItem(listOffset, 1);
|
listOffset = this->FindMenuItem(listOffset, 1);
|
||||||
|
listChanged = true;
|
||||||
}
|
}
|
||||||
else if(optionBtn[selectedItem+1]->IsVisible())
|
else if(optionBtn[selectedItem+1]->IsVisible())
|
||||||
{
|
{
|
||||||
@ -312,6 +326,7 @@ void GuiOptionBrowser::Update(GuiTrigger * t)
|
|||||||
{
|
{
|
||||||
// move list up by 1
|
// move list up by 1
|
||||||
listOffset = prev;
|
listOffset = prev;
|
||||||
|
listChanged = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2013,13 +2013,13 @@ static int MenuGameCheats()
|
|||||||
OptionList options;
|
OptionList options;
|
||||||
|
|
||||||
for(i=0; i < Cheat.num_cheats; i++)
|
for(i=0; i < Cheat.num_cheats; i++)
|
||||||
|
{
|
||||||
sprintf (options.name[i], "%s", Cheat.c[i].name);
|
sprintf (options.name[i], "%s", Cheat.c[i].name);
|
||||||
|
sprintf (options.value[i], "%s", Cheat.c[i].enabled == true ? "On" : "Off");
|
||||||
|
}
|
||||||
|
|
||||||
options.length = i;
|
options.length = i;
|
||||||
|
|
||||||
for(i=0; i < options.length; i++)
|
|
||||||
options.value[i][0] = 0;
|
|
||||||
|
|
||||||
GuiText titleTxt("Game Settings - Cheats", 28, (GXColor){255, 255, 255, 255});
|
GuiText titleTxt("Game Settings - Cheats", 28, (GXColor){255, 255, 255, 255});
|
||||||
titleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
titleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
||||||
titleTxt.SetPosition(50,50);
|
titleTxt.SetPosition(50,50);
|
||||||
@ -2065,15 +2065,17 @@ static int MenuGameCheats()
|
|||||||
{
|
{
|
||||||
usleep(THREAD_SLEEP);
|
usleep(THREAD_SLEEP);
|
||||||
|
|
||||||
for(i=0; i < Cheat.num_cheats; i++)
|
|
||||||
sprintf (options.value[i], "%s", Cheat.c[i].enabled == true ? "On" : "Off");
|
|
||||||
|
|
||||||
ret = optionBrowser.GetClickedOption();
|
ret = optionBrowser.GetClickedOption();
|
||||||
|
|
||||||
if(Cheat.c[ret].enabled)
|
if(ret >= 0)
|
||||||
S9xDisableCheat(ret);
|
{
|
||||||
else
|
if(Cheat.c[ret].enabled)
|
||||||
S9xEnableCheat(ret);
|
S9xDisableCheat(ret);
|
||||||
|
else
|
||||||
|
S9xEnableCheat(ret);
|
||||||
|
sprintf (options.value[ret], "%s", Cheat.c[ret].enabled == true ? "On" : "Off");
|
||||||
|
optionBrowser.TriggerUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
if(backBtn.GetState() == STATE_CLICKED)
|
if(backBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
@ -2548,6 +2550,7 @@ static int MenuSettingsMappingsMap()
|
|||||||
{
|
{
|
||||||
int menu = MENU_NONE;
|
int menu = MENU_NONE;
|
||||||
int ret,i,j;
|
int ret,i,j;
|
||||||
|
bool firstRun = true;
|
||||||
OptionList options;
|
OptionList options;
|
||||||
|
|
||||||
char menuTitle[100];
|
char menuTitle[100];
|
||||||
@ -2667,24 +2670,6 @@ static int MenuSettingsMappingsMap()
|
|||||||
{
|
{
|
||||||
usleep(THREAD_SLEEP);
|
usleep(THREAD_SLEEP);
|
||||||
|
|
||||||
for(i=0; i < options.length; i++)
|
|
||||||
{
|
|
||||||
for(j=0; j < ctrlr_def[mapMenuCtrl].num_btns; j++)
|
|
||||||
{
|
|
||||||
if(btnmap[mapMenuCtrlSNES][mapMenuCtrl][i] == 0)
|
|
||||||
{
|
|
||||||
options.value[i][0] = 0;
|
|
||||||
}
|
|
||||||
else if(btnmap[mapMenuCtrlSNES][mapMenuCtrl][i] ==
|
|
||||||
ctrlr_def[mapMenuCtrl].map[j].btn)
|
|
||||||
{
|
|
||||||
if(strcmp(options.value[i], ctrlr_def[mapMenuCtrl].map[j].name) != 0)
|
|
||||||
sprintf(options.value[i], ctrlr_def[mapMenuCtrl].map[j].name);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = optionBrowser.GetClickedOption();
|
ret = optionBrowser.GetClickedOption();
|
||||||
|
|
||||||
if(ret >= 0)
|
if(ret >= 0)
|
||||||
@ -2693,6 +2678,30 @@ static int MenuSettingsMappingsMap()
|
|||||||
btnmap[mapMenuCtrlSNES][mapMenuCtrl][ret] = ButtonMappingWindow();
|
btnmap[mapMenuCtrlSNES][mapMenuCtrl][ret] = ButtonMappingWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ret >= 0 || firstRun)
|
||||||
|
{
|
||||||
|
firstRun = false;
|
||||||
|
|
||||||
|
for(i=0; i < options.length; i++)
|
||||||
|
{
|
||||||
|
for(j=0; j < ctrlr_def[mapMenuCtrl].num_btns; j++)
|
||||||
|
{
|
||||||
|
if(btnmap[mapMenuCtrlSNES][mapMenuCtrl][i] == 0)
|
||||||
|
{
|
||||||
|
options.value[i][0] = 0;
|
||||||
|
}
|
||||||
|
else if(btnmap[mapMenuCtrlSNES][mapMenuCtrl][i] ==
|
||||||
|
ctrlr_def[mapMenuCtrl].map[j].btn)
|
||||||
|
{
|
||||||
|
if(strcmp(options.value[i], ctrlr_def[mapMenuCtrl].map[j].name) != 0)
|
||||||
|
sprintf(options.value[i], ctrlr_def[mapMenuCtrl].map[j].name);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
optionBrowser.TriggerUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
if(backBtn.GetState() == STATE_CLICKED)
|
if(backBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
menu = MENU_GAMESETTINGS_MAPPINGS_CTRL;
|
menu = MENU_GAMESETTINGS_MAPPINGS_CTRL;
|
||||||
@ -2708,7 +2717,10 @@ static int MenuSettingsMappingsMap()
|
|||||||
"No");
|
"No");
|
||||||
|
|
||||||
if(choice == 1)
|
if(choice == 1)
|
||||||
|
{
|
||||||
ResetControls(mapMenuCtrlSNES, mapMenuCtrl);
|
ResetControls(mapMenuCtrlSNES, mapMenuCtrl);
|
||||||
|
optionBrowser.TriggerUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HaltGui();
|
HaltGui();
|
||||||
@ -2931,6 +2943,7 @@ static int MenuSettingsVideo()
|
|||||||
int menu = MENU_NONE;
|
int menu = MENU_NONE;
|
||||||
int ret;
|
int ret;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
bool firstRun = true;
|
||||||
OptionList options;
|
OptionList options;
|
||||||
|
|
||||||
sprintf(options.name[i++], "Rendering");
|
sprintf(options.name[i++], "Rendering");
|
||||||
@ -2990,42 +3003,6 @@ static int MenuSettingsVideo()
|
|||||||
{
|
{
|
||||||
usleep(THREAD_SLEEP);
|
usleep(THREAD_SLEEP);
|
||||||
|
|
||||||
// don't allow original render mode if progressive video mode detected
|
|
||||||
if (GCSettings.render==0 && progressive)
|
|
||||||
GCSettings.render++;
|
|
||||||
|
|
||||||
if (GCSettings.render == 0)
|
|
||||||
sprintf (options.value[0], "Original");
|
|
||||||
else if (GCSettings.render == 1)
|
|
||||||
sprintf (options.value[0], "Filtered");
|
|
||||||
else if (GCSettings.render == 2)
|
|
||||||
sprintf (options.value[0], "Unfiltered");
|
|
||||||
|
|
||||||
if(GCSettings.widescreen)
|
|
||||||
sprintf (options.value[1], "16:9 Correction");
|
|
||||||
else
|
|
||||||
sprintf (options.value[1], "Default");
|
|
||||||
|
|
||||||
sprintf (options.value[2], "%s", GetFilterName((RenderFilter)GCSettings.FilterMethod));
|
|
||||||
|
|
||||||
sprintf (options.value[3], "%.2f%%", GCSettings.ZoomLevel*100);
|
|
||||||
|
|
||||||
sprintf (options.value[4], "%d, %d", GCSettings.xshift, GCSettings.yshift);
|
|
||||||
|
|
||||||
switch(GCSettings.videomode)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
sprintf (options.value[5], "Automatic (Recommended)"); break;
|
|
||||||
case 1:
|
|
||||||
sprintf (options.value[5], "NTSC (480i)"); break;
|
|
||||||
case 2:
|
|
||||||
sprintf (options.value[5], "Progressive (480p)"); break;
|
|
||||||
case 3:
|
|
||||||
sprintf (options.value[5], "PAL (50Hz)"); break;
|
|
||||||
case 4:
|
|
||||||
sprintf (options.value[5], "PAL (60Hz)"); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = optionBrowser.GetClickedOption();
|
ret = optionBrowser.GetClickedOption();
|
||||||
|
|
||||||
switch (ret)
|
switch (ret)
|
||||||
@ -3060,6 +3037,48 @@ static int MenuSettingsVideo()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ret >= 0 || firstRun)
|
||||||
|
{
|
||||||
|
firstRun = false;
|
||||||
|
|
||||||
|
// don't allow original render mode if progressive video mode detected
|
||||||
|
if (GCSettings.render==0 && progressive)
|
||||||
|
GCSettings.render++;
|
||||||
|
|
||||||
|
if (GCSettings.render == 0)
|
||||||
|
sprintf (options.value[0], "Original");
|
||||||
|
else if (GCSettings.render == 1)
|
||||||
|
sprintf (options.value[0], "Filtered");
|
||||||
|
else if (GCSettings.render == 2)
|
||||||
|
sprintf (options.value[0], "Unfiltered");
|
||||||
|
|
||||||
|
if(GCSettings.widescreen)
|
||||||
|
sprintf (options.value[1], "16:9 Correction");
|
||||||
|
else
|
||||||
|
sprintf (options.value[1], "Default");
|
||||||
|
|
||||||
|
sprintf (options.value[2], "%s", GetFilterName((RenderFilter)GCSettings.FilterMethod));
|
||||||
|
|
||||||
|
sprintf (options.value[3], "%.2f%%", GCSettings.ZoomLevel*100);
|
||||||
|
|
||||||
|
sprintf (options.value[4], "%d, %d", GCSettings.xshift, GCSettings.yshift);
|
||||||
|
|
||||||
|
switch(GCSettings.videomode)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
sprintf (options.value[5], "Automatic (Recommended)"); break;
|
||||||
|
case 1:
|
||||||
|
sprintf (options.value[5], "NTSC (480i)"); break;
|
||||||
|
case 2:
|
||||||
|
sprintf (options.value[5], "Progressive (480p)"); break;
|
||||||
|
case 3:
|
||||||
|
sprintf (options.value[5], "PAL (50Hz)"); break;
|
||||||
|
case 4:
|
||||||
|
sprintf (options.value[5], "PAL (60Hz)"); break;
|
||||||
|
}
|
||||||
|
optionBrowser.TriggerUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
if(backBtn.GetState() == STATE_CLICKED)
|
if(backBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
menu = MENU_GAMESETTINGS;
|
menu = MENU_GAMESETTINGS;
|
||||||
@ -3249,6 +3268,7 @@ static int MenuSettingsFile()
|
|||||||
int menu = MENU_NONE;
|
int menu = MENU_NONE;
|
||||||
int ret;
|
int ret;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
bool firstRun = true;
|
||||||
OptionList options;
|
OptionList options;
|
||||||
sprintf(options.name[i++], "Load Device");
|
sprintf(options.name[i++], "Load Device");
|
||||||
sprintf(options.name[i++], "Save Device");
|
sprintf(options.name[i++], "Save Device");
|
||||||
@ -3309,72 +3329,6 @@ static int MenuSettingsFile()
|
|||||||
{
|
{
|
||||||
usleep(THREAD_SLEEP);
|
usleep(THREAD_SLEEP);
|
||||||
|
|
||||||
// some load/save methods are not implemented - here's where we skip them
|
|
||||||
// they need to be skipped in the order they were enumerated in snes9xGX.h
|
|
||||||
|
|
||||||
// no USB ports on GameCube
|
|
||||||
#ifdef HW_DOL
|
|
||||||
if(GCSettings.LoadMethod == METHOD_USB)
|
|
||||||
GCSettings.LoadMethod++;
|
|
||||||
if(GCSettings.SaveMethod == METHOD_USB)
|
|
||||||
GCSettings.SaveMethod++;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// saving to DVD is impossible
|
|
||||||
if(GCSettings.SaveMethod == METHOD_DVD)
|
|
||||||
GCSettings.SaveMethod++;
|
|
||||||
|
|
||||||
// disable SMB in GC mode (stalls out)
|
|
||||||
#ifdef HW_DOL
|
|
||||||
if(GCSettings.LoadMethod == METHOD_SMB)
|
|
||||||
GCSettings.LoadMethod++;
|
|
||||||
if(GCSettings.SaveMethod == METHOD_SMB)
|
|
||||||
GCSettings.SaveMethod++;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// disable MC saving in Wii mode - does not work for some reason!
|
|
||||||
#ifdef HW_RVL
|
|
||||||
if(GCSettings.SaveMethod == METHOD_MC_SLOTA)
|
|
||||||
GCSettings.SaveMethod++;
|
|
||||||
if(GCSettings.SaveMethod == METHOD_MC_SLOTB)
|
|
||||||
GCSettings.SaveMethod++;
|
|
||||||
options.name[7][0] = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// correct load/save methods out of bounds
|
|
||||||
if(GCSettings.LoadMethod > 4)
|
|
||||||
GCSettings.LoadMethod = 0;
|
|
||||||
if(GCSettings.SaveMethod > 6)
|
|
||||||
GCSettings.SaveMethod = 0;
|
|
||||||
|
|
||||||
if (GCSettings.LoadMethod == METHOD_AUTO) sprintf (options.value[0],"Auto Detect");
|
|
||||||
else if (GCSettings.LoadMethod == METHOD_SD) sprintf (options.value[0],"SD");
|
|
||||||
else if (GCSettings.LoadMethod == METHOD_USB) sprintf (options.value[0],"USB");
|
|
||||||
else if (GCSettings.LoadMethod == METHOD_DVD) sprintf (options.value[0],"DVD");
|
|
||||||
else if (GCSettings.LoadMethod == METHOD_SMB) sprintf (options.value[0],"Network");
|
|
||||||
|
|
||||||
if (GCSettings.SaveMethod == METHOD_AUTO) sprintf (options.value[1],"Auto Detect");
|
|
||||||
else if (GCSettings.SaveMethod == METHOD_SD) sprintf (options.value[1],"SD");
|
|
||||||
else if (GCSettings.SaveMethod == METHOD_USB) sprintf (options.value[1],"USB");
|
|
||||||
else if (GCSettings.SaveMethod == METHOD_SMB) sprintf (options.value[1],"Network");
|
|
||||||
else if (GCSettings.SaveMethod == METHOD_MC_SLOTA) sprintf (options.value[1],"MC Slot A");
|
|
||||||
else if (GCSettings.SaveMethod == METHOD_MC_SLOTB) sprintf (options.value[1],"MC Slot B");
|
|
||||||
|
|
||||||
snprintf (options.value[2], 30, "%s", GCSettings.LoadFolder);
|
|
||||||
snprintf (options.value[3], 30, "%s", GCSettings.SaveFolder);
|
|
||||||
snprintf (options.value[4], 30, "%s", GCSettings.CheatFolder);
|
|
||||||
|
|
||||||
if (GCSettings.AutoLoad == 0) sprintf (options.value[5],"Off");
|
|
||||||
else if (GCSettings.AutoLoad == 1) sprintf (options.value[5],"SRAM");
|
|
||||||
else if (GCSettings.AutoLoad == 2) sprintf (options.value[5],"Snapshot");
|
|
||||||
|
|
||||||
if (GCSettings.AutoSave == 0) sprintf (options.value[6],"Off");
|
|
||||||
else if (GCSettings.AutoSave == 1) sprintf (options.value[6],"SRAM");
|
|
||||||
else if (GCSettings.AutoSave == 2) sprintf (options.value[6],"Snapshot");
|
|
||||||
else if (GCSettings.AutoSave == 3) sprintf (options.value[6],"Both");
|
|
||||||
|
|
||||||
sprintf (options.value[7], "%s", GCSettings.VerifySaves == true ? "On" : "Off");
|
|
||||||
|
|
||||||
ret = optionBrowser.GetClickedOption();
|
ret = optionBrowser.GetClickedOption();
|
||||||
|
|
||||||
switch (ret)
|
switch (ret)
|
||||||
@ -3416,6 +3370,79 @@ static int MenuSettingsFile()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ret >= 0 || firstRun)
|
||||||
|
{
|
||||||
|
firstRun = false;
|
||||||
|
|
||||||
|
// some load/save methods are not implemented - here's where we skip them
|
||||||
|
// they need to be skipped in the order they were enumerated in snes9xGX.h
|
||||||
|
|
||||||
|
// no USB ports on GameCube
|
||||||
|
#ifdef HW_DOL
|
||||||
|
if(GCSettings.LoadMethod == METHOD_USB)
|
||||||
|
GCSettings.LoadMethod++;
|
||||||
|
if(GCSettings.SaveMethod == METHOD_USB)
|
||||||
|
GCSettings.SaveMethod++;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// saving to DVD is impossible
|
||||||
|
if(GCSettings.SaveMethod == METHOD_DVD)
|
||||||
|
GCSettings.SaveMethod++;
|
||||||
|
|
||||||
|
// disable SMB in GC mode (stalls out)
|
||||||
|
#ifdef HW_DOL
|
||||||
|
if(GCSettings.LoadMethod == METHOD_SMB)
|
||||||
|
GCSettings.LoadMethod++;
|
||||||
|
if(GCSettings.SaveMethod == METHOD_SMB)
|
||||||
|
GCSettings.SaveMethod++;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// disable MC saving in Wii mode - does not work for some reason!
|
||||||
|
#ifdef HW_RVL
|
||||||
|
if(GCSettings.SaveMethod == METHOD_MC_SLOTA)
|
||||||
|
GCSettings.SaveMethod++;
|
||||||
|
if(GCSettings.SaveMethod == METHOD_MC_SLOTB)
|
||||||
|
GCSettings.SaveMethod++;
|
||||||
|
options.name[7][0] = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// correct load/save methods out of bounds
|
||||||
|
if(GCSettings.LoadMethod > 4)
|
||||||
|
GCSettings.LoadMethod = 0;
|
||||||
|
if(GCSettings.SaveMethod > 6)
|
||||||
|
GCSettings.SaveMethod = 0;
|
||||||
|
|
||||||
|
if (GCSettings.LoadMethod == METHOD_AUTO) sprintf (options.value[0],"Auto Detect");
|
||||||
|
else if (GCSettings.LoadMethod == METHOD_SD) sprintf (options.value[0],"SD");
|
||||||
|
else if (GCSettings.LoadMethod == METHOD_USB) sprintf (options.value[0],"USB");
|
||||||
|
else if (GCSettings.LoadMethod == METHOD_DVD) sprintf (options.value[0],"DVD");
|
||||||
|
else if (GCSettings.LoadMethod == METHOD_SMB) sprintf (options.value[0],"Network");
|
||||||
|
|
||||||
|
if (GCSettings.SaveMethod == METHOD_AUTO) sprintf (options.value[1],"Auto Detect");
|
||||||
|
else if (GCSettings.SaveMethod == METHOD_SD) sprintf (options.value[1],"SD");
|
||||||
|
else if (GCSettings.SaveMethod == METHOD_USB) sprintf (options.value[1],"USB");
|
||||||
|
else if (GCSettings.SaveMethod == METHOD_SMB) sprintf (options.value[1],"Network");
|
||||||
|
else if (GCSettings.SaveMethod == METHOD_MC_SLOTA) sprintf (options.value[1],"MC Slot A");
|
||||||
|
else if (GCSettings.SaveMethod == METHOD_MC_SLOTB) sprintf (options.value[1],"MC Slot B");
|
||||||
|
|
||||||
|
snprintf (options.value[2], 30, "%s", GCSettings.LoadFolder);
|
||||||
|
snprintf (options.value[3], 30, "%s", GCSettings.SaveFolder);
|
||||||
|
snprintf (options.value[4], 30, "%s", GCSettings.CheatFolder);
|
||||||
|
|
||||||
|
if (GCSettings.AutoLoad == 0) sprintf (options.value[5],"Off");
|
||||||
|
else if (GCSettings.AutoLoad == 1) sprintf (options.value[5],"SRAM");
|
||||||
|
else if (GCSettings.AutoLoad == 2) sprintf (options.value[5],"Snapshot");
|
||||||
|
|
||||||
|
if (GCSettings.AutoSave == 0) sprintf (options.value[6],"Off");
|
||||||
|
else if (GCSettings.AutoSave == 1) sprintf (options.value[6],"SRAM");
|
||||||
|
else if (GCSettings.AutoSave == 2) sprintf (options.value[6],"Snapshot");
|
||||||
|
else if (GCSettings.AutoSave == 3) sprintf (options.value[6],"Both");
|
||||||
|
|
||||||
|
sprintf (options.value[7], "%s", GCSettings.VerifySaves == true ? "On" : "Off");
|
||||||
|
|
||||||
|
optionBrowser.TriggerUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
if(backBtn.GetState() == STATE_CLICKED)
|
if(backBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
menu = MENU_SETTINGS;
|
menu = MENU_SETTINGS;
|
||||||
@ -3437,6 +3464,7 @@ static int MenuSettingsMenu()
|
|||||||
int menu = MENU_NONE;
|
int menu = MENU_NONE;
|
||||||
int ret;
|
int ret;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
bool firstRun = true;
|
||||||
OptionList options;
|
OptionList options;
|
||||||
|
|
||||||
sprintf(options.name[i++], "Exit Action");
|
sprintf(options.name[i++], "Exit Action");
|
||||||
@ -3494,49 +3522,6 @@ static int MenuSettingsMenu()
|
|||||||
{
|
{
|
||||||
usleep(THREAD_SLEEP);
|
usleep(THREAD_SLEEP);
|
||||||
|
|
||||||
#ifdef HW_RVL
|
|
||||||
if (GCSettings.ExitAction == 1)
|
|
||||||
sprintf (options.value[0], "Return to Wii Menu");
|
|
||||||
else if (GCSettings.ExitAction == 2)
|
|
||||||
sprintf (options.value[0], "Power off Wii");
|
|
||||||
else if (GCSettings.ExitAction == 3)
|
|
||||||
sprintf (options.value[0], "Return to Loader");
|
|
||||||
else
|
|
||||||
sprintf (options.value[0], "Auto");
|
|
||||||
#else // GameCube
|
|
||||||
if(GCSettings.ExitAction > 1)
|
|
||||||
GCSettings.ExitAction = 0;
|
|
||||||
if (GCSettings.ExitAction == 0)
|
|
||||||
sprintf (options.value[0], "Return to Loader");
|
|
||||||
else
|
|
||||||
sprintf (options.value[0], "Reboot");
|
|
||||||
|
|
||||||
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
|
|
||||||
sprintf(options.value[2], "Mute");
|
|
||||||
|
|
||||||
if(GCSettings.SFXVolume > 0)
|
|
||||||
sprintf(options.value[3], "%d%%", GCSettings.SFXVolume);
|
|
||||||
else
|
|
||||||
sprintf(options.value[3], "Mute");
|
|
||||||
|
|
||||||
if (GCSettings.Rumble == 1)
|
|
||||||
sprintf (options.value[4], "Enabled");
|
|
||||||
else
|
|
||||||
sprintf (options.value[4], "Disabled");
|
|
||||||
|
|
||||||
ret = optionBrowser.GetClickedOption();
|
ret = optionBrowser.GetClickedOption();
|
||||||
|
|
||||||
switch (ret)
|
switch (ret)
|
||||||
@ -3565,6 +3550,56 @@ static int MenuSettingsMenu()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ret >= 0 || firstRun)
|
||||||
|
{
|
||||||
|
firstRun = false;
|
||||||
|
|
||||||
|
#ifdef HW_RVL
|
||||||
|
if (GCSettings.ExitAction == 1)
|
||||||
|
sprintf (options.value[0], "Return to Wii Menu");
|
||||||
|
else if (GCSettings.ExitAction == 2)
|
||||||
|
sprintf (options.value[0], "Power off Wii");
|
||||||
|
else if (GCSettings.ExitAction == 3)
|
||||||
|
sprintf (options.value[0], "Return to Loader");
|
||||||
|
else
|
||||||
|
sprintf (options.value[0], "Auto");
|
||||||
|
#else // GameCube
|
||||||
|
if(GCSettings.ExitAction > 1)
|
||||||
|
GCSettings.ExitAction = 0;
|
||||||
|
if (GCSettings.ExitAction == 0)
|
||||||
|
sprintf (options.value[0], "Return to Loader");
|
||||||
|
else
|
||||||
|
sprintf (options.value[0], "Reboot");
|
||||||
|
|
||||||
|
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
|
||||||
|
sprintf(options.value[2], "Mute");
|
||||||
|
|
||||||
|
if(GCSettings.SFXVolume > 0)
|
||||||
|
sprintf(options.value[3], "%d%%", GCSettings.SFXVolume);
|
||||||
|
else
|
||||||
|
sprintf(options.value[3], "Mute");
|
||||||
|
|
||||||
|
if (GCSettings.Rumble == 1)
|
||||||
|
sprintf (options.value[4], "Enabled");
|
||||||
|
else
|
||||||
|
sprintf (options.value[4], "Disabled");
|
||||||
|
|
||||||
|
optionBrowser.TriggerUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
if(backBtn.GetState() == STATE_CLICKED)
|
if(backBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
menu = MENU_SETTINGS;
|
menu = MENU_SETTINGS;
|
||||||
@ -3587,6 +3622,7 @@ static int MenuSettingsNetwork()
|
|||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
int ret;
|
int ret;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
bool firstRun = true;
|
||||||
OptionList options;
|
OptionList options;
|
||||||
sprintf(options.name[i++], "SMB Share IP");
|
sprintf(options.name[i++], "SMB Share IP");
|
||||||
sprintf(options.name[i++], "SMB Share Name");
|
sprintf(options.name[i++], "SMB Share Name");
|
||||||
@ -3642,11 +3678,6 @@ static int MenuSettingsNetwork()
|
|||||||
{
|
{
|
||||||
usleep(THREAD_SLEEP);
|
usleep(THREAD_SLEEP);
|
||||||
|
|
||||||
strncpy (options.value[0], GCSettings.smbip, 15);
|
|
||||||
strncpy (options.value[1], GCSettings.smbshare, 19);
|
|
||||||
strncpy (options.value[2], GCSettings.smbuser, 19);
|
|
||||||
strncpy (options.value[3], GCSettings.smbpwd, 19);
|
|
||||||
|
|
||||||
ret = optionBrowser.GetClickedOption();
|
ret = optionBrowser.GetClickedOption();
|
||||||
|
|
||||||
switch (ret)
|
switch (ret)
|
||||||
@ -3668,6 +3699,16 @@ static int MenuSettingsNetwork()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ret >= 0 || firstRun)
|
||||||
|
{
|
||||||
|
firstRun = false;
|
||||||
|
strncpy (options.value[0], GCSettings.smbip, 15);
|
||||||
|
strncpy (options.value[1], GCSettings.smbshare, 19);
|
||||||
|
strncpy (options.value[2], GCSettings.smbuser, 19);
|
||||||
|
strncpy (options.value[3], GCSettings.smbpwd, 19);
|
||||||
|
optionBrowser.TriggerUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
if(backBtn.GetState() == STATE_CLICKED)
|
if(backBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
menu = MENU_SETTINGS;
|
menu = MENU_SETTINGS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user