From 3f18fce879256f287fb0b456ca34b31bb01f5476 Mon Sep 17 00:00:00 2001 From: Paul Gardner-Stephen Date: Sat, 20 Apr 2019 01:01:05 +0930 Subject: [PATCH] unroll loop in keyboard scanner --- c64/kernal/scan_keyboard.s | 50 ++++++++------------------------------ 1 file changed, 10 insertions(+), 40 deletions(-) diff --git a/c64/kernal/scan_keyboard.s b/c64/kernal/scan_keyboard.s index 4b81e6ee..e2113e02 100644 --- a/c64/kernal/scan_keyboard.s +++ b/c64/kernal/scan_keyboard.s @@ -314,47 +314,17 @@ skip0: ;; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;; // Scan Keyboard Matrix - lda #%11111110 - sta $dc00 - ldy $dc01 - sty ScanResult+7 - sec - + ldx #7 + lda #%11111110 +* sta $dc00 + pha + lda $dc01 + sta ScanResult,x + pla + sec rol - sta $dc00 - ldy $dc01 - sty ScanResult+6 - - rol - sta $dc00 - ldy $dc01 - sty ScanResult+5 - - rol - sta $dc00 - ldy $dc01 - sty ScanResult+4 - - rol - sta $dc00 - ldy $dc01 - sty ScanResult+3 - - rol - sta $dc00 - ldy $dc01 - sty ScanResult+2 - - rol - sta $dc00 - ldy $dc01 - sty ScanResult+1 - - rol - sta $dc00 - ldy $dc01 - sty ScanResult+0 - + dex + bpl - ;; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~