moved new MEGA65 keyboard handler to separate ROM segment

This commit is contained in:
FeralChild64 committed 2020-11-29 23:14:52 +01:00
1 parent 2a77b90b40
commit a6831d7619
5 files changed
+41 -3

No files matched your search

@@ -17,5 +17,5 @@
; Vector table (Open ROMs private!)
!word $0000
!word m65_scnkey
}
+13
View File
@@ -0,0 +1,13 @@
;; #LAYOUT# M65 KERNAL_C #TAKE
;; #LAYOUT# * * #IGNORE
;; #IMPORT# KERNAL_0 = KERNAL_0_combined.sym
;
; Definitions for calling MEGA65 segment KERNAL_0 routines from KERNAL_C
;
;; #ALIAS# m65_scnkey_init_pressed = KERNAL_0.m65_scnkey_init_pressed
;; #ALIAS# scnkey_buffer_full = KERNAL_0.scnkey_buffer_full
;; #ALIAS# kb_matrix_bucky_shflag = KERNAL_0.kb_matrix_bucky_shflag
;; #ALIAS# __kb_matrix_normal = KERNAL_0.__kb_matrix_normal
+22 -1
View File
@@ -37,7 +37,28 @@ SCNKEY:
!ifdef CONFIG_MB_M65 { !ifdef CONFIG_M65_KB_DEV {
jsr M65_MODEGET
+bcc m65_scnkey
bcs scnkey_legacy_mode
; Map KERNAL_C segment
lda VIC_CTRLA
pha
ora #%00100000
sta VIC_CTRLA
; Call the native mode routine
jsr (VKC__m65_scnkey)
; Restore mapping and quit
pla
sta VIC_CTRLA
rts
scnkey_legacy_mode:
} }
; Prepare for SHFLAG update
+5 -1
View File
@@ -1,4 +1,4 @@
;; #LAYOUT# M65 KERNAL_0 #TAKE
;; #LAYOUT# M65 KERNAL_C #TAKE
;; #LAYOUT# * * #IGNORE
@@ -127,6 +127,8 @@ m65_scnkey_next_1:
dex
bpl m65_scnkey_loop_1
rts
;
; Analyze currently and previously pressed keys
;
@@ -156,6 +158,8 @@ m65_scnkey_output_key:
; Put the key into the keyboard buffer
inc $D020
tya
ldy NDX
sta KEYD, y