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
hardware:interrupts [2016/06/05 15:12]
ex_writer [User-Defined Interrupts]
hardware:interrupts [2016/06/11 22:17] (current)
ex_writer [Automatic Interrupts (ACTINT)]
Line 48: Line 48:
  
   * Enable screen interrupts and set its mode in INMOD ($E)   * Enable screen interrupts and set its mode in INMOD ($E)
-  * Designate the target interrupt scanline in INLIN ($F)+  * Designate the target interrupt scanline in INLIN ($F)+++ 
   * Set the interrupt handler address... ​   * Set the interrupt handler address... ​
     * low byte in INFBK ($D)     * low byte in INFBK ($D)
Line 55: Line 55:
   * Enable interrupts with the EI opcode   * Enable interrupts with the EI opcode
  
 ++++<wrap alert>​necessary only with multiple interrupts? screen interrupts seem to function fine when INLIN isn't set </​wrap>​
 === Interrupt Enable and Mode (INMOD) === === Interrupt Enable and Mode (INMOD) ===
  
Line 113: Line 114:
 ===== Automatic Interrupts (ACTINT) ===== ===== Automatic Interrupts (ACTINT) =====
  
-<​WRAP ​alert>To be written...</​WRAP>​+<​WRAP ​todo>Test and clarify</​WRAP>​ 
 + 
 +The Bally Arcade system ROM provides an "​automatic"​ interrupt service via the [[system routines:​interrupt scheduler#​ACTINT]] system routine. 
 + 
 +In the system ROM source, ACTINT is listed as follows: 
 + 
 +<code z80> 
 +MACTIN: 
 +        DI                      ; MAKE SURE INTERRUPT IS DISABLED 
 +        PUSH    AF 
 +        PUSH    BC 
 +        PUSH    DE 
 +        PUSH    HL 
 +        IM      2 
 +        LD      A,ITAB SHR 8 
 +        LD      I,A 
 +        LD      A,$C8 
 +        OUT     ​(INLIN),​A 
 +        LD      A,ITAB & 0FFH 
 +        OUT     ​(INFBK),​A 
 +        CALL    TIMEZ           ; UPDATE TIMEOUT,​MUSIC AND SECONDS 
 +        LD      C,$0F           ; USE CT0-3 
 +        CALL    TIMEY           ; DEC CT0-3 
 +        POP     HL 
 +        POP     DE 
 +        POP     BC 
 +        POP     AF 
 +        EI 
 +        RET 
 +</​code>​ 
 + 
 +ACTIN does the following:​ 
 + 
 +  * Sets Z80 interrupt mode 2 (IM2) 
 +  * Sets I register and INFBK to vector to ITAB on interrupt (which calls MACTIN) 
 +  * Sets INLIN to $C8 (i.e., line 100) 
 +  * Calls TIMEZ (updates game timer, blackout timer, and music processor) 
 +  * Calls TIMEY (decrements counter-timers CT0–CT3)
 ===== Screen Interrupt Examples ===== ===== Screen Interrupt Examples =====