New function videomode() for the C128. Marked toggle_videomode as deprecated.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4126 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -66,7 +66,8 @@ OBJS = _scrsize.o \
|
||||
systime.o \
|
||||
sysuname.o \
|
||||
tgi_mode_table.o \
|
||||
toggle_videomode.o
|
||||
toggle_videomode.o \
|
||||
videomode.o
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Drivers
|
||||
|
||||
@@ -8,6 +8,11 @@
|
||||
.export _toggle_videomode
|
||||
.import SWAPPER, BSOUT
|
||||
|
||||
; This function is deprecated
|
||||
.assert 0, warning, "toggle_videomode() is deprecated, please use videomode() instead!"
|
||||
|
||||
|
||||
|
||||
.proc _toggle_videomode
|
||||
|
||||
jsr SWAPPER ; Toggle the mode
|
||||
|
||||
33
libsrc/c128/videomode.s
Normal file
33
libsrc/c128/videomode.s
Normal file
@@ -0,0 +1,33 @@
|
||||
;
|
||||
; Ullrich von Bassewitz, 2009-09-07
|
||||
;
|
||||
; unsigned char __fastcall__ videomode (unsigned char Mode);
|
||||
; /* Set the video mode, return the old mode */
|
||||
;
|
||||
|
||||
.export _videomode
|
||||
.import SWAPPER, BSOUT
|
||||
|
||||
.include "c128.inc"
|
||||
|
||||
|
||||
.proc _videomode
|
||||
|
||||
cmp MODE ; Do we have this mode already?
|
||||
beq @L9
|
||||
|
||||
lda MODE ; Get current mode ...
|
||||
pha ; ... and save it
|
||||
|
||||
jsr SWAPPER ; Toggle the mode
|
||||
lda #14
|
||||
jsr BSOUT ; Switch to lower case chars
|
||||
pla ; Get old mode into A
|
||||
|
||||
; Done, old mode is in A
|
||||
|
||||
@L9: ldx #$00 ; Clear high byte
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
Reference in New Issue
Block a user