@@ -260,6 +260,8 @@ void config_read(void)
260260 config_emulator.fullscreen = read_bool (" Emulator" , " FullScreen" , false );
261261 config_emulator.fullscreen_mode = read_int (" Emulator" , " FullScreenMode" , 1 );
262262 config_emulator.always_show_menu = read_bool (" Emulator" , " AlwaysShowMenu" , false );
263+ config_emulator.theme = read_int (" Emulator" , " Theme" , config_Theme_Dark);
264+ config_emulator.theme = CLAMP (config_emulator.theme , config_Theme_Light, config_Theme_Dark);
263265 config_emulator.ffwd_speed = read_int (" Emulator" , " FFWD" , 1 );
264266 config_emulator.save_slot = read_int (" Emulator" , " SaveSlot" , 0 );
265267 config_emulator.start_paused = read_bool (" Emulator" , " StartPaused" , false );
@@ -327,12 +329,18 @@ void config_read(void)
327329 config_video.palette = read_int (" Video" , " Palette" , 0 );
328330 config_video.color_correction = read_bool (" Video" , " ColorCorrection" , true );
329331 config_video.sync = read_bool (" Video" , " Sync" , true );
330- config_video.background_color [0 ] = read_float (" Video" , " BackgroundColorR" , 0 .1f );
331- config_video.background_color [1 ] = read_float (" Video" , " BackgroundColorG" , 0 .1f );
332- config_video.background_color [2 ] = read_float (" Video" , " BackgroundColorB" , 0 .1f );
333- config_video.background_color_debugger [0 ] = read_float (" Video" , " BackgroundColorDebuggerR" , 0 .2f );
334- config_video.background_color_debugger [1 ] = read_float (" Video" , " BackgroundColorDebuggerG" , 0 .2f );
335- config_video.background_color_debugger [2 ] = read_float (" Video" , " BackgroundColorDebuggerB" , 0 .2f );
332+ config_video.background_color [config_Theme_Dark][0 ] = read_float (" Video" , " BackgroundColorR" , 0 .1f );
333+ config_video.background_color [config_Theme_Dark][1 ] = read_float (" Video" , " BackgroundColorG" , 0 .1f );
334+ config_video.background_color [config_Theme_Dark][2 ] = read_float (" Video" , " BackgroundColorB" , 0 .1f );
335+ config_video.background_color_debugger [config_Theme_Dark][0 ] = read_float (" Video" , " BackgroundColorDebuggerR" , 0 .2f );
336+ config_video.background_color_debugger [config_Theme_Dark][1 ] = read_float (" Video" , " BackgroundColorDebuggerG" , 0 .2f );
337+ config_video.background_color_debugger [config_Theme_Dark][2 ] = read_float (" Video" , " BackgroundColorDebuggerB" , 0 .2f );
338+ config_video.background_color [config_Theme_Light][0 ] = read_float (" Video" , " BackgroundColorLightR" , 128 .0f / 255 .0f );
339+ config_video.background_color [config_Theme_Light][1 ] = read_float (" Video" , " BackgroundColorLightG" , 128 .0f / 255 .0f );
340+ config_video.background_color [config_Theme_Light][2 ] = read_float (" Video" , " BackgroundColorLightB" , 128 .0f / 255 .0f );
341+ config_video.background_color_debugger [config_Theme_Light][0 ] = read_float (" Video" , " BackgroundColorDebuggerLightR" , 160 .0f / 255 .0f );
342+ config_video.background_color_debugger [config_Theme_Light][1 ] = read_float (" Video" , " BackgroundColorDebuggerLightG" , 160 .0f / 255 .0f );
343+ config_video.background_color_debugger [config_Theme_Light][2 ] = read_float (" Video" , " BackgroundColorDebuggerLightB" , 160 .0f / 255 .0f );
336344
337345 for (int i = 0 ; i < config_max_custom_palettes; i++)
338346 {
@@ -496,6 +504,7 @@ void config_write(void)
496504 write_bool (" Emulator" , " FullScreen" , config_emulator.fullscreen );
497505 write_int (" Emulator" , " FullScreenMode" , config_emulator.fullscreen_mode );
498506 write_bool (" Emulator" , " AlwaysShowMenu" , config_emulator.always_show_menu );
507+ write_int (" Emulator" , " Theme" , config_emulator.theme );
499508 write_int (" Emulator" , " FFWD" , config_emulator.ffwd_speed );
500509 write_int (" Emulator" , " SaveSlot" , config_emulator.save_slot );
501510 write_bool (" Emulator" , " StartPaused" , config_emulator.start_paused );
@@ -551,12 +560,18 @@ void config_write(void)
551560 write_int (" Video" , " Palette" , config_video.palette );
552561 write_bool (" Video" , " ColorCorrection" , config_video.color_correction );
553562 write_bool (" Video" , " Sync" , config_video.sync );
554- write_float (" Video" , " BackgroundColorR" , config_video.background_color [0 ]);
555- write_float (" Video" , " BackgroundColorG" , config_video.background_color [1 ]);
556- write_float (" Video" , " BackgroundColorB" , config_video.background_color [2 ]);
557- write_float (" Video" , " BackgroundColorDebuggerR" , config_video.background_color_debugger [0 ]);
558- write_float (" Video" , " BackgroundColorDebuggerG" , config_video.background_color_debugger [1 ]);
559- write_float (" Video" , " BackgroundColorDebuggerB" , config_video.background_color_debugger [2 ]);
563+ write_float (" Video" , " BackgroundColorR" , config_video.background_color [config_Theme_Dark][0 ]);
564+ write_float (" Video" , " BackgroundColorG" , config_video.background_color [config_Theme_Dark][1 ]);
565+ write_float (" Video" , " BackgroundColorB" , config_video.background_color [config_Theme_Dark][2 ]);
566+ write_float (" Video" , " BackgroundColorDebuggerR" , config_video.background_color_debugger [config_Theme_Dark][0 ]);
567+ write_float (" Video" , " BackgroundColorDebuggerG" , config_video.background_color_debugger [config_Theme_Dark][1 ]);
568+ write_float (" Video" , " BackgroundColorDebuggerB" , config_video.background_color_debugger [config_Theme_Dark][2 ]);
569+ write_float (" Video" , " BackgroundColorLightR" , config_video.background_color [config_Theme_Light][0 ]);
570+ write_float (" Video" , " BackgroundColorLightG" , config_video.background_color [config_Theme_Light][1 ]);
571+ write_float (" Video" , " BackgroundColorLightB" , config_video.background_color [config_Theme_Light][2 ]);
572+ write_float (" Video" , " BackgroundColorDebuggerLightR" , config_video.background_color_debugger [config_Theme_Light][0 ]);
573+ write_float (" Video" , " BackgroundColorDebuggerLightG" , config_video.background_color_debugger [config_Theme_Light][1 ]);
574+ write_float (" Video" , " BackgroundColorDebuggerLightB" , config_video.background_color_debugger [config_Theme_Light][2 ]);
560575
561576 for (int i = 0 ; i < config_max_custom_palettes; i++)
562577 {
0 commit comments