mirror of
https://github.com/cc65/cc65.git
synced 2025-01-03 16:33:19 +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:
parent
7521ae888a
commit
dacee3b9ed
@ -70,14 +70,13 @@
|
||||
BAR .addr ; BAR routine
|
||||
TEXTSTYLE .addr ; TEXTSTYLE routine
|
||||
OUTTEXT .addr ; OUTTEXT routine
|
||||
IRQ .addr ; IRQ routine
|
||||
.endstruct
|
||||
.endstruct
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; The TGI API version, stored at TGI_HDR_VERSION
|
||||
|
||||
TGI_API_VERSION = $05
|
||||
TGI_API_VERSION = $06
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Bitmapped tgi driver flags, stored in TGI_HDR::VARS::FLAGS.
|
||||
|
@ -115,7 +115,6 @@ pages: .byte 2 ; Number of screens available
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
|
@ -85,7 +85,6 @@ Y2 := ptr4
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
|
@ -68,7 +68,6 @@ libref: .addr $0000 ; Library reference
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ******************************************************************************
|
||||
|
||||
|
@ -59,7 +59,6 @@ YSIZE = 8 ; System font height
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
|
@ -59,7 +59,6 @@ YSIZE = 8 ; System font height
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
|
@ -88,7 +88,6 @@ pages: .byte 1 ; Number of screens available
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
|
@ -89,7 +89,6 @@ pages: .byte 0 ; Number of screens available
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
|
@ -57,7 +57,6 @@
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
|
@ -74,7 +74,6 @@ aspect: .word $00D4 ; Aspect ratio (based on 4/3 display)
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
|
@ -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
|
||||
|
@ -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
libsrc/lynx/tgi_irq.s
Normal file
11
libsrc/lynx/tgi_irq.s
Normal 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
|
@ -60,7 +60,6 @@ yres: .word 56 ; Max Y resolution
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
|
@ -58,7 +58,6 @@ YSIZE = 8 ; System font height
|
||||
.addr CIRCLE
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
|
@ -58,7 +58,6 @@ YSIZE = 8 ; System font height
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
.import tgi_libref
|
||||
.importzp ptr1
|
||||
.interruptor tgi_irq ; Export as IRQ handler
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.include "tgi-error.inc"
|
||||
@ -81,7 +80,6 @@ tgi_line: jmp $0000
|
||||
tgi_bar: jmp $0000
|
||||
tgi_textstyle: jmp $0000
|
||||
tgi_outtext: jmp $0000
|
||||
tgi_irq: .byte $60, $00, $00 ; RTS plus two dummy bytes
|
||||
|
||||
; Driver header signature
|
||||
.rodata
|
||||
@ -144,20 +142,13 @@ _tgi_install:
|
||||
dex
|
||||
bpl @L3
|
||||
|
||||
; Install the IRQ vector if the driver needs it.
|
||||
|
||||
lda tgi_irq+2 ; Check high byte of IRQ vector
|
||||
beq @L4 ; Jump if vector invalid
|
||||
lda #$4C ; Jump opcode
|
||||
sta tgi_irq ; Activate IRQ routine
|
||||
|
||||
; Initialize some other variables
|
||||
|
||||
lda #$00
|
||||
@L4: ldx #csize-1
|
||||
@L5: sta cstart,x ; Clear error/mode/curx/cury/...
|
||||
ldx #csize-1
|
||||
@L4: sta cstart,x ; Clear error/mode/curx/cury/...
|
||||
dex
|
||||
bpl @L5
|
||||
bpl @L4
|
||||
|
||||
rts
|
||||
|
||||
@ -206,9 +197,6 @@ _tgi_uninstall:
|
||||
|
||||
jsr tgi_uninstall ; Allow the driver to clean up
|
||||
|
||||
lda #$60 ; RTS opcode
|
||||
sta tgi_irq ; Disable IRQ entry point
|
||||
|
||||
; Clear driver pointer and error code
|
||||
|
||||
tgi_clear_ptr:
|
||||
|
Loading…
Reference in New Issue
Block a user