mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-27 11:41:48 +01:00
+added configurable screen width scaling in menu options
This commit is contained in:
parent
cead1c2364
commit
70af97e256
@ -89,6 +89,8 @@ void config_default(void)
|
||||
config.bilinear = 1;
|
||||
|
||||
/* controllers options */
|
||||
input.system[0] = SYSTEM_GAMEPAD;
|
||||
input.system[1] = SYSTEM_GAMEPAD;
|
||||
gx_input_SetDefault();
|
||||
config.gun_cursor[0] = 1;
|
||||
config.gun_cursor[1] = 1;
|
||||
@ -104,12 +106,14 @@ void config_default(void)
|
||||
config.bg_color = 0;
|
||||
config.bgm_volume = 100.0;
|
||||
config.sfx_volume = 100.0;
|
||||
config.screen_w = 658;
|
||||
#ifdef HW_RVL
|
||||
if (CONF_GetAspectRatio() == CONF_ASPECT_16_9)
|
||||
config.screen_w = 672;
|
||||
#endif
|
||||
|
||||
/* restore saved configuration */
|
||||
config_load();
|
||||
|
||||
input.system[0] = SYSTEM_GAMEPAD;
|
||||
input.system[1] = SYSTEM_GAMEPAD;
|
||||
io_reset();
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,7 @@ typedef struct
|
||||
float sfx_volume;
|
||||
int8 sram_auto;
|
||||
int8 state_auto;
|
||||
uint16 screen_w;
|
||||
} t_config;
|
||||
|
||||
/* Global data */
|
||||
|
@ -257,13 +257,14 @@ static gui_item items_video[8] =
|
||||
};
|
||||
|
||||
/* Preferences menu */
|
||||
static gui_item items_prefs[5] =
|
||||
static gui_item items_prefs[6] =
|
||||
{
|
||||
{NULL,NULL,"Auto SRAM: OFF", "Enable/disable automatic SRAM", 52,132,276,48},
|
||||
{NULL,NULL,"Auto STATE: OFF", "Enable/disable automatic Savestate", 52,132,276,48},
|
||||
{NULL,NULL,"SFX Volume: 100", "Adjust sound effects volume", 52,132,276,48},
|
||||
{NULL,NULL,"BGM Volume: 100", "Adjust background music volume", 52,132,276,48},
|
||||
{NULL,NULL,"BG Color: DEFAULT", "Change background color", 52,132,276,48}
|
||||
{NULL,NULL,"BG Color: DEFAULT", "Change background color", 52,132,276,48},
|
||||
{NULL,NULL,"Screen Width: 658", "Adjust Screen Width", 52,132,276,48}
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -454,7 +455,7 @@ static gui_menu menu_prefs =
|
||||
{
|
||||
"Menu Settings",
|
||||
0,0,
|
||||
5,4,6,
|
||||
6,4,6,
|
||||
items_prefs,
|
||||
buttons_list,
|
||||
bg_list,
|
||||
@ -608,6 +609,7 @@ static void prefmenu ()
|
||||
sprintf (items[3].text, "BGM Volume: %1.1f", config.bgm_volume);
|
||||
if (config.bg_color) sprintf (items[4].text, "BG Color: Type %d", config.bg_color);
|
||||
else sprintf (items[4].text, "BG Color: DEFAULT");
|
||||
sprintf (items[5].text, "Screen Width: %d", config.screen_w);
|
||||
|
||||
GUI_InitMenu(m);
|
||||
GUI_SlideMenuTitle(m,strlen("Menu "));
|
||||
@ -660,12 +662,24 @@ static void prefmenu ()
|
||||
if (ret < 0) config.bg_color --;
|
||||
else config.bg_color ++;
|
||||
if (config.bg_color < 0) config.bg_color = BG_COLOR_MAX - 1;
|
||||
if (config.bg_color >= BG_COLOR_MAX) config.bg_color = 0;
|
||||
else if (config.bg_color >= BG_COLOR_MAX) config.bg_color = 0;
|
||||
if (config.bg_color) sprintf (items[4].text, "BG Color: Type %d", config.bg_color);
|
||||
else sprintf (items[4].text, "BG Color: DEFAULT");
|
||||
GUI_SetBgColor(bg_colors[config.bg_color]);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
case -7:
|
||||
if (ret < 0) config.screen_w --;
|
||||
else config.screen_w ++;
|
||||
if (config.screen_w < 640) config.screen_w = VI_MAX_WIDTH_NTSC;
|
||||
else if (config.screen_w > VI_MAX_WIDTH_NTSC) config.screen_w = 640;
|
||||
vmode->viWidth = config.screen_w;
|
||||
vmode->viXOrigin = (VI_MAX_WIDTH_NTSC - vmode->viWidth)/2;
|
||||
VIDEO_Configure(vmode);
|
||||
sprintf (items[5].text, "Screen Width: %d", config.screen_w);
|
||||
break;
|
||||
|
||||
case -1:
|
||||
quit = 1;
|
||||
break;
|
||||
|
@ -1226,6 +1226,10 @@ void gx_video_Stop(void)
|
||||
|
||||
/* reset VI */
|
||||
gxDrawScreenshot(0xff);
|
||||
|
||||
/* adjust overscan */
|
||||
vmode->viWidth = config.screen_w;
|
||||
vmode->viXOrigin = (VI_MAX_WIDTH_NTSC - vmode->viWidth)/2;
|
||||
VIDEO_Configure(vmode);
|
||||
VIDEO_SetPreRetraceCallback(NULL);
|
||||
VIDEO_SetPostRetraceCallback(gx_input_UpdateMenu);
|
||||
@ -1458,17 +1462,6 @@ void gx_video_Init(void)
|
||||
break;
|
||||
}
|
||||
|
||||
/* adjust overscan */
|
||||
vmode->viWidth = 658;
|
||||
vmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 658)/2;
|
||||
#ifdef HW_RVL
|
||||
if (CONF_GetAspectRatio())
|
||||
{
|
||||
vmode->viWidth = 672;
|
||||
vmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 672)/2;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Configure VI */
|
||||
VIDEO_Configure (vmode);
|
||||
|
||||
|
@ -27,9 +27,9 @@
|
||||
|
||||
#define DEFAULT_PATH "/genplus"
|
||||
#ifdef HW_RVL
|
||||
#define VERSION "version 1.3.2W"
|
||||
#define VERSION "version 1.3.xW"
|
||||
#else
|
||||
#define VERSION "version 1.3.2G"
|
||||
#define VERSION "version 1.3.XG"
|
||||
#endif
|
||||
|
||||
/* globals */
|
||||
|
Loading…
Reference in New Issue
Block a user