Thanks for checking! Here's a small standalone test (ciaflag.prg, source for 64tass included). It needs a 1581 on device 8 in true drive emulation: x64sc -debugcart -drive8type 1581 -drive8truedrive -autostartprgmode 1 -autostart ciaflag.prg It uploads a little routine to the 1581 that counts FLAG interrupts (FLAG is ATN on the 1581) while the drive runs a busy loop with interrupts on. The C64 then sends bursts of 2 ATN pulses with a 5000-10000 cycle pause after each burst, so the first pulse of...
CIA: the first FLAG/SDR interrupt after 5000 quiet cycles can be lost
reproduced: drive 8 at the default idle method, drive 9 at "skip cycles", LOAD from 8 hangs. The cause is in r46285's drive_cpu_execute_in_step: it stepped all enabled drives from the oldest drive's clock. Drive 8 ("no idle") is run after every CPU instruction while drive 9 is only caught up on bus access, so drive 9 lagged by millions of cycles, and every step to an older clock set drive 8's last_clk back. Drive 8 then emulated the same time again and ran ahead of the computer, which broke the serial...
Thanks. Updated patch attached (drive-in-step-r46284.patch), against trunk r46284, no option and no environment variable. What I found on trunk: with the default "no idle" method, drive_cycle_hook() catches every drive up to the main CPU clock after each main CPU instruction, so a drive does see another drive's line changes, unlike 3.10. The drives are still caught up one after the other though, a whole instruction at a time (and longer when the CPU is stalled by badlines), so one drive can run several...
True drive emulation: with two or more drives, drives cannot see each other’s IEC lines unless the C64 accesses CIA2