From 47edcca508d07b0c597128cf2b1479954bd885e4 Mon Sep 17 00:00:00 2001 From: MrGrynch Date: Thu, 8 Feb 2024 10:32:00 -0500 Subject: [PATCH 1/2] Fix for bad command parsing for some WPC generation hardware --- src/wpc/altsound/snd_alt.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wpc/altsound/snd_alt.cpp b/src/wpc/altsound/snd_alt.cpp index 4ff6b02a6..0c3e85c7b 100644 --- a/src/wpc/altsound/snd_alt.cpp +++ b/src/wpc/altsound/snd_alt.cpp @@ -412,9 +412,10 @@ void preprocess_commands(CmdData* cmds_out, int cmd_in) ALT_DEBUG(0, "Hardware Generation: GEN_WPCDCS, GEN_WPCSECURITY, GEN_WPC95DCS, GEN_WPC95"); - if (((cmd_buffer[3] == 0x55) && (cmd_buffer[2] == 0xAA)) // change volume? - || - ((cmd_buffer[2] == 0x00) && (cmd_buffer[1] == 0x00) && (cmd_buffer[0] == 0x00))) // glitch in command buffer? + if (((cmd_buffer[3] == 0x55) && (cmd_buffer[2] == 0xAA))) // change volume? + // DAR@20240208 The check below is a very bad idea. See https://github.com/vpinball/pinmame/issues/220 + //|| + //((cmd_buffer[2] == 0x00) && (cmd_buffer[1] == 0x00) && (cmd_buffer[0] == 0x00))) // glitch in command buffer? { if ((cmd_buffer[3] == 0x55) && (cmd_buffer[2] == 0xAA) && (cmd_buffer[1] == (cmd_buffer[0] ^ 0xFF))) { // change volume op (following first byte = volume, second = ~volume, if these don't match: ignore) // DAR@20230518 From 8f9f4b804d242b4b2ff3037ef7993406c30f03a0 Mon Sep 17 00:00:00 2001 From: MrGrynch Date: Sun, 11 Feb 2024 14:14:51 -0500 Subject: [PATCH 2/2] Fixed bug with WPCDCS, WPCSECURITY, WPC95DCS, WPC95 altsound command processing --- src/wpc/altsound/snd_alt.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wpc/altsound/snd_alt.cpp b/src/wpc/altsound/snd_alt.cpp index 0c3e85c7b..62bdc1af9 100644 --- a/src/wpc/altsound/snd_alt.cpp +++ b/src/wpc/altsound/snd_alt.cpp @@ -413,7 +413,11 @@ void preprocess_commands(CmdData* cmds_out, int cmd_in) ALT_DEBUG(0, "Hardware Generation: GEN_WPCDCS, GEN_WPCSECURITY, GEN_WPC95DCS, GEN_WPC95"); if (((cmd_buffer[3] == 0x55) && (cmd_buffer[2] == 0xAA))) // change volume? - // DAR@20240208 The check below is a very bad idea. See https://github.com/vpinball/pinmame/issues/220 + // DAR@20240208 The check below is dangerous. If this is still a + // problem, it would be better to revisit it when it + // reappears to implement a more robust solution that + // works for all systems + // See https://github.com/vpinball/pinmame/issues/220 //|| //((cmd_buffer[2] == 0x00) && (cmd_buffer[1] == 0x00) && (cmd_buffer[0] == 0x00))) // glitch in command buffer? {