Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
system_routines:interrupt_scheduler [2016/06/05 16:31]
ex_writer [ACTINT]
system_routines:interrupt_scheduler [2016/06/11 22:23] (current)
ex_writer [CTIMER]
Line 21: Line 21:
 | Arguments: | None | | Arguments: | None |
 | Description:​ | ACTINT provides automatic [[hardware:​interrupts|interrupt]] service and runs the seconds timer, the game timer, the music processor, and blackout timers, plus CT0–CT3. Functions as 60<​sup>​th</​sup>​ of a second timers. | | Description:​ | ACTINT provides automatic [[hardware:​interrupts|interrupt]] service and runs the seconds timer, the game timer, the music processor, and blackout timers, plus CT0–CT3. Functions as 60<​sup>​th</​sup>​ of a second timers. |
-|Notes: | Once ACTINT is called, it sets: + 
 +Once ACTINT is called, it sets:  
   * Z80 Interrupt mode 2 (IM 2)  ​   * Z80 Interrupt mode 2 (IM 2)  ​
-  * INLIN = 200 (line 100)  ​+  * INLIN = C8H = 200 (i.e., line 100)  ​
   * I register and Interrupt Feedback (INFBK)  ​   * I register and Interrupt Feedback (INFBK)  ​
   * Enable interrupts (EI)   * Enable interrupts (EI)
-ACTINT also calls TIMEX and TIMEY which decrement counters/​timers. ​|+ 
 +ACTINT also calls TIMEX and TIMEY which decrement counters/​timers. ​ 
 + 
 +<wrap alert>​Appears to call TIMEZ rather than TIMEX? CTIMER calls TIMEX.</​wrap>​
 ==== CTIMER ==== ==== CTIMER ====
  
Line 33: Line 37:
 | Calling Sequence: | <code z80>​CALL ​     CTIMER</​code>​| | Calling Sequence: | <code z80>​CALL ​     CTIMER</​code>​|
 | Input: | HL = address of custom time base\\ B = value to load into time base 1 to 0 transition\\ C = counter mask as in [[interrupt scheduler#​deccts|DECCTS]] | | Input: | HL = address of custom time base\\ B = value to load into time base 1 to 0 transition\\ C = counter mask as in [[interrupt scheduler#​deccts|DECCTS]] |
-| Description:​ | HL is loaded and decremented. If HL != 0, then a return is executed, otherwise, HL is loaded with B and [[interrupt scheduler#​deccts|DECCTS]] is called.\\ \\ Registers HL, DE, BC, and AF are undefined upon exit. |+| 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 [[interrupt scheduler#​deccts|DECCTS]] is called.\\ \\ Registers HL, DE, BC, and AF are undefined upon exit. |
  
 ==== BMUSIC ==== ==== BMUSIC ====
Line 62: Line 66:
 | Calling Sequence: | <code z80>​SYSTEM ​   EMUSIC</​code>​ or <code z80>​SYSSUK ​   EMUSIC</​code>​| | Calling Sequence: | <code z80>​SYSTEM ​   EMUSIC</​code>​ or <code z80>​SYSSUK ​   EMUSIC</​code>​|
 | Arguments: | None | | Arguments: | None |
-| Notes: | None | 
 | Description:​ | Outputs 0 to volume ports and halt music processor. | | Description:​ | Outputs 0 to volume ports and halt music processor. |
-| Restrictions:​ | None | 
  
 ==== STIMER ==== ==== STIMER ====
Line 74: Line 76:
 PUSH      DE PUSH      DE
 PUSH      HL PUSH      HL
-PUSH      IX 
-PUSH      IY 
 CALL      STIMER CALL      STIMER
-POP       IY 
-POP       IX 
 POP       HL POP       HL
 POP       DE POP       DE
Line 85: Line 83:
 | Input: | None | | 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. | | 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. |
-Uses: | AF, BC, DE, HL +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. ​|
-| Calls: | Music processor on note (duration) expiration | +
-| Note: | Sets bit 7 of KEYSEX (KEYS-EX tracking byte) to 1 on every second | +