CPCWiki forum

General Category => Programming => Topic started by: lightforce6128 on 02:06, 30 September 24

Title: Compatibility of uncommon HTOTAL and missing HSYNC
Post by: lightforce6128 on 02:06, 30 September 24
Currently I'm doing some CRTC experiments. Because it can easily happen that one runs out of available time (64 NOPs per scanline), it is tempting to spare something "insignificant". Does it really matter if the full screen is 64 characters wide? Wouldn't 63 or 65 characters also be okay? And horizontal synchronization. Is it really necessary to do it on every single line? Isn't it enough to do it on every second line? Or even skip 100 lines?

The emulator (WinAPE) does not seem to bother about these things too much. It allows screen widths of 63 to 65 characters. Above or below this the display turns into snow. Also skipping horizontal synchronization for several lines seems not to hurt.

I read that the CRTC creates HSYNC and VSYNC, forwards both to the Gate Array, which combines both into a signal that is finally sent to the display. I'm not sure what the Gate Array does if it does not receive a HSYNC signal. And I'm also not sure what the display does if there is no HSYNC signal. If the signal is at a different place than before, then it will start to move the image left or right to resynchronize. But if there is no signal, what will happen then?

Still another thing this is as seen from modern displays. How do they (respectively the converter circuits) handle the signals determined for old, analog hardware?

My question is: How is your experience with these things in different settings (emulators, old and modern displays)? What is allowed to keep compatibility over a wide variety of settings?
Title: Re: Compatibility of uncommon HTOTAL and missing HSYNC
Post by: lightforce6128 on 02:15, 30 September 24
For trying out the different image widths you can use this small BASIC program:

10 FOR i = 61 TO 65
20 OUT &BC00,0 : OUT &BD00,i
30 CALL &BB18
40 NEXT
50 OUT &BC00,0 : OUT &BD00,63

Every key press will go to the next image width. The first one tried (61) may already cause snow. The next three might work. The last one will cause snow again. At the end the program restores the normal setting (63 is the last character, counted from 0, so 64 characters are used).
Title: Re: Compatibility of uncommon HTOTAL and missing HSYNC
Post by: McArti0 on 06:51, 30 September 24
On CRT, you can use this method to wavy the vertical edge of the screen. :-\
I still plan to do an in-water effect.
The LCD will slam the door and say that it will not work in such conditions. :blank:
Title: Re: Compatibility of uncommon HTOTAL and missing HSYNC
Post by: lightforce6128 on 15:58, 30 September 24
For trying out missing VSYNC I first thought this could only be done in assembly. But it turns out that this is possible in BASIC, too, although the begin and end of the area are a bit unstable. @McArti0 : I know this can be done much better, but I guess not in BASIC.

110 BORDER 26
120 OUT &BC00,2
130 FOR hsync = 45 TO 64 STEP 19
140   WHILE INKEY$=""
150     CALL &BD19 ' wait for VSYNC
160     FOR i = 1 TO 2 : NEXT
170     OUT &BD00,hsync
180     FOR i = 1 TO 2 : NEXT
190     OUT &BD00,46
200   WEND
210 NEXT
220 BORDER 1

First, the program should show a single "wave", although far from what is possible if this is properly synchronized with an assembly program and other background tasks are suppressed. After a keypress the program will show the same scenario with a HSYNC value that will never be reached (display ends at 63), hereby not sending any HSYNC from the CRTC during this time.

In the emulator (WinAPE) the first image shows the wave and the second image does not seem to be affected in any way. @all : What are your experiences with this?
Title: Re: Compatibility of uncommon HTOTAL and missing HSYNC
Post by: GUNHED on 12:42, 01 October 24
IMO the real CTM644 should serve as reference. If your code runs on it, then it's all fine. However, it's always worth to take a look at the GT65 too, sometimes it will 'wobble' depending on what you do.  :)
Powered by SMFPacks Menu Editor Mod