home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 August - Disc 3
/
chip_20018103_hu.iso
/
amiga
/
chiputil
/
dragndrop14b.lha
/
Dragndrop_demo.lha
/
DragnDrop
/
TestDragnDrop.s
< prev
Wrap
Text File
|
1999-03-30
|
38KB
|
1,345 lines
IFND Konstanten_Flag
Konstanten_Flag=1
Endif
Mode_New=1006
Mode_Old=1005
Offset_Begin=-1
Offset_End=1
Offset_Current=0
Access_Read=-2
Access_Write=-1
DosTrue=-1
DosFalse=0
True=Dostrue
False=DosFalse
Null=0
IncDir "Sys:Coder/"
Include "Preass/Konstanten.inc"
Include "Preass/ASL_lib.inc"
Include "Preass/intuition.inc"
Include "Include/Guienv.i"
Include "Include/Libraries/gadtools.i"
Main:
Include "preass/Startup.i"
Jsr Openlibs
Tst.l D0
Beq Mainende
Jsr START
Mainende:
jsr Closelibs
Move.l Error,d0
tst.l d0
beq .l1
jmp ErrorHandling
.l1: Rts
Mode_NoCase= 100
Mode_Case= 0
FileReq:
Move.l A0,LokalScreen
Move.l AslBase,a6
Move.l #ASL_FileRequest,d0
Move.l #0,a0
Jsr AllocAslRequest(a6)
Move.l D0,Requester
Tst.l Requester
Beq .Select2
move.l #ASLFR_Taglist,a0
move.l LokalScreen,4(a0)
Move.l Requester,a0
Move.l #ASLFR_Taglist,a1
Jsr ASLRequest(a6)
Move.l D0,Result
Tst.l Result
Beq .Select2
Clr.l D0
Move.l Requester,A0
Move.l 4(A0),D0
Move.l D0,Filename_Zeiger
Clr.l D0
Move.l Requester,A0
Move.l 8(A0),D0
Move.l D0,Dirname_zeiger
Move.l ExecBase,a6
Move.l Dirname_zeiger,a0
Move.l #Dirname,a1
Move.l #100,d0
Jsr Copymem(a6)
Move.l Filename_zeiger,a0
Move.l #Name,a1
Move.l #100,d0
Jsr Copymem(a6)
Lea Name_Bak,a0
move.l Dirname_zeiger,a1
.Sel1: move.b (a1)+,(a0)+
cmpi.b #0,(a1)
bne .sel1
cmpi.b #":",-1(a0)
beq .sel12
move.b #"/",(a0)+
.sel12: move.l Filename_zeiger,a1
.Sel2: move.b (a1)+,(a0)+
cmpi.b #0,(a1)
bne .sel2
move.b #0,(a0)+
.Select2:
Tst.l Requester
Beq .lab1
Move.l AslBase,a6
Move.l Requester,a0
Jsr FreeASLRequest(a6)
.lab1: RTS
FillBuffer:
subq.l #1,d1
.l1:move.b d0,(a0)+
dbra d1,.l1
RTS
ConvertZahl:
Move.l #" ",Zusatz
Move.l #" 0",Zahl
ConvertZahl1:
Movem.l a0-a5,-(sp)
Lea Zusatz,a0
Cmpi.l #0,d7
bpl .l0
Neg.l d7
move.b #"-",zahl
Cmpi.l #9999,d7
bgt .l0
move.b #"-",zusatz
.l0:Move.l d7,d0
MoveQ.l #-1,d1
.l1:AddQ.l #1,d1
Subi.l #10000000,d0
Bpl .l1
Addi.l #10000000,d0
addi.l #$30,d1
cmpi.b #"0",d1
Beq .l11
move.b d1,0(a0)
.l11:MoveQ.l #-1,d1
.l2:AddQ.l #1,d1
Subi.l #1000000,d0
Bpl .l2
Addi.l #1000000,d0
addi.l #$30,d1
cmpi.b #" ",0(a0)
bne .l22
cmpi.b #"0",d1
Beq .l21
.l22:
move.b d1,1(a0)
.l21:MoveQ.l #-1,d1
.l3:AddQ.l #1,d1
Subi.l #100000,d0
Bpl .l3
Addi.l #100000,d0
addi.l #$30,d1
cmpi.b #" ",1(a0)
bne .l32
cmpi.b #"0",d1
Beq .l31
.l32:
move.b d1,2(a0)
.l31:MoveQ.l #-1,d1
.l4:AddQ.l #1,d1
Subi.l #10000,d0
Bpl .l4
Addi.l #10000,d0
addi.l #$30,d1
cmpi.b #" ",2(a0)
bne .l42
cmpi.b #"0",d1
Beq .l41
.l42:
move.b d1,3(a0)
.l41:MoveQ.l #-1,d1
.l5:AddQ.l #1,d1
Subi.l #1000,d0
Bpl .l5
Addi.l #1000,d0
addi.l #$30,d1
cmpi.b #" ",3(a0)
bne .l52
cmpi.b #"0",d1
Beq .l51
.l52:
move.b d1,4(a0)
.l51:MoveQ.l #-1,d1
.l6:AddQ.l #1,d1
Subi.l #100,d0
Bpl .l6
Addi.l #100,d0
addi.l #$30,d1
cmpi.b #" ",4(a0)
bne .l62
cmpi.b #"0",d1
Beq .l61
.l62:
move.b d1,5(a0)
.l61:MoveQ.l #-1,d1
.l7:AddQ.l #1,d1
Subi.l #10,d0
Bpl .l7
Addi.l #10,d0
addi.l #$30,d1
cmpi.b #" ",5(a0)
bne .l72
cmpi.b #"0",d1
Beq .l71
.l72:
move.b d1,6(a0)
.l71:
addi.l #$30,d0
move.b d0,7(a0)
Movem.l (sp)+,a0-a5
Tst.l D6
Beq .ende
Move.l DOSBase,a6
Move.l D6,d1
Move.l #Zusatz,d2
Move.l #8,d3
Jsr Write(a6)
.ende:RTS
CompareString:
movem.l d0-d7/a0-a6,-(sp)
movem.l d0-d1/a0-a1,-(sp)
Jsr CountString
Move.l D0,Stringlaenge
movem.l (sp)+,d0-d1/a0-a1
movem.l d0-d1/a0-a1,-(sp)
Move.l a1,A0
Jsr CountString
Cmp.l Stringlaenge,D0
Beq .l0
movem.l (sp)+,d0-d1/a0-a1
bra .fehler
.l0:movem.l (sp)+,d0-d1/a0-a1
cmpi.l #Mode_Nocase,d1
beq .nocase
move.l Stringlaenge,d1
subq.l #1,d1
addi.l d0,a1
.l1:move.b (a0)+,d0
cmp.b (a1)+,d0
bne .fehler
dbra d1,.l1
movem.l (a7)+,d0-d7/a0-a6
moveq.l #-1,d0
RTS
.NoCase:
move.l Stringlaenge,d1
subq.l #1,d1
addi.l d0,a1
.l2:move.b (a0)+,d0
move.b (a1)+,d2
bclr #5,d0
bclr #5,d2
cmp.b d2,d0
bne .fehler
dbra d1,.l2
movem.l (a7)+,d0-d7/a0-a6
moveq.l #-1,d0
RTS
.Fehler:
movem.l (a7)+,d0-d7/a0-a6
moveq.l #0,d0
RTS
CountString:
move.l a1,-(Sp)
move.l a0,a1
.l1: cmpi.b #$00,(a1)+
bne .l1
lea -1(a1),a1
sub.l a0,a1
move.l a1,d0
move.l (sp)+,a1
RTS
CountEOL:
move.l a1,-(Sp)
move.l a0,a1
.l1: cmpi.b #$0a,(a1)
beq .l2
cmpi.b #$00,(a1)+
bne .l1
lea -1(a1),a1
.l2: sub.l a0,a1
move.l a1,d0
addq.l #1,d0
cmpi.b #$00,(a0)
beq .null
move.l (sp)+,a1
RTS
.null: clr.l d0
move.l (sp)+,a1
RTS
CD:
Move.l DOSBase,a6
Move.l a0,d1
Move.l #Access_read,d2
Jsr Lock(a6)
Tst.l d0
Beq .ende
Move.l d0,d1
Jsr Currentdir(a6)
Move.l d0,d1
Jsr Unlock(a6)
moveq.l #-1,d0
.ende: RTS
GetFilename:
cmpi.l #0,laenge
beq .l13
cmpi.l #1,laenge
beq .l13
Move.l Adresse,a0
.l1: cmpi.b #`"`,(a0)
beq .l10
cmpi.b #` `,(a0)+
beq .l1
lea -1(a0),a1
.l2: cmpi.b #`"`,(a0)
beq .l11
cmpi.b #$0a,(a0)
beq .l12
cmpi.b #$00,(a0)
beq .l12
cmpi.b #` `,(a0)+
bne .l2
Lea -1(a0),a2
.l3: suba.l a1,a2
move.l A0,NextArg
Move.l ExecBase,a6
Move.l a1,a0
Move.l #Filename,a1
Move.l a2,d0
Jsr Copymem(a6)
Move.l a2,d0
rts
.l10: lea 1(a0),a1
bra .l2
.l11: lea 1(a0),a1
bra .l3
.l12: move.l a0,a2
bra .l3
.l13: moveq.l #0,d0
RTS
Normal= 0
Kein_CLS= 1
Keine_CMAP= 2
Play_Anim= 3
CNOP 0,4
BMHD:
Breite: dc.w 0
Hoehe: dc.w 0
Posx: dc.w 0
Posy: dc.w 0
Tiefe: dc.b 0
Maske: dc.b 0
Packart:dc.b 0,0
Trans: dc.w 0
dc.b 0,0
PageX: dc.w 0
PageY: dc.w 0
Bitmap:
BPR: dc.w 0
Rows: dc.w 0
dc.b 0
Tiefe1: dc.b 0
dc.w 0
plane1: dc.l 0
plane2: dc.l 0
plane3: dc.l 0
plane4: dc.l 0
plane5: dc.l 0
plane6: dc.l 0
plane7: dc.l 0
plane8: dc.l 0
Cnop 0,4
DisplayIFF:
Moveq.l #$0,D0
Move.l D0,SBlock
Moveq.l #$0,D0
Move.l D0,DBlock
Move.l DOSBase,a6
Move.l a0,d1
Move.l #Mode_old,d2
Jsr Open(a6)
Move.l D0,FH
Tst.l FH
Beq .Error
Move.l Lokalmode,d0
Cmp.l #Normal,D0
Beq .pre0000
Bra .pre0001
.pre0000:
Move.l GraphicsBase,a6
Move.l Viewport,a0
Move.l #0,d0
Move.l #0,d1
Move.l #0,d2
Move.l #0,d3
Jsr SetRGB32(a6)
Move.l LRp,a1
Move.l #0,d0
Jsr SetAPen(a6)
Move.l LRp,a1
Move.l #0,d0
Move.l #0,d1
Move.l #639,d2
Move.l #279,d3
Jsr RectFill(a6)
.Pre0001:
Move.l DOSBase,a6
Move.l FH,d1
Move.l #Buffer,d2
Move.l #4,d3
Jsr Read(a6)
Move.l Buffer,d0
Cmp.l #"FORM",D0
Bne .ErrorClose1
Move.l FH,d1
Move.l #Buffer,d2
Move.l #4,d3
Jsr Read(a6)
Move.l FH,d1
Move.l #Buffer,d2
Move.l #4,d3
Jsr Read(a6)
Move.l Buffer,d0
Cmp.l #"ILBM",D0
Bne .ErrorClose1
Move.l FH,d1
Move.l #Buffer,d2
Move.l #4,d3
Jsr Read(a6)
Move.l Buffer,d0
Cmp.l #"BMHD",D0
Bne .ErrorClose1
Move.l FH,d1
Move.l #anzahl,d2
Move.l #4,d3
Jsr Read(a6)
Move.l FH,d1
Move.l #BMHD,d2
Move.l anzahl,d3
Jsr Read(a6)
Clr.l d0
Move.l Lokalmode,d0
Cmp.l #PLAY_Anim,D0
Beq .pre0005
Bra .pre0006
.pre0005:
Move.l #44,PosLeft
Move.l #0,PosTop
.Pre0006:
Move.w Breite,d0
Move.l d0,BildBreite
Move.w Hoehe,d0
Move.l d0,Bildhoehe
Move.l BildHoehe,d0
Cmp.l MaxHoehe,D0
Blt .Schleife
Move.l MaxHoehe,BildHoehe
.Schleife:
Move.l DOSBase,a6
Move.l FH,d1
Move.l #Buffer,d2
Move.l #4,d3
Jsr Read(a6)
Move.l D0,Anzahl
Move.l Anzahl,d0
Cmp.l #4,D0
Bne .ende
Move.l FH,d1
Move.l #anzahl,d2
Move.l #4,d3
Jsr Read(a6)
Move.l Buffer,d0
Cmp.l #"CMAP",D0
Beq .pre0010
Bra .pre0011
.pre0010:
Move.l FH,d1
Move.l #Buffer,d2
Move.l anzahl,d3
Jsr Read(a6)
Move.l LokalMode,d0
Cmp.l #Keine_CMAP,D0
Beq .Schleife
move.l Anzahl,d7
divu.l #3,d7
subq.l #1,d7
Lea Buffer,a4
Moveq.l #-1,d4
.CMAP1: Clr.l d1
Clr.l d2
Clr.l d3
addq.l #1,d4
move.b (a4)+,d1
move.b (a4)+,d2
move.b (a4)+,d3
ROR.l #8,d1
ROR.l #8,d2
ROR.l #8,d3
Move.l GraphicsBase,a6
Move.l Viewport,a0
Move.l D4,d0
Move.l D1,d1
Move.l D2,d2
Jsr SetRGB32(a6)
Move.l D4,d0
Cmp.l #255,D0
Bne .Cmap1
bra .Schleife
.Pre0011:
Move.l Buffer,d0
Cmp.l #"BODY",D0
Beq .pre0015
Bra .pre0016
.pre0015:
Move.l ExecBase,a6
Move.l Anzahl,d0
Move.l #MEMF_any,d1
Jsr Allocmem(a6)
Move.l D0,SBlock
Tst.l SBlock
Beq .errorclose1
Move.l DOSBase,a6
Move.l FH,d1
Move.l Sblock,d2
Move.l anzahl,d3
Jsr Read(a6)
clr.l d0
clr.l d1
move.W Breite,d0
divu.w #8,d0
swap d0
cmpi.w #0,d0
beq.s .body1
addi.l #$00010000,d0
.body1:
swap.w d0
andi.l #$FFFF,d0
move.l d0,BytesperRow
move.w hoehe,d1
mulu.l d1,d0
clr.w d1
move.b Tiefe,d1
mulu.l d1,d0
move.l d0,BM_laenge
Move.l ExecBase,a6
Move.l BM_Laenge,d0
Move.l #MEMF_ANY,d1
Jsr AllocMem(a6)
Move.l D0,DBlock
Tst.l Dblock
Beq .Errorclose2
move.l sblock,a0
move.l dblock,a1
move.l a1,a2
add.l BM_laenge,a2
.Body2: clr.w d0
cmp.l a1,a2
ble.s .Bodyende
move.b (a0)+,d0
tst.b d0
bpl.s .plus ; nicht gleiche
neg.b d0
move.b (a0)+,d1
.Body3: move.b d1,(a1)+
dbra d0,.Body3
bra.s .body2
.plus: move.b (a0)+,(a1)+
dbra d0,.plus
bra.s .body2
.Bodyende:
Move.l ExecBase,a6
Move.l SBlock,a1
Move.l Anzahl,d0
Jsr Freemem(a6)
Move.l DBlock,SBlock ; Tausche Source<->Ziel
Move.l BM_Laenge,d0
Move.l #MEMF_Chip,d1
Jsr AllocMem(a6)
Move.l D0,DBlock
Tst.l Dblock
Beq .Errorclose3
clr.l d1
move.l Bytesperrow,d7
Move.l d7,d0
move.w Hoehe,d1
mulu.l d0,d1
move.l d1,BitPlaneGroesse
move.l d7,d1
; Lsr.l #2,d7
subq.l #1,d7
move.l d7,d6
clr.l d0
move.b tiefe,D0
move.l d0,Planes
subq.l #1,d0
mulu.l d1,d0
move.l d0,skip
Move.l #1,I
Move.l Planes,I_bis
Move.l #1,I_Step
.I_Label:
Move.l Sblock,a0
Move.l I,d0
Subq.l #1,d0
move.l BytesPerRow,d1
mulu.l d1,d0
add.l d0,a0
Move.l Dblock,a1
Move.l I,d0
Subq.l #1,d0
move.l BitPlanegroesse,d1
mulu.l d1,d0
add.l d0,a1
move.w hoehe,d5
subq.l #1,d5
.body5: Move.b (a0)+,(a1)+
dbra d6,.Body5
add.l Skip,a0
move.l d7,d6
dbra d5,.Body5
Move.l I,D0
Add.l I_Step,D0
Move.l D0,I
Cmp.l I_Bis,D0
Ble .I_Label
Move.l sblock,a1
Move.l BM_Laenge,d0
Jsr Freemem(a6)
Move.l LokalMode,d0
Cmp.l #PLAY_Anim,D0
Bne .pre0017
Bra .pre0018
.pre0017:
Move.l DOSBase,a6
Move.l FH,d1
Jsr Close(a6)
.Pre0018:
move.l BytesperRow,d0
move.w d0,BPR
move.w hoehe,Rows
move.b tiefe,tiefe1
Move.l Bitplanegroesse,d0
move.l DBlock,a0
move.l #plane1,a1
move.l a0,(a1)+
add.l d0,a0
move.l a0,(a1)+
add.l d0,a0
move.l a0,(a1)+
add.l d0,a0
move.l a0,(a1)+
add.l d0,a0
move.l a0,(a1)+
add.l d0,a0
move.l a0,(a1)+
add.l d0,a0
move.l a0,(a1)+
add.l d0,a0
move.l a0,(a1)+
Move.l GraphicsBase,a6
Move.l #Bitmap,a0
Move.l #0,d0
Move.l #0,d1
Move.l LRp,a1
Move.l PosLeft,d2
Move.l PosTop,d3
Move.l BildBreite,d4
Move.l Bildhoehe,d5
Move.l #$C0,d6
Jsr BltBitMapRastport(a6)
Move.l ExecBase,a6
Move.l Dblock,a1
Move.l BM_Laenge,d0
Jsr Freemem(a6)
Move.l LokalMode,d0
Cmp.l #Play_Anim,D0
Beq .Schleife
RTS
.Pre0016:
Move.l DOSBase,a6
Move.l FH,d1
Move.l #Buffer,d2
Move.l anzahl,d3
Jsr Read(a6)
Bra .Schleife
.Error: Move.l #0,d0
RTS
.errorClose3:
Move.l ExecBase,a6
Move.l Dblock,a1
Move.l BM_laenge,d0
Jsr FreeMem(a6)
bra.s .ErrorClose1
.errorClose2:
Move.l ExecBase,a6
Move.l Sblock,a1
Move.l Anzahl,d0
Jsr FreeMem(a6)
.ErrorClose1:
Move.l DOSBase,a6
Move.l FH,d1
Jsr Close(a6)
bra.s .error
.ende:
Move.l DOSBase,a6
Move.l FH,d1
Jsr Close(a6)
RTS
Open_Window:
Move.l GUIEnvBase,a6
Move.l #000,D0
Move.l #000,D1
Move.l #640,D2
Move.l #480,D3
Move.l Lokal1,A0
Move.l #IDCMP_MOUSEMOVE!IDCMP_MOUSEBUTTONS!IDCMP_GADGETDOWN!IDCMP_GADGETUP!IDCMP_REFRESHWINDOW!IDCMP_MENUPICK!IDCMP_VANILLAKEY!IDCMP_RAWKEY!0,D4
Move.l #WFLG_BACKDROP!WFLG_BORDERLESS!WFLG_REPORTMOUSE!0,D5
Move.l Lokal,A1
Move.l #0,A2
Jsr OpenGuiWindowA(a6)
Move.l D0,Window
Tst.l Window
Beq Open_Windowende
Move.l Window,A0
Move.l #0,A1
Jsr CreateGuiInfoA(a6)
Move.l D0,GUI
Move.l gui,A0
Move.l #001,D0
Move.l #Projektname000,A1
Move.l #0,A2
Jsr CreateGUIMenuEntryA(a6)
Move.l gui,A0
Move.l #002,D0
Move.l #Quitname001,A1
Move.l #Menu001Tags,A2
Jsr CreateGUIMenuEntryA(a6)
Open_Windowende:
Move.l Window,D0
RTS
Close_Window:
Move.l GUIEnvBase,a6
Move.l Lokal,A0
Jsr CloseGuiWindow(a6)
RTS
Open_Screen:
Move.l GUIEnvBase,a6
Move.l Screenmode,D0
Move.l #8,D1
Move.l Lokal1,A0
Move.l #ScreenTags,A1
Jsr OpenGuiScreenA(a6)
Move.l D0,Screen
.Ende:
Move.l Screen,D0
RTS
even
TopazAttr:
dc.l TopazName
dc.w 8
dc.b 0,0
Topazname:
dc.b "topaz.font",0
blk.b 29,0
Close_Screen:
Move.l GUIEnvBase,a6
Move.l Lokal,A0
Jsr CloseGuiScreen(a6)
RTS
Haupt:
Move.l GUIEnvBase,a6
Move.l Gui,A0
Jsr WaitGuiMsg(a6)
Clr.l D0
Move.l Gui,A0
Move.l 36(A0),D0
Move.l D0,MsgClass
Clr.l D0
Move.l Gui,A0
Move.w 52(A0),D0
Move.l D0,MsgGadNbr
Clr.l D0
Move.l Gui,A0
Move.w 54(A0),D0
Move.l D0,MsgMenuNum
Clr.l D0
Move.l Gui,A0
Move.w 56(A0),D0
Move.l D0,MsgItemNum
Clr.l D0
Move.l Gui,A0
Move.l 32(A0),D0
Move.l D0,Imsg
Clr.l D0
Move.l Imsg,A0
Move.w 32(A0),D0
Move.l D0,Mx
Clr.l D0
Move.l Imsg,A0
Move.w 34(A0),D0
Move.l D0,My
Move.l mx,D0
Sub.l mxa,D0
Move.l D0,dx
Move.l my,D0
Sub.l mya,D0
Move.l D0,dy
Move.l mx,D0
Move.l D0,mxa
Move.l my,D0
Move.l D0,mya
Move.l MsgClass,d0
Cmp.l #IDCMP_MOUSEMOVE,D0
Beq .pre0022
Bra .pre0023
.pre0022:
Move.l Dragstatus,d0
Cmp.l #1,D0
Beq .Delta
.Pre0023:
Move.l MsgClass,d0
Cmp.l #IDCMP_MOUSEBUTTONS,D0
Beq .Dragdrop
Move.l MsgClass,d0
Cmp.l #IDCMP_MENUPICK,D0
Bne Haupt
RTS
.DragDrop:
Move.l DragStatus,d0
Cmp.l #1,D0
Beq .Drop
.Drag:
Move.l DragnDropBase,a6
lea Polygon1,a0
Move.l mx,d0
Move.l my,d1
Jsr DND_TestPolygon(a6)
Move.l D0,TA_result
Cmp.l #0,D0
Bne .Dragfound
lea Polygon2,a0
Move.l mx,d0
Move.l my,d1
Jsr DND_TestPolygon(a6)
Move.l D0,TA_result
Cmp.l #0,D0
Bne .Dragfound
lea Polygon3,a0
Move.l mx,d0
Move.l my,d1
Jsr DND_TestPolygon(a6)
Move.l D0,TA_result
Cmp.l #0,D0
Bne .Dragfound
lea Polygon4,a0
Move.l mx,d0
Move.l my,d1
Jsr DND_TestPolygon(a6)
Move.l D0,TA_result
Cmp.l #0,D0
Bne .Dragfound
lea Polygon5,a0
Move.l mx,d0
Move.l my,d1
Jsr DND_TestPolygon(a6)
Move.l D0,TA_result
Cmp.l #0,D0
Bne .Dragfound
lea Polygon7,a0
Move.l mx,d0
Move.l my,d1
Jsr DND_TestPolygon(a6)
Move.l D0,TA_result
Cmp.l #0,D0
Bne .Dragfound
lea Polygon8,a0
Move.l mx,d0
Move.l my,d1
Jsr DND_TestPolygon(a6)
Move.l D0,TA_result
Cmp.l #0,D0
Bne .Dragfound
Bra Haupt
.dragfound:
Moveq.l #$1,D0
Move.l D0,Dragstatus
Move.l Rastport1,a0
Move.l TA_Result,a1
Move.l Screen1,a2
Jsr DND_OpenPolygon(a6)
Move.l D0,Drag
bra Haupt
.Delta:
Move.l DragnDropBase,a6
Move.l Drag,a0
Move.l dx,d0
Move.l dy,d1
Jsr DND_MoveDrag(a6)
bra Haupt
.Drop:
Moveq.l #$0,D0
Move.l D0,Dragstatus
Move.l DragnDropBase,a6
Move.l Drag,a0
Jsr DND_CloseDrag(a6)
Move.l TA_Result,a0
Jsr DND_FreeResult(a6)
Moveq.l #$0,D0
Move.l D0,Drag
lea Drops,A0
Move.l mx,d0
Move.l my,d1
Jsr DND_TestArea(a6)
Move.l D0,TA_result
Cmp.l #0,D0
Beq Haupt
Move.l Ta_result,a0
Jsr DND_FreeResult(a6)
.Dropfound:
Move.l GUIEnvBase,a6
Move.l Gui,A0
Move.l #Dropname002,A1
Move.l #GER_Okkind,D0
Move.l #0,A2
Jsr GuiRequestA(a6)
bra Haupt
Hintergrundbild:
Move.l Screen1,A0
lea 84(A0),A0
Move.l A0,ScreenRastport
Move.l Screen1,A0
lea 44(A0),A0
Move.l A0,Viewport
Move.l #480,D0
Move.l D0,Maxhoehe
Move.l LOKAL,A0
Move.l #Normal,LokalMode
Move.l Rastport1,LRp
Move.l #00,PosLeft
Move.l #0,PosTop
Jsr DisplayIff
RTS
Start:
Move.l DOSBase,a6
Jsr Input(a6)
Move.l D0,IH
Jsr Output(a6)
Move.l D0,OH
Move.l #$39024,Screenmode
Move.l #Screen1name003,Lokal1
Jsr Open_Screen
Move.l D0,Screen1
Cmp.l #0,D0
Bne .pre0027
Bra .pre0028
.pre0027:
Move.l Screen1,Lokal
Move.l #Window1name004,Lokal1
Jsr Open_Window
Move.l D0,Window1
Cmp.l #0,D0
Bne .pre0029
Bra .pre0030
.pre0029:
Move.l Gui,D0
Move.l D0,Gui1
Clr.l D0
Move.l Window1,A0
Move.l 50(A0),D0
Move.l D0,Rastport1
Move.l #dragndropname005,Lokal
Jsr HintergrundBild
; DND_Draw(Rastport1,&Drags,1)
; DND_DrawPolygon(Rastport1,&polygon,1)
Move.l GUIEnvBase,a6
Move.l Gui1,A0
Move.l #0,A1
Jsr DrawGuiA(a6)
Move.l Gui1,D0
Move.l D0,Gui
Jsr Haupt
Move.l Window1,Lokal
Jsr Close_Window
.Pre0030:
Move.l Screen1,Lokal
Jsr Close_Screen
.Pre0028:
RTS
Errorhandling:
Move.l DOSBase,a6
Jsr output(a6)
Move.l D0,Ausgabe
Move.l Error,d0
Cmp.l #1,D0
Beq .Pre0000
Bra .Pre0001
.Pre0000:
Move.l DOSBase,a6
Move.l Ausgabe,d1
Move.l #Allgemeiner_Fehlerxnname000,d2
Moveq.l #$13,d3
Jsr Write(a6)
.Pre0001:
Move.l Error,d0
Cmp.l #2,D0
Beq .Pre0002
Bra .Pre0003
.Pre0002:
Move.l DOSBase,a6
Move.l Ausgabe,d1
Move.l #Konnte_File_nicht_findenxnname001,d2
Moveq.l #$19,d3
Jsr Write(a6)
.Pre0003:
Move.l Error,d0
Cmp.l #3,D0
Beq .Pre0004
Bra .Pre0005
.Pre0004:
Move.l DOSBase,a6
Move.l Ausgabe,d1
Move.l #Window_Screen_Fehlerxnname002,d2
Moveq.l #$15,d3
Jsr Write(a6)
.Pre0005:
Move.l Error,d0
Cmp.l #4,D0
Beq .Pre0006
Bra .Pre0007
.Pre0006:
Move.l DOSBase,a6
Move.l Ausgabe,d1
Move.l #Library_nicht_gefundenxnname003,d2
Moveq.l #$17,d3
Jsr Write(a6)
.Pre0007:
Move.l Error,d0
Cmp.l #5,D0
Beq .Pre0008
Bra .Pre0009
.Pre0008:
Move.l DOSBase,a6
Move.l Ausgabe,d1
Move.l #Fehlerhafte_Eingabexnname004,d2
Moveq.l #$14,d3
Jsr Write(a6)
.Pre0009:
Move.l Error,d0
Cmp.l #6,D0
Beq .Pre0010
Bra .Pre0011
.Pre0010:
Move.l DOSBase,a6
Move.l Ausgabe,d1
Move.l #Speicherfehlerxnname005,d2
Moveq.l #$0F,d3
Jsr Write(a6)
.Pre0011:
RTS
even
Ausgabe: dc.l 0
Allgemeiner_Fehlerxnname000:
dc.b `Allgemeiner Fehler`,$a,``,0
even
Konnte_File_nicht_findenxnname001:
dc.b `Konnte File nicht finden`,$a,``,0
even
Window_Screen_Fehlerxnname002:
dc.b `Window|Screen Fehler`,$a,``,0
even
Library_nicht_gefundenxnname003:
dc.b `Library nicht gefunden`,$a,``,0
even
Fehlerhafte_Eingabexnname004:
dc.b `Fehlerhafte Eingabe`,$a,``,0
even
Speicherfehlerxnname005: dc.b `Speicherfehler`,$a,``,0
even
Even
Openlibs:
Move.l $4.w,a6
Move.l #Aslname,a1
Moveq.l #0,d0
Jsr Openlibrary(a6)
Move.l d0,Aslbase
Tst.l D0
Beq.w .ende
Move.l #DOSname,a1
Moveq.l #0,d0
Jsr Openlibrary(a6)
Move.l d0,DOSbase
Tst.l D0
Beq.w .ende
Move.l #Graphicsname,a1
Moveq.l #0,d0
Jsr Openlibrary(a6)
Move.l d0,Graphicsbase
Tst.l D0
Beq.w .ende
Move.l #GUIEnvname,a1
Moveq.l #0,d0
Jsr Openlibrary(a6)
Move.l d0,GUIEnvbase
Tst.l D0
Beq.w .ende
Move.l #DragnDropname,a1
Moveq.l #0,d0
Jsr Openlibrary(a6)
Move.l d0,DragnDropbase
Tst.l D0
Beq.w .ende
RTS
.ende: Move.l #4,Error
Rts
Closelibs:
Move.l $4.w,a6
Tst.l Aslbase
Beq.w .ende00
Move.l Aslbase,a1
Jsr Closelibrary(a6)
.ende00:Tst.l DOSbase
Beq.w .ende01
Move.l DOSbase,a1
Jsr Closelibrary(a6)
.ende01:Tst.l Graphicsbase
Beq.w .ende02
Move.l Graphicsbase,a1
Jsr Closelibrary(a6)
.ende02:Tst.l GUIEnvbase
Beq.w .ende03
Move.l GUIEnvbase,a1
Jsr Closelibrary(a6)
.ende03:Tst.l DragnDropbase
Beq.w .ende04
Move.l DragnDropbase,a1
Jsr Closelibrary(a6)
.ende04:Rts
even
WBmessage: dc.l 0
Laenge: dc.l 0
Adresse: dc.l 0
Error: dc.l 0
LokalScreen: dc.l 0
Requester: dc.l 0
Result: dc.l 0
Filename_Zeiger: dc.l 0
Dirname_zeiger: dc.l 0
Zusatz: dc.l 0
Zahl: dc.l 0
Zahlyyy: dc.l 0
Stringlaenge: dc.l 0
NextArg: dc.l 0
Lokalmode: dc.l 0
Anzahl: dc.l 0
Rot: dc.l 0
Gruen: dc.l 0
Blau: dc.l 0
BM_Laenge: dc.l 0
BytesperRow: dc.l 0
Planes: dc.l 0
BitPlanegroesse: dc.l 0
LRP: dc.l 0
BildBreite: dc.l 0
Bildhoehe: dc.l 0
Skip: dc.l 0
MaxHoehe: dc.l 0
PosLeft: dc.l 0
PosTop: dc.l 0
SBlock: dc.l 0
DBlock: dc.l 0
FH: dc.l 0
I: dc.l 0
I_bis: dc.l 0
I_step: dc.l 0
Window: dc.l 0
GUI: dc.l 0
Lokal: dc.l 0
Screenmode: dc.l 0
Lokal1: dc.l 0
Lokal2: dc.l 0
Lokal3: dc.l 0
Screen: dc.l 0
TA_Result: dc.l 0
MsgClass: dc.l 0
MsgGadNbr: dc.l 0
MsgMenuNum: dc.l 0
MsgItemNum: dc.l 0
Imsg: dc.l 0
Mx: dc.l 0
My: dc.l 0
dx: dc.l 0
dy: dc.l 0
mxa: dc.l 0
mya: dc.l 0
Dragstatus: dc.l 0
Drag: dc.l 0
ScreenRastport: dc.l 0
Viewport: dc.l 0
IH: dc.l 0
OH: dc.l 0
Screen1: dc.l 0
Window1: dc.l 0
Gui1: dc.l 0
Rastport1: dc.l 0
AslBase: dc.l 0
DOSBase: dc.l 0
NONE: dc.l 0
GraphicsBase: dc.l 0
GUIEnvBase: dc.l 0
DragnDropBase: dc.l 0
even
DirName: blk.b 256,0
even
Name: blk.b 256,0
even
Name_bak: blk.b 256,0
even
ASLTitletext: dc.b "WΣhle Filenamen ",0
even
ASLFR_Taglist:
dc.l ASLFR_screen,0
dc.l ASLFR_PrivateIDCMP,Dostrue
dc.l ASLFR_TextAttr,Dosfalse
dc.l ASLFR_InitialLeftEdge,20
dc.l ASLFR_InitialTopEdge,24
dc.l ASLFR_TitleText,ASLTitletext
dc.l ASLFR_InitialWidth,300
dc.l ASLFR_Initialheight,210
dc.l ASLFR_InitialDrawer,Dirname
dc.l ASLFR_InitialFile,Name
dc.l Tag_end,0
Filename: blk.b 256,0
even
Version: dc.b "$VER: (C) CYBORG 1998-99",0
even
Drops: dc.L 141,419,295,472,0,0,0,0,0,0,0
even
Polygon1: dc.L 22,13,141,13,82,70,81,70,22,13,0,0,0
even
Polygon2: dc.L 82,73,141,132,82,191,81,191,22,132,82,73,0,0,0
even
Polygon3: dc.L 22,254,81,195,82,195,141,254,22,254,0,0,0
even
Polygon4: dc.L 401,99,460,40,519,40,580,100,521,159,460,159,401,100,0,0,0
even
Polygon5: dc.L 28,447,138,418,138,474,28,447,0,0,0
even
Polygon7: dc.L 297,418,403,447,297,473,297,418,0,0,0
even
Polygon8: dc.L 228,134,634,374,602,475,518,459,158,226,228,134,0,0,0
even
Cnop 0,4
Buffer: blk.b 1024,0
even
Projektname000: dc.b `Projekt`,0
even
Quitname001: dc.b `Quit`,0
even
Menu001Tags:
dc.l GEM_Shortcut,MenuShorCut001MSC
dc.l Tag_Done,0
ScreenTags:
dc.l SA_Font,TopazAttr
dc.l SA_Left,0
dc.l SA_Top,0
dc.l SA_Behind,false
dc.l SA_Width,640
dc.l SA_Height,480
dc.l Tag_done,Null
Dropname002: dc.b `Drop!`,0
even
Block: blk.b 1024,0
even
Screen1name003: dc.b `Screen1`,0
even
Window1name004: dc.b `Window1`,0
even
dragndropname005: dc.b `dragndrop.iff`,0
even
Aslname: dc.b "asl.library",0
DOSname: dc.b "dos.library",0
Graphicsname: dc.b "graphics.library",0
GUIEnvname: dc.b "guienv.library",0
DragnDropname: dc.b "dragndrop.library",0
even
MenuShorCut001MSC: dc.b "q",0
Include "Preass:LVO3.0/Exec_lib.i"
Include "Preass:LVO3.0/Asl_lib.i"
Include "Preass:LVO3.0/DOS_lib.i"
Include "Preass:LVO3.0/Graphics_lib.i"
Include "Preass:LVO3.0/GUIEnv_lib.i"
Include "Preass:LVO3.0/DragnDrop_lib.i"