From e9dd7ad7bc8e67719c6786ad49f6fecdb434d08c Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 11 Oct 2019 18:38:43 +0200 Subject: [PATCH] changes to avoid accidental similarity --- bin/kernal_generic.rom | Bin 8192 -> 8192 bytes bin/kernal_mega65.rom | Bin 8192 -> 8192 bytes bin/kernal_ultimate64.rom | Bin 8192 -> 8192 bytes c64/aliases/,aliases_cpu.s | 6 +- c64/kernal/assets/keyboard_matrix.s | 92 ++++++++++++++-------- c64/kernal/screen/chrout_screen_control.s | 18 ++--- 6 files changed, 72 insertions(+), 44 deletions(-) diff --git a/bin/kernal_generic.rom b/bin/kernal_generic.rom index 9e5f655fa2808d1c65034ee91fc106f42a0d37ad..4795ba13d79c587d63291e375748d9985cfcdcdd 100644 GIT binary patch delta 37 scmZp0XmHr@Urw^`0{2>p3z|&55*K`$f1TvJzz*bcGF^B-Swj8=05x3@jQ{`u delta 37 scmZp0XmHr@Urv(m0{dEt3!F?BI8XLn;07`^nR+EI_%#2TEFu2_03a9-rvLx| diff --git a/bin/kernal_mega65.rom b/bin/kernal_mega65.rom index b108fb6e757fe41e5dfaadd42281616e64cbd3aa..87da23d18a8bea770fc37b8a6a65b79fd548837e 100644 GIT binary patch delta 37 scmZp0XmHr@Urw^`0{2>p3z|&55*K`)|2oNcfgQ-@WV-NvvV{B#06YN@@c;k- delta 37 scmZp0XmHr@Urv(m0{dEt3!F?BI8XLn;07`^nR+EI_&onLSwj8=03vV@3jhEB diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index e1f031b546613e6383339ada56f17842deca857d..48b7482a12f8be9de5170975df2825f03ed964a3 100644 GIT binary patch delta 37 scmZp0XmHr@Urw^`0{2>p3z|&55*K`?{5r{ZfgQ-@WV-NvvV{B#05*OQo&W#< delta 37 scmZp0XmHr@Urv(m0{dEt3!F?BI8XLn;07`^nR+EI_)PgVSwj8=03d!3xBvhE diff --git a/c64/aliases/,aliases_cpu.s b/c64/aliases/,aliases_cpu.s index 38d7a572..7e2bbfa5 100644 --- a/c64/aliases/,aliases_cpu.s +++ b/c64/aliases/,aliases_cpu.s @@ -1,9 +1,13 @@ - // // Provide pseudocommands to make CPU optimizations easier // +// +// Stack manipulation - some CPUs will leave .A unchanged, some will use it as temporary storage, so consider .A trashed +// + + .pseudocommand phx_trash_a { #if CONFIG_CPU_WDC_65C02 || CONFIG_CPU_CSG_65CE02 || CONFIG_CPU_WDC_65816 diff --git a/c64/kernal/assets/keyboard_matrix.s b/c64/kernal/assets/keyboard_matrix.s index 1c36c586..b5f2af05 100644 --- a/c64/kernal/assets/keyboard_matrix.s +++ b/c64/kernal/assets/keyboard_matrix.s @@ -1,26 +1,32 @@ -// Key board matrixes: unshifted, shifted, control and C= modified -// 64 bytes for each +// +// Keyboard matrix, based on +// +// - [RG64] C64 Programmer's Reference Guide - pages 379-381 +// - [CM64] Compute's Mapping the Commodore 64 - pages 38-39 +// - http://commodore128.mirkosoft.sk/keyboard.html (C128 extension) +// - http://www.zimmers.net/cbmpics/cbm/c65/c65manual.txt + +// Values can be computed by running a program like: +// 10 GET A$ : IF A$ = "" GOTO10 +// 20 PRINT ASC(A$) : GOTO10 +// and converting the values + keyboard_matrix: - // Unshifted matrix built by refering to - // Compute's Mapping the 64 p38-39 - // and C64 PRG pages 379-381 - .byte $14,$0D,$1D,$88,$85,$86,$87,17 - .byte $33,87,$41,$34,$5A,83,$45,$00 - .byte $35,$52,$44,$36,$43,$46,$54,88 + + // Normal + .byte $14,$0D,$1D,$88,$85,$86,$87,$11 + .byte $33,$57,$41,$34,$5A,$53,$45,$00 + .byte $35,$52,$44,$36,$43,$46,$54,$58 .byte $37,$59,$47,$38,$42,$48,$55,$56 .byte $39,$49,$4A,$30,$4D,$4B,$4F,$4E - .byte $2B,$50,$4C,45,46,58,$40,44 - .byte $5C,$2A,59,$13,$00,$3D,$5E,$2F + .byte $2B,$50,$4C,$2D,$2E,$3A,$40,$2C + .byte $5C,$2A,$3B,$13,$00,$3D,$5E,$2F .byte $31,$5F,$00,$32,$20,$00,$51,$03 - // Shifted keyboard - // Values computed by running a program like: - // 10 GETA$:IFA$=""GOTO10 - // 20 ?ASC(A$):GOTO10 - // and converting the values + // With SHIFT .byte $94,$8D,$9D,$8C,$89,$8A,$8B,$91 .byte $23,$77,$61,$24,$7A,$73,$65,$00 .byte $25,$72,$64,$26,$63,$66,$74,$78 @@ -30,7 +36,7 @@ keyboard_matrix: .byte $A9,$C0,$5D,$93,$00,$3D,$DE,$3F .byte $21,$5F,$00,$22,$A0,$00,$71,$83 - // Vendor key modified keyboard + // With VENDOR key .byte $94,$8D,$9D,$8C,$89,$8A,$8B,$91 .byte $96,$B3,$B0,$97,$AD,$AE,$B1,$00 .byte $98,$B2,$AC,$99,$BC,$BB,$A3,$BD @@ -40,7 +46,7 @@ keyboard_matrix: .byte $A8,$DF,$5D,$93,$00,$3D,$DE,$3F .byte $81,$5F,$00,$95,$a0,$00,$AB,$83 - // Control modified keyboard + // With CTRL .byte $00,$00,$00,$00,$00,$00,$00,$00 .byte $1C,$17,$01,$9F,$1A,$13,$05,$00 .byte $9C,$12,$04,$1E,$03,$06,$14,$18 @@ -50,23 +56,41 @@ keyboard_matrix: .byte $1C,$00,$1D,$00,$00,$1F,$1E,$00 .byte $90,$06,$00,$05,$00,$00,$11,$00 - keyboard_matrix_lookup: - // Work out if normal, shifted, control or Vendor - // modified keyboard. - // Table contains the offsets into keyboard_matrixes - // that should be used for different values of - // the bottom 3 bits of key_bucky_state - // Interaction is simple to work out when playing - // with a C64: - // CONTROL trumps SHIFT or Vendor - // Vendor + SHIFT = DOES NOTHING + // Work out if normal, shifted, control or Vendor modified keyboard. + // Table contains the offsets into keyboard_matrixes that should be used + // for different values of the bottom 3 bits of key_bucky_state XXX + // Interaction is simple to work out when playing with a C64: + // CTRL trumps SHIFT or VENDOR + // VENDOR + SHIFT = DOES NOTHING // All 3 does CONTROL .byte $00 // Normal - .byte $40 // Shifted - .byte $80 // Control - .byte $80 // Control + SHIFT - .byte $C0 // Vendor - .byte $C0 // Vendor + SHIFT - .byte $80 // Vendor+ CTRL - .byte $80 // Vendor + CTRL + SHIFT + .byte $40 // SHIFT + .byte $80 // CTRL + .byte $80 // CTRL + SHIFT + .byte $C0 // VENDOR + .byte $C0 // VENDOR + SHIFT + .byte $80 // VENDOR + CTRL + .byte $80 // VENDOR + CTRL + SHIFT + + +// keyboard_matrix_ext128: $D02F + + // .byte (HELP),$38,$35,(TAB),$32,$34,$37,$31 // $FE + // .byte $1B, $2B, $2D,$0A,$0D,$36,$39,$33 // $FD + // .byte $00,$30,$2E,$91,$11,$9D,$1D,(NO_SCRL) // $FB + +// keyboard_matrix_ext65: + + // Last column - normal + // .byte (NO_SCRL),(TAB),$00,(HELP),(F9),(F11),(F13),$1B + + // Last column - shifted + // .byte (NO_SCRL),(TAB),$00,(HELP),(F10),(F12),(F14),$1B + + + // XXX ESC : $1B (alias: CTRL [ ) + // XXX HELP : (to be determined, ?) + // XXX TAB : (to be determined, $18 ?) + // XXX NO_SCRL : (to be determined, ?) + // XXX ALT : bucky, 128: row 3, 1st, 65: 3rd \ No newline at end of file diff --git a/c64/kernal/screen/chrout_screen_control.s b/c64/kernal/screen/chrout_screen_control.s index 440ace12..ff4f5706 100644 --- a/c64/kernal/screen/chrout_screen_control.s +++ b/c64/kernal/screen/chrout_screen_control.s @@ -105,15 +105,6 @@ rvs_l1: sta RVS jmp chrout_screen_done !: -chrout_try_MODE_TXT: - - cmp #$0E - bne !+ - - lda VIC_YMCSB - ora #$02 // to lower case - bne mode_l1 // branch always -!: chrout_try_MODE_GFX: cmp #$8E @@ -125,6 +116,15 @@ mode_l1: sta VIC_YMCSB jmp chrout_screen_done !: +chrout_try_MODE_TXT: + + cmp #$0E + bne !+ + + lda VIC_YMCSB + ora #$02 // to lower case + bne mode_l1 // branch always +!: chrout_try_COLOR: ldx #$0F