ini option to disable autofire.

This commit is contained in:
Sorgelig
2022-11-28 20:46:42 +08:00
parent c24a7ac742
commit 2d40444af0
4 changed files with 6 additions and 1 deletions

View File

@@ -270,3 +270,6 @@ vrr_min_framerate=0
vrr_max_framerate=0
; VESA VRR base framerate. Normally set to the current video mode's output framerate
vrr_vesa_framerate=0
; disable autofire if for some reason it's not required and accidentally triggered
disable_autofire=0

View File

@@ -107,6 +107,7 @@ static const ini_var_t ini_vars[] =
{ "PLAYER_2_CONTROLLER", (void*)(&(cfg.player_controller[1])), STRING, 0, sizeof(cfg.player_controller[1]) - 1 },
{ "PLAYER_3_CONTROLLER", (void*)(&(cfg.player_controller[2])), STRING, 0, sizeof(cfg.player_controller[2]) - 1 },
{ "PLAYER_4_CONTROLLER", (void*)(&(cfg.player_controller[3])), STRING, 0, sizeof(cfg.player_controller[3]) - 1 },
{ "DISABLE_AUTOFIRE", (void *)(&(cfg.disable_autofire)), UINT8, 0, 1},
};
static const int nvars = (int)(sizeof(ini_vars) / sizeof(ini_var_t));

1
cfg.h
View File

@@ -79,6 +79,7 @@ typedef struct {
uint8_t vrr_max_framerate;
uint8_t vrr_vesa_framerate;
uint16_t video_off;
uint8_t disable_autofire;
} cfg_t;
extern cfg_t cfg;

View File

@@ -1753,7 +1753,7 @@ static void joy_digital(int jnum, uint32_t mask, uint32_t code, char press, int
}
else
{
if (!user_io_osd_is_visible() && press)
if (!user_io_osd_is_visible() && press && !cfg.disable_autofire)
{
if (lastcode[num] && lastmask[num])
{