2 ; Ullrich von Bassewitz, 21.06.2002
4 ; Common functions of the tgi graphics kernel.
7 .include "tgi-kernel.inc"
13 ;----------------------------------------------------------------------------
18 _tgi_drv: .res 2 ; Pointer to driver
19 _tgi_error: .res 1 ; Last error code
20 _tgi_mode: .res 1 ; Graphics mode or zero
21 _tgi_xres: .res 2 ; X resolution of the current mode
22 _tgi_yres: .res 2 ; Y resolution of the current mode
27 ; Jump table for the driver functions.
29 tgi_install: jmp $0000
30 tgi_deinstall: jmp $0000
33 tgi_control: jmp $0000
35 tgi_setcolor: jmp $0000
36 tgi_setpixel: jmp $0000
37 tgi_getpixel: jmp $0000
43 ;----------------------------------------------------------------------------
44 ; void __fastcall__ tgi_setup (void);
45 ; /* Setup the driver and graphics kernel once the driver is loaded */
56 jsr tgi_set_ptr ; load _tgi_drv into ptr1
58 ; Copy the jump vectors
62 @L1: inx ; Skip JMP opcode
63 jsr copy ; Copy one byte
64 jsr copy ; Copy one byte
65 cpx #(TGI_HDR_JUMPCOUNT*3)
68 ; Copy the screen dimensions
83 ; Initialize variables
89 jsr tgi_install ; Call driver install routine
93 ;----------------------------------------------------------------------------
94 ; Fetch the error code from the driver and place it into the global error
95 ; variable. The function will also return the error in A and the flags from
96 ; loading the error code are set.
105 ;----------------------------------------------------------------------------
106 ; Load the pointer to the tgi driver into ptr1.