From 36c824864c02f0a3f62c8a1d365d1670835c8c96 Mon Sep 17 00:00:00 2001 From: "Christian A. Weber" Date: Tue, 12 May 1992 22:26:12 +0000 Subject: Initial revision --- Source/SaveBitMap.S | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Source/SaveBitMap.S (limited to 'Source/SaveBitMap.S') diff --git a/Source/SaveBitMap.S b/Source/SaveBitMap.S new file mode 100644 index 0000000..15607c3 --- /dev/null +++ b/Source/SaveBitMap.S @@ -0,0 +1,82 @@ +** +** $Id: $ +** $Revision: $ +** +** $Filename: SaveBitMap.S $ +** $Author: Christian A. Weber $ +** $Release: 19.1 $ +** $Date: 92/05/11 21:11:27 $ +** +** iff.library/IFFLib_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 IFFLib_SaveBitMap + SECTION text,CODE + + INCLUDE "IFFLib.i" + + XREF SaveClipFunc + XDEF SaveBitMapFunc + + +******* iff.library/IFFLib_SaveBitMap *************************************** +* +* NAME +* IFFLib_SaveBitMap -- save the planes of a BitMap as an IFF-file +* +* SYNOPSIS +* result = IFFLib_SaveBitMap( filename, bitmap, colortable, flags ) +* D0 A0 A1 A2 D0 +* +* BOOL IFFLib_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 error, Call IFFLib_IFFError() to know +* more about the reason of the failure +* +* NOTE +* This routine needs 620 bytes of stack space +* +* SEE ALSO +* 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 -- cgit v1.2.3