home *** CD-ROM | disk | FTP | other *** search
File List | 1987-05-13 | 28.2 KB | 483 lines |
- ; TrackPopUp.a
- ; by Steve Brecher
- ; Copyright 1987 Software Supply
- ; All Publication Rights Reserved
- ; Permission is hereby granted to translate this source code work to
- ; computer-executable object or machine code and to distribute the translation
- ; without restriction. However, this work may not be published in printed
- ; form without express permission of the copyright holder.
- ; If this routine is incorporated in a software product, the author would
- ; appreciate (but does not require) credit where feasible.
-
- ; Set tabs to 10
-
- Load 'MacDefs.d' ;all of the Apple-supplied EQUates
-
- ; This code makes extensive use of "Pascal-ish" macros. The macros are
- ; identical to those which are supplied in the ProgStructMacs.a file that
- ; comes with MPW 2.0 (forthcoming as of May 1987) with a couple of exceptions:
- ; I use "Subr" instead of "Procedure"; and my version of the "Call" macro
- ; automatically generates an Import for any routine which is undefined.
- ; Refer to the MPW Asm listing output file to see the macro expansions.
- ; The Asm listing will also supply (in the object code portion) the values
- ; of symbols and that might not be defined in older EQUate files.
-
- Load 'SBMacs.d'
-
- ;
- ; function TrackPopUp(MHndl: MenuHandle;
- ; thePt: Point; {starting cursor location}
- ; crsrItem: integer; {item# of item to be initially under cursor}
- ; ): integer; {item# of selected item, 0 if none}
- ;
- ; Call this routine when the user clicks on something which should present a
- ; pop-up menu. Pass the global location of the click in thePt. If the menu is
- ; to be drawn such that the cursor is initially in the first item, pass 1 in
- ; crsrItem; if in the second item, pass 2, etc.
- ;
- ; Notes:
- ; --This code will work on all Macintosh products from 128K to Mac II, including
- ; Mac XL. If the large menu bar option is enabled with a Radius FPD, the
- ; pop up menu will use the special 16-point FPD font.
- ; --CalcMenuSize(MHndl) must have been called prior to calling TrackPopUp (it need be
- ; called only once at program startup if the items aren't changed).
- ; --PopUpMenuSelect is used only on a Mac II even if the trap is otherwise
- ; available. This is because PopUpMenuSelect is perceptibly slower than our
- ; own code when running on, e.g., a Mac Plus. PopUpMenuSelect is available
- ; on any Mac running System 4.1 or later; this routine can be shortened by
- ; about half if altered to assume the trap is always available.
- ; --The code tests for the existence of the PopUpMenuSelect trap and an
- ; up-to-date MDEF even when running on a Mac II, for historical reasons.
- ; --If there is insufficient memory to create a handle for saving the bits under
- ; the menu, MemErr will be set, no menu will display, and 0 will be returned.
- ; This doesn't apply when the _PopUpMenuSelect trap is used; the trap is smart
- ; enough to cause an update event for the area under the menu if it can't get
- ; RAM for saving the bits.
- ; --thePt is assumed to be on the main screen (i.e., within screenBits.bounds).
- ; --Menu edges are guaranteed to be at least 1 pixel from the sides of the screen
- ; and at least 2 pixels from the menu bar or bottom of the screen. The
- ; crsrItem argument will not be honored if the menu has to be moved up/down
- ; more than half an item in order fulfill the 2-pixel guarantee. The 2-pixel
- ; margin is necessary for compatibility with the PopUpMenuSelect trap.
-
- ; --The Control Panel setting for chosen item flashes is overridden by the
- ; following value if the Panel setting is larger. To honor the Panel setting,
- ; set the following value to 128.
- 0000 0080 MaxFlashes Equ 128 ;limit flashes of chosen item to this
-
- Export Function TrackPopup(MHndl:L, thePt: L, crsrItem):W
- 00000 2 TrackPopup FUNC Export
- 00000 2 SF#0002 RECORD {FramePtr},Decr
- 00000 2 TrackPopup DS.W 0
- FFFFC 3 MHndl DS.L 1
- FFFF8 3 thePt DS.L 1
- FFFF6 3 crsrItem DS.W 1
- FFFF2 2 RetAddr DS.L 1
- FFFF2 Var theBitMap:bitMapRec, SavePort:L, saveItem
- FFFEE 1 LinkA6 DS.L 1
- FFFEE FFEE 1 FramePtr EQU *
- FFFE0 2 theBitMap DS.B 1*14
- FFFDC 2 SavePort DS.L 1
- FFFDA 2 saveItem DS.W 1
- FFFDA Var ColorMenu, SaveRGBBackColor:6
- FFFD8 2 ColorMenu DS.W 1
- FFFD2 2 SaveRGBBackColor DS.B 1*6
- FFFD2 Begin Save=D3-D6/A2-A4
- FFFD2 1 LocalSize DS.W 0
- FFFD2 1 ENDR
- 00000 1 WITH SF#0002
- 00000 4E56 FFE4 1 LINK A6,#LocalSize
- 00004 A6 1 FP SET A6
- 00004 48E7 1E38 1 MOVEM.L D3-D6/A2-A4,-(A7)
- 00008
- 00008 ; This code will make use of an application global, MenuBarHt: integer, which
- 00008 ; contains the menu bar height. If the application does not supply such
- 00008 ; a global, comment out the following line, and conditional assembly directives
- 00008 ; below will adapt to its absence.
- 00008 Import MenuBarHt:Data ;remove if not available in appl globals
- 00008
- 00008 7800 MoveQ #0,D4
- 0000A 382D 0000 Move MenuBarHt(A5),D4
- 0000E 31C4 0A0A Move D4,TopMenuItem ;needed for new MDEF, doesn't hurt old
- 00012
- 00012 Call _GetPort(SavePort(FP):A)
- 00012 486E FFEE 1 PEA SavePort(FP)
- 00016 A874 1 _GetPort
- 00018 G 2478 09DE Move.L WmgrPort,A2
- 0001C Call _SetPort(A2:L)
- 0001C 2F0A 1 MOVE.L A2,-(A7)
- 0001E A873 1 _SetPort
- 00020
- 00020 Call FPDHndl ;Radius FPD info handle in A0 <> nil?
- 00020 1 Import FPDHndl
- 00020 4EBA 0000 1 JSR FPDHndl
- 00024 6722 00048 Beq.S CalcPos ;no
- 00026 G 2050 Move.L (A0),A0 ;yes...
- 00028 0828 0005 0001 Btst #5,1(A0) ;FPD big menu bar in use?
- 0002E 6718 00048 Beq.S CalcPos ;no
- 00030 Call SetFPD(#$0100) ;yes, set largeFontEnable:=true, dontReposition=false
- 00030 3F3C 0100 1 MOVE.W #$0100,-(A7)
- 00034 1 Import SetFPD
- 00034 4EBA 0000 1 JSR SetFPD
- 00038 357C 0010 004A Move #16,txSize(A2) ;use special 16 point Chicago
- 0003E 70FF MoveQ #-1,D0
- 00040 31C0 0988 Move D0,CurFMFamily ;invalidate FM cache...
- 00044 31C0 0BC6 Move D0,FONDID
- 00048
- 00048 CalcPos Call _CountMItems:W(MHndl(FP):L),D2
- 00048 554F 1 SUBQ.W #2,A7
- 0004A 2F2E 000E 1 MOVE.L MHndl(FP),-(A7)
- 0004E A950 1 _CountMItems
- 00050 341F 1 MOVE.W (A7)+,D2
- 00052 G 206E 000E Move.L MHndl(FP),A0
- 00056 G 2050 Move.L (A0),A0
- 00058 2228 0002 Move.L menuWidth(A0),D1 ;D1.hi=width, D1.lo=height
- 0005C 7000 MoveQ #0,D0
- 0005E 3001 Move D1,D0 ;height
- 00060 80C2 Divu D2,D0 ;height per item
- 00062 3600 Move D0,D3
- 00064 946E 0008 Sub crsrItem(FP),D2 ;number of items to be below cursor
- 00068 C0C2 Mulu D2,D0 ;height of items below cursor
- 0006A 3403 Move D3,D2
- 0006C E24A Lsr #1,D2 ;D2 = half of an item's height
- 0006E D042 Add D2,D0 ;height below cursor
- 00070 9240 Sub D0,D1 ;height above cursor
- 00072 7402 MoveQ #2,D2 ;const for later
- 00074 202E 000A Move.L thePt(FP),D0
- 00078 4840 Swap D0
- 0007A 9081 Sub.L D1,D0 ;left, top of rect
- 0007C 4840 Swap D0 ;top, left of rect
- 0007E 5040 AddQ #8,D0 ;shift it so cursor is 8 in from right
- 00080 B042 Cmp D2,D0 ;too far left? (min margin 1 to left of frame)
- 00082 6C02 00086 Bge.S @0 ;no
- 00084 3002 Move D2,D0 ;yes, shift it right: left=2, frame at 1
- 00086 47EE FFF8 @0 Lea theBitMap+bounds(FP),A3
- 0008A 90B8 0A02 Sub.L OneOne,D0 ;top left of frame
- 0008E 2680 Move.L D0,(A3)
- 00090 2228 0002 Move.L menuWidth(A0),D1
- 00094 4841 Swap D1 ;height, width
- 00096 G 0681 0003 000B Add.L #$30003+8,D1 ;height, width incl. frame & shadow
- 0009C ;and extra right margin for balance
- 0009C D081 Add.L D1,D0 ;bot,right of shadow
- 0009E G 2055 Move.L (A5),A0
- 000A0 2428 FF90 Move.L screenBits+bounds+botRight(A0),D2
- 000A4 5542 SubQ #2,D2
- 000A6 9440 Sub D0,D2 ;margin of at least 1 to right?
- 000A8 6A06 000B0 Bpl.S @1 ;yes
- 000AA D042 Add D2,D0 ;no, move left...
- 000AC D56B 0002 Add D2,left(A3)
- 000B0 4842 @1 Swap D2 ;screenBits.bounds.bottom
- 000B2 5742 SubQ #3,D2
- 000B4 4840 Swap D0 ;right, bot of frame
- 000B6 9440 Sub D0,D2 ;margin of at least 2 on bottom?
- 000B8 6A04 000BE Bpl.S @2 ;yes
- 000BA D042 Add D2,D0 ;no, move up...
- 000BC D553 Add D2,top(A3)
- 000BE 4840 @2 Swap D0
- 000C0 2740 0004 Move.L D0,botRight(A3) ;bot, right of shadow
- 000C4 342D 0000 Move MenuBarHt(A5),D2
- 000C8 5442 AddQ #2,D2
- 000CA 9453 Sub top(A3),D2 ;too high?
- 000CC 6F06 000D4 Ble.S @3 ;no, ok
- 000CE D553 Add D2,top(A3) ;yes, move down
- 000D0 D56B 0004 Add D2,bottom(A3)
- 000D4
- 000D4 G 0C78 3FFF 028E @3 Cmp #$3FFF,ROM85 ;Mac II or later?
- 000DA 53EE FFEA Sls ColorMenu(A6) ;tentatively, true if color Mac
- 000DE 625E 0013E Bhi.S @5 ;earlier than Mac II
- 000E0 303C 009F Move #$9F,D0 ;unimplemented core routine
- 000E4 A746 _GetTrapAddress NewTool
- 000E6 G 2248 Move.L A0,A1
- 000E8 700B MoveQ #$0B,D0
- 000EA A746 _GetTrapAddress NewTool ;_PopUpMenuSelect installed?
- 000EC G B3C8 Cmp.L A0,A1
- 000EE 674E 0013E Beq.S @5 ;no
- 000F0 6100 01E0 002D2 Bsr MDEFHandle
- 000F4 G 2050 Move.L (A0),A0
- 000F6 G 0C68 000A 000A Cmp #10,10(A0) ;got the right MDEF for PopUpMenuSelect?
- 000FC G 6540 0013E Blo.S @5 ;no
- 000FE 594F SubQ #4,SP ;yes, use _PopUpMenuSelect; result space
- 00100 Push.L MHndl(FP)
- 00100 2F2E 000E 1 Move.L MHndl(FP),-(SP)
- 00104 Call _InsertMenu((SP):L, #-1) ;must be "hierarchical"
- 00104 2F17 1 MOVE.L (SP),-(A7)
- 00106 3F3C FFFF 1 MOVE.W #-1,-(A7)
- 0010A A935 1 _InsertMenu
- 0010C 7401 MoveQ #1,D2
- 0010E D453 Add top(A3),D2 ;top excl frame
- 00110 302E 000A Move thePt+v(FP),D0
- 00114 9042 Sub D2,D0 ;height above cursor
- 00116 48C0 Ext.L D0
- 00118 80C3 Divu D3,D0 ;items above one cursor is to be in
- 0011A 3200 Move D0,D1
- 0011C C0C3 Mulu D3,D0 ;height above top of cursor's item
- 0011E D042 Add D2,D0 ;top of cursor's item
- 00120 Push D0
- 00120 3F00 1 Move.W D0,-(SP)
- 00122 Push left(A3)
- 00122 3F2B 0002 1 Move.W left(A3),-(SP)
- 00126 5257 AddQ #1,(SP) ;excl frame
- 00128 5241 AddQ #1,D1
- 0012A Push D1 ;cursor's item
- 0012A 3F01 1 Move.W D1,-(SP)
- 0012C A80B _PopUpMenuSelect
- 0012E Pop TrackPopUp(FP)
- 0012E 3D5F 0012 1 Move.W (SP)+,TrackPopUp(FP)
- 00132 Pop A0
- 00132 G 305F 1 Move.W (SP)+,A0
- 00134 6704 0013A Beq.S @4
- 00136 3D48 0012 Move A0,TrackPopUp(FP)
- 0013A 6000 015A 00296 @4 Bra Done
- 0013E
- 0013E 426E 0012 @5 Clr TrackPopUp(FP)
- 00142 G 0641 000F Add #15,D1 ;calc shadowed rowbytes...
- 00146 E849 Lsr #4,D1
- 00148 D241 Add D1,D1
- 0014A 3001 Move D1,D0 ;D0 = rowbytes
- 0014C 3740 FFFE Move D0,rowBytes-bounds(A3)
- 00150 4841 Swap D1 ;D1 = height
- 00152 C0C1 Mulu D1,D0 ;byte size
- 00154 A122 _NewHandle ;get handle for saved bits
- 00156 6600 0128 00280 Bne RstFPD ;whoops
- 0015A Push.L A0 ;save handle on stack for later
- 0015A 2F08 1 Move.L A0,-(SP)
- 0015C 2750 FFFA Move.L (A0),baseAddr-bounds(A3) ;save the pixels in the menu's area...
- 00160 Call _CopyBits(portBits(A2):A, baseAddr-bounds(A3):A, A3:L, A3:L, #srcCopy, #0:L)
- 00160 486A 0002 1 PEA portBits(A2)
- 00164 486B FFFA 1 PEA baseAddr-bounds(A3)
- 00168 2F0B 1 MOVE.L A3,-(A7)
- 0016A 2F0B 1 MOVE.L A3,-(A7)
- 0016C G 4267 1 MOVE.W #srcCopy,-(A7)
- 0016E G 42A7 1 MOVE.L #0,-(A7)
- 00170 A8EC 1 _CopyBits
- 00172
- 00172 4A2E FFEA Tst.B ColorMenu(FP) ;color Mac?
- 00176 6724 0019C Beq.S @7 ;no
- 00178 Call _GetMCEntry:L(#0:L),D3 ;color menu?
- 00178 594F 1 SUBQ.W #4,A7
- 0017A G 42A7 1 MOVE.L #0,-(A7)
- 0017C AA64 1 _GetMCEntry
- 0017E 261F 1 MOVE.L (A7)+,D3
- 00180 56EE FFEA Sne ColorMenu(FP) ;remember to restore backcolor if so
- 00184 6716 0019C Beq.S @7 ;no
- 00186 G 2478 0D2C Move.L WMgrCPort,A2 ;yes, use color WMgrPort for drawing
- 0018A Call _SetPort(A2:L)
- 0018A 2F0A 1 MOVE.L A2,-(A7)
- 0018C A873 1 _SetPort
- 0018E Call _GetBackColor(SaveRGBBackColor(FP):A) ;save old backcolor
- 0018E 486E FFE4 1 PEA SaveRGBBackColor(FP)
- 00192 AA1A 1 _GetBackColor
- 00194 G 2043 Move.L D3,A0 ;menu color table's menubar entry
- 00196 Call _RGBBackColor(mctRGB2(A0):A)
- 00196 4868 000A 1 PEA mctRGB2(A0)
- 0019A AA15 1 _RGBBackColor
- 0019C
- 0019C @7 Call _ClipRect(portRect(A2):A)
- 0019C 486A 0010 1 PEA portRect(A2)
- 001A0 A87B 1 _ClipRect
- 001A2 2638 0A02 Move.L OneOne,D3
- 001A6 97AB 0004 Sub.L D3,botRight(A3) ;rect sans shadow
- 001AA Call _EraseRect(A3:L)
- 001AA 2F0B 1 MOVE.L A3,-(A7)
- 001AC A8A3 1 _EraseRect
- 001AE Call _FrameRect(A3:L)
- 001AE 2F0B 1 MOVE.L A3,-(A7)
- 001B0 A8A1 1 _FrameRect
- 001B2 Push right(A3) ;draw shadow...
- 001B2 3F2B 0006 1 Move.W right(A3),-(SP)
- 001B6 Push top(A3)
- 001B6 3F13 1 Move.W top(A3),-(SP)
- 001B8 5657 AddQ #3,(SP)
- 001BA Push.L botRight(A3)
- 001BA 2F2B 0004 1 Move.L botRight(A3),-(SP)
- 001BE Push left(A3)
- 001BE 3F2B 0002 1 Move.W left(A3),-(SP)
- 001C2 5657 AddQ #3,(SP)
- 001C4 Push bottom(A3)
- 001C4 3F2B 0004 1 Move.W bottom(A3),-(SP)
- 001C8 A893 _MoveTo
- 001CA A891 _LineTo
- 001CC A891 _LineTo
- 001CE Call _InsetRect(A3:L, D3:L) ;rect sans frame
- 001CE 2F0B 1 MOVE.L A3,-(A7)
- 001D0 2F03 1 MOVE.L D3,-(A7)
- 001D2 A8A9 1 _InsetRect
- 001D4
- 001D4 9853 Sub top(A3),D4 ;D4 = -(dist from top of popup to menu bar)
- 001D6 4844 Swap D4
- 001D8 Call _SetOrigin(D4:L) ;fool MDEF, which draws top at v=menubar ht
- 001D8 2F04 1 MOVE.L D4,-(A7)
- 001DA A878 1 _SetOrigin
- 001DC Call _OffsetRect(A3:L, D4:L) ;and adjust our rect accordingly
- 001DC 2F0B 1 MOVE.L A3,-(A7)
- 001DE 2F04 1 MOVE.L D4,-(A7)
- 001E0 A8A8 1 _OffsetRect
- 001E2 Call _ClipRect(A3:L) ;clip to inside of frame
- 001E2 2F0B 1 MOVE.L A3,-(A7)
- 001E4 A87B 1 _ClipRect
- 001E6
- 001E6 7000 MoveQ #mDrawMsg,D0 ;draw the items
- 001E8 6100 00CC 002B6 Bsr CallMDEF
- 001EC
- 001EC TrackIt: Call _GetMouse(thePt(FP):A)
- 001EC 486E 000A 1 PEA thePt(FP)
- 001F0 A972 1 _GetMouse
- 001F2 7001 MoveQ #mChooseMsg,D0
- 001F4 6100 00C0 002B6 Bsr CallMDEF
- 001F8 Call _WaitMouseUp:B(),CC
- 001F8 554F 1 SUBQ.W #2,A7
- 001FA A977 1 _WaitMouseUp
- 001FC 4A1F 1 TST.B (A7)+
- 001FE 66EC 001EC Bne.S TrackIt
- 00200
- 00200 3D6E 0012 FFEC MouseUp: Move TrackPopUp(FP),saveItem(FP)
- 00206 672E 00236 Beq.S NoFlash
- 00208 3838 0A24 Move menuFlash,D4
- 0020C 6728 00236 Beq.S NoFlash
- 0020E 2A2E 000A Move.L thePt(FP),D5
- 00212 5344 SubQ #1,D4 ;adjust menu flash for DBra
- 00214 G 0C44 007F Cmp #MaxFlashes-1,D4 ;limit per EQU (after Dbra adjust)
- 00218 6302 0021C Bls.S @0
- 0021A 787F MoveQ #MaxFlashes-1,D4
- 0021C 42AE 000A @0 Clr.L thePt(FP)
- 00220 6100 0088 002AA Bsr Flasher
- 00224 2D45 000A Move.L D5,thePt(FP)
- 00228 6100 0080 002AA Bsr Flasher
- 0022C G 51CC FFEE 0021C Dbra D4,@0
- 00230 3D6E FFEC 0012 Move saveItem(FP),TrackPopUp(FP)
- 00236
- 00236 NoFlash: Call _SetOrigin(#0:L) ;restore WMgr(C)Port's origin
- 00236 G 42A7 1 MOVE.L #0,-(A7)
- 00238 A878 1 _SetOrigin
- 0023A Call _ClipRect(portRect(A2):A) ;and restore its clipRgn
- 0023A 486A 0010 1 PEA portRect(A2)
- 0023E A87B 1 _ClipRect
- 00240 4244 Clr D4
- 00242 4484 Neg.L D4
- 00244 Call _OffsetRect(A3:L, D4:L) ;restore rect to 0-origin basis
- 00244 2F0B 1 MOVE.L A3,-(A7)
- 00246 2F04 1 MOVE.L D4,-(A7)
- 00248 A8A8 1 _OffsetRect
- 0024A Call _InsetRect(A3:L, #-1:D0) ;restore bits, incl frame
- 0024A 2F0B 1 MOVE.L A3,-(A7)
- 0024C 70FF 1 MOVEQ #-1,D0
- 0024E 2F00 1 MOVE.L D0,-(A7)
- 00250 A8A9 1 _InsetRect
- 00252 D7AB 0004 Add.L D3,botRight(A3) ;and incl shadow
- 00256 4A2E FFEA Tst.B ColorMenu(FP) ;restore back color if we changed it...
- 0025A 670E 0026A Beq.S @0
- 0025C Call _RGBBackColor(SaveRGBBackColor(FP):A)
- 0025C 486E FFE4 1 PEA SaveRGBBackColor(FP)
- 00260 AA15 1 _RGBBackColor
- 00262 G 2478 09DE Move.L WMgrPort,A2 ;revert to old style port for CopyBits
- 00266 Call _SetPort(A2:L)
- 00266 2F0A 1 MOVE.L A2,-(A7)
- 00268 A873 1 _SetPort
- 0026A @0 Call _CopyBits(baseAddr-bounds(A3):A, portBits(A2):A, A3:L, A3:L, #srcCopy, #0:L)
- 0026A 486B FFFA 1 PEA baseAddr-bounds(A3)
- 0026E 486A 0002 1 PEA portBits(A2)
- 00272 2F0B 1 MOVE.L A3,-(A7)
- 00274 2F0B 1 MOVE.L A3,-(A7)
- 00276 G 4267 1 MOVE.W #srcCopy,-(A7)
- 00278 G 42A7 1 MOVE.L #0,-(A7)
- 0027A A8EC 1 _CopyBits
- 0027C Pop.L A0 ;bits handle
- 0027C G 205F 1 Move.L (SP)+,A0
- 0027E A023 _DisposHandle
- 00280
- 00280 RstFPD: Call SetFPD(#0) ;if FPD, largeFontEnable := false
- 00280 G 4267 1 MOVE.W #0,-(A7)
- 00282 4EBA 0000 1 JSR SetFPD
- 00286 670E 00296 Beq.S Done ;no FPD
- 00288 426A 004A Clr txSize(A2) ;must clear after DisposHandle if FPD
- 0028C 70FF MoveQ #-1,D0
- 0028E 31C0 0988 Move D0,CurFMFamily ;invalidate FM cache...
- 00292 31C0 0BC6 Move D0,FONDID
- 00296
- 00296 Done: Call _SetPort(savePort(FP):L) ;restore port
- 00296 2F2E FFEE 1 MOVE.L savePort(FP),-(A7)
- 0029A A873 1 _SetPort
- 0029C Return
- 0029C 4CDF 1C78 1 MOVEM.L (A7)+,D3-D6/A2-A4
- 002A0 4E5E 1 UNLK A6
- 002A2 205F 1 MOVEA.L (A7)+,A0
- 002A4 4FEF 000A 1 LEA 10(A7),A7
- 002A8 4ED0 1 JMP (A0)
- 002AA 1
- 002AA
- 002AA 7001 Flasher MoveQ #mChooseMsg,D0
- 002AC 6108 002B6 Bsr.S CallMDEF
- 002AE G 307C 0003 Move #3,A0
- 002B2 A03B _Delay
- 002B4 4E75 Rts
- 002B6
- 002B6 CallMDEF: Push D0 ;msg
- 002B6 3F00 1 Move.W D0,-(SP)
- 002B8 6118 002D2 Bsr.S MDefHandle ;A0 = MDEF Handle, A1 = MenuHandle
- 002BA A029 _HLock
- 002BC G 2050 Move.L (A0),A0
- 002BE Push.L A1 ;menu handle
- 002BE 2F09 1 Move.L A1,-(SP)
- 002C0 Push.L A3 ;rect
- 002C0 2F0B 1 Move.L A3,-(SP)
- 002C2 Push.L thePt(FP)
- 002C2 2F2E 000A 1 Move.L thePt(FP),-(SP)
- 002C6 486E 0012 Pea TrackPopUp(FP)
- 002CA 4E90 Jsr (A0)
- 002CC 6104 002D2 Bsr.S MDefHandle
- 002CE A02A _HUnlock
- 002D0 4E75 Rts
- 002D2
- 002D2 MDefHandle:
- 002D2 G 226E 000E Move.L MHndl(FP),A1
- 002D6 G 2051 Move.L (A1),A0
- 002D8 G 2068 0006 Move.L menuDefHandle(A0),A0
- 002DC 4E75 Rts
- 002DE
- 002DE EndP
-
- 00000 FPDHndl Proc Export ;sets A0 = Radius INFO handle, CCR Z flag reflects
- 00000
- 00000 Call _GetNamedResource:L(#'INFO':L, FPDName:A),D0
- 00000 594F 1 SUBQ.W #4,A7
- 00002 2F3C 494E 464F 1 MOVE.L #'INFO',-(A7)
- 00008 487A 0032 0003C 1 PEA FPDName
- 0000C A9A1 1 _GetNamedResource
- 0000E 201F 1 MOVE.L (A7)+,D0
- 00010 G 2040 Move.L D0,A0
- 00012 4E75 Rts
- 00014
- 00014 0000 0014 Export SetFPD
- 00014
- 00014 ; Procedure SetFPD(Bytes4And5: integer)
- 00014 ; if FPD exists, set values of byte 4 = largeFontEnable and byte 5 = dontReposition
- 00014 ; Sets Z flag if no FPD (Beq NoFPD)
- 00014
- 00014 61EA 00000 SetFPD: Bsr.S FPDHndl
- 00016 671E 00036 Beq.S @0
- 00018 Push.L A0
- 00018 2F08 1 Move.L A0,-(SP)
- 0001A G 2050 Move.L (A0),A0
- 0001C 316F 0008 0004 Move 4+4(SP),4(A0)
- 00022 42A8 0006 Clr.L 6(A0) ;always use FPD default cursor routine
- 00026 Push.L #'INFO'
- 00026 2F3C 494E 464F 1 Move.L #'INFO',-(SP)
- 0002C Push0
- 0002C 4267 1 Clr.W -(SP)
- 0002E 487A 000C 0003C Pea FPDName
- 00032 A9AB _AddResource
- 00034 70FF MoveQ #-1,D0 ;clear Z flag
- 00036 @0 Pop.L A0
- 00036 G 205F 1 Move.L (SP)+,A0
- 00038 544F AddQ #2,SP
- 0003A 4ED0 Jmp (A0)
- 0003C
- 0003C String Pascal
- 0003C 0E526164697573 FPDName: DC.B 'Radius Display'
- 0004B
- 0004B End
-
- Elapsed time: 32.35 seconds.
-
- Assembly complete - no errors found. 3145 lines.
-