Skip to content

Commit

Permalink
potx/poty must also be read when no mouse is active, so other devices…
Browse files Browse the repository at this point in the history
… that attach to the controller ports which use these lines will still work

git-svn-id: https://svn.code.sf.net/p/vice-emu/code/trunk@45292 379a1393-f5fb-40a0-bcee-ef074d9b53f7
  • Loading branch information
mrdudz committed Aug 11, 2024
1 parent e5adeb7 commit 25ab797
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions vice/src/vic20/vic-mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,17 +291,15 @@ uint8_t vic_read(uint16_t addr)

#ifdef HAVE_MOUSE
if ((addr == 8) || (addr == 9)) {
if (_mouse_enabled) {
if ((maincpu_clk ^ pot_cycle) & ~511) {
pot_cycle = maincpu_clk & ~511; /* simplistic 512 cycle sampling */
if ((maincpu_clk ^ pot_cycle) & ~511) {
pot_cycle = maincpu_clk & ~511; /* simplistic 512 cycle sampling */

if (_mouse_enabled) {
mouse_poll();
}

vic.regs[8] = read_joyport_potx();
vic.regs[9] = read_joyport_poty();
if (_mouse_enabled) {
mouse_poll();
}

vic.regs[8] = read_joyport_potx();
vic.regs[9] = read_joyport_poty();
}
}
#endif
Expand Down

0 comments on commit 25ab797

Please sign in to comment.