home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d2xx
/
d245
/
fenster
/
fenster.s
< prev
next >
Wrap
Text File
|
1989-09-06
|
32KB
|
1,697 lines
*
* FENSTER V1.0 / 24.July.1989 2 o'clock in the morning
*
* by Roger Fischlin, Steigerwaldweg 6, D-6450 Hanau 7, West Germany
* Phone. (06181) 650266
*
*
* FENSTER v1.0 is public domain software - So you are only allowed
* to use this code for non-commercial purposes.
*
*
*
incdir "vd0:include/"
include intuition/intuition.i
include intuition/intuition_lib.i
include exec/memory.i
include exec/exec_lib.i
include graphics/graphics_lib.i
include graphics/text.i
include libraries/dos_lib.i
include libraries/dos.i
FontFlag set 0
SETAPEN macro
move.l WindowPointer,a1
move.l wd_RPort(a1),a1
move.l \1,d0
CALLGRAF SetAPen
endm
SETBPEN macro
move.l WindowPointer,a1
move.l wd_RPort(a1),a1
move.l \1,d0
CALLGRAF SetBPen
endm
SETDRMD macro
move.l WindowPointer,a1
move.l wd_RPort(a1),a1
move.l \1,d0
CALLGRAF SetDrMd
endm
RECTFILL macro
move.l WindowPointer,a1
move.l wd_RPort(a1),a1
move.l \1,d0
move.l \2,d1
move.l \3,d2
move.l \4,d3
CALLGRAF RectFill
endm
BORDER macro
bra.s MakeBox_\@
MakeBox2_\@ BOX \1,\2,\3,\4,\5,0
MakeBox_\@ move.l WindowPointer,a0
move.l wd_RPort(a0),a0
lea.l MakeBox2_\@(pc),a1
moveq.l #0,d0
moveq.l #0,d1
CALLINT DrawBorder
endm
WRITE macro
move.l WindowPointer,a1
move.l wd_RPort(a1),a1
move.l a1,a3
move.l \1,d0
move.l \2,d1
CALLGRAF Move
move.l a3,a1
move.l \3,d0
CALLGRAF SetAPen
lea.l Write_Text\@(pc),a0
move.l a3,a1
move.l #Write_Ende\@-Write_Text\@,d0
CALLGRAF Text
bra Write_Label\@
Write_Text\@ dc.b \4
Write_Ende\@ dc.b 0
even
Write_Label\@ nop
endm
BOX macro ; macro to create a border structure
dc.w 0,0
dc.b \5,0,RP_JAM1,5
dc.l box_\@,\6
box_\@ dc.w \1,\2,\3,\2,\3,\4,\1,\4,\1,\2
endm
TEXT macro ; macro to create a text structure
dc.b 2,0,RP_JAM1,0
dc.w \1+1,\2+1
dc.l TOPAZ_80,T_String\@,Text2_\@
Text2_\@ dc.b \3,0,RP_JAM1,0
dc.w \1,\2
dc.l TOPAZ_80,T_String\@,0
T_String\@ dc.b \4,0
even
IFEQ FontFlag
TOPAZ_80 dc.l T_80name
dc.w TOPAZ_EIGHTY
dc.b FS_NORMAL,FPF_ROMFONT
even
T_80name dc.b "topaz.font",0
FontFlag set 1
endc
endm
AUTOGADGET macro
* \1,\2 x,y
* \3,\4 size
* \5,\6 colors (text & Box)
* \7 Text
* \8 ID
* \9 NextGadget
dc.l \9
dc.w \1,\2,\3,\4
dc.w GADGHCOMP,RELVERIFY,BOOLGADGET
dc.l AGadget\@_Box
dc.l 0,AGadget\@_Text,0,0
dc.w \8,0,0
AGadget\@_Box BOX -1,-1,\3,\4,\5,0
even
AG_T_String\@ dc.b \7,0
AG_T_String\@_End
even
AGadget\@_Text dc.b 2,0,RP_JAM1,0
dc.w (\3-(AG_T_String\@_End-AG_T_String\@-1)*8)/2+1,((\4-8)/2)+1
dc.l TOPAZ_80,AG_T_String\@,AG_Text2_\@
AG_Text2_\@ dc.b \6,0,RP_JAM1,0
dc.w (\3-(AG_T_String\@_End-AG_T_String\@-1)*8)/2),(\4-8)/2
dc.l TOPAZ_80,AG_T_String\@,0
IFEQ FontFlag
TOPAZ_80 dc.l T_80name
dc.w TOPAZ_EIGHTY
dc.b FS_NORMAL,FPF_ROMFONT
even
T_80name dc.b "topaz.font",0
FontFlag set 1
endc
endm
include "misc/easystart.i"
OpenThem lea dosname(pc),a1 ; open libs
moveq.l #0,d0
CALLEXEC OpenLibrary
move.l d0,_DOSBase
lea intname(pc),a1
moveq.l #0,d0
CALLEXEC OpenLibrary
move.l d0,_IntuitionBase
lea grafname(pc),a1
moveq.l #0,d0
CALLEXEC OpenLibrary
move.l d0,_GfxBase
jmp Init ; jump to end of file
_DOSBase dc.l 0
dosname DOSNAME
_GfxBase dc.l 0
grafname GRAFNAME
_IntuitionBase dc.l 0
intname INTNAME
Window1 dc.l 0
Palette dc.w $443,$eee,$002,$f80
Start lea.l Screendef,a0 ; open Screen
CALLINT OpenScreen
tst.l d0
beq ende
move.l d0,ScreenPtr1
lea.l Windowdef1,a0 ; open window
CALLINT OpenWindow
tst.l d0
beq QUIT2
move.l d0,Window1
move.l d0,a0 ; set colours
CALLINT ViewPortAddress
move.l d0,a0
moveq.l #4,d0
lea.l Palette,a1
CALLGRAF LoadRGB4
CALLINT RemakeDisplay
WindowPointer set Window1 ;define Window1 as WindowPointer (for macros )
SETDRMD #RP_JAM1
ChangeScreen SETAPEN #0
RECTFILL #10,#10,#270,#165
clr.l Mode ; mode = select Screen
jsr ShowScreen ; Select Screen
lea.l Gadget1,a0
move.l Window1,a1
sub.l a2,a2
CALLINT RefreshGadgets
wait move.l Window1,a0 ; wait .....
move.l wd_UserPort(a0),a0
move.l a0,a5
CALLEXEC WaitPort
move.l a5,a0
CALLEXEC GetMsg ; get message
move.l d0,a1
move.l im_Class(a1),d4 ; get data
move.w im_Code(a1),d5
move.l im_IAddress(a1),a4
moveq.l #0,d6
move.w im_MouseY(a1),d6
CALLEXEC ReplyMsg ; reply message
cmp.l #MENUPICK,d4
beq QUIT
cmp.l #VANILLAKEY,d4
beq KEY
moveq.l #0,d0 ; use table to get subroutine
move.w gg_GadgetID(a4),d0
subq #1,d0
lsl.l #2,d0
lea.l Vektoren,a0
tst.l Mode
bne modus2
lea.l VektorenScreen,a0
modus2 move.l (a0,d0),a0
jmp (a0)
Vektoren dc.l ChangeScreen,GetWindows,KillWindow,FRONT,BACK
dc.l CLEAR,FRAME,ALL,REFRESH,IDCMP
dc.l ABOUT,NewLimits,NewLimits,NewLimits,NewLimits
dc.l NewPen,MoveWindow,MoveWindow,SizeWindow,SizeWindow
dc.l NewPen,WindowSelect,wait,wait,wait
VektorenScreen dc.l ChangeScreen,ChangeScreen,Error,Error,Error
dc.l Error,Error,Error,Error,Error
dc.l ABOUT,Error,Error,Error,Error
dc.l Error,Error,Error,Error,Error
dc.l Error,ScreenSelect,wait,wait
Error move.l ScreenPtr1,a0
CALLINT DisplayBeep
bra wait
QUIT move.l Window1,a0 ; bye, bye !
CALLINT CloseWindow
move.l ScreenPtr1,a0
CALLINT CloseScreen
moveq.l #0,d0
rts
KEY cmp.b #"f",d5 ; useful key pressed ?
beq KEY2
cmp.b #"s",d5
bne KEY3
tst.l Mode
beq wait
move.l BILDSCHIRM,a0
CALLINT ScreenToFront
bra wait
KEY2 move.l ScreenPtr1,a0
CALLINT ScreenToFront
bra wait
KEY3 cmp.b #"u",d5
beq UP
cmp.b #"d",d5
bne wait
move.l Top,d0 ; move down
add.l #17,d0
cmp.l Anzahl,d0
bge wait
add.l #1,Top
bra ShowWindow
UP tst.l Top ; move up
beq wait
sub.l #1,Top
bra ShowWindow
Mode dc.l 0
Screendef dc.w 0,0,460-4,199,2
dc.b 0,1
dc.w V_HIRES
dc.w CUSTOMSCREEN
dc.l TOPAZ_80
dc.l S_Title,0,0
Windowdef1 dc.w 0,0,460-4,199
dc.b -1,-1
dc.l GADGETUP!MENUPICK!VANILLAKEY
dc.l WINDOWDRAG!WINDOWCLOSE!ACTIVATE!SMART_REFRESH!BACKDROP
dc.l Gadget1
dc.l 0
dc.l 0
ScreenPtr1 dc.l 0,0
dc.w 0,0,0,0,CUSTOMSCREEN
S_Title dc.b "RF-Tools : FENSTER V1.0 by Roger Fischlin 7/1989 ",0
even
Gadget1 AUTOGADGET 280,13+0*14,165,10,3,1,<"Change Screen">,1,Gadget2
even
Gadget2 AUTOGADGET 280,13+1*14,165,10,3,1,<"Update List">,2,Gadget3
even
Gadget3 AUTOGADGET 280,13+2*14,165,10,3,1,<"Kill Window">,3,Gadget4
even
Gadget4 AUTOGADGET 280,13+3*14,165,10,3,1,<"Window To Front">,4,Gadget5
even
Gadget5 AUTOGADGET 280,13+4*14,165,10,3,1,<"Window To Back">,5,Gadget6
even
Gadget6 AUTOGADGET 280,13+5*14,165,10,3,1,<"Clear Pointer">,6,Gadget7
even
Gadget7 AUTOGADGET 280,13+6*14,165,10,3,1,<"Redraw Frame">,7,Gadget8
even
Gadget8 AUTOGADGET 280,13+7*14,165,10,3,1,<"Kill Screen&Windows">,8,Gadget9
even
Gadget9 AUTOGADGET 280,13+8*14,165,10,3,1,<"Refresh Gadgets">,9,Gadget10
even
Gadget10 AUTOGADGET 280,13+9*14,165,10,3,1,<"Modify IDCMP">,10,Gadget11
even
Gadget11 AUTOGADGET 280,13+10*14,165,10,1,3,<"About Fenster">,11,Gadget12
even
Gadget12 dc.l Gadget13
dc.w 55,185+3,41,12
dc.w GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
dc.l G12_box
dc.l 0,G12_Text,0,G12_Info
dc.w 12,0,0
G12_box BOX -5,-4,36,12,1,G12_Box2
even
G12_Box2 BOX -5,-4,-55,12,1,0
even
G12_Text TEXT -50,0,3,<"min.X">
even
G12_Info dc.l G12_Puffer,G12_Undo
dc.w 0,4
ds.b si_SIZEOF
G12_Puffer ds.b 6
G12_Undo ds.b 6
Gadget13 dc.l Gadget14
dc.w 5*8+150-45+1,185+3,41,12
dc.w GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
dc.l G12_box
dc.l 0,G13_Text,0,G13_Info
dc.w 13,0,0
even
G13_Text TEXT -50,0,3,<"min.Y">
even
G13_Info dc.l G13_Puffer,G13_Undo
dc.w 0,4
ds.b si_SIZEOF
G13_Puffer ds.b 6
G13_Undo ds.b 6
Gadget14 dc.l Gadget15
dc.w 5*8+250-10-45+2,185+3,41,12
dc.w GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
dc.l G12_box
dc.l 0,G14_Text,0,G14_Info
dc.w 14,0,0
even
G14_Text TEXT -50,0,3,<"max.X">
even
G14_Info dc.l G14_Puffer,G14_Undo
dc.w 0,4
ds.b si_SIZEOF
G14_Puffer ds.b 6
G14_Undo ds.b 6
Gadget15 dc.l Gadget16
dc.w 5*8+350-20-45+3,185+3,41,12
dc.w GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
dc.l G12_box
dc.l 0,G15_Text,0,G15_Info
dc.w 15,0,0
even
G15_Text TEXT -53,0,3,<"max.Y">
even
G15_Info dc.l G15_Puffer,G15_Undo
dc.w 0,4
ds.b si_SIZEOF
G15_Puffer ds.b 6
G15_Undo ds.b 6
Gadget16 dc.l Gadget17
dc.w 5*8+450-30-45+4,185+3,41,12
dc.w GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
dc.l G16_box
dc.l 0,G16_Text,0,G16_Info
dc.w 16,0,0
even
G16_box BOX -5,-4,35,12,1,G16_Box2
even
G16_Box2 BOX -5,-4,-55,12,1,0
even
G16_Text TEXT -50,0,3,<"BPen">
even
G16_Info dc.l G16_Puffer,G16_Undo
dc.w 0,3
ds.b si_SIZEOF
G16_Puffer ds.b 6
G16_Undo ds.b 6
Gadget17 dc.l Gadget18
dc.w 55,185+3-16,41,12
dc.w GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
dc.l G12_box
dc.l 0,G17_Text,0,G17_Info
dc.w 17,0,0
G17_Text TEXT -50,0,3,<"X">
even
G17_Info dc.l G17_Puffer,G17_Undo
dc.w 0,4
ds.b si_SIZEOF
G17_Puffer ds.b 6
G17_Undo ds.b 6
Gadget18 dc.l Gadget19
dc.w 5*8+150-45+1,185+3-16,41,12
dc.w GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
dc.l G12_box
dc.l 0,G18_Text,0,G18_Info
dc.w 18,0,0
even
G18_Text TEXT -50,0,3,<"Y">
even
G18_Info dc.l G18_Puffer,G18_Undo
dc.w 0,4
ds.b si_SIZEOF
G18_Puffer ds.b 6
G18_Undo ds.b 6
Gadget19 dc.l Gadget20
dc.w 5*8+250-10-45+2,185+3-16,41,12
dc.w GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
dc.l G12_box
dc.l 0,G19_Text,0,G19_Info
dc.w 19,0,0
even
G19_Text TEXT -50,0,3,<"Width">
even
G19_Info dc.l G19_Puffer,G19_Undo
dc.w 0,4
ds.b si_SIZEOF
G19_Puffer ds.b 6
G19_Undo ds.b 6
Gadget20 dc.l Gadget21
dc.w 5*8+350-20-45+3,185+3-16,41,12
dc.w GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
dc.l G12_box
dc.l 0,G20_Text,0,G20_Info
dc.w 20,0,0
even
G20_Text TEXT -53,0,3,<"Height">
even
G20_Info dc.l G20_Puffer,G20_Undo
dc.w 0,4
ds.b si_SIZEOF
G20_Puffer ds.b 6
G20_Undo ds.b 6
Gadget21 dc.l Gadget22
dc.w 5*8+450-30-45+4,185+3-16,41,12
dc.w GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
dc.l G16_box
dc.l 0,G21_Text,0,G21_Info
dc.w 21,0,0
even
G21_Text TEXT -50,0,3,<"DPen">
even
G21_Info dc.l G21_Puffer,G21_Undo
dc.w 0,3
ds.b si_SIZEOF
G21_Puffer ds.b 6
G21_Undo ds.b 6
even
Gadget22 dc.l 0
dc.w 10,32-6,240+16,128+8
dc.w GADGHNONE,RELVERIFY!LONGINT,BOOLGADGET
dc.l 0
dc.l 0,0,0,0
dc.w 22,0,0
even
Windowdef3 dc.w (454-300)/2,25,300,120
dc.b -1,-1
dc.l GADGETUP
dc.l WINDOWDRAG!ACTIVATE!SMART_REFRESH
dc.l GadgetAbout
dc.l 0
dc.l W3_Title
dc.l 0,0
dc.w 0,0,0,0,CUSTOMSCREEN
W3_Title dc.b " » ABOUT FENSTER « ",0
even
GadgetAbout AUTOGADGET 20,100,260,12,3,1,<"Exit">,0,0
even
Window2 dc.l 0
ABOUT lea.l Windowdef3,a0 ; about FENSTER
move.l ScreenPtr1,nw_Screen(a0)
CALLINT OpenWindow
tst.l d0
beq wait
move.l d0,Window2
WindowPointer set Window2
SETAPEN #2
RECTFILL #2,#10,#297,#118
SETDRMD #RP_JAM1
WRITE #6+((290-23*8)/2),#20+1,#0,<"RF-Tools : FENSTER V1.0">
WRITE #6+((290-31*8)/2),#29+1,#0,<"This utility is public domain !">
WRITE #6+((290-24*8)/2),#40+1,#0,<"by: Roger Fischlin ">
WRITE #6+((290-24*8)/2),#49+1,#0,<" Steigerwaldweg 6">
WRITE #6+((290-24*8)/2),#58+1,#0,<" D-6450 Hanau 7">
WRITE #6+((290-24*8)/2),#67+1,#0,<" West Germany">
WRITE #6+((290-24*8)/2),#76+1,#0,<" Phone:(06181) 650266">
WRITE #6+((290-33*8)/2),#86+1,#0,<"What about reading the doc file ?">
WRITE #5+((290-23*8)/2),#20,#1,<"RF-Tools : FENSTER V1.0">
WRITE #5+((290-31*8)/2),#29,#1,<"This utility is public domain !">
WRITE #5+((290-24*8)/2),#40,#3,<"by: Roger Fischlin ">
WRITE #5+((290-24*8)/2),#49,#3,<" Steigerwaldweg 6">
WRITE #5+((290-24*8)/2),#58,#3,<" D-6450 Hanau 7">
WRITE #5+((290-24*8)/2),#67,#3,<" West Germany">
WRITE #5+((290-24*8)/2),#76,#3,<" Phone:(06181) 650266">
WRITE #5+((290-33*8)/2),#86,#1,<"What about reading the doc file ?">
lea.l GadgetAbout,a0
move.l Window2,a1
sub.l a2,a2
CALLINT RefreshGadgets
move.l Window2,a0
move.l wd_UserPort(a0),a0
CALLEXEC WaitPort
move.l Window2,a0
CALLINT CloseWindow
bra wait
Zeile dc.b " ... x .. ",0
even
* Ask User to select screen ....
WindowPointer set Window1
ShowScreen WRITE #10,#20,#2,<" Select Screen">
WRITE #11,#19,#1,<" Select Screen">
WRITE #10,#26,#2,<"--------------------------------">
WRITE #11,#25,#1,<"--------------------------------">
SETAPEN #3
moveq.l #0,d5 ; get pointer to first screen
move.l _IntuitionBase,a6
move.l ib_FirstScreen(a6),a5
lea.l Pointer,a3
clr.l Anzahl
clr.l Top
.SS1 move.l sc_DefaultTitle(a5),a4 ; get screen title
lea.l Zeile,a0 ; up to 32 characters
move.l #31,d0
.SS5 move.b #" ",(a0)+
dbra d0,.SS5
move.b #"x",Zeile+59-32
lea.l Zeile,a0
.SS2 tst.b (a4) ; leave out spaces
beq .SS3
cmp.b #" ",(a4)+
beq .SS2
tst.b -(a4)
beq .SS3
move.l #21,d0
.SS4 move.b (a4)+,d1
beq .SS3
move.b d1,(a0)+
dbra d0,.SS4
.SS3 moveq.l #0,d0 ; write screen width & height
move.w sc_Width(a5),d0
lea.l Zeile+54-32,a0
bsr MakeZahl
moveq.l #0,d0
move.w sc_Height(a5),d0
lea.l Zeile+60-32,a0
bsr MakeZahl
move.l Window1,a1
move.l wd_RPort(a1),a1
move.l #10,d0
move.l d5,d1
lsl.l #3,d1
add.l #32,d1
CALLGRAF Move
lea.l Zeile,a0
move.l Window1,a1
move.l wd_RPort(a1),a1
move.l #33,d0
CALLGRAF Text
add.l #1,Anzahl
move.l a5,(a3)+ ; any more screens ?
move.l (a5),a5
cmp.l #0,a5
beq .SS6
addq #1,d5
cmp.w #14,d5 ; up to 14 screens (DID YOU HAVE HAD MORE THAN 14 SCREENS ?!?)
bne .SS1
.SS6 rts
Top dc.l 0 ; nummer of first pointer on display
Anzahl dc.l 0 ; number of pointers displayed
FENSTER dc.l 0 ; pointer to current window
BILDSCHIRM dc.l 0 ; pointer to current screen
Pointer ds.l 20*5 ; array containing the window pointers
MakeZahl moveq.l #3,d2 ; convert number (<1024) into ASCII text
moveq.l #0,d3
lea.l .Potenzen,a1
.MZ1 move.b #"0"-1,d1
.MZ2 addq #1,d1
sub.l (a1),d0
bcc .MZ2
add.l (a1)+,d0
tst.b d2
beq .MZ3
cmp.b #"0",d1
beq .MZ4
moveq.l #1,d3
bra .MZ3
.MZ4 tst.b d3
bne .MZ3
move.b #" ",d1
.MZ3 move.b d1,(a0)+
dbra d2,.MZ1
rts
.Potenzen dc.l 1000
dc.l 100
dc.l 10
dc.l 1
MakeZahl3 moveq.l #2,d2 ; convert number (<1000) into ASCII text
moveq.l #0,d3
lea.l .Potenzen,a1
.MZ1 move.b #"0"-1,d1
.MZ2 addq #1,d1
sub.l (a1),d0
bcc .MZ2
add.l (a1)+,d0
tst.b d2
beq .MZ3
cmp.b #"0",d1
beq .MZ4
moveq.l #1,d3
bra .MZ3
.MZ4 tst.b d3
beq .MZ5
.MZ3 move.b d1,(a0)+
.MZ5 dbra d2,.MZ1
clr.b (a0)
rts
.Potenzen dc.l 100
dc.l 10
dc.l 1
MakeZahl2 moveq.l #1,d2 ; convert number (<99) into ASCII text
moveq.l #0,d3
lea.l .Potenzen,a1
.MZ1 move.b #"0"-1,d1
.MZ2 addq #1,d1
sub.l (a1),d0
bcc .MZ2
add.l (a1)+,d0
tst.b d2
beq .MZ3
cmp.b #"0",d1
beq .MZ4
moveq.l #1,d3
bra .MZ3
.MZ4 tst.b d3
beq .MZ5
.MZ3 move.b d1,(a0)+
.MZ5 dbra d2,.MZ1
clr.b (a0)
rts
.Potenzen dc.l 10
dc.l 1
GetLine sub.w gg_TopEdge(a4),d6 ; calculate which screen / window was selected
lsr.w #3,d6
and.l #$ffff,d6
move.l Anzahl,d0
add.l Top,d6
cmp.l d0,d6
bge .GetLine1
lea.l Pointer,a0
lsl.l #2,d6
move.l (a0,d6),a0 ; a0 contains pointer
moveq.l #0,d0
rts
.GetLine1 moveq.l #-1,d0 ; error - user selected space
rts
ScreenSelect jsr GetLine ; list windows of selected screen
tst.l d0
bne wait
move.l a0,a5
move.l a5,BILDSCHIRM
SETAPEN #0
RECTFILL #10,#10,#270,#165
WRITE #10,#26,#2,<"--------------------------------">
WRITE #11,#25,#1,<"--------------------------------">
.SS1 move.l sc_DefaultTitle(a5),a4 ; write screen title
lea.l Zeile,a0
move.l #31,d0
.SS5 move.b #" ",(a0)+
dbra d0,.SS5
move.b #"x",Zeile+59-32
lea.l Zeile,a0
.SS2 tst.b (a4)
beq .SS3
cmp.b #" ",(a4)+
beq .SS2
tst.b -(a4)
beq .SS3
move.l #21,d0
.SS4 move.b (a4)+,d1
beq .SS3
move.b d1,(a0)+
dbra d0,.SS4
.SS3 moveq.l #0,d0
move.w sc_Width(a5),d0
lea.l Zeile+54-32,a0
bsr MakeZahl
moveq.l #0,d0
move.w sc_Height(a5),d0
lea.l Zeile+60-32,a0
bsr MakeZahl
SETAPEN #2
move.l Window1,a1
move.l wd_RPort(a1),a1
move.l #10+1,d0
move.l #19+1,d1
CALLGRAF Move
lea.l Zeile,a0
move.l Window1,a1
move.l wd_RPort(a1),a1
move.l #33,d0
CALLGRAF Text
SETAPEN #1
move.l Window1,a1
move.l wd_RPort(a1),a1
move.l #10,d0
move.l #19,d1
CALLGRAF Move
lea.l Zeile,a0
move.l Window1,a1
move.l wd_RPort(a1),a1
move.l #33,d0
CALLGRAF Text
move.l #1,Mode
GetWindows SETAPEN #0 ; storew all windows on the screen in array and print their names
RECTFILL #10,#28,#270,#165
move.l BILDSCHIRM,a5
clr.l FENSTER
lea.l Pointer,a1
move.l #20*5,d0
clr.l Top
clr.l Anzahl
clr.l Pointer
move.l sc_FirstWindow(a5),a5
.Loop cmp.l #0,a5
beq .Loop2
.Loop3 move.l a5,(a1)+
add.l #1,Anzahl
move.l (a5),a5
dbra d0,.Loop
.Loop2 move.l Pointer,FENSTER ; define first window as already selected
jsr FillIn ; Fill in the gadgets on the bottom
ShowWindow SETAPEN #3
SETBPEN #0
SETDRMD #RP_JAM2
move.l Window1,a1
move.l wd_RPort(a1),a1
move.l #10,d0
move.l #32,d1
CALLGRAF Move
lea.l ClearZeile,a0
move.l Window1,a1
move.l wd_RPort(a1),a1
move.l #32,d0
CALLGRAF Text
moveq.l #0,d5
lea.l Pointer,a3
move.l Top,d4
lsl.l #2,d4
add.l d4,a3
.SS1 move.l d5,d0
add.l Top,d0
cmp.l Anzahl,d0
bge .SS6
SETBPEN #0
move.l (a3)+,a5
cmp.l FENSTER,a5
bne .SS0
SETBPEN #2
.SS0 move.l wd_Title(a5),a4 ; title up to 31 characters
lea.l Zeile,a0
move.l #31,d0
.SS5 move.b #" ",(a0)+
dbra d0,.SS5
lea.l Zeile,a0
.SS2 tst.b (a4)
beq .SS3
cmp.b #" ",(a4)+
beq .SS2
tst.b -(a4)
beq .SS3
move.l #31,d0
.SS4 move.b (a4)+,d1
beq .SS3
move.b d1,(a0)+
dbra d0,.SS4
.SS3
move.l Window1,a1
move.l wd_RPort(a1),a1
move.l #10,d0
move.l d5,d1
lsl.l #3,d1
add.l #32,d1
CALLGRAF Move
lea.l Zeile,a0
move.l Window1,a1
move.l wd_RPort(a1),a1
move.l #32,d0
CALLGRAF Text
addq #1,d5
cmp.w #17,d5
bne .SS1
.SS6 SETDRMD #RP_JAM1
bra wait
ClearZeile dc.b " "
even
WindowSelect jsr GetLine ; which window was selected ?
tst.l d0
bne wait
move.l a0,FENSTER
jsr FillIn
bra ShowWindow
FRONT move.l FENSTER,a0 ; move window to front
cmp.l #0,a0
beq Error
CALLINT WindowToFront
bra wait
BACK move.l FENSTER,a0 ; " " " back
cmp.l #0,a0
beq Error
CALLINT WindowToBack
bra wait
CLEAR move.l FENSTER,a0 ; clear pointer
cmp.l #0,a0
beq Error
CALLINT ClearPointer
bra wait
NewLimits move.l FENSTER,a0 ; define new limits
cmp.l #0,a0
beq Error
moveq.l #0,d0
moveq.l #0,d1
moveq.l #0,d2
moveq.l #0,d3
move.w G12_Info+si_LongInt+2,d0
move.w G13_Info+si_LongInt+2,d1
move.w G14_Info+si_LongInt+2,d2
move.w G15_Info+si_LongInt+2,d3
CALLINT WindowLimits
bra wait
NewPen move.l FENSTER,a0 ; define new pens
cmp.l #0,a0
beq Error
move.b G16_Info+si_LongInt+3,wd_BlockPen(a0)
move.b G21_Info+si_LongInt+3,wd_DetailPen(a0)
FRAME move.l FENSTER,a0
cmp.l #0,a0
beq Error
CALLINT RefreshWindowFrame ; use them !
bra wait
REFRESH move.l FENSTER,a1 ; refresh gadgets (if there are any to be refreshed !)
cmp.l #0,a1
beq Error
move.l wd_FirstGadget(a1),a0
sub.l a2,a2
cmp.l #0,a0
beq Error
CALLINT RefreshGadgets
bra wait
FillIn move.l FENSTER,a6 ; put data from window into longint gadgets
cmp.l #0,a6
beq .Label1
lea.l G12_Puffer,a0
moveq.l #0,d0
move.w wd_MinWidth(a6),d0
move.l d0,G12_Info+si_LongInt
bsr MakeZahl3
lea.l G13_Puffer,a0
moveq.l #0,d0
move.w wd_MinHeight(a6),d0
move.l d0,G13_Info+si_LongInt
bsr MakeZahl3
lea.l G14_Puffer,a0
moveq.l #0,d0
move.w wd_MaxWidth(a6),d0
cmp.w #999,d0
bls .Label3
moveq.l #0,d0
.Label3 move.l d0,G14_Info+si_LongInt
bsr MakeZahl3
lea.l G15_Puffer,a0
moveq.l #0,d0
move.w wd_MaxHeight(a6),d0
cmp.w #999,d0
bls .Label4
moveq.l #0,d0
.Label4 move.l d0,G15_Info+si_LongInt
bsr MakeZahl3
lea.l G17_Puffer,a0
moveq.l #0,d0
move.w wd_LeftEdge(a6),d0
move.l d0,G17_Info+si_LongInt
bsr MakeZahl3
lea.l G18_Puffer,a0
moveq.l #0,d0
move.w wd_TopEdge(a6),d0
move.l d0,G18_Info+si_LongInt
bsr MakeZahl3
lea.l G19_Puffer,a0
moveq.l #0,d0
move.w wd_Width(a6),d0
move.l d0,G19_Info+si_LongInt
bsr MakeZahl3
lea.l G20_Puffer,a0
moveq.l #0,d0
move.w wd_Height(a6),d0
move.l d0,G20_Info+si_LongInt
bsr MakeZahl3
lea.l G16_Puffer,a0
moveq.l #0,d0
move.b wd_BlockPen(a6),d0
move.l d0,G16_Info+si_LongInt
bsr MakeZahl2
lea.l G21_Puffer,a0
moveq.l #0,d0
move.b wd_DetailPen(a6),d0
move.l d0,G21_Info+si_LongInt
bsr MakeZahl2
lea.l Gadget12,a0
move.l Window1,a1
sub.l a2,a2
CALLINT RefreshGadgets
rts
.Label1 clr.b G12_Puffer
clr.b G13_Puffer
clr.b G14_Puffer
clr.b G15_Puffer
clr.b G16_Puffer
clr.b G17_Puffer
clr.b G18_Puffer
clr.b G19_Puffer
clr.b G20_Puffer
clr.b G21_Puffer
lea.l Gadget12,a0
move.l Window1,a1
sub.l a2,a2
CALLINT RefreshGadgets
rts
Windowdef4 dc.w (454-300)/2,45,300,80
dc.b -1,-1
dc.l GADGETUP
dc.l WINDOWDRAG!ACTIVATE!SMART_REFRESH
dc.l GadgetGURU
dc.l 0
dc.l W4_Title
dc.l 0,0
dc.w 0,0,0,0,CUSTOMSCREEN
W4_Title dc.b " » ERROR MESSAGE « ",0
even
GadgetGURU AUTOGADGET 20,60,260,12,3,1,<"Exit">,0,0
even
GURU lea.l Windowdef4,a0
move.l ScreenPtr1,nw_Screen(a0)
CALLINT OpenWindow
tst.l d0
beq Undo
move.l d0,Window2
WindowPointer set Window2
SETAPEN #2
RECTFILL #2,#10,#297,#78
SETDRMD #RP_JAM1
WRITE #6+((290-32*8)/2),#20+1,#0,<"Sorry - But if I moved / resized">
WRITE #6+((290-29*8)/2),#30+1,#0,<"the window , the system would">
WRITE #6+((290-30*8)/2),#40+1,#0,<"crash !!! Check screen size !">
WRITE #5+((290-32*8)/2),#20,#1,<"Sorry - But if I moved / resized">
WRITE #5+((290-29*8)/2),#30,#1,<"the window , the system would">
WRITE #5+((290-30*8)/2),#40,#1,<"crash !!! Check screen size !">
lea.l GadgetGURU,a0
move.l Window2,a1
sub.l a2,a2
CALLINT RefreshGadgets
move.l Window2,a0
move.l wd_UserPort(a0),a0
CALLEXEC WaitPort
move.l Window2,a0
CALLINT CloseWindow
Undo move.l FENSTER,a6 ; get current data (to undo illegal data)
lea.l G17_Puffer,a0
moveq.l #0,d0
move.w wd_LeftEdge(a6),d0
move.l d0,G17_Info+si_LongInt
bsr MakeZahl3
lea.l G18_Puffer,a0
moveq.l #0,d0
move.w wd_TopEdge(a6),d0
move.l d0,G18_Info+si_LongInt
bsr MakeZahl3
lea.l G19_Puffer,a0
moveq.l #0,d0
move.w wd_Width(a6),d0
move.l d0,G19_Info+si_LongInt
bsr MakeZahl3
lea.l G20_Puffer,a0
moveq.l #0,d0
move.w wd_Height(a6),d0
move.l d0,G20_Info+si_LongInt
bsr MakeZahl3
lea.l Gadget17,a0
move.l Window1,a1
sub.l a2,a2
CALLINT RefreshGadgets
bra wait
WindowPointer set Window1
A
MoveWindow move.l FENSTER,a0 ; move window
move.l G17_Info+si_LongInt,d0
move.l G18_Info+si_LongInt,d1
move.l d0,d2
move.l d1,d3
add.w wd_Width(a0),d2
add.w wd_Height(a0),d3
move.l wd_WScreen(a0),a1
cmp.w sc_Width(a1),d2 ; check if they are possible !!!!
bhi GURU
cmp.w sc_Height(a1),d3
bhi GURU
sub.w wd_LeftEdge(a0),d0
sub.w wd_TopEdge(a0),d1
CALLINT MoveWindow
bra wait
SizeWindow move.l FENSTER,a0 ; re-size window
move.l G19_Info+si_LongInt,d0
move.l G20_Info+si_LongInt,d1
move.l d0,d2
move.l d1,d3
add.w wd_LeftEdge(a0),d2
add.w wd_TopEdge(a0),d3
move.l wd_WScreen(a0),a1
cmp.w sc_Width(a1),d2 ; check if they are possible !!!!
bhi GURU
cmp.w sc_Height(a1),d3
bhi GURU
sub.w wd_Width(a0),d0
sub.w wd_Height(a0),d1
CALLINT SizeWindow
bra wait
Windowdef5 dc.w 275,30,174,100
dc.b -1,-1
dc.l GADGETUP
dc.l WINDOWDRAG!ACTIVATE!SMART_REFRESH
dc.l GadgetKILL1
dc.l 0
dc.l W5_Title
dc.l 0,0
dc.w 0,0,0,0,CUSTOMSCREEN
W5_Title dc.b " » KILL WINDOW « ",0
even
GadgetKILL1 AUTOGADGET 10,60,154,12,3,1,<"YES !">,0,GadgetKILL2
even
GadgetKILL2 AUTOGADGET 10,80,154,12,3,1,<"No - forget it !">,1,0
even
KillWindow tst.l FENSTER
beq Error
lea.l Windowdef5,a0
move.l ScreenPtr1,nw_Screen(a0)
CALLINT OpenWindow
tst.l d0
beq KILL_IT
move.l d0,Window2
WindowPointer set Window2
SETAPEN #2
RECTFILL #2,#10,#171,#98
SETDRMD #RP_JAM1
WRITE #1+((174-18*8)/2),#20+1,#0,<"Do you really want">
WRITE #1+((174-18*8)/2),#30+1,#0,<"to close the">
WRITE #1+((174-18*8)/2),#40+1,#0,<" window ? ">
WRITE #0+((174-18*8)/2),#20,#1,<"Do you really want">
WRITE #0+((174-18*8)/2),#30,#1,<"to close the">
WRITE #0+((174-18*8)/2),#40,#1,<" window ? ">
lea.l GadgetKILL1,a0
move.l Window2,a1
sub.l a2,a2
CALLINT RefreshGadgets
move.l Window2,a0
move.l wd_UserPort(a0),a0
move.l a0,a5
CALLEXEC WaitPort
move.l a5,a0
CALLEXEC GetMsg ; get message
move.l d0,a1
move.l im_IAddress(a1),a4
CALLEXEC ReplyMsg ; reply message
tst.w gg_GadgetID(a4)
beq KILL_IT
move.l Window2,a0
CALLINT CloseWindow
bra wait
KILL_IT move.l Window2,a0
CALLINT CloseWindow
move.l FENSTER,a0
CALLINT CloseWindow
bra GetWindows
Windowpointer set Window1
AUTOGADGET2 macro
* \1,\2 x,y
* \3,\4 size
* \5,\6 colors (text & Box)
* \7 Text
* \8 ID
* \9 NextGadget
dc.l \9
dc.w \1,\2,\3,\4
dc.w GADGHCOMP!SELECTED,RELVERIFY!TOGGLESELECT,BOOLGADGET
dc.l AG2adget\@_Box
dc.l 0,AG2adget\@_Text,0,0
dc.w \8,0,0
AG2adget\@_Box BOX -1,-1,\3,\4,\5,0
even
AG2_T_String\@ dc.b \7,0
AG2_T_String\@_End
even
AG2adget\@_Text dc.b 2,0,RP_JAM1,0
dc.w (\3-(AG2_T_String\@_End-AG2_T_String\@-1)*8)/2+1,((\4-8)/2)+1
dc.l TOPAZ_80,AG2_T_String\@,AG2_Text2_\@
AG2_Text2_\@ dc.b \6,0,RP_JAM1,0
dc.w (\3-(AG2_T_String\@_End-AG2_T_String\@-1)*8)/2),(\4-8)/2
dc.l TOPAZ_80,AG2_T_String\@,0
IFEQ FontFlag
TOPAZ_80 dc.l T_80name
dc.w TOPAZ_EIGHTY
dc.b FS_NORMAL,FPF_ROMFONT
even
T_80name dc.b "topaz.font",0
FontFlag set 1
endc
endm
Windowdef6 dc.w 460-300-10,0,300,199
dc.b -1,-1
dc.l GADGETUP
dc.l WINDOWDRAG!ACTIVATE!SMART_REFRESH
dc.l GadgetIDCMP
dc.l 0
dc.l W6_Title
dc.l 0,0
dc.w 0,0,0,0,CUSTOMSCREEN
W6_Title dc.b " » IDCMP FLAGS « ",0
even
GadgetIDCMP AUTOGADGET2 20,20,120,10,3,1,<"SIZEVERIFY">,0,GadgetIDCMP2
even
GadgetIDCMP2 AUTOGADGET2 20,35,120,10,3,1,<"NEWSIZE">,1,GadgetIDCMP3
even
GadgetIDCMP3 AUTOGADGET2 20,50,120,10,3,1,<"REFRESHWINDOW">,2,GadgetIDCMP4
even
GadgetIDCMP4 AUTOGADGET2 20,65,120,10,3,1,<"MOUSEBUTTONS">,3,GadgetIDCMP5
even
GadgetIDCMP5 AUTOGADGET2 20,80,120,10,3,1,<"MOUSEMOVE">,4,GadgetIDCMP6
even
GadgetIDCMP6 AUTOGADGET2 20,95,120,10,3,1,<"GADGETDOWN">,5,GadgetIDCMP7
even
GadgetIDCMP7 AUTOGADGET2 20,110,120,10,3,1,<"GADGETUP">,6,GadgetIDCMP8
even
GadgetIDCMP8 AUTOGADGET2 20,125,120,10,3,1,<"REQSET">,7,GadgetIDCMP9
even
GadgetIDCMP9 AUTOGADGET2 20,140,120,10,3,1,<"MENUPICK">,8,GadgetIDCMP10
even
GadgetIDCMP10 AUTOGADGET2 20,155,120,10,3,1,<"CLOSEWINDOW">,9,GadgetIDCMP11
even
GadgetIDCMP11 AUTOGADGET2 20,170,120,10,3,1,<"RAWKEY">,10,GadgetIDCMP12
even
GadgetIDCMP12 AUTOGADGET2 20,185,120,10,3,1,<"REQVERIFY">,11,GadgetIDCMP13
even
GadgetIDCMP13 AUTOGADGET2 160,20,120,10,3,1,<"REQCLEAR">,12,GadgetIDCMP14
even
GadgetIDCMP14 AUTOGADGET2 160,35,120,10,3,1,<"MENUVERIFY">,13,GadgetIDCMP15
even
GadgetIDCMP15 AUTOGADGET2 160,50,120,10,3,1,<"NEWPREFS">,14,GadgetIDCMP16
even
GadgetIDCMP16 AUTOGADGET2 160,65,120,10,3,1,<"DISKINSERTED">,15,GadgetIDCMP17
even
GadgetIDCMP17 AUTOGADGET2 160,80,120,10,3,1,<"DISKREMOVED">,16,GadgetIDCMP18
even
GadgetIDCMP18 AUTOGADGET2 160,95,120,10,3,1,<"WBENCHMESSAGE">,17,GadgetIDCMP19
even
GadgetIDCMP19 AUTOGADGET2 160,110,120,10,3,1,<"ACTIVEWINDOW">,18,GadgetIDCMP20
even
GadgetIDCMP20 AUTOGADGET2 160,125,120,10,3,1,<"INACTIVEWINDOW">,19,GadgetIDCMP21
even
GadgetIDCMP21 AUTOGADGET2 160,140,120,10,3,1,<"DELTAMOVE">,20,GadgetIDCMP22
even
GadgetIDCMP22 AUTOGADGET2 160,155,120,10,3,1,<"VANILLAKEY">,21,GadgetIDCMP23
even
GadgetIDCMP23 AUTOGADGET2 160,170,120,10,3,1,<"INTUITICKS">,22,GadgetIDCMP_CA
even
GadgetIDCMP_CA AUTOGADGET 160,185,60,10,1,3,<"Cancel">,100,GadgetIDCMP_OK
even
GadgetIDCMP_OK AUTOGADGET 240,185,40,10,1,3,<"OK">,101,0
even
IDCMP tst.l FENSTER
beq Error
move.l FENSTER,a0
move.l wd_IDCMPFlags(a0),.IDCMPFlags
move.l wd_IDCMPFlags(a0),d1
moveq.l #0,d0 ; if bit is 1, set gadget selected
lea.l .GadgetList,a0
.Label1 move.l (a0)+,a1
btst d0,d1
bne .Label2
and.w #$ffff-SELECTED,gg_Flags(a1)
bra .Label3
.Label2 or.w #SELECTED,gg_Flags(a1)
.Label3 addq #1,d0
cmp.b #23,d0
bne .Label1
lea.l Windowdef6,a0
move.l ScreenPtr1,nw_Screen(a0)
CALLINT OpenWindow
tst.l d0
beq wait
move.l d0,Window2
WindowPointer set Window2
SETAPEN #2
RECTFILL #2,#10,#297,#197
lea.l GadgetIDCMP,a0
move.l Window2,a1
sub.l a2,a2
CALLINT RefreshGadgets
.wait move.l Window2,a0
move.l wd_UserPort(a0),a0
move.l a0,a5
CALLEXEC WaitPort
move.l a5,a0
CALLEXEC GetMsg ; get message
move.l d0,a1
move.l im_IAddress(a1),a4
CALLEXEC ReplyMsg ; reply message
moveq.l #0,d0
move.w gg_GadgetID(a4),d0
cmp.w #100,d0
beq .Quit
cmp.w #101,d0
beq .Change
move.l .IDCMPFlags,d1
bchg d0,d1
move.l d1,.IDCMPFlags
bra .wait
.Change move.l FENSTER,a0
move.l .IDCMPFlags,d0
CALLINT ModifyIDCMP
.Quit move.l Window2,a0
CALLINT CloseWindow
bra wait
.GadgetList dc.l GadgetIDCMP
dc.l GadgetIDCMP2
dc.l GadgetIDCMP3
dc.l GadgetIDCMP4
dc.l GadgetIDCMP5
dc.l GadgetIDCMP6
dc.l GadgetIDCMP7
dc.l GadgetIDCMP8
dc.l GadgetIDCMP9
dc.l GadgetIDCMP10
dc.l GadgetIDCMP11
dc.l GadgetIDCMP12
dc.l GadgetIDCMP13
dc.l GadgetIDCMP14
dc.l GadgetIDCMP15
dc.l GadgetIDCMP16
dc.l GadgetIDCMP17
dc.l GadgetIDCMP18
dc.l GadgetIDCMP19
dc.l GadgetIDCMP20
dc.l GadgetIDCMP21
dc.l GadgetIDCMP22
dc.l GadgetIDCMP23
.IDCMPFlags dc.l 0
Windowdef9 dc.w 275,30,174,100
dc.b -1,-1
dc.l GADGETUP
dc.l WINDOWDRAG!ACTIVATE!SMART_REFRESH
dc.l GadgetKILL1
dc.l 0
dc.l W9_Title
dc.l 0,0
dc.w 0,0,0,0,CUSTOMSCREEN
W9_Title dc.b " » KILL SCREEN « ",0
ALL lea.l Windowdef9,a0
move.l ScreenPtr1,nw_Screen(a0)
CALLINT OpenWindow
tst.l d0
beq KILL_ALL
move.l d0,Window2
WindowPointer set Window2
SETAPEN #2
RECTFILL #2,#10,#171,#98
SETDRMD #RP_JAM1
WRITE #1+((174-18*8)/2),#20+1,#0,<"Do you really want">
WRITE #1+((174-18*8)/2),#30+1,#0,<"to close the">
WRITE #1+((174-18*8)/2),#40+1,#0,<" screen ? ">
WRITE #0+((174-18*8)/2),#20,#1,<"Do you really want">
WRITE #0+((174-18*8)/2),#30,#1,<"to close the">
WRITE #0+((174-18*8)/2),#40,#1,<" screen ? ">
lea.l GadgetKILL1,a0
move.l Window2,a1
sub.l a2,a2
CALLINT RefreshGadgets
move.l Window2,a0
move.l wd_UserPort(a0),a0
move.l a0,a5
CALLEXEC WaitPort
move.l a5,a0
CALLEXEC GetMsg ; get message
move.l d0,a1
move.l im_IAddress(a1),a4
CALLEXEC ReplyMsg ; reply message
tst.w gg_GadgetID(a4)
beq KILL_ALL
move.l Window2,a0
CALLINT CloseWindow
bra wait
KILL_ALL
move.l BILDSCHIRM,a5
.Label1 move.l sc_FirstWindow(a5),a0 ; close window (if there are any windows left )
cmp.l #0,a0
beq .Label2
CALLINT CloseWindow
bra .Label1
.Label2 move.l BILDSCHIRM,a0
CALLINT CloseScreen
move.l Window2,a0
CALLINT CloseWindow
jmp ChangeScreen
QUIT2 move.l ScreenPtr1,a0
CALLINT CloseScreen
ende move.l #RECOVERY_ALERT,d0 ; error message
move.l #30,d1
lea.l ErrorText,a0
CALLINT DisplayAlert
moveq.l #0,d0
rts
ErrorText dc.w 60
dc.b 17
dc.b "FENSTER : ERROR !?! I cannot open the screen / window !"
dc.b 0,0
Windowdef dc.w 20,20,160,10
dc.b -1,-1
dc.l MENUPICK!CLOSEWINDOW
dc.l WINDOWDRAG!WINDOWCLOSE!ACTIVATE!SMART_REFRESH!WINDOWDEPTH
dc.l 0
dc.l 0
dc.l W_Title
dc.l 0,0
dc.w 0,0,0,0,WBENCHSCREEN
W_Title dc.b "Fenster ",0
even
WindowPtr dc.l 0
Init lea.l Windowdef,a0 ; create window on WB
CALLINT OpenWindow
tst.l d0
beq ende
move.l d0,WindowPtr
.wait move.l WindowPtr,a0 ; wait .....
move.l wd_UserPort(a0),a0
move.l a0,a5
CALLEXEC WaitPort
move.l a5,a0
CALLEXEC GetMsg ; get message
move.l d0,a1
move.l im_Class(a1),d4 ; get data
CALLEXEC ReplyMsg ; reply message
cmp.l #MENUPICK,d4 ; right mouse button pressed ?
beq .FENSTER
move.l WindowPtr,a0
CALLINT CloseWindow
rts
.FENSTER jsr Start ; open FENSTER
bra .wait