Product specifications

The interrupt vector word is identified by a zero in bit 0. The 5 most significant bits
form the 5 most significant bits of the interrupt vector provided by the chip on
interrupts (mode 2). Bits 1 and 2 are set according to the channel generating the
interrupt and bit 0 is always zero.
B2 B1 Channel
0 0 0
0 1 1
1 0 2
1 1 3
The interrupt vector table must lie on an 8 byte boundary. This table normally sits at
FFF0 hex. A working example set up of an IM 2 vector table is detailed in section 3.2
Note that the ctc channels were reset twice, this is because one or all of the channels
may be expecting a timer constant and hence misunderstand the first reset program
word sent to the channel.
In the service routine the VDP status register is read (IN (2),A). This is to
acknowledge and reset the VDP interrupt as well as re-initialise the read write cycle of
the VDP.
How to Generate VDP Interrupts
3.2
Setting up a VDP interrupt servicing routine is essentially a three stage process which
is detailed in parts 1 to 3. Part 4 is a listing of the code which will perform the complete
task.
Before this section of code is executed it is vital to inform the VDP chip that it is going
to be expected to perform user defined interrupts. This is done by ensuring that when
the VDP write only registers are set up, bit 5 is register 1 is at 1. This is the VDP
interrupt enable bit.
Part 1
VDP interrupts are set up and accessed through the normal Z80 IM 2. This mode is
tied into the CTC chip and enables four channels to be made available to the user on
ports 8, 9, 10 and 11 referred to as CTC channels 0, 1, 2 and 3 respectively.
The first task that needs to be done is to shut off any existing interrupts on board the
ctc chip which you do not require. The code below will switch of all ctc interrupts on
channels 0, 1, 2 and 3.
KILLcTc: LD B,2 ;Loop counter = 2
LD A,3 ;Ready reset CTC channel byte in
;Acc ready for output to ports 8, 9, 10 & 11
KILLloop: OUT (CTC),A ;Ouput reset byte to channel 1 port 8
OUT (CTC+1),A ;Ouput reset byte to channel 2 port 9
OUT (CTC+2),A ;Ouput reset byte to channel 3 port 10
OUT (CTC+3),A ;Ouput reset byte to channel 4 port 11