From 8424286a3ea42dfc53b1f1d30c1af3e229b18301 Mon Sep 17 00:00:00 2001 From: Marco van den Heuvel Date: Fri, 23 Mar 2018 14:31:53 -0700 Subject: [PATCH] Add c16 files as well. --- libsrc/c16/fast.s | 22 ++++++++++++++++++++++ libsrc/c16/isfast.s | 22 ++++++++++++++++++++++ libsrc/c16/slow.s | 22 ++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 libsrc/c16/fast.s create mode 100644 libsrc/c16/isfast.s create mode 100644 libsrc/c16/slow.s diff --git a/libsrc/c16/fast.s b/libsrc/c16/fast.s new file mode 100644 index 000000000..e48813969 --- /dev/null +++ b/libsrc/c16/fast.s @@ -0,0 +1,22 @@ +; +; Marco van den Heuvel, 2018-03-20 +; +; void fast (void); +; /* Switch the CPU into double clock mode. */ +; + + .export _fast + + .include "plus4.inc" + + +.proc _fast + + lda TED_CLK + and #%11111101 + sta TED_CLK + rts + +.endproc + + diff --git a/libsrc/c16/isfast.s b/libsrc/c16/isfast.s new file mode 100644 index 000000000..ff104d97f --- /dev/null +++ b/libsrc/c16/isfast.s @@ -0,0 +1,22 @@ +; +; Marco van den Heuvel, 2018-03-20 +; +; unsigned char isfast (void); +; /* Returns 1 if the CPU is in double clock mode. */ +; + + .export _isfast + + .include "plus4.inc" + + +.proc _isfast + + lda TED_CLK + lsr + and #$01 + ldx #$00 + rts + +.endproc + diff --git a/libsrc/c16/slow.s b/libsrc/c16/slow.s new file mode 100644 index 000000000..18b8c231c --- /dev/null +++ b/libsrc/c16/slow.s @@ -0,0 +1,22 @@ +; +; Marco van den Heuvel, 2018-03-28 +; +; void slow (void); +; /* Switch the CPU into single clock mode. */ +; + + .export _slow + + .include "plus4.inc" + + +.proc _slow + + lda TED_CLK + ora #%00000010 + sta TED_CLK + rts + +.endproc + + -- 2.39.5