diff options
| author | Christian A. Weber <chris@gna.ch> | 1993-05-24 15:46:47 +0000 | 
|---|---|---|
| committer | Christian A. Weber <chris@gna.ch> | 1993-05-24 15:46:47 +0000 | 
| commit | 352ff7df4e1869743f238de34c975129a97c3d33 (patch) | |
| tree | 5ec9c1c07e0257f55f5b3c26b94b78f92994edd1 /Source | |
| parent | 937e75f81313bfaa7d3442275f0cd6873a07d10f (diff) | |
| download | iff-library-352ff7df4e1869743f238de34c975129a97c3d33.tar.gz iff-library-352ff7df4e1869743f238de34c975129a97c3d33.tar.bz2 iff-library-352ff7df4e1869743f238de34c975129a97c3d33.zip | |
FORMs können jetzt verschachtelt werden bei Push/PopChunk()
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/IFFLib.S | 44 | ||||
| -rw-r--r-- | Source/PushChunk.S | 34 | 
2 files changed, 43 insertions, 35 deletions
| diff --git a/Source/IFFLib.S b/Source/IFFLib.S index 9361edb..9d0348f 100644 --- a/Source/IFFLib.S +++ b/Source/IFFLib.S @@ -1,11 +1,10 @@  ** -**	$Id: IFFLib.S,v 22.1 92/06/02 16:49:02 chris Exp $ -**	$Revision: 22.1 $ +**	$Id: IFFLib.S,v 22.2 92/06/03 23:46:04 chris Exp $ +**	$Revision: 22.2 $  **  **	$Filename: IFFLib.S $  **	$Author: chris $ -**	$Release: 19.1 $ -**	$Date: 92/06/02 16:49:02 $ +**	$Date: 92/06/03 23:46:04 $  **  **	Disk-resident library for simple IFF file I/O. Does not handle  **	nested PROPs and CATs. Contains special ILBM support routines. @@ -55,8 +54,11 @@  		SECTION	text,CODE  * PP_VERSION +* DELEXP	; Wenn definiert wird Delayed Expunge unterstützt +  		INCLUDE	"IFFLib.i" +		INCLUDE	"IFF_rev.i"  		XREF	FindOurNode		 ; Error-Node finden @@ -86,21 +88,12 @@  	IFD PP_VERSION  VERSION:	EQU	101			 ; D0 bei OpenLibrary  REVISION:	EQU	4			 ; jedesmal um 1 erhöhen -	ELSE -VERSION:	EQU	22			 ; D0 bei OpenLibrary -REVISION:	EQU	2			 ; jedesmal um 1 erhöhen  	ENDC  *****************************************************************************  ** Diese Routine wird aufgerufen wenn man iff.library als Programm startet -FirstByte: -		bra.b	1$ -		dc.b	"CHW!" -1$: -	*** wird aufgerufen, wenn mann die Library vom CLI aus startet - -		lea	DOSName(PC),a1		; dos.library öffnen +FirstByte:	lea	DOSName(PC),a1		; dos.library öffnen  		movea.l	4.W,a6  		JSRLIB	OldOpenLibrary  		movea.l	d0,a6			; DosBase @@ -108,16 +101,12 @@ FirstByte:  		move.l	d0,d1			; file: stdout  		lea	MyLibInfo(PC),a0	; Adresse des ID-Strings  		move.l	a0,d2 -	IFD PP_VERSION -		moveq.l	#67,d3			; Länge des ID-Strings -	ELSE -		moveq.l	#42,d3			; Länge des ID-Strings -	ENDC +		moveq.l	#MyLibInfoEnd-MyLibInfo,d3	; Länge des ID-Strings  		JSRLIB	Write  		movea.l	a6,a1  		movea.l	4.W,a6  		JSRLIB	CloseLibrary		; For Chris -		moveq.l	#5,d0			; return-code: WARN +		moveq.l	#10,d0			; return-code: ERROR  		rts  ***************************************************************************** @@ -137,9 +126,14 @@ MyROMTag:	DC.W	RTC_MATCHWORD  	IFD PP_VERSION  MyLibName:	DC.B	"iffpp.library",0  MyLibInfo:	DC.B	"IFFPP 101.4 (03.06.92) Copyright © 1990-1992 by Christian A. Weber",10,13,0 +MyLibInfoEnd:  	ELSE  MyLibName:	DC.B	"iff.library",0 -MyLibInfo:	DC.B	"IFF 22.2 (03.06.92) by Christian A. Weber",10,13,0 +MyLibInfo:	VERS +		DC.B	" (" +		DATE +		DC.B	") (-: by Christian A. Weber :-)",13,10,0 +MyLibInfoEnd:  	ENDC  DOSName:	DC.B	"dos.library",0 @@ -294,12 +288,13 @@ CloseFunc:	movem.l	a2/a5-a6,-(SP)  		moveq.l	#0,d0			; return-code  		subq.w	#1,LIB_OPENCNT(a6) +	IFD DELEXP  		bne.b	2$			; jemand hat sie noch offen -  		btst.b	#LIBB_DELEXP,LIB_FLAGS(a6) ; haben wir delayed Expunge?  		beq.b	2$			; neenee --->  		bsr.b	ExpungeFunc		; sonst Expunge  2$: +	ENDC  		rts				; Library ist jetzt zu  ***************************************************************************** @@ -311,7 +306,9 @@ ExpungeFunc:	movem.l	d2/a5-a6,-(SP)  		tst.w	LIB_OPENCNT(a5)		; sind wir noch offen?  		beq.b	1$			; nein +	IFD DELEXP  		bset.b	#LIBB_DELEXP,LIB_FLAGS(a5) +	ENDC  		moveq.l	#0,d0			; return-code  		bra.b	99$  1$: @@ -326,9 +323,10 @@ ExpungeFunc:	movem.l	d2/a5-a6,-(SP)  		moveq.l	#0,d0  		movea.l	a5,a1			; LibPtr  		move.w	LIB_NEGSIZE(a5),d0	; Grösse der Sprungtabelle -		sub.w	d0,a1			; A1 := Anfang der Sprungtab. +		suba.w	d0,a1			; A1 := Anfang der Sprungtab.  		add.w	LIB_POSSIZE(a5),d0	; D0 := Lib-Grösse gesamt  		JSRLIB	FreeMem			; freigeben +  		move.l	d2,d0			; return-code: Segmentliste  99$:		movem.l	(SP)+,d2/a5-a6 diff --git a/Source/PushChunk.S b/Source/PushChunk.S index b021340..e645da9 100644 --- a/Source/PushChunk.S +++ b/Source/PushChunk.S @@ -1,11 +1,10 @@  ** -**	$Id: $ -**	$Revision: $ +**	$Id: PushChunk.S,v 21.1 92/05/15 03:24:41 chris Exp $ +**	$Revision: 21.1 $  **  **	$Filename: PushChunk.S $ -**	$Author: Christian A. Weber $ -**	$Release: 21.1 $ -**	$Date: 92/05/14 22:26:34 $ +**	$Author: chris $ +**	$Date: 92/05/15 03:24:41 $  **  **	iff.library/IFFL_PushChunk  ** @@ -55,33 +54,44 @@  *	Non-zero if successful or 0 if not successful (call IFFL_IFFError()  *	to get an IFFL_ERROR_... error code.  * +*    NOTE +*       Currently, the level of nested FORMs is restricted to 7. +*  *    SEE ALSO  *	IFFL_PopChunk(), IFFL_WriteChunkBytes()  *  ***************************************************************************** -PushChunkFunc:	movem.l	d0-d3/a2/a5-a6,-(SP) +PushChunkFunc:	movem.l	d0-d3/a2/a5-a6,-(SP)	; D0 auch (siehe unten!)  		movea.l	a6,a5			; IFFBase für ClearError()  		movea.l	a0,a2			; A2 :  IFF-Handle  		movea.l	iffb_DOSBase(a5),a6	; A6 :  DOSBase -	*** File-Type schreiben falls dies der erste Chunk ist +	*** File-Type schreiben falls das FORM leer ist -		tst.l	ifffh_FormSize(a2)	; 1. Chunk ? +		tst.l	ifffh_ChunkSize(a2)	; 1. Chunk ?  		bne.b	.NotFirstChunk		; nee --->  		move.l	ifffh_File(a2),d1	; Filehandle -		move.l	SP,d2			; Type aufm Stack +		move.l	SP,d2			; Typ (D0) aufm Stack von MOVEM her  		moveq.l	#4,d3			; Länge: 1 Langwort  		JSRLIB	Write  		cmp.l	d3,d0			; OK geschrieben ?  		bne.b	.WriteError -		add.l	d3,ifffh_FormSize(a2)	; FORM-Grösse anpassen +		add.l	d3,ifffh_ChunkSize(a2)	; FORM-Grösse anpassen  .NotFirstChunk: +	*** Chunk-Stack eins nach oben rutschen + +		lea	iffh_CStackEnd(a2),a1	; Destination +		lea	-8(a1),a0		; Source +		moveq	#(iffh_CStackEnd-iffh_CStack-8)/4-1,d0 +.StackUp:	move.l	-(a0),-(a1) +		dbf	d0,.StackUp +  	*** Chunk im IFF-Handle initialisieren -		clr.l	ifffh_ChunkSize(a2)	; Chunk-Grösse resstten +		clr.l	ifffh_ChunkSize(a2)	; Chunk-Grösse resetten  		move.l	ifffh_File(a2),d1  		moveq.l	#0,d2			; Aktuelle Position @@ -94,7 +104,7 @@ PushChunkFunc:	movem.l	d0-d3/a2/a5-a6,-(SP)  		move.l	ifffh_File(a2),d1  		lea	4(SP),a0 -		move.l	a0,d2			; ID und 1 LONG garbage +		move.l	a0,d2			; Chunk-ID und 1 LONG garbage  		moveq.l	#8,d3			; ID und provisorische Länge  		JSRLIB	Write  		cmp.l	d3,d0			; OK geschrieben ? | 
