From c1e64671473be2fa467fe2e2063226bc5cd3bebf Mon Sep 17 00:00:00 2001 From: "Christian A. Weber" Date: Mon, 18 May 1992 02:16:02 +0000 Subject: Benutzt jetzt externe Dekompressions-Routine --- Source/DecodePic.S | 69 +++++++++++++++++------------------------------------- 1 file changed, 22 insertions(+), 47 deletions(-) (limited to 'Source') diff --git a/Source/DecodePic.S b/Source/DecodePic.S index b1f3136..baae610 100644 --- a/Source/DecodePic.S +++ b/Source/DecodePic.S @@ -1,11 +1,11 @@ ** -** $Id: DecodePic.S,v 1.1 92/05/12 22:26:36 chris Exp $ -** $Revision: 1.1 $ +** $Id: DecodePic.S,v 21.1 92/05/15 03:21:35 chris Exp $ +** $Revision: 21.1 $ ** ** $Filename: DecodePic.S $ ** $Author: chris $ ** $Release: 19.1 $ -** $Date: 92/05/12 22:26:36 $ +** $Date: 92/05/15 03:21:35 $ ** ** iff.library/IFFL_DecodePic ** @@ -22,7 +22,8 @@ INCLUDE "IFFLib.i" - XREF ClearError,SetError,GetBMHDFunc,FindChunkFunc + XREF ClearError,SetError,Decompress_BYTERUN1 + XREF GetBMHDFunc,FindChunkFunc XDEF DecodePicFunc @@ -80,7 +81,7 @@ DecodePicFunc: movem.l d2-d7/a2-a6,-(SP) *** Testen ob ILBM-File cmpi.l #'ILBM',8(a4) ; ist's überhaupt ein ILBM-File ? - beq.s 1$ ; ja ---> + beq.b 1$ ; ja ---> moveq #IFFL_ERROR_NOILBM,d0 ; Fehlernummer bra .Error 1$: @@ -88,7 +89,7 @@ DecodePicFunc: movem.l d2-d7/a2-a6,-(SP) bsr GetBMHDFunc ; BitMapHeader suchen ;; tst.l d0 - bne.s 2$ ; gefunden ---> + bne.b 2$ ; gefunden ---> moveq #IFFL_ERROR_NOBMHD,d0 ; Fehlernummer bra .Error 2$: movea.l d0,a2 ; A2: BitMapHeader @@ -112,7 +113,7 @@ DecodePicFunc: movem.l d2-d7/a2-a6,-(SP) movea.l a4,a1 ; IFF-File bsr FindChunkFunc ;; tst.l d0 - bne.s 4$ ; gefunden ---> + bne.b 4$ ; gefunden ---> moveq #IFFL_ERROR_NOBODY,d0 ; Fehlernummer bra .Error 4$: @@ -124,17 +125,17 @@ DecodePicFunc: movem.l d2-d7/a2-a6,-(SP) *** Compression testen und entsprechende Routine nach A6 move.b bmh_Compression(a2),d0 - bne.s 5$ + bne.b 5$ lea CopyRow(PC),a6 ; Not crunched - bra.s 7$ ; ---> + bra.b 7$ ; ---> 5$: - cmpi.b #1,d0 ; CmpByteRun1 ? - bne.s 6$ ; ja ---> - lea DecrunchRow(PC),a6 ; CmpByteRun1 - bra.s 7$ ; ---> + subq.b #1,d0 ; CmpByteRun1 ? + bne.b 6$ ; ja ---> + lea Decompress_BYTERUN1(PC),a6 ; DecompressBlock.S + bra.b 7$ ; ---> 6$: moveq #IFFL_ERROR_BADCOMPRESSION,d0 - bra.s .Error + bra.b .Error 7$: *** Masking testen und wenn 'hasmask' (Stencil) D7.B:=$FF, sonst $00 @@ -155,10 +156,10 @@ DecodePicFunc: movem.l d2-d7/a2-a6,-(SP) moveq.l #0,d6 move.w bm_Rows(a3),d6 ; D6 : Max. Anzahl Zeilen cmp.w bmh_Height(a2),d6 ; BitMap zu groß ? - ble.s 8$ ; nein ---> + ble.b 8$ ; nein ---> move.w bmh_Height(a2),d6 ; Sonst Höhe aus bmh nehmen 8$: - bra.s .CheckCond ; ---> für dbf + bra.b .CheckCond ; ---> für dbf *** Hauptschleife @@ -167,18 +168,18 @@ DecodePicFunc: movem.l d2-d7/a2-a6,-(SP) .body2: move.l d4,d0 ; Source bytes per row cmp.b bm_Depth(a3),d3 ; Is there a dest-plane ? - bhs.s .NoDest ; nope ---> skip it + bhs.b .NoDest ; nope ---> skip it movea.l (a2),a1 ; Adrese der aktuellen Plane add.l d5,(a2)+ ; Plane auf nächste Linie - bra.s 9$ + bra.b 9$ .NoDest: lea LineBuffer(SP),a1 ; Plane ins NIL kopieren 9$: jsr (a6) ; Linie copyren / decrunchen addq.b #1,d3 ; INC planecounter cmp.b d2,d3 - blt.s .body2 ; ---> Nächste Plane + blt.b .body2 ; ---> Nächste Plane tst.b d7 ; Maske zu überhüpfen ? - beq.s .NoMask ; nein ---> + beq.b .NoMask ; nein ---> move.l d4,d0 ; Source bytes per row lea LineBuffer(SP),a1 ; Maske zur Hölle schicken jsr (a6) ; Linie copyren / decrunchen @@ -187,7 +188,7 @@ DecodePicFunc: movem.l d2-d7/a2-a6,-(SP) dbhs d6,.body1 ; wenn nicht: nächste Linie .Okay: bsr ClearError ; IFFError rücksetzen, D0 := 1 - bra.s .Ende + bra.b .Ende .Error: bsr SetError ; IFFError setzen, clr.l d0 @@ -203,30 +204,4 @@ CopyRow: dbf d0,copyloop rts -*************** 1 Linie decrunchen *************************************** - -DecrunchRow: move.l d2,-(SP) - -1$: moveq.l #0,d1 - move.b (a0)+,d1 ; D1 : nächstes Kommando-Byte - bmi.s 2$ ; crunched ---> - -.CopyLoop: move.b (a0)+,(a1)+ ; D1+1 Bytes normal kopieren - subq.w #1,d0 ; DEC ColumnCounter - dble d1,.CopyLoop - bra.s 3$ ; ---> -2$: - neg.b d1 - bmi.s 3$ ; ~$80 (== $80) ist 'NOP' - move.b (a0)+,d2 ; Zu repetierender Wert -.RepLoop: move.b d2,(a1)+ - subq.w #1,d0 ; DEC ColumnCounter - dble d1,.RepLoop -3$: - tst.w d0 ; Linie fertig ? - bgt.s 1$ ; noch nicht ---> Loop - - move.l (SP)+,d2 - rts - END -- cgit v1.2.3