]> git.sur5r.net Git - cc65/blob - libsrc/c128/videomode.s
poor man's _toascii routine, contributed by Fatih Aygun
[cc65] / libsrc / c128 / videomode.s
1 ;
2 ; Ullrich von Bassewitz, 2009-09-07
3 ;
4 ; unsigned __fastcall__ videomode (unsigned Mode);
5 ; /* Set the video mode, return the old mode */
6 ;
7
8         .export         _videomode
9         .import         SWAPPER, BSOUT
10
11         .include        "c128.inc"
12
13
14 .proc   _videomode
15
16         cmp     MODE                    ; Do we have this mode already?
17         beq     @L9
18
19         lda     MODE                    ; Get current mode ...
20         pha                             ; ... and save it
21
22         jsr     SWAPPER                 ; Toggle the mode
23         lda     #14
24         jsr     BSOUT                   ; Switch to lower case chars
25         pla                             ; Get old mode into A
26
27 ; Done, old mode is in A
28
29 @L9:    ldx     #$00                    ; Clear high byte
30         rts
31
32 .endproc
33