]> git.sur5r.net Git - cc65/blob - libsrc/c128/videomode.s
Fixed a video problem: When switching the display, the SCROLL flag gets
[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         lda     #$C0
26         sta     SCROLL                  ; Disable scrolling
27         pla                             ; Get old mode into A
28
29 ; Done, old mode is in A
30
31 @L9:    ldx     #$00                    ; Clear high byte
32         rts
33
34 .endproc
35