David Laundon wrote (oh yes he did):
> For internal ports the number of t-states used depends on when the
> instruction occurs.  IN A,(n) and OUT (n),A takes 12 *OR* 16
> t-states

This is already in place, with the extra 4 t-states being added when
LineCycleCounter is not a multiple of 8.  I notice it's also important in
getting the correct Defender value, as it doesn't work without with it
commented out.


> and IN r,(C) and OUT (C),r takes 16 *OR* 20 t-states.

These need adding, and are probably important for palette changing code that
is often part of line-interrupt handlers, since as Andrew (:-)) mentioned
the timing accurancy for them is pretty critical.

I expect INd(R) and OTd(R) instructions will probably need similar
modifications, especially as OTDR is probably the most commonly used method
for setting up a palette.


> The number of t-states since some fixed point (beginning of the frame?)
> after the instruction seems to be rounded up to the nearest multiple of 8.

The Defender timing stabilisation fix needed the LineCycleCounter to be
resynchronised at the start of the frame, so it does seem to suggest that
it's frame based.


> *However* :) For external ports this rounding to the nearest 8 since some
> fixed point doesn't seem to occur.  Also, IIRC, IN A,(n) and IN r,(C) both
> take the same time for external ports (12 t-states).

Some are obviously internal or external, but I'm not sure about all of them.
Are the MIDI, floppy, printer and sound ports still classed as internal?
(possibly)  I'd guess that reads/writes for unhandled ports will be fast
too, in which case the only ones that need slowing down will be special
hardware devices.  If that's true then only special hardware (that has to be
emulated specially) will need the extra 4 t-states - that might just be the
clock and hard disk ports for now.  Does that sound about right?


> Well, that should keep you going for a while :)

The missing additional timings are easily added, and the external special
cases might not be too bad either - I'll add em over the weekend unless
there are other complications!

Si

Reply via email to