merging changes from Zopenko from 2.3.4

This commit is contained in:
Daryl Borth 2016-12-10 13:47:27 -07:00
parent 0f46c1c3f3
commit 2a0a8c2d6c
14 changed files with 239 additions and 67 deletions

View File

@ -38,14 +38,31 @@ https://github.com/dborth/vbagx/releases
|0O×øo· UPDATE HISTORY ·oø×O0|
`¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨'
[2.3.3]
[2.3.4 - September 15, 2016]
* fixes the gc pad down on file browser
* added koston default green gb color screen
* added the screenshot/preview button
* added the wiiupro icon on the controller settings
* increased and centered the screenshot image
* added the screenshot white image background
* Added the delete save file (SRAM / Snapshot) option
* Changed the box colors for the SRAM and Snapshots files to match the color
scheme of the emu GUI
* Change the "Power off Wii" exit option to completely turn off the wii,
ignoring the WC24 settings
* Updated settings file name in order to have it's own settings file name
* Added an option to switch between screenshots, covers, or artwork images,
with their respective named folders at the device's root. You can set which
one to show, by going to Settings > Menu > Preview Image. The .PNG image file
needs to have the same name as the ROM (e.g.: Mother 3.png)
* Removed sound from GUI (thanks to Askot)
* Added option to switch between the Green or Monochrome GB color screen. You
can set which one to show by going to Settings > Emulation > GB Screen Palette
[2.3.3 - June 25, 2016]
* Fixed the GC pad Down input on the File browser window
* Added Koston's green gb color screen
* Added the Screenshot Button
* Increased and Centered the Screenshot image and reduce game list width
* Added a background for the preview image
* Added the WiiuPro Controller icon on the controller settings
* Fix DSI error / Bug from Emulator Main Menu
[2.3.2 - March 4, 2015] - libertyernie

View File

@ -93,6 +93,8 @@ extern const u8 icon_game_load_png[];
extern const u32 icon_game_load_png_size;
extern const u8 icon_game_save_png[];
extern const u32 icon_game_save_png_size;
extern const u8 icon_game_delete_png[];
extern const u32 icon_game_delete_png_size;
extern const u8 icon_game_reset_png[];
extern const u32 icon_game_reset_png_size;

View File

@ -24,6 +24,8 @@ GuiSaveBrowser::GuiSaveBrowser(int w, int h, SaveList * s, int a)
if(action == 0) // load
listOffset = 0;
else if(action == 2) // delete SRAM / Snapshot
listOffset = 0;
else
listOffset = -2; // save - reserve -2 & -1 for new slots
@ -257,7 +259,8 @@ void GuiSaveBrowser::Update(GuiTrigger * t)
if(selectedItem == 0)
{
if((listOffset - 2 >= 0 && action == 0) ||
(listOffset >= 0 && action == 1))
(listOffset >= 0 && action == 1) ||
(listOffset - 2 >= 0 && action == 2))
{
// move list up by 1
listOffset -= 2;
@ -295,7 +298,8 @@ void GuiSaveBrowser::Update(GuiTrigger * t)
if(selectedItem < 2)
{
if((listOffset - 2 >= 0 && action == 0) ||
(listOffset >= 0 && action == 1))
(listOffset >= 0 && action == 1) ||
(listOffset - 2 >= 0 && action == 2))
{
// move list up by 1
listOffset -= 2;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -773,7 +773,7 @@ static void WindowCredits(void * ptr)
txt[i] = new GuiText("Credits", 20, (GXColor){0, 0, 0, 255});
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(0,y); i++; y+=24;
txt[i] = new GuiText("Official Site: https://github.com/dborth/vba-wii", 20, (GXColor){0, 0, 0, 255});
txt[i] = new GuiText("Official Site: https://github.com/dborth/vbagx", 20, (GXColor){0, 0, 0, 255});
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(0,y); i++; y+=32;
txt[i]->SetPresets(20, (GXColor){0, 0, 0, 255}, 0,
@ -973,7 +973,7 @@ static int MenuGameSelection()
preview.SetPosition(174, -8);
u8* imgBuffer = MEM_ALLOC(512 * 512 * 4);
int previousBrowserIndex = -1;
char screenshotPath[MAXJOLIET + 1];
char imagePath[MAXJOLIET + 1];
HaltGui();
btnLogo->SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
@ -1009,15 +1009,15 @@ static int MenuGameSelection()
gameBrowser.TriggerUpdate();
}
//update game screenshot
//update gamelist image
if(previousBrowserIndex != browser.selIndex)
{
previousBrowserIndex = browser.selIndex;
snprintf(screenshotPath, MAXJOLIET, "%s%s/%s.png", pathPrefix[GCSettings.LoadMethod], GCSettings.ScreenshotsFolder, browserList[browser.selIndex].displayname);
snprintf(imagePath, MAXJOLIET, "%s%s/%s.png", pathPrefix[GCSettings.LoadMethod], GCSettings.ImageFolder, browserList[browser.selIndex].displayname);
AllocSaveBuffer();
int width, height;
if(LoadFile(screenshotPath, SILENT))
if(LoadFile(imagePath, SILENT))
{
if(DecodePNG(savebuffer, &width, &height, imgBuffer, 512, 512))
{
@ -1134,6 +1134,7 @@ static int MenuGame()
GuiImageData iconGameSettings(icon_game_settings_png);
GuiImageData iconLoad(icon_game_load_png);
GuiImageData iconSave(icon_game_save_png);
GuiImageData iconDelete(icon_game_delete_png);
GuiImageData iconReset(icon_game_reset_png);
GuiImageData battery(battery_png);
@ -1143,10 +1144,9 @@ static int MenuGame()
GuiTrigger trigHome;
trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0);
int xOffset=125, yOffset=65;
if (isBoktai) {
xOffset=170; yOffset=70;
}
int xOffset=125;
if (isBoktai)
xOffset=200;
GuiText saveBtnTxt("Save", 22, (GXColor){0, 0, 0, 255});
GuiImage saveBtnImg(&btnLargeOutline);
@ -1154,7 +1154,7 @@ static int MenuGame()
GuiImage saveBtnIcon(&iconSave);
GuiButton saveBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
saveBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
saveBtn.SetPosition(-xOffset, 185-yOffset);
saveBtn.SetPosition(-200, 120);
saveBtn.SetLabel(&saveBtnTxt);
saveBtn.SetImage(&saveBtnImg);
saveBtn.SetImageOver(&saveBtnImgOver);
@ -1171,7 +1171,7 @@ static int MenuGame()
GuiImage loadBtnIcon(&iconLoad);
GuiButton loadBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
loadBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
loadBtn.SetPosition(xOffset, 185-yOffset);
loadBtn.SetPosition(0, 120);
loadBtn.SetLabel(&loadBtnTxt);
loadBtn.SetImage(&loadBtnImg);
loadBtn.SetImageOver(&loadBtnImgOver);
@ -1182,29 +1182,51 @@ static int MenuGame()
loadBtn.SetTrigger(trig2);
loadBtn.SetEffectGrow();
GuiText deleteBtnTxt("Delete", 22, (GXColor){0, 0, 0, 255});
GuiImage deleteBtnImg(&btnLargeOutline);
GuiImage deleteBtnImgOver(&btnLargeOutlineOver);
GuiImage deleteBtnIcon(&iconDelete);
GuiButton deleteBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
deleteBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
deleteBtn.SetPosition(200, 120);
deleteBtn.SetLabel(&deleteBtnTxt);
deleteBtn.SetImage(&deleteBtnImg);
deleteBtn.SetImageOver(&deleteBtnImgOver);
deleteBtn.SetIcon(&deleteBtnIcon);
deleteBtn.SetSoundOver(&btnSoundOver);
deleteBtn.SetSoundClick(&btnSoundClick);
deleteBtn.SetTrigger(trigA);
deleteBtn.SetTrigger(trig2);
deleteBtn.SetEffectGrow();
// Boktai adds an extra button for setting the sun.
GuiText *sunBtnTxt = NULL;
GuiImage *sunBtnImg = NULL;
GuiImage *sunBtnImgOver = NULL;
GuiButton *sunBtn = NULL;
if (isBoktai) {
if (isBoktai)
{
struct tm *newtime;
time_t long_time;
// regardless of the weather, there should be no sun at night time!
time(&long_time); // Get time as long integer.
newtime = localtime(&long_time); // Convert to local time.
if (newtime->tm_hour > 21 || newtime->tm_hour < 5)
{
sprintf(s, "Weather: Night Time");
} else sprintf(s, "Weather: %d%% sun", SunBars*10);
}
else
sprintf(s, "Weather: %d%% sun", SunBars*10);
sunBtnTxt = new GuiText(s, 22, (GXColor){0, 0, 0, 255});
sunBtnTxt->SetWrap(true, btnLargeOutline.GetWidth()-30);
sunBtnImg = new GuiImage(&btnLargeOutline);
sunBtnImgOver = new GuiImage(&btnLargeOutlineOver);
sunBtn = new GuiButton(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
sunBtn->SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
sunBtn->SetPosition(0, 185);
sunBtn->SetPosition(0, 250);
sunBtn->SetLabel(sunBtnTxt);
sunBtn->SetImage(sunBtnImg);
sunBtn->SetImageOver(sunBtnImgOver);
@ -1221,7 +1243,7 @@ static int MenuGame()
GuiImage resetBtnIcon(&iconReset);
GuiButton resetBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
resetBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
resetBtn.SetPosition(xOffset, 185+yOffset);
resetBtn.SetPosition(xOffset, 250);
resetBtn.SetLabel(&resetBtnTxt);
resetBtn.SetImage(&resetBtnImg);
resetBtn.SetImageOver(&resetBtnImgOver);
@ -1239,7 +1261,7 @@ static int MenuGame()
GuiImage gameSettingsBtnIcon(&iconGameSettings);
GuiButton gameSettingsBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
gameSettingsBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
gameSettingsBtn.SetPosition(-xOffset, 185+yOffset);
gameSettingsBtn.SetPosition(-xOffset, 250);
gameSettingsBtn.SetLabel(&gameSettingsBtnTxt);
gameSettingsBtn.SetImage(&gameSettingsBtnImg);
gameSettingsBtn.SetImageOver(&gameSettingsBtnImgOver);
@ -1328,6 +1350,7 @@ static int MenuGame()
w.Append(&titleTxt);
w.Append(&saveBtn);
w.Append(&loadBtn);
w.Append(&deleteBtn);
w.Append(&resetBtn);
w.Append(&gameSettingsBtn);
if (isBoktai)
@ -1443,7 +1466,8 @@ static int MenuGame()
if (isBoktai)
{
if (sunBtn->GetState() == STATE_CLICKED) {
if (sunBtn->GetState() == STATE_CLICKED)
{
++SunBars;
if (SunBars>10) SunBars=0;
menu = MENU_GAME;
@ -1458,6 +1482,10 @@ static int MenuGame()
{
menu = MENU_GAME_LOAD;
}
else if(deleteBtn.GetState() == STATE_CLICKED)
{
menu = MENU_GAME_DELETE;
}
else if(resetBtn.GetState() == STATE_CLICKED)
{
if (WindowPrompt("Reset Game", "Reset this game? Any unsaved progress will be lost.", "OK", "Cancel"))
@ -1584,6 +1612,7 @@ static int MenuGameSaves(int action)
int j = 0;
char filepath[1024];
char deletepath[1024];
char scrfile[1024];
char tmp[MAXJOLIET+1];
@ -1601,6 +1630,8 @@ static int MenuGameSaves(int action)
if(action == 0)
titleTxt.SetText("Load Game");
else if (action == 2)
titleTxt.SetText("Delete Saves");
else
titleTxt.SetText("Save Game");
@ -1709,7 +1740,7 @@ static int MenuGameSaves(int action)
FreeSaveBuffer();
saves.length = j;
if(saves.length == 0 && action == 0)
if((saves.length == 0 && action == 0) || (saves.length == 0 && action == 2))
{
InfoPrompt("No game saves found.");
menu = MENU_GAME;
@ -1730,7 +1761,7 @@ static int MenuGameSaves(int action)
ret = saveBrowser.GetClickedSave();
// load or save game
// load, save and delete save games
if(ret > -3)
{
result = 0;
@ -1750,6 +1781,35 @@ static int MenuGameSaves(int action)
}
if(result)
menu = MENU_EXIT;
}
else if(action == 2) // delete SRAM/Snapshot
{
if (WindowPrompt("Delete File", "Delete this save file? Deleted files can not be restored.", "OK", "Cancel"))
{
MakeFilePath(filepath, saves.type[ret], saves.filename[ret]);
switch(saves.type[ret])
{
case FILE_SRAM:
strncpy(deletepath, filepath, 1024);
deletepath[strlen(deletepath)-4] = 0;
sprintf(deletepath, "%s.sav", deletepath);
remove(deletepath); // Delete the *.srm file (Battery save file)
break;
case FILE_SNAPSHOT:
strncpy(deletepath, filepath, 1024);
deletepath[strlen(deletepath)-4] = 0;
sprintf(deletepath, "%s.png", deletepath);
remove(deletepath); // Delete the *.png file (Screenshot file)
strncpy(deletepath, filepath, 1024);
deletepath[strlen(deletepath)-4] = 0;
sprintf(deletepath, "%s.sgm", deletepath);
remove(deletepath); // Delete the *.frz file (Save State file)
break;
}
}
menu = MENU_GAME_DELETE;
}
else // save
{
@ -2016,7 +2076,7 @@ static int MenuGameSettings()
if (WindowPrompt("Preview Screenshot", "Save a new Preview Screenshot? Current Screenshot image will be overwritten.", "OK", "Cancel"))
{
snprintf(filepath, 1024, "%s%s/%s", pathPrefix[GCSettings.SaveMethod], GCSettings.ScreenshotsFolder, ROMFilename);
SavePreviewImg(filepath, NOTSILENT);
SavePreviewImg(filepath, SILENT);
}
}
else if(closeBtn.GetState() == STATE_CLICKED)
@ -3067,6 +3127,7 @@ static int MenuSettingsEmulation()
sprintf(options.name[i++], "Hardware (GB/GBC)");
sprintf(options.name[i++], "Super Game Boy border");
sprintf(options.name[i++], "Offset from UTC (hours)");
sprintf(options.name[i++], "GB Screen Palette");
options.length = i;
for(i=0; i < options.length; i++)
@ -3135,6 +3196,9 @@ static int MenuSettingsEmulation()
GCSettings.OffsetMinutesUTC = -60*12;
}
break;
case 3:
GCSettings.BasicPalette ^= 1;
break;
}
if(ret >= 0 || firstRun)
@ -3149,10 +3213,6 @@ static int MenuSettingsEmulation()
sprintf (options.value[0], "Super Game Boy");
else if (GCSettings.GBHardware == 3)
sprintf (options.value[0], "Game Boy");
else if (GCSettings.GBHardware == 4)
sprintf (options.value[0], "Game Boy Advance");
else if (GCSettings.GBHardware == 5)
sprintf (options.value[0], "Super Game Boy 2");
if (GCSettings.SGBBorder == 0)
sprintf (options.value[1], "Off");
@ -3163,6 +3223,12 @@ static int MenuSettingsEmulation()
sprintf (options.value[2], "%+.2f", GCSettings.OffsetMinutesUTC / 60.0);
if (GCSettings.BasicPalette == 0)
sprintf (options.value[3], "Green Screen");
else
sprintf (options.value[3], "Monochrome Screen");
optionBrowser.TriggerUpdate();
}
@ -3172,6 +3238,7 @@ static int MenuSettingsEmulation()
}
}
HaltGui();
InitialisePalette();
mainWindow->Remove(&optionBrowser);
mainWindow->Remove(&w);
mainWindow->Remove(&titleTxt);
@ -3379,6 +3446,8 @@ static int MenuSettingsFile()
sprintf(options.name[i++], "Load Folder");
sprintf(options.name[i++], "Save Folder");
sprintf(options.name[i++], "Screenshots Folder");
sprintf(options.name[i++], "Covers Folder");
sprintf(options.name[i++], "Artworks Folder");
sprintf(options.name[i++], "Auto Load");
sprintf(options.name[i++], "Auto Save");
sprintf(options.name[i++], "Append Auto to .SAV Files");
@ -3453,18 +3522,26 @@ static int MenuSettingsFile()
break;
case 5:
OnScreenKeyboard(GCSettings.CoverFolder, MAXPATHLEN);
break;
case 6:
OnScreenKeyboard(GCSettings.ArtworkFolder, MAXPATHLEN);
break;
case 7:
GCSettings.AutoLoad++;
if (GCSettings.AutoLoad > 2)
GCSettings.AutoLoad = 0;
break;
case 6:
case 8:
GCSettings.AutoSave++;
if (GCSettings.AutoSave > 3)
GCSettings.AutoSave = 0;
break;
case 7:
case 9:
GCSettings.AppendAuto++;
if (GCSettings.AppendAuto > 1)
GCSettings.AppendAuto = 0;
@ -3530,18 +3607,20 @@ static int MenuSettingsFile()
snprintf (options.value[2], 35, "%s", GCSettings.LoadFolder);
snprintf (options.value[3], 35, "%s", GCSettings.SaveFolder);
snprintf (options.value[4], 35, "%s", GCSettings.ScreenshotsFolder);
snprintf (options.value[5], 35, "%s", GCSettings.CoverFolder);
snprintf (options.value[6], 35, "%s", GCSettings.ArtworkFolder);
if (GCSettings.AutoLoad == 0) sprintf (options.value[7],"Off");
else if (GCSettings.AutoLoad == 1) sprintf (options.value[7],"SRAM");
else if (GCSettings.AutoLoad == 2) sprintf (options.value[7],"Snapshot");
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[8],"Off");
else if (GCSettings.AutoSave == 1) sprintf (options.value[8],"SRAM");
else if (GCSettings.AutoSave == 2) sprintf (options.value[8],"Snapshot");
else if (GCSettings.AutoSave == 3) sprintf (options.value[8],"Both");
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");
if (GCSettings.AppendAuto == 0) sprintf (options.value[7],"Off");
else if (GCSettings.AppendAuto == 1) sprintf (options.value[7],"On");
if (GCSettings.AppendAuto == 0) sprintf (options.value[9],"Off");
else if (GCSettings.AppendAuto == 1) sprintf (options.value[9],"On");
optionBrowser.TriggerUpdate();
}
@ -3575,6 +3654,7 @@ static int MenuSettingsMenu()
sprintf(options.name[i++], "Sound Effects Volume");
sprintf(options.name[i++], "Rumble");
sprintf(options.name[i++], "Language");
sprintf(options.name[i++], "Preview Image");
options.length = i;
for(i=0; i < options.length; i++)
@ -3657,6 +3737,11 @@ static int MenuSettingsMenu()
GCSettings.language = LANG_PORTUGUESE;
else if(GCSettings.language == LANG_JAPANESE)
GCSettings.language = LANG_ENGLISH;
break;
case 6:
GCSettings.PreviewImage++;
if(GCSettings.PreviewImage > 2)
GCSettings.PreviewImage = 0;
break;
}
@ -3724,7 +3809,22 @@ static int MenuSettingsMenu()
case LANG_CATALAN: sprintf(options.value[5], "Catalan"); break;
case LANG_TURKISH: sprintf(options.value[5], "Turkish"); break;
}
switch(GCSettings.PreviewImage)
{
case 0:
sprintf(options.value[6], "Screenshots");
snprintf(GCSettings.ImageFolder, MAXJOLIET, "%s", GCSettings.ScreenshotsFolder);
break;
case 1:
sprintf(options.value[6], "Covers");
snprintf(GCSettings.ImageFolder, MAXJOLIET, "%s", GCSettings.CoverFolder);
break;
case 2:
sprintf(options.value[6], "Artworks");
snprintf(GCSettings.ImageFolder, MAXJOLIET, "%s", GCSettings.ArtworkFolder);
break;
}
optionBrowser.TriggerUpdate();
}
@ -4671,6 +4771,9 @@ MainMenu (int menu)
case MENU_GAME_SAVE:
currentMenu = MenuGameSaves(1);
break;
case MENU_GAME_DELETE:
currentMenu = MenuGameSaves(2);
break;
case MENU_GAMESETTINGS:
currentMenu = MenuGameSettings();
break;

View File

@ -39,6 +39,7 @@ enum
MENU_GAME,
MENU_GAME_SAVE,
MENU_GAME_LOAD,
MENU_GAME_DELETE,
MENU_GAMESETTINGS,
MENU_GAMESETTINGS_MAPPINGS,
MENU_GAMESETTINGS_MAPPINGS_MAP,

View File

@ -167,8 +167,11 @@ preparePrefsData ()
createXMLSetting("SaveMethod", "Save Method", toStr(GCSettings.SaveMethod));
createXMLSetting("LoadFolder", "Load Folder", GCSettings.LoadFolder);
createXMLSetting("SaveFolder", "Save Folder", GCSettings.SaveFolder);
//createXMLSetting("CheatFolder", "Cheats Folder", GCSettings.CheatFolder);
createXMLSetting("ScreenshotsFolder", "Screenshots Folder", GCSettings.ScreenshotsFolder);
createXMLSetting("CoverFolder", "Covers Folder", GCSettings.CoverFolder);
createXMLSetting("ArtworkFolder", "Artworks Folder", GCSettings.ArtworkFolder);
createXMLSetting("ImageFolder", "Image Folder", GCSettings.ImageFolder);
createXMLSection("Network", "Network Settings");
createXMLSetting("smbip", "Share Computer IP", GCSettings.smbip);
@ -197,7 +200,12 @@ preparePrefsData ()
createXMLSetting("SFXVolume", "Sound Effects Volume", toStr(GCSettings.SFXVolume));
createXMLSetting("Rumble", "Rumble", toStr(GCSettings.Rumble));
createXMLSetting("language", "Language", toStr(GCSettings.language));
createXMLSetting("PreviewImage", "Preview Image", toStr(GCSettings.PreviewImage));
createXMLSection("Emulation", "Emulation Settings");
createXMLSetting("BasicPalette", "Basic Color Palette for GB", toStr(GCSettings.BasicPalette));
createXMLSection("Controller", "Controller Settings");
createXMLSetting("WiiControls", "Match Wii Game", toStr(GCSettings.WiiControls));
@ -448,9 +456,6 @@ decodePrefsData ()
result = false;
else if(verMajor < 2) // less than version 2.0.0
result = false; // reset settings (sorry, should update settings instead)
else if((verMajor*100 + verMinor*10 + verPoint) >
(curMajor*100 + curMinor*10 + curPoint)) // some future version
result = false; // reset settings
else
result = true;
}
@ -466,8 +471,11 @@ decodePrefsData ()
loadXMLSetting(&GCSettings.SaveMethod, "SaveMethod");
loadXMLSetting(GCSettings.LoadFolder, "LoadFolder", sizeof(GCSettings.LoadFolder));
loadXMLSetting(GCSettings.SaveFolder, "SaveFolder", sizeof(GCSettings.SaveFolder));
//loadXMLSetting(GCSettings.CheatFolder, "CheatFolder", sizeof(GCSettings.CheatFolder));
loadXMLSetting(GCSettings.ScreenshotsFolder, "ScreenshotsFolder", sizeof(GCSettings.ScreenshotsFolder));
loadXMLSetting(GCSettings.CoverFolder, "CoverFolder", sizeof(GCSettings.CoverFolder));
loadXMLSetting(GCSettings.ArtworkFolder, "ArtworkFolder", sizeof(GCSettings.ArtworkFolder));
loadXMLSetting(GCSettings.ImageFolder, "ImageFolder", sizeof(GCSettings.ImageFolder));
// Network Settings
loadXMLSetting(GCSettings.smbip, "smbip", sizeof(GCSettings.smbip));
@ -496,7 +504,13 @@ decodePrefsData ()
loadXMLSetting(&GCSettings.SFXVolume, "SFXVolume");
loadXMLSetting(&GCSettings.Rumble, "Rumble");
loadXMLSetting(&GCSettings.language, "language");
loadXMLSetting(&GCSettings.PreviewImage, "PreviewImage");
// Emulation Settings
loadXMLSetting(&GCSettings.BasicPalette, "BasicPalette");
// Controller Settings
loadXMLSetting(&GCSettings.WiiControls, "WiiControls");
@ -599,7 +613,11 @@ DefaultSettings ()
GCSettings.SaveMethod = DEVICE_AUTO; // Auto, SD, USB, Network (SMB)
sprintf (GCSettings.LoadFolder, "%s/roms", APPFOLDER); // Path to game files
sprintf (GCSettings.SaveFolder, "%s/saves", APPFOLDER); // Path to save files
sprintf (GCSettings.CheatFolder, "%s/cheats", APPFOLDER); // Path to cheat files
sprintf (GCSettings.ScreenshotsFolder, "%s/screenshots", APPFOLDER); // Path to screenshot files
sprintf (GCSettings.CoverFolder, "%s/covers", APPFOLDER); // Path to cover files
sprintf (GCSettings.ArtworkFolder, "%s/artworks", APPFOLDER); // Path to artwork files
sprintf (GCSettings.ImageFolder, "%s/screenshots", APPFOLDER);
GCSettings.AutoLoad = 1;
GCSettings.AutoSave = 1;
@ -623,6 +641,10 @@ DefaultSettings ()
GCSettings.MusicVolume = 40;
GCSettings.SFXVolume = 40;
GCSettings.Rumble = 1;
GCSettings.PreviewImage = 0;
GCSettings.BasicPalette = 0;
#ifdef HW_RVL
GCSettings.language = CONF_GetLanguage();

View File

@ -91,7 +91,7 @@ void ExitApp()
ExitCleanup();
if(ShutdownRequested)
SYS_ResetSystem(SYS_POWEROFF, 0, 0);
SYS_ResetSystem(SYS_POWEROFF_STANDBY, 0, 0);
#ifdef HW_RVL
if(GCSettings.ExitAction == 0) // Auto
@ -123,7 +123,7 @@ void ExitApp()
}
else if(GCSettings.ExitAction == 2) // Shutdown Wii
{
SYS_ResetSystem(SYS_POWEROFF, 0, 0);
SYS_ResetSystem(SYS_POWEROFF_STANDBY, 0, 0);
}
else // Exit to Loader
{

View File

@ -16,7 +16,7 @@
#include "utils/FreeTypeGX.h"
#define APPNAME "Visual Boy Advance GX"
#define APPVERSION "2.3.3"
#define APPVERSION "2.3.4"
#define APPFOLDER "vbagx"
#define PREF_FILE_NAME "settings.xml"
#define PAL_FILE_NAME "palettes.xml"
@ -27,7 +27,8 @@
const char pathPrefix[9][8] =
{ "", "sd:/", "usb:/", "dvd:/", "smb:/", "carda:/", "cardb:/" };
enum {
enum
{
DEVICE_AUTO,
DEVICE_SD,
DEVICE_USB,
@ -37,14 +38,16 @@ enum {
DEVICE_SD_SLOTB
};
enum {
enum
{
FILE_SRAM,
FILE_SNAPSHOT,
FILE_ROM,
FILE_BORDER_PNG
};
enum {
enum
{
LANG_JAPANESE = 0,
LANG_ENGLISH,
LANG_GERMAN,
@ -62,7 +65,8 @@ enum {
LANG_LENGTH
};
struct SGCSettings{
struct SGCSettings
{
float gbaZoomHor; // GBA horizontal zoom amount
float gbaZoomVert; // GBA vertical zoom amount
float gbZoomHor; // GB horizontal zoom amount
@ -88,15 +92,22 @@ struct SGCSettings{
int SFXVolume;
int Rumble;
int language;
int PreviewImage;
int OffsetMinutesUTC; // Used for clock on MBC3 and TAMA5
int GBHardware; // Mapped to gbEmulatorType in VBA
int SGBBorder;
int BasicPalette; // 0 - Green 1 - Monochrome
char LoadFolder[MAXPATHLEN]; // Path to game files
char LastFileLoaded[MAXPATHLEN]; //Last file loaded filename
char SaveFolder[MAXPATHLEN]; // Path to save files
char CheatFolder[MAXPATHLEN]; // Path to cheat files
char ScreenshotsFolder[MAXPATHLEN]; //Path to screenshots files
char CoverFolder[MAXPATHLEN]; //Path to cover files
char ArtworkFolder[MAXPATHLEN]; //Path to artwork files
char ImageFolder[MAXPATHLEN]; //Saved image folder path
char BorderFolder[MAXPATHLEN]; // Path to Super Game Boy border files
char smbip[80];
char smbuser[20];
char smbpwd[20];

View File

@ -1061,12 +1061,14 @@ bool LoadGBROM()
{
gbEmulatorType = GCSettings.GBHardware;
if (browserList[browser.selIndex].length > 1024*1024*8) {
if (browserList[browser.selIndex].length > 1024*1024*8)
{
InfoPrompt("ROM size is too large (> 8 MB)");
return false;
}
gbRom = (u8 *)malloc(1024*1024*8); // 32 MB is too much for sure
if (!gbRom) {
if (!gbRom)
{
InfoPrompt("Unable to allocate 8 MB of memory");
return false;
}
@ -1310,9 +1312,19 @@ void InitialisePalette()
// Build GBPalette
for( i = 0; i < 24; )
{
systemGbPalette[i++] = (0x1c) | (0x1e << 5) | (0x1c << 10);
systemGbPalette[i++] = (0x10) | (0x17 << 5) | (0x0b << 10);
systemGbPalette[i++] = (0x27) | (0x0c << 5) | (0x0a << 10);
if (GCSettings.BasicPalette == 0) //Greenish color
{
systemGbPalette[i++] = (0x1c) | (0x1e << 5) | (0x1c << 10);
systemGbPalette[i++] = (0x10) | (0x17 << 5) | (0x0b << 10);
systemGbPalette[i++] = (0x27) | (0x0c << 5) | (0x0a << 10);
}
else // Monochrome color
{
systemGbPalette[i++] = (0x1f) | (0x1f << 5) | (0x1f << 10);
systemGbPalette[i++] = (0x15) | (0x15 << 5) | (0x15 << 10);
systemGbPalette[i++] = (0x0c) | (0x0c << 5) | (0x0c << 10);
}
systemGbPalette[i++] = 0;
}
// Set palette etc - Fixed to RGB565