*>--------------------------------------------------<* * * CRB-Packer Ripper for Vampire's Universal Ripper * * ...made by Vampire (of course!) * just assemble and save as executable * Open = -$1E Write = -$30 Close = -$24 saveadr = 0 lenght = 4 datadr = 8 datlen = 12 type = 16 prefix1ptr = 18 prefix2ptr = 22 suffix1ptr = 26 suffix2ptr = 30 message = 34 savename = 38 namelenght = 42 datnamadr = 44 callflags = 48 fromadr = 50 toadr = 54 flashreg = 58 memtableptr = 62 memtypes = 78 newname = 92 dosbase = 66 gfxbase = 70 savecodeptr =112 PlayCIAA =116 * W - parameter-bits: %00000 * |||||____additional data found * ||||_____own save routine (set if opt=decr) * |||______saveable * ||_______playable / (viewable) * |________data found ** >> Header << header: dc.w $601E,$5044,$4f53 ; 0: RIPSEG header \ dc.w %0100000000000000 ; 6: (flags: see docs) \ 16 bytes dc.w InfoText-header ; 8: offset to InfoText / -------- dc.b "UniSEG" ; 10: identifier !! / dc.l checkmem ; rip-routine (without mem-loop!) dc.l DecryptTab ; for decrunching or converting to disk dc.l 0 ; new !! dc.w checkmem-header dc.w ende-checkmem safety: ; This label must (!) be at this pos. moveq #121,d0 ; You can put here a routine which is rts ; called from cli. ; That might be an error message or ; a complete cli-ripper! ** >> Individual area starting here!! << checkmem: move.l a0,a1 moveq #$1e,d5 ; 31 samples d_lp move.w 6(a1),d2 beq.s nix cmp.w #1,d2 beq.s d_smpok add.w 4(a1),d2 cmp.w (a1),d2 bgt.s nix d_smpok cmp.b #$40,3(a1) bgt.s nix addq.l #8,a1 ; adr to next sample dbf d5,d_lp cmp.b #$7f,1(a1) bne.s nix bsr len sub.l a0,a2 move.l a2,lenght(a5) move.b #%10100000,d6 lea pre1(pc),a1 lea messy(pc),a3 move.l a3,message(a5) btst #0,d7 beq.s notde move.b #%10110000,d6 lea pre2(pc),a1 notde move.b d6,type(a5) move.l a1,prefix1ptr(a5) nix rts DecryptTab: bra.l BuildHeader bra.l DecrunchPattern bra.l WhereSampleblock ;a0 moduleadr ;a1 destmem, $43C bytes ;a5 ptr to glb ;>d7 hipattern (0-x) BuildHeader: lea $14(a1),a1 ; skip name moveq #$1e,d1 ; make header with 31 samples lp_hdr jsr 128(a5) move.l (a0)+,(a1)+ move.l (a0)+,(a1)+ dbf d1,lp_hdr moveq #64,d0 lp_posi move.w (a0)+,(a1)+ dbf d0,lp_posi move.l #"M.K.",(a1)+ move.l anzpatt(pc),d7 rts ;d0 nr of pattern ;a0 moduleadr ;a1 destmem, $400 bytes ;a5 glb DecrunchPattern: lea $17a(a0),a5 bsr quatsch ; a6=ptr to offsets lsl.w #4,d0 lea (a6,d0.w),a6 move.l #$C0000000,d4 moveq #3,d6 lp_patt move.l a1,a0 ; get row_destadr move.l (a6)+,d0 lea (a5,d0.l),a4 ; get pattern_row adr MOVEQ #$3F,D5 dec_lp MOVE.L (A4)+,D0 MOVE.L D0,D1 moveq #0,d2 AND.L d4,D0 CMPI.L #$80000000,D0 BEQ.S dec_1 move.l d1,(a0) ; add normal value lea $10(a0),a0 move.l d1,d2 ; and save it for decr-loop bra.s nxval dec_1 ANDI.L #$3F,D1 SUB.L D1,D5 dec_lp2 move.l d2,(a0) ; add crunched values lea $10(a0),a0 dbf d1,dec_lp2 nxval DBra D5,dec_lp addq.l #4,a1 ; point to next row dbf d6,lp_patt rts ;a0 moduleadr ;a5 glb ;>a0 samplestrart ;>d0 lenght WhereSampleblock: move.l smpadr(pc),a0 move.l endadr(pc),d0 sub.l a0,d0 rts InfoText: lin1 dc.b lin2-lin1-2,"CRB-Packer ripper/decruncher 1.0 - coded by The Vampire of PseudoDOS",$a lin2 dc.b lin3-lin2-2,"For modules using the 'CrunchedReplay' from 01.02.1991, by Heatseeker",$a lin3 dc.b lin4-lin3-2,"of Cryptoburners. Replay ripped, but not built in coz it is too lame.",$a lin4 dc.b last-lin4-2,"OPT 1: decrunch module while saving (to play it with Protracker)",$a last messy dc.b pre1-messy-2 dc.b "This could be CRB-Packer...",$a pre1 dc.b pre2-pre1-1 dc.b "crb." pre2 dc.b ende-pre2-1 dc.b "mod." ende even quatsch: lea offsets,a6 rts len movem.l d0/d1/a0,-(a7) ; a0 must be mt_data lea $fa(a0),a1 moveq #$7f,d0 moveq #0,d1 moveq #0,d2 maxpt1 move.b (a1)+,d1 cmp.b d2,d1 ble.s maxpt2 move.l d1,d2 maxpt2 dbra d0,maxpt1 move.b d2,anzpatt addq.w #1,d2 lea $17a(a0),a2 lea offsets,a3 lea (a3),a4 lsl.l #2,d2 subq.l #1,d2 movea.l a3,a4 moveq #0,d4 move.l #$c0000000,d5 offs_lp move.l d4,(a3)+ move.l (a2),d0 and.l d5,d0 cmp.l d5,d0 beq.s insold moveq #$3f,d6 row_lp move.l (a2)+,d0 addq.l #4,d4 move.l d0,d1 and.l d5,d0 cmpi.l #$80000000,d0 bne.s nextval andi.l #$3f,d1 sub.l d1,d6 nextval dbra d6,row_lp bra.s next insold move.l (a2)+,d0 addq.l #4,d4 andi.l #$3ffffffc,d0 move.l (a4,d0.l),d0 subq.l #4,a3 move.l d0,(a3)+ next dbra d2,offs_lp move.l a2,smpadr moveq #$1e,d0 smp_lp moveq #0,d1 move.w (a0),d1 asl.l #1,d1 adda.l d1,a2 addq.l #8,a0 dbra d0,smp_lp move.l a2,endadr movem.l (a7)+,d0/d1/a0 ; now a2 points to endadr rts smpadr dc.l 0 endadr dc.l 0 anzpatt dc.b 0 section "",bss offsets blk.l 64*4,0 ; pattern offsets .