Skip to content

Instantly share code, notes, and snippets.

@Ersanio
Created September 6, 2018 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ersanio/c0943a9ebd8a5df76b0045de23aa6d47 to your computer and use it in GitHub Desktop.
Save Ersanio/c0943a9ebd8a5df76b0045de23aa6d47 to your computer and use it in GitHub Desktop.
inflate stack magic #2
;here be dragons (at this point I think all of the code is dragons though)
macro inline_decode_symbol(table)
ldx #<table>
tdc
tcs
-
%get_bit()
rol
inx
inx
tay
tsc
adc.b tree.code_lengths,x
tcs
tya
sec
sbc.b tree.code_lengths,x
bpl -
sta $00
tsc
adc $00
asl
tay
lda.w tree.translate+<table>,y
endmacro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment