From 03fd8751b0a6df2a10a47368e8d15abbda0c70fd Mon Sep 17 00:00:00 2001 From: John Brandwood Date: Thu, 25 Mar 2021 19:01:35 -0400 Subject: [PATCH] Reorganize 6502 decompress_faster depackers for smaller size and greater speed. --- asm/6502/decompress_faster_v1.asm | 254 ++++++++------------ asm/6502/decompress_faster_v2.asm | 375 +++++++----------------------- 2 files changed, 175 insertions(+), 454 deletions(-) diff --git a/asm/6502/decompress_faster_v1.asm b/asm/6502/decompress_faster_v1.asm index 1f65a40..2e29c5d 100644 --- a/asm/6502/decompress_faster_v1.asm +++ b/asm/6502/decompress_faster_v1.asm @@ -7,12 +7,9 @@ ; ; This code is written for the ACME assembler. ; -; Optional code is presented for one minor 6502 optimization that breaks -; compatibility with the current LZSA1 format standard. +; The code is 167 bytes for the small version, and 192 bytes for the normal. ; -; The code is 168 bytes for the small version, and 205 bytes for the normal. -; -; Copyright John Brandwood 2019. +; Copyright John Brandwood 2021. ; ; Distributed under the Boost Software License, Version 1.0. ; (See accompanying file LICENSE_1_0.txt or copy at @@ -30,80 +27,11 @@ ; ; - ; Choose size over space (within sane limits)? + ; Choose size over decompression speed (within sane limits)? ; LZSA_SMALL_SIZE = 0 - ; - ; Remove code inlining to save space? - ; - ; This saves 15 bytes of code at the cost of 7% speed. - ; - - !if LZSA_SMALL_SIZE { -LZSA_NO_INLINE = 1 - } else { -LZSA_NO_INLINE = 0 - } - - ; - ; Use smaller code for copying literals? - ; - ; This saves 11 bytes of code at the cost of 15% speed. - ; - - !if LZSA_SMALL_SIZE { -LZSA_SHORT_CP = 1 - } else { -LZSA_SHORT_CP = 0 - } - - ; - ; Use smaller code for copying literals? - ; - ; This saves 11 bytes of code at the cost of 30% speed. - ; - - !if LZSA_SMALL_SIZE { -LZSA_SHORT_LZ = 1 - } else { -LZSA_SHORT_LZ = 0 - } - - ; - ; Macro to increment the source pointer to the next page. - ; - ; This should call a subroutine to determine if a bank - ; has been crossed, and a new bank should be paged in. - ; - - !macro LZSA_INC_PAGE { - inc