diff --git a/src/aliases/,aliases_hardware_m65.s b/src/aliases/,aliases_hardware_m65.s index 14e33cc4..6202f37d 100644 --- a/src/aliases/,aliases_hardware_m65.s +++ b/src/aliases/,aliases_hardware_m65.s @@ -16,6 +16,8 @@ .label VIC_XPOS = $D050 + .label VIC_CTRLC = $D054 + .label VIC_CHARSTEP = $D058 // 2 bytes - logical characters per line .label VIC_SCRNPTR = $D060 // 4 bytes - pointer to start of screen memory diff --git a/src/aliases/,aliases_petscii_codes.s b/src/aliases/,aliases_petscii_codes.s index 0156cfff..6cb39b13 100644 --- a/src/aliases/,aliases_petscii_codes.s +++ b/src/aliases/,aliases_petscii_codes.s @@ -25,27 +25,35 @@ .const KEY_FLAG_NO_SCRL = %00100000 // Open ROMs unofficial #endif -// Note - the following PETSCII codes are currently unassigned, can be used for further extensions: -// -// $01, $02, $04, $06, $0A, $0B, $0C, $0F, $18, $82 +// Note - the following PETSCII codes are currently unassigned, can be used for further extensions: $01, $04, $06, ($80 ?) .const KEY_NA = $00 // to indicate that no key is presed + // PETSCII codes for our extended screen editor -.const KEY_TAB_FW = $8F // CTRL+>, TAB - Open ROMs unofficial, original TAB conflicts with C64 PETSCII -.const KEY_TAB_BW = $80 // CTRL+<, SHIFT+TAB - Open ROMs unofficial, original TAB conflicts with C64 PETSCII +.const KEY_C64_TAB_FW = $8F // CTRL+>, TAB - Open ROMs unofficial, original TAB conflicts with C64 PETSCII, XXX remove? +.const KEY_C64_TAB_BW = $80 // CTRL+<, SHIFT+TAB - Open ROMs unofficial, original TAB conflicts with C64 PETSCII, XXX remove? // PETSCII codes for certain C128 and C65 functionalities #if CONFIG_KEYBOARD_C128 || CONFIG_KEYBOARD_C65 -.const KEY_BELL = $07 // no key, originally CTRL+G // XXX implement BELL +.const KEY_BELL = $07 // no key, originally CTRL+G // XXX implement, add to C65 keyboard matrix .const KEY_ESC = $1B #endif +#if CONFIG_KEYBOARD_C65 +.const KEY_TAB = $09 // XXX add to C65 keyboard matrix +.const KEY_LINE_FEED = $0A // XXX add to C65 keyboard matrix +.const KEY_TAB_SET_CLR = $18 // XXX add to C65 keyboard matrix +.const KEY_UNDERLINE_ON = $02 // XXX add to C65 keyboard matrix +.const KEY_UNDERLINE_OFF = $82 // XXX add to C65 keyboard matrix +.const KEY_FLASHING_ON = $0F // XXX add to C65 keyboard matrix +.const KEY_FLASHING_OFF = $8F // XXX add to C65 keyboard matrix +#endif // PETSCII codes for programmable keys @@ -71,7 +79,7 @@ #endif #if CONFIG_KEYBOARD_C128 || CONFIG_KEYBOARD_C65 -.const KEY_HELP = $84 // normally C65 only, also used for our C128 support +.const KEY_HELP = $84 #endif @@ -109,10 +117,14 @@ // PETSCII codes for case toggle -.const KEY_SHIFT_ON = $09 // no key -.const KEY_SHIFT_OFF = $08 // no key -.const KEY_TXT = $0E // no key -.const KEY_GFX = $8E // no key +.const KEY_C64_SHIFT_ON = $09 // no key +.const KEY_C64_SHIFT_OFF = $08 // no key +#if CONFIG_KEYBOARD_C65 +.const KEY_C65_SHIFT_OFF = $0B // no key +.const KEY_C65_SHIFT_ON = $0C // no key +#endif +.const KEY_TXT = $0E // no key +.const KEY_GFX = $8E // no key // PETSCII codes for other non-printable characters diff --git a/src/kernal/extapi_m65/mega65_mode65.s b/src/kernal/extapi_m65/mega65_mode65.s index 57eb1700..dc6c8207 100644 --- a/src/kernal/extapi_m65/mega65_mode65.s +++ b/src/kernal/extapi_m65/mega65_mode65.s @@ -37,7 +37,9 @@ M65_MODE65: lda %01000000 // enable C65 character set sta VIC_CTRLA - // XXX + // XXX enable 48 MHz mode in VIC_CTRLC + + // XXX posibly alter other settings // Set screen mode to 80x25 diff --git a/src/kernal/keyboard/kb_matrix.s b/src/kernal/keyboard/kb_matrix.s index e194bd95..97a836e2 100644 --- a/src/kernal/keyboard/kb_matrix.s +++ b/src/kernal/keyboard/kb_matrix.s @@ -56,7 +56,7 @@ __kb_matrix_ctrl: .byte $1F,$19,$07,$9E,$02,$08,$15,$16 .byte $12,$09,$0A,$92,$0D,$0B,$0F,$0E #if CONFIG_EDIT_TABULATORS - .byte $00,$10,$0C,$00,KEY_TAB_FW,$1B,$00,KEY_TAB_BW + .byte $00,$10,$0C,$00,KEY_C64_TAB_FW,$1B,$00,KEY_C64_TAB_BW #else .byte $00,$10,$0C,$00,$00,$1B,$00,$00 #endif diff --git a/src/kernal/keyboard/kb_matrix_128.s b/src/kernal/keyboard/kb_matrix_128.s index d6323ba6..e93d0ec9 100644 --- a/src/kernal/keyboard/kb_matrix_128.s +++ b/src/kernal/keyboard/kb_matrix_128.s @@ -16,7 +16,7 @@ kb_matrix_128: - .byte KEY_HELP,$38,$35,KEY_TAB_FW,$32,$34,$37,$31 + .byte KEY_HELP,$38,$35,KEY_C64_TAB_FW,$32,$34,$37,$31 .byte KEY_ESC,$2B,$2D,$8D,$0D,$36,$39,$33 .byte $00,$30,$2E,$91,$11,$9D,$1D,$00 diff --git a/src/kernal/keyboard/kb_matrix_65.s b/src/kernal/keyboard/kb_matrix_65.s index a7cd89f5..c20831b3 100644 --- a/src/kernal/keyboard/kb_matrix_65.s +++ b/src/kernal/keyboard/kb_matrix_65.s @@ -15,11 +15,11 @@ kb_matrix_65: - .byte $00, KEY_TAB_FW, $00, KEY_HELP, KEY_F9, KEY_F11, KEY_F13, KEY_ESC + .byte $00, KEY_C64_TAB_FW, $00, KEY_HELP, KEY_F9, KEY_F11, KEY_F13, KEY_ESC kb_matrix_65_shifted: - .byte $00, KEY_TAB_BW, $00, KEY_HELP, KEY_F10, KEY_F12, KEY_F14, KEY_ESC + .byte $00, KEY_C64_TAB_BW, $00, KEY_HELP, KEY_F10, KEY_F12, KEY_F14, KEY_ESC #endif // CONFIG_KEYBOARD_C65 and no CONFIG_LEGACY_SCNKEY diff --git a/src/kernal/keyboard/scnkey.s b/src/kernal/keyboard/scnkey.s index d6080c78..ac43679c 100644 --- a/src/kernal/keyboard/scnkey.s +++ b/src/kernal/keyboard/scnkey.s @@ -428,12 +428,12 @@ scnkey_got_petscii: // Special handling for SHIFT+TAB; it is easier than creating new matrix tax - cmp #KEY_TAB_FW + cmp #KEY_C64_TAB_FW bne !+ lda SHFLAG and #KEY_FLAG_SHIFT beq !+ - ldx #KEY_TAB_BW + ldx #KEY_C64_TAB_BW !: txa diff --git a/src/kernal/screen/chrout_screen_jumptable_codes.s b/src/kernal/screen/chrout_screen_jumptable_codes.s index 07d30cd4..4299d42a 100644 --- a/src/kernal/screen/chrout_screen_jumptable_codes.s +++ b/src/kernal/screen/chrout_screen_jumptable_codes.s @@ -13,8 +13,8 @@ chrout_screen_jumptable_codes: .byte KEY_CLR .byte KEY_HOME - .byte KEY_SHIFT_OFF - .byte KEY_SHIFT_ON + .byte KEY_C64_SHIFT_OFF + .byte KEY_C64_SHIFT_ON .byte KEY_TXT .byte KEY_GFX .byte KEY_RVS_OFF @@ -31,8 +31,8 @@ __chrout_screen_jumptable_quote_guard: .byte KEY_STOP #endif #if CONFIG_EDIT_TABULATORS - .byte KEY_TAB_BW - .byte KEY_TAB_FW + .byte KEY_C64_TAB_BW + .byte KEY_C64_TAB_FW #endif .byte KEY_DEL .byte KEY_RETURN diff --git a/src/kernal/screen_m65/mega65_screen_tables.s b/src/kernal/screen_m65/mega65_screen_tables.s index 7055d533..9978b9e1 100644 --- a/src/kernal/screen_m65/mega65_screen_tables.s +++ b/src/kernal/screen_m65/mega65_screen_tables.s @@ -46,4 +46,40 @@ m65_scrtab_rowoffset_hi: // row offsets - high bytes .byte >(80 * 10), >(80 * 11), >(80 * 12), >(80 * 13), >(80 * 14), >(80 * 15), >(80 * 16), >(80 * 17), >(80 * 18), >(80 * 19) .byte >(80 * 20), >(80 * 21), >(80 * 22), >(80 * 23), >(80 * 24), >(80 * 25), >(80 * 26), >(80 * 27), >(80 * 28), >(80 * 29) .byte >(80 * 30), >(80 * 31), >(80 * 32), >(80 * 33), >(80 * 34), >(80 * 35), >(80 * 36), >(80 * 37), >(80 * 38), >(80 * 39) - .byte >(80 * 40), >(80 * 41), >(80 * 42), >(80 * 43), >(80 * 44), >(80 * 45), >(80 * 46), >(80 * 47), >(80 * 48), >(80 * 49) \ No newline at end of file + .byte >(80 * 40), >(80 * 41), >(80 * 42), >(80 * 43), >(80 * 44), >(80 * 45), >(80 * 46), >(80 * 47), >(80 * 48), >(80 * 49) + +// Jumptable for screen control codes support. To improve performance, should be sorted +// starting from the least probable routine. + +m65_chrout_screen_jumptable_codes: + + .byte KEY_CLR + .byte KEY_HOME + .byte KEY_C65_SHIFT_OFF + .byte KEY_C65_SHIFT_ON + .byte KEY_TXT + .byte KEY_GFX + .byte KEY_RVS_OFF + .byte KEY_RVS_ON + .byte KEY_CRSR_RIGHT + .byte KEY_CRSR_LEFT + .byte KEY_CRSR_DOWN + .byte KEY_CRSR_UP + .byte KEY_INS + .byte KEY_TAB + .byte KEY_LINE_FEED + .byte KEY_UNDERLINE_ON + .byte KEY_UNDERLINE_OFF + .byte KEY_FLASHING_ON + .byte KEY_FLASHING_OFF + .byte KEY_TAB_SET_CLR + .byte KEY_ESC + .byte KEY_BELL + +__m65_chrout_screen_jumptable_quote_guard: + + .byte KEY_STOP + .byte KEY_DEL + .byte KEY_RETURN + +__m65_chrout_screen_jumptable_codes_end: diff --git a/src/kernal/screen_m65/mega65_scrmodeset.s b/src/kernal/screen_m65/mega65_scrmodeset.s index 27879d87..3d8278cd 100644 --- a/src/kernal/screen_m65/mega65_scrmodeset.s +++ b/src/kernal/screen_m65/mega65_scrmodeset.s @@ -52,9 +52,9 @@ m65_scrmodeset_internal: // entry point for M65_MODE65 // Set the logical row length to 80 ldx #$50 - stx VIC_CHARSTEP+0 + // stx VIC_CHARSTEP+0 ldx #$00 - stx VIC_CHARSTEP+1 + // stx VIC_CHARSTEP+1 // Set the following locations: // - M64_SCRWINMODE - for scroll-console mode