diff --git a/.gitignore b/.gitignore index 31ea311..502d5bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -/snes9x-gx.pnps -/snes9x-gx.pnproj -/build_wii -/executables +/snes9x-gx.pnps +/snes9x-gx.pnproj +/build_wii +/build_gc +/executables diff --git a/readme.txt b/readme.txt index 49539e4..e53312e 100644 --- a/readme.txt +++ b/readme.txt @@ -31,6 +31,18 @@ Wii homebrew is WiiBrew (www.wiibrew.org). •˜———–—––-- - —————————––––– ———–—––-- - —————————––––– ———–—––-- - ————————• | UPDATE HISTORY | •˜———–—––-- - —————————––––– ———–—––-- - —————————––––– ———–—––-- - ————————• + +[4.3.6 - September 12, 2016] + +* 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 emulator credits +* Added an option to switch between screenshots, covers, or artworks images, + with their respectively named folders inside /snes9xgx 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.: Contra III.png) + [4.3.5 - February 06, 2016] * Added Fix94 wiiflow plugin mode diff --git a/source/freeze.cpp b/source/freeze.cpp index 234e764..dc2ff2c 100644 --- a/source/freeze.cpp +++ b/source/freeze.cpp @@ -144,8 +144,7 @@ LoadSnapshotAuto (bool silent) * SavePreview ***************************************************************************/ -int -SavePreviewImg (char * filepath, bool silent) +int SavePreviewImg (char * filepath, bool silent) { int device; @@ -161,8 +160,5 @@ SavePreviewImg (char * filepath, bool silent) sprintf(screenpath, "%s.png", screenpath); SaveFile((char *)gameScreenPng, screenpath, gameScreenPngSize, silent); } - - if(!silent) - InfoPrompt("Save successful"); return 1; } \ No newline at end of file diff --git a/source/images/button_gamesave.png b/source/images/button_gamesave.png index 1e44a73..78803c6 100644 Binary files a/source/images/button_gamesave.png and b/source/images/button_gamesave.png differ diff --git a/source/images/button_gamesave_over.png b/source/images/button_gamesave_over.png index 0f44608..ce132c3 100644 Binary files a/source/images/button_gamesave_over.png and b/source/images/button_gamesave_over.png differ diff --git a/source/images/button_prompt_over.png b/source/images/button_prompt_over.png index 2f244c2..605cfeb 100644 Binary files a/source/images/button_prompt_over.png and b/source/images/button_prompt_over.png differ diff --git a/source/input.cpp b/source/input.cpp index 8739968..a1a4993 100644 --- a/source/input.cpp +++ b/source/input.cpp @@ -633,13 +633,13 @@ void ReportButtons () int i, j; UpdatePads(); -/* + Settings.TurboMode = ( userInput[0].pad.substickX > 70 || userInput[0].WPAD_StickX(1) > 70 || userInput[0].wupcdata.substickX > 560 ); // RIGHT on c-stick and on classic controller right joystick -*/ + /* Check for menu: * CStick left * OR "L+R+X+Y" (eg. Homebrew/Adapted SNES controllers) diff --git a/source/menu.cpp b/source/menu.cpp index bc2782e..2619427 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -787,13 +787,13 @@ static void WindowCredits(void * ptr) creditsBoxImg.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); creditsWindowBox.Append(&creditsBoxImg); - int numEntries = 24; + int numEntries = 23; GuiText * txt[numEntries]; txt[i] = new GuiText("Credits", 30, (GXColor){0, 0, 0, 255}); txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(0,y); i++; y+=32; - txt[i] = new GuiText("Official Site: http://code.google.com/p/snes9x-gx/", 20, (GXColor){0, 0, 0, 255}); + txt[i] = new GuiText("Official Site: https://github.com/dborth/snes9xgx", 20, (GXColor){0, 0, 0, 255}); txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(0,y); i++; y+=40; txt[i]->SetPresets(20, (GXColor){0, 0, 0, 255}, 0, @@ -803,9 +803,9 @@ static void WindowCredits(void * ptr) txt[i]->SetPosition(60,y); i++; txt[i] = new GuiText("Tantric"); txt[i]->SetPosition(350,y); i++; y+=24; - txt[i] = new GuiText("Coding"); + txt[i] = new GuiText("Additional improvements"); txt[i]->SetPosition(60,y); i++; - txt[i] = new GuiText("michniewski"); + txt[i] = new GuiText("Zopenko, michniewski"); txt[i]->SetPosition(350,y); i++; y+=24; txt[i] = new GuiText("Menu artwork"); txt[i]->SetPosition(60,y); i++; @@ -841,11 +841,9 @@ static void WindowCredits(void * ptr) txt[i] = new GuiText("Snes9x - Copyright (c) Snes9x Team 1996 - 2006"); txt[i]->SetPosition(0,y); i++; y+=20; - txt[i] = new GuiText("This software is open source and may be copied,"); + txt[i] = new GuiText("This software is open source and may be copied, distributed, or modified "); txt[i]->SetPosition(0,y); i++; y+=20; - txt[i] = new GuiText("distributed, or modified under the terms of the"); - txt[i]->SetPosition(0,y); i++; y+=20; - txt[i] = new GuiText("GNU General Public License (GPL) Version 2."); + txt[i] = new GuiText("under the terms of the GNU General Public License (GPL) Version 2."); txt[i]->SetPosition(0,y); i++; y+=20; char iosVersion[20]; @@ -989,8 +987,8 @@ 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); btnLogo->SetPosition(-50, 24); @@ -1013,11 +1011,11 @@ static int MenuGameSelection() gameBrowser.fileList[0]->SetState(STATE_SELECTED); gameBrowser.TriggerUpdate(); titleTxt.SetText(inSz ? szname : "Choose Game"); - + while(menu == MENU_NONE) { usleep(THREAD_SLEEP); - + if(selectLoadedFile == 2) { selectLoadedFile = 0; @@ -1050,8 +1048,7 @@ static int MenuGameSelection() menu = MENU_GAMESELECTION; break; } - - + titleTxt.SetText(inSz ? szname : "Choose Game"); ResumeGui(); @@ -1071,20 +1068,19 @@ static int MenuGameSelection() } } - //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)) { preview.SetImage(imgBuffer, width, height); - //preview.SetScale(225.0f / width); preview.SetScale( MIN(225.0f / width, 235.0f / height) ); } else @@ -1290,7 +1286,7 @@ static int MenuGame() deleteBtn.SetTrigger(trigA); deleteBtn.SetTrigger(trig2); deleteBtn.SetEffectGrow(); - + GuiText resetBtnTxt("Reset", 22, (GXColor){0, 0, 0, 255}); GuiImage resetBtnImg(&btnLargeOutline); GuiImage resetBtnImgOver(&btnLargeOutlineOver); @@ -1776,7 +1772,7 @@ static int MenuGameSaves(int action) ret = saveBrowser.GetClickedSave(); - // load, save and delete save games + //load, save and delete save games if(ret > -3) { int result = 0; @@ -1796,7 +1792,7 @@ static int MenuGameSaves(int action) if(result) menu = MENU_EXIT; } - else if(action == 2) // delete SRAM/Snapshot + else if(action == 2) // delete RAM/State { if (WindowPrompt("Delete File", "Delete this save file? Deleted files can not be restored.", "OK", "Cancel")) { @@ -1822,8 +1818,6 @@ static int MenuGameSaves(int action) } } menu = MENU_GAME_DELETE; - - } else // save { @@ -1869,7 +1863,6 @@ static int MenuGameSaves(int action) } } } - if(backBtn.GetState() == STATE_CLICKED) { menu = MENU_GAME; @@ -3518,6 +3511,8 @@ static int MenuSettingsFile() sprintf(options.name[i++], "Save Folder"); sprintf(options.name[i++], "Cheats 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"); options.length = i; @@ -3593,14 +3588,22 @@ static int MenuSettingsFile() case 5: OnScreenKeyboard(GCSettings.ScreenshotsFolder, MAXPATHLEN); break; - + case 6: + OnScreenKeyboard(GCSettings.CoverFolder, MAXPATHLEN); + break; + + case 7: + OnScreenKeyboard(GCSettings.ArtworkFolder, MAXPATHLEN); + break; + + case 8: GCSettings.AutoLoad++; if (GCSettings.AutoLoad > 2) GCSettings.AutoLoad = 0; break; - case 7: + case 9: GCSettings.AutoSave++; if (GCSettings.AutoSave > 3) GCSettings.AutoSave = 0; @@ -3667,15 +3670,17 @@ static int MenuSettingsFile() snprintf (options.value[3], 35, "%s", GCSettings.SaveFolder); snprintf (options.value[4], 35, "%s", GCSettings.CheatFolder); snprintf (options.value[5], 35, "%s", GCSettings.ScreenshotsFolder); + snprintf (options.value[6], 35, "%s", GCSettings.CoverFolder); + snprintf (options.value[7], 35, "%s", GCSettings.ArtworkFolder); - if (GCSettings.AutoLoad == 0) sprintf (options.value[6],"Off"); - else if (GCSettings.AutoLoad == 1) sprintf (options.value[6],"SRAM"); - else if (GCSettings.AutoLoad == 2) sprintf (options.value[6],"Snapshot"); + if (GCSettings.AutoLoad == 0) sprintf (options.value[8],"Off"); + else if (GCSettings.AutoLoad == 1) sprintf (options.value[8],"SRAM"); + else if (GCSettings.AutoLoad == 2) sprintf (options.value[8],"Snapshot"); - if (GCSettings.AutoSave == 0) sprintf (options.value[7],"Off"); - else if (GCSettings.AutoSave == 1) sprintf (options.value[7],"SRAM"); - else if (GCSettings.AutoSave == 2) sprintf (options.value[7],"Snapshot"); - else if (GCSettings.AutoSave == 3) sprintf (options.value[7],"Both"); + if (GCSettings.AutoSave == 0) sprintf (options.value[9],"Off"); + else if (GCSettings.AutoSave == 1) sprintf (options.value[9],"SRAM"); + else if (GCSettings.AutoSave == 2) sprintf (options.value[9],"Snapshot"); + else if (GCSettings.AutoSave == 3) sprintf (options.value[9],"Both"); optionBrowser.TriggerUpdate(); } @@ -3710,6 +3715,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++) @@ -3794,6 +3800,12 @@ static int MenuSettingsMenu() GCSettings.language = LANG_ENGLISH; break; + + case 6: + GCSettings.PreviewImage++; + if(GCSettings.PreviewImage > 2) + GCSettings.PreviewImage = 0; + break; } if(ret >= 0 || firstRun) @@ -3861,6 +3873,22 @@ static int MenuSettingsMenu() 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(); } diff --git a/source/preferences.cpp b/source/preferences.cpp index 4968ef0..6639b4d 100644 --- a/source/preferences.cpp +++ b/source/preferences.cpp @@ -127,7 +127,10 @@ preparePrefsData () 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); @@ -156,7 +159,8 @@ 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("Controller", "Controller Settings"); createXMLSetting("Controller", "Controller", toStr(GCSettings.Controller)); @@ -270,9 +274,6 @@ decodePrefsData () int verMajor = version[0] - '0'; int verMinor = version[2] - '0'; int verPoint = version[4] - '0'; - int curMajor = APPVERSION[0] - '0'; - int curMinor = APPVERSION[2] - '0'; - int curPoint = APPVERSION[4] - '0'; // first we'll check that the versioning is valid if(!(verMajor >= 0 && verMajor <= 9 && @@ -283,9 +284,6 @@ decodePrefsData () result = false; // reset settings else if(verMajor == 4 && verMinor == 0 && verPoint < 2) // anything less than 4.0.2 result = false; // reset settings - else if((verMajor*100 + verMinor*10 + verPoint) > - (curMajor*100 + curMinor*10 + curPoint)) // some future version - result = false; // reset settings else result = true; } @@ -304,7 +302,10 @@ decodePrefsData () 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)); @@ -336,6 +337,7 @@ decodePrefsData () loadXMLSetting(&GCSettings.SFXVolume, "SFXVolume"); loadXMLSetting(&GCSettings.Rumble, "Rumble"); loadXMLSetting(&GCSettings.language, "language"); + loadXMLSetting(&GCSettings.PreviewImage, "PreviewImage"); // Controller Settings @@ -409,7 +411,10 @@ DefaultSettings () 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 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/covers", APPFOLDER); GCSettings.AutoLoad = 1; GCSettings.AutoSave = 1; @@ -431,6 +436,8 @@ DefaultSettings () GCSettings.MusicVolume = 40; GCSettings.SFXVolume = 40; GCSettings.Rumble = 1; + GCSettings.PreviewImage = 0; + #ifdef HW_RVL GCSettings.language = CONF_GetLanguage(); @@ -667,6 +674,12 @@ bool LoadPrefs() if(strcmp(GCSettings.ScreenshotsFolder, "snes9x/screenshots") == 0) sprintf(GCSettings.ScreenshotsFolder, "snes9xgx/screenshots"); + if(strcmp(GCSettings.CoverFolder, "snes9x/covers") == 0) + sprintf(GCSettings.CoverFolder, "snes9xgx/covers"); + + if(strcmp(GCSettings.ArtworkFolder, "snes9x/artworks") == 0) + sprintf(GCSettings.ArtworkFolder, "snes9xgx/artworks"); + ResetText(); return prefFound; } diff --git a/source/snes9xgx.cpp b/source/snes9xgx.cpp index 9556d0d..3daf4fc 100644 --- a/source/snes9xgx.cpp +++ b/source/snes9xgx.cpp @@ -121,7 +121,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 @@ -153,7 +153,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 { diff --git a/source/snes9xgx.h b/source/snes9xgx.h index c88e009..66f8372 100644 --- a/source/snes9xgx.h +++ b/source/snes9xgx.h @@ -22,7 +22,7 @@ #define APPNAME "Snes9x GX" #define APPVERSION "4.3.6" #define APPFOLDER "snes9xgx" -#define PREF_FILE_NAME "settings.xml" +#define PREF_FILE_NAME "settings.xml" #define NOTSILENT 0 #define SILENT 1 @@ -84,12 +84,15 @@ struct SGCSettings{ int AutoSave; int LoadMethod; // For ROMS: Auto, SD, DVD, USB, Network (SMB) int SaveMethod; // For SRAM, Freeze, Prefs: Auto, SD, USB, SMB - char LoadFolder[MAXPATHLEN]; // Path to game files + 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 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 Exit_Dol_File[MAXPATHLEN]; // Exit Path char LoaderName[20]; // Menu Loader Name u32 Exit_Channel[2]; // Exit Channel @@ -115,6 +118,7 @@ struct SGCSettings{ int SFXVolume; int Rumble; int language; + int PreviewImage; int sfxOverclock; };