]> git.sur5r.net Git - cc65/blob - libsrc/tgi/tgi_done.s
improved handling of cursor display and position
[cc65] / libsrc / tgi / tgi_done.s
1 ;
2 ; Ullrich von Bassewitz, 21.06.2002
3 ;
4 ; void __fastcall__ tgi_done (void);
5 ; /* End graphics mode, switch back to text mode. Will NOT unload the driver! */
6
7         .include        "tgi-kernel.inc"
8         .include        "tgi-error.inc"
9
10         .export         _tgi_done
11
12 _tgi_done:
13         lda     _tgi_mode               ; Is a graphics mode active?
14         beq     @L1                     ; Jump if not
15         jsr     tgi_done                ; Call the driver routine
16         jsr     tgi_geterror            ; Get the error code
17         sta     _tgi_error              ; Save it for reference
18         cmp     #TGI_ERR_OK
19         bne     @L1                     ; Jump if we had an error
20         sta     _tgi_mode               ; Reset the current mode (A = 0)
21 @L1:    rts
22
23
24