From d0b57d41612a36368a866f5b6c490ecddbba2ac8 Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Thu, 28 Jun 2012 13:05:31 +0000 Subject: [PATCH] -changed video mode options, now should be more clear what they do ;) -fixed bug of game crashing when selecting progressive as video mode (issue 94) -updated german.ini -updated english.ini -updated theme default.ini note: if you have the problem of overlapping options, then its most likely a outdated default.ini, try updating to this one and see if the problem is fixed --- source/loader/apploader.c | 1 - source/loader/disc.c | 23 +++++++------ source/loader/videopatch.c | 34 +++++++------------ source/menu/menu.hpp | 4 ++- source/menu/menu_config3.cpp | 8 ++--- source/menu/menu_config_game.cpp | 6 ++-- source/menu/menu_game.cpp | 55 +++++++++++++++++-------------- wii/wiiflow/Languages/english.ini | 2 +- wii/wiiflow/Languages/german.ini | 2 +- wii/wiiflow/themes/default.ini | 1 + 10 files changed, 66 insertions(+), 70 deletions(-) diff --git a/source/loader/apploader.c b/source/loader/apploader.c index 8df2a867..e056c6c5 100644 --- a/source/loader/apploader.c +++ b/source/loader/apploader.c @@ -101,7 +101,6 @@ void maindolpatches(void *dst, int len, u8 vidMode, GXRModeObj *vmode, bool vipa NewSuperMarioBrosPatch(); patchVideoModes(dst, len, vidMode, vmode, patchVidModes); - if(hooktype != 0 && dogamehooks(dst, len, false)) hookpatched = true; if(vipatch) diff --git a/source/loader/disc.c b/source/loader/disc.c index bdd584b8..6e91f027 100644 --- a/source/loader/disc.c +++ b/source/loader/disc.c @@ -98,11 +98,11 @@ GXRModeObj * __Disc_SelectVMode(u8 videoselected, u64 chantitle) else Region = diskid[3]; - switch (videoselected) + switch(videoselected) { case 0: // DEFAULT (DISC/GAME) /* Select video mode */ - switch (Region) + switch(Region) { case 'W': break; // Don't overwrite wiiware video modes. @@ -112,7 +112,7 @@ GXRModeObj * __Disc_SelectVMode(u8 videoselected, u64 chantitle) case 'P': case 'X': case 'Y': - if (CONF_GetVideo() != CONF_VIDEO_PAL) + if(CONF_GetVideo() != CONF_VIDEO_PAL) { vmode_reg = VI_PAL; vmode = progressive ? &TVNtsc480Prog : &TVNtsc480IntDf; @@ -122,7 +122,7 @@ GXRModeObj * __Disc_SelectVMode(u8 videoselected, u64 chantitle) case 'E': case 'J': default: - if (CONF_GetVideo() != CONF_VIDEO_NTSC) + if(CONF_GetVideo() != CONF_VIDEO_NTSC) { vmode_reg = VI_NTSC; vmode = progressive ? &TVNtsc480Prog : &TVEurgb60Hz480IntDf; @@ -130,24 +130,23 @@ GXRModeObj * __Disc_SelectVMode(u8 videoselected, u64 chantitle) break; } break; - case 1: // PAL50 + case 1: // SYSTEM + break; + case 2: // PAL50 vmode = &TVPal528IntDf; vmode_reg = vmode->viTVMode >> 2; break; - case 2: // PAL60 + case 3: // PAL60 vmode = progressive ? &TVNtsc480Prog : &TVEurgb60Hz480IntDf; vmode_reg = progressive ? TVEurgb60Hz480Prog.viTVMode >> 2 : vmode->viTVMode >> 2; break; - case 3: // NTSC + case 4: // NTSC vmode = progressive ? &TVNtsc480Prog : &TVNtsc480IntDf; vmode_reg = vmode->viTVMode >> 2; break; - case 4: // AUTO PATCH TO SYSTEM - case 5: // SYSTEM - break; - case 6: // PROGRESSIVE 480P(NTSC + PATCH ALL) + case 5: // PROGRESSIVE 480P vmode = &TVNtsc480Prog; - vmode_reg = vmode->viTVMode >> 2; + vmode_reg = Region == 'P' ? TVEurgb60Hz480Prog.viTVMode >> 2 : vmode->viTVMode >> 2; break; default: break; diff --git a/source/loader/videopatch.c b/source/loader/videopatch.c index e2a24781..9b4a2632 100644 --- a/source/loader/videopatch.c +++ b/source/loader/videopatch.c @@ -278,35 +278,16 @@ void patchVideoModes(void *dst, u32 len, int vidMode, GXRModeObj *vmode, int pat { GXRModeObj **table = 0; - if (vidMode == 5) // system - { - return; - } - if (vidMode == 6) // progressive 480P(NTSC + patch all) - { - applyVideoPatch(dst, len, vmode, 2); - } - else if (patchVidModes > 0 && vmode != 0) - { + if(patchVidModes && vmode != 0) applyVideoPatch(dst, len, vmode, patchVidModes - 1); - } else { switch(vidMode) { case 0: // default / disc / game break; - case 1: // PAL50 - Search_and_patch_Video_Modes(dst, len, NTSC2PAL); - break; - case 2: // PAL60 - Search_and_patch_Video_Modes(dst, len, NTSC2PAL60); - break; - case 3: // NTSC - Search_and_patch_Video_Modes(dst, len, PAL2NTSC); - break; - case 4: // auto patch / system - switch (CONF_GetVideo()) + case 1: // SYSTEM + switch(CONF_GetVideo()) { case CONF_VIDEO_PAL: table = CONF_GetEuRGB60() > 0 ? NTSC2PAL60 : NTSC2PAL; @@ -320,6 +301,15 @@ void patchVideoModes(void *dst, u32 len, int vidMode, GXRModeObj *vmode, int pat } Search_and_patch_Video_Modes(dst, len, table); break; + case 2: // PAL50 + Search_and_patch_Video_Modes(dst, len, NTSC2PAL); + break; + case 3: // PAL60 + Search_and_patch_Video_Modes(dst, len, NTSC2PAL60); + break; + case 4: // NTSC + Search_and_patch_Video_Modes(dst, len, PAL2NTSC); + break; default: break; } diff --git a/source/menu/menu.hpp b/source/menu/menu.hpp index bd49a801..30ed1384 100644 --- a/source/menu/menu.hpp +++ b/source/menu/menu.hpp @@ -1078,7 +1078,9 @@ private: struct SOption { const char id[10]; const wchar_t text[16]; }; static const string _translations[23]; static const SOption _languages[11]; - static const SOption _videoModes[7]; + + static const SOption _GlobalVideoModes[6]; + static const SOption _VideoModes[7]; static const SOption _GlobalDMLvideoModes[6]; static const SOption _GlobalGClanguages[7]; diff --git a/source/menu/menu_config3.cpp b/source/menu/menu_config3.cpp index ec98cdb4..4c886c70 100644 --- a/source/menu/menu_config3.cpp +++ b/source/menu/menu_config3.cpp @@ -85,9 +85,9 @@ void CMenu::_showConfig3(void) if(m_current_view != COVERFLOW_DML) { - i = min(max(0, m_cfg.getInt("GENERAL", "video_mode", 0)), (int)ARRAY_SIZE(CMenu::_videoModes) - 1); - m_btnMgr.setText(m_config3LblVideo, _t(CMenu::_videoModes[i].id, CMenu::_videoModes[i].text)); - + i = min(max(0, m_cfg.getInt("GENERAL", "video_mode", 0)), (int)ARRAY_SIZE(CMenu::_GlobalVideoModes) - 1); + m_btnMgr.setText(m_config3LblVideo, _t(CMenu::_GlobalVideoModes[i].id, CMenu::_GlobalVideoModes[i].text)); + i = min(max(0, m_cfg.getInt("GENERAL", "game_language", 0)), (int)ARRAY_SIZE(CMenu::_languages) - 1); m_btnMgr.setText(m_config3LblLanguage, _t(CMenu::_languages[i].id, CMenu::_languages[i].text)); } @@ -126,7 +126,7 @@ int CMenu::_config3(void) else if (m_btnMgr.selected(m_config3BtnVideoP) || m_btnMgr.selected(m_config3BtnVideoM)) { s8 direction = m_btnMgr.selected(m_config3BtnVideoP) ? 1 : -1; - m_cfg.setInt("GENERAL", "video_mode", (int)loopNum((u32)m_cfg.getInt("GENERAL", "video_mode", 0) + direction, ARRAY_SIZE(CMenu::_videoModes))); + m_cfg.setInt("GENERAL", "video_mode", (int)loopNum((u32)m_cfg.getInt("GENERAL", "video_mode", 0) + direction, ARRAY_SIZE(CMenu::_GlobalVideoModes))); _showConfig3(); } else if (m_btnMgr.selected(m_config3BtnDMLLanguageP) || m_btnMgr.selected(m_config3BtnDMLLanguageM)) diff --git a/source/menu/menu_config_game.cpp b/source/menu/menu_config_game.cpp index 75538aca..5a6b5651 100644 --- a/source/menu/menu_config_game.cpp +++ b/source/menu/menu_config_game.cpp @@ -389,8 +389,8 @@ void CMenu::_showGameSettings(void) m_btnMgr.setText(m_gameSettingsBtnVipatch, _optBoolToString(m_gcfg2.getOptBool(id, "vipatch", 0))); m_btnMgr.setText(m_gameSettingsBtnCountryPatch, _optBoolToString(m_gcfg2.getOptBool(id, "country_patch", 0))); m_btnMgr.setText(m_gameSettingsBtnIOSreloadBlock, _optBoolToString(m_gcfg2.getOptBool(id, "reload_block", 0))); - i = min((u32)m_gcfg2.getInt(id, "video_mode", 0), ARRAY_SIZE(CMenu::_videoModes) - 1u); - m_btnMgr.setText(m_gameSettingsLblVideo, _t(CMenu::_videoModes[i].id, CMenu::_videoModes[i].text)); + i = min((u32)m_gcfg2.getInt(id, "video_mode", 0), ARRAY_SIZE(CMenu::_VideoModes) - 1u); + m_btnMgr.setText(m_gameSettingsLblVideo, _t(CMenu::_VideoModes[i].id, CMenu::_VideoModes[i].text)); i = min((u32)m_gcfg2.getInt(id, "language", 0), ARRAY_SIZE(CMenu::_languages) - 1u); m_btnMgr.setText(m_gameSettingsLblLanguage, _t(CMenu::_languages[i].id, CMenu::_languages[i].text)); i = min((u32)m_gcfg2.getInt(id, "aspect_ratio", 0), ARRAY_SIZE(CMenu::_AspectRatio) - 1u); @@ -517,7 +517,7 @@ void CMenu::_gameSettings(void) else if (m_btnMgr.selected(m_gameSettingsBtnVideoP) || m_btnMgr.selected(m_gameSettingsBtnVideoM)) { s8 direction = m_btnMgr.selected(m_gameSettingsBtnVideoP) ? 1 : -1; - m_gcfg2.setInt(id, "video_mode", (int)loopNum((u32)m_gcfg2.getInt(id, "video_mode", 0) + direction, ARRAY_SIZE(CMenu::_videoModes))); + m_gcfg2.setInt(id, "video_mode", (int)loopNum((u32)m_gcfg2.getInt(id, "video_mode", 0) + direction, ARRAY_SIZE(CMenu::_VideoModes))); _showGameSettings(); } else if (m_btnMgr.selected(m_gameSettingsBtnDMLVideoP) || m_btnMgr.selected(m_gameSettingsBtnDMLVideoM)) diff --git a/source/menu/menu_game.cpp b/source/menu/menu_game.cpp index a27a9a81..b5accb1f 100644 --- a/source/menu/menu_game.cpp +++ b/source/menu/menu_game.cpp @@ -97,14 +97,23 @@ const CMenu::SOption CMenu::_languages[11] = { { "lngkor", L"Korean" } }; -const CMenu::SOption CMenu::_videoModes[7] = { - { "viddef", L"Default" }, +const CMenu::SOption CMenu::_GlobalVideoModes[6] = { + { "vidgame", L"Game" }, + { "vidsys", L"System" }, { "vidp50", L"PAL 50Hz" }, { "vidp60", L"PAL 60Hz" }, { "vidntsc", L"NTSC" }, - { "vidpatch", L"Auto Patch" }, - { "vidsys", L"System" }, - { "vidprog", L"Progressive" } + { "vidprog", L"Progressive" }, +}; + +const CMenu::SOption CMenu::_VideoModes[7] = { + { "viddef", L"Default" }, + { "vidgame", L"Game" }, + { "vidsys", L"System" }, + { "vidp50", L"PAL 50Hz" }, + { "vidp60", L"PAL 60Hz" }, + { "vidntsc", L"NTSC" }, + { "vidprog", L"Progressive" }, }; const CMenu::SOption CMenu::_GlobalDMLvideoModes[6] = { @@ -904,29 +913,30 @@ void CMenu::_launchChannel(dir_discHdr *hdr) } forwarder = m_gcfg2.getBool(id, "custom", forwarder) || strncmp(id.c_str(), "WIMC", 4) == 0; - + bool vipatch = m_gcfg2.testOptBool(id, "vipatch", m_cfg.getBool("GENERAL", "vipatch", false)); bool cheat = m_gcfg2.testOptBool(id, "cheat", m_cfg.getBool("NAND", "cheat", false)); bool countryPatch = m_gcfg2.testOptBool(id, "country_patch", m_cfg.getBool("GENERAL", "country_patch", false)); - u8 videoMode = (u8)min((u32)m_gcfg2.getInt(id, "video_mode", 0), ARRAY_SIZE(CMenu::_videoModes) - 1u); + + u8 videoMode = (u8)min((u32)m_gcfg2.getInt(id, "video_mode", 0), ARRAY_SIZE(CMenu::_VideoModes) - 1u); + videoMode = (videoMode == 0) ? (u8)min((u32)m_cfg.getInt("GENERAL", "video_mode", 0), ARRAY_SIZE(CMenu::_GlobalVideoModes) - 1) : videoMode-1; + int language = min((u32)m_gcfg2.getInt(id, "language", 0), ARRAY_SIZE(CMenu::_languages) - 1u); + language = (language == 0) ? min((u32)m_cfg.getInt("GENERAL", "game_language", 0), ARRAY_SIZE(CMenu::_languages) - 1) : language; + const char *rtrn = m_gcfg2.getBool(id, "returnto", true) ? m_cfg.getString("GENERAL", "returnto").c_str() : NULL; u8 patchVidMode = min((u32)m_gcfg2.getInt(id, "patch_video_modes", 0), ARRAY_SIZE(CMenu::_vidModePatch) - 1u); int aspectRatio = min((u32)m_gcfg2.getInt(id, "aspect_ratio", 0), ARRAY_SIZE(CMenu::_AspectRatio) - 1u)-1; - + if(!forwarder) { hooktype = (u32) m_gcfg2.getInt(id, "hooktype", 0); debuggerselect = m_gcfg2.getBool(id, "debugger", false) ? 1 : 0; - if ((debuggerselect || cheat) && hooktype == 0) + if((debuggerselect || cheat) && hooktype == 0) hooktype = 1; - if (!debuggerselect && !cheat) + if(!debuggerselect && !cheat) hooktype = 0; - if (videoMode == 0) - videoMode = (u8)min((u32)m_cfg.getInt("GENERAL", "video_mode", 0), ARRAY_SIZE(CMenu::_videoModes) - 1); - if (language == 0) - language = min((u32)m_cfg.getInt("GENERAL", "game_language", 0), ARRAY_SIZE(CMenu::_languages) - 1); } m_cfg.setString("NAND", "current_item", id); @@ -949,14 +959,6 @@ void CMenu::_launchChannel(dir_discHdr *hdr) m_gcfg2.save(true); m_cat.save(true); m_cfg.save(true); - - /*if(!emu_disabled && emulate_mode == 1) - { - char basepath[64]; - snprintf(basepath, sizeof(basepath), "%s:%s", DeviceName[emuPartition], emuPath.c_str()); - Nand::Instance()->CreateConfig(basepath); - Nand::Instance()->Do_Region_Change(id); - }*/ CheckGameSoundThread(); m_vid.CheckWaitThread(true); @@ -1145,8 +1147,13 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd) bool vipatch = m_gcfg2.testOptBool(id, "vipatch", m_cfg.getBool("GENERAL", "vipatch", false)); bool cheat = m_gcfg2.testOptBool(id, "cheat", m_cfg.getBool("GAMES", "cheat", false)); bool countryPatch = m_gcfg2.testOptBool(id, "country_patch", m_cfg.getBool("GENERAL", "country_patch", false)); - u8 videoMode = (u8)min((u32)m_gcfg2.getInt(id, "video_mode", 0), ARRAY_SIZE(CMenu::_videoModes) - 1u); + + u8 videoMode = (u8)min((u32)m_gcfg2.getInt(id, "video_mode", 0), ARRAY_SIZE(CMenu::_VideoModes) - 1u); + videoMode = (videoMode == 0) ? (u8)min((u32)m_cfg.getInt("GENERAL", "video_mode", 0), ARRAY_SIZE(CMenu::_GlobalVideoModes) - 1) : videoMode-1; + int language = min((u32)m_gcfg2.getInt(id, "language", 0), ARRAY_SIZE(CMenu::_languages) - 1u); + language = (language == 0) ? min((u32)m_cfg.getInt("GENERAL", "game_language", 0), ARRAY_SIZE(CMenu::_languages) - 1) : language; + const char *rtrn = m_gcfg2.getBool(id, "returnto", true) ? m_cfg.getString("GENERAL", "returnto").c_str() : NULL; int aspectRatio = min((u32)m_gcfg2.getInt(id, "aspect_ratio", 0), ARRAY_SIZE(CMenu::_AspectRatio) - 1u)-1; @@ -1232,8 +1239,6 @@ void CMenu::_launchGame(dir_discHdr *hdr, bool dvd) u32 cheatSize = 0, gameconfigSize = 0; CheckGameSoundThread(); - if(videoMode == 0) videoMode = (u8)min((u32)m_cfg.getInt("GENERAL", "video_mode", 0), ARRAY_SIZE(CMenu::_videoModes) - 1); - if(language == 0) language = min((u32)m_cfg.getInt("GENERAL", "game_language", 0), ARRAY_SIZE(CMenu::_languages) - 1); m_cfg.setString("GAMES", "current_item", id); m_gcfg1.setInt("PLAYCOUNT", id, m_gcfg1.getInt("PLAYCOUNT", id, 0) + 1); m_gcfg1.setUInt("LASTPLAYED", id, time(NULL)); diff --git a/wii/wiiflow/Languages/english.ini b/wii/wiiflow/Languages/english.ini index 35df7434..bea54285 100644 --- a/wii/wiiflow/Languages/english.ini +++ b/wii/wiiflow/Languages/english.ini @@ -263,10 +263,10 @@ turbografx16=TurboGrafx-16 turbografxcd=TurboGrafx-CD unknown=Unknown viddef=Default +vidgame=Game vidntsc=NTSC vidp50=PAL 50Hz vidp60=PAL 60Hz -vidpatch=Auto Patch vidprog=Progressive vidsys=System vmpall=All diff --git a/wii/wiiflow/Languages/german.ini b/wii/wiiflow/Languages/german.ini index 4d3dab2d..f4f4193c 100644 --- a/wii/wiiflow/Languages/german.ini +++ b/wii/wiiflow/Languages/german.ini @@ -259,10 +259,10 @@ turbografx16=TurboGrafx-16 turbografxcd=TurboGrafx-CD unknown=Unbekannt viddef=Standard +vidgame=Spiel vidntsc=NTSC vidp50=PAL 50Hz vidp60=PAL 60Hz -vidpatch=Auto Patch vidprog=Progressive vidsys=Konsole vmpall=Alle diff --git a/wii/wiiflow/themes/default.ini b/wii/wiiflow/themes/default.ini index ea5c5fde..386d3ca5 100644 --- a/wii/wiiflow/themes/default.ini +++ b/wii/wiiflow/themes/default.ini @@ -1,3 +1,4 @@ + [_BREWFLOW_1] blur_factor=1.200000048 blur_radius=2