From: Toni Wilen Date: Wed, 16 Jul 2025 08:19:56 +0000 (+0300) Subject: RoboCop 3 dongle fix. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=2686fcfd84674707f5553ed8c1bedf5daaf6c620;p=francis%2Fwinuae.git RoboCop 3 dongle fix. --- diff --git a/dongle.cpp b/dongle.cpp index 4d4f0c01..0c507aa9 100644 --- a/dongle.cpp +++ b/dongle.cpp @@ -16,6 +16,7 @@ #include "events.h" #include "uae.h" #include "debug.h" +#include "inputdevice.h" #define ROBOCOP3 1 #define LEADERBOARD 2 @@ -157,8 +158,9 @@ void dongle_cia_write (int cia, int reg, uae_u8 extra, uae_u8 val) } break; case ROBOCOP3: - if (cia == 0 && reg == 0 && (val & 0x80)) - dflag ^= 1; + if (cia == 0 && reg == 0 && (val & 0x80) && !(oldcia[cia][reg] & 0x80)) { + pulse_joydat(1, 1, 1); + } break; case BAT2: if (cia == 1 && reg == 0 && !(val & 0x80)) { @@ -190,8 +192,9 @@ uae_u16 dongle_joydat (int port, uae_u16 val) switch (currprefs.dongle) { case ROBOCOP3: - if (port == 1 && dflag) - val += 0x100; + if (port == 1) { + val &= 0x0101; + } break; case LEADERBOARD: if (port == 1) { diff --git a/include/inputdevice.h b/include/inputdevice.h index 188f2131..71ad37c6 100644 --- a/include/inputdevice.h +++ b/include/inputdevice.h @@ -291,6 +291,8 @@ extern uae_u16 JOY0DAT (void); extern uae_u16 JOY1DAT (void); extern void JOYSET (int num, uae_u16 v); extern uae_u16 JOYGET (int num); +extern void pulse_joydat(int joy, int xy, int dir); + extern void inputdevice_vsync (void); extern void inputdevice_hsync (bool); diff --git a/inputdevice.cpp b/inputdevice.cpp index 130a08cb..8004dced 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -3703,7 +3703,7 @@ static uae_u16 getjoystate (int joy) v = (uae_u8)mouse_x[joy] | (mouse_y[joy] << 8); #if DONGLE_DEBUG - if (notinrom ()) + if (M68K_GETPC < 0xe00000) write_log (_T("JOY%dDAT %04X %s\n"), joy, v, debuginfo (0)); #endif if (inputdevice_logging & 2) @@ -3711,6 +3711,15 @@ static uae_u16 getjoystate (int joy) return v; } +void pulse_joydat(int joy, int xy, int dir) +{ + if (xy) { + mouse_y[joy] += dir; + } else { + mouse_x[joy] += dir; + } +} + uae_u16 JOY0DAT (void) { uae_u16 v; @@ -4480,7 +4489,7 @@ void POTGO (uae_u16 v) if (inputdevice_logging & (16 | 128)) write_log (_T("POTGO_W: %04X %08X\n"), v, M68K_GETPC); #if DONGLE_DEBUG - if (notinrom ()) + if (M68K_GETPC < 0xe00000) write_log (_T("POTGO %04X %s\n"), v, debuginfo(0)); #endif dongle_potgo (v); @@ -4511,7 +4520,7 @@ uae_u16 POTGOR (void) v = handle_joystick_potgor (potgo_value) & 0x5500; v = dongle_potgor (v); #if DONGLE_DEBUG - if (notinrom ()) + if (M68K_GETPC < 0xe00000) write_log (_T("POTGOR %04X %s\n"), v, debuginfo(0)); #endif if (inputdevice_logging & 16)