Skip to content

Commit

Permalink
ini option to disable autofire.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorgelig committed Nov 28, 2022
1 parent c24a7ac commit 2d40444
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions MiSTer.ini
Expand Up @@ -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
1 change: 1 addition & 0 deletions cfg.cpp
Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions cfg.h
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion input.cpp
Expand Up @@ -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])
{
Expand Down

0 comments on commit 2d40444

Please sign in to comment.