finished the new keyboard scanning routine
This commit is contained in:
1 parent
5dedf1314e
commit
470c4bded6
8 files changed
+78
-36
No files matched your search
@@ -105,6 +105,46 @@ Cause the system to support SIDs in `$D4xx` and `$D5xx` ranges, respectively.
|
|||||||
|
|
||||||
Each of them needs a couple of bytes in KERNAL segment - but they can share some code, and `$D4xx` range support replaces the standard `$D400` address handling, so exact amount depends on the exact configuration.
|
Each of them needs a couple of bytes in KERNAL segment - but they can share some code, and `$D4xx` range support replaces the standard `$D400` address handling, so exact amount depends on the exact configuration.
|
||||||
|
|
||||||
|
## Keyboard
|
||||||
|
|
||||||
|
Original keyboard support routine is just horrible. It does nothing to prevent ghosting - press A+S+D at the same time - it prints F. Try to use joystick connected to control port 1 - it outputs phantom characters. The Open ROMs provides much more sophisticated routines to prevent such problems.
|
||||||
|
|
||||||
|
### `CONFIG_LEGACY_SCNKEY`
|
||||||
|
|
||||||
|
Uses old Open ROMs keyboard scanning routine, which is basically example routine by TWW/CTR, hacked to work within Kernal. It's greatest advantage is multi-key rollover, it's disadvantages - it's much less compatible (uses several bytes of memory which are normally free for user software - thus, it is considered legacy for now), does not support all the system variables (`RPTFLG` and `KEYLOG` are unsupported), and ignores the configuration options - this can be changed, but it requires some effort.
|
||||||
|
|
||||||
|
Needs 70-250 more space in KERNAL segment (depending on the features enabled for current default routine). If unsure - disable.
|
||||||
|
|
||||||
|
### `CONFIG_KEYBOARD_C128`
|
||||||
|
|
||||||
|
Allows to use additional keys found on the C128 keyboard.
|
||||||
|
|
||||||
|
Needs 128 bytes more space in KERNAL segment. If unsure - disable.
|
||||||
|
|
||||||
|
### `CONFIG_KEY_REPEAT_DEFAULT`
|
||||||
|
|
||||||
|
Enables key repetition by default during the startup (sets `RPTFLG`).
|
||||||
|
|
||||||
|
Needs 5 bytes more space in KERNAL segment.
|
||||||
|
|
||||||
|
### `CONFIG_KEY_REPEAT_ALWAYS`
|
||||||
|
|
||||||
|
Enables the key repetition and ignores `RPTFLG`.
|
||||||
|
|
||||||
|
Saves 22 bytes from KERNAL segment.
|
||||||
|
|
||||||
|
### `CONFIG_KEY_FAST_SCAN`
|
||||||
|
|
||||||
|
Performs somee speed optimizations in the keyboard scanning routine, at the eexpense of some more ROM space.
|
||||||
|
|
||||||
|
Needs 13 bytes more space in KERNAL segment. Only disable if you are running out of ROM space.
|
||||||
|
|
||||||
|
### `CONFIG_JOY1_CURSOR` and `CONFIG_JOY2_CURSOR`
|
||||||
|
|
||||||
|
Joystick movement also moves the cursor.
|
||||||
|
|
||||||
|
Needs about 65 bytes of ROM space to handle both joysticks.
|
||||||
|
|
||||||
## Eye candy
|
## Eye candy
|
||||||
|
|
||||||
### `CONFIG_BANNER_SIMPLE`, `CONFIG_BANNER_FANCY`, `CONFIG_BANNER_VARIANT`
|
### `CONFIG_BANNER_SIMPLE`, `CONFIG_BANNER_FANCY`, `CONFIG_BANNER_VARIANT`
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
Here are the features of the Open ROMs not found in the original ROMs from the 80s (many of them are [configurable](CONFIG.md)):
|
Here are the features of the Open ROMs not found in the original ROMs from the 80s (many of them are [configurable](CONFIG.md)):
|
||||||
|
|
||||||
* improved keyboard scanning, supports multi-key roll-over and rejection of spurious joystick input
|
* improved keyboard scanning, supports anti-ghosting and is resistant to joystick interference (one variant even supports multi-keyy rollover)
|
||||||
* joystick (port 1) can be used to move text cursor
|
* joystick can be used to move text cursor
|
||||||
* uses RAM under ROM and I/O: 61438 bytes free
|
* uses RAM under ROM and I/O: 61438 bytes free
|
||||||
* cold/warm start silences multiple SID chips - all $D4xx and $D5xx addresses
|
* cold/warm start silences multiple SID chips - all $D4xx and $D5xx addresses
|
||||||
* wark start due to BRK prints out the instruction address
|
* wark start due to BRK prints out the instruction address
|
||||||
|
|||||||
@@ -48,13 +48,13 @@
|
|||||||
// Keyboard settings
|
// Keyboard settings
|
||||||
|
|
||||||
|
|
||||||
// #define CONFIG_LEGACY_SCNKEY // XXX document this
|
// #define CONFIG_LEGACY_SCNKEY
|
||||||
#define CONFIG_KEYBOARD_C128 // XXX document this
|
#define CONFIG_KEYBOARD_C128
|
||||||
// #define CONFIG_KEY_REPEAT_DEFAULT // XXX document this
|
// #define CONFIG_KEY_REPEAT_DEFAULT
|
||||||
// #define CONFIG_KEY_REPEAT_ALWAYS // XXX document this
|
// #define CONFIG_KEY_REPEAT_ALWAYS
|
||||||
#define CONFIG_KEY_FAST_SCAN // XXX document this
|
#define CONFIG_KEY_FAST_SCAN
|
||||||
#define CONFIG_JOY1_CURSOR // XXX document this
|
#define CONFIG_JOY1_CURSOR
|
||||||
#define CONFIG_JOY2_CURSOR // XXX document this
|
// #define CONFIG_JOY2_CURSOR
|
||||||
|
|
||||||
|
|
||||||
// Eye candy
|
// Eye candy
|
||||||
|
|||||||
@@ -50,13 +50,13 @@
|
|||||||
// Keyboard settings
|
// Keyboard settings
|
||||||
|
|
||||||
|
|
||||||
#define CONFIG_LEGACY_SCNKEY // XXX document this
|
#define CONFIG_LEGACY_SCNKEY
|
||||||
// #define CONFIG_KEYBOARD_C128 // XXX document this
|
// #define CONFIG_KEYBOARD_C128
|
||||||
// #define CONFIG_KEY_REPEAT_DEFAULT // XXX document this
|
// #define CONFIG_KEY_REPEAT_DEFAULT
|
||||||
// #define CONFIG_KEY_REPEAT_ALWAYS // XXX document this
|
// #define CONFIG_KEY_REPEAT_ALWAYS
|
||||||
#define CONFIG_KEY_FAST_SCAN // XXX document this
|
#define CONFIG_KEY_FAST_SCAN
|
||||||
#define CONFIG_JOY1_CURSOR // XXX document this
|
#define CONFIG_JOY1_CURSOR
|
||||||
#define CONFIG_JOY2_CURSOR // XXX document this
|
#define CONFIG_JOY2_CURSOR
|
||||||
|
|
||||||
|
|
||||||
// Eye candy
|
// Eye candy
|
||||||
|
|||||||
@@ -48,13 +48,13 @@
|
|||||||
// Keyboard settings
|
// Keyboard settings
|
||||||
|
|
||||||
|
|
||||||
// #define CONFIG_LEGACY_SCNKEY // XXX document this
|
// #define CONFIG_LEGACY_SCNKEY
|
||||||
// #define CONFIG_KEYBOARD_C128 // XXX document this
|
// #define CONFIG_KEYBOARD_C128
|
||||||
// #define CONFIG_KEY_REPEAT_DEFAULT // XXX document this
|
// #define CONFIG_KEY_REPEAT_DEFAULT
|
||||||
// #define CONFIG_KEY_REPEAT_ALWAYS // XXX document this
|
// #define CONFIG_KEY_REPEAT_ALWAYS
|
||||||
#define CONFIG_KEY_FAST_SCAN // XXX document this
|
#define CONFIG_KEY_FAST_SCAN
|
||||||
#define CONFIG_JOY1_CURSOR // XXX document this
|
#define CONFIG_JOY1_CURSOR
|
||||||
#define CONFIG_JOY2_CURSOR // XXX document this
|
#define CONFIG_JOY2_CURSOR
|
||||||
|
|
||||||
|
|
||||||
// Eye candy
|
// Eye candy
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#if CONFIG_KEYBOARD_C128
|
#if CONFIG_KEYBOARD_C128 && !CONFIG_LEGACY_SCNKEY
|
||||||
|
|
||||||
|
|
||||||
kb_matrix_128:
|
kb_matrix_128:
|
||||||
@@ -27,4 +27,4 @@ kb_matrix_128_bucky_filter:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // CONFIG_KEYBOARD_C128
|
#endif // CONFIG_KEYBOARD_C128 and no CONFIG_LEGACY_SCNKEY
|
||||||
@@ -273,15 +273,17 @@ scnkey_output_key:
|
|||||||
!:
|
!:
|
||||||
|
|
||||||
lda kb_matrix_128 - $40, y // retrieve key code from C128 extended matrix
|
lda kb_matrix_128 - $40, y // retrieve key code from C128 extended matrix
|
||||||
cmp KEY_TAB_FW // special handling for SHIFT+TAB
|
|
||||||
bne scnkey_got_petscii
|
// XXX this will be needed for extended screen editor
|
||||||
lda SHFLAG // special handling for SHIFT+TAB
|
// cmp KEY_TAB_FW // special handling for SHIFT+TAB
|
||||||
and #KEY_FLAG_SHIFT
|
// bne scnkey_got_petscii
|
||||||
bne !+
|
// lda SHFLAG // special handling for SHIFT+TAB
|
||||||
lda KEY_TAB_FW
|
// and #KEY_FLAG_SHIFT
|
||||||
bne scnkey_got_petscii // branch alWAYS
|
// bne !+
|
||||||
!:
|
// lda KEY_TAB_FW
|
||||||
lda KEY_TAB_BW
|
// bne scnkey_got_petscii // branch alWAYS
|
||||||
|
// !:
|
||||||
|
// lda KEY_TAB_BW
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#if CONFIG_KEYBOARD_C128
|
#if CONFIG_KEYBOARD_C128 && !CONFIG_LEGACY_SCNKEY
|
||||||
|
|
||||||
|
|
||||||
// Inlining this within SCNKEY would both overcomplicate the implementation
|
// Inlining this within SCNKEY would both overcomplicate the implementation
|
||||||
@@ -74,4 +74,4 @@ scnkey_128_no_keys:
|
|||||||
jmp scnkey_no_keys // pass controll to original routine
|
jmp scnkey_no_keys // pass controll to original routine
|
||||||
|
|
||||||
|
|
||||||
#endif // CONFIG_KEYBOARD_C128
|
#endif // CONFIG_KEYBOARD_C128 and no CONFIG_LEGACY_SCNKEY
|
||||||
Reference in new issue
Block a user