]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
RoboCop 3 dongle fix.
authorToni Wilen <twilen@winuae.net>
Wed, 16 Jul 2025 08:19:56 +0000 (11:19 +0300)
committerToni Wilen <twilen@winuae.net>
Wed, 16 Jul 2025 08:19:56 +0000 (11:19 +0300)
dongle.cpp
include/inputdevice.h
inputdevice.cpp

index 4d4f0c016abca25b33052f420c6e89d7451354e4..0c507aa9266b0d83168211c25e691f4428a21fbf 100644 (file)
@@ -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) {
index 188f2131ccf4abb7fd9637e278d26e385fa35f48..71ad37c6d2f4fffd00ce9180700986c37bf3cd0d 100644 (file)
@@ -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);
index 130a08cbb8a897c802d8a4a46e09c56e1f422898..8004dced52033d5c9b2a1e8c1af73a3900c101aa 100644 (file)
@@ -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)