@@ -38,14 +38,14 @@ DevSettingsHandler::DevSettingsHandler(OSystem& osystem)
3838void DevSettingsHandler::loadSettings (SettingsSet set)
3939{
4040 const bool devSettings = set == SettingsSet::developer;
41- const string& prefix = devSettings ? " dev." : " plr." ;
41+ const string prefix = devSettings ? " dev." : " plr." ;
4242 const Settings& settings = myOSystem.settings ();
4343
4444 myFrameStats[set] = settings.getBool (prefix + " stats" );
4545 myDetectedInfo[set] = settings.getBool (prefix + " detectedinfo" );
4646 // AtariVox/SaveKey/PlusROM access
4747 myExternAccess[set] = settings.getBool (prefix + " extaccess" );
48- myConsole[set] = settings.getString (prefix + " console" ) == " 7800" ? 1 : 0 ;
48+ myConsole[set] = settings.getString (prefix + " console" ) == " 7800" ;
4949 myPlusROM[set] = devSettings ? settings.getBool (" dev.plusroms.on" ) : true ;
5050 // Randomization
5151 myRandomBank[set] = settings.getBool (prefix + " bankrandom" );
@@ -102,12 +102,12 @@ void DevSettingsHandler::loadSettings(SettingsSet set)
102102void DevSettingsHandler::saveSettings (SettingsSet set)
103103{
104104 const bool devSettings = set == SettingsSet::developer;
105- const string& prefix = devSettings ? " dev." : " plr." ;
105+ const string prefix = devSettings ? " dev." : " plr." ;
106106 Settings& settings = myOSystem.settings ();
107107
108108 settings.setValue (prefix + " stats" , myFrameStats[set]);
109109 settings.setValue (prefix + " detectedinfo" , myDetectedInfo[set]);
110- settings.setValue (prefix + " console" , myConsole[set] == 1 ? " 7800" : " 2600" );
110+ settings.setValue (prefix + " console" , myConsole[set] ? " 7800" : " 2600" );
111111 if (myOSystem.hasConsole ())
112112 myOSystem.eventHandler ().set7800Mode ();
113113
@@ -181,51 +181,63 @@ void DevSettingsHandler::applySettings(SettingsSet set)
181181 // *** Emulation tab ***
182182 myOSystem.frameBuffer ().showFrameStats (myFrameStats[set]);
183183
184- if (myOSystem.hasConsole ())
184+ const bool hasConsole = myOSystem.hasConsole ();
185+
186+ if (hasConsole)
185187 {
186- myOSystem.console ().cartridge ().enableRandomHotspots (myRandomHotspots[set]);
187- myOSystem.console ().tia ().driveUnusedPinsRandom (myUndrivenPins[set]);
188- myOSystem.console ().cartridge ().enablePlusROM (myPlusROM[set]);
188+ auto & console = myOSystem.console ();
189+ auto & tia = console.tia ();
190+
191+ console.cartridge ().enableRandomHotspots (myRandomHotspots[set]);
192+ tia.driveUnusedPinsRandom (myUndrivenPins[set]);
193+ console.cartridge ().enablePlusROM (myPlusROM[set]);
189194 // Notes:
190195 // - thumb exceptions not updated, because set in cart constructor
191196 // - other missing settings are used on-the-fly
192197 }
193198
194199#ifdef DEBUGGER_SUPPORT
195200 // Read from write ports and write to read ports breaks
196- if (myOSystem. hasConsole () )
201+ if (hasConsole)
197202 {
198- myOSystem.console ().system ().m6502 ().setReadFromWritePortBreak (myRWPortBreak[set]);
199- myOSystem.console ().system ().m6502 ().setWriteToReadPortBreak (myWRPortBreak[set]);
203+ auto & m6502 = myOSystem.console ().system ().m6502 ();
204+
205+ m6502.setReadFromWritePortBreak (myRWPortBreak[set]);
206+ m6502.setWriteToReadPortBreak (myWRPortBreak[set]);
200207 }
201208#endif
202209
203210 // *** TIA tab ***
204- if (myOSystem. hasConsole () )
211+ if (hasConsole)
205212 {
206- myOSystem.console ().tia ().setPlInvertedPhaseClock (myPlInvPhase[set]);
207- myOSystem.console ().tia ().setMsInvertedPhaseClock (myMsInvPhase[set]);
208- myOSystem.console ().tia ().setBlInvertedPhaseClock (myBlInvPhase[set]);
209- myOSystem.console ().tia ().setPlShortLateHMove (myPlLateHMove[set]);
210- myOSystem.console ().tia ().setMsShortLateHMove (myMsLateHMove[set]);
211- myOSystem.console ().tia ().setBlShortLateHMove (myBlLateHMove[set]);
212- myOSystem.console ().tia ().setPFBitsDelay (myPFBits[set]);
213- myOSystem.console ().tia ().setPFColorDelay (myPFColor[set]);
214- myOSystem.console ().tia ().setPFScoreGlitch (myPFScore[set]);
215- myOSystem.console ().tia ().setBKColorDelay (myBKColor[set]);
216- myOSystem.console ().tia ().setPlSwapDelay (myPlSwap[set]);
217- myOSystem.console ().tia ().setBlSwapDelay (myBlSwap[set]);
213+ auto & tia = myOSystem.console ().tia ();
214+
215+ tia.setPlInvertedPhaseClock (myPlInvPhase[set]);
216+ tia.setMsInvertedPhaseClock (myMsInvPhase[set]);
217+ tia.setBlInvertedPhaseClock (myBlInvPhase[set]);
218+ tia.setPlShortLateHMove (myPlLateHMove[set]);
219+ tia.setMsShortLateHMove (myMsLateHMove[set]);
220+ tia.setBlShortLateHMove (myBlLateHMove[set]);
221+ tia.setPFBitsDelay (myPFBits[set]);
222+ tia.setPFColorDelay (myPFColor[set]);
223+ tia.setPFScoreGlitch (myPFScore[set]);
224+ tia.setBKColorDelay (myBKColor[set]);
225+ tia.setPlSwapDelay (myPlSwap[set]);
226+ tia.setBlSwapDelay (myBlSwap[set]);
218227 }
219228
220229 // *** Video tab ***
221- if (myOSystem. hasConsole () )
230+ if (hasConsole)
222231 {
232+ auto & console = myOSystem.console ();
233+ auto & tia = console.tia ();
234+
223235 // TV Jitter
224- myOSystem. console (). tia () .toggleJitter (myTVJitter[set] ? 1 : 0 );
225- myOSystem. console (). tia () .setJitterSensitivity (myTVJitterSense[set]);
226- myOSystem. console (). tia () .setJitterRecoveryFactor (myTVJitterRec[set]);
236+ tia.toggleJitter (myTVJitter[set] ? 1 : 0 );
237+ tia.setJitterSensitivity (myTVJitterSense[set]);
238+ tia.setJitterRecoveryFactor (myTVJitterRec[set]);
227239 // PAL color loss
228- myOSystem. console () .enableColorLoss (myColorLoss[set]);
240+ console.enableColorLoss (myColorLoss[set]);
229241 }
230242
231243 // Debug colours
0 commit comments