From 85760e0c531d127f2a52e1d87a6f02214c98a5fd Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sun, 28 Feb 2016 22:13:05 +0100 Subject: [PATCH 1/8] initial import from old sources --- libsrc/c128/kbrepeat.s | 22 ++++++++++++++++++++++ libsrc/c64/kbrepeat.s | 22 ++++++++++++++++++++++ libsrc/pet/kbrepeat.s | 22 ++++++++++++++++++++++ libsrc/plus4/kbrepeat.s | 22 ++++++++++++++++++++++ libsrc/vic20/kbrepeat.s | 22 ++++++++++++++++++++++ 5 files changed, 110 insertions(+) create mode 100644 libsrc/c128/kbrepeat.s create mode 100644 libsrc/c64/kbrepeat.s create mode 100644 libsrc/pet/kbrepeat.s create mode 100644 libsrc/plus4/kbrepeat.s create mode 100644 libsrc/vic20/kbrepeat.s diff --git a/libsrc/c128/kbrepeat.s b/libsrc/c128/kbrepeat.s new file mode 100644 index 000000000..f515e4ca3 --- /dev/null +++ b/libsrc/c128/kbrepeat.s @@ -0,0 +1,22 @@ + + .export _kbrepeat, _kbrepeatdelay, _kbrepeatrate + + .include "c128/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 diff --git a/libsrc/c64/kbrepeat.s b/libsrc/c64/kbrepeat.s new file mode 100644 index 000000000..b6c33250b --- /dev/null +++ b/libsrc/c64/kbrepeat.s @@ -0,0 +1,22 @@ + + .export _kbrepeat, _kbrepeatdelay, _kbrepeatrate + + .include "c64/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 diff --git a/libsrc/pet/kbrepeat.s b/libsrc/pet/kbrepeat.s new file mode 100644 index 000000000..44d60575f --- /dev/null +++ b/libsrc/pet/kbrepeat.s @@ -0,0 +1,22 @@ + + .export _kbrepeat, _kbrepeatdelay, _kbrepeatrate + + .include "pet/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 diff --git a/libsrc/plus4/kbrepeat.s b/libsrc/plus4/kbrepeat.s new file mode 100644 index 000000000..8636d0e33 --- /dev/null +++ b/libsrc/plus4/kbrepeat.s @@ -0,0 +1,22 @@ + + .export _kbrepeat, _kbrepeatdelay, _kbrepeatrate + + .include "plus4/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 diff --git a/libsrc/vic20/kbrepeat.s b/libsrc/vic20/kbrepeat.s new file mode 100644 index 000000000..5a4ad96f6 --- /dev/null +++ b/libsrc/vic20/kbrepeat.s @@ -0,0 +1,22 @@ + + .export _kbrepeat, _kbrepeatdelay, _kbrepeatrate + + .include "vic20/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 From a42feca228d589e3d3ae3bb80da7c668c1db028f Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sat, 17 Jun 2017 02:37:34 +0200 Subject: [PATCH 2/8] fixed some stuff, compiles again :) --- asminc/c128.inc | 4 ++++ asminc/c64.inc | 3 +++ asminc/pet.inc | 5 +++++ asminc/plus4.inc | 5 +++++ asminc/vic20.inc | 3 +++ libsrc/c128/kbrepeat.s | 2 +- libsrc/c64/kbrepeat.s | 2 +- libsrc/pet/kbrepeat.s | 2 +- libsrc/plus4/kbrepeat.s | 2 +- libsrc/vic20/kbrepeat.s | 2 +- 10 files changed, 25 insertions(+), 5 deletions(-) diff --git a/asminc/c128.inc b/asminc/c128.inc index e6c89b07b..9e9acc5a8 100644 --- a/asminc/c128.inc +++ b/asminc/c128.inc @@ -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 diff --git a/asminc/c64.inc b/asminc/c64.inc index ababb1ea0..00b66a64f 100644 --- a/asminc/c64.inc +++ b/asminc/c64.inc @@ -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 diff --git a/asminc/pet.inc b/asminc/pet.inc index a745a89c8..ea6eef2e0 100644 --- a/asminc/pet.inc +++ b/asminc/pet.inc @@ -31,6 +31,11 @@ BASIC_BUF_LEN = 81 ; Maximum length of command-line KEY_BUF := $26F ; Keyboard buffer +;FIXME: these are wrong? +KBDREPEAT := $28a +KBDREPEATRATE := $28b +KBDREPEATDELAY := $28c + ;---------------------------------------------------------------------------- ; PET ROM type detection diff --git a/asminc/plus4.inc b/asminc/plus4.inc index 69b2298a3..42ed314bd 100644 --- a/asminc/plus4.inc +++ b/asminc/plus4.inc @@ -33,6 +33,11 @@ FKEY_COUNT := $55D ; Characters for function key FKEY_SPACE := $55F ; Function key definitions FKEY_ORIG := $F3D2 ; Original definitions +;FIXME: he?! these ok? :o) +KBDREPEAT := $28a +KBDREPEATRATE := $28b +KBDREPEATDELAY := $28c + ; --------------------------------------------------------------------------- ; Kernal routines diff --git a/asminc/vic20.inc b/asminc/vic20.inc index 12424dc11..d882eb1ad 100644 --- a/asminc/vic20.inc +++ b/asminc/vic20.inc @@ -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 diff --git a/libsrc/c128/kbrepeat.s b/libsrc/c128/kbrepeat.s index f515e4ca3..c32e8c017 100644 --- a/libsrc/c128/kbrepeat.s +++ b/libsrc/c128/kbrepeat.s @@ -1,7 +1,7 @@ .export _kbrepeat, _kbrepeatdelay, _kbrepeatrate - .include "c128/c128.inc" + .include "c128.inc" _kbrepeat: ldx KBDREPEAT ; get old value diff --git a/libsrc/c64/kbrepeat.s b/libsrc/c64/kbrepeat.s index b6c33250b..f59c8a6da 100644 --- a/libsrc/c64/kbrepeat.s +++ b/libsrc/c64/kbrepeat.s @@ -1,7 +1,7 @@ .export _kbrepeat, _kbrepeatdelay, _kbrepeatrate - .include "c64/c64.inc" + .include "c64.inc" _kbrepeat: ldx KBDREPEAT ; get old value diff --git a/libsrc/pet/kbrepeat.s b/libsrc/pet/kbrepeat.s index 44d60575f..0a29d7420 100644 --- a/libsrc/pet/kbrepeat.s +++ b/libsrc/pet/kbrepeat.s @@ -1,7 +1,7 @@ .export _kbrepeat, _kbrepeatdelay, _kbrepeatrate - .include "pet/pet.inc" + .include "pet.inc" _kbrepeat: ldx KBDREPEAT ; get old value diff --git a/libsrc/plus4/kbrepeat.s b/libsrc/plus4/kbrepeat.s index 8636d0e33..927b99e5b 100644 --- a/libsrc/plus4/kbrepeat.s +++ b/libsrc/plus4/kbrepeat.s @@ -1,7 +1,7 @@ .export _kbrepeat, _kbrepeatdelay, _kbrepeatrate - .include "plus4/plus4.inc" + .include "plus4.inc" _kbrepeat: ldx KBDREPEAT ; get old value diff --git a/libsrc/vic20/kbrepeat.s b/libsrc/vic20/kbrepeat.s index 5a4ad96f6..5115c852e 100644 --- a/libsrc/vic20/kbrepeat.s +++ b/libsrc/vic20/kbrepeat.s @@ -1,7 +1,7 @@ .export _kbrepeat, _kbrepeatdelay, _kbrepeatrate - .include "vic20/vic20.inc" + .include "vic20.inc" _kbrepeat: ldx KBDREPEAT ; get old value From e985e0beb424f0146c1755aa8d7a310ebb90783b Mon Sep 17 00:00:00 2001 From: mrdudz Date: Thu, 22 Jun 2017 00:04:42 +0200 Subject: [PATCH 3/8] fixed zp locations provided by polluks :) --- asminc/pet.inc | 15 +++++++++++---- asminc/plus4.inc | 7 +++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/asminc/pet.inc b/asminc/pet.inc index ea6eef2e0..8f2f469e0 100644 --- a/asminc/pet.inc +++ b/asminc/pet.inc @@ -31,10 +31,17 @@ BASIC_BUF_LEN = 81 ; Maximum length of command-line KEY_BUF := $26F ; Keyboard buffer -;FIXME: these are wrong? -KBDREPEAT := $28a -KBDREPEATRATE := $28b -KBDREPEATDELAY := $28c +;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 diff --git a/asminc/plus4.inc b/asminc/plus4.inc index 42ed314bd..3b2f08c54 100644 --- a/asminc/plus4.inc +++ b/asminc/plus4.inc @@ -33,10 +33,9 @@ FKEY_COUNT := $55D ; Characters for function key FKEY_SPACE := $55F ; Function key definitions FKEY_ORIG := $F3D2 ; Original definitions -;FIXME: he?! these ok? :o) -KBDREPEAT := $28a -KBDREPEATRATE := $28b -KBDREPEATDELAY := $28c +KBDREPEAT := $540 +KBDREPEATRATE := $541 +KBDREPEATDELAY := $542 ; --------------------------------------------------------------------------- ; Kernal routines From bd9208879e723cc663f67559b54d1cb50dd6fa91 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sun, 6 Aug 2017 18:09:40 +0200 Subject: [PATCH 4/8] added prototypes and proposed constants --- include/cbm.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/cbm.h b/include/cbm.h index 701924d57..5bb860e4f 100644 --- a/include/cbm.h +++ b/include/cbm.h @@ -153,7 +153,13 @@ 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 kbrepeat(unsigned char); +unsigned char kbrepeatdelay(unsigned char); +unsigned char kbrepeatrate(unsigned char); /*****************************************************************************/ /* CBM kernal functions */ From dafe3c1e3cc3316ff187e4adfd756097865d2ae4 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sun, 6 Aug 2017 20:15:35 +0200 Subject: [PATCH 5/8] added documentation for the kbrepeat... functions --- doc/funcref.sgml | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/doc/funcref.sgml b/doc/funcref.sgml index a2ccf6c73..d7c477958 100644 --- a/doc/funcref.sgml +++ b/doc/funcref.sgml @@ -179,6 +179,9 @@ function. + + + (incomplete) @@ -2063,6 +2066,70 @@ to get off the serial bus so it can be used for other purposes. +kbrepeat