mirror of
https://github.com/exoticorn/upkr.git
synced 2026-01-20 11:36:42 +01:00
z80_unpacker: optimisation: -1B in decode_number (fwd 170B / rev 167B)
slightly slower code, ROM unpack is back to ~22.6s
This commit is contained in:
Binary file not shown.
@@ -301,13 +301,12 @@ decode_number:
|
|||||||
; BC = probs+context_index-1
|
; BC = probs+context_index-1
|
||||||
; A' = upkr_current_byte (!!! init to 0x80 at start, not 0x00)
|
; A' = upkr_current_byte (!!! init to 0x80 at start, not 0x00)
|
||||||
; return length in DE, CF=0
|
; return length in DE, CF=0
|
||||||
ld de,$7FFF ; length = 0 with positional-stop-bit
|
ld de,$FFFF ; length = 0 with positional-stop-bit
|
||||||
jr .loop_entry
|
or a ; CF=0 to skip getting data bit and use only `rr d : rr e` to fix init DE
|
||||||
.loop:
|
.loop:
|
||||||
call inc_c_decode_bit ; context_index + 1
|
call c,inc_c_decode_bit ; get data bit, context_index + 1 / if CF=0 just add stop bit into DE init
|
||||||
rr d
|
rr d
|
||||||
rr e ; DE = length = (length >> 1) | (bit << 15);
|
rr e ; DE = length = (length >> 1) | (bit << 15);
|
||||||
.loop_entry:
|
|
||||||
call inc_c_decode_bit ; context_index += 2
|
call inc_c_decode_bit ; context_index += 2
|
||||||
jr c,.loop
|
jr c,.loop
|
||||||
.fix_bit_pos:
|
.fix_bit_pos:
|
||||||
|
|||||||
Reference in New Issue
Block a user