1 ;Exomizer 2 Z80 decoder
4 ; optimized by Antonio Villena
6 ; compression algorithm by Magnus Lind
9 ; hl=compressed data start
10 ; de=uncompressed destination start
12 ; you may change exo_mapbasebits to point to any free buffer
34 ld (iy+0),c ;bits[i]=b1
37 defb 210 ;3 bytes nop (JP NC)
43 ld (iy+104),d ;base[i]=b2
50 db 218 ;3 bytes nop (JP C) --> jr exo_mainloop
55 call exo_getbit ;literal?
76 ld de,512+48 ;2 bits, 48 offset
83 ld de,1024+32 ;4 bits, 32 offset
95 push hl ;de=destination
102 pop hl ;Keep HL, DE is updated
103 jr exo_mainloop ;Next!
106 ld iy,exo_mapbasebits
114 add hl,bc ;Always clear C flag
121 ld bc,0 ;get D bits in BC
138 exo_mapbasebits_size equ 156
139 ;exo_mapbasebits: defs 156 ;tables for bits, baseL, baseH