#include "events.h"
#include "uae.h"
#include "debug.h"
+#include "inputdevice.h"
#define ROBOCOP3 1
#define LEADERBOARD 2
}
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)) {
switch (currprefs.dongle)
{
case ROBOCOP3:
- if (port == 1 && dflag)
- val += 0x100;
+ if (port == 1) {
+ val &= 0x0101;
+ }
break;
case LEADERBOARD:
if (port == 1) {
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);
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)
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;
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);
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)