1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

Added isfast function which returns a 1 when the C128 is in 2MHz mode.

This commit is contained in:
Marco van den Heuvel 2018-03-20 13:11:24 -07:00
parent b7a5dd76e9
commit 5d4116f05f
4 changed files with 50 additions and 1 deletions

View File

@ -87,6 +87,7 @@ url="funcref.html" name="function reference"> for declaration and usage.
<item>c64mode
<item>fast
<item>slow
<item>isfast
</itemize>

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

View 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

20
libsrc/c128/isfast.s Normal file
View File

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