1
0
mirror of https://github.com/cc65/cc65.git synced 2025-02-23 18:29:05 +00:00

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:
uz 2009-09-07 13:21:04 +00:00
parent 90c731d1e9
commit 74bfd6ee31
5 changed files with 95 additions and 14 deletions

View File

@ -106,8 +106,9 @@ function.
<itemize>
<item><ref id="c64mode" name="c64mode">
<item><ref id="fast" name="fast">
<item><ref id="toggle_videomode" name="toggle_videomode">
<item><ref id="slow" name="slow">
<item><ref id="toggle_videomode" name="toggle_videomode">
<item><ref id="videomode" name="videomode">
</itemize>
@ -2008,7 +2009,8 @@ will nearly double the speed compared to slow mode.
<tag/Availability/C128
<tag/See also/
<ref id="slow" name="slow">,
<ref id="toggle_videomode" name="toggle_videomode">
<ref id="toggle_videomode" name="toggle_videomode">,
<ref id="videomode" name="videomode">
<tag/Example/None.
</descrip>
</quote>
@ -4172,7 +4174,8 @@ will halve the speed compared to fast mode.
<tag/Availability/C128
<tag/See also/
<ref id="fast" name="fast">,
<ref id="toggle_videomode" name="toggle_videomode">
<ref id="toggle_videomode" name="toggle_videomode">,
<ref id="videomode" name="videomode">
<tag/Example/None.
</descrip>
</quote>
@ -4837,11 +4840,14 @@ old mode (cursor position, color and so on) are saved and restored together
with the mode.
<tag/Limits/<itemize>
<item>The function is specific to the C128.
<item>This function is deprecated. Please use <ref id="videomode"
name="videomode"> instead!
</itemize>
<tag/Availability/C128
<tag/See also/
<ref id="fast" name="fast">,
<ref id="slow" name="slow">
<ref id="slow" name="slow">,
<ref id="videomode" name="videomode">
<tag/Example/None.
</descrip>
</quote>
@ -4957,7 +4963,7 @@ if (unlink (FILENAME) == 0) {
printf ("We deleted %s successfully\n", FILENAME);
} else {
printf ("There was a problem deleting %s\n", FILENAME);
}
}
</verb>
</descrip>
</quote>
@ -5020,6 +5026,33 @@ used in presence of a prototype.
</quote>
<sect1>videomode<label id="videomode"><p>
<quote>
<descrip>
<tag/Function/Switch to either 40 or 80 column mode.
<tag/Header/<tt/<ref id="c128.h" name="c128.h">/
<tag/Declaration/<tt/unsigned char __fastcall__ videomode (unsigned char Mode);/
<tag/Description/Switch to 40 or 80 column mode depending on the argument. If
the requested mode is already active, nothing happens. The old mode is returned
from the call.
<tag/Limits/<itemize>
<item>The function is specific to the C128.
<item>This function is replaces <ref id="toggle_videomode"
name="toggle_videomode">.
<item>The function is only available as fastcall function, so it may only be
used in presence of a prototype.
</itemize>
<tag/Availability/C128
<tag/See also/
<ref id="fast" name="fast">,
<ref id="slow" name="slow">,
<ref id="toggle_videomode" name="toggle_videomode">
<tag/Example/None.
</descrip>
</quote>
<sect1>wherex<label id="wherex"><p>
<quote>

View File

@ -6,10 +6,10 @@
/* */
/* */
/* */
/* (C) 1998-2003 Ullrich von Bassewitz */
/* Römerstraße 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* (C) 1998-2009, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@ -55,8 +55,6 @@
#define CH_F7 136
#define CH_F8 140
/* Color defines */
#define COLOR_BLACK 0x00
#define COLOR_WHITE 0x01
@ -64,7 +62,7 @@
#define COLOR_CYAN 0x03
#define COLOR_VIOLET 0x04
#define COLOR_GREEN 0x05
#define COLOR_BLUE 0x06
#define COLOR_BLUE 0x06
#define COLOR_YELLOW 0x07
#define COLOR_ORANGE 0x08
#define COLOR_BROWN 0x09
@ -75,6 +73,10 @@
#define COLOR_LIGHTBLUE 0x0E
#define COLOR_GRAY3 0x0F
/* Video mode defines */
#define VIDEOMODE_40COL 0x00
#define VIDEOMODE_80COL 0x80
/* Define hardware */
@ -98,8 +100,15 @@
unsigned char __fastcall__ videomode (unsigned char Mode);
/* Set the video mode, return the old mode. Call with one of the VIDEOMODE_xx
* constants.
*/
void toggle_videomode (void);
/* Toggle the video mode between 40 and 80 chars (calls SWAPPER) */
/* Toggle the video mode between 40 and 80 chars (calls SWAPPER).
* THIS FUNCTION IS DEPRECATED, please use videomode instead!
*/
void c64mode (void);
/* Switch the C128 into C64 mode. Note: This function will not return! */

View File

@ -66,7 +66,8 @@ OBJS = _scrsize.o \
systime.o \
sysuname.o \
tgi_mode_table.o \
toggle_videomode.o
toggle_videomode.o \
videomode.o
#--------------------------------------------------------------------------
# Drivers

View File

@ -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
View 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