Commodore 128 Programmer's Reference Manual page 422

Hide thumbs Also See for 128:
Table of Contents

Advertisement

412
COMMODORE 128
1. IRQ's disabled.
U
2. Editor: split screen handler.
3. Editor: clear VIC raster IRQ.
\ /
4. IRQ's enabled.
1J
5. Editor: keyboard scan.
6. Editor: VIC cursor blink.
7. Kernal: "jiffie" clock.
f
8. Kernal: cassette switches.
^
9. Kernal: clear CIA-1 ICR.
10. BASIC: sprites, sounds, etc.
j (
11. Return from interrupt.
Jj
As indicated in the preceding description, the C128 operating system uses the
IRQ heavily. In particular, the Editor split screen handler has rather strict require-
j {
ments that programmers must recognize and accommodate. An all-text screen or a
l-j
fully bit mapped screen presents no particular problem, but a split text and bit map
screen requires twice the IRQ frequency (two every sixtieth of a second). Thus, the
\ i
Editor (and consequently, IRQ-dependent applications) must distinguish between
[J
the "main" 60Hz IRQ and the "middle" IRQ. Only during the main IRQ will all
the actions listed above be performed; the middle IRQ is only used by the Editor to
split the screen. The Editor IRQ routine sets the carry flag to designate a main IRQ.
<
Moreover, there is no margin in the timing requirements of a split screen. Program-
^
mers should note the way the Editor uses the VIC during IRQ's and avoid direct VIC
I/O if the Editor screen operations are enabled. There is a flag byte called GRAPHM,
\ J
located at $D8, which can be set to $FF to disable the Editor's use of the VIC.
Lj
The Editor is also responsible for scanning the C128 keyboard. Programmers
should note that SCNKEY has two indirect jumps, KEYLOG and KEYPUT, it
t f
takes during its execution. The keyboard is controlled via CIA-1 PRA, PRB, VIC
j /
register #47 (extended key matrix), and the 8502 port (bit 6 = CAPS LOCK). The
^
SCNKEY routine is callable from the jump table.
The balance of the IRQ routines up to calling BASIC are self-explanatory.
j j
The Kernal software clock is maintained by UDTIM, which is in the jump table.
Lj
The IRQ processing makes one last call to BASIC-IRQ ($4006), but only if
INIT_STATUS bit 0 is set indicating BASIC is ready to handle IRQs (this was
\~ t
discussed earlier in the RESET section). BASIC-IRQ is a heavy user of the VIC
[J
and SID, and the same precautions should be taken regarding direct VIC and SID
I/O as with the Editor. BASIC-IRQ also utilizes a hold-off byte called IRQ_WRAP
) f
-FLAG. It is normally used by the system to block IRQ-ed IRQ calls, but can be
j I
set by the user with the effect of disabling the BASIC—IRQ handler. Alternatively
you could clear bit 0 of the INIT_STATUS byte as mentioned above and achieve
the same result.
\
The use of the IRQ indirect ($314) by an application usually requires more
Lj
care than most other wedges for several reasons. The likelihood of an IRQ occur
ring while the wedge is being installed is greater, there exists the possibility that the
\
user or some other software has already wedged the vector, and usually it is
Lj

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents