Commit efa48856 authored by bslenul's avatar bslenul
Browse files

Add core options to change crosshair color + remove light gun warnings

parent 04ff92b2
......@@ -1971,7 +1971,7 @@ static void InitCommon(std::vector<CDIF *> *_CDInterfaces, const bool EmulateMem
PSX_CDC = new PS_CDC();
PSX_FIO = new FrontIO(emulate_memcard, emulate_multitap);
PSX_FIO->SetAMCT(MDFN_GetSettingB("psx.input.analog_mode_ct"));
for(unsigned i = 0; i < 8; i++)
for(unsigned i = 0; i < 2; i++)
{
char buf[64];
snprintf(buf, sizeof(buf), "psx.input.port%u.gun_chairs", i + 1);
......@@ -3625,6 +3625,56 @@ static void check_variables(bool startup)
}
}
var.key = BEETLE_OPT(crosshair_color_p1);
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if (strcmp(var.value, "red") == 0)
setting_crosshair_color_p1 = 0xFF0000;
else if (strcmp(var.value, "blue") == 0)
setting_crosshair_color_p1 = 0x0080FF;
else if (strcmp(var.value, "green") == 0)
setting_crosshair_color_p1 = 0x00FF00;
else if (strcmp(var.value, "orange") == 0)
setting_crosshair_color_p1 = 0xFF8000;
else if (strcmp(var.value, "yellow") == 0)
setting_crosshair_color_p1 = 0xFFFF00;
else if (strcmp(var.value, "cyan") == 0)
setting_crosshair_color_p1 = 0x00FFFF;
else if (strcmp(var.value, "pink") == 0)
setting_crosshair_color_p1 = 0xFF00FF;
else if (strcmp(var.value, "purple") == 0)
setting_crosshair_color_p1 = 0x8000FF;
else if (strcmp(var.value, "black") == 0)
setting_crosshair_color_p1 = 0x000000;
else if (strcmp(var.value, "white") == 0)
setting_crosshair_color_p1 = 0xFFFFFF;
}
var.key = BEETLE_OPT(crosshair_color_p2);
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if (strcmp(var.value, "red") == 0)
setting_crosshair_color_p2 = 0xFF0000;
else if (strcmp(var.value, "blue") == 0)
setting_crosshair_color_p2 = 0x0080FF;
else if (strcmp(var.value, "green") == 0)
setting_crosshair_color_p2 = 0x00FF00;
else if (strcmp(var.value, "orange") == 0)
setting_crosshair_color_p2 = 0xFF8000;
else if (strcmp(var.value, "yellow") == 0)
setting_crosshair_color_p2 = 0xFFFF00;
else if (strcmp(var.value, "cyan") == 0)
setting_crosshair_color_p2 = 0x00FFFF;
else if (strcmp(var.value, "pink") == 0)
setting_crosshair_color_p2 = 0xFF00FF;
else if (strcmp(var.value, "purple") == 0)
setting_crosshair_color_p2 = 0x8000FF;
else if (strcmp(var.value, "black") == 0)
setting_crosshair_color_p2 = 0x000000;
else if (strcmp(var.value, "white") == 0)
setting_crosshair_color_p2 = 0xFFFFFF;
}
var.key = BEETLE_OPT(enable_multitap_port1);
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
......
......@@ -454,6 +454,50 @@ struct retro_core_option_v2_definition option_defs_us[] = {
},
"cross"
},
{
BEETLE_OPT(crosshair_color_p1),
"Port 1: Gun Crosshair Color",
NULL,
"Change the light gun crosshair color for port 1.",
NULL,
"input",
{
{ "red", "Red" },
{ "blue", "Blue" },
{ "green", "Green" },
{ "orange", "Orange" },
{ "yellow", "Yellow" },
{ "cyan", "Cyan" },
{ "pink", "Pink" },
{ "purple", "Purple" },
{ "black", "Black" },
{ "white", "White" },
{ NULL, NULL },
},
"red"
},
{
BEETLE_OPT(crosshair_color_p2),
"Port 2: Gun Crosshair Color",
NULL,
"Change the light gun crosshair color for port 2.",
NULL,
"input",
{
{ "red", "Red" },
{ "blue", "Blue" },
{ "green", "Green" },
{ "orange", "Orange" },
{ "yellow", "Yellow" },
{ "cyan", "Cyan" },
{ "pink", "Pink" },
{ "purple", "Purple" },
{ "black", "Black" },
{ "white", "White" },
{ NULL, NULL },
},
"blue"
},
{
BEETLE_OPT(mouse_sensitivity),
"Mouse Sensitivity",
......
......@@ -28,6 +28,8 @@ int setting_initial_scanline = 0;
int setting_initial_scanline_pal = 0;
int setting_last_scanline = 239;
int setting_last_scanline_pal = 287;
int setting_crosshair_color_p1 = 0xFF0000;
int setting_crosshair_color_p2 = 0x0080FF;
uint32_t setting_psx_multitap_port_1 = 0;
uint32_t setting_psx_multitap_port_2 = 0;
......@@ -38,6 +40,10 @@ uint64_t MDFN_GetSettingUI(const char *name)
{
if (!strcmp("psx.spu.resamp_quality", name)) /* make configurable */
return 4;
if (!strcmp("psx.input.port1.gun_chairs", name))
return setting_crosshair_color_p1;
if (!strcmp("psx.input.port2.gun_chairs", name))
return setting_crosshair_color_p2;
MDFN_DispMessage(3, RETRO_LOG_WARN,
RETRO_MESSAGE_TARGET_LOG, RETRO_MESSAGE_TYPE_NOTIFICATION,
......
......@@ -18,6 +18,8 @@ extern int setting_initial_scanline;
extern int setting_initial_scanline_pal;
extern int setting_last_scanline;
extern int setting_last_scanline_pal;
extern int setting_crosshair_color_p1;
extern int setting_crosshair_color_p2;
/* This should assert() or something if the setting isn't found,
* since it would be a totally tubular error! */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment