1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 00:29:31 +00:00

tgi_mode -> tgi_gmode, removed param from tgi_init()

git-svn-id: svn://svn.cc65.org/cc65/trunk@1859 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2002-12-29 20:57:57 +00:00
parent 3b4112ae0c
commit 6323d98d4f
3 changed files with 8 additions and 11 deletions

View File

@ -18,7 +18,7 @@
_tgi_drv: .res 2 ; Pointer to driver
_tgi_error: .res 1 ; Last error code
_tgi_mode: .res 1 ; Graphics mode or zero
_tgi_gmode: .res 1 ; Flag: Graphics mode active
_tgi_curx: .res 2 ; Current drawing cursor X
_tgi_cury: .res 2 ; Current drawing cursor Y
_tgi_color: .res 1 ; Current drawing color

View File

@ -10,14 +10,14 @@
.export _tgi_done
_tgi_done:
lda _tgi_mode ; Is a graphics mode active?
lda _tgi_gmode ; Is a graphics mode active?
beq @L1 ; Jump if not
jsr tgi_done ; Call the driver routine
jsr tgi_geterror ; Get the error code
sta _tgi_error ; Save it for reference
cmp #TGI_ERR_OK
bne @L1 ; Jump if we had an error
sta _tgi_mode ; Reset the current mode (A = 0)
sta _tgi_gmode ; Reset the graph mode flag (A = 0)
@L1: rts

View File

@ -1,8 +1,8 @@
;
; Ullrich von Bassewitz, 21.06.2002
;
; void __fastcall__ tgi_init (unsigned char mode);
; /* Initialize the given graphics mode. */
; void __fastcall__ tgi_init (void);
; /* Initialize the already loaded graphics driver */
.include "tgi-kernel.inc"
@ -14,16 +14,15 @@
.export _tgi_init
_tgi_init:
pha ; Save mode
jsr _tgi_done ; Switch off graphics if needed
pla
sta _tgi_mode ; Remember the mode
jsr tgi_init ; Go into graphics mode
jsr tgi_geterror ; Get the error code
sta _tgi_error ; Save for later reference
cmp #TGI_ERR_OK
bne @L9 ; Jump on error
inc _tgi_gmode ; Remember that graph mode is active
; Do driver initialization. First set the default palette.
jsr tgi_getdefpalette ; Get the default palette into A/X
@ -56,7 +55,5 @@ _tgi_init:
; Error exit
@L9: lda #$00
sta _tgi_mode ; Clear the mode if init was not successful
rts
@L9: rts