diff --git a/genplus-gx/cinterface/zap.c b/genplus-gx/cinterface/zap.c index 4802b5ee56..1d4aea8542 100644 --- a/genplus-gx/cinterface/zap.c +++ b/genplus-gx/cinterface/zap.c @@ -97,13 +97,6 @@ extern struct uint8 Counter; } activator[2]; -extern struct -{ - uint8 State; - uint8 Counter; - uint8 Timeout; -} gamepad[MAX_DEVICES]; - extern uint8 pad_index; extern struct diff --git a/genplus-gx/core/input_hw/gamepad.c b/genplus-gx/core/input_hw/gamepad.c index a13ad30c88..bb4ef9f55d 100644 --- a/genplus-gx/core/input_hw/gamepad.c +++ b/genplus-gx/core/input_hw/gamepad.c @@ -40,13 +40,6 @@ #include "shared.h" #include "gamepad.h" -struct -{ - uint8 State; - uint8 Counter; - uint8 Timeout; -} gamepad[MAX_DEVICES]; - uint8 pad_index; diff --git a/genplus-gx/core/input_hw/input.h b/genplus-gx/core/input_hw/input.h index 6f4d908121..d59e17b0d2 100644 --- a/genplus-gx/core/input_hw/input.h +++ b/genplus-gx/core/input_hw/input.h @@ -137,6 +137,13 @@ typedef struct int y_offset; /* gun vertical offset */ } t_input; +struct +{ + uint8 State; + uint8 Counter; + uint8 Timeout; +} gamepad[MAX_DEVICES]; + /* Global variables */ extern t_input input; extern int old_system[2]; diff --git a/genplus-gx/core/state.c b/genplus-gx/core/state.c index 41f75c80c9..e80a1823b0 100644 --- a/genplus-gx/core/state.c +++ b/genplus-gx/core/state.c @@ -100,6 +100,7 @@ int state_load(unsigned char *state) /* IO */ load_param(io_reg, sizeof(io_reg)); + load_param(gamepad, sizeof(gamepad)); if ((system_hw & SYSTEM_PBC) == SYSTEM_MD) { io_reg[0] = region_code | 0x20 | (config.bios & 1); @@ -221,6 +222,7 @@ int state_save(unsigned char *state) /* IO */ save_param(io_reg, sizeof(io_reg)); + save_param(gamepad, sizeof(gamepad)); /* VDP */ bufferptr += vdp_context_save(&state[bufferptr]);