** ** $Id: SaveBitMap.S,v 21.2 92/05/18 02:15:32 chris Exp $ ** $Revision: 21.2 $ ** ** $Filename: SaveBitMap.S $ ** $Author: chris $ ** $Date: 92/05/18 02:15:32 $ ** ** iff.library/IFFL_SaveBitMap ** ** COPYRIGHT (C) 1987-1992 BY CHRISTIAN A. WEBER, BRUGGERWEG 2, ** CH-8037 ZUERICH, SWITZERLAND. ALL RIGHTS RESERVED. NO PART ** OF THIS SOFTWARE MAY BE COPIED, REPRODUCED, OR TRANSMITTED ** IN ANY FORM OR BY ANY MEANS, WITHOUT THE PRIOR WRITTEN PER- ** MISSION OF THE AUTHOR. USE AT YOUR OWN RISK. ** IDNT IFFL_SaveBitMap SECTION text,CODE INCLUDE "IFFLib.i" XREF SaveClipFunc XDEF SaveBitMapFunc ******* iff.library/IFFL_SaveBitMap ***************************************** * * NAME * IFFL_SaveBitMap -- save the planes of a BitMap as an IFF-file * * SYNOPSIS * result = IFFL_SaveBitMap( filename, bitmap, colortable, flags ) * D0 A0 A1 A2 D0 * * BOOL IFFL_SaveBitMap(char *, struct BitMap *, UWORD *, ULONG ) * * FUNCTION * Save the planes of a BitMap as an IFF-file, optionally with a * colortable. The IFF file will contain the following chunks: * * FORM - The IFF header, with the type ILBM * BMHD - The BitMap Header structre * CMAP - The color map, this chunk is omitted if colortable is zero * CAMG - The Amiga ViewModes word, contains the special ViewModes * information (HAM, LACE, HIRES ...) * BODY - The (crunched or uncompressed) picture * * INPUTS * filename - Name of the IFF file to create * bitmap - Pointer to the BitMap holding your picture * colortable - Pointer to an Amiga ColorTable structure or zero * (if colortable = 0, no CMAP chunk will be generated). * flags - Bit 0: 1 = Use the "CmpByteRun1" compression algorythm, * 0 = Save the file uncompressed * Bit 7: 1 = This is a HAM (Hold and modify) picture * 0 = This is a normal or Extra-Halfbrite picture * * RESULT * Non-zero if successful, 0 if an error occurred. You can then call * IFFL_IFFError() to know more about the reason of the failure. * * NOTE * Up to V19 this routine needs at least 650 bytes of stack space * * SEE ALSO * IFFL_SaveClip() * ***************************************************************************** SaveBitMapFunc: movem.l d2-d4,-(SP) moveq #0,d1 ; X-Offset : 0 moveq #0,d2 ; Y-Offset : 0 move.w bm_BytesPerRow(a1),d3 ; Breite : maximal move.w bm_Rows(a1),d4 ; Höhe : maximal bsr SaveClipFunc ; als Ausschnitt speichern movem.l (SP)+,d2-d4 rts END