From 8c7400c26eae416737949eb6adce7883c5e48268 Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 13 Feb 2003 21:29:12 +0000 Subject: [PATCH] Added fast(), slow() and c64mode() git-svn-id: svn://svn.cc65.org/cc65/trunk@1982 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- include/c128.h | 11 +++++++++++ libsrc/c128/Makefile | 3 +++ libsrc/c128/c128.inc | 3 ++- libsrc/c128/c64mode.s | 13 +++++++++++++ libsrc/c128/fast.s | 23 +++++++++++++++++++++++ libsrc/c128/slow.s | 22 ++++++++++++++++++++++ 6 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 libsrc/c128/c64mode.s create mode 100644 libsrc/c128/fast.s create mode 100644 libsrc/c128/slow.s diff --git a/include/c128.h b/include/c128.h index 205febd26..746215a48 100644 --- a/include/c128.h +++ b/include/c128.h @@ -98,6 +98,17 @@ void toggle_videomode (void); /* Toggle the video mode between 40 and 80 chars (calls SWAPPER) */ +void c64mode (void); +/* Switch the C128 into C64 mode. Note: This function will not return! */ + +void fast (void); +/* Switch the CPU into 2MHz mode. Note: This will disable video when in + * 40 column mode. + */ + +void slow (void); +/* Switch the CPU into 1MHz mode. */ + /* End of c128.h */ diff --git a/libsrc/c128/Makefile b/libsrc/c128/Makefile index cad101c59..36310200b 100644 --- a/libsrc/c128/Makefile +++ b/libsrc/c128/Makefile @@ -28,12 +28,14 @@ OBJS = _scrsize.o \ break.o \ + c64mode.o \ cgetc.o \ clrscr.o \ conio.o \ crt0.o \ color.o \ cputc.o \ + fast.o \ get_tv.o \ joy_stddrv.o \ kbhit.o \ @@ -42,6 +44,7 @@ OBJS = _scrsize.o \ randomize.o \ revers.o \ rs232.o \ + slow.o \ tgi_mode_table.o \ toggle_videomode.o diff --git a/libsrc/c128/c128.inc b/libsrc/c128/c128.inc index e30c3b9b7..aed393980 100644 --- a/libsrc/c128/c128.inc +++ b/libsrc/c128/c128.inc @@ -47,7 +47,8 @@ KBDREAD = $C006 NEWLINE = $C363 PRINT = $C322 -; Extended jump table +; Extended jump table +C64MODE = $FF4D SWAPPER = $FF5F SETBNK = $FF68 diff --git a/libsrc/c128/c64mode.s b/libsrc/c128/c64mode.s new file mode 100644 index 000000000..88a632d36 --- /dev/null +++ b/libsrc/c128/c64mode.s @@ -0,0 +1,13 @@ +; +; Ullrich von Bassewitz, 2003-02-13 +; +; void c64mode (void); +; /* Switch the C128 into C64 mode. Note: This function will not return! */ +; + + .export _c64mode + + .include "c128.inc" + + _c64mode = C64MODE + diff --git a/libsrc/c128/fast.s b/libsrc/c128/fast.s new file mode 100644 index 000000000..abb32d2be --- /dev/null +++ b/libsrc/c128/fast.s @@ -0,0 +1,23 @@ +; +; Ullrich von Bassewitz, 2003-02-13 +; +; void fast (void); +; /* Switch the CPU into 2MHz mode. Note: This will disable video when in +; * 40 column mode. +; */ +; + + .export _fast + + .include "c128.inc" + + +.proc _fast + + lda #$01 + sta VIC_CLK_128 + rts + +.endproc + + diff --git a/libsrc/c128/slow.s b/libsrc/c128/slow.s new file mode 100644 index 000000000..0c265eed6 --- /dev/null +++ b/libsrc/c128/slow.s @@ -0,0 +1,22 @@ +; +; Ullrich von Bassewitz, 2003-02-13 +; +; void slow (void); +; /* Switch the CPU into 1MHz mode. */ +; */ +; + + .export _slow + + .include "c128.inc" + + +.proc _slow + + lda #$00 + sta VIC_CLK_128 + rts + +.endproc + + -- 2.39.5