Skip to content

Commit 27860e3

Browse files
committed
Added Video Width settings for GC games
1 parent 45a95ff commit 27860e3

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

driveRoot/rvloader/theme/scripts/gamesview.lua

+8-6
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,17 @@ function init()
7676
menuSystem:setEntryDecreaseAction(menuSystem.decreaseEntryValue)
7777
menuSystem:addYesNoEntry("Enable Cheats", false, GamesView.config.YES, GamesView.config.NO)
7878
menuSystem:addYesNoEntry("Memory Card Emulation", false, GamesView.config.YES, GamesView.config.NO)
79-
menuSystem:addEntry("Max Pads")
80-
menuSystem:addEntryOption("1", 1)
81-
menuSystem:addEntryOption("2", 2)
82-
menuSystem:addEntryOption("3", 3)
83-
menuSystem:addEntryOption("4", 4)
79+
menuSystem:addEntry("Max Pads", false)
80+
menuSystem:addRangeToOptions(1, 4, 1)
81+
menuSystem:setEntryIncreaseAction(menuSystem.increaseEntryValue)
82+
menuSystem:setEntryDecreaseAction(menuSystem.decreaseEntryValue)
83+
menuSystem:addEntry("Video Width", false)
84+
menuSystem:addEntryOption("Auto", 0)
85+
menuSystem:addRangeToOptions(640, 720, 1)
8486
menuSystem:setEntryIncreaseAction(menuSystem.increaseEntryValue)
8587
menuSystem:setEntryDecreaseAction(menuSystem.decreaseEntryValue)
8688
if Gcp.isV2() then
87-
menuSystem:addEntry("Configure GC+2.0 map")
89+
menuSystem:addEntry("Configure GC+2.0 map", false)
8890
menuSystem:setEntrySelectAction(activateGCPMapping)
8991
end
9092
elseif GamesView.getGamesType() == GamesView.gameType.WII_GAME then

driveRoot/rvloader/theme/scripts/menuSystem.lua

+8-1
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,21 @@ function MenuSystem:getEntriesWithOptions()
187187
end
188188

189189
function MenuSystem:addYesNoEntry(id, showChanges, yesValue, noValue)
190-
self:addEntry(id, showChanges)
190+
self:addEntry(id, showChanges, false)
191191
self:addEntryOption("Yes", yesValue)
192192
self:addEntryOption("No", noValue)
193193
self:setEntrySelectAction(self.increaseEntryValue)
194194
self:setEntryIncreaseAction(self.increaseEntryValue)
195195
self:setEntryDecreaseAction(self.decreaseEntryValue)
196196
end
197197

198+
--Very crude system, but gets the job done for nintendont's video width for now
199+
function MenuSystem:addRangeToOptions(min, max, step)
200+
for i = min, max, step do
201+
self:addEntryOption(tostring(i), i)
202+
end
203+
end
204+
198205
function MenuSystem:setEntryValue(id, value)
199206
entryIndex = self.entriesIndex[id]
200207
valueIndex = nil

main/source/gui/guigamesview.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ void GuiGamesView::openGameConfig(u32 idx) {
185185
gameConfig.setValue("Memory Card Emulation", 1);
186186
if (!gameConfig.getValue("Max Pads", &tempVal))
187187
gameConfig.setValue("Max Pads", 4);
188+
if (!gameConfig.getValue("Video Width", &tempVal))
189+
gameConfig.setValue("Video Width", 0);
188190

189191
//GC+2.0 mapping
190192
if (!gameConfig.getValue("GCPMap_A", &tempVal))
@@ -620,6 +622,10 @@ int GuiGamesView::lua_bootGame(lua_State* L) {
620622
thisView->gameConfig.getValue("Max Pads", &tempVal);
621623
cfg.MaxPads = tempVal;
622624

625+
tempVal = 0;
626+
thisView->gameConfig.getValue("Video Width", &tempVal);
627+
cfg.VideoScale = tempVal - 600;
628+
623629
//GC+2.0 map
624630
thisView->gameConfig.getValue("GCPMap_A", &thisView->gcpMap[GCP_MAP_BUTTON_A_ID]);
625631
thisView->gameConfig.getValue("GCPMap_B", &thisView->gcpMap[GCP_MAP_BUTTON_B_ID]);

0 commit comments

Comments
 (0)