Changes

CRTC

1 byte added, 4 July
/* CRTC register differences */
Therefore, as an example, reading register 4 will give the same result as reading register 12 or 20.
 
<br>
 
=== Horizontal and Vertical Sync (R3) ===
 
Type 0:
*Bits 7..4 define Vertical Sync Width. If 0 is programmed this gives 16 lines of VSYNC.
*Bits 3..0 define Horizontal Sync Width. If 0 is programmed no HSYNC is generated.
 
Type 1:
*Bits 7..4 are ignored. Vertical Sync is fixed at 16 lines.
*Bits 3..0 define Horizontal Sync Width. If 0 is programmed no HSYNC is generated.
 
Type 2:
*Bits 7..4 are ignored. Vertical Sync is fixed at 16 lines.
*Bits 3..0 define Horizontal Sync Width. If 0 is programmed this gives a HSYNC width of 16.
 
Types 3/4:
*Bits 7..4 define Vertical Sync Width. If 0 is programmed this gives 16 lines of VSYNC.
*Bits 3..0 define Horizontal Sync Width. If 0 is programmed this gives a HSYNC width of 16.
 
<br>
 
=== Interlace and Skew (R8) ===
 
Types 0/3/4:
*Bits 7..6 define the skew (delay) of the CUDISP signal (00 = Non-skew ; 01 = One-character skew ; 10 = Two-character skew ; 11 = Non-output).
*Bits 5..4 define the skew (delay) of the DISPTMG signal (00 = Non-skew ; 01 = One-character skew ; 10 = Two-character skew ; 11 = Non-output).
*Bits 3..2 are ignored.
*Bits 1..0 define the interlace mode (00 = No Interlace; 01 = Interlace Sync; 10 = No Interlace; 11 = Interlace Sync and Video).
 
Types 1/2:
*Bits 7..2 are ignored.
*Bits 1..0 define the interlace mode.
 
 
2 interlace modes are available:
* In interlace sync mode, the same information is painted in both fields to enhance readability. In this mode, reprogramming the CRTC is not necessary
* In interlace sync and video mode, alternating lines are displayed in the even and odd field to double the resolution. In this mode, it is necessary to reprogram the CRTC as if we were building a frame of 624 lines. The 625th line is managed automatically by the CRTC
[[File:CRTC Interlace modes.png]]
 
<br>
 
=== Vertical Displayed (R6) ===
 
On CRTCs 0/1/2, the condition VCC=R6 is considered immediately to activate the VBORDER. The only exception is for CRTC 1 with a value of 0, which triggers an immediate BORDER without the condition VCC=R6 being required.
 
On CRTCs 3/4, the condition VCC=R6 is tested only at new character line start. The update of R6 during the character line is therefore not considered.
 
<br>
 
=== R31 on Type 1 ===
 
R31 is described in the UM6845R documentation as "Dummy Register".
 
Its use is described in the documentation for the Rockwell R6545 in combination with R18, R19 and R8 and the Status Register.
 
In the UM6845R it appears to have no effect. Reading and writing does nothing. Reading it returns 0x0ff.
 
R31 doesn't exist on CRTCs 0/2/3/4.
 
<br>
 
=== Status register on Type 1 ===
 
The UM6845R has a status register that can be read using port &BExx.
 
Bit 6 is set to 1 if there is a strobe input to the /LPEN signal. It is cleared to 0 when either R17 or R16 (LPEN address) of the CRTC are read. It signals there is a valid LPEN input. On my CPC (arnoldemu) with UM6845R, it is triggered at power on, R17 and R16 have the values 0 when read.
 
Bit 5 is set to 1 when CRTC is in "vertical blanking". Vertical blanking is when the vertical border is active. i.e. VCC>=R6.
 
It is cleared when the frame is started (VCC=0). It is not directly related to the DISPTMG output (used by the CPC to display the border colour) because that output is a combination of horizontal and vertical blanking.
This bit will be 0 when pixels are being displayed.
 
All the other bits read as 0 and don't have any function.
<br>
|(C9=R9 and C0=R0) or (C9=0 and C0=0 to R0-1)
|}
 
<br>
 
 
=== Horizontal and Vertical Sync (R3) ===
 
Type 0:
*Bits 7..4 define Vertical Sync Width. If 0 is programmed this gives 16 lines of VSYNC.
*Bits 3..0 define Horizontal Sync Width. If 0 is programmed no HSYNC is generated.
 
Type 1:
*Bits 7..4 are ignored. Vertical Sync is fixed at 16 lines.
*Bits 3..0 define Horizontal Sync Width. If 0 is programmed no HSYNC is generated.
 
Type 2:
*Bits 7..4 are ignored. Vertical Sync is fixed at 16 lines.
*Bits 3..0 define Horizontal Sync Width. If 0 is programmed this gives a HSYNC width of 16.
 
Types 3/4:
*Bits 7..4 define Vertical Sync Width. If 0 is programmed this gives 16 lines of VSYNC.
*Bits 3..0 define Horizontal Sync Width. If 0 is programmed this gives a HSYNC width of 16.
 
<br>
 
=== Interlace and Skew (R8) ===
 
Types 0/3/4:
*Bits 7..6 define the skew (delay) of the CUDISP signal (00 = Non-skew ; 01 = One-character skew ; 10 = Two-character skew ; 11 = Non-output).
*Bits 5..4 define the skew (delay) of the DISPTMG signal (00 = Non-skew ; 01 = One-character skew ; 10 = Two-character skew ; 11 = Non-output).
*Bits 3..2 are ignored.
*Bits 1..0 define the interlace mode (00 = No Interlace; 01 = Interlace Sync; 10 = No Interlace; 11 = Interlace Sync and Video).
 
Types 1/2:
*Bits 7..2 are ignored.
*Bits 1..0 define the interlace mode.
 
 
2 interlace modes are available:
* In interlace sync mode, the same information is painted in both fields to enhance readability. In this mode, reprogramming the CRTC is not necessary
* In interlace sync and video mode, alternating lines are displayed in the even and odd field to double the resolution. In this mode, it is necessary to reprogram the CRTC as if we were building a frame of 624 lines. The 625th line is managed automatically by the CRTC
[[File:CRTC Interlace modes.png]]
 
<br>
 
=== Vertical Displayed (R6) ===
 
On CRTCs 0/1/2, the condition VCC=R6 is considered immediately to activate the VBORDER. The only exception is for CRTC 1 with a value of 0, which triggers an immediate BORDER without the condition VCC=R6 being required.
 
On CRTCs 3/4, the condition VCC=R6 is tested only at new character line start. The update of R6 during the character line is therefore not considered.
 
<br>
 
=== R31 on Type 1 ===
 
R31 is described in the UM6845R documentation as "Dummy Register".
 
Its use is described in the documentation for the Rockwell R6545 in combination with R18, R19 and R8 and the Status Register.
 
In the UM6845R it appears to have no effect. Reading and writing does nothing. Reading it returns 0x0ff.
 
R31 doesn't exist on CRTCs 0/2/3/4.
 
<br>
 
=== Status register on Type 1 ===
 
The UM6845R has a status register that can be read using port &BExx.
 
Bit 6 is set to 1 if there is a strobe input to the /LPEN signal. It is cleared to 0 when either R17 or R16 (LPEN address) of the CRTC are read. It signals there is a valid LPEN input. On my CPC (arnoldemu) with UM6845R, it is triggered at power on, R17 and R16 have the values 0 when read.
 
Bit 5 is set to 1 when CRTC is in "vertical blanking". Vertical blanking is when the vertical border is active. i.e. VCC>=R6.
 
It is cleared when the frame is started (VCC=0). It is not directly related to the DISPTMG output (used by the CPC to display the border colour) because that output is a combination of horizontal and vertical blanking.
This bit will be 0 when pixels are being displayed.
 
All the other bits read as 0 and don't have any function.
<br>
6,129
edits