80x42 text mode does not display properly.
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
Here is a bug I received privately from Bodo^Rabenauge.
The attached test program switches the CRTC to 42 text lines of 7 scan lines each. It displays weirdly in VICE. On a real 8296 (that model is important) it show up fine. See attached photo.
There are at least 2 issues in play here.
The screen size is set (using CRTC_REG_VTOTAL and CRTC_REG_VTOTALADJ) to 40 text lines plus 20 scan lines. The vertical sync is however set at text line 43. That text line is however never reached. Some CRTC models use the same counter to count the scan lines in a text line, and also the "vertical adjust" lines when VTOTAL text lines have been shown.
The
src/raster/*code is just weird and overly complex and nobody understands it. The crtc code probably works against the raster code and the result is not good if some unwritten assumptions are not met.For 1 I can adjust the code to use separate counters for those. As I understand, some makers of CRTCs do it that way. Commodore must be among those. But I think the demo isn't portable to machines where the CRTC has been replaced by another type.
For 2 I have some adjustments. It turns out that the vertical size of the "canvas" wasn't set the same as the "screen", but smaller, which likely caused confusion. Various border widths seemed to be applied inconsistently. I have code which changes this but it remains rather fragile.
The 42 text lines don't fit in the original window size, which caused more confusion. I added some code to resize larger when needed.
This is hopefully fixed in revision 45801.