mirror of
https://github.com/cc65/cc65.git
synced 2025-02-13 12:30:40 +00:00
Made the CBM Pet kbrepeat() work on both 40-column and 80-column machines.
Put the kbrepeat() description in an alphabetical position in the function document.
This commit is contained in:
parent
0deeccebf8
commit
3c0b8c4e86
@ -26,22 +26,21 @@ SCR_LINELEN := $D5 ; Screen line length
|
|||||||
CURS_Y := $D8 ; Cursor row
|
CURS_Y := $D8 ; Cursor row
|
||||||
FNADR := $DA ; Pointer to file name
|
FNADR := $DA ; Pointer to file name
|
||||||
|
|
||||||
|
; 80-Column CBMs
|
||||||
|
KBDREPEAT80 := $E4
|
||||||
|
KBDRPTRATE80 := $E5
|
||||||
|
KBDRPTDELAY80 := $E6
|
||||||
|
|
||||||
BASIC_BUF := $200 ; Location of command-line
|
BASIC_BUF := $200 ; Location of command-line
|
||||||
BASIC_BUF_LEN = 81 ; Maximum length of command-line
|
BASIC_BUF_LEN = 81 ; Maximum length of command-line
|
||||||
|
|
||||||
KEY_BUF := $26F ; Keyboard buffer
|
KEY_BUF := $26F ; Keyboard buffer
|
||||||
|
|
||||||
;FIXME: we must somehow handle the difference between the two - how?
|
; 40-Column PETs/CBMs
|
||||||
|
KBDRPTDELAY40 := $3E9
|
||||||
; 40-Column PETs
|
KBDRPTRATE40 := $3EA
|
||||||
;KBDREPEAT := $3ee
|
KBDREPEAT40 := $3EE
|
||||||
;KBDREPEATRATE := $3ea
|
KBDREPEAT40B := $3F8
|
||||||
;KBDREPEATDELAY := $3e9
|
|
||||||
|
|
||||||
; 80-Column PETs
|
|
||||||
KBDREPEAT := $e4
|
|
||||||
KBDREPEATRATE := $e5
|
|
||||||
KBDREPEATDELAY := $e6
|
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
; PET ROM type detection
|
; PET ROM type detection
|
||||||
@ -67,5 +66,3 @@ VIA_PRB := $E840
|
|||||||
VIA_PRA := $E841
|
VIA_PRA := $E841
|
||||||
VIA_DDRB := $E842
|
VIA_DDRB := $E842
|
||||||
VIA_DDRA := $E843
|
VIA_DDRA := $E843
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
<article>
|
<article>
|
||||||
<title>cc65 function reference
|
<title>cc65 function reference
|
||||||
<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">
|
<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">,<newline>
|
||||||
<date>2016-08-07
|
<url url="mailto:greg.king5@verizon.net" name="Greg King">
|
||||||
|
<date>2017-09-02
|
||||||
|
|
||||||
<abstract>
|
<abstract>
|
||||||
cc65 is a C compiler for 6502 based systems. This function reference describes
|
cc65 is a C compiler for 6502 based systems. This function reference describes
|
||||||
@ -2166,26 +2167,6 @@ to get off the serial bus so it can be used for other purposes.
|
|||||||
</descrip>
|
</descrip>
|
||||||
</quote>
|
</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 __fastcall__ kbrepeat (unsigned char mode);/
|
|
||||||
<tag/Description/This function changes which keys have automatic repeat when
|
|
||||||
being hold down for a certain time. Possible values are KBREPEAT_CURSOR (repeat
|
|
||||||
only cursor-related keys), KBREPEAT_NONE (no repeat for any keys) and
|
|
||||||
KBREPEAT_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/Example/None.
|
|
||||||
</descrip>
|
|
||||||
</quote>
|
|
||||||
|
|
||||||
<sect1>cclear<label id="cclear"><p>
|
<sect1>cclear<label id="cclear"><p>
|
||||||
|
|
||||||
@ -4062,6 +4043,28 @@ do), the function is rather useless.
|
|||||||
</quote>
|
</quote>
|
||||||
|
|
||||||
|
|
||||||
|
<sect1>kbrepeat<label id="kbrepeat"><p>
|
||||||
|
|
||||||
|
<quote>
|
||||||
|
<descrip>
|
||||||
|
<tag/Function/Set the keyboard repeat mode.
|
||||||
|
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
|
||||||
|
<tag/Declaration/<tt/unsigned char __fastcall__ kbrepeat (unsigned char mode);/
|
||||||
|
<tag/Description/This function changes which keys have automatic repeat when
|
||||||
|
being held down for a certain time. Possible values are <tt/KBREPEAT_CURSOR/
|
||||||
|
(repeat only cursor-related keys), <tt/KBREPEAT_NONE/ (no repeat for any
|
||||||
|
keys), and <tt/KBREPEAT_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/Example/None.
|
||||||
|
</descrip>
|
||||||
|
</quote>
|
||||||
|
|
||||||
|
|
||||||
<sect1>labs<label id="labs"><p>
|
<sect1>labs<label id="labs"><p>
|
||||||
|
|
||||||
<quote>
|
<quote>
|
||||||
|
@ -1,14 +1,29 @@
|
|||||||
;
|
;
|
||||||
; unsigned char __fastcall__ kbrepeat (unsigned char mode);
|
; unsigned char __fastcall__ kbrepeat (unsigned char mode);
|
||||||
|
;
|
||||||
|
; 2017-06-16, Groepaz
|
||||||
|
; 2017-09-05, Greg King
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _kbrepeat
|
.export _kbrepeat
|
||||||
|
|
||||||
.include "pet.inc"
|
.include "pet.inc"
|
||||||
|
|
||||||
_kbrepeat:
|
_kbrepeat:
|
||||||
ldx KBDREPEAT ; get old value
|
ldx #>$0000
|
||||||
sta KBDREPEAT ; store new value
|
ldy SCR_LINELEN
|
||||||
txa ; return old value
|
cpy #40 + 1
|
||||||
ldx #0
|
bcc L1 ; branch if screen is 40 columns wide
|
||||||
|
|
||||||
|
ldy KBDREPEAT80 ; get old value
|
||||||
|
sta KBDREPEAT80 ; store new value
|
||||||
|
tya ; return old value
|
||||||
|
rts
|
||||||
|
|
||||||
|
L1: tay
|
||||||
|
lda KBDREPEAT40B ; get REPEAT-key flag (used by some editor ROMs)
|
||||||
|
lsr a ; move bit 0 into bit 7
|
||||||
|
ror a
|
||||||
|
ora KBDREPEAT40 ; combine with old key-REPEAT flags
|
||||||
|
sty KBDREPEAT40
|
||||||
rts
|
rts
|
||||||
|
Loading…
x
Reference in New Issue
Block a user