Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background D020 updates late after raster interrupt? #803

Open
dansanderson opened this issue May 31, 2024 · 2 comments
Open

Background D020 updates late after raster interrupt? #803

dansanderson opened this issue May 31, 2024 · 2 comments

Comments

@dansanderson
Copy link
Collaborator

A simple assembly language program that sets a raster interrupt for line 200, changes the border (D020) and background (D021) to black (0), counts down from 255 in a short busy-loop, then changes the border and background to white (1) demonstrates that the background does not change until just more than half way across the raster line, for both transitions. The border appears to transition on the first of the two raster lines. This is not explained by CPU cycles spent in the interrupt handler code, at 40 MHz.

I don't actually know if this is unexpected behavior for a C65 or a C64. Is there a known trick to this? Note that at 40 MHz there is no visible "stability" issue often discussed in the context of a C64 1 MHz interrupt.

Photo on 5-30-24 at 5 38 PM

raster_hwirq.asm.txt

@dansanderson
Copy link
Collaborator Author

I can get the background change position to flicker steadily by eight-ish pixels (just eyeballing) with minor code changes. It would be surprising if this is CPU cycle slop in the interrupt, and seems more likely to be related to when the VIC recognizes a new border color.

I also tried a version where I cycled through 16 colors across 16 adjacent lines, one interrupt per line, and saw an interesting pattern of variability, stable by line position. So that might also suggest the background color change happens at different times based on raster vertical position.

@ki-bo
Copy link
Member

ki-bo commented Sep 18, 2024

This is probably related to MEGA65 and no C65 behavior. My feeling is that you see pre-rendered characters where the bg color was still white when the rendering happened (chars are not rendered in real-time, but are rendered into the raster rewrite buffer first, and then those pre-rendered pixels are pushed to the video output later). Rendering of chars probably starts at the end of the previous raster line, and parts of the text are already ready when you change the bg color.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants