Merge pull request #620 from blackystardust/master

Added c16/plus4 fast(), isfast() and slow() functions, and updated the documentation accordingly.
This commit is contained in:
Oliver Schmidt 2018-03-31 11:57:27 +02:00 committed by GitHub
commit 8886e6f100
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 214 additions and 27 deletions

View file

@ -73,6 +73,7 @@ TED_CURSLO := $FF0D
TED_V1FRQLO := $FF0E TED_V1FRQLO := $FF0E
TED_V2FRQLO := $FF0F TED_V2FRQLO := $FF0F
TED_V2FRQHI := $FF10 TED_V2FRQHI := $FF10
TED_CLK := $FF13
TED_BGCOLOR := $FF15 TED_BGCOLOR := $FF15
TED_COLOR1 := $FF16 TED_COLOR1 := $FF16
TED_COLOR2 := $FF17 TED_COLOR2 := $FF17

View file

@ -85,9 +85,6 @@ url="funcref.html" name="function reference"> for declaration and usage.
<itemize> <itemize>
<item>videomode <item>videomode
<item>c64mode <item>c64mode
<item>fast
<item>slow
<item>isfast
</itemize> </itemize>
@ -123,6 +120,19 @@ declaration and usage.
</itemize> </itemize>
<sect1>CBM specific CPU functions<p>
Some CPU related functions are available for some of the Commodore
machines. See the <url url="funcref.html" name="function reference"> for
declaration and usage.
<itemize>
<item>fast
<item>slow
<item>isfast
</itemize>
<sect1>Hardware access<p> <sect1>Hardware access<p>
The following pseudo variables declared in the <tt/c128.h/ header file do The following pseudo variables declared in the <tt/c128.h/ header file do

View file

@ -126,6 +126,18 @@ declaration and usage.
</itemize> </itemize>
<sect1>CBM specific CPU functions<p>
Some CPU related functions are available for some of the Commodore
machines. See the <url url="funcref.html" name="function reference"> for
declaration and usage.
<itemize>
<item>fast
<item>slow
<item>isfast
</itemize>
<sect1>Hardware access<p> <sect1>Hardware access<p>
The following pseudo variables declared in the <tt/c16.h/ header file do The following pseudo variables declared in the <tt/c16.h/ header file do

View file

@ -140,6 +140,12 @@ function.
<sect1><tt/c16.h/<label id="c16.h"><p> <sect1><tt/c16.h/<label id="c16.h"><p>
<itemize>
<item><ref id="fast" name="fast">
<item><ref id="isfast" name="isfast">
<item><ref id="slow" name="slow">
</itemize>
(incomplete) (incomplete)
@ -502,6 +508,12 @@ It does not declare any functions.
<sect1><tt/plus4.h/<label id="plus4.h"><p> <sect1><tt/plus4.h/<label id="plus4.h"><p>
<itemize>
<item><ref id="fast" name="fast">
<item><ref id="isfast" name="isfast">
<item><ref id="slow" name="slow">
</itemize>
(incomplete) (incomplete)
@ -3292,21 +3304,21 @@ program, it may not be able to read it.
<quote> <quote>
<descrip> <descrip>
<tag/Function/Switch the C128 into 2MHz mode. <tag/Function/Switch the CPU into fast mode (C128: 2MHz mode, C16/Plus4: double clock mode).
<tag/Header/<tt/<ref id="c128.h" name="c128.h">/ <tag/Header/<tt/<ref id="c128.h" name="c128.h">,
<ref id="c16.h" name="c16.h">, <ref id="plus4.h" name="plus4.h">/
<tag/Declaration/<tt/void fast (void);/ <tag/Declaration/<tt/void fast (void);/
<tag/Description/The function will switch the clock of the C128 to 2MHz. This <tag/Description/The function will switch the clock of the CPU to fast mode. For the C128
will nearly double the speed compared to slow mode. target it means switching the CPU into 2MHz mode. For the C16/Plus4 target it means
switching the CPU into double clock mode.
<tag/Notes/<itemize> <tag/Notes/<itemize>
<item>The function is specific to the C128. <item>The function is specific to the C128, C16 and Plus4.
<item>2MHz clock will not work in 40 column mode. <item>On the C128 the 2MHz clock will not work in 40 column mode.
</itemize> </itemize>
<tag/Availability/C128 <tag/Availability/cc65 (not all platforms)
<tag/See also/ <tag/See also/
<ref id="isfast" name="isfast">, <ref id="isfast" name="isfast">,
<ref id="slow" name="slow">, <ref id="slow" name="slow">,
<ref id="toggle_videomode" name="toggle_videomode">,
<ref id="videomode" name="videomode">
<tag/Example/None. <tag/Example/None.
</descrip> </descrip>
</quote> </quote>
@ -3960,19 +3972,18 @@ fastcall function, so it may only be used in presence of a prototype.
<quote> <quote>
<descrip> <descrip>
<tag/Function/Check if the C128 is in 2MHz mode. <tag/Function/Check if the CPU is in fast mode (C128: 2MHz mode, C16/Plus4: double clock mode).
<tag/Header/<tt/<ref id="c128.h" name="c128.h">/ <tag/Header/<tt/<ref id="c128.h" name="c128.h">,
<ref id="c16.h" name="c16.h">, <ref id="plus4.h" name="plus4.h">/
<tag/Declaration/<tt/unsigned char isfast (void);/ <tag/Declaration/<tt/unsigned char isfast (void);/
<tag/Description/The function returns a 1 if the C128 is in 2MHz mode. <tag/Description/The function returns a 1 if the CPU is in fast mode (C128: 2MHz mode, C16/Plus4: double clock mode).
<tag/Notes/<itemize> <tag/Notes/<itemize>
<item>The function is specific to the C128. <item>The function is specific to the C128, C16 and Plus4.
</itemize> </itemize>
<tag/Availability/C128 <tag/Availability/cc65 (not all platforms)
<tag/See also/ <tag/See also/
<ref id="fast" name="fast">, <ref id="fast" name="fast">,
<ref id="slow" name="slow">, <ref id="slow" name="slow">,
<ref id="toggle_videomode" name="toggle_videomode">,
<ref id="videomode" name="videomode">
<tag/Example/None. <tag/Example/None.
</descrip> </descrip>
</quote> </quote>
@ -6086,20 +6097,20 @@ be used in presence of a prototype.
<quote> <quote>
<descrip> <descrip>
<tag/Function/Switch the C128 into 1MHz mode. <tag/Function/Switch the CPU into slow mode (C128: 1MHz mode, C16/Plus4: single clock mode).
<tag/Header/<tt/<ref id="c128.h" name="c128.h">/ <tag/Header/<tt/<ref id="c128.h" name="c128.h">,
<ref id="c16.h" name="c16.h">, <ref id="plus4.h" name="plus4.h">/
<tag/Declaration/<tt/void slow (void);/ <tag/Declaration/<tt/void slow (void);/
<tag/Description/The function will switch the clock of the C128 to 1MHz. This <tag/Description/The function will switch the clock of the CPU to slow mode. for the C128
will halve the speed compared to fast mode. target it means switching the CPU into 1MHz mode. for the C16/Plus4 target it means
switching the CPU into single clock mode.
<tag/Notes/<itemize> <tag/Notes/<itemize>
<item>The function is specific to the C128. <item>The function is specific to the C128, C16 and Plus4.
</itemize> </itemize>
<tag/Availability/C128 <tag/Availability/cc65 (not all platforms)
<tag/See also/ <tag/See also/
<ref id="fast" name="fast">, <ref id="fast" name="fast">,
<ref id="isfast" name="isfast">, <ref id="isfast" name="isfast">,
<ref id="toggle_videomode" name="toggle_videomode">,
<ref id="videomode" name="videomode">
<tag/Example/None. <tag/Example/None.
</descrip> </descrip>
</quote> </quote>

View file

@ -124,6 +124,19 @@ declaration and usage.
</itemize> </itemize>
<sect1>CBM specific CPU functions<p>
Some CPU related functions are available for some of the Commodore
machines. See the <url url="funcref.html" name="function reference"> for
declaration and usage.
<itemize>
<item>fast
<item>slow
<item>isfast
</itemize>
<sect1>Hardware access<p> <sect1>Hardware access<p>
The following pseudo variables declared in the <tt/plus4.h/ header file do The following pseudo variables declared in the <tt/plus4.h/ header file do

View file

@ -59,6 +59,14 @@
extern void plus4_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */ extern void plus4_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
extern void plus4_stdser_ser[]; extern void plus4_stdser_ser[];
void fast (void);
/* Switch the CPU into double clock mode. */
void slow (void);
/* Switch the CPU into single clock mode. */
unsigned char isfast (void);
/* Returns 1 if the CPU is in double clock mode. */
/* End of plus4.h */ /* End of plus4.h */

22
libsrc/c16/fast.s Normal file
View file

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

22
libsrc/c16/isfast.s Normal file
View file

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

22
libsrc/c16/slow.s Normal file
View file

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

22
libsrc/plus4/fast.s Normal file
View file

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

22
libsrc/plus4/isfast.s Normal file
View file

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

22
libsrc/plus4/slow.s Normal file
View file

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