From afe75a0db5c0407bb37c1951dcf851a27cc7f20e Mon Sep 17 00:00:00 2001 From: SergioMartin86 Date: Thu, 8 Aug 2024 18:36:07 +0200 Subject: [PATCH] If ark is not enabled, reject configs that request it --- source/inputParser.hpp | 4 ++++ source/quickerNES/core/core.hpp | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/source/inputParser.hpp b/source/inputParser.hpp index 29fbb26..d680b5d 100644 --- a/source/inputParser.hpp +++ b/source/inputParser.hpp @@ -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()); } diff --git a/source/quickerNES/core/core.hpp b/source/quickerNES/core/core.hpp index dcf8426..18c68bc 100644 --- a/source/quickerNES/core/core.hpp +++ b/source/quickerNES/core/core.hpp @@ -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;