mirror of
https://github.com/cc65/cc65.git
synced 2025-08-08 06:25:17 +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:
@@ -106,8 +106,9 @@ function.
|
|||||||
<itemize>
|
<itemize>
|
||||||
<item><ref id="c64mode" name="c64mode">
|
<item><ref id="c64mode" name="c64mode">
|
||||||
<item><ref id="fast" name="fast">
|
<item><ref id="fast" name="fast">
|
||||||
<item><ref id="toggle_videomode" name="toggle_videomode">
|
|
||||||
<item><ref id="slow" name="slow">
|
<item><ref id="slow" name="slow">
|
||||||
|
<item><ref id="toggle_videomode" name="toggle_videomode">
|
||||||
|
<item><ref id="videomode" name="videomode">
|
||||||
</itemize>
|
</itemize>
|
||||||
|
|
||||||
|
|
||||||
@@ -2008,7 +2009,8 @@ will nearly double the speed compared to slow mode.
|
|||||||
<tag/Availability/C128
|
<tag/Availability/C128
|
||||||
<tag/See also/
|
<tag/See also/
|
||||||
<ref id="slow" name="slow">,
|
<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.
|
<tag/Example/None.
|
||||||
</descrip>
|
</descrip>
|
||||||
</quote>
|
</quote>
|
||||||
@@ -4172,7 +4174,8 @@ will halve the speed compared to fast mode.
|
|||||||
<tag/Availability/C128
|
<tag/Availability/C128
|
||||||
<tag/See also/
|
<tag/See also/
|
||||||
<ref id="fast" name="fast">,
|
<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.
|
<tag/Example/None.
|
||||||
</descrip>
|
</descrip>
|
||||||
</quote>
|
</quote>
|
||||||
@@ -4837,11 +4840,14 @@ old mode (cursor position, color and so on) are saved and restored together
|
|||||||
with the mode.
|
with the mode.
|
||||||
<tag/Limits/<itemize>
|
<tag/Limits/<itemize>
|
||||||
<item>The function is specific to the C128.
|
<item>The function is specific to the C128.
|
||||||
|
<item>This function is deprecated. Please use <ref id="videomode"
|
||||||
|
name="videomode"> instead!
|
||||||
</itemize>
|
</itemize>
|
||||||
<tag/Availability/C128
|
<tag/Availability/C128
|
||||||
<tag/See also/
|
<tag/See also/
|
||||||
<ref id="fast" name="fast">,
|
<ref id="fast" name="fast">,
|
||||||
<ref id="slow" name="slow">
|
<ref id="slow" name="slow">,
|
||||||
|
<ref id="videomode" name="videomode">
|
||||||
<tag/Example/None.
|
<tag/Example/None.
|
||||||
</descrip>
|
</descrip>
|
||||||
</quote>
|
</quote>
|
||||||
@@ -4957,7 +4963,7 @@ if (unlink (FILENAME) == 0) {
|
|||||||
printf ("We deleted %s successfully\n", FILENAME);
|
printf ("We deleted %s successfully\n", FILENAME);
|
||||||
} else {
|
} else {
|
||||||
printf ("There was a problem deleting %s\n", FILENAME);
|
printf ("There was a problem deleting %s\n", FILENAME);
|
||||||
}
|
}
|
||||||
</verb>
|
</verb>
|
||||||
</descrip>
|
</descrip>
|
||||||
</quote>
|
</quote>
|
||||||
@@ -5020,6 +5026,33 @@ used in presence of a prototype.
|
|||||||
</quote>
|
</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>
|
<sect1>wherex<label id="wherex"><p>
|
||||||
|
|
||||||
<quote>
|
<quote>
|
||||||
|
@@ -6,10 +6,10 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 1998-2003 Ullrich von Bassewitz */
|
/* (C) 1998-2009, Ullrich von Bassewitz */
|
||||||
/* R<EFBFBD>merstra<EFBFBD>e 52 */
|
/* Roemerstrasse 52 */
|
||||||
/* D-70794 Filderstadt */
|
/* D-70794 Filderstadt */
|
||||||
/* EMail: uz@cc65.org */
|
/* EMail: uz@cc65.org */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* This software is provided 'as-is', without any expressed or implied */
|
/* This software is provided 'as-is', without any expressed or implied */
|
||||||
@@ -55,8 +55,6 @@
|
|||||||
#define CH_F7 136
|
#define CH_F7 136
|
||||||
#define CH_F8 140
|
#define CH_F8 140
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Color defines */
|
/* Color defines */
|
||||||
#define COLOR_BLACK 0x00
|
#define COLOR_BLACK 0x00
|
||||||
#define COLOR_WHITE 0x01
|
#define COLOR_WHITE 0x01
|
||||||
@@ -64,7 +62,7 @@
|
|||||||
#define COLOR_CYAN 0x03
|
#define COLOR_CYAN 0x03
|
||||||
#define COLOR_VIOLET 0x04
|
#define COLOR_VIOLET 0x04
|
||||||
#define COLOR_GREEN 0x05
|
#define COLOR_GREEN 0x05
|
||||||
#define COLOR_BLUE 0x06
|
#define COLOR_BLUE 0x06
|
||||||
#define COLOR_YELLOW 0x07
|
#define COLOR_YELLOW 0x07
|
||||||
#define COLOR_ORANGE 0x08
|
#define COLOR_ORANGE 0x08
|
||||||
#define COLOR_BROWN 0x09
|
#define COLOR_BROWN 0x09
|
||||||
@@ -75,6 +73,10 @@
|
|||||||
#define COLOR_LIGHTBLUE 0x0E
|
#define COLOR_LIGHTBLUE 0x0E
|
||||||
#define COLOR_GRAY3 0x0F
|
#define COLOR_GRAY3 0x0F
|
||||||
|
|
||||||
|
/* Video mode defines */
|
||||||
|
#define VIDEOMODE_40COL 0x00
|
||||||
|
#define VIDEOMODE_80COL 0x80
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Define hardware */
|
/* 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);
|
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);
|
void c64mode (void);
|
||||||
/* Switch the C128 into C64 mode. Note: This function will not return! */
|
/* Switch the C128 into C64 mode. Note: This function will not return! */
|
||||||
|
@@ -66,7 +66,8 @@ OBJS = _scrsize.o \
|
|||||||
systime.o \
|
systime.o \
|
||||||
sysuname.o \
|
sysuname.o \
|
||||||
tgi_mode_table.o \
|
tgi_mode_table.o \
|
||||||
toggle_videomode.o
|
toggle_videomode.o \
|
||||||
|
videomode.o
|
||||||
|
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# Drivers
|
# Drivers
|
||||||
|
@@ -8,6 +8,11 @@
|
|||||||
.export _toggle_videomode
|
.export _toggle_videomode
|
||||||
.import SWAPPER, BSOUT
|
.import SWAPPER, BSOUT
|
||||||
|
|
||||||
|
; This function is deprecated
|
||||||
|
.assert 0, warning, "toggle_videomode() is deprecated, please use videomode() instead!"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.proc _toggle_videomode
|
.proc _toggle_videomode
|
||||||
|
|
||||||
jsr SWAPPER ; Toggle the mode
|
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