home *** CD-ROM | disk | FTP | other *** search
- ;
- ; WaitAccess V1.00 Friday, 18-Feb-1994
- ;
- ; by Jan Hagqvist
- ;
-
- ; V0.01 Friday 18-Feb-1994
-
-
- XREF _LVOOpenLibrary
- XREF _LVOCloseLibrary
- XREF _LVOOpenWindow
- XREF _LVOCloseWindow
- XREF _LVOWaitPort
- XREF _LVOGetMsg
- XREF _LVOReplyMsg
- XREF _LVOVPrintf
- XREF _LVOOpen
- XREF _LVOClose
- XREF _LVOMove
- XREF _LVOText
- XREF _LVODelay
-
-
- JAM1 equ 0
- WBENCHSCREEN equ 1
- IDCMP_CLOSEWINDOW equ $00000200
- WFLG_SMART_REFRESH equ $00000000
- WFLG_DRAGBAR equ $00000002
- WFLG_DEPTHGADGET equ $00000004
- WFLG_CLOSEGADGET equ $00000008
-
-
-
- WaitAccess
- move.l a0,FileName
- add.l d0,a0
- clr.b -1(a0)
-
- move.l 4,a6
- moveq.l #36,d0
- lea IntuitionName(pc),a1
- jsr _LVOOpenLibrary(a6)
- move.l d0,IntuitionBase
- tst.l d0
- beq Quit
- moveq.l #0,d0
- lea GfxName(pc),a1
- jsr _LVOOpenLibrary(a6)
- move.l d0,GfxBase
- tst.l d0
- beq Quit
- moveq.l #0,d0
- lea DosName(pc),a1
- jsr _LVOOpenLibrary(a6)
- move.l d0,DosBase
- tst.l d0
- beq Quit
-
- move.l FileName(pc),a0
- tst.b (a0)
- beq NoFileName
-
- move.l IntuitionBase(pc),a6
- lea NewWindow(pc),a0
- jsr _LVOOpenWindow(a6)
- tst.l d0
- beq NoWindow
- move.l d0,MyWindow
- move.l d0,a0
- move.l 50(a0),MyRastPort
- move.l 86(a0),MyUserPort
-
- move.l GfxBase(pc),a6
- move.l MyRastPort(pc),a1
- moveq.l #10,d0
- moveq.l #18,d1
- jsr _LVOMove(a6)
- move.l MyRastPort(pc),a1
- move.l FileName(pc),a0
- bsr StrLen
- jsr _LVOText(a6)
-
- clr.b QuitFlag
- WaitForMessage1
- tst.b QuitFlag
- bne Quit
-
- move.l DosBase(pc),a6
- moveq.l #5,d1
- jsr _LVODelay(a6)
- bsr AccessFile
-
- WaitForMessage2
- move.l 4,a6
- move.l MyUserPort(pc),a0
- jsr _LVOGetMsg(a6)
- tst.l d0
- beq.s WaitForMessage1
- move.l d0,a1
- move.l 20(a1),Class
- jsr _LVOReplyMsg(a6)
- WaitForMessage3
- cmp.l #IDCMP_CLOSEWINDOW,Class
- bne.s WaitForMessage4
- bsr SetQuitFlag
- WaitForMessage4
- WaitForMessage500
- bra WaitForMessage2
-
-
-
- Quit
- move.l IntuitionBase(pc),a6
- tst.l MyWindow
- beq.s Quit7
- move.l MyWindow(pc),a0
- jsr _LVOCloseWindow(a6)
- Quit7
- move.l 4,a6
- tst.l DosBase
- beq.s Quit3
- move.l DosBase(pc),a1
- jsr _LVOCloseLibrary(a6)
- Quit3
- tst.l GfxBase
- beq.s Quit2
- move.l GfxBase(pc),a1
- jsr _LVOCloseLibrary(a6)
- Quit2
- tst.l IntuitionBase
- beq.s Quit1
- move.l IntuitionBase(pc),a1
- jsr _LVOCloseLibrary(a6)
- Quit1
- moveq.l #0,d0
- rts ; Exit to CLI
-
-
-
- SetQuitFlag
- move.b #1,QuitFlag
- rts
-
-
-
- NoWindow
- move.l #NoWindowMessage,d1
- bsr.s ShowMessage
- bra Quit
-
- NoFileName
- move.l #NoFileNameMessage,d1
- bsr.s ShowMessage
- bra Quit
-
- ShowMessage
- move.l DosBase(pc),a6
- move.l #MessageFormat,d2
- jsr _LVOVPrintf(a6)
- rts
-
-
-
- StrLen
- moveq.l #0,d0
- move.l a0,a2
- StrLen2
- tst.b (a2)+
- beq.s StrLen3
- addq.l #1,d0
- bra.s StrLen2
- StrLen3
- rts
-
-
-
- AccessFile
- move.l FileName(pc),d1
- move.w #1005,d2
- jsr _LVOOpen(a6)
- tst.l d0
- bne.s AccessFile2
- rts
- AccessFile2
- move.l d0,d1
- jsr _LVOClose(a6)
- bsr SetQuitFlag
- rts
-
-
-
- NewWindow
- dc.w 20,70,600,23
- dc.b 0,1
- dc.l IDCMP_CLOSEWINDOW
- dc.l WFLG_DRAGBAR!WFLG_CLOSEGADGET!WFLG_DEPTHGADGET!WFLG_SMART_REFRESH
- dc.l 0,0,WindowTitle,0,0
- dc.w 600,23,-1,-1,WBENCHSCREEN
-
-
- IntuitionBase dc.l 0
- GfxBase dc.l 0
- DosBase dc.l 0
- MyUserPort dc.l 0
- MyRastPort dc.l 0
- MyWindow dc.l 0
- FileName dc.l 0
-
- Class dc.l 0
-
- QuitFlag dc.b 0
-
- IntuitionName dc.b 'intuition.library',0
- GfxName dc.b 'graphics.library',0
- DosName dc.b 'dos.library',0
-
- VersionString dc.b '$VER: WaitAccess V1.00 (18.2.94) by Jan Hagqvist',10,0
- MessageFormat dc.b '%s',0
- NoWindowMessage dc.b 'Can''t open window',10,0
- NoFileNameMessage dc.b 'No file name given',10,0
- WindowTitle dc.b 'WaitAccess V1.00',0
-
- END
-