If ark is not enabled, reject configs that request it

This commit is contained in:
SergioMartin86 2024-08-08 18:36:07 +02:00
parent 831ad3908a
commit afe75a0db5
2 changed files with 14 additions and 0 deletions

View File

@ -66,6 +66,8 @@ class InputParser
_controller1Type = controller_t::fourscore2;
isTypeRecognized = true;
}
#ifdef _QUICKERNES_SUPPORT_ARKANOID_INPUTS
if (controller1Type == "ArkanoidNES")
{
_controller1Type = controller_t::arkanoidNES;
@ -76,6 +78,8 @@ class InputParser
_controller1Type = controller_t::arkanoidFamicom;
isTypeRecognized = true;
}
#endif
if (isTypeRecognized == false) JAFFAR_THROW_LOGIC("Controller 1 type not recognized: '%s'\n", controller1Type.c_str());
}

View File

@ -61,8 +61,12 @@ struct nes_state_lite_t
struct input_state_t
{
uint32_t joypad_latches[2]; // input_state 1 & 2 shift registers
#ifdef _QUICKERNES_SUPPORT_ARKANOID_INPUTS
uint32_t arkanoid_latch; // arkanoid latch
uint8_t arkanoid_fire; // arkanoid latch
#endif
uint8_t w4016; // strobe
};
@ -560,8 +564,11 @@ class Core : private Cpu
input_state.joypad_latches[0] = 0;
input_state.joypad_latches[1] = 0;
#ifdef _QUICKERNES_SUPPORT_ARKANOID_INPUTS
input_state.arkanoid_latch = 0;
input_state.arkanoid_fire = 0;
#endif
nes.frame_count = 0;
}
@ -832,8 +839,11 @@ class Core : private Cpu
{
input_state.joypad_latches[0] = current_joypad[0];
input_state.joypad_latches[1] = current_joypad[1];
#ifdef _QUICKERNES_SUPPORT_ARKANOID_INPUTS
input_state.arkanoid_latch = current_arkanoid_latch;
input_state.arkanoid_fire = current_arkanoid_fire;
#endif
}
input_state.w4016 = data;
return;