diff --git a/README.md b/README.md index 25f16f6f..dbfe2bfb 100644 --- a/README.md +++ b/README.md @@ -129,9 +129,9 @@ This is a major update with new features and bug fixes. This ROM requires a matc 4. `joystick_ps2_keycodes` can remap the keyboard joystick 5. `iso_cursor_char` sets the blinking cursor screen code to a character other than $9F while in ISO mode. 6. `ps2kbd_typematic` sets the keyboard repeat delay and repeat rate. + 7. `pfkey`, similar to the C128 `PFKEY` API call. Within the KERNAL screen editor, the actions of the function keys F1-F8, as well as the SHIFT+RUN action can be changed. * Solved a race in kbd_scan if a KERNAL call was in progress was interrupted by the default ISR. * Removed support for preserving state in the KERNAL ISR for VERA 0.1.1. VERA 0.3.1 is the new minimum version. - * Implemented the C128 `PFKEY` API call. Within the KERNAL screen editor, the actions of the function keys F1-F8, as well as the SHIFT+RUN action can be changed. * DOS * Implemented turning on ___experimental___ fast reads (auto_tx) and writes for SD card accesses, implemented via the channel 15 command `"U0>Bn"` where `n` is a value from 0 to 3. * 0 = Turn off fast reads/writes diff --git a/inc/kernal.inc b/inc/kernal.inc index abf3de2a..f16760c0 100644 --- a/inc/kernal.inc +++ b/inc/kernal.inc @@ -51,7 +51,7 @@ lkupla = $ff59 lkupsa = $ff5c screen_mode = $ff5f ; old name: swapper screen_set_charset = $ff62 ; old name: dlchr -pfkey = $ff65 +;pfkey = $ff65 ; moved to extapi slot 7 jsrfar = $ff6e fetch = $ff74 stash = $ff77 diff --git a/kernal/cbm/editor.s b/kernal/cbm/editor.s index 5fe1b726..6f7a5d0a 100644 --- a/kernal/cbm/editor.s +++ b/kernal/cbm/editor.s @@ -33,6 +33,7 @@ MODIFIER_4080 = 32 MODIFIER_SHIFT = 1 .include "io.inc" +.include "regs.inc" ; kernal .export crsw @@ -1333,23 +1334,13 @@ iso_cursor_char: rts pfkey: - KVARS_START + KVARS_START_TRASH_A_NZ cpy #11 ; max length is 10 characters bcs @error dex ; input shuld be 1-9, shifted to 0-8 cpx #9 ; max keynum is 9 (shifted to 8) bcs @error - phy ; preserve Y (length) - phx ; preserve X (keynum) - tax ; pointer is in ZP - ; get pointer out of arbitrary ZP into kernal ZP - lda 0,x - sta tmp2 - lda 1,x - sta tmp2+1 - ; convert key number to offset into table - ; multiply X by 11 - plx ; restore X (keynum) + txa beq @found clc lda #0 @@ -1358,14 +1349,14 @@ pfkey: bne :- tax @found: - ply ; restore Y (length) + tya beq @terminate @loop: - lda (tmp2) + lda (r0) sta fkeytb,x - inc tmp2 + inc r0L bne :+ - inc tmp2+1 + inc r0H : inx dey bne @loop @@ -1378,7 +1369,7 @@ pfkey: @error: sec @end: - KVARS_END + KVARS_END_TRASH_A_NZ rts set_fkey_defaults: diff --git a/kernal/vectors.s b/kernal/vectors.s index 74e5daec..63627348 100644 --- a/kernal/vectors.s +++ b/kernal/vectors.s @@ -124,7 +124,7 @@ jmp lkupsa ; $FF5C: [C128] LKUPSA - look up secondary address jmp screen_mode ; $FF5F: screen_mode - get/set screen mode [unsupported C128: SWAPPER] jmp screen_set_charset ; $FF62: activate 8x8 text mode charset [incompatible with C128: DLCHR – init 80-col character RAM] - jmp pfkey ; $FF65: [C128] PFKEY – program a function key + .byte 0, 0, 0 ; $FF65: [C128] PFKEY – X16 implementation in extapi slot #7 jmp mouse_config ; $FF68: mouse_config - configure mouse pointer [unsupported C128: SETBNK – set bank for I/O operations] jmp mouse_get ; $FF6B: mouse_get - get state of mouse [unsupported C128: GETCFG – lookup MMU data for given bank] jmp jsrfar ; $FF6E: [C128] JSRFAR – gosub in another bank [incompatible with C128] diff --git a/kernal/x16/extapi.s b/kernal/x16/extapi.s index 257b5d98..45730ab6 100644 --- a/kernal/x16/extapi.s +++ b/kernal/x16/extapi.s @@ -4,6 +4,7 @@ .import joystick_ps2_keycodes .import iso_cursor_char .import ps2kbd_typematic +.import pfkey .export extapi @@ -41,3 +42,4 @@ apitbl: .word joystick_ps2_keycodes-1 ; API 4 .word iso_cursor_char-1 ; API 5 .word ps2kbd_typematic-1 ; API 6 + .word pfkey-1 ; API 7 diff --git a/kernsup/kernsup.inc b/kernsup/kernsup.inc index 9849d531..1bf644d3 100644 --- a/kernsup/kernsup.inc +++ b/kernsup/kernsup.inc @@ -70,7 +70,7 @@ bridge lkupla ; $FF59: LKUPLA bridge lkupsa ; $FF5C: LKUPSA bridge screen_mode ; $FF5F: get/set screen mode bridge screen_set_charset ; $FF62: activate 8x8 text mode charset -bridge pfkey ; $FF65: PFKEY – program a function key +.byte 0, 0, 0 ; $FF65: bridge mouse_config ; $FF68: mouse_config bridge mouse_get ; $FF6B: mouse_get jmp xjsrfar ; $FF6E: JSRFAR – gosub in another bank