mirror of
https://github.com/fadden/fhpack.git
synced 2024-06-17 05:29:29 +00:00
reorder for more speed and smaller size
This commit is contained in:
parent
438e445f55
commit
efa2bf71a9
41
LZ4FH65816.S
41
LZ4FH65816.S
|
@ -55,7 +55,25 @@ entry
|
||||||
inx
|
inx
|
||||||
and #$00ff
|
and #$00ff
|
||||||
cmp #lz4fh_magic
|
cmp #lz4fh_magic
|
||||||
|
beq mainloop
|
||||||
|
|
||||||
|
fail
|
||||||
|
jsr bell
|
||||||
|
jmp monitor
|
||||||
|
|
||||||
|
notempty
|
||||||
|
cmp #tok_eod
|
||||||
|
|
||||||
|
* exit
|
||||||
|
sec ;return to emulation mode
|
||||||
|
xce
|
||||||
bne fail
|
bne fail
|
||||||
|
rts
|
||||||
|
|
||||||
|
* handle "special" match length values (in A)
|
||||||
|
specialmatch
|
||||||
|
cmp #tok_empty
|
||||||
|
bne notempty
|
||||||
|
|
||||||
mainloop
|
mainloop
|
||||||
lda $0000,x
|
lda $0000,x
|
||||||
|
@ -73,8 +91,7 @@ mainloop
|
||||||
lda $0000,x ;length >= 15, get next
|
lda $0000,x ;length >= 15, get next
|
||||||
inx
|
inx
|
||||||
and #$00ff
|
and #$00ff
|
||||||
clc
|
adc #14 ;(carry set) add 15 - will not exceed 255
|
||||||
adc #15
|
|
||||||
|
|
||||||
* At this point, Y holds the address of the next
|
* At this point, Y holds the address of the next
|
||||||
* compressed data byte, X has the address of the
|
* compressed data byte, X has the address of the
|
||||||
|
@ -114,23 +131,3 @@ _dstmod ora #$ff00 ;OR in hi-res page
|
||||||
mvn $00,$00
|
mvn $00,$00
|
||||||
plx ;restore srcptr
|
plx ;restore srcptr
|
||||||
bra mainloop
|
bra mainloop
|
||||||
|
|
||||||
* handle "special" match length values (in A)
|
|
||||||
specialmatch
|
|
||||||
cmp #tok_empty
|
|
||||||
beq mainloop ;empty match, just loop
|
|
||||||
|
|
||||||
cmp #tok_eod
|
|
||||||
bne fail
|
|
||||||
|
|
||||||
* exit
|
|
||||||
sec ;return to emulation mode
|
|
||||||
xce
|
|
||||||
rts
|
|
||||||
|
|
||||||
fail
|
|
||||||
sec
|
|
||||||
xce
|
|
||||||
jsr bell
|
|
||||||
jmp monitor
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user