diff --git a/Languages/czech.lang b/Languages/czech.lang index 5e1d53a9..9a5558aa 100644 --- a/Languages/czech.lang +++ b/Languages/czech.lang @@ -1062,6 +1062,9 @@ msgstr "" msgid "Frame Projection Y-Offset" msgstr "" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "" diff --git a/Languages/danish.lang b/Languages/danish.lang index 85277dad..16c6607e 100644 --- a/Languages/danish.lang +++ b/Languages/danish.lang @@ -1062,6 +1062,9 @@ msgstr "Billedeprojektion X-Offset" msgid "Frame Projection Y-Offset" msgstr "Billedeprojektion Y-Offset" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "Billeder" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "Video Skala" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "Virtuel Pointer Hastighed" diff --git a/Languages/dutch.lang b/Languages/dutch.lang index e2c0db47..dce23709 100644 --- a/Languages/dutch.lang +++ b/Languages/dutch.lang @@ -1062,6 +1062,9 @@ msgstr "Rand projectie X-compensatie" msgid "Frame Projection Y-Offset" msgstr "Rand projectie Y-compensatie" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "Randen" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "Virtuele Muis Snelheid" diff --git a/Languages/english.lang b/Languages/english.lang index 51364e85..a2dac578 100644 --- a/Languages/english.lang +++ b/Languages/english.lang @@ -1062,6 +1062,9 @@ msgstr "" msgid "Frame Projection Y-Offset" msgstr "" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "" diff --git a/Languages/finnish.lang b/Languages/finnish.lang index c60ccdb7..9105ea80 100644 --- a/Languages/finnish.lang +++ b/Languages/finnish.lang @@ -1062,6 +1062,9 @@ msgstr "" msgid "Frame Projection Y-Offset" msgstr "" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "" diff --git a/Languages/french.lang b/Languages/french.lang index a89b8ebb..43755f80 100644 --- a/Languages/french.lang +++ b/Languages/french.lang @@ -1062,6 +1062,9 @@ msgstr "Projection image pos. X" msgid "Frame Projection Y-Offset" msgstr "Projection image pos. Y" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "images" @@ -2386,6 +2389,9 @@ msgstr "Position de l'image" msgid "Video scale" msgstr "Échelle de l'image" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "Vitesse du pointeur virtuel" diff --git a/Languages/german.lang b/Languages/german.lang index c7ed6a55..50bc8c65 100644 --- a/Languages/german.lang +++ b/Languages/german.lang @@ -1062,6 +1062,9 @@ msgstr "Frame Projektions-X-Offset" msgid "Frame Projection Y-Offset" msgstr "Frame Projektions-Y-Offset" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "Frames" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "Pointergeschwindigkeit" diff --git a/Languages/greek.lang b/Languages/greek.lang index c5c7285b..9c3f7d17 100644 --- a/Languages/greek.lang +++ b/Languages/greek.lang @@ -1062,6 +1062,9 @@ msgstr "Οριζόντιο πλάτος προβολής καρέ" msgid "Frame Projection Y-Offset" msgstr "Κάθετο ύψος προβολής καρέ" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "Καρέ" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "Ταχύτητα εικονικού δείκτη" diff --git a/Languages/hungarian.lang b/Languages/hungarian.lang index 1c04a040..5c83d8b4 100644 --- a/Languages/hungarian.lang +++ b/Languages/hungarian.lang @@ -1062,6 +1062,9 @@ msgstr "" msgid "Frame Projection Y-Offset" msgstr "" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "" @@ -2389,6 +2392,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "" diff --git a/Languages/italian.lang b/Languages/italian.lang index 11810ae9..e42d490c 100644 --- a/Languages/italian.lang +++ b/Languages/italian.lang @@ -1062,6 +1062,9 @@ msgstr "Proiezione offset-x frame" msgid "Frame Projection Y-Offset" msgstr "Proiezione offset-y frame" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "Frames" @@ -2389,6 +2392,9 @@ msgstr "" msgid "Video scale" msgstr "Scaling video" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "Velocità puntatore virtuale" diff --git a/Languages/japanese.lang b/Languages/japanese.lang index 4956a417..38ceffb6 100644 --- a/Languages/japanese.lang +++ b/Languages/japanese.lang @@ -1062,6 +1062,9 @@ msgstr "フレーム角のXオフセット" msgid "Frame Projection Y-Offset" msgstr "フレーム角のyオフセット" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "フレーム" @@ -2389,6 +2392,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "ポインタの速度" diff --git a/Languages/korean.lang b/Languages/korean.lang index 26e95877..59f7670e 100644 --- a/Languages/korean.lang +++ b/Languages/korean.lang @@ -1062,6 +1062,9 @@ msgstr "프레임 영상 X-옵셋" msgid "Frame Projection Y-Offset" msgstr "프레임 영상 Y-옵셋" +msgid "Framebuffer" +msgstr "프레임 버퍼" + msgid "Frames" msgstr "프레임" @@ -2389,6 +2392,9 @@ msgstr "비디오 옵셋" msgid "Video scale" msgstr "비디오 스케일" +msgid "Video Width" +msgstr "비디오 폭" + msgid "Virtual Pointer Speed" msgstr "가상 포인터 속도" diff --git a/Languages/norwegian.lang b/Languages/norwegian.lang index 0fadcee3..e6708d53 100644 --- a/Languages/norwegian.lang +++ b/Languages/norwegian.lang @@ -1062,6 +1062,9 @@ msgstr "" msgid "Frame Projection Y-Offset" msgstr "" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "" diff --git a/Languages/polish.lang b/Languages/polish.lang index e816c068..2ed7561c 100644 --- a/Languages/polish.lang +++ b/Languages/polish.lang @@ -1062,6 +1062,9 @@ msgstr "" msgid "Frame Projection Y-Offset" msgstr "" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "" diff --git a/Languages/portuguese_br.lang b/Languages/portuguese_br.lang index 3e7c8eee..a4687381 100644 --- a/Languages/portuguese_br.lang +++ b/Languages/portuguese_br.lang @@ -1062,6 +1062,9 @@ msgstr "Deslocamento X da Moldura" msgid "Frame Projection Y-Offset" msgstr "Deslocamento Y da Moldura" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "Escala Video" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "Velocidade do Ponteiro" diff --git a/Languages/portuguese_pt.lang b/Languages/portuguese_pt.lang index 1f5ef4bd..76ba1203 100644 --- a/Languages/portuguese_pt.lang +++ b/Languages/portuguese_pt.lang @@ -1062,6 +1062,9 @@ msgstr "" msgid "Frame Projection Y-Offset" msgstr "" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "" diff --git a/Languages/russian.lang b/Languages/russian.lang index dda4a445..19272f47 100644 --- a/Languages/russian.lang +++ b/Languages/russian.lang @@ -1062,6 +1062,9 @@ msgstr "" msgid "Frame Projection Y-Offset" msgstr "" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "" diff --git a/Languages/schinese.lang b/Languages/schinese.lang index ff49fd9a..9848c78d 100644 --- a/Languages/schinese.lang +++ b/Languages/schinese.lang @@ -1062,6 +1062,9 @@ msgstr "帧投影 X 轴偏移" msgid "Frame Projection Y-Offset" msgstr "帧投影 Y 轴偏移" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "帧数" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "虚拟指针速度" diff --git a/Languages/spanish.lang b/Languages/spanish.lang index 793edad7..56fa0a6b 100644 --- a/Languages/spanish.lang +++ b/Languages/spanish.lang @@ -1062,6 +1062,9 @@ msgstr "Proyección del marco X-Offset" msgid "Frame Projection Y-Offset" msgstr "Proyección del marco Y-Offset" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "Marcos" @@ -2386,6 +2389,9 @@ msgstr "Offset de vídeo" msgid "Video scale" msgstr "Escala de vídeo" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "Vel. Puntero Virtual" diff --git a/Languages/swedish.lang b/Languages/swedish.lang index e2d3730d..5e50cc28 100644 --- a/Languages/swedish.lang +++ b/Languages/swedish.lang @@ -1062,6 +1062,9 @@ msgstr "" msgid "Frame Projection Y-Offset" msgstr "" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "" diff --git a/Languages/tchinese.lang b/Languages/tchinese.lang index 0ba6569a..a657d143 100644 --- a/Languages/tchinese.lang +++ b/Languages/tchinese.lang @@ -1062,6 +1062,9 @@ msgstr "畫框投射X軸位移" msgid "Frame Projection Y-Offset" msgstr "畫框投射Y軸位移" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "畫框數" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "虛擬指針的速度" diff --git a/Languages/thai.lang b/Languages/thai.lang index b09f996f..82c3f5bd 100644 --- a/Languages/thai.lang +++ b/Languages/thai.lang @@ -1062,6 +1062,9 @@ msgstr "" msgid "Frame Projection Y-Offset" msgstr "" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "" diff --git a/Languages/turkish.lang b/Languages/turkish.lang index 61a4e0ff..f585add4 100644 --- a/Languages/turkish.lang +++ b/Languages/turkish.lang @@ -1062,6 +1062,9 @@ msgstr "" msgid "Frame Projection Y-Offset" msgstr "" +msgid "Framebuffer" +msgstr "" + msgid "Frames" msgstr "" @@ -2386,6 +2389,9 @@ msgstr "" msgid "Video scale" msgstr "" +msgid "Video Width" +msgstr "" + msgid "Virtual Pointer Speed" msgstr "" diff --git a/source/patches/gamepatches.c b/source/patches/gamepatches.c index 0ea8e82d..6d949e6c 100644 --- a/source/patches/gamepatches.c +++ b/source/patches/gamepatches.c @@ -59,7 +59,7 @@ void ClearDOLList() } void gamepatches(u8 videoSelected, u8 videoPatchDol, u8 aspectForce, u8 languageChoice, u8 patchcountrystring, - u8 vipatch, u8 deflicker, u8 sneekVideoPatch, u8 hooktype, u64 returnTo, u8 privateServer, const char *serverAddr) + u8 vipatch, u8 deflicker, u8 sneekVideoPatch, u8 hooktype, u8 videoWidth, u64 returnTo, u8 privateServer, const char *serverAddr) { int i; u8 vfilter_off[7] = {0, 0, 21, 22, 21, 0, 0}; @@ -99,6 +99,9 @@ void gamepatches(u8 videoSelected, u8 videoPatchDol, u8 aspectForce, u8 language anti_002_fix(dst, len); + if (videoWidth == WIDTH_FRAMEBUFFER) + patch_width(dst, len); + if (deflicker == DEFLICKER_ON_LOW) { patch_vfilters(dst, len, vfilter_low); @@ -169,6 +172,54 @@ void anti_002_fix(u8 *addr, u32 len) } } +void patch_width(u8 *addr, u32 len) +{ + u8 SearchPattern[32] = { + 0x40, 0x82, 0x00, 0x08, 0x48, 0x00, 0x00, 0x1C, + 0x28, 0x09, 0x00, 0x03, 0x40, 0x82, 0x00, 0x08, + 0x48, 0x00, 0x00, 0x10, 0x2C, 0x03, 0x00, 0x00, + 0x40, 0x82, 0x00, 0x08, 0x54, 0xA5, 0x0C, 0x3C}; + u8 *addr_start = addr; + u8 *addr_end = addr + len - sizeof(SearchPattern); + while (addr_start <= addr_end) + { + if (memcmp(addr_start, SearchPattern, sizeof(SearchPattern)) == 0) + { + if (addr_start[-0x70] == 0xA0 && addr_start[-0x6E] == 0x00 && addr_start[-0x6D] == 0x0A) + { + if (addr_start[-0x44] == 0xA0 && addr_start[-0x42] == 0x00 && addr_start[-0x41] == 0x0E) + { + u8 reg_a = (addr_start[-0x6F] >> 5); + u8 reg_b = (addr_start[-0x43] >> 5); + + // Patch to the framebuffer resolution + addr_start[-0x41] = 0x04; + + // Center the image + void *offset = addr_start - 0x70; + + u32 old_heap_ptr = *(u32 *)0x80003110; + *(u32 *)0x80003110 = old_heap_ptr - 0x20; + u32 heap_space = old_heap_ptr - 0x20; + + u32 org_address = (addr_start[-0x70] << 24) | (addr_start[-0x6F] << 16); + *(u32 *)(heap_space + 0x00) = org_address | 4; + *(u32 *)(heap_space + 0x04) = 0x200002D0 | (reg_b << 21) | (reg_a << 16); + *(u32 *)(heap_space + 0x08) = 0x38000002 | (reg_a << 21); + *(u32 *)(heap_space + 0x0C) = 0x7C000396 | (reg_a << 21) | (reg_b << 16) | (reg_a << 11); + + *(u32 *)offset = 0x48000000 + ((heap_space - (u32)offset) & 0x3ffffff); + *(u32 *)(heap_space + 0x10) = 0x48000000 + ((((u32)offset + 0x04) - (heap_space + 0x10)) & 0x3ffffff); + + gprintf("Patched resolution. Branched from 0x%x to 0x%x\n", offset, heap_space); + return; + } + } + } + addr_start += 4; + } +} + /** Patch GXSetCopyFilter to disable the deflicker filter **/ void deflicker_patch(u8 *addr, u32 len) { diff --git a/source/patches/gamepatches.h b/source/patches/gamepatches.h index 7bbeec42..600ded8e 100644 --- a/source/patches/gamepatches.h +++ b/source/patches/gamepatches.h @@ -10,11 +10,12 @@ extern "C" { void RegisterDOL(u8 *dst, int len); void ClearDOLList(); void gamepatches(u8 videoSelected, u8 videoPatchDol, u8 aspectForce, u8 languageChoice, u8 patchcountrystring, - u8 vipatch, u8 deflicker, u8 sneekVideoPatch, u8 hooktype, u64 returnTo, u8 privateServer, const char *serverAddr); + u8 vipatch, u8 deflicker, u8 sneekVideoPatch, u8 hooktype, u8 videoWidth, u64 returnTo, u8 privateServer, const char *serverAddr); void anti_002_fix(u8 *addr, u32 len); void deflicker_patch(u8 *addr, u32 len); void patch_vfilters(u8 *addr, u32 len, u8 *vfilter); void patch_vfilters_rogue(u8 *addr, u32 len, u8 *vfilter); +void patch_width(u8 *addr, u32 len); void PrivateServerPatcher(void *addr, u32 len, u8 privateServer, const char *serverAddr); void PatchFix480p(); s8 do_new_wiimmfi(); diff --git a/source/settings/CGameSettings.cpp b/source/settings/CGameSettings.cpp index 67868dd4..1a0fc6f0 100644 --- a/source/settings/CGameSettings.cpp +++ b/source/settings/CGameSettings.cpp @@ -188,6 +188,7 @@ bool CGameSettings::Save() fprintf(f, "videoPatchDol:%d; ", GameList[i].videoPatchDol); fprintf(f, "patchFix480p:%d; ", GameList[i].patchFix480p); fprintf(f, "deflicker:%d; ", GameList[i].deflicker); + fprintf(f, "videowidth:%d; ", GameList[i].videoWidth); fprintf(f, "aspectratio:%d; ", GameList[i].aspectratio); fprintf(f, "language:%d; ", GameList[i].language); fprintf(f, "ocarina:%d; ", GameList[i].ocarina); @@ -276,6 +277,11 @@ bool CGameSettings::SetSetting(GameCFG & game, const char *name, const char *val game.deflicker = atoi(value); return true; } + else if(strcmp(name, "videowidth") == 0) + { + game.videoWidth = atoi(value); + return true; + } else if(strcmp(name, "aspectratio") == 0) { game.aspectratio = atoi(value); @@ -677,6 +683,7 @@ void CGameSettings::SetDefault(GameCFG &game) game.videoPatchDol = INHERIT; game.patchFix480p = INHERIT; game.deflicker = INHERIT; + game.videoWidth = INHERIT; game.aspectratio = INHERIT; game.language = INHERIT; game.ocarina = INHERIT; diff --git a/source/settings/CGameSettings.h b/source/settings/CGameSettings.h index 88621b11..464caec5 100644 --- a/source/settings/CGameSettings.h +++ b/source/settings/CGameSettings.h @@ -25,6 +25,7 @@ typedef struct _GameCFG u32 alternatedolstart; short patchcountrystrings; std::string alternatedolname; + short videoWidth; short returnTo; short sneekVideoPatch; short NandEmuMode; @@ -92,6 +93,7 @@ typedef struct _GameCFG this->alternatedolstart = game.alternatedolstart; this->patchcountrystrings = game.patchcountrystrings; this->alternatedolname = game.alternatedolname; + this->videoWidth = game.videoWidth; this->returnTo = game.returnTo; this->sneekVideoPatch = game.sneekVideoPatch; this->NandEmuMode = game.NandEmuMode; diff --git a/source/settings/CSettings.cpp b/source/settings/CSettings.cpp index 31e4bbfb..6ddff8bf 100644 --- a/source/settings/CSettings.cpp +++ b/source/settings/CSettings.cpp @@ -108,6 +108,7 @@ void CSettings::SetDefault() videoPatchDol = OFF; patchFix480p = ON; deflicker = DEFLICKER_AUTO; + videoWidth = WIDTH_AUTO; language = CONSOLE_DEFAULT; ocarina = OFF; hddinfo = CLOCK_HR12; @@ -327,6 +328,7 @@ bool CSettings::Save() fprintf(file, "videoPatchDol = %d\n", videoPatchDol); fprintf(file, "patchFix480p = %d\n", patchFix480p); fprintf(file, "deflicker = %d\n", deflicker); + fprintf(file, "videowidth = %d\n", videoWidth); fprintf(file, "language = %d\n", language); fprintf(file, "ocarina = %d\n", ocarina); fprintf(file, "hddinfo = %d\n", hddinfo); @@ -584,6 +586,11 @@ bool CSettings::SetSetting(char *name, char *value) deflicker = atoi(value); return true; } + else if (strcmp(name, "videowidth") == 0) + { + videoWidth = atoi(value); + return true; + } else if (strcmp(name, "language") == 0) { language = atoi(value); diff --git a/source/settings/CSettings.h b/source/settings/CSettings.h index 9078af29..de73b33c 100644 --- a/source/settings/CSettings.h +++ b/source/settings/CSettings.h @@ -120,6 +120,7 @@ class CSettings short gamesoundvolume; short tooltips; short parentalcontrol; + short videoWidth; u8 BootIOS; u8 LoaderIOS; u8 cios; diff --git a/source/settings/SettingsEnums.h b/source/settings/SettingsEnums.h index f52c173b..af460ec1 100644 --- a/source/settings/SettingsEnums.h +++ b/source/settings/SettingsEnums.h @@ -123,6 +123,13 @@ enum DEFLICKER_MAX }; +enum +{ + WIDTH_AUTO, + WIDTH_FRAMEBUFFER, + WIDTH_MAX +}; + enum { CLOCK_HR12 = 1, // use OFF for clock off diff --git a/source/settings/menus/GameLoadSM.cpp b/source/settings/menus/GameLoadSM.cpp index 7510ef4e..0357e113 100644 --- a/source/settings/menus/GameLoadSM.cpp +++ b/source/settings/menus/GameLoadSM.cpp @@ -72,6 +72,12 @@ static const char * DeflickerText[] = trNOOP( "ON (High)" ) }; +static const char * WidthText[] = +{ + trNOOP( "Auto" ), + trNOOP( "Framebuffer" ) +}; + static const char * AspectText[] = { trNOOP( "Force 4:3" ), @@ -206,6 +212,7 @@ void GameLoadSM::SetOptionNames() Options->SetName(Idx++, "%s", tr( "Sneek Video Patch" )); Options->SetName(Idx++, "%s", tr( "VIDTV Patch" )); Options->SetName(Idx++, "%s", tr( "Deflicker Filter" )); + Options->SetName(Idx++, "%s", tr( "Video Width" )); Options->SetName(Idx++, "%s", tr( "Aspect Ratio" )); Options->SetName(Idx++, "%s", tr( "Patch Country Strings" )); Options->SetName(Idx++, "%s", tr( "Game Language" )); @@ -288,6 +295,12 @@ void GameLoadSM::SetOptionValues() else Options->SetValue(Idx++, "%s", tr(DeflickerText[GameConfig.deflicker])); + //! Settings: Video Width + if(GameConfig.videoWidth == INHERIT) + Options->SetValue(Idx++, tr("Use global")); + else + Options->SetValue(Idx++, "%s", tr(WidthText[GameConfig.videoWidth])); + //! Settings: Aspect Ratio if(GameConfig.aspectratio == INHERIT) Options->SetValue(Idx++, tr("Use global")); @@ -483,6 +496,12 @@ int GameLoadSM::GetMenuInternal() if (++GameConfig.deflicker >= DEFLICKER_MAX) GameConfig.deflicker = INHERIT; } + //! Settings: Video Width + else if (ret == ++Idx) + { + if (++GameConfig.videoWidth >= WIDTH_MAX) GameConfig.videoWidth = INHERIT; + } + //! Settings: Aspect Ratio else if (ret == ++Idx) { diff --git a/source/settings/menus/LoaderSettings.cpp b/source/settings/menus/LoaderSettings.cpp index 9ffb34a7..cac578b9 100644 --- a/source/settings/menus/LoaderSettings.cpp +++ b/source/settings/menus/LoaderSettings.cpp @@ -61,7 +61,7 @@ static const char * VideoModeText[] = trNOOP( "Force NTSC" ), trNOOP( "Region Patch" ), trNOOP( "Force PAL480p" ), - trNOOP( "Force NTSC480p" ), + trNOOP( "Force NTSC480p" ) }; static const char * VideoPatchDolText[] = @@ -69,7 +69,7 @@ static const char * VideoPatchDolText[] = trNOOP( "OFF" ), trNOOP( "Region Patch" ), trNOOP( "ON" ), - trNOOP( "All" ), + trNOOP( "All" ) }; static const char * DeflickerText[] = @@ -82,6 +82,12 @@ static const char * DeflickerText[] = trNOOP( "ON (High)" ) }; +static const char * WidthText[] = +{ + trNOOP( "Auto" ), + trNOOP( "Framebuffer" ) +}; + static const char * LanguageText[] = { trNOOP( "Japanese" ), @@ -114,20 +120,20 @@ static const char * HooktypeText[] = trNOOP( "GXDraw" ), trNOOP( "GXFlush" ), trNOOP( "OSSleepThread" ), - trNOOP( "AXNextFrame" ), + trNOOP( "AXNextFrame" ) }; static const char * ChannelLaunchText[] = { trNOOP( "Main DOL" ), - trNOOP( "Boot Content" ), + trNOOP( "Boot Content" ) }; static const char * GCMode[] = { trNOOP( "MIOS (Default & Customs)" ), trNOOP( "Devolution" ), - trNOOP( "Nintendont" ), + trNOOP( "Nintendont" ) }; static const char * GCSourceText[][3] = @@ -136,7 +142,7 @@ static const char * GCSourceText[][3] = { trNOOP( "SD Path" ), "", "" }, { trNOOP( "Auto" ), "", "" }, { trNOOP( "Main Path" ), "/", trNOOP( "SD Path" ) }, - { trNOOP( "SD Path" ), "/", trNOOP( "Main Path" ) }, + { trNOOP( "SD Path" ), "/", trNOOP( "Main Path" ) } }; static const char * DMLVideoText[] = @@ -150,21 +156,21 @@ static const char * DMLVideoText[] = "", // unused trNOOP( "Force PAL480p" ), trNOOP( "Force NTSC480p" ), - trNOOP( "None" ), + trNOOP( "None" ) }; static const char * DMLNMMMode[] = { trNOOP( "OFF" ), trNOOP( "ON" ), - trNOOP( "Debug" ), + trNOOP( "Debug" ) }; static const char * DMLDebug[] = { trNOOP( "OFF" ), trNOOP( "ON" ), - trNOOP( "Debug Wait" ), + trNOOP( "Debug Wait" ) }; static const char * DEVOMCText[] = @@ -172,21 +178,21 @@ static const char * DEVOMCText[] = trNOOP( "OFF" ), trNOOP( "ON" ), trNOOP( "Individual" ), - trNOOP( "Regional" ), + trNOOP( "Regional" ) }; static const char * NINMCText[] = { trNOOP( "OFF" ), trNOOP( "Individual" ), - trNOOP( "ON (Multi)" ), + trNOOP( "ON (Multi)" ) }; static const char * NINCfgText[] = { trNOOP( "Delete" ), trNOOP( "Create" ), - trNOOP( "No change" ), + trNOOP( "No change" ) }; static const char * PrivServText[] = @@ -195,7 +201,7 @@ static const char * PrivServText[] = trNOOP( "NoSSL only" ), trNOOP( "Wiimmfi" ), trNOOP( "AltWFC" ), - trNOOP( "Custom" ), + trNOOP( "Custom" ) }; static const char blocked[22] = @@ -244,6 +250,7 @@ void LoaderSettings::SetOptionNames() Options->SetName(Idx++, "%s", tr( "Sneek Video Patch" )); Options->SetName(Idx++, "%s", tr( "VIDTV Patch" )); Options->SetName(Idx++, "%s", tr( "Deflicker Filter" )); + Options->SetName(Idx++, "%s", tr( "Video Width" )); Options->SetName(Idx++, "%s", tr( "Aspect Ratio" )); Options->SetName(Idx++, "%s", tr( "Game Language" )); Options->SetName(Idx++, "%s", tr( "Patch Country Strings" )); @@ -340,6 +347,9 @@ void LoaderSettings::SetOptionValues() //! Settings: Deflicker Filter Options->SetValue(Idx++, "%s", tr( DeflickerText[Settings.deflicker] )); + //! Settings: Video Width + Options->SetValue(Idx++, "%s", tr( WidthText[Settings.videoWidth] )); + //! Settings: Aspect Ratio Options->SetValue(Idx++, "%s", tr( AspectText[Settings.GameAspectRatio] )); @@ -601,6 +611,12 @@ int LoaderSettings::GetMenuInternal() if (++Settings.deflicker >= DEFLICKER_MAX) Settings.deflicker = 0; } + //! Settings: Video Width + else if (ret == ++Idx) + { + if (++Settings.videoWidth >= WIDTH_MAX) Settings.videoWidth = 0; + } + //! Settings: Aspect Ratio else if (ret == ++Idx ) { diff --git a/source/usbloader/GameBooter.cpp b/source/usbloader/GameBooter.cpp index 5654fd7b..b72d4363 100644 --- a/source/usbloader/GameBooter.cpp +++ b/source/usbloader/GameBooter.cpp @@ -312,6 +312,7 @@ int GameBooter::BootGame(struct discHdr *gameHdr) u8 reloadblock = game_cfg->iosreloadblock == INHERIT ? Settings.BlockIOSReload : game_cfg->iosreloadblock; u8 Hooktype = game_cfg->Hooktype == INHERIT ? Settings.Hooktype : game_cfg->Hooktype; u8 WiirdDebugger = game_cfg->WiirdDebugger == INHERIT ? Settings.WiirdDebugger : game_cfg->WiirdDebugger; + u16 videoWidth = game_cfg->videoWidth == INHERIT ? Settings.videoWidth : game_cfg->videoWidth; u64 returnToChoice = strlen(Settings.returnTo) > 0 ? (game_cfg->returnTo ? NandTitles.FindU32(Settings.returnTo) : 0) : 0; u8 NandEmuMode = OFF; const char *NandEmuPath = game_cfg->NandEmuPath.size() == 0 ? Settings.NandEmuPath : game_cfg->NandEmuPath.c_str(); @@ -485,13 +486,13 @@ int GameBooter::BootGame(struct discHdr *gameHdr) { //! Either the server is not Wiimmfi, or, if it is Wiimmfi, the game isn't MKWii - patch the old way gamepatches(videoChoice, videoPatchDolChoice, aspectChoice, languageChoice, countrystrings, viChoice, - deflicker, sneekChoice, Hooktype, returnToChoice, PrivServChoice, customAddress); + deflicker, sneekChoice, Hooktype, videoWidth, returnToChoice, PrivServChoice, customAddress); } else { //! Wiimmfi patch for Mario Kart Wii - patch with PRIVSERV_OFF and handle all the patching within do_new_wiimmfi() gamepatches(videoChoice, videoPatchDolChoice, aspectChoice, languageChoice, countrystrings, viChoice, - deflicker, sneekChoice, Hooktype, returnToChoice, PRIVSERV_OFF, customAddress); + deflicker, sneekChoice, Hooktype, videoWidth, returnToChoice, PRIVSERV_OFF, customAddress); } //! Load Code handler if needed