.struct TGI_HDR
ID .byte 3 ; Contains 0x74, 0x67, 0x69 ("tgi")
VERSION .byte 1 ; Interface version
+ LIBREF .addr ; Library reference
VARS .struct
XRES .word 1 ; X resolution
YRES .word 1 ; Y resolution
; Oliver Schmidt, 2013-05-31
;
- .export em_libref, joy_libref, mouse_libref, ser_libref
+ .export em_libref, joy_libref, mouse_libref, ser_libref, tgi_libref
.import _exit
em_libref := _exit
joy_libref := _exit
mouse_libref := _exit
ser_libref := _exit
+tgi_libref := _exit
.byte $74, $67, $69 ; "tgi"
.byte TGI_API_VERSION ; TGI API version number
+ .addr $0000 ; Library reference
.word 280 ; X resolution
.word 192 ; Y resolution
.byte 8 ; Number of drawing colors
.byte $74, $67, $69 ; "tgi"
.byte TGI_API_VERSION ; TGI API version number
+ .addr $0000 ; Library reference
.word 40 ; X resolution
.word 48 ; Y resolution
.byte 16 ; Number of drawing colors
; Oliver Schmidt, 2013-05-31
;
- .export em_libref, joy_libref
+ .export em_libref, joy_libref, tgi_libref
.import _exit
em_libref := _exit
joy_libref := _exit
+tgi_libref := _exit
.byte $74, $67, $69 ; "tgi"
.byte TGI_API_VERSION ; TGI API version number
+ .addr $0000 ; Library reference
.word x_res ; X resolution
.word y_res ; Y resolution
.byte colors ; Number of drawing colors
; Oliver Schmidt, 2013-05-31
;
- .export joy_libref, ser_libref
+ .export joy_libref, ser_libref, tgi_libref
.import _exit
joy_libref := _exit
ser_libref := _exit
+tgi_libref := _exit
.byte "tgi"
.byte TGI_API_VERSION ; TGI API version number
+ .addr $0000 ; Library reference
.word 228 ; x resolution
.word 200 ; y resolution
.byte 3 ; Number of drawing colors
.byte $74, $67, $69 ; "tgi"
.byte TGI_API_VERSION ; TGI API version number
+ .addr $0000 ; Library reference
.word 240 ; X resolution
.word 200 ; Y resolution
.byte 2 ; Number of drawing colors
; Oliver Schmidt, 2013-05-31
;
- .export em_libref, joy_libref, mouse_libref, ser_libref
+ .export em_libref, joy_libref, mouse_libref, ser_libref, tgi_libref
.import _exit
em_libref := _exit
joy_libref := _exit
mouse_libref := _exit
ser_libref := _exit
+tgi_libref := _exit
.byte $74, $67, $69 ; "tgi"
.byte TGI_API_VERSION ; TGI API version number
+ .addr $0000 ; Library reference
xres: .word 640 ; X resolution
yres: .word 200 ; Y resolution
.byte 2 ; Number of drawing colors
.byte $74, $67, $69 ; "tgi"
.byte TGI_API_VERSION ; TGI API version number
+ .addr $0000 ; Library reference
xres: .word 640 ; X resolution
yres: .word 480 ; Y resolution
.byte 2 ; Number of drawing colors
; Oliver Schmidt, 2013-05-31
;
- .export em_libref, joy_libref, mouse_libref, ser_libref
+ .export em_libref, joy_libref, mouse_libref, ser_libref, tgi_libref
.import _exit
em_libref := _exit
joy_libref := _exit
mouse_libref := _exit
ser_libref := _exit
+tgi_libref := _exit
.byte $74, $67, $69 ; "tgi"
.byte TGI_API_VERSION ; TGI API version number
+ .addr $0000 ; Library reference
.word 320 ; X resolution
.word 200 ; Y resolution
.byte 2 ; Number of drawing colors
; Oliver Schmidt, 2013-05-31
;
- .export em_libref, joy_libref
+ .export em_libref, joy_libref, tgi_libref
.import _exit
em_libref := _exit
joy_libref := _exit
+tgi_libref := _exit
.byte $74, $67, $69 ; "tgi"
.byte TGI_API_VERSION ; TGI API version number
+ .addr $0000 ; Library reference
xres: .word 320 ; X resolution
yres: .word 200 ; Y resolution
.byte 2 ; Number of drawing colors
; Oliver Schmidt, 2013-05-31
;
- .export joy_libref, ser_libref
+ .export joy_libref, ser_libref, tgi_libref
.import _exit
joy_libref := _exit
ser_libref := _exit
+tgi_libref := _exit
.byte $74, $67, $69 ; "tgi"
.byte TGI_API_VERSION ; TGI API version number
+ .addr $0000 ; Library reference
.word 160 ; X resolution
.word 102 ; Y resolution
.byte 16 ; Number of drawing colors
; Oliver Schmidt, 2013-05-31
;
- .export joy_libref
+ .export joy_libref, tgi_libref
.import _exit
joy_libref := _exit
+tgi_libref := _exit
.byte $74, $67, $69 ; "tgi"
.byte TGI_API_VERSION ; TGI API version number
+ .addr $0000 ; Library reference
xres: .word charsperline*2 ; Max X resolution
yres: .word 56 ; Max Y resolution
.byte 2 ; Number of drawing colors
.byte 1 ; Number of screens available
.byte 2 ; System font X size
.byte 2 ; System font Y size
- .word $100 ; Aspect ratio
+ .word $0100 ; Aspect ratio
.byte 0 ; TGI driver flags
; Next comes the jump table. Currently all entries must be valid and may point
; Common functions of the tgi graphics kernel.
;
- .include "tgi-kernel.inc"
- .include "tgi-error.inc"
-
+ .import tgi_libref
.importzp ptr1
.interruptor tgi_irq ; Export as IRQ handler
+ .include "tgi-kernel.inc"
+ .include "tgi-error.inc"
+
;----------------------------------------------------------------------------
; Variables
dey
bpl @L0
+; Set the library reference
+
+ ldy #TGI_HDR::LIBREF
+ lda #<tgi_libref
+ sta (ptr1),y
+ iny
+ lda #>tgi_libref
+ sta (ptr1),y
+
; Copy the jump vectors
ldy #TGI_HDR::JUMPTAB