summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/DecodePic.S50
-rw-r--r--Source/FindChunk.S28
-rw-r--r--Source/GetBMHD.S33
-rw-r--r--Source/GetColorTab.S26
-rw-r--r--Source/GetViewModes.S36
-rw-r--r--Source/IFFError.S88
-rw-r--r--Source/IFFLib.S54
-rw-r--r--Source/ModifyFrame.S48
-rw-r--r--Source/SaveBitMap.S28
-rw-r--r--Source/SaveClip.S29
10 files changed, 203 insertions, 217 deletions
diff --git a/Source/DecodePic.S b/Source/DecodePic.S
index e8877a5..b1f3136 100644
--- a/Source/DecodePic.S
+++ b/Source/DecodePic.S
@@ -1,13 +1,13 @@
**
-** $Id: $
-** $Revision: $
+** $Id: DecodePic.S,v 1.1 92/05/12 22:26:36 chris Exp $
+** $Revision: 1.1 $
**
** $Filename: DecodePic.S $
-** $Author: Christian A. Weber $
+** $Author: chris $
** $Release: 19.1 $
-** $Date: 92/05/11 21:11:27 $
+** $Date: 92/05/12 22:26:36 $
**
-** iff.library/IFFLib_DecodePic
+** iff.library/IFFL_DecodePic
**
** COPYRIGHT (C) 1987-1992 BY CHRISTIAN A. WEBER, BRUGGERWEG 2,
** CH-8037 ZUERICH, SWITZERLAND. ALL RIGHTS RESERVED. NO PART
@@ -17,7 +17,7 @@
**
- IDNT IFFLib_DecodePic
+ IDNT IFFL_DecodePic
SECTION text,CODE
INCLUDE "IFFLib.i"
@@ -26,16 +26,16 @@
XDEF DecodePicFunc
-******* iff.library/IFFLib_DecodePic ****************************************
+******* iff.library/IFFL_DecodePic ******************************************
*
* NAME
-* IFFLib_DecodePic -- decode the BODY of an ILBM file into a BitMap
+* IFFL_DecodePic -- decode the BODY of an ILBM file into a BitMap
*
* SYNOPSIS
-* success = IFFLib_DecodePic( ifffile, bitmap )
-* D0 A1 A0
+* success = IFFL_DecodePic( iff, bitmap )
+* D0 A1 A0
*
-* BOOL IFFLib_DecodePic( IFFFILE, struct BitMap * )
+* BOOL IFFL_DecodePic( IFFL_HANDLE, struct BitMap * )
*
* FUNCTION
* Decodes and decompresses a picture into the user supplied BitMap.
@@ -44,23 +44,23 @@
* will be drawn into the top left corner of your BitMap.
* If the picture has less planes than the BitMap, the unused planes
* are NOT touched by this routine, so you may wish to clear them
-* before calling IFFLib_DecodePic(). If the picture has more planes
+* before calling IFFL_DecodePic(). If the picture has more planes
* than your BitMap, the surplus planes of the picture are ignored.
*
* INPUTS
-* ifffile - IFF file pointer, from IFFLib_OpenIFF()
-* bitmap - Pointer to a properly initialized BitMap structure:
-* bm_Planes[] must point to valid BitPlanes,
-* bm_Depth contains the number of planes.
-* bm_Width and bm_Height must be set according to the
-* size of your bit planes.
+* iff - IFF file handle, from IFFL_OpenIFF()
+* bitmap - Pointer to a properly initialized BitMap structure:
+* bm_Planes[] must point to valid BitPlanes,
+* bm_Depth contains the number of planes.
+* bm_Width and bm_Height must be set according to the
+* size of your bit planes.
*
* RESULTS
-* Non-zero if OK, 0 if error, Call IFFError() to know the reason
-* of the failure
+* Non-zero if successful, zero if error. Call IFFL_IFFError() to
+* know the reason of the failure
*
* NOTE
-* This routine needs at least 620 bytes of stack space
+* This routine needs at least 650 bytes of stack space
*
* SEE ALSO
*
@@ -81,7 +81,7 @@ DecodePicFunc: movem.l d2-d7/a2-a6,-(SP)
cmpi.l #'ILBM',8(a4) ; ist's überhaupt ein ILBM-File ?
beq.s 1$ ; ja --->
- moveq #IFF_NOILBM,d0 ; Fehlernummer
+ moveq #IFFL_ERROR_NOILBM,d0 ; Fehlernummer
bra .Error
1$:
*** BitMapHeader suchen und nach A2
@@ -89,7 +89,7 @@ DecodePicFunc: movem.l d2-d7/a2-a6,-(SP)
bsr GetBMHDFunc ; BitMapHeader suchen
;; tst.l d0
bne.s 2$ ; gefunden --->
- moveq #IFF_NOBMHD,d0 ; Fehlernummer
+ moveq #IFFL_ERROR_NOBMHD,d0 ; Fehlernummer
bra .Error
2$: movea.l d0,a2 ; A2: BitMapHeader
@@ -113,7 +113,7 @@ DecodePicFunc: movem.l d2-d7/a2-a6,-(SP)
bsr FindChunkFunc
;; tst.l d0
bne.s 4$ ; gefunden --->
- moveq #IFF_NOBODY,d0 ; Fehlernummer
+ moveq #IFFL_ERROR_NOBODY,d0 ; Fehlernummer
bra .Error
4$:
movea.l d0,a0 ; A0 : Body-Adresse
@@ -133,7 +133,7 @@ DecodePicFunc: movem.l d2-d7/a2-a6,-(SP)
lea DecrunchRow(PC),a6 ; CmpByteRun1
bra.s 7$ ; --->
6$:
- moveq #IFF_UNKNOWNCOMPRESSION,d0
+ moveq #IFFL_ERROR_BADCOMPRESSION,d0
bra.s .Error
7$:
*** Masking testen und wenn 'hasmask' (Stencil) D7.B:=$FF, sonst $00
diff --git a/Source/FindChunk.S b/Source/FindChunk.S
index 2ddea63..0b065a0 100644
--- a/Source/FindChunk.S
+++ b/Source/FindChunk.S
@@ -1,13 +1,13 @@
**
-** $Id: $
-** $Revision: $
+** $Id: FindChunk.S,v 1.1 92/05/12 22:26:33 chris Exp $
+** $Revision: 1.1 $
**
** $Filename: FindChunk.S $
-** $Author: Christian A. Weber $
+** $Author: chris $
** $Release: 19.1 $
-** $Date: 92/05/11 21:11:27 $
+** $Date: 92/05/12 22:26:33 $
**
-** iff.library/IFFLib_FindChunk
+** iff.library/IFFL_FindChunk
**
** COPYRIGHT (C) 1987-1992 BY CHRISTIAN A. WEBER, BRUGGERWEG 2,
** CH-8037 ZUERICH, SWITZERLAND. ALL RIGHTS RESERVED. NO PART
@@ -17,7 +17,7 @@
**
- IDNT IFFLib_FindChunk
+ IDNT IFFL_FindChunk
SECTION text,CODE
INCLUDE "IffLib.i"
@@ -25,26 +25,26 @@
XDEF FindChunkFunc
-******* iff.library/IFFLib_FindChunk ****************************************
+******* iff.library/IFFL_FindChunk ******************************************
*
* NAME
-* IFFLib_FindChunk -- find an IFF-chunk
+* IFFL_FindChunk -- find an IFF-chunk
*
* SYNOPSIS
-* chunk = IFFLib_FindChunk( ifffile, chunkname )
-* D0 A1 D0
+* chunk = IFFL_FindChunk( iff, chunkname )
+* D0 A1 D0
*
-* APTR IFFLib_FindChunk( IFFFILE, ULONG )
+* APTR IFFL_FindChunk( IFFL_HANDLE, ULONG )
*
* FUNCTION
* Find a specific chunk in an IFF file
*
* INPUTS
-* ifffile - pointer to a FORM, normally the result of OpenIFF()
+* iff - IFF file handle, from IFFL_OpenIFF()
* chunkname - 4 characters packed ASCII ('BODY', 'VHDR' ...)
* if chunkname is 0, FindChunk() returns a pointer to the
* first byte after the end of the current FORM. This can
-* be used byANIM readers for jumping from FORM to FORM.
+* be used by ANIM readers for jumping from FORM to FORM.
*
* RESULTS
* Pointer to the beginning of the chunk (that means to the chunk
@@ -54,7 +54,7 @@
* none known
*
* SEE ALSO
-* IFFLib_GetBMHD(), IFFLib_GetColorTab()
+* IFFL_GetBMHD(), IFFL_GetColorTab()
*
*****************************************************************************
diff --git a/Source/GetBMHD.S b/Source/GetBMHD.S
index 35aec40..af18de4 100644
--- a/Source/GetBMHD.S
+++ b/Source/GetBMHD.S
@@ -1,13 +1,13 @@
**
-** $Id: $
-** $Revision: $
+** $Id: GetBMHD.S,v 1.1 92/05/12 22:26:34 chris Exp $
+** $Revision: 1.1 $
**
** $Filename: GetBMHD.S $
-** $Author: Christian A. Weber $
+** $Author: chris $
** $Release: 19.1 $
-** $Date: 92/05/11 21:11:27 $
+** $Date: 92/05/12 22:26:34 $
**
-** iff.library/IFFLib_GetBMHD
+** iff.library/IFFL_GetBMHD
**
** COPYRIGHT (C) 1987-1992 BY CHRISTIAN A. WEBER, BRUGGERWEG 2,
** CH-8037 ZUERICH, SWITZERLAND. ALL RIGHTS RESERVED. NO PART
@@ -17,7 +17,7 @@
**
- IDNT IFFLib_GetBMHD
+ IDNT IFFL_GetBMHD
SECTION text,CODE
INCLUDE "IffLib.i"
@@ -26,29 +26,29 @@
XDEF GetBMHDFunc
-******* iff.library/IFFLib_GetBMHD ******************************************
+******* iff.library/IFFL_GetBMHD ********************************************
*
* NAME
-* IFFLib_GetBMHD -- find a BitMapHeader of an IFF-file
+* IFFL_GetBMHD -- find a BitMapHeader of an IFF-file
*
* SYNOPSIS
-* header = IFFLib_GetBMHD( ifffile )
-* D0 A1
+* header = IFFL_GetBMHD( iff )
+* D0 A1
*
-* struct BitMapHeader *IFFLib_GetBMHD( IFFFILE )
+* struct BitMapHeader *IFFL_GetBMHD( IFFL_HANDLE )
*
* FUNCTION
-* Returns a pointer to a 'BitMapHeader' structure as defined in
-* iff.h and iff.i
+* Returns a pointer to a BMHD (BitMapHeader) structure as defined
+* in iff.h and iff.i
*
* INPUTS
-* ifffile - IFF file pointer, returned by IFFLib_OpenIFF()
+* iff - IFF file handle, from IFFL_OpenIFF()
*
* RESULTS
* Pointer to the BitMapHeader, or NULL if no BMHD chunk found
*
* SEE ALSO
-* IFFLib_FindChunk(), IFFLib_GetColorTab()
+* IFFL_FindChunk(), IFFL_GetColorTab()
*
*****************************************************************************
@@ -57,7 +57,7 @@ GetBMHDFunc: movem.l d2/a5-a6,-(SP)
move.l #'BMHD',d0
bsr FindChunkFunc ; setzt Z-Flag wenn not found
bne.s 1$ ; Chunk gefunden --->
- moveq.l #IFF_NOBMHD,d0
+ moveq.l #IFFL_ERROR_NOBMHD,d0
bsr SetError
bra.s 99$
1$:
@@ -68,4 +68,5 @@ GetBMHDFunc: movem.l d2/a5-a6,-(SP)
99$: movem.l (SP)+,d2/a5-a6
rts
+
END
diff --git a/Source/GetColorTab.S b/Source/GetColorTab.S
index e7adcb6..7512653 100644
--- a/Source/GetColorTab.S
+++ b/Source/GetColorTab.S
@@ -1,13 +1,13 @@
**
-** $Id: $
-** $Revision: $
+** $Id: GetColorTab.S,v 1.1 92/05/12 22:26:12 chris Exp $
+** $Revision: 1.1 $
**
** $Filename: GetColorTab.S $
-** $Author: Christian A. Weber $
+** $Author: chris $
** $Release: 19.1 $
-** $Date: 92/05/11 21:11:27 $
+** $Date: 92/05/12 22:26:12 $
**
-** iff.library/IFFLib_GetColorTab
+** iff.library/IFFL_GetColorTab
**
** COPYRIGHT (C) 1987-1992 BY CHRISTIAN A. WEBER, BRUGGERWEG 2,
** CH-8037 ZUERICH, SWITZERLAND. ALL RIGHTS RESERVED. NO PART
@@ -17,7 +17,7 @@
**
- IDNT IFFLib_GetColorTab
+ IDNT IFFL_GetColorTab
SECTION text,CODE
INCLUDE "IFFLib.i"
@@ -26,14 +26,16 @@
XDEF GetColorTabFunc
-******* iff.library/IFFLib_GetColorTab **************************************
+******* iff.library/IFFL_GetColorTab ****************************************
*
* NAME
-* IFFLib_GetColorTab -- find a CMAP and convert it to a ColorTable
+* IFFL_GetColorTab -- find a CMAP and convert it to a ColorTable
*
* SYNOPSIS
-* count = IFFLib_GetColorTab( ifffile, colortable )
-* D0 A1 A0
+* count = IFFL_GetColorTab( iff, colortable )
+* D0 A1 A0
+*
+* LONG IFFFL_GetColorTab( IFF_HANDLE, UWORD * )
*
* FUNCTION
* Searches the CMAP chunk of an IFF file and converts it, if it's
@@ -41,7 +43,7 @@
* directly be used as a parameter for the LoadRGB4() function.
*
* INPUTS
-* ifffile - IFF file pointer, returned by IFFLib_OpenIFF()
+* iff - IFF file handle, from IFFL_OpenIFF()
* colortable - Pointer to a block of memory which must be large
* enough to hold the colortable (2 bytes per color).
* Must be WORD aligned.
@@ -51,7 +53,7 @@
* CMAP chunk
*
* SEE ALSO
-* IFFLib_FindChunk(), IFFLib_GetBMHD()
+* IFFL_FindChunk(), IFFL_GetBMHD()
*
*****************************************************************************
diff --git a/Source/GetViewModes.S b/Source/GetViewModes.S
index e6a10c6..bf5b4b9 100644
--- a/Source/GetViewModes.S
+++ b/Source/GetViewModes.S
@@ -1,13 +1,13 @@
**
-** $Id: $
-** $Revision: $
+** $Id: GetViewModes.S,v 1.1 92/05/12 22:26:49 chris Exp $
+** $Revision: 1.1 $
**
** $Filename: GetViewModes.S $
-** $Author: Christian A. Weber $
+** $Author: chris $
** $Release: 19.1 $
-** $Date: 92/05/11 21:11:27 $
+** $Date: 92/05/12 22:26:49 $
**
-** iff.library/IFFLib_GetViewModes
+** iff.library/IFFL_GetViewModes
**
** COPYRIGHT (C) 1987-1992 BY CHRISTIAN A. WEBER, BRUGGERWEG 2,
** CH-8037 ZUERICH, SWITZERLAND. ALL RIGHTS RESERVED. NO PART
@@ -17,7 +17,7 @@
**
- IDNT IFFLib_GetViewModes
+ IDNT IFFL_GetViewModes
SECTION text,CODE
INCLUDE "IffLib.i"
@@ -27,30 +27,32 @@
XDEF GetViewModesFunc
-******* iff.library/IFFLib_GetViewModes **************************************
+******* iff.library/IFFL_GetViewModes ***************************************
*
* NAME
-* IFFLib_GetViewModes() -- Get Amiga-specific ViewModes
+* IFFL_GetViewModes() -- Get Amiga-specific ViewModes
*
* SYNOPSIS
-* viewmodes = IFFLib_GetViewModes( ifffile )
-* D0 A1
+* viewmodes = IFFL_GetViewModes( iff )
+* D0 A1
*
-* ULONG IFFLib_GetViewModes( IFFFILE )
+* ULONG IFFL_GetViewModes( IFFL_HANDLE )
*
* FUNCTION
* Searches the IFF file for a 'CAMG' chunk which holds the view modes
* information. If there is no CAMG chunk, the view modes are calcu-
* lated using the information in the BitMapHeader structure.
-* You can directly put the low WORD of the result of a GetViewModes()
-* call into the ns_ViewModes field of a NewScreen structure. All
-* forbidden bits are masked out, as suggested by CBM.
+* You can directly put the low WORD of the result of a call to
+* IFFL_ GetViewModes() into the ns_ViewModes field of a NewScreen
+* structure, or you can use the whole ULONG for the SA_DisplayID tag
+* under OS 2.x.
*
* INPUTS
-* ifffile - IFF file pointer, returned from OpenIFF()
+* iff - IFF file handle, from OpenIFF()
*
* RESULT
-* viewmodes - LONG containing the view modes (HAM, LACE, HIRES ...)
+* viewmodes - ULONG containing the view modes (HAM, LACE, HIRES ...)
+* All forbidden bits are masked out, as suggested by CBM.
* Under Kickstart V1.3, only the lower WORD is used.
*
* BUGS
@@ -61,6 +63,7 @@
* the correct CAMG chunk.
*
* SEE ALSO
+* <graphics/displayinfo.h>
*
*****************************************************************************
@@ -121,4 +124,5 @@ NotHiRes:
NotInterlace:
rts
+
END
diff --git a/Source/IFFError.S b/Source/IFFError.S
index 3472f59..28936a0 100644
--- a/Source/IFFError.S
+++ b/Source/IFFError.S
@@ -1,13 +1,13 @@
**
-** $Id: $
-** $Revision: $
+** $Id: IFFError.S,v 1.1 92/05/12 22:26:38 chris Exp $
+** $Revision: 1.1 $
**
** $Filename: IFFError.S $
-** $Author: Christian A. Weber $
+** $Author: chris $
** $Release: 19.1 $
-** $Date: 92/05/11 21:11:27 $
+** $Date: 92/05/12 22:26:38 $
**
-** iff.library/IFFLib_IFFError
+** iff.library/IFFL_IFFError
**
** COPYRIGHT (C) 1987-1992 BY CHRISTIAN A. WEBER, BRUGGERWEG 2,
** CH-8037 ZUERICH, SWITZERLAND. ALL RIGHTS RESERVED. NO PART
@@ -17,7 +17,7 @@
**
- IDNT IFFLib_IFFError
+ IDNT IFFL_IFFError
SECTION text,CODE
INCLUDE "IFFLib.i"
@@ -26,20 +26,20 @@
XDEF IFFErrorFunc
-******* iff.library/IFFLib_IFFError *****************************************
+******* iff.library/IFFL_IFFError *******************************************
*
* NAME
-* IFFLib_IFFError -- Get detailed error descrpition
+* IFFL_IFFError -- Get detailed error descrpition after an error
*
* SYNOPSIS
-* error = IFFLib_IFFError()
+* error = IFFL_IFFError()
* D0
*
-* LONG IFFLib_IFFError( void )
+* LONG IFFL_IFFError( VOID )
*
* FUNCTION
-* If one of the above functions returns zero, you can call
-* IFFLib_IFFError() to know the reason for the failure. An error
+* If one of the iff.library functions returns zero, you can call
+* IFFL_IFFError() to know the reason for the failure. An error
* code is returned, please refer to the files 'iff.h' or 'iff.i'
* for the complete list of errors.
*
@@ -48,32 +48,7 @@
*
* RESULT
* Error-number generated by the latest function call, or zero if
-* no error
-*
-* Cuurently the following numbers are used:
-*
-* Nr. Symbol Function Description
-*
-* 16 IFF_CANTOPENFILE OpenIFF() File not found
-* 17 IFF_READERROR OpenIFF() Read() returned an error
-* 18 IFF_NOMEM OpenIFF() Not enough memory for the file
-* 19 IFF_NOTIFF OpenIFF() File is not IFF
-* 20 IFF_WRITEERROR SaveBitMap() Cannot write the file
-*
-* 24 IFF_NOILBM DecodePic() IFF file is not an ILBM file
-* 25 IFF_NOBMHD DecodePic() BMHD chunk not found
-* 26 IFF_NOBODY DecodePic() BODY chunk not found
-* 27 IFF_TOOMANYPLANES DecodePic() Picture has more planes than the
-* BitMap (OBSOLETE SINCE 18.7!)
-* 28 IFF_UNKNOWNCOMPRESSION " Unknown compression type
-* 29 IFF_NOANHD ModifyFrame() ANHD chunk not found
-* 30 IFF_NODLTA ModifyFrame() DLTA chunk not found
-*
-* -1 IFF_BADTASK A task which did not open the IFF library
-* tried to call IFFError(). Since the IFF
-* library is capable of multi-tasking, the
-* error-values are stored for each task
-* separately.
+* no error.
*
* BUGS
* If you don't close the IFF library at the end of your program
@@ -82,19 +57,20 @@
* (This is not a bug, it's a feature ;-))
*
* SEE ALSO
+* <iff.h>
*
*****************************************************************************
*** Unseren Node nach D0 und A0 bringen, Set Z-Flag if not found
-FindOurNode: movea.l ib_SysBase(a5),a6
+FindOurNode: movea.l iffb_SysBase(a5),a6
move.l ThisTask(a6),d1
- move.l ib_ErrList(a5),d0 ; 1. Node in Error Liste
+ move.l iffb_ErrList(a5),d0 ; 1. Node in Error Liste
.findloop: movea.l d0,a0 ; next node
move.l LN_SUCC(a0),d0
beq.s .findend ; ---> Ende (Z-Flag gesetzt)
- cmp.l er_Task(a0),d1 ; Unser Node ?
+ cmp.l ifferr_Task(a0),d1 ; Unser Node ?
bne.s .findloop
move.l a0,d0 ; unser Node, Clear Z-Flag
.findend: rts
@@ -102,39 +78,39 @@ FindOurNode: movea.l ib_SysBase(a5),a6
*****************************************************************************
-ClearError: bsr FindOurNode ; Node nach D0 und A0
+ClearError: bsr FindOurNode ; Node nach D0 und A0
;; tst.l d0
- beq.s 1$ ; no node ---> nichts eintragen
- clr.l er_Error(a0)
-1$: moveq #1,d0 ; Code für 'OK'
+ beq.s 1$ ; no node ---> nichts eintragen
+ clr.l ifferr_Error(a0)
+1$: moveq #1,d0 ; Code für 'OK'
rts
*****************************************************************************
-SetError: move.l d0,-(SP) ; Error-Nummer retten
- bsr FindOurNode ; Node nach D0 und A0
+SetError: move.l d0,-(SP) ; Error-Nummer retten
+ bsr FindOurNode ; Node nach D0 und A0
;; tst.l d0
- beq.s 1$ ; no node ---> nichts eintragen
- move.l (SP),er_Error(a0)
+ beq.s 1$ ; kein Node ---> nichts eintragen
+ move.l (SP),ifferr_Error(a0)
1$:
addq.l #4,SP
- moveq #0,d0 ; Code für 'Error'
+ moveq #0,d0 ; Code für 'Error'
rts
*****************************************************************************
IFFErrorFunc: movem.l a5-a6,-(SP)
- movea.l a6,a5 ; IFFBase
- bsr FindOurNode ; Node nach D0 und A0
+ movea.l a6,a5 ; IFFBase
+ bsr FindOurNode ; Node nach D0 und A0
;; tst.l d0
- beq.s 1$ ; kein Node ---> Fehler!!
- move.l er_Error(a0),d0
- clr.l er_Error(a0) ; Error rücksetzen
+ beq.s 1$ ; kein Node ---> Fehler!!
+ move.l ifferr_Error(a0),d0
+ clr.l ifferr_Error(a0) ; Error rücksetzen
2$: movem.l (SP)+,a5-a6
rts
1$:
- moveq #IFF_BADTASK,d0
+ moveq #IFFL_ERROR_BADTASK,d0
bra.s 2$
END
diff --git a/Source/IFFLib.S b/Source/IFFLib.S
index 2150632..3ce284c 100644
--- a/Source/IFFLib.S
+++ b/Source/IFFLib.S
@@ -1,11 +1,11 @@
**
-** $Id: $
-** $Revision: $
+** $Id: IFFLib.S,v 1.1 92/05/12 22:26:51 chris Exp $
+** $Revision: 1.1 $
**
** $Filename: IFFLib.S $
-** $Author: Christian A. Weber $
+** $Author: chris $
** $Release: 19.1 $
-** $Date: 92/05/11 21:11:27 $
+** $Date: 92/05/12 22:26:51 $
**
** Disk-resident library for simple IFF file I/O. Does not handle
** nested PROPs and CATs. Contains special ILBM support routines.
@@ -48,6 +48,8 @@
** 13-Apr-90 V 18.7 DecodePic geht bis 24 Bitplanes
** 07-Oct-90 V 19.1 SaveClip() speichert 256 Farben bei 24 Planes
** An neue 2.0 Includefiles angepasst (JSRLIB..)
+**
+**
IDNT IFFLib
SECTION text,CODE
@@ -58,7 +60,7 @@
XREF FindOurNode ; Error-Node finden
- XREF OpenIFFFunc
+ XREF OldOpenIFFFunc
XREF CloseIFFFunc
XREF FindChunkFunc
XREF GetBMHDFunc
@@ -68,7 +70,7 @@
XREF SaveClipFunc
XREF IFFErrorFunc
XREF GetViewModesFunc
- XREF NewOpenIFFFunc
+ XREF OldNewOpenIFFFunc
XREF ModifyFrameFunc
IFD PP_VERSION
XREF PPOpenIFFFunc
@@ -101,9 +103,9 @@ FirstByte:
lea MyLibInfo(PC),a0 ; Adresse des ID-Strings
move.l a0,d2
IFD PP_VERSION
- moveq.l #65,d3 ; Länge des ID-Strings
+ moveq.l #67,d3 ; Länge des ID-Strings
ELSEIF
- moveq.l #45,d3 ; Länge des ID-Strings
+ moveq.l #42,d3 ; Länge des ID-Strings
ENDC
JSRLIB Write
movea.l a6,a1
@@ -127,16 +129,16 @@ MyROMTag: DC.W RTC_MATCHWORD
IFD PP_VERSION
MyLibName: DC.B "iffpp.library",0
-MyLibInfo: DC.B "IFFPP 100.3 (01-Jul-1990) Copyright © 1990 by Christian A. Weber",10,0
+MyLibInfo: DC.B "IFFPP 101.1 (14.05.92) Copyright © 1990-1992 by Christian A. Weber",10,0
ELSEIF
MyLibName: DC.B "iff.library",0
-MyLibInfo: DC.B "IFF 19.1 (09-Oct-1990) by Christian A. Weber",10,0
+MyLibInfo: DC.B "IFF 19.1 (14.05.92) by Christian A. Weber",10,0
ENDC
DOSName: DC.B "dos.library",0
EVEN
-Init: DC.L ib_SIZEOF ; data space size
+Init: DC.L iffb_SIZEOF ; data space size
DC.L FuncTable ; Zeiger auf Funktions-Initializers
DC.L DataTable ; Zeiger auf Data-Initializers
DC.L InitRoutine ; Initialisierungs-Routine
@@ -153,7 +155,7 @@ FuncTable: ;; DC.W -1 ; Switch to WORD-Offset-Mode
*** Jetzt unsere IFF-Routinen:
- DC.L OpenIFFFunc ; Offset -30
+ DC.L OldOpenIFFFunc ; Offset -30
DC.L CloseIFFFunc ; Offset -36
DC.L FindChunkFunc ; Offset -42
DC.L GetBMHDFunc ; Offset -48
@@ -163,7 +165,7 @@ FuncTable: ;; DC.W -1 ; Switch to WORD-Offset-Mode
DC.L SaveClipFunc ; Offset -72
DC.L IFFErrorFunc ; Offset -78
DC.L GetViewModesFunc ; Offset -84
- DC.L NewOpenIFFFunc ; Offset -90
+ DC.L OldNewOpenIFFFunc ; Offset -90
DC.L ModifyFrameFunc ; Offset -96
IFD PP_VERSION
DC.L PPOpenIFFFunc ; Offset -102
@@ -187,18 +189,18 @@ DataTable: INITBYTE LN_TYPE,NT_LIBRARY
InitRoutine: movem.l d0-d1/a0-a1/a5,-(SP)
movea.l d0,a5 ; Library pointer
- move.l a6,ib_SysBase(a5) ; Save SysBase
- move.l a0,ib_SegList(a5) ; Save SegList
+ move.l a6,iffb_SysBase(a5) ; Save SysBase
+ move.l a0,iffb_SegList(a5) ; Save SegList
*** Dos-Library öffnen
lea DOSName(PC),a1 ; dos.library öffnen
JSRLIB OldOpenLibrary
- move.l d0,ib_DOSBase(a5) ; DosBase merken
+ move.l d0,iffb_DOSBase(a5) ; DosBase merken
*** Error-Liste initialisieren
- lea ib_ErrList(a5),a0
+ lea iffb_ErrList(a5),a0
move.l a0,(a0) ; NewList
addq.l #4,(a0)
clr.l 4(a0)
@@ -221,9 +223,9 @@ OpenFunc: movem.l d1/a0-a2/a5-a6,-(SP)
*** Speicher für neuen Error-Node reservieren
- moveq.l #er_SIZEOF,d0 ; Amount
+ moveq.l #ifferr_SIZEOF,d0 ; Amount
move.l #MEMF_PUBLIC|MEMF_CLEAR,d1 ; Requirements
- movea.l ib_SysBase(a5),a6
+ movea.l iffb_SysBase(a5),a6
JSRLIB AllocMem
tst.l d0
beq.s .OpenError ; Error ---> 0 zurückgeben
@@ -231,11 +233,11 @@ OpenFunc: movem.l d1/a0-a2/a5-a6,-(SP)
*** Error-Node initialisieren: Task eintragen
- move.l ThisTask(a6),er_Task(a2)
+ move.l ThisTask(a6),ifferr_Task(a2)
*** Error-Node an Liste anhängen
- lea ib_ErrList(a5),a0 ; Liste
+ lea iffb_ErrList(a5),a0 ; Liste
movea.l a2,a1 ; Node
JSRLIB AddTail
@@ -264,10 +266,10 @@ CloseFunc: movem.l a2/a5-a6,-(SP)
beq.s 1$ ; nicht gefunden --->
movea.l d0,a2 ; ErrorNode retten
movea.l d0,a1
- movea.l ib_SysBase(a5),a6
+ movea.l iffb_SysBase(a5),a6
JSRLIB Remove
- moveq.l #er_SIZEOF,d0
+ moveq.l #ifferr_SIZEOF,d0
movea.l a2,a1
JSRLIB FreeMem
1$: movem.l (SP)+,a2/a5-a6
@@ -298,12 +300,12 @@ ExpungeFunc: movem.l d2/a5-a6,-(SP)
bra.s 99$
1$:
movea.l a5,a1 ; LibPtr (zeigt auf NODE)
- movea.l ib_SysBase(a5),a6
+ movea.l iffb_SysBase(a5),a6
JSRLIB Remove ; Library aus Liste entfernen
- movea.l ib_DOSBase(a5),a1 ; dos.library schliessen
+ movea.l iffb_DOSBase(a5),a1 ; dos.library schliessen
JSRLIB CloseLibrary
- move.l ib_SegList(a5),d2 ; Segmentliste retten
+ move.l iffb_SegList(a5),d2 ; Segmentliste retten
moveq.l #0,d0
movea.l a5,a1 ; LibPtr
diff --git a/Source/ModifyFrame.S b/Source/ModifyFrame.S
index 46fe5ec..d29f300 100644
--- a/Source/ModifyFrame.S
+++ b/Source/ModifyFrame.S
@@ -1,13 +1,13 @@
**
-** $Id: $
-** $Revision: $
+** $Id: ModifyFrame.S,v 1.1 92/05/12 22:26:40 chris Exp $
+** $Revision: 1.1 $
**
** $Filename: ModifyFrame.S $
-** $Author: Christian A. Weber $
+** $Author: chris $
** $Release: 19.1 $
-** $Date: 92/05/11 21:11:27 $
+** $Date: 92/05/12 22:26:40 $
**
-** iff.library/IFFLib_ModifyFrame
+** iff.library/IFFL_ModifyFrame
**
** COPYRIGHT (C) 1987-1992 BY CHRISTIAN A. WEBER, BRUGGERWEG 2,
** CH-8037 ZUERICH, SWITZERLAND. ALL RIGHTS RESERVED. NO PART
@@ -17,7 +17,7 @@
**
- IDNT IFFLib_ModifyFrame
+ IDNT IFFL_ModifyFrame
SECTION text,CODE
INCLUDE "IFFLib.i"
@@ -26,16 +26,16 @@
XDEF ModifyFrameFunc
-******* iff.library/IFFLib_ModifyFrame **************************************
+******* iff.library/IFFL_ModifyFrame ****************************************
*
* NAME
-* IFFLib_ModifyFrame -- Modify an anim frame using a DLTA chunk
+* IFFL_ModifyFrame -- Modify an anim frame using a DLTA chunk
*
* SYNOPSIS
-* success = IFFLib_ModifyFrame( modifyform, bitmap )
-* D0 A1 A0
+* success = IFFL_ModifyFrame( modifyform, bitmap )
+* D0 A1 A0
*
-* BOOL IFFLib_ModifyFrame( void *, struct BitMap * )
+* BOOL IFFL_ModifyFrame( VOID *, struct BitMap * )
*
* FUNCTION
* Uses the DLTA chunk of the supplied FORM to modify the planes-data
@@ -46,29 +46,30 @@
*
* INPUTS
* modifyform - pointer to the FORM containing the actual DLTA chunk
-* bitmap - Pointer to a properly initialized BitMap structure,
-* the planes must contain the image which was displayed
-* to frames back (using double-buffering)
+* bitmap - Pointer to a properly initialized BitMap structure,
+* the planes must contain the image which was displayed
+* to frames back (using double-buffering)
*
* RESULT
-* Non-zero if OK, 0 if error; call IFFError() to know the reason
+* Non-zero if OK, 0 if error; call IFFL_IFFError() to know the reason
* of the failure
*
* RESTRICTIONS
* Currently, only compression type 5 (Byte Vertical Delta Mode) is
* implemented. If you have animations which use modes 1 to 4, try
* loading them with DPaint III and saving them again.
-* Sculpt-Animate pictures do not work, because I have no documentation
-* about the compression scheme they use.
+* Sculpt-Animate ('J' type ANIM, Movie format) support will be
+* added soon.
* I will implement some more compression types upon request.
*
-* WARNINGS
+* NOTE
* This routine needs at least 820 bytes of stack.
* The size of the bitmap is not checked by this routine, the planes
* must have at least the size described in the BMHD of the anim
* file.
*
-* BUGS
+* SEE ALSO
+* IFFL_IFFError()
*
*****************************************************************************
@@ -100,7 +101,7 @@ ModifyFrameFunc:
cmpi.l #'ILBM',8(a4) ; ILBM-Form ?
beq.s 3$ ; ja --->
- moveq #IFF_NOILBM,d0 ; Fehlernummer
+ moveq #IFFL_ERROR_NOILBM,d0 ; Fehlernummer
bra .Error
3$:
*** AnimHeader suchen und nach A2
@@ -110,7 +111,7 @@ ModifyFrameFunc:
bsr FindChunkFunc
;; tst.l d0
bne.s 4$ ; gefunden --->
- moveq #IFF_NOANHD,d0 ; Fehlernummer
+ moveq #IFFL_ERROR_NOANHD,d0 ; Fehlernummer
bra .Error
4$:
addq.l #8,d0 ; ANHD.... überhüpfen
@@ -124,7 +125,7 @@ ModifyFrameFunc:
lea MakePlane(PC),a6
bra.s 6$
5$:
- moveq #IFF_UNKNOWNCOMPRESSION,d0
+ moveq #IFFL_ERROR_BADCOMPRESSION,d0
bra.s .Error
6$:
*** DLTA-Chunk finden und nach A4
@@ -133,7 +134,7 @@ ModifyFrameFunc:
move.l #'DLTA',d0
bsr FindChunkFunc ; Start der Daten
bne.s 7$ ; gefunden --->
- moveq #IFF_NODLTA,d0 ; Fehlernummer
+ moveq #IFFL_ERROR_NODLTA,d0 ; Fehlernummer
bra .Error
7$:
addq.l #8,d0 ; DLTA.... überhüpfen
@@ -253,6 +254,5 @@ ColumnDbf: dbf d4,ColumnLoop ; Nächste Kolonne --->
movem.l (SP)+,d0-d5/a0-a1/a3
rts
-*****************************************************************************
END
diff --git a/Source/SaveBitMap.S b/Source/SaveBitMap.S
index 15607c3..91fc2c9 100644
--- a/Source/SaveBitMap.S
+++ b/Source/SaveBitMap.S
@@ -1,13 +1,13 @@
**
-** $Id: $
-** $Revision: $
+** $Id: SaveBitMap.S,v 1.1 92/05/12 22:26:54 chris Exp $
+** $Revision: 1.1 $
**
** $Filename: SaveBitMap.S $
-** $Author: Christian A. Weber $
+** $Author: chris $
** $Release: 19.1 $
-** $Date: 92/05/11 21:11:27 $
+** $Date: 92/05/12 22:26:54 $
**
-** iff.library/IFFLib_SaveBitMap
+** iff.library/IFFL_SaveBitMap
**
** COPYRIGHT (C) 1987-1992 BY CHRISTIAN A. WEBER, BRUGGERWEG 2,
** CH-8037 ZUERICH, SWITZERLAND. ALL RIGHTS RESERVED. NO PART
@@ -17,7 +17,7 @@
**
- IDNT IFFLib_SaveBitMap
+ IDNT IFFL_SaveBitMap
SECTION text,CODE
INCLUDE "IFFLib.i"
@@ -26,16 +26,16 @@
XDEF SaveBitMapFunc
-******* iff.library/IFFLib_SaveBitMap ***************************************
+******* iff.library/IFFL_SaveBitMap *****************************************
*
* NAME
-* IFFLib_SaveBitMap -- save the planes of a BitMap as an IFF-file
+* IFFL_SaveBitMap -- save the planes of a BitMap as an IFF-file
*
* SYNOPSIS
-* result = IFFLib_SaveBitMap( filename, bitmap, colortable, flags )
-* D0 A0 A1 A2 D0
+* result = IFFL_SaveBitMap( filename, bitmap, colortable, flags )
+* D0 A0 A1 A2 D0
*
-* BOOL IFFLib_SaveBitMap(char *, struct BitMap *, UWORD *, ULONG )
+* BOOL IFFL_SaveBitMap(char *, struct BitMap *, UWORD *, ULONG )
*
* FUNCTION
* Save the planes of a BitMap as an IFF-file, optionally with a
@@ -59,14 +59,14 @@
* 0 = This is a normal or Extra-Halfbrite picture
*
* RESULT
-* Non-zero if successful, 0 if error, Call IFFLib_IFFError() to know
+* Non-zero if successful, 0 if error, Call IFFL_IFFError() to know
* more about the reason of the failure
*
* NOTE
-* This routine needs 620 bytes of stack space
+* This routine needs 650 bytes of stack space
*
* SEE ALSO
-* SaveClip
+* IFFL_SaveClip()
*
*****************************************************************************
diff --git a/Source/SaveClip.S b/Source/SaveClip.S
index eb2fbaf..ecc4925 100644
--- a/Source/SaveClip.S
+++ b/Source/SaveClip.S
@@ -1,13 +1,13 @@
**
-** $Id: $
-** $Revision: $
+** $Id: SaveClip.S,v 1.1 92/05/12 22:26:45 chris Exp $
+** $Revision: 1.1 $
**
** $Filename: SaveClip.S $
-** $Author: Christian A. Weber $
+** $Author: chris $
** $Release: 19.1 $
-** $Date: 92/05/11 21:11:27 $
+** $Date: 92/05/12 22:26:45 $
**
-** iff.library/IFFLib_SaveClip
+** iff.library/IFFL_SaveClip
**
** COPYRIGHT (C) 1987-1992 BY CHRISTIAN A. WEBER, BRUGGERWEG 2,
** CH-8037 ZUERICH, SWITZERLAND. ALL RIGHTS RESERVED. NO PART
@@ -17,7 +17,7 @@
**
- IDNT IFFLib_SaveClip
+ IDNT IFFL_SaveClip
SECTION text,CODE
INCLUDE "IFFLib.i"
@@ -26,13 +26,13 @@
XDEF SaveClipFunc
-******* iff.library/IFFLib_SaveClip *****************************************
+******* iff.library/IFFL_SaveClip *******************************************
*
* NAME
-* IFFLib_SaveClip -- save a part of a BitMap as an IFF-file
+* IFFL_SaveClip -- save a part of a BitMap as an IFF-file
*
* SYNOPSIS
-* result = IFFLib_SaveClip
+* result = IFFL_SaveClip
* D0 ( filename, bitmap, coltab, flags, xoff, yoff, width, height )
* A0 A1 A2 D0 D1 D2 D3 D4
*
@@ -54,18 +54,18 @@
* height - height in lines of the rectangle
*
* RESULTS
-* Non-zero if successful, 0 if error, Call IFFLib_IFFError() to
+* Non-zero if successful, 0 if error, Call IFFL_IFFError() to
* know more about the reason of the failure
*
* NOTE
-* This routine needs 620 bytes of stack space
+* This routine needs 650 bytes of stack space
*
* BUGS
* The width of the rectangle will be rounded to WORD boundaries,
* because DPAINT wants it!
*
* SEE ALSO
-* IFFLib_SaveBitMap()
+* IFFL_SaveBitMap()
*
*****************************************************************************
@@ -191,7 +191,7 @@ SaveClipFunc: movem.l d2-d7/a2-a6,-(SP)
nocmap: move.l d6,d1 ; FileName
move.l #MODE_NEWFILE,d2
- movea.l ib_DOSBase(a5),a6
+ movea.l iffb_DOSBase(a5),a6
JSRLIB Open
move.l d0,d7 ; D7 : FileHandle
beq writeerror
@@ -268,7 +268,7 @@ nocmap: move.l d6,d1 ; FileName
writeerror: move.l d7,d1 ; File
beq.s 1$ ; schon / nochzu!
JSRLIB Close
-1$: moveq #IFF_WRITEERROR,d0
+1$: moveq #IFFL_ERROR_WRITE,d0
bsr SetError ; Error setzen, D0 := 0
SaveClip_End: adda.w #sb_datasize,SP ; Speicher wirder freigeben
@@ -487,4 +487,5 @@ CountEq: move.l a0,-(SP)
3$: move.l (SP)+,a0
rts
+
END