Alcoholics Anonymous wrote: ↑
Mon Apr 05, 2021 4:35 pm
@slingshot, I did some testing with the im2 vector patch applied only (the last two merge commits March 31) and I've found it affects the border colour timing on the Pentagon. I'm seeing the effect in "Across the Edge" which is in the following zip and must be run from Pentagon personality:
https://drive.google.com/file/d/1-3-o4y ... sp=sharing
You can see the problem near the beginning where the border colour change does not line up with the pixel area.
The Pentagon does not have contention so the only thing I can think of is the adjustment in iorq timing has affected the io write / read cycles so that the border colour write to port 0xfe is being picked up by the ula too early. I don't see any changes in 128K demos so far but this sort of thing might be hidden by port contention.
The other possibility is you've fixed a broken io write cycle in which case I should adjust when the interrupt occurs in a Pentagon frame or i should delay when port 0xfe changes are seen by the ula.
As I wrote it on GitLab, it looks like two factors:
- The fixed CPU inserts the correct wait states to the intack cycle in every case. Previously it could happen that only 1 wait states was inserted instead of two, when the interrupt occured during an IO instruction. There's an occurrence of this at the pseudo-loader stage, just before the first scene where the error happens. Then the CPU is HALTed one cycle later, comes out of HALT because of an interrupt also one cycle later, everything is shifted by one cycle.
- The Pentagon mode can change the border register in one pixel granularity. Shifting by one CPU clock means a shift of two pixels at the border effect - this could be seen in the failed demo. It doesn't affect 48K or 128K, as it loads the attribute register at a constant pace even in the border area.
I'm not sure how to fix it without breaking anything else. The Rage end scene is OK for example (no such bad interrupt event happens when it's loaded). It's strange that the Across demo relies on bad CPU behaviour.
Maybe the attribute loading of Pentagon can be changed to two pixel granularity (one CPU clock), then one cycle shift doesn't count if it's done in the middle of the IO cycle, as IORQ is active for 2,5 half cycles. If you check The Rage carefully, you can see the diagonal lines in the border area are only 2 pixels precise, so probably the original machine also works on CPU clock level for border attribute setting, not at pixel clock level (Upd.: maybe this theory is stupid, because in one case you must write at T2, other case in Tw, effectively using a 4-pixel granularity, which is probably not good enough).