1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 15:29:46 +00:00

Merge pull request #452 from mrdudz/kbrepeat

kbrepeatdelay and kbrepeatrate for cbm targets
This commit is contained in:
Oliver Schmidt 2017-08-20 14:15:37 +02:00 committed by GitHub
commit b5a4e5667a
12 changed files with 214 additions and 0 deletions

View File

@ -38,6 +38,10 @@ INIT_STATUS := $A04 ; Flags: Reset/Restore initiation status
FKEY_LEN := $1000 ; Function key lengths
FKEY_TEXT := $100A ; Function key texts
KBDREPEAT := $28a
KBDREPEATRATE := $28b
KBDREPEATDELAY := $28c
; ---------------------------------------------------------------------------
; Kernal routines

View File

@ -33,6 +33,9 @@ CHARCOLOR := $286
CURS_COLOR := $287 ; Color under the cursor
PALFLAG := $2A6 ; $01 = PAL, $00 = NTSC
KBDREPEAT := $28a
KBDREPEATRATE := $28b
KBDREPEATDELAY := $28c
; ---------------------------------------------------------------------------
; Kernal routines

View File

@ -31,6 +31,18 @@ BASIC_BUF_LEN = 81 ; Maximum length of command-line
KEY_BUF := $26F ; Keyboard buffer
;FIXME: we must somehow handle the difference between the two - how?
; 40-Column PETs
;KBDREPEAT := $3ee
;KBDREPEATRATE := $3ea
;KBDREPEATDELAY := $3e9
; 80-Column PETs
KBDREPEAT := $e4
KBDREPEATRATE := $e5
KBDREPEATDELAY := $e6
;----------------------------------------------------------------------------
; PET ROM type detection

View File

@ -33,6 +33,10 @@ FKEY_COUNT := $55D ; Characters for function key
FKEY_SPACE := $55F ; Function key definitions
FKEY_ORIG := $F3D2 ; Original definitions
KBDREPEAT := $540
KBDREPEATRATE := $541
KBDREPEATDELAY := $542
; ---------------------------------------------------------------------------
; Kernal routines

View File

@ -31,6 +31,9 @@ BASIC_BUF_LEN = 89 ; Maximum length of command-line
CHARCOLOR := $286
CURS_COLOR := $287 ; Color under the cursor
KBDREPEAT := $28a
KBDREPEATRATE := $28b
KBDREPEATDELAY := $28c
; ---------------------------------------------------------------------------
; Screen size

View File

@ -183,6 +183,9 @@ function.
<!-- <item><ref id="cbm_save" name="cbm_save"> -->
<!-- <item><ref id="cbm_write" name="cbm_write"> -->
<!-- <item><ref id="get_tv" name="get_tv"> -->
<item><ref id="kbrepeat" name="kbrepeat">
<item><ref id="kbrepeatdelay" name="kbrepeatdelay">
<item><ref id="kbrepeatrate" name="kbrepeatrate">
</itemize>
(incomplete)
@ -2165,6 +2168,73 @@ to get off the serial bus so it can be used for other purposes.
</descrip>
</quote>
<sect1>kbrepeat<label id="kbrepeat"><p>
<quote>
<descrip>
<tag/Function/Set keyboard repeat mode
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned char kbrepeat (unsigned char);/
<tag/Description/This function changes what keys will have automatic repeat when
being hold down for a certain time. Possible values are KBDREPEAT_CURSOR (repeat
only cursor-related keys), KBDREPEAT_NONE (no repeat for any keys) and
KBDREPEAT_ALL (repeat all keys).
The old mode is returned so it can be restored later.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="kbrepeatdelay" name="kbrepeatdelay">
<ref id="kbrepeatrate" name="kbrepeatrate">
<tag/Example/None.
</descrip>
</quote>
<sect1>kbrepeatdelay<label id="kbrepeatdelay"><p>
<quote>
<descrip>
<tag/Function/Set keyboard repeat delay
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned char kbrepeatdelay (unsigned char);/
<tag/Description/This function changes the delay until a keypress is being
repeated automatically.
The old value is returned so it can be restored later.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="kbrepeat" name="kbrepeat">
<ref id="kbrepeatrate" name="kbrepeatrate">
<tag/Example/None.
</descrip>
</quote>
<sect1>kbrepeatrate<label id="kbrepeatrate"><p>
<quote>
<descrip>
<tag/Function/Set keyboard repeat rate
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
<tag/Declaration/<tt/unsigned char kbrepeatrate (unsigned char);/
<tag/Description/This function changes the keyboard repeat rate (the time between
repeated keypresses).
The old value is returned so it can be restored later.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function; so, it may be used
only in the presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="kbrepeat" name="kbrepeat">
<ref id="kbrepeatdelay" name="kbrepeatdelay">
<tag/Example/None.
</descrip>
</quote>
<sect1>cclear<label id="cclear"><p>

View File

@ -158,6 +158,14 @@ struct cbm_dirent {
unsigned char get_tv (void);
/* Return the video mode the machine is using. */
#define KBDREPEAT_CURSOR 0x00
#define KBDREPEAT_NONE 0x40
#define KBDREPEAT_ALL 0x80
unsigned char __fastcall__ kbrepeat(unsigned char);
unsigned char __fastcall__ kbrepeatdelay(unsigned char);
unsigned char __fastcall__ kbrepeatrate(unsigned char);
#if !defined(__CBM610__) && !defined(__PET__)
void waitvsync (void);
/* wait for the start of the next frame */

22
libsrc/c128/kbrepeat.s Normal file
View File

@ -0,0 +1,22 @@
.export _kbrepeat, _kbrepeatdelay, _kbrepeatrate
.include "c128.inc"
_kbrepeat:
ldx KBDREPEAT ; get old value
sta KBDREPEAT ; store new value
txa ; return old value
rts
_kbrepeatdelay:
ldx KBDREPEATDELAY ; get old value
sta KBDREPEATDELAY ; store new value
txa ; return old value
rts
_kbrepeatrate:
ldx KBDREPEATRATE ; get old value
sta KBDREPEATRATE ; store new value
txa ; return old value
rts

22
libsrc/c64/kbrepeat.s Normal file
View File

@ -0,0 +1,22 @@
.export _kbrepeat, _kbrepeatdelay, _kbrepeatrate
.include "c64.inc"
_kbrepeat:
ldx KBDREPEAT ; get old value
sta KBDREPEAT ; store new value
txa ; return old value
rts
_kbrepeatdelay:
ldx KBDREPEATDELAY ; get old value
sta KBDREPEATDELAY ; store new value
txa ; return old value
rts
_kbrepeatrate:
ldx KBDREPEATRATE ; get old value
sta KBDREPEATRATE ; store new value
txa ; return old value
rts

22
libsrc/pet/kbrepeat.s Normal file
View File

@ -0,0 +1,22 @@
.export _kbrepeat, _kbrepeatdelay, _kbrepeatrate
.include "pet.inc"
_kbrepeat:
ldx KBDREPEAT ; get old value
sta KBDREPEAT ; store new value
txa ; return old value
rts
_kbrepeatdelay:
ldx KBDREPEATDELAY ; get old value
sta KBDREPEATDELAY ; store new value
txa ; return old value
rts
_kbrepeatrate:
ldx KBDREPEATRATE ; get old value
sta KBDREPEATRATE ; store new value
txa ; return old value
rts

22
libsrc/plus4/kbrepeat.s Normal file
View File

@ -0,0 +1,22 @@
.export _kbrepeat, _kbrepeatdelay, _kbrepeatrate
.include "plus4.inc"
_kbrepeat:
ldx KBDREPEAT ; get old value
sta KBDREPEAT ; store new value
txa ; return old value
rts
_kbrepeatdelay:
ldx KBDREPEATDELAY ; get old value
sta KBDREPEATDELAY ; store new value
txa ; return old value
rts
_kbrepeatrate:
ldx KBDREPEATRATE ; get old value
sta KBDREPEATRATE ; store new value
txa ; return old value
rts

22
libsrc/vic20/kbrepeat.s Normal file
View File

@ -0,0 +1,22 @@
.export _kbrepeat, _kbrepeatdelay, _kbrepeatrate
.include "vic20.inc"
_kbrepeat:
ldx KBDREPEAT ; get old value
sta KBDREPEAT ; store new value
txa ; return old value
rts
_kbrepeatdelay:
ldx KBDREPEATDELAY ; get old value
sta KBDREPEATDELAY ; store new value
txa ; return old value
rts
_kbrepeatrate:
ldx KBDREPEATRATE ; get old value
sta KBDREPEATRATE ; store new value
txa ; return old value
rts