From 50da880ffcde556a68bc571110d908c8542758db Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 24 Feb 2021 21:11:41 +0100 Subject: [PATCH] code size optimization --- src/kernal/board_m65/mega65_imports_1.s | 3 ++ src/kernal/board_m65/mega65_tape_fast_cpu.s | 31 --------------------- src/kernal/tape/tape_common_screen.s | 19 +++---------- src/kernal/tape/tape_head_align.s | 2 +- 4 files changed, 8 insertions(+), 47 deletions(-) delete mode 100644 src/kernal/board_m65/mega65_tape_fast_cpu.s diff --git a/src/kernal/board_m65/mega65_imports_1.s b/src/kernal/board_m65/mega65_imports_1.s index fdad4bb5..1d5fd086 100644 --- a/src/kernal/board_m65/mega65_imports_1.s +++ b/src/kernal/board_m65/mega65_imports_1.s @@ -40,6 +40,9 @@ ;; #ALIAS# viciv_hotregs_on = KERNAL_0.viciv_hotregs_on ;; #ALIAS# viciv_hotregs_off = KERNAL_0.viciv_hotregs_off +;; #ALIAS# m65_speed_tape_cbdos = KERNAL_0.m65_speed_tape_cbdos +;; #ALIAS# m65_speed_restore = KERNAL_0.m65_speed_restore + ;; #ALIAS# m65_clr_magictstr = KERNAL_0.m65_clr_magictstr ;; #ALIAS# m65_scrtab_txtwidth = KERNAL_0.m65_scrtab_txtwidth ;; #ALIAS# m65_scrtab_txtheight = KERNAL_0.m65_scrtab_txtheight diff --git a/src/kernal/board_m65/mega65_tape_fast_cpu.s b/src/kernal/board_m65/mega65_tape_fast_cpu.s deleted file mode 100644 index 0be56175..00000000 --- a/src/kernal/board_m65/mega65_tape_fast_cpu.s +++ /dev/null @@ -1,31 +0,0 @@ -;; #LAYOUT# M65 KERNAL_1 #TAKE -;; #LAYOUT# * * #IGNORE - -; -; Tape helper routine -; -; - unlocks VIC-IV -; - switches CPU to fast processing mode and disables badlines -; - stores previous VIC_CTRLB in NXTBIN -; - -!ifdef HAS_TAPE { - - -tape_fast_cpu: - - jsr M65_MODEGET - bcc @1 - - jsr viciv_unhide -@1: - lda VIC_CTRLB - ora #%01000000 - sta VIC_CTRLB - sta NXTBIT - - lda #$00 - sta MISC_EMU - - rts -} diff --git a/src/kernal/tape/tape_common_screen.s b/src/kernal/tape/tape_common_screen.s index 51e251cd..715af440 100644 --- a/src/kernal/tape/tape_common_screen.s +++ b/src/kernal/tape/tape_common_screen.s @@ -22,20 +22,9 @@ tape_screen_on_motor_off: !ifdef CONFIG_MB_M65 { - jsr M65_MODEGET - bcc @1 + ; Restore standard CPU speed settings - ; For compatibility mode, restore normal speed settings and hide VIC-IV - - lda #$03 - sta MISC_EMU - - lda NXTBIT - sta VIC_CTRLB - - sta VIC_KEY -@1: - rts + jmp m65_speed_restore } else ifdef CONFIG_MB_U64 { @@ -64,12 +53,12 @@ tape_screen_off_motor_on: !ifdef CONFIG_MB_M65 { - ; On MEGA65 we need to switch banks everytim we retrieve byte to be stored in memory, + ; On MEGA65 we need to switch banks everytime we retrieve byte to be stored in memory, ; additionally we perform advanced tape speed autocallibration - this is all too expensive ; to be handled by 1 MHz CPU - so in case of compatibility mode, switch CPU to fast speed ; (and disable badlines, so we will not have to blank the screen) - jsr tape_fast_cpu + jsr m65_speed_tape_cbdos } else ifdef CONFIG_MB_U64 { diff --git a/src/kernal/tape/tape_head_align.s b/src/kernal/tape/tape_head_align.s index 2c3144e9..92c678ea 100644 --- a/src/kernal/tape/tape_head_align.s +++ b/src/kernal/tape/tape_head_align.s @@ -48,7 +48,7 @@ tape_head_align: ; Switch CPU to fast mode !ifdef CONFIG_MB_M65 { - jsr tape_fast_cpu + jsr m65_speed_tape_cbdos } !ifdef CONFIG_MB_U64 {