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:
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
_tgi_drv: .res 2 ; Pointer to driver
|
_tgi_drv: .res 2 ; Pointer to driver
|
||||||
_tgi_error: .res 1 ; Last error code
|
_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_curx: .res 2 ; Current drawing cursor X
|
||||||
_tgi_cury: .res 2 ; Current drawing cursor Y
|
_tgi_cury: .res 2 ; Current drawing cursor Y
|
||||||
_tgi_color: .res 1 ; Current drawing color
|
_tgi_color: .res 1 ; Current drawing color
|
||||||
|
|||||||
@@ -10,14 +10,14 @@
|
|||||||
.export _tgi_done
|
.export _tgi_done
|
||||||
|
|
||||||
_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
|
beq @L1 ; Jump if not
|
||||||
jsr tgi_done ; Call the driver routine
|
jsr tgi_done ; Call the driver routine
|
||||||
jsr tgi_geterror ; Get the error code
|
jsr tgi_geterror ; Get the error code
|
||||||
sta _tgi_error ; Save it for reference
|
sta _tgi_error ; Save it for reference
|
||||||
cmp #TGI_ERR_OK
|
cmp #TGI_ERR_OK
|
||||||
bne @L1 ; Jump if we had an error
|
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
|
@L1: rts
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
;
|
;
|
||||||
; Ullrich von Bassewitz, 21.06.2002
|
; Ullrich von Bassewitz, 21.06.2002
|
||||||
;
|
;
|
||||||
; void __fastcall__ tgi_init (unsigned char mode);
|
; void __fastcall__ tgi_init (void);
|
||||||
; /* Initialize the given graphics mode. */
|
; /* Initialize the already loaded graphics driver */
|
||||||
|
|
||||||
|
|
||||||
.include "tgi-kernel.inc"
|
.include "tgi-kernel.inc"
|
||||||
@@ -14,16 +14,15 @@
|
|||||||
.export _tgi_init
|
.export _tgi_init
|
||||||
|
|
||||||
_tgi_init:
|
_tgi_init:
|
||||||
pha ; Save mode
|
|
||||||
jsr _tgi_done ; Switch off graphics if needed
|
jsr _tgi_done ; Switch off graphics if needed
|
||||||
pla
|
|
||||||
sta _tgi_mode ; Remember the mode
|
|
||||||
jsr tgi_init ; Go into graphics mode
|
jsr tgi_init ; Go into graphics mode
|
||||||
jsr tgi_geterror ; Get the error code
|
jsr tgi_geterror ; Get the error code
|
||||||
sta _tgi_error ; Save for later reference
|
sta _tgi_error ; Save for later reference
|
||||||
cmp #TGI_ERR_OK
|
cmp #TGI_ERR_OK
|
||||||
bne @L9 ; Jump on error
|
bne @L9 ; Jump on error
|
||||||
|
|
||||||
|
inc _tgi_gmode ; Remember that graph mode is active
|
||||||
|
|
||||||
; Do driver initialization. First set the default palette.
|
; Do driver initialization. First set the default palette.
|
||||||
|
|
||||||
jsr tgi_getdefpalette ; Get the default palette into A/X
|
jsr tgi_getdefpalette ; Get the default palette into A/X
|
||||||
@@ -56,7 +55,5 @@ _tgi_init:
|
|||||||
|
|
||||||
; Error exit
|
; Error exit
|
||||||
|
|
||||||
@L9: lda #$00
|
@L9: rts
|
||||||
sta _tgi_mode ; Clear the mode if init was not successful
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user