mirror of
https://github.com/cc65/cc65.git
synced 2026-04-25 22:18:27 +00:00
Renamed ..._deinstall -> ..._uninstall.
Rename tgi_setup to tgi_install. Make tgi_install and tgi_deinstall user callable. More cosmetic changes. git-svn-id: svn://svn.cc65.org/cc65/trunk@1966 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
+65
-18
@@ -7,7 +7,7 @@
|
||||
.include "tgi-kernel.inc"
|
||||
.include "tgi-error.inc"
|
||||
|
||||
.export _tgi_setup
|
||||
.export tgi_clear_ptr
|
||||
.importzp ptr1
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ tgi_driver_var_size = * - tgi_driver_vars
|
||||
; Jump table for the driver functions.
|
||||
|
||||
tgi_install: jmp $0000
|
||||
tgi_deinstall: jmp $0000
|
||||
tgi_uninstall: jmp $0000
|
||||
tgi_init: jmp $0000
|
||||
tgi_done: jmp $0000
|
||||
tgi_geterror: jmp $0000
|
||||
@@ -63,21 +63,31 @@ tgi_circle: jmp $0000
|
||||
tgi_textstyle: jmp $0000
|
||||
tgi_outtext: jmp $0000
|
||||
|
||||
; Driver header signature
|
||||
.rodata
|
||||
tgi_sig: .byte $74, $67, $69, $00 ; "tgi", version
|
||||
tgi_sig_len = * - tgi_sig
|
||||
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
; void __fastcall__ tgi_setup (void);
|
||||
; /* Setup the driver and graphics kernel once the driver is loaded */
|
||||
; void __fastcall__ tgi_install (void* driver);
|
||||
; /* Install an already loaded driver. */
|
||||
|
||||
|
||||
copy: lda (ptr1),y
|
||||
sta tgi_install,x
|
||||
iny
|
||||
inx
|
||||
rts
|
||||
_tgi_install:
|
||||
sta _tgi_drv
|
||||
sta ptr1
|
||||
stx _tgi_drv+1
|
||||
stx ptr1+1
|
||||
|
||||
; Check the driver signature
|
||||
|
||||
_tgi_setup:
|
||||
jsr tgi_set_ptr ; load _tgi_drv into ptr1
|
||||
ldy #tgi_sig_len-1
|
||||
@L0: lda (ptr1),y
|
||||
cmp tgi_sig,y
|
||||
bne tgi_inv_drv
|
||||
dey
|
||||
bpl @L0
|
||||
|
||||
; Copy the jump vectors
|
||||
|
||||
@@ -125,14 +135,12 @@ _tgi_setup:
|
||||
|
||||
rts
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
; Load the pointer to the tgi driver into ptr1.
|
||||
; Copy one byte from the jump vectors
|
||||
|
||||
tgi_set_ptr:
|
||||
lda _tgi_drv
|
||||
sta ptr1
|
||||
lda _tgi_drv+1
|
||||
sta ptr1+1
|
||||
copy: lda (ptr1),y
|
||||
sta tgi_install,x
|
||||
iny
|
||||
inx
|
||||
rts
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
@@ -143,3 +151,42 @@ tgi_inv_arg:
|
||||
sta _tgi_error
|
||||
rts
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
; Set an invalid driver error
|
||||
|
||||
tgi_inv_drv:
|
||||
lda #TGI_ERR_INV_DRIVER
|
||||
sta _tgi_error
|
||||
rts
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
; Load the pointer to the tgi driver into ptr1.
|
||||
|
||||
tgi_set_ptr:
|
||||
lda _tgi_drv
|
||||
sta ptr1
|
||||
lda _tgi_drv+1
|
||||
sta ptr1+1
|
||||
rts
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
; void __fastcall__ tgi_uninstall (void);
|
||||
; /* Uninstall the currently loaded driver but do not unload it. Will call
|
||||
; * tgi_done if necessary.
|
||||
; */
|
||||
|
||||
_tgi_uninstall:
|
||||
jsr _tgi_done ; Switch off graphics
|
||||
jsr tgi_uninstall ; Allow the driver to clean up
|
||||
|
||||
; Clear driver pointer and error code
|
||||
|
||||
tgi_clear_ptr: ; External entry point
|
||||
lda #$00
|
||||
sta _tgi_drv
|
||||
sta _tgi_drv+1
|
||||
sta _tgi_error
|
||||
|
||||
rts
|
||||
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
.importzp ptr1, ptr2, ptr3, ptr4
|
||||
.import popax
|
||||
.import _tgi_getmaxx, _tgi_getmaxy
|
||||
.export _tgi_bar
|
||||
|
||||
_tgi_bar:
|
||||
|
||||
.proc _tgi_bar
|
||||
|
||||
sta ptr4 ; Y2
|
||||
stx ptr4+1
|
||||
|
||||
@@ -130,4 +130,4 @@ _tgi_bar:
|
||||
|
||||
@L9: rts
|
||||
|
||||
|
||||
.endproc
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
.import popax
|
||||
.importzp tmp1
|
||||
.export _tgi_circle
|
||||
|
||||
_tgi_circle:
|
||||
.proc _tgi_circle
|
||||
|
||||
sta tmp1 ; Get the coordinates
|
||||
jsr popax
|
||||
jsr tgi_popxy ; Pop X/Y into ptr1/ptr2
|
||||
jmp tgi_circle ; Call the driver
|
||||
|
||||
|
||||
.endproc
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
.export _tgi_clear
|
||||
|
||||
_tgi_clear = tgi_clear ; Call the driver
|
||||
|
||||
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
.include "tgi-kernel.inc"
|
||||
.include "tgi-error.inc"
|
||||
|
||||
.export _tgi_done
|
||||
.proc _tgi_done
|
||||
|
||||
_tgi_done:
|
||||
lda _tgi_gmode ; Is a graphics mode active?
|
||||
beq @L1 ; Jump if not
|
||||
jsr tgi_done ; Call the driver routine
|
||||
@@ -20,5 +19,5 @@ _tgi_done:
|
||||
sta _tgi_gmode ; Reset the graph mode flag (A = 0)
|
||||
@L1: rts
|
||||
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
.importzp ptr1, ptr2, ptr3, ptr4
|
||||
.export tgi_emu_bar
|
||||
|
||||
tgi_emu_bar:
|
||||
.proc tgi_emu_bar
|
||||
|
||||
lda ptr4
|
||||
sta Y2
|
||||
lda ptr4+1
|
||||
@@ -63,6 +63,8 @@ tgi_emu_bar:
|
||||
|
||||
@L4: rts
|
||||
|
||||
.endproc
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
; Data
|
||||
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.export _tgi_getcolor
|
||||
|
||||
_tgi_getcolor:
|
||||
.proc _tgi_getcolor
|
||||
|
||||
lda _tgi_color ; Get the current drawing color
|
||||
ldx #0 ; Clear high byte
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
@@ -5,11 +5,12 @@
|
||||
; /* Get the number of available colors */
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.export _tgi_getcolorcount
|
||||
|
||||
.proc _tgi_getcolorcount
|
||||
|
||||
_tgi_getcolorcount:
|
||||
lda _tgi_colorcount
|
||||
ldx #0
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
;
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.export _tgi_getdefpalette
|
||||
|
||||
_tgi_getdefpalette = tgi_getdefpalette ; Call the driver
|
||||
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
.export _tgi_geterror
|
||||
.proc _tgi_geterror
|
||||
|
||||
_tgi_geterror:
|
||||
lda _tgi_drv ; Check if we have a driver
|
||||
ora _tgi_drv+1
|
||||
beq @L1
|
||||
@@ -22,3 +21,5 @@ _tgi_geterror:
|
||||
stx _tgi_error ; Clear high level error code
|
||||
@L2: rts
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -4,19 +4,18 @@
|
||||
; unsigned char __fastcall__ tgi_getmaxcolor (void);
|
||||
; /* Return the maximum supported color number (the number of colors would
|
||||
; * then be getmaxcolor()+1).
|
||||
; */
|
||||
; */
|
||||
;
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.export _tgi_getmaxcolor
|
||||
|
||||
.proc _tgi_getmaxcolor
|
||||
|
||||
_tgi_getmaxcolor:
|
||||
ldx _tgi_colorcount
|
||||
dex
|
||||
txa
|
||||
ldx #0
|
||||
rts
|
||||
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -7,14 +7,15 @@
|
||||
; */
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.export _tgi_getmaxx
|
||||
.import _tgi_getxres
|
||||
|
||||
.import decax1
|
||||
|
||||
|
||||
_tgi_getmaxx:
|
||||
.proc _tgi_getmaxx
|
||||
|
||||
jsr _tgi_getxres
|
||||
jmp decax1
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
|
||||
@@ -7,13 +7,12 @@
|
||||
; */
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.export _tgi_getmaxy
|
||||
.import _tgi_getyres
|
||||
.import decax1
|
||||
|
||||
.proc _tgi_getmaxy
|
||||
|
||||
_tgi_getmaxy:
|
||||
jsr _tgi_getyres
|
||||
jmp decax1
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
;
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.export _tgi_getpagecount
|
||||
|
||||
.proc _tgi_getpagecount
|
||||
|
||||
_tgi_getpagecount:
|
||||
lda _tgi_pagecount
|
||||
ldx #0
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -8,10 +8,7 @@
|
||||
;
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.export _tgi_getpalette
|
||||
|
||||
|
||||
_tgi_getpalette = tgi_getpalette ; Call the driver
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,13 +6,15 @@
|
||||
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
.import return0
|
||||
.export _tgi_getpixel
|
||||
|
||||
_tgi_getpixel:
|
||||
.import return0
|
||||
|
||||
.proc _tgi_getpixel
|
||||
|
||||
jsr tgi_getset ; Pop args, check range
|
||||
bcs @L9
|
||||
jmp tgi_getpixel ; Call the driver
|
||||
@L9: jmp return0 ; Assume bg color
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
.importzp ptr1, ptr2
|
||||
|
||||
|
||||
tgi_getset:
|
||||
.proc tgi_getset
|
||||
|
||||
jsr tgi_popxy ; Pop X/Y into ptr1/ptr2
|
||||
|
||||
; Are the coordinates out of range? First check if any coord is negative.
|
||||
@@ -36,4 +37,5 @@ tgi_getset:
|
||||
sbc _tgi_yres+1
|
||||
@L9: rts
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.export _tgi_getxres
|
||||
|
||||
.proc _tgi_getxres
|
||||
|
||||
_tgi_getxres:
|
||||
lda _tgi_xres
|
||||
ldx _tgi_xres+1
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -6,13 +6,12 @@
|
||||
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.export _tgi_getyres
|
||||
.import ldaxidx
|
||||
|
||||
.proc _tgi_getyres
|
||||
|
||||
_tgi_getyres:
|
||||
lda _tgi_yres
|
||||
ldx _tgi_yres+1
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
.import popax
|
||||
.export _tgi_gotoxy
|
||||
|
||||
_tgi_gotoxy:
|
||||
.proc _tgi_gotoxy
|
||||
|
||||
sta _tgi_cury ; Y
|
||||
stx _tgi_cury+1
|
||||
jsr popax
|
||||
@@ -18,5 +18,5 @@ _tgi_gotoxy:
|
||||
stx _tgi_curx+1
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
|
||||
@@ -9,11 +9,9 @@
|
||||
.include "tgi-error.inc"
|
||||
|
||||
.importzp ptr1
|
||||
.import _tgi_done
|
||||
.import _tgi_setcolor
|
||||
.export _tgi_init
|
||||
|
||||
_tgi_init:
|
||||
.proc _tgi_init
|
||||
|
||||
jsr _tgi_done ; Switch off graphics if needed
|
||||
jsr tgi_init ; Go into graphics mode
|
||||
jsr tgi_geterror ; Get the error code
|
||||
@@ -57,3 +55,6 @@ _tgi_init:
|
||||
|
||||
@L9: rts
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
|
||||
@@ -8,12 +8,14 @@
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
.import popax
|
||||
.export _tgi_line
|
||||
|
||||
_tgi_line:
|
||||
.proc _tgi_line
|
||||
|
||||
jsr tgi_linepop ; Pop/store Y2/X2
|
||||
jsr popax
|
||||
jsr tgi_popxy ; Pop/store X1/Y1 into ptr1/ptr2
|
||||
jmp tgi_line ; Call the driver
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
.import popax
|
||||
.importzp ptr3, ptr4
|
||||
|
||||
tgi_linepop:
|
||||
.proc tgi_linepop
|
||||
|
||||
sta ptr4 ; Y2
|
||||
stx ptr4+1
|
||||
sta _tgi_cury
|
||||
@@ -21,4 +22,5 @@ tgi_linepop:
|
||||
stx _tgi_curx+1
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -9,11 +9,12 @@
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
.import popax
|
||||
.export _tgi_lineto
|
||||
|
||||
_tgi_lineto:
|
||||
.proc _tgi_lineto
|
||||
|
||||
jsr tgi_curtoxy ; Copy curx/cury into ptr1/ptr2
|
||||
jsr tgi_linepop ; Pop x2/y2 into ptr3/ptr4 and curx/cury
|
||||
jmp tgi_line ; Call the driver
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
+13
-29
@@ -64,8 +64,6 @@ void __fastcall__ tgi_load_driver (const char* name)
|
||||
* should NOT use this function in most cases, use tgi_load() instead.
|
||||
*/
|
||||
{
|
||||
static const unsigned char marker[4] = { 0x74, 0x67, 0x69, 0x00 };
|
||||
|
||||
static struct mod_ctrl ctrl = {
|
||||
read /* Read from disk */
|
||||
};
|
||||
@@ -78,38 +76,24 @@ void __fastcall__ tgi_load_driver (const char* name)
|
||||
|
||||
/* Now open the file */
|
||||
ctrl.callerdata = open (name, O_RDONLY);
|
||||
if (ctrl.callerdata < 0) {
|
||||
tgi_error = TGI_ERR_CANNOT_LOAD;
|
||||
return;
|
||||
}
|
||||
if (ctrl.callerdata >= 0) {
|
||||
|
||||
/* Load the module */
|
||||
Res = mod_load (&ctrl);
|
||||
/* Load the module */
|
||||
Res = mod_load (&ctrl);
|
||||
|
||||
/* Close the input file */
|
||||
close (ctrl.callerdata);
|
||||
/* Close the input file */
|
||||
close (ctrl.callerdata);
|
||||
|
||||
/* Check the return code */
|
||||
if (Res == MLOAD_OK) {
|
||||
/* Check the return code */
|
||||
if (Res == MLOAD_OK) {
|
||||
|
||||
/* Get a pointer to the loaded driver */
|
||||
tgi_drv = (tgi_drv_header*) ctrl.module;
|
||||
/* Check the driver signature, install the driver */
|
||||
tgi_install (ctrl.module);
|
||||
return;
|
||||
|
||||
/* Check the header */
|
||||
if (memcmp (tgi_drv, marker, sizeof (marker)) != 0) {
|
||||
/* Invalid driver */
|
||||
mod_free (tgi_drv);
|
||||
tgi_drv = 0;
|
||||
tgi_error = TGI_ERR_INV_DRIVER;
|
||||
} else {
|
||||
/* Driver is ok do setup */
|
||||
tgi_setup ();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
/* Error loading the driver */
|
||||
tgi_error = TGI_ERR_CANNOT_LOAD;
|
||||
|
||||
}
|
||||
|
||||
/* Error loading the driver */
|
||||
tgi_error = TGI_ERR_CANNOT_LOAD;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
.code
|
||||
|
||||
_tgi_map_mode:
|
||||
.proc _tgi_map_mode
|
||||
|
||||
sta tmp1 ; Save mode
|
||||
ldy #$00
|
||||
|
||||
@@ -48,4 +49,6 @@ Found: tya
|
||||
inx
|
||||
@L1: rts
|
||||
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
|
||||
@@ -9,12 +9,13 @@
|
||||
|
||||
.import popax
|
||||
.importzp ptr3
|
||||
.export _tgi_outtext
|
||||
|
||||
_tgi_outtext:
|
||||
.proc _tgi_outtext
|
||||
|
||||
sta ptr3
|
||||
stx ptr3+1 ; Save s
|
||||
jsr tgi_curtoxy ; Copy curx/cury into ptr1/ptr2
|
||||
jmp tgi_outtext ; Call the driver
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
|
||||
.import popax
|
||||
.importzp ptr3
|
||||
.export _tgi_outtextxy
|
||||
|
||||
_tgi_outtextxy:
|
||||
.proc _tgi_outtextxy
|
||||
|
||||
sta ptr3
|
||||
stx ptr3+1 ; Save s
|
||||
jsr popax ; get y from stack
|
||||
jsr tgi_popxy ; Pop x/y into ptr1/ptr2
|
||||
jmp tgi_outtext ; Call the driver
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
.import popax
|
||||
.importzp ptr1, ptr2
|
||||
|
||||
tgi_popxy:
|
||||
.proc tgi_popxy
|
||||
|
||||
sta ptr2 ; Y
|
||||
stx ptr2+1
|
||||
jsr popax
|
||||
@@ -17,4 +18,5 @@ tgi_popxy:
|
||||
stx ptr1+1
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
.import popax
|
||||
.importzp ptr3, ptr4
|
||||
|
||||
tgi_popxy2:
|
||||
.proc tgi_popxy2
|
||||
|
||||
sta ptr4 ; Y
|
||||
stx ptr4+1
|
||||
jsr popax
|
||||
@@ -17,3 +18,6 @@ tgi_popxy2:
|
||||
stx ptr3+1
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.export _tgi_setcolor
|
||||
|
||||
_tgi_setcolor:
|
||||
.proc _tgi_setcolor
|
||||
|
||||
cmp _tgi_colorcount ; Compare to available colors
|
||||
bcs @L1
|
||||
sta _tgi_color ; Remember the drawing color
|
||||
jmp tgi_setcolor ; Call the driver
|
||||
@L1: jmp tgi_inv_arg ; Invalid argument
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.export _tgi_setdrawpage
|
||||
|
||||
_tgi_setdrawpage:
|
||||
.proc _tgi_setdrawpage
|
||||
|
||||
cmp _tgi_pagecount ; Compare to available pages
|
||||
bcs @L1
|
||||
jmp tgi_setdrawpage ; Call the driver
|
||||
@L1: jmp tgi_inv_arg ; Invalid argument
|
||||
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
.importzp ptr1
|
||||
.export _tgi_setpalette
|
||||
|
||||
.proc _tgi_setpalette
|
||||
|
||||
_tgi_setpalette:
|
||||
sta ptr1
|
||||
stx ptr1+1
|
||||
jmp tgi_setpalette ; Call the driver
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
.export _tgi_setpixel
|
||||
.proc _tgi_setpixel
|
||||
|
||||
_tgi_setpixel:
|
||||
jsr tgi_getset ; Pop args, check range
|
||||
bcs @L9
|
||||
jmp tgi_setpixel ; Call the driver
|
||||
@L9: rts
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
.export _tgi_setviewpage
|
||||
|
||||
_tgi_setviewpage:
|
||||
.proc _tgi_setviewpage
|
||||
|
||||
cmp _tgi_pagecount ; Compare to available pages
|
||||
bcs @L1
|
||||
jmp tgi_setviewpage ; Call the driver
|
||||
@L1: jmp tgi_inv_arg ; Invalid argument
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
;
|
||||
;
|
||||
; Ullrich von Bassewitz, 22.06.2002
|
||||
;
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
.import _strlen, pushax, tosumulax
|
||||
.export _tgi_textwidth
|
||||
.export _tgi_textheight
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
; unsigned __fastcall__ tgi_textwidth (const char* s);
|
||||
@@ -17,6 +15,7 @@
|
||||
|
||||
|
||||
_tgi_textwidth:
|
||||
|
||||
ldy _tgi_textdir ; Get text direction
|
||||
bne height
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
.import popax, incsp2
|
||||
.export _tgi_textstyle
|
||||
|
||||
_tgi_textstyle:
|
||||
.proc _tgi_textstyle
|
||||
|
||||
pha
|
||||
jsr popax ; Get magx/magy in one call
|
||||
tay
|
||||
@@ -39,3 +39,5 @@ DirOk: cpy #$00
|
||||
|
||||
jmp tgi_textstyle
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
+5
-12
@@ -8,25 +8,18 @@
|
||||
.include "tgi-kernel.inc"
|
||||
.include "modload.inc"
|
||||
|
||||
.import _tgi_done
|
||||
.export _tgi_unload
|
||||
.import tgi_clear_ptr
|
||||
|
||||
.proc _tgi_unload
|
||||
|
||||
_tgi_unload:
|
||||
jsr _tgi_done ; Switch off graphics
|
||||
jsr tgi_deinstall ; Allow the driver to clean up
|
||||
jsr tgi_uninstall ; Allow the driver to clean up
|
||||
|
||||
lda _tgi_drv
|
||||
ldx _tgi_drv+1
|
||||
jsr _mod_free ; Free the driver
|
||||
|
||||
; Clear variables
|
||||
|
||||
lda #$00
|
||||
sta _tgi_drv
|
||||
sta _tgi_drv+1
|
||||
sta _tgi_error
|
||||
|
||||
rts
|
||||
jmp tgi_clear_ptr ; Clear the driver pointer and exit
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user