From 299e9cd5243ba4eb71d95c3b84a082b045ceb085 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Mon, 21 Sep 2020 19:40:33 +0200 Subject: [PATCH] address mode optimizations, updated credits --- CREDITS.md | 1 + src/kernal/,kernal_aliases.s | 23 +++++++++++++++++++++++ src/kernal/keyboard/scnkey_legacy.s | 16 +--------------- 3 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 src/kernal/,kernal_aliases.s diff --git a/CREDITS.md b/CREDITS.md index 76bd4e40..a514a658 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -28,6 +28,7 @@ * Gábor Lénárt - for [his work](https://github.com/lgblgblgb/xemu) on XEMU MEGA65 emulator * Hernán Di Pietro - for [his work](https://github.com/hernandp/xemu) on XEMU MEGA65 emulator +* Marco Baye - for [ACME](https://sourceforge.net/projects/acme-crossass) cross-assembler * Mads Nielsen - for the [Kick Assembler](http://www.theweb.dk/KickAssembler/Main.html#frontpage) * Simon Jameson - for his Kick Assembler [pseudocommands](https://github.com/smnjameson/M65_KickAsm_PseudoCommands) for MEGA65 CPU support diff --git a/src/kernal/,kernal_aliases.s b/src/kernal/,kernal_aliases.s new file mode 100644 index 00000000..4140a5f5 --- /dev/null +++ b/src/kernal/,kernal_aliases.s @@ -0,0 +1,23 @@ + +; +; Aliases for legacy keyboard scan routine +; + +!ifdef CONFIG_LEGACY_SCNKEY { + + ; Low memory variables + + ; Reuse RS232 variables, since they should not be used by other things. + ; Carefully avoid $A7 which is used by 64NET + !addr KeyQuantity = $A8 ; 1 byte + !addr BufferNew = $A9 ; 3 bytes + !addr TempZP = $B6 ; 1 byte + ; These should be initialized in CINT to $FF + !addr BufferQuantity = $B4 ; 1 byte + !addr BufferOld = $293 ; 3 bytes + !addr Buffer = $297 ; 4 bytes + + ; $250-$258 is the 81st - 88th characters in BASIC input, a carry over from VIC-20 + ; and not used on C64, so safe for us to use, probably. + !addr ScanResult = $250 ; 8 bytes +} diff --git a/src/kernal/keyboard/scnkey_legacy.s b/src/kernal/keyboard/scnkey_legacy.s index 38feccd1..b1bb9d41 100644 --- a/src/kernal/keyboard/scnkey_legacy.s +++ b/src/kernal/keyboard/scnkey_legacy.s @@ -59,24 +59,10 @@ ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - ; Low memory variables - ; Reuse RS232 variables, since they should not be used by other things. - ; Carefully avoid $A7 which is used by 64NET - !addr KeyQuantity = $A8 ; 1 byte - !addr BufferNew = $A9 ; 3 bytes - !addr TempZP = $B6 ; 1 byte - ; These should be initialized in CINT to $FF - !addr BufferQuantity = $B4 ; 1 byte - !addr BufferOld = $293 ; 3 bytes - !addr Buffer = $297 ; 4 bytes - - ; $250-$258 is the 81st - 88th characters in BASIC input, a carry over from VIC-20 - ; and not used on C64, so safe for us to use, probably. - !addr ScanResult = $250 ; 8 bytes ; Operational Variables - !addr MaxKeyRollover = 3 + !set MaxKeyRollover = 3 SCNKEY: