Amstrad XT pages
Home -> Amstrad XTs -> PPC / PC20 display hardware

PPC / PC20 display notes

The PPC and PC20/PC200 use very similar video hardware - an internal display adaptor (IDA) that supports CGA and MDA modes. The MDA is at a reduced resolution; IBM's original uses 720x350, while the PPC and PC20/PC200 use 640x350 for external monitors and 640x200 for the internal LCD (PPC only).

PPC display limitations

The PPC's internal display is a mono 640x200 LCD. It emulates the various video modes like this:

MDA text mode

Here are the text attributes used by the PPC / PC200 with an external MDA monitor:

as opposed to the attributes used by a genuine MDA:

(The poor quality of the pictures is caused by the use of a cheap webcam).

CGA text modes

CGA to LCD colours (first mapping)
000102030405060708090A0B0C0D0E0F
101112131415161718191A1B1C1D1E1F
202122232425262728292A2B2C2D2E2F
303132333435363738393A3B3C3D3E3F
404142434445464748494A4B4C4D4E4F
505152535455565758595A5B5C5D5E5F
606162636465666768696A6B6C6D6E6F
707172737475767778797A7B7C7D7E7F
808182838485868788898A8B8C8D8E8F
909192939495969798999A9B9C9D9E9F
A0A1A2A3A4A5A6A7A8A9AAABACADAEAF
B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF
C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF
D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF
E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
CGA to LCD colours (second mapping)
000102030405060708090A0B0C0D0E0F
101112131415161718191A1B1C1D1E1F
202122232425262728292A2B2C2D2E2F
303132333435363738393A3B3C3D3E3F
404142434445464748494A4B4C4D4E4F
505152535455565758595A5B5C5D5E5F
606162636465666768696A6B6C6D6E6F
707172737475767778797A7B7C7D7E7F
808182838485868788898A8B8C8D8E8F
909192939495969798999A9B9C9D9E9F
A0A1A2A3A4A5A6A7A8A9AAABACADAEAF
B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF
C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF
D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF
E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF

CGA graphics modes

Display Fonts

Here are the fonts used by the PPC/PC20 IDA.

The CGA characters used in text mode (from the CGA font ROM) are aligned to the right-hand side of the character cell; in graphics mode (from the ROS ROM), they are aligned to the left-hand side.

Character set CGA MDA
Normal
Danish
Portugese
Greek

Technical information

The IDA on a PPC or PC20/PC200 is designed to disallow direct access to some video controller registers. Attempts to write to these registers will cause a non-maskable interrupt; the NMI handler then programs the registers itself, using a table of preset values. This means that programs which attempt to change video mode by programming the video controller directly may still work on an LCD or television.

The way this works on the PPC is fully documented in the technical manual, section 1.11; in particular, 1.11.5.6 and following sections.

To support this, the IDA has some extra registers, and extra bits in existing registers:

CGA Mode Control Register: 03D8h (CGA)

Bits 6 and 7 are protected by the IDA; attempts to write to them will usually trigger an NMI.

On a genuine CGA, this register is write-only. On a PPC / PC200, it can be read (this returns the last value written).

Graphics Adaptor interrupt status: 03DDh

This is a read-only port which gives the reason why the graphics adaptor raised a non-maskable interrupt. Reading this port clears the top 3 bits.

Operation control register: 03DEh

Reading this port reads the first three motherboard DIP switches:

Writing to the port controls the extended video hardware:

The last value written to this port is saved at 0040:008Fh (PPC) or 0040:008Eh (PC20/PC200).

Last 6845 value written: 03DFh

Port 03DFh is a read-only port, which returns the last value written to port 03B5h/03D5h.

Video NMI

When a program attempts to program the graphics hardware directly, by writing to:

- and the I/O channel check is enabled (bit 5 of port 061h), then an NMI will be raised. The ROS will do the following:

  1. Check if 0040:0089h is zero. If it is, then set it to 0FFh; otherwise return. This prevents the handler being re-entered.
  2. The top 2 bits of port 62h are checked. If this is not a parity error or I/O channel check, the ROS jumps to the previous NMI handler.
  3. If this is a parity error, the system halts with an error message.
  4. Port 03DDh is read. If the top 3 bits are zero, then the video hardware did not cause the NMI, so jump to the previous NMI handler (its address is at 0040:008Ah). The value that was read is retained for later use.
  5. The last value written to port 03DEh is loaded. Bit 6 is set (unlock the IDA), and bits 7 and 2 are reset (disable NMI, and enable the IDA). The resulting value is output to port 03DEh.
  6. If bit 5 of port 03DDh was set, then handle output to a 6845 register:
    • (PPC only) If the write was to R10 or R11 (cursor start / cursor end) and the display is in MDA mode and the LCD is in use, the low 5 bits of the value are restricted to between 0 and 7. This ensures that the cursor will fit in the 8x8 character cells used by the LCD.
    • If register R1 (Horizontal Displayed) is written, then look up the correct values for registers R0-R3 from a ROM table and output them. The correct values depend what video mode is in use, and what the output device is. (PPC only) If R1 is set to 80 and the display is in CGA mode, set bit 0 of 0040:008Eh.
    • If register R6 (Vertical Displayed) is written, then look up the correct values for registers R6-R9 from a ROM table and output them. The correct values depend what video mode is in use, and what the output device is. (PPC only) If R6 is set to 100 and the display is in CGA mode, set bit 1 of 0040:008Eh.

    The two (PPC only) checks that set bits in 0040:008Eh are used to detect programs trying to select 160x100 mode. If both bits are set, then 160x100 mode will be selected on the next write to port 03D8h.

  7. (PPC only) If bit 7 of port 03DDh was set, then check 0040:008Eh. If it contains 3, then the program is selecting 160x100 mode; set bit 6 of port 03D8h. The value is also ORed with the byte at 0040:0012h, to get the LCD contrast setting.
  8. The original value of port 03DEh is written back to it.
  9. Port 03DDh is read to clear the top 3 bits.
  10. The I/O channel check is disabled and re-enabled.
  11. 0040:0089h is reset to zero.

Video self-test

  1. Write 80h to port 03DEh.
  2. Read port 03DDh, to reset interrupt flags.
  3. Read port 03DDh. The top 3 bits must now be 0.
  4. Write to the 6845 Horizontal Total register.
  5. Read port 03DDh. Bit 5 must be set.
  6. Write to the CGA Mode Control register, selecting text mode.
  7. Read port 03DDh. Bit 7 must be set.
  8. Write 80h to port 03DEh.
  9. Read port 03DDh. Bit 6 must be set.
  10. Read port 03DDh. The top 3 bits must now be 0.

John Elliott 23 January 2004