home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
compress
/
packers
/
turtlesmasher141
/
turtledecruncher.asm
< prev
next >
Wrap
Assembly Source File
|
1995-02-27
|
3KB
|
146 lines
section Timedecruncher,code
lea crunched,a0
lea decrunched,a1
bsr decrunch
rts
;----------------------------------------------------
crunched incbin cruncheddata ;put the crunched data here
decrunched dcb.b 200000,0 ;free mem for decrunched data
;*****************************************************
;* Turtle Smasher Data Decruncher *
;* Uses Registers D0,D1,D2,D3,A0,A1,A2 *
;* a0=address for crunched data *
;* a1=address where the decrunched data places *
;* *
;* Improved and Fixed for data decrunching by *
;* Mr.Crook & Him of VOX DEI. *
;* This source MUST be spread with the cruncher. *
;*****************************************************
decrunch move.l a1,a2
add.l (a0)+,a2
add.l (a0),a0
subq.l #8,a0
move.l (a0),d0
again moveq #3,d1
bsr.w d46
tst.b d2
beq.b caa
cmpi.w #7,d2
bne.b c7a
lsr.l #1,d0
bne.b c5e
bsr.w d3c
c5e bcc.b c72
moveq #10,d1
bsr.w d46
tst.w d2
bne.b c7a
moveq #18,d1
bsr.w d46
bra.b c7a
c72 moveq #4,d1
bsr.w d46
addq.w #7,d2
c7a subq.w #1,d2
c7c moveq #7,d1
c7e lsr.l #1,d0
beq.b c90
roxl.l #1,d3
dbra d1,c7e
move.b d3,-(a2)
dbra d2,c7c
bra.b caa
c90 move.l -(a0),d0
move.w d0,$00dff180 ; make screen flashing
move #$10,ccr
roxr.l #1,d0
roxl.l #1,d3
dbra d1,c7e
move.b d3,-(a2)
dbra d2,c7c
caa cmp.l a2,a1
bge.w exit
moveq #$02,d1
bsr.w d46
moveq #2,d3
moveq #8,d1
tst.w d2
beq.b d26
moveq #4,d3
cmpi.w #2,d2
beq.w d10
moveq #3,d3
cmpi.w #1,d2
beq.w d02
moveq #2,d1
bsr.w d46
cmpi.w #3,d2
beq.b cf8
cmpi.w #2,d2
beq.b cec
addq.w #5,d2
move.w d2,d3
bra.w d10
cec moveq #2,d1
bsr.b d46
addq.w #7,d2
move.w d2,d3
bra.w d10
cf8 moveq #8,d1
bsr.b d46
move.w d2,d3
bra.w d10
d02 moveq #8,d1
lsr.l #1,d0
bne.b d0a
bsr.b d3c
d0a bcs.b d26
moveq #14,d1
bra.b d26
d10 moveq #16,d1
lsr.l #1,d0
bne.b d18
bsr.b d3c
d18 bcc.b d26
moveq #8,d1
lsr.l #1,d0
bne.b d22
bsr.b d3c
d22 bcs.b d26
moveq #12,d1
d26 bsr.b d46
subq.w #1,d3
d2a move.b -1(a2,d2.l),-(a2)
dbra d3,d2a
bra.w again
;---------------------------------------------------
exit rts ;here we leave the decruncher
;---------------------------------------------------
d3c move.l -(a0),d0
move #$10,ccr
roxr.l #1,d0
rts
d46 clr.l d2
subq.w #1,d1
roxlloop lsr.l #1,d0
beq.b zerobit
roxl.l #1,d2
dbra d1,roxlloop
rts
zerobit move.l -(a0),d0
move #$10,ccr
roxr.l #1,d0
roxl.l #1,d2
dbra d1,roxlloop
rts
end