dirkwhoffmann / vAmiga

vAmiga is a user-friendly Amiga 500, 1000, 2000 emulator for macOS

Home Page:https://dirkwhoffmann.github.io/vAmiga

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve Agnus sequencer accuracy

dirkwhoffmann opened this issue · comments

The current sequencer cannot handle the case that bitplane DMA is switched off in the middle of a scanline (i.e., while bitplane DMA is active). To address this scenario, the sequencer should be improved as follows:

sequencer

  1. Emulate the bpstopreq and the stop flipflop accurately.
  2. Emulate the T-flipflop counter accurately.
    Right now, when BPRUN equals 0, the counter equals 0 in my emulation. This is inaccurate because the LSB (cnt0) is represented by the HI line. Hence, if BPRUN equals 0, the counter still toggles between 0 and 1 in the real machine. This affects timing of line last which in turn affects timing of the stop flipflop.

Furthermore, there is a bug in the real OCS Agnus (ECS is even worse). If DMA is switched off after stopreq has been asserted, the flipflop doesn't seem to get cleared any more. Hence, if DMA is switched on again in the next scanline, DMA terminates early because stopreq is still asserted. I can't see this behaviour in the available schematics.

Part of v2.1b3