home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / intdemo.lha / IntDemo.s < prev   
Encoding:
Text File  |  1980-01-01  |  3.5 KB  |  172 lines

  1.     section    lard,code
  2.     opt    c-
  3.     opt    d+
  4.     
  5. code:    IncDir    "DH0:Include/"
  6.     Include    Intuition/Intuition.I
  7.     Include    Intuition/Intuition_Lib.I
  8.     Include    Libraries/dos_LIb.i
  9.     Include    Libraries/Dos.i
  10.     Include    Exec/Exec_Lib.I
  11.     Include    Exec/Exec.I
  12.     Include    Exec/ExecBase.I
  13.     Include    Graphics/GfxBase.I
  14.     Include    Graphics/Graphics_Lib.I
  15.     Include    Graphics/Display.I
  16.     ;Include    Misc/EasyStart.i
  17.  
  18.     Lea    GFXName,A1
  19.     Moveq    #0,D0
  20.     CALLEXEC    OpenLibrary
  21.     Move.l     D0,_GfxBase
  22.     Beq    Error
  23.  
  24.     Lea    DosName,A1
  25.     Moveq    #0,D0
  26.     CALLEXEC    OpenLibrary
  27.     Move.l     D0,_DOSBase
  28.     Beq    Error
  29.  
  30.     Lea    IntName,A1
  31.     Moveq    #0,D0
  32.     CALLEXEC    OpenLibrary
  33.     Move.l    D0,_IntuitionBase
  34.     Beq    Error
  35.  
  36.     *-----------------------------------------------*
  37.  
  38.     Lea    MyScreen,a0
  39.     CALLINT    OpenScreen
  40.     Move.l    D0,_MyScrBase
  41.     Beq    CloseInt
  42.  
  43.     Lea    MyWindow,a0
  44.     move.l    _MyScrBase,nw_Screen(a0)
  45.     CALLINT    OpenWindow
  46.     Move.l    D0,_MyWinBase
  47.     Beq    CloseInt
  48.     Move.l    D0,A0
  49.     Move.l    wd_RPort(A0),_MyWinRPort
  50.     Move.l    wd_UserPort(a0),_MyWinUserPort
  51.  
  52.     *-----------------------------------------------*
  53.  
  54. .WaitLoop    Move.l    _MyWinUserPort,A0
  55.     CALLEXEC    WaitPort
  56.     Move.l    _MyWinUserPort,A0
  57.     CALLEXEC    GetMsg
  58.     Move.l    D0,A1
  59.     Move.l    im_Class(A1),D2    ;D2=IDCMP Flags Directly
  60.     Move.w    im_Code(A1),D3    ;D3=Data ie key why class=Rawkey
  61.     Move.w    im_Qualifier(A1),D4    ;D4=things like CTRL SHIFT
  62.     Move.w    im_MouseX(a1),D5    ;D5=MouseX Coordinate
  63.     Move.w    im_MouseY(a1),D6    ;D5=MouseY Coordinate
  64.     Move.l    im_IAddress(A1),D7    ;D7=Addres of Intuition Obj ie Gadget
  65.     Movem.l    D0-D7/A0-A6,-(A7)    
  66.     CALLEXEC    ReplyMsg
  67.     Movem.l    (a7)+,D0-D7/A0-A6
  68.  
  69.     Cmp.l    #MOUSEBUTTONS,D2
  70.     bne    .nomouse
  71.  
  72.     ;move.w    $dff006,$dff180
  73.  
  74. .nomouse    Cmp.l    #CLOSEWINDOW,D2
  75.     bne    .WaitLoop
  76.     
  77. .Exit    Move.l    _MyWinBase,A0
  78.     CALLINT    CloseWindow
  79.  
  80.     Move.l    _MyScrBase,A0
  81.     CALLINT    CloseScreen
  82.  
  83.     *-------------------------------*
  84.     
  85. CloseInt    Move.l    _IntuitionBase,A1
  86.     CALLEXEC    CloseLibrary
  87.  
  88.     Move.l    _DOSBase,A1
  89.     CALLEXEC    CloseLibrary
  90.  
  91.     Move.l    _GfxBase,A1
  92.     CALLEXEC    CloseLibrary
  93.  
  94.     *-------------------------------*
  95.  
  96. Error    Moveq    #0,D0
  97.     Rts
  98.  
  99.     *-------------------------------*
  100.  
  101. _MyScrBase        Dc.l    0
  102.  
  103. _MyWinBase        Dc.l    0
  104. _MyWinRPort        Dc.l    0
  105. _MyWinUserPort    Dc.l    0
  106. _MyWinVPort        Dc.l    0
  107.  
  108. _IntuitionBase    Dc.l    0
  109. _DOSBase        Dc.l    0
  110. _GfxBase        dc.l    0
  111.  
  112. GFXName        GRAFNAME
  113. IntName        INTNAME
  114. DosName        DOSNAME
  115.         even
  116.  
  117.     *********************************************
  118. MyWindow:    
  119.     dc.w    70,15
  120.     dc.w    200,156
  121.     dc.b    0,1
  122.     dc.l    CLOSEWINDOW+MOUSEBUTTONS
  123.     dc.l    WINDOWCLOSE+ACTIVATE+RMBTRAP+NOCAREREFRESH
  124.     dc.l    0
  125.     dc.l    0
  126.     dc.l    SymbolWindowName
  127.     dc.l    0
  128.     dc.l    0
  129.     dc.w    5,5
  130.     dc.w    -1,-1
  131.     dc.w    CUSTOMSCREEN
  132. SymbolWindowName:
  133.     dc.b    'Select Symbol',0
  134.     cnop 0,2
  135.  
  136.     *********************************************
  137.  
  138. MyScreen:    dc.w    0,0        ;screen XY origin relative to View
  139.     dc.w    320,200        ;screen width and height
  140.     dc.w    0        ;screen depth (number of bitplanes)
  141.     dc.b    0,0        ;detail and block pens
  142.     dc.w    0        ;display modes for this screen
  143.     dc.w    CUSTOMSCREEN+CUSTOMBITMAP+SCREENQUIET             
  144.                 ;screen type
  145.     dc.l    0        ;pointer to default screen font
  146.     dc.l    0        ;screen title
  147.     dc.l    0        ;first in list of custom screen gadgets
  148.     dc.l    MyBitMap        ;pointer to custom BitMap structure
  149.  
  150. MyBitMap:    dc.w    40        ;bm_BytesPerRow (.w)
  151.     dc.w    200        ;bm_Rows (.w)
  152.     dc.b    0        ;bm_Flags (.b)
  153.     dc.b    4        ;bm_Depth (.b)
  154.     dc.w    0        ;bm_Pad (.w)
  155.     dc.l    Scr+(0*40*256)    ;bm_Planes (.l) 1
  156.     dc.l    Scr+(1*40*256)    ;bm_Planes (.l) 2
  157.     dc.l    Scr+(2*40*256)    ;bm_Planes (.l) 3
  158.     dc.l    Scr+(3*40*256)    ;bm_Planes (.l) 4
  159.     dc.l    Scr+(4*40*256)    ;bm_Planes (.l) 5
  160.     dc.l    Scr+(5*40*256)    ;bm_Planes (.l) 6
  161.     dc.l    Scr+(6*40*256)    ;bm_Planes (.l) 7
  162.     dc.l    Scr+(7*40*256)    ;bm_Planes (.l) 8
  163.     
  164.     
  165.     section    chipmem,data_c
  166.     
  167. scr:    ds.l    20*200*3
  168.  
  169.     end
  170.  
  171.  
  172.