some work towards extra keys support in MEGA65 mode

This commit is contained in:
FeralChild64 committed 2020-08-20 21:51:38 +02:00
1 parent 8b6b470417
commit e32b3651d2
10 files changed
+77 -25

No files matched your search

+2
View File
@@ -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
+23 -11
View File
@@ -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
+3 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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
@@ -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
+37 -1
View File
@@ -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)
.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:
+2 -2
View File
@@ -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