; *************************************************************************** ; *************************************************************************** ; ; lzsa2_6502.s ; ; NMOS 6502 decompressor for data stored in Emmanuel Marty's LZSA2 format. ; ; Optional code is presented for two minor 6502 optimizations that break ; compatibility with the current LZSA2 format standard. ; ; This code is written for the PCEAS/NECASM assembler in HuC & MagicKit. ; ; 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 ; ; ; Save 7 bytes of code, and 21 cycles every time that a ; 16-bit length is decoded? ; ; N.B. Setting this breaks compatibility with LZSA v1.2 ; LZSA_SWAP_LEN16 = 0 ; ; Save 3 bytes of code, and 4 or 8 cycles when decoding ; an offset? ; ; N.B. Setting this breaks compatibility with LZSA v1.2 ; LZSA_SWAP_XZY = 0 ; ; Remove code inlining to save space? ; ; This saves 15 bytes of code, but decompression is 7% slower. ; LZSA_BEST_SIZE = 0 ; ; Assume that we're decompessing from a large multi-bank ; compressed data file, and that the next bank may need to ; paged in when a page-boundary is crossed. ; LZSA_FROM_BANK = 0 ; ; Macro to increment the source pointer to the next page. ; if LZSA_FROM_BANK LZSA_INC_PAGE macro jsr .next_page endm else LZSA_INC_PAGE macro inc