Slimelite BBS

Asm Screen, no window

Back to AMOS_ECHO

From Lee Kindness · 1996-04-02 04:38 · #75508 in AMOS_ECHO

 * This message forwarded from AMPROG
 * Original dated 01 Apr 96
 * From Lee Kindness, 69:106/3.46
 * To All

This little bit of asm succeeds in opening a screen, but the window wont
open... A friend asked me to take a look and i can't see why? Anyone else?


*
*  This opens the screen, but the window does not appear
*

 INCLUDE "intuition/screens.i"

ExecBase equ 4

OpenLibrary  equ  -552
CloseLibrary equ  -414
OpenScreen   equ  -$C6
CloseScreen  equ  -$42
OpenWindow   equ  -204
CloseWindow  equ  -72
Wait         equ  -318

 SECTION code,CODE

* Open Intuition.library
 movea.l #IntuitionName,a1
 move.l  #0,d0
 movea.l ExecBase,a6
 jsr     OpenLibrary(a6)
 move.l  d0,_IntuitionBase

* Opens the screen
 movea.l #MyNewScreen,a0
 movea.l _IntuitionBase,a6
 jsr     OpenScreen(a6)
 move.l  d0,MyScreen

* Opens the window
 movea.l #MyNewWindow,a0
 movea.l _IntuitionBase,a6
 jsr     OpenWindow(a6)
 move.l  d0,MyWindow

* Waits for the window to close 
 movea.l MyWindow,a0
 movea.l wd_UserPort(a0),a0
 move.b  MP_SIGBIT(a0),d1
 moveq.l #1,d0
 lsl.l   d1,d0
 movea.l ExecBase,a6
 jsr     Wait(a6)

* Closes the window 
 movea.l MyWindow,a0
 move.l  _IntuitionBase,a6
 jsr     CloseWindow(a6)

* Closes the screen
 movea.l MyScreen,a0
 move.l  _IntuitionBase,a6
 jsr     CloseScreen(a6)

* Closes Intuition.library 
 move.l  _IntuitionBase,a1
 movea.l ExecBase,a6
 jsr     CloseLibrary(a6)

 clr.l d0
 rts

 SECTION data,DATA

MyNewScreen:
 dc.w 0,0,640,256,5
 dc.b 1,2
 dc.w V_HIRES,CUSTOMSCREEN
 dc.l 0,ScreenTitle,0,0

MyNewWindow:
 dc.w 0,14,400,100
 dc.b -1,-1
 dc.l CLOSEWINDOW,WINDOWCLOSE!WINDOWDEPTH!WINDOWDRAG!WINDOWSIZING!ACTIVATE,0,0
 dc.l WindowTitle,MyScreen,0
 dc.w 80,24,-1,-1,CUSTOMSCREEN

IntuitionName:
 dc.b 'intuition.library',0

ScreenTitle:
 dc.b 'ScreenyTitle',0

WindowTitle:
 dc.b 'WindyTitle',0

 SECTION mem,BSS

_IntuitionBase:
 ds.l 1
MyScreen:
 ds.l 1
MyWindow:
 ds.l 1

 END

-- /Wangi!/
 Lee Kindness   cs2lk@scms.rgu.ac.uk wangi@frost3.demon.co.uk
 Team TRUMPET!  http://www.scms.rgu.ac.uk/students/cs_yr94/lk

--- Spot 1.3a #1473
 * Origin: Naeb eht arron ot "tap woc" dias nikpmup eht timrek (2:259/15.46)