.import tgi_libref
.importzp ptr1
- .interruptor tgi_irq ; Export as IRQ handler
.include "tgi-kernel.inc"
.include "tgi-error.inc"
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
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
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: