The Interrupt Scheduler handles systems dependent upon timing, i.e., counters, timers, music, and interrupts.
ACTIVE INTERRUPTS
Calling Sequence: | SYSTEM ACTINT or SYSSUK ACTINT |
Arguments: | None |
Description: | ACTINT provides automatic interrupt service and runs the seconds timer, the game timer, the music processor, and blackout timers, plus CT0–CT3. Functions as 60th of a second timers. |
Once ACTINT is called, it sets:
ACTINT also calls TIMEX and TIMEY which decrement counters/timers.
Appears to call TIMEZ rather than TIMEX? CTIMER calls TIMEX.
CUSTOM TIMER
Calling Sequence: | CALL CTIMER
|
Input: | HL = address of custom time base B = value to load into time base 1 to 0 transition C = counter mask as in DECCTS |
Description: | Calls TIMEX, which decrements a time base in RAM (HL). If HL != 0, then a return is executed, otherwise, HL is loaded with B and DECCTS is called. Registers HL, DE, BC, and AF are undefined upon exit. |
BEGIN PLAYING MUSIC
Calling Sequence: | SYSTEM BMUSIC or SYSSUK BMUSIC DW (music stack) DB (voices byte) DW (score) |
Arguments: | A = voices to start with HL = music program counter (score) IX = music stack pointer |
Description: | Quiets any previous music, then interprets specified “score.” |
DECREMENT COUNTERS/TIMERS
STOP MUSIC
Calling Sequence: | SYSTEM EMUSIC or SYSSUK EMUSIC |
Arguments: | None |
Description: | Outputs 0 to volume ports and halt music processor. |
DECREMENT TIMERS
Calling Sequence: | PUSH AF PUSH BC PUSH DE PUSH HL CALL STIMER POP HL POP DE POP BC POP AF |
Input: | None |
Description: | STIMER keeps track of game time. If it hits 0, then bit 7 (GSBEND, i.e., game end) in the game status byte (GAMSTB) is set. |
Notes: | Uses AF, BC, DE, and HL. Sets bit 7 of KEYSEX (KEYS-EX tracking byte) to 1 on every second. Calls music processor on note (duration) expiration. |