1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-24 11:31:31 +00:00

Merge pull request #619 from blackystardust/master

Added isfast function which returns a 1 when the C128 is in 2MHz mode.
This commit is contained in:
Oliver Schmidt 2018-03-22 11:50:38 +00:00 committed by GitHub
commit d869368679
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 51 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

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

@ -0,0 +1,21 @@
;
; 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
ldx #$00
rts
.endproc