🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #10497

Re: IFF.LIBRARY

#10497
From: Mike (I'll think of something ye...
Date: Tue, 06 Dec 1988 02:53
114 lines
3127 bytes
I'd add a "#ifndef" around those pragmas. I also turned the function
declarations into prototypes:


/************** F U N C T I O N   D E C L A R A T I O N S ***************/

APTR OpenIFF(char *);
void CloseIFF(APTR);
struct Chunk *FindChunk(APTR, char *);
struct BitMapHeader *GetBMHD(APTR);
LONG GetColorTab(APTR, UWORD *);
BOOL DecodePic(APTR, struct BitMap *);
BOOL SaveBitMap(char *, struct BitMap *, UWORD *, long);
BOOL SaveClip(char *, struct BitMap *, UWORD *, int, int, int, int, int);
LONG IffError(void);


/************** F U N C T I O N   P R A G M A S ***************/

#ifndef NOPRAGMA
#pragma libcall IFFBase OpenIFF 1e 801
#pragma libcall IFFBase CloseIFF 24 901
#pragma libcall IFFBase FindChunk 2a 0902
#pragma libcall IFFBase GetBMHD 30 901
#pragma libcall IFFBase GetColorTab 36 8902
#pragma libcall IFFBase DecodePic 3c 8902
#pragma libcall IFFBase SaveBitMap 42 0A9804
#pragma libcall IFFBase SaveClip 48 43210A9808
#pragma libcall IFFBase IffError 4e 00
#pragma libcall IFFBase GetViewModes 54 901
#endif


Finally, for those who want it, here's the assembler interface for
Lattice. Just asm it, copy the library into lib: as lib.o, and then
link it with programs that need the iff.library (assuming you compiled
with NOPRAGMA defined).

	<mike

; asm interface to iff.library
		csect	text

; Pointer to the library, supplied by the caller
		xref	_IFFBase

		xdef	_OpenIFF
_OpenIFF:	move.l	4(sp),a0
		move.l	_IFFBase,a6
		jmp	-30(a6)

		xdef	_CloseIFF
_CloseIFF:	move.l	4(sp),a1
		move.l	_IFFBase,a6
		jmp	-36(a6)

		xdef	_FindChunk
_FindChunk:	move.l	4(sp),a1
		move.l	8(sp),d0
		move.l	_IFFBase,a6
		jmp	-42(a6)

		xdef	_GetBMHD
_GetBMHD:	move.l	4(sp),a1
		move.l	_IFFBase,a6
		jmp	-48(a6)

		xdef	_GetColorTab
_GetColorTab:	move.l	4(sp),a1
		move.l	8(sp),a0
		move.l	_IFFBase,a6
		jmp	-54(a6)

		xdef	_DecodePic
_DecodePic:	move.l	4(sp),a1
		move.l	8(sp),a0
		move.l	_IFFBase,a6
		jmp	-60(a6)

		xdef	_SaveBitMap
_SaveBitMap:	move.l	a2,-(sp)
		movem.l	8(sp),a0/a1/a2
		move.l	20(sp),d0
		move.l	_IFFBase,a6
		jsr	-66(a6)
		move.l	(sp)+,a2
		rts

		xdef	_SaveClip
_SaveClip:	movem.l	d4/a2,-(sp)
		movem.l	24(sp),d0-d4
		movem.l	12(sp),a0-a2
		move.l	_IFFBase,a6
		jsr	-72(a6)
		movem.l	(sp)+,d4/a2
		rts

		xdef	_IffError
_IffError:	move.l	_IFFBase,a6
		jmp	-78(a6)

		xdef	_GetViewModes
_GetViewModes:	move.l	4(sp),a1
		move.l	_IFFBase,a6
		jmp	-84(a6)

		end

--
I know the world is flat.				Mike Meyer
Don't try tell me that it's round.			mwm@berkeley.edu
I know the world stands still.				ucbvax!mwm
Don't try to make it turn around.			mwm@ucbjade.BITNET
Technical Details
Message-ID: <17861@agate.BERKELEY.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!pacbell!ames!pasteur!agate!eris.berkeley.edu!mwm
References: <62827UH2@PSUVM> <587@wuphys.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!pacbell!ames!pasteur!agate!eris.berkeley.edu!mwm
From: mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer)
Newsgroups: comp.sys.amiga.tech
Subject: Re: IFF.LIBRARY
Message-ID: <17861@agate.BERKELEY.EDU>
Date: 6 Dec 88 02:53:42 GMT
References: <62827UH2@PSUVM> <587@wuphys.UUCP>
Sender: usenet@agate.BERKELEY.EDU
Organization: Missionaria Phonibalonica
Lines: 114