1
0
mirror of https://github.com/cc65/cc65.git synced 2026-04-25 22:18:27 +00:00

Removed IRQ support from TGI drivers.

All but one TGI drivers didn't use IRQs. Especially when the TGI driver kernel was the only .interruptor this meant quite some unnecessary overhead because it pulled in the whole IRQ infrastructure.

The one driver using IRQs (the graphics driver for the 160x102x16 mode on the Lynx) now uses a library reference to set up a JMP to its IRQ handler.
This commit is contained in:
Oliver Schmidt
2018-02-02 18:15:45 +01:00
parent 7521ae888a
commit dacee3b9ed
17 changed files with 37 additions and 40 deletions
+1 -2
View File
@@ -2,9 +2,8 @@
; Oliver Schmidt, 2013-05-31
;
.export joy_libref, ser_libref, tgi_libref
.export joy_libref, ser_libref
.import _exit
joy_libref := _exit
ser_libref := _exit
tgi_libref := _exit
+21 -9
View File
@@ -29,7 +29,7 @@
.byte $74, $67, $69 ; "tgi"
.byte TGI_API_VERSION ; TGI API version number
.addr $0000 ; Library reference
libref: .addr $0000 ; Library reference
.word 160 ; X resolution
.word 102 ; Y resolution
.byte 16 ; Number of drawing colors
@@ -64,7 +64,6 @@
.addr BAR
.addr TEXTSTYLE
.addr OUTTEXT
.addr IRQ
; ------------------------------------------------------------------------
@@ -164,6 +163,18 @@ INSTALL:
stz BGINDEX
stz DRAWPAGE
stz SWAPREQUEST
lda libref
ldx libref+1
sta ptr1
stx ptr1+1
ldy #1
lda #<irq
sta (ptr1),y
iny
lda #>irq
sta (ptr1),y
lda #$4C ; Jump opcode
sta (ptr1) ; Activate IRQ routine
rts
@@ -175,6 +186,12 @@ INSTALL:
;
UNINSTALL:
lda libref
ldx libref+1
sta ptr1
stx ptr1+1
lda #$60 ; RTS opcode
sta (ptr1) ; Disable IRQ routine
rts
@@ -466,14 +483,10 @@ SETDRAWPAGE:
stx DRAWPAGEH
rts
; ------------------------------------------------------------------------
; IRQ: VBL interrupt handler
;
IRQ:
irq:
lda INTSET ; Poll all pending interrupts
and #VBL_INTERRUPT
beq IRQEND ; Exit if not a VBL interrupt
beq @L0 ; Exit if not a VBL interrupt
lda SWAPREQUEST
beq @L0
@@ -485,7 +498,6 @@ IRQ:
jsr SETDRAWPAGE
stz SWAPREQUEST
@L0:
IRQEND:
clc
rts
+11
View File
@@ -0,0 +1,11 @@
;
; Oliver Schmidt, 2018-02-02
;
.export tgi_libref
.interruptor tgi_irq ; Export as IRQ handler
.data
tgi_libref:
tgi_irq: .byte $60, $00, $00 ; RTS plus two dummy bytes