; *************************************************************************** ; *************************************************************************** ; ; lzsa2_6502.s ; ; NMOS 6502 decompressor for data stored in Emmanuel Marty's LZSA2 format. ; ; This code is written for the ACME assembler. ; ; Optional code is presented for two minor 6502 optimizations that break ; compatibility with the current LZSA2 format standard. ; ; The code is 241 bytes for the small version, and 267 bytes for the normal. ; ; Copyright John Brandwood 2019. ; ; Distributed under the Boost Software License, Version 1.0. ; (See accompanying file LICENSE_1_0.txt or copy at ; http://www.boost.org/LICENSE_1_0.txt) ; ; *************************************************************************** ; *************************************************************************** ; *************************************************************************** ; *************************************************************************** ; ; Decompression Options & Macros ; ; ; Choose size over space (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 5% speed. ; !if LZSA_SMALL_SIZE { LZSA_SHORT_CP = 1 } else { LZSA_SHORT_CP = 0 } ; ; We will read from or write to $FFFF. This prevents the ; use of the "INC ptrhi / BNE" trick and reduces speed. ; LZSA_USE_FFFF = 0 ; ; Macro to increment the source pointer to the next page. ; !macro LZSA_INC_PAGE { inc