******************************************************************************
*                                                                            *
*                              » I M A G E  ! «                              *
*                                                                            *
*                   created by Aliso 1989 in West-Germany                    *
*                                                                            *
*               PD Asm68k 1.0.3, PD BLINK V6.7 & PD SMALL.LIB                *
*                                                                            *
* Dieses Programm ist ein Public Domain - Programm!                          *
* Die Routinen können NUR FÜR DEN PRIVATEN Gebrauch kopiert werden.          *
*                                                                            *
******************************************************************************

	extern	NewScreen,NewWindow
	extern	ImageMyGad,ImageZeigeIFF,ImageKonIFF,ImageInfo
	extern	ImageClose,ImageBack,ImageStruk,ImageZeigen,ImageHaken
	extern	ScreenPtr,ReadIFF
	extern	GrafikStart,GrafikStop,Palette,Sprite
	extern	WindowFormat,WindowName,WindowInfo,WindowCredits
	extern	ImageWinFormat,ImageWinName,ImageWinInfo,ImageWinCredits
	extern	NameBuffer,NameString,ImageData13
	extern	BitMapLen,BitMapAdr,NoFile2

	entry	_DOSBase,_SysBase,_IntuitionBase,_GfxBase,MyGadget,MyWindow
	entry	InfoFlag,XKoor,YKoor,Width,Height,Depth,KonvertFlag,MyBitMap
	entry	WidthImage,HeightImage,YImage,XImage,DepthImage


******************************************************************************
*                                                                            *
*                       P R O G R A M M L A B E L S                          *
*                                                                            *
******************************************************************************

AbsExecBase equ $4
GADGETFLAGS equ $3|$4			; GADGHNONE|GADGIMAGE 
GADGETACT   equ $1|$2			; RELVERIFY|GADGIMMEDIATE
GADGETTYP   equ $1			; BOOLGADGET

** Gadget IDs

GADMYGAD     equ 100
GADZEIGEIFF  equ 101
GADKONIFF    equ 102
GADINFO      equ 103
GADCLOSE     equ 104
GADBACK      equ 105
GADSTRUK     equ 106
GADZEIGEN    equ 107
ASSID        equ 200
CID          equ 201
NameSTRINGID equ 202
NameOKID     equ 203
NameSTOPID   equ 204
CreditsOKID  equ 205
InfoOKID     equ 206
MEMF_CHIP    equ 2
MEMF_FAST    equ 4

CALLSYS MACRO
   xref  _LVO\1
   move.l \2,a6
   jsr    _LVO\1(a6)
   ENDM

CALL MACRO
 xref _LVO\1
 jsr  _LVO\1(a6)
 ENDM
  

** IDCMP-Flags:

GADGETUP     equ $40

** DOS

MODE_NEWFILE equ 1006

******************************************************************************
*                                                                            *
*                    P R O G R A M M C O D E                                 *
*                                                                            *
******************************************************************************

	Section Main,Code

Start:
	move.l	sp,Stack				; Stapel speichern
	clr.l	Message					; Pointer auf 0
	suba.l	a1,a1					; a1 = 0
	CALLSYS	FindTask,AbsExecBase			;
	move.l	d0,a4					;
	tst.l	$ac(a4)					; CLI ?
	bne.s	1$					; ja, dann weiter
	lea	$5c(a4),a0				; MessagePort
	CALL	WaitPort				;
	CALL	GetMsg					;
	move.l	d0,Message				;
1$:
	jsr	FlimmerGame				; Bildschirmflacker
	jsr	InitAll					; Initialisation
	jsr	SetGraphicHaken				; Haken setzen

******************************************************************************
*                                                                            *
*                    H A U P T S C H L E I F E                               *
*                                                                            *
******************************************************************************

TheLoop:						; Hauptschleife
	jsr	WaitSignal				; auf Signal warten
	move.l	MyWindow,a0				; UserPort
	move.l	86(a0),a0				; holen
	CALL	GetMsg					; Message abholen
	move.l	d0,a5					; Message-Pointer
	beq.s	TheLoop					; =0 -> keine Message
	move.l	d0,a1					;
	CALL	ReplyMsg				;
	move.l	20(a5),d7				; CLASS
	move.l	28(a5),a5				; IAddress
	move.w	38(a5),d6				; Gadget ID
	cmpi.l	#GADGETUP,d7				; richtige 'CLASS'?
	bne.s	TheLoop					; nein, Hauptschleife
	cmpi.w	#GADCLOSE,d6				; Close-Gadget?
	bne.s	1$					; nein, weiter
	jmp	TheEnd					; sonst Abbruch
1$:
	cmpi.w	#GADBACK,d6				; Back-Gadget ?
	bne.s	2$					; nein, weiter
	move.l	MyScreen,a0				; Screen nach
	CALLSYS	ScreenToBack,_IntuitionBase		; hinten bringen
	bra	TheLoop					; Hauptschleife
2$:
	cmpi.w	#GADZEIGEIFF,d6				; ZeigeIFF-Gadget ?
	bne.s	5$					; nein, weiter
	jsr	ShowIFF					; Bild zeigen
	bra	TheLoop					; Hauptschleife
5$:
	cmpi.w	#GADINFO,d6				; Info-Gadget ?
	bne.s	6$					; nein, weiter
	jsr	ShowInfo				; Informationen zeigen
	bra	TheLoop					; Hauptschleife
6$:
	cmpi.w	#GADZEIGEN,d6				; Ausgabe-Gadget ?
	bne.s	7$					; nein, weiter
	bchg	#1,AusgabeFlag				;
	bra	TheLoop					; Hauptschleife
7$:
	cmpi.w	#GADSTRUK,d6				; Struktur-Gadget ?
	bne.s	8$					; nein, weiter
	jsr	SetStructure				;
	bra	TheLoop					; Hauptschleife
8$:
	cmpi.w	#GADKONIFF,d6				: KonIFF-Gadget ?
	bne	TheLoop					; nein, Hauptschleife
	jsr	KonvertIFF				;
	bra	TheLoop					;

******************************************************************************
*                                                                            *
*                    H A U P T S C H L E I F E - E N D E                     *
*                                                                            *
******************************************************************************

*****
** TheEnd:
**         beendet das Programm, ohne eine Fehlermeldung auszugeben.
*****
TheEnd:
	suba.l	a5,a5
	jmp	CloseAll				; Alles schließen

******************************************************************************
*                                                                            *
*                    P R O G R A M M A B S C H N I T T E                     *
*                                                                            *
******************************************************************************


******************************************************************************

*****
** ShowIFF:
**         zeigt einen IFF-Grafikdatei
*****
ShowIFF:
	movem.l	a0-a6/d0-d7,-(sp)			; Register auf Stack
	clr.l	ScreenPtr				; Pointer löschen
	jsr	InputName				; Name holen
	tst.l	d7					; alles ok?
	beq.s	1$					; nein, Abbruch
	jsr	SetSleepy				;
	lea	NameBuffer,a0				; Zeiger auf Filename
	jsr	ReadIFF					; Datei lesen
	jsr	Mouse
	tst.l	ScreenPtr				; wurde Screen geöffnet
	beq.s	1$					; nein, Abbruch
	jsr	WaitMouse				; auf Maustaste warten
	move.l	ScreenPtr,a0				; Screen schließen
	CALLSYS	CloseScreen,_IntuitionBase		;
1$:
	movem.l	(sp)+,a0-a6/d0-d7			; Register v. Stack
	rts

******************************************************************************

*****
** Info:
**      zeigt Höhe,Breite,X,Y und Tiefe an
*****
ShowInfo:
	movem.l	a0-a6/d0-d7,-(sp)			; Register auf Stack
	jsr	InputName				; Name holen
	tst.l	d7					; alles Ok?
	beq	1$					; nein, Abbruch
	jsr	SetSleepy				;
	move.w	#1,d0					; Flag setzen
	move.w	d0,InfoFlag				;
	lea	NameBuffer,a0				; Zeiger auf Filename
	jsr	ReadIFF					; Werte lesen
	jsr	Mouse					;
	tst.w	InfoFlag				; Fehler ?
	beq	1$					; ja, Abbruch
	clr.w	InfoFlag				; Flag löschen

	jsr	NoIDCMPs				;
	lea	WindowInfo,a0				; Window öffnen
	move.l	MyScreen,30(a0)				; Screen-Pointer
	CALLSYS	OpenWindow,_IntuitionBase		;
	move.l	d0,Window				; Pointer speichern
	beq	2$					; bei Fehler Abbruch
	move.l	d0,a0					; RastPort
	move.l	50(a0),a0				; holen
	move.l	a0,RastPortWin				;
	lea	ImageWinInfo,a1				; Image-Struktur
	clr.l	d0					;
	clr.l	d1					; Offsets
	CALL	DrawImage				;
	move.l	RastPortWin,a1				;
	move.l	#1,d0					;
	CALLSYS	SetAPen,_GfxBase			;
	lea	Depth,a1				; Tiefe
	move.l	#44,d0					; X
	move.l	#47,d1					; Y
	jsr	PrintData				; ausgeben
	lea	XKoor,a1				; Xkoor
	move.l	#85,d0					; X
	jsr	PrintData				; ausgeben
	lea	YKoor,a1				; YKoor
	move.l	#115,d0					; X
	jsr	PrintData				; und ausgeben
	lea	Width,a1				; Breite
	move.l	#44,d0					; X
	move.l	#66,d1					; Y
	jsr	PrintData				; ausgeben
	lea	Height,a1				; Höhe
	move.l	#115,d0					; X
	jsr	PrintData				; und ausgeben
	move.l	Window,a0				;
	jsr	WaitSignalPar				; Wait
	move.l	Window,a0				; Window
	move.l	86(a0),a0				; Port
	CALLSYS	GetMsg,_SysBase				; Message abholen
	move.l	d0,a1					;
	CALL	ReplyMsg				; beantworten
	move.l	Window,a0				; Fenster
	CALLSYS	CloseWindow,_IntuitionBase		; schließen
2$:							;
	jsr	IDCMPs					;
1$:							;
	movem.l	(sp)+,a0-a6/d0-d7			; Register v. Stack
	rts

******************************************************************************

*****
** KonvertIFF:
**            konvertiert den IFF-File in die gewünschte Form,
**            zeigt, falls gewünscht, den Source-Coce an
*****
KonvertIFF:
	clr.l	FileHandler
	clr.l	WindowHandle
	movem.l	a0-a6/d0-d7,-(sp)			; Register speichern
	jsr	NoIDCMPs				; IDCMPs löschen
	jsr	WhichFormat				; Format holen
	tst.w	FormatTyp				; Fehler ?
	beq	3$					; ja, Abbruch
	jsr	InputName				; Name holen
	tst.l	d7					; alles ok?
	beq	3$					; nein, Abbruch
	lea	NameBuffer,a0				; Zeiger auf Namen
	move.w	#1,KonvertFlag				; Flag setzen
	jsr	ReadIFF					; IFF lesen
	tst.w	KonvertFlag				; alles ok ?
	beq	3$					; nein, Abbruch
	jsr	SetSleepy				; Wartezeichen
	lea	NameBuffer,a0				; Zeiger auf Name
	jsr	Printf					; formatieren
	lea	String,a0				; Zeiger auf String
	move.l	Position,d0				; Position
	move.b	#'.',0(a0,d0)				; Punkt schreiben
	move.w	FormatTyp,d1				; Typ ermitteln
	cmpi.w	#ASSID,d1				; Assembler ?
	bne.s	1$					; nein, C!
	move.b	#'a',1(a0,d0)				; Suffix a
	bra.s	2$					; schreiben
1$:							;
	move.b	#'c',1(a0,d0)				; Suffix c
2$:							; schreiben
	move.b	#0,2(a0,d0)				; Ende kennzeichnen
	move.l	#String,d1				; Zeiger auf Filename
	move.l	#1006,d2				; NEWFILE-Modus
	CALLSYS	Open,_DOSBase				;
	move.l	d0,FileHandler				; Handler speichern
	bne.s	4$					;
	jsr	NoFile2					; Fehler!
	bra.s	5$
4$:
	tst.w	AusgabeFlag
	beq.s	10$
	move.l	MyScreen,a0				; Screen nach
	CALLSYS	ScreenToBack,_IntuitionBase		; hinten bringen
	move.l	#1005,d2				; MODEOLD
	move.l	#WindowCon,d1				;
	CALLSYS	Open,_DOSBase				;
	move.l	d0,WindowHandle				;
10$:
	jsr	SelectFunction				; sonst, weiter
	move.l	FileHandler,d1				; File schließen
	CALLSYS	Close,_DOSBase				;
5$:
	jsr	Mouse					; normaler Mauszeiger
	move.l	BitMapAdr,a1				;
	move.l	BitMapLen,d0				;
	CALLSYS	FreeMem,_SysBase			;
	tst.l	WindowHandle				; Window ?
	beq.s	3$					; nein
	move.l	WindowHandle,d1				;
	move.l	#Msg1,d2				;
	move.l	#24,d3					;
	CALLSYS	Write,_DOSBase				;
	jsr	WaitMouse				;
	move.l	WindowHandle,d1				;
	CALL	Close					; und schließen
	move.l	MyScreen,a0				; Screen nach vorne
	CALLSYS	ScreenToFront,_IntuitionBase		; bringen

3$:							;
	jsr	IDCMPs					;
	movem.l	(sp)+,a0-a6/d0-d7			; Register vom Stack
	rts						; und zurück
SelectFunction:						;
	jsr	WriteData				;
	move.w	Structure,d0				;
	cmpi.w	#0,d0					; BitMap
	beq.s	1$					; BitMap schreiben
	cmpi.w	#1,d0					; Image ?
	beq.s	2$					; nein, nichts
3$:
	jsr	WriteLogo				; Logo schreiben
	rts						; und zurück
2$:							;
	jsr	WriteImage				; Image
	bra.s	3$					;
1$:							;
	jsr	WriteBitMap				; BitMap
	bra.s	3$					;
	dc.b	' WRITTEN BY ALISO 1989 Version 1.0 and Public Domain!! '
	cnop	2
WriteLogo:
	move.w	FormatTyp,d0				;
	cmpi.w	#ASSID,d0				; Assembler ?
	bne.s	1$					; nein, C
	lea	LogoA,a0				;
2$:
	jsr	Printf					;
	jsr	Print2					;
	rts
1$:
	lea	LogoC,a0				;
	bra.s	2$					;

*****
** WhichFormat:
**              holt den Formattyp vom Benutzer
*****
WhichFormat:
	clr.w	FormatTyp				; löschen
	lea	WindowFormat,a0				; Format-Window
	move.l	MyScreen,30(a0)				; Screen-Pointer
	CALLSYS	OpenWindow,_IntuitionBase		; Window öffnen
	move.l	d0,Window				; Pointer
	beq	1$					; Fehler!
	move.l	d0,a0					; RastPort holen
	move.l	50(a0),a0				;
	lea	ImageWinFormat,a1			; Image
	clr.l	d0					; X
	clr.l	d1					; Y
	CALL	DrawImage,_IntuitionBase		;
	move.l	Window,a0				;
	jsr	WaitSignalPar				; Wait
	move.l	Window,a0				; Window
	move.l	86(a0),a0				; Port
	CALLSYS	GetMsg,_SysBase				; Message abholen
	move.l	d0,a1					;
	move.l	28(a1),a0				; IAddress
	move.w	38(a0),FormatTyp			; ID
	CALL	ReplyMsg				; beantworten
	move.l	Window,a0				; Window schließen
	CALLSYS	CloseWindow,_IntuitionBase		;
1$:							;
	rts						; und zurück

******************************************************************************
*                                                                            *
*                    U N T E R R O U T I N E N                               *
*                                                                            *
******************************************************************************

*****
** Printf:
**         untersucht einen entsprechend formatierten String
**         und setzt die Werte ein
**         Printf - Spezialversion
** => A0 FormatString
**    A1 DataStream
Printf:
	movem.l	a0-a6/d0-d7,-(sp)			; Register retten
	clr.l	Position				;
1$:							;
	move.b	(a0)+,d0				; Zeichen nach D0
	cmpi.b	#'2',d0					; Zahl ?
	beq.s	2$					; Byte ausgeben
	cmpi.b	#'4',d0					; Word ?
	beq.s	4$					; Word ausgeben
	cmpi.b	#0,d0					; 0 ?
	beq.s	3$					;
	jsr	PutChar					; sonst nur kopieren
	bra.s	1$					; nein, weiter
3$:
	movem.l	(sp)+,a0-a6/d0-d7			;
	rts						; Return To Start
2$:							;
	jsr	A_Byte					;
	bra.s	1$					;
4$:							;
	jsr	A_Byte					;
	jsr	A_Byte					;
	bra.s	1$					;
A_Byte:
	clr.l	d1					;
	move.b	(a1)+,d1				; Byte holen
	move.b	d1,d0					;
	rol.b	#4,d0					;
	jsr	Nibble					; ausgeben
	move.b	d1,d0					;
Nibble:							;
	and.l	#$f,d0					; Bits löschen
	cmp.b	#9,d0					;
	ble.s	NoAdd					;
	add.b	#7,d0					;
NoAdd:							;
	add.b	#48,d0					;
	jmp	PutChar					; und ausgeben
;## Ende von Printf

Print2:							; Ausgabe auf Datei &
	movem.l	a0-a6/d0-d7,-(sp)			; Window
	move.l	FileHandler,d1				; FileHandler holen
	move.l	#String,d2				; String
	move.l	Position,d3				; Anzahl
	CALLSYS	Write,_DOSBase				; schreiben
	tst.w	AusgabeFlag				; Ausgabe-Flag ?
	beq.s	1$					; nein, Ende
	move.l	WindowHandle,d1				; Window-Handle holen
	move.l	#String,d2				; Zeiger 
	move.l	Position,d3				; Anzahl
	CALLSYS	Write,_DOSBase				; ausgeben
1$:
	movem.l	(sp)+,a0-a6/d0-d7			; Register
	rts						; und zurück

;##
;## WriteBitMap: gibt die BitMap-Struktur in Ass. o. C mit Werten aus
;## ------------
;##
WriteBitMap:
	movem.l	a0-a6/d0-d7,-(sp)			; Register retten
	lea	MyBitMap,a1				;
	move.w	FormatTyp,d0				; Typ ?
	cmpi.w	#ASSID,d0				; Assembler
	bne.s	1$					; nein, C
	lea	BitMapFmtA,a0				;
2$:
	jsr	Printf					; ausgeben
	jsr	Print2					;
	jsr	WritePlanes
	movem.l	(sp)+,a0-a6/d0-d7			;
	rts						;
1$:
	lea	BitMapFmtC,a0				;
	bra.s	2$					;
WritePlanes:
	lea	MyBitMap,a0				; Zeiger auf BitMap
	clr.l	d0					; D0 löschen
	move.b	5(a0),d0				; Anzahl d. Planes
	subq.l	#1,d0					; -1
	move.w	FormatTyp,d1				;
	cmpi.w	#ASSID,d1				; Assembler
	bne.s	1$					;
	lea	PlanesFmtA,a0				;
2$:							; Plane ausgeben
	jsr	Printf					;
	jsr	Print2					;
	adda.l	#14,a0					; nächste Plane
	dbf.s	d0,2$					;
	rts						; und zurück
1$:
	lea	PlanesFmtC,a0				; C Format
3$:
	jsr	Printf					; ausgeben
	jsr	Print2					;
	adda.l	#12,a0					; nächste Plane
	dbf.s	d0,3$					;
	jsr	WritePlaneEndC				; Ende schreiben
	rts						; und zurück


	
;## Ende von WriteBitMap

;##
;## WriteImage: gibt die Image-Struktur in Ass. o. C mit Werten aus
;## -----------
;##
WriteImage:
	movem.l	a0-a6/d0-d7,-(sp)			;
	lea	PublicImage,a1				;
	move.w	XImage,(a1)+				; X
	move.w	YImage,(a1)+				; Y
	move.w	WidthImage,(a1)+			; Width
	move.w	HeightImage,(a1)+			; Height
	clr.w	d0					; D0 löschen
	move.w	DepthImage,d0				;
	move.w	DepthImage,(a1)+			; Depth
	moveq.b	#1,d1					; 1
	rol.b	d0,d1					; um d0 Bits rollen
	subq.b	#1,d1					; -1
	move.b	d1,(a1)+				; PlanePick
	move.b	#0,(a1)					; PlaneOnOff
	lea	PublicImage,a1				; Imagedaten
	move.w	FormatTyp,d0				;
	cmpi.w	#ASSID,d0				; Assmbler ?
	bne.s	1$					; nein, C
	lea	ImageFmtA,a0				;
2$:							;
	jsr	Printf					; formatieren
	jsr	Print2					; und ausgeben
	movem.l	(sp)+,a0-a6/d0-d7			;
	rts						;
1$:							;
	lea	ImageFmtC,a0				;
	bra.s	2$					;

;## Ende von WriteImage

;##
;## WriteData: schreibt die eigentlichen Daten
;##
WriteData:
	movem.l	a0-a6/d0-d7,-(sp)			; Register
	move.w	FormatTyp,d0				; Typ ermitteln
	cmpi.w	#ASSID,d0				; Assembler ?
	bne	WriteDataC				; nein, also C
	lea	ImageDataBegA,a0			;
	jsr	Printf
	jsr	Print2
	lea	MyBitMap,a5				;
	clr.l	d0					; D0 löschen
	clr.l	d1					;
	move.w	(a5),d0					; BytesPerRow
	move.w	2(a5),d1				;
	mulu	d1,d0					; * Rows
	move.w	d0,BytesPerPlane			; speichern
	clr.l	d4					; d4 löschen
	move.b	5(a5),d4				; Depth
	adda.l	#8,a5					; Zeiger auf 1. Plane
	subq.l	#1,d4					; d4-1
	moveq.l	#-1,d0					; Nummer
1$:
	move.l	d0,-(sp)				; retten
	move.l	(a5)+,a4				; Planeadresse
	jsr	WritePlaneA				; Daten schreiben
	move.l	(sp)+,d0				; Register holen
	addq.l	#1,d0					; nächste Nummer
	dbf.s	d4,1$					; nächste Plane
	lea	DataEndA,a0				;
	jsr	Printf					; Ende der Daten
	jsr	Print2					; schreiben
	movem.l	(sp)+,a0-a6/d0-d7			; Register vom Stack
	rts

** => A4 Zeiger auf Plane
** => D0 Plane-Nummer
WritePlaneA:
	jsr	WritePlaneNrA				; Nummer schreiben
	moveq.l	#1,d7					; Zähler
	clr.l	d5					; D5 löschen
	move.w	BytesPerPlane,d5			; Anzahl d. Bytes
	asr.w	#1,d5					; /2
	subq.l	#1,d5					; nach D5 -1
3$:							;
	move.w	(a4)+,DataFeld				; Wort nach DataFeld
	subq.l	#1,d7					; Zähler-1
	tst.l	d7					; Zeilenende ?
	bne.s	1$					; nein, weiter
	lea	RawDataA2,a0				; 
	move.l	#10,d7					; Zähler = 10
	bra.s	2$					; weiter bei 2$
1$:							;
	lea	RawDataA1,a0				; Ausgabe mit Komma
2$:							;
	lea	DataFeld,a1				;
	jsr	Printf					; formatieren
	jsr	Print2					; und ausgeben
	dbf	d5,3$					; eine ganze Plane
	rts						;
WritePlaneNrA:
	lea	PlanesA,a0				;
	cmpi.l	#-1,d0					; -1 ?
	beq.s	2$
1$:							;
	adda.l	#9,a0					;
	dbf.s	d0,1$					; Schleife
2$:							; 
	jsr	Printf					; formatieren,
	jsr	Print2					; ausgeben
	rts						; und zurück

;##
;## WriteDataC
;##
WriteDataC:
	tst.w	Structure				; BitMap?
	beq.s	2$					; nein!
	lea	ImageDataBegC,a0			; Vorspann
	jsr	Printf					; schreiben
	jsr	Print2					;
2$:
	lea	MyBitMap,a5				; Anzahl der
	clr.l	d0					; Bytes in einer
	clr.l	d1					; Plane berechnen
	move.w	(a5),d0					;
	move.w	2(a5),d1				;
	mulu	d1,d0					;
	move.w	d0,BytesPerPlane			; speichern
	clr.l	d4					;
	move.b	5(a5),d4				; Tiefe
	adda.l	#8,a5					; Zeiger auf Plane
	subq.l	#1,d4					; Tiefe - 1
	moveq.l	#-1,d0					;
1$:
	move.l	d0,-(sp)				; retten
	move.l	(a5)+,a4				; Planeadresse
	jsr	WritePlaneC				; Daten schreiben
	move.l	(sp)+,d0				;
	addq.l	#1,d0					;
	dbf.s	d4,1$					;
	tst.w	Structure				; BitMap
	beq.s	3$					; ja
	jsr	WritePlaneEndC				;
3$:
	movem.l	(sp)+,a0-a6/d0-d7			;
	rts						;
WritePlaneC:
	tst.w	Structure				; BitMap ?
	bne.s	4$					; nein, Image
	jsr	WritePlaneBegC				; Anfang schreiben
4$:
	clr.l	d5					;
	moveq.l	#1,d7					;
	move.w	BytesPerPlane,d5			;
	asr.w	#1,d5					; /2
	subq.l	#1,d5					; -1
3$:
	move.w	(a4)+,DataFeld				; Datenwort ins Feld
	subq.l	#1,d7					; Zähler -1
	tst.l	d7					; =0?
	bne.s	1$					; nein, weiter
	lea	RawDataC2,a0				; nächste Zeile
	moveq.l	#9,d7					; Zähler = 9
	bra.s	2$					; ausgeben
1$:
	lea	RawDataC1,a0				; gleiche Zeile
2$:
	lea	DataFeld,a1				; DataStream
	jsr	Printf					; formatieren
	jsr	Print2					; und ausgeben
	dbf.s	d5,3$					;
	tst.w	Structure				; BitMap ?
	bne.s	5$					; nein, Image
	jsr	WritePlaneEndC				; Ende schreiben
5$:
	rts						;
WritePlaneBegC:
	lea	PlanesC,a0				; Zeiger auf String
	cmpi.l	#-1,d0					; -1?
	beq.s	2$					; ja, alles ok!
1$:
	adda.l	#18,a0					; +17
	dbf.s	d0,1$					;
2$:
	jsr	Printf					; formatieren,
	jsr	Print2					; ausgeben
	rts						; und zurück
WritePlaneEndC:
	lea	ImageDataEndC,a0			;
	jsr	Printf					; formatieren
	jsr	Print2					; ausgeben
	rts						; und zurück

*****
** SetStructure:
**               Struktur setzen
*****
SetStructure:
	movem.l	a0-a6/d0-d7,-(sp)			; Register retten
	move.l	RastPort,a1				; RastPort
	move.l	#12,d0					;
	CALLSYS	SetAPen,_GfxBase			;
	move.l	RastPort,a1				;
	move.l	#180,d0					; X1
	move.l	#163,d1					; Y1
	move.l	#212,d2					; X2
	move.l	#206,d3					; Y2
	CALL	RectFill,_GfxBase			;
	cmpi.w	#2,Structure				;
	beq.s	1$					;
	addq.w	#1,Structure				;
2$:
	jsr	SetGraphicHaken				; Haken setzen
	movem.l	(sp)+,a0-a6/d0-d7			;
	rts						; und zurück
1$:
	clr.w	Structure				;
	bra.s	2$					;
*****
** SetGraphicHaken:
**                  Setzen des Hakens
*****
SetGraphicHaken:
	move.l	RastPort,a0				; RastPort
	move.l	#180,d0					; X
	lea	ImageHaken2,a1				;
	move.w	Structure,d2				; Struktur nach d0
	cmpi.w	#0,d2					; = 0?
	bne.s	1$					;
	move.l	#163,d1					;
	bra	3$					;
1$:							;
	cmpi.w	#1,d2					;
	bne.s	2$					;
	move.l	#176,d1					;
	bra	3$					;
2$:							;
	move.l	#189,d1					;
3$:							;
	CALLSYS	DrawImage,_IntuitionBase		;
	rts						;


** => a1 Zeiger auf Data
** => D0 X
** => D1 Y
PrintData:
	movem.l	a6/d1,-(sp)				; a6 auf Stack
	lea	InfoFmt,a0				; FormatString
	jsr	FormatString				; formatieren
	move.l	RastPortWin,a1				; RastPort
	CALLSYS	Move,_GfxBase				; Cursor bewegen
	move.l	RastPortWin,a1				; RastPort
	lea	String,a0				; Zeiger auf String
	move.l	Position,d0				; Anzahl
	subq.l	#1,d0					; -1
	CALL	Text					; ausgeben
	movem.l	(sp)+,a6/d1				; a6 vom Stack
	rts

*****
** FormatString:
**              formatierte Ausgabe
** => A0 FormatString
**    A1 DataStream
** <= Ergebnis steht in String
*****
FormatString:
	clr.l	Position				;
	movem.l	a0-a6/d0-d7,-(sp)			; Register retten
	lea	PutChar,a2				;
	lea	Return,a3				;
	CALLSYS	RawDoFmt,_SysBase			;
	movem.l	(sp)+,a0-a6/d0-d7			;
	rts						;
PutChar:						;
	movem.l	a0/d1,-(sp)				; Register
	lea	String,a0				; String
	move.l	Position,d1				; Position
	move.b	d0,0(a0,d1)				; Zeichen kopieren
	addq.l	#1,Position				; erhöhen
	movem.l	(sp)+,a0/d1				; Register
Return:							;
	rts						; und zurück

*****
** WaitMouse:
**            wartet auf einen Tastendruck der Maus
*****
WaitMouse:
	btst	#6,$BFE001
	bne.s	WaitMouse
	rts
*****
** InputName:
**           der Benutzer kann den Name eingeben
*****
InputName:
	movem.l	a0-a6/d0-d6,-(sp)			; Register auf Stack
	clr.l	d7					;
	jsr	NoIDCMPs				;
	lea	WindowName,a0				; Window öffnen
	move.l	MyScreen,30(a0)				; Screen-Pointer
	CALLSYS	OpenWindow,_IntuitionBase		;
	move.l	d0,Window				; Pointer speichern
	beq	1$					; bei Fehler Abbruch
	move.l	d0,a0					; RastPort
	move.l	50(a0),a0				; holen
	lea	ImageWinName,a1				; Image-Struktur
	clr.l	d0					;
	clr.l	d1					; Offsets
	CALL	DrawImage				;
	suba.l	a2,a2					;
	lea	NameString,a0				;
	move.l	Window,a1				;
	CALL	ActivateGadget				;
2$:
	move.l	Window,a0				; auf Intuition
	jsr	WaitSignalPar				; warten
	move.l	86(a0),a0				; UserPort
	CALLSYS	GetMsg,_SysBase				; Message abholen
	move.l	d0,a1					; Kopie nach A1
	move.l	28(a1),a5				; IAddress
	move.w	38(a5),d6				; ID
	CALL	ReplyMsg				; beantworten
	cmpi.w	#NameOKID,d6				; Ok -> Ende
	bne.s	3$					; nein, weiter
	move.l	#-1,d7					; Ok-Status
	bra.s	5$					;
3$:
	cmpi.w	#NameSTOPID,d6				; STOP -> Ende
	bne.s	2$					; nein, weiter
	clr.l	d7					; STOP-Status
5$:
	move.l	Window,a0				; Window schließen
	CALLSYS	CloseWindow,_IntuitionBase		;
1$:
	jsr	IDCMPs
	movem.l	(sp)+,a0-a6/d0-d6			; Register vom Stack
	rts						; und zurück


*****
** NoIDCMPs:
**          löscht die IDCMP-Flags!
*****
NoIDCMPs:
	movem.l	a0/a1/a6/d0/d1,-(sp)			; Register retten
	move.l	MyWindow,a0				;
	clr.l	d0					;
	CALLSYS	ModifyIDCMP,_IntuitionBase		; Flags ändern
	movem.l	(sp)+,a0/a1/a6/d0/d1			; Register vom Stack
	rts
*****
** IDCMPs:
**        setzt die IDCMP-Flags!
**
*****
IDCMPs:
	movem.l	a0/a1/a6/d0/d1,-(sp)			; Register retten
	move.l	MyWindow,a0				;
	move.l	#$40,d0					;
	CALLSYS	ModifyIDCMP,_IntuitionBase		;
	movem.l	(sp)+,a0/a1/a6/d0/d1			; Register vom Stack
	rts
	

*****
** WaitSignalPar:
**             wartet auf ein Signal von Intuition
** => A0 Zeiger auf ein beliebiges Window
*****
WaitSignalPar:
	movem.l	a0/a1/d1/d0,-(sp)			; Register retten
	bra.s	WaitSignal1
*****
*****
** WaitSignal:
**             wartet auf ein Signal von Intuition
*****
WaitSignal:
	movem.l	a0/a1/d1/d0,-(sp)			; Arbeitsregister
	move.l	MyWindow,a0				;
WaitSignal1:						; 
	adda.l	#86,a0					; UserPort
	move.l	(a0),a0					;
	clr.l	d1					;
	move.b	15(a0),d1				; Signal nach d1
	moveq.l	#1,d0					;
	rol.l	d1,d0					;
	CALLSYS	Wait,_SysBase				;
	movem.l	(sp)+,a0/a1/d1/d0			;
	rts	

*****
** SetSleepy:
**           wechselt Spritedaten und Farbwerte des Mauszeigers
*****
SetSleepy:
	movem.l	a0-a6/d0-d7,-(sp)			; Register retten
	move.l	MyWindow,a0				; Window-Pointer
	lea	Sprite,a1				; Spritedaten
	move.l	#23,d0					; Höhe
	move.l	#16,d1					; Breite
	clr.l	d2					; Offsets des
	clr.l	d3					; "Hot Spot"
	CALLSYS	SetPointer,_IntuitionBase		;
	lea	SleepyColors,a5				; Farbtabelle
	move.l	#2,d7					; Anzahl
	move.l	#17,d0					; Register
	jsr	SetColorsGlb				;
	movem.l	(sp)+,a0-a6/d0-d7			; Register vom Stack
	rts						;
*****
** Mouse:
**       zeigt den original Mauszeiger wieder
*****
Mouse:
	movem.l	a0-a6/d0-d7,-(sp)			;
	move.l	MyWindow,a0				; Window-Pointer
	CALLSYS	ClearPointer,_IntuitionBase		;
	lea	MouseColors,a5				;
	moveq.l	#2,d7					;
	move.l	#17,d0		 			;
	jsr	SetColorsGlb				;
	movem.l	(sp)+,a0-a6/d0-d7			;
	rts						;

*****
** SetColorsGlb:
**              Setzt Farbwerte
** => a5 Zeiger auf Farbtabelle ( in Byteformation, keine Wörter! )
**    d7 Anzahl der Farben
**    d0 Startregister
** <= 
*****
SetColorsGlb:
	move.l	MyScreen,a0				; Screen-Pointer
	adda.l	#44,a0					; ViewPort
1$:
	movem.l	a0/d0,-(sp)				;
	clr.l	d1					; Register
	clr.l	d2					; löschen
	clr.l	d3					;
	move.b	(a5)+,d1				; Rot
	move.b	(a5)+,d2				; Grün
	move.b	(a5)+,d3				; Blau
	CALLSYS	SetRGB4,_GfxBase			;
	movem.l	(sp)+,a0/d0				;
	addq.l	#1,d0					; Register erhöhen
	dbf	d7,1$					;
	rts						;

*****
** InitAll:
**         öffnet einen Screen, kopiert bei Fast-Ram die Grafikimages ins
**         Chip, besorgt sich die Farben des Sprites
**         bei Fehler wird alles geschlossen und ein Feldertext wird ausgeben
**         (das geschieht in `CloseAll'!)
*****
InitAll:
	suba.l	a5,a5					; a5 löschen
	move.l	AbsExecBase,_SysBase			; Basisadresse v. Exec
	lea	DOSName,a1				; DOS-Library
	CALLSYS	OldOpenLibrary,_SysBase			; öffnen
	move.l	d0,_DOSBase				;
	beq	CloseAll				; Fehler -> Abbruch
	lea	IntuitionName,a1			; Intuition-Library
	CALL	OldOpenLibrary				; öffnen
	move.l	d0,_IntuitionBase			;
	beq	CloseAll				; Fehler -> Abbruch
	lea	GfxName,a1				; Graphics-Library
	CALL	OldOpenLibrary				; öffnen
	move.l	d0,_GfxBase				;
	beq	CloseAll				; Fehler -> Abbruch
	move.l	#MEMF_FAST,d1				; Fast-RAM?
	CALL	AvailMem				;
	tst.l	d0					; D0 = 0?
	beq	1$					; ja, kein Fast-Ram
	move.l	#MEMF_CHIP,d1				; sonst Bilder kopieren
	move.l	#GrafikStop-GrafikStart,d0		;
	CALL	AllocMem				; Speicher allokieren
	move.l	d0,CHIPPtr				; Adresse in CHIPPtr
	beq	2$					; Fehler!
	lea	GrafikStart,a0				; sonst Daten kopieren
	move.l	d0,a1					; Zieladresse
	move.l	#GrafikStop-GrafikStart,d0		; Länge
	CALL	CopyMem					;
1$:
	CALLSYS	Output,_DOSBase				; Output holen
	move.l	d0,Output				;
	lea	NewScreen,a0				; Screen öffnen
	CALLSYS	OpenScreen,_IntuitionBase		;
	move.l	d0,MyScreen				; Pointer speichern
	beq	3$					; Fehler -> Abbruch
	lea	NewWindow,a0				; Window öffnen
	move.l	MyScreen,30(a0)				; Screen-Pointer
	CALL	OpenWindow				;
	move.l	d0,MyWindow				; Pointer speichern
	beq	4$					; Fehler -> Abbruch
	move.l	d0,a0					; RastPort ermitteln
	move.l	50(a0),RastPort				;
	jsr	SetColors				; Farben setzen
	rts						; sonst zurück
2$:
	lea	NoCHIP_Err,a5				;
	jmp	CloseAll				;
3$:
	lea	NoScreen_Err,a5				;
	jmp	CloseAll				;
4$:
	lea	NoWindow_Err,a5				;
	jmp	CloseAll				;

*****
** SetColors:
**           setzt die Farbwerte für den Screen und holt sich die
**           Farbtöne des Mauszeigers
*****
SetColors:
	lea	Palette,a5				; Farbpalette
	move.l	MyScreen,a0				; ScreenPointer
	adda.l	#44,a0					; ViewPort
	move.l	#15,d7					; Zähler
	clr.l	d0					; Register
1$:
	movem.l	a0/d0,-(sp)				; Register retten
	clr.l	d3					; Register löschen
	clr.l	d1					;
	clr.l	d2					;
	move.w	(a5)+,d3				; Farbwerte nach d3
	move.w	d3,d1					; Kopie nach d1
	asr.w	#8,d1					; 8 Bits rollen
	and.w	#$f,d1					; Bits ausmarkieren
	move.w	d3,d2					; Kopie nach d2
	asr.w	#4,d2					; 4 Bits rollen
	and.w	#$f,d2					; Bits ausmarkieren
	and.w	#$f,d3					;
	CALLSYS	SetRGB4,_GfxBase			; Farben setzen
	movem.l	(sp)+,a0/d0				; Register vom Stack
	addq.l	#1,d0					; D0 erhöhen
	dbf.s	d7,1$					;
	move.l	4(a0),a0				; ColorMap
	move.l	#17,d0					; Register
	moveq.l	#2,d7					;
	lea	MouseColors,a5				; Farbtabelle f. M.
2$:							; Schleife 2
	movem.l	a0/d0,-(sp)				; Register auf Stack
	CALL	GetRGB4					; Farben
	move.w	d0,d1					; Kopie nach D1
	move.w	d1,d2					; und D2
	and.w	#$f,d0					; Blau
	asr.w	#4,d1					; 4 Bits nach rechts
	and.w	#$f,d1					; Grün
	asr.w	#8,d2					; 8 Bits nach rechts
	and.w	#$f,d2					; Rot
	move.b	d2,(a5)+				; Rot,
	move.b	d1,(a5)+				; Grün und
	move.b	d0,(a5)+				; Blau in die Tabelle
	movem.l	(sp)+,a0/d0				; Register vom Stack
	addq.l	#1,d0					; nächstes Register
	dbf	d7,2$					; Schleifenende
	rts						;
 
*****
** CloseAll:
**          prüft und schließt alles, was geöffnet wurde und
**          gibt gegebenenfalls einen String aus
*****
CloseAll:
	cmpi.l	#0,a5				; wurde String übergeben
	beq.s	1$				; nein weiter
	jsr	Print				;
1$:						;
	tst.l	MyWindow			; Window ?
	beq.s	2$				;
	movea.l	MyWindow,a0			;
	CALLSYS	CloseWindow,_IntuitionBase	; Window schließen
2$:						;
	tst.l	MyScreen			; Screen ?
	beq.s	3$				;
	movea.l	MyScreen,a0			; Screen schließen
	CALLSYS	CloseScreen,_IntuitionBase	;
3$:						;
	tst.l	CHIPPtr				; RAM ?
	beq.s	4$				;
	movea.l	CHIPPtr,a1			; Adresse
	move.l	#GrafikStop-GrafikStart,d0	; Speicher freigeben
	CALLSYS	FreeMem,_SysBase		;
4$:						;
	tst.l	_GfxBase			; Graphics-Library ?
	beq.s	5$				;
	movea.l	_GfxBase,a1			;
	CALLSYS	CloseLibrary,_SysBase		; Library schließen
5$:						;
	tst.l	_IntuitionBase			; Intuition-Library
	beq.s	6$				;
	movea.l	_IntuitionBase,a1		;
	CALLSYS	CloseLibrary,_SysBase		; Library schließen
6$:						;
	tst.l	_DOSBase			;
	beq.s	7$				;
	movea.l	_DOSBase,a1			;
	CALLSYS	CloseLibrary,_SysBase		; Library schließen
7$:						;
	tst.l	Message				;
	beq.s	8$				;
	CALLSYS	Forbid,_SysBase			;
	move.l	Message,a1			;
	CALL	ReplyMsg			;
	CALL	Permit				;
8$:
	movea.l	Stack,sp			; Stack
	clr.l	d0				; für DOS
	rts					; und zurück

*****
** Print:
**       gibt einen String aus
*****
Print:						;
	tst.l	Output				; Outputhandle ?
	beq.s	2$				; nein, Abbruch
	move.l	a5,d2				; Zeiger nach D2
	move.l	Output,d1			; Outputhandle nach D1
	move.l	#-1,d3				; Zähler -1
1$:						; Schleife
	addq.l	#1,d3				; Zähler=Zähler+1
	tst.b	(a5)+				; Test auf Ende
	bne.s	1$				; nein, weiter suchen
	CALLSYS	Write,_DOSBase			; sonst ausgeben
2$:						;
	rts					; und zurück

*****
** FlimmerGame
*****
FlimmerGame:
	movem.l	d0/d1,-(sp)
	move.l	#$2fff,d0
Flimmer1:
	move.w	#0,$dff180
	move.w	$DFF006,$dff182
	move.l	#$30,d1
Flimmer2:
	nop
	dbf	d1,Flimmer2
	move.w	d0,$dff180
	dbf	d0,Flimmer1
	movem.l	(sp)+,d0/d1
	rts

******************************************************************************
*                                                                            *
*                      G A D G E T S T R U K T U R E N                       *
*                                                                            *
******************************************************************************
MyGadget:
	dc.l	CloseGadget
	dc.w	125,3,71,26,GADGETFLAGS,GADGETACT,GADGETTYP
	dc.l	ImageMyGad,0,0,0,0
	dc.w	GADMYGAD
	dc.l	0
CloseGadget:
	dc.l	BackGadget
	dc.w	83,3,31,18,GADGETFLAGS,GADGETACT,GADGETTYP
	dc.l	ImageClose,0,0,0,0
	dc.w	GADCLOSE
	dc.l	0
BackGadget:
	dc.l	ZeigeIFFGadget
	dc.w	206,3,31,18,GADGETFLAGS,GADGETACT,GADGETTYP
	dc.l	ImageBack,0,0,0,0
	dc.w	GADBACK
	dc.l	0
ZeigeIFFGadget:
	dc.l	KonIFFGadget
	dc.w	73,32,173,34,GADGETFLAGS,GADGETACT,GADGETTYP
	dc.l	ImageZeigeIFF,0,0,0,0
	dc.w	GADZEIGEIFF
	dc.l	0
KonIFFGadget:
	dc.l	InfoGadget
	dc.w	73,68,173,34,GADGETFLAGS,GADGETACT,GADGETTYP
	dc.l	ImageKonIFF,0,0,0,0
	dc.w	GADKONIFF
	dc.l	0
InfoGadget:
	dc.l	StrukGadget
	dc.w	73,104,173,34,GADGETFLAGS,GADGETACT,GADGETTYP
	dc.l	ImageInfo,0,0,0,0
	dc.w	GADINFO
	dc.l	0
StrukGadget:
	dc.l	ZeigenGadget
	dc.w	100,141,124,73,GADGETFLAGS,GADGETACT,GADGETTYP
	dc.l	ImageStruk,0,0,0,0
	dc.w	GADSTRUK
	dc.l	0
ZeigenGadget:
	dc.l	0
	dc.w	88,217,148,33,$2|$4,GADGETACT|$100,GADGETTYP
	dc.l	ImageZeigen,ImageHaken,0,0,0
	dc.w	GADZEIGEN
	dc.l	0
ImageHaken2:
	dc.w	0,0,32,18,4
	dc.l	ImageData13
	dc.b	$f,0
	dc.l	0

******************************************************************************
*                                                                            *
*                     V A R I A B E L N  &  D A T E N                        *
*                                                                            *
******************************************************************************

DOSName:		dc.b	'dos.library',0
			cnop	2
GfxName:		dc.b	'graphics.library',0
			cnop	2
IntuitionName:		dc.b	'intuition.library',0
			cnop	2
NoCHIP_Err:		dc.b	'Keinen CHIP-Speicher für Images.',10,13,0
			cnop	2
NoScreen_Err:		dc.b	'Konnte Screen nicht oeffnen.',10,13,0
			cnop	2
NoWindow_Err:		dc.b	'Konnte Window nicht oeffnen.',10,13,0
			cnop	2
SleepyColors:		dc.b	8,3,0,15,15,15,15,15,0
			cnop	2
MouseColors:		ds.b	10
			cnop	2
InfoFmt:		dc.b	'%3d',0
			cnop	2
_SysBase:		dc.l	0
_IntuitionBase:		dc.l	0
_DOSBase:		dc.l	0
_GfxBase:		dc.l	0
Message:		dc.l	0
Output:			dc.l	0
CHIPPtr:		dc.l	0
MyScreen:		dc.l	0
MyWindow:		dc.l	0
Window:			dc.l	0
Stack:			dc.l	0
RastPort:		dc.l	0
RastPortWin:		dc.l	0
Position:		dc.l	0
FileHandler:		dc.l	0
WindowHandle:		dc.l	0
InfoFlag:		dc.w	0
XKoor:			dc.w	0
YKoor:			dc.w	0
Width:			dc.w	0
Height:			dc.w	0
Depth:			dc.w	0
AusgabeFlag:		dc.w	0
KonvertFlag:		dc.w	0
Structure:		dc.w	2
FormatTyp:		dc.w	0
BytesPerPlane:		dc.w	0
MyBitMap:		ds.b	40
XImage:			dc.w	0
YImage:			dc.w	0
WidthImage:		dc.w	0
HeightImage:		dc.w	0
DepthImage:		dc.w	0

******************************************************************************
*                                                                            *
*        spezielle Formatstrings für Printf (IMAGE-Version!)                 *
*                                                                            *
******************************************************************************
** für C
BitMapFmtC:
	dc.b	'struct BitMap The_BitMap =',10,'{',10
	dc.b	' 0x4,0x4,0x2,0x2,0x4,',10,' ',0
	cnop	2
PlanesFmtC:
	dc.b	'&PlaneA[0],',0
	dc.b	'&PlaneB[0],',0
	dc.b	'&PlaneC[0],',0
	dc.b	'&PlaneD[0],',0
	dc.b	'&PlaneE[0],',0
	dc.b	'&PlaneF[0],',0
	cnop	2
PlanesC:
	dc.b	'UWORD PlaneA[]=',10,'{',0
	dc.b	'UWORD PlaneB[]=',10,'{',0
	dc.b	'UWORD PlaneC[]=',10,'{',0
	dc.b	'UWORD PlaneD[]=',10,'{',0
	dc.b	'UWORD PlaneE[]=',10,'{',0
	dc.b	'UWORD PlaneF[]=',10,'{',0
	cnop	2
ImageFmtC:
	dc.b	'struct Image The_Image =',10,'{',10
	dc.b	' 0x4,0x4,0x4,0x4,0x4,&ImageData[0],0x2,0x2,NULL',10
	dc.b	'};',10,0
	cnop	2
ImageDataBegC:
	dc.b	'UWORD ImageData[]=',10,'{',0
	cnop	2
ImageDataEndC:
	dc.b	10,'};',10,0
	cnop	2
** für Assembler
BitMapFmtA:
	dc.b	'The_BitMap:',10
	dc.b	'	dc.w	$4,$4',10
	dc.b	'	dc.b	$2,$2',10
	dc.b	'	dc.w	$4',10,0
	cnop	2
PlanesFmtA:
	dc.b	'	dc.l	PlaneA',10,0
	dc.b	'	dc.l	PlaneB',10,0
	dc.b	'	dc.l	PlaneC',10,0
	dc.b	'	dc.l	PlaneD',10,0
	dc.b	'	dc.l	PlaneE',10,0
	dc.b	'	dc.l	PlaneF',10,0
	cnop	2
RawDataC1:
	dc.b	'0x4,',0
	cnop	2
RawDataC2:
	dc.b	10,'0x4,',0
	cnop	2
PlanesA:
	dc.b	10,'PlaneA:',0
	dc.b	10,'PlaneB:',0
	dc.b	10,'PlaneC:',0
	dc.b	10,'PlaneD:',0
	dc.b	10,'PlaneE:',0
	dc.b	10,'PlaneF:',0
	cnop	2
ImageFmtA:
	dc.b	'The_Image:',10
	dc.b	'	dc.w	$4,$4,$4,$4,$4',10
	dc.b	'	dc.l	ImageData',10
	dc.b	'	dc.b	$2,$2',10
	dc.b	'	dc.l	0',10,0
	cnop	2
ImageDataBegA:
	dc.b	'ImageData:',10,0
RawDataA1:
	dc.b	',$4',0
	cnop	2
RawDataA2:
	dc.b	10,'  dc.w $4',0
	cnop	2
DataEndA:
	dc.b	10,';Ende von ImageData',10,0
	cnop	2
LogoA:
	dc.b	10,';Konvertiert mit IMAGE von Aliso',10,0
	cnop	2
LogoC:
	dc.b	10,'/* Konvertiert mit IMAGE von Aliso */',10,0
	cnop	2
WindowCon:
	dc.b	'con:0/0/640/256/IMAGE-Ausgabe-Window',0
	cnop	2
Msg1:
	dc.b	'Dr',$fc,'cke linke Maustaste!',0
	cnop	2
PublicImage:
	ds.b	12
DataFeld:
	ds.b	10
String:			ds.b	255
			cnop	2
