]> git.sur5r.net Git - cc65/commitdiff
Added isfast function which returns a 1 when the C128 is in 2MHz mode.
authorMarco van den Heuvel <blackystardust68@yahoo.com>
Tue, 20 Mar 2018 20:11:24 +0000 (13:11 -0700)
committerMarco van den Heuvel <blackystardust68@yahoo.com>
Tue, 20 Mar 2018 20:11:24 +0000 (13:11 -0700)
doc/c128.sgml
doc/funcref.sgml
include/c128.h
libsrc/c128/isfast.s [new file with mode: 0644]

index f133d8d4c6c15b190957ea5c982a6b3458e0ea95..14c874998d5e46cc84863ebe210fe3c84e53a1c9 100644 (file)
@@ -87,6 +87,7 @@ url="funcref.html" name="function reference"> for declaration and usage.
 <item>c64mode
 <item>fast
 <item>slow
+<item>isfast
 </itemize>
 
 
index 235a0d40f58655094e70fe0f80e8a1d855ac1e3d..193a10c52abfe75f5d773f6b671a6c2cbabf8f86 100644 (file)
@@ -131,6 +131,7 @@ function.
 <itemize>
 <item><ref id="c64mode" name="c64mode">
 <item><ref id="fast" name="fast">
+<item><ref id="isfast" name="isfast">
 <item><ref id="slow" name="slow">
 <item><ref id="toggle_videomode" name="toggle_videomode">
 <item><ref id="videomode" name="videomode">
@@ -3302,6 +3303,7 @@ will nearly double the speed compared to slow mode.
 </itemize>
 <tag/Availability/C128
 <tag/See also/
+<ref id="isfast" name="isfast">,
 <ref id="slow" name="slow">,
 <ref id="toggle_videomode" name="toggle_videomode">,
 <ref id="videomode" name="videomode">
@@ -3954,6 +3956,28 @@ fastcall function, so it may only be used in presence of a prototype.
 </quote>
 
 
+<sect1>isfast<label id="isfast"><p>
+
+<quote>
+<descrip>
+<tag/Function/Check if the C128 is in 2MHz mode.
+<tag/Header/<tt/<ref id="c128.h" name="c128.h">/
+<tag/Declaration/<tt/unsigned char isfast (void);/
+<tag/Description/The function returns a 1 if the C128 is in 2MHz mode.
+<tag/Notes/<itemize>
+<item>The function is specific to the C128.
+</itemize>
+<tag/Availability/C128
+<tag/See also/
+<ref id="fast" name="fast">,
+<ref id="slow" name="slow">,
+<ref id="toggle_videomode" name="toggle_videomode">,
+<ref id="videomode" name="videomode">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>isgraph<label id="isgraph"><p>
 
 <quote>
@@ -6073,6 +6097,7 @@ will halve the speed compared to fast mode.
 <tag/Availability/C128
 <tag/See also/
 <ref id="fast" name="fast">,
+<ref id="isfast" name="isfast">,
 <ref id="toggle_videomode" name="toggle_videomode">,
 <ref id="videomode" name="videomode">
 <tag/Example/None.
@@ -6864,6 +6889,7 @@ name="videomode"> instead!
 <tag/Availability/C128
 <tag/See also/
 <ref id="fast" name="fast">,
+<ref id="isfast" name="isfast">,
 <ref id="slow" name="slow">,
 <ref id="videomode" name="videomode">
 <tag/Example/None.
@@ -7064,6 +7090,7 @@ used in presence of a prototype.
 <tag/Availability/C128 and enhanced Apple //e
 <tag/See also/
 <ref id="fast" name="fast">,
+<ref id="isfast" name="isfast">,
 <ref id="slow" name="slow">,
 <ref id="toggle_videomode" name="toggle_videomode">
 <tag/Example/None.
index 356140d41b9c7362abfed850f20d638b4c254e1b..99e050a9bd7c26901c006291e941a1a25d5155cf 100644 (file)
@@ -167,7 +167,8 @@ void fast (void);
 void slow (void);
 /* Switch the CPU into 1MHz mode. */
 
-
+unsigned char isfast (void);
+/* Returns 1 if the CPU is in 2MHz mode. */
 
 /* End of c128.h */
 #endif
diff --git a/libsrc/c128/isfast.s b/libsrc/c128/isfast.s
new file mode 100644 (file)
index 0000000..01b5973
--- /dev/null
@@ -0,0 +1,20 @@
+;
+; Marco van den Heuvel, 2018-03-19
+;
+; unsigned char isfast (void);
+; /* Returns 1 if the CPU is in 2MHz mode. */
+;
+
+        .export         _isfast
+
+        .include        "c128.inc"
+
+
+.proc   _isfast
+
+        lda     VIC_CLK_128
+        and     #$01
+        rts
+
+.endproc
+