So viacore_peek() calls via_context->read_pra(...). Actually in the CIA core the same problem could occur, since ciacore_peek() calls ciacore_read() (which calls cia_context->read_ciapa(...)) for the port registers, claiming that this has no side effects. So I guess that the VIA is alone in having potential side effects if the port values are read? First of all it sounds suspect that just reading a port value has a side effect. If it happens inside the 1541, perhaps this is a case where the port...
The report mentions the Vice monitor. Could it be that the monitor has a bug in this area, while the emulation is fine? (I expect the emulation to be fine) I'm wondering about this because the "banking" ideas of the monitor are in some respects a bit, eh, complicated, and maybe a bug could slip in here. Some things just look different in the monitor, such as an "empty bus".
VIA timer does not wrap to $ffff
Closing since it seems to be fixed :)
r45978 contains essentially the change as described above, plus a bunch of changed or added comments that (hopefully) explain why the change is correct.
Fix bug 2203, caused by changing the timing of viacore_t1_zero_alarm()
When I compare versions r41808 with r41995, it looks like I have moved the "timer 1 zero alarm" 1 cycle earlier: In the case case VIA_T1CH: /* Write timer A high */, it was via_context->tai = rclk + via_context->tal + 2; and became via_context->tai = rclk+1 + via_context->tal ; (tai is now called t1zero) I could move it 1 later again but this would affect other things that happen in the viacore_t1_zero_alarm() function, such as setting the T1 flag in the Interrupt Flag Register and adjusting the...
When I compare versions r41808 with r41995, it looks like I have moved the "timer 1 zero alarm" 1 cycle earlier: In the case case VIA_T1CH: /* Write timer A high */, it was via_context->tai = rclk + via_context->tal + 2; and became via_context->tai = rclk+1 + via_context->tal ; (tai is now called t1zero) I could move it 1 later again but this would affect other things that happen in the viacore_t1_zero_alarm() function, such as setting the T1 flag in the Interrupt Flag Register and adjusting the...