home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 303.lha / AssemTools / Include / intlib.i < prev    next >
Text File  |  1980-12-03  |  27KB  |  1,120 lines

  1. ;
  2. ;  intlib.i  intuition handler library
  3. ;  founded by tm 14.06.89
  4. ;  (c) 1989 supervisor
  5. ;
  6.  
  7. ;  "getidcmp, initchrout, chrout" created 14.06.89 -> v1.0
  8. ;  "allocgad" created 15.06.89 -> v1.01
  9. ;  "gadborder, sborder" created 15.06.89 -> v1.02
  10. ;  "allocgad" - Got It Out to Work! 15.06.89 -> v1.03
  11. ;  "findgad, -w" created 15.06.89 -> v1.04
  12. ;  "request" gotten from jm (blaf) 15.06.89 -> v1.05
  13. ;  "getidcmp" debugt 16.06.89 -> v1.06
  14. ;  "gad" changed to "gg"; "AA, AR" added to "allocgad";
  15. ;  "findgad" debugt 16.06.89 -> v1.061
  16. ;  "chrcursor" added 22.06.89 -> v1.062
  17. ;  features added to "chrout" 25.06.89 -> v1.063
  18. ;  "allocmenu" created by JM 15..16.07.89 -> v1.1
  19. ;  "allocmenu" modified (rel.word, AA, AR added) 16.07.89 
  20. ;    -> v1.101 -> v1.103b
  21. ;  "getmenunum" created -> v1.104
  22. ;  -> v1.104b 07.08.89
  23.  
  24. *T
  25. *T    INTLIB.I * Metacc Include File
  26. *T        Version 1.104b
  27. *T            Date 07.08.89
  28. *T
  29. *B
  30.  
  31. ;  getidcmp    (get a standard idcmp message)
  32. ;  in:        a0=*window; d0=flag /=0: wait, <>0 do not wait/;
  33. ;  call:    intlib    getidcmp;
  34. ;  out:        d0=class, d1=code, d2=qualifier;
  35. ;          a0=iaddress, d3,d4=mousex,mousey;
  36.  
  37. ;  request    (display an autorequester)
  38. ;  in:        a0=*window; a1=*texts; a2=*textattr (==0: deflt)
  39. ;  call:    intlib    request;
  40. ;  out:        d0=result; />0: true, =0: error, <0: false/
  41.  
  42. ;  allocgg    (allocate and create a gadget structure chain)
  43. ;  in:        a0=*gadgetdata; a1=*strgad_bufr_base;
  44. ;          a2=rel_base; a4=variable_base;
  45. ;  call:    intlib    allocgg;
  46. ;  out:        d0=a0=*firstgadget; /use execlib->free to free/
  47. ;  notes:    The gadgetdata list may contain elements
  48. ;        of the following form:
  49. ;         type.w, x1.w, y1.w, sx.w, sy.w, userdata.l,
  50. ;         specl.w
  51. ;        followed by "specl" bytes of additional data.
  52. ;        See "allocgg.doc" for documentation.
  53.  
  54. ;  allocmenu    (allocate and create a menu structure chain)
  55. ;  in:        a0=*menudata; a1=*default_IntuiText;
  56. ;          a2=rel_base; a4=variable_base;
  57. ;  call:    intlib    allocmenu;
  58. ;  out:        d0=a0=*menustrip; /use execlib->free to free/
  59. ;  notes:    The menudata list contains elements of the
  60. ;          following form:
  61. ;           type.b, cmdkey.b, specl.w, [<special_data>],
  62. ;           name.str
  63. ;          -NOTE-: Add a 'ds.w 0' after the name to word-
  64. ;          align the rest of data.
  65. ;          The <special_data> field contains "specl" bytes
  66. ;          of additional data. See "allocmenu.doc" for
  67. ;          documentation. "handler.i" contatins macros
  68. ;          ".menu, .item, .subitm" to facilitate use.
  69.  
  70. ;  ggborder    (draw simple border to gadgets)
  71. ;  in:        a0=*gadgetdata; a1=*rport;
  72. ;  call:    intlib    ggborder;
  73.  
  74. ;  findgg    (find a gadget by UserData)
  75. ;  in:        a0=*firstgadget; d0=userdata;
  76. ;  call:    intlib    findgg;
  77. ;  out:        a0=*gadget; /==0 if not found/
  78.  
  79. ;  findggw    (find a gadget by a half of UserData)
  80. ;  in:        a0=*firstgadget; d0=(uword) userdata;
  81. ;  call:    intlib    findggw;
  82. ;  out:        a0=*gadget; /==0 if not found/
  83.  
  84. ;  getmenunum    (convert a packed menu number)
  85. ;  in:        d0=packed;
  86. ;  call:    intlib    getmenunum;
  87. ;  out:        d0=menu, d1=item, d2=subitem;
  88. ;  notes:    All inputs/outputs uword (-1 returned 16
  89. ;        bits wide if parameter undefined)
  90.  
  91. ;  sborder    (draw a simple border)
  92. ;  in:        d0,d1=x1,y1; d2,d3=sx,sy; a1=rport;
  93. ;  call:    intlib    sborder;
  94.  
  95. ;  initchrout    (init a chrout structure)
  96. ;  in:        a0=*window; a1=*chrout;
  97. ;  call:    intlib    initchrout;
  98.  
  99. ;  chrcursor    (set and read current cursor position)
  100. ;  in:        d0, d1=column, row; a1=*chrout;
  101. ;  call:    intlib    chrcursor;
  102. ;  out:        d0, d1=oldcolumn, oldrow;
  103.  
  104. ;  chrout    (output text into a chrout)
  105. ;  in:        a0=*string; a1=*chrout;
  106. ;  call:    intlib    chrout;
  107. ;  notes:    Control codes are:
  108. ;        8   BS   Backspace. Cursor left
  109. ;        9   TAB  Tabulator (size 8 characters)
  110. ;        10  LF   Line feed
  111. ;        11  VT   Vertical tab. Cursor up
  112. ;        12  FF   Form feed (clearscreen)
  113. ;        13  CR   Carriage return
  114. ;        14  SO   Cursor on
  115. ;        15  SI   Cursor off
  116. ;        16  DLE  Scroll up one line
  117. ;        17  DC1  Scroll down one line
  118. ;        20  DC4  Clear to end of line
  119. ;        21  NAK  Insert character
  120. ;        22  SYN  Delete line at cursor
  121. ;        23  ETB  Insert line at cursor
  122. ;        24  CAN  Clear line at cursor and end of screen
  123. ;        25  EM   Cursor to nethermost line
  124. ;        26  SUB  Cursor home
  125. ;        28  FS   Cursor up. Scroll if out
  126. ;        29  GS   Cursor down. Scroll if out
  127. ;        30  RS   Cursor left
  128. ;        31  US   Cursor right
  129. ;        127 DEL  Delete character to right
  130.  
  131. *E
  132.  
  133. chrout_x    equ    0    ;cursor pos.
  134. chrout_y    equ    2
  135. chrout_sx    equ    4    ;size of window in chr pos's.
  136. chrout_sy    equ    6
  137. chrout_cx    equ    8    ;character size
  138. chrout_cy    equ    10
  139. chrout_ox    equ    12    ;offset from borders
  140. chrout_oy    equ    14
  141. chrout_rport    equ    16
  142. chrout_backg    equ    20
  143. chrout_foreg    equ    22
  144. chrout_baseline    equ    24
  145. chrout_cursor    equ    26
  146. chrout_window    equ    28
  147. chrout_pad    equ    32    ;future expansion
  148. chrout_idcmper    equ    36    ;idcmp handler
  149. chrout_SIZEOF    equ    40
  150.  
  151.  
  152. intlib        macro
  153.         ifnc    '\1',''
  154. _INTF\1        set    1
  155.         bsr    _INT\1
  156.         mexit
  157.         endc
  158.  
  159.         ifd    _INTFrequest
  160. _INTrequest    push    d1-d7/a0-a6
  161.         move.l    a0,d7            window*
  162.         move.l    a1,d3            text*
  163.         move.l    a2,d2            font*
  164.         move.l    #it_SIZEOF*6,d0
  165.         move.l    #MEMF_PUBLIC!MEMF_CLEAR,d1
  166.         lib    Exec,AllocMem
  167.         move.l    d0,d6            mem*
  168.         beq    102$            -> no memory
  169.         move.l    d3,a0            ASCII text*
  170.         move.l    d6,a1            first IText*
  171.         lea.l    201$(pc),a2        coordinate table
  172.         moveq.l    #4,d0            #of structs
  173. 2$        move.l    a0,it_IText(a1)        save first text*
  174.         move.l    d2,it_ITextFont(a1)    set font
  175.         move.b    #RP_JAM1,it_DrawMode(a1)
  176.         move.b    (a2)+,it_LeftEdge+1(a1)    set x
  177.         move.b    (a2)+,it_TopEdge+1(a1)    set y
  178. 1$        tst.b    (a0)+            get next string*
  179.         bne.s    1$
  180.         lea.l    it_SIZEOF(a1),a1    next it*
  181.         dbf    d0,2$
  182.         move.l    d6,a0
  183.         lea.l    it_SIZEOF(a0),a1    next*
  184.         move.l    a1,it_NextText(a0)
  185.         lea.l    it_SIZEOF(a1),a0    next*
  186.         move.l    a0,it_NextText(a1)
  187.         move.l    d7,a0
  188.         move.l    d6,a1            bodytext
  189.         lea.l    it_SIZEOF*3(a1),a2    positext
  190.         lea.l    it_SIZEOF*4(a1),a3    negatext
  191.         move.l    it_IText(a2),a6        text*
  192.         tst.b    (a6)
  193.         bne.s    6$            if no POSITEXT no gg needed
  194.         sub.l    a2,a2
  195. 6$        push    a0/a1
  196.         move.l    d6,a0
  197.         lib    Intuition,IntuiTextLength
  198.         moveq.l    #40,d2
  199.         add.l    d0,d2            width
  200.         pull    a0/a1
  201.         moveq.l    #72,d3            height
  202.         moveq.l    #0,d0            posiflags
  203.         moveq.l    #0,d1            negaflags
  204.         flib    Intuition,AutoRequest
  205.         tst.l    d0
  206.         bne.s    10$
  207.         moveq.l    #-1,d7        false
  208.         bra.s    11$
  209. 10$        moveq.l    #1,d7        true
  210. 11$        move.l    d6,a1
  211.         move.l    #it_SIZEOF*6,d0
  212.         lib    Exec,FreeMem
  213.         move.l    d7,d0
  214.         bra.s    101$
  215. 201$        dc.b    9,5,9,15,9,25,6,3,6,3
  216. 102$        moveq.l    #0,d0
  217. 101$        pull    d1-d7/a0-a6
  218.         tst.l    d0
  219.         rts
  220.         endc
  221.  
  222.         ifd    _INTFggborder
  223. _INTggborder    push    a0-a3/d0-d4
  224.         move.l    a0,a2
  225.         move.l    a1,a3
  226. _INTggborder1    move.w    (a2),d4
  227.         beq.s    _INTggborder0
  228.         move.w    2(a2),d0
  229.         move.w    4(a2),d1
  230.         move.w    6(a2),d2
  231.         move.w    8(a2),d3
  232.         subq.w    #1,d0
  233.         subq.w    #1,d1
  234.         addq.w    #1,d2
  235.         addq.w    #1,d3
  236.         move.l    a3,a1
  237.         intlib    sborder
  238.         lea.l    14(a2),a2
  239.         add.w    (a2)+,a2
  240.         bra.s    _INTggborder1
  241. _INTggborder0    pull    a0-a3/d0-d4
  242.         rts
  243.         endc
  244.  
  245.         ifd    _INTFsborder
  246. _INTsborder    push    d0-d5/a0-a2
  247.         add.w    d0,d2
  248.         add.w    d1,d3
  249.         move.l    a1,a2
  250.         move.w    d0,d4
  251.         move.w    d1,d5
  252.         lib    Gfx,Move
  253.         move.w    d4,d0
  254.         move.w    d3,d1
  255.         move.l    a2,a1
  256.         flib    Gfx,Draw
  257.         move.w    d2,d0
  258.         move.w    d3,d1
  259.         move.l    a2,a1
  260.         flib    Gfx,Draw
  261.         move.w    d2,d0
  262.         move.w    d5,d1
  263.         move.l    a2,a1
  264.         flib    Gfx,Draw
  265.         move.w    d4,d0
  266.         move.w    d5,d1
  267.         move.l    a2,a1
  268.         flib    Gfx,Draw
  269.         pull    d0-d5/a0-a2
  270.         rts
  271.         endc
  272.  
  273.         ifd    _INTFfindgg
  274. _INTfindgg1    move.l    (a0),a0
  275. _INTfindgg    cmp.l    40(a0),d0
  276.         beq.s    _INTfindgg0
  277.         tst.l    (a0)
  278.         bne.s    _INTfindgg1
  279.         sub.l    a0,a0
  280. _INTfindgg0    rts
  281.         endc
  282.  
  283.         ifd    _INTFfindggw
  284. _INTfindggw1    move.l    (a0),a0
  285. _INTfindggw    cmp.w    40(a0),d0
  286.         beq.s    _INTfindggw0
  287.         tst.l    (a0)
  288.         bne.s    _INTfindggw1
  289.         sub.l    a0,a0
  290. _INTfindggw0    rts
  291.         endc
  292.  
  293.         ifd    _INTFgetmenunum
  294. _INTgetmenunum    move.w    d0,d1
  295.         move.w    d0,d2
  296.         and.w    #$1f,d0
  297.         lsr.w    #5,d1
  298.         and.w    #$3f,d1
  299.         rol.w    #5,d2
  300.         and.w    #$1f,d2
  301.         cmp.w    #$1f,d0
  302.         bne.s    1$
  303.         moveq    #-1,d0
  304. 1$        cmp.w    #$3f,d1
  305.         bne.s    2$
  306.         moveq    #-1,d1
  307. 2$        cmp.w    #$1f,d2
  308.         bne.s    3$
  309.         moveq    #-1,d2
  310. 3$        tst.w    d0
  311.         rts
  312.         endc
  313.  
  314.         ifd    _INTFallocgg
  315. _INTallocgg    push    a1-a5/d1-d7
  316.         move.l    a2,d6    ;rel.base
  317.         move.l    a0,a2    ;data
  318.         move.l    a1,d7    ;strbuf.base
  319.         moveq    #0,d2
  320. _INTallocgg1    move.w    (a0),d1
  321.         beq.s    _INTallocgg2
  322.         lea.l    14(a0),a0
  323.         add.w    (a0)+,a0
  324.         bsr    _INTallocgg.s
  325.         add.l    d0,d2
  326.         bra.s    _INTallocgg1
  327. _INTallocgg2    addq.w    #4,d2
  328.         move.l    d2,d0
  329.         moveq    #1,d1
  330.         lib    Exec,AllocMem
  331.         move.l    d0,a3
  332.         tst.l    d0
  333.         beq    _INTallocgg0
  334.         move.l    d2,(a3)+
  335.         move.l    a3,a0
  336. _INTallocgg3    move.w    (a2),d1
  337.         beq    _INTallocgg0
  338.         bsr    _INTallocgg.s
  339.         add.l    a0,d0
  340.         lea.l    14(a2),a1
  341.         add.w    (a1)+,a1
  342.         tst.w    (a1)
  343.         bne.s    _INTallocgg3b
  344.         moveq    #0,d0
  345. _INTallocgg3b    move.l    a0,a5
  346.         move.l    d0,(a0)+        ;next
  347.         move.l    2(a2),(a0)+        ;co-ordinates
  348.         move.l    6(a2),(a0)+        ;size
  349.         move.w    #GADGHCOMP,(a0)+    ;flags
  350.         move.w    #RELVERIFY,(a0)+    ;activation
  351.         moveq    #0,d2
  352.         cmp.w    #BOOLGADGET,d1
  353.         beq.s    _INTallocgg3c
  354.         lea.l    44(a5),a1
  355.         move.l    a1,d2
  356. _INTallocgg3c    move.w    d1,(a0)+        ;type
  357.         clr.l    (a0)+            ;render
  358.         clr.l    (a0)+            ;selrender
  359.         clr.l    (a0)+            ;text
  360.         clr.l    (a0)+            ;mutual excl
  361.         move.l    d2,(a0)+        ;specialinfo
  362.         clr.w    (a0)+            ;id
  363.         move.l    10(a2),(a0)+        ;userdata
  364.         lea.l    14(a2),a2
  365.         cmp.w    #BOOLGADGET,d1        ;bool gad:
  366.         beq.s    _INTallocgg3e        ;no specinfo
  367.         moveq    #8,d0
  368. _INTallocgg3d    clr.l    (a0)+            ;9 longs of wisp
  369.         dbf    d0,_INTallocgg3d
  370.         cmp.w    #STRGADGET,d1        ;str gad:
  371.         beq.s    _INTallocgg3e        ;specinfo 36 byt
  372.         clr.l    (a0)+
  373.         clr.w    (a0)+
  374.         lea.l    66(a5),a1
  375.         move.l    a1,18(a5)        ;set propptr
  376. _INTallocgg3e    move.w    (a2)+,d0
  377. _INTallocgg3f    tst.w    d0
  378.         ble    _INTallocgg3
  379.         move.w    (a2)+,d1
  380.         subq.w    #2,d0
  381.         lea.l    _INTallocgg.t1(pc),a1
  382.         moveq    #-2,d2
  383. _INTallocgg3g    addq.w    #2,d2
  384.         tst.w    (a1)
  385.         beq.s    _INTallocgg3f
  386.         cmp.w    (a1)+,d1
  387.         bne.s    _INTallocgg3g
  388.         lea.l    _INTallocgg.t2(pc),a1
  389.         move.b    0(a1,d2.w),d1
  390.         move.b    1(a1,d2.w),d2
  391.         ext.w    d2
  392.         tst.b    d1
  393.         beq.s    _INTallocgg3w
  394.         cmp.b    #1,d1
  395.         beq.s    _INTallocgg3l
  396.         cmp.b    #3,d1
  397.         beq.s    _INTallocgg3r
  398.         cmp.b    #4,d1
  399.         beq.s    _INTallocgg3t
  400.         subq.w    #4,d0        ;rel.long *
  401.         move.l    (a2)+,d1
  402.         add.l    d6,d1
  403.         move.l    d1,0(a5,d2.w)
  404.         bra.s    _INTallocgg3f
  405. _INTallocgg3w    subq.w    #2,d0        ;word *
  406.         move.w    (a2)+,0(a5,d2.w)
  407.         bra.s    _INTallocgg3f
  408. _INTallocgg3l    subq.w    #4,d0        ;long *
  409.         move.l    (a2)+,0(a5,d2.w)
  410.         bra.s    _INTallocgg3f
  411. _INTallocgg3r    subq.w    #2,d0        ;bufferptr
  412.         move.w    (a2)+,d1
  413.         ext.l    d1
  414.         add.l    d7,d1
  415.         move.l    d1,0(a5,d2.w)
  416.         bra    _INTallocgg3f
  417. _INTallocgg3t    tst.b    d2
  418.         bpl.s    _INTallocgg3u    ;rel. baseaddr.w
  419.         subq.w    #2,d0
  420.         move.w    (a2)+,d1
  421.         move.l    a5,0(a4,d1.w)
  422.         bra    _INTallocgg3f
  423. _INTallocgg3u    subq.w    #4,d0        ;abs. baseaddr.l
  424.         move.l    (a2)+,a1
  425.         move.l    a5,(a1)
  426.         bra    _INTallocgg3f
  427. _INTallocgg.s    moveq.l    #44,d0            ;gadget_SO
  428.         cmp.w    #BOOLGADGET,d1
  429.         beq.s    _INTallocgg.s1
  430.         add.w    #36,d0            ;stringinfo_SO
  431.         cmp.w    #STRGADGET,d1
  432.         beq.s    _INTallocgg.s1
  433.         addq.w    #6,d0            ;prop needs 42
  434. _INTallocgg.s1    rts
  435. _INTallocgg0    move.l    a3,a0
  436.         move.l    a0,d0
  437.         pull    a1-a5/d1-d7
  438.         rts
  439. _INTallocgg.t1    dc.b    'GFGAGRGSGTGMGIGU'
  440.         dc.b    'PFPHPVPhPvSBSUSP'
  441.         dc.b    'SMSDAAAR',0,0
  442. _INTallocgg.t2    dc.b    0,12,0,14,2,18,2,22,2,26,1,30,0,38,1,40
  443.         dc.b    0,44,0,46,0,48,0,50,0,52,3,44,3,48,0,52
  444.         dc.b    0,54,0,56,4,1,4,-1
  445.         endc
  446.  
  447.         ifd    _INTFgetidcmp
  448. _INTgetidcmp    push    d5-d7/a1-a2
  449.         move.l    d0,d7        ;0=wait
  450.         move.l    86(a0),a2    ;wd_userport
  451. _INTgetidcmp1    move.l    a2,a0
  452.         lib    Exec,GetMsg
  453.         tst.l    d0
  454.         bne.s    _INTgetidcmp2
  455.         tst.l    d7
  456.         bne.s    _INTgetidcmp0
  457.         moveq.l    #0,d1
  458.         move.b    15(a2),d1
  459.         moveq.l    #0,d0
  460.         bset.l    d1,d0
  461.         lib    Exec,Wait
  462.         bra.s    _INTgetidcmp1
  463. _INTgetidcmp2    move.l    d0,a1
  464.         move.l    im_Class(a1),d0
  465.         move.w    im_Code(a1),d1
  466.         move.w    im_Qualifier(a1),d2
  467.         move.l    im_IAddress(a1),a0
  468.         move.w    im_MouseX(a1),d3
  469.         move.w    im_MouseY(a1),d4
  470.         ext.l    d1
  471.         ext.l    d2
  472.         ext.l    d3
  473.         ext.l    d4
  474.         push    a0/d0-d4
  475.         lib    Exec,ReplyMsg
  476.         pull    a0/d0-d4
  477. _INTgetidcmp.x    pull    d5-d7/a1-a2
  478.         rts
  479. _INTgetidcmp0    moveq    #0,d0
  480.         moveq    #0,d1
  481.         moveq    #0,d2
  482.         moveq    #0,d3
  483.         moveq    #0,d4
  484.         sub.l    a0,a0
  485.         bra.s    _INTgetidcmp.x
  486.         endc
  487.  
  488.         ifd    _INTFchrout
  489. _INTchrout    push    all
  490.         move.l    a1,a2
  491.         lea.l    -1(a0),a5
  492.         bsr    _INTchroutcur
  493. _INTchrout1    addq.w    #1,a5
  494. _INTchrout1b    move.b    (a5),d0
  495.         cmp.b    #32,d0
  496.         blo    _INTchroutnp
  497.         move.l    a5,a0
  498.         move.w    chrout_x(a2),d1
  499. _INTchrout2    addq.w    #1,a5
  500.         addq.w    #1,d1
  501.         move.b    (a5),d0
  502.         cmp.b    #32,d0
  503.         blo.s    _INTchrout3
  504.         cmp.w    chrout_sx(a2),d1
  505.         blo.s    _INTchrout2
  506. _INTchrout3    push    d1/a0
  507.         move.w    chrout_x(a2),d0
  508.         mulu.w    chrout_cx(a2),d0
  509.         add.w    chrout_ox(a2),d0
  510.         move.w    chrout_y(a2),d1
  511.         mulu.w    chrout_cy(a2),d1
  512.         add.w    chrout_oy(a2),d1
  513.         add.w    chrout_baseline(a2),d1
  514.         move.l    chrout_rport(a2),a1
  515.         lib    Gfx,Move
  516.         move.l    chrout_rport(a2),a1
  517.         move.w    chrout_backg(a2),d0
  518.         flib    Gfx,SetBPen
  519.         move.l    chrout_rport(a2),a1
  520.         move.w    chrout_foreg(a2),d0
  521.         flib    Gfx,SetAPen
  522.         pull    d1/a0
  523.         move.l    chrout_rport(a2),a1
  524.         move.w    d1,d0
  525.         move.w    d1,d2
  526.         sub.w    chrout_x(a2),d0
  527.         flib    Gfx,Text
  528.         move.w    d2,chrout_x(a2)
  529.         cmp.w    chrout_sx(a2),d2
  530.         blo    _INTchrout1b
  531.         subq.w    #1,a5
  532. _INTchroutlf    clr.w    chrout_x(a2)
  533. _INTchroutcd    addq.w    #1,chrout_y(a2)
  534.         move.w    chrout_y(a2),d0
  535.         cmp.w    chrout_sy(a2),d0
  536.         blo    _INTchrout1
  537.         subq.w    #1,chrout_y(a2)
  538. _INTchroutsc    move.l    chrout_rport(a2),a1
  539.         move.w    chrout_backg(a2),d0
  540.         lib    Gfx,SetBPen
  541.         bsr.s    _INTchroutcss
  542.         bsr.s    _INTchroutpts
  543.         flib    Gfx,ScrollRaster
  544.         bra    _INTchrout1
  545. _INTchroutyy    move.l    chrout_rport(a2),a1
  546.         move.w    chrout_backg(a2),d0
  547.         lib    Gfx,SetBPen
  548.         bsr.s    _INTchroutcss
  549.         bsr.s    _INTchroutpts
  550.         neg.w    d1
  551.         flib    Gfx,ScrollRaster
  552.         bra    _INTchrout1
  553. _INTchroutpts    move.w    d3,d5
  554.         move.w    d2,d4
  555.         move.w    d1,d3
  556.         move.w    d0,d2
  557.         move.w    chrout_cy(a2),d1
  558.         moveq    #0,d0
  559.         move.l    chrout_rport(a2),a1
  560.         rts
  561. _INTchroutocr    clr.w    chrout_x(a2)
  562.         bra    _INTchrout1
  563. _INTchroutcss    move.w    chrout_ox(a2),d0
  564.         move.w    chrout_oy(a2),d1
  565.         move.w    chrout_sx(a2),d2
  566.         move.w    chrout_sy(a2),d3
  567.         mulu.w    chrout_cx(a2),d2
  568.         mulu.w    chrout_cy(a2),d3
  569.         add.w    d0,d2
  570.         add.w    d1,d3
  571.         subq.w    #1,d2
  572.         subq.w    #1,d3
  573.         rts
  574. _INTchroutcs    move.l    chrout_rport(a2),a1
  575.         move.w    chrout_backg(a2),d0
  576.         lib    Gfx,SetAPen
  577.         bsr.s    _INTchroutcss
  578.         flib    Gfx,RectFill
  579. _INTchroutch    clr.w    chrout_x(a2)
  580.         clr.w    chrout_y(a2)
  581.         bra    _INTchrout1
  582. _INTchroutcl    subq.w    #1,chrout_x(a2)
  583.         bpl    _INTchrout1
  584.         move.w    chrout_sx(a2),d0
  585.         subq.w    #1,d0
  586.         move.w    d0,chrout_x(a2)
  587. _INTchroutcu    tst.w    chrout_y(a2)
  588.         beq    _INTchroutyy
  589.         subq.w    #1,chrout_y(a2)
  590.         bra    _INTchrout1
  591. _INTchroutcr    addq.w    #1,chrout_x(a2)
  592.         move.w    chrout_x(a2),d0
  593. _INTchroutqr    cmp.w    chrout_sx(a2),d0
  594.         bhs    _INTchroutlf
  595.         bra    _INTchrout1
  596. _INTchrouttab    move.w    chrout_x(a2),d0
  597.         addq.w    #8,d0
  598.         and.b    #$f8,d0
  599.         move.w    d0,chrout_x(a2)
  600.         bra    _INTchroutqr
  601. _INTchroutnp    tst.b    d0
  602.         beq    _INTchroutxx
  603.         lea.l    _INTchrout.t1(pc),a1
  604.         moveq    #-2,d1
  605. _INTchroutnp1    addq.w    #2,d1
  606.         tst.b    (a1)
  607.         beq    _INTchrout1
  608.         cmp.b    (a1)+,d0
  609.         bne.s    _INTchroutnp1
  610.         lea.l    _INTchrout.t2(pc),a1
  611.         add.w    d1,a1
  612.         move.l    a1,a0
  613.         add.w    (a1),a0
  614.         jmp    (a0)
  615. _INTchrout.t1    dc.b    10,13,8,9,12,11,28,29,30,31
  616.         dc.b    26,16,14,15,17,25,20,127,21
  617.         dc.b    22,23,24,0
  618.         ds.w    0
  619. _INTchrout.t2    dc.w    _INTchroutlf-*
  620.         dc.w    _INTchroutocr-*
  621.         dc.w    _INTchroutcl-*
  622.         dc.w    _INTchrouttab-*
  623.         dc.w    _INTchroutcs-*
  624.         dc.w    _INTchroutcu-*
  625.         dc.w    _INTchroutcu-*
  626.         dc.w    _INTchroutcd-*
  627.         dc.w    _INTchroutcl-*
  628.         dc.w    _INTchroutcr-*
  629.         dc.w    _INTchroutch-*
  630.         dc.w    _INTchroutsc-*
  631.         dc.w    _INTchroutsi-*
  632.         dc.w    _INTchroutsi-*
  633.         dc.w    _INTchroutyy-*
  634.         dc.w    _INTchroutnml-*
  635.         dc.w    _INTchrouteol-*
  636.         dc.w    _INTchroutdel-*
  637.         dc.w    _INTchroutins-*
  638.         dc.w    _INTchroutdll-*
  639.         dc.w    _INTchroutinl-*
  640.         dc.w    _INTchrouteos-*
  641. _INTchroutcas    move.w    chrout_x(a2),d0
  642.         move.w    chrout_y(a2),d1
  643.         mulu.w    chrout_cx(a2),d0
  644.         mulu.w    chrout_cy(a2),d1
  645.         move.w    chrout_sx(a2),d2
  646.         mulu.w    chrout_cx(a2),d2
  647.         subq.w    #1,d2
  648.         move.w    d1,d3
  649.         add.w    chrout_cy(a2),d3
  650. _INTchroutcas1    subq.w    #1,d3
  651.         add.w    chrout_ox(a2),d0
  652.         add.w    chrout_oy(a2),d1
  653.         add.w    chrout_ox(a2),d2
  654.         add.w    chrout_oy(a2),d3
  655.         rts
  656. _INTchroutcrs    moveq    #0,d0
  657.         move.w    chrout_y(a4),d1
  658.         mulu.w    chrout_cy(a4),d1
  659.         move.w    chrout_sx(a4),d2
  660.         mulu.w    chrout_cx(a4),d2
  661.         subq.w    #1,d2
  662.         move.w    chrout_sy(a4),d3
  663.         mulu.w    chrout_cy(a4),d3
  664.         bra.s    _INTchroutcas1
  665. _INTchroutnml    move.w    chrout_sy(a2),d0
  666.         subq.w    #1,d0
  667.         move.w    d0,chrout_y(a2)
  668.         bra    _INTchrout1
  669. _INTchrouteol    move.w    chrout_backg(a2),d0
  670.         move.l    chrout_rport(a2),a1
  671.         lib    Gfx,SetAPen
  672.         bsr    _INTchroutcas
  673.         move.l    chrout_rport(a2),a1
  674.         flib    Gfx,RectFill
  675.         bra    _INTchrout1
  676. _INTchroutdel    move.w    chrout_backg(a2),d0
  677.         move.l    chrout_rport(a2),a1
  678.         lib    Gfx,SetBPen
  679.         bsr    _INTchroutcas
  680.         bsr    _INTchroutpts
  681.         moveq    #0,d1
  682.         move.w    chrout_cx(a2),d0
  683.         flib    Gfx,ScrollRaster
  684.         bra    _INTchrout1
  685. _INTchroutins    move.w    chrout_backg(a2),d0
  686.         move.l    chrout_rport(a2),a1
  687.         lib    Gfx,SetBPen
  688.         bsr    _INTchroutcas
  689.         bsr    _INTchroutpts
  690.         moveq    #0,d1
  691.         move.w    chrout_cx(a2),d0
  692.         neg.w    d0
  693.         flib    Gfx,ScrollRaster
  694.         bra    _INTchrout1
  695. _INTchroutdll    move.w    chrout_backg(a2),d0
  696.         move.l    chrout_rport(a2),a1
  697.         lib    Gfx,SetBPen
  698.         bsr    _INTchroutcrs
  699.         bsr    _INTchroutpts
  700.         flib    Gfx,ScrollRaster
  701.         bra    _INTchrout1
  702. _INTchroutinl    move.w    chrout_backg(a2),d0
  703.         move.l    chrout_rport(a2),a1
  704.         lib    Gfx,SetBPen
  705.         bsr    _INTchroutcrs
  706.         bsr    _INTchroutpts
  707.         neg.w    d1
  708.         flib    Gfx,ScrollRaster
  709.         bra    _INTchrout1
  710. _INTchrouteos    move.w    chrout_backg(a2),d0
  711.         move.l    chrout_rport(a2),a1
  712.         lib    Gfx,SetAPen
  713.         bsr    _INTchroutcrs
  714.         flib    Gfx,RectFill
  715.         bra    _INTchrout1
  716. _INTchroutcur    tst.w    chrout_cursor(a2)
  717.         bne.s    _INTchroutcur1
  718.         move.l    chrout_rport(a2),a1
  719.         moveq    #0,d7
  720.         move.b    28(a1),d7
  721.         moveq    #2,d0        ;complement
  722.         lib    Gfx,SetDrMd
  723.         move.w    chrout_x(a2),d0
  724.         move.w    chrout_y(a2),d1
  725.         mulu.w    chrout_cx(a2),d0
  726.         mulu.w    chrout_cy(a2),d1
  727.         add.w    chrout_ox(a2),d0
  728.         add.w    chrout_oy(a2),d1
  729.         move.w    d0,d2
  730.         move.w    d1,d3
  731.         add.w    chrout_cx(a2),d2
  732.         add.w    chrout_cy(a2),d3
  733.         subq.w    #1,d2
  734.         subq.w    #1,d3
  735.         move.l    chrout_rport(a2),a1
  736.         flib    Gfx,RectFill
  737.         move.l    chrout_rport(a2),a1
  738.         move.w    d7,d0
  739.         flib    Gfx,SetDrMd
  740. _INTchroutcur1    rts
  741. _INTchroutsi    and.w    #1,d0
  742.         move.w    d0,chrout_cursor(a2)
  743.         bra    _INTchrout1
  744. _INTchroutxx    bsr    _INTchroutcur
  745.         pull    all
  746.         rts
  747.         endc
  748.  
  749.         ifd    _INTFchrcursor
  750. _INTchrcursor    cmp.w    chrout_sx(a1),d0
  751.         bhs.s    _INTchrcursor1
  752.         move.w    d0,chrout_x(a1)
  753. _INTchrcursor1    cmp.w    chrout_sy(a1),d1
  754.         bhs.s    _INTchrcursor2
  755.         move.w    d1,chrout_y(a1)
  756. _INTchrcursor2    move.w    chrout_x(a1),d0
  757.         ext.l    d0
  758.         move.w    chrout_y(a1),a1
  759.         ext.l    d1
  760.         rts
  761.         endc
  762.  
  763.         ifd    _INTFinitchrout
  764. _INTinitchrout    push    all
  765.         move.l    50(a0),a2
  766.         clr.l    chrout_x(a1)
  767.         move.l    a0,chrout_window(a1)
  768.         move.w    58(a2),chrout_cy(a1)
  769.         move.w    60(a2),chrout_cx(a1)
  770.         move.w    #4,chrout_ox(a1)
  771.         move.w    #12,chrout_oy(a1)
  772.         move.l    a2,chrout_rport(a1)
  773.         move.w    #1,chrout_foreg(a1)
  774.         clr.w    chrout_backg(a1)
  775.         move.w    62(a2),chrout_baseline(a1)
  776.         move.w    #-1,chrout_cursor(a1)
  777.         move.w    8(a0),d0
  778.         subq.w    #8,d0
  779.         ext.l    d0
  780.         divs.w    8(a1),d0
  781.         move.w    d0,chrout_sx(a1)
  782.         move.w    10(a0),d0
  783.         sub.w    #16,d0
  784.         ext.l    d0
  785.         divs.w    10(a1),d0
  786.         move.w    d0,chrout_sy(a1)
  787.         clr.l    chrout_idcmper(a1)
  788.         clr.l    chrout_pad(a1)
  789.         pull    all
  790.         rts
  791.         endc
  792.  
  793.         ifd    _INTFallocmenu
  794.  
  795. _INTalmnmem    set    -4    ;internal structure
  796. _INTalmntxtattr    set    -8
  797. _INTalmnmuad    set    -12
  798. _INTalmnmiad    set    -16
  799. _INTalmnsavea4    set    -20
  800. _INTalmnsource    set    -24
  801. _INTalmnlwid    set    -26
  802. _INTalmna2base    set    -30
  803. _INTalmna4base    set    -34
  804. _INTalmnitext    set    -38
  805. _INTalmnlswid    set    -40
  806. _INTalmnmex    set    -42
  807. _INTalmnity    set    -44
  808. _INTalmnfohei    set    -46
  809.  
  810. _INTallocmenu    push    a1-a4/a6/d1-d7    *a0=cmd string; a1=IntuiText (sample)
  811.         link    a5,#_INTalmnfohei
  812.         move.l    a0,_INTalmnsource(a5)
  813.         move.l    a1,_INTalmnitext(a5)
  814.         move.l    it_ITextFont(a1),_INTalmntxtattr(a5)
  815.         clr.l    _INTalmnmem(a5)
  816.         move.l    _INTalmntxtattr(a5),d0
  817.         beq.s    1$
  818.         move.l    d0,a2
  819.         move.w    ta_YSize(a2),d0
  820.         bra.s    2$
  821. 1$        moveq    #10,d0
  822. 2$        move.w    d0,_INTalmnfohei(a5)    set font height
  823.         bsr    _INTalmn_len
  824.         addq.l    #4,d0
  825.         move.l    d0,d2
  826.         move.l    #MEMF_PUBLIC!MEMF_CLEAR,d1
  827.         lib    Exec,AllocMem
  828.         tst.l    d0
  829.         beq    _INTalmn_e
  830.         move.l    d0,a0            bufptr
  831.         move.l    d2,(a0)+
  832.         move.l    a0,_INTalmnmem(a5)
  833.  
  834.         move.l    _INTalmnsource(a5),a0
  835.         move.l    _INTalmnmem(a5),a1
  836.         move.w    #5,_INTalmnmex(a5)    x-coord
  837.         clr.l    _INTalmnmuad(a5)    reset menu struct pointer
  838.  
  839. * MAIN LOOP
  840. 100$        move.b    (a0)+,d0
  841.         beq    _INTalmn_x
  842.         cmp.b    #1,d0
  843.         bne    200$
  844.  
  845.  
  846. * PROCESS A MENU STRUCTURE
  847.  
  848.         addq.l    #1,a0            skip command key
  849.         clr.l    _INTalmnmiad(a5)    reset menu struct pointer
  850.         move.w    #1,_INTalmnity(a5)    first item y-coord
  851.         move.l    _INTalmnmuad(a5),d0
  852.         beq.s    10$
  853.         move.l    d0,a2
  854.         move.l    a1,mu_NextMenu(a2)    set pointer to this menu
  855.  
  856. 10$        move.l    a1,_INTalmnmuad(a5)    start of this Menu
  857.         move.w    _INTalmnmex(a5),mu_LeftEdge(a1)    mu_LeftEdge
  858.         clr.w    mu_TopEdge(a1)        mu_TopEdge
  859.  
  860.         move.w    #11,mu_Height(a1)    mu_Height
  861.         move.w    #MENUENABLED,mu_Flags(a1) mu_Flags
  862.         move.l    _INTalmnmuad(a5),a2
  863.         add.w    #mu_SIZEOF,a2
  864.         move.l    a2,mu_FirstItem(a1)    mu_FirstItem
  865.  
  866.         move.w    (a0)+,d2
  867. 101$        tst.w    d2
  868.         ble.s    110$            -> no special data
  869.         lea    _INTalmnmuspec(pc),a2
  870. 102$        move.w    (a0)+,d0
  871.         subq.w    #2,d2            decr special length
  872. 103$        move.w    (a2)+,d1        end of table?
  873.         beq.s    101$            -> get next spec cmd
  874.         cmp.w    d0,d1
  875.         bne.s    103$
  876.         lea    (_INTalmnmusidcs-_INTalmnmuspec-2)(a2),a2
  877.         moveq    #0,d0
  878.         move.b    (a2)+,d0        get offset
  879.         move.b    (a2)+,d1        get type (not unused any more)
  880.         bne.s    104$
  881.         move.w    (a0)+,d1        get special data
  882.         subq.w    #2,d2
  883.         move.w    d1,0(a1,d0.w)        put special info
  884.         bra.s    101$            get next spec data
  885. 104$        move.w    (a0)+,d1        get special data
  886.         subq.w    #2,d2
  887.         add.w    d1,0(a1,d0.w)        add special info (relative)
  888.         bra.s    101$
  889.  
  890. * PROCESS MenuName
  891.  
  892. 110$        move.l    _INTalmnmuad(a5),a2        get menu  address
  893.         move.l    a0,mu_MenuName(a2)        set menuname  ptr
  894.         push    a0-a2/d1            save the rgisters
  895.         lea    mu_SIZEOF(a1),a2        temp space for IT
  896.         move.l    a0,it_IText(a2)            set string pointr
  897.         move.l    a2,a0                set IntuiText ptr
  898.         lib    Intuition,IntuiTextLength    call IntuiTextLen
  899.         clr.l    it_IText(a2)            clear  work  area
  900.         pull    a0-a2/d1            restore registers
  901.         addq.w    #8,d0                greatr box
  902.         move.w    d0,mu_Width(a2)            store menu  width
  903.         add.w    #16,d0                space betw. menus
  904.         add.w    d0,_INTalmnmex(a5)        incr menu x coord
  905.         bsr    _INTalmn_skne            skip name & align
  906.         lea    mu_SIZEOF(a1),a1
  907.         bra    100$
  908.  
  909.  
  910. 200$        cmp.b    #2,d0
  911.         bne.s    300$
  912.  
  913. * PROCESS MENU ITEM
  914.  
  915.         move.l    _INTalmnmiad(a5),d0
  916.         beq.s    20$
  917.         move.l    d0,a2
  918.         move.l    a1,mi_NextItem(a2)        set pointer to this item
  919.  
  920. 20$        move.l    a1,_INTalmnmiad(a5)        start of this Item
  921.         move.w    _INTalmnity(a5),mi_TopEdge(a1)
  922.         move.w    _INTalmnlwid(a5),mi_Width(a1)
  923.         move.w    _INTalmnfohei(a5),mi_Height(a1)
  924.         move.w    #ITEMTEXT!ITEMENABLED!HIGHCOMP,d0
  925.         tst.b    (a0)
  926.         beq.s    23$
  927.         or.w    #COMMSEQ,d0
  928. 23$        move.w    d0,mi_Flags(a1)
  929.         move.b    (a0)+,mi_Command(a1)
  930.         lea    mi_SIZEOF(a1),a2
  931.         move.l    a2,mi_ItemFill(a1)
  932.  
  933.         bsr    _INTalmn_goops            copy IntuiText
  934.  
  935.         bsr    _INTalmn_hspec            process special information
  936.  
  937.         move.l    a0,(it_IText+mi_SIZEOF)(a1)    set string address
  938.         move.w    mi_Width(a1),_INTalmnlwid(a5)    get real width
  939.         move.w    mi_TopEdge(a1),d0
  940.         add.w    _INTalmnfohei(a5),d0
  941.         move.w    d0,_INTalmnity(a5)        get real Ycoord
  942.         move.w    mi_Width(a1),_INTalmnlswid(a5)    set subitem width
  943.         lea    (mi_SIZEOF+it_SIZEOF)(a1),a1
  944.         bsr    _INTalmn_skne            skip name and align
  945.         bra    100$
  946.  
  947.  
  948. * PROCESS SUBITEM
  949.  
  950. 300$        moveq.l    #2,d4                reset SubItem Y
  951.         move.l    _INTalmnmiad(a5),a2        get adr of Item
  952.         move.l    a1,mi_SubItem(a2)        set subitem ptr
  953. 399$        move.w    _INTalmnfohei(a5),mi_Height(a1)    set subm Y size
  954.         move.w    d4,mi_TopEdge(a1)        set sub Y coord
  955.         move.w    _INTalmnlswid(a5),mi_Width(a1)    set subm X size
  956.         move.w    _INTalmnlwid(a5),d0        get Xsz of Item 
  957.         subq.w    #8,d0                decr. RightEdge
  958.         move.w    d0,mi_LeftEdge(a1)        set sub X coord
  959.  
  960.         move.w    #ITEMTEXT!ITEMENABLED!HIGHCOMP,d0
  961.         tst.b    (a0)                see  if COMMSEQ
  962.         beq.s    33$                no, dont set it
  963.         or.w    #COMMSEQ,d0            yes,  set  flag
  964. 33$        move.w    d0,mi_Flags(a1)            set  sub  Flags
  965.         move.b    (a0)+,mi_Command(a1)        set command key
  966.         lea    mi_SIZEOF(a1),a2        get end of SItm
  967.         move.l    a2,mi_ItemFill(a1)        store IText ptr
  968.         bsr    _INTalmn_goops            copy  IntuiText
  969.         bsr    _INTalmn_hspec            sets spec. info
  970.  
  971.         move.l    a0,(it_IText+mi_SIZEOF)(a1)    set sub nameptr
  972.         move.w    mi_TopEdge(a1),d4        get real Ycoord
  973.         add.w    _INTalmnfohei(a5),d4        add font height
  974.         move.w    mi_Width(a1),_INTalmnlswid(a5)    get real  width
  975.         lea    (mi_SIZEOF+it_SIZEOF)(a1),a1    update dest ptr
  976.         bsr    _INTalmn_skne            skip name&align
  977.         cmpi.b    #3,(a0)+            another subitm?
  978.         bne.s    310$                no jump to main
  979.         move.l    a1,-(mi_SIZEOF+it_SIZEOF)(a1)    set next subptr
  980.         bra    399$                handle next sub
  981. 310$        subq.l    #1,a0                back to type id
  982.         bra    100$                return to  main
  983.  
  984.  
  985. _INTalmn_x    move.l    _INTalmnmem(a5),d0
  986.         move.l    d0,a0
  987.         unlk    a5
  988.         pull    a1-a4/a6/d1-d7
  989.         rts
  990.  
  991. _INTalmn_e    moveq    #0,d0
  992.         move.l    d0,a0
  993.         unlk    a5
  994.         pull    a1-a4/a6/d1-d7
  995.         rts
  996.  
  997.  
  998. _INTalmn_tab    dc.w    0,mu_SIZEOF,mi_SIZEOF+it_SIZEOF,mi_SIZEOF+it_SIZEOF
  999. _INTalmn_len    push    a0-a1/d1
  1000.         sub.l    a1,a1
  1001. 100$        moveq    #0,d0
  1002.         move.b    (a0)+,d0
  1003.         beq.s    _INTalmn_len_x
  1004.         add.w    d0,d0
  1005.         add.w    _INTalmn_tab(pc,d0.w),a1 add length
  1006.         addq.l    #1,a0            skip cmd key
  1007.         add.w    (a0)+,a0        skip special data
  1008. 101$        tst.b    (a0)+            skip name
  1009.         bne.s    101$
  1010.         addq.l    #1,a0
  1011.         move.l    a0,d1
  1012.         and.w    #$fffe,d1
  1013.         move.l    d1,a0
  1014.         bra.s    100$            process next menu
  1015. _INTalmn_len_x    move.l    a1,d0
  1016.         addq.l    #8,d0            for safety
  1017.         pull    a0-a1/d1
  1018.         rts
  1019.  
  1020.  
  1021. _INTalmn_goops    move.l    _INTalmnitext(a5),a2
  1022.         move.b    it_FrontPen(a2),(it_FrontPen+mi_SIZEOF)(a1)
  1023.         move.b    it_BackPen(a2),(it_BackPen+mi_SIZEOF)(a1)
  1024.         move.b    it_DrawMode(a2),(it_DrawMode+mi_SIZEOF)(a1)
  1025.         move.w    it_LeftEdge(a2),(it_LeftEdge+mi_SIZEOF)(a1)
  1026.         move.w    it_TopEdge(a2),(it_TopEdge+mi_SIZEOF)(a1)
  1027.         move.l    it_ITextFont(a2),(it_ITextFont+mi_SIZEOF)(a1)
  1028.         rts
  1029.  
  1030.  
  1031. _INTalmn_skne    tst.b    (a0)+
  1032.         bne.s    _INTalmn_skne
  1033.         move.l    a0,d0
  1034.         addq.l    #1,d0
  1035.         and.w    #$fffe,d0
  1036.         move.l    d0,a0
  1037.         rts
  1038.  
  1039.  
  1040. * HANDLE SPECIAL COMMANDS FOR ITEM AND SUBITEM
  1041.  
  1042. _INTalmn_hspec    move.w    (a0)+,d2
  1043. 701$        tst.w    d2
  1044.         ble.s    750$            -> no special data
  1045.         lea    _INTalmnmispec(pc),a2
  1046. 702$        move.w    (a0)+,d0
  1047.         subq.w    #2,d2            decr special length
  1048. 703$        move.w    (a2)+,d1        end of table?
  1049.         beq.s    701$            -> get next spec cmd
  1050.         cmp.w    d0,d1
  1051.         bne.s    703$
  1052.         lea    (_INTalmnmisidcs-_INTalmnmispec-2)(a2),a2
  1053.         moveq    #0,d0
  1054.         move.b    (a2)+,d0        get offset
  1055.         move.b    (a2)+,d1        get type
  1056.         bne.s    710$
  1057.         move.w    (a0)+,d1        get special data
  1058.         subq.w    #2,d2
  1059.         move.w    d1,0(a1,d0.w)        put special info
  1060.         bra.s    701$            get next spec data
  1061. 710$        cmp.b    #1,d1
  1062.         bne.s    720$
  1063.         move.l    (a0)+,d1        get special data
  1064.         subq.w    #4,d2
  1065.         move.l    d1,0(a1,d0.w)        put special info
  1066.         bra.s    701$            get next spec data
  1067. 720$        cmp.b    #2,d1
  1068.         bne.s    730$
  1069.         move.l    (a0)+,d1        get special data
  1070.         subq.w    #4,d2
  1071.         add.l    _INTalmna2base(a5),d1
  1072.         move.l    d1,0(a1,d0.w)        put special info
  1073.         bra.s    701$            get next spec data
  1074. 730$        cmp.b    #3,d1
  1075.         bne.s    751$
  1076.         tst.b    d0
  1077.         bne.s    740$
  1078.         move.l    _INTalmna4base(a5),a2
  1079.         add.w    (a0)+,a2        get special data
  1080.         subq.w    #2,d2
  1081.         move.l    a1,(a2)
  1082.         bra    701$            get next spec data
  1083. 740$        move.l    (a0)+,a2
  1084.         subq.w    #4,d2
  1085.         move.l    a1,(a2)
  1086.         bra    701$
  1087. 750$        rts
  1088. 751$        cmp.b    #4,d1
  1089.         bne.s    752$
  1090.         move.w    (a0)+,d1
  1091.         subq.w    #2,d2
  1092.         move.b    d1,0(a1,d0.w)
  1093.         bra    701$
  1094. 752$        move.w    (a0)+,d1        get special data
  1095.         subq.w    #2,d2
  1096.         add.w    d1,0(a1,d0.w)        add special info (relative)
  1097.         bra    701$            get next spec data
  1098.  
  1099. _INTalmnmuspec    dc.b    'MLMTMWMHMF',0,0
  1100. _INTalmnmusidcs    dc.b    mu_LeftEdge,5,mu_TopEdge,5,mu_Width,0,mu_Height,0
  1101.         dc.b    mu_Flags,0
  1102.  
  1103. _INTalmnmispec    dc.b    'ILITIWIHIFIMIIISTFTBTDTLTTTAAAAR',0,0
  1104. _INTalmnmisidcs    dc.b    mi_LeftEdge,5,mi_TopEdge,5,mi_Width,0,mi_Height,0
  1105.         dc.b    mi_Flags,0,mi_MutualExclude,1,mi_ItemFill,2
  1106.         dc.b    mi_SelectFill,2
  1107.         dc.b    mi_SIZEOF+it_FrontPen,4
  1108.         dc.b    mi_SIZEOF+it_BackPen,4
  1109.         dc.b    mi_SIZEOF+it_DrawMode,4
  1110.         dc.b    mi_SIZEOF+it_LeftEdge,5
  1111.         dc.b    mi_SIZEOF+it_TopEdge,5
  1112.         dc.b    mi_SIZEOF+it_ITextFont,2
  1113.         dc.b    1,3,0,3
  1114.  
  1115. ;0=short, 1=long, 2=aptr(a2), 3=AR (0) / AA (<>0), 4=byte, 5=rel.word
  1116.  
  1117.         endc
  1118.         endm
  1119.  
  1120.