Home » Archimedes archive » Micro User » MU 1991-03.adf » PD-Stuff » Utilities/Bins/!Trash/source_arc/TrashSrc

Utilities/Bins/!Trash/source_arc/TrashSrc

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Micro User » MU 1991-03.adf » PD-Stuff
Filename: Utilities/Bins/!Trash/source_arc/TrashSrc
Read OK:
File size: 15919 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >$.!Trash.TrashSrc
   20
   30REM RISC OS Trash Can Module V1.40 (C) Richard K. Lloyd 1990
   40
   50REM This source code is released into the Public Domain for anyone to
   60REM use, although some credit in your source might be nice...
   70
   80REM Special thanks to:
   90REM - Philip Colmer (PColmer@uk.co.acorn) for suggestions
  100REM - Rabin Ezra (rabin@uk.ac.qmc.cs) for bug fixes
  110REM - David Pilling (mcbmsdp@uk.ac.mcc.cms) for a beta-test Spark 2.00
  120REM - Gary Bartlett () for the Trash Van inspiration and sprites
  130REM - Me (rkl@uk.ac.liv.cs.and) for filling a gaping hole in the Desktop
  140
  150REM Volume/page references are for the RISC OS Issue 1 (1989)
  160REM 4-volume Programmer's Reference Manuals.
  170
  180REM Version 1.40 Released September 1990
  190REM - Context-sensitive !Help information provided.
  200REM - "Persistent" menu if right button pressed on a menu item.
  210REM - New sprites with a Spark-like "flash" - shown if Spark installed.
  220REM - Now "Spark-aware" regardless of installation order.
  230REM - Incorrect border flash when clicking instead of dragging now fixed.
  240
  250REM Version 1.30 Released July 1990
  260REM - Configuration of new menu options (see below) stored in CMOS RAM.
  270REM - 'Immediate' menu option to erase files straight away on a trashing.
  280REM - 'Warning' menu option to turn the border red during dangerous ops.
  290REM - 'Animation' menu option to show an icon bar Van during deletion.
  300REM - New VanSprites file (and code to handle it) for above animation.
  310REM - Fixed Info template workspace fault (force reload after Temp Quit).
  320REM - Auto-time/datestamp updating of Info window without using !Formed.
  330REM - Added, ahem, a "debug%" flag for window/icon handle display.
  340REM - 'Immediate' mode now accidentally simulates the behaviour of an
  350REM   Atari ST trash can ! In other words, no fat icon, no Trash Window,
  360REM   no retention of trashed files in Trash$Dir. Pretty rubbish (!) eh ?
  370
  380REM Version 1.20 Released January 1990
  390REM - Report errors if any occur during the trashing/emptying processes.
  400REM - Switch on hourglass if trashing takes longer than 1 second.
  410REM - Supports file trashing from inside archives using Spark 2.xx.
  420REM - Displays an error if *Desktop_TrashCan issued outside the Desktop.
  430
  440REM Version 1.11 Released November 1989 (2 days after V1.10 !)
  450REM - Fixed *fatal* bug with V1.10 Info menu item.
  460REM - Slightly re-coded Quit menu parsing.
  470REM - Adjusted menu widths and heights (Philip Colmer).
  480REM - Allowed Info window to be dragged (Philip Colmer).
  490
  500REM Version 1.10 Released November 1989
  510REM - Enhancements by Philip Colmer from 1.02a:
  520REM   - Third sprite added to overcome trash can 'love-handles' in Filer.
  530REM   - Correction of icon bar parameter block (wildly wrong in 1.02).
  540REM   - Hard-coded Info window replaces cheap sub-menu Info.
  550REM - Enhancements by RKL on top of this:
  560REM   - Uses Templates for Info window (boy, do I hate !FormEd...).
  570REM   - New Temporary/Permanent Quit menu option.
  580REM   - Claims RMA during module life for internal workspace.
  590REM   - Set TrashWork$Dir to <Obey$Dir> in !Run (template/sprites dir).
  600REM   - Performs internal *IconSprites call (Wimp_SpriteOp 11).
  610
  620REM Version 1.02a - not released (Modifications by Philip Colmer)
  630
  640REM Version 1.02 Released November 1989
  650REM - Had to redefine !Trash sprite because of Wimp_SetIconState.
  660REM - Bug fixes (including code) by Rabin Ezra:
  670REM   - Extended Trash$Dir buffer to 64 chars.
  680REM   - Checked for Trash$Dir expansion buffer overflow.
  690REM   - Zero-terminated the Trash$Dir expansion.
  700REM - Improvement suggestions (with coding hints) by Philip Colmer:
  710REM   - Moved Trash Can icon to left side of icon bar.
  720REM   - Improved filing system activity trapping.
  730REM   - Stopped annoying icon bar "icon shuffling".
  740
  750REM Version 1.01 Released July 1989
  760REM - Fixed rename inconsistency.
  770REM - Added Wimp_Poll message acknowledgement.
  780REM - Extended maximum length of expanded Trash$Dir to 48 chars.
  790REM - Set Trash$Dir to <Obey$Dir>.Trash in !Run.
  800REM - Posted with Acorn's "official" uuencode to avoid IBM munging.
  810
  820REM Version 1.00 Released July 1989
  830REM - Mac-style trash can with Mac-style icons (ResEdit was useful !).
  840REM - Survives anything except hard reset, module kill or power off.
  850
  860REM Check out the Indigo Girls' eponymously-titled album (on CD):
  870REM great acoustic guitar harmonies - reached US #22 (sadly nowhere in UK)
  880REM RKL's Best Album Of 1989: Diesel Park West's "Shakespeare Alabama" CD.
  890REM RKL's Best Albums Of 1990 so far:
  900REM All those Beach Boys 2-for-1 CD reissues - great stuff !
  910
  920DIM org &2000:REM Plenty of assembly space
  930
  940REM Application constants
  950
  960prog$="Trash Can":REM English text name of module
  970ver$="1.40":REM Version number of module in X.YY format
  980REM Change next line to date$=MID$(TIME$,5,11) to get the current date
  990date$="10 Sep 1990":REM Current date as a fixed string
 1000resdate$=LEFT$(date$,2)+"-"+MID$(date$,4,3)+"-"+RIGHT$(date$,2)
 1010resdate$=ver$+" ("+resdate$+")":REM Version/date for Info Template
 1020command$="Desktop_TrashCan":REM * command implemented
 1030trashvar$="Trash$Dir":REM Trash can environmental variable
 1040wimp$="Wimp$Scrap":REM Wimp temporary file environmental variable
 1050maxpathlen%=64:REM Maximum length of expanded Trash$Dir (inc. terminator)
 1060iconbartype%=-2:REM -1 = Utility (RHS of bar), -2 = Service (LHS of bar)
 1070windman%=200:REM Expect at LEAST V2.00 of the Window Manager
 1080stackspace%=&800:REM 2K for internal RMA stack and template workspace
 1090windowspace%=&800:REM 2K for Wimp_GetWindowInfo / Wimp_TransferBlock
 1100spritespace%=3*1024:REM 3K for sprite user area
 1110sparkdel$="!spark -d ":REM Spark command to delete a file inside archive
 1120battery%=38:REM CMOS RAM location used to store settings
 1130debug%=FALSE:REM So-called debugging - prints window/icon handle
 1140
 1150REM Time for some constants to help the reader
 1160
 1170bl$=CHR$(0):REM NULL char used to terminate strings
 1180cr$=CHR$(13):REM Plain CR
 1190UpCallV=&1D:REM Warning vector for FS change check
 1200XOS_WriteI=&20100:REM X SWI form of OS_WriteI (used for VDU 7). I-199
 1210
 1220Service_Reset      =&27:REM End of machine reset signalled
 1230Service_StartWimp  =&49:REM Request by Desktop to start WIMP modules
 1240Service_StartedWimp=&4A:REM Desktop indicates all tasks now active
 1250
 1260FOR A%=0 TO 2 STEP 2
 1270P%=org
 1280[OPT A%
 1290
 1300; Note that the module header must contain ADDRESS OFFSETS from the
 1310; start of the module, hence a subtraction of org is required. II-628
 1320
 1330                EQUD    appstart-org      ; Application start addr
 1340                EQUD    init-org          ; Initialisation addr
 1350                EQUD    byebye-org        ; Finalisation addr
 1360                EQUD    servicecall-org   ; Service call handler addr
 1370                EQUD    titlestr-org      ; Module title string addr
 1380                EQUD    helpstr-org       ; Help string addr
 1390                EQUD    keywords-org      ; Command/help table addr
 1400                EQUD    0                 ; No extra SWIs...
 1410                EQUD    0                 ; What do you want ?
 1420                EQUD    0                 ; Blood ?
 1430                EQUD    0                 ; Well hard luck...
 1440
 1450; Title string to be used by *Modules and when *RMKilling etc. II-635
 1460; Due to the way *Help works in RISC OS, avoid calling the module the
 1470; same name as one of its * commands (I've been guilty of this ...!).
 1480
 1490.titlestr       EQUS    "TrashCan"+bl$
 1500                ALIGN
 1510
 1520; Help string to be used in *Help Modules etc. II-635
 1530; Note the tab character as recommended by Acorn. A second tab
 1540; character will be needed if prog$ is < 8 characters (unlikely !).
 1550
 1560.helpstr        EQUS prog$+CHR$(9)+ver$+" ("+date$+")"+bl$
 1570                ALIGN
 1580
 1590; Keyword lookup table for *Help and command execution. II-636
 1600; Any addresses should, as usual, be offsets from the module start.
 1610; Note- Modules that multi-task under the Wimp MUST have a startup
 1620;       * command because of the way Start_WimpTask is called when
 1630;       the Desktop first starts up.
 1640
 1650.keywords
 1660.startupname    EQUS    command$+bl$    ; * command name
 1670                ALIGN                   ; MUST include an ALIGN
 1680                EQUD    startupcomm-org ; TrashCan exec addr OFFSET
 1690                EQUB    0               ; Minimum params = 0
 1700                EQUB    %00000000       ; No OS_GSTrans peformed
 1710                EQUB    0               ; Maximum params = 0
 1720                EQUB    %00000000       ; No *Conf or special *Help code
 1730                EQUD    noparams-org    ; Special params message OFFSET
 1740                EQUD    startuphelp-org ; * command help text OFFSET
 1750                EQUD    0               ; No more * commands
 1760
 1770; If any parameters supplied, then complain. In actual fact, this message
 1780; is displayed if params<min or params>max (just that min=max=0 here).
 1790
 1800.noparams       EQUS    "Syntax: *"+command$+bl$
 1810                ALIGN
 1820
 1830; *Help text goes here. Avoid CHR$(13) or CHR$(10) unless absolutely
 1840; necessary (usually to split the *Syntax message from the rest),
 1850; because this text is OS_PrettyPrinted. Hard spaces = CHR$(31).
 1860
 1870.startuphelp    EQUS    "The "+prog$+" utility provides a trash can icon on the icon bar, and uses "
 1880                EQUS    "the Filer to display the trash can contents."+cr$+CHR$(10)+"Do not use *"+command$+", use *Desktop instead."+bl$
 1890                ALIGN
 1900
 1910; PHEW ! Now let's get down to some coding...
 1920
 1930.internalreset
 1940
 1950; An internal task variable is set to zero (not running) on execution
 1960; of the Initialisation code, at the end of a machine (soft !) reset or
 1970; when an old task is shutdown (to prevent duplication).
 1980
 1990                STMFD   R13!,{R0,R14}
 2000                MOV     R0,#0
 2010                STR     R0,taskhandle   ; Task not running, not claimed
 2020                STR     R0,sparktaskhand; Don't know about Spark yet
 2030                STR     R0,sparkwindhand; or the window involved
 2040                STRB    R0,glassstat    ; Hourglass is off
 2050                LDMFD   R13!,{R0,PC}
 2060
 2070.servicecall
 2080
 2090; The location 'taskhandle' holds the state of the task:
 2100; 0  = Not running, waiting to claim Service_StartWimp
 2110; -1 = Not running, claimed Service_StartWimp, waiting for * command
 2120; >0 = Running, value set to Wimp_Initialise returned task handle
 2130
 2140; The Service_Reset signal (Service Call &27) is the ONLY way (I know..)
 2150; to execute module code at the end of a machine reset. I use this to
 2160; shutdown the task if still active.
 2170; II-681 ---> DOESN'T TELL YOU to refer to III-1161
 2180
 2190                CMP     R1,#Service_Reset       ; End of machine reset ?
 2200                BEQ     init                    ; Yes, so restart
 2210
 2220; The very first thing that the Desktop does after a Wimp_Initialise
 2230; is to signal Service_StartWimp (Service Call &49) to every module.
 2240; Those that are interested in being trendy (OK, multi-tasking), claim
 2250; that service call IF THEY ARE NOT ALREADY RUNNING and, of course,
 2260; haven't already received and claimed a Service_StartWimp.
 2270; II-701 ---> annoyingly referring to the rough 'Window Manager' chapter
 2280;             (turns out, after much page scanning, to be III-1159)
 2290
 2300                CMP     R1,#Service_StartWimp   ; Are we firing up the
 2310                BEQ     round1                  ; Desktop ?
 2320
 2330; Once everyone's responded to Service_StartWimp who wants to, a
 2340; 'final chance' is sent around - Service_StartedWimp (&4A).
 2350; II-702 ---> annoyingly (vaguely, like above) referring to III-1161
 2360
 2370                CMP     R1,#Service_StartedWimp ; Round 2 of Desktop
 2380                BEQ     round2
 2390
 2400                MOV     PC,R14          ; Not interested in any of them
 2410
 2420.round1         STMFD   R13!,{R2,R14}
 2430                LDR     R2,taskhandle
 2440                MOVS    R2,R2                   ; Is taskhandle = 0 ?
 2450                MVNEQ   R2,#0                   ; Yes, so taskhandle = -1
 2460                STREQ   R2,taskhandle
 2470; Claim the Service Call because not running and not prev. claimed it
 2480                ADREQ   R0,startupname          ; => *Desktop_Trashcan
 2490                MOVEQ   R1,#0                   ; Claim the call
 2500                LDMFD   R13!,{R2,PC}
 2510
 2520.round2
 2530
 2540; Since the * command may have failed, the task handle should be
 2550; set to 0 if it's still stuck at -1.
 2560
 2570                STMFD   R13!,{R2,R14}
 2580                LDR     R2,taskhandle
 2590                MOVS    R2,R2                   ; Is taskhandle = -1 ?
 2600                MOVMI   R2,#0                   ; Stuck, so unstick !
 2610                STRMI   R2,taskhandle
 2620                LDMFD   R13!,{R2,PC}
 2630
 2640.claimRMA
 2650
 2660; On entry,     R3      = RMA space required
 2670; On exit,      R2      = Pointer to claimed space
 2680
 2690                STMFD   R13!,{R0,R14}
 2700                MOV     R0,#6           ; Claim RMA
 2710.joinclaim      SWI     "XOS_Module"    ; II-655
 2720                ADRVS   R0,poorclaim
 2730                SWIVS   "OS_GenerateError"      ; I-41
 2740                LDMFD   R13!,{R0,PC}
 2750.poorclaim      EQUD    0
 2760                EQUS    "RMA workspace failure"+bl$
 2770                ALIGN
 2780
 2790.releaseRMA
 2800
 2810; On entry,     R2      = Pointer to space to be released
 2820
 2830                STMFD   R13!,{R0,R14}
 2840                MOV     R0,#7           ; Release RMA
 2850                B       joinclaim
 2860
 2870.startupcomm
 2880
 2890; Once Service_WimpStart has been claimed, the Desktop will call
 2900; Wimp_StartTask with R0 = * command addr returned by the claimant.
 2910; Unfortunately, you can't dive straight in and start executing your
 2920; code - you have to call OS_Module 2 (Enter Application) first.
 2930
 2940                STMFD   R13!,{R0-R2,R14}
 2950                MOV     R2,R0                   ; Point to * command tail
 2960                MOV     R0,#0                   ; How many tasks running ?
 2970                SWI     "XWimp_ReadSysInfo"     ; III-1284
 2980                MOVS    R0,R0                   ; None, so not in
 2990                ADREQ   R0,notindesktop         ; Desktop
 3000                SWIEQ   "OS_GenerateError"
 3010                ADR     R1,titlestr             ; Point to module name
 3020                MOV     R0,#2                   ; Enter Application
 3030                SWI     "XOS_Module"            ; II-651
 3040                LDMFD   R13!,{R0-R2,PC}
 3050.notindesktop   EQUD    0
 3060                EQUS    "Use *Desktop to start the "+prog$+bl$
 3070                ALIGN
 3080
 3090.leavenow
 3100
 3110; User-instigated quit requested, so shutdown task and leave gracefully
 3120; On entry,     R9      = 0 for Temporary Quit, 1 for Permanent Quit
 3130;                       = -1 for main (rather than sub) menu Quit
 3140; For the moment, R9 = -1 is treated as a Permanent Quit (happy Philip ?)
 3150
 3160                BL      wimpclosedown   ; All done, so shutdown
 3170                MOVS    R9,R9   ; Severity of Quit ?
 3180                MOVEQ   R1,#0
 3190                MOVEQ   R2,#0
 3200                SWIEQ   "OS_Exit"       ; 0 = Mild ! II-743
 3210                ADR     R0,trashname1   ; First name
 3220                MVN     R2,#0   ; Delete variables
 3230                MOV     R3,#0   ; First call
 3240                MOV     R4,#0   ; Normal string
 3250                SWI     "XOS_SetVarVal" ; Delete Trash$Dir. II-752
 3260                ADR     R0,trashname2   ; Second name
 3270                MOV     R3,#0   ; First call
 3280                MOV     R4,#0   ; Normal string
 3290                SWI     "XOS_SetVarVal" ; Delete TrashWork$Dir
 3300                MOV     R0,#0
 3310                MOV     R1,#0
 3320                MOV     R2,#0
 3330                ADR     R3,titlestr
 3340                SWI     "OS_ExitAndDie" ; -1 or 1 = Severe ! II-758
 3350.trashname1     EQUS    "Trash$Dir"+bl$
 3360.trashname2     EQUS    "TrashWork$Dir"+bl$
 3370                ALIGN
 3380
 3390.registerspark
 3400
 3410; On entry,     R5      = Spark's "new" task handle
 3420
 3430                STMFD   R13!,{R0,R14}
 3440                LDR     R0,sparktaskhand; Get old task handle
 3450                CMP     R0,R5           ; Is it new info ?
 3460                STRNE   R5,sparktaskhand; Save new task handle
 3470                BLNE    redocontents    ; Update trash can icon
 3480                LDMFD   R13!,{R0,PC}
 3490
 3500.inituserarea
 3510
 3520; After about 75 million different attempts at coding using OS_SpriteOp
 3530; only, OS_SpriteOp mixed with Wimp_SpriteOp and Wimp_SpriteOp only,
 3540; I came to following conclusions regarding Wimp programs and sprites:
 3550; 1) Use Wimp_SpriteOp for reading Sprite files and plotting them.
 3560; 2) Use OS_SpriteOp 16 for saving a rect to a sprite (saves background)
 3570;    and OS_SpriteOp 34 for replotting that saved rect
 3580; 3) Setup RMA workspace (claim and then call OS_SpriteOp 9) for the
 3590;    OS_SpriteOp 16/34 calls - do NOT use the System Sprite area !
 3600
 3610                STMFD   R13!,{R0,R1,R14}
 3620                MOV     R0,#spritespace%; Space needed for Van sprites
 3630                LDR     R1,spritearea   ; Offset 0 = Total area size
 3640                STR     R0,[R1]
 3650                MOV     R0,#0           ; Offset 4 = No sprites yet
 3660                STR     R0,[R1,#4]
 3670                MOV     R0,#16
 3680                STR     R0,[R1,#8]      ; Offset 8 = No extension area
 3690                STR     R0,[R1,#12]     ; Offset 12 = First free word
 3700                MOV     R0,#9           ; Initialise sprite area (*SNew)
 3710                BL      spriteop        ; I-398
 3720                LDMFD   R13!,{R0,R1,PC}
 3730
 3740.dummyspark     STMFD   R13!,{R3,R14}
 3750                LDR     R3,sparktaskhand        ; Only send if Spark's
 3760                MOVS    R3,R3                   ; handle unknown
 3770                LDREQ   R3,windowspace  ; Point to start of command
 3780                ADDEQ   R3,R3,#20       ; buffer
 3790                BLEQ    sendittospark   ; Tell everyone to do nothing
 3800                LDMFD   R13!,{R3,PC}
 3810
 3820.delsparkfile   STMFD   R13!,{R0,R2,R3,R14}
 3830                ADR     R0,savedleaf
 3840                LDR     R3,putleafhere  ; Set up when drag started
 3850.retrieveleaf   LDRB    R2,[R0],#1      ; Copy leaf onto end
 3860                STRB    R2,[R3],#1
 3870                MOVS    R2,R2
 3880                BNE     retrieveleaf
 3890                BL      sendittospark   ; Tell Spark to delete file
 3900                LDMFD   R13!,{R0,R2,R3,PC}
 3910
 3920.sendittospark  STMFD   R13!,{R0-R3,R14}
 3930                MOV     R0,#13         ; Needs CR at end of command
 3940                STRB    R0,[R3],#1
 3950                MOV     R0,#0
 3960.padtoword      STRB    R0,[R3],#1
 3970                TST     R3,#%11         ; Pad to word
 3980                BNE     padtoword
 3990                LDR     R1,windowspace
 4000                SUB     R0,R3,R1        ; Size (inc. leaf/data) of block
 4010                LDR     R2,sparktaskhand
 4020                LDR     R3,sparkcommID  ; Spark command message ID
 4030                BL      sendamessage
 4040                LDMFD   R13!,{R0-R3,PC}
 4050.sparkcommID    EQUD    &41000+61       ; Do Spark command ID
 4060
 4070.sendamessage
 4080
 4090; On entry,     R0      = Size of message block
 4100;               R1      = Pointer to message (usu. Wimp_Poll) block
 4110;               R2      = Task handle (0 = everyone)
 4120;               R3      = Message action
 4130
 4140                STMFD   R13!,{R0,R14}
 4150                STR     R0,[R1]         ; Store block length
 4160                MOV     R0,#0
 4170                STR     R0,[R1,#12]     ; my_ref = 0 (Original message)
 4180                STR     R3,[R1,#16]     ; Store message action
 4190                MOV     R0,#18
 4200                SWI     "XWimp_SendMessage" ; III-1253
 4210                LDMFD   R13!,{R0,PC}
 4220
 4230.appstart
 4240
 4250; Well, here's the start sequence at last ! We only want one of this
 4260; task running, so must shut down the old one if it is running.
 4270
 4280                LDR     R13,workspace   ; Reset stack pointer -> RMA
 4290                BL      wimpclosedown   ; Shut down old task
 4300                MOV     R0,#windman%    ; Expecting V2.00 Window Manager
 4310                LDR     R1,taskconstant ; Indicate new-style Wimp task
 4320                ADR     R2,description  ; English text name of program
 4330                SWI     "XWimp_Initialise" ; Start task. III-1173
 4340                CMP     R0,#windman%    ; Are we earlier than V2.00 ?
 4350                ADRLT   R0,notrecentwimp; Yes, so crash out
 4360                SWILT   "OS_GenerateError"
 4370                STR     R1,taskhandle   ; Save Wimp task handle
 4380
 4390; At the point, everything is ready for application initialisation...
 4400
 4410                BL      dummyspark      ; Try and get Spark to reply
 4420                BL      loadtemplate    ; Load template/make Info window
 4430                BL      scantrashspr    ; Load application sprites
 4440                BL      readCMOS        ; Setup menu ticks
 4450                MOV     R10,#0          ; First scan
 4451                STRB    R10,dragstate   ; Assume button is up
 4460                BL      checkcontents   ; Scan trash can
 4470                BL      scanvanspr      ; Load animation sprites
 4480
 4490; Because applications could rename/delete/copy etc. in a variety of
 4500; ways (and not using the WIMP), then have to claim UpCallV to
 4510; trap any directory-changing activity.
 4520
 4530                MOV     R0,#UpCallV             ; I-68
 4540                ADR     R1,trapupcall
 4550                MOV     R2,#0
 4560                SWI     "XOS_Claim"             ; I-58
 4570
 4580; ...and a tight Wimp_Poll loop, only quitting when the user requests it
 4590
 4600.intightloop    MOV     R0,#0           ; All reason codes wanted
 4610                SUB     R1,R13,#stackspace% ; Data returned to RMA
 4620                SWI     "XWimp_Poll"    ; III-1192
 4630                LDR     R13,workspace   ; Reset stack pointer -> RMA
 4640                MOVS    R0,R0           ; Is it idle ?
 4650                BNE     actuallybusy
 4660                BL      stopglass       ; Yes, so Hourglass off if on
 4670                BL      checkfordrag    ; Are we dragging from Spark ?
 4680                B       checkfsflag     ; See if Trash$Dir has changed
 4690.actuallybusy   CMP     R0,#6           ; Check for mouse click. III-1196
 4700                BNE     maybemenusel
 4710                LDR     R0,[R1,#8]      ; Get button state
 4720                CMP     R0,#4           ; Is it left button...?
 4730                CMPNE   R0,#1           ; ...or the right button ?
 4740                BNE     maybemiddle
 4750                LDRB    R0,CMOSbyte     ; Only do something if not in
 4760                TST     R0,#%001        ; Immediate mode
 4770                BLEQ    peepincan       ; Look inside trash can
 4780                B       intightloop
 4790.maybemiddle    CMP     R0,#2
 4800                BLEQ    makenewmenu     ; Middle button -> menu
 4810                B       intightloop
 4820.maybemenusel   CMP     R0,#9
 4830                BNE     nomouseclick
 4840                MOV     R2,R1           ; Save Wimp_Poll block ptr
 4850                ADD     R1,R1,#&100     ; Pointer block further on
 4860                SWI     "XWimp_GetPointerInfo"  ; III-1214
 4870                LDR     R0,[R1,#8]      ; Get button state
 4880                MOV     R1,R2           ; Restore Wimp_Poll block ptr
 4890                BL      dealwithmenu    ; Menu item selected. III-1199
 4900                CMP     R0,#1           ; Is it the right button ?
 4910                BLEQ    makeoldmenu     ; Keep menu on screen
 4920                B       intightloop
 4930.nomouseclick   CMP     R0,#2           ; Info window dragged ?
 4940                BNE     maybemessage    ; (Philip Colmer)
 4950                SWI     "XWimp_OpenWindow"      ; III-1190
 4960                B       intightloop     ; That was nice'n'easy...
 4970.maybemessage   CMP     R0,#17          ; Check for message broadcast
 4980                CMPNE   R0,#18          ; III-1202
 4990                BNE     checkfsflag
 5000                LDR     R2,[R1,#16]
 5010                MOVS    R2,R2
 5020                MOVEQ   R9,#0           ; Signal Temporary Quit
 5030                BEQ     leavenow        ; Quit requested. III-1255
 5040                MOV     R3,#&500
 5050                ADD     R3,R3,#2        ; !Help ID = &502
 5060                CMP     R3,R2           ; Was !Help requested ?
 5070                BNE     wasitadrag
 5080                LDR     R2,[R1,#32]     ; Get icon handle
 5090                CMN     R2,#-iconbartype%       ; Icon bar ?
 5100                MOVNE   R4,#1           ; No, so must be Info Window
 5110                BNE     helpwanted      ; Rejoin help request
 5120                LDR     R2,[R1,#36]     ; Is it my icon ?
 5130                LDR     R3,iconhandle
 5140                CMP     R2,R3
 5150                BNE     intightloop
 5160                MOV     R4,#0           ; Flag that it's the icon
 5170.helpwanted     BL      askedforhelp    ; !Help info requested
 5180                B       intightloop
 5190.wasitadrag     CMP     R2,#3           ; Load data requested ?
 5200                BNE     maybespark      ; III-1265
 5210                LDR     R2,[R1,#20]     ; Is it on the icon bar ?
 5220                CMN     R2,#-iconbartype%
 5230                BNE     intightloop
 5240                LDR     R2,[R1,#24]     ; Is it my icon ?
 5250                LDR     R3,iconhandle
 5260                CMP     R2,R3
 5270                BLEQ    moveintotrash   ; File dragged onto trash can
 5280                B       intightloop
 5290.maybespark     LDR     R3,dyingappmess ; Has an application just died ?
 5300                LDR     R4,sparktaskhand
 5310                LDR     R5,[R1,#4]      ; Get task handle involved
 5320                CMP     R2,R3
 5330                CMPEQ   R5,R4           ; Was it Spark ?
 5340                MOVEQ   R5,#0           ; If so, forget Spark's handle
 5350                BEQ     sparkchange     ; Return icon to normal
 5360                LDR     R3,reptaskname  ; Is it the task handle
 5370                CMP     R2,R3           ; translation ?
 5380                BNE     didsparkstart
 5390                ADR     R0,sparktaskname; Spark's task name...
 5400                ADD     R2,R1,#28
 5410.scanningname   LDRB    R3,[R0],#1      ; ...compare it with the
 5420                LDRB    R4,[R2],#1      ; returned name to find a match
 5430                CMP     R3,R4
 5440                BNE     intightloop
 5450                MOVS    R3,R3           ; Still scanning name
 5460                BNE     scanningname
 5470                LDR     R5,[R1,#20]     ; Retrieve handle matching name
 5480                B       sparkchange
 5490.didsparkstart  LDR     R3,sparkmessid  ; Has Spark just started up ?
 5500                CMP     R2,R3
 5510                BEQ     sparkchange     ; OK, time to know about Spark
 5520                LDR     R3,sparkcommID  ; Was Spark replying ?
 5530                CMP     R2,R3
 5540                BNE     whataboutsave   ; Not a response to dummy bcast
 5550; At this point, received response from dummy Spark broadcast, so ask
 5560; about the name matching the task handle (in R5 at the moment)
 5570                MOV     R0,#24          ; Size = 24 bytes
 5580                MOV     R2,#0           ; General broadcast
 5590                LDR     R3,reqtaskname  ; Request task handle translation
 5600                STR     R5,[R1,#20]     ; Store task handle
 5610                BL      sendamessage
 5620                B       intightloop
 5630.whataboutsave  CMP     R2,#1           ; DataSave request ?
 5640                BNE     intightloop     ; (Spark'ed file onto Trash Can)
 5650                CMP     R4,R5           ; Check task handle involved
 5660                BNE     intightloop     ; belongs to Spark and no-one else
 5670                MOV     R2,R4
 5680                LDR     R3,[R1,#8]      ; Copy my_ref
 5690                STR     R3,[R1,#12]
 5700                MOV     R3,#2           ; DataSaveAck
 5710                STR     R3,[R1,#16]
 5720                MVN     R3,#0           ; Set file to 'unsafe' (-1)
 5730                STR     R3,[R1,#36]
 5740                ADD     R3,R1,#44
 5750                ADR     R4,savedleaf
 5760.savetheleaf    LDRB    R5,[R3],#1      ; Save suggested Spark
 5770                STRB    R5,[R4],#1      ; leafname for use later
 5780                MOVS    R5,R5
 5790                BNE     savetheleaf
 5800                ADR     R3,tempsparkname
 5810                ADD     R4,R1,#44
 5820.copyscrapname  LDRB    R5,[R3],#1      ; Temporary filename for
 5830                STRB    R5,[R4],#1      ; decompression = <Wimp$Scrap>
 5840                MOVS    R5,R5
 5850                BNE     copyscrapname
 5860                SWI     "XWimp_SendMessage" ; Spark->decompress
 5870                B       intightloop
 5880.sparkchange    BL      registerspark   ; Save Spark handle if changed
 5890                BL      dummyspark      ; Re-broadcast in case there's
 5900                B       intightloop     ; 2 or more Sparks...
 5910.sparkmessid    EQUD    &41000+60       ; Spark started message ID
 5920.dyingappmess   EQUD    &400C3          ; Message_TaskCloseDown
 5930.reqtaskname    EQUD    &400C6          ; Message_TaskNameRq
 5940.reptaskname    EQUD    &400C7          ; Message_TaskNameIs
 5950.tempsparkname  EQUS    "<"+wimp$+">"+bl$
 5960                ALIGN
 5970.sparktaskname  EQUS    "Spark"+bl$
 5980                ALIGN
 5990
 6000.checkfsflag    LDRB    R10,fsctrlflag  ; This is why we need all reason
 6010                MOVS    R10,R10         ; codes - at any time there could
 6020                BLNE    checkcontents   ; be an FS action changing
 6030                B       intightloop     ; Trash$Dir
 6040
 6050.description    EQUS    prog$+bl$
 6060                ALIGN
 6070.sparktaskhand  EQUD    0
 6080.sparkwindhand  EQUD    0
 6090.notrecentwimp  EQUD    0
 6100                EQUS    prog$+" requires Window Manager V"+FNfraction(windman%)+" or later"+bl$
 6110                ALIGN
 6120
 6130.init
 6140
 6150; This routine is called when the module is first loaded, when a
 6160; *RMReInit is called or when a machine reset is signalled.
 6170
 6180                STMFD   R13!,{R2,R3,R14}
 6190                BL      internalreset   ; Only want to reset
 6200                MOV     R3,#stackspace% ; Claim RMA for stack
 6210                LDR     R2,workspace    ; See if already claimed
 6220                MOVS    R2,R2
 6230                BLEQ    claimRMA
 6240                ADDEQ   R2,R2,R3        ; Adjust to end of workspace
 6250                STREQ   R2,workspace    ; cos stack builds downwards
 6260                MOVEQ   R3,#windowspace%; Claim RMA for window info
 6270                BLEQ    claimRMA
 6280                STREQ   R2,windowspace
 6290                MOVEQ   R3,#spritespace%; Claim RMA for sprite workspace
 6300                BLEQ    claimRMA
 6310                STREQ   R2,spritearea
 6320                LDMFD   R13!,{R2,R3,PC}
 6330.workspace      EQUD    0
 6340.windowspace    EQUD    0
 6350.spritearea     EQUD    0
 6360.savedleaf      EQUS    STRING$(11,bl$) ; Filename
 6370                ALIGN
 6380
 6390.changeicon
 6400
 6410; On entry,     R1      = ASC "1" for thin trash can, ASC "2" for thick
 6420; This routine has been added to V1.02 onwards
 6430; Entry param different in V1.10 onwards for new thin can (Philip Colmer)
 6440; Now adds 2 to R1 if Spark's task handle is known
 6450
 6460                STMFD   R13!,{R0,R1,R14}
 6470                LDR     R0,sparktaskhand; Do we know Spark's handle yet ?
 6480                MOVS    R0,R0
 6490                ADDNE   R1,R1,#2        ; Yes, so use 'flashy' sprites
 6500                LDRB    R0,spritename+6
 6510                CMP     R0,R1           ; No point in call if no change
 6520                STRNEB  R1,spritename+6 ; Toggle sprite name
 6530                ADRNE   R1,iconstateblk
 6540; Boy - my favourite opcode is on the next line !
 6550                SWINE   "XWimp_SetIconState"    ; III-1211. Avoid shuffle
 6560                LDMFD   R13!,{R0,R1,PC}
 6570.iconstateblk   EQUD    iconbartype%
 6580.iconhandle     EQUD    0
 6590                EQUD    0       ; EOR word      ; Both words set to zero
 6600                EQUD    0       ; Clear word    ; because flags the same
 6610
 6620.makeicon
 6630
 6640; On entry,     R1      = ASC "1" for thin trash can, ASC "2" for thick
 6650; Note - Sprites should be called '!trash1' and '!trash2' - do NOT rename
 6660; Entry param different in V1.10 onwards for new thin can (Philip Colmer)
 6670
 6680                STMFD   R13!,{R0,R1,R14}
 6690                STRB    R1,spritename+6 ; Poke name ending
 6700                ADR     R1,spritename
 6710                STR     R1,pokespname
 6720                ADR     R1,iconblock
 6730                SWI     "XWimp_CreateIcon"      ; III-1180
 6740                STR     R0,iconhandle
 6750                LDMFD   R13!,{R0,R1,PC}
 6760; This is a data block for Wimp_CreateIcon - fixed by Philip Colmer
 6770.iconblock      EQUD    iconbartype%    ; Icon bar 'service' flag
 6780                EQUD    0               ; Bottom left X
 6790                EQUD    0               ; Bottom left Y
 6800                EQUD    69              ; Top right X
 6810                EQUD    68              ; Top right Y
 6820                EQUB    %00000010       ; Icon is a sprite
 6830                EQUB    %00110001       ; Click notifies/Indirected
 6840                EQUB    %00000000       ; Nothing special about icon
 6850                EQUB    %00000001       ; Forecol = 1, Backcol = 0
 6860.pokespname     EQUD    0               ; Pointer to sprite name
 6870                EQUD    1               ; Pointer to WIMP sprites
 6880                EQUD    12
 6890.spritename     EQUS    "!trash"+STRING$(6,bl$) ; Sprite name
 6900
 6910; 'killicon' routine removed from V1.02 onwards - no longer required
 6920
 6930.trapupcall
 6940
 6950; Thanks to Philip Colmer for the reason codes here - the old PRMs
 6960; only list R0=1 and R0=&100, so I had no idea about R0=3 ! I-139
 6970; On entry,     R0      = Reason code (3 for file modification)
 6980;               R9      = File modification reason (if R0=3)
 6990
 7000                STMFD   R13!,{R9,R14}
 7010                CMP     R0,#3           ; Only if modification notified
 7020                BNE     notfilemod
 7030                CMP     R9,#0           ; *Save (0)
 7040                CMPNE   R9,#6           ; *Delete (6)
 7050                CMPNE   R9,#7           ; *Create (7)
 7060                CMPNE   R9,#8           ; *CDir (8)
 7070                SUB     R9,R9,#256      ; Can't get 257 immediately
 7080                CMPNE   R9,#1           ; Open/Create for update (257)
 7090                SUB     R9,R9,#256      ; Can't get 520 immediately
 7100                CMPNE   R9,#8           ; *Rename (520)
 7110                MOVEQ   R9,#1           ; Although can't be sure, set
 7120                STREQB  R9,fsctrlflag   ; changed flag to be safe
 7130.notfilemod     LDMFD   R13!,{R9,PC}
 7140
 7150.wimpclosedown
 7160
 7170; This (handy) routine will only call Wimp_CloseDown if Wimp_Initialise
 7180; had successfully been executed (i.e. taskhandle > 0). It then sets
 7190; taskhandle to 0 to indicate shutdown. Note that Wimp_CloseDown also
 7200; handily kills the icon bar icon.
 7210
 7220                STMFD   R13!,{R0-R2,R14}
 7230                LDR     R0,taskhandle           ; Is taskhandle > 0 ?
 7240                MOVS    R0,R0
 7250                BLE     dormanttask
 7260                BL      notrashwind     ; Remove Trash Can Window
 7270                MOV     R0,#UpCallV     ; Release UpCallV
 7280                ADR     R1,trapupcall
 7290                MOV     R2,#0
 7300                SWI     "XOS_Release"   ; I-59
 7310                BL      checkforred     ; Remove red border if present
 7320                LDR     R0,taskhandle
 7330                LDR     R1,taskconstant
 7340                SWI     "XWimp_CloseDown" ; Shutdown task. III-1241
 7350.dormanttask    MOV     R0,#0
 7360                STR     R0,iconhandle   ; Clear icon handle
 7370                STR     R0,taskhandle   ; Clear task handle
 7380                STR     R0,sparktaskhand; Clear Spark handle
 7390                STR     R0,templatehandle ; Templates will need a reload
 7400                STRB    R0,modifiedbord ; No red border yet
 7410                LDMFD   R13!,{R0-R2,PC}
 7420.taskconstant   EQUS    "TASK"  ; Special four-letter word !
 7430.taskhandle     EQUD    0       ; Wimp task handle (also used as a flag)
 7440
 7450.peepincan
 7460
 7470; Want to have a look inside trash can, so create the directory if not
 7480; already there and use the Filer to create a new Wimp task.
 7490
 7500                STMFD   R13!,{R0,R14}
 7510                BL      canexists       ; Make sure Trash$Dir is OK
 7520
 7530; Stupid *Filer_OpenDir <dir> doesn't translate environmental vars !!
 7540; Hence must use translated buffer.
 7550
 7560                ADR     R0,startupwind
 7570                SWI     "XWimp_StartTask"   ; III-1242
 7580                LDMFD   R13!,{R0,PC}
 7590
 7600.readtrashdir
 7610
 7620; On entry,     R1      = Address of buffer to store Trash$Dir expansion
 7630; MUST have Trash$Dir defined at all times, otherwise fatal error
 7640
 7650                STMFD   R13!,{R0-R4,R14}
 7660                MOV     R0,#0
 7670                STRB    R0,poketrash
 7680                ADR     R0,plaintrash
 7690                MOV     R2,#maxpathlen%-1       ; Reduced by 1 (Rabin).
 7700                MOV     R3,#0
 7710                MOV     R4,#0
 7720                SWI     "XOS_ReadVarVal"        ; II-750
 7730                MOVVC   R0,#0
 7740                STRVCB  R0,[R1,R2]      ; Add a zero terminator (Rabin).
 7750                LDMVCFD R13!,{R0-R4,PC}
 7760; This section revamped by Rabin Ezra. Thanks !
 7770                MOVS    R2,R2           ; Is error overflow ?
 7780                ADREQ   R0,undefinedvar
 7790                ADRNE   R0,vartoolong
 7800                SWI     "OS_GenerateError"
 7810.plaintrash     EQUS    trashvar$+bl$
 7820.startupwind    EQUS    "Filer_OpenDir "        ; III-1292
 7830.trashopenbuff  EQUS    STRING$(maxpathlen%,bl$)
 7840.closedownwind  EQUS    "Filer_CloseDir "       ; III-1291
 7850.trashclosebuff EQUS    STRING$(maxpathlen%,bl$)
 7860                ALIGN
 7870.vartoolong     EQUD    0
 7880                EQUS    trashvar$+" environmental variable longer than "+STR$(maxpathlen%-1)+" characters"+bl$
 7890                ALIGN
 7900.undefinedvar   EQUD    0
 7910                EQUS    trashvar$+" environmental variable undefined"+bl$
 7920.fsctrlflag     EQUB    0
 7930.glassstat      EQUB    0
 7940.CMOSbyte       EQUB    0
 7941.dragstate      EQUB    0
 7950                ALIGN
 7960
 7970.notrashwind    STMFD   R13!,{R0,R1,R14}
 7980                ADR     R1,trashclosebuff
 7990                BL      readtrashdir            ; Get Trash$Dir
 8000
 8010; Note that because the Wimp may already be partially shut down, we
 8020; can't use XWimp_StartTask in this section, so use XOS_CLI
 8030
 8040                ADR     R0,closedownwind
 8050                SWI     "XOS_CLI"       ; Shutdown Trash window. II-619
 8060                LDMFD   R13!,{R0,R1,PC}
 8070
 8080.checkcontents
 8090
 8100; On entry,     R10     = 0 if want to create icon, <> 0 to update it
 8110; Want to decide what icon to put on icon bar, so check the contents
 8120; of <Trash$Dir>. If the env. variable doesn't exist, or the dir doesn't
 8130; exist or there's nothing in the dir, then trash is empty.
 8140
 8150                STMFD   R13!,{R0-R3,R14}
 8160                ADR     R1,trashopenbuff
 8170                BL      readtrashdir    ; Trash$Dir check
 8180                MOV     R0,#ASC"."
 8190                STRB    R0,poketrash
 8200                MOV     R0,#5
 8210                ADR     R1,trashbits
 8220                SWI     "XOS_File" ; Any <Trash$Dir>.* files ? III-850
 8230                LDR     R2,trashstat
 8240                ORR     R2,R2,#(1<<22)  ; Bit 22 set to indicate empty
 8250                BVS     empty
 8260                LDRB    R3,CMOSbyte     ; If in Immediate mode, then
 8270                TST     R3,#%001        ; trash can is always 'empty'
 8280                BNE     empty
 8290                MOVS    R0,R0
 8300                BICNE   R2,R2,#(1<<22)  ; Bit 22 cleared because full
 8310.empty          STR     R2,trashstat
 8320                BL      updatecan
 8330                LDMFD   R13!,{R0-R3,PC}
 8340.trashbits      EQUS    "<"+trashvar$+">"
 8350.poketrash      EQUS    bl$+"*"+bl$
 8360                ALIGN
 8370
 8380.redocontents
 8390
 8400; Like checkcontents, but uses last scan for info rather than re-scanning
 8410
 8420                STMFD   R13!,{R2,R10,R14}
 8430                LDR     R2,trashstat    ; Get last scan
 8440                MOV     R10,#1          ; Flag icon update
 8450                BL      updatecan
 8460                LDMFD   R13!,{R2,R10,PC}
 8470
 8480.updatecan
 8490
 8500; On entry,     R2      = Trashstat value
 8510;               R10     = 0 if want to create icon, <> 0 to update it
 8520
 8530                STMFD   R13!,{R1,R14}
 8540                TST     R2,#(1<<22)
 8550                MOVNE   R1,#ASC"1" ; Empty flag (Philip Colmer)
 8560                MOVEQ   R1,#ASC"2" ; Full flag
 8570                MOVS    R10,R10         ; Is this the first time the
 8580                BLEQ    makeicon        ; icon is to appear on the bar ?
 8590                BLNE    changeicon
 8600                MOV     R1,#0
 8610                STRB    R1,fsctrlflag   ; No need for more updates
 8620                LDMFD   R13!,{R1,PC}
 8630
 8640.canexists
 8650
 8660; Must create trash directory if it doesn't exist
 8670
 8680                STMFD   R13!,{R0,R1,R14}
 8690                ADR     R1,trashopenbuff
 8700                BL      readtrashdir    ; Make sure Trash$Dir var exists
 8710                MOV     R0,#0
 8720                STRB    R0,poketrash
 8730                ADR     R1,trashbits
 8740                MOV     R0,#8
 8750                SWI     "XOS_File"      ; *CDIR <Trash$Dir>. III-854
 8760                LDMFD   R13!,{R0,R1,PC}
 8770
 8780.newname        EQUS    "<"+trashvar$+">"
 8790.nameending     EQUS    "."+STRING$(11,bl$)
 8800                ALIGN
 8810
 8820.getcaniconinfo
 8830
 8840; On exit,      R2      = Right-hand X coord of trash can icon on icon bar
 8850
 8860                STMFD   R13!,{R1,R3,R14}
 8870                MVN     R2,#-(iconbartype%+1)   ; Icon bar type
 8880                LDR     R3,iconhandle   ; Trash can icon handle
 8890                BL      geticoninfo
 8900                LDR     R2,[R1,#16]     ; Get icon right X coord
 8910                LDMFD   R13!,{R1,R3,PC}
 8920
 8930.geticoninfo
 8940
 8950; On entry,     R0      = Window handle
 8960;               R2      = Icon handle
 8970; On exit,      R1      = Pointer to IconState info
 8980
 8990                ADR     R1,(trashclosebuff+3) DIV 4*4    ; Recycle workspc
 9000                STR     R2,[R1]         ; Store window handle
 9010                STR     R3,[R1,#4]      ; Store icon handle
 9020                SWI     "XWimp_GetIconState"    ; Get icon info. III-1213
 9030                MOV     PC,R14
 9040
 9050.moveintotrash
 9060
 9070; On entry,     R1      = Pointer to Wimp_Poll block
 9080
 9090                STMFD   R13!,{R0-R6,R9,R14}
 9100                LDRB    R5,CMOSbyte     ; Get Immediate option
 9110                AND     R5,R5,#%001
 9120                BL      startglass      ; Hourglass on
 9130                ADD     R3,R1,#44       ; Point to filename
 9140                BL      canexists       ; Create Trash dir if needed
 9150
 9160; Because *Rename is extremely awkward about wildcards - won't allow
 9170; them (ARRGGHH !) - have to copy the name (from the last '.' onwards)
 9180
 9190                LDR     R4,[R3,#-44+12] ; Is it from Filer ?
 9200                MOVS    R4,R4
 9210                BEQ     itsfromFiler    ; Yes, so endings the same
 9220                LDR     R0,sparktaskhand
 9230                LDR     R1,[R3,#-44+4]  ; Is it Spark ?
 9240                CMP     R0,R1
 9250                BNE     canttrash       ; No, so ignore
 9260                ADR     R0,savedleaf    ; and copy leafname to the
 9270                ADR     R1,nameending+1 ; end of Trash$Dir
 9280.copysafeleaf   LDRB    R2,[R0],#1
 9290                STRB    R2,[R1],#1
 9300                MOVS    R2,R2
 9310                BNE     copysafeleaf
 9320                B       retryaccess
 9330.itsfromFiler   MOV     R0,R3
 9340                MOV     R2,#0           ; Don't poke yet
 9350.lookingforend  LDRB    R1,[R0],#1
 9360                CMP     R1,#ASC"."      ; Still traversing dirs ?
 9370                ADREQ   R2,nameending
 9380                MOVS    R2,R2
 9390                STRNEB  R1,[R2],#1      ; Copy text into dest name
 9400                MOVS    R1,R1
 9410                BNE     lookingforend   ; Got terminator yet ?
 9420
 9430; Next bit added to V1.01 to make sure that *Rename ALWAYS works
 9440; if the file is on the same disk (avoiding having to *Copy locked files)
 9450
 9460.retryaccess    MOV     R0,#24          ; *Access <file> WR. III-910
 9470                MOV     R1,R3           ; Point to original filename
 9480                ADR     R2,attributes   ; Point to WR access string
 9490                BL      dofscontrol
 9500                BGT     canttrash
 9510.retryrename    STMFD   R13!,{R3}
 9520                MOV     R1,R3
 9530                MOVS    R5,R5           ; Immediate enabled ?
 9540                MOVEQ   R0,#25          ; *RENAME reason code. III-911
 9550                ADREQ   R2,newname
 9560                SWIEQ   "XOS_FSControl" ; *Rename. III-911
 9570                BEQ     attemptnewname
 9580                ADR     R6,callwipe     ; (Optionally) animate van and
 9590                MOV     R9,R1           ; *Wipe everything from Trash$Dir
 9600                BL      dovananimation
 9610                B       attemptnewname
 9620.callwipe       STMFD   R13!,{R0-R3,R14}
 9630                MOV     R0,#27          ; *WIPE reason code. III-915
 9640                MOV     R1,R9
 9650                MOV     R3,#%010000011  ; ~QF~CR~V and delete original
 9660                SWI     "XOS_FSControl" ; *Wipe. III-915
 9670                LDMFD   R13!,{R0-R3,PC}
 9680.attemptnewname LDMFD   R13!,{R3}
 9690                BVC     acknowledge     ; Good, so acknowledge it
 9700
 9710; To prevent the silly copy of Trash into itself (causes 77 levels
 9720; to be created !), the error code for Bad RENAME is checked.
 9730
 9740                LDR     R1,[R0]         ; Get the error word
 9750                LDR     R2,badrename
 9760                CMP     R1,R2           ; = &108B0 (Bad RENAME) ?
 9770                BEQ     canttrash
 9780
 9790; The only (non-fatal) way a rename can fail is if the rename is
 9800; attempted across disks/FSs or into itself (when it's a dir)....
 9810
 9820                LDR     R2,baddisk
 9830                CMP     R1,R2           ; = &1089F (Not same disc) ?
 9840                CMPNE   R1,#&B0         ; = &B0 (Bad rename) ?
 9850
 9860; ...or if it is already present in Trash$Dir (Already exists error)
 9870
 9880                LDRNE   R2,doublecan
 9890                CMPNE   R1,R2           ; = &108C4 (Already exists) ?
 9900                BEQ     dotrashcopy
 9910
 9920; If it gets here, then there's a disk fault
 9930
 9940                BL      generateerror
 9950                CMP     R1,#1
 9960                BEQ     retryrename
 9970                BGT     canttrash
 9980.dotrashcopy    MOVS    R5,R5           ; If Immediate then *Wipe failed
 9990                BNE     canttrash       ; so don't do anything else
10000                MOV     R0,#26          ; *COPY reason code. III-912
10010                MOV     R1,R3
10020                ADR     R2,newname
10030                BL      dofscontrol     ; Do the *COPY
10040                BGT     canttrash
10050
10060; This code added for V1.01 - should have been in V1.00...sorry.
10070
10080.acknowledge    MOV     R0,#17          ; User message
10090                SUB     R1,R3,#44       ; Go back to block start
10100                LDR     R2,[R1,#8]      ; Get unique reference number
10110                STR     R2,[R1,#12]     ; Store it in response field
10120                MOV     R2,#4
10130                STR     R2,[R1,#16]     ; DataLoadAck
10140                LDR     R2,[R1,#4]      ; Get task handle involved
10150                SWI     "XWimp_SendMessage"  ; Acknowledge drag
10160                MOVS    R4,R4
10170                BLNE    delsparkfile    ; Delete Spark file
10180.canttrash      LDMFD   R13!,{R0-R6,R9,PC} ; Return (FS flag may be set)
10190.fakereturn     MOV     PC,R14          ; Fake return for animation
10200.badrename      EQUD    &108B0          ; Bad RENAME error code
10210.baddisk        EQUD    &1089F          ; Not same disc error code
10220.doublecan      EQUD    &108C4          ; Already exists error code
10230
10240; Note that PUBLIC read-write (/WR) has NOT been used because anyone
10250; on Econet could hack around with the files whilst they're in the trash!
10260
10270.attributes     EQUS    "WR"+bl$        ; *Access attributes
10280                ALIGN
10290
10300.checkerror
10310
10320; On entry,     R0      = Points to an error block (if V set)
10330; On exit,      ZC      = LT if no error, EQ if OK clicked, GT if Cancel
10340
10350                STMFD   R13!,{R1,R14}
10360                MOVVC   R1,#0
10370                BLVS    generateerror
10380                CMP     R1,#1           ; Tacky, but it works !
10390                LDMFD   R13!,{R1,PC}
10400
10410.generateerror
10420
10430; On entry,     R0      = Points to an error block
10440; On exit,      R1      = 1 if OK clicked, 2 if Cancel clicked
10450
10460                STMFD   R13!,{R0,R2,R14}
10470                MOV     R1,#%0000011    ; OK & Cancel, Highlight OK
10480                ADR     R2,errorname
10490                SWI     "XWimp_ReportError" ; III-1243
10500                MOV     R0,#0           ; Wimp_ReportError does an
10510                STRB    R0,glassstat    ; Hourglass_Smash, so need to
10520                BL      startglass      ; start it up again
10530                LDMFD   R13!,{R0,R2,PC}
10540.errorname      EQUS    prog$+bl$
10550                ALIGN
10560
10570.startglass
10580
10590; Switch on Hourglass (busy delay = 1 second), but only if it is off
10600
10610                STMFD   R13!,{R0,R14}
10620                LDRB    R0,glassstat
10630                MOVS    R0,R0
10640                MOVEQ   R0,#100         ; 1 second to start
10650                STREQB  R0,glassstat
10660                SWIEQ   "XHourglass_Start" ; IV-1393
10670                LDMFD   R13!,{R0,PC}
10680
10690.stopglass
10700
10710; Switch off Hourglass, but only if it is on
10720
10730                STMFD   R13!,{R0,R14}
10740                LDRB    R0,glassstat
10750                MOVS    R0,R0
10760                MOVNE   R0,#0
10770                STRNEB  R0,glassstat
10780                SWINE   "XHourglass_Off" ; IV-1391
10790                LDMFD   R13!,{R0,PC}
10800
10810.byebye
10820
10830; This routine is called when the module is *RMKilled or *RMReInited.
10840
10850                STMFD   R13!,{R2,R14}
10860                LDR     R2,workspace            ; Free (any) stack space
10870                SUBS    R2,R2,#stackspace%      ; Point to RMA start
10880                BLPL    releaseRMA
10890                LDRPL   R2,windowspace          ; Release window space
10900                BLPL    releaseRMA
10910                LDRPL   R2,spritearea           ; Release sprite area
10920                BLPL    releaseRMA
10930                BL      wimpclosedown           ; Shut down active task
10940                MOV     R2,#0
10950                STR     R2,workspace      ; Clear workspace flag
10960                LDMFD   R13!,{R2,PC}
10970
10980.readCMOS       STMFD   R13!,{R0-R2,R14}
10990                MOV     R0,#161         ; Read CMOS RAM to get saved
11000                MOV     R1,#battery%    ; settings of menu options
11010                SWI     "XOS_Byte"      ; II-787
11020                STRB    R2,CMOSbyte     ; Save for later modification
11030                LDR     R0,immediatestat  ; Configure tick on Immediate
11040                MOV     R1,#%001        ; Bit 0 first
11050                BL      twiddlebit
11060                STR     R0,immediatestat
11070                LDR     R0,warningstat  ; Configure tick on Warning
11080                BL      twiddlebit
11090                STR     R0,warningstat
11100                LDR     R0,animationstat ; Configure tick on Animation
11110                BL      twiddlebit
11120                STR     R0,animationstat
11130                LDMFD   R13!,{R0-R2,PC}
11140
11150.twiddlebit
11160
11170; On entry,     R0      = Menu status word
11180;               R1      = Bit mask of status
11190;               R2      = Status byte
11200; On exit,      R0      = New value of menu status word
11210;               R1      = Shifted left by 1
11220
11230                STMFD   R13!,{R2,R14}
11240                BIC     R0,R0,#(1<<0)   ; Clear flag bit (0) on menu
11250                ANDS    R2,R2,R1
11260                ORRNE   R0,R0,#(1<<0)   ; Set flag bit if switched on
11270                MOV     R1,R1,ASL #1    ; Next menu is 1 bit on in CMOS
11280                LDMFD   R13!,{R2,PC}
11290
11300.togglebit
11310
11320; On entry,     R0      = Bit position to be toggled
11330
11340                STMFD   R13!,{R0-R2,R14}
11350                MOV     R1,#1           ; Straightforward EOR (1<<R0)
11360                LDRB    R2,CMOSbyte     ; Flip bit R0 in CMOS RAM
11370                EOR     R2,R2,R1,ASL R0
11380                MOV     R0,#162
11390                MOV     R1,#battery%
11400                SWI     "XOS_Byte"      ; Update CMOS RAM. II-788
11410                BL      readCMOS        ; Re-read 'cos menu option changed
11420                LDMFD   R13!,{R0-R2,PC}
11430
11440.dealwithmenu
11450
11460; On entry,     R1      = Pointer to Wimp_Poll block
11470
11480                STMFD   R13!,{R0-R2,R6,R9,R10,R14}
11490                LDR     R0,[R1]         ; Get item number (from 0)
11500                MOVS    R0,R0
11510                BEQ     ignoremenu      ; Item #1 = Info (do nothing)
11520                CMP     R0,#5           ; Item #6 = Quit
11530                LDREQ   R9,[R1,#4]
11540                BEQ     leavenow
11550                CMP     R0,#4           ; Item #5 = Empty Trash
11560                BEQ     dothebinning
11570; It it gets here, then must be Items #2-4 (Immediate, Warning, Animation)
11580                SUB     R0,R0,#1        ; Invert tick on appropriate
11590                BL      togglebit       ; menu (updating CMOS RAM too)
11600                MOVS    R0,R0           ; Skip if not Immediate
11610                BNE     ignoremenu
11620                MOV     R10,#1          ; If Immediate item toggled then
11630                BL      checkcontents   ; might need to re-enable fat can
11640                LDRB    R0,CMOSbyte     ; If Immediate toggled on, then
11650                TST     R0,#%001        ; must shut down Trash Can Window
11660                BLNE    notrashwind
11670                B       ignoremenu
11680; Must be Item #5, which is only enabled if there is Trash
11690.dothebinning   ADR     R6,cleantrashdir
11700                BL      dovananimation  ; Trundle van time !
11710.ignoremenu     LDMFD   R13!,{R0-R2,R6,R9,R10,PC}
11720
11730.trashthestuff
11740
11750; On entry,     R6      = Address of routine to be used for trashing
11760
11770                MOV     PC,R6           ; Not exactly tricky to code...
11780
11790.cleantrashdir  STMFD   R13!,{R0,R1,R14}
11800                BL      startglass      ; Hourglass on
11810                MOV     R0,#27          ; *WIPE reason code. III-915
11820                ADR     R1,trashbits
11830                BL      dofscontrol
11840                LDMFD   R13!,{R0,R1,PC}
11850
11860.dofscontrol
11870
11880; On entry,     R0      = OS_FSControl reason code
11890;               R1      = Pointer to source name
11900;               R2      = Pointer to dest name (not used with *WIPE)
11910
11920                STMFD   R13!,{R3,R14}
11930                MOV     R3,#ASC"."
11940                STRB    R3,poketrash
11950.retrycopywipe  STMFD   R13!,{R0-R2}
11960                MOV     R3,#%010000011  ; ~QF~CR~V and delete original
11970                SWI     "XOS_FSControl"
11980                BL      checkerror      ; Keep trying until no error
11990                LDMFD   R13!,{R0-R2}    ; or Cancel clicked on
12000                BEQ     retrycopywipe
12010                LDMFD   R13!,{R3,PC} ; Return (FS flag will be set)
12020
12030.checkfordrag
12040; On entry,     R1      = Pointer to Wimp_Poll block (used for workspace)
12050                STMFD   R13!,{R0-R5,R14}
12060                SWI     "XWimp_GetPointerInfo"
12070                LDR     R2,[R1,#12]     ; Get window handle
12080                LDR     R3,[R1,#16]     ; Get icon handle
12090                LDR     R0,[R1,#8]      ; Must have one of the buttons
12100                TST     R0,#%101        ; down to start a drag
12110                MOVEQ   R4,#0
12120                STREQ   R4,sparkwindhand; If not, we don't know Spark's
12130                BEQ     checkformenu    ; window handle
12131                MOV     R5,#1           ; Button down, away from can
12140                LDR     R4,sparkwindhand; Skip if we already know
12150                MOVS    R4,R4           ; Spark's window handle
12160                BNE     couldbeoverme
12170                MOVS    R3,R3           ; Only looking for an icon,
12180                BMI     couldbeoverme   ; not part of a window
12190                MOVS    R4,R2           ; Make sure not background or
12200                BMI     couldbeoverme   ; icon bar
12210                LDR     R1,windowspace
12220                MOV     R0,#20
12230                STR     R0,[R1]         ; Block size
12240                MOV     R0,#0
12250                STR     R0,[R1,#12]     ; my_ref = 0
12260                MOV     R0,#19
12270                SWI     "XWimp_SendMessage"     ; Ask for owner handle
12280                LDR     R0,sparktaskhand
12290                CMP     R0,R2           ; Was it a Spark icon ?
12300                BNE     notsparkdrag
12310                STR     R4,[R1]                 ; Need to get more
12320                SWI     "XWimp_GetWindowInfo"   ; details. III-1210
12330                LDR     R0,[R1,#28+4]   ; Get window flags
12340                MOV     R0,R0,LSR #24   ; Get icon control flags
12350                BIC     R0,R0,#(%11<<7) ; Ignore bit sel/horiz scroll
12360                CMP     R0,#%111111     ; Are all enabled ?
12370                BNE     notsparkdrag
12380                LDR     R0,[R1,#56+4]
12390                TST     R0,#(1<<8)      ; Is title info indirect ?
12400                BEQ     notsparkdrag
12410                STR     R4,sparkwindhand; Save window handle
12420                ADR     R0,sparkrootcomm
12430                MOV     R2,#LEN(sparkdel$)
12440                ADD     R3,R1,#20
12450.stillcommmove  LDRB    R4,[R0],#1      ; Copy start of Spark command
12460                STRB    R4,[R3],#1      ; into workspace area
12470                SUBS    R2,R2,#1
12480                BNE     stillcommmove
12490                LDR     R0,sparktaskhand; Source task
12500                LDR     R4,[R1,#72+8+4] ; Size of buffer
12510                LDR     R1,[R1,#72+4]   ; Pointer to window title
12520                LDR     R2,taskhandle   ; Destination task
12530                SWI     "XWimp_TransferBlock"   ; III-1283
12540
12550; Although we 'think' we know the length of the window title, it is
12560; only the buffer size - must find the terminating zero instead
12570
12580.findpathzero   LDRB    R0,[R3]
12590                MOVS    R0,R0
12600                ADDNE   R3,R3,#1
12610                BNE     findpathzero
12620                STR     R3,putleafhere  ; That's where the leaf goes
12630                B       notsparkdrag
12640.couldbeoverme  CMN     R2,#2           ; Window = -2 (icon bar) ?
12650                LDREQ   R1,iconhandle
12660                CMPEQ   R1,R3           ; Icon = Trash Can ?
12670                BNE     notsparkdrag
12680
12690; If it gets here, then a button is down and the pointer is over the
12700; Trash Can icon.
12710
12720                LDRB    R0,CMOSbyte     ; Immediate and Warning enabled ?
12730                AND     R0,R0,#%11
12740                CMP     R0,#%11
12750                BNE     notsparkdrag
12760
12770; However, 'dragstate' must have been set to 1 (away from can,
12780; button down) rather than 0 (button up) or 2 (over can, button down)
12790; prior to this if we want to turn the border red.
12800
12801                MOV     R5,#2           ; Over can, button down
12810                LDRB    R0,dragstate
12820                CMP     R0,#1
12830                BLEQ    turnborderred   ; OK, so warn user that he's
12840                B       dontchange      ; about to destroy files
12850
12860; At this point, R0 = Button state
12870;                R1 = GetPointerInfo block, R2/R3 = window/icon handles
12880; Must see if pointer is over 'Empty Trash' (enabled) menu option
12890
12900.checkformenu
12910]
12920IF debug% THEN
12930[OPT A%
12940                BL      showhandles     ; Display handles in top left
12950]
12960ENDIF
12970[OPT A%
12971                MOV     R5,#0           ; Button up, away from can
12980                CMP     R3,#5*3-2       ; On fifth item (Empty Trash) ?
12990                BNE     notsparkdrag
13000                LDRB    R0,CMOSbyte     ; Warning enabled ?
13010                AND     R0,R0,#%10
13020                CMP     R0,#%10
13030                BNE     notsparkdrag
13040                BL      getmenuiconinfo ; Yes, so get menu item text
13050                MOV     R4,#3
13060.scanformiss    LDR     R2,[R0],#4      ; Compare "Empty Trash" with
13070                LDR     R3,[R1],#4      ; menu item text to see if
13080                CMP     R2,R3           ; it's my menu (only easy way !)
13090                BNE     notsparkdrag
13100                SUBS    R4,R4,#1
13110                BNE     scanformiss
13120                BL      turnborderred   ; Turn border red if on item
13130                B       dontchange
13140.notsparkdrag   BL      checkforred     ; Not over can, so remove red
13160.dontchange     STRB    R5,dragstate
13161                LDMFD   R13!,{R0-R5,PC}
13170.putleafhere    EQUD    0
13180.sparkrootcomm  EQUS    sparkdel$
13190                ALIGN
13200]
13210IF debug% THEN
13220[OPT A%
13230; Start of debugging code
13240
13250.showhandles
13260
13270; On entry,     R2/R3   = Window/icon handles (from GetPointerInfo)
13280
13290                STMFD   R13!,{R0,R14}
13300                SWI     XOS_WriteI+4    ; VDU 4 for fast text
13310                SWI     XOS_WriteI+30   ; VDU 30 to keep in top left
13320                MOV     R0,R2           ; Display window handle
13330                BL      outhex
13340                SWI     "XOS_NewLine"   ; Next line. I-166
13350                MOV     R0,R3           ; Display icon handle
13360                BL      outhex
13370                SWI     XOS_WriteI+5    ; Back to slow text again
13380                LDMFD   R13!,{R0,PC}
13390
13400.outhex
13410
13420; On entry,     R0      = Value to printed as 8 hex digits
13430
13440                STMFD   R13!,{R0-R2,R14}
13450                ADR     R1,hexbuffer    ; Convert R0 into 8 zero-padded
13460                MOV     R2,#9           ; hex digits...
13470                SWI     "XOS_ConvertHex8" ; II-601
13480                MOV     R1,#8           ; ...and print them out
13490                SWI     "XOS_WriteN"    ; I-189
13500                LDMFD   R13!,{R0-R2,PC}
13510.hexbuffer      EQUS    STRING$(12,bl$)
13520
13530; End of debugging code
13540]
13550ENDIF
13560[OPT A%
13570.checkforred    STMFD   R13!,{R0,R2,R14}
13580                LDRB    R0,modifiedbord ; If border is red,
13590                MOVS    R0,R0
13600                LDRNE   R0,curbordercol ; then restore to its previous
13610                MOVNE   R2,#0           ; colour
13620                BLNE    restoreborder
13630                LDMFD   R13!,{R0,R2,PC}
13640
13650.turnborderred  STMFD   R13!,{R0,R1,R14}
13660                LDRB    R0,modifiedbord ; Skip if already red
13670                MOVS    R0,R0
13680                BNE     alreadycooked
13690                ADR     R1,wimppalette  ; Simply read all 16 colours
13700                SWI     "XWimp_ReadPalette" ; and save them. III-1251
13710                LDR     R0,[R1,#64]     ; Read and save border colour
13720                STR     R0,curbordercol
13730                MOV     R0,#&00F000     ; Red in RGB values
13740                MOV     R2,#1           ; Flag as modified
13750                BL      restoreborder   ; Change border colour to red
13760.alreadycooked  LDMFD   R13!,{R0,R1,PC}
13770.curbordercol   EQUD    0
13780.wimppalette    EQUS    STRING$(80,bl$)
13790.modifiedbord   EQUB    0
13800                ALIGN
13810
13820.restoreborder
13830
13840; On entry,     R0      = RGB value for border
13850;               R2      = Modified flag
13860
13870                STMFD   R13!,{R1,R14}
13880                STRB    R2,modifiedbord
13890                ADR     R1,wimppalette
13900                STR     R0,[R1,#64]     ; Store border colour
13910                BL      videosync       ; Smooth out change
13920                SWI     "XWimp_SetPalette" ; Mod border colour. III-1250
13930                LDMFD   R13!,{R1,PC}
13940
13950.copyhelpmess
13960
13970; On entry,     R0      = Source address of message
13980;               R2      = Dest address of message
13990; On exit,      R2      = Updated dest address
14000
14010                STMFD   R13!,{R0,R1,R14}
14020.suckuphelp     LDRB    R1,[R0],#1      ; Copy help text into
14030                MOVS    R1,R1
14040                STRNEB  R1,[R2],#1      ; message packet
14050                BNE     suckuphelp
14060                LDMFD   R13!,{R0,R1,PC}
14070
14080.askedforhelp
14090
14100; On entry,     R1      = Pointer to Wimp_Poll block
14110;               R4      = 0 if icon, <> 0 if Info Window
14120
14130                STMFD   R13!,{R0-R3,R14}
14140                ADD     R2,R1,#20       ; Where the help text is to go
14150                MOVS    R4,R4           ; Is it the icon or Info window ?
14160                BEQ     itsiconhelp
14170                ADR     R0,helpmessinfo ; Info Window help
14180                BL      copyhelpmess
14190                B       finishmessnow
14200.itsiconhelp    ADR     R0,helpmessicon ; First help line is constant
14210                BL      copyhelpmess
14220                LDRB    R3,CMOSbyte     ; Now decide on Immediate text
14230                TST     R3,#%001        ; or Trash$Dir info
14240                ADRNE   R0,helpimmed
14250                ADREQ   R0,helpstore
14260                BL      copyhelpmess
14270                TST     R3,#%010        ; Add Warning text if enabled
14280                ADRNE   R0,helpwarn
14290                BLNE    copyhelpmess
14300                TST     R3,#%100        ; Add Animation text if enabled
14310                ADRNE   R0,helpanim
14320                BLNE    copyhelpmess
14330.finishmessnow  MOV     R0,#0           ; Null terminator needed
14340                STRB    R0,[R2,#-2]
14350                ADD     R0,R2,#2        ; Compute word-rounded length of
14360                BIC     R0,R0,#%11      ; message block
14370                SUB     R0,R0,R1
14380                STR     R0,[R1]         ; Save length in block
14390                LDR     R2,[R1,#4]      ; Task handle to reply to
14400                LDR     R0,[R1,#8]      ; Copy reference number
14410                STR     R0,[R1,#12]
14420                MOV     R0,#&500
14430                ADD     R0,R0,#3        ; !Help reply ID = &503
14440                STR     R0,[R1,#16]
14450                MOV     R0,#17
14460                SWI     "XWimp_SendMessage"
14470                LDMFD   R13!,{R0-R3,PC}
14480.helpmessinfo   EQUS    "This is the Info Window.|MIt shows the name and purpose of this application as well as the author, "
14490                EQUS    "version number and date developed. It employs 'auto-stamping' to "
14500                EQUS    "synchronise "+prog$+" module and Info Window versions and dates.|M"+bl$
14510                ALIGN
14520.helpmessicon   EQUS    "This is the "+prog$+" icon. Drag files onto it to "+bl$
14530                ALIGN
14540.helpimmed      EQUS    "delete them immediately.|MMENU: Toggles options.|M"+bl$
14550                ALIGN
14560.helpstore      EQUS    "put them in the "+prog$+".|MMENU: Toggles options/empties trash. SELECT or ADJUST: View trash.|M"+bl$
14570                ALIGN
14580.helpwarn       EQUS    "A red border warning is shown before deletion.|M"+bl$
14590                ALIGN
14600.helpanim       EQUS    "A Trash Van will pick up the trash.|M"+bl$
14610                ALIGN
14620
14630.videosync      STMFD   R13!,{R0-R2,R14}
14640                MOV     R0,#19          ; WAIT (watch out - annoyingly
14650                SWI     "XOS_Byte"      ; corrupts R1 and R2 !). I-298
14660                LDMFD   R13!,{R0-R2,PC}
14670
14680.wimpspriteop
14690
14700; On entry,     R0      = OS_SpriteOp reason code
14710;               R2      = Pointer to sprite name (or filename)
14720;               R3..    = Other OS_SpriteOp params
14730
14740                STMFD   R13!,{R0-R2,R14}
14750
14760; Note to Acorn - I would DEARLY like to use Wimp_SpriteOp exclusively
14770; in this module, but it doesn't support any "write" operations !
14780
14790                ADD     R0,R0,#&100     ; Pointing to special user area
14800                SWI     "XWimp_SpriteOp"; III-1271
14810.leavespriteop  LDMFD   R13!,{R0-R2,PC}
14820
14830.spriteop
14840
14850; On entry,     R0      = OS_SpriteOp reason code
14860;               R2      = Pointer to sprite name (or filename)
14870;               R3..    = Other OS_SpriteOp params
14880
14890                STMFD   R13!,{R0-R2,R14}
14900                ADD     R0,R0,#&100     ; Flag user area
14910                LDR     R1,spritearea
14920                SWI     "XOS_SpriteOp"  ; I-393
14930                LDMFD   R13!,{R0-R2,PC}
14940
14950.trundlevan
14960
14970; On entry,     R0      = Pointer to sprite family name
14980;               R1      = Start position
14990;               R2      = Finish position
15000;               R3      = OS units between each movement (can be -ve)
15010;               R7/R8   = X/Y shift
15020
15030                STMFD   R13!,{R0-R10,R14}
15040                STMFD   R13!,{R0-R3}
15050                MOV     R2,R0
15060                MOV     R9,#ASC"1"      ; Select first sprite
15070                STRB    R9,[R2,#6]
15080                MOV     R0,#40          ; Read sprite info
15090                BL      wimpspriteop    ; I-423
15100                BVS     spritefailure   ; Give up if no sprite
15110                MOV     R5,#1           ; Bottom of van = 1 pixel above
15120                MOV     R5,R5,ASL R8    ; screen bottom (scale it)
15130                SUBS    R3,R3,#1        ; Width of sprite - 1
15140                BMI     spritefailure   ; Give up if width = 0
15150                MOV     R7,R3,ASL R7    ; then shift it by the Xfactor
15160                SUBS    R4,R4,#1        ; Height of sprite - 1
15170                BMI     spritefailure   ; Give up if height = 0
15180                MOV     R8,R4,ASL R8    ; then shift it by the Yfactor
15190                LDMFD   R13!,{R0-R3}
15200                BL      saveundervan    ; Initial temp sprite setup
15210                BVS     vanhitfinish
15220
15230; The rest of this routine deals with moving the van (smoothly !) in
15240; a straight horizontal line between R1 and R2 (step R3). It flips
15250; between 3 different sprites every third video sync.
15260
15270.animationflip  MOV     R10,#3          ; Reset flip counter
15280                STRB    R9,[R0,#6]      ; Select sprite
15290.noanimflip     BL      videosync       ; Smooth out animation
15300                ADR     R4,tempoutsprite; Select saved rectangle
15310                MOV     R6,#0           ; Overwrite screen
15320                BL      plotsprite      ; Restore underneath rectangle
15330                BVS     vanhitfinish
15340                ADD     R1,R1,R3        ; Move van xcoord
15350                MOVS    R3,R3           ; Which way is the van going ?
15360                BPL     lefttoright
15370                CMP     R1,R2           ; If left, then stop when less
15380                BLT     vanhitfinish
15390                B       vanstillgoing
15400.lefttoright    CMP     R1,R2           ; If right, then stop when more
15410                BGT     vanhitfinish
15420.vanstillgoing  BL      saveundervan    ; Save underneath again
15430                BVS     vanhitfinish
15440                MOV     R4,R0
15450                MOV     R6,#8           ; Overwrite but use mask
15460                BL      plotsprite      ; Plot van in new position
15470                BVS     vanhitfinish
15480                SUBS    R10,R10,#1
15490                BNE     noanimflip      ; Have 3 moves gone by ?
15500                ADD     R9,R9,#1        ; Yes, so next sprite please
15510                CMP     R9,#ASC"4"
15520                MOVEQ   R9,#ASC"1"
15530                B       animationflip
15540.spritefailure  LDMFD   R13!,{R0-R3}
15550.vanhitfinish   LDMFD   R13!,{R0-R10,PC}
15560
15570.saveundervan
15580
15590; On entry,     R1      = Left X position of van
15600;               R5      = Bottom Y position of van
15610;               R7/R8   = Van sprite width/height (minus one unit)
15620
15630                STMFD   R13!,{R0-R7,R14}
15640                ADR     R2,tempoutsprite
15650                MOV     R3,#0           ; No palette
15660                MOV     R4,R1           ; Left side
15670                ADD     R6,R4,R7        ; Right side (Left+Width)
15680                ADD     R7,R5,R8        ; Top side (Bottom+Height)
15690                MOV     R0,#16          ; Save rectangle to sprite
15700                BL      spriteop        ; I-405
15710                LDMFD   R13!,{R0-R7,PC}
15720
15730.plotsprite
15740
15750; On entry,     R1      = Left xcoord
15760;               R4      = Pointer to sprite name
15770;               R5      = Bottom ycoord
15780;               R6      = Action code (0 = overwrite, 8 = ditto with mask)
15790
15800                STMFD   R13!,{R0-R5,R9,R14}
15810                MOV     R2,R4   ; Lots of register juggling !
15820                MOV     R3,R1
15830                MOV     R4,R5
15840                MOV     R5,R6
15850                MOV     R0,#34            ; Plot sprite. I-417
15860                MOV     R9,R6
15870                BL      choosesprcall
15880                LDMFD   R13!,{R0-R5,R9,PC}
15890
15900.choosesprcall
15910
15920; On entry,     R9      = 0 => Use OS_SpriteOp, <> 0 => Use Wimp_SpriteOp
15930
15940                STMFD   R13!,{R14}
15950                MOVS    R9,R9           ; Select routine depending on reg
15960                BEQ     donormsprcall
15970                BL      wimpspriteop
15980                B       endthesprcall
15990.donormsprcall  BL      spriteop
16000.endthesprcall  LDMFD   R13!,{PC}
16010
16020.dovananimation
16030
16040; On entry,     R6      = Address of routine to call for trashing
16050; On exit,      V       = Set if trashing failed
16060
16070                STMFD   R13!,{R0-R8,R14}
16080                LDRB    R0,CMOSbyte
16090                TST     R0,#%100        ; Animation enabled ?
16100                BEQ     noanimtoday
16110                ADR     R0,inputblock
16120                ADR     R1,outputblock
16130                SWI     "XOS_ReadVduVariables"  ; Get mode info. I-345
16140                LDR     R0,[R1]         ; Is it a 16-colour MODE ?
16150                CMP     R0,#15
16160                BEQ     itsa16col
16170.noanimtoday    BL      trashthestuff   ; Not right mode, so delete now
16180                B       endofseq
16190.itsa16col      BL      getcaniconinfo  ; R2 = Right X coord of icon
16200                BL      inituserarea    ; *SNew the user sprite area
16210                LDR     R7,[R1,#4]      ; X shift needed
16220                LDR     R8,[R1,#8]      ; Y shift needed
16230                LDR     R1,[R1,#12]     ; Number of X pixels - 1
16240                MOV     R1,R1,ASL R7    ; Start = far right
16250                BIC     R1,R1,#%1111    ; Make sure a multiple of 16
16260                MOV     R0,#4
16270                ADD     R2,R2,R0,ASL R7 ; Finish = 4 pixels to can right
16280                BIC     R2,R2,#%1111    ; Also a multiple of 16
16290                ADR     R0,vanleftname  ; Van is pointing to left
16300                MVN     R3,#15          ; Go left 16 OS units at time
16310                BL      trundlevan
16320                BL      trashthestuff   ; Delete (rename) the stuff
16330                BVS     endofseq
16340                MOV     R0,R1           ; New Start = Old Finish
16350                MOV     R1,R2           ; and vice versa
16360                MOV     R2,R0
16370                ADR     R0,vanrightname ; Van is pointing to right
16380                RSB     R3,R3,#0        ; Flip travel direction
16390                BL      trundlevan
16400.endofseq       LDMFD   R13!,{R0-R8,PC}
16410.inputblock     EQUD    3               ; NColour
16420                EQUD    4               ; XEigFactor
16430                EQUD    5               ; YEigFactor
16440                EQUD    11              ; XWindLimit
16450                EQUD    -1
16460.outputblock    EQUS    STRING$(16,bl$)
16470.tempoutsprite  EQUS    "tempvan"+bl$
16480
16490.scantrashspr   STMFD   R13!,{R1,R2,R14}
16500                ADR     R1,iconspritename
16510                ADR     R2,trashiconname
16520                BL      iconsprites     ; Load in trash can sprites
16530                LDMFD   R13!,{R1,R2,PC}
16540
16550.iconsprites
16560
16570; On entry,     R1      = Filename to load if R2 sprite not present
16580;               R2      = Sprite name to check for existence
16590
16600                STMFD   R13!,{R0-R6,R14}
16610                MOV     R0,#40          ; Read sprite info reason code
16620                BL      wimpspriteop    ; Does sprite exist ? I-423
16630                MOVVS   R0,#11          ; Merge sprite file reason code
16640                MOVVS   R2,R1
16650                BLVS    wimpspriteop    ; I-400
16660                ADRVS   R0,wotnoicons
16670                SWIVS   "OS_GenerateError"
16680                LDMFD   R13!,{R0-R6,PC}
16690.wotnoicons     EQUD    0
16700                EQUS    prog$+" sprites could not be loaded"+bl$
16710                ALIGN
16720
16730.scanvanspr     STMFD   R13!,{R1,R2,R14}
16740                ADR     R2,vanleftname
16750                MOV     R1,#ASC"3"
16760                STRB    R1,[R2,#6]
16770                ADR     R1,loadthevan
16780                BL      iconsprites     ; Load in trash van sprites
16790                LDMFD   R13!,{R1,R2,PC}
16800.trashiconname  EQUS    "!trash2"+bl$
16810.iconspritename EQUS    "<TrashWork$Dir>.!Sprites"+bl$
16820                ALIGN
16830.vanleftname    EQUS    "vanlft1"+bl$
16840.vanrightname   EQUS    "vanrgt1"+bl$
16850.loadthevan     EQUS    "<TrashWork$Dir>.VanSprites"+bl$
16860                ALIGN
16870
16880.loadtemplate
16890
16900; Load in Info window template. I'm not happy that the LoadTemplate docs
16910; in the new PRMs fail to refer you to OpenTemplate (which MUST be called
16920; first to tell the WIMP which template file you're dealing with). Yes,
16930; you can find the blurb on III-1153, but I would've liked a clue - I
16940; kept getting 'Channel' errors until I realised what was going on !
16950
16960                STMFD   R13!,{R0-R6,R14}
16970                LDR     R1,templatehandle       ; Already got template ?
16980                MOVS    R1,R1
16990                BNE     havetemplate
17000                ADR     R1,tempfilename         ; New template file
17010                SWI     "XWimp_OpenTemplate"    ; III-1236
17020                ADRVS   R0,wotnotempfile        ; Certainly can't go on
17030                SWIVS   "OS_GenerateError"      ; if no template file
17040                LDR     R1,workspace
17050                SUB     R1,R1,#stackspace%       ; Point to start of RMA
17060                ADD     R2,R1,#&300     ; Indirected data goes here
17070                ADD     R3,R2,#&100     ; End of indirected data
17080                MVN     R4,#0   ; -1 => no fonts involved
17090                ADR     R5,templatename ; Point to template name
17100                MOV     R6,#0   ; First call (actually want Info window)
17110                SWI     "XWimp_LoadTemplate"    ; III-1238
17120                MOVS    R6,R6                   ; I want my Info window !
17130                ADREQ   R0,wotnoinfowind        ; (R6=0 if not found)
17140                SWIEQ   "OS_GenerateError"
17150; Wimp_LoadTemplate has left R1 pointing to the Info window template
17160; so it's best to store the handle and then create the window
17170                STR     R1,templatehandle
17180                ADR     R5,specialyear
17190                ADR     R6,autoyear
17200                BL      autostamptemp           ; Add year
17210                ADR     R5,specialstamp
17220                ADR     R6,autodate
17230                BL      autostamptemp           ; Add version/date
17240                SWI     "XWimp_CloseTemplate"   ; III-1237 (ignore error)
17250.havetemplate   SWI     "XWimp_CreateWindow"    ; III-1174 (ignore error)
17260                STR     R0,submenupoke  ; Info sub-menu item
17270                LDMFD   R13!,{R0-R6,PC}
17280.templatename   EQUS    "Info"+STRING$(8,bl$)
17290.templatehandle EQUD    0
17300.tempfilename   EQUS    "<TrashWork$Dir>.Templates"+bl$
17310                ALIGN
17320.wotnotempfile  EQUD    0
17330                EQUS    "No "+prog$+" template file"+bl$
17340                ALIGN
17350.wotnoinfowind  EQUD    0
17360                EQUS    "No Info window in template file"+bl$
17370.specialyear    EQUS    "YYYY"
17380.autoyear       EQUS    RIGHT$(date$,4)+cr$
17390.specialstamp   EQUS    "A.BB"
17400.autodate       EQUS    resdate$+cr$
17410                ALIGN
17420
17430.autostamptemp
17440
17450; On entry,     R1      = Template data start
17460;               R3      = Template data end
17470;               R5      = Pointer to special search string (4 bytes)
17480;               R6      = Pointer to replacement string (CR-termed)
17490
17500                STMFD   R13!,{R0-R4,R14}
17510.scanallfour    MOV     R2,#3           ; Search string = 4 bytes
17520.stillnostamp   LDRB    R4,[R1,R2]
17530                LDRB    R0,[R5,R2]
17540                CMP     R4,R0
17550                BNE     nosubmatch      ; Next byte if no match
17560                SUBS    R2,R2,#1        ; Keep scanning until all four
17570                BPL     stillnostamp    ; found
17580                B       exactdate
17590.nosubmatch     ADD     R1,R1,#1        ; Next byte (leave if no more)
17600                CMP     R1,R3
17610                BNE     scanallfour
17620                B       nochangetodate
17630.exactdate      MOV     R0,R6           ; Copy replacement string on
17640.doautostamp    LDRB    R2,[R0],#1      ; top of search result addr
17650                STRB    R2,[R1],#1      ; up until a CR (indirected data
17660                CMP     R2,#13          ; ends in a CR, not 0).
17670                BNE     doautostamp
17680                B       scanallfour
17690.nochangetodate LDMFD   R13!,{R0-R4,PC}
17700
17710.getmenuiconinfo
17720
17730; On entry,     R2      = Window handle
17740;               R3      = Icon handle
17750; On exit,      R0      = Pointer to text string
17760;               R1      = Pointer to 'Empty Trash' menu string
17770                STMFD   R13!,{R2,R3,R14}
17780                BL      geticoninfo
17790                ADD     R0,R1,#28       ; Pointer to menu text
17800                ADR     R1,trashstat+4
17810                LDMFD   R13!,{R2,R3,PC}
17820
17830.makenewmenu
17840
17850; On entry,     R1      = Pointer to Wimp_Poll block
17860
17870                STMFD   R13!,{R2,R14}
17880                LDR     R2,[R1]         ; Get X returned from Wimp_Poll
17890                SUB     R2,R2,#64       ; Subtract 64 for easy access
17900                STR     R2,newmenux     ; Save X coord
17910                BL      makemenu
17920                LDMFD   R13!,{R2,PC}
17930
17940.makeoldmenu    STMFD   R13!,{R2,R14}
17950                LDR     R2,newmenux     ; Retrieve X coord
17960                BL      makemenu
17970                LDMFD   R13!,{R2,PC}
17980
17990.makemenu
18000
18010; On entry,     R2      = X coord of menu
18020; Must display a menu using Wimp_CreateMenu.
18030
18040                STMFD   R13!,{R1,R3,R14}
18050                MOV     R3,#228         ; Menu Y = 228 if on icon bar
18060                ADD     R3,R3,#44*3     ; + 3 items worth for new bits
18070                ADR     R1,multiquitaddr
18080                STR     R1,multiquitpoke
18090                ADR     R1,menublock
18100                SWI     "XWimp_CreateMenu"      ; III-1226
18110                LDMFD   R13!,{R1,R3,PC}
18120.newmenux       EQUD    0       ; Save menu X coord here
18130
18140.menublock
18150; Menu structure first...
18160                EQUS    prog$+STRING$(12-LEN(prog$),bl$) ; Menu title
18170                EQUB    7       ; Foreground = 7 (normally black)
18180                EQUB    2       ; Background = 2 (normally grey)
18190                EQUB    7       ; Work fore  = 7 (normally black)
18200                EQUB    0       ; Work back  = 0 (normally white)
18210                EQUD    188     ; Total width of menu items
18220                EQUD    44      ; Total height of menu items
18230                EQUD    0       ; Line spacing between items
18240; ...then Menu item #1
18250                EQUD    0       ; Nothing special
18260.submenupoke    EQUD    0       ; Sub-menu addr poked in here
18270                EQUD    (7<<24) OR 1 ; Item has text and is black
18280                EQUS    "Info       "+bl$
18290; ...then Menu item #2
18300.immediatestat  EQUD    0       ; Nothing special
18310                EQUD    -1      ; No sub-menu
18320                EQUD    (7<<24) OR 1 ; Item has text and is black
18330                EQUS    "Immediate  "+bl$       ; Menu item
18340; ...then Menu item #3
18350.warningstat    EQUD    0       ; Nothing special
18360                EQUD    -1      ; No sub-menu
18370                EQUD    (7<<24) OR 1 ; Item has text and is black
18380                EQUS    "Warning    "+bl$       ; Menu item
18390; ...then Menu item #4
18400.animationstat  EQUD    0       ; Nothing special
18410                EQUD    -1      ; No sub-menu
18420                EQUD    (7<<24) OR 1 ; Item has text and is black
18430                EQUS    "Animation  "+bl$       ; Menu item
18440; ...then Menu item #5
18450                EQUD    0       ; Nothing special
18460                EQUD    -1      ; No sub-menu
18470; This word has to have bit 22 changed depending on Trash contents
18480; Bit 22 refers to whether the item is shaded (unselectable) or not
18490.trashstat      EQUD    (7<<24) OR 1 ; Item has text and is black
18500                EQUS    "Empty Trash"+bl$       ; Menu item
18510; ...and finally Menu item #6
18520                EQUD    &80     ; Last menu item
18530.multiquitpoke  EQUD    0       ; Quit sub-menu addr poked in here
18540                EQUD    (7<<24) OR 1 ; Item has text and is black
18550                EQUS    "Quit       "+bl$       ; Menu item
18560; Now for the Quit option sub-menu
18570.multiquitaddr  EQUS    "Quit"+STRING$(8,bl$) ; Menu title
18580                EQUB    7       ; Foreground = 7 (normally black)
18590                EQUB    2       ; Background = 2 (normally grey)
18600                EQUB    7       ; Work fore  = 7 (normally black)
18610                EQUB    0       ; Work back  = 0 (normally white)
18620                EQUD    156     ; Total width of menu items
18630                EQUD    44      ; Total height of menu items
18640                EQUD    0       ; Line spacing between items
18650; Menu item #1
18660                EQUD    0       ; Nothing special
18670                EQUD    -1      ; No sub-menu
18680                EQUD    (7<<24) OR 1 ; Item has text and is black
18690                EQUS    "Temporary  "+bl$
18700; Menu item #2
18710                EQUD    &80     ; Last menu item
18720                EQUD    -1      ; No sub-menu
18730                EQUD    (7<<24) OR 1 ; Item has text and is black
18740                EQUS    "Permanent  "+bl$
18750]NEXT
18760
18770REM Save as a module !RunImage
18780F$="$.!Trash.!RunImage"
18790SYS "OS_File",&A,F$,&FFA,,org,P%
18800END
18810
18820REM OK, I could change @%, but can YOU understand the various bits of @% ?
18830REM Why on earth didn't Roger put new FIELD,PLACES etc. keywords in ?
18840DEFFNfraction(V%)=STR$(V% DIV 100)+"."+RIGHT$("0"+STR$(V% MOD 100),2)

� >$.!Trash.TrashSrc

>� RISC OS Trash Can Module V1.40 (C) Richard K. Lloyd 1990
(
2G� This source code is released into the Public Domain for anyone to
<?� use, although some credit in your source might be nice...
F
P� Special thanks to:
Z;� - Philip Colmer (PColmer@uk.co.acorn) for suggestions
d5� - Rabin Ezra (rabin@uk.ac.qmc.cs) for bug fixes
nH� - David Pilling (mcbmsdp@uk.ac.mcc.cms) for a beta-test Spark 2.00
xB� - Gary Bartlett () for the Trash Van inspiration and sprites
�J� - Me (rkl@uk.ac.liv.cs.and) for filling a gaping hole in the Desktop
�
�?� Volume/page references are for the RISC OS Issue 1 (1989)
�.� 4-volume Programmer's Reference Manuals.
�
�*� Version 1.40 Released September 1990
�5� - Context-sensitive !Help information provided.
�A� - "Persistent" menu if right button pressed on a menu item.
�I� - New sprites with a Spark-like "flash" - shown if Spark installed.
�;� - Now "Spark-aware" regardless of installation order.
�K� - Incorrect border flash when clicking instead of dragging now fixed.
�
�%� Version 1.30 Released July 1990
I� - Configuration of new menu options (see below) stored in CMOS RAM.
K� - 'Immediate' menu option to erase files straight away on a trashing.
J� - 'Warning' menu option to turn the border red during dangerous ops.
"H� - 'Animation' menu option to show an icon bar Van during deletion.
,H� - New VanSprites file (and code to handle it) for above animation.
6K� - Fixed Info template workspace fault (force reload after Temp Quit).
@J� - Auto-time/datestamp updating of Info window without using !Formed.
JD� - Added, ahem, a "debug%" flag for window/icon handle display.
TG� - 'Immediate' mode now accidentally simulates the behaviour of an
^J�   Atari ST trash can ! In other words, no fat icon, no Trash Window,
hK�   no retention of trashed files in Trash$Dir. Pretty rubbish (!) eh ?
r
|(� Version 1.20 Released January 1990
�J� - Report errors if any occur during the trashing/emptying processes.
�C� - Switch on hourglass if trashing takes longer than 1 second.
�E� - Supports file trashing from inside archives using Spark 2.xx.
�J� - Displays an error if *Desktop_TrashCan issued outside the Desktop.
�
�@� Version 1.11 Released November 1989 (2 days after V1.10 !)
�4� - Fixed *fatal* bug with V1.10 Info menu item.
�,� - Slightly re-coded Quit menu parsing.
�9� - Adjusted menu widths and heights (Philip Colmer).
�:� - Allowed Info window to be dragged (Philip Colmer).
�
�)� Version 1.10 Released November 1989
�1� - Enhancements by Philip Colmer from 1.02a:
K�   - Third sprite added to overcome trash can 'love-handles' in Filer.
H�   - Correction of icon bar parameter block (wildly wrong in 1.02).
>�   - Hard-coded Info window replaces cheap sub-menu Info.
&+� - Enhancements by RKL on top of this:
0E�   - Uses Templates for Info window (boy, do I hate !FormEd...).
:3�   - New Temporary/Permanent Quit menu option.
D?�   - Claims RMA during module life for internal workspace.
NI�   - Set TrashWork$Dir to <Obey$Dir> in !Run (template/sprites dir).
XA�   - Performs internal *IconSprites call (Wimp_SpriteOp 11).
b
lC� Version 1.02a - not released (Modifications by Philip Colmer)
v
�)� Version 1.02 Released November 1989
�C� - Had to redefine !Trash sprite because of Wimp_SetIconState.
�1� - Bug fixes (including code) by Rabin Ezra:
�0�   - Extended Trash$Dir buffer to 64 chars.
�:�   - Checked for Trash$Dir expansion buffer overflow.
�2�   - Zero-terminated the Trash$Dir expansion.
�E� - Improvement suggestions (with coding hints) by Philip Colmer:
�8�   - Moved Trash Can icon to left side of icon bar.
�3�   - Improved filing system activity trapping.
�5�   - Stopped annoying icon bar "icon shuffling".
�
�%� Version 1.01 Released July 1989
�#� - Fixed rename inconsistency.
0� - Added Wimp_Poll message acknowledgement.
B� - Extended maximum length of expanded Trash$Dir to 48 chars.
2� - Set Trash$Dir to <Obey$Dir>.Trash in !Run.
 E� - Posted with Acorn's "official" uuencode to avoid IBM munging.
*
4%� Version 1.00 Released July 1989
>H� - Mac-style trash can with Mac-style icons (ResEdit was useful !).
HF� - Survives anything except hard reset, module kill or power off.
R
\C� Check out the Indigo Girls' eponymously-titled album (on CD):
fL� great acoustic guitar harmonies - reached US #22 (sadly nowhere in UK)
pL� RKL's Best Album Of 1989: Diesel Park West's "Shakespeare Alabama" CD.
z'� RKL's Best Albums Of 1990 so far:
�>� All those Beach Boys 2-for-1 CD reissues - great stuff !
�
�*� org &2000:� Plenty of assembly space
�
�� Application constants
�
�3prog$="Trash Can":� English text name of module
�9ver$="1.40":� Version number of module in X.YY format
�H� Change next line to date$=MID$(TIME$,5,11) to get the current date
�8date$="10 Sep 1990":� Current date as a fixed string
�4resdate$=�date$,2)+"-"+�date$,4,3)+"-"+�date$,2)
�Dresdate$=ver$+" ("+resdate$+")":� Version/date for Info Template
�7command$="Desktop_TrashCan":� * command implemented
<trashvar$="Trash$Dir":� Trash can environmental variable
Cwimp$="Wimp$Scrap":� Wimp temporary file environmental variable
Kmaxpathlen%=64:� Maximum length of expanded Trash$Dir (inc. terminator)
$Jiconbartype%=-2:� -1 = Utility (RHS of bar), -2 = Service (LHS of bar)
.>windman%=200:� Expect at LEAST V2.00 of the Window Manager
8Gstackspace%=&800:� 2K for internal RMA stack and template workspace
BFwindowspace%=&800:� 2K for Wimp_GetWindowInfo / Wimp_TransferBlock
L1spritespace%=3*1024:� 3K for sprite user area
VJsparkdel$="!spark -d ":� Spark command to delete a file inside archive
`:battery%=38:� CMOS RAM location used to store settings
j>debug%=�:� So-called debugging - prints window/icon handle
t
~0� Time for some constants to help the reader
�
�2bl$=�(0):� NULL char used to terminate strings
�cr$=�(13):� Plain CR
�4UpCallV=&1D:� Warning vector for FS change check
�GXOS_WriteI=&20100:� X SWI form of OS_WriteI (used for VDU 7). I-199
�
�<Service_Reset      =&27:� End of machine reset signalled
�FService_StartWimp  =&49:� Request by Desktop to start WIMP modules
�DService_StartedWimp=&4A:� Desktop indicates all tasks now active
�
�� A%=0 � 2 � 2
�
P%=org
[OPT A%


E; Note that the module header must contain ADDRESS �SETS from the
I; start of the module, hence a subtraction of org is required. II-628
(
2F                EQUD    appstart-org      ; Application start addr
<C                EQUD    init-org          ; Initialisation addr
FA                EQUD    byebye-org        ; Finalisation addr
PI                EQUD    servicecall-org   ; Service call handler addr
ZH                EQUD    titlestr-org      ; Module title string addr
d@                EQUD    helpstr-org       ; Help string addr
nG                EQUD    keywords-org      ; Command/help table addr
x@                EQUD    0                 ; No extra SWIs...
�B                EQUD    0                 ; What do you want ?
�7                EQUD    0                 ; Blood ?
�A                EQUD    0                 ; Well hard luck...
�
�I; Title string to be used by *Modules and when *RMKilling etc. II-635
�I; Due to the way *Help works in RISC OS, avoid calling the module the
�I; same name as one of its * commands (I've been guilty of this ...!).
�
�*.titlestr       EQUS    "TrashCan"+bl$
�                ALIGN
�
�9; Help string to be used in *Help Modules etc. II-635
�B; Note the tab character as recommended by Acorn. A second tab
G; character will be needed if prog$ is < 8 characters (unlikely !).

;.helpstr        EQUS prog$+�(9)+ver$+" ("+date$+")"+bl$
"                ALIGN
,
6B; Keyword lookup table for *Help and command execution. II-636
@G; Any addresses should, as usual, be offsets from the module start.
JF; Note- Modules that multi-task under the Wimp MUST have a startup
TF;       * command because of the way Start_WimpTask is called when
^(;       the Desktop first starts up.
h
r
.keywords
|<.startupname    EQUS    command$+bl$    ; * command name
�C                ALIGN                   ; MUST include an ALIGN
�E                EQUD    startupcomm-org ; TrashCan exec addr �SET
�@                EQUB    0               ; Minimum params = 0
�D                EQUB    %00000000       ; No OS_GSTrans peformed
�@                EQUB    0               ; Maximum params = 0
�L                EQUB    %00000000       ; No *Conf or special *Help code
�I                EQUD    noparams-org    ; Special params message �SET
�F                EQUD    startuphelp-org ; * command help text �SET
�@                EQUD    0               ; No more * commands
�
�M; If any parameters supplied, then complain. In actual fact, this message
�J; is displayed if params<min or params>max (just that min=max=0 here).
�
4.noparams       EQUS    "Syntax: *"+command$+bl$
                ALIGN

&B; *Help text goes here. Avoid �(13) or �(10) unless absolutely
0E; necessary (usually to split the *Syntax message from the rest),
:A; because this text is OS_PrettyPrinted. Hard spaces = �(31).
D
Nh.startuphelp    EQUS    "The "+prog$+" utility provides a trash can icon on the icon bar, and uses "
X�                EQUS    "the Filer to display the trash can contents."+cr$+�(10)+"Do not use *"+command$+", use *Desktop instead."+bl$
b                ALIGN
l
v1; PHEW ! Now let's get down to some coding...
�
�.internalreset
�
�I; An internal task variable is set to zero (not running) on execution
�K; of the Initialisation code, at the end of a machine (soft !) reset or
�<; when an old task is shutdown (to prevent duplication).
�
�)                STMFD   R13!,{R0,R14}
�!                MOV     R0,#0
�K                STR     R0,taskhandle   ; Task not running, not claimed
�H                STR     R0,sparktaskhand; Don't know about Spark yet
�D                STR     R0,sparkwindhand; or the window involved
�>                STRB    R0,glassstat    ; Hourglass is off
(                LDMFD   R13!,{R0,PC}

.servicecall
 
*<; The location 'taskhandle' holds the state of the task:
4:; 0  = Not running, waiting to claim Service_StartWimp
>H; -1 = Not running, claimed Service_StartWimp, waiting for * command
HE; >0 = Running, value set to Wimp_Initialise returned task handle
R
\K; The Service_Reset signal (Service Call &27) is the �LY way (I know..)
fI; to execute module code at the end of a machine reset. I use this to
p(; shutdown the task if still active.
z7; II-681 ---> DOESN'T TELL YOU to refer to III-1161
�
�L                CMP     R1,#Service_Reset       ; End of machine reset ?
�E                BEQ     init                    ; Yes, so restart
�
�H; The very first thing that the Desktop does after a Wimp_Initialise
�H; is to signal Service_StartWimp (Service Call &49) to every module.
�J; Those that are interested in being trendy (OK, multi-tasking), claim
�D; that service call � THEY ARE � ALREADY RUNNING and, of course,
�?; haven't already received and claimed a Service_StartWimp.
�L; II-701 ---> annoyingly referring to the rough 'Window Manager' chapter
�G;             (turns out, after much page scanning, to be III-1159)
�
�J                CMP     R1,#Service_StartWimp   ; Are we firing up the
	?                BEQ     round1                  ; Desktop ?
	
	D; Once everyone's responded to Service_StartWimp who wants to, a
	$@; 'final chance' is sent around - Service_StartedWimp (&4A).
	.H; II-702 ---> annoyingly (vaguely, like above) referring to III-1161
	8
	BH                CMP     R1,#Service_StartedWimp ; Round 2 of Desktop
	L"                BEQ     round2
	V
	`K                MOV     PC,R14          ; Not interested in any of them
	j
	t).round1         STMFD   R13!,{R2,R14}
	~)                LDR     R2,taskhandle
	�I                MOVS    R2,R2                   ; Is taskhandle = 0 ?
	�M                MVNEQ   R2,#0                   ; Yes, so taskhandle = -1
	�)                STREQ   R2,taskhandle
	�I; Claim the Service Call because not running and not prev. claimed it
	�J                ADREQ   R0,startupname          ; => *Desktop_Trashcan
	�A                �Q   R1,#0                   ; Claim the call
	�(                LDMFD   R13!,{R2,PC}
	�
	�.round2
	�
	�D; Since the * command may have failed, the task handle should be
	�); set to 0 if it's still stuck at -1.


)                STMFD   R13!,{R2,R14}
)                LDR     R2,taskhandle
J                MOVS    R2,R2                   ; Is taskhandle = -1 ?
(I                MOVMI   R2,#0                   ; Stuck, so unstick !
2)                STRMI   R2,taskhandle
<(                LDMFD   R13!,{R2,PC}
F
P
.claimRMA
Z
d0; On entry,     R3      = RMA space required
n6; On exit,      R2      = Pointer to claimed space
x
�)                STMFD   R13!,{R0,R14}
�7                MOV     R0,#6           ; Claim RMA
�4.joinclaim      SWI     "XOS_Module"    ; II-655
�(                ADRVS   R0,poorclaim
�:                SWIVS   "OS_GenerateError"      ; I-41
�(                LDMFD   R13!,{R0,PC}
�.poorclaim      EQUD    0
�7                EQUS    "RMA workspace failure"+bl$
�                ALIGN
�
�.releaseRMA
�
�=; On entry,     R2      = Pointer to space to be released

)                STMFD   R13!,{R0,R14}
9                MOV     R0,#7           ; Release RMA
"%                B       joinclaim
,
6.startupcomm
@
JD; Once Service_WimpStart has been claimed, the Desktop will call
TG; Wimp_StartTask with R0 = * command addr returned by the claimant.
^H; Unfortunately, you can't dive straight in and start executing your
hD; code - you have to call OS_Module 2 (Enter Application) first.
r
|,                STMFD   R13!,{R0-R2,R14}
�M                MOV     R2,R0                   ; Point to * command tail
�N                MOV     R0,#0                   ; How many tasks running ?
�>                SWI     "XWimp_ReadSysInfo"     ; III-1284
�E                MOVS    R0,R0                   ; None, so not in
�=                ADREQ   R0,notindesktop         ; Desktop
�.                SWIEQ   "OS_GenerateError"
�J                ADR     R1,titlestr             ; Point to module name
�G                MOV     R0,#2                   ; Enter Application
�<                SWI     "XOS_Module"            ; II-651
�+                LDMFD   R13!,{R0-R2,PC}
�.notindesktop   EQUD    0
�B                EQUS    "Use *Desktop to start the "+prog$+bl$
�                ALIGN


.leavenow

&K; User-instigated quit requested, so shutdown task and leave gracefully
0H; On entry,     R9      = 0 for Temporary Quit, 1 for Permanent Quit
:E;                       = -1 for main (rather than sub) menu Quit
DM; For the moment, R9 = -1 is treated as a Permanent Quit (happy Philip ?)
N
XC                BL      wimpclosedown   ; All done, so shutdown
b8                MOVS    R9,R9   ; Severity of Quit ?
l                �Q   R1,#0
v                �Q   R2,#0
�?                SWIEQ   "OS_Exit"       ; 0 = Mild ! II-743
�8                ADR     R0,trashname1   ; First name
�6                MVN     R2,#0   ; Delete variables
�0                MOV     R3,#0   ; First call
�3                MOV     R4,#0   ; Normal string
�F                SWI     "XOS_SetVarVal" ; Delete Trash$Dir. II-752
�9                ADR     R0,trashname2   ; Second name
�0                MOV     R3,#0   ; First call
�3                MOV     R4,#0   ; Normal string
�B                SWI     "XOS_SetVarVal" ; Delete TrashWork$Dir
�!                MOV     R0,#0
�!                MOV     R1,#0
�!                MOV     R2,#0

'                ADR     R3,titlestr

G                SWI     "OS_ExitAndDie" ; -1 or 1 = Severe ! II-758

+.trashname1     EQUS    "Trash$Dir"+bl$

 /.trashname2     EQUS    "TrashWork$Dir"+bl$

*                ALIGN

4

>.registerspark

H

R7; On entry,     R5      = Spark's "new" task handle

\

f)                STMFD   R13!,{R0,R14}

pA                LDR     R0,sparktaskhand; Get old task handle

z>                CMP     R0,R5           ; Is it new info ?

�B                STRNE   R5,sparktaskhand; Save new task handle

�C                BLNE    redocontents    ; Update trash can icon

�(                LDMFD   R13!,{R0,PC}

�

�.inituserarea

�

�K; After about 75 million different attempts at coding using OS_SpriteOp

�H; only, OS_SpriteOp mixed with Wimp_SpriteOp and Wimp_SpriteOp only,

�J; I came to following conclusions regarding Wimp programs and sprites:

�F; 1) Use Wimp_SpriteOp for reading Sprite files and plotting them.

�L; 2) Use OS_SpriteOp 16 for saving a rect to a sprite (saves background)

�:;    and OS_SpriteOp 34 for replotting that saved rect

�H; 3) Setup RMA workspace (claim and then call OS_SpriteOp 9) for the
D;    OS_SpriteOp 16/34 calls - do � use the System Sprite area !

,                STMFD   R13!,{R0,R1,R14}
$J                MOV     R0,#spritespace%; Space needed for Van sprites
.H                LDR     R1,spritearea   ; Offset 0 = Total area size
8#                STR     R0,[R1]
BG                MOV     R0,#0           ; Offset 4 = No sprites yet
L&                STR     R0,[R1,#4]
V"                MOV     R0,#16
`J                STR     R0,[R1,#8]      ; Offset 8 = No extension area
jI                STR     R0,[R1,#12]     ; Offset 12 = First free word
tL                MOV     R0,#9           ; Initialise sprite area (*SNew)
~3                BL      spriteop        ; I-398
�+                LDMFD   R13!,{R0,R1,PC}
�
�).dummyspark     STMFD   R13!,{R3,R14}
�J                LDR     R3,sparktaskhand        ; Only send if Spark's
�D                MOVS    R3,R3                   ; handle unknown
�G                LDREQ   R3,windowspace  ; Point to start of command
�4                ADDEQ   R3,R3,#20       ; buffer
�I                BLEQ    sendittospark   ; Tell everyone to do nothing
�(                LDMFD   R13!,{R3,PC}
�
�/.delsparkfile   STMFD   R13!,{R0,R2,R3,R14}
�(                ADR     R0,savedleaf
F                LDR     R3,putleafhere  ; Set up when drag started

@.retrieveleaf   LDRB    R2,[R0],#1      ; Copy leaf onto end
&                STRB    R2,[R3],#1
!                MOVS    R2,R2
((                BNE     retrieveleaf
2G                BL      sendittospark   ; Tell Spark to delete file
<.                LDMFD   R13!,{R0,R2,R3,PC}
F
P,.sendittospark  STMFD   R13!,{R0-R3,R14}
ZG                MOV     R0,#13         ; Needs CR at end of command
d&                STRB    R0,[R3],#1
n!                MOV     R0,#0
x&.padtoword      STRB    R0,[R3],#1
�9                TST     R3,#%11         ; Pad to word
�%                BNE     padtoword
�*                LDR     R1,windowspace
�L                SUB     R0,R3,R1        ; Size (inc. leaf/data) of block
�,                LDR     R2,sparktaskhand
�F                LDR     R3,sparkcommID  ; Spark command message ID
�(                BL      sendamessage
�+                LDMFD   R13!,{R0-R3,PC}
�A.sparkcommID    EQUD    &41000+61       ; Do Spark command ID
�
�.sendamessage
�
�3; On entry,     R0      = Size of message block
G;               R1      = Pointer to message (usu. Wimp_Poll) block
8;               R2      = Task handle (0 = everyone)
,;               R3      = Message action
"
,)                STMFD   R13!,{R0,R14}
6@                STR     R0,[R1]         ; Store block length
@!                MOV     R0,#0
JK                STR     R0,[R1,#12]     ; my_ref = 0 (Original message)
TB                STR     R3,[R1,#16]     ; Store message action
^"                MOV     R0,#18
h:                SWI     "XWimp_SendMessage" ; III-1253
r(                LDMFD   R13!,{R0,PC}
|
�
.appstart
�
�H; Well, here's the start sequence at last ! We only want one of this
�C; task running, so must shut down the old one if it is running.
�
�H                LDR     R13,workspace   ; Reset stack pointer -> RMA
�@                BL      wimpclosedown   ; Shut down old task
�L                MOV     R0,#windman%    ; Expecting V2.00 Window Manager
�J                LDR     R1,taskconstant ; Indicate new-style Wimp task
�J                ADR     R2,description  ; English text name of program
�E                SWI     "XWimp_Initialise" ; Start task. III-1173
�I                CMP     R0,#windman%    ; Are we earlier than V2.00 ?
�?                ADRLT   R0,notrecentwimp; Yes, so crash out
.                SWILT   "OS_GenerateError"
C                STR     R1,taskhandle   ; Save Wimp task handle

&I; At the point, everything is ready for application initialisation...
0
:H                BL      dummyspark      ; Try and get Spark to reply
DL                BL      loadtemplate    ; Load template/make Info window
NF                BL      scantrashspr    ; Load application sprites
X>                BL      readCMOS        ; Setup menu ticks
b8                MOV     R10,#0          ; First scan
cA                STRB    R10,dragstate   ; Assume button is up
l<                BL      checkcontents   ; Scan trash can
vD                BL      scanvanspr      ; Load animation sprites
�
�H; Because applications could rename/delete/copy etc. in a variety of
�B; ways (and not using the WIMP), then have to claim UpCallV to
�+; trap any directory-changing activity.
�
�:                MOV     R0,#UpCallV             ; I-68
�)                ADR     R1,trapupcall
�!                MOV     R2,#0
�:                SWI     "XOS_Claim"             ; I-58
�
�L; ...and a tight Wimp_Poll loop, only quitting when the user requests it
�
�E.intightloop    MOV     R0,#0           ; All reason codes wanted
F                SUB     R1,R13,#stackspace% ; Data returned to RMA
6                SWI     "XWimp_Poll"    ; III-1192
H                LDR     R13,workspace   ; Reset stack pointer -> RMA
 :                MOVS    R0,R0           ; Is it idle ?
*(                BNE     actuallybusy
4I                BL      stopglass       ; Yes, so Hourglass off if on
>J                BL      checkfordrag    ; Are we dragging from Spark ?
HJ                B       checkfsflag     ; See if Trash$Dir has changed
RM.actuallybusy   CMP     R0,#6           ; Check for mouse click. III-1196
\(                BNE     maybemenusel
f>                LDR     R0,[R1,#8]      ; Get button state
pC                CMP     R0,#4           ; Is it left button...?
zF                CMPNE   R0,#1           ; ...or the right button ?
�'                BNE     maybemiddle
�I                LDRB    R0,CMOSbyte     ; Only do something if not in
�<                TST     R0,#%001        ; Immediate mode
�C                BLEQ    peepincan       ; Look inside trash can
�'                B       intightloop
�!.maybemiddle    CMP     R0,#2
�C                BLEQ    makenewmenu     ; Middle button -> menu
�'                B       intightloop
�!.maybemenusel   CMP     R0,#9
�(                BNE     nomouseclick
�F                MOV     R2,R1           ; Save Wimp_Poll block ptr
�F                ADD     R1,R1,#&100     ; Pointer block further on
�>                SWI     "XWimp_GetPointerInfo"  ; III-1214
>                LDR     R0,[R1,#8]      ; Get button state
I                MOV     R1,R2           ; Restore Wimp_Poll block ptr
J                BL      dealwithmenu    ; Menu item selected. III-1199
$F                CMP     R0,#1           ; Is it the right button ?
.A                BLEQ    makeoldmenu     ; Keep menu on screen
8'                B       intightloop
BC.nomouseclick   CMP     R0,#2           ; Info window dragged ?
L=                BNE     maybemessage    ; (Philip Colmer)
V>                SWI     "XWimp_OpenWindow"      ; III-1190
`E                B       intightloop     ; That was nice'n'easy...
jI.maybemessage   CMP     R0,#17          ; Check for message broadcast
t6                CMPNE   R0,#18          ; III-1202
~'                BNE     checkfsflag
�'                LDR     R2,[R1,#16]
�!                MOVS    R2,R2
�@                �Q   R9,#0           ; Signal Temporary Quit
�F                BEQ     leavenow        ; Quit requested. III-1255
�$                MOV     R3,#&500
�=                ADD     R3,R3,#2        ; !Help ID = &502
�C                CMP     R3,R2           ; Was !Help requested ?
�&                BNE     wasitadrag
�=                LDR     R2,[R1,#32]     ; Get icon handle
�@                CMN     R2,#-iconbartype%       ; Icon bar ?
�H                MOVNE   R4,#1           ; No, so must be Info Window
�A                BNE     helpwanted      ; Rejoin help request
=                LDR     R2,[R1,#36]     ; Is it my icon ?

)                LDR     R3,iconhandle
!                CMP     R2,R3
'                BNE     intightloop
(E                MOV     R4,#0           ; Flag that it's the icon
2B.helpwanted     BL      askedforhelp    ; !Help info requested
<'                B       intightloop
FC.wasitadrag     CMP     R2,#3           ; Load data requested ?
P6                BNE     maybespark      ; III-1265
ZE                LDR     R2,[R1,#20]     ; Is it on the icon bar ?
d-                CMN     R2,#-iconbartype%
n'                BNE     intightloop
x=                LDR     R2,[R1,#24]     ; Is it my icon ?
�)                LDR     R3,iconhandle
�!                CMP     R2,R3
�I                BLEQ    moveintotrash   ; File dragged onto trash can
�'                B       intightloop
�L.maybespark     LDR     R3,dyingappmess ; Has an application just died ?
�,                LDR     R4,sparktaskhand
�F                LDR     R5,[R1,#4]      ; Get task handle involved
�!                CMP     R2,R3
�<                CMPEQ   R5,R4           ; Was it Spark ?
�G                �Q   R5,#0           ; If so, forget Spark's handle
�C                BEQ     sparkchange     ; Return icon to normal
�C                LDR     R3,reptaskname  ; Is it the task handle
�;                CMP     R2,R3           ; translation ?
)                BNE     didsparkstart
B                ADR     R0,sparktaskname; Spark's task name...
%                ADD     R2,R1,#28
"D.scanningname   LDRB    R3,[R0],#1      ; ...compare it with the
,K                LDRB    R4,[R2],#1      ; returned name to find a match
6!                CMP     R3,R4
@'                BNE     intightloop
JA                MOVS    R3,R3           ; Still scanning name
T(                BNE     scanningname
^K                LDR     R5,[R1,#20]     ; Retrieve handle matching name
h'                B       sparkchange
rI.didsparkstart  LDR     R3,sparkmessid  ; Has Spark just started up ?
|!                CMP     R2,R3
�J                BEQ     sparkchange     ; OK, time to know about Spark
�B                LDR     R3,sparkcommID  ; Was Spark replying ?
�!                CMP     R2,R3
�K                BNE     whataboutsave   ; Not a response to dummy bcast
�I; At this point, received response from dummy Spark broadcast, so ask
�C; about the name matching the task handle (in R5 at the moment)
�=                MOV     R0,#24          ; Size = 24 bytes
�?                MOV     R2,#0           ; General broadcast
�M                LDR     R3,reqtaskname  ; Request task handle translation
�?                STR     R5,[R1,#20]     ; Store task handle
�(                BL      sendamessage
�'                B       intightloop
�@.whataboutsave  CMP     R2,#1           ; DataSave request ?
L                BNE     intightloop     ; (Spark'ed file onto Trash Can)
H                CMP     R4,R5           ; Check task handle involved
N                BNE     intightloop     ; belongs to Spark and no-one else
&!                MOV     R2,R4
09                LDR     R3,[R1,#8]      ; Copy my_ref
:'                STR     R3,[R1,#12]
D9                MOV     R3,#2           ; DataSaveAck
N'                STR     R3,[R1,#16]
XG                MVN     R3,#0           ; Set file to 'unsafe' (-1)
b'                STR     R3,[R1,#36]
l%                ADD     R3,R1,#44
v(                ADR     R4,savedleaf
�B.savetheleaf    LDRB    R5,[R3],#1      ; Save suggested Spark
�D                STRB    R5,[R4],#1      ; leafname for use later
�!                MOVS    R5,R5
�'                BNE     savetheleaf
�,                ADR     R3,tempsparkname
�%                ADD     R4,R1,#44
�D.copyscrapname  LDRB    R5,[R3],#1      ; Temporary filename for
�J                STRB    R5,[R4],#1      ; decompression = <Wimp$Scrap>
�!                MOVS    R5,R5
�)                BNE     copyscrapname
�C                SWI     "XWimp_SendMessage" ; Spark->decompress
�'                B       intightloop
�J.sparkchange    BL      registerspark   ; Save Spark handle if changed
J                BL      dummyspark      ; Re-broadcast in case there's
A                B       intightloop     ; 2 or more Sparks...
F.sparkmessid    EQUD    &41000+60       ; Spark started message ID
 C.dyingappmess   EQUD    &400C3          ; Message_TaskCloseDown
*@.reqtaskname    EQUD    &400C6          ; Message_TaskNameRq
4@.reptaskname    EQUD    &400C7          ; Message_TaskNameIs
>-.tempsparkname  EQUS    "<"+wimp$+">"+bl$
H                ALIGN
R'.sparktaskname  EQUS    "Spark"+bl$
\                ALIGN
f
pL.checkfsflag    LDRB    R10,fsctrlflag  ; This is why we need all reason
zM                MOVS    R10,R10         ; codes - at any time there could
�F                BLNE    checkcontents   ; be an FS action changing
�7                B       intightloop     ; Trash$Dir
�
�%.description    EQUS    prog$+bl$
�                ALIGN
�.sparktaskhand  EQUD    0
�.sparkwindhand  EQUD    0
�.notrecentwimp  EQUD    0
�b                EQUS    prog$+" requires Window Manager V"+�fraction(windman%)+" or later"+bl$
�                ALIGN
�
�	.init
�
D; This routine is called when the module is first loaded, when a
?; *RMReInit is called or when a machine reset is signalled.

$,                STMFD   R13!,{R2,R3,R14}
.@                BL      internalreset   ; Only want to reset
8A                MOV     R3,#stackspace% ; Claim RMA for stack
BD                LDR     R2,workspace    ; See if already claimed
L!                MOVS    R2,R2
V$                BLEQ    claimRMA
`H                ADDEQ   R2,R2,R3        ; Adjust to end of workspace
jH                STREQ   R2,workspace    ; cos stack builds downwards
tD                �Q   R3,#windowspace%; Claim RMA for window info
~$                BLEQ    claimRMA
�*                STREQ   R2,windowspace
�I                �Q   R3,#spritespace%; Claim RMA for sprite workspace
�$                BLEQ    claimRMA
�)                STREQ   R2,spritearea
�+                LDMFD   R13!,{R2,R3,PC}
�.workspace      EQUD    0
�.windowspace    EQUD    0
�.spritearea     EQUD    0
�/.savedleaf      EQUS    �11,bl$) ; Filename
�                ALIGN
�
�.changeicon


G; On entry,     R1      = � "1" for thin trash can, � "2" for thick
2; This routine has been added to V1.02 onwards
M; Entry param different in V1.10 onwards for new thin can (Philip Colmer)
(6; Now adds 2 to R1 if Spark's task handle is known
2
<,                STMFD   R13!,{R0,R1,R14}
FM                LDR     R0,sparktaskhand; Do we know Spark's handle yet ?
P!                MOVS    R0,R0
ZJ                ADDNE   R1,R1,#2        ; Yes, so use 'flashy' sprites
d+                LDRB    R0,spritename+6
nK                CMP     R0,R1           ; No point in call if no change
x@                STRNEB  R1,spritename+6 ; Toggle sprite name
�+                ADRNE   R1,iconstateblk
�5; Boy - my favourite opcode is on the next line !
�M                SWINE   "XWimp_SetIconState"    ; III-1211. Avoid shuffle
�+                LDMFD   R13!,{R0,R1,PC}
�(.iconstateblk   EQUD    iconbartype%
�.iconhandle     EQUD    0
�J                EQUD    0       ; � word      ; Both words set to zero
�L                EQUD    0       ; Clear word    ; because flags the same
�
�
.makeicon
�
�G; On entry,     R1      = � "1" for thin trash can, � "2" for thick
�K; Note - Sprites should be called '!trash1' and '!trash2' - do � rename
M; Entry param different in V1.10 onwards for new thin can (Philip Colmer)

,                STMFD   R13!,{R0,R1,R14}
">                STRB    R1,spritename+6 ; Poke name ending
,)                ADR     R1,spritename
6)                STR     R1,pokespname
@(                ADR     R1,iconblock
J>                SWI     "XWimp_CreateIcon"      ; III-1180
T)                STR     R0,iconhandle
^+                LDMFD   R13!,{R0,R1,PC}
hG; This is a data block for Wimp_CreateIcon - fixed by Philip Colmer
rE.iconblock      EQUD    iconbartype%    ; Icon bar 'service' flag
|;                EQUD    0               ; Bottom left X
�;                EQUD    0               ; Bottom left Y
�9                EQUD    69              ; Top right X
�9                EQUD    68              ; Top right Y
�>                EQUB    %00000010       ; Icon is a sprite
�G                EQUB    %00110001       ; Click notifies/Indirected
�H                EQUB    %00000000       ; Nothing special about icon
�F                EQUB    %00000001       ; Forecol = 1, Backcol = 0
�D.pokespname     EQUD    0               ; Pointer to sprite name
�E                EQUD    1               ; Pointer to WIMP sprites
�                EQUD    12
�:.spritename     EQUS    "!trash"+�6,bl$) ; Sprite name
�
�H; 'killicon' routine removed from V1.02 onwards - no longer required

.trapupcall

&F; Thanks to Philip Colmer for the reason codes here - the old PRMs
0E; only list R0=1 and R0=&100, so I had no idea about R0=3 ! I-139
:C; On entry,     R0      = Reason code (3 for file modification)
D@;               R9      = File modification reason (if R0=3)
N
X)                STMFD   R13!,{R9,R14}
bK                CMP     R0,#3           ; Only if modification notified
l&                BNE     notfilemod
v7                CMP     R9,#0           ; *Save (0)
�9                CMPNE   R9,#6           ; *Delete (6)
�9                CMPNE   R9,#7           ; *Create (7)
�7                CMPNE   R9,#8           ; *CDir (8)
�G                SUB     R9,R9,#256      ; Can't get 257 immediately
�J                CMPNE   R9,#1           ; Open/Create for update (257)
�G                SUB     R9,R9,#256      ; Can't get 520 immediately
�;                CMPNE   R9,#8           ; *Rename (520)
�F                �Q   R9,#1           ; Although can't be sure, set
�E                STREQB  R9,fsctrlflag   ; changed flag to be safe
�(.notfilemod     LDMFD   R13!,{R9,PC}
�
�.wimpclosedown
�
K; This (handy) routine will only call Wimp_CloseDown if Wimp_Initialise
H; had successfully been executed (i.e. taskhandle > 0). It then sets
I; taskhandle to 0 to indicate shutdown. Note that Wimp_CloseDown also
 &; handily kills the icon bar icon.
*
4,                STMFD   R13!,{R0-R2,R14}
>I                LDR     R0,taskhandle           ; Is taskhandle > 0 ?
H!                MOVS    R0,R0
R'                BLE     dormanttask
\E                BL      notrashwind     ; Remove Trash Can Window
f=                MOV     R0,#UpCallV     ; Release UpCallV
p)                ADR     R1,trapupcall
z!                MOV     R2,#0
�2                SWI     "XOS_Release"   ; I-59
�J                BL      checkforred     ; Remove red border if present
�)                LDR     R0,taskhandle
�+                LDR     R1,taskconstant
�G                SWI     "XWimp_CloseDown" ; Shutdown task. III-1241
�!.dormanttask    MOV     R0,#0
�?                STR     R0,iconhandle   ; Clear icon handle
�?                STR     R0,taskhandle   ; Clear task handle
�@                STR     R0,sparktaskhand; Clear Spark handle
�L                STR     R0,templatehandle ; Templates will need a reload
�?                STRB    R0,modifiedbord ; No red border yet
�+                LDMFD   R13!,{R0-R2,PC}
�@.taskconstant   EQUS    "TASK"  ; Special four-letter word !
L.taskhandle     EQUD    0       ; Wimp task handle (also used as a flag)

.peepincan
$
.J; Want to have a look inside trash can, so create the directory if not
8@; already there and use the Filer to create a new Wimp task.
B
L)                STMFD   R13!,{R0,R14}
VG                BL      canexists       ; Make sure Trash$Dir is OK
`
jI; Stupid *Filer_OpenDir <dir> doesn't translate environmental vars !!
t'; Hence must use translated buffer.
~
�*                ADR     R0,startupwind
�:                SWI     "XWimp_StartTask"   ; III-1242
�(                LDMFD   R13!,{R0,PC}
�
�.readtrashdir
�
�L; On entry,     R1      = Address of buffer to store Trash$Dir expansion
�E; MUST have Trash$Dir defined at all times, otherwise fatal error
�
�,                STMFD   R13!,{R0-R4,R14}
�!                MOV     R0,#0
�(                STRB    R0,poketrash
)                ADR     R0,plaintrash

K                MOV     R2,#maxpathlen%-1       ; Reduced by 1 (Rabin).
!                MOV     R3,#0
!                MOV     R4,#0
(<                SWI     "XOS_ReadVarVal"        ; II-750
2!                MOVVC   R0,#0
<L                STRVCB  R0,[R1,R2]      ; Add a zero terminator (Rabin).
F+                LDMVCFD R13!,{R0-R4,PC}
P3; This section revamped by Rabin Ezra. Thanks !
ZA                MOVS    R2,R2           ; Is error overflow ?
d+                ADREQ   R0,undefinedvar
n)                ADRNE   R0,vartoolong
x.                SWI     "OS_GenerateError"
�).plaintrash     EQUS    trashvar$+bl$
�>.startupwind    EQUS    "Filer_OpenDir "        ; III-1292
�-.trashopenbuff  EQUS    �maxpathlen%,bl$)
�>.closedownwind  EQUS    "Filer_CloseDir "       ; III-1291
�-.trashclosebuff EQUS    �maxpathlen%,bl$)
�                ALIGN
�.vartoolong     EQUD    0
�o                EQUS    trashvar$+" environmental variable longer than "+�(maxpathlen%-1)+" characters"+bl$
�                ALIGN
�.undefinedvar   EQUD    0
�M                EQUS    trashvar$+" environmental variable undefined"+bl$
�.fsctrlflag     EQUB    0
�.glassstat      EQUB    0
.CMOSbyte       EQUB    0
.dragstate      EQUB    0
                ALIGN

",.notrashwind    STMFD   R13!,{R0,R1,R14}
,-                ADR     R1,trashclosebuff
6C                BL      readtrashdir            ; Get Trash$Dir
@
JG; Note that because the Wimp may already be partially shut down, we
T?; can't use XWimp_StartTask in this section, so use XOS_CLI
^
h,                ADR     R0,closedownwind
rK                SWI     "XOS_CLI"       ; Shutdown Trash window. II-619
|+                LDMFD   R13!,{R0,R1,PC}
�
�.checkcontents
�
�I; On entry,     R10     = 0 if want to create icon, <> 0 to update it
�H; Want to decide what icon to put on icon bar, so check the contents
�L; of <Trash$Dir>. If the env. variable doesn't exist, or the dir doesn't
�?; exist or there's nothing in the dir, then trash is empty.
�
�,                STMFD   R13!,{R0-R3,R14}
�,                ADR     R1,trashopenbuff
�=                BL      readtrashdir    ; Trash$Dir check
�$                MOV     R0,#�"."
�(                STRB    R0,poketrash
 !                MOV     R0,#5
 (                ADR     R1,trashbits
 J                SWI     "XOS_File" ; Any <Trash$Dir>.* files ? III-850
 &(                LDR     R2,trashstat
 0I                �R     R2,R2,#(1<<22)  ; Bit 22 set to indicate empty
 :!                BVS     empty
 DH                LDRB    R3,CMOSbyte     ; If in Immediate mode, then
 NI                TST     R3,#%001        ; trash can is always 'empty'
 X!                BNE     empty
 b!                MOVS    R0,R0
 lI                BICNE   R2,R2,#(1<<22)  ; Bit 22 cleared because full
 v(.empty          STR     R2,trashstat
 �%                BL      updatecan
 �+                LDMFD   R13!,{R0-R3,PC}
 �-.trashbits      EQUS    "<"+trashvar$+">"
 �'.poketrash      EQUS    bl$+"*"+bl$
 �                ALIGN
 �
 �.redocontents
 �
 �M; Like checkcontents, but uses last scan for info rather than re-scanning
 �
 �-                STMFD   R13!,{R2,R10,R14}
 �;                LDR     R2,trashstat    ; Get last scan
 �>                MOV     R10,#1          ; Flag icon update
!%                BL      updatecan
!,                LDMFD   R13!,{R2,R10,PC}
!
! .updatecan
!*
!4-; On entry,     R2      = Trashstat value
!>I;               R10     = 0 if want to create icon, <> 0 to update it
!H
!R)                STMFD   R13!,{R1,R14}
!\'                TST     R2,#(1<<22)
!fA                MOVNE   R1,#�"1" ; Empty flag (Philip Colmer)
!p-                �Q   R1,#�"2" ; Full flag
!zH                MOVS    R10,R10         ; Is this the first time the
!�L                BLEQ    makeicon        ; icon is to appear on the bar ?
!�&                BLNE    changeicon
!�!                MOV     R1,#0
!�F                STRB    R1,fsctrlflag   ; No need for more updates
!�(                LDMFD   R13!,{R1,PC}
!�
!�.canexists
!�
!�5; Must create trash directory if it doesn't exist
!�
!�,                STMFD   R13!,{R0,R1,R14}
!�,                ADR     R1,trashopenbuff
!�L                BL      readtrashdir    ; Make sure Trash$Dir var exists
"!                MOV     R0,#0
"(                STRB    R0,poketrash
"(                ADR     R1,trashbits
"$!                MOV     R0,#8
".H                SWI     "XOS_File"      ; *CDIR <Trash$Dir>. III-854
"8+                LDMFD   R13!,{R0,R1,PC}
"B
"L-.newname        EQUS    "<"+trashvar$+">"
"V(.nameending     EQUS    "."+�11,bl$)
"`                ALIGN
"j
"t.getcaniconinfo
"~
"�N; On exit,      R2      = Right-hand X coord of trash can icon on icon bar
"�
"�,                STMFD   R13!,{R1,R3,R14}
"�C                MVN     R2,#-(iconbartype%+1)   ; Icon bar type
"�C                LDR     R3,iconhandle   ; Trash can icon handle
"�'                BL      geticoninfo
"�D                LDR     R2,[R1,#16]     ; Get icon right X coord
"�+                LDMFD   R13!,{R1,R3,PC}
"�
"�.geticoninfo
"�
"�+; On entry,     R0      = Window handle
#);               R2      = Icon handle
#
7; On exit,      R1      = Pointer to IconState info
#
#L                ADR     R1,(trashclosebuff+3) � 4*4    ; Recycle workspc
#(A                STR     R2,[R1]         ; Store window handle
#2?                STR     R3,[R1,#4]      ; Store icon handle
#<M                SWI     "XWimp_GetIconState"    ; Get icon info. III-1213
#F"                MOV     PC,R14
#P
#Z.moveintotrash
#d
#n8; On entry,     R1      = Pointer to Wimp_Poll block
#x
#�/                STMFD   R13!,{R0-R6,R9,R14}
#�B                LDRB    R5,CMOSbyte     ; Get Immediate option
#�%                �     R5,R5,#%001
#�:                BL      startglass      ; Hourglass on
#�?                ADD     R3,R1,#44       ; Point to filename
#�H                BL      canexists       ; Create Trash dir if needed
#�
#�H; Because *Rename is extremely awkward about wildcards - won't allow
#�J; them (ARRGGHH !) - have to copy the name (from the last '.' onwards)
#�
#�@                LDR     R4,[R3,#-44+12] ; Is it from Filer ?
#�!                MOVS    R4,R4
#�F                BEQ     itsfromFiler    ; Yes, so endings the same
$,                LDR     R0,sparktaskhand
$;                LDR     R1,[R3,#-44+4]  ; Is it Spark ?
$!                CMP     R0,R1
$";                BNE     canttrash       ; No, so ignore
$,F                ADR     R0,savedleaf    ; and copy leafname to the
$6>                ADR     R1,nameending+1 ; end of Trash$Dir
$@&.copysafeleaf   LDRB    R2,[R0],#1
$J&                STRB    R2,[R1],#1
$T!                MOVS    R2,R2
$^(                BNE     copysafeleaf
$h'                B       retryaccess
$r!.itsfromFiler   MOV     R0,R3
$|<                MOV     R2,#0           ; Don't poke yet
$�&.lookingforend  LDRB    R1,[R0],#1
$�C                CMP     R1,#�"."      ; Still traversing dirs ?
$�)                ADREQ   R2,nameending
$�!                MOVS    R2,R2
$�F                STRNEB  R1,[R2],#1      ; Copy text into dest name
$�!                MOVS    R1,R1
$�B                BNE     lookingforend   ; Got terminator yet ?
$�
$�D; Next bit added to V1.01 to make sure that *Rename ALWAYS works
$�M; if the file is on the same disk (avoiding having to *Copy locked files)
$�
$�H.retryaccess    MOV     R0,#24          ; *Access <file> WR. III-910
$�H                MOV     R1,R3           ; Point to original filename
%G                ADR     R2,attributes   ; Point to WR access string
%'                BL      dofscontrol
%%                BGT     canttrash
%&%.retryrename    STMFD   R13!,{R3}
%0!                MOV     R1,R3
%:A                MOVS    R5,R5           ; Immediate enabled ?
%DG                �Q   R0,#25          ; *RENAME reason code. III-911
%N&                ADREQ   R2,newname
%X>                SWIEQ   "XOS_FSControl" ; *Rename. III-911
%b*                BEQ     attemptnewname
%lJ                ADR     R6,callwipe     ; (Optionally) animate van and
%vM                MOV     R9,R1           ; *Wipe everything from Trash$Dir
%�*                BL      dovananimation
%�*                B       attemptnewname
%�,.callwipe       STMFD   R13!,{R0-R3,R14}
%�H                MOV     R0,#27          ; *WIPE reason code. III-915
%�!                MOV     R1,R9
%�J                MOV     R3,#%010000011  ; ~QF~CR~V and delete original
%�<                SWI     "XOS_FSControl" ; *Wipe. III-915
%�+                LDMFD   R13!,{R0-R3,PC}
%�%.attemptnewname LDMFD   R13!,{R3}
%�E                BVC     acknowledge     ; Good, so acknowledge it
%�
%�F; To prevent the silly copy of Trash into itself (causes 77 levels
%�A; to be created !), the error code for Bad RENAME is checked.
&
&@                LDR     R1,[R0]         ; Get the error word
&(                LDR     R2,badrename
& E                CMP     R1,R2           ; = &108B0 (Bad RENAME) ?
&*%                BEQ     canttrash
&4
&>D; The only (non-fatal) way a rename can fail is if the rename is
&HE; attempted across disks/FSs or into itself (when it's a dir)....
&R
&\&                LDR     R2,baddisk
&fH                CMP     R1,R2           ; = &1089F (Not same disc) ?
&pB                CMPNE   R1,#&B0         ; = &B0 (Bad rename) ?
&z
&�H; ...or if it is already present in Trash$Dir (Already exists error)
&�
&�(                LDRNE   R2,doublecan
&�I                CMPNE   R1,R2           ; = &108C4 (Already exists) ?
&�'                BEQ     dotrashcopy
&�
&�0; If it gets here, then there's a disk fault
&�
&�)                BL      generateerror
&�!                CMP     R1,#1
&�'                BEQ     retryrename
&�%                BGT     canttrash
&�L.dotrashcopy    MOVS    R5,R5           ; If Immediate then *Wipe failed
'G                BNE     canttrash       ; so don't do anything else
'H                MOV     R0,#26          ; *COPY reason code. III-912
'!                MOV     R1,R3
'$&                ADR     R2,newname
'.:                BL      dofscontrol     ; Do the *COPY
'8%                BGT     canttrash
'B
'LD; This code added for V1.01 - should have been in V1.00...sorry.
'V
'`:.acknowledge    MOV     R0,#17          ; User message
'jD                SUB     R1,R3,#44       ; Go back to block start
'tI                LDR     R2,[R1,#8]      ; Get unique reference number
'~H                STR     R2,[R1,#12]     ; Store it in response field
'�!                MOV     R2,#4
'�9                STR     R2,[R1,#16]     ; DataLoadAck
'�F                LDR     R2,[R1,#4]      ; Get task handle involved
'�C                SWI     "XWimp_SendMessage"  ; Acknowledge drag
'�!                MOVS    R4,R4
'�?                BLNE    delsparkfile    ; Delete Spark file
'�L.canttrash      LDMFD   R13!,{R0-R6,R9,PC} ; Return (FS flag may be set)
'�G.fakereturn     MOV     PC,R14          ; Fake return for animation
'�C.badrename      EQUD    &108B0          ; Bad RENAME error code
'�F.baddisk        EQUD    &1089F          ; Not same disc error code
'�G.doublecan      EQUD    &108C4          ; Already exists error code
'�
(F; Note that PUBLIC read-write (/WR) has � been used because anyone
(
M; on Econet could hack around with the files whilst they're in the trash!
(
(@.attributes     EQUS    "WR"+bl$        ; *Access attributes
((                ALIGN
(2
(<.checkerror
(F
(PA; On entry,     R0      = Points to an error block (if V set)
(ZL; On exit,      ZC      = LT if no error, EQ if OK clicked, GT if Cancel
(d
(n)                STMFD   R13!,{R1,R14}
(x!                MOVVC   R1,#0
(�)                BLVS    generateerror
(�C                CMP     R1,#1           ; Tacky, but it works !
(�(                LDMFD   R13!,{R1,PC}
(�
(�.generateerror
(�
(�6; On entry,     R0      = Points to an error block
(�B; On exit,      R1      = 1 if OK clicked, 2 if Cancel clicked
(�
(�,                STMFD   R13!,{R0,R2,R14}
(�G                MOV     R1,#%0000011    ; OK & Cancel, Highlight OK
(�(                ADR     R2,errorname
(�:                SWI     "XWimp_ReportError" ; III-1243
)F                MOV     R0,#0           ; Wimp_ReportError does an
)I                STRB    R0,glassstat    ; Hourglass_Smash, so need to
)?                BL      startglass      ; start it up again
)"+                LDMFD   R13!,{R0,R2,PC}
),%.errorname      EQUS    prog$+bl$
)6                ALIGN
)@
)J.startglass
)T
)^H; Switch on Hourglass (busy delay = 1 second), but only if it is off
)h
)r)                STMFD   R13!,{R0,R14}
)|(                LDRB    R0,glassstat
)�!                MOVS    R0,R0
)�<                �Q   R0,#100         ; 1 second to start
)�(                STREQB  R0,glassstat
)�8                SWIEQ   "XHourglass_Start" ; IV-1393
)�(                LDMFD   R13!,{R0,PC}
)�
)�.stopglass
)�
)�0; Switch off Hourglass, but only if it is on
)�
)�)                STMFD   R13!,{R0,R14}
)�(                LDRB    R0,glassstat
)�!                MOVS    R0,R0
*!                MOVNE   R0,#0
*(                STRNEB  R0,glassstat
*6                SWINE   "XHourglass_Off" ; IV-1391
*&(                LDMFD   R13!,{R0,PC}
*0
*:.byebye
*D
*NI; This routine is called when the module is *RMKilled or *RMReInited.
*X
*b)                STMFD   R13!,{R2,R14}
*lL                LDR     R2,workspace            ; Free (any) stack space
*vH                SUBS    R2,R2,#stackspace%      ; Point to RMA start
*�&                BLPL    releaseRMA
*�J                LDRPL   R2,windowspace          ; Release window space
*�&                BLPL    releaseRMA
*�I                LDRPL   R2,spritearea           ; Release sprite area
*�&                BLPL    releaseRMA
*�K                BL      wimpclosedown           ; Shut down active task
*�!                MOV     R2,#0
*�D                STR     R2,workspace      ; Clear workspace flag
*�(                LDMFD   R13!,{R2,PC}
*�
*�,.readCMOS       STMFD   R13!,{R0-R2,R14}
*�H                MOV     R0,#161         ; Read CMOS RAM to get saved
*�F                MOV     R1,#battery%    ; settings of menu options
+4                SWI     "XOS_Byte"      ; II-787
+I                STRB    R2,CMOSbyte     ; Save for later modification
+K                LDR     R0,immediatestat  ; Configure tick on Immediate
+ 9                MOV     R1,#%001        ; Bit 0 first
+*&                BL      twiddlebit
+4,                STR     R0,immediatestat
+>G                LDR     R0,warningstat  ; Configure tick on Warning
+H&                BL      twiddlebit
+R*                STR     R0,warningstat
+\J                LDR     R0,animationstat ; Configure tick on Animation
+f&                BL      twiddlebit
+p,                STR     R0,animationstat
+z+                LDMFD   R13!,{R0-R2,PC}
+�
+�.twiddlebit
+�
+�.; On entry,     R0      = Menu status word
+�0;               R1      = Bit mask of status
+�);               R2      = Status byte
+�;; On exit,      R0      = New value of menu status word
+�/;               R1      = Shifted left by 1
+�
+�)                STMFD   R13!,{R2,R14}
+�H                BIC     R0,R0,#(1<<0)   ; Clear flag bit (0) on menu
+�"                �S    R2,R2,R1
+�H                �RNE   R0,R0,#(1<<0)   ; Set flag bit if switched on
,K                MOV     R1,R1,ASL #1    ; Next menu is 1 bit on in CMOS
,(                LDMFD   R13!,{R2,PC}
,
,$.togglebit
,.
,88; On entry,     R0      = Bit position to be toggled
,B
,L,                STMFD   R13!,{R0-R2,R14}
,VG                MOV     R1,#1           ; Straightforward � (1<<R0)
,`E                LDRB    R2,CMOSbyte     ; Flip bit R0 in CMOS RAM
,j)                �     R2,R2,R1,ASL R0
,t#                MOV     R0,#162
,~(                MOV     R1,#battery%
,�E                SWI     "XOS_Byte"      ; Update CMOS RAM. II-788
,�N                BL      readCMOS        ; Re-read 'cos menu option changed
,�+                LDMFD   R13!,{R0-R2,PC}
,�
,�.dealwithmenu
,�
,�8; On entry,     R1      = Pointer to Wimp_Poll block
,�
,�6                STMFD   R13!,{R0-R2,R6,R9,R10,R14}
,�F                LDR     R0,[R1]         ; Get item number (from 0)
,�!                MOVS    R0,R0
,�I                BEQ     ignoremenu      ; Item #1 = Info (do nothing)
-<                CMP     R0,#5           ; Item #6 = Quit
-
&                LDREQ   R9,[R1,#4]
-$                BEQ     leavenow
-C                CMP     R0,#4           ; Item #5 = Empty Trash
-((                BEQ     dothebinning
-2N; It it gets here, then must be Items #2-4 (Immediate, Warning, Animation)
-<H                SUB     R0,R0,#1        ; Invert tick on appropriate
-FJ                BL      togglebit       ; menu (updating CMOS RAM too)
-PC                MOVS    R0,R0           ; Skip if not Immediate
-Z&                BNE     ignoremenu
-dL                MOV     R10,#1          ; If Immediate item toggled then
-nM                BL      checkcontents   ; might need to re-enable fat can
-xK                LDRB    R0,CMOSbyte     ; If Immediate toggled on, then
-�M                TST     R0,#%001        ; must shut down Trash Can Window
-�'                BLNE    notrashwind
-�&                B       ignoremenu
-�>; Must be Item #5, which is only enabled if there is Trash
-�,.dothebinning   ADR     R6,cleantrashdir
-�@                BL      dovananimation  ; Trundle van time !
-�5.ignoremenu     LDMFD   R13!,{R0-R2,R6,R9,R10,PC}
-�
-�.trashthestuff
-�
-�H; On entry,     R6      = Address of routine to be used for trashing
-�
-�K                MOV     PC,R6           ; Not exactly tricky to code...
.
.,.cleantrashdir  STMFD   R13!,{R0,R1,R14}
.:                BL      startglass      ; Hourglass on
."H                MOV     R0,#27          ; *WIPE reason code. III-915
.,(                ADR     R1,trashbits
.6'                BL      dofscontrol
.@+                LDMFD   R13!,{R0,R1,PC}
.J
.T.dofscontrol
.^
.h6; On entry,     R0      = OS_FSControl reason code
.r4;               R1      = Pointer to source name
.|H;               R2      = Pointer to dest name (not used with *WIPE)
.�
.�)                STMFD   R13!,{R3,R14}
.�$                MOV     R3,#�"."
.�(                STRB    R3,poketrash
.�(.retrycopywipe  STMFD   R13!,{R0-R2}
.�J                MOV     R3,#%010000011  ; ~QF~CR~V and delete original
.�+                SWI     "XOS_FSControl"
.�H                BL      checkerror      ; Keep trying until no error
.�B                LDMFD   R13!,{R0-R2}    ; or Cancel clicked on
.�)                BEQ     retrycopywipe
.�G                LDMFD   R13!,{R3,PC} ; Return (FS flag will be set)
.�
.�.checkfordrag
/M; On entry,     R1      = Pointer to Wimp_Poll block (used for workspace)
/,                STMFD   R13!,{R0-R5,R14}
/2                SWI     "XWimp_GetPointerInfo"
/&?                LDR     R2,[R1,#12]     ; Get window handle
/0=                LDR     R3,[R1,#16]     ; Get icon handle
/:J                LDR     R0,[R1,#8]      ; Must have one of the buttons
/DB                TST     R0,#%101        ; down to start a drag
/N                �Q   R4,#0
/XK                STREQ   R4,sparkwindhand; If not, we don't know Spark's
/b;                BEQ     checkformenu    ; window handle
/cH                MOV     R5,#1           ; Button down, away from can
/lE                LDR     R4,sparkwindhand; Skip if we already know
/vC                MOVS    R4,R4           ; Spark's window handle
/�)                BNE     couldbeoverme
/�G                MOVS    R3,R3           ; Only looking for an icon,
/�B                BMI     couldbeoverme   ; not part of a window
/�I                MOVS    R4,R2           ; Make sure not background or
/�6                BMI     couldbeoverme   ; icon bar
/�*                LDR     R1,windowspace
/�"                MOV     R0,#20
/�8                STR     R0,[R1]         ; Block size
/�!                MOV     R0,#0
/�8                STR     R0,[R1,#12]     ; my_ref = 0
/�"                MOV     R0,#19
/�J                SWI     "XWimp_SendMessage"     ; Ask for owner handle
/�,                LDR     R0,sparktaskhand
0C                CMP     R0,R2           ; Was it a Spark icon ?
0(                BNE     notsparkdrag
0F                STR     R4,[R1]                 ; Need to get more
0 G                SWI     "XWimp_GetWindowInfo"   ; details. III-1210
0*>                LDR     R0,[R1,#28+4]   ; Get window flags
04D                MOV     R0,R0,LSR #24   ; Get icon control flags
0>I                BIC     R0,R0,#(%11<<7) ; Ignore bit sel/horiz scroll
0H?                CMP     R0,#%111111     ; Are all enabled ?
0R(                BNE     notsparkdrag
0\)                LDR     R0,[R1,#56+4]
0fF                TST     R0,#(1<<8)      ; Is title info indirect ?
0p(                BEQ     notsparkdrag
0z@                STR     R4,sparkwindhand; Save window handle
0�,                ADR     R0,sparkrootcomm
0�,                MOV     R2,#�(sparkdel$)
0�%                ADD     R3,R1,#20
0�I.stillcommmove  LDRB    R4,[R0],#1      ; Copy start of Spark command
0�A                STRB    R4,[R3],#1      ; into workspace area
0�$                SUBS    R2,R2,#1
0�)                BNE     stillcommmove
0�9                LDR     R0,sparktaskhand; Source task
0�<                LDR     R4,[R1,#72+8+4] ; Size of buffer
0�E                LDR     R1,[R1,#72+4]   ; Pointer to window title
0�>                LDR     R2,taskhandle   ; Destination task
0�>                SWI     "XWimp_TransferBlock"   ; III-1283
0�
1G; Although we 'think' we know the length of the window title, it is
1C; only the buffer size - must find the terminating zero instead
1
1$#.findpathzero   LDRB    R0,[R3]
1.!                MOVS    R0,R0
18$                ADDNE   R3,R3,#1
1B(                BNE     findpathzero
1LH                STR     R3,putleafhere  ; That's where the leaf goes
1V(                B       notsparkdrag
1`F.couldbeoverme  CMN     R2,#2           ; Window = -2 (icon bar) ?
1j)                LDREQ   R1,iconhandle
1t@                CMPEQ   R1,R3           ; Icon = Trash Can ?
1~(                BNE     notsparkdrag
1�
1�H; If it gets here, then a button is down and the pointer is over the
1�; Trash Can icon.
1�
1�M                LDRB    R0,CMOSbyte     ; Immediate and Warning enabled ?
1�$                �     R0,R0,#%11
1�#                CMP     R0,#%11
1�(                BNE     notsparkdrag
1�
1�B; However, 'dragstate' must have been set to 1 (away from can,
1�I; button down) rather than 0 (button up) or 2 (over can, button down)
1�6; prior to this if we want to turn the border red.
2
2C                MOV     R5,#2           ; Over can, button down
2
(                LDRB    R0,dragstate
2!                CMP     R0,#1
2H                BLEQ    turnborderred   ; OK, so warn user that he's
2(D                B       dontchange      ; about to destroy files
22
2<&; At this point, R0 = Button state
2FK;                R1 = GetPointerInfo block, R2/R3 = window/icon handles
2PE; Must see if pointer is over 'Empty Trash' (enabled) menu option
2Z
2d.checkformenu
2n]
2x� debug% �
2�[OPT A%
2�I                BL      showhandles     ; Display handles in top left
2�]
2��
2�[OPT A%
2�F                MOV     R5,#0           ; Button up, away from can
2�K                CMP     R3,#5*3-2       ; On fifth item (Empty Trash) ?
2�(                BNE     notsparkdrag
2�?                LDRB    R0,CMOSbyte     ; Warning enabled ?
2�$                �     R0,R0,#%10
2�#                CMP     R0,#%10
2�(                BNE     notsparkdrag
2�H                BL      getmenuiconinfo ; Yes, so get menu item text
2�!                MOV     R4,#3
3H.scanformiss    LDR     R2,[R0],#4      ; Compare "Empty Trash" with
3F                LDR     R3,[R1],#4      ; menu item text to see if
3L                CMP     R2,R3           ; it's my menu (only easy way !)
3"(                BNE     notsparkdrag
3,$                SUBS    R4,R4,#1
36'                BNE     scanformiss
3@H                BL      turnborderred   ; Turn border red if on item
3J&                B       dontchange
3TI.notsparkdrag   BL      checkforred     ; Not over can, so remove red
3h(.dontchange     STRB    R5,dragstate
3i+                LDMFD   R13!,{R0-R5,PC}
3r.putleafhere    EQUD    0
3|%.sparkrootcomm  EQUS    sparkdel$
3�                ALIGN
3�]
3�� debug% �
3�[OPT A%
3�; Start of debugging code
3�
3�.showhandles
3�
3�G; On entry,     R2/R3   = Window/icon handles (from GetPointerInfo)
3�
3�)                STMFD   R13!,{R0,R14}
3�?                SWI     XOS_WriteI+4    ; � 4 for fast text
3�F                SWI     XOS_WriteI+30   ; � 30 to keep in top left
4C                MOV     R0,R2           ; Display window handle
4"                BL      outhex
4>                SWI     "XOS_NewLine"   ; Next line. I-166
4&A                MOV     R0,R3           ; Display icon handle
40"                BL      outhex
4:E                SWI     XOS_WriteI+5    ; Back to slow text again
4D(                LDMFD   R13!,{R0,PC}
4N
4X.outhex
4b
4l>; On entry,     R0      = Value to printed as 8 hex digits
4v
4�,                STMFD   R13!,{R0-R2,R14}
4�K                ADR     R1,hexbuffer    ; Convert R0 into 8 zero-padded
4�;                MOV     R2,#9           ; hex digits...
4�6                SWI     "XOS_ConvertHex8" ; II-601
4�C                MOV     R1,#8           ; ...and print them out
4�3                SWI     "XOS_WriteN"    ; I-189
4�+                LDMFD   R13!,{R0-R2,PC}
4�$.hexbuffer      EQUS    �12,bl$)
4�
4�; End of debugging code
4�]
4��
4�[OPT A%
5,.checkforred    STMFD   R13!,{R0,R2,R14}
5?                LDRB    R0,modifiedbord ; If border is red,
5!                MOVS    R0,R0
5 J                LDRNE   R0,curbordercol ; then restore to its previous
5*4                MOVNE   R2,#0           ; colour
54)                BLNE    restoreborder
5>+                LDMFD   R13!,{R0,R2,PC}
5H
5R,.turnborderred  STMFD   R13!,{R0,R1,R14}
5\A                LDRB    R0,modifiedbord ; Skip if already red
5f!                MOVS    R0,R0
5p)                BNE     alreadycooked
5zH                ADR     R1,wimppalette  ; Simply read all 16 colours
5�I                SWI     "XWimp_ReadPalette" ; and save them. III-1251
5�I                LDR     R0,[R1,#64]     ; Read and save border colour
5�+                STR     R0,curbordercol
5�?                MOV     R0,#&00F000     ; Red in RGB values
5�>                MOV     R2,#1           ; Flag as modified
5�I                BL      restoreborder   ; Change border colour to red
5�+.alreadycooked  LDMFD   R13!,{R0,R1,PC}
5�.curbordercol   EQUD    0
5�$.wimppalette    EQUS    �80,bl$)
5�.modifiedbord   EQUB    0
5�                ALIGN
5�
5�.restoreborder
6
62; On entry,     R0      = RGB value for border
6+;               R2      = Modified flag
6$
6.)                STMFD   R13!,{R1,R14}
68+                STRB    R2,modifiedbord
6B*                ADR     R1,wimppalette
6LA                STR     R0,[R1,#64]     ; Store border colour
6V?                BL      videosync       ; Smooth out change
6`L                SWI     "XWimp_SetPalette" ; Mod border colour. III-1250
6j(                LDMFD   R13!,{R1,PC}
6t
6~.copyhelpmess
6�
6�7; On entry,     R0      = Source address of message
6�5;               R2      = Dest address of message
6�2; On exit,      R2      = Updated dest address
6�
6�,                STMFD   R13!,{R0,R1,R14}
6�A.suckuphelp     LDRB    R1,[R0],#1      ; Copy help text into
6�!                MOVS    R1,R1
6�<                STRNEB  R1,[R2],#1      ; message packet
6�&                BNE     suckuphelp
6�+                LDMFD   R13!,{R0,R1,PC}
6�
7.askedforhelp
7

78; On entry,     R1      = Pointer to Wimp_Poll block
7<;               R4      = 0 if icon, <> 0 if Info Window
7(
72,                STMFD   R13!,{R0-R3,R14}
7<J                ADD     R2,R1,#20       ; Where the help text is to go
7FM                MOVS    R4,R4           ; Is it the icon or Info window ?
7P'                BEQ     itsiconhelp
7Z>                ADR     R0,helpmessinfo ; Info Window help
7d(                BL      copyhelpmess
7n)                B       finishmessnow
7xI.itsiconhelp    ADR     R0,helpmessicon ; First help line is constant
7�(                BL      copyhelpmess
7�J                LDRB    R3,CMOSbyte     ; Now decide on Immediate text
7�?                TST     R3,#%001        ; or Trash$Dir info
7�(                ADRNE   R0,helpimmed
7�(                ADREQ   R0,helpstore
7�(                BL      copyhelpmess
7�I                TST     R3,#%010        ; Add Warning text if enabled
7�'                ADRNE   R0,helpwarn
7�(                BLNE    copyhelpmess
7�K                TST     R3,#%100        ; Add Animation text if enabled
7�'                ADRNE   R0,helpanim
7�(                BLNE    copyhelpmess
7�D.finishmessnow  MOV     R0,#0           ; Null terminator needed
8'                STRB    R0,[R2,#-2]
8L                ADD     R0,R2,#2        ; Compute word-rounded length of
8;                BIC     R0,R0,#%11      ; message block
8"$                SUB     R0,R0,R1
8,B                STR     R0,[R1]         ; Save length in block
86E                LDR     R2,[R1,#4]      ; Task handle to reply to
8@C                LDR     R0,[R1,#8]      ; Copy reference number
8J'                STR     R0,[R1,#12]
8T$                MOV     R0,#&500
8^C                ADD     R0,R0,#3        ; !Help reply ID = &503
8h'                STR     R0,[R1,#16]
8r"                MOV     R0,#17
8|/                SWI     "XWimp_SendMessage"
8�+                LDMFD   R13!,{R0-R3,PC}
8��.helpmessinfo   EQUS    "This is the Info Window.|MIt shows the name and purpose of this application as well as the author, "
8�_                EQUS    "version number and date developed. It employs 'auto-stamping' to "
8�d                EQUS    "synchronise "+prog$+" module and Info Window versions and dates.|M"+bl$
8�                ALIGN
8�T.helpmessicon   EQUS    "This is the "+prog$+" icon. Drag files onto it to "+bl$
8�                ALIGN
8�T.helpimmed      EQUS    "delete them immediately.|MMENU: Toggles options.|M"+bl$
8�                ALIGN
8�.helpstore      EQUS    "put them in the "+prog$+".|MMENU: Toggles options/empties trash. SELECT or ADJUST: View trash.|M"+bl$
8�                ALIGN
8�R.helpwarn       EQUS    "A red border warning is shown before deletion.|M"+bl$
8�                ALIGN
9G.helpanim       EQUS    "A Trash Van will pick up the trash.|M"+bl$
9                ALIGN
9
9&,.videosync      STMFD   R13!,{R0-R2,R14}
90H                MOV     R0,#19          ; È– (watch out - annoyingly
9:J                SWI     "XOS_Byte"      ; corrupts R1 and R2 !). I-298
9D+                LDMFD   R13!,{R0-R2,PC}
9N
9X.wimpspriteop
9b
9l5; On entry,     R0      = OS_SpriteOp reason code
9vB;               R2      = Pointer to sprite name (or filename)
9�6;               R3..    = Other OS_SpriteOp params
9�
9�,                STMFD   R13!,{R0-R2,R14}
9�
9�J; Note to Acorn - I would DEARLY like to use Wimp_SpriteOp exclusively
9�E; in this module, but it doesn't support any "write" operations !
9�
9�K                ADD     R0,R0,#&100     ; Pointing to special user area
9�6                SWI     "XWimp_SpriteOp"; III-1271
9�+.leavespriteop  LDMFD   R13!,{R0-R2,PC}
9�
9�
.spriteop
9�
:5; On entry,     R0      = OS_SpriteOp reason code
:B;               R2      = Pointer to sprite name (or filename)
:6;               R3..    = Other OS_SpriteOp params
: 
:*,                STMFD   R13!,{R0-R2,R14}
:4<                ADD     R0,R0,#&100     ; Flag user area
:>)                LDR     R1,spritearea
:H3                SWI     "XOS_SpriteOp"  ; I-393
:R+                LDMFD   R13!,{R0-R2,PC}
:\
:f.trundlevan
:p
:z;; On entry,     R0      = Pointer to sprite family name
:�,;               R1      = Start position
:�-;               R2      = Finish position
:�I;               R3      = OS units between each movement (can be -ve)
:�';               R7/R8   = X/Y shift
:�
:�-                STMFD   R13!,{R0-R10,R14}
:�(                STMFD   R13!,{R0-R3}
:�!                MOV     R2,R0
:�?                MOV     R9,#�"1"      ; Select first sprite
:�&                STRB    R9,[R2,#6]
:�>                MOV     R0,#40          ; Read sprite info
:�3                BL      wimpspriteop    ; I-423
:�B                BVS     spritefailure   ; Give up if no sprite
;K                MOV     R5,#1           ; Bottom of van = 1 pixel above
;F                MOV     R5,R5,ASL R8    ; screen bottom (scale it)
;A                SUBS    R3,R3,#1        ; Width of sprite - 1
;$B                BMI     spritefailure   ; Give up if width = 0
;.J                MOV     R7,R3,ASL R7    ; then shift it by the Xfactor
;8B                SUBS    R4,R4,#1        ; Height of sprite - 1
;BC                BMI     spritefailure   ; Give up if height = 0
;LJ                MOV     R8,R4,ASL R8    ; then shift it by the Yfactor
;V(                LDMFD   R13!,{R0-R3}
;`G                BL      saveundervan    ; Initial temp sprite setup
;j(                BVS     vanhitfinish
;t
;~H; The rest of this routine deals with moving the van (smoothly !) in
;�F; a straight horizontal line between R1 and R2 (step R3). It flips
;�9; between 3 different sprites every third video sync.
;�
;�@.animationflip  MOV     R10,#3          ; Reset flip counter
;�;                STRB    R9,[R0,#6]      ; Select sprite
;�B.noanimflip     BL      videosync       ; Smooth out animation
;�D                ADR     R4,tempoutsprite; Select saved rectangle
;�>                MOV     R6,#0           ; Overwrite screen
;�J                BL      plotsprite      ; Restore underneath rectangle
;�(                BVS     vanhitfinish
;�=                ADD     R1,R1,R3        ; Move van xcoord
;�J                MOVS    R3,R3           ; Which way is the van going ?
<'                BPL     lefttoright
<
J                CMP     R1,R2           ; If left, then stop when less
<(                BLT     vanhitfinish
<)                B       vanstillgoing
<(K.lefttoright    CMP     R1,R2           ; If right, then stop when more
<2(                BGT     vanhitfinish
<<C.vanstillgoing  BL      saveundervan    ; Save underneath again
<F(                BVS     vanhitfinish
<P!                MOV     R4,R0
<ZD                MOV     R6,#8           ; Overwrite but use mask
<dF                BL      plotsprite      ; Plot van in new position
<n(                BVS     vanhitfinish
<x&                SUBS    R10,R10,#1
<�D                BNE     noanimflip      ; Have 3 moves gone by ?
<�H                ADD     R9,R9,#1        ; Yes, so next sprite please
<�$                CMP     R9,#�"4"
<�!                �Q   R9,#�"1"
<�)                B       animationflip
<�(.spritefailure  LDMFD   R13!,{R0-R3}
<�,.vanhitfinish   LDMFD   R13!,{R0-R10,PC}
<�
<�.saveundervan
<�
<�4; On entry,     R1      = Left X position of van
<�6;               R5      = Bottom Y position of van
<�F;               R7/R8   = Van sprite width/height (minus one unit)
=
=,                STMFD   R13!,{R0-R7,R14}
=,                ADR     R2,tempoutsprite
="8                MOV     R3,#0           ; No palette
=,7                MOV     R4,R1           ; Left side
=6E                ADD     R6,R4,R7        ; Right side (Left+Width)
=@F                ADD     R7,R5,R8        ; Top side (Bottom+Height)
=JF                MOV     R0,#16          ; Save rectangle to sprite
=T3                BL      spriteop        ; I-405
=^+                LDMFD   R13!,{R0-R7,PC}
=h
=r.plotsprite
=|
=�); On entry,     R1      = Left xcoord
=�4;               R4      = Pointer to sprite name
=�+;               R5      = Bottom ycoord
=�N;               R6      = Action code (0 = overwrite, 8 = ditto with mask)
=�
=�/                STMFD   R13!,{R0-R5,R9,R14}
=�A                MOV     R2,R4   ; Lots of register juggling !
=�!                MOV     R3,R1
=�!                MOV     R4,R5
=�!                MOV     R5,R6
=�B                MOV     R0,#34            ; Plot sprite. I-417
=�!                MOV     R9,R6
=�)                BL      choosesprcall
>.                LDMFD   R13!,{R0-R5,R9,PC}
>
>.choosesprcall
>&
>0M; On entry,     R9      = 0 => Use OS_SpriteOp, <> 0 => Use Wimp_SpriteOp
>:
>D&                STMFD   R13!,{R14}
>NM                MOVS    R9,R9           ; Select routine depending on reg
>X)                BEQ     donormsprcall
>b(                BL      wimpspriteop
>l)                B       endthesprcall
>v$.donormsprcall  BL      spriteop
>�%.endthesprcall  LDMFD   R13!,{PC}
>�
>�.dovananimation
>�
>�E; On entry,     R6      = Address of routine to call for trashing
>�4; On exit,      V       = Set if trashing failed
>�
>�,                STMFD   R13!,{R0-R8,R14}
>�'                LDRB    R0,CMOSbyte
>�A                TST     R0,#%100        ; Animation enabled ?
>�'                BEQ     noanimtoday
>�)                ADR     R0,inputblock
>�*                ADR     R1,outputblock
?J                SWI     "XOS_ReadVduVariables"  ; Get mode info. I-345
?C                LDR     R0,[R1]         ; Is it a 16-colour � ?
?"                CMP     R0,#15
? %                BEQ     itsa16col
?*K.noanimtoday    BL      trashthestuff   ; Not right mode, so delete now
?4$                B       endofseq
?>H.itsa16col      BL      getcaniconinfo  ; R2 = Right X coord of icon
?HH                BL      inituserarea    ; *SNew the user sprite area
?R<                LDR     R7,[R1,#4]      ; X shift needed
?\<                LDR     R8,[R1,#8]      ; Y shift needed
?fD                LDR     R1,[R1,#12]     ; Number of X pixels - 1
?p?                MOV     R1,R1,ASL R7    ; Start = far right
?zH                BIC     R1,R1,#%1111    ; Make sure a multiple of 16
?�!                MOV     R0,#4
?�L                ADD     R2,R2,R0,ASL R7 ; Finish = 4 pixels to can right
?�C                BIC     R2,R2,#%1111    ; Also a multiple of 16
?�E                ADR     R0,vanleftname  ; Van is pointing to left
?�I                MVN     R3,#15          ; Go left 16 OS units at time
?�&                BL      trundlevan
?�G                BL      trashthestuff   ; Delete (rename) the stuff
?�$                BVS     endofseq
?�D                MOV     R0,R1           ; New Start = Old Finish
?�<                MOV     R1,R2           ; and vice versa
?�!                MOV     R2,R0
?�F                ADR     R0,vanrightname ; Van is pointing to right
?�C                RSB     R3,R3,#0        ; Flip travel direction
@&                BL      trundlevan
@+.endofseq       LDMFD   R13!,{R0-R8,PC}
@5.inputblock     EQUD    3               ; NColour
@$8                EQUD    4               ; XEigFactor
@.8                EQUD    5               ; YEigFactor
@88                EQUD    11              ; XWindLimit
@B                EQUD    -1
@L$.outputblock    EQUS    �16,bl$)
@V).tempoutsprite  EQUS    "tempvan"+bl$
@`
@j,.scantrashspr   STMFD   R13!,{R1,R2,R14}
@t-                ADR     R1,iconspritename
@~,                ADR     R2,trashiconname
@�G                BL      iconsprites     ; Load in trash can sprites
@�+                LDMFD   R13!,{R1,R2,PC}
@�
@�.iconsprites
@�
@�G; On entry,     R1      = Filename to load if R2 sprite not present
@�@;               R2      = Sprite name to check for existence
@�
@�,                STMFD   R13!,{R0-R6,R14}
@�J                MOV     R0,#40          ; Read sprite info reason code
@�G                BL      wimpspriteop    ; Does sprite exist ? I-423
@�K                MOVVS   R0,#11          ; Merge sprite file reason code
A!                MOVVS   R2,R1
A
3                BLVS    wimpspriteop    ; I-400
A)                ADRVS   R0,wotnoicons
A.                SWIVS   "OS_GenerateError"
A(+                LDMFD   R13!,{R0-R6,PC}
A2.wotnoicons     EQUD    0
A<D                EQUS    prog$+" sprites could not be loaded"+bl$
AF                ALIGN
AP
AZ,.scanvanspr     STMFD   R13!,{R1,R2,R14}
Ad*                ADR     R2,vanleftname
An$                MOV     R1,#�"3"
Ax&                STRB    R1,[R2,#6]
A�)                ADR     R1,loadthevan
A�G                BL      iconsprites     ; Load in trash van sprites
A�+                LDMFD   R13!,{R1,R2,PC}
A�).trashiconname  EQUS    "!trash2"+bl$
A�:.iconspritename EQUS    "<TrashWork$Dir>.!Sprites"+bl$
A�                ALIGN
A�).vanleftname    EQUS    "vanlft1"+bl$
A�).vanrightname   EQUS    "vanrgt1"+bl$
A�<.loadthevan     EQUS    "<TrashWork$Dir>.VanSprites"+bl$
A�                ALIGN
A�
A�.loadtemplate
A�
BL; Load in Info window template. I'm not happy that the LoadTemplate docs
BM; in the new PRMs fail to refer you to OpenTemplate (which MUST be called
BK; first to tell the WIMP which template file you're dealing with). Yes,
B"I; you can find the blurb on III-1153, but I would've liked a clue - I
B,H; kept getting 'Channel' errors until I realised what was going on !
B6
B@,                STMFD   R13!,{R0-R6,R14}
BJL                LDR     R1,templatehandle       ; Already got template ?
BT!                MOVS    R1,R1
B^(                BNE     havetemplate
BhG                ADR     R1,tempfilename         ; New template file
Br>                SWI     "XWimp_OpenTemplate"    ; III-1236
B|K                ADRVS   R0,wotnotempfile        ; Certainly can't go on
B�I                SWIVS   "OS_GenerateError"      ; if no template file
B�(                LDR     R1,workspace
B�L                SUB     R1,R1,#stackspace%       ; Point to start of RMA
B�G                ADD     R2,R1,#&300     ; Indirected data goes here
B�D                ADD     R3,R2,#&100     ; End of indirected data
B�=                MVN     R4,#0   ; -1 => no fonts involved
B�D                ADR     R5,templatename ; Point to template name
B�L                MOV     R6,#0   ; First call (actually want Info window)
B�>                SWI     "XWimp_LoadTemplate"    ; III-1238
B�M                MOVS    R6,R6                   ; I want my Info window !
B�I                ADREQ   R0,wotnoinfowind        ; (R6=0 if not found)
B�.                SWIEQ   "OS_GenerateError"
B�H; Wimp_LoadTemplate has left R1 pointing to the Info window template
CA; so it's best to store the handle and then create the window
C-                STR     R1,templatehandle
C*                ADR     R5,specialyear
C&'                ADR     R6,autoyear
C0>                BL      autostamptemp           ; Add year
C:+                ADR     R5,specialstamp
CD'                ADR     R6,autodate
CNF                BL      autostamptemp           ; Add version/date
CXM                SWI     "XWimp_CloseTemplate"   ; III-1237 (ignore error)
CbM.havetemplate   SWI     "XWimp_CreateWindow"    ; III-1174 (ignore error)
Cl@                STR     R0,submenupoke  ; Info sub-menu item
Cv+                LDMFD   R13!,{R0-R6,PC}
C�*.templatename   EQUS    "Info"+�8,bl$)
C�.templatehandle EQUD    0
C�;.tempfilename   EQUS    "<TrashWork$Dir>.Templates"+bl$
C�                ALIGN
C�.wotnotempfile  EQUD    0
C�<                EQUS    "No "+prog$+" template file"+bl$
C�                ALIGN
C�.wotnoinfowind  EQUD    0
C�A                EQUS    "No Info window in template file"+bl$
C�".specialyear    EQUS    "YYYY"
C�).autoyear       EQUS    �date$,4)+cr$
C�".specialstamp   EQUS    "A.BB"
C�(.autodate       EQUS    resdate$+cr$
D                ALIGN
D
D.autostamptemp
D 
D*1; On entry,     R1      = Template data start
D4/;               R3      = Template data end
D>H;               R5      = Pointer to special search string (4 bytes)
DHG;               R6      = Pointer to replacement string (CR-termed)
DR
D\,                STMFD   R13!,{R0-R4,R14}
DfE.scanallfour    MOV     R2,#3           ; Search string = 4 bytes
Dp&.stillnostamp   LDRB    R4,[R1,R2]
Dz&                LDRB    R0,[R5,R2]
D�!                CMP     R4,R0
D�C                BNE     nosubmatch      ; Next byte if no match
D�J                SUBS    R2,R2,#1        ; Keep scanning until all four
D�3                BPL     stillnostamp    ; found
D�%                B       exactdate
D�J.nosubmatch     ADD     R1,R1,#1        ; Next byte (leave if no more)
D�!                CMP     R1,R3
D�'                BNE     scanallfour
D�*                B       nochangetodate
D�H.exactdate      MOV     R0,R6           ; Copy replacement string on
D�G.doautostamp    LDRB    R2,[R0],#1      ; top of search result addr
D�L                STRB    R2,[R1],#1      ; up until a CR (indirected data
D�C                CMP     R2,#13          ; ends in a CR, not 0).
E'                BNE     doautostamp
E'                B       scanallfour
E+.nochangetodate LDMFD   R13!,{R0-R4,PC}
E$
E..getmenuiconinfo
E8
EB+; On entry,     R2      = Window handle
EL);               R3      = Icon handle
EV4; On exit,      R0      = Pointer to text string
E`B;               R1      = Pointer to 'Empty Trash' menu string
Ej,                STMFD   R13!,{R2,R3,R14}
Et'                BL      geticoninfo
E~B                ADD     R0,R1,#28       ; Pointer to menu text
E�*                ADR     R1,trashstat+4
E�+                LDMFD   R13!,{R2,R3,PC}
E�
E�.makenewmenu
E�
E�8; On entry,     R1      = Pointer to Wimp_Poll block
E�
E�)                STMFD   R13!,{R2,R14}
E�K                LDR     R2,[R1]         ; Get X returned from Wimp_Poll
E�I                SUB     R2,R2,#64       ; Subtract 64 for easy access
E�:                STR     R2,newmenux     ; Save X coord
E�$                BL      makemenu
F(                LDMFD   R13!,{R2,PC}
F

F).makeoldmenu    STMFD   R13!,{R2,R14}
F>                LDR     R2,newmenux     ; Retrieve X coord
F($                BL      makemenu
F2(                LDMFD   R13!,{R2,PC}
F<
FF
.makemenu
FP
FZ-; On entry,     R2      = X coord of menu
Fd0; Must display a menu using Wimp_CreateMenu.
Fn
Fx,                STMFD   R13!,{R1,R3,R14}
F�I                MOV     R3,#228         ; Menu Y = 228 if on icon bar
F�J                ADD     R3,R3,#44*3     ; + 3 items worth for new bits
F�,                ADR     R1,multiquitaddr
F�,                STR     R1,multiquitpoke
F�(                ADR     R1,menublock
F�>                SWI     "XWimp_CreateMenu"      ; III-1226
F�+                LDMFD   R13!,{R1,R3,PC}
F�<.newmenux       EQUD    0       ; Save menu X coord here
F�
F�.menublock
F�; Menu structure first...
F�@                EQUS    prog$+�12-�(prog$),bl$) ; Menu title
F�E                EQUB    7       ; Foreground = 7 (normally black)
GD                EQUB    2       ; Background = 2 (normally grey)
GE                EQUB    7       ; Work fore  = 7 (normally black)
GE                EQUB    0       ; Work back  = 0 (normally white)
G"?                EQUD    188     ; Total width of menu items
G,@                EQUD    44      ; Total height of menu items
G6@                EQUD    0       ; Line spacing between items
G@; ...then Menu item #1
GJ5                EQUD    0       ; Nothing special
GTA.submenupoke    EQUD    0       ; Sub-menu addr poked in here
G^D                EQUD    (7<<24) � 1 ; Item has text and is black
Gh-                EQUS    "Info       "+bl$
Gr; ...then Menu item #2
G|5.immediatestat  EQUD    0       ; Nothing special
G�1                EQUD    -1      ; No sub-menu
G�D                EQUD    (7<<24) � 1 ; Item has text and is black
G�?                EQUS    "Immediate  "+bl$       ; Menu item
G�; ...then Menu item #3
G�5.warningstat    EQUD    0       ; Nothing special
G�1                EQUD    -1      ; No sub-menu
G�D                EQUD    (7<<24) � 1 ; Item has text and is black
G�?                EQUS    "Warning    "+bl$       ; Menu item
G�; ...then Menu item #4
G�5.animationstat  EQUD    0       ; Nothing special
G�1                EQUD    -1      ; No sub-menu
G�D                EQUD    (7<<24) � 1 ; Item has text and is black
G�?                EQUS    "Animation  "+bl$       ; Menu item
H; ...then Menu item #5
H5                EQUD    0       ; Nothing special
H1                EQUD    -1      ; No sub-menu
H&F; This word has to have bit 22 changed depending on Trash contents
H0G; Bit 22 refers to whether the item is shaded (unselectable) or not
H:D.trashstat      EQUD    (7<<24) � 1 ; Item has text and is black
HD?                EQUS    "Empty Trash"+bl$       ; Menu item
HN!; ...and finally Menu item #6
HX4                EQUD    &80     ; Last menu item
HbF.multiquitpoke  EQUD    0       ; Quit sub-menu addr poked in here
HlD                EQUD    (7<<24) � 1 ; Item has text and is black
Hv?                EQUS    "Quit       "+bl$       ; Menu item
H�&; Now for the Quit option sub-menu
H�7.multiquitaddr  EQUS    "Quit"+�8,bl$) ; Menu title
H�E                EQUB    7       ; Foreground = 7 (normally black)
H�D                EQUB    2       ; Background = 2 (normally grey)
H�E                EQUB    7       ; Work fore  = 7 (normally black)
H�E                EQUB    0       ; Work back  = 0 (normally white)
H�?                EQUD    156     ; Total width of menu items
H�@                EQUD    44      ; Total height of menu items
H�@                EQUD    0       ; Line spacing between items
H�; Menu item #1
H�5                EQUD    0       ; Nothing special
H�1                EQUD    -1      ; No sub-menu
H�D                EQUD    (7<<24) � 1 ; Item has text and is black
I-                EQUS    "Temporary  "+bl$
I; Menu item #2
I4                EQUD    &80     ; Last menu item
I 1                EQUD    -1      ; No sub-menu
I*D                EQUD    (7<<24) � 1 ; Item has text and is black
I4-                EQUS    "Permanent  "+bl$
I>]�
IH
IR � Save as a module !RunImage
I\F$="$.!Trash.!RunImage"
If#È™ "OS_File",&A,F$,&FFA,,org,P%
Ip�
Iz
I�L� OK, I could change @%, but can YOU understand the various bits of @% ?
I�G� Why on earth didn't Roger put new FIELD,PLACES etc. keywords in ?
I�6ݤfraction(V%)=�(V% � 100)+"."+�"0"+�(V% � 100),2)
�
00000000  0d 00 0a 18 f4 20 3e 24  2e 21 54 72 61 73 68 2e  |..... >$.!Trash.|
00000010  54 72 61 73 68 53 72 63  0d 00 14 04 0d 00 1e 3e  |TrashSrc.......>|
00000020  f4 20 52 49 53 43 20 4f  53 20 54 72 61 73 68 20  |. RISC OS Trash |
00000030  43 61 6e 20 4d 6f 64 75  6c 65 20 56 31 2e 34 30  |Can Module V1.40|
00000040  20 28 43 29 20 52 69 63  68 61 72 64 20 4b 2e 20  | (C) Richard K. |
00000050  4c 6c 6f 79 64 20 31 39  39 30 0d 00 28 04 0d 00  |Lloyd 1990..(...|
00000060  32 47 f4 20 54 68 69 73  20 73 6f 75 72 63 65 20  |2G. This source |
00000070  63 6f 64 65 20 69 73 20  72 65 6c 65 61 73 65 64  |code is released|
00000080  20 69 6e 74 6f 20 74 68  65 20 50 75 62 6c 69 63  | into the Public|
00000090  20 44 6f 6d 61 69 6e 20  66 6f 72 20 61 6e 79 6f  | Domain for anyo|
000000a0  6e 65 20 74 6f 0d 00 3c  3f f4 20 75 73 65 2c 20  |ne to..<?. use, |
000000b0  61 6c 74 68 6f 75 67 68  20 73 6f 6d 65 20 63 72  |although some cr|
000000c0  65 64 69 74 20 69 6e 20  79 6f 75 72 20 73 6f 75  |edit in your sou|
000000d0  72 63 65 20 6d 69 67 68  74 20 62 65 20 6e 69 63  |rce might be nic|
000000e0  65 2e 2e 2e 0d 00 46 04  0d 00 50 18 f4 20 53 70  |e.....F...P.. Sp|
000000f0  65 63 69 61 6c 20 74 68  61 6e 6b 73 20 74 6f 3a  |ecial thanks to:|
00000100  0d 00 5a 3b f4 20 2d 20  50 68 69 6c 69 70 20 43  |..Z;. - Philip C|
00000110  6f 6c 6d 65 72 20 28 50  43 6f 6c 6d 65 72 40 75  |olmer (PColmer@u|
00000120  6b 2e 63 6f 2e 61 63 6f  72 6e 29 20 66 6f 72 20  |k.co.acorn) for |
00000130  73 75 67 67 65 73 74 69  6f 6e 73 0d 00 64 35 f4  |suggestions..d5.|
00000140  20 2d 20 52 61 62 69 6e  20 45 7a 72 61 20 28 72  | - Rabin Ezra (r|
00000150  61 62 69 6e 40 75 6b 2e  61 63 2e 71 6d 63 2e 63  |abin@uk.ac.qmc.c|
00000160  73 29 20 66 6f 72 20 62  75 67 20 66 69 78 65 73  |s) for bug fixes|
00000170  0d 00 6e 48 f4 20 2d 20  44 61 76 69 64 20 50 69  |..nH. - David Pi|
00000180  6c 6c 69 6e 67 20 28 6d  63 62 6d 73 64 70 40 75  |lling (mcbmsdp@u|
00000190  6b 2e 61 63 2e 6d 63 63  2e 63 6d 73 29 20 66 6f  |k.ac.mcc.cms) fo|
000001a0  72 20 61 20 62 65 74 61  2d 74 65 73 74 20 53 70  |r a beta-test Sp|
000001b0  61 72 6b 20 32 2e 30 30  0d 00 78 42 f4 20 2d 20  |ark 2.00..xB. - |
000001c0  47 61 72 79 20 42 61 72  74 6c 65 74 74 20 28 29  |Gary Bartlett ()|
000001d0  20 66 6f 72 20 74 68 65  20 54 72 61 73 68 20 56  | for the Trash V|
000001e0  61 6e 20 69 6e 73 70 69  72 61 74 69 6f 6e 20 61  |an inspiration a|
000001f0  6e 64 20 73 70 72 69 74  65 73 0d 00 82 4a f4 20  |nd sprites...J. |
00000200  2d 20 4d 65 20 28 72 6b  6c 40 75 6b 2e 61 63 2e  |- Me (rkl@uk.ac.|
00000210  6c 69 76 2e 63 73 2e 61  6e 64 29 20 66 6f 72 20  |liv.cs.and) for |
00000220  66 69 6c 6c 69 6e 67 20  61 20 67 61 70 69 6e 67  |filling a gaping|
00000230  20 68 6f 6c 65 20 69 6e  20 74 68 65 20 44 65 73  | hole in the Des|
00000240  6b 74 6f 70 0d 00 8c 04  0d 00 96 3f f4 20 56 6f  |ktop.......?. Vo|
00000250  6c 75 6d 65 2f 70 61 67  65 20 72 65 66 65 72 65  |lume/page refere|
00000260  6e 63 65 73 20 61 72 65  20 66 6f 72 20 74 68 65  |nces are for the|
00000270  20 52 49 53 43 20 4f 53  20 49 73 73 75 65 20 31  | RISC OS Issue 1|
00000280  20 28 31 39 38 39 29 0d  00 a0 2e f4 20 34 2d 76  | (1989)..... 4-v|
00000290  6f 6c 75 6d 65 20 50 72  6f 67 72 61 6d 6d 65 72  |olume Programmer|
000002a0  27 73 20 52 65 66 65 72  65 6e 63 65 20 4d 61 6e  |'s Reference Man|
000002b0  75 61 6c 73 2e 0d 00 aa  04 0d 00 b4 2a f4 20 56  |uals........*. V|
000002c0  65 72 73 69 6f 6e 20 31  2e 34 30 20 52 65 6c 65  |ersion 1.40 Rele|
000002d0  61 73 65 64 20 53 65 70  74 65 6d 62 65 72 20 31  |ased September 1|
000002e0  39 39 30 0d 00 be 35 f4  20 2d 20 43 6f 6e 74 65  |990...5. - Conte|
000002f0  78 74 2d 73 65 6e 73 69  74 69 76 65 20 21 48 65  |xt-sensitive !He|
00000300  6c 70 20 69 6e 66 6f 72  6d 61 74 69 6f 6e 20 70  |lp information p|
00000310  72 6f 76 69 64 65 64 2e  0d 00 c8 41 f4 20 2d 20  |rovided....A. - |
00000320  22 50 65 72 73 69 73 74  65 6e 74 22 20 6d 65 6e  |"Persistent" men|
00000330  75 20 69 66 20 72 69 67  68 74 20 62 75 74 74 6f  |u if right butto|
00000340  6e 20 70 72 65 73 73 65  64 20 6f 6e 20 61 20 6d  |n pressed on a m|
00000350  65 6e 75 20 69 74 65 6d  2e 0d 00 d2 49 f4 20 2d  |enu item....I. -|
00000360  20 4e 65 77 20 73 70 72  69 74 65 73 20 77 69 74  | New sprites wit|
00000370  68 20 61 20 53 70 61 72  6b 2d 6c 69 6b 65 20 22  |h a Spark-like "|
00000380  66 6c 61 73 68 22 20 2d  20 73 68 6f 77 6e 20 69  |flash" - shown i|
00000390  66 20 53 70 61 72 6b 20  69 6e 73 74 61 6c 6c 65  |f Spark installe|
000003a0  64 2e 0d 00 dc 3b f4 20  2d 20 4e 6f 77 20 22 53  |d....;. - Now "S|
000003b0  70 61 72 6b 2d 61 77 61  72 65 22 20 72 65 67 61  |park-aware" rega|
000003c0  72 64 6c 65 73 73 20 6f  66 20 69 6e 73 74 61 6c  |rdless of instal|
000003d0  6c 61 74 69 6f 6e 20 6f  72 64 65 72 2e 0d 00 e6  |lation order....|
000003e0  4b f4 20 2d 20 49 6e 63  6f 72 72 65 63 74 20 62  |K. - Incorrect b|
000003f0  6f 72 64 65 72 20 66 6c  61 73 68 20 77 68 65 6e  |order flash when|
00000400  20 63 6c 69 63 6b 69 6e  67 20 69 6e 73 74 65 61  | clicking instea|
00000410  64 20 6f 66 20 64 72 61  67 67 69 6e 67 20 6e 6f  |d of dragging no|
00000420  77 20 66 69 78 65 64 2e  0d 00 f0 04 0d 00 fa 25  |w fixed........%|
00000430  f4 20 56 65 72 73 69 6f  6e 20 31 2e 33 30 20 52  |. Version 1.30 R|
00000440  65 6c 65 61 73 65 64 20  4a 75 6c 79 20 31 39 39  |eleased July 199|
00000450  30 0d 01 04 49 f4 20 2d  20 43 6f 6e 66 69 67 75  |0...I. - Configu|
00000460  72 61 74 69 6f 6e 20 6f  66 20 6e 65 77 20 6d 65  |ration of new me|
00000470  6e 75 20 6f 70 74 69 6f  6e 73 20 28 73 65 65 20  |nu options (see |
00000480  62 65 6c 6f 77 29 20 73  74 6f 72 65 64 20 69 6e  |below) stored in|
00000490  20 43 4d 4f 53 20 52 41  4d 2e 0d 01 0e 4b f4 20  | CMOS RAM....K. |
000004a0  2d 20 27 49 6d 6d 65 64  69 61 74 65 27 20 6d 65  |- 'Immediate' me|
000004b0  6e 75 20 6f 70 74 69 6f  6e 20 74 6f 20 65 72 61  |nu option to era|
000004c0  73 65 20 66 69 6c 65 73  20 73 74 72 61 69 67 68  |se files straigh|
000004d0  74 20 61 77 61 79 20 6f  6e 20 61 20 74 72 61 73  |t away on a tras|
000004e0  68 69 6e 67 2e 0d 01 18  4a f4 20 2d 20 27 57 61  |hing....J. - 'Wa|
000004f0  72 6e 69 6e 67 27 20 6d  65 6e 75 20 6f 70 74 69  |rning' menu opti|
00000500  6f 6e 20 74 6f 20 74 75  72 6e 20 74 68 65 20 62  |on to turn the b|
00000510  6f 72 64 65 72 20 72 65  64 20 64 75 72 69 6e 67  |order red during|
00000520  20 64 61 6e 67 65 72 6f  75 73 20 6f 70 73 2e 0d  | dangerous ops..|
00000530  01 22 48 f4 20 2d 20 27  41 6e 69 6d 61 74 69 6f  |."H. - 'Animatio|
00000540  6e 27 20 6d 65 6e 75 20  6f 70 74 69 6f 6e 20 74  |n' menu option t|
00000550  6f 20 73 68 6f 77 20 61  6e 20 69 63 6f 6e 20 62  |o show an icon b|
00000560  61 72 20 56 61 6e 20 64  75 72 69 6e 67 20 64 65  |ar Van during de|
00000570  6c 65 74 69 6f 6e 2e 0d  01 2c 48 f4 20 2d 20 4e  |letion...,H. - N|
00000580  65 77 20 56 61 6e 53 70  72 69 74 65 73 20 66 69  |ew VanSprites fi|
00000590  6c 65 20 28 61 6e 64 20  63 6f 64 65 20 74 6f 20  |le (and code to |
000005a0  68 61 6e 64 6c 65 20 69  74 29 20 66 6f 72 20 61  |handle it) for a|
000005b0  62 6f 76 65 20 61 6e 69  6d 61 74 69 6f 6e 2e 0d  |bove animation..|
000005c0  01 36 4b f4 20 2d 20 46  69 78 65 64 20 49 6e 66  |.6K. - Fixed Inf|
000005d0  6f 20 74 65 6d 70 6c 61  74 65 20 77 6f 72 6b 73  |o template works|
000005e0  70 61 63 65 20 66 61 75  6c 74 20 28 66 6f 72 63  |pace fault (forc|
000005f0  65 20 72 65 6c 6f 61 64  20 61 66 74 65 72 20 54  |e reload after T|
00000600  65 6d 70 20 51 75 69 74  29 2e 0d 01 40 4a f4 20  |emp Quit)...@J. |
00000610  2d 20 41 75 74 6f 2d 74  69 6d 65 2f 64 61 74 65  |- Auto-time/date|
00000620  73 74 61 6d 70 20 75 70  64 61 74 69 6e 67 20 6f  |stamp updating o|
00000630  66 20 49 6e 66 6f 20 77  69 6e 64 6f 77 20 77 69  |f Info window wi|
00000640  74 68 6f 75 74 20 75 73  69 6e 67 20 21 46 6f 72  |thout using !For|
00000650  6d 65 64 2e 0d 01 4a 44  f4 20 2d 20 41 64 64 65  |med...JD. - Adde|
00000660  64 2c 20 61 68 65 6d 2c  20 61 20 22 64 65 62 75  |d, ahem, a "debu|
00000670  67 25 22 20 66 6c 61 67  20 66 6f 72 20 77 69 6e  |g%" flag for win|
00000680  64 6f 77 2f 69 63 6f 6e  20 68 61 6e 64 6c 65 20  |dow/icon handle |
00000690  64 69 73 70 6c 61 79 2e  0d 01 54 47 f4 20 2d 20  |display...TG. - |
000006a0  27 49 6d 6d 65 64 69 61  74 65 27 20 6d 6f 64 65  |'Immediate' mode|
000006b0  20 6e 6f 77 20 61 63 63  69 64 65 6e 74 61 6c 6c  | now accidentall|
000006c0  79 20 73 69 6d 75 6c 61  74 65 73 20 74 68 65 20  |y simulates the |
000006d0  62 65 68 61 76 69 6f 75  72 20 6f 66 20 61 6e 0d  |behaviour of an.|
000006e0  01 5e 4a f4 20 20 20 41  74 61 72 69 20 53 54 20  |.^J.   Atari ST |
000006f0  74 72 61 73 68 20 63 61  6e 20 21 20 49 6e 20 6f  |trash can ! In o|
00000700  74 68 65 72 20 77 6f 72  64 73 2c 20 6e 6f 20 66  |ther words, no f|
00000710  61 74 20 69 63 6f 6e 2c  20 6e 6f 20 54 72 61 73  |at icon, no Tras|
00000720  68 20 57 69 6e 64 6f 77  2c 0d 01 68 4b f4 20 20  |h Window,..hK.  |
00000730  20 6e 6f 20 72 65 74 65  6e 74 69 6f 6e 20 6f 66  | no retention of|
00000740  20 74 72 61 73 68 65 64  20 66 69 6c 65 73 20 69  | trashed files i|
00000750  6e 20 54 72 61 73 68 24  44 69 72 2e 20 50 72 65  |n Trash$Dir. Pre|
00000760  74 74 79 20 72 75 62 62  69 73 68 20 28 21 29 20  |tty rubbish (!) |
00000770  65 68 20 3f 0d 01 72 04  0d 01 7c 28 f4 20 56 65  |eh ?..r...|(. Ve|
00000780  72 73 69 6f 6e 20 31 2e  32 30 20 52 65 6c 65 61  |rsion 1.20 Relea|
00000790  73 65 64 20 4a 61 6e 75  61 72 79 20 31 39 39 30  |sed January 1990|
000007a0  0d 01 86 4a f4 20 2d 20  52 65 70 6f 72 74 20 65  |...J. - Report e|
000007b0  72 72 6f 72 73 20 69 66  20 61 6e 79 20 6f 63 63  |rrors if any occ|
000007c0  75 72 20 64 75 72 69 6e  67 20 74 68 65 20 74 72  |ur during the tr|
000007d0  61 73 68 69 6e 67 2f 65  6d 70 74 79 69 6e 67 20  |ashing/emptying |
000007e0  70 72 6f 63 65 73 73 65  73 2e 0d 01 90 43 f4 20  |processes....C. |
000007f0  2d 20 53 77 69 74 63 68  20 6f 6e 20 68 6f 75 72  |- Switch on hour|
00000800  67 6c 61 73 73 20 69 66  20 74 72 61 73 68 69 6e  |glass if trashin|
00000810  67 20 74 61 6b 65 73 20  6c 6f 6e 67 65 72 20 74  |g takes longer t|
00000820  68 61 6e 20 31 20 73 65  63 6f 6e 64 2e 0d 01 9a  |han 1 second....|
00000830  45 f4 20 2d 20 53 75 70  70 6f 72 74 73 20 66 69  |E. - Supports fi|
00000840  6c 65 20 74 72 61 73 68  69 6e 67 20 66 72 6f 6d  |le trashing from|
00000850  20 69 6e 73 69 64 65 20  61 72 63 68 69 76 65 73  | inside archives|
00000860  20 75 73 69 6e 67 20 53  70 61 72 6b 20 32 2e 78  | using Spark 2.x|
00000870  78 2e 0d 01 a4 4a f4 20  2d 20 44 69 73 70 6c 61  |x....J. - Displa|
00000880  79 73 20 61 6e 20 65 72  72 6f 72 20 69 66 20 2a  |ys an error if *|
00000890  44 65 73 6b 74 6f 70 5f  54 72 61 73 68 43 61 6e  |Desktop_TrashCan|
000008a0  20 69 73 73 75 65 64 20  6f 75 74 73 69 64 65 20  | issued outside |
000008b0  74 68 65 20 44 65 73 6b  74 6f 70 2e 0d 01 ae 04  |the Desktop.....|
000008c0  0d 01 b8 40 f4 20 56 65  72 73 69 6f 6e 20 31 2e  |...@. Version 1.|
000008d0  31 31 20 52 65 6c 65 61  73 65 64 20 4e 6f 76 65  |11 Released Nove|
000008e0  6d 62 65 72 20 31 39 38  39 20 28 32 20 64 61 79  |mber 1989 (2 day|
000008f0  73 20 61 66 74 65 72 20  56 31 2e 31 30 20 21 29  |s after V1.10 !)|
00000900  0d 01 c2 34 f4 20 2d 20  46 69 78 65 64 20 2a 66  |...4. - Fixed *f|
00000910  61 74 61 6c 2a 20 62 75  67 20 77 69 74 68 20 56  |atal* bug with V|
00000920  31 2e 31 30 20 49 6e 66  6f 20 6d 65 6e 75 20 69  |1.10 Info menu i|
00000930  74 65 6d 2e 0d 01 cc 2c  f4 20 2d 20 53 6c 69 67  |tem....,. - Slig|
00000940  68 74 6c 79 20 72 65 2d  63 6f 64 65 64 20 51 75  |htly re-coded Qu|
00000950  69 74 20 6d 65 6e 75 20  70 61 72 73 69 6e 67 2e  |it menu parsing.|
00000960  0d 01 d6 39 f4 20 2d 20  41 64 6a 75 73 74 65 64  |...9. - Adjusted|
00000970  20 6d 65 6e 75 20 77 69  64 74 68 73 20 61 6e 64  | menu widths and|
00000980  20 68 65 69 67 68 74 73  20 28 50 68 69 6c 69 70  | heights (Philip|
00000990  20 43 6f 6c 6d 65 72 29  2e 0d 01 e0 3a f4 20 2d  | Colmer)....:. -|
000009a0  20 41 6c 6c 6f 77 65 64  20 49 6e 66 6f 20 77 69  | Allowed Info wi|
000009b0  6e 64 6f 77 20 74 6f 20  62 65 20 64 72 61 67 67  |ndow to be dragg|
000009c0  65 64 20 28 50 68 69 6c  69 70 20 43 6f 6c 6d 65  |ed (Philip Colme|
000009d0  72 29 2e 0d 01 ea 04 0d  01 f4 29 f4 20 56 65 72  |r)........). Ver|
000009e0  73 69 6f 6e 20 31 2e 31  30 20 52 65 6c 65 61 73  |sion 1.10 Releas|
000009f0  65 64 20 4e 6f 76 65 6d  62 65 72 20 31 39 38 39  |ed November 1989|
00000a00  0d 01 fe 31 f4 20 2d 20  45 6e 68 61 6e 63 65 6d  |...1. - Enhancem|
00000a10  65 6e 74 73 20 62 79 20  50 68 69 6c 69 70 20 43  |ents by Philip C|
00000a20  6f 6c 6d 65 72 20 66 72  6f 6d 20 31 2e 30 32 61  |olmer from 1.02a|
00000a30  3a 0d 02 08 4b f4 20 20  20 2d 20 54 68 69 72 64  |:...K.   - Third|
00000a40  20 73 70 72 69 74 65 20  61 64 64 65 64 20 74 6f  | sprite added to|
00000a50  20 6f 76 65 72 63 6f 6d  65 20 74 72 61 73 68 20  | overcome trash |
00000a60  63 61 6e 20 27 6c 6f 76  65 2d 68 61 6e 64 6c 65  |can 'love-handle|
00000a70  73 27 20 69 6e 20 46 69  6c 65 72 2e 0d 02 12 48  |s' in Filer....H|
00000a80  f4 20 20 20 2d 20 43 6f  72 72 65 63 74 69 6f 6e  |.   - Correction|
00000a90  20 6f 66 20 69 63 6f 6e  20 62 61 72 20 70 61 72  | of icon bar par|
00000aa0  61 6d 65 74 65 72 20 62  6c 6f 63 6b 20 28 77 69  |ameter block (wi|
00000ab0  6c 64 6c 79 20 77 72 6f  6e 67 20 69 6e 20 31 2e  |ldly wrong in 1.|
00000ac0  30 32 29 2e 0d 02 1c 3e  f4 20 20 20 2d 20 48 61  |02)....>.   - Ha|
00000ad0  72 64 2d 63 6f 64 65 64  20 49 6e 66 6f 20 77 69  |rd-coded Info wi|
00000ae0  6e 64 6f 77 20 72 65 70  6c 61 63 65 73 20 63 68  |ndow replaces ch|
00000af0  65 61 70 20 73 75 62 2d  6d 65 6e 75 20 49 6e 66  |eap sub-menu Inf|
00000b00  6f 2e 0d 02 26 2b f4 20  2d 20 45 6e 68 61 6e 63  |o...&+. - Enhanc|
00000b10  65 6d 65 6e 74 73 20 62  79 20 52 4b 4c 20 6f 6e  |ements by RKL on|
00000b20  20 74 6f 70 20 6f 66 20  74 68 69 73 3a 0d 02 30  | top of this:..0|
00000b30  45 f4 20 20 20 2d 20 55  73 65 73 20 54 65 6d 70  |E.   - Uses Temp|
00000b40  6c 61 74 65 73 20 66 6f  72 20 49 6e 66 6f 20 77  |lates for Info w|
00000b50  69 6e 64 6f 77 20 28 62  6f 79 2c 20 64 6f 20 49  |indow (boy, do I|
00000b60  20 68 61 74 65 20 21 46  6f 72 6d 45 64 2e 2e 2e  | hate !FormEd...|
00000b70  29 2e 0d 02 3a 33 f4 20  20 20 2d 20 4e 65 77 20  |)...:3.   - New |
00000b80  54 65 6d 70 6f 72 61 72  79 2f 50 65 72 6d 61 6e  |Temporary/Perman|
00000b90  65 6e 74 20 51 75 69 74  20 6d 65 6e 75 20 6f 70  |ent Quit menu op|
00000ba0  74 69 6f 6e 2e 0d 02 44  3f f4 20 20 20 2d 20 43  |tion...D?.   - C|
00000bb0  6c 61 69 6d 73 20 52 4d  41 20 64 75 72 69 6e 67  |laims RMA during|
00000bc0  20 6d 6f 64 75 6c 65 20  6c 69 66 65 20 66 6f 72  | module life for|
00000bd0  20 69 6e 74 65 72 6e 61  6c 20 77 6f 72 6b 73 70  | internal worksp|
00000be0  61 63 65 2e 0d 02 4e 49  f4 20 20 20 2d 20 53 65  |ace...NI.   - Se|
00000bf0  74 20 54 72 61 73 68 57  6f 72 6b 24 44 69 72 20  |t TrashWork$Dir |
00000c00  74 6f 20 3c 4f 62 65 79  24 44 69 72 3e 20 69 6e  |to <Obey$Dir> in|
00000c10  20 21 52 75 6e 20 28 74  65 6d 70 6c 61 74 65 2f  | !Run (template/|
00000c20  73 70 72 69 74 65 73 20  64 69 72 29 2e 0d 02 58  |sprites dir)...X|
00000c30  41 f4 20 20 20 2d 20 50  65 72 66 6f 72 6d 73 20  |A.   - Performs |
00000c40  69 6e 74 65 72 6e 61 6c  20 2a 49 63 6f 6e 53 70  |internal *IconSp|
00000c50  72 69 74 65 73 20 63 61  6c 6c 20 28 57 69 6d 70  |rites call (Wimp|
00000c60  5f 53 70 72 69 74 65 4f  70 20 31 31 29 2e 0d 02  |_SpriteOp 11)...|
00000c70  62 04 0d 02 6c 43 f4 20  56 65 72 73 69 6f 6e 20  |b...lC. Version |
00000c80  31 2e 30 32 61 20 2d 20  6e 6f 74 20 72 65 6c 65  |1.02a - not rele|
00000c90  61 73 65 64 20 28 4d 6f  64 69 66 69 63 61 74 69  |ased (Modificati|
00000ca0  6f 6e 73 20 62 79 20 50  68 69 6c 69 70 20 43 6f  |ons by Philip Co|
00000cb0  6c 6d 65 72 29 0d 02 76  04 0d 02 80 29 f4 20 56  |lmer)..v....). V|
00000cc0  65 72 73 69 6f 6e 20 31  2e 30 32 20 52 65 6c 65  |ersion 1.02 Rele|
00000cd0  61 73 65 64 20 4e 6f 76  65 6d 62 65 72 20 31 39  |ased November 19|
00000ce0  38 39 0d 02 8a 43 f4 20  2d 20 48 61 64 20 74 6f  |89...C. - Had to|
00000cf0  20 72 65 64 65 66 69 6e  65 20 21 54 72 61 73 68  | redefine !Trash|
00000d00  20 73 70 72 69 74 65 20  62 65 63 61 75 73 65 20  | sprite because |
00000d10  6f 66 20 57 69 6d 70 5f  53 65 74 49 63 6f 6e 53  |of Wimp_SetIconS|
00000d20  74 61 74 65 2e 0d 02 94  31 f4 20 2d 20 42 75 67  |tate....1. - Bug|
00000d30  20 66 69 78 65 73 20 28  69 6e 63 6c 75 64 69 6e  | fixes (includin|
00000d40  67 20 63 6f 64 65 29 20  62 79 20 52 61 62 69 6e  |g code) by Rabin|
00000d50  20 45 7a 72 61 3a 0d 02  9e 30 f4 20 20 20 2d 20  | Ezra:...0.   - |
00000d60  45 78 74 65 6e 64 65 64  20 54 72 61 73 68 24 44  |Extended Trash$D|
00000d70  69 72 20 62 75 66 66 65  72 20 74 6f 20 36 34 20  |ir buffer to 64 |
00000d80  63 68 61 72 73 2e 0d 02  a8 3a f4 20 20 20 2d 20  |chars....:.   - |
00000d90  43 68 65 63 6b 65 64 20  66 6f 72 20 54 72 61 73  |Checked for Tras|
00000da0  68 24 44 69 72 20 65 78  70 61 6e 73 69 6f 6e 20  |h$Dir expansion |
00000db0  62 75 66 66 65 72 20 6f  76 65 72 66 6c 6f 77 2e  |buffer overflow.|
00000dc0  0d 02 b2 32 f4 20 20 20  2d 20 5a 65 72 6f 2d 74  |...2.   - Zero-t|
00000dd0  65 72 6d 69 6e 61 74 65  64 20 74 68 65 20 54 72  |erminated the Tr|
00000de0  61 73 68 24 44 69 72 20  65 78 70 61 6e 73 69 6f  |ash$Dir expansio|
00000df0  6e 2e 0d 02 bc 45 f4 20  2d 20 49 6d 70 72 6f 76  |n....E. - Improv|
00000e00  65 6d 65 6e 74 20 73 75  67 67 65 73 74 69 6f 6e  |ement suggestion|
00000e10  73 20 28 77 69 74 68 20  63 6f 64 69 6e 67 20 68  |s (with coding h|
00000e20  69 6e 74 73 29 20 62 79  20 50 68 69 6c 69 70 20  |ints) by Philip |
00000e30  43 6f 6c 6d 65 72 3a 0d  02 c6 38 f4 20 20 20 2d  |Colmer:...8.   -|
00000e40  20 4d 6f 76 65 64 20 54  72 61 73 68 20 43 61 6e  | Moved Trash Can|
00000e50  20 69 63 6f 6e 20 74 6f  20 6c 65 66 74 20 73 69  | icon to left si|
00000e60  64 65 20 6f 66 20 69 63  6f 6e 20 62 61 72 2e 0d  |de of icon bar..|
00000e70  02 d0 33 f4 20 20 20 2d  20 49 6d 70 72 6f 76 65  |..3.   - Improve|
00000e80  64 20 66 69 6c 69 6e 67  20 73 79 73 74 65 6d 20  |d filing system |
00000e90  61 63 74 69 76 69 74 79  20 74 72 61 70 70 69 6e  |activity trappin|
00000ea0  67 2e 0d 02 da 35 f4 20  20 20 2d 20 53 74 6f 70  |g....5.   - Stop|
00000eb0  70 65 64 20 61 6e 6e 6f  79 69 6e 67 20 69 63 6f  |ped annoying ico|
00000ec0  6e 20 62 61 72 20 22 69  63 6f 6e 20 73 68 75 66  |n bar "icon shuf|
00000ed0  66 6c 69 6e 67 22 2e 0d  02 e4 04 0d 02 ee 25 f4  |fling"........%.|
00000ee0  20 56 65 72 73 69 6f 6e  20 31 2e 30 31 20 52 65  | Version 1.01 Re|
00000ef0  6c 65 61 73 65 64 20 4a  75 6c 79 20 31 39 38 39  |leased July 1989|
00000f00  0d 02 f8 23 f4 20 2d 20  46 69 78 65 64 20 72 65  |...#. - Fixed re|
00000f10  6e 61 6d 65 20 69 6e 63  6f 6e 73 69 73 74 65 6e  |name inconsisten|
00000f20  63 79 2e 0d 03 02 30 f4  20 2d 20 41 64 64 65 64  |cy....0. - Added|
00000f30  20 57 69 6d 70 5f 50 6f  6c 6c 20 6d 65 73 73 61  | Wimp_Poll messa|
00000f40  67 65 20 61 63 6b 6e 6f  77 6c 65 64 67 65 6d 65  |ge acknowledgeme|
00000f50  6e 74 2e 0d 03 0c 42 f4  20 2d 20 45 78 74 65 6e  |nt....B. - Exten|
00000f60  64 65 64 20 6d 61 78 69  6d 75 6d 20 6c 65 6e 67  |ded maximum leng|
00000f70  74 68 20 6f 66 20 65 78  70 61 6e 64 65 64 20 54  |th of expanded T|
00000f80  72 61 73 68 24 44 69 72  20 74 6f 20 34 38 20 63  |rash$Dir to 48 c|
00000f90  68 61 72 73 2e 0d 03 16  32 f4 20 2d 20 53 65 74  |hars....2. - Set|
00000fa0  20 54 72 61 73 68 24 44  69 72 20 74 6f 20 3c 4f  | Trash$Dir to <O|
00000fb0  62 65 79 24 44 69 72 3e  2e 54 72 61 73 68 20 69  |bey$Dir>.Trash i|
00000fc0  6e 20 21 52 75 6e 2e 0d  03 20 45 f4 20 2d 20 50  |n !Run... E. - P|
00000fd0  6f 73 74 65 64 20 77 69  74 68 20 41 63 6f 72 6e  |osted with Acorn|
00000fe0  27 73 20 22 6f 66 66 69  63 69 61 6c 22 20 75 75  |'s "official" uu|
00000ff0  65 6e 63 6f 64 65 20 74  6f 20 61 76 6f 69 64 20  |encode to avoid |
00001000  49 42 4d 20 6d 75 6e 67  69 6e 67 2e 0d 03 2a 04  |IBM munging...*.|
00001010  0d 03 34 25 f4 20 56 65  72 73 69 6f 6e 20 31 2e  |..4%. Version 1.|
00001020  30 30 20 52 65 6c 65 61  73 65 64 20 4a 75 6c 79  |00 Released July|
00001030  20 31 39 38 39 0d 03 3e  48 f4 20 2d 20 4d 61 63  | 1989..>H. - Mac|
00001040  2d 73 74 79 6c 65 20 74  72 61 73 68 20 63 61 6e  |-style trash can|
00001050  20 77 69 74 68 20 4d 61  63 2d 73 74 79 6c 65 20  | with Mac-style |
00001060  69 63 6f 6e 73 20 28 52  65 73 45 64 69 74 20 77  |icons (ResEdit w|
00001070  61 73 20 75 73 65 66 75  6c 20 21 29 2e 0d 03 48  |as useful !)...H|
00001080  46 f4 20 2d 20 53 75 72  76 69 76 65 73 20 61 6e  |F. - Survives an|
00001090  79 74 68 69 6e 67 20 65  78 63 65 70 74 20 68 61  |ything except ha|
000010a0  72 64 20 72 65 73 65 74  2c 20 6d 6f 64 75 6c 65  |rd reset, module|
000010b0  20 6b 69 6c 6c 20 6f 72  20 70 6f 77 65 72 20 6f  | kill or power o|
000010c0  66 66 2e 0d 03 52 04 0d  03 5c 43 f4 20 43 68 65  |ff...R...\C. Che|
000010d0  63 6b 20 6f 75 74 20 74  68 65 20 49 6e 64 69 67  |ck out the Indig|
000010e0  6f 20 47 69 72 6c 73 27  20 65 70 6f 6e 79 6d 6f  |o Girls' eponymo|
000010f0  75 73 6c 79 2d 74 69 74  6c 65 64 20 61 6c 62 75  |usly-titled albu|
00001100  6d 20 28 6f 6e 20 43 44  29 3a 0d 03 66 4c f4 20  |m (on CD):..fL. |
00001110  67 72 65 61 74 20 61 63  6f 75 73 74 69 63 20 67  |great acoustic g|
00001120  75 69 74 61 72 20 68 61  72 6d 6f 6e 69 65 73 20  |uitar harmonies |
00001130  2d 20 72 65 61 63 68 65  64 20 55 53 20 23 32 32  |- reached US #22|
00001140  20 28 73 61 64 6c 79 20  6e 6f 77 68 65 72 65 20  | (sadly nowhere |
00001150  69 6e 20 55 4b 29 0d 03  70 4c f4 20 52 4b 4c 27  |in UK)..pL. RKL'|
00001160  73 20 42 65 73 74 20 41  6c 62 75 6d 20 4f 66 20  |s Best Album Of |
00001170  31 39 38 39 3a 20 44 69  65 73 65 6c 20 50 61 72  |1989: Diesel Par|
00001180  6b 20 57 65 73 74 27 73  20 22 53 68 61 6b 65 73  |k West's "Shakes|
00001190  70 65 61 72 65 20 41 6c  61 62 61 6d 61 22 20 43  |peare Alabama" C|
000011a0  44 2e 0d 03 7a 27 f4 20  52 4b 4c 27 73 20 42 65  |D...z'. RKL's Be|
000011b0  73 74 20 41 6c 62 75 6d  73 20 4f 66 20 31 39 39  |st Albums Of 199|
000011c0  30 20 73 6f 20 66 61 72  3a 0d 03 84 3e f4 20 41  |0 so far:...>. A|
000011d0  6c 6c 20 74 68 6f 73 65  20 42 65 61 63 68 20 42  |ll those Beach B|
000011e0  6f 79 73 20 32 2d 66 6f  72 2d 31 20 43 44 20 72  |oys 2-for-1 CD r|
000011f0  65 69 73 73 75 65 73 20  2d 20 67 72 65 61 74 20  |eissues - great |
00001200  73 74 75 66 66 20 21 0d  03 8e 04 0d 03 98 2a de  |stuff !.......*.|
00001210  20 6f 72 67 20 26 32 30  30 30 3a f4 20 50 6c 65  | org &2000:. Ple|
00001220  6e 74 79 20 6f 66 20 61  73 73 65 6d 62 6c 79 20  |nty of assembly |
00001230  73 70 61 63 65 0d 03 a2  04 0d 03 ac 1b f4 20 41  |space......... A|
00001240  70 70 6c 69 63 61 74 69  6f 6e 20 63 6f 6e 73 74  |pplication const|
00001250  61 6e 74 73 0d 03 b6 04  0d 03 c0 33 70 72 6f 67  |ants.......3prog|
00001260  24 3d 22 54 72 61 73 68  20 43 61 6e 22 3a f4 20  |$="Trash Can":. |
00001270  45 6e 67 6c 69 73 68 20  74 65 78 74 20 6e 61 6d  |English text nam|
00001280  65 20 6f 66 20 6d 6f 64  75 6c 65 0d 03 ca 39 76  |e of module...9v|
00001290  65 72 24 3d 22 31 2e 34  30 22 3a f4 20 56 65 72  |er$="1.40":. Ver|
000012a0  73 69 6f 6e 20 6e 75 6d  62 65 72 20 6f 66 20 6d  |sion number of m|
000012b0  6f 64 75 6c 65 20 69 6e  20 58 2e 59 59 20 66 6f  |odule in X.YY fo|
000012c0  72 6d 61 74 0d 03 d4 48  f4 20 43 68 61 6e 67 65  |rmat...H. Change|
000012d0  20 6e 65 78 74 20 6c 69  6e 65 20 74 6f 20 64 61  | next line to da|
000012e0  74 65 24 3d 4d 49 44 24  28 54 49 4d 45 24 2c 35  |te$=MID$(TIME$,5|
000012f0  2c 31 31 29 20 74 6f 20  67 65 74 20 74 68 65 20  |,11) to get the |
00001300  63 75 72 72 65 6e 74 20  64 61 74 65 0d 03 de 38  |current date...8|
00001310  64 61 74 65 24 3d 22 31  30 20 53 65 70 20 31 39  |date$="10 Sep 19|
00001320  39 30 22 3a f4 20 43 75  72 72 65 6e 74 20 64 61  |90":. Current da|
00001330  74 65 20 61 73 20 61 20  66 69 78 65 64 20 73 74  |te as a fixed st|
00001340  72 69 6e 67 0d 03 e8 34  72 65 73 64 61 74 65 24  |ring...4resdate$|
00001350  3d c0 64 61 74 65 24 2c  32 29 2b 22 2d 22 2b c1  |=.date$,2)+"-"+.|
00001360  64 61 74 65 24 2c 34 2c  33 29 2b 22 2d 22 2b c2  |date$,4,3)+"-"+.|
00001370  64 61 74 65 24 2c 32 29  0d 03 f2 44 72 65 73 64  |date$,2)...Dresd|
00001380  61 74 65 24 3d 76 65 72  24 2b 22 20 28 22 2b 72  |ate$=ver$+" ("+r|
00001390  65 73 64 61 74 65 24 2b  22 29 22 3a f4 20 56 65  |esdate$+")":. Ve|
000013a0  72 73 69 6f 6e 2f 64 61  74 65 20 66 6f 72 20 49  |rsion/date for I|
000013b0  6e 66 6f 20 54 65 6d 70  6c 61 74 65 0d 03 fc 37  |nfo Template...7|
000013c0  63 6f 6d 6d 61 6e 64 24  3d 22 44 65 73 6b 74 6f  |command$="Deskto|
000013d0  70 5f 54 72 61 73 68 43  61 6e 22 3a f4 20 2a 20  |p_TrashCan":. * |
000013e0  63 6f 6d 6d 61 6e 64 20  69 6d 70 6c 65 6d 65 6e  |command implemen|
000013f0  74 65 64 0d 04 06 3c 74  72 61 73 68 76 61 72 24  |ted...<trashvar$|
00001400  3d 22 54 72 61 73 68 24  44 69 72 22 3a f4 20 54  |="Trash$Dir":. T|
00001410  72 61 73 68 20 63 61 6e  20 65 6e 76 69 72 6f 6e  |rash can environ|
00001420  6d 65 6e 74 61 6c 20 76  61 72 69 61 62 6c 65 0d  |mental variable.|
00001430  04 10 43 77 69 6d 70 24  3d 22 57 69 6d 70 24 53  |..Cwimp$="Wimp$S|
00001440  63 72 61 70 22 3a f4 20  57 69 6d 70 20 74 65 6d  |crap":. Wimp tem|
00001450  70 6f 72 61 72 79 20 66  69 6c 65 20 65 6e 76 69  |porary file envi|
00001460  72 6f 6e 6d 65 6e 74 61  6c 20 76 61 72 69 61 62  |ronmental variab|
00001470  6c 65 0d 04 1a 4b 6d 61  78 70 61 74 68 6c 65 6e  |le...Kmaxpathlen|
00001480  25 3d 36 34 3a f4 20 4d  61 78 69 6d 75 6d 20 6c  |%=64:. Maximum l|
00001490  65 6e 67 74 68 20 6f 66  20 65 78 70 61 6e 64 65  |ength of expande|
000014a0  64 20 54 72 61 73 68 24  44 69 72 20 28 69 6e 63  |d Trash$Dir (inc|
000014b0  2e 20 74 65 72 6d 69 6e  61 74 6f 72 29 0d 04 24  |. terminator)..$|
000014c0  4a 69 63 6f 6e 62 61 72  74 79 70 65 25 3d 2d 32  |Jiconbartype%=-2|
000014d0  3a f4 20 2d 31 20 3d 20  55 74 69 6c 69 74 79 20  |:. -1 = Utility |
000014e0  28 52 48 53 20 6f 66 20  62 61 72 29 2c 20 2d 32  |(RHS of bar), -2|
000014f0  20 3d 20 53 65 72 76 69  63 65 20 28 4c 48 53 20  | = Service (LHS |
00001500  6f 66 20 62 61 72 29 0d  04 2e 3e 77 69 6e 64 6d  |of bar)...>windm|
00001510  61 6e 25 3d 32 30 30 3a  f4 20 45 78 70 65 63 74  |an%=200:. Expect|
00001520  20 61 74 20 4c 45 41 53  54 20 56 32 2e 30 30 20  | at LEAST V2.00 |
00001530  6f 66 20 74 68 65 20 57  69 6e 64 6f 77 20 4d 61  |of the Window Ma|
00001540  6e 61 67 65 72 0d 04 38  47 73 74 61 63 6b 73 70  |nager..8Gstacksp|
00001550  61 63 65 25 3d 26 38 30  30 3a f4 20 32 4b 20 66  |ace%=&800:. 2K f|
00001560  6f 72 20 69 6e 74 65 72  6e 61 6c 20 52 4d 41 20  |or internal RMA |
00001570  73 74 61 63 6b 20 61 6e  64 20 74 65 6d 70 6c 61  |stack and templa|
00001580  74 65 20 77 6f 72 6b 73  70 61 63 65 0d 04 42 46  |te workspace..BF|
00001590  77 69 6e 64 6f 77 73 70  61 63 65 25 3d 26 38 30  |windowspace%=&80|
000015a0  30 3a f4 20 32 4b 20 66  6f 72 20 57 69 6d 70 5f  |0:. 2K for Wimp_|
000015b0  47 65 74 57 69 6e 64 6f  77 49 6e 66 6f 20 2f 20  |GetWindowInfo / |
000015c0  57 69 6d 70 5f 54 72 61  6e 73 66 65 72 42 6c 6f  |Wimp_TransferBlo|
000015d0  63 6b 0d 04 4c 31 73 70  72 69 74 65 73 70 61 63  |ck..L1spritespac|
000015e0  65 25 3d 33 2a 31 30 32  34 3a f4 20 33 4b 20 66  |e%=3*1024:. 3K f|
000015f0  6f 72 20 73 70 72 69 74  65 20 75 73 65 72 20 61  |or sprite user a|
00001600  72 65 61 0d 04 56 4a 73  70 61 72 6b 64 65 6c 24  |rea..VJsparkdel$|
00001610  3d 22 21 73 70 61 72 6b  20 2d 64 20 22 3a f4 20  |="!spark -d ":. |
00001620  53 70 61 72 6b 20 63 6f  6d 6d 61 6e 64 20 74 6f  |Spark command to|
00001630  20 64 65 6c 65 74 65 20  61 20 66 69 6c 65 20 69  | delete a file i|
00001640  6e 73 69 64 65 20 61 72  63 68 69 76 65 0d 04 60  |nside archive..`|
00001650  3a 62 61 74 74 65 72 79  25 3d 33 38 3a f4 20 43  |:battery%=38:. C|
00001660  4d 4f 53 20 52 41 4d 20  6c 6f 63 61 74 69 6f 6e  |MOS RAM location|
00001670  20 75 73 65 64 20 74 6f  20 73 74 6f 72 65 20 73  | used to store s|
00001680  65 74 74 69 6e 67 73 0d  04 6a 3e 64 65 62 75 67  |ettings..j>debug|
00001690  25 3d a3 3a f4 20 53 6f  2d 63 61 6c 6c 65 64 20  |%=.:. So-called |
000016a0  64 65 62 75 67 67 69 6e  67 20 2d 20 70 72 69 6e  |debugging - prin|
000016b0  74 73 20 77 69 6e 64 6f  77 2f 69 63 6f 6e 20 68  |ts window/icon h|
000016c0  61 6e 64 6c 65 0d 04 74  04 0d 04 7e 30 f4 20 54  |andle..t...~0. T|
000016d0  69 6d 65 20 66 6f 72 20  73 6f 6d 65 20 63 6f 6e  |ime for some con|
000016e0  73 74 61 6e 74 73 20 74  6f 20 68 65 6c 70 20 74  |stants to help t|
000016f0  68 65 20 72 65 61 64 65  72 0d 04 88 04 0d 04 92  |he reader.......|
00001700  32 62 6c 24 3d bd 28 30  29 3a f4 20 4e 55 4c 4c  |2bl$=.(0):. NULL|
00001710  20 63 68 61 72 20 75 73  65 64 20 74 6f 20 74 65  | char used to te|
00001720  72 6d 69 6e 61 74 65 20  73 74 72 69 6e 67 73 0d  |rminate strings.|
00001730  04 9c 18 63 72 24 3d bd  28 31 33 29 3a f4 20 50  |...cr$=.(13):. P|
00001740  6c 61 69 6e 20 43 52 0d  04 a6 34 55 70 43 61 6c  |lain CR...4UpCal|
00001750  6c 56 3d 26 31 44 3a f4  20 57 61 72 6e 69 6e 67  |lV=&1D:. Warning|
00001760  20 76 65 63 74 6f 72 20  66 6f 72 20 46 53 20 63  | vector for FS c|
00001770  68 61 6e 67 65 20 63 68  65 63 6b 0d 04 b0 47 58  |hange check...GX|
00001780  4f 53 5f 57 72 69 74 65  49 3d 26 32 30 31 30 30  |OS_WriteI=&20100|
00001790  3a f4 20 58 20 53 57 49  20 66 6f 72 6d 20 6f 66  |:. X SWI form of|
000017a0  20 4f 53 5f 57 72 69 74  65 49 20 28 75 73 65 64  | OS_WriteI (used|
000017b0  20 66 6f 72 20 56 44 55  20 37 29 2e 20 49 2d 31  | for VDU 7). I-1|
000017c0  39 39 0d 04 ba 04 0d 04  c4 3c 53 65 72 76 69 63  |99.......<Servic|
000017d0  65 5f 52 65 73 65 74 20  20 20 20 20 20 3d 26 32  |e_Reset      =&2|
000017e0  37 3a f4 20 45 6e 64 20  6f 66 20 6d 61 63 68 69  |7:. End of machi|
000017f0  6e 65 20 72 65 73 65 74  20 73 69 67 6e 61 6c 6c  |ne reset signall|
00001800  65 64 0d 04 ce 46 53 65  72 76 69 63 65 5f 53 74  |ed...FService_St|
00001810  61 72 74 57 69 6d 70 20  20 3d 26 34 39 3a f4 20  |artWimp  =&49:. |
00001820  52 65 71 75 65 73 74 20  62 79 20 44 65 73 6b 74  |Request by Deskt|
00001830  6f 70 20 74 6f 20 73 74  61 72 74 20 57 49 4d 50  |op to start WIMP|
00001840  20 6d 6f 64 75 6c 65 73  0d 04 d8 44 53 65 72 76  | modules...DServ|
00001850  69 63 65 5f 53 74 61 72  74 65 64 57 69 6d 70 3d  |ice_StartedWimp=|
00001860  26 34 41 3a f4 20 44 65  73 6b 74 6f 70 20 69 6e  |&4A:. Desktop in|
00001870  64 69 63 61 74 65 73 20  61 6c 6c 20 74 61 73 6b  |dicates all task|
00001880  73 20 6e 6f 77 20 61 63  74 69 76 65 0d 04 e2 04  |s now active....|
00001890  0d 04 ec 12 e3 20 41 25  3d 30 20 b8 20 32 20 88  |..... A%=0 . 2 .|
000018a0  20 32 0d 04 f6 0a 50 25  3d 6f 72 67 0d 05 00 0b  | 2....P%=org....|
000018b0  5b 4f 50 54 20 41 25 0d  05 0a 04 0d 05 14 45 3b  |[OPT A%.......E;|
000018c0  20 4e 6f 74 65 20 74 68  61 74 20 74 68 65 20 6d  | Note that the m|
000018d0  6f 64 75 6c 65 20 68 65  61 64 65 72 20 6d 75 73  |odule header mus|
000018e0  74 20 63 6f 6e 74 61 69  6e 20 41 44 44 52 45 53  |t contain ADDRES|
000018f0  53 20 87 53 45 54 53 20  66 72 6f 6d 20 74 68 65  |S .SETS from the|
00001900  0d 05 1e 49 3b 20 73 74  61 72 74 20 6f 66 20 74  |...I; start of t|
00001910  68 65 20 6d 6f 64 75 6c  65 2c 20 68 65 6e 63 65  |he module, hence|
00001920  20 61 20 73 75 62 74 72  61 63 74 69 6f 6e 20 6f  | a subtraction o|
00001930  66 20 6f 72 67 20 69 73  20 72 65 71 75 69 72 65  |f org is require|
00001940  64 2e 20 49 49 2d 36 32  38 0d 05 28 04 0d 05 32  |d. II-628..(...2|
00001950  46 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |F               |
00001960  20 45 51 55 44 20 20 20  20 61 70 70 73 74 61 72  | EQUD    appstar|
00001970  74 2d 6f 72 67 20 20 20  20 20 20 3b 20 41 70 70  |t-org      ; App|
00001980  6c 69 63 61 74 69 6f 6e  20 73 74 61 72 74 20 61  |lication start a|
00001990  64 64 72 0d 05 3c 43 20  20 20 20 20 20 20 20 20  |ddr..<C         |
000019a0  20 20 20 20 20 20 20 45  51 55 44 20 20 20 20 69  |       EQUD    i|
000019b0  6e 69 74 2d 6f 72 67 20  20 20 20 20 20 20 20 20  |nit-org         |
000019c0  20 3b 20 49 6e 69 74 69  61 6c 69 73 61 74 69 6f  | ; Initialisatio|
000019d0  6e 20 61 64 64 72 0d 05  46 41 20 20 20 20 20 20  |n addr..FA      |
000019e0  20 20 20 20 20 20 20 20  20 20 45 51 55 44 20 20  |          EQUD  |
000019f0  20 20 62 79 65 62 79 65  2d 6f 72 67 20 20 20 20  |  byebye-org    |
00001a00  20 20 20 20 3b 20 46 69  6e 61 6c 69 73 61 74 69  |    ; Finalisati|
00001a10  6f 6e 20 61 64 64 72 0d  05 50 49 20 20 20 20 20  |on addr..PI     |
00001a20  20 20 20 20 20 20 20 20  20 20 20 45 51 55 44 20  |           EQUD |
00001a30  20 20 20 73 65 72 76 69  63 65 63 61 6c 6c 2d 6f  |   servicecall-o|
00001a40  72 67 20 20 20 3b 20 53  65 72 76 69 63 65 20 63  |rg   ; Service c|
00001a50  61 6c 6c 20 68 61 6e 64  6c 65 72 20 61 64 64 72  |all handler addr|
00001a60  0d 05 5a 48 20 20 20 20  20 20 20 20 20 20 20 20  |..ZH            |
00001a70  20 20 20 20 45 51 55 44  20 20 20 20 74 69 74 6c  |    EQUD    titl|
00001a80  65 73 74 72 2d 6f 72 67  20 20 20 20 20 20 3b 20  |estr-org      ; |
00001a90  4d 6f 64 75 6c 65 20 74  69 74 6c 65 20 73 74 72  |Module title str|
00001aa0  69 6e 67 20 61 64 64 72  0d 05 64 40 20 20 20 20  |ing addr..d@    |
00001ab0  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 44  |            EQUD|
00001ac0  20 20 20 20 68 65 6c 70  73 74 72 2d 6f 72 67 20  |    helpstr-org |
00001ad0  20 20 20 20 20 20 3b 20  48 65 6c 70 20 73 74 72  |      ; Help str|
00001ae0  69 6e 67 20 61 64 64 72  0d 05 6e 47 20 20 20 20  |ing addr..nG    |
00001af0  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 44  |            EQUD|
00001b00  20 20 20 20 6b 65 79 77  6f 72 64 73 2d 6f 72 67  |    keywords-org|
00001b10  20 20 20 20 20 20 3b 20  43 6f 6d 6d 61 6e 64 2f  |      ; Command/|
00001b20  68 65 6c 70 20 74 61 62  6c 65 20 61 64 64 72 0d  |help table addr.|
00001b30  05 78 40 20 20 20 20 20  20 20 20 20 20 20 20 20  |.x@             |
00001b40  20 20 20 45 51 55 44 20  20 20 20 30 20 20 20 20  |   EQUD    0    |
00001b50  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 4e  |             ; N|
00001b60  6f 20 65 78 74 72 61 20  53 57 49 73 2e 2e 2e 0d  |o extra SWIs....|
00001b70  05 82 42 20 20 20 20 20  20 20 20 20 20 20 20 20  |..B             |
00001b80  20 20 20 45 51 55 44 20  20 20 20 30 20 20 20 20  |   EQUD    0    |
00001b90  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 57  |             ; W|
00001ba0  68 61 74 20 64 6f 20 79  6f 75 20 77 61 6e 74 20  |hat do you want |
00001bb0  3f 0d 05 8c 37 20 20 20  20 20 20 20 20 20 20 20  |?...7           |
00001bc0  20 20 20 20 20 45 51 55  44 20 20 20 20 30 20 20  |     EQUD    0  |
00001bd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00001be0  20 42 6c 6f 6f 64 20 3f  0d 05 96 41 20 20 20 20  | Blood ?...A    |
00001bf0  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 44  |            EQUD|
00001c00  20 20 20 20 30 20 20 20  20 20 20 20 20 20 20 20  |    0           |
00001c10  20 20 20 20 20 20 3b 20  57 65 6c 6c 20 68 61 72  |      ; Well har|
00001c20  64 20 6c 75 63 6b 2e 2e  2e 0d 05 a0 04 0d 05 aa  |d luck..........|
00001c30  49 3b 20 54 69 74 6c 65  20 73 74 72 69 6e 67 20  |I; Title string |
00001c40  74 6f 20 62 65 20 75 73  65 64 20 62 79 20 2a 4d  |to be used by *M|
00001c50  6f 64 75 6c 65 73 20 61  6e 64 20 77 68 65 6e 20  |odules and when |
00001c60  2a 52 4d 4b 69 6c 6c 69  6e 67 20 65 74 63 2e 20  |*RMKilling etc. |
00001c70  49 49 2d 36 33 35 0d 05  b4 49 3b 20 44 75 65 20  |II-635...I; Due |
00001c80  74 6f 20 74 68 65 20 77  61 79 20 2a 48 65 6c 70  |to the way *Help|
00001c90  20 77 6f 72 6b 73 20 69  6e 20 52 49 53 43 20 4f  | works in RISC O|
00001ca0  53 2c 20 61 76 6f 69 64  20 63 61 6c 6c 69 6e 67  |S, avoid calling|
00001cb0  20 74 68 65 20 6d 6f 64  75 6c 65 20 74 68 65 0d  | the module the.|
00001cc0  05 be 49 3b 20 73 61 6d  65 20 6e 61 6d 65 20 61  |..I; same name a|
00001cd0  73 20 6f 6e 65 20 6f 66  20 69 74 73 20 2a 20 63  |s one of its * c|
00001ce0  6f 6d 6d 61 6e 64 73 20  28 49 27 76 65 20 62 65  |ommands (I've be|
00001cf0  65 6e 20 67 75 69 6c 74  79 20 6f 66 20 74 68 69  |en guilty of thi|
00001d00  73 20 2e 2e 2e 21 29 2e  0d 05 c8 04 0d 05 d2 2a  |s ...!)........*|
00001d10  2e 74 69 74 6c 65 73 74  72 20 20 20 20 20 20 20  |.titlestr       |
00001d20  45 51 55 53 20 20 20 20  22 54 72 61 73 68 43 61  |EQUS    "TrashCa|
00001d30  6e 22 2b 62 6c 24 0d 05  dc 19 20 20 20 20 20 20  |n"+bl$....      |
00001d40  20 20 20 20 20 20 20 20  20 20 41 4c 49 47 4e 0d  |          ALIGN.|
00001d50  05 e6 04 0d 05 f0 39 3b  20 48 65 6c 70 20 73 74  |......9; Help st|
00001d60  72 69 6e 67 20 74 6f 20  62 65 20 75 73 65 64 20  |ring to be used |
00001d70  69 6e 20 2a 48 65 6c 70  20 4d 6f 64 75 6c 65 73  |in *Help Modules|
00001d80  20 65 74 63 2e 20 49 49  2d 36 33 35 0d 05 fa 42  | etc. II-635...B|
00001d90  3b 20 4e 6f 74 65 20 74  68 65 20 74 61 62 20 63  |; Note the tab c|
00001da0  68 61 72 61 63 74 65 72  20 61 73 20 72 65 63 6f  |haracter as reco|
00001db0  6d 6d 65 6e 64 65 64 20  62 79 20 41 63 6f 72 6e  |mmended by Acorn|
00001dc0  2e 20 41 20 73 65 63 6f  6e 64 20 74 61 62 0d 06  |. A second tab..|
00001dd0  04 47 3b 20 63 68 61 72  61 63 74 65 72 20 77 69  |.G; character wi|
00001de0  6c 6c 20 62 65 20 6e 65  65 64 65 64 20 69 66 20  |ll be needed if |
00001df0  70 72 6f 67 24 20 69 73  20 3c 20 38 20 63 68 61  |prog$ is < 8 cha|
00001e00  72 61 63 74 65 72 73 20  28 75 6e 6c 69 6b 65 6c  |racters (unlikel|
00001e10  79 20 21 29 2e 0d 06 0e  04 0d 06 18 3b 2e 68 65  |y !)........;.he|
00001e20  6c 70 73 74 72 20 20 20  20 20 20 20 20 45 51 55  |lpstr        EQU|
00001e30  53 20 70 72 6f 67 24 2b  bd 28 39 29 2b 76 65 72  |S prog$+.(9)+ver|
00001e40  24 2b 22 20 28 22 2b 64  61 74 65 24 2b 22 29 22  |$+" ("+date$+")"|
00001e50  2b 62 6c 24 0d 06 22 19  20 20 20 20 20 20 20 20  |+bl$..".        |
00001e60  20 20 20 20 20 20 20 20  41 4c 49 47 4e 0d 06 2c  |        ALIGN..,|
00001e70  04 0d 06 36 42 3b 20 4b  65 79 77 6f 72 64 20 6c  |...6B; Keyword l|
00001e80  6f 6f 6b 75 70 20 74 61  62 6c 65 20 66 6f 72 20  |ookup table for |
00001e90  2a 48 65 6c 70 20 61 6e  64 20 63 6f 6d 6d 61 6e  |*Help and comman|
00001ea0  64 20 65 78 65 63 75 74  69 6f 6e 2e 20 49 49 2d  |d execution. II-|
00001eb0  36 33 36 0d 06 40 47 3b  20 41 6e 79 20 61 64 64  |636..@G; Any add|
00001ec0  72 65 73 73 65 73 20 73  68 6f 75 6c 64 2c 20 61  |resses should, a|
00001ed0  73 20 75 73 75 61 6c 2c  20 62 65 20 6f 66 66 73  |s usual, be offs|
00001ee0  65 74 73 20 66 72 6f 6d  20 74 68 65 20 6d 6f 64  |ets from the mod|
00001ef0  75 6c 65 20 73 74 61 72  74 2e 0d 06 4a 46 3b 20  |ule start...JF; |
00001f00  4e 6f 74 65 2d 20 4d 6f  64 75 6c 65 73 20 74 68  |Note- Modules th|
00001f10  61 74 20 6d 75 6c 74 69  2d 74 61 73 6b 20 75 6e  |at multi-task un|
00001f20  64 65 72 20 74 68 65 20  57 69 6d 70 20 4d 55 53  |der the Wimp MUS|
00001f30  54 20 68 61 76 65 20 61  20 73 74 61 72 74 75 70  |T have a startup|
00001f40  0d 06 54 46 3b 20 20 20  20 20 20 20 2a 20 63 6f  |..TF;       * co|
00001f50  6d 6d 61 6e 64 20 62 65  63 61 75 73 65 20 6f 66  |mmand because of|
00001f60  20 74 68 65 20 77 61 79  20 53 74 61 72 74 5f 57  | the way Start_W|
00001f70  69 6d 70 54 61 73 6b 20  69 73 20 63 61 6c 6c 65  |impTask is calle|
00001f80  64 20 77 68 65 6e 0d 06  5e 28 3b 20 20 20 20 20  |d when..^(;     |
00001f90  20 20 74 68 65 20 44 65  73 6b 74 6f 70 20 66 69  |  the Desktop fi|
00001fa0  72 73 74 20 73 74 61 72  74 73 20 75 70 2e 0d 06  |rst starts up...|
00001fb0  68 04 0d 06 72 0d 2e 6b  65 79 77 6f 72 64 73 0d  |h...r..keywords.|
00001fc0  06 7c 3c 2e 73 74 61 72  74 75 70 6e 61 6d 65 20  |.|<.startupname |
00001fd0  20 20 20 45 51 55 53 20  20 20 20 63 6f 6d 6d 61  |   EQUS    comma|
00001fe0  6e 64 24 2b 62 6c 24 20  20 20 20 3b 20 2a 20 63  |nd$+bl$    ; * c|
00001ff0  6f 6d 6d 61 6e 64 20 6e  61 6d 65 0d 06 86 43 20  |ommand name...C |
00002000  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 41  |               A|
00002010  4c 49 47 4e 20 20 20 20  20 20 20 20 20 20 20 20  |LIGN            |
00002020  20 20 20 20 20 20 20 3b  20 4d 55 53 54 20 69 6e  |       ; MUST in|
00002030  63 6c 75 64 65 20 61 6e  20 41 4c 49 47 4e 0d 06  |clude an ALIGN..|
00002040  90 45 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.E              |
00002050  20 20 45 51 55 44 20 20  20 20 73 74 61 72 74 75  |  EQUD    startu|
00002060  70 63 6f 6d 6d 2d 6f 72  67 20 3b 20 54 72 61 73  |pcomm-org ; Tras|
00002070  68 43 61 6e 20 65 78 65  63 20 61 64 64 72 20 87  |hCan exec addr .|
00002080  53 45 54 0d 06 9a 40 20  20 20 20 20 20 20 20 20  |SET...@         |
00002090  20 20 20 20 20 20 20 45  51 55 42 20 20 20 20 30  |       EQUB    0|
000020a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000020b0  20 4d 69 6e 69 6d 75 6d  20 70 61 72 61 6d 73 20  | Minimum params |
000020c0  3d 20 30 0d 06 a4 44 20  20 20 20 20 20 20 20 20  |= 0...D         |
000020d0  20 20 20 20 20 20 20 45  51 55 42 20 20 20 20 25  |       EQUB    %|
000020e0  30 30 30 30 30 30 30 30  20 20 20 20 20 20 20 3b  |00000000       ;|
000020f0  20 4e 6f 20 4f 53 5f 47  53 54 72 61 6e 73 20 70  | No OS_GSTrans p|
00002100  65 66 6f 72 6d 65 64 0d  06 ae 40 20 20 20 20 20  |eformed...@     |
00002110  20 20 20 20 20 20 20 20  20 20 20 45 51 55 42 20  |           EQUB |
00002120  20 20 20 30 20 20 20 20  20 20 20 20 20 20 20 20  |   0            |
00002130  20 20 20 3b 20 4d 61 78  69 6d 75 6d 20 70 61 72  |   ; Maximum par|
00002140  61 6d 73 20 3d 20 30 0d  06 b8 4c 20 20 20 20 20  |ams = 0...L     |
00002150  20 20 20 20 20 20 20 20  20 20 20 45 51 55 42 20  |           EQUB |
00002160  20 20 20 25 30 30 30 30  30 30 30 30 20 20 20 20  |   %00000000    |
00002170  20 20 20 3b 20 4e 6f 20  2a 43 6f 6e 66 20 6f 72  |   ; No *Conf or|
00002180  20 73 70 65 63 69 61 6c  20 2a 48 65 6c 70 20 63  | special *Help c|
00002190  6f 64 65 0d 06 c2 49 20  20 20 20 20 20 20 20 20  |ode...I         |
000021a0  20 20 20 20 20 20 20 45  51 55 44 20 20 20 20 6e  |       EQUD    n|
000021b0  6f 70 61 72 61 6d 73 2d  6f 72 67 20 20 20 20 3b  |oparams-org    ;|
000021c0  20 53 70 65 63 69 61 6c  20 70 61 72 61 6d 73 20  | Special params |
000021d0  6d 65 73 73 61 67 65 20  87 53 45 54 0d 06 cc 46  |message .SET...F|
000021e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000021f0  45 51 55 44 20 20 20 20  73 74 61 72 74 75 70 68  |EQUD    startuph|
00002200  65 6c 70 2d 6f 72 67 20  3b 20 2a 20 63 6f 6d 6d  |elp-org ; * comm|
00002210  61 6e 64 20 68 65 6c 70  20 74 65 78 74 20 87 53  |and help text .S|
00002220  45 54 0d 06 d6 40 20 20  20 20 20 20 20 20 20 20  |ET...@          |
00002230  20 20 20 20 20 20 45 51  55 44 20 20 20 20 30 20  |      EQUD    0 |
00002240  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00002250  4e 6f 20 6d 6f 72 65 20  2a 20 63 6f 6d 6d 61 6e  |No more * comman|
00002260  64 73 0d 06 e0 04 0d 06  ea 4d 3b 20 49 66 20 61  |ds.......M; If a|
00002270  6e 79 20 70 61 72 61 6d  65 74 65 72 73 20 73 75  |ny parameters su|
00002280  70 70 6c 69 65 64 2c 20  74 68 65 6e 20 63 6f 6d  |pplied, then com|
00002290  70 6c 61 69 6e 2e 20 49  6e 20 61 63 74 75 61 6c  |plain. In actual|
000022a0  20 66 61 63 74 2c 20 74  68 69 73 20 6d 65 73 73  | fact, this mess|
000022b0  61 67 65 0d 06 f4 4a 3b  20 69 73 20 64 69 73 70  |age...J; is disp|
000022c0  6c 61 79 65 64 20 69 66  20 70 61 72 61 6d 73 3c  |layed if params<|
000022d0  6d 69 6e 20 6f 72 20 70  61 72 61 6d 73 3e 6d 61  |min or params>ma|
000022e0  78 20 28 6a 75 73 74 20  74 68 61 74 20 6d 69 6e  |x (just that min|
000022f0  3d 6d 61 78 3d 30 20 68  65 72 65 29 2e 0d 06 fe  |=max=0 here)....|
00002300  04 0d 07 08 34 2e 6e 6f  70 61 72 61 6d 73 20 20  |....4.noparams  |
00002310  20 20 20 20 20 45 51 55  53 20 20 20 20 22 53 79  |     EQUS    "Sy|
00002320  6e 74 61 78 3a 20 2a 22  2b 63 6f 6d 6d 61 6e 64  |ntax: *"+command|
00002330  24 2b 62 6c 24 0d 07 12  19 20 20 20 20 20 20 20  |$+bl$....       |
00002340  20 20 20 20 20 20 20 20  20 41 4c 49 47 4e 0d 07  |         ALIGN..|
00002350  1c 04 0d 07 26 42 3b 20  2a 48 65 6c 70 20 74 65  |....&B; *Help te|
00002360  78 74 20 67 6f 65 73 20  68 65 72 65 2e 20 41 76  |xt goes here. Av|
00002370  6f 69 64 20 bd 28 31 33  29 20 6f 72 20 bd 28 31  |oid .(13) or .(1|
00002380  30 29 20 75 6e 6c 65 73  73 20 61 62 73 6f 6c 75  |0) unless absolu|
00002390  74 65 6c 79 0d 07 30 45  3b 20 6e 65 63 65 73 73  |tely..0E; necess|
000023a0  61 72 79 20 28 75 73 75  61 6c 6c 79 20 74 6f 20  |ary (usually to |
000023b0  73 70 6c 69 74 20 74 68  65 20 2a 53 79 6e 74 61  |split the *Synta|
000023c0  78 20 6d 65 73 73 61 67  65 20 66 72 6f 6d 20 74  |x message from t|
000023d0  68 65 20 72 65 73 74 29  2c 0d 07 3a 41 3b 20 62  |he rest),..:A; b|
000023e0  65 63 61 75 73 65 20 74  68 69 73 20 74 65 78 74  |ecause this text|
000023f0  20 69 73 20 4f 53 5f 50  72 65 74 74 79 50 72 69  | is OS_PrettyPri|
00002400  6e 74 65 64 2e 20 48 61  72 64 20 73 70 61 63 65  |nted. Hard space|
00002410  73 20 3d 20 bd 28 33 31  29 2e 0d 07 44 04 0d 07  |s = .(31)...D...|
00002420  4e 68 2e 73 74 61 72 74  75 70 68 65 6c 70 20 20  |Nh.startuphelp  |
00002430  20 20 45 51 55 53 20 20  20 20 22 54 68 65 20 22  |  EQUS    "The "|
00002440  2b 70 72 6f 67 24 2b 22  20 75 74 69 6c 69 74 79  |+prog$+" utility|
00002450  20 70 72 6f 76 69 64 65  73 20 61 20 74 72 61 73  | provides a tras|
00002460  68 20 63 61 6e 20 69 63  6f 6e 20 6f 6e 20 74 68  |h can icon on th|
00002470  65 20 69 63 6f 6e 20 62  61 72 2c 20 61 6e 64 20  |e icon bar, and |
00002480  75 73 65 73 20 22 0d 07  58 8a 20 20 20 20 20 20  |uses "..X.      |
00002490  20 20 20 20 20 20 20 20  20 20 45 51 55 53 20 20  |          EQUS  |
000024a0  20 20 22 74 68 65 20 46  69 6c 65 72 20 74 6f 20  |  "the Filer to |
000024b0  64 69 73 70 6c 61 79 20  74 68 65 20 74 72 61 73  |display the tras|
000024c0  68 20 63 61 6e 20 63 6f  6e 74 65 6e 74 73 2e 22  |h can contents."|
000024d0  2b 63 72 24 2b bd 28 31  30 29 2b 22 44 6f 20 6e  |+cr$+.(10)+"Do n|
000024e0  6f 74 20 75 73 65 20 2a  22 2b 63 6f 6d 6d 61 6e  |ot use *"+comman|
000024f0  64 24 2b 22 2c 20 75 73  65 20 2a 44 65 73 6b 74  |d$+", use *Deskt|
00002500  6f 70 20 69 6e 73 74 65  61 64 2e 22 2b 62 6c 24  |op instead."+bl$|
00002510  0d 07 62 19 20 20 20 20  20 20 20 20 20 20 20 20  |..b.            |
00002520  20 20 20 20 41 4c 49 47  4e 0d 07 6c 04 0d 07 76  |    ALIGN..l...v|
00002530  31 3b 20 50 48 45 57 20  21 20 4e 6f 77 20 6c 65  |1; PHEW ! Now le|
00002540  74 27 73 20 67 65 74 20  64 6f 77 6e 20 74 6f 20  |t's get down to |
00002550  73 6f 6d 65 20 63 6f 64  69 6e 67 2e 2e 2e 0d 07  |some coding.....|
00002560  80 04 0d 07 8a 12 2e 69  6e 74 65 72 6e 61 6c 72  |.......internalr|
00002570  65 73 65 74 0d 07 94 04  0d 07 9e 49 3b 20 41 6e  |eset.......I; An|
00002580  20 69 6e 74 65 72 6e 61  6c 20 74 61 73 6b 20 76  | internal task v|
00002590  61 72 69 61 62 6c 65 20  69 73 20 73 65 74 20 74  |ariable is set t|
000025a0  6f 20 7a 65 72 6f 20 28  6e 6f 74 20 72 75 6e 6e  |o zero (not runn|
000025b0  69 6e 67 29 20 6f 6e 20  65 78 65 63 75 74 69 6f  |ing) on executio|
000025c0  6e 0d 07 a8 4b 3b 20 6f  66 20 74 68 65 20 49 6e  |n...K; of the In|
000025d0  69 74 69 61 6c 69 73 61  74 69 6f 6e 20 63 6f 64  |itialisation cod|
000025e0  65 2c 20 61 74 20 74 68  65 20 65 6e 64 20 6f 66  |e, at the end of|
000025f0  20 61 20 6d 61 63 68 69  6e 65 20 28 73 6f 66 74  | a machine (soft|
00002600  20 21 29 20 72 65 73 65  74 20 6f 72 0d 07 b2 3c  | !) reset or...<|
00002610  3b 20 77 68 65 6e 20 61  6e 20 6f 6c 64 20 74 61  |; when an old ta|
00002620  73 6b 20 69 73 20 73 68  75 74 64 6f 77 6e 20 28  |sk is shutdown (|
00002630  74 6f 20 70 72 65 76 65  6e 74 20 64 75 70 6c 69  |to prevent dupli|
00002640  63 61 74 69 6f 6e 29 2e  0d 07 bc 04 0d 07 c6 29  |cation)........)|
00002650  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002660  53 54 4d 46 44 20 20 20  52 31 33 21 2c 7b 52 30  |STMFD   R13!,{R0|
00002670  2c 52 31 34 7d 0d 07 d0  21 20 20 20 20 20 20 20  |,R14}...!       |
00002680  20 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |         MOV    |
00002690  20 52 30 2c 23 30 0d 07  da 4b 20 20 20 20 20 20  | R0,#0...K      |
000026a0  20 20 20 20 20 20 20 20  20 20 53 54 52 20 20 20  |          STR   |
000026b0  20 20 52 30 2c 74 61 73  6b 68 61 6e 64 6c 65 20  |  R0,taskhandle |
000026c0  20 20 3b 20 54 61 73 6b  20 6e 6f 74 20 72 75 6e  |  ; Task not run|
000026d0  6e 69 6e 67 2c 20 6e 6f  74 20 63 6c 61 69 6d 65  |ning, not claime|
000026e0  64 0d 07 e4 48 20 20 20  20 20 20 20 20 20 20 20  |d...H           |
000026f0  20 20 20 20 20 53 54 52  20 20 20 20 20 52 30 2c  |     STR     R0,|
00002700  73 70 61 72 6b 74 61 73  6b 68 61 6e 64 3b 20 44  |sparktaskhand; D|
00002710  6f 6e 27 74 20 6b 6e 6f  77 20 61 62 6f 75 74 20  |on't know about |
00002720  53 70 61 72 6b 20 79 65  74 0d 07 ee 44 20 20 20  |Spark yet...D   |
00002730  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 52  |             STR|
00002740  20 20 20 20 20 52 30 2c  73 70 61 72 6b 77 69 6e  |     R0,sparkwin|
00002750  64 68 61 6e 64 3b 20 6f  72 20 74 68 65 20 77 69  |dhand; or the wi|
00002760  6e 64 6f 77 20 69 6e 76  6f 6c 76 65 64 0d 07 f8  |ndow involved...|
00002770  3e 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |>               |
00002780  20 53 54 52 42 20 20 20  20 52 30 2c 67 6c 61 73  | STRB    R0,glas|
00002790  73 73 74 61 74 20 20 20  20 3b 20 48 6f 75 72 67  |sstat    ; Hourg|
000027a0  6c 61 73 73 20 69 73 20  6f 66 66 0d 08 02 28 20  |lass is off...( |
000027b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
000027c0  44 4d 46 44 20 20 20 52  31 33 21 2c 7b 52 30 2c  |DMFD   R13!,{R0,|
000027d0  50 43 7d 0d 08 0c 04 0d  08 16 10 2e 73 65 72 76  |PC}.........serv|
000027e0  69 63 65 63 61 6c 6c 0d  08 20 04 0d 08 2a 3c 3b  |icecall.. ...*<;|
000027f0  20 54 68 65 20 6c 6f 63  61 74 69 6f 6e 20 27 74  | The location 't|
00002800  61 73 6b 68 61 6e 64 6c  65 27 20 68 6f 6c 64 73  |askhandle' holds|
00002810  20 74 68 65 20 73 74 61  74 65 20 6f 66 20 74 68  | the state of th|
00002820  65 20 74 61 73 6b 3a 0d  08 34 3a 3b 20 30 20 20  |e task:..4:; 0  |
00002830  3d 20 4e 6f 74 20 72 75  6e 6e 69 6e 67 2c 20 77  |= Not running, w|
00002840  61 69 74 69 6e 67 20 74  6f 20 63 6c 61 69 6d 20  |aiting to claim |
00002850  53 65 72 76 69 63 65 5f  53 74 61 72 74 57 69 6d  |Service_StartWim|
00002860  70 0d 08 3e 48 3b 20 2d  31 20 3d 20 4e 6f 74 20  |p..>H; -1 = Not |
00002870  72 75 6e 6e 69 6e 67 2c  20 63 6c 61 69 6d 65 64  |running, claimed|
00002880  20 53 65 72 76 69 63 65  5f 53 74 61 72 74 57 69  | Service_StartWi|
00002890  6d 70 2c 20 77 61 69 74  69 6e 67 20 66 6f 72 20  |mp, waiting for |
000028a0  2a 20 63 6f 6d 6d 61 6e  64 0d 08 48 45 3b 20 3e  |* command..HE; >|
000028b0  30 20 3d 20 52 75 6e 6e  69 6e 67 2c 20 76 61 6c  |0 = Running, val|
000028c0  75 65 20 73 65 74 20 74  6f 20 57 69 6d 70 5f 49  |ue set to Wimp_I|
000028d0  6e 69 74 69 61 6c 69 73  65 20 72 65 74 75 72 6e  |nitialise return|
000028e0  65 64 20 74 61 73 6b 20  68 61 6e 64 6c 65 0d 08  |ed task handle..|
000028f0  52 04 0d 08 5c 4b 3b 20  54 68 65 20 53 65 72 76  |R...\K; The Serv|
00002900  69 63 65 5f 52 65 73 65  74 20 73 69 67 6e 61 6c  |ice_Reset signal|
00002910  20 28 53 65 72 76 69 63  65 20 43 61 6c 6c 20 26  | (Service Call &|
00002920  32 37 29 20 69 73 20 74  68 65 20 ee 4c 59 20 77  |27) is the .LY w|
00002930  61 79 20 28 49 20 6b 6e  6f 77 2e 2e 29 0d 08 66  |ay (I know..)..f|
00002940  49 3b 20 74 6f 20 65 78  65 63 75 74 65 20 6d 6f  |I; to execute mo|
00002950  64 75 6c 65 20 63 6f 64  65 20 61 74 20 74 68 65  |dule code at the|
00002960  20 65 6e 64 20 6f 66 20  61 20 6d 61 63 68 69 6e  | end of a machin|
00002970  65 20 72 65 73 65 74 2e  20 49 20 75 73 65 20 74  |e reset. I use t|
00002980  68 69 73 20 74 6f 0d 08  70 28 3b 20 73 68 75 74  |his to..p(; shut|
00002990  64 6f 77 6e 20 74 68 65  20 74 61 73 6b 20 69 66  |down the task if|
000029a0  20 73 74 69 6c 6c 20 61  63 74 69 76 65 2e 0d 08  | still active...|
000029b0  7a 37 3b 20 49 49 2d 36  38 31 20 2d 2d 2d 3e 20  |z7; II-681 ---> |
000029c0  44 4f 45 53 4e 27 54 20  54 45 4c 4c 20 59 4f 55  |DOESN'T TELL YOU|
000029d0  20 74 6f 20 72 65 66 65  72 20 74 6f 20 49 49 49  | to refer to III|
000029e0  2d 31 31 36 31 0d 08 84  04 0d 08 8e 4c 20 20 20  |-1161.......L   |
000029f0  20 20 20 20 20 20 20 20  20 20 20 20 20 43 4d 50  |             CMP|
00002a00  20 20 20 20 20 52 31 2c  23 53 65 72 76 69 63 65  |     R1,#Service|
00002a10  5f 52 65 73 65 74 20 20  20 20 20 20 20 3b 20 45  |_Reset       ; E|
00002a20  6e 64 20 6f 66 20 6d 61  63 68 69 6e 65 20 72 65  |nd of machine re|
00002a30  73 65 74 20 3f 0d 08 98  45 20 20 20 20 20 20 20  |set ?...E       |
00002a40  20 20 20 20 20 20 20 20  20 42 45 51 20 20 20 20  |         BEQ    |
00002a50  20 69 6e 69 74 20 20 20  20 20 20 20 20 20 20 20  | init           |
00002a60  20 20 20 20 20 20 20 20  20 3b 20 59 65 73 2c 20  |         ; Yes, |
00002a70  73 6f 20 72 65 73 74 61  72 74 0d 08 a2 04 0d 08  |so restart......|
00002a80  ac 48 3b 20 54 68 65 20  76 65 72 79 20 66 69 72  |.H; The very fir|
00002a90  73 74 20 74 68 69 6e 67  20 74 68 61 74 20 74 68  |st thing that th|
00002aa0  65 20 44 65 73 6b 74 6f  70 20 64 6f 65 73 20 61  |e Desktop does a|
00002ab0  66 74 65 72 20 61 20 57  69 6d 70 5f 49 6e 69 74  |fter a Wimp_Init|
00002ac0  69 61 6c 69 73 65 0d 08  b6 48 3b 20 69 73 20 74  |ialise...H; is t|
00002ad0  6f 20 73 69 67 6e 61 6c  20 53 65 72 76 69 63 65  |o signal Service|
00002ae0  5f 53 74 61 72 74 57 69  6d 70 20 28 53 65 72 76  |_StartWimp (Serv|
00002af0  69 63 65 20 43 61 6c 6c  20 26 34 39 29 20 74 6f  |ice Call &49) to|
00002b00  20 65 76 65 72 79 20 6d  6f 64 75 6c 65 2e 0d 08  | every module...|
00002b10  c0 4a 3b 20 54 68 6f 73  65 20 74 68 61 74 20 61  |.J; Those that a|
00002b20  72 65 20 69 6e 74 65 72  65 73 74 65 64 20 69 6e  |re interested in|
00002b30  20 62 65 69 6e 67 20 74  72 65 6e 64 79 20 28 4f  | being trendy (O|
00002b40  4b 2c 20 6d 75 6c 74 69  2d 74 61 73 6b 69 6e 67  |K, multi-tasking|
00002b50  29 2c 20 63 6c 61 69 6d  0d 08 ca 44 3b 20 74 68  |), claim...D; th|
00002b60  61 74 20 73 65 72 76 69  63 65 20 63 61 6c 6c 20  |at service call |
00002b70  e7 20 54 48 45 59 20 41  52 45 20 ac 20 41 4c 52  |. THEY ARE . ALR|
00002b80  45 41 44 59 20 52 55 4e  4e 49 4e 47 20 61 6e 64  |EADY RUNNING and|
00002b90  2c 20 6f 66 20 63 6f 75  72 73 65 2c 0d 08 d4 3f  |, of course,...?|
00002ba0  3b 20 68 61 76 65 6e 27  74 20 61 6c 72 65 61 64  |; haven't alread|
00002bb0  79 20 72 65 63 65 69 76  65 64 20 61 6e 64 20 63  |y received and c|
00002bc0  6c 61 69 6d 65 64 20 61  20 53 65 72 76 69 63 65  |laimed a Service|
00002bd0  5f 53 74 61 72 74 57 69  6d 70 2e 0d 08 de 4c 3b  |_StartWimp....L;|
00002be0  20 49 49 2d 37 30 31 20  2d 2d 2d 3e 20 61 6e 6e  | II-701 ---> ann|
00002bf0  6f 79 69 6e 67 6c 79 20  72 65 66 65 72 72 69 6e  |oyingly referrin|
00002c00  67 20 74 6f 20 74 68 65  20 72 6f 75 67 68 20 27  |g to the rough '|
00002c10  57 69 6e 64 6f 77 20 4d  61 6e 61 67 65 72 27 20  |Window Manager' |
00002c20  63 68 61 70 74 65 72 0d  08 e8 47 3b 20 20 20 20  |chapter...G;    |
00002c30  20 20 20 20 20 20 20 20  20 28 74 75 72 6e 73 20  |         (turns |
00002c40  6f 75 74 2c 20 61 66 74  65 72 20 6d 75 63 68 20  |out, after much |
00002c50  70 61 67 65 20 73 63 61  6e 6e 69 6e 67 2c 20 74  |page scanning, t|
00002c60  6f 20 62 65 20 49 49 49  2d 31 31 35 39 29 0d 08  |o be III-1159)..|
00002c70  f2 04 0d 08 fc 4a 20 20  20 20 20 20 20 20 20 20  |.....J          |
00002c80  20 20 20 20 20 20 43 4d  50 20 20 20 20 20 52 31  |      CMP     R1|
00002c90  2c 23 53 65 72 76 69 63  65 5f 53 74 61 72 74 57  |,#Service_StartW|
00002ca0  69 6d 70 20 20 20 3b 20  41 72 65 20 77 65 20 66  |imp   ; Are we f|
00002cb0  69 72 69 6e 67 20 75 70  20 74 68 65 0d 09 06 3f  |iring up the...?|
00002cc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002cd0  42 45 51 20 20 20 20 20  72 6f 75 6e 64 31 20 20  |BEQ     round1  |
00002ce0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002cf0  3b 20 44 65 73 6b 74 6f  70 20 3f 0d 09 10 04 0d  |; Desktop ?.....|
00002d00  09 1a 44 3b 20 4f 6e 63  65 20 65 76 65 72 79 6f  |..D; Once everyo|
00002d10  6e 65 27 73 20 72 65 73  70 6f 6e 64 65 64 20 74  |ne's responded t|
00002d20  6f 20 53 65 72 76 69 63  65 5f 53 74 61 72 74 57  |o Service_StartW|
00002d30  69 6d 70 20 77 68 6f 20  77 61 6e 74 73 20 74 6f  |imp who wants to|
00002d40  2c 20 61 0d 09 24 40 3b  20 27 66 69 6e 61 6c 20  |, a..$@; 'final |
00002d50  63 68 61 6e 63 65 27 20  69 73 20 73 65 6e 74 20  |chance' is sent |
00002d60  61 72 6f 75 6e 64 20 2d  20 53 65 72 76 69 63 65  |around - Service|
00002d70  5f 53 74 61 72 74 65 64  57 69 6d 70 20 28 26 34  |_StartedWimp (&4|
00002d80  41 29 2e 0d 09 2e 48 3b  20 49 49 2d 37 30 32 20  |A)....H; II-702 |
00002d90  2d 2d 2d 3e 20 61 6e 6e  6f 79 69 6e 67 6c 79 20  |---> annoyingly |
00002da0  28 76 61 67 75 65 6c 79  2c 20 6c 69 6b 65 20 61  |(vaguely, like a|
00002db0  62 6f 76 65 29 20 72 65  66 65 72 72 69 6e 67 20  |bove) referring |
00002dc0  74 6f 20 49 49 49 2d 31  31 36 31 0d 09 38 04 0d  |to III-1161..8..|
00002dd0  09 42 48 20 20 20 20 20  20 20 20 20 20 20 20 20  |.BH             |
00002de0  20 20 20 43 4d 50 20 20  20 20 20 52 31 2c 23 53  |   CMP     R1,#S|
00002df0  65 72 76 69 63 65 5f 53  74 61 72 74 65 64 57 69  |ervice_StartedWi|
00002e00  6d 70 20 3b 20 52 6f 75  6e 64 20 32 20 6f 66 20  |mp ; Round 2 of |
00002e10  44 65 73 6b 74 6f 70 0d  09 4c 22 20 20 20 20 20  |Desktop..L"     |
00002e20  20 20 20 20 20 20 20 20  20 20 20 42 45 51 20 20  |           BEQ  |
00002e30  20 20 20 72 6f 75 6e 64  32 0d 09 56 04 0d 09 60  |   round2..V...`|
00002e40  4b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |K               |
00002e50  20 4d 4f 56 20 20 20 20  20 50 43 2c 52 31 34 20  | MOV     PC,R14 |
00002e60  20 20 20 20 20 20 20 20  20 3b 20 4e 6f 74 20 69  |         ; Not i|
00002e70  6e 74 65 72 65 73 74 65  64 20 69 6e 20 61 6e 79  |nterested in any|
00002e80  20 6f 66 20 74 68 65 6d  0d 09 6a 04 0d 09 74 29  | of them..j...t)|
00002e90  2e 72 6f 75 6e 64 31 20  20 20 20 20 20 20 20 20  |.round1         |
00002ea0  53 54 4d 46 44 20 20 20  52 31 33 21 2c 7b 52 32  |STMFD   R13!,{R2|
00002eb0  2c 52 31 34 7d 0d 09 7e  29 20 20 20 20 20 20 20  |,R14}..~)       |
00002ec0  20 20 20 20 20 20 20 20  20 4c 44 52 20 20 20 20  |         LDR    |
00002ed0  20 52 32 2c 74 61 73 6b  68 61 6e 64 6c 65 0d 09  | R2,taskhandle..|
00002ee0  88 49 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.I              |
00002ef0  20 20 4d 4f 56 53 20 20  20 20 52 32 2c 52 32 20  |  MOVS    R2,R2 |
00002f00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002f10  20 20 3b 20 49 73 20 74  61 73 6b 68 61 6e 64 6c  |  ; Is taskhandl|
00002f20  65 20 3d 20 30 20 3f 0d  09 92 4d 20 20 20 20 20  |e = 0 ?...M     |
00002f30  20 20 20 20 20 20 20 20  20 20 20 4d 56 4e 45 51  |           MVNEQ|
00002f40  20 20 20 52 32 2c 23 30  20 20 20 20 20 20 20 20  |   R2,#0        |
00002f50  20 20 20 20 20 20 20 20  20 20 20 3b 20 59 65 73  |           ; Yes|
00002f60  2c 20 73 6f 20 74 61 73  6b 68 61 6e 64 6c 65 20  |, so taskhandle |
00002f70  3d 20 2d 31 0d 09 9c 29  20 20 20 20 20 20 20 20  |= -1...)        |
00002f80  20 20 20 20 20 20 20 20  53 54 52 45 51 20 20 20  |        STREQ   |
00002f90  52 32 2c 74 61 73 6b 68  61 6e 64 6c 65 0d 09 a6  |R2,taskhandle...|
00002fa0  49 3b 20 43 6c 61 69 6d  20 74 68 65 20 53 65 72  |I; Claim the Ser|
00002fb0  76 69 63 65 20 43 61 6c  6c 20 62 65 63 61 75 73  |vice Call becaus|
00002fc0  65 20 6e 6f 74 20 72 75  6e 6e 69 6e 67 20 61 6e  |e not running an|
00002fd0  64 20 6e 6f 74 20 70 72  65 76 2e 20 63 6c 61 69  |d not prev. clai|
00002fe0  6d 65 64 20 69 74 0d 09  b0 4a 20 20 20 20 20 20  |med it...J      |
00002ff0  20 20 20 20 20 20 20 20  20 20 41 44 52 45 51 20  |          ADREQ |
00003000  20 20 52 30 2c 73 74 61  72 74 75 70 6e 61 6d 65  |  R0,startupname|
00003010  20 20 20 20 20 20 20 20  20 20 3b 20 3d 3e 20 2a  |          ; => *|
00003020  44 65 73 6b 74 6f 70 5f  54 72 61 73 68 63 61 6e  |Desktop_Trashcan|
00003030  0d 09 ba 41 20 20 20 20  20 20 20 20 20 20 20 20  |...A            |
00003040  20 20 20 20 ec 51 20 20  20 52 31 2c 23 30 20 20  |    .Q   R1,#0  |
00003050  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003060  20 3b 20 43 6c 61 69 6d  20 74 68 65 20 63 61 6c  | ; Claim the cal|
00003070  6c 0d 09 c4 28 20 20 20  20 20 20 20 20 20 20 20  |l...(           |
00003080  20 20 20 20 20 4c 44 4d  46 44 20 20 20 52 31 33  |     LDMFD   R13|
00003090  21 2c 7b 52 32 2c 50 43  7d 0d 09 ce 04 0d 09 d8  |!,{R2,PC}.......|
000030a0  0b 2e 72 6f 75 6e 64 32  0d 09 e2 04 0d 09 ec 44  |..round2.......D|
000030b0  3b 20 53 69 6e 63 65 20  74 68 65 20 2a 20 63 6f  |; Since the * co|
000030c0  6d 6d 61 6e 64 20 6d 61  79 20 68 61 76 65 20 66  |mmand may have f|
000030d0  61 69 6c 65 64 2c 20 74  68 65 20 74 61 73 6b 20  |ailed, the task |
000030e0  68 61 6e 64 6c 65 20 73  68 6f 75 6c 64 20 62 65  |handle should be|
000030f0  0d 09 f6 29 3b 20 73 65  74 20 74 6f 20 30 20 69  |...); set to 0 i|
00003100  66 20 69 74 27 73 20 73  74 69 6c 6c 20 73 74 75  |f it's still stu|
00003110  63 6b 20 61 74 20 2d 31  2e 0d 0a 00 04 0d 0a 0a  |ck at -1........|
00003120  29 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |)               |
00003130  20 53 54 4d 46 44 20 20  20 52 31 33 21 2c 7b 52  | STMFD   R13!,{R|
00003140  32 2c 52 31 34 7d 0d 0a  14 29 20 20 20 20 20 20  |2,R14}...)      |
00003150  20 20 20 20 20 20 20 20  20 20 4c 44 52 20 20 20  |          LDR   |
00003160  20 20 52 32 2c 74 61 73  6b 68 61 6e 64 6c 65 0d  |  R2,taskhandle.|
00003170  0a 1e 4a 20 20 20 20 20  20 20 20 20 20 20 20 20  |..J             |
00003180  20 20 20 4d 4f 56 53 20  20 20 20 52 32 2c 52 32  |   MOVS    R2,R2|
00003190  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000031a0  20 20 20 3b 20 49 73 20  74 61 73 6b 68 61 6e 64  |   ; Is taskhand|
000031b0  6c 65 20 3d 20 2d 31 20  3f 0d 0a 28 49 20 20 20  |le = -1 ?..(I   |
000031c0  20 20 20 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |             MOV|
000031d0  4d 49 20 20 20 52 32 2c  23 30 20 20 20 20 20 20  |MI   R2,#0      |
000031e0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 53  |             ; S|
000031f0  74 75 63 6b 2c 20 73 6f  20 75 6e 73 74 69 63 6b  |tuck, so unstick|
00003200  20 21 0d 0a 32 29 20 20  20 20 20 20 20 20 20 20  | !..2)          |
00003210  20 20 20 20 20 20 53 54  52 4d 49 20 20 20 52 32  |      STRMI   R2|
00003220  2c 74 61 73 6b 68 61 6e  64 6c 65 0d 0a 3c 28 20  |,taskhandle..<( |
00003230  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
00003240  44 4d 46 44 20 20 20 52  31 33 21 2c 7b 52 32 2c  |DMFD   R13!,{R2,|
00003250  50 43 7d 0d 0a 46 04 0d  0a 50 0d 2e 63 6c 61 69  |PC}..F...P..clai|
00003260  6d 52 4d 41 0d 0a 5a 04  0d 0a 64 30 3b 20 4f 6e  |mRMA..Z...d0; On|
00003270  20 65 6e 74 72 79 2c 20  20 20 20 20 52 33 20 20  | entry,     R3  |
00003280  20 20 20 20 3d 20 52 4d  41 20 73 70 61 63 65 20  |    = RMA space |
00003290  72 65 71 75 69 72 65 64  0d 0a 6e 36 3b 20 4f 6e  |required..n6; On|
000032a0  20 65 78 69 74 2c 20 20  20 20 20 20 52 32 20 20  | exit,      R2  |
000032b0  20 20 20 20 3d 20 50 6f  69 6e 74 65 72 20 74 6f  |    = Pointer to|
000032c0  20 63 6c 61 69 6d 65 64  20 73 70 61 63 65 0d 0a  | claimed space..|
000032d0  78 04 0d 0a 82 29 20 20  20 20 20 20 20 20 20 20  |x....)          |
000032e0  20 20 20 20 20 20 53 54  4d 46 44 20 20 20 52 31  |      STMFD   R1|
000032f0  33 21 2c 7b 52 30 2c 52  31 34 7d 0d 0a 8c 37 20  |3!,{R0,R14}...7 |
00003300  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
00003310  4f 56 20 20 20 20 20 52  30 2c 23 36 20 20 20 20  |OV     R0,#6    |
00003320  20 20 20 20 20 20 20 3b  20 43 6c 61 69 6d 20 52  |       ; Claim R|
00003330  4d 41 0d 0a 96 34 2e 6a  6f 69 6e 63 6c 61 69 6d  |MA...4.joinclaim|
00003340  20 20 20 20 20 20 53 57  49 20 20 20 20 20 22 58  |      SWI     "X|
00003350  4f 53 5f 4d 6f 64 75 6c  65 22 20 20 20 20 3b 20  |OS_Module"    ; |
00003360  49 49 2d 36 35 35 0d 0a  a0 28 20 20 20 20 20 20  |II-655...(      |
00003370  20 20 20 20 20 20 20 20  20 20 41 44 52 56 53 20  |          ADRVS |
00003380  20 20 52 30 2c 70 6f 6f  72 63 6c 61 69 6d 0d 0a  |  R0,poorclaim..|
00003390  aa 3a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.:              |
000033a0  20 20 53 57 49 56 53 20  20 20 22 4f 53 5f 47 65  |  SWIVS   "OS_Ge|
000033b0  6e 65 72 61 74 65 45 72  72 6f 72 22 20 20 20 20  |nerateError"    |
000033c0  20 20 3b 20 49 2d 34 31  0d 0a b4 28 20 20 20 20  |  ; I-41...(    |
000033d0  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 4d 46  |            LDMF|
000033e0  44 20 20 20 52 31 33 21  2c 7b 52 30 2c 50 43 7d  |D   R13!,{R0,PC}|
000033f0  0d 0a be 1d 2e 70 6f 6f  72 63 6c 61 69 6d 20 20  |.....poorclaim  |
00003400  20 20 20 20 45 51 55 44  20 20 20 20 30 0d 0a c8  |    EQUD    0...|
00003410  37 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |7               |
00003420  20 45 51 55 53 20 20 20  20 22 52 4d 41 20 77 6f  | EQUS    "RMA wo|
00003430  72 6b 73 70 61 63 65 20  66 61 69 6c 75 72 65 22  |rkspace failure"|
00003440  2b 62 6c 24 0d 0a d2 19  20 20 20 20 20 20 20 20  |+bl$....        |
00003450  20 20 20 20 20 20 20 20  41 4c 49 47 4e 0d 0a dc  |        ALIGN...|
00003460  04 0d 0a e6 0f 2e 72 65  6c 65 61 73 65 52 4d 41  |......releaseRMA|
00003470  0d 0a f0 04 0d 0a fa 3d  3b 20 4f 6e 20 65 6e 74  |.......=; On ent|
00003480  72 79 2c 20 20 20 20 20  52 32 20 20 20 20 20 20  |ry,     R2      |
00003490  3d 20 50 6f 69 6e 74 65  72 20 74 6f 20 73 70 61  |= Pointer to spa|
000034a0  63 65 20 74 6f 20 62 65  20 72 65 6c 65 61 73 65  |ce to be release|
000034b0  64 0d 0b 04 04 0d 0b 0e  29 20 20 20 20 20 20 20  |d.......)       |
000034c0  20 20 20 20 20 20 20 20  20 53 54 4d 46 44 20 20  |         STMFD  |
000034d0  20 52 31 33 21 2c 7b 52  30 2c 52 31 34 7d 0d 0b  | R13!,{R0,R14}..|
000034e0  18 39 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.9              |
000034f0  20 20 4d 4f 56 20 20 20  20 20 52 30 2c 23 37 20  |  MOV     R0,#7 |
00003500  20 20 20 20 20 20 20 20  20 20 3b 20 52 65 6c 65  |          ; Rele|
00003510  61 73 65 20 52 4d 41 0d  0b 22 25 20 20 20 20 20  |ase RMA.."%     |
00003520  20 20 20 20 20 20 20 20  20 20 20 42 20 20 20 20  |           B    |
00003530  20 20 20 6a 6f 69 6e 63  6c 61 69 6d 0d 0b 2c 04  |   joinclaim..,.|
00003540  0d 0b 36 10 2e 73 74 61  72 74 75 70 63 6f 6d 6d  |..6..startupcomm|
00003550  0d 0b 40 04 0d 0b 4a 44  3b 20 4f 6e 63 65 20 53  |..@...JD; Once S|
00003560  65 72 76 69 63 65 5f 57  69 6d 70 53 74 61 72 74  |ervice_WimpStart|
00003570  20 68 61 73 20 62 65 65  6e 20 63 6c 61 69 6d 65  | has been claime|
00003580  64 2c 20 74 68 65 20 44  65 73 6b 74 6f 70 20 77  |d, the Desktop w|
00003590  69 6c 6c 20 63 61 6c 6c  0d 0b 54 47 3b 20 57 69  |ill call..TG; Wi|
000035a0  6d 70 5f 53 74 61 72 74  54 61 73 6b 20 77 69 74  |mp_StartTask wit|
000035b0  68 20 52 30 20 3d 20 2a  20 63 6f 6d 6d 61 6e 64  |h R0 = * command|
000035c0  20 61 64 64 72 20 72 65  74 75 72 6e 65 64 20 62  | addr returned b|
000035d0  79 20 74 68 65 20 63 6c  61 69 6d 61 6e 74 2e 0d  |y the claimant..|
000035e0  0b 5e 48 3b 20 55 6e 66  6f 72 74 75 6e 61 74 65  |.^H; Unfortunate|
000035f0  6c 79 2c 20 79 6f 75 20  63 61 6e 27 74 20 64 69  |ly, you can't di|
00003600  76 65 20 73 74 72 61 69  67 68 74 20 69 6e 20 61  |ve straight in a|
00003610  6e 64 20 73 74 61 72 74  20 65 78 65 63 75 74 69  |nd start executi|
00003620  6e 67 20 79 6f 75 72 0d  0b 68 44 3b 20 63 6f 64  |ng your..hD; cod|
00003630  65 20 2d 20 79 6f 75 20  68 61 76 65 20 74 6f 20  |e - you have to |
00003640  63 61 6c 6c 20 4f 53 5f  4d 6f 64 75 6c 65 20 32  |call OS_Module 2|
00003650  20 28 45 6e 74 65 72 20  41 70 70 6c 69 63 61 74  | (Enter Applicat|
00003660  69 6f 6e 29 20 66 69 72  73 74 2e 0d 0b 72 04 0d  |ion) first...r..|
00003670  0b 7c 2c 20 20 20 20 20  20 20 20 20 20 20 20 20  |.|,             |
00003680  20 20 20 53 54 4d 46 44  20 20 20 52 31 33 21 2c  |   STMFD   R13!,|
00003690  7b 52 30 2d 52 32 2c 52  31 34 7d 0d 0b 86 4d 20  |{R0-R2,R14}...M |
000036a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
000036b0  4f 56 20 20 20 20 20 52  32 2c 52 30 20 20 20 20  |OV     R2,R0    |
000036c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000036d0  20 50 6f 69 6e 74 20 74  6f 20 2a 20 63 6f 6d 6d  | Point to * comm|
000036e0  61 6e 64 20 74 61 69 6c  0d 0b 90 4e 20 20 20 20  |and tail...N    |
000036f0  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 20  |            MOV |
00003700  20 20 20 20 52 30 2c 23  30 20 20 20 20 20 20 20  |    R0,#0       |
00003710  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 48 6f  |            ; Ho|
00003720  77 20 6d 61 6e 79 20 74  61 73 6b 73 20 72 75 6e  |w many tasks run|
00003730  6e 69 6e 67 20 3f 0d 0b  9a 3e 20 20 20 20 20 20  |ning ?...>      |
00003740  20 20 20 20 20 20 20 20  20 20 53 57 49 20 20 20  |          SWI   |
00003750  20 20 22 58 57 69 6d 70  5f 52 65 61 64 53 79 73  |  "XWimp_ReadSys|
00003760  49 6e 66 6f 22 20 20 20  20 20 3b 20 49 49 49 2d  |Info"     ; III-|
00003770  31 32 38 34 0d 0b a4 45  20 20 20 20 20 20 20 20  |1284...E        |
00003780  20 20 20 20 20 20 20 20  4d 4f 56 53 20 20 20 20  |        MOVS    |
00003790  52 30 2c 52 30 20 20 20  20 20 20 20 20 20 20 20  |R0,R0           |
000037a0  20 20 20 20 20 20 20 20  3b 20 4e 6f 6e 65 2c 20  |        ; None, |
000037b0  73 6f 20 6e 6f 74 20 69  6e 0d 0b ae 3d 20 20 20  |so not in...=   |
000037c0  20 20 20 20 20 20 20 20  20 20 20 20 20 41 44 52  |             ADR|
000037d0  45 51 20 20 20 52 30 2c  6e 6f 74 69 6e 64 65 73  |EQ   R0,notindes|
000037e0  6b 74 6f 70 20 20 20 20  20 20 20 20 20 3b 20 44  |ktop         ; D|
000037f0  65 73 6b 74 6f 70 0d 0b  b8 2e 20 20 20 20 20 20  |esktop....      |
00003800  20 20 20 20 20 20 20 20  20 20 53 57 49 45 51 20  |          SWIEQ |
00003810  20 20 22 4f 53 5f 47 65  6e 65 72 61 74 65 45 72  |  "OS_GenerateEr|
00003820  72 6f 72 22 0d 0b c2 4a  20 20 20 20 20 20 20 20  |ror"...J        |
00003830  20 20 20 20 20 20 20 20  41 44 52 20 20 20 20 20  |        ADR     |
00003840  52 31 2c 74 69 74 6c 65  73 74 72 20 20 20 20 20  |R1,titlestr     |
00003850  20 20 20 20 20 20 20 20  3b 20 50 6f 69 6e 74 20  |        ; Point |
00003860  74 6f 20 6d 6f 64 75 6c  65 20 6e 61 6d 65 0d 0b  |to module name..|
00003870  cc 47 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.G              |
00003880  20 20 4d 4f 56 20 20 20  20 20 52 30 2c 23 32 20  |  MOV     R0,#2 |
00003890  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000038a0  20 20 3b 20 45 6e 74 65  72 20 41 70 70 6c 69 63  |  ; Enter Applic|
000038b0  61 74 69 6f 6e 0d 0b d6  3c 20 20 20 20 20 20 20  |ation...<       |
000038c0  20 20 20 20 20 20 20 20  20 53 57 49 20 20 20 20  |         SWI    |
000038d0  20 22 58 4f 53 5f 4d 6f  64 75 6c 65 22 20 20 20  | "XOS_Module"   |
000038e0  20 20 20 20 20 20 20 20  20 3b 20 49 49 2d 36 35  |         ; II-65|
000038f0  31 0d 0b e0 2b 20 20 20  20 20 20 20 20 20 20 20  |1...+           |
00003900  20 20 20 20 20 4c 44 4d  46 44 20 20 20 52 31 33  |     LDMFD   R13|
00003910  21 2c 7b 52 30 2d 52 32  2c 50 43 7d 0d 0b ea 1d  |!,{R0-R2,PC}....|
00003920  2e 6e 6f 74 69 6e 64 65  73 6b 74 6f 70 20 20 20  |.notindesktop   |
00003930  45 51 55 44 20 20 20 20  30 0d 0b f4 42 20 20 20  |EQUD    0...B   |
00003940  20 20 20 20 20 20 20 20  20 20 20 20 20 45 51 55  |             EQU|
00003950  53 20 20 20 20 22 55 73  65 20 2a 44 65 73 6b 74  |S    "Use *Deskt|
00003960  6f 70 20 74 6f 20 73 74  61 72 74 20 74 68 65 20  |op to start the |
00003970  22 2b 70 72 6f 67 24 2b  62 6c 24 0d 0b fe 19 20  |"+prog$+bl$.... |
00003980  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 41  |               A|
00003990  4c 49 47 4e 0d 0c 08 04  0d 0c 12 0d 2e 6c 65 61  |LIGN.........lea|
000039a0  76 65 6e 6f 77 0d 0c 1c  04 0d 0c 26 4b 3b 20 55  |venow......&K; U|
000039b0  73 65 72 2d 69 6e 73 74  69 67 61 74 65 64 20 71  |ser-instigated q|
000039c0  75 69 74 20 72 65 71 75  65 73 74 65 64 2c 20 73  |uit requested, s|
000039d0  6f 20 73 68 75 74 64 6f  77 6e 20 74 61 73 6b 20  |o shutdown task |
000039e0  61 6e 64 20 6c 65 61 76  65 20 67 72 61 63 65 66  |and leave gracef|
000039f0  75 6c 6c 79 0d 0c 30 48  3b 20 4f 6e 20 65 6e 74  |ully..0H; On ent|
00003a00  72 79 2c 20 20 20 20 20  52 39 20 20 20 20 20 20  |ry,     R9      |
00003a10  3d 20 30 20 66 6f 72 20  54 65 6d 70 6f 72 61 72  |= 0 for Temporar|
00003a20  79 20 51 75 69 74 2c 20  31 20 66 6f 72 20 50 65  |y Quit, 1 for Pe|
00003a30  72 6d 61 6e 65 6e 74 20  51 75 69 74 0d 0c 3a 45  |rmanent Quit..:E|
00003a40  3b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |;               |
00003a50  20 20 20 20 20 20 20 20  3d 20 2d 31 20 66 6f 72  |        = -1 for|
00003a60  20 6d 61 69 6e 20 28 72  61 74 68 65 72 20 74 68  | main (rather th|
00003a70  61 6e 20 73 75 62 29 20  6d 65 6e 75 20 51 75 69  |an sub) menu Qui|
00003a80  74 0d 0c 44 4d 3b 20 46  6f 72 20 74 68 65 20 6d  |t..DM; For the m|
00003a90  6f 6d 65 6e 74 2c 20 52  39 20 3d 20 2d 31 20 69  |oment, R9 = -1 i|
00003aa0  73 20 74 72 65 61 74 65  64 20 61 73 20 61 20 50  |s treated as a P|
00003ab0  65 72 6d 61 6e 65 6e 74  20 51 75 69 74 20 28 68  |ermanent Quit (h|
00003ac0  61 70 70 79 20 50 68 69  6c 69 70 20 3f 29 0d 0c  |appy Philip ?)..|
00003ad0  4e 04 0d 0c 58 43 20 20  20 20 20 20 20 20 20 20  |N...XC          |
00003ae0  20 20 20 20 20 20 42 4c  20 20 20 20 20 20 77 69  |      BL      wi|
00003af0  6d 70 63 6c 6f 73 65 64  6f 77 6e 20 20 20 3b 20  |mpclosedown   ; |
00003b00  41 6c 6c 20 64 6f 6e 65  2c 20 73 6f 20 73 68 75  |All done, so shu|
00003b10  74 64 6f 77 6e 0d 0c 62  38 20 20 20 20 20 20 20  |tdown..b8       |
00003b20  20 20 20 20 20 20 20 20  20 4d 4f 56 53 20 20 20  |         MOVS   |
00003b30  20 52 39 2c 52 39 20 20  20 3b 20 53 65 76 65 72  | R9,R9   ; Sever|
00003b40  69 74 79 20 6f 66 20 51  75 69 74 20 3f 0d 0c 6c  |ity of Quit ?..l|
00003b50  1e 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00003b60  20 ec 51 20 20 20 52 31  2c 23 30 0d 0c 76 1e 20  | .Q   R1,#0..v. |
00003b70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 ec  |               .|
00003b80  51 20 20 20 52 32 2c 23  30 0d 0c 80 3f 20 20 20  |Q   R2,#0...?   |
00003b90  20 20 20 20 20 20 20 20  20 20 20 20 20 53 57 49  |             SWI|
00003ba0  45 51 20 20 20 22 4f 53  5f 45 78 69 74 22 20 20  |EQ   "OS_Exit"  |
00003bb0  20 20 20 20 20 3b 20 30  20 3d 20 4d 69 6c 64 20  |     ; 0 = Mild |
00003bc0  21 20 49 49 2d 37 34 33  0d 0c 8a 38 20 20 20 20  |! II-743...8    |
00003bd0  20 20 20 20 20 20 20 20  20 20 20 20 41 44 52 20  |            ADR |
00003be0  20 20 20 20 52 30 2c 74  72 61 73 68 6e 61 6d 65  |    R0,trashname|
00003bf0  31 20 20 20 3b 20 46 69  72 73 74 20 6e 61 6d 65  |1   ; First name|
00003c00  0d 0c 94 36 20 20 20 20  20 20 20 20 20 20 20 20  |...6            |
00003c10  20 20 20 20 4d 56 4e 20  20 20 20 20 52 32 2c 23  |    MVN     R2,#|
00003c20  30 20 20 20 3b 20 44 65  6c 65 74 65 20 76 61 72  |0   ; Delete var|
00003c30  69 61 62 6c 65 73 0d 0c  9e 30 20 20 20 20 20 20  |iables...0      |
00003c40  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
00003c50  20 20 52 33 2c 23 30 20  20 20 3b 20 46 69 72 73  |  R3,#0   ; Firs|
00003c60  74 20 63 61 6c 6c 0d 0c  a8 33 20 20 20 20 20 20  |t call...3      |
00003c70  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
00003c80  20 20 52 34 2c 23 30 20  20 20 3b 20 4e 6f 72 6d  |  R4,#0   ; Norm|
00003c90  61 6c 20 73 74 72 69 6e  67 0d 0c b2 46 20 20 20  |al string...F   |
00003ca0  20 20 20 20 20 20 20 20  20 20 20 20 20 53 57 49  |             SWI|
00003cb0  20 20 20 20 20 22 58 4f  53 5f 53 65 74 56 61 72  |     "XOS_SetVar|
00003cc0  56 61 6c 22 20 3b 20 44  65 6c 65 74 65 20 54 72  |Val" ; Delete Tr|
00003cd0  61 73 68 24 44 69 72 2e  20 49 49 2d 37 35 32 0d  |ash$Dir. II-752.|
00003ce0  0c bc 39 20 20 20 20 20  20 20 20 20 20 20 20 20  |..9             |
00003cf0  20 20 20 41 44 52 20 20  20 20 20 52 30 2c 74 72  |   ADR     R0,tr|
00003d00  61 73 68 6e 61 6d 65 32  20 20 20 3b 20 53 65 63  |ashname2   ; Sec|
00003d10  6f 6e 64 20 6e 61 6d 65  0d 0c c6 30 20 20 20 20  |ond name...0    |
00003d20  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 20  |            MOV |
00003d30  20 20 20 20 52 33 2c 23  30 20 20 20 3b 20 46 69  |    R3,#0   ; Fi|
00003d40  72 73 74 20 63 61 6c 6c  0d 0c d0 33 20 20 20 20  |rst call...3    |
00003d50  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 20  |            MOV |
00003d60  20 20 20 20 52 34 2c 23  30 20 20 20 3b 20 4e 6f  |    R4,#0   ; No|
00003d70  72 6d 61 6c 20 73 74 72  69 6e 67 0d 0c da 42 20  |rmal string...B |
00003d80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
00003d90  57 49 20 20 20 20 20 22  58 4f 53 5f 53 65 74 56  |WI     "XOS_SetV|
00003da0  61 72 56 61 6c 22 20 3b  20 44 65 6c 65 74 65 20  |arVal" ; Delete |
00003db0  54 72 61 73 68 57 6f 72  6b 24 44 69 72 0d 0c e4  |TrashWork$Dir...|
00003dc0  21 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |!               |
00003dd0  20 4d 4f 56 20 20 20 20  20 52 30 2c 23 30 0d 0c  | MOV     R0,#0..|
00003de0  ee 21 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.!              |
00003df0  20 20 4d 4f 56 20 20 20  20 20 52 31 2c 23 30 0d  |  MOV     R1,#0.|
00003e00  0c f8 21 20 20 20 20 20  20 20 20 20 20 20 20 20  |..!             |
00003e10  20 20 20 4d 4f 56 20 20  20 20 20 52 32 2c 23 30  |   MOV     R2,#0|
00003e20  0d 0d 02 27 20 20 20 20  20 20 20 20 20 20 20 20  |...'            |
00003e30  20 20 20 20 41 44 52 20  20 20 20 20 52 33 2c 74  |    ADR     R3,t|
00003e40  69 74 6c 65 73 74 72 0d  0d 0c 47 20 20 20 20 20  |itlestr...G     |
00003e50  20 20 20 20 20 20 20 20  20 20 20 53 57 49 20 20  |           SWI  |
00003e60  20 20 20 22 4f 53 5f 45  78 69 74 41 6e 64 44 69  |   "OS_ExitAndDi|
00003e70  65 22 20 3b 20 2d 31 20  6f 72 20 31 20 3d 20 53  |e" ; -1 or 1 = S|
00003e80  65 76 65 72 65 20 21 20  49 49 2d 37 35 38 0d 0d  |evere ! II-758..|
00003e90  16 2b 2e 74 72 61 73 68  6e 61 6d 65 31 20 20 20  |.+.trashname1   |
00003ea0  20 20 45 51 55 53 20 20  20 20 22 54 72 61 73 68  |  EQUS    "Trash|
00003eb0  24 44 69 72 22 2b 62 6c  24 0d 0d 20 2f 2e 74 72  |$Dir"+bl$.. /.tr|
00003ec0  61 73 68 6e 61 6d 65 32  20 20 20 20 20 45 51 55  |ashname2     EQU|
00003ed0  53 20 20 20 20 22 54 72  61 73 68 57 6f 72 6b 24  |S    "TrashWork$|
00003ee0  44 69 72 22 2b 62 6c 24  0d 0d 2a 19 20 20 20 20  |Dir"+bl$..*.    |
00003ef0  20 20 20 20 20 20 20 20  20 20 20 20 41 4c 49 47  |            ALIG|
00003f00  4e 0d 0d 34 04 0d 0d 3e  12 2e 72 65 67 69 73 74  |N..4...>..regist|
00003f10  65 72 73 70 61 72 6b 0d  0d 48 04 0d 0d 52 37 3b  |erspark..H...R7;|
00003f20  20 4f 6e 20 65 6e 74 72  79 2c 20 20 20 20 20 52  | On entry,     R|
00003f30  35 20 20 20 20 20 20 3d  20 53 70 61 72 6b 27 73  |5      = Spark's|
00003f40  20 22 6e 65 77 22 20 74  61 73 6b 20 68 61 6e 64  | "new" task hand|
00003f50  6c 65 0d 0d 5c 04 0d 0d  66 29 20 20 20 20 20 20  |le..\...f)      |
00003f60  20 20 20 20 20 20 20 20  20 20 53 54 4d 46 44 20  |          STMFD |
00003f70  20 20 52 31 33 21 2c 7b  52 30 2c 52 31 34 7d 0d  |  R13!,{R0,R14}.|
00003f80  0d 70 41 20 20 20 20 20  20 20 20 20 20 20 20 20  |.pA             |
00003f90  20 20 20 4c 44 52 20 20  20 20 20 52 30 2c 73 70  |   LDR     R0,sp|
00003fa0  61 72 6b 74 61 73 6b 68  61 6e 64 3b 20 47 65 74  |arktaskhand; Get|
00003fb0  20 6f 6c 64 20 74 61 73  6b 20 68 61 6e 64 6c 65  | old task handle|
00003fc0  0d 0d 7a 3e 20 20 20 20  20 20 20 20 20 20 20 20  |..z>            |
00003fd0  20 20 20 20 43 4d 50 20  20 20 20 20 52 30 2c 52  |    CMP     R0,R|
00003fe0  35 20 20 20 20 20 20 20  20 20 20 20 3b 20 49 73  |5           ; Is|
00003ff0  20 69 74 20 6e 65 77 20  69 6e 66 6f 20 3f 0d 0d  | it new info ?..|
00004000  84 42 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.B              |
00004010  20 20 53 54 52 4e 45 20  20 20 52 35 2c 73 70 61  |  STRNE   R5,spa|
00004020  72 6b 74 61 73 6b 68 61  6e 64 3b 20 53 61 76 65  |rktaskhand; Save|
00004030  20 6e 65 77 20 74 61 73  6b 20 68 61 6e 64 6c 65  | new task handle|
00004040  0d 0d 8e 43 20 20 20 20  20 20 20 20 20 20 20 20  |...C            |
00004050  20 20 20 20 42 4c 4e 45  20 20 20 20 72 65 64 6f  |    BLNE    redo|
00004060  63 6f 6e 74 65 6e 74 73  20 20 20 20 3b 20 55 70  |contents    ; Up|
00004070  64 61 74 65 20 74 72 61  73 68 20 63 61 6e 20 69  |date trash can i|
00004080  63 6f 6e 0d 0d 98 28 20  20 20 20 20 20 20 20 20  |con...(         |
00004090  20 20 20 20 20 20 20 4c  44 4d 46 44 20 20 20 52  |       LDMFD   R|
000040a0  31 33 21 2c 7b 52 30 2c  50 43 7d 0d 0d a2 04 0d  |13!,{R0,PC}.....|
000040b0  0d ac 11 2e 69 6e 69 74  75 73 65 72 61 72 65 61  |....inituserarea|
000040c0  0d 0d b6 04 0d 0d c0 4b  3b 20 41 66 74 65 72 20  |.......K; After |
000040d0  61 62 6f 75 74 20 37 35  20 6d 69 6c 6c 69 6f 6e  |about 75 million|
000040e0  20 64 69 66 66 65 72 65  6e 74 20 61 74 74 65 6d  | different attem|
000040f0  70 74 73 20 61 74 20 63  6f 64 69 6e 67 20 75 73  |pts at coding us|
00004100  69 6e 67 20 4f 53 5f 53  70 72 69 74 65 4f 70 0d  |ing OS_SpriteOp.|
00004110  0d ca 48 3b 20 6f 6e 6c  79 2c 20 4f 53 5f 53 70  |..H; only, OS_Sp|
00004120  72 69 74 65 4f 70 20 6d  69 78 65 64 20 77 69 74  |riteOp mixed wit|
00004130  68 20 57 69 6d 70 5f 53  70 72 69 74 65 4f 70 20  |h Wimp_SpriteOp |
00004140  61 6e 64 20 57 69 6d 70  5f 53 70 72 69 74 65 4f  |and Wimp_SpriteO|
00004150  70 20 6f 6e 6c 79 2c 0d  0d d4 4a 3b 20 49 20 63  |p only,...J; I c|
00004160  61 6d 65 20 74 6f 20 66  6f 6c 6c 6f 77 69 6e 67  |ame to following|
00004170  20 63 6f 6e 63 6c 75 73  69 6f 6e 73 20 72 65 67  | conclusions reg|
00004180  61 72 64 69 6e 67 20 57  69 6d 70 20 70 72 6f 67  |arding Wimp prog|
00004190  72 61 6d 73 20 61 6e 64  20 73 70 72 69 74 65 73  |rams and sprites|
000041a0  3a 0d 0d de 46 3b 20 31  29 20 55 73 65 20 57 69  |:...F; 1) Use Wi|
000041b0  6d 70 5f 53 70 72 69 74  65 4f 70 20 66 6f 72 20  |mp_SpriteOp for |
000041c0  72 65 61 64 69 6e 67 20  53 70 72 69 74 65 20 66  |reading Sprite f|
000041d0  69 6c 65 73 20 61 6e 64  20 70 6c 6f 74 74 69 6e  |iles and plottin|
000041e0  67 20 74 68 65 6d 2e 0d  0d e8 4c 3b 20 32 29 20  |g them....L; 2) |
000041f0  55 73 65 20 4f 53 5f 53  70 72 69 74 65 4f 70 20  |Use OS_SpriteOp |
00004200  31 36 20 66 6f 72 20 73  61 76 69 6e 67 20 61 20  |16 for saving a |
00004210  72 65 63 74 20 74 6f 20  61 20 73 70 72 69 74 65  |rect to a sprite|
00004220  20 28 73 61 76 65 73 20  62 61 63 6b 67 72 6f 75  | (saves backgrou|
00004230  6e 64 29 0d 0d f2 3a 3b  20 20 20 20 61 6e 64 20  |nd)...:;    and |
00004240  4f 53 5f 53 70 72 69 74  65 4f 70 20 33 34 20 66  |OS_SpriteOp 34 f|
00004250  6f 72 20 72 65 70 6c 6f  74 74 69 6e 67 20 74 68  |or replotting th|
00004260  61 74 20 73 61 76 65 64  20 72 65 63 74 0d 0d fc  |at saved rect...|
00004270  48 3b 20 33 29 20 53 65  74 75 70 20 52 4d 41 20  |H; 3) Setup RMA |
00004280  77 6f 72 6b 73 70 61 63  65 20 28 63 6c 61 69 6d  |workspace (claim|
00004290  20 61 6e 64 20 74 68 65  6e 20 63 61 6c 6c 20 4f  | and then call O|
000042a0  53 5f 53 70 72 69 74 65  4f 70 20 39 29 20 66 6f  |S_SpriteOp 9) fo|
000042b0  72 20 74 68 65 0d 0e 06  44 3b 20 20 20 20 4f 53  |r the...D;    OS|
000042c0  5f 53 70 72 69 74 65 4f  70 20 31 36 2f 33 34 20  |_SpriteOp 16/34 |
000042d0  63 61 6c 6c 73 20 2d 20  64 6f 20 ac 20 75 73 65  |calls - do . use|
000042e0  20 74 68 65 20 53 79 73  74 65 6d 20 53 70 72 69  | the System Spri|
000042f0  74 65 20 61 72 65 61 20  21 0d 0e 10 04 0d 0e 1a  |te area !.......|
00004300  2c 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |,               |
00004310  20 53 54 4d 46 44 20 20  20 52 31 33 21 2c 7b 52  | STMFD   R13!,{R|
00004320  30 2c 52 31 2c 52 31 34  7d 0d 0e 24 4a 20 20 20  |0,R1,R14}..$J   |
00004330  20 20 20 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |             MOV|
00004340  20 20 20 20 20 52 30 2c  23 73 70 72 69 74 65 73  |     R0,#sprites|
00004350  70 61 63 65 25 3b 20 53  70 61 63 65 20 6e 65 65  |pace%; Space nee|
00004360  64 65 64 20 66 6f 72 20  56 61 6e 20 73 70 72 69  |ded for Van spri|
00004370  74 65 73 0d 0e 2e 48 20  20 20 20 20 20 20 20 20  |tes...H         |
00004380  20 20 20 20 20 20 20 4c  44 52 20 20 20 20 20 52  |       LDR     R|
00004390  31 2c 73 70 72 69 74 65  61 72 65 61 20 20 20 3b  |1,spritearea   ;|
000043a0  20 4f 66 66 73 65 74 20  30 20 3d 20 54 6f 74 61  | Offset 0 = Tota|
000043b0  6c 20 61 72 65 61 20 73  69 7a 65 0d 0e 38 23 20  |l area size..8# |
000043c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
000043d0  54 52 20 20 20 20 20 52  30 2c 5b 52 31 5d 0d 0e  |TR     R0,[R1]..|
000043e0  42 47 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |BG              |
000043f0  20 20 4d 4f 56 20 20 20  20 20 52 30 2c 23 30 20  |  MOV     R0,#0 |
00004400  20 20 20 20 20 20 20 20  20 20 3b 20 4f 66 66 73  |          ; Offs|
00004410  65 74 20 34 20 3d 20 4e  6f 20 73 70 72 69 74 65  |et 4 = No sprite|
00004420  73 20 79 65 74 0d 0e 4c  26 20 20 20 20 20 20 20  |s yet..L&       |
00004430  20 20 20 20 20 20 20 20  20 53 54 52 20 20 20 20  |         STR    |
00004440  20 52 30 2c 5b 52 31 2c  23 34 5d 0d 0e 56 22 20  | R0,[R1,#4]..V" |
00004450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
00004460  4f 56 20 20 20 20 20 52  30 2c 23 31 36 0d 0e 60  |OV     R0,#16..`|
00004470  4a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |J               |
00004480  20 53 54 52 20 20 20 20  20 52 30 2c 5b 52 31 2c  | STR     R0,[R1,|
00004490  23 38 5d 20 20 20 20 20  20 3b 20 4f 66 66 73 65  |#8]      ; Offse|
000044a0  74 20 38 20 3d 20 4e 6f  20 65 78 74 65 6e 73 69  |t 8 = No extensi|
000044b0  6f 6e 20 61 72 65 61 0d  0e 6a 49 20 20 20 20 20  |on area..jI     |
000044c0  20 20 20 20 20 20 20 20  20 20 20 53 54 52 20 20  |           STR  |
000044d0  20 20 20 52 30 2c 5b 52  31 2c 23 31 32 5d 20 20  |   R0,[R1,#12]  |
000044e0  20 20 20 3b 20 4f 66 66  73 65 74 20 31 32 20 3d  |   ; Offset 12 =|
000044f0  20 46 69 72 73 74 20 66  72 65 65 20 77 6f 72 64  | First free word|
00004500  0d 0e 74 4c 20 20 20 20  20 20 20 20 20 20 20 20  |..tL            |
00004510  20 20 20 20 4d 4f 56 20  20 20 20 20 52 30 2c 23  |    MOV     R0,#|
00004520  39 20 20 20 20 20 20 20  20 20 20 20 3b 20 49 6e  |9           ; In|
00004530  69 74 69 61 6c 69 73 65  20 73 70 72 69 74 65 20  |itialise sprite |
00004540  61 72 65 61 20 28 2a 53  4e 65 77 29 0d 0e 7e 33  |area (*SNew)..~3|
00004550  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004560  42 4c 20 20 20 20 20 20  73 70 72 69 74 65 6f 70  |BL      spriteop|
00004570  20 20 20 20 20 20 20 20  3b 20 49 2d 33 39 38 0d  |        ; I-398.|
00004580  0e 88 2b 20 20 20 20 20  20 20 20 20 20 20 20 20  |..+             |
00004590  20 20 20 4c 44 4d 46 44  20 20 20 52 31 33 21 2c  |   LDMFD   R13!,|
000045a0  7b 52 30 2c 52 31 2c 50  43 7d 0d 0e 92 04 0d 0e  |{R0,R1,PC}......|
000045b0  9c 29 2e 64 75 6d 6d 79  73 70 61 72 6b 20 20 20  |.).dummyspark   |
000045c0  20 20 53 54 4d 46 44 20  20 20 52 31 33 21 2c 7b  |  STMFD   R13!,{|
000045d0  52 33 2c 52 31 34 7d 0d  0e a6 4a 20 20 20 20 20  |R3,R14}...J     |
000045e0  20 20 20 20 20 20 20 20  20 20 20 4c 44 52 20 20  |           LDR  |
000045f0  20 20 20 52 33 2c 73 70  61 72 6b 74 61 73 6b 68  |   R3,sparktaskh|
00004600  61 6e 64 20 20 20 20 20  20 20 20 3b 20 4f 6e 6c  |and        ; Onl|
00004610  79 20 73 65 6e 64 20 69  66 20 53 70 61 72 6b 27  |y send if Spark'|
00004620  73 0d 0e b0 44 20 20 20  20 20 20 20 20 20 20 20  |s...D           |
00004630  20 20 20 20 20 4d 4f 56  53 20 20 20 20 52 33 2c  |     MOVS    R3,|
00004640  52 33 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R3              |
00004650  20 20 20 20 20 3b 20 68  61 6e 64 6c 65 20 75 6e  |     ; handle un|
00004660  6b 6e 6f 77 6e 0d 0e ba  47 20 20 20 20 20 20 20  |known...G       |
00004670  20 20 20 20 20 20 20 20  20 4c 44 52 45 51 20 20  |         LDREQ  |
00004680  20 52 33 2c 77 69 6e 64  6f 77 73 70 61 63 65 20  | R3,windowspace |
00004690  20 3b 20 50 6f 69 6e 74  20 74 6f 20 73 74 61 72  | ; Point to star|
000046a0  74 20 6f 66 20 63 6f 6d  6d 61 6e 64 0d 0e c4 34  |t of command...4|
000046b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000046c0  41 44 44 45 51 20 20 20  52 33 2c 52 33 2c 23 32  |ADDEQ   R3,R3,#2|
000046d0  30 20 20 20 20 20 20 20  3b 20 62 75 66 66 65 72  |0       ; buffer|
000046e0  0d 0e ce 49 20 20 20 20  20 20 20 20 20 20 20 20  |...I            |
000046f0  20 20 20 20 42 4c 45 51  20 20 20 20 73 65 6e 64  |    BLEQ    send|
00004700  69 74 74 6f 73 70 61 72  6b 20 20 20 3b 20 54 65  |ittospark   ; Te|
00004710  6c 6c 20 65 76 65 72 79  6f 6e 65 20 74 6f 20 64  |ll everyone to d|
00004720  6f 20 6e 6f 74 68 69 6e  67 0d 0e d8 28 20 20 20  |o nothing...(   |
00004730  20 20 20 20 20 20 20 20  20 20 20 20 20 4c 44 4d  |             LDM|
00004740  46 44 20 20 20 52 31 33  21 2c 7b 52 33 2c 50 43  |FD   R13!,{R3,PC|
00004750  7d 0d 0e e2 04 0d 0e ec  2f 2e 64 65 6c 73 70 61  |}......./.delspa|
00004760  72 6b 66 69 6c 65 20 20  20 53 54 4d 46 44 20 20  |rkfile   STMFD  |
00004770  20 52 31 33 21 2c 7b 52  30 2c 52 32 2c 52 33 2c  | R13!,{R0,R2,R3,|
00004780  52 31 34 7d 0d 0e f6 28  20 20 20 20 20 20 20 20  |R14}...(        |
00004790  20 20 20 20 20 20 20 20  41 44 52 20 20 20 20 20  |        ADR     |
000047a0  52 30 2c 73 61 76 65 64  6c 65 61 66 0d 0f 00 46  |R0,savedleaf...F|
000047b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000047c0  4c 44 52 20 20 20 20 20  52 33 2c 70 75 74 6c 65  |LDR     R3,putle|
000047d0  61 66 68 65 72 65 20 20  3b 20 53 65 74 20 75 70  |afhere  ; Set up|
000047e0  20 77 68 65 6e 20 64 72  61 67 20 73 74 61 72 74  | when drag start|
000047f0  65 64 0d 0f 0a 40 2e 72  65 74 72 69 65 76 65 6c  |ed...@.retrievel|
00004800  65 61 66 20 20 20 4c 44  52 42 20 20 20 20 52 32  |eaf   LDRB    R2|
00004810  2c 5b 52 30 5d 2c 23 31  20 20 20 20 20 20 3b 20  |,[R0],#1      ; |
00004820  43 6f 70 79 20 6c 65 61  66 20 6f 6e 74 6f 20 65  |Copy leaf onto e|
00004830  6e 64 0d 0f 14 26 20 20  20 20 20 20 20 20 20 20  |nd...&          |
00004840  20 20 20 20 20 20 53 54  52 42 20 20 20 20 52 32  |      STRB    R2|
00004850  2c 5b 52 33 5d 2c 23 31  0d 0f 1e 21 20 20 20 20  |,[R3],#1...!    |
00004860  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 53  |            MOVS|
00004870  20 20 20 20 52 32 2c 52  32 0d 0f 28 28 20 20 20  |    R2,R2..((   |
00004880  20 20 20 20 20 20 20 20  20 20 20 20 20 42 4e 45  |             BNE|
00004890  20 20 20 20 20 72 65 74  72 69 65 76 65 6c 65 61  |     retrievelea|
000048a0  66 0d 0f 32 47 20 20 20  20 20 20 20 20 20 20 20  |f..2G           |
000048b0  20 20 20 20 20 42 4c 20  20 20 20 20 20 73 65 6e  |     BL      sen|
000048c0  64 69 74 74 6f 73 70 61  72 6b 20 20 20 3b 20 54  |dittospark   ; T|
000048d0  65 6c 6c 20 53 70 61 72  6b 20 74 6f 20 64 65 6c  |ell Spark to del|
000048e0  65 74 65 20 66 69 6c 65  0d 0f 3c 2e 20 20 20 20  |ete file..<.    |
000048f0  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 4d 46  |            LDMF|
00004900  44 20 20 20 52 31 33 21  2c 7b 52 30 2c 52 32 2c  |D   R13!,{R0,R2,|
00004910  52 33 2c 50 43 7d 0d 0f  46 04 0d 0f 50 2c 2e 73  |R3,PC}..F...P,.s|
00004920  65 6e 64 69 74 74 6f 73  70 61 72 6b 20 20 53 54  |endittospark  ST|
00004930  4d 46 44 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |MFD   R13!,{R0-R|
00004940  33 2c 52 31 34 7d 0d 0f  5a 47 20 20 20 20 20 20  |3,R14}..ZG      |
00004950  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
00004960  20 20 52 30 2c 23 31 33  20 20 20 20 20 20 20 20  |  R0,#13        |
00004970  20 3b 20 4e 65 65 64 73  20 43 52 20 61 74 20 65  | ; Needs CR at e|
00004980  6e 64 20 6f 66 20 63 6f  6d 6d 61 6e 64 0d 0f 64  |nd of command..d|
00004990  26 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |&               |
000049a0  20 53 54 52 42 20 20 20  20 52 30 2c 5b 52 33 5d  | STRB    R0,[R3]|
000049b0  2c 23 31 0d 0f 6e 21 20  20 20 20 20 20 20 20 20  |,#1..n!         |
000049c0  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
000049d0  30 2c 23 30 0d 0f 78 26  2e 70 61 64 74 6f 77 6f  |0,#0..x&.padtowo|
000049e0  72 64 20 20 20 20 20 20  53 54 52 42 20 20 20 20  |rd      STRB    |
000049f0  52 30 2c 5b 52 33 5d 2c  23 31 0d 0f 82 39 20 20  |R0,[R3],#1...9  |
00004a00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 54 53  |              TS|
00004a10  54 20 20 20 20 20 52 33  2c 23 25 31 31 20 20 20  |T     R3,#%11   |
00004a20  20 20 20 20 20 20 3b 20  50 61 64 20 74 6f 20 77  |      ; Pad to w|
00004a30  6f 72 64 0d 0f 8c 25 20  20 20 20 20 20 20 20 20  |ord...%         |
00004a40  20 20 20 20 20 20 20 42  4e 45 20 20 20 20 20 70  |       BNE     p|
00004a50  61 64 74 6f 77 6f 72 64  0d 0f 96 2a 20 20 20 20  |adtoword...*    |
00004a60  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 52 20  |            LDR |
00004a70  20 20 20 20 52 31 2c 77  69 6e 64 6f 77 73 70 61  |    R1,windowspa|
00004a80  63 65 0d 0f a0 4c 20 20  20 20 20 20 20 20 20 20  |ce...L          |
00004a90  20 20 20 20 20 20 53 55  42 20 20 20 20 20 52 30  |      SUB     R0|
00004aa0  2c 52 33 2c 52 31 20 20  20 20 20 20 20 20 3b 20  |,R3,R1        ; |
00004ab0  53 69 7a 65 20 28 69 6e  63 2e 20 6c 65 61 66 2f  |Size (inc. leaf/|
00004ac0  64 61 74 61 29 20 6f 66  20 62 6c 6f 63 6b 0d 0f  |data) of block..|
00004ad0  aa 2c 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.,              |
00004ae0  20 20 4c 44 52 20 20 20  20 20 52 32 2c 73 70 61  |  LDR     R2,spa|
00004af0  72 6b 74 61 73 6b 68 61  6e 64 0d 0f b4 46 20 20  |rktaskhand...F  |
00004b00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |              LD|
00004b10  52 20 20 20 20 20 52 33  2c 73 70 61 72 6b 63 6f  |R     R3,sparkco|
00004b20  6d 6d 49 44 20 20 3b 20  53 70 61 72 6b 20 63 6f  |mmID  ; Spark co|
00004b30  6d 6d 61 6e 64 20 6d 65  73 73 61 67 65 20 49 44  |mmand message ID|
00004b40  0d 0f be 28 20 20 20 20  20 20 20 20 20 20 20 20  |...(            |
00004b50  20 20 20 20 42 4c 20 20  20 20 20 20 73 65 6e 64  |    BL      send|
00004b60  61 6d 65 73 73 61 67 65  0d 0f c8 2b 20 20 20 20  |amessage...+    |
00004b70  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 4d 46  |            LDMF|
00004b80  44 20 20 20 52 31 33 21  2c 7b 52 30 2d 52 33 2c  |D   R13!,{R0-R3,|
00004b90  50 43 7d 0d 0f d2 41 2e  73 70 61 72 6b 63 6f 6d  |PC}...A.sparkcom|
00004ba0  6d 49 44 20 20 20 20 45  51 55 44 20 20 20 20 26  |mID    EQUD    &|
00004bb0  34 31 30 30 30 2b 36 31  20 20 20 20 20 20 20 3b  |41000+61       ;|
00004bc0  20 44 6f 20 53 70 61 72  6b 20 63 6f 6d 6d 61 6e  | Do Spark comman|
00004bd0  64 20 49 44 0d 0f dc 04  0d 0f e6 11 2e 73 65 6e  |d ID.........sen|
00004be0  64 61 6d 65 73 73 61 67  65 0d 0f f0 04 0d 0f fa  |damessage.......|
00004bf0  33 3b 20 4f 6e 20 65 6e  74 72 79 2c 20 20 20 20  |3; On entry,    |
00004c00  20 52 30 20 20 20 20 20  20 3d 20 53 69 7a 65 20  | R0      = Size |
00004c10  6f 66 20 6d 65 73 73 61  67 65 20 62 6c 6f 63 6b  |of message block|
00004c20  0d 10 04 47 3b 20 20 20  20 20 20 20 20 20 20 20  |...G;           |
00004c30  20 20 20 20 52 31 20 20  20 20 20 20 3d 20 50 6f  |    R1      = Po|
00004c40  69 6e 74 65 72 20 74 6f  20 6d 65 73 73 61 67 65  |inter to message|
00004c50  20 28 75 73 75 2e 20 57  69 6d 70 5f 50 6f 6c 6c  | (usu. Wimp_Poll|
00004c60  29 20 62 6c 6f 63 6b 0d  10 0e 38 3b 20 20 20 20  |) block...8;    |
00004c70  20 20 20 20 20 20 20 20  20 20 20 52 32 20 20 20  |           R2   |
00004c80  20 20 20 3d 20 54 61 73  6b 20 68 61 6e 64 6c 65  |   = Task handle|
00004c90  20 28 30 20 3d 20 65 76  65 72 79 6f 6e 65 29 0d  | (0 = everyone).|
00004ca0  10 18 2c 3b 20 20 20 20  20 20 20 20 20 20 20 20  |..,;            |
00004cb0  20 20 20 52 33 20 20 20  20 20 20 3d 20 4d 65 73  |   R3      = Mes|
00004cc0  73 61 67 65 20 61 63 74  69 6f 6e 0d 10 22 04 0d  |sage action.."..|
00004cd0  10 2c 29 20 20 20 20 20  20 20 20 20 20 20 20 20  |.,)             |
00004ce0  20 20 20 53 54 4d 46 44  20 20 20 52 31 33 21 2c  |   STMFD   R13!,|
00004cf0  7b 52 30 2c 52 31 34 7d  0d 10 36 40 20 20 20 20  |{R0,R14}..6@    |
00004d00  20 20 20 20 20 20 20 20  20 20 20 20 53 54 52 20  |            STR |
00004d10  20 20 20 20 52 30 2c 5b  52 31 5d 20 20 20 20 20  |    R0,[R1]     |
00004d20  20 20 20 20 3b 20 53 74  6f 72 65 20 62 6c 6f 63  |    ; Store bloc|
00004d30  6b 20 6c 65 6e 67 74 68  0d 10 40 21 20 20 20 20  |k length..@!    |
00004d40  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 20  |            MOV |
00004d50  20 20 20 20 52 30 2c 23  30 0d 10 4a 4b 20 20 20  |    R0,#0..JK   |
00004d60  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 52  |             STR|
00004d70  20 20 20 20 20 52 30 2c  5b 52 31 2c 23 31 32 5d  |     R0,[R1,#12]|
00004d80  20 20 20 20 20 3b 20 6d  79 5f 72 65 66 20 3d 20  |     ; my_ref = |
00004d90  30 20 28 4f 72 69 67 69  6e 61 6c 20 6d 65 73 73  |0 (Original mess|
00004da0  61 67 65 29 0d 10 54 42  20 20 20 20 20 20 20 20  |age)..TB        |
00004db0  20 20 20 20 20 20 20 20  53 54 52 20 20 20 20 20  |        STR     |
00004dc0  52 33 2c 5b 52 31 2c 23  31 36 5d 20 20 20 20 20  |R3,[R1,#16]     |
00004dd0  3b 20 53 74 6f 72 65 20  6d 65 73 73 61 67 65 20  |; Store message |
00004de0  61 63 74 69 6f 6e 0d 10  5e 22 20 20 20 20 20 20  |action..^"      |
00004df0  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
00004e00  20 20 52 30 2c 23 31 38  0d 10 68 3a 20 20 20 20  |  R0,#18..h:    |
00004e10  20 20 20 20 20 20 20 20  20 20 20 20 53 57 49 20  |            SWI |
00004e20  20 20 20 20 22 58 57 69  6d 70 5f 53 65 6e 64 4d  |    "XWimp_SendM|
00004e30  65 73 73 61 67 65 22 20  3b 20 49 49 49 2d 31 32  |essage" ; III-12|
00004e40  35 33 0d 10 72 28 20 20  20 20 20 20 20 20 20 20  |53..r(          |
00004e50  20 20 20 20 20 20 4c 44  4d 46 44 20 20 20 52 31  |      LDMFD   R1|
00004e60  33 21 2c 7b 52 30 2c 50  43 7d 0d 10 7c 04 0d 10  |3!,{R0,PC}..|...|
00004e70  86 0d 2e 61 70 70 73 74  61 72 74 0d 10 90 04 0d  |...appstart.....|
00004e80  10 9a 48 3b 20 57 65 6c  6c 2c 20 68 65 72 65 27  |..H; Well, here'|
00004e90  73 20 74 68 65 20 73 74  61 72 74 20 73 65 71 75  |s the start sequ|
00004ea0  65 6e 63 65 20 61 74 20  6c 61 73 74 20 21 20 57  |ence at last ! W|
00004eb0  65 20 6f 6e 6c 79 20 77  61 6e 74 20 6f 6e 65 20  |e only want one |
00004ec0  6f 66 20 74 68 69 73 0d  10 a4 43 3b 20 74 61 73  |of this...C; tas|
00004ed0  6b 20 72 75 6e 6e 69 6e  67 2c 20 73 6f 20 6d 75  |k running, so mu|
00004ee0  73 74 20 73 68 75 74 20  64 6f 77 6e 20 74 68 65  |st shut down the|
00004ef0  20 6f 6c 64 20 6f 6e 65  20 69 66 20 69 74 20 69  | old one if it i|
00004f00  73 20 72 75 6e 6e 69 6e  67 2e 0d 10 ae 04 0d 10  |s running.......|
00004f10  b8 48 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.H              |
00004f20  20 20 4c 44 52 20 20 20  20 20 52 31 33 2c 77 6f  |  LDR     R13,wo|
00004f30  72 6b 73 70 61 63 65 20  20 20 3b 20 52 65 73 65  |rkspace   ; Rese|
00004f40  74 20 73 74 61 63 6b 20  70 6f 69 6e 74 65 72 20  |t stack pointer |
00004f50  2d 3e 20 52 4d 41 0d 10  c2 40 20 20 20 20 20 20  |-> RMA...@      |
00004f60  20 20 20 20 20 20 20 20  20 20 42 4c 20 20 20 20  |          BL    |
00004f70  20 20 77 69 6d 70 63 6c  6f 73 65 64 6f 77 6e 20  |  wimpclosedown |
00004f80  20 20 3b 20 53 68 75 74  20 64 6f 77 6e 20 6f 6c  |  ; Shut down ol|
00004f90  64 20 74 61 73 6b 0d 10  cc 4c 20 20 20 20 20 20  |d task...L      |
00004fa0  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
00004fb0  20 20 52 30 2c 23 77 69  6e 64 6d 61 6e 25 20 20  |  R0,#windman%  |
00004fc0  20 20 3b 20 45 78 70 65  63 74 69 6e 67 20 56 32  |  ; Expecting V2|
00004fd0  2e 30 30 20 57 69 6e 64  6f 77 20 4d 61 6e 61 67  |.00 Window Manag|
00004fe0  65 72 0d 10 d6 4a 20 20  20 20 20 20 20 20 20 20  |er...J          |
00004ff0  20 20 20 20 20 20 4c 44  52 20 20 20 20 20 52 31  |      LDR     R1|
00005000  2c 74 61 73 6b 63 6f 6e  73 74 61 6e 74 20 3b 20  |,taskconstant ; |
00005010  49 6e 64 69 63 61 74 65  20 6e 65 77 2d 73 74 79  |Indicate new-sty|
00005020  6c 65 20 57 69 6d 70 20  74 61 73 6b 0d 10 e0 4a  |le Wimp task...J|
00005030  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005040  41 44 52 20 20 20 20 20  52 32 2c 64 65 73 63 72  |ADR     R2,descr|
00005050  69 70 74 69 6f 6e 20 20  3b 20 45 6e 67 6c 69 73  |iption  ; Englis|
00005060  68 20 74 65 78 74 20 6e  61 6d 65 20 6f 66 20 70  |h text name of p|
00005070  72 6f 67 72 61 6d 0d 10  ea 45 20 20 20 20 20 20  |rogram...E      |
00005080  20 20 20 20 20 20 20 20  20 20 53 57 49 20 20 20  |          SWI   |
00005090  20 20 22 58 57 69 6d 70  5f 49 6e 69 74 69 61 6c  |  "XWimp_Initial|
000050a0  69 73 65 22 20 3b 20 53  74 61 72 74 20 74 61 73  |ise" ; Start tas|
000050b0  6b 2e 20 49 49 49 2d 31  31 37 33 0d 10 f4 49 20  |k. III-1173...I |
000050c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 43  |               C|
000050d0  4d 50 20 20 20 20 20 52  30 2c 23 77 69 6e 64 6d  |MP     R0,#windm|
000050e0  61 6e 25 20 20 20 20 3b  20 41 72 65 20 77 65 20  |an%    ; Are we |
000050f0  65 61 72 6c 69 65 72 20  74 68 61 6e 20 56 32 2e  |earlier than V2.|
00005100  30 30 20 3f 0d 10 fe 3f  20 20 20 20 20 20 20 20  |00 ?...?        |
00005110  20 20 20 20 20 20 20 20  41 44 52 4c 54 20 20 20  |        ADRLT   |
00005120  52 30 2c 6e 6f 74 72 65  63 65 6e 74 77 69 6d 70  |R0,notrecentwimp|
00005130  3b 20 59 65 73 2c 20 73  6f 20 63 72 61 73 68 20  |; Yes, so crash |
00005140  6f 75 74 0d 11 08 2e 20  20 20 20 20 20 20 20 20  |out....         |
00005150  20 20 20 20 20 20 20 53  57 49 4c 54 20 20 20 22  |       SWILT   "|
00005160  4f 53 5f 47 65 6e 65 72  61 74 65 45 72 72 6f 72  |OS_GenerateError|
00005170  22 0d 11 12 43 20 20 20  20 20 20 20 20 20 20 20  |"...C           |
00005180  20 20 20 20 20 53 54 52  20 20 20 20 20 52 31 2c  |     STR     R1,|
00005190  74 61 73 6b 68 61 6e 64  6c 65 20 20 20 3b 20 53  |taskhandle   ; S|
000051a0  61 76 65 20 57 69 6d 70  20 74 61 73 6b 20 68 61  |ave Wimp task ha|
000051b0  6e 64 6c 65 0d 11 1c 04  0d 11 26 49 3b 20 41 74  |ndle......&I; At|
000051c0  20 74 68 65 20 70 6f 69  6e 74 2c 20 65 76 65 72  | the point, ever|
000051d0  79 74 68 69 6e 67 20 69  73 20 72 65 61 64 79 20  |ything is ready |
000051e0  66 6f 72 20 61 70 70 6c  69 63 61 74 69 6f 6e 20  |for application |
000051f0  69 6e 69 74 69 61 6c 69  73 61 74 69 6f 6e 2e 2e  |initialisation..|
00005200  2e 0d 11 30 04 0d 11 3a  48 20 20 20 20 20 20 20  |...0...:H       |
00005210  20 20 20 20 20 20 20 20  20 42 4c 20 20 20 20 20  |         BL     |
00005220  20 64 75 6d 6d 79 73 70  61 72 6b 20 20 20 20 20  | dummyspark     |
00005230  20 3b 20 54 72 79 20 61  6e 64 20 67 65 74 20 53  | ; Try and get S|
00005240  70 61 72 6b 20 74 6f 20  72 65 70 6c 79 0d 11 44  |park to reply..D|
00005250  4c 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |L               |
00005260  20 42 4c 20 20 20 20 20  20 6c 6f 61 64 74 65 6d  | BL      loadtem|
00005270  70 6c 61 74 65 20 20 20  20 3b 20 4c 6f 61 64 20  |plate    ; Load |
00005280  74 65 6d 70 6c 61 74 65  2f 6d 61 6b 65 20 49 6e  |template/make In|
00005290  66 6f 20 77 69 6e 64 6f  77 0d 11 4e 46 20 20 20  |fo window..NF   |
000052a0  20 20 20 20 20 20 20 20  20 20 20 20 20 42 4c 20  |             BL |
000052b0  20 20 20 20 20 73 63 61  6e 74 72 61 73 68 73 70  |     scantrashsp|
000052c0  72 20 20 20 20 3b 20 4c  6f 61 64 20 61 70 70 6c  |r    ; Load appl|
000052d0  69 63 61 74 69 6f 6e 20  73 70 72 69 74 65 73 0d  |ication sprites.|
000052e0  11 58 3e 20 20 20 20 20  20 20 20 20 20 20 20 20  |.X>             |
000052f0  20 20 20 42 4c 20 20 20  20 20 20 72 65 61 64 43  |   BL      readC|
00005300  4d 4f 53 20 20 20 20 20  20 20 20 3b 20 53 65 74  |MOS        ; Set|
00005310  75 70 20 6d 65 6e 75 20  74 69 63 6b 73 0d 11 62  |up menu ticks..b|
00005320  38 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |8               |
00005330  20 4d 4f 56 20 20 20 20  20 52 31 30 2c 23 30 20  | MOV     R10,#0 |
00005340  20 20 20 20 20 20 20 20  20 3b 20 46 69 72 73 74  |         ; First|
00005350  20 73 63 61 6e 0d 11 63  41 20 20 20 20 20 20 20  | scan..cA       |
00005360  20 20 20 20 20 20 20 20  20 53 54 52 42 20 20 20  |         STRB   |
00005370  20 52 31 30 2c 64 72 61  67 73 74 61 74 65 20 20  | R10,dragstate  |
00005380  20 3b 20 41 73 73 75 6d  65 20 62 75 74 74 6f 6e  | ; Assume button|
00005390  20 69 73 20 75 70 0d 11  6c 3c 20 20 20 20 20 20  | is up..l<      |
000053a0  20 20 20 20 20 20 20 20  20 20 42 4c 20 20 20 20  |          BL    |
000053b0  20 20 63 68 65 63 6b 63  6f 6e 74 65 6e 74 73 20  |  checkcontents |
000053c0  20 20 3b 20 53 63 61 6e  20 74 72 61 73 68 20 63  |  ; Scan trash c|
000053d0  61 6e 0d 11 76 44 20 20  20 20 20 20 20 20 20 20  |an..vD          |
000053e0  20 20 20 20 20 20 42 4c  20 20 20 20 20 20 73 63  |      BL      sc|
000053f0  61 6e 76 61 6e 73 70 72  20 20 20 20 20 20 3b 20  |anvanspr      ; |
00005400  4c 6f 61 64 20 61 6e 69  6d 61 74 69 6f 6e 20 73  |Load animation s|
00005410  70 72 69 74 65 73 0d 11  80 04 0d 11 8a 48 3b 20  |prites.......H; |
00005420  42 65 63 61 75 73 65 20  61 70 70 6c 69 63 61 74  |Because applicat|
00005430  69 6f 6e 73 20 63 6f 75  6c 64 20 72 65 6e 61 6d  |ions could renam|
00005440  65 2f 64 65 6c 65 74 65  2f 63 6f 70 79 20 65 74  |e/delete/copy et|
00005450  63 2e 20 69 6e 20 61 20  76 61 72 69 65 74 79 20  |c. in a variety |
00005460  6f 66 0d 11 94 42 3b 20  77 61 79 73 20 28 61 6e  |of...B; ways (an|
00005470  64 20 6e 6f 74 20 75 73  69 6e 67 20 74 68 65 20  |d not using the |
00005480  57 49 4d 50 29 2c 20 74  68 65 6e 20 68 61 76 65  |WIMP), then have|
00005490  20 74 6f 20 63 6c 61 69  6d 20 55 70 43 61 6c 6c  | to claim UpCall|
000054a0  56 20 74 6f 0d 11 9e 2b  3b 20 74 72 61 70 20 61  |V to...+; trap a|
000054b0  6e 79 20 64 69 72 65 63  74 6f 72 79 2d 63 68 61  |ny directory-cha|
000054c0  6e 67 69 6e 67 20 61 63  74 69 76 69 74 79 2e 0d  |nging activity..|
000054d0  11 a8 04 0d 11 b2 3a 20  20 20 20 20 20 20 20 20  |......:         |
000054e0  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
000054f0  30 2c 23 55 70 43 61 6c  6c 56 20 20 20 20 20 20  |0,#UpCallV      |
00005500  20 20 20 20 20 20 20 3b  20 49 2d 36 38 0d 11 bc  |       ; I-68...|
00005510  29 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |)               |
00005520  20 41 44 52 20 20 20 20  20 52 31 2c 74 72 61 70  | ADR     R1,trap|
00005530  75 70 63 61 6c 6c 0d 11  c6 21 20 20 20 20 20 20  |upcall...!      |
00005540  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
00005550  20 20 52 32 2c 23 30 0d  11 d0 3a 20 20 20 20 20  |  R2,#0...:     |
00005560  20 20 20 20 20 20 20 20  20 20 20 53 57 49 20 20  |           SWI  |
00005570  20 20 20 22 58 4f 53 5f  43 6c 61 69 6d 22 20 20  |   "XOS_Claim"  |
00005580  20 20 20 20 20 20 20 20  20 20 20 3b 20 49 2d 35  |           ; I-5|
00005590  38 0d 11 da 04 0d 11 e4  4c 3b 20 2e 2e 2e 61 6e  |8.......L; ...an|
000055a0  64 20 61 20 74 69 67 68  74 20 57 69 6d 70 5f 50  |d a tight Wimp_P|
000055b0  6f 6c 6c 20 6c 6f 6f 70  2c 20 6f 6e 6c 79 20 71  |oll loop, only q|
000055c0  75 69 74 74 69 6e 67 20  77 68 65 6e 20 74 68 65  |uitting when the|
000055d0  20 75 73 65 72 20 72 65  71 75 65 73 74 73 20 69  | user requests i|
000055e0  74 0d 11 ee 04 0d 11 f8  45 2e 69 6e 74 69 67 68  |t.......E.intigh|
000055f0  74 6c 6f 6f 70 20 20 20  20 4d 4f 56 20 20 20 20  |tloop    MOV    |
00005600  20 52 30 2c 23 30 20 20  20 20 20 20 20 20 20 20  | R0,#0          |
00005610  20 3b 20 41 6c 6c 20 72  65 61 73 6f 6e 20 63 6f  | ; All reason co|
00005620  64 65 73 20 77 61 6e 74  65 64 0d 12 02 46 20 20  |des wanted...F  |
00005630  20 20 20 20 20 20 20 20  20 20 20 20 20 20 53 55  |              SU|
00005640  42 20 20 20 20 20 52 31  2c 52 31 33 2c 23 73 74  |B     R1,R13,#st|
00005650  61 63 6b 73 70 61 63 65  25 20 3b 20 44 61 74 61  |ackspace% ; Data|
00005660  20 72 65 74 75 72 6e 65  64 20 74 6f 20 52 4d 41  | returned to RMA|
00005670  0d 12 0c 36 20 20 20 20  20 20 20 20 20 20 20 20  |...6            |
00005680  20 20 20 20 53 57 49 20  20 20 20 20 22 58 57 69  |    SWI     "XWi|
00005690  6d 70 5f 50 6f 6c 6c 22  20 20 20 20 3b 20 49 49  |mp_Poll"    ; II|
000056a0  49 2d 31 31 39 32 0d 12  16 48 20 20 20 20 20 20  |I-1192...H      |
000056b0  20 20 20 20 20 20 20 20  20 20 4c 44 52 20 20 20  |          LDR   |
000056c0  20 20 52 31 33 2c 77 6f  72 6b 73 70 61 63 65 20  |  R13,workspace |
000056d0  20 20 3b 20 52 65 73 65  74 20 73 74 61 63 6b 20  |  ; Reset stack |
000056e0  70 6f 69 6e 74 65 72 20  2d 3e 20 52 4d 41 0d 12  |pointer -> RMA..|
000056f0  20 3a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | :              |
00005700  20 20 4d 4f 56 53 20 20  20 20 52 30 2c 52 30 20  |  MOVS    R0,R0 |
00005710  20 20 20 20 20 20 20 20  20 20 3b 20 49 73 20 69  |          ; Is i|
00005720  74 20 69 64 6c 65 20 3f  0d 12 2a 28 20 20 20 20  |t idle ?..*(    |
00005730  20 20 20 20 20 20 20 20  20 20 20 20 42 4e 45 20  |            BNE |
00005740  20 20 20 20 61 63 74 75  61 6c 6c 79 62 75 73 79  |    actuallybusy|
00005750  0d 12 34 49 20 20 20 20  20 20 20 20 20 20 20 20  |..4I            |
00005760  20 20 20 20 42 4c 20 20  20 20 20 20 73 74 6f 70  |    BL      stop|
00005770  67 6c 61 73 73 20 20 20  20 20 20 20 3b 20 59 65  |glass       ; Ye|
00005780  73 2c 20 73 6f 20 48 6f  75 72 67 6c 61 73 73 20  |s, so Hourglass |
00005790  6f 66 66 20 69 66 20 6f  6e 0d 12 3e 4a 20 20 20  |off if on..>J   |
000057a0  20 20 20 20 20 20 20 20  20 20 20 20 20 42 4c 20  |             BL |
000057b0  20 20 20 20 20 63 68 65  63 6b 66 6f 72 64 72 61  |     checkfordra|
000057c0  67 20 20 20 20 3b 20 41  72 65 20 77 65 20 64 72  |g    ; Are we dr|
000057d0  61 67 67 69 6e 67 20 66  72 6f 6d 20 53 70 61 72  |agging from Spar|
000057e0  6b 20 3f 0d 12 48 4a 20  20 20 20 20 20 20 20 20  |k ?..HJ         |
000057f0  20 20 20 20 20 20 20 42  20 20 20 20 20 20 20 63  |       B       c|
00005800  68 65 63 6b 66 73 66 6c  61 67 20 20 20 20 20 3b  |heckfsflag     ;|
00005810  20 53 65 65 20 69 66 20  54 72 61 73 68 24 44 69  | See if Trash$Di|
00005820  72 20 68 61 73 20 63 68  61 6e 67 65 64 0d 12 52  |r has changed..R|
00005830  4d 2e 61 63 74 75 61 6c  6c 79 62 75 73 79 20 20  |M.actuallybusy  |
00005840  20 43 4d 50 20 20 20 20  20 52 30 2c 23 36 20 20  | CMP     R0,#6  |
00005850  20 20 20 20 20 20 20 20  20 3b 20 43 68 65 63 6b  |         ; Check|
00005860  20 66 6f 72 20 6d 6f 75  73 65 20 63 6c 69 63 6b  | for mouse click|
00005870  2e 20 49 49 49 2d 31 31  39 36 0d 12 5c 28 20 20  |. III-1196..\(  |
00005880  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 4e  |              BN|
00005890  45 20 20 20 20 20 6d 61  79 62 65 6d 65 6e 75 73  |E     maybemenus|
000058a0  65 6c 0d 12 66 3e 20 20  20 20 20 20 20 20 20 20  |el..f>          |
000058b0  20 20 20 20 20 20 4c 44  52 20 20 20 20 20 52 30  |      LDR     R0|
000058c0  2c 5b 52 31 2c 23 38 5d  20 20 20 20 20 20 3b 20  |,[R1,#8]      ; |
000058d0  47 65 74 20 62 75 74 74  6f 6e 20 73 74 61 74 65  |Get button state|
000058e0  0d 12 70 43 20 20 20 20  20 20 20 20 20 20 20 20  |..pC            |
000058f0  20 20 20 20 43 4d 50 20  20 20 20 20 52 30 2c 23  |    CMP     R0,#|
00005900  34 20 20 20 20 20 20 20  20 20 20 20 3b 20 49 73  |4           ; Is|
00005910  20 69 74 20 6c 65 66 74  20 62 75 74 74 6f 6e 2e  | it left button.|
00005920  2e 2e 3f 0d 12 7a 46 20  20 20 20 20 20 20 20 20  |..?..zF         |
00005930  20 20 20 20 20 20 20 43  4d 50 4e 45 20 20 20 52  |       CMPNE   R|
00005940  30 2c 23 31 20 20 20 20  20 20 20 20 20 20 20 3b  |0,#1           ;|
00005950  20 2e 2e 2e 6f 72 20 74  68 65 20 72 69 67 68 74  | ...or the right|
00005960  20 62 75 74 74 6f 6e 20  3f 0d 12 84 27 20 20 20  | button ?...'   |
00005970  20 20 20 20 20 20 20 20  20 20 20 20 20 42 4e 45  |             BNE|
00005980  20 20 20 20 20 6d 61 79  62 65 6d 69 64 64 6c 65  |     maybemiddle|
00005990  0d 12 8e 49 20 20 20 20  20 20 20 20 20 20 20 20  |...I            |
000059a0  20 20 20 20 4c 44 52 42  20 20 20 20 52 30 2c 43  |    LDRB    R0,C|
000059b0  4d 4f 53 62 79 74 65 20  20 20 20 20 3b 20 4f 6e  |MOSbyte     ; On|
000059c0  6c 79 20 64 6f 20 73 6f  6d 65 74 68 69 6e 67 20  |ly do something |
000059d0  69 66 20 6e 6f 74 20 69  6e 0d 12 98 3c 20 20 20  |if not in...<   |
000059e0  20 20 20 20 20 20 20 20  20 20 20 20 20 54 53 54  |             TST|
000059f0  20 20 20 20 20 52 30 2c  23 25 30 30 31 20 20 20  |     R0,#%001   |
00005a00  20 20 20 20 20 3b 20 49  6d 6d 65 64 69 61 74 65  |     ; Immediate|
00005a10  20 6d 6f 64 65 0d 12 a2  43 20 20 20 20 20 20 20  | mode...C       |
00005a20  20 20 20 20 20 20 20 20  20 42 4c 45 51 20 20 20  |         BLEQ   |
00005a30  20 70 65 65 70 69 6e 63  61 6e 20 20 20 20 20 20  | peepincan      |
00005a40  20 3b 20 4c 6f 6f 6b 20  69 6e 73 69 64 65 20 74  | ; Look inside t|
00005a50  72 61 73 68 20 63 61 6e  0d 12 ac 27 20 20 20 20  |rash can...'    |
00005a60  20 20 20 20 20 20 20 20  20 20 20 20 42 20 20 20  |            B   |
00005a70  20 20 20 20 69 6e 74 69  67 68 74 6c 6f 6f 70 0d  |    intightloop.|
00005a80  12 b6 21 2e 6d 61 79 62  65 6d 69 64 64 6c 65 20  |..!.maybemiddle |
00005a90  20 20 20 43 4d 50 20 20  20 20 20 52 30 2c 23 32  |   CMP     R0,#2|
00005aa0  0d 12 c0 43 20 20 20 20  20 20 20 20 20 20 20 20  |...C            |
00005ab0  20 20 20 20 42 4c 45 51  20 20 20 20 6d 61 6b 65  |    BLEQ    make|
00005ac0  6e 65 77 6d 65 6e 75 20  20 20 20 20 3b 20 4d 69  |newmenu     ; Mi|
00005ad0  64 64 6c 65 20 62 75 74  74 6f 6e 20 2d 3e 20 6d  |ddle button -> m|
00005ae0  65 6e 75 0d 12 ca 27 20  20 20 20 20 20 20 20 20  |enu...'         |
00005af0  20 20 20 20 20 20 20 42  20 20 20 20 20 20 20 69  |       B       i|
00005b00  6e 74 69 67 68 74 6c 6f  6f 70 0d 12 d4 21 2e 6d  |ntightloop...!.m|
00005b10  61 79 62 65 6d 65 6e 75  73 65 6c 20 20 20 43 4d  |aybemenusel   CM|
00005b20  50 20 20 20 20 20 52 30  2c 23 39 0d 12 de 28 20  |P     R0,#9...( |
00005b30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 42  |               B|
00005b40  4e 45 20 20 20 20 20 6e  6f 6d 6f 75 73 65 63 6c  |NE     nomousecl|
00005b50  69 63 6b 0d 12 e8 46 20  20 20 20 20 20 20 20 20  |ick...F         |
00005b60  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
00005b70  32 2c 52 31 20 20 20 20  20 20 20 20 20 20 20 3b  |2,R1           ;|
00005b80  20 53 61 76 65 20 57 69  6d 70 5f 50 6f 6c 6c 20  | Save Wimp_Poll |
00005b90  62 6c 6f 63 6b 20 70 74  72 0d 12 f2 46 20 20 20  |block ptr...F   |
00005ba0  20 20 20 20 20 20 20 20  20 20 20 20 20 41 44 44  |             ADD|
00005bb0  20 20 20 20 20 52 31 2c  52 31 2c 23 26 31 30 30  |     R1,R1,#&100|
00005bc0  20 20 20 20 20 3b 20 50  6f 69 6e 74 65 72 20 62  |     ; Pointer b|
00005bd0  6c 6f 63 6b 20 66 75 72  74 68 65 72 20 6f 6e 0d  |lock further on.|
00005be0  12 fc 3e 20 20 20 20 20  20 20 20 20 20 20 20 20  |..>             |
00005bf0  20 20 20 53 57 49 20 20  20 20 20 22 58 57 69 6d  |   SWI     "XWim|
00005c00  70 5f 47 65 74 50 6f 69  6e 74 65 72 49 6e 66 6f  |p_GetPointerInfo|
00005c10  22 20 20 3b 20 49 49 49  2d 31 32 31 34 0d 13 06  |"  ; III-1214...|
00005c20  3e 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |>               |
00005c30  20 4c 44 52 20 20 20 20  20 52 30 2c 5b 52 31 2c  | LDR     R0,[R1,|
00005c40  23 38 5d 20 20 20 20 20  20 3b 20 47 65 74 20 62  |#8]      ; Get b|
00005c50  75 74 74 6f 6e 20 73 74  61 74 65 0d 13 10 49 20  |utton state...I |
00005c60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
00005c70  4f 56 20 20 20 20 20 52  31 2c 52 32 20 20 20 20  |OV     R1,R2    |
00005c80  20 20 20 20 20 20 20 3b  20 52 65 73 74 6f 72 65  |       ; Restore|
00005c90  20 57 69 6d 70 5f 50 6f  6c 6c 20 62 6c 6f 63 6b  | Wimp_Poll block|
00005ca0  20 70 74 72 0d 13 1a 4a  20 20 20 20 20 20 20 20  | ptr...J        |
00005cb0  20 20 20 20 20 20 20 20  42 4c 20 20 20 20 20 20  |        BL      |
00005cc0  64 65 61 6c 77 69 74 68  6d 65 6e 75 20 20 20 20  |dealwithmenu    |
00005cd0  3b 20 4d 65 6e 75 20 69  74 65 6d 20 73 65 6c 65  |; Menu item sele|
00005ce0  63 74 65 64 2e 20 49 49  49 2d 31 31 39 39 0d 13  |cted. III-1199..|
00005cf0  24 46 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |$F              |
00005d00  20 20 43 4d 50 20 20 20  20 20 52 30 2c 23 31 20  |  CMP     R0,#1 |
00005d10  20 20 20 20 20 20 20 20  20 20 3b 20 49 73 20 69  |          ; Is i|
00005d20  74 20 74 68 65 20 72 69  67 68 74 20 62 75 74 74  |t the right butt|
00005d30  6f 6e 20 3f 0d 13 2e 41  20 20 20 20 20 20 20 20  |on ?...A        |
00005d40  20 20 20 20 20 20 20 20  42 4c 45 51 20 20 20 20  |        BLEQ    |
00005d50  6d 61 6b 65 6f 6c 64 6d  65 6e 75 20 20 20 20 20  |makeoldmenu     |
00005d60  3b 20 4b 65 65 70 20 6d  65 6e 75 20 6f 6e 20 73  |; Keep menu on s|
00005d70  63 72 65 65 6e 0d 13 38  27 20 20 20 20 20 20 20  |creen..8'       |
00005d80  20 20 20 20 20 20 20 20  20 42 20 20 20 20 20 20  |         B      |
00005d90  20 69 6e 74 69 67 68 74  6c 6f 6f 70 0d 13 42 43  | intightloop..BC|
00005da0  2e 6e 6f 6d 6f 75 73 65  63 6c 69 63 6b 20 20 20  |.nomouseclick   |
00005db0  43 4d 50 20 20 20 20 20  52 30 2c 23 32 20 20 20  |CMP     R0,#2   |
00005dc0  20 20 20 20 20 20 20 20  3b 20 49 6e 66 6f 20 77  |        ; Info w|
00005dd0  69 6e 64 6f 77 20 64 72  61 67 67 65 64 20 3f 0d  |indow dragged ?.|
00005de0  13 4c 3d 20 20 20 20 20  20 20 20 20 20 20 20 20  |.L=             |
00005df0  20 20 20 42 4e 45 20 20  20 20 20 6d 61 79 62 65  |   BNE     maybe|
00005e00  6d 65 73 73 61 67 65 20  20 20 20 3b 20 28 50 68  |message    ; (Ph|
00005e10  69 6c 69 70 20 43 6f 6c  6d 65 72 29 0d 13 56 3e  |ilip Colmer)..V>|
00005e20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005e30  53 57 49 20 20 20 20 20  22 58 57 69 6d 70 5f 4f  |SWI     "XWimp_O|
00005e40  70 65 6e 57 69 6e 64 6f  77 22 20 20 20 20 20 20  |penWindow"      |
00005e50  3b 20 49 49 49 2d 31 31  39 30 0d 13 60 45 20 20  |; III-1190..`E  |
00005e60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 20  |              B |
00005e70  20 20 20 20 20 20 69 6e  74 69 67 68 74 6c 6f 6f  |      intightloo|
00005e80  70 20 20 20 20 20 3b 20  54 68 61 74 20 77 61 73  |p     ; That was|
00005e90  20 6e 69 63 65 27 6e 27  65 61 73 79 2e 2e 2e 0d  | nice'n'easy....|
00005ea0  13 6a 49 2e 6d 61 79 62  65 6d 65 73 73 61 67 65  |.jI.maybemessage|
00005eb0  20 20 20 43 4d 50 20 20  20 20 20 52 30 2c 23 31  |   CMP     R0,#1|
00005ec0  37 20 20 20 20 20 20 20  20 20 20 3b 20 43 68 65  |7          ; Che|
00005ed0  63 6b 20 66 6f 72 20 6d  65 73 73 61 67 65 20 62  |ck for message b|
00005ee0  72 6f 61 64 63 61 73 74  0d 13 74 36 20 20 20 20  |roadcast..t6    |
00005ef0  20 20 20 20 20 20 20 20  20 20 20 20 43 4d 50 4e  |            CMPN|
00005f00  45 20 20 20 52 30 2c 23  31 38 20 20 20 20 20 20  |E   R0,#18      |
00005f10  20 20 20 20 3b 20 49 49  49 2d 31 32 30 32 0d 13  |    ; III-1202..|
00005f20  7e 27 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |~'              |
00005f30  20 20 42 4e 45 20 20 20  20 20 63 68 65 63 6b 66  |  BNE     checkf|
00005f40  73 66 6c 61 67 0d 13 88  27 20 20 20 20 20 20 20  |sflag...'       |
00005f50  20 20 20 20 20 20 20 20  20 4c 44 52 20 20 20 20  |         LDR    |
00005f60  20 52 32 2c 5b 52 31 2c  23 31 36 5d 0d 13 92 21  | R2,[R1,#16]...!|
00005f70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005f80  4d 4f 56 53 20 20 20 20  52 32 2c 52 32 0d 13 9c  |MOVS    R2,R2...|
00005f90  40 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |@               |
00005fa0  20 ec 51 20 20 20 52 39  2c 23 30 20 20 20 20 20  | .Q   R9,#0     |
00005fb0  20 20 20 20 20 20 3b 20  53 69 67 6e 61 6c 20 54  |      ; Signal T|
00005fc0  65 6d 70 6f 72 61 72 79  20 51 75 69 74 0d 13 a6  |emporary Quit...|
00005fd0  46 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |F               |
00005fe0  20 42 45 51 20 20 20 20  20 6c 65 61 76 65 6e 6f  | BEQ     leaveno|
00005ff0  77 20 20 20 20 20 20 20  20 3b 20 51 75 69 74 20  |w        ; Quit |
00006000  72 65 71 75 65 73 74 65  64 2e 20 49 49 49 2d 31  |requested. III-1|
00006010  32 35 35 0d 13 b0 24 20  20 20 20 20 20 20 20 20  |255...$         |
00006020  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
00006030  33 2c 23 26 35 30 30 0d  13 ba 3d 20 20 20 20 20  |3,#&500...=     |
00006040  20 20 20 20 20 20 20 20  20 20 20 41 44 44 20 20  |           ADD  |
00006050  20 20 20 52 33 2c 52 33  2c 23 32 20 20 20 20 20  |   R3,R3,#2     |
00006060  20 20 20 3b 20 21 48 65  6c 70 20 49 44 20 3d 20  |   ; !Help ID = |
00006070  26 35 30 32 0d 13 c4 43  20 20 20 20 20 20 20 20  |&502...C        |
00006080  20 20 20 20 20 20 20 20  43 4d 50 20 20 20 20 20  |        CMP     |
00006090  52 33 2c 52 32 20 20 20  20 20 20 20 20 20 20 20  |R3,R2           |
000060a0  3b 20 57 61 73 20 21 48  65 6c 70 20 72 65 71 75  |; Was !Help requ|
000060b0  65 73 74 65 64 20 3f 0d  13 ce 26 20 20 20 20 20  |ested ?...&     |
000060c0  20 20 20 20 20 20 20 20  20 20 20 42 4e 45 20 20  |           BNE  |
000060d0  20 20 20 77 61 73 69 74  61 64 72 61 67 0d 13 d8  |   wasitadrag...|
000060e0  3d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |=               |
000060f0  20 4c 44 52 20 20 20 20  20 52 32 2c 5b 52 31 2c  | LDR     R2,[R1,|
00006100  23 33 32 5d 20 20 20 20  20 3b 20 47 65 74 20 69  |#32]     ; Get i|
00006110  63 6f 6e 20 68 61 6e 64  6c 65 0d 13 e2 40 20 20  |con handle...@  |
00006120  20 20 20 20 20 20 20 20  20 20 20 20 20 20 43 4d  |              CM|
00006130  4e 20 20 20 20 20 52 32  2c 23 2d 69 63 6f 6e 62  |N     R2,#-iconb|
00006140  61 72 74 79 70 65 25 20  20 20 20 20 20 20 3b 20  |artype%       ; |
00006150  49 63 6f 6e 20 62 61 72  20 3f 0d 13 ec 48 20 20  |Icon bar ?...H  |
00006160  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4d 4f  |              MO|
00006170  56 4e 45 20 20 20 52 34  2c 23 31 20 20 20 20 20  |VNE   R4,#1     |
00006180  20 20 20 20 20 20 3b 20  4e 6f 2c 20 73 6f 20 6d  |      ; No, so m|
00006190  75 73 74 20 62 65 20 49  6e 66 6f 20 57 69 6e 64  |ust be Info Wind|
000061a0  6f 77 0d 13 f6 41 20 20  20 20 20 20 20 20 20 20  |ow...A          |
000061b0  20 20 20 20 20 20 42 4e  45 20 20 20 20 20 68 65  |      BNE     he|
000061c0  6c 70 77 61 6e 74 65 64  20 20 20 20 20 20 3b 20  |lpwanted      ; |
000061d0  52 65 6a 6f 69 6e 20 68  65 6c 70 20 72 65 71 75  |Rejoin help requ|
000061e0  65 73 74 0d 14 00 3d 20  20 20 20 20 20 20 20 20  |est...=         |
000061f0  20 20 20 20 20 20 20 4c  44 52 20 20 20 20 20 52  |       LDR     R|
00006200  32 2c 5b 52 31 2c 23 33  36 5d 20 20 20 20 20 3b  |2,[R1,#36]     ;|
00006210  20 49 73 20 69 74 20 6d  79 20 69 63 6f 6e 20 3f  | Is it my icon ?|
00006220  0d 14 0a 29 20 20 20 20  20 20 20 20 20 20 20 20  |...)            |
00006230  20 20 20 20 4c 44 52 20  20 20 20 20 52 33 2c 69  |    LDR     R3,i|
00006240  63 6f 6e 68 61 6e 64 6c  65 0d 14 14 21 20 20 20  |conhandle...!   |
00006250  20 20 20 20 20 20 20 20  20 20 20 20 20 43 4d 50  |             CMP|
00006260  20 20 20 20 20 52 32 2c  52 33 0d 14 1e 27 20 20  |     R2,R3...'  |
00006270  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 4e  |              BN|
00006280  45 20 20 20 20 20 69 6e  74 69 67 68 74 6c 6f 6f  |E     intightloo|
00006290  70 0d 14 28 45 20 20 20  20 20 20 20 20 20 20 20  |p..(E           |
000062a0  20 20 20 20 20 4d 4f 56  20 20 20 20 20 52 34 2c  |     MOV     R4,|
000062b0  23 30 20 20 20 20 20 20  20 20 20 20 20 3b 20 46  |#0           ; F|
000062c0  6c 61 67 20 74 68 61 74  20 69 74 27 73 20 74 68  |lag that it's th|
000062d0  65 20 69 63 6f 6e 0d 14  32 42 2e 68 65 6c 70 77  |e icon..2B.helpw|
000062e0  61 6e 74 65 64 20 20 20  20 20 42 4c 20 20 20 20  |anted     BL    |
000062f0  20 20 61 73 6b 65 64 66  6f 72 68 65 6c 70 20 20  |  askedforhelp  |
00006300  20 20 3b 20 21 48 65 6c  70 20 69 6e 66 6f 20 72  |  ; !Help info r|
00006310  65 71 75 65 73 74 65 64  0d 14 3c 27 20 20 20 20  |equested..<'    |
00006320  20 20 20 20 20 20 20 20  20 20 20 20 42 20 20 20  |            B   |
00006330  20 20 20 20 69 6e 74 69  67 68 74 6c 6f 6f 70 0d  |    intightloop.|
00006340  14 46 43 2e 77 61 73 69  74 61 64 72 61 67 20 20  |.FC.wasitadrag  |
00006350  20 20 20 43 4d 50 20 20  20 20 20 52 32 2c 23 33  |   CMP     R2,#3|
00006360  20 20 20 20 20 20 20 20  20 20 20 3b 20 4c 6f 61  |           ; Loa|
00006370  64 20 64 61 74 61 20 72  65 71 75 65 73 74 65 64  |d data requested|
00006380  20 3f 0d 14 50 36 20 20  20 20 20 20 20 20 20 20  | ?..P6          |
00006390  20 20 20 20 20 20 42 4e  45 20 20 20 20 20 6d 61  |      BNE     ma|
000063a0  79 62 65 73 70 61 72 6b  20 20 20 20 20 20 3b 20  |ybespark      ; |
000063b0  49 49 49 2d 31 32 36 35  0d 14 5a 45 20 20 20 20  |III-1265..ZE    |
000063c0  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 52 20  |            LDR |
000063d0  20 20 20 20 52 32 2c 5b  52 31 2c 23 32 30 5d 20  |    R2,[R1,#20] |
000063e0  20 20 20 20 3b 20 49 73  20 69 74 20 6f 6e 20 74  |    ; Is it on t|
000063f0  68 65 20 69 63 6f 6e 20  62 61 72 20 3f 0d 14 64  |he icon bar ?..d|
00006400  2d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |-               |
00006410  20 43 4d 4e 20 20 20 20  20 52 32 2c 23 2d 69 63  | CMN     R2,#-ic|
00006420  6f 6e 62 61 72 74 79 70  65 25 0d 14 6e 27 20 20  |onbartype%..n'  |
00006430  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 4e  |              BN|
00006440  45 20 20 20 20 20 69 6e  74 69 67 68 74 6c 6f 6f  |E     intightloo|
00006450  70 0d 14 78 3d 20 20 20  20 20 20 20 20 20 20 20  |p..x=           |
00006460  20 20 20 20 20 4c 44 52  20 20 20 20 20 52 32 2c  |     LDR     R2,|
00006470  5b 52 31 2c 23 32 34 5d  20 20 20 20 20 3b 20 49  |[R1,#24]     ; I|
00006480  73 20 69 74 20 6d 79 20  69 63 6f 6e 20 3f 0d 14  |s it my icon ?..|
00006490  82 29 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.)              |
000064a0  20 20 4c 44 52 20 20 20  20 20 52 33 2c 69 63 6f  |  LDR     R3,ico|
000064b0  6e 68 61 6e 64 6c 65 0d  14 8c 21 20 20 20 20 20  |nhandle...!     |
000064c0  20 20 20 20 20 20 20 20  20 20 20 43 4d 50 20 20  |           CMP  |
000064d0  20 20 20 52 32 2c 52 33  0d 14 96 49 20 20 20 20  |   R2,R3...I    |
000064e0  20 20 20 20 20 20 20 20  20 20 20 20 42 4c 45 51  |            BLEQ|
000064f0  20 20 20 20 6d 6f 76 65  69 6e 74 6f 74 72 61 73  |    moveintotras|
00006500  68 20 20 20 3b 20 46 69  6c 65 20 64 72 61 67 67  |h   ; File dragg|
00006510  65 64 20 6f 6e 74 6f 20  74 72 61 73 68 20 63 61  |ed onto trash ca|
00006520  6e 0d 14 a0 27 20 20 20  20 20 20 20 20 20 20 20  |n...'           |
00006530  20 20 20 20 20 42 20 20  20 20 20 20 20 69 6e 74  |     B       int|
00006540  69 67 68 74 6c 6f 6f 70  0d 14 aa 4c 2e 6d 61 79  |ightloop...L.may|
00006550  62 65 73 70 61 72 6b 20  20 20 20 20 4c 44 52 20  |bespark     LDR |
00006560  20 20 20 20 52 33 2c 64  79 69 6e 67 61 70 70 6d  |    R3,dyingappm|
00006570  65 73 73 20 3b 20 48 61  73 20 61 6e 20 61 70 70  |ess ; Has an app|
00006580  6c 69 63 61 74 69 6f 6e  20 6a 75 73 74 20 64 69  |lication just di|
00006590  65 64 20 3f 0d 14 b4 2c  20 20 20 20 20 20 20 20  |ed ?...,        |
000065a0  20 20 20 20 20 20 20 20  4c 44 52 20 20 20 20 20  |        LDR     |
000065b0  52 34 2c 73 70 61 72 6b  74 61 73 6b 68 61 6e 64  |R4,sparktaskhand|
000065c0  0d 14 be 46 20 20 20 20  20 20 20 20 20 20 20 20  |...F            |
000065d0  20 20 20 20 4c 44 52 20  20 20 20 20 52 35 2c 5b  |    LDR     R5,[|
000065e0  52 31 2c 23 34 5d 20 20  20 20 20 20 3b 20 47 65  |R1,#4]      ; Ge|
000065f0  74 20 74 61 73 6b 20 68  61 6e 64 6c 65 20 69 6e  |t task handle in|
00006600  76 6f 6c 76 65 64 0d 14  c8 21 20 20 20 20 20 20  |volved...!      |
00006610  20 20 20 20 20 20 20 20  20 20 43 4d 50 20 20 20  |          CMP   |
00006620  20 20 52 32 2c 52 33 0d  14 d2 3c 20 20 20 20 20  |  R2,R3...<     |
00006630  20 20 20 20 20 20 20 20  20 20 20 43 4d 50 45 51  |           CMPEQ|
00006640  20 20 20 52 35 2c 52 34  20 20 20 20 20 20 20 20  |   R5,R4        |
00006650  20 20 20 3b 20 57 61 73  20 69 74 20 53 70 61 72  |   ; Was it Spar|
00006660  6b 20 3f 0d 14 dc 47 20  20 20 20 20 20 20 20 20  |k ?...G         |
00006670  20 20 20 20 20 20 20 ec  51 20 20 20 52 35 2c 23  |       .Q   R5,#|
00006680  30 20 20 20 20 20 20 20  20 20 20 20 3b 20 49 66  |0           ; If|
00006690  20 73 6f 2c 20 66 6f 72  67 65 74 20 53 70 61 72  | so, forget Spar|
000066a0  6b 27 73 20 68 61 6e 64  6c 65 0d 14 e6 43 20 20  |k's handle...C  |
000066b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 45  |              BE|
000066c0  51 20 20 20 20 20 73 70  61 72 6b 63 68 61 6e 67  |Q     sparkchang|
000066d0  65 20 20 20 20 20 3b 20  52 65 74 75 72 6e 20 69  |e     ; Return i|
000066e0  63 6f 6e 20 74 6f 20 6e  6f 72 6d 61 6c 0d 14 f0  |con to normal...|
000066f0  43 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |C               |
00006700  20 4c 44 52 20 20 20 20  20 52 33 2c 72 65 70 74  | LDR     R3,rept|
00006710  61 73 6b 6e 61 6d 65 20  20 3b 20 49 73 20 69 74  |askname  ; Is it|
00006720  20 74 68 65 20 74 61 73  6b 20 68 61 6e 64 6c 65  | the task handle|
00006730  0d 14 fa 3b 20 20 20 20  20 20 20 20 20 20 20 20  |...;            |
00006740  20 20 20 20 43 4d 50 20  20 20 20 20 52 32 2c 52  |    CMP     R2,R|
00006750  33 20 20 20 20 20 20 20  20 20 20 20 3b 20 74 72  |3           ; tr|
00006760  61 6e 73 6c 61 74 69 6f  6e 20 3f 0d 15 04 29 20  |anslation ?...) |
00006770  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 42  |               B|
00006780  4e 45 20 20 20 20 20 64  69 64 73 70 61 72 6b 73  |NE     didsparks|
00006790  74 61 72 74 0d 15 0e 42  20 20 20 20 20 20 20 20  |tart...B        |
000067a0  20 20 20 20 20 20 20 20  41 44 52 20 20 20 20 20  |        ADR     |
000067b0  52 30 2c 73 70 61 72 6b  74 61 73 6b 6e 61 6d 65  |R0,sparktaskname|
000067c0  3b 20 53 70 61 72 6b 27  73 20 74 61 73 6b 20 6e  |; Spark's task n|
000067d0  61 6d 65 2e 2e 2e 0d 15  18 25 20 20 20 20 20 20  |ame......%      |
000067e0  20 20 20 20 20 20 20 20  20 20 41 44 44 20 20 20  |          ADD   |
000067f0  20 20 52 32 2c 52 31 2c  23 32 38 0d 15 22 44 2e  |  R2,R1,#28.."D.|
00006800  73 63 61 6e 6e 69 6e 67  6e 61 6d 65 20 20 20 4c  |scanningname   L|
00006810  44 52 42 20 20 20 20 52  33 2c 5b 52 30 5d 2c 23  |DRB    R3,[R0],#|
00006820  31 20 20 20 20 20 20 3b  20 2e 2e 2e 63 6f 6d 70  |1      ; ...comp|
00006830  61 72 65 20 69 74 20 77  69 74 68 20 74 68 65 0d  |are it with the.|
00006840  15 2c 4b 20 20 20 20 20  20 20 20 20 20 20 20 20  |.,K             |
00006850  20 20 20 4c 44 52 42 20  20 20 20 52 34 2c 5b 52  |   LDRB    R4,[R|
00006860  32 5d 2c 23 31 20 20 20  20 20 20 3b 20 72 65 74  |2],#1      ; ret|
00006870  75 72 6e 65 64 20 6e 61  6d 65 20 74 6f 20 66 69  |urned name to fi|
00006880  6e 64 20 61 20 6d 61 74  63 68 0d 15 36 21 20 20  |nd a match..6!  |
00006890  20 20 20 20 20 20 20 20  20 20 20 20 20 20 43 4d  |              CM|
000068a0  50 20 20 20 20 20 52 33  2c 52 34 0d 15 40 27 20  |P     R3,R4..@' |
000068b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 42  |               B|
000068c0  4e 45 20 20 20 20 20 69  6e 74 69 67 68 74 6c 6f  |NE     intightlo|
000068d0  6f 70 0d 15 4a 41 20 20  20 20 20 20 20 20 20 20  |op..JA          |
000068e0  20 20 20 20 20 20 4d 4f  56 53 20 20 20 20 52 33  |      MOVS    R3|
000068f0  2c 52 33 20 20 20 20 20  20 20 20 20 20 20 3b 20  |,R3           ; |
00006900  53 74 69 6c 6c 20 73 63  61 6e 6e 69 6e 67 20 6e  |Still scanning n|
00006910  61 6d 65 0d 15 54 28 20  20 20 20 20 20 20 20 20  |ame..T(         |
00006920  20 20 20 20 20 20 20 42  4e 45 20 20 20 20 20 73  |       BNE     s|
00006930  63 61 6e 6e 69 6e 67 6e  61 6d 65 0d 15 5e 4b 20  |canningname..^K |
00006940  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
00006950  44 52 20 20 20 20 20 52  35 2c 5b 52 31 2c 23 32  |DR     R5,[R1,#2|
00006960  30 5d 20 20 20 20 20 3b  20 52 65 74 72 69 65 76  |0]     ; Retriev|
00006970  65 20 68 61 6e 64 6c 65  20 6d 61 74 63 68 69 6e  |e handle matchin|
00006980  67 20 6e 61 6d 65 0d 15  68 27 20 20 20 20 20 20  |g name..h'      |
00006990  20 20 20 20 20 20 20 20  20 20 42 20 20 20 20 20  |          B     |
000069a0  20 20 73 70 61 72 6b 63  68 61 6e 67 65 0d 15 72  |  sparkchange..r|
000069b0  49 2e 64 69 64 73 70 61  72 6b 73 74 61 72 74 20  |I.didsparkstart |
000069c0  20 4c 44 52 20 20 20 20  20 52 33 2c 73 70 61 72  | LDR     R3,spar|
000069d0  6b 6d 65 73 73 69 64 20  20 3b 20 48 61 73 20 53  |kmessid  ; Has S|
000069e0  70 61 72 6b 20 6a 75 73  74 20 73 74 61 72 74 65  |park just starte|
000069f0  64 20 75 70 20 3f 0d 15  7c 21 20 20 20 20 20 20  |d up ?..|!      |
00006a00  20 20 20 20 20 20 20 20  20 20 43 4d 50 20 20 20  |          CMP   |
00006a10  20 20 52 32 2c 52 33 0d  15 86 4a 20 20 20 20 20  |  R2,R3...J     |
00006a20  20 20 20 20 20 20 20 20  20 20 20 42 45 51 20 20  |           BEQ  |
00006a30  20 20 20 73 70 61 72 6b  63 68 61 6e 67 65 20 20  |   sparkchange  |
00006a40  20 20 20 3b 20 4f 4b 2c  20 74 69 6d 65 20 74 6f  |   ; OK, time to|
00006a50  20 6b 6e 6f 77 20 61 62  6f 75 74 20 53 70 61 72  | know about Spar|
00006a60  6b 0d 15 90 42 20 20 20  20 20 20 20 20 20 20 20  |k...B           |
00006a70  20 20 20 20 20 4c 44 52  20 20 20 20 20 52 33 2c  |     LDR     R3,|
00006a80  73 70 61 72 6b 63 6f 6d  6d 49 44 20 20 3b 20 57  |sparkcommID  ; W|
00006a90  61 73 20 53 70 61 72 6b  20 72 65 70 6c 79 69 6e  |as Spark replyin|
00006aa0  67 20 3f 0d 15 9a 21 20  20 20 20 20 20 20 20 20  |g ?...!         |
00006ab0  20 20 20 20 20 20 20 43  4d 50 20 20 20 20 20 52  |       CMP     R|
00006ac0  32 2c 52 33 0d 15 a4 4b  20 20 20 20 20 20 20 20  |2,R3...K        |
00006ad0  20 20 20 20 20 20 20 20  42 4e 45 20 20 20 20 20  |        BNE     |
00006ae0  77 68 61 74 61 62 6f 75  74 73 61 76 65 20 20 20  |whataboutsave   |
00006af0  3b 20 4e 6f 74 20 61 20  72 65 73 70 6f 6e 73 65  |; Not a response|
00006b00  20 74 6f 20 64 75 6d 6d  79 20 62 63 61 73 74 0d  | to dummy bcast.|
00006b10  15 ae 49 3b 20 41 74 20  74 68 69 73 20 70 6f 69  |..I; At this poi|
00006b20  6e 74 2c 20 72 65 63 65  69 76 65 64 20 72 65 73  |nt, received res|
00006b30  70 6f 6e 73 65 20 66 72  6f 6d 20 64 75 6d 6d 79  |ponse from dummy|
00006b40  20 53 70 61 72 6b 20 62  72 6f 61 64 63 61 73 74  | Spark broadcast|
00006b50  2c 20 73 6f 20 61 73 6b  0d 15 b8 43 3b 20 61 62  |, so ask...C; ab|
00006b60  6f 75 74 20 74 68 65 20  6e 61 6d 65 20 6d 61 74  |out the name mat|
00006b70  63 68 69 6e 67 20 74 68  65 20 74 61 73 6b 20 68  |ching the task h|
00006b80  61 6e 64 6c 65 20 28 69  6e 20 52 35 20 61 74 20  |andle (in R5 at |
00006b90  74 68 65 20 6d 6f 6d 65  6e 74 29 0d 15 c2 3d 20  |the moment)...= |
00006ba0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
00006bb0  4f 56 20 20 20 20 20 52  30 2c 23 32 34 20 20 20  |OV     R0,#24   |
00006bc0  20 20 20 20 20 20 20 3b  20 53 69 7a 65 20 3d 20  |       ; Size = |
00006bd0  32 34 20 62 79 74 65 73  0d 15 cc 3f 20 20 20 20  |24 bytes...?    |
00006be0  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 20  |            MOV |
00006bf0  20 20 20 20 52 32 2c 23  30 20 20 20 20 20 20 20  |    R2,#0       |
00006c00  20 20 20 20 3b 20 47 65  6e 65 72 61 6c 20 62 72  |    ; General br|
00006c10  6f 61 64 63 61 73 74 0d  15 d6 4d 20 20 20 20 20  |oadcast...M     |
00006c20  20 20 20 20 20 20 20 20  20 20 20 4c 44 52 20 20  |           LDR  |
00006c30  20 20 20 52 33 2c 72 65  71 74 61 73 6b 6e 61 6d  |   R3,reqtasknam|
00006c40  65 20 20 3b 20 52 65 71  75 65 73 74 20 74 61 73  |e  ; Request tas|
00006c50  6b 20 68 61 6e 64 6c 65  20 74 72 61 6e 73 6c 61  |k handle transla|
00006c60  74 69 6f 6e 0d 15 e0 3f  20 20 20 20 20 20 20 20  |tion...?        |
00006c70  20 20 20 20 20 20 20 20  53 54 52 20 20 20 20 20  |        STR     |
00006c80  52 35 2c 5b 52 31 2c 23  32 30 5d 20 20 20 20 20  |R5,[R1,#20]     |
00006c90  3b 20 53 74 6f 72 65 20  74 61 73 6b 20 68 61 6e  |; Store task han|
00006ca0  64 6c 65 0d 15 ea 28 20  20 20 20 20 20 20 20 20  |dle...(         |
00006cb0  20 20 20 20 20 20 20 42  4c 20 20 20 20 20 20 73  |       BL      s|
00006cc0  65 6e 64 61 6d 65 73 73  61 67 65 0d 15 f4 27 20  |endamessage...' |
00006cd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 42  |               B|
00006ce0  20 20 20 20 20 20 20 69  6e 74 69 67 68 74 6c 6f  |       intightlo|
00006cf0  6f 70 0d 15 fe 40 2e 77  68 61 74 61 62 6f 75 74  |op...@.whatabout|
00006d00  73 61 76 65 20 20 43 4d  50 20 20 20 20 20 52 32  |save  CMP     R2|
00006d10  2c 23 31 20 20 20 20 20  20 20 20 20 20 20 3b 20  |,#1           ; |
00006d20  44 61 74 61 53 61 76 65  20 72 65 71 75 65 73 74  |DataSave request|
00006d30  20 3f 0d 16 08 4c 20 20  20 20 20 20 20 20 20 20  | ?...L          |
00006d40  20 20 20 20 20 20 42 4e  45 20 20 20 20 20 69 6e  |      BNE     in|
00006d50  74 69 67 68 74 6c 6f 6f  70 20 20 20 20 20 3b 20  |tightloop     ; |
00006d60  28 53 70 61 72 6b 27 65  64 20 66 69 6c 65 20 6f  |(Spark'ed file o|
00006d70  6e 74 6f 20 54 72 61 73  68 20 43 61 6e 29 0d 16  |nto Trash Can)..|
00006d80  12 48 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.H              |
00006d90  20 20 43 4d 50 20 20 20  20 20 52 34 2c 52 35 20  |  CMP     R4,R5 |
00006da0  20 20 20 20 20 20 20 20  20 20 3b 20 43 68 65 63  |          ; Chec|
00006db0  6b 20 74 61 73 6b 20 68  61 6e 64 6c 65 20 69 6e  |k task handle in|
00006dc0  76 6f 6c 76 65 64 0d 16  1c 4e 20 20 20 20 20 20  |volved...N      |
00006dd0  20 20 20 20 20 20 20 20  20 20 42 4e 45 20 20 20  |          BNE   |
00006de0  20 20 69 6e 74 69 67 68  74 6c 6f 6f 70 20 20 20  |  intightloop   |
00006df0  20 20 3b 20 62 65 6c 6f  6e 67 73 20 74 6f 20 53  |  ; belongs to S|
00006e00  70 61 72 6b 20 61 6e 64  20 6e 6f 2d 6f 6e 65 20  |park and no-one |
00006e10  65 6c 73 65 0d 16 26 21  20 20 20 20 20 20 20 20  |else..&!        |
00006e20  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
00006e30  52 32 2c 52 34 0d 16 30  39 20 20 20 20 20 20 20  |R2,R4..09       |
00006e40  20 20 20 20 20 20 20 20  20 4c 44 52 20 20 20 20  |         LDR    |
00006e50  20 52 33 2c 5b 52 31 2c  23 38 5d 20 20 20 20 20  | R3,[R1,#8]     |
00006e60  20 3b 20 43 6f 70 79 20  6d 79 5f 72 65 66 0d 16  | ; Copy my_ref..|
00006e70  3a 27 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |:'              |
00006e80  20 20 53 54 52 20 20 20  20 20 52 33 2c 5b 52 31  |  STR     R3,[R1|
00006e90  2c 23 31 32 5d 0d 16 44  39 20 20 20 20 20 20 20  |,#12]..D9       |
00006ea0  20 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |         MOV    |
00006eb0  20 52 33 2c 23 32 20 20  20 20 20 20 20 20 20 20  | R3,#2          |
00006ec0  20 3b 20 44 61 74 61 53  61 76 65 41 63 6b 0d 16  | ; DataSaveAck..|
00006ed0  4e 27 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |N'              |
00006ee0  20 20 53 54 52 20 20 20  20 20 52 33 2c 5b 52 31  |  STR     R3,[R1|
00006ef0  2c 23 31 36 5d 0d 16 58  47 20 20 20 20 20 20 20  |,#16]..XG       |
00006f00  20 20 20 20 20 20 20 20  20 4d 56 4e 20 20 20 20  |         MVN    |
00006f10  20 52 33 2c 23 30 20 20  20 20 20 20 20 20 20 20  | R3,#0          |
00006f20  20 3b 20 53 65 74 20 66  69 6c 65 20 74 6f 20 27  | ; Set file to '|
00006f30  75 6e 73 61 66 65 27 20  28 2d 31 29 0d 16 62 27  |unsafe' (-1)..b'|
00006f40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006f50  53 54 52 20 20 20 20 20  52 33 2c 5b 52 31 2c 23  |STR     R3,[R1,#|
00006f60  33 36 5d 0d 16 6c 25 20  20 20 20 20 20 20 20 20  |36]..l%         |
00006f70  20 20 20 20 20 20 20 41  44 44 20 20 20 20 20 52  |       ADD     R|
00006f80  33 2c 52 31 2c 23 34 34  0d 16 76 28 20 20 20 20  |3,R1,#44..v(    |
00006f90  20 20 20 20 20 20 20 20  20 20 20 20 41 44 52 20  |            ADR |
00006fa0  20 20 20 20 52 34 2c 73  61 76 65 64 6c 65 61 66  |    R4,savedleaf|
00006fb0  0d 16 80 42 2e 73 61 76  65 74 68 65 6c 65 61 66  |...B.savetheleaf|
00006fc0  20 20 20 20 4c 44 52 42  20 20 20 20 52 35 2c 5b  |    LDRB    R5,[|
00006fd0  52 33 5d 2c 23 31 20 20  20 20 20 20 3b 20 53 61  |R3],#1      ; Sa|
00006fe0  76 65 20 73 75 67 67 65  73 74 65 64 20 53 70 61  |ve suggested Spa|
00006ff0  72 6b 0d 16 8a 44 20 20  20 20 20 20 20 20 20 20  |rk...D          |
00007000  20 20 20 20 20 20 53 54  52 42 20 20 20 20 52 35  |      STRB    R5|
00007010  2c 5b 52 34 5d 2c 23 31  20 20 20 20 20 20 3b 20  |,[R4],#1      ; |
00007020  6c 65 61 66 6e 61 6d 65  20 66 6f 72 20 75 73 65  |leafname for use|
00007030  20 6c 61 74 65 72 0d 16  94 21 20 20 20 20 20 20  | later...!      |
00007040  20 20 20 20 20 20 20 20  20 20 4d 4f 56 53 20 20  |          MOVS  |
00007050  20 20 52 35 2c 52 35 0d  16 9e 27 20 20 20 20 20  |  R5,R5...'     |
00007060  20 20 20 20 20 20 20 20  20 20 20 42 4e 45 20 20  |           BNE  |
00007070  20 20 20 73 61 76 65 74  68 65 6c 65 61 66 0d 16  |   savetheleaf..|
00007080  a8 2c 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.,              |
00007090  20 20 41 44 52 20 20 20  20 20 52 33 2c 74 65 6d  |  ADR     R3,tem|
000070a0  70 73 70 61 72 6b 6e 61  6d 65 0d 16 b2 25 20 20  |psparkname...%  |
000070b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 41 44  |              AD|
000070c0  44 20 20 20 20 20 52 34  2c 52 31 2c 23 34 34 0d  |D     R4,R1,#44.|
000070d0  16 bc 44 2e 63 6f 70 79  73 63 72 61 70 6e 61 6d  |..D.copyscrapnam|
000070e0  65 20 20 4c 44 52 42 20  20 20 20 52 35 2c 5b 52  |e  LDRB    R5,[R|
000070f0  33 5d 2c 23 31 20 20 20  20 20 20 3b 20 54 65 6d  |3],#1      ; Tem|
00007100  70 6f 72 61 72 79 20 66  69 6c 65 6e 61 6d 65 20  |porary filename |
00007110  66 6f 72 0d 16 c6 4a 20  20 20 20 20 20 20 20 20  |for...J         |
00007120  20 20 20 20 20 20 20 53  54 52 42 20 20 20 20 52  |       STRB    R|
00007130  35 2c 5b 52 34 5d 2c 23  31 20 20 20 20 20 20 3b  |5,[R4],#1      ;|
00007140  20 64 65 63 6f 6d 70 72  65 73 73 69 6f 6e 20 3d  | decompression =|
00007150  20 3c 57 69 6d 70 24 53  63 72 61 70 3e 0d 16 d0  | <Wimp$Scrap>...|
00007160  21 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |!               |
00007170  20 4d 4f 56 53 20 20 20  20 52 35 2c 52 35 0d 16  | MOVS    R5,R5..|
00007180  da 29 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.)              |
00007190  20 20 42 4e 45 20 20 20  20 20 63 6f 70 79 73 63  |  BNE     copysc|
000071a0  72 61 70 6e 61 6d 65 0d  16 e4 43 20 20 20 20 20  |rapname...C     |
000071b0  20 20 20 20 20 20 20 20  20 20 20 53 57 49 20 20  |           SWI  |
000071c0  20 20 20 22 58 57 69 6d  70 5f 53 65 6e 64 4d 65  |   "XWimp_SendMe|
000071d0  73 73 61 67 65 22 20 3b  20 53 70 61 72 6b 2d 3e  |ssage" ; Spark->|
000071e0  64 65 63 6f 6d 70 72 65  73 73 0d 16 ee 27 20 20  |decompress...'  |
000071f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 20  |              B |
00007200  20 20 20 20 20 20 69 6e  74 69 67 68 74 6c 6f 6f  |      intightloo|
00007210  70 0d 16 f8 4a 2e 73 70  61 72 6b 63 68 61 6e 67  |p...J.sparkchang|
00007220  65 20 20 20 20 42 4c 20  20 20 20 20 20 72 65 67  |e    BL      reg|
00007230  69 73 74 65 72 73 70 61  72 6b 20 20 20 3b 20 53  |isterspark   ; S|
00007240  61 76 65 20 53 70 61 72  6b 20 68 61 6e 64 6c 65  |ave Spark handle|
00007250  20 69 66 20 63 68 61 6e  67 65 64 0d 17 02 4a 20  | if changed...J |
00007260  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 42  |               B|
00007270  4c 20 20 20 20 20 20 64  75 6d 6d 79 73 70 61 72  |L      dummyspar|
00007280  6b 20 20 20 20 20 20 3b  20 52 65 2d 62 72 6f 61  |k      ; Re-broa|
00007290  64 63 61 73 74 20 69 6e  20 63 61 73 65 20 74 68  |dcast in case th|
000072a0  65 72 65 27 73 0d 17 0c  41 20 20 20 20 20 20 20  |ere's...A       |
000072b0  20 20 20 20 20 20 20 20  20 42 20 20 20 20 20 20  |         B      |
000072c0  20 69 6e 74 69 67 68 74  6c 6f 6f 70 20 20 20 20  | intightloop    |
000072d0  20 3b 20 32 20 6f 72 20  6d 6f 72 65 20 53 70 61  | ; 2 or more Spa|
000072e0  72 6b 73 2e 2e 2e 0d 17  16 46 2e 73 70 61 72 6b  |rks......F.spark|
000072f0  6d 65 73 73 69 64 20 20  20 20 45 51 55 44 20 20  |messid    EQUD  |
00007300  20 20 26 34 31 30 30 30  2b 36 30 20 20 20 20 20  |  &41000+60     |
00007310  20 20 3b 20 53 70 61 72  6b 20 73 74 61 72 74 65  |  ; Spark starte|
00007320  64 20 6d 65 73 73 61 67  65 20 49 44 0d 17 20 43  |d message ID.. C|
00007330  2e 64 79 69 6e 67 61 70  70 6d 65 73 73 20 20 20  |.dyingappmess   |
00007340  45 51 55 44 20 20 20 20  26 34 30 30 43 33 20 20  |EQUD    &400C3  |
00007350  20 20 20 20 20 20 20 20  3b 20 4d 65 73 73 61 67  |        ; Messag|
00007360  65 5f 54 61 73 6b 43 6c  6f 73 65 44 6f 77 6e 0d  |e_TaskCloseDown.|
00007370  17 2a 40 2e 72 65 71 74  61 73 6b 6e 61 6d 65 20  |.*@.reqtaskname |
00007380  20 20 20 45 51 55 44 20  20 20 20 26 34 30 30 43  |   EQUD    &400C|
00007390  36 20 20 20 20 20 20 20  20 20 20 3b 20 4d 65 73  |6          ; Mes|
000073a0  73 61 67 65 5f 54 61 73  6b 4e 61 6d 65 52 71 0d  |sage_TaskNameRq.|
000073b0  17 34 40 2e 72 65 70 74  61 73 6b 6e 61 6d 65 20  |.4@.reptaskname |
000073c0  20 20 20 45 51 55 44 20  20 20 20 26 34 30 30 43  |   EQUD    &400C|
000073d0  37 20 20 20 20 20 20 20  20 20 20 3b 20 4d 65 73  |7          ; Mes|
000073e0  73 61 67 65 5f 54 61 73  6b 4e 61 6d 65 49 73 0d  |sage_TaskNameIs.|
000073f0  17 3e 2d 2e 74 65 6d 70  73 70 61 72 6b 6e 61 6d  |.>-.tempsparknam|
00007400  65 20 20 45 51 55 53 20  20 20 20 22 3c 22 2b 77  |e  EQUS    "<"+w|
00007410  69 6d 70 24 2b 22 3e 22  2b 62 6c 24 0d 17 48 19  |imp$+">"+bl$..H.|
00007420  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007430  41 4c 49 47 4e 0d 17 52  27 2e 73 70 61 72 6b 74  |ALIGN..R'.sparkt|
00007440  61 73 6b 6e 61 6d 65 20  20 45 51 55 53 20 20 20  |askname  EQUS   |
00007450  20 22 53 70 61 72 6b 22  2b 62 6c 24 0d 17 5c 19  | "Spark"+bl$..\.|
00007460  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007470  41 4c 49 47 4e 0d 17 66  04 0d 17 70 4c 2e 63 68  |ALIGN..f...pL.ch|
00007480  65 63 6b 66 73 66 6c 61  67 20 20 20 20 4c 44 52  |eckfsflag    LDR|
00007490  42 20 20 20 20 52 31 30  2c 66 73 63 74 72 6c 66  |B    R10,fsctrlf|
000074a0  6c 61 67 20 20 3b 20 54  68 69 73 20 69 73 20 77  |lag  ; This is w|
000074b0  68 79 20 77 65 20 6e 65  65 64 20 61 6c 6c 20 72  |hy we need all r|
000074c0  65 61 73 6f 6e 0d 17 7a  4d 20 20 20 20 20 20 20  |eason..zM       |
000074d0  20 20 20 20 20 20 20 20  20 4d 4f 56 53 20 20 20  |         MOVS   |
000074e0  20 52 31 30 2c 52 31 30  20 20 20 20 20 20 20 20  | R10,R10        |
000074f0  20 3b 20 63 6f 64 65 73  20 2d 20 61 74 20 61 6e  | ; codes - at an|
00007500  79 20 74 69 6d 65 20 74  68 65 72 65 20 63 6f 75  |y time there cou|
00007510  6c 64 0d 17 84 46 20 20  20 20 20 20 20 20 20 20  |ld...F          |
00007520  20 20 20 20 20 20 42 4c  4e 45 20 20 20 20 63 68  |      BLNE    ch|
00007530  65 63 6b 63 6f 6e 74 65  6e 74 73 20 20 20 3b 20  |eckcontents   ; |
00007540  62 65 20 61 6e 20 46 53  20 61 63 74 69 6f 6e 20  |be an FS action |
00007550  63 68 61 6e 67 69 6e 67  0d 17 8e 37 20 20 20 20  |changing...7    |
00007560  20 20 20 20 20 20 20 20  20 20 20 20 42 20 20 20  |            B   |
00007570  20 20 20 20 69 6e 74 69  67 68 74 6c 6f 6f 70 20  |    intightloop |
00007580  20 20 20 20 3b 20 54 72  61 73 68 24 44 69 72 0d  |    ; Trash$Dir.|
00007590  17 98 04 0d 17 a2 25 2e  64 65 73 63 72 69 70 74  |......%.descript|
000075a0  69 6f 6e 20 20 20 20 45  51 55 53 20 20 20 20 70  |ion    EQUS    p|
000075b0  72 6f 67 24 2b 62 6c 24  0d 17 ac 19 20 20 20 20  |rog$+bl$....    |
000075c0  20 20 20 20 20 20 20 20  20 20 20 20 41 4c 49 47  |            ALIG|
000075d0  4e 0d 17 b6 1d 2e 73 70  61 72 6b 74 61 73 6b 68  |N.....sparktaskh|
000075e0  61 6e 64 20 20 45 51 55  44 20 20 20 20 30 0d 17  |and  EQUD    0..|
000075f0  c0 1d 2e 73 70 61 72 6b  77 69 6e 64 68 61 6e 64  |...sparkwindhand|
00007600  20 20 45 51 55 44 20 20  20 20 30 0d 17 ca 1d 2e  |  EQUD    0.....|
00007610  6e 6f 74 72 65 63 65 6e  74 77 69 6d 70 20 20 45  |notrecentwimp  E|
00007620  51 55 44 20 20 20 20 30  0d 17 d4 62 20 20 20 20  |QUD    0...b    |
00007630  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 53  |            EQUS|
00007640  20 20 20 20 70 72 6f 67  24 2b 22 20 72 65 71 75  |    prog$+" requ|
00007650  69 72 65 73 20 57 69 6e  64 6f 77 20 4d 61 6e 61  |ires Window Mana|
00007660  67 65 72 20 56 22 2b a4  66 72 61 63 74 69 6f 6e  |ger V"+.fraction|
00007670  28 77 69 6e 64 6d 61 6e  25 29 2b 22 20 6f 72 20  |(windman%)+" or |
00007680  6c 61 74 65 72 22 2b 62  6c 24 0d 17 de 19 20 20  |later"+bl$....  |
00007690  20 20 20 20 20 20 20 20  20 20 20 20 20 20 41 4c  |              AL|
000076a0  49 47 4e 0d 17 e8 04 0d  17 f2 09 2e 69 6e 69 74  |IGN.........init|
000076b0  0d 17 fc 04 0d 18 06 44  3b 20 54 68 69 73 20 72  |.......D; This r|
000076c0  6f 75 74 69 6e 65 20 69  73 20 63 61 6c 6c 65 64  |outine is called|
000076d0  20 77 68 65 6e 20 74 68  65 20 6d 6f 64 75 6c 65  | when the module|
000076e0  20 69 73 20 66 69 72 73  74 20 6c 6f 61 64 65 64  | is first loaded|
000076f0  2c 20 77 68 65 6e 20 61  0d 18 10 3f 3b 20 2a 52  |, when a...?; *R|
00007700  4d 52 65 49 6e 69 74 20  69 73 20 63 61 6c 6c 65  |MReInit is calle|
00007710  64 20 6f 72 20 77 68 65  6e 20 61 20 6d 61 63 68  |d or when a mach|
00007720  69 6e 65 20 72 65 73 65  74 20 69 73 20 73 69 67  |ine reset is sig|
00007730  6e 61 6c 6c 65 64 2e 0d  18 1a 04 0d 18 24 2c 20  |nalled.......$, |
00007740  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
00007750  54 4d 46 44 20 20 20 52  31 33 21 2c 7b 52 32 2c  |TMFD   R13!,{R2,|
00007760  52 33 2c 52 31 34 7d 0d  18 2e 40 20 20 20 20 20  |R3,R14}...@     |
00007770  20 20 20 20 20 20 20 20  20 20 20 42 4c 20 20 20  |           BL   |
00007780  20 20 20 69 6e 74 65 72  6e 61 6c 72 65 73 65 74  |   internalreset|
00007790  20 20 20 3b 20 4f 6e 6c  79 20 77 61 6e 74 20 74  |   ; Only want t|
000077a0  6f 20 72 65 73 65 74 0d  18 38 41 20 20 20 20 20  |o reset..8A     |
000077b0  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |           MOV  |
000077c0  20 20 20 52 33 2c 23 73  74 61 63 6b 73 70 61 63  |   R3,#stackspac|
000077d0  65 25 20 3b 20 43 6c 61  69 6d 20 52 4d 41 20 66  |e% ; Claim RMA f|
000077e0  6f 72 20 73 74 61 63 6b  0d 18 42 44 20 20 20 20  |or stack..BD    |
000077f0  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 52 20  |            LDR |
00007800  20 20 20 20 52 32 2c 77  6f 72 6b 73 70 61 63 65  |    R2,workspace|
00007810  20 20 20 20 3b 20 53 65  65 20 69 66 20 61 6c 72  |    ; See if alr|
00007820  65 61 64 79 20 63 6c 61  69 6d 65 64 0d 18 4c 21  |eady claimed..L!|
00007830  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007840  4d 4f 56 53 20 20 20 20  52 32 2c 52 32 0d 18 56  |MOVS    R2,R2..V|
00007850  24 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |$               |
00007860  20 42 4c 45 51 20 20 20  20 63 6c 61 69 6d 52 4d  | BLEQ    claimRM|
00007870  41 0d 18 60 48 20 20 20  20 20 20 20 20 20 20 20  |A..`H           |
00007880  20 20 20 20 20 41 44 44  45 51 20 20 20 52 32 2c  |     ADDEQ   R2,|
00007890  52 32 2c 52 33 20 20 20  20 20 20 20 20 3b 20 41  |R2,R3        ; A|
000078a0  64 6a 75 73 74 20 74 6f  20 65 6e 64 20 6f 66 20  |djust to end of |
000078b0  77 6f 72 6b 73 70 61 63  65 0d 18 6a 48 20 20 20  |workspace..jH   |
000078c0  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 52  |             STR|
000078d0  45 51 20 20 20 52 32 2c  77 6f 72 6b 73 70 61 63  |EQ   R2,workspac|
000078e0  65 20 20 20 20 3b 20 63  6f 73 20 73 74 61 63 6b  |e    ; cos stack|
000078f0  20 62 75 69 6c 64 73 20  64 6f 77 6e 77 61 72 64  | builds downward|
00007900  73 0d 18 74 44 20 20 20  20 20 20 20 20 20 20 20  |s..tD           |
00007910  20 20 20 20 20 ec 51 20  20 20 52 33 2c 23 77 69  |     .Q   R3,#wi|
00007920  6e 64 6f 77 73 70 61 63  65 25 3b 20 43 6c 61 69  |ndowspace%; Clai|
00007930  6d 20 52 4d 41 20 66 6f  72 20 77 69 6e 64 6f 77  |m RMA for window|
00007940  20 69 6e 66 6f 0d 18 7e  24 20 20 20 20 20 20 20  | info..~$       |
00007950  20 20 20 20 20 20 20 20  20 42 4c 45 51 20 20 20  |         BLEQ   |
00007960  20 63 6c 61 69 6d 52 4d  41 0d 18 88 2a 20 20 20  | claimRMA...*   |
00007970  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 52  |             STR|
00007980  45 51 20 20 20 52 32 2c  77 69 6e 64 6f 77 73 70  |EQ   R2,windowsp|
00007990  61 63 65 0d 18 92 49 20  20 20 20 20 20 20 20 20  |ace...I         |
000079a0  20 20 20 20 20 20 20 ec  51 20 20 20 52 33 2c 23  |       .Q   R3,#|
000079b0  73 70 72 69 74 65 73 70  61 63 65 25 3b 20 43 6c  |spritespace%; Cl|
000079c0  61 69 6d 20 52 4d 41 20  66 6f 72 20 73 70 72 69  |aim RMA for spri|
000079d0  74 65 20 77 6f 72 6b 73  70 61 63 65 0d 18 9c 24  |te workspace...$|
000079e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000079f0  42 4c 45 51 20 20 20 20  63 6c 61 69 6d 52 4d 41  |BLEQ    claimRMA|
00007a00  0d 18 a6 29 20 20 20 20  20 20 20 20 20 20 20 20  |...)            |
00007a10  20 20 20 20 53 54 52 45  51 20 20 20 52 32 2c 73  |    STREQ   R2,s|
00007a20  70 72 69 74 65 61 72 65  61 0d 18 b0 2b 20 20 20  |pritearea...+   |
00007a30  20 20 20 20 20 20 20 20  20 20 20 20 20 4c 44 4d  |             LDM|
00007a40  46 44 20 20 20 52 31 33  21 2c 7b 52 32 2c 52 33  |FD   R13!,{R2,R3|
00007a50  2c 50 43 7d 0d 18 ba 1d  2e 77 6f 72 6b 73 70 61  |,PC}.....workspa|
00007a60  63 65 20 20 20 20 20 20  45 51 55 44 20 20 20 20  |ce      EQUD    |
00007a70  30 0d 18 c4 1d 2e 77 69  6e 64 6f 77 73 70 61 63  |0.....windowspac|
00007a80  65 20 20 20 20 45 51 55  44 20 20 20 20 30 0d 18  |e    EQUD    0..|
00007a90  ce 1d 2e 73 70 72 69 74  65 61 72 65 61 20 20 20  |...spritearea   |
00007aa0  20 20 45 51 55 44 20 20  20 20 30 0d 18 d8 2f 2e  |  EQUD    0.../.|
00007ab0  73 61 76 65 64 6c 65 61  66 20 20 20 20 20 20 45  |savedleaf      E|
00007ac0  51 55 53 20 20 20 20 c4  31 31 2c 62 6c 24 29 20  |QUS    .11,bl$) |
00007ad0  3b 20 46 69 6c 65 6e 61  6d 65 0d 18 e2 19 20 20  |; Filename....  |
00007ae0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 41 4c  |              AL|
00007af0  49 47 4e 0d 18 ec 04 0d  18 f6 0f 2e 63 68 61 6e  |IGN.........chan|
00007b00  67 65 69 63 6f 6e 0d 19  00 04 0d 19 0a 47 3b 20  |geicon.......G; |
00007b10  4f 6e 20 65 6e 74 72 79  2c 20 20 20 20 20 52 31  |On entry,     R1|
00007b20  20 20 20 20 20 20 3d 20  97 20 22 31 22 20 66 6f  |      = . "1" fo|
00007b30  72 20 74 68 69 6e 20 74  72 61 73 68 20 63 61 6e  |r thin trash can|
00007b40  2c 20 97 20 22 32 22 20  66 6f 72 20 74 68 69 63  |, . "2" for thic|
00007b50  6b 0d 19 14 32 3b 20 54  68 69 73 20 72 6f 75 74  |k...2; This rout|
00007b60  69 6e 65 20 68 61 73 20  62 65 65 6e 20 61 64 64  |ine has been add|
00007b70  65 64 20 74 6f 20 56 31  2e 30 32 20 6f 6e 77 61  |ed to V1.02 onwa|
00007b80  72 64 73 0d 19 1e 4d 3b  20 45 6e 74 72 79 20 70  |rds...M; Entry p|
00007b90  61 72 61 6d 20 64 69 66  66 65 72 65 6e 74 20 69  |aram different i|
00007ba0  6e 20 56 31 2e 31 30 20  6f 6e 77 61 72 64 73 20  |n V1.10 onwards |
00007bb0  66 6f 72 20 6e 65 77 20  74 68 69 6e 20 63 61 6e  |for new thin can|
00007bc0  20 28 50 68 69 6c 69 70  20 43 6f 6c 6d 65 72 29  | (Philip Colmer)|
00007bd0  0d 19 28 36 3b 20 4e 6f  77 20 61 64 64 73 20 32  |..(6; Now adds 2|
00007be0  20 74 6f 20 52 31 20 69  66 20 53 70 61 72 6b 27  | to R1 if Spark'|
00007bf0  73 20 74 61 73 6b 20 68  61 6e 64 6c 65 20 69 73  |s task handle is|
00007c00  20 6b 6e 6f 77 6e 0d 19  32 04 0d 19 3c 2c 20 20  | known..2...<,  |
00007c10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 53 54  |              ST|
00007c20  4d 46 44 20 20 20 52 31  33 21 2c 7b 52 30 2c 52  |MFD   R13!,{R0,R|
00007c30  31 2c 52 31 34 7d 0d 19  46 4d 20 20 20 20 20 20  |1,R14}..FM      |
00007c40  20 20 20 20 20 20 20 20  20 20 4c 44 52 20 20 20  |          LDR   |
00007c50  20 20 52 30 2c 73 70 61  72 6b 74 61 73 6b 68 61  |  R0,sparktaskha|
00007c60  6e 64 3b 20 44 6f 20 77  65 20 6b 6e 6f 77 20 53  |nd; Do we know S|
00007c70  70 61 72 6b 27 73 20 68  61 6e 64 6c 65 20 79 65  |park's handle ye|
00007c80  74 20 3f 0d 19 50 21 20  20 20 20 20 20 20 20 20  |t ?..P!         |
00007c90  20 20 20 20 20 20 20 4d  4f 56 53 20 20 20 20 52  |       MOVS    R|
00007ca0  30 2c 52 30 0d 19 5a 4a  20 20 20 20 20 20 20 20  |0,R0..ZJ        |
00007cb0  20 20 20 20 20 20 20 20  41 44 44 4e 45 20 20 20  |        ADDNE   |
00007cc0  52 31 2c 52 31 2c 23 32  20 20 20 20 20 20 20 20  |R1,R1,#2        |
00007cd0  3b 20 59 65 73 2c 20 73  6f 20 75 73 65 20 27 66  |; Yes, so use 'f|
00007ce0  6c 61 73 68 79 27 20 73  70 72 69 74 65 73 0d 19  |lashy' sprites..|
00007cf0  64 2b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |d+              |
00007d00  20 20 4c 44 52 42 20 20  20 20 52 30 2c 73 70 72  |  LDRB    R0,spr|
00007d10  69 74 65 6e 61 6d 65 2b  36 0d 19 6e 4b 20 20 20  |itename+6..nK   |
00007d20  20 20 20 20 20 20 20 20  20 20 20 20 20 43 4d 50  |             CMP|
00007d30  20 20 20 20 20 52 30 2c  52 31 20 20 20 20 20 20  |     R0,R1      |
00007d40  20 20 20 20 20 3b 20 4e  6f 20 70 6f 69 6e 74 20  |     ; No point |
00007d50  69 6e 20 63 61 6c 6c 20  69 66 20 6e 6f 20 63 68  |in call if no ch|
00007d60  61 6e 67 65 0d 19 78 40  20 20 20 20 20 20 20 20  |ange..x@        |
00007d70  20 20 20 20 20 20 20 20  53 54 52 4e 45 42 20 20  |        STRNEB  |
00007d80  52 31 2c 73 70 72 69 74  65 6e 61 6d 65 2b 36 20  |R1,spritename+6 |
00007d90  3b 20 54 6f 67 67 6c 65  20 73 70 72 69 74 65 20  |; Toggle sprite |
00007da0  6e 61 6d 65 0d 19 82 2b  20 20 20 20 20 20 20 20  |name...+        |
00007db0  20 20 20 20 20 20 20 20  41 44 52 4e 45 20 20 20  |        ADRNE   |
00007dc0  52 31 2c 69 63 6f 6e 73  74 61 74 65 62 6c 6b 0d  |R1,iconstateblk.|
00007dd0  19 8c 35 3b 20 42 6f 79  20 2d 20 6d 79 20 66 61  |..5; Boy - my fa|
00007de0  76 6f 75 72 69 74 65 20  6f 70 63 6f 64 65 20 69  |vourite opcode i|
00007df0  73 20 6f 6e 20 74 68 65  20 6e 65 78 74 20 6c 69  |s on the next li|
00007e00  6e 65 20 21 0d 19 96 4d  20 20 20 20 20 20 20 20  |ne !...M        |
00007e10  20 20 20 20 20 20 20 20  53 57 49 4e 45 20 20 20  |        SWINE   |
00007e20  22 58 57 69 6d 70 5f 53  65 74 49 63 6f 6e 53 74  |"XWimp_SetIconSt|
00007e30  61 74 65 22 20 20 20 20  3b 20 49 49 49 2d 31 32  |ate"    ; III-12|
00007e40  31 31 2e 20 41 76 6f 69  64 20 73 68 75 66 66 6c  |11. Avoid shuffl|
00007e50  65 0d 19 a0 2b 20 20 20  20 20 20 20 20 20 20 20  |e...+           |
00007e60  20 20 20 20 20 4c 44 4d  46 44 20 20 20 52 31 33  |     LDMFD   R13|
00007e70  21 2c 7b 52 30 2c 52 31  2c 50 43 7d 0d 19 aa 28  |!,{R0,R1,PC}...(|
00007e80  2e 69 63 6f 6e 73 74 61  74 65 62 6c 6b 20 20 20  |.iconstateblk   |
00007e90  45 51 55 44 20 20 20 20  69 63 6f 6e 62 61 72 74  |EQUD    iconbart|
00007ea0  79 70 65 25 0d 19 b4 1d  2e 69 63 6f 6e 68 61 6e  |ype%.....iconhan|
00007eb0  64 6c 65 20 20 20 20 20  45 51 55 44 20 20 20 20  |dle     EQUD    |
00007ec0  30 0d 19 be 4a 20 20 20  20 20 20 20 20 20 20 20  |0...J           |
00007ed0  20 20 20 20 20 45 51 55  44 20 20 20 20 30 20 20  |     EQUD    0  |
00007ee0  20 20 20 20 20 3b 20 82  20 77 6f 72 64 20 20 20  |     ; . word   |
00007ef0  20 20 20 3b 20 42 6f 74  68 20 77 6f 72 64 73 20  |   ; Both words |
00007f00  73 65 74 20 74 6f 20 7a  65 72 6f 0d 19 c8 4c 20  |set to zero...L |
00007f10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 45  |               E|
00007f20  51 55 44 20 20 20 20 30  20 20 20 20 20 20 20 3b  |QUD    0       ;|
00007f30  20 43 6c 65 61 72 20 77  6f 72 64 20 20 20 20 3b  | Clear word    ;|
00007f40  20 62 65 63 61 75 73 65  20 66 6c 61 67 73 20 74  | because flags t|
00007f50  68 65 20 73 61 6d 65 0d  19 d2 04 0d 19 dc 0d 2e  |he same.........|
00007f60  6d 61 6b 65 69 63 6f 6e  0d 19 e6 04 0d 19 f0 47  |makeicon.......G|
00007f70  3b 20 4f 6e 20 65 6e 74  72 79 2c 20 20 20 20 20  |; On entry,     |
00007f80  52 31 20 20 20 20 20 20  3d 20 97 20 22 31 22 20  |R1      = . "1" |
00007f90  66 6f 72 20 74 68 69 6e  20 74 72 61 73 68 20 63  |for thin trash c|
00007fa0  61 6e 2c 20 97 20 22 32  22 20 66 6f 72 20 74 68  |an, . "2" for th|
00007fb0  69 63 6b 0d 19 fa 4b 3b  20 4e 6f 74 65 20 2d 20  |ick...K; Note - |
00007fc0  53 70 72 69 74 65 73 20  73 68 6f 75 6c 64 20 62  |Sprites should b|
00007fd0  65 20 63 61 6c 6c 65 64  20 27 21 74 72 61 73 68  |e called '!trash|
00007fe0  31 27 20 61 6e 64 20 27  21 74 72 61 73 68 32 27  |1' and '!trash2'|
00007ff0  20 2d 20 64 6f 20 ac 20  72 65 6e 61 6d 65 0d 1a  | - do . rename..|
00008000  04 4d 3b 20 45 6e 74 72  79 20 70 61 72 61 6d 20  |.M; Entry param |
00008010  64 69 66 66 65 72 65 6e  74 20 69 6e 20 56 31 2e  |different in V1.|
00008020  31 30 20 6f 6e 77 61 72  64 73 20 66 6f 72 20 6e  |10 onwards for n|
00008030  65 77 20 74 68 69 6e 20  63 61 6e 20 28 50 68 69  |ew thin can (Phi|
00008040  6c 69 70 20 43 6f 6c 6d  65 72 29 0d 1a 0e 04 0d  |lip Colmer).....|
00008050  1a 18 2c 20 20 20 20 20  20 20 20 20 20 20 20 20  |..,             |
00008060  20 20 20 53 54 4d 46 44  20 20 20 52 31 33 21 2c  |   STMFD   R13!,|
00008070  7b 52 30 2c 52 31 2c 52  31 34 7d 0d 1a 22 3e 20  |{R0,R1,R14}.."> |
00008080  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
00008090  54 52 42 20 20 20 20 52  31 2c 73 70 72 69 74 65  |TRB    R1,sprite|
000080a0  6e 61 6d 65 2b 36 20 3b  20 50 6f 6b 65 20 6e 61  |name+6 ; Poke na|
000080b0  6d 65 20 65 6e 64 69 6e  67 0d 1a 2c 29 20 20 20  |me ending..,)   |
000080c0  20 20 20 20 20 20 20 20  20 20 20 20 20 41 44 52  |             ADR|
000080d0  20 20 20 20 20 52 31 2c  73 70 72 69 74 65 6e 61  |     R1,spritena|
000080e0  6d 65 0d 1a 36 29 20 20  20 20 20 20 20 20 20 20  |me..6)          |
000080f0  20 20 20 20 20 20 53 54  52 20 20 20 20 20 52 31  |      STR     R1|
00008100  2c 70 6f 6b 65 73 70 6e  61 6d 65 0d 1a 40 28 20  |,pokespname..@( |
00008110  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 41  |               A|
00008120  44 52 20 20 20 20 20 52  31 2c 69 63 6f 6e 62 6c  |DR     R1,iconbl|
00008130  6f 63 6b 0d 1a 4a 3e 20  20 20 20 20 20 20 20 20  |ock..J>         |
00008140  20 20 20 20 20 20 20 53  57 49 20 20 20 20 20 22  |       SWI     "|
00008150  58 57 69 6d 70 5f 43 72  65 61 74 65 49 63 6f 6e  |XWimp_CreateIcon|
00008160  22 20 20 20 20 20 20 3b  20 49 49 49 2d 31 31 38  |"      ; III-118|
00008170  30 0d 1a 54 29 20 20 20  20 20 20 20 20 20 20 20  |0..T)           |
00008180  20 20 20 20 20 53 54 52  20 20 20 20 20 52 30 2c  |     STR     R0,|
00008190  69 63 6f 6e 68 61 6e 64  6c 65 0d 1a 5e 2b 20 20  |iconhandle..^+  |
000081a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |              LD|
000081b0  4d 46 44 20 20 20 52 31  33 21 2c 7b 52 30 2c 52  |MFD   R13!,{R0,R|
000081c0  31 2c 50 43 7d 0d 1a 68  47 3b 20 54 68 69 73 20  |1,PC}..hG; This |
000081d0  69 73 20 61 20 64 61 74  61 20 62 6c 6f 63 6b 20  |is a data block |
000081e0  66 6f 72 20 57 69 6d 70  5f 43 72 65 61 74 65 49  |for Wimp_CreateI|
000081f0  63 6f 6e 20 2d 20 66 69  78 65 64 20 62 79 20 50  |con - fixed by P|
00008200  68 69 6c 69 70 20 43 6f  6c 6d 65 72 0d 1a 72 45  |hilip Colmer..rE|
00008210  2e 69 63 6f 6e 62 6c 6f  63 6b 20 20 20 20 20 20  |.iconblock      |
00008220  45 51 55 44 20 20 20 20  69 63 6f 6e 62 61 72 74  |EQUD    iconbart|
00008230  79 70 65 25 20 20 20 20  3b 20 49 63 6f 6e 20 62  |ype%    ; Icon b|
00008240  61 72 20 27 73 65 72 76  69 63 65 27 20 66 6c 61  |ar 'service' fla|
00008250  67 0d 1a 7c 3b 20 20 20  20 20 20 20 20 20 20 20  |g..|;           |
00008260  20 20 20 20 20 45 51 55  44 20 20 20 20 30 20 20  |     EQUD    0  |
00008270  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 42  |             ; B|
00008280  6f 74 74 6f 6d 20 6c 65  66 74 20 58 0d 1a 86 3b  |ottom left X...;|
00008290  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000082a0  45 51 55 44 20 20 20 20  30 20 20 20 20 20 20 20  |EQUD    0       |
000082b0  20 20 20 20 20 20 20 20  3b 20 42 6f 74 74 6f 6d  |        ; Bottom|
000082c0  20 6c 65 66 74 20 59 0d  1a 90 39 20 20 20 20 20  | left Y...9     |
000082d0  20 20 20 20 20 20 20 20  20 20 20 45 51 55 44 20  |           EQUD |
000082e0  20 20 20 36 39 20 20 20  20 20 20 20 20 20 20 20  |   69           |
000082f0  20 20 20 3b 20 54 6f 70  20 72 69 67 68 74 20 58  |   ; Top right X|
00008300  0d 1a 9a 39 20 20 20 20  20 20 20 20 20 20 20 20  |...9            |
00008310  20 20 20 20 45 51 55 44  20 20 20 20 36 38 20 20  |    EQUD    68  |
00008320  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 54 6f  |            ; To|
00008330  70 20 72 69 67 68 74 20  59 0d 1a a4 3e 20 20 20  |p right Y...>   |
00008340  20 20 20 20 20 20 20 20  20 20 20 20 20 45 51 55  |             EQU|
00008350  42 20 20 20 20 25 30 30  30 30 30 30 31 30 20 20  |B    %00000010  |
00008360  20 20 20 20 20 3b 20 49  63 6f 6e 20 69 73 20 61  |     ; Icon is a|
00008370  20 73 70 72 69 74 65 0d  1a ae 47 20 20 20 20 20  | sprite...G     |
00008380  20 20 20 20 20 20 20 20  20 20 20 45 51 55 42 20  |           EQUB |
00008390  20 20 20 25 30 30 31 31  30 30 30 31 20 20 20 20  |   %00110001    |
000083a0  20 20 20 3b 20 43 6c 69  63 6b 20 6e 6f 74 69 66  |   ; Click notif|
000083b0  69 65 73 2f 49 6e 64 69  72 65 63 74 65 64 0d 1a  |ies/Indirected..|
000083c0  b8 48 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.H              |
000083d0  20 20 45 51 55 42 20 20  20 20 25 30 30 30 30 30  |  EQUB    %00000|
000083e0  30 30 30 20 20 20 20 20  20 20 3b 20 4e 6f 74 68  |000       ; Noth|
000083f0  69 6e 67 20 73 70 65 63  69 61 6c 20 61 62 6f 75  |ing special abou|
00008400  74 20 69 63 6f 6e 0d 1a  c2 46 20 20 20 20 20 20  |t icon...F      |
00008410  20 20 20 20 20 20 20 20  20 20 45 51 55 42 20 20  |          EQUB  |
00008420  20 20 25 30 30 30 30 30  30 30 31 20 20 20 20 20  |  %00000001     |
00008430  20 20 3b 20 46 6f 72 65  63 6f 6c 20 3d 20 31 2c  |  ; Forecol = 1,|
00008440  20 42 61 63 6b 63 6f 6c  20 3d 20 30 0d 1a cc 44  | Backcol = 0...D|
00008450  2e 70 6f 6b 65 73 70 6e  61 6d 65 20 20 20 20 20  |.pokespname     |
00008460  45 51 55 44 20 20 20 20  30 20 20 20 20 20 20 20  |EQUD    0       |
00008470  20 20 20 20 20 20 20 20  3b 20 50 6f 69 6e 74 65  |        ; Pointe|
00008480  72 20 74 6f 20 73 70 72  69 74 65 20 6e 61 6d 65  |r to sprite name|
00008490  0d 1a d6 45 20 20 20 20  20 20 20 20 20 20 20 20  |...E            |
000084a0  20 20 20 20 45 51 55 44  20 20 20 20 31 20 20 20  |    EQUD    1   |
000084b0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 50 6f  |            ; Po|
000084c0  69 6e 74 65 72 20 74 6f  20 57 49 4d 50 20 73 70  |inter to WIMP sp|
000084d0  72 69 74 65 73 0d 1a e0  1e 20 20 20 20 20 20 20  |rites....       |
000084e0  20 20 20 20 20 20 20 20  20 45 51 55 44 20 20 20  |         EQUD   |
000084f0  20 31 32 0d 1a ea 3a 2e  73 70 72 69 74 65 6e 61  | 12...:.spritena|
00008500  6d 65 20 20 20 20 20 45  51 55 53 20 20 20 20 22  |me     EQUS    "|
00008510  21 74 72 61 73 68 22 2b  c4 36 2c 62 6c 24 29 20  |!trash"+.6,bl$) |
00008520  3b 20 53 70 72 69 74 65  20 6e 61 6d 65 0d 1a f4  |; Sprite name...|
00008530  04 0d 1a fe 48 3b 20 27  6b 69 6c 6c 69 63 6f 6e  |....H; 'killicon|
00008540  27 20 72 6f 75 74 69 6e  65 20 72 65 6d 6f 76 65  |' routine remove|
00008550  64 20 66 72 6f 6d 20 56  31 2e 30 32 20 6f 6e 77  |d from V1.02 onw|
00008560  61 72 64 73 20 2d 20 6e  6f 20 6c 6f 6e 67 65 72  |ards - no longer|
00008570  20 72 65 71 75 69 72 65  64 0d 1b 08 04 0d 1b 12  | required.......|
00008580  0f 2e 74 72 61 70 75 70  63 61 6c 6c 0d 1b 1c 04  |..trapupcall....|
00008590  0d 1b 26 46 3b 20 54 68  61 6e 6b 73 20 74 6f 20  |..&F; Thanks to |
000085a0  50 68 69 6c 69 70 20 43  6f 6c 6d 65 72 20 66 6f  |Philip Colmer fo|
000085b0  72 20 74 68 65 20 72 65  61 73 6f 6e 20 63 6f 64  |r the reason cod|
000085c0  65 73 20 68 65 72 65 20  2d 20 74 68 65 20 6f 6c  |es here - the ol|
000085d0  64 20 50 52 4d 73 0d 1b  30 45 3b 20 6f 6e 6c 79  |d PRMs..0E; only|
000085e0  20 6c 69 73 74 20 52 30  3d 31 20 61 6e 64 20 52  | list R0=1 and R|
000085f0  30 3d 26 31 30 30 2c 20  73 6f 20 49 20 68 61 64  |0=&100, so I had|
00008600  20 6e 6f 20 69 64 65 61  20 61 62 6f 75 74 20 52  | no idea about R|
00008610  30 3d 33 20 21 20 49 2d  31 33 39 0d 1b 3a 43 3b  |0=3 ! I-139..:C;|
00008620  20 4f 6e 20 65 6e 74 72  79 2c 20 20 20 20 20 52  | On entry,     R|
00008630  30 20 20 20 20 20 20 3d  20 52 65 61 73 6f 6e 20  |0      = Reason |
00008640  63 6f 64 65 20 28 33 20  66 6f 72 20 66 69 6c 65  |code (3 for file|
00008650  20 6d 6f 64 69 66 69 63  61 74 69 6f 6e 29 0d 1b  | modification)..|
00008660  44 40 3b 20 20 20 20 20  20 20 20 20 20 20 20 20  |D@;             |
00008670  20 20 52 39 20 20 20 20  20 20 3d 20 46 69 6c 65  |  R9      = File|
00008680  20 6d 6f 64 69 66 69 63  61 74 69 6f 6e 20 72 65  | modification re|
00008690  61 73 6f 6e 20 28 69 66  20 52 30 3d 33 29 0d 1b  |ason (if R0=3)..|
000086a0  4e 04 0d 1b 58 29 20 20  20 20 20 20 20 20 20 20  |N...X)          |
000086b0  20 20 20 20 20 20 53 54  4d 46 44 20 20 20 52 31  |      STMFD   R1|
000086c0  33 21 2c 7b 52 39 2c 52  31 34 7d 0d 1b 62 4b 20  |3!,{R9,R14}..bK |
000086d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 43  |               C|
000086e0  4d 50 20 20 20 20 20 52  30 2c 23 33 20 20 20 20  |MP     R0,#3    |
000086f0  20 20 20 20 20 20 20 3b  20 4f 6e 6c 79 20 69 66  |       ; Only if|
00008700  20 6d 6f 64 69 66 69 63  61 74 69 6f 6e 20 6e 6f  | modification no|
00008710  74 69 66 69 65 64 0d 1b  6c 26 20 20 20 20 20 20  |tified..l&      |
00008720  20 20 20 20 20 20 20 20  20 20 42 4e 45 20 20 20  |          BNE   |
00008730  20 20 6e 6f 74 66 69 6c  65 6d 6f 64 0d 1b 76 37  |  notfilemod..v7|
00008740  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008750  43 4d 50 20 20 20 20 20  52 39 2c 23 30 20 20 20  |CMP     R9,#0   |
00008760  20 20 20 20 20 20 20 20  3b 20 2a 53 61 76 65 20  |        ; *Save |
00008770  28 30 29 0d 1b 80 39 20  20 20 20 20 20 20 20 20  |(0)...9         |
00008780  20 20 20 20 20 20 20 43  4d 50 4e 45 20 20 20 52  |       CMPNE   R|
00008790  39 2c 23 36 20 20 20 20  20 20 20 20 20 20 20 3b  |9,#6           ;|
000087a0  20 2a 44 65 6c 65 74 65  20 28 36 29 0d 1b 8a 39  | *Delete (6)...9|
000087b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000087c0  43 4d 50 4e 45 20 20 20  52 39 2c 23 37 20 20 20  |CMPNE   R9,#7   |
000087d0  20 20 20 20 20 20 20 20  3b 20 2a 43 72 65 61 74  |        ; *Creat|
000087e0  65 20 28 37 29 0d 1b 94  37 20 20 20 20 20 20 20  |e (7)...7       |
000087f0  20 20 20 20 20 20 20 20  20 43 4d 50 4e 45 20 20  |         CMPNE  |
00008800  20 52 39 2c 23 38 20 20  20 20 20 20 20 20 20 20  | R9,#8          |
00008810  20 3b 20 2a 43 44 69 72  20 28 38 29 0d 1b 9e 47  | ; *CDir (8)...G|
00008820  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008830  53 55 42 20 20 20 20 20  52 39 2c 52 39 2c 23 32  |SUB     R9,R9,#2|
00008840  35 36 20 20 20 20 20 20  3b 20 43 61 6e 27 74 20  |56      ; Can't |
00008850  67 65 74 20 32 35 37 20  69 6d 6d 65 64 69 61 74  |get 257 immediat|
00008860  65 6c 79 0d 1b a8 4a 20  20 20 20 20 20 20 20 20  |ely...J         |
00008870  20 20 20 20 20 20 20 43  4d 50 4e 45 20 20 20 52  |       CMPNE   R|
00008880  39 2c 23 31 20 20 20 20  20 20 20 20 20 20 20 3b  |9,#1           ;|
00008890  20 4f 70 65 6e 2f 43 72  65 61 74 65 20 66 6f 72  | Open/Create for|
000088a0  20 75 70 64 61 74 65 20  28 32 35 37 29 0d 1b b2  | update (257)...|
000088b0  47 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |G               |
000088c0  20 53 55 42 20 20 20 20  20 52 39 2c 52 39 2c 23  | SUB     R9,R9,#|
000088d0  32 35 36 20 20 20 20 20  20 3b 20 43 61 6e 27 74  |256      ; Can't|
000088e0  20 67 65 74 20 35 32 30  20 69 6d 6d 65 64 69 61  | get 520 immedia|
000088f0  74 65 6c 79 0d 1b bc 3b  20 20 20 20 20 20 20 20  |tely...;        |
00008900  20 20 20 20 20 20 20 20  43 4d 50 4e 45 20 20 20  |        CMPNE   |
00008910  52 39 2c 23 38 20 20 20  20 20 20 20 20 20 20 20  |R9,#8           |
00008920  3b 20 2a 52 65 6e 61 6d  65 20 28 35 32 30 29 0d  |; *Rename (520).|
00008930  1b c6 46 20 20 20 20 20  20 20 20 20 20 20 20 20  |..F             |
00008940  20 20 20 ec 51 20 20 20  52 39 2c 23 31 20 20 20  |   .Q   R9,#1   |
00008950  20 20 20 20 20 20 20 20  3b 20 41 6c 74 68 6f 75  |        ; Althou|
00008960  67 68 20 63 61 6e 27 74  20 62 65 20 73 75 72 65  |gh can't be sure|
00008970  2c 20 73 65 74 0d 1b d0  45 20 20 20 20 20 20 20  |, set...E       |
00008980  20 20 20 20 20 20 20 20  20 53 54 52 45 51 42 20  |         STREQB |
00008990  20 52 39 2c 66 73 63 74  72 6c 66 6c 61 67 20 20  | R9,fsctrlflag  |
000089a0  20 3b 20 63 68 61 6e 67  65 64 20 66 6c 61 67 20  | ; changed flag |
000089b0  74 6f 20 62 65 20 73 61  66 65 0d 1b da 28 2e 6e  |to be safe...(.n|
000089c0  6f 74 66 69 6c 65 6d 6f  64 20 20 20 20 20 4c 44  |otfilemod     LD|
000089d0  4d 46 44 20 20 20 52 31  33 21 2c 7b 52 39 2c 50  |MFD   R13!,{R9,P|
000089e0  43 7d 0d 1b e4 04 0d 1b  ee 12 2e 77 69 6d 70 63  |C}.........wimpc|
000089f0  6c 6f 73 65 64 6f 77 6e  0d 1b f8 04 0d 1c 02 4b  |losedown.......K|
00008a00  3b 20 54 68 69 73 20 28  68 61 6e 64 79 29 20 72  |; This (handy) r|
00008a10  6f 75 74 69 6e 65 20 77  69 6c 6c 20 6f 6e 6c 79  |outine will only|
00008a20  20 63 61 6c 6c 20 57 69  6d 70 5f 43 6c 6f 73 65  | call Wimp_Close|
00008a30  44 6f 77 6e 20 69 66 20  57 69 6d 70 5f 49 6e 69  |Down if Wimp_Ini|
00008a40  74 69 61 6c 69 73 65 0d  1c 0c 48 3b 20 68 61 64  |tialise...H; had|
00008a50  20 73 75 63 63 65 73 73  66 75 6c 6c 79 20 62 65  | successfully be|
00008a60  65 6e 20 65 78 65 63 75  74 65 64 20 28 69 2e 65  |en executed (i.e|
00008a70  2e 20 74 61 73 6b 68 61  6e 64 6c 65 20 3e 20 30  |. taskhandle > 0|
00008a80  29 2e 20 49 74 20 74 68  65 6e 20 73 65 74 73 0d  |). It then sets.|
00008a90  1c 16 49 3b 20 74 61 73  6b 68 61 6e 64 6c 65 20  |..I; taskhandle |
00008aa0  74 6f 20 30 20 74 6f 20  69 6e 64 69 63 61 74 65  |to 0 to indicate|
00008ab0  20 73 68 75 74 64 6f 77  6e 2e 20 4e 6f 74 65 20  | shutdown. Note |
00008ac0  74 68 61 74 20 57 69 6d  70 5f 43 6c 6f 73 65 44  |that Wimp_CloseD|
00008ad0  6f 77 6e 20 61 6c 73 6f  0d 1c 20 26 3b 20 68 61  |own also.. &; ha|
00008ae0  6e 64 69 6c 79 20 6b 69  6c 6c 73 20 74 68 65 20  |ndily kills the |
00008af0  69 63 6f 6e 20 62 61 72  20 69 63 6f 6e 2e 0d 1c  |icon bar icon...|
00008b00  2a 04 0d 1c 34 2c 20 20  20 20 20 20 20 20 20 20  |*...4,          |
00008b10  20 20 20 20 20 20 53 54  4d 46 44 20 20 20 52 31  |      STMFD   R1|
00008b20  33 21 2c 7b 52 30 2d 52  32 2c 52 31 34 7d 0d 1c  |3!,{R0-R2,R14}..|
00008b30  3e 49 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |>I              |
00008b40  20 20 4c 44 52 20 20 20  20 20 52 30 2c 74 61 73  |  LDR     R0,tas|
00008b50  6b 68 61 6e 64 6c 65 20  20 20 20 20 20 20 20 20  |khandle         |
00008b60  20 20 3b 20 49 73 20 74  61 73 6b 68 61 6e 64 6c  |  ; Is taskhandl|
00008b70  65 20 3e 20 30 20 3f 0d  1c 48 21 20 20 20 20 20  |e > 0 ?..H!     |
00008b80  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 53 20  |           MOVS |
00008b90  20 20 20 52 30 2c 52 30  0d 1c 52 27 20 20 20 20  |   R0,R0..R'    |
00008ba0  20 20 20 20 20 20 20 20  20 20 20 20 42 4c 45 20  |            BLE |
00008bb0  20 20 20 20 64 6f 72 6d  61 6e 74 74 61 73 6b 0d  |    dormanttask.|
00008bc0  1c 5c 45 20 20 20 20 20  20 20 20 20 20 20 20 20  |.\E             |
00008bd0  20 20 20 42 4c 20 20 20  20 20 20 6e 6f 74 72 61  |   BL      notra|
00008be0  73 68 77 69 6e 64 20 20  20 20 20 3b 20 52 65 6d  |shwind     ; Rem|
00008bf0  6f 76 65 20 54 72 61 73  68 20 43 61 6e 20 57 69  |ove Trash Can Wi|
00008c00  6e 64 6f 77 0d 1c 66 3d  20 20 20 20 20 20 20 20  |ndow..f=        |
00008c10  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
00008c20  52 30 2c 23 55 70 43 61  6c 6c 56 20 20 20 20 20  |R0,#UpCallV     |
00008c30  3b 20 52 65 6c 65 61 73  65 20 55 70 43 61 6c 6c  |; Release UpCall|
00008c40  56 0d 1c 70 29 20 20 20  20 20 20 20 20 20 20 20  |V..p)           |
00008c50  20 20 20 20 20 41 44 52  20 20 20 20 20 52 31 2c  |     ADR     R1,|
00008c60  74 72 61 70 75 70 63 61  6c 6c 0d 1c 7a 21 20 20  |trapupcall..z!  |
00008c70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4d 4f  |              MO|
00008c80  56 20 20 20 20 20 52 32  2c 23 30 0d 1c 84 32 20  |V     R2,#0...2 |
00008c90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
00008ca0  57 49 20 20 20 20 20 22  58 4f 53 5f 52 65 6c 65  |WI     "XOS_Rele|
00008cb0  61 73 65 22 20 20 20 3b  20 49 2d 35 39 0d 1c 8e  |ase"   ; I-59...|
00008cc0  4a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |J               |
00008cd0  20 42 4c 20 20 20 20 20  20 63 68 65 63 6b 66 6f  | BL      checkfo|
00008ce0  72 72 65 64 20 20 20 20  20 3b 20 52 65 6d 6f 76  |rred     ; Remov|
00008cf0  65 20 72 65 64 20 62 6f  72 64 65 72 20 69 66 20  |e red border if |
00008d00  70 72 65 73 65 6e 74 0d  1c 98 29 20 20 20 20 20  |present...)     |
00008d10  20 20 20 20 20 20 20 20  20 20 20 4c 44 52 20 20  |           LDR  |
00008d20  20 20 20 52 30 2c 74 61  73 6b 68 61 6e 64 6c 65  |   R0,taskhandle|
00008d30  0d 1c a2 2b 20 20 20 20  20 20 20 20 20 20 20 20  |...+            |
00008d40  20 20 20 20 4c 44 52 20  20 20 20 20 52 31 2c 74  |    LDR     R1,t|
00008d50  61 73 6b 63 6f 6e 73 74  61 6e 74 0d 1c ac 47 20  |askconstant...G |
00008d60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
00008d70  57 49 20 20 20 20 20 22  58 57 69 6d 70 5f 43 6c  |WI     "XWimp_Cl|
00008d80  6f 73 65 44 6f 77 6e 22  20 3b 20 53 68 75 74 64  |oseDown" ; Shutd|
00008d90  6f 77 6e 20 74 61 73 6b  2e 20 49 49 49 2d 31 32  |own task. III-12|
00008da0  34 31 0d 1c b6 21 2e 64  6f 72 6d 61 6e 74 74 61  |41...!.dormantta|
00008db0  73 6b 20 20 20 20 4d 4f  56 20 20 20 20 20 52 30  |sk    MOV     R0|
00008dc0  2c 23 30 0d 1c c0 3f 20  20 20 20 20 20 20 20 20  |,#0...?         |
00008dd0  20 20 20 20 20 20 20 53  54 52 20 20 20 20 20 52  |       STR     R|
00008de0  30 2c 69 63 6f 6e 68 61  6e 64 6c 65 20 20 20 3b  |0,iconhandle   ;|
00008df0  20 43 6c 65 61 72 20 69  63 6f 6e 20 68 61 6e 64  | Clear icon hand|
00008e00  6c 65 0d 1c ca 3f 20 20  20 20 20 20 20 20 20 20  |le...?          |
00008e10  20 20 20 20 20 20 53 54  52 20 20 20 20 20 52 30  |      STR     R0|
00008e20  2c 74 61 73 6b 68 61 6e  64 6c 65 20 20 20 3b 20  |,taskhandle   ; |
00008e30  43 6c 65 61 72 20 74 61  73 6b 20 68 61 6e 64 6c  |Clear task handl|
00008e40  65 0d 1c d4 40 20 20 20  20 20 20 20 20 20 20 20  |e...@           |
00008e50  20 20 20 20 20 53 54 52  20 20 20 20 20 52 30 2c  |     STR     R0,|
00008e60  73 70 61 72 6b 74 61 73  6b 68 61 6e 64 3b 20 43  |sparktaskhand; C|
00008e70  6c 65 61 72 20 53 70 61  72 6b 20 68 61 6e 64 6c  |lear Spark handl|
00008e80  65 0d 1c de 4c 20 20 20  20 20 20 20 20 20 20 20  |e...L           |
00008e90  20 20 20 20 20 53 54 52  20 20 20 20 20 52 30 2c  |     STR     R0,|
00008ea0  74 65 6d 70 6c 61 74 65  68 61 6e 64 6c 65 20 3b  |templatehandle ;|
00008eb0  20 54 65 6d 70 6c 61 74  65 73 20 77 69 6c 6c 20  | Templates will |
00008ec0  6e 65 65 64 20 61 20 72  65 6c 6f 61 64 0d 1c e8  |need a reload...|
00008ed0  3f 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |?               |
00008ee0  20 53 54 52 42 20 20 20  20 52 30 2c 6d 6f 64 69  | STRB    R0,modi|
00008ef0  66 69 65 64 62 6f 72 64  20 3b 20 4e 6f 20 72 65  |fiedbord ; No re|
00008f00  64 20 62 6f 72 64 65 72  20 79 65 74 0d 1c f2 2b  |d border yet...+|
00008f10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008f20  4c 44 4d 46 44 20 20 20  52 31 33 21 2c 7b 52 30  |LDMFD   R13!,{R0|
00008f30  2d 52 32 2c 50 43 7d 0d  1c fc 40 2e 74 61 73 6b  |-R2,PC}...@.task|
00008f40  63 6f 6e 73 74 61 6e 74  20 20 20 45 51 55 53 20  |constant   EQUS |
00008f50  20 20 20 22 54 41 53 4b  22 20 20 3b 20 53 70 65  |   "TASK"  ; Spe|
00008f60  63 69 61 6c 20 66 6f 75  72 2d 6c 65 74 74 65 72  |cial four-letter|
00008f70  20 77 6f 72 64 20 21 0d  1d 06 4c 2e 74 61 73 6b  | word !...L.task|
00008f80  68 61 6e 64 6c 65 20 20  20 20 20 45 51 55 44 20  |handle     EQUD |
00008f90  20 20 20 30 20 20 20 20  20 20 20 3b 20 57 69 6d  |   0       ; Wim|
00008fa0  70 20 74 61 73 6b 20 68  61 6e 64 6c 65 20 28 61  |p task handle (a|
00008fb0  6c 73 6f 20 75 73 65 64  20 61 73 20 61 20 66 6c  |lso used as a fl|
00008fc0  61 67 29 0d 1d 10 04 0d  1d 1a 0e 2e 70 65 65 70  |ag).........peep|
00008fd0  69 6e 63 61 6e 0d 1d 24  04 0d 1d 2e 4a 3b 20 57  |incan..$....J; W|
00008fe0  61 6e 74 20 74 6f 20 68  61 76 65 20 61 20 6c 6f  |ant to have a lo|
00008ff0  6f 6b 20 69 6e 73 69 64  65 20 74 72 61 73 68 20  |ok inside trash |
00009000  63 61 6e 2c 20 73 6f 20  63 72 65 61 74 65 20 74  |can, so create t|
00009010  68 65 20 64 69 72 65 63  74 6f 72 79 20 69 66 20  |he directory if |
00009020  6e 6f 74 0d 1d 38 40 3b  20 61 6c 72 65 61 64 79  |not..8@; already|
00009030  20 74 68 65 72 65 20 61  6e 64 20 75 73 65 20 74  | there and use t|
00009040  68 65 20 46 69 6c 65 72  20 74 6f 20 63 72 65 61  |he Filer to crea|
00009050  74 65 20 61 20 6e 65 77  20 57 69 6d 70 20 74 61  |te a new Wimp ta|
00009060  73 6b 2e 0d 1d 42 04 0d  1d 4c 29 20 20 20 20 20  |sk...B...L)     |
00009070  20 20 20 20 20 20 20 20  20 20 20 53 54 4d 46 44  |           STMFD|
00009080  20 20 20 52 31 33 21 2c  7b 52 30 2c 52 31 34 7d  |   R13!,{R0,R14}|
00009090  0d 1d 56 47 20 20 20 20  20 20 20 20 20 20 20 20  |..VG            |
000090a0  20 20 20 20 42 4c 20 20  20 20 20 20 63 61 6e 65  |    BL      cane|
000090b0  78 69 73 74 73 20 20 20  20 20 20 20 3b 20 4d 61  |xists       ; Ma|
000090c0  6b 65 20 73 75 72 65 20  54 72 61 73 68 24 44 69  |ke sure Trash$Di|
000090d0  72 20 69 73 20 4f 4b 0d  1d 60 04 0d 1d 6a 49 3b  |r is OK..`...jI;|
000090e0  20 53 74 75 70 69 64 20  2a 46 69 6c 65 72 5f 4f  | Stupid *Filer_O|
000090f0  70 65 6e 44 69 72 20 3c  64 69 72 3e 20 64 6f 65  |penDir <dir> doe|
00009100  73 6e 27 74 20 74 72 61  6e 73 6c 61 74 65 20 65  |sn't translate e|
00009110  6e 76 69 72 6f 6e 6d 65  6e 74 61 6c 20 76 61 72  |nvironmental var|
00009120  73 20 21 21 0d 1d 74 27  3b 20 48 65 6e 63 65 20  |s !!..t'; Hence |
00009130  6d 75 73 74 20 75 73 65  20 74 72 61 6e 73 6c 61  |must use transla|
00009140  74 65 64 20 62 75 66 66  65 72 2e 0d 1d 7e 04 0d  |ted buffer...~..|
00009150  1d 88 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |..*             |
00009160  20 20 20 41 44 52 20 20  20 20 20 52 30 2c 73 74  |   ADR     R0,st|
00009170  61 72 74 75 70 77 69 6e  64 0d 1d 92 3a 20 20 20  |artupwind...:   |
00009180  20 20 20 20 20 20 20 20  20 20 20 20 20 53 57 49  |             SWI|
00009190  20 20 20 20 20 22 58 57  69 6d 70 5f 53 74 61 72  |     "XWimp_Star|
000091a0  74 54 61 73 6b 22 20 20  20 3b 20 49 49 49 2d 31  |tTask"   ; III-1|
000091b0  32 34 32 0d 1d 9c 28 20  20 20 20 20 20 20 20 20  |242...(         |
000091c0  20 20 20 20 20 20 20 4c  44 4d 46 44 20 20 20 52  |       LDMFD   R|
000091d0  31 33 21 2c 7b 52 30 2c  50 43 7d 0d 1d a6 04 0d  |13!,{R0,PC}.....|
000091e0  1d b0 11 2e 72 65 61 64  74 72 61 73 68 64 69 72  |....readtrashdir|
000091f0  0d 1d ba 04 0d 1d c4 4c  3b 20 4f 6e 20 65 6e 74  |.......L; On ent|
00009200  72 79 2c 20 20 20 20 20  52 31 20 20 20 20 20 20  |ry,     R1      |
00009210  3d 20 41 64 64 72 65 73  73 20 6f 66 20 62 75 66  |= Address of buf|
00009220  66 65 72 20 74 6f 20 73  74 6f 72 65 20 54 72 61  |fer to store Tra|
00009230  73 68 24 44 69 72 20 65  78 70 61 6e 73 69 6f 6e  |sh$Dir expansion|
00009240  0d 1d ce 45 3b 20 4d 55  53 54 20 68 61 76 65 20  |...E; MUST have |
00009250  54 72 61 73 68 24 44 69  72 20 64 65 66 69 6e 65  |Trash$Dir define|
00009260  64 20 61 74 20 61 6c 6c  20 74 69 6d 65 73 2c 20  |d at all times, |
00009270  6f 74 68 65 72 77 69 73  65 20 66 61 74 61 6c 20  |otherwise fatal |
00009280  65 72 72 6f 72 0d 1d d8  04 0d 1d e2 2c 20 20 20  |error.......,   |
00009290  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 4d  |             STM|
000092a0  46 44 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 34  |FD   R13!,{R0-R4|
000092b0  2c 52 31 34 7d 0d 1d ec  21 20 20 20 20 20 20 20  |,R14}...!       |
000092c0  20 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |         MOV    |
000092d0  20 52 30 2c 23 30 0d 1d  f6 28 20 20 20 20 20 20  | R0,#0...(      |
000092e0  20 20 20 20 20 20 20 20  20 20 53 54 52 42 20 20  |          STRB  |
000092f0  20 20 52 30 2c 70 6f 6b  65 74 72 61 73 68 0d 1e  |  R0,poketrash..|
00009300  00 29 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.)              |
00009310  20 20 41 44 52 20 20 20  20 20 52 30 2c 70 6c 61  |  ADR     R0,pla|
00009320  69 6e 74 72 61 73 68 0d  1e 0a 4b 20 20 20 20 20  |intrash...K     |
00009330  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |           MOV  |
00009340  20 20 20 52 32 2c 23 6d  61 78 70 61 74 68 6c 65  |   R2,#maxpathle|
00009350  6e 25 2d 31 20 20 20 20  20 20 20 3b 20 52 65 64  |n%-1       ; Red|
00009360  75 63 65 64 20 62 79 20  31 20 28 52 61 62 69 6e  |uced by 1 (Rabin|
00009370  29 2e 0d 1e 14 21 20 20  20 20 20 20 20 20 20 20  |)....!          |
00009380  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 52 33  |      MOV     R3|
00009390  2c 23 30 0d 1e 1e 21 20  20 20 20 20 20 20 20 20  |,#0...!         |
000093a0  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
000093b0  34 2c 23 30 0d 1e 28 3c  20 20 20 20 20 20 20 20  |4,#0..(<        |
000093c0  20 20 20 20 20 20 20 20  53 57 49 20 20 20 20 20  |        SWI     |
000093d0  22 58 4f 53 5f 52 65 61  64 56 61 72 56 61 6c 22  |"XOS_ReadVarVal"|
000093e0  20 20 20 20 20 20 20 20  3b 20 49 49 2d 37 35 30  |        ; II-750|
000093f0  0d 1e 32 21 20 20 20 20  20 20 20 20 20 20 20 20  |..2!            |
00009400  20 20 20 20 4d 4f 56 56  43 20 20 20 52 30 2c 23  |    MOVVC   R0,#|
00009410  30 0d 1e 3c 4c 20 20 20  20 20 20 20 20 20 20 20  |0..<L           |
00009420  20 20 20 20 20 53 54 52  56 43 42 20 20 52 30 2c  |     STRVCB  R0,|
00009430  5b 52 31 2c 52 32 5d 20  20 20 20 20 20 3b 20 41  |[R1,R2]      ; A|
00009440  64 64 20 61 20 7a 65 72  6f 20 74 65 72 6d 69 6e  |dd a zero termin|
00009450  61 74 6f 72 20 28 52 61  62 69 6e 29 2e 0d 1e 46  |ator (Rabin)...F|
00009460  2b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |+               |
00009470  20 4c 44 4d 56 43 46 44  20 52 31 33 21 2c 7b 52  | LDMVCFD R13!,{R|
00009480  30 2d 52 34 2c 50 43 7d  0d 1e 50 33 3b 20 54 68  |0-R4,PC}..P3; Th|
00009490  69 73 20 73 65 63 74 69  6f 6e 20 72 65 76 61 6d  |is section revam|
000094a0  70 65 64 20 62 79 20 52  61 62 69 6e 20 45 7a 72  |ped by Rabin Ezr|
000094b0  61 2e 20 54 68 61 6e 6b  73 20 21 0d 1e 5a 41 20  |a. Thanks !..ZA |
000094c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
000094d0  4f 56 53 20 20 20 20 52  32 2c 52 32 20 20 20 20  |OVS    R2,R2    |
000094e0  20 20 20 20 20 20 20 3b  20 49 73 20 65 72 72 6f  |       ; Is erro|
000094f0  72 20 6f 76 65 72 66 6c  6f 77 20 3f 0d 1e 64 2b  |r overflow ?..d+|
00009500  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00009510  41 44 52 45 51 20 20 20  52 30 2c 75 6e 64 65 66  |ADREQ   R0,undef|
00009520  69 6e 65 64 76 61 72 0d  1e 6e 29 20 20 20 20 20  |inedvar..n)     |
00009530  20 20 20 20 20 20 20 20  20 20 20 41 44 52 4e 45  |           ADRNE|
00009540  20 20 20 52 30 2c 76 61  72 74 6f 6f 6c 6f 6e 67  |   R0,vartoolong|
00009550  0d 1e 78 2e 20 20 20 20  20 20 20 20 20 20 20 20  |..x.            |
00009560  20 20 20 20 53 57 49 20  20 20 20 20 22 4f 53 5f  |    SWI     "OS_|
00009570  47 65 6e 65 72 61 74 65  45 72 72 6f 72 22 0d 1e  |GenerateError"..|
00009580  82 29 2e 70 6c 61 69 6e  74 72 61 73 68 20 20 20  |.).plaintrash   |
00009590  20 20 45 51 55 53 20 20  20 20 74 72 61 73 68 76  |  EQUS    trashv|
000095a0  61 72 24 2b 62 6c 24 0d  1e 8c 3e 2e 73 74 61 72  |ar$+bl$...>.star|
000095b0  74 75 70 77 69 6e 64 20  20 20 20 45 51 55 53 20  |tupwind    EQUS |
000095c0  20 20 20 22 46 69 6c 65  72 5f 4f 70 65 6e 44 69  |   "Filer_OpenDi|
000095d0  72 20 22 20 20 20 20 20  20 20 20 3b 20 49 49 49  |r "        ; III|
000095e0  2d 31 32 39 32 0d 1e 96  2d 2e 74 72 61 73 68 6f  |-1292...-.trasho|
000095f0  70 65 6e 62 75 66 66 20  20 45 51 55 53 20 20 20  |penbuff  EQUS   |
00009600  20 c4 6d 61 78 70 61 74  68 6c 65 6e 25 2c 62 6c  | .maxpathlen%,bl|
00009610  24 29 0d 1e a0 3e 2e 63  6c 6f 73 65 64 6f 77 6e  |$)...>.closedown|
00009620  77 69 6e 64 20 20 45 51  55 53 20 20 20 20 22 46  |wind  EQUS    "F|
00009630  69 6c 65 72 5f 43 6c 6f  73 65 44 69 72 20 22 20  |iler_CloseDir " |
00009640  20 20 20 20 20 20 3b 20  49 49 49 2d 31 32 39 31  |      ; III-1291|
00009650  0d 1e aa 2d 2e 74 72 61  73 68 63 6c 6f 73 65 62  |...-.trashcloseb|
00009660  75 66 66 20 45 51 55 53  20 20 20 20 c4 6d 61 78  |uff EQUS    .max|
00009670  70 61 74 68 6c 65 6e 25  2c 62 6c 24 29 0d 1e b4  |pathlen%,bl$)...|
00009680  19 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00009690  20 41 4c 49 47 4e 0d 1e  be 1d 2e 76 61 72 74 6f  | ALIGN.....varto|
000096a0  6f 6c 6f 6e 67 20 20 20  20 20 45 51 55 44 20 20  |olong     EQUD  |
000096b0  20 20 30 0d 1e c8 6f 20  20 20 20 20 20 20 20 20  |  0...o         |
000096c0  20 20 20 20 20 20 20 45  51 55 53 20 20 20 20 74  |       EQUS    t|
000096d0  72 61 73 68 76 61 72 24  2b 22 20 65 6e 76 69 72  |rashvar$+" envir|
000096e0  6f 6e 6d 65 6e 74 61 6c  20 76 61 72 69 61 62 6c  |onmental variabl|
000096f0  65 20 6c 6f 6e 67 65 72  20 74 68 61 6e 20 22 2b  |e longer than "+|
00009700  c3 28 6d 61 78 70 61 74  68 6c 65 6e 25 2d 31 29  |.(maxpathlen%-1)|
00009710  2b 22 20 63 68 61 72 61  63 74 65 72 73 22 2b 62  |+" characters"+b|
00009720  6c 24 0d 1e d2 19 20 20  20 20 20 20 20 20 20 20  |l$....          |
00009730  20 20 20 20 20 20 41 4c  49 47 4e 0d 1e dc 1d 2e  |      ALIGN.....|
00009740  75 6e 64 65 66 69 6e 65  64 76 61 72 20 20 20 45  |undefinedvar   E|
00009750  51 55 44 20 20 20 20 30  0d 1e e6 4d 20 20 20 20  |QUD    0...M    |
00009760  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 53  |            EQUS|
00009770  20 20 20 20 74 72 61 73  68 76 61 72 24 2b 22 20  |    trashvar$+" |
00009780  65 6e 76 69 72 6f 6e 6d  65 6e 74 61 6c 20 76 61  |environmental va|
00009790  72 69 61 62 6c 65 20 75  6e 64 65 66 69 6e 65 64  |riable undefined|
000097a0  22 2b 62 6c 24 0d 1e f0  1d 2e 66 73 63 74 72 6c  |"+bl$.....fsctrl|
000097b0  66 6c 61 67 20 20 20 20  20 45 51 55 42 20 20 20  |flag     EQUB   |
000097c0  20 30 0d 1e fa 1d 2e 67  6c 61 73 73 73 74 61 74  | 0.....glassstat|
000097d0  20 20 20 20 20 20 45 51  55 42 20 20 20 20 30 0d  |      EQUB    0.|
000097e0  1f 04 1d 2e 43 4d 4f 53  62 79 74 65 20 20 20 20  |....CMOSbyte    |
000097f0  20 20 20 45 51 55 42 20  20 20 20 30 0d 1f 05 1d  |   EQUB    0....|
00009800  2e 64 72 61 67 73 74 61  74 65 20 20 20 20 20 20  |.dragstate      |
00009810  45 51 55 42 20 20 20 20  30 0d 1f 0e 19 20 20 20  |EQUB    0....   |
00009820  20 20 20 20 20 20 20 20  20 20 20 20 20 41 4c 49  |             ALI|
00009830  47 4e 0d 1f 18 04 0d 1f  22 2c 2e 6e 6f 74 72 61  |GN......",.notra|
00009840  73 68 77 69 6e 64 20 20  20 20 53 54 4d 46 44 20  |shwind    STMFD |
00009850  20 20 52 31 33 21 2c 7b  52 30 2c 52 31 2c 52 31  |  R13!,{R0,R1,R1|
00009860  34 7d 0d 1f 2c 2d 20 20  20 20 20 20 20 20 20 20  |4}..,-          |
00009870  20 20 20 20 20 20 41 44  52 20 20 20 20 20 52 31  |      ADR     R1|
00009880  2c 74 72 61 73 68 63 6c  6f 73 65 62 75 66 66 0d  |,trashclosebuff.|
00009890  1f 36 43 20 20 20 20 20  20 20 20 20 20 20 20 20  |.6C             |
000098a0  20 20 20 42 4c 20 20 20  20 20 20 72 65 61 64 74  |   BL      readt|
000098b0  72 61 73 68 64 69 72 20  20 20 20 20 20 20 20 20  |rashdir         |
000098c0  20 20 20 3b 20 47 65 74  20 54 72 61 73 68 24 44  |   ; Get Trash$D|
000098d0  69 72 0d 1f 40 04 0d 1f  4a 47 3b 20 4e 6f 74 65  |ir..@...JG; Note|
000098e0  20 74 68 61 74 20 62 65  63 61 75 73 65 20 74 68  | that because th|
000098f0  65 20 57 69 6d 70 20 6d  61 79 20 61 6c 72 65 61  |e Wimp may alrea|
00009900  64 79 20 62 65 20 70 61  72 74 69 61 6c 6c 79 20  |dy be partially |
00009910  73 68 75 74 20 64 6f 77  6e 2c 20 77 65 0d 1f 54  |shut down, we..T|
00009920  3f 3b 20 63 61 6e 27 74  20 75 73 65 20 58 57 69  |?; can't use XWi|
00009930  6d 70 5f 53 74 61 72 74  54 61 73 6b 20 69 6e 20  |mp_StartTask in |
00009940  74 68 69 73 20 73 65 63  74 69 6f 6e 2c 20 73 6f  |this section, so|
00009950  20 75 73 65 20 58 4f 53  5f 43 4c 49 0d 1f 5e 04  | use XOS_CLI..^.|
00009960  0d 1f 68 2c 20 20 20 20  20 20 20 20 20 20 20 20  |..h,            |
00009970  20 20 20 20 41 44 52 20  20 20 20 20 52 30 2c 63  |    ADR     R0,c|
00009980  6c 6f 73 65 64 6f 77 6e  77 69 6e 64 0d 1f 72 4b  |losedownwind..rK|
00009990  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000099a0  53 57 49 20 20 20 20 20  22 58 4f 53 5f 43 4c 49  |SWI     "XOS_CLI|
000099b0  22 20 20 20 20 20 20 20  3b 20 53 68 75 74 64 6f  |"       ; Shutdo|
000099c0  77 6e 20 54 72 61 73 68  20 77 69 6e 64 6f 77 2e  |wn Trash window.|
000099d0  20 49 49 2d 36 31 39 0d  1f 7c 2b 20 20 20 20 20  | II-619..|+     |
000099e0  20 20 20 20 20 20 20 20  20 20 20 4c 44 4d 46 44  |           LDMFD|
000099f0  20 20 20 52 31 33 21 2c  7b 52 30 2c 52 31 2c 50  |   R13!,{R0,R1,P|
00009a00  43 7d 0d 1f 86 04 0d 1f  90 12 2e 63 68 65 63 6b  |C}.........check|
00009a10  63 6f 6e 74 65 6e 74 73  0d 1f 9a 04 0d 1f a4 49  |contents.......I|
00009a20  3b 20 4f 6e 20 65 6e 74  72 79 2c 20 20 20 20 20  |; On entry,     |
00009a30  52 31 30 20 20 20 20 20  3d 20 30 20 69 66 20 77  |R10     = 0 if w|
00009a40  61 6e 74 20 74 6f 20 63  72 65 61 74 65 20 69 63  |ant to create ic|
00009a50  6f 6e 2c 20 3c 3e 20 30  20 74 6f 20 75 70 64 61  |on, <> 0 to upda|
00009a60  74 65 20 69 74 0d 1f ae  48 3b 20 57 61 6e 74 20  |te it...H; Want |
00009a70  74 6f 20 64 65 63 69 64  65 20 77 68 61 74 20 69  |to decide what i|
00009a80  63 6f 6e 20 74 6f 20 70  75 74 20 6f 6e 20 69 63  |con to put on ic|
00009a90  6f 6e 20 62 61 72 2c 20  73 6f 20 63 68 65 63 6b  |on bar, so check|
00009aa0  20 74 68 65 20 63 6f 6e  74 65 6e 74 73 0d 1f b8  | the contents...|
00009ab0  4c 3b 20 6f 66 20 3c 54  72 61 73 68 24 44 69 72  |L; of <Trash$Dir|
00009ac0  3e 2e 20 49 66 20 74 68  65 20 65 6e 76 2e 20 76  |>. If the env. v|
00009ad0  61 72 69 61 62 6c 65 20  64 6f 65 73 6e 27 74 20  |ariable doesn't |
00009ae0  65 78 69 73 74 2c 20 6f  72 20 74 68 65 20 64 69  |exist, or the di|
00009af0  72 20 64 6f 65 73 6e 27  74 0d 1f c2 3f 3b 20 65  |r doesn't...?; e|
00009b00  78 69 73 74 20 6f 72 20  74 68 65 72 65 27 73 20  |xist or there's |
00009b10  6e 6f 74 68 69 6e 67 20  69 6e 20 74 68 65 20 64  |nothing in the d|
00009b20  69 72 2c 20 74 68 65 6e  20 74 72 61 73 68 20 69  |ir, then trash i|
00009b30  73 20 65 6d 70 74 79 2e  0d 1f cc 04 0d 1f d6 2c  |s empty........,|
00009b40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00009b50  53 54 4d 46 44 20 20 20  52 31 33 21 2c 7b 52 30  |STMFD   R13!,{R0|
00009b60  2d 52 33 2c 52 31 34 7d  0d 1f e0 2c 20 20 20 20  |-R3,R14}...,    |
00009b70  20 20 20 20 20 20 20 20  20 20 20 20 41 44 52 20  |            ADR |
00009b80  20 20 20 20 52 31 2c 74  72 61 73 68 6f 70 65 6e  |    R1,trashopen|
00009b90  62 75 66 66 0d 1f ea 3d  20 20 20 20 20 20 20 20  |buff...=        |
00009ba0  20 20 20 20 20 20 20 20  42 4c 20 20 20 20 20 20  |        BL      |
00009bb0  72 65 61 64 74 72 61 73  68 64 69 72 20 20 20 20  |readtrashdir    |
00009bc0  3b 20 54 72 61 73 68 24  44 69 72 20 63 68 65 63  |; Trash$Dir chec|
00009bd0  6b 0d 1f f4 24 20 20 20  20 20 20 20 20 20 20 20  |k...$           |
00009be0  20 20 20 20 20 4d 4f 56  20 20 20 20 20 52 30 2c  |     MOV     R0,|
00009bf0  23 97 22 2e 22 0d 1f fe  28 20 20 20 20 20 20 20  |#."."...(       |
00009c00  20 20 20 20 20 20 20 20  20 53 54 52 42 20 20 20  |         STRB   |
00009c10  20 52 30 2c 70 6f 6b 65  74 72 61 73 68 0d 20 08  | R0,poketrash. .|
00009c20  21 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |!               |
00009c30  20 4d 4f 56 20 20 20 20  20 52 30 2c 23 35 0d 20  | MOV     R0,#5. |
00009c40  12 28 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.(              |
00009c50  20 20 41 44 52 20 20 20  20 20 52 31 2c 74 72 61  |  ADR     R1,tra|
00009c60  73 68 62 69 74 73 0d 20  1c 4a 20 20 20 20 20 20  |shbits. .J      |
00009c70  20 20 20 20 20 20 20 20  20 20 53 57 49 20 20 20  |          SWI   |
00009c80  20 20 22 58 4f 53 5f 46  69 6c 65 22 20 3b 20 41  |  "XOS_File" ; A|
00009c90  6e 79 20 3c 54 72 61 73  68 24 44 69 72 3e 2e 2a  |ny <Trash$Dir>.*|
00009ca0  20 66 69 6c 65 73 20 3f  20 49 49 49 2d 38 35 30  | files ? III-850|
00009cb0  0d 20 26 28 20 20 20 20  20 20 20 20 20 20 20 20  |. &(            |
00009cc0  20 20 20 20 4c 44 52 20  20 20 20 20 52 32 2c 74  |    LDR     R2,t|
00009cd0  72 61 73 68 73 74 61 74  0d 20 30 49 20 20 20 20  |rashstat. 0I    |
00009ce0  20 20 20 20 20 20 20 20  20 20 20 20 84 52 20 20  |            .R  |
00009cf0  20 20 20 52 32 2c 52 32  2c 23 28 31 3c 3c 32 32  |   R2,R2,#(1<<22|
00009d00  29 20 20 3b 20 42 69 74  20 32 32 20 73 65 74 20  |)  ; Bit 22 set |
00009d10  74 6f 20 69 6e 64 69 63  61 74 65 20 65 6d 70 74  |to indicate empt|
00009d20  79 0d 20 3a 21 20 20 20  20 20 20 20 20 20 20 20  |y. :!           |
00009d30  20 20 20 20 20 42 56 53  20 20 20 20 20 65 6d 70  |     BVS     emp|
00009d40  74 79 0d 20 44 48 20 20  20 20 20 20 20 20 20 20  |ty. DH          |
00009d50  20 20 20 20 20 20 4c 44  52 42 20 20 20 20 52 33  |      LDRB    R3|
00009d60  2c 43 4d 4f 53 62 79 74  65 20 20 20 20 20 3b 20  |,CMOSbyte     ; |
00009d70  49 66 20 69 6e 20 49 6d  6d 65 64 69 61 74 65 20  |If in Immediate |
00009d80  6d 6f 64 65 2c 20 74 68  65 6e 0d 20 4e 49 20 20  |mode, then. NI  |
00009d90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 54 53  |              TS|
00009da0  54 20 20 20 20 20 52 33  2c 23 25 30 30 31 20 20  |T     R3,#%001  |
00009db0  20 20 20 20 20 20 3b 20  74 72 61 73 68 20 63 61  |      ; trash ca|
00009dc0  6e 20 69 73 20 61 6c 77  61 79 73 20 27 65 6d 70  |n is always 'emp|
00009dd0  74 79 27 0d 20 58 21 20  20 20 20 20 20 20 20 20  |ty'. X!         |
00009de0  20 20 20 20 20 20 20 42  4e 45 20 20 20 20 20 65  |       BNE     e|
00009df0  6d 70 74 79 0d 20 62 21  20 20 20 20 20 20 20 20  |mpty. b!        |
00009e00  20 20 20 20 20 20 20 20  4d 4f 56 53 20 20 20 20  |        MOVS    |
00009e10  52 30 2c 52 30 0d 20 6c  49 20 20 20 20 20 20 20  |R0,R0. lI       |
00009e20  20 20 20 20 20 20 20 20  20 42 49 43 4e 45 20 20  |         BICNE  |
00009e30  20 52 32 2c 52 32 2c 23  28 31 3c 3c 32 32 29 20  | R2,R2,#(1<<22) |
00009e40  20 3b 20 42 69 74 20 32  32 20 63 6c 65 61 72 65  | ; Bit 22 cleare|
00009e50  64 20 62 65 63 61 75 73  65 20 66 75 6c 6c 0d 20  |d because full. |
00009e60  76 28 2e 65 6d 70 74 79  20 20 20 20 20 20 20 20  |v(.empty        |
00009e70  20 20 53 54 52 20 20 20  20 20 52 32 2c 74 72 61  |  STR     R2,tra|
00009e80  73 68 73 74 61 74 0d 20  80 25 20 20 20 20 20 20  |shstat. .%      |
00009e90  20 20 20 20 20 20 20 20  20 20 42 4c 20 20 20 20  |          BL    |
00009ea0  20 20 75 70 64 61 74 65  63 61 6e 0d 20 8a 2b 20  |  updatecan. .+ |
00009eb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
00009ec0  44 4d 46 44 20 20 20 52  31 33 21 2c 7b 52 30 2d  |DMFD   R13!,{R0-|
00009ed0  52 33 2c 50 43 7d 0d 20  94 2d 2e 74 72 61 73 68  |R3,PC}. .-.trash|
00009ee0  62 69 74 73 20 20 20 20  20 20 45 51 55 53 20 20  |bits      EQUS  |
00009ef0  20 20 22 3c 22 2b 74 72  61 73 68 76 61 72 24 2b  |  "<"+trashvar$+|
00009f00  22 3e 22 0d 20 9e 27 2e  70 6f 6b 65 74 72 61 73  |">". .'.poketras|
00009f10  68 20 20 20 20 20 20 45  51 55 53 20 20 20 20 62  |h      EQUS    b|
00009f20  6c 24 2b 22 2a 22 2b 62  6c 24 0d 20 a8 19 20 20  |l$+"*"+bl$. ..  |
00009f30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 41 4c  |              AL|
00009f40  49 47 4e 0d 20 b2 04 0d  20 bc 11 2e 72 65 64 6f  |IGN. ... ...redo|
00009f50  63 6f 6e 74 65 6e 74 73  0d 20 c6 04 0d 20 d0 4d  |contents. ... .M|
00009f60  3b 20 4c 69 6b 65 20 63  68 65 63 6b 63 6f 6e 74  |; Like checkcont|
00009f70  65 6e 74 73 2c 20 62 75  74 20 75 73 65 73 20 6c  |ents, but uses l|
00009f80  61 73 74 20 73 63 61 6e  20 66 6f 72 20 69 6e 66  |ast scan for inf|
00009f90  6f 20 72 61 74 68 65 72  20 74 68 61 6e 20 72 65  |o rather than re|
00009fa0  2d 73 63 61 6e 6e 69 6e  67 0d 20 da 04 0d 20 e4  |-scanning. ... .|
00009fb0  2d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |-               |
00009fc0  20 53 54 4d 46 44 20 20  20 52 31 33 21 2c 7b 52  | STMFD   R13!,{R|
00009fd0  32 2c 52 31 30 2c 52 31  34 7d 0d 20 ee 3b 20 20  |2,R10,R14}. .;  |
00009fe0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |              LD|
00009ff0  52 20 20 20 20 20 52 32  2c 74 72 61 73 68 73 74  |R     R2,trashst|
0000a000  61 74 20 20 20 20 3b 20  47 65 74 20 6c 61 73 74  |at    ; Get last|
0000a010  20 73 63 61 6e 0d 20 f8  3e 20 20 20 20 20 20 20  | scan. .>       |
0000a020  20 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |         MOV    |
0000a030  20 52 31 30 2c 23 31 20  20 20 20 20 20 20 20 20  | R10,#1         |
0000a040  20 3b 20 46 6c 61 67 20  69 63 6f 6e 20 75 70 64  | ; Flag icon upd|
0000a050  61 74 65 0d 21 02 25 20  20 20 20 20 20 20 20 20  |ate.!.%         |
0000a060  20 20 20 20 20 20 20 42  4c 20 20 20 20 20 20 75  |       BL      u|
0000a070  70 64 61 74 65 63 61 6e  0d 21 0c 2c 20 20 20 20  |pdatecan.!.,    |
0000a080  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 4d 46  |            LDMF|
0000a090  44 20 20 20 52 31 33 21  2c 7b 52 32 2c 52 31 30  |D   R13!,{R2,R10|
0000a0a0  2c 50 43 7d 0d 21 16 04  0d 21 20 0e 2e 75 70 64  |,PC}.!...! ..upd|
0000a0b0  61 74 65 63 61 6e 0d 21  2a 04 0d 21 34 2d 3b 20  |atecan.!*..!4-; |
0000a0c0  4f 6e 20 65 6e 74 72 79  2c 20 20 20 20 20 52 32  |On entry,     R2|
0000a0d0  20 20 20 20 20 20 3d 20  54 72 61 73 68 73 74 61  |      = Trashsta|
0000a0e0  74 20 76 61 6c 75 65 0d  21 3e 49 3b 20 20 20 20  |t value.!>I;    |
0000a0f0  20 20 20 20 20 20 20 20  20 20 20 52 31 30 20 20  |           R10  |
0000a100  20 20 20 3d 20 30 20 69  66 20 77 61 6e 74 20 74  |   = 0 if want t|
0000a110  6f 20 63 72 65 61 74 65  20 69 63 6f 6e 2c 20 3c  |o create icon, <|
0000a120  3e 20 30 20 74 6f 20 75  70 64 61 74 65 20 69 74  |> 0 to update it|
0000a130  0d 21 48 04 0d 21 52 29  20 20 20 20 20 20 20 20  |.!H..!R)        |
0000a140  20 20 20 20 20 20 20 20  53 54 4d 46 44 20 20 20  |        STMFD   |
0000a150  52 31 33 21 2c 7b 52 31  2c 52 31 34 7d 0d 21 5c  |R13!,{R1,R14}.!\|
0000a160  27 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |'               |
0000a170  20 54 53 54 20 20 20 20  20 52 32 2c 23 28 31 3c  | TST     R2,#(1<|
0000a180  3c 32 32 29 0d 21 66 41  20 20 20 20 20 20 20 20  |<22).!fA        |
0000a190  20 20 20 20 20 20 20 20  4d 4f 56 4e 45 20 20 20  |        MOVNE   |
0000a1a0  52 31 2c 23 97 22 31 22  20 3b 20 45 6d 70 74 79  |R1,#."1" ; Empty|
0000a1b0  20 66 6c 61 67 20 28 50  68 69 6c 69 70 20 43 6f  | flag (Philip Co|
0000a1c0  6c 6d 65 72 29 0d 21 70  2d 20 20 20 20 20 20 20  |lmer).!p-       |
0000a1d0  20 20 20 20 20 20 20 20  20 ec 51 20 20 20 52 31  |         .Q   R1|
0000a1e0  2c 23 97 22 32 22 20 3b  20 46 75 6c 6c 20 66 6c  |,#."2" ; Full fl|
0000a1f0  61 67 0d 21 7a 48 20 20  20 20 20 20 20 20 20 20  |ag.!zH          |
0000a200  20 20 20 20 20 20 4d 4f  56 53 20 20 20 20 52 31  |      MOVS    R1|
0000a210  30 2c 52 31 30 20 20 20  20 20 20 20 20 20 3b 20  |0,R10         ; |
0000a220  49 73 20 74 68 69 73 20  74 68 65 20 66 69 72 73  |Is this the firs|
0000a230  74 20 74 69 6d 65 20 74  68 65 0d 21 84 4c 20 20  |t time the.!.L  |
0000a240  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 4c  |              BL|
0000a250  45 51 20 20 20 20 6d 61  6b 65 69 63 6f 6e 20 20  |EQ    makeicon  |
0000a260  20 20 20 20 20 20 3b 20  69 63 6f 6e 20 69 73 20  |      ; icon is |
0000a270  74 6f 20 61 70 70 65 61  72 20 6f 6e 20 74 68 65  |to appear on the|
0000a280  20 62 61 72 20 3f 0d 21  8e 26 20 20 20 20 20 20  | bar ?.!.&      |
0000a290  20 20 20 20 20 20 20 20  20 20 42 4c 4e 45 20 20  |          BLNE  |
0000a2a0  20 20 63 68 61 6e 67 65  69 63 6f 6e 0d 21 98 21  |  changeicon.!.!|
0000a2b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000a2c0  4d 4f 56 20 20 20 20 20  52 31 2c 23 30 0d 21 a2  |MOV     R1,#0.!.|
0000a2d0  46 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |F               |
0000a2e0  20 53 54 52 42 20 20 20  20 52 31 2c 66 73 63 74  | STRB    R1,fsct|
0000a2f0  72 6c 66 6c 61 67 20 20  20 3b 20 4e 6f 20 6e 65  |rlflag   ; No ne|
0000a300  65 64 20 66 6f 72 20 6d  6f 72 65 20 75 70 64 61  |ed for more upda|
0000a310  74 65 73 0d 21 ac 28 20  20 20 20 20 20 20 20 20  |tes.!.(         |
0000a320  20 20 20 20 20 20 20 4c  44 4d 46 44 20 20 20 52  |       LDMFD   R|
0000a330  31 33 21 2c 7b 52 31 2c  50 43 7d 0d 21 b6 04 0d  |13!,{R1,PC}.!...|
0000a340  21 c0 0e 2e 63 61 6e 65  78 69 73 74 73 0d 21 ca  |!...canexists.!.|
0000a350  04 0d 21 d4 35 3b 20 4d  75 73 74 20 63 72 65 61  |..!.5; Must crea|
0000a360  74 65 20 74 72 61 73 68  20 64 69 72 65 63 74 6f  |te trash directo|
0000a370  72 79 20 69 66 20 69 74  20 64 6f 65 73 6e 27 74  |ry if it doesn't|
0000a380  20 65 78 69 73 74 0d 21  de 04 0d 21 e8 2c 20 20  | exist.!...!.,  |
0000a390  20 20 20 20 20 20 20 20  20 20 20 20 20 20 53 54  |              ST|
0000a3a0  4d 46 44 20 20 20 52 31  33 21 2c 7b 52 30 2c 52  |MFD   R13!,{R0,R|
0000a3b0  31 2c 52 31 34 7d 0d 21  f2 2c 20 20 20 20 20 20  |1,R14}.!.,      |
0000a3c0  20 20 20 20 20 20 20 20  20 20 41 44 52 20 20 20  |          ADR   |
0000a3d0  20 20 52 31 2c 74 72 61  73 68 6f 70 65 6e 62 75  |  R1,trashopenbu|
0000a3e0  66 66 0d 21 fc 4c 20 20  20 20 20 20 20 20 20 20  |ff.!.L          |
0000a3f0  20 20 20 20 20 20 42 4c  20 20 20 20 20 20 72 65  |      BL      re|
0000a400  61 64 74 72 61 73 68 64  69 72 20 20 20 20 3b 20  |adtrashdir    ; |
0000a410  4d 61 6b 65 20 73 75 72  65 20 54 72 61 73 68 24  |Make sure Trash$|
0000a420  44 69 72 20 76 61 72 20  65 78 69 73 74 73 0d 22  |Dir var exists."|
0000a430  06 21 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.!              |
0000a440  20 20 4d 4f 56 20 20 20  20 20 52 30 2c 23 30 0d  |  MOV     R0,#0.|
0000a450  22 10 28 20 20 20 20 20  20 20 20 20 20 20 20 20  |".(             |
0000a460  20 20 20 53 54 52 42 20  20 20 20 52 30 2c 70 6f  |   STRB    R0,po|
0000a470  6b 65 74 72 61 73 68 0d  22 1a 28 20 20 20 20 20  |ketrash.".(     |
0000a480  20 20 20 20 20 20 20 20  20 20 20 41 44 52 20 20  |           ADR  |
0000a490  20 20 20 52 31 2c 74 72  61 73 68 62 69 74 73 0d  |   R1,trashbits.|
0000a4a0  22 24 21 20 20 20 20 20  20 20 20 20 20 20 20 20  |"$!             |
0000a4b0  20 20 20 4d 4f 56 20 20  20 20 20 52 30 2c 23 38  |   MOV     R0,#8|
0000a4c0  0d 22 2e 48 20 20 20 20  20 20 20 20 20 20 20 20  |.".H            |
0000a4d0  20 20 20 20 53 57 49 20  20 20 20 20 22 58 4f 53  |    SWI     "XOS|
0000a4e0  5f 46 69 6c 65 22 20 20  20 20 20 20 3b 20 2a 43  |_File"      ; *C|
0000a4f0  44 49 52 20 3c 54 72 61  73 68 24 44 69 72 3e 2e  |DIR <Trash$Dir>.|
0000a500  20 49 49 49 2d 38 35 34  0d 22 38 2b 20 20 20 20  | III-854."8+    |
0000a510  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 4d 46  |            LDMF|
0000a520  44 20 20 20 52 31 33 21  2c 7b 52 30 2c 52 31 2c  |D   R13!,{R0,R1,|
0000a530  50 43 7d 0d 22 42 04 0d  22 4c 2d 2e 6e 65 77 6e  |PC}."B.."L-.newn|
0000a540  61 6d 65 20 20 20 20 20  20 20 20 45 51 55 53 20  |ame        EQUS |
0000a550  20 20 20 22 3c 22 2b 74  72 61 73 68 76 61 72 24  |   "<"+trashvar$|
0000a560  2b 22 3e 22 0d 22 56 28  2e 6e 61 6d 65 65 6e 64  |+">"."V(.nameend|
0000a570  69 6e 67 20 20 20 20 20  45 51 55 53 20 20 20 20  |ing     EQUS    |
0000a580  22 2e 22 2b c4 31 31 2c  62 6c 24 29 0d 22 60 19  |"."+.11,bl$)."`.|
0000a590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000a5a0  41 4c 49 47 4e 0d 22 6a  04 0d 22 74 13 2e 67 65  |ALIGN."j.."t..ge|
0000a5b0  74 63 61 6e 69 63 6f 6e  69 6e 66 6f 0d 22 7e 04  |tcaniconinfo."~.|
0000a5c0  0d 22 88 4e 3b 20 4f 6e  20 65 78 69 74 2c 20 20  |.".N; On exit,  |
0000a5d0  20 20 20 20 52 32 20 20  20 20 20 20 3d 20 52 69  |    R2      = Ri|
0000a5e0  67 68 74 2d 68 61 6e 64  20 58 20 63 6f 6f 72 64  |ght-hand X coord|
0000a5f0  20 6f 66 20 74 72 61 73  68 20 63 61 6e 20 69 63  | of trash can ic|
0000a600  6f 6e 20 6f 6e 20 69 63  6f 6e 20 62 61 72 0d 22  |on on icon bar."|
0000a610  92 04 0d 22 9c 2c 20 20  20 20 20 20 20 20 20 20  |...".,          |
0000a620  20 20 20 20 20 20 53 54  4d 46 44 20 20 20 52 31  |      STMFD   R1|
0000a630  33 21 2c 7b 52 31 2c 52  33 2c 52 31 34 7d 0d 22  |3!,{R1,R3,R14}."|
0000a640  a6 43 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.C              |
0000a650  20 20 4d 56 4e 20 20 20  20 20 52 32 2c 23 2d 28  |  MVN     R2,#-(|
0000a660  69 63 6f 6e 62 61 72 74  79 70 65 25 2b 31 29 20  |iconbartype%+1) |
0000a670  20 20 3b 20 49 63 6f 6e  20 62 61 72 20 74 79 70  |  ; Icon bar typ|
0000a680  65 0d 22 b0 43 20 20 20  20 20 20 20 20 20 20 20  |e.".C           |
0000a690  20 20 20 20 20 4c 44 52  20 20 20 20 20 52 33 2c  |     LDR     R3,|
0000a6a0  69 63 6f 6e 68 61 6e 64  6c 65 20 20 20 3b 20 54  |iconhandle   ; T|
0000a6b0  72 61 73 68 20 63 61 6e  20 69 63 6f 6e 20 68 61  |rash can icon ha|
0000a6c0  6e 64 6c 65 0d 22 ba 27  20 20 20 20 20 20 20 20  |ndle.".'        |
0000a6d0  20 20 20 20 20 20 20 20  42 4c 20 20 20 20 20 20  |        BL      |
0000a6e0  67 65 74 69 63 6f 6e 69  6e 66 6f 0d 22 c4 44 20  |geticoninfo.".D |
0000a6f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
0000a700  44 52 20 20 20 20 20 52  32 2c 5b 52 31 2c 23 31  |DR     R2,[R1,#1|
0000a710  36 5d 20 20 20 20 20 3b  20 47 65 74 20 69 63 6f  |6]     ; Get ico|
0000a720  6e 20 72 69 67 68 74 20  58 20 63 6f 6f 72 64 0d  |n right X coord.|
0000a730  22 ce 2b 20 20 20 20 20  20 20 20 20 20 20 20 20  |".+             |
0000a740  20 20 20 4c 44 4d 46 44  20 20 20 52 31 33 21 2c  |   LDMFD   R13!,|
0000a750  7b 52 31 2c 52 33 2c 50  43 7d 0d 22 d8 04 0d 22  |{R1,R3,PC}."..."|
0000a760  e2 10 2e 67 65 74 69 63  6f 6e 69 6e 66 6f 0d 22  |...geticoninfo."|
0000a770  ec 04 0d 22 f6 2b 3b 20  4f 6e 20 65 6e 74 72 79  |...".+; On entry|
0000a780  2c 20 20 20 20 20 52 30  20 20 20 20 20 20 3d 20  |,     R0      = |
0000a790  57 69 6e 64 6f 77 20 68  61 6e 64 6c 65 0d 23 00  |Window handle.#.|
0000a7a0  29 3b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |);              |
0000a7b0  20 52 32 20 20 20 20 20  20 3d 20 49 63 6f 6e 20  | R2      = Icon |
0000a7c0  68 61 6e 64 6c 65 0d 23  0a 37 3b 20 4f 6e 20 65  |handle.#.7; On e|
0000a7d0  78 69 74 2c 20 20 20 20  20 20 52 31 20 20 20 20  |xit,      R1    |
0000a7e0  20 20 3d 20 50 6f 69 6e  74 65 72 20 74 6f 20 49  |  = Pointer to I|
0000a7f0  63 6f 6e 53 74 61 74 65  20 69 6e 66 6f 0d 23 14  |conState info.#.|
0000a800  04 0d 23 1e 4c 20 20 20  20 20 20 20 20 20 20 20  |..#.L           |
0000a810  20 20 20 20 20 41 44 52  20 20 20 20 20 52 31 2c  |     ADR     R1,|
0000a820  28 74 72 61 73 68 63 6c  6f 73 65 62 75 66 66 2b  |(trashclosebuff+|
0000a830  33 29 20 81 20 34 2a 34  20 20 20 20 3b 20 52 65  |3) . 4*4    ; Re|
0000a840  63 79 63 6c 65 20 77 6f  72 6b 73 70 63 0d 23 28  |cycle workspc.#(|
0000a850  41 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |A               |
0000a860  20 53 54 52 20 20 20 20  20 52 32 2c 5b 52 31 5d  | STR     R2,[R1]|
0000a870  20 20 20 20 20 20 20 20  20 3b 20 53 74 6f 72 65  |         ; Store|
0000a880  20 77 69 6e 64 6f 77 20  68 61 6e 64 6c 65 0d 23  | window handle.#|
0000a890  32 3f 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2?              |
0000a8a0  20 20 53 54 52 20 20 20  20 20 52 33 2c 5b 52 31  |  STR     R3,[R1|
0000a8b0  2c 23 34 5d 20 20 20 20  20 20 3b 20 53 74 6f 72  |,#4]      ; Stor|
0000a8c0  65 20 69 63 6f 6e 20 68  61 6e 64 6c 65 0d 23 3c  |e icon handle.#<|
0000a8d0  4d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |M               |
0000a8e0  20 53 57 49 20 20 20 20  20 22 58 57 69 6d 70 5f  | SWI     "XWimp_|
0000a8f0  47 65 74 49 63 6f 6e 53  74 61 74 65 22 20 20 20  |GetIconState"   |
0000a900  20 3b 20 47 65 74 20 69  63 6f 6e 20 69 6e 66 6f  | ; Get icon info|
0000a910  2e 20 49 49 49 2d 31 32  31 33 0d 23 46 22 20 20  |. III-1213.#F"  |
0000a920  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4d 4f  |              MO|
0000a930  56 20 20 20 20 20 50 43  2c 52 31 34 0d 23 50 04  |V     PC,R14.#P.|
0000a940  0d 23 5a 12 2e 6d 6f 76  65 69 6e 74 6f 74 72 61  |.#Z..moveintotra|
0000a950  73 68 0d 23 64 04 0d 23  6e 38 3b 20 4f 6e 20 65  |sh.#d..#n8; On e|
0000a960  6e 74 72 79 2c 20 20 20  20 20 52 31 20 20 20 20  |ntry,     R1    |
0000a970  20 20 3d 20 50 6f 69 6e  74 65 72 20 74 6f 20 57  |  = Pointer to W|
0000a980  69 6d 70 5f 50 6f 6c 6c  20 62 6c 6f 63 6b 0d 23  |imp_Poll block.#|
0000a990  78 04 0d 23 82 2f 20 20  20 20 20 20 20 20 20 20  |x..#./          |
0000a9a0  20 20 20 20 20 20 53 54  4d 46 44 20 20 20 52 31  |      STMFD   R1|
0000a9b0  33 21 2c 7b 52 30 2d 52  36 2c 52 39 2c 52 31 34  |3!,{R0-R6,R9,R14|
0000a9c0  7d 0d 23 8c 42 20 20 20  20 20 20 20 20 20 20 20  |}.#.B           |
0000a9d0  20 20 20 20 20 4c 44 52  42 20 20 20 20 52 35 2c  |     LDRB    R5,|
0000a9e0  43 4d 4f 53 62 79 74 65  20 20 20 20 20 3b 20 47  |CMOSbyte     ; G|
0000a9f0  65 74 20 49 6d 6d 65 64  69 61 74 65 20 6f 70 74  |et Immediate opt|
0000aa00  69 6f 6e 0d 23 96 25 20  20 20 20 20 20 20 20 20  |ion.#.%         |
0000aa10  20 20 20 20 20 20 20 80  20 20 20 20 20 52 35 2c  |       .     R5,|
0000aa20  52 35 2c 23 25 30 30 31  0d 23 a0 3a 20 20 20 20  |R5,#%001.#.:    |
0000aa30  20 20 20 20 20 20 20 20  20 20 20 20 42 4c 20 20  |            BL  |
0000aa40  20 20 20 20 73 74 61 72  74 67 6c 61 73 73 20 20  |    startglass  |
0000aa50  20 20 20 20 3b 20 48 6f  75 72 67 6c 61 73 73 20  |    ; Hourglass |
0000aa60  6f 6e 0d 23 aa 3f 20 20  20 20 20 20 20 20 20 20  |on.#.?          |
0000aa70  20 20 20 20 20 20 41 44  44 20 20 20 20 20 52 33  |      ADD     R3|
0000aa80  2c 52 31 2c 23 34 34 20  20 20 20 20 20 20 3b 20  |,R1,#44       ; |
0000aa90  50 6f 69 6e 74 20 74 6f  20 66 69 6c 65 6e 61 6d  |Point to filenam|
0000aaa0  65 0d 23 b4 48 20 20 20  20 20 20 20 20 20 20 20  |e.#.H           |
0000aab0  20 20 20 20 20 42 4c 20  20 20 20 20 20 63 61 6e  |     BL      can|
0000aac0  65 78 69 73 74 73 20 20  20 20 20 20 20 3b 20 43  |exists       ; C|
0000aad0  72 65 61 74 65 20 54 72  61 73 68 20 64 69 72 20  |reate Trash dir |
0000aae0  69 66 20 6e 65 65 64 65  64 0d 23 be 04 0d 23 c8  |if needed.#...#.|
0000aaf0  48 3b 20 42 65 63 61 75  73 65 20 2a 52 65 6e 61  |H; Because *Rena|
0000ab00  6d 65 20 69 73 20 65 78  74 72 65 6d 65 6c 79 20  |me is extremely |
0000ab10  61 77 6b 77 61 72 64 20  61 62 6f 75 74 20 77 69  |awkward about wi|
0000ab20  6c 64 63 61 72 64 73 20  2d 20 77 6f 6e 27 74 20  |ldcards - won't |
0000ab30  61 6c 6c 6f 77 0d 23 d2  4a 3b 20 74 68 65 6d 20  |allow.#.J; them |
0000ab40  28 41 52 52 47 47 48 48  20 21 29 20 2d 20 68 61  |(ARRGGHH !) - ha|
0000ab50  76 65 20 74 6f 20 63 6f  70 79 20 74 68 65 20 6e  |ve to copy the n|
0000ab60  61 6d 65 20 28 66 72 6f  6d 20 74 68 65 20 6c 61  |ame (from the la|
0000ab70  73 74 20 27 2e 27 20 6f  6e 77 61 72 64 73 29 0d  |st '.' onwards).|
0000ab80  23 dc 04 0d 23 e6 40 20  20 20 20 20 20 20 20 20  |#...#.@         |
0000ab90  20 20 20 20 20 20 20 4c  44 52 20 20 20 20 20 52  |       LDR     R|
0000aba0  34 2c 5b 52 33 2c 23 2d  34 34 2b 31 32 5d 20 3b  |4,[R3,#-44+12] ;|
0000abb0  20 49 73 20 69 74 20 66  72 6f 6d 20 46 69 6c 65  | Is it from File|
0000abc0  72 20 3f 0d 23 f0 21 20  20 20 20 20 20 20 20 20  |r ?.#.!         |
0000abd0  20 20 20 20 20 20 20 4d  4f 56 53 20 20 20 20 52  |       MOVS    R|
0000abe0  34 2c 52 34 0d 23 fa 46  20 20 20 20 20 20 20 20  |4,R4.#.F        |
0000abf0  20 20 20 20 20 20 20 20  42 45 51 20 20 20 20 20  |        BEQ     |
0000ac00  69 74 73 66 72 6f 6d 46  69 6c 65 72 20 20 20 20  |itsfromFiler    |
0000ac10  3b 20 59 65 73 2c 20 73  6f 20 65 6e 64 69 6e 67  |; Yes, so ending|
0000ac20  73 20 74 68 65 20 73 61  6d 65 0d 24 04 2c 20 20  |s the same.$.,  |
0000ac30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |              LD|
0000ac40  52 20 20 20 20 20 52 30  2c 73 70 61 72 6b 74 61  |R     R0,sparkta|
0000ac50  73 6b 68 61 6e 64 0d 24  0e 3b 20 20 20 20 20 20  |skhand.$.;      |
0000ac60  20 20 20 20 20 20 20 20  20 20 4c 44 52 20 20 20  |          LDR   |
0000ac70  20 20 52 31 2c 5b 52 33  2c 23 2d 34 34 2b 34 5d  |  R1,[R3,#-44+4]|
0000ac80  20 20 3b 20 49 73 20 69  74 20 53 70 61 72 6b 20  |  ; Is it Spark |
0000ac90  3f 0d 24 18 21 20 20 20  20 20 20 20 20 20 20 20  |?.$.!           |
0000aca0  20 20 20 20 20 43 4d 50  20 20 20 20 20 52 30 2c  |     CMP     R0,|
0000acb0  52 31 0d 24 22 3b 20 20  20 20 20 20 20 20 20 20  |R1.$";          |
0000acc0  20 20 20 20 20 20 42 4e  45 20 20 20 20 20 63 61  |      BNE     ca|
0000acd0  6e 74 74 72 61 73 68 20  20 20 20 20 20 20 3b 20  |nttrash       ; |
0000ace0  4e 6f 2c 20 73 6f 20 69  67 6e 6f 72 65 0d 24 2c  |No, so ignore.$,|
0000acf0  46 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |F               |
0000ad00  20 41 44 52 20 20 20 20  20 52 30 2c 73 61 76 65  | ADR     R0,save|
0000ad10  64 6c 65 61 66 20 20 20  20 3b 20 61 6e 64 20 63  |dleaf    ; and c|
0000ad20  6f 70 79 20 6c 65 61 66  6e 61 6d 65 20 74 6f 20  |opy leafname to |
0000ad30  74 68 65 0d 24 36 3e 20  20 20 20 20 20 20 20 20  |the.$6>         |
0000ad40  20 20 20 20 20 20 20 41  44 52 20 20 20 20 20 52  |       ADR     R|
0000ad50  31 2c 6e 61 6d 65 65 6e  64 69 6e 67 2b 31 20 3b  |1,nameending+1 ;|
0000ad60  20 65 6e 64 20 6f 66 20  54 72 61 73 68 24 44 69  | end of Trash$Di|
0000ad70  72 0d 24 40 26 2e 63 6f  70 79 73 61 66 65 6c 65  |r.$@&.copysafele|
0000ad80  61 66 20 20 20 4c 44 52  42 20 20 20 20 52 32 2c  |af   LDRB    R2,|
0000ad90  5b 52 30 5d 2c 23 31 0d  24 4a 26 20 20 20 20 20  |[R0],#1.$J&     |
0000ada0  20 20 20 20 20 20 20 20  20 20 20 53 54 52 42 20  |           STRB |
0000adb0  20 20 20 52 32 2c 5b 52  31 5d 2c 23 31 0d 24 54  |   R2,[R1],#1.$T|
0000adc0  21 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |!               |
0000add0  20 4d 4f 56 53 20 20 20  20 52 32 2c 52 32 0d 24  | MOVS    R2,R2.$|
0000ade0  5e 28 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |^(              |
0000adf0  20 20 42 4e 45 20 20 20  20 20 63 6f 70 79 73 61  |  BNE     copysa|
0000ae00  66 65 6c 65 61 66 0d 24  68 27 20 20 20 20 20 20  |feleaf.$h'      |
0000ae10  20 20 20 20 20 20 20 20  20 20 42 20 20 20 20 20  |          B     |
0000ae20  20 20 72 65 74 72 79 61  63 63 65 73 73 0d 24 72  |  retryaccess.$r|
0000ae30  21 2e 69 74 73 66 72 6f  6d 46 69 6c 65 72 20 20  |!.itsfromFiler  |
0000ae40  20 4d 4f 56 20 20 20 20  20 52 30 2c 52 33 0d 24  | MOV     R0,R3.$|
0000ae50  7c 3c 20 20 20 20 20 20  20 20 20 20 20 20 20 20  ||<              |
0000ae60  20 20 4d 4f 56 20 20 20  20 20 52 32 2c 23 30 20  |  MOV     R2,#0 |
0000ae70  20 20 20 20 20 20 20 20  20 20 3b 20 44 6f 6e 27  |          ; Don'|
0000ae80  74 20 70 6f 6b 65 20 79  65 74 0d 24 86 26 2e 6c  |t poke yet.$.&.l|
0000ae90  6f 6f 6b 69 6e 67 66 6f  72 65 6e 64 20 20 4c 44  |ookingforend  LD|
0000aea0  52 42 20 20 20 20 52 31  2c 5b 52 30 5d 2c 23 31  |RB    R1,[R0],#1|
0000aeb0  0d 24 90 43 20 20 20 20  20 20 20 20 20 20 20 20  |.$.C            |
0000aec0  20 20 20 20 43 4d 50 20  20 20 20 20 52 31 2c 23  |    CMP     R1,#|
0000aed0  97 22 2e 22 20 20 20 20  20 20 3b 20 53 74 69 6c  |."."      ; Stil|
0000aee0  6c 20 74 72 61 76 65 72  73 69 6e 67 20 64 69 72  |l traversing dir|
0000aef0  73 20 3f 0d 24 9a 29 20  20 20 20 20 20 20 20 20  |s ?.$.)         |
0000af00  20 20 20 20 20 20 20 41  44 52 45 51 20 20 20 52  |       ADREQ   R|
0000af10  32 2c 6e 61 6d 65 65 6e  64 69 6e 67 0d 24 a4 21  |2,nameending.$.!|
0000af20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000af30  4d 4f 56 53 20 20 20 20  52 32 2c 52 32 0d 24 ae  |MOVS    R2,R2.$.|
0000af40  46 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |F               |
0000af50  20 53 54 52 4e 45 42 20  20 52 31 2c 5b 52 32 5d  | STRNEB  R1,[R2]|
0000af60  2c 23 31 20 20 20 20 20  20 3b 20 43 6f 70 79 20  |,#1      ; Copy |
0000af70  74 65 78 74 20 69 6e 74  6f 20 64 65 73 74 20 6e  |text into dest n|
0000af80  61 6d 65 0d 24 b8 21 20  20 20 20 20 20 20 20 20  |ame.$.!         |
0000af90  20 20 20 20 20 20 20 4d  4f 56 53 20 20 20 20 52  |       MOVS    R|
0000afa0  31 2c 52 31 0d 24 c2 42  20 20 20 20 20 20 20 20  |1,R1.$.B        |
0000afb0  20 20 20 20 20 20 20 20  42 4e 45 20 20 20 20 20  |        BNE     |
0000afc0  6c 6f 6f 6b 69 6e 67 66  6f 72 65 6e 64 20 20 20  |lookingforend   |
0000afd0  3b 20 47 6f 74 20 74 65  72 6d 69 6e 61 74 6f 72  |; Got terminator|
0000afe0  20 79 65 74 20 3f 0d 24  cc 04 0d 24 d6 44 3b 20  | yet ?.$...$.D; |
0000aff0  4e 65 78 74 20 62 69 74  20 61 64 64 65 64 20 74  |Next bit added t|
0000b000  6f 20 56 31 2e 30 31 20  74 6f 20 6d 61 6b 65 20  |o V1.01 to make |
0000b010  73 75 72 65 20 74 68 61  74 20 2a 52 65 6e 61 6d  |sure that *Renam|
0000b020  65 20 41 4c 57 41 59 53  20 77 6f 72 6b 73 0d 24  |e ALWAYS works.$|
0000b030  e0 4d 3b 20 69 66 20 74  68 65 20 66 69 6c 65 20  |.M; if the file |
0000b040  69 73 20 6f 6e 20 74 68  65 20 73 61 6d 65 20 64  |is on the same d|
0000b050  69 73 6b 20 28 61 76 6f  69 64 69 6e 67 20 68 61  |isk (avoiding ha|
0000b060  76 69 6e 67 20 74 6f 20  2a 43 6f 70 79 20 6c 6f  |ving to *Copy lo|
0000b070  63 6b 65 64 20 66 69 6c  65 73 29 0d 24 ea 04 0d  |cked files).$...|
0000b080  24 f4 48 2e 72 65 74 72  79 61 63 63 65 73 73 20  |$.H.retryaccess |
0000b090  20 20 20 4d 4f 56 20 20  20 20 20 52 30 2c 23 32  |   MOV     R0,#2|
0000b0a0  34 20 20 20 20 20 20 20  20 20 20 3b 20 2a 41 63  |4          ; *Ac|
0000b0b0  63 65 73 73 20 3c 66 69  6c 65 3e 20 57 52 2e 20  |cess <file> WR. |
0000b0c0  49 49 49 2d 39 31 30 0d  24 fe 48 20 20 20 20 20  |III-910.$.H     |
0000b0d0  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |           MOV  |
0000b0e0  20 20 20 52 31 2c 52 33  20 20 20 20 20 20 20 20  |   R1,R3        |
0000b0f0  20 20 20 3b 20 50 6f 69  6e 74 20 74 6f 20 6f 72  |   ; Point to or|
0000b100  69 67 69 6e 61 6c 20 66  69 6c 65 6e 61 6d 65 0d  |iginal filename.|
0000b110  25 08 47 20 20 20 20 20  20 20 20 20 20 20 20 20  |%.G             |
0000b120  20 20 20 41 44 52 20 20  20 20 20 52 32 2c 61 74  |   ADR     R2,at|
0000b130  74 72 69 62 75 74 65 73  20 20 20 3b 20 50 6f 69  |tributes   ; Poi|
0000b140  6e 74 20 74 6f 20 57 52  20 61 63 63 65 73 73 20  |nt to WR access |
0000b150  73 74 72 69 6e 67 0d 25  12 27 20 20 20 20 20 20  |string.%.'      |
0000b160  20 20 20 20 20 20 20 20  20 20 42 4c 20 20 20 20  |          BL    |
0000b170  20 20 64 6f 66 73 63 6f  6e 74 72 6f 6c 0d 25 1c  |  dofscontrol.%.|
0000b180  25 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |%               |
0000b190  20 42 47 54 20 20 20 20  20 63 61 6e 74 74 72 61  | BGT     canttra|
0000b1a0  73 68 0d 25 26 25 2e 72  65 74 72 79 72 65 6e 61  |sh.%&%.retryrena|
0000b1b0  6d 65 20 20 20 20 53 54  4d 46 44 20 20 20 52 31  |me    STMFD   R1|
0000b1c0  33 21 2c 7b 52 33 7d 0d  25 30 21 20 20 20 20 20  |3!,{R3}.%0!     |
0000b1d0  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |           MOV  |
0000b1e0  20 20 20 52 31 2c 52 33  0d 25 3a 41 20 20 20 20  |   R1,R3.%:A    |
0000b1f0  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 53  |            MOVS|
0000b200  20 20 20 20 52 35 2c 52  35 20 20 20 20 20 20 20  |    R5,R5       |
0000b210  20 20 20 20 3b 20 49 6d  6d 65 64 69 61 74 65 20  |    ; Immediate |
0000b220  65 6e 61 62 6c 65 64 20  3f 0d 25 44 47 20 20 20  |enabled ?.%DG   |
0000b230  20 20 20 20 20 20 20 20  20 20 20 20 20 ec 51 20  |             .Q |
0000b240  20 20 52 30 2c 23 32 35  20 20 20 20 20 20 20 20  |  R0,#25        |
0000b250  20 20 3b 20 2a 52 45 4e  41 4d 45 20 72 65 61 73  |  ; *RENAME reas|
0000b260  6f 6e 20 63 6f 64 65 2e  20 49 49 49 2d 39 31 31  |on code. III-911|
0000b270  0d 25 4e 26 20 20 20 20  20 20 20 20 20 20 20 20  |.%N&            |
0000b280  20 20 20 20 41 44 52 45  51 20 20 20 52 32 2c 6e  |    ADREQ   R2,n|
0000b290  65 77 6e 61 6d 65 0d 25  58 3e 20 20 20 20 20 20  |ewname.%X>      |
0000b2a0  20 20 20 20 20 20 20 20  20 20 53 57 49 45 51 20  |          SWIEQ |
0000b2b0  20 20 22 58 4f 53 5f 46  53 43 6f 6e 74 72 6f 6c  |  "XOS_FSControl|
0000b2c0  22 20 3b 20 2a 52 65 6e  61 6d 65 2e 20 49 49 49  |" ; *Rename. III|
0000b2d0  2d 39 31 31 0d 25 62 2a  20 20 20 20 20 20 20 20  |-911.%b*        |
0000b2e0  20 20 20 20 20 20 20 20  42 45 51 20 20 20 20 20  |        BEQ     |
0000b2f0  61 74 74 65 6d 70 74 6e  65 77 6e 61 6d 65 0d 25  |attemptnewname.%|
0000b300  6c 4a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |lJ              |
0000b310  20 20 41 44 52 20 20 20  20 20 52 36 2c 63 61 6c  |  ADR     R6,cal|
0000b320  6c 77 69 70 65 20 20 20  20 20 3b 20 28 4f 70 74  |lwipe     ; (Opt|
0000b330  69 6f 6e 61 6c 6c 79 29  20 61 6e 69 6d 61 74 65  |ionally) animate|
0000b340  20 76 61 6e 20 61 6e 64  0d 25 76 4d 20 20 20 20  | van and.%vM    |
0000b350  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 20  |            MOV |
0000b360  20 20 20 20 52 39 2c 52  31 20 20 20 20 20 20 20  |    R9,R1       |
0000b370  20 20 20 20 3b 20 2a 57  69 70 65 20 65 76 65 72  |    ; *Wipe ever|
0000b380  79 74 68 69 6e 67 20 66  72 6f 6d 20 54 72 61 73  |ything from Tras|
0000b390  68 24 44 69 72 0d 25 80  2a 20 20 20 20 20 20 20  |h$Dir.%.*       |
0000b3a0  20 20 20 20 20 20 20 20  20 42 4c 20 20 20 20 20  |         BL     |
0000b3b0  20 64 6f 76 61 6e 61 6e  69 6d 61 74 69 6f 6e 0d  | dovananimation.|
0000b3c0  25 8a 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |%.*             |
0000b3d0  20 20 20 42 20 20 20 20  20 20 20 61 74 74 65 6d  |   B       attem|
0000b3e0  70 74 6e 65 77 6e 61 6d  65 0d 25 94 2c 2e 63 61  |ptnewname.%.,.ca|
0000b3f0  6c 6c 77 69 70 65 20 20  20 20 20 20 20 53 54 4d  |llwipe       STM|
0000b400  46 44 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 33  |FD   R13!,{R0-R3|
0000b410  2c 52 31 34 7d 0d 25 9e  48 20 20 20 20 20 20 20  |,R14}.%.H       |
0000b420  20 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |         MOV    |
0000b430  20 52 30 2c 23 32 37 20  20 20 20 20 20 20 20 20  | R0,#27         |
0000b440  20 3b 20 2a 57 49 50 45  20 72 65 61 73 6f 6e 20  | ; *WIPE reason |
0000b450  63 6f 64 65 2e 20 49 49  49 2d 39 31 35 0d 25 a8  |code. III-915.%.|
0000b460  21 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |!               |
0000b470  20 4d 4f 56 20 20 20 20  20 52 31 2c 52 39 0d 25  | MOV     R1,R9.%|
0000b480  b2 4a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.J              |
0000b490  20 20 4d 4f 56 20 20 20  20 20 52 33 2c 23 25 30  |  MOV     R3,#%0|
0000b4a0  31 30 30 30 30 30 31 31  20 20 3b 20 7e 51 46 7e  |10000011  ; ~QF~|
0000b4b0  43 52 7e 56 20 61 6e 64  20 64 65 6c 65 74 65 20  |CR~V and delete |
0000b4c0  6f 72 69 67 69 6e 61 6c  0d 25 bc 3c 20 20 20 20  |original.%.<    |
0000b4d0  20 20 20 20 20 20 20 20  20 20 20 20 53 57 49 20  |            SWI |
0000b4e0  20 20 20 20 22 58 4f 53  5f 46 53 43 6f 6e 74 72  |    "XOS_FSContr|
0000b4f0  6f 6c 22 20 3b 20 2a 57  69 70 65 2e 20 49 49 49  |ol" ; *Wipe. III|
0000b500  2d 39 31 35 0d 25 c6 2b  20 20 20 20 20 20 20 20  |-915.%.+        |
0000b510  20 20 20 20 20 20 20 20  4c 44 4d 46 44 20 20 20  |        LDMFD   |
0000b520  52 31 33 21 2c 7b 52 30  2d 52 33 2c 50 43 7d 0d  |R13!,{R0-R3,PC}.|
0000b530  25 d0 25 2e 61 74 74 65  6d 70 74 6e 65 77 6e 61  |%.%.attemptnewna|
0000b540  6d 65 20 4c 44 4d 46 44  20 20 20 52 31 33 21 2c  |me LDMFD   R13!,|
0000b550  7b 52 33 7d 0d 25 da 45  20 20 20 20 20 20 20 20  |{R3}.%.E        |
0000b560  20 20 20 20 20 20 20 20  42 56 43 20 20 20 20 20  |        BVC     |
0000b570  61 63 6b 6e 6f 77 6c 65  64 67 65 20 20 20 20 20  |acknowledge     |
0000b580  3b 20 47 6f 6f 64 2c 20  73 6f 20 61 63 6b 6e 6f  |; Good, so ackno|
0000b590  77 6c 65 64 67 65 20 69  74 0d 25 e4 04 0d 25 ee  |wledge it.%...%.|
0000b5a0  46 3b 20 54 6f 20 70 72  65 76 65 6e 74 20 74 68  |F; To prevent th|
0000b5b0  65 20 73 69 6c 6c 79 20  63 6f 70 79 20 6f 66 20  |e silly copy of |
0000b5c0  54 72 61 73 68 20 69 6e  74 6f 20 69 74 73 65 6c  |Trash into itsel|
0000b5d0  66 20 28 63 61 75 73 65  73 20 37 37 20 6c 65 76  |f (causes 77 lev|
0000b5e0  65 6c 73 0d 25 f8 41 3b  20 74 6f 20 62 65 20 63  |els.%.A; to be c|
0000b5f0  72 65 61 74 65 64 20 21  29 2c 20 74 68 65 20 65  |reated !), the e|
0000b600  72 72 6f 72 20 63 6f 64  65 20 66 6f 72 20 42 61  |rror code for Ba|
0000b610  64 20 52 45 4e 41 4d 45  20 69 73 20 63 68 65 63  |d RENAME is chec|
0000b620  6b 65 64 2e 0d 26 02 04  0d 26 0c 40 20 20 20 20  |ked..&...&.@    |
0000b630  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 52 20  |            LDR |
0000b640  20 20 20 20 52 31 2c 5b  52 30 5d 20 20 20 20 20  |    R1,[R0]     |
0000b650  20 20 20 20 3b 20 47 65  74 20 74 68 65 20 65 72  |    ; Get the er|
0000b660  72 6f 72 20 77 6f 72 64  0d 26 16 28 20 20 20 20  |ror word.&.(    |
0000b670  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 52 20  |            LDR |
0000b680  20 20 20 20 52 32 2c 62  61 64 72 65 6e 61 6d 65  |    R2,badrename|
0000b690  0d 26 20 45 20 20 20 20  20 20 20 20 20 20 20 20  |.& E            |
0000b6a0  20 20 20 20 43 4d 50 20  20 20 20 20 52 31 2c 52  |    CMP     R1,R|
0000b6b0  32 20 20 20 20 20 20 20  20 20 20 20 3b 20 3d 20  |2           ; = |
0000b6c0  26 31 30 38 42 30 20 28  42 61 64 20 52 45 4e 41  |&108B0 (Bad RENA|
0000b6d0  4d 45 29 20 3f 0d 26 2a  25 20 20 20 20 20 20 20  |ME) ?.&*%       |
0000b6e0  20 20 20 20 20 20 20 20  20 42 45 51 20 20 20 20  |         BEQ    |
0000b6f0  20 63 61 6e 74 74 72 61  73 68 0d 26 34 04 0d 26  | canttrash.&4..&|
0000b700  3e 44 3b 20 54 68 65 20  6f 6e 6c 79 20 28 6e 6f  |>D; The only (no|
0000b710  6e 2d 66 61 74 61 6c 29  20 77 61 79 20 61 20 72  |n-fatal) way a r|
0000b720  65 6e 61 6d 65 20 63 61  6e 20 66 61 69 6c 20 69  |ename can fail i|
0000b730  73 20 69 66 20 74 68 65  20 72 65 6e 61 6d 65 20  |s if the rename |
0000b740  69 73 0d 26 48 45 3b 20  61 74 74 65 6d 70 74 65  |is.&HE; attempte|
0000b750  64 20 61 63 72 6f 73 73  20 64 69 73 6b 73 2f 46  |d across disks/F|
0000b760  53 73 20 6f 72 20 69 6e  74 6f 20 69 74 73 65 6c  |Ss or into itsel|
0000b770  66 20 28 77 68 65 6e 20  69 74 27 73 20 61 20 64  |f (when it's a d|
0000b780  69 72 29 2e 2e 2e 2e 0d  26 52 04 0d 26 5c 26 20  |ir).....&R..&\& |
0000b790  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
0000b7a0  44 52 20 20 20 20 20 52  32 2c 62 61 64 64 69 73  |DR     R2,baddis|
0000b7b0  6b 0d 26 66 48 20 20 20  20 20 20 20 20 20 20 20  |k.&fH           |
0000b7c0  20 20 20 20 20 43 4d 50  20 20 20 20 20 52 31 2c  |     CMP     R1,|
0000b7d0  52 32 20 20 20 20 20 20  20 20 20 20 20 3b 20 3d  |R2           ; =|
0000b7e0  20 26 31 30 38 39 46 20  28 4e 6f 74 20 73 61 6d  | &1089F (Not sam|
0000b7f0  65 20 64 69 73 63 29 20  3f 0d 26 70 42 20 20 20  |e disc) ?.&pB   |
0000b800  20 20 20 20 20 20 20 20  20 20 20 20 20 43 4d 50  |             CMP|
0000b810  4e 45 20 20 20 52 31 2c  23 26 42 30 20 20 20 20  |NE   R1,#&B0    |
0000b820  20 20 20 20 20 3b 20 3d  20 26 42 30 20 28 42 61  |     ; = &B0 (Ba|
0000b830  64 20 72 65 6e 61 6d 65  29 20 3f 0d 26 7a 04 0d  |d rename) ?.&z..|
0000b840  26 84 48 3b 20 2e 2e 2e  6f 72 20 69 66 20 69 74  |&.H; ...or if it|
0000b850  20 69 73 20 61 6c 72 65  61 64 79 20 70 72 65 73  | is already pres|
0000b860  65 6e 74 20 69 6e 20 54  72 61 73 68 24 44 69 72  |ent in Trash$Dir|
0000b870  20 28 41 6c 72 65 61 64  79 20 65 78 69 73 74 73  | (Already exists|
0000b880  20 65 72 72 6f 72 29 0d  26 8e 04 0d 26 98 28 20  | error).&...&.( |
0000b890  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
0000b8a0  44 52 4e 45 20 20 20 52  32 2c 64 6f 75 62 6c 65  |DRNE   R2,double|
0000b8b0  63 61 6e 0d 26 a2 49 20  20 20 20 20 20 20 20 20  |can.&.I         |
0000b8c0  20 20 20 20 20 20 20 43  4d 50 4e 45 20 20 20 52  |       CMPNE   R|
0000b8d0  31 2c 52 32 20 20 20 20  20 20 20 20 20 20 20 3b  |1,R2           ;|
0000b8e0  20 3d 20 26 31 30 38 43  34 20 28 41 6c 72 65 61  | = &108C4 (Alrea|
0000b8f0  64 79 20 65 78 69 73 74  73 29 20 3f 0d 26 ac 27  |dy exists) ?.&.'|
0000b900  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b910  42 45 51 20 20 20 20 20  64 6f 74 72 61 73 68 63  |BEQ     dotrashc|
0000b920  6f 70 79 0d 26 b6 04 0d  26 c0 30 3b 20 49 66 20  |opy.&...&.0; If |
0000b930  69 74 20 67 65 74 73 20  68 65 72 65 2c 20 74 68  |it gets here, th|
0000b940  65 6e 20 74 68 65 72 65  27 73 20 61 20 64 69 73  |en there's a dis|
0000b950  6b 20 66 61 75 6c 74 0d  26 ca 04 0d 26 d4 29 20  |k fault.&...&.) |
0000b960  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 42  |               B|
0000b970  4c 20 20 20 20 20 20 67  65 6e 65 72 61 74 65 65  |L      generatee|
0000b980  72 72 6f 72 0d 26 de 21  20 20 20 20 20 20 20 20  |rror.&.!        |
0000b990  20 20 20 20 20 20 20 20  43 4d 50 20 20 20 20 20  |        CMP     |
0000b9a0  52 31 2c 23 31 0d 26 e8  27 20 20 20 20 20 20 20  |R1,#1.&.'       |
0000b9b0  20 20 20 20 20 20 20 20  20 42 45 51 20 20 20 20  |         BEQ    |
0000b9c0  20 72 65 74 72 79 72 65  6e 61 6d 65 0d 26 f2 25  | retryrename.&.%|
0000b9d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b9e0  42 47 54 20 20 20 20 20  63 61 6e 74 74 72 61 73  |BGT     canttras|
0000b9f0  68 0d 26 fc 4c 2e 64 6f  74 72 61 73 68 63 6f 70  |h.&.L.dotrashcop|
0000ba00  79 20 20 20 20 4d 4f 56  53 20 20 20 20 52 35 2c  |y    MOVS    R5,|
0000ba10  52 35 20 20 20 20 20 20  20 20 20 20 20 3b 20 49  |R5           ; I|
0000ba20  66 20 49 6d 6d 65 64 69  61 74 65 20 74 68 65 6e  |f Immediate then|
0000ba30  20 2a 57 69 70 65 20 66  61 69 6c 65 64 0d 27 06  | *Wipe failed.'.|
0000ba40  47 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |G               |
0000ba50  20 42 4e 45 20 20 20 20  20 63 61 6e 74 74 72 61  | BNE     canttra|
0000ba60  73 68 20 20 20 20 20 20  20 3b 20 73 6f 20 64 6f  |sh       ; so do|
0000ba70  6e 27 74 20 64 6f 20 61  6e 79 74 68 69 6e 67 20  |n't do anything |
0000ba80  65 6c 73 65 0d 27 10 48  20 20 20 20 20 20 20 20  |else.'.H        |
0000ba90  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
0000baa0  52 30 2c 23 32 36 20 20  20 20 20 20 20 20 20 20  |R0,#26          |
0000bab0  3b 20 2a 43 4f 50 59 20  72 65 61 73 6f 6e 20 63  |; *COPY reason c|
0000bac0  6f 64 65 2e 20 49 49 49  2d 39 31 32 0d 27 1a 21  |ode. III-912.'.!|
0000bad0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000bae0  4d 4f 56 20 20 20 20 20  52 31 2c 52 33 0d 27 24  |MOV     R1,R3.'$|
0000baf0  26 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |&               |
0000bb00  20 41 44 52 20 20 20 20  20 52 32 2c 6e 65 77 6e  | ADR     R2,newn|
0000bb10  61 6d 65 0d 27 2e 3a 20  20 20 20 20 20 20 20 20  |ame.'.:         |
0000bb20  20 20 20 20 20 20 20 42  4c 20 20 20 20 20 20 64  |       BL      d|
0000bb30  6f 66 73 63 6f 6e 74 72  6f 6c 20 20 20 20 20 3b  |ofscontrol     ;|
0000bb40  20 44 6f 20 74 68 65 20  2a 43 4f 50 59 0d 27 38  | Do the *COPY.'8|
0000bb50  25 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |%               |
0000bb60  20 42 47 54 20 20 20 20  20 63 61 6e 74 74 72 61  | BGT     canttra|
0000bb70  73 68 0d 27 42 04 0d 27  4c 44 3b 20 54 68 69 73  |sh.'B..'LD; This|
0000bb80  20 63 6f 64 65 20 61 64  64 65 64 20 66 6f 72 20  | code added for |
0000bb90  56 31 2e 30 31 20 2d 20  73 68 6f 75 6c 64 20 68  |V1.01 - should h|
0000bba0  61 76 65 20 62 65 65 6e  20 69 6e 20 56 31 2e 30  |ave been in V1.0|
0000bbb0  30 2e 2e 2e 73 6f 72 72  79 2e 0d 27 56 04 0d 27  |0...sorry..'V..'|
0000bbc0  60 3a 2e 61 63 6b 6e 6f  77 6c 65 64 67 65 20 20  |`:.acknowledge  |
0000bbd0  20 20 4d 4f 56 20 20 20  20 20 52 30 2c 23 31 37  |  MOV     R0,#17|
0000bbe0  20 20 20 20 20 20 20 20  20 20 3b 20 55 73 65 72  |          ; User|
0000bbf0  20 6d 65 73 73 61 67 65  0d 27 6a 44 20 20 20 20  | message.'jD    |
0000bc00  20 20 20 20 20 20 20 20  20 20 20 20 53 55 42 20  |            SUB |
0000bc10  20 20 20 20 52 31 2c 52  33 2c 23 34 34 20 20 20  |    R1,R3,#44   |
0000bc20  20 20 20 20 3b 20 47 6f  20 62 61 63 6b 20 74 6f  |    ; Go back to|
0000bc30  20 62 6c 6f 63 6b 20 73  74 61 72 74 0d 27 74 49  | block start.'tI|
0000bc40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000bc50  4c 44 52 20 20 20 20 20  52 32 2c 5b 52 31 2c 23  |LDR     R2,[R1,#|
0000bc60  38 5d 20 20 20 20 20 20  3b 20 47 65 74 20 75 6e  |8]      ; Get un|
0000bc70  69 71 75 65 20 72 65 66  65 72 65 6e 63 65 20 6e  |ique reference n|
0000bc80  75 6d 62 65 72 0d 27 7e  48 20 20 20 20 20 20 20  |umber.'~H       |
0000bc90  20 20 20 20 20 20 20 20  20 53 54 52 20 20 20 20  |         STR    |
0000bca0  20 52 32 2c 5b 52 31 2c  23 31 32 5d 20 20 20 20  | R2,[R1,#12]    |
0000bcb0  20 3b 20 53 74 6f 72 65  20 69 74 20 69 6e 20 72  | ; Store it in r|
0000bcc0  65 73 70 6f 6e 73 65 20  66 69 65 6c 64 0d 27 88  |esponse field.'.|
0000bcd0  21 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |!               |
0000bce0  20 4d 4f 56 20 20 20 20  20 52 32 2c 23 34 0d 27  | MOV     R2,#4.'|
0000bcf0  92 39 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.9              |
0000bd00  20 20 53 54 52 20 20 20  20 20 52 32 2c 5b 52 31  |  STR     R2,[R1|
0000bd10  2c 23 31 36 5d 20 20 20  20 20 3b 20 44 61 74 61  |,#16]     ; Data|
0000bd20  4c 6f 61 64 41 63 6b 0d  27 9c 46 20 20 20 20 20  |LoadAck.'.F     |
0000bd30  20 20 20 20 20 20 20 20  20 20 20 4c 44 52 20 20  |           LDR  |
0000bd40  20 20 20 52 32 2c 5b 52  31 2c 23 34 5d 20 20 20  |   R2,[R1,#4]   |
0000bd50  20 20 20 3b 20 47 65 74  20 74 61 73 6b 20 68 61  |   ; Get task ha|
0000bd60  6e 64 6c 65 20 69 6e 76  6f 6c 76 65 64 0d 27 a6  |ndle involved.'.|
0000bd70  43 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |C               |
0000bd80  20 53 57 49 20 20 20 20  20 22 58 57 69 6d 70 5f  | SWI     "XWimp_|
0000bd90  53 65 6e 64 4d 65 73 73  61 67 65 22 20 20 3b 20  |SendMessage"  ; |
0000bda0  41 63 6b 6e 6f 77 6c 65  64 67 65 20 64 72 61 67  |Acknowledge drag|
0000bdb0  0d 27 b0 21 20 20 20 20  20 20 20 20 20 20 20 20  |.'.!            |
0000bdc0  20 20 20 20 4d 4f 56 53  20 20 20 20 52 34 2c 52  |    MOVS    R4,R|
0000bdd0  34 0d 27 ba 3f 20 20 20  20 20 20 20 20 20 20 20  |4.'.?           |
0000bde0  20 20 20 20 20 42 4c 4e  45 20 20 20 20 64 65 6c  |     BLNE    del|
0000bdf0  73 70 61 72 6b 66 69 6c  65 20 20 20 20 3b 20 44  |sparkfile    ; D|
0000be00  65 6c 65 74 65 20 53 70  61 72 6b 20 66 69 6c 65  |elete Spark file|
0000be10  0d 27 c4 4c 2e 63 61 6e  74 74 72 61 73 68 20 20  |.'.L.canttrash  |
0000be20  20 20 20 20 4c 44 4d 46  44 20 20 20 52 31 33 21  |    LDMFD   R13!|
0000be30  2c 7b 52 30 2d 52 36 2c  52 39 2c 50 43 7d 20 3b  |,{R0-R6,R9,PC} ;|
0000be40  20 52 65 74 75 72 6e 20  28 46 53 20 66 6c 61 67  | Return (FS flag|
0000be50  20 6d 61 79 20 62 65 20  73 65 74 29 0d 27 ce 47  | may be set).'.G|
0000be60  2e 66 61 6b 65 72 65 74  75 72 6e 20 20 20 20 20  |.fakereturn     |
0000be70  4d 4f 56 20 20 20 20 20  50 43 2c 52 31 34 20 20  |MOV     PC,R14  |
0000be80  20 20 20 20 20 20 20 20  3b 20 46 61 6b 65 20 72  |        ; Fake r|
0000be90  65 74 75 72 6e 20 66 6f  72 20 61 6e 69 6d 61 74  |eturn for animat|
0000bea0  69 6f 6e 0d 27 d8 43 2e  62 61 64 72 65 6e 61 6d  |ion.'.C.badrenam|
0000beb0  65 20 20 20 20 20 20 45  51 55 44 20 20 20 20 26  |e      EQUD    &|
0000bec0  31 30 38 42 30 20 20 20  20 20 20 20 20 20 20 3b  |108B0          ;|
0000bed0  20 42 61 64 20 52 45 4e  41 4d 45 20 65 72 72 6f  | Bad RENAME erro|
0000bee0  72 20 63 6f 64 65 0d 27  e2 46 2e 62 61 64 64 69  |r code.'.F.baddi|
0000bef0  73 6b 20 20 20 20 20 20  20 20 45 51 55 44 20 20  |sk        EQUD  |
0000bf00  20 20 26 31 30 38 39 46  20 20 20 20 20 20 20 20  |  &1089F        |
0000bf10  20 20 3b 20 4e 6f 74 20  73 61 6d 65 20 64 69 73  |  ; Not same dis|
0000bf20  63 20 65 72 72 6f 72 20  63 6f 64 65 0d 27 ec 47  |c error code.'.G|
0000bf30  2e 64 6f 75 62 6c 65 63  61 6e 20 20 20 20 20 20  |.doublecan      |
0000bf40  45 51 55 44 20 20 20 20  26 31 30 38 43 34 20 20  |EQUD    &108C4  |
0000bf50  20 20 20 20 20 20 20 20  3b 20 41 6c 72 65 61 64  |        ; Alread|
0000bf60  79 20 65 78 69 73 74 73  20 65 72 72 6f 72 20 63  |y exists error c|
0000bf70  6f 64 65 0d 27 f6 04 0d  28 00 46 3b 20 4e 6f 74  |ode.'...(.F; Not|
0000bf80  65 20 74 68 61 74 20 50  55 42 4c 49 43 20 72 65  |e that PUBLIC re|
0000bf90  61 64 2d 77 72 69 74 65  20 28 2f 57 52 29 20 68  |ad-write (/WR) h|
0000bfa0  61 73 20 ac 20 62 65 65  6e 20 75 73 65 64 20 62  |as . been used b|
0000bfb0  65 63 61 75 73 65 20 61  6e 79 6f 6e 65 0d 28 0a  |ecause anyone.(.|
0000bfc0  4d 3b 20 6f 6e 20 45 63  6f 6e 65 74 20 63 6f 75  |M; on Econet cou|
0000bfd0  6c 64 20 68 61 63 6b 20  61 72 6f 75 6e 64 20 77  |ld hack around w|
0000bfe0  69 74 68 20 74 68 65 20  66 69 6c 65 73 20 77 68  |ith the files wh|
0000bff0  69 6c 73 74 20 74 68 65  79 27 72 65 20 69 6e 20  |ilst they're in |
0000c000  74 68 65 20 74 72 61 73  68 21 0d 28 14 04 0d 28  |the trash!.(...(|
0000c010  1e 40 2e 61 74 74 72 69  62 75 74 65 73 20 20 20  |.@.attributes   |
0000c020  20 20 45 51 55 53 20 20  20 20 22 57 52 22 2b 62  |  EQUS    "WR"+b|
0000c030  6c 24 20 20 20 20 20 20  20 20 3b 20 2a 41 63 63  |l$        ; *Acc|
0000c040  65 73 73 20 61 74 74 72  69 62 75 74 65 73 0d 28  |ess attributes.(|
0000c050  28 19 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |(.              |
0000c060  20 20 41 4c 49 47 4e 0d  28 32 04 0d 28 3c 0f 2e  |  ALIGN.(2..(<..|
0000c070  63 68 65 63 6b 65 72 72  6f 72 0d 28 46 04 0d 28  |checkerror.(F..(|
0000c080  50 41 3b 20 4f 6e 20 65  6e 74 72 79 2c 20 20 20  |PA; On entry,   |
0000c090  20 20 52 30 20 20 20 20  20 20 3d 20 50 6f 69 6e  |  R0      = Poin|
0000c0a0  74 73 20 74 6f 20 61 6e  20 65 72 72 6f 72 20 62  |ts to an error b|
0000c0b0  6c 6f 63 6b 20 28 69 66  20 56 20 73 65 74 29 0d  |lock (if V set).|
0000c0c0  28 5a 4c 3b 20 4f 6e 20  65 78 69 74 2c 20 20 20  |(ZL; On exit,   |
0000c0d0  20 20 20 5a 43 20 20 20  20 20 20 3d 20 4c 54 20  |   ZC      = LT |
0000c0e0  69 66 20 6e 6f 20 65 72  72 6f 72 2c 20 45 51 20  |if no error, EQ |
0000c0f0  69 66 20 4f 4b 20 63 6c  69 63 6b 65 64 2c 20 47  |if OK clicked, G|
0000c100  54 20 69 66 20 43 61 6e  63 65 6c 0d 28 64 04 0d  |T if Cancel.(d..|
0000c110  28 6e 29 20 20 20 20 20  20 20 20 20 20 20 20 20  |(n)             |
0000c120  20 20 20 53 54 4d 46 44  20 20 20 52 31 33 21 2c  |   STMFD   R13!,|
0000c130  7b 52 31 2c 52 31 34 7d  0d 28 78 21 20 20 20 20  |{R1,R14}.(x!    |
0000c140  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 56  |            MOVV|
0000c150  43 20 20 20 52 31 2c 23  30 0d 28 82 29 20 20 20  |C   R1,#0.(.)   |
0000c160  20 20 20 20 20 20 20 20  20 20 20 20 20 42 4c 56  |             BLV|
0000c170  53 20 20 20 20 67 65 6e  65 72 61 74 65 65 72 72  |S    generateerr|
0000c180  6f 72 0d 28 8c 43 20 20  20 20 20 20 20 20 20 20  |or.(.C          |
0000c190  20 20 20 20 20 20 43 4d  50 20 20 20 20 20 52 31  |      CMP     R1|
0000c1a0  2c 23 31 20 20 20 20 20  20 20 20 20 20 20 3b 20  |,#1           ; |
0000c1b0  54 61 63 6b 79 2c 20 62  75 74 20 69 74 20 77 6f  |Tacky, but it wo|
0000c1c0  72 6b 73 20 21 0d 28 96  28 20 20 20 20 20 20 20  |rks !.(.(       |
0000c1d0  20 20 20 20 20 20 20 20  20 4c 44 4d 46 44 20 20  |         LDMFD  |
0000c1e0  20 52 31 33 21 2c 7b 52  31 2c 50 43 7d 0d 28 a0  | R13!,{R1,PC}.(.|
0000c1f0  04 0d 28 aa 12 2e 67 65  6e 65 72 61 74 65 65 72  |..(...generateer|
0000c200  72 6f 72 0d 28 b4 04 0d  28 be 36 3b 20 4f 6e 20  |ror.(...(.6; On |
0000c210  65 6e 74 72 79 2c 20 20  20 20 20 52 30 20 20 20  |entry,     R0   |
0000c220  20 20 20 3d 20 50 6f 69  6e 74 73 20 74 6f 20 61  |   = Points to a|
0000c230  6e 20 65 72 72 6f 72 20  62 6c 6f 63 6b 0d 28 c8  |n error block.(.|
0000c240  42 3b 20 4f 6e 20 65 78  69 74 2c 20 20 20 20 20  |B; On exit,     |
0000c250  20 52 31 20 20 20 20 20  20 3d 20 31 20 69 66 20  | R1      = 1 if |
0000c260  4f 4b 20 63 6c 69 63 6b  65 64 2c 20 32 20 69 66  |OK clicked, 2 if|
0000c270  20 43 61 6e 63 65 6c 20  63 6c 69 63 6b 65 64 0d  | Cancel clicked.|
0000c280  28 d2 04 0d 28 dc 2c 20  20 20 20 20 20 20 20 20  |(...(.,         |
0000c290  20 20 20 20 20 20 20 53  54 4d 46 44 20 20 20 52  |       STMFD   R|
0000c2a0  31 33 21 2c 7b 52 30 2c  52 32 2c 52 31 34 7d 0d  |13!,{R0,R2,R14}.|
0000c2b0  28 e6 47 20 20 20 20 20  20 20 20 20 20 20 20 20  |(.G             |
0000c2c0  20 20 20 4d 4f 56 20 20  20 20 20 52 31 2c 23 25  |   MOV     R1,#%|
0000c2d0  30 30 30 30 30 31 31 20  20 20 20 3b 20 4f 4b 20  |0000011    ; OK |
0000c2e0  26 20 43 61 6e 63 65 6c  2c 20 48 69 67 68 6c 69  |& Cancel, Highli|
0000c2f0  67 68 74 20 4f 4b 0d 28  f0 28 20 20 20 20 20 20  |ght OK.(.(      |
0000c300  20 20 20 20 20 20 20 20  20 20 41 44 52 20 20 20  |          ADR   |
0000c310  20 20 52 32 2c 65 72 72  6f 72 6e 61 6d 65 0d 28  |  R2,errorname.(|
0000c320  fa 3a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.:              |
0000c330  20 20 53 57 49 20 20 20  20 20 22 58 57 69 6d 70  |  SWI     "XWimp|
0000c340  5f 52 65 70 6f 72 74 45  72 72 6f 72 22 20 3b 20  |_ReportError" ; |
0000c350  49 49 49 2d 31 32 34 33  0d 29 04 46 20 20 20 20  |III-1243.).F    |
0000c360  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 20  |            MOV |
0000c370  20 20 20 20 52 30 2c 23  30 20 20 20 20 20 20 20  |    R0,#0       |
0000c380  20 20 20 20 3b 20 57 69  6d 70 5f 52 65 70 6f 72  |    ; Wimp_Repor|
0000c390  74 45 72 72 6f 72 20 64  6f 65 73 20 61 6e 0d 29  |tError does an.)|
0000c3a0  0e 49 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.I              |
0000c3b0  20 20 53 54 52 42 20 20  20 20 52 30 2c 67 6c 61  |  STRB    R0,gla|
0000c3c0  73 73 73 74 61 74 20 20  20 20 3b 20 48 6f 75 72  |ssstat    ; Hour|
0000c3d0  67 6c 61 73 73 5f 53 6d  61 73 68 2c 20 73 6f 20  |glass_Smash, so |
0000c3e0  6e 65 65 64 20 74 6f 0d  29 18 3f 20 20 20 20 20  |need to.).?     |
0000c3f0  20 20 20 20 20 20 20 20  20 20 20 42 4c 20 20 20  |           BL   |
0000c400  20 20 20 73 74 61 72 74  67 6c 61 73 73 20 20 20  |   startglass   |
0000c410  20 20 20 3b 20 73 74 61  72 74 20 69 74 20 75 70  |   ; start it up|
0000c420  20 61 67 61 69 6e 0d 29  22 2b 20 20 20 20 20 20  | again.)"+      |
0000c430  20 20 20 20 20 20 20 20  20 20 4c 44 4d 46 44 20  |          LDMFD |
0000c440  20 20 52 31 33 21 2c 7b  52 30 2c 52 32 2c 50 43  |  R13!,{R0,R2,PC|
0000c450  7d 0d 29 2c 25 2e 65 72  72 6f 72 6e 61 6d 65 20  |}.),%.errorname |
0000c460  20 20 20 20 20 45 51 55  53 20 20 20 20 70 72 6f  |     EQUS    pro|
0000c470  67 24 2b 62 6c 24 0d 29  36 19 20 20 20 20 20 20  |g$+bl$.)6.      |
0000c480  20 20 20 20 20 20 20 20  20 20 41 4c 49 47 4e 0d  |          ALIGN.|
0000c490  29 40 04 0d 29 4a 0f 2e  73 74 61 72 74 67 6c 61  |)@..)J..startgla|
0000c4a0  73 73 0d 29 54 04 0d 29  5e 48 3b 20 53 77 69 74  |ss.)T..)^H; Swit|
0000c4b0  63 68 20 6f 6e 20 48 6f  75 72 67 6c 61 73 73 20  |ch on Hourglass |
0000c4c0  28 62 75 73 79 20 64 65  6c 61 79 20 3d 20 31 20  |(busy delay = 1 |
0000c4d0  73 65 63 6f 6e 64 29 2c  20 62 75 74 20 6f 6e 6c  |second), but onl|
0000c4e0  79 20 69 66 20 69 74 20  69 73 20 6f 66 66 0d 29  |y if it is off.)|
0000c4f0  68 04 0d 29 72 29 20 20  20 20 20 20 20 20 20 20  |h..)r)          |
0000c500  20 20 20 20 20 20 53 54  4d 46 44 20 20 20 52 31  |      STMFD   R1|
0000c510  33 21 2c 7b 52 30 2c 52  31 34 7d 0d 29 7c 28 20  |3!,{R0,R14}.)|( |
0000c520  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
0000c530  44 52 42 20 20 20 20 52  30 2c 67 6c 61 73 73 73  |DRB    R0,glasss|
0000c540  74 61 74 0d 29 86 21 20  20 20 20 20 20 20 20 20  |tat.).!         |
0000c550  20 20 20 20 20 20 20 4d  4f 56 53 20 20 20 20 52  |       MOVS    R|
0000c560  30 2c 52 30 0d 29 90 3c  20 20 20 20 20 20 20 20  |0,R0.).<        |
0000c570  20 20 20 20 20 20 20 20  ec 51 20 20 20 52 30 2c  |        .Q   R0,|
0000c580  23 31 30 30 20 20 20 20  20 20 20 20 20 3b 20 31  |#100         ; 1|
0000c590  20 73 65 63 6f 6e 64 20  74 6f 20 73 74 61 72 74  | second to start|
0000c5a0  0d 29 9a 28 20 20 20 20  20 20 20 20 20 20 20 20  |.).(            |
0000c5b0  20 20 20 20 53 54 52 45  51 42 20 20 52 30 2c 67  |    STREQB  R0,g|
0000c5c0  6c 61 73 73 73 74 61 74  0d 29 a4 38 20 20 20 20  |lassstat.).8    |
0000c5d0  20 20 20 20 20 20 20 20  20 20 20 20 53 57 49 45  |            SWIE|
0000c5e0  51 20 20 20 22 58 48 6f  75 72 67 6c 61 73 73 5f  |Q   "XHourglass_|
0000c5f0  53 74 61 72 74 22 20 3b  20 49 56 2d 31 33 39 33  |Start" ; IV-1393|
0000c600  0d 29 ae 28 20 20 20 20  20 20 20 20 20 20 20 20  |.).(            |
0000c610  20 20 20 20 4c 44 4d 46  44 20 20 20 52 31 33 21  |    LDMFD   R13!|
0000c620  2c 7b 52 30 2c 50 43 7d  0d 29 b8 04 0d 29 c2 0e  |,{R0,PC}.)...)..|
0000c630  2e 73 74 6f 70 67 6c 61  73 73 0d 29 cc 04 0d 29  |.stopglass.)...)|
0000c640  d6 30 3b 20 53 77 69 74  63 68 20 6f 66 66 20 48  |.0; Switch off H|
0000c650  6f 75 72 67 6c 61 73 73  2c 20 62 75 74 20 6f 6e  |ourglass, but on|
0000c660  6c 79 20 69 66 20 69 74  20 69 73 20 6f 6e 0d 29  |ly if it is on.)|
0000c670  e0 04 0d 29 ea 29 20 20  20 20 20 20 20 20 20 20  |...).)          |
0000c680  20 20 20 20 20 20 53 54  4d 46 44 20 20 20 52 31  |      STMFD   R1|
0000c690  33 21 2c 7b 52 30 2c 52  31 34 7d 0d 29 f4 28 20  |3!,{R0,R14}.).( |
0000c6a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
0000c6b0  44 52 42 20 20 20 20 52  30 2c 67 6c 61 73 73 73  |DRB    R0,glasss|
0000c6c0  74 61 74 0d 29 fe 21 20  20 20 20 20 20 20 20 20  |tat.).!         |
0000c6d0  20 20 20 20 20 20 20 4d  4f 56 53 20 20 20 20 52  |       MOVS    R|
0000c6e0  30 2c 52 30 0d 2a 08 21  20 20 20 20 20 20 20 20  |0,R0.*.!        |
0000c6f0  20 20 20 20 20 20 20 20  4d 4f 56 4e 45 20 20 20  |        MOVNE   |
0000c700  52 30 2c 23 30 0d 2a 12  28 20 20 20 20 20 20 20  |R0,#0.*.(       |
0000c710  20 20 20 20 20 20 20 20  20 53 54 52 4e 45 42 20  |         STRNEB |
0000c720  20 52 30 2c 67 6c 61 73  73 73 74 61 74 0d 2a 1c  | R0,glassstat.*.|
0000c730  36 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |6               |
0000c740  20 53 57 49 4e 45 20 20  20 22 58 48 6f 75 72 67  | SWINE   "XHourg|
0000c750  6c 61 73 73 5f 4f 66 66  22 20 3b 20 49 56 2d 31  |lass_Off" ; IV-1|
0000c760  33 39 31 0d 2a 26 28 20  20 20 20 20 20 20 20 20  |391.*&(         |
0000c770  20 20 20 20 20 20 20 4c  44 4d 46 44 20 20 20 52  |       LDMFD   R|
0000c780  31 33 21 2c 7b 52 30 2c  50 43 7d 0d 2a 30 04 0d  |13!,{R0,PC}.*0..|
0000c790  2a 3a 0b 2e 62 79 65 62  79 65 0d 2a 44 04 0d 2a  |*:..byebye.*D..*|
0000c7a0  4e 49 3b 20 54 68 69 73  20 72 6f 75 74 69 6e 65  |NI; This routine|
0000c7b0  20 69 73 20 63 61 6c 6c  65 64 20 77 68 65 6e 20  | is called when |
0000c7c0  74 68 65 20 6d 6f 64 75  6c 65 20 69 73 20 2a 52  |the module is *R|
0000c7d0  4d 4b 69 6c 6c 65 64 20  6f 72 20 2a 52 4d 52 65  |MKilled or *RMRe|
0000c7e0  49 6e 69 74 65 64 2e 0d  2a 58 04 0d 2a 62 29 20  |Inited..*X..*b) |
0000c7f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
0000c800  54 4d 46 44 20 20 20 52  31 33 21 2c 7b 52 32 2c  |TMFD   R13!,{R2,|
0000c810  52 31 34 7d 0d 2a 6c 4c  20 20 20 20 20 20 20 20  |R14}.*lL        |
0000c820  20 20 20 20 20 20 20 20  4c 44 52 20 20 20 20 20  |        LDR     |
0000c830  52 32 2c 77 6f 72 6b 73  70 61 63 65 20 20 20 20  |R2,workspace    |
0000c840  20 20 20 20 20 20 20 20  3b 20 46 72 65 65 20 28  |        ; Free (|
0000c850  61 6e 79 29 20 73 74 61  63 6b 20 73 70 61 63 65  |any) stack space|
0000c860  0d 2a 76 48 20 20 20 20  20 20 20 20 20 20 20 20  |.*vH            |
0000c870  20 20 20 20 53 55 42 53  20 20 20 20 52 32 2c 52  |    SUBS    R2,R|
0000c880  32 2c 23 73 74 61 63 6b  73 70 61 63 65 25 20 20  |2,#stackspace%  |
0000c890  20 20 20 20 3b 20 50 6f  69 6e 74 20 74 6f 20 52  |    ; Point to R|
0000c8a0  4d 41 20 73 74 61 72 74  0d 2a 80 26 20 20 20 20  |MA start.*.&    |
0000c8b0  20 20 20 20 20 20 20 20  20 20 20 20 42 4c 50 4c  |            BLPL|
0000c8c0  20 20 20 20 72 65 6c 65  61 73 65 52 4d 41 0d 2a  |    releaseRMA.*|
0000c8d0  8a 4a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.J              |
0000c8e0  20 20 4c 44 52 50 4c 20  20 20 52 32 2c 77 69 6e  |  LDRPL   R2,win|
0000c8f0  64 6f 77 73 70 61 63 65  20 20 20 20 20 20 20 20  |dowspace        |
0000c900  20 20 3b 20 52 65 6c 65  61 73 65 20 77 69 6e 64  |  ; Release wind|
0000c910  6f 77 20 73 70 61 63 65  0d 2a 94 26 20 20 20 20  |ow space.*.&    |
0000c920  20 20 20 20 20 20 20 20  20 20 20 20 42 4c 50 4c  |            BLPL|
0000c930  20 20 20 20 72 65 6c 65  61 73 65 52 4d 41 0d 2a  |    releaseRMA.*|
0000c940  9e 49 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.I              |
0000c950  20 20 4c 44 52 50 4c 20  20 20 52 32 2c 73 70 72  |  LDRPL   R2,spr|
0000c960  69 74 65 61 72 65 61 20  20 20 20 20 20 20 20 20  |itearea         |
0000c970  20 20 3b 20 52 65 6c 65  61 73 65 20 73 70 72 69  |  ; Release spri|
0000c980  74 65 20 61 72 65 61 0d  2a a8 26 20 20 20 20 20  |te area.*.&     |
0000c990  20 20 20 20 20 20 20 20  20 20 20 42 4c 50 4c 20  |           BLPL |
0000c9a0  20 20 20 72 65 6c 65 61  73 65 52 4d 41 0d 2a b2  |   releaseRMA.*.|
0000c9b0  4b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |K               |
0000c9c0  20 42 4c 20 20 20 20 20  20 77 69 6d 70 63 6c 6f  | BL      wimpclo|
0000c9d0  73 65 64 6f 77 6e 20 20  20 20 20 20 20 20 20 20  |sedown          |
0000c9e0  20 3b 20 53 68 75 74 20  64 6f 77 6e 20 61 63 74  | ; Shut down act|
0000c9f0  69 76 65 20 74 61 73 6b  0d 2a bc 21 20 20 20 20  |ive task.*.!    |
0000ca00  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 20  |            MOV |
0000ca10  20 20 20 20 52 32 2c 23  30 0d 2a c6 44 20 20 20  |    R2,#0.*.D   |
0000ca20  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 52  |             STR|
0000ca30  20 20 20 20 20 52 32 2c  77 6f 72 6b 73 70 61 63  |     R2,workspac|
0000ca40  65 20 20 20 20 20 20 3b  20 43 6c 65 61 72 20 77  |e      ; Clear w|
0000ca50  6f 72 6b 73 70 61 63 65  20 66 6c 61 67 0d 2a d0  |orkspace flag.*.|
0000ca60  28 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |(               |
0000ca70  20 4c 44 4d 46 44 20 20  20 52 31 33 21 2c 7b 52  | LDMFD   R13!,{R|
0000ca80  32 2c 50 43 7d 0d 2a da  04 0d 2a e4 2c 2e 72 65  |2,PC}.*...*.,.re|
0000ca90  61 64 43 4d 4f 53 20 20  20 20 20 20 20 53 54 4d  |adCMOS       STM|
0000caa0  46 44 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 32  |FD   R13!,{R0-R2|
0000cab0  2c 52 31 34 7d 0d 2a ee  48 20 20 20 20 20 20 20  |,R14}.*.H       |
0000cac0  20 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |         MOV    |
0000cad0  20 52 30 2c 23 31 36 31  20 20 20 20 20 20 20 20  | R0,#161        |
0000cae0  20 3b 20 52 65 61 64 20  43 4d 4f 53 20 52 41 4d  | ; Read CMOS RAM|
0000caf0  20 74 6f 20 67 65 74 20  73 61 76 65 64 0d 2a f8  | to get saved.*.|
0000cb00  46 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |F               |
0000cb10  20 4d 4f 56 20 20 20 20  20 52 31 2c 23 62 61 74  | MOV     R1,#bat|
0000cb20  74 65 72 79 25 20 20 20  20 3b 20 73 65 74 74 69  |tery%    ; setti|
0000cb30  6e 67 73 20 6f 66 20 6d  65 6e 75 20 6f 70 74 69  |ngs of menu opti|
0000cb40  6f 6e 73 0d 2b 02 34 20  20 20 20 20 20 20 20 20  |ons.+.4         |
0000cb50  20 20 20 20 20 20 20 53  57 49 20 20 20 20 20 22  |       SWI     "|
0000cb60  58 4f 53 5f 42 79 74 65  22 20 20 20 20 20 20 3b  |XOS_Byte"      ;|
0000cb70  20 49 49 2d 37 38 37 0d  2b 0c 49 20 20 20 20 20  | II-787.+.I     |
0000cb80  20 20 20 20 20 20 20 20  20 20 20 53 54 52 42 20  |           STRB |
0000cb90  20 20 20 52 32 2c 43 4d  4f 53 62 79 74 65 20 20  |   R2,CMOSbyte  |
0000cba0  20 20 20 3b 20 53 61 76  65 20 66 6f 72 20 6c 61  |   ; Save for la|
0000cbb0  74 65 72 20 6d 6f 64 69  66 69 63 61 74 69 6f 6e  |ter modification|
0000cbc0  0d 2b 16 4b 20 20 20 20  20 20 20 20 20 20 20 20  |.+.K            |
0000cbd0  20 20 20 20 4c 44 52 20  20 20 20 20 52 30 2c 69  |    LDR     R0,i|
0000cbe0  6d 6d 65 64 69 61 74 65  73 74 61 74 20 20 3b 20  |mmediatestat  ; |
0000cbf0  43 6f 6e 66 69 67 75 72  65 20 74 69 63 6b 20 6f  |Configure tick o|
0000cc00  6e 20 49 6d 6d 65 64 69  61 74 65 0d 2b 20 39 20  |n Immediate.+ 9 |
0000cc10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
0000cc20  4f 56 20 20 20 20 20 52  31 2c 23 25 30 30 31 20  |OV     R1,#%001 |
0000cc30  20 20 20 20 20 20 20 3b  20 42 69 74 20 30 20 66  |       ; Bit 0 f|
0000cc40  69 72 73 74 0d 2b 2a 26  20 20 20 20 20 20 20 20  |irst.+*&        |
0000cc50  20 20 20 20 20 20 20 20  42 4c 20 20 20 20 20 20  |        BL      |
0000cc60  74 77 69 64 64 6c 65 62  69 74 0d 2b 34 2c 20 20  |twiddlebit.+4,  |
0000cc70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 53 54  |              ST|
0000cc80  52 20 20 20 20 20 52 30  2c 69 6d 6d 65 64 69 61  |R     R0,immedia|
0000cc90  74 65 73 74 61 74 0d 2b  3e 47 20 20 20 20 20 20  |testat.+>G      |
0000cca0  20 20 20 20 20 20 20 20  20 20 4c 44 52 20 20 20  |          LDR   |
0000ccb0  20 20 52 30 2c 77 61 72  6e 69 6e 67 73 74 61 74  |  R0,warningstat|
0000ccc0  20 20 3b 20 43 6f 6e 66  69 67 75 72 65 20 74 69  |  ; Configure ti|
0000ccd0  63 6b 20 6f 6e 20 57 61  72 6e 69 6e 67 0d 2b 48  |ck on Warning.+H|
0000cce0  26 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |&               |
0000ccf0  20 42 4c 20 20 20 20 20  20 74 77 69 64 64 6c 65  | BL      twiddle|
0000cd00  62 69 74 0d 2b 52 2a 20  20 20 20 20 20 20 20 20  |bit.+R*         |
0000cd10  20 20 20 20 20 20 20 53  54 52 20 20 20 20 20 52  |       STR     R|
0000cd20  30 2c 77 61 72 6e 69 6e  67 73 74 61 74 0d 2b 5c  |0,warningstat.+\|
0000cd30  4a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |J               |
0000cd40  20 4c 44 52 20 20 20 20  20 52 30 2c 61 6e 69 6d  | LDR     R0,anim|
0000cd50  61 74 69 6f 6e 73 74 61  74 20 3b 20 43 6f 6e 66  |ationstat ; Conf|
0000cd60  69 67 75 72 65 20 74 69  63 6b 20 6f 6e 20 41 6e  |igure tick on An|
0000cd70  69 6d 61 74 69 6f 6e 0d  2b 66 26 20 20 20 20 20  |imation.+f&     |
0000cd80  20 20 20 20 20 20 20 20  20 20 20 42 4c 20 20 20  |           BL   |
0000cd90  20 20 20 74 77 69 64 64  6c 65 62 69 74 0d 2b 70  |   twiddlebit.+p|
0000cda0  2c 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |,               |
0000cdb0  20 53 54 52 20 20 20 20  20 52 30 2c 61 6e 69 6d  | STR     R0,anim|
0000cdc0  61 74 69 6f 6e 73 74 61  74 0d 2b 7a 2b 20 20 20  |ationstat.+z+   |
0000cdd0  20 20 20 20 20 20 20 20  20 20 20 20 20 4c 44 4d  |             LDM|
0000cde0  46 44 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 32  |FD   R13!,{R0-R2|
0000cdf0  2c 50 43 7d 0d 2b 84 04  0d 2b 8e 0f 2e 74 77 69  |,PC}.+...+...twi|
0000ce00  64 64 6c 65 62 69 74 0d  2b 98 04 0d 2b a2 2e 3b  |ddlebit.+...+..;|
0000ce10  20 4f 6e 20 65 6e 74 72  79 2c 20 20 20 20 20 52  | On entry,     R|
0000ce20  30 20 20 20 20 20 20 3d  20 4d 65 6e 75 20 73 74  |0      = Menu st|
0000ce30  61 74 75 73 20 77 6f 72  64 0d 2b ac 30 3b 20 20  |atus word.+.0;  |
0000ce40  20 20 20 20 20 20 20 20  20 20 20 20 20 52 31 20  |             R1 |
0000ce50  20 20 20 20 20 3d 20 42  69 74 20 6d 61 73 6b 20  |     = Bit mask |
0000ce60  6f 66 20 73 74 61 74 75  73 0d 2b b6 29 3b 20 20  |of status.+.);  |
0000ce70  20 20 20 20 20 20 20 20  20 20 20 20 20 52 32 20  |             R2 |
0000ce80  20 20 20 20 20 3d 20 53  74 61 74 75 73 20 62 79  |     = Status by|
0000ce90  74 65 0d 2b c0 3b 3b 20  4f 6e 20 65 78 69 74 2c  |te.+.;; On exit,|
0000cea0  20 20 20 20 20 20 52 30  20 20 20 20 20 20 3d 20  |      R0      = |
0000ceb0  4e 65 77 20 76 61 6c 75  65 20 6f 66 20 6d 65 6e  |New value of men|
0000cec0  75 20 73 74 61 74 75 73  20 77 6f 72 64 0d 2b ca  |u status word.+.|
0000ced0  2f 3b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |/;              |
0000cee0  20 52 31 20 20 20 20 20  20 3d 20 53 68 69 66 74  | R1      = Shift|
0000cef0  65 64 20 6c 65 66 74 20  62 79 20 31 0d 2b d4 04  |ed left by 1.+..|
0000cf00  0d 2b de 29 20 20 20 20  20 20 20 20 20 20 20 20  |.+.)            |
0000cf10  20 20 20 20 53 54 4d 46  44 20 20 20 52 31 33 21  |    STMFD   R13!|
0000cf20  2c 7b 52 32 2c 52 31 34  7d 0d 2b e8 48 20 20 20  |,{R2,R14}.+.H   |
0000cf30  20 20 20 20 20 20 20 20  20 20 20 20 20 42 49 43  |             BIC|
0000cf40  20 20 20 20 20 52 30 2c  52 30 2c 23 28 31 3c 3c  |     R0,R0,#(1<<|
0000cf50  30 29 20 20 20 3b 20 43  6c 65 61 72 20 66 6c 61  |0)   ; Clear fla|
0000cf60  67 20 62 69 74 20 28 30  29 20 6f 6e 20 6d 65 6e  |g bit (0) on men|
0000cf70  75 0d 2b f2 22 20 20 20  20 20 20 20 20 20 20 20  |u.+."           |
0000cf80  20 20 20 20 20 80 53 20  20 20 20 52 32 2c 52 32  |     .S    R2,R2|
0000cf90  2c 52 31 0d 2b fc 48 20  20 20 20 20 20 20 20 20  |,R1.+.H         |
0000cfa0  20 20 20 20 20 20 20 84  52 4e 45 20 20 20 52 30  |       .RNE   R0|
0000cfb0  2c 52 30 2c 23 28 31 3c  3c 30 29 20 20 20 3b 20  |,R0,#(1<<0)   ; |
0000cfc0  53 65 74 20 66 6c 61 67  20 62 69 74 20 69 66 20  |Set flag bit if |
0000cfd0  73 77 69 74 63 68 65 64  20 6f 6e 0d 2c 06 4b 20  |switched on.,.K |
0000cfe0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
0000cff0  4f 56 20 20 20 20 20 52  31 2c 52 31 2c 41 53 4c  |OV     R1,R1,ASL|
0000d000  20 23 31 20 20 20 20 3b  20 4e 65 78 74 20 6d 65  | #1    ; Next me|
0000d010  6e 75 20 69 73 20 31 20  62 69 74 20 6f 6e 20 69  |nu is 1 bit on i|
0000d020  6e 20 43 4d 4f 53 0d 2c  10 28 20 20 20 20 20 20  |n CMOS.,.(      |
0000d030  20 20 20 20 20 20 20 20  20 20 4c 44 4d 46 44 20  |          LDMFD |
0000d040  20 20 52 31 33 21 2c 7b  52 32 2c 50 43 7d 0d 2c  |  R13!,{R2,PC}.,|
0000d050  1a 04 0d 2c 24 0e 2e 74  6f 67 67 6c 65 62 69 74  |...,$..togglebit|
0000d060  0d 2c 2e 04 0d 2c 38 38  3b 20 4f 6e 20 65 6e 74  |.,...,88; On ent|
0000d070  72 79 2c 20 20 20 20 20  52 30 20 20 20 20 20 20  |ry,     R0      |
0000d080  3d 20 42 69 74 20 70 6f  73 69 74 69 6f 6e 20 74  |= Bit position t|
0000d090  6f 20 62 65 20 74 6f 67  67 6c 65 64 0d 2c 42 04  |o be toggled.,B.|
0000d0a0  0d 2c 4c 2c 20 20 20 20  20 20 20 20 20 20 20 20  |.,L,            |
0000d0b0  20 20 20 20 53 54 4d 46  44 20 20 20 52 31 33 21  |    STMFD   R13!|
0000d0c0  2c 7b 52 30 2d 52 32 2c  52 31 34 7d 0d 2c 56 47  |,{R0-R2,R14}.,VG|
0000d0d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000d0e0  4d 4f 56 20 20 20 20 20  52 31 2c 23 31 20 20 20  |MOV     R1,#1   |
0000d0f0  20 20 20 20 20 20 20 20  3b 20 53 74 72 61 69 67  |        ; Straig|
0000d100  68 74 66 6f 72 77 61 72  64 20 82 20 28 31 3c 3c  |htforward . (1<<|
0000d110  52 30 29 0d 2c 60 45 20  20 20 20 20 20 20 20 20  |R0).,`E         |
0000d120  20 20 20 20 20 20 20 4c  44 52 42 20 20 20 20 52  |       LDRB    R|
0000d130  32 2c 43 4d 4f 53 62 79  74 65 20 20 20 20 20 3b  |2,CMOSbyte     ;|
0000d140  20 46 6c 69 70 20 62 69  74 20 52 30 20 69 6e 20  | Flip bit R0 in |
0000d150  43 4d 4f 53 20 52 41 4d  0d 2c 6a 29 20 20 20 20  |CMOS RAM.,j)    |
0000d160  20 20 20 20 20 20 20 20  20 20 20 20 82 20 20 20  |            .   |
0000d170  20 20 52 32 2c 52 32 2c  52 31 2c 41 53 4c 20 52  |  R2,R2,R1,ASL R|
0000d180  30 0d 2c 74 23 20 20 20  20 20 20 20 20 20 20 20  |0.,t#           |
0000d190  20 20 20 20 20 4d 4f 56  20 20 20 20 20 52 30 2c  |     MOV     R0,|
0000d1a0  23 31 36 32 0d 2c 7e 28  20 20 20 20 20 20 20 20  |#162.,~(        |
0000d1b0  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
0000d1c0  52 31 2c 23 62 61 74 74  65 72 79 25 0d 2c 88 45  |R1,#battery%.,.E|
0000d1d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000d1e0  53 57 49 20 20 20 20 20  22 58 4f 53 5f 42 79 74  |SWI     "XOS_Byt|
0000d1f0  65 22 20 20 20 20 20 20  3b 20 55 70 64 61 74 65  |e"      ; Update|
0000d200  20 43 4d 4f 53 20 52 41  4d 2e 20 49 49 2d 37 38  | CMOS RAM. II-78|
0000d210  38 0d 2c 92 4e 20 20 20  20 20 20 20 20 20 20 20  |8.,.N           |
0000d220  20 20 20 20 20 42 4c 20  20 20 20 20 20 72 65 61  |     BL      rea|
0000d230  64 43 4d 4f 53 20 20 20  20 20 20 20 20 3b 20 52  |dCMOS        ; R|
0000d240  65 2d 72 65 61 64 20 27  63 6f 73 20 6d 65 6e 75  |e-read 'cos menu|
0000d250  20 6f 70 74 69 6f 6e 20  63 68 61 6e 67 65 64 0d  | option changed.|
0000d260  2c 9c 2b 20 20 20 20 20  20 20 20 20 20 20 20 20  |,.+             |
0000d270  20 20 20 4c 44 4d 46 44  20 20 20 52 31 33 21 2c  |   LDMFD   R13!,|
0000d280  7b 52 30 2d 52 32 2c 50  43 7d 0d 2c a6 04 0d 2c  |{R0-R2,PC}.,...,|
0000d290  b0 11 2e 64 65 61 6c 77  69 74 68 6d 65 6e 75 0d  |...dealwithmenu.|
0000d2a0  2c ba 04 0d 2c c4 38 3b  20 4f 6e 20 65 6e 74 72  |,...,.8; On entr|
0000d2b0  79 2c 20 20 20 20 20 52  31 20 20 20 20 20 20 3d  |y,     R1      =|
0000d2c0  20 50 6f 69 6e 74 65 72  20 74 6f 20 57 69 6d 70  | Pointer to Wimp|
0000d2d0  5f 50 6f 6c 6c 20 62 6c  6f 63 6b 0d 2c ce 04 0d  |_Poll block.,...|
0000d2e0  2c d8 36 20 20 20 20 20  20 20 20 20 20 20 20 20  |,.6             |
0000d2f0  20 20 20 53 54 4d 46 44  20 20 20 52 31 33 21 2c  |   STMFD   R13!,|
0000d300  7b 52 30 2d 52 32 2c 52  36 2c 52 39 2c 52 31 30  |{R0-R2,R6,R9,R10|
0000d310  2c 52 31 34 7d 0d 2c e2  46 20 20 20 20 20 20 20  |,R14}.,.F       |
0000d320  20 20 20 20 20 20 20 20  20 4c 44 52 20 20 20 20  |         LDR    |
0000d330  20 52 30 2c 5b 52 31 5d  20 20 20 20 20 20 20 20  | R0,[R1]        |
0000d340  20 3b 20 47 65 74 20 69  74 65 6d 20 6e 75 6d 62  | ; Get item numb|
0000d350  65 72 20 28 66 72 6f 6d  20 30 29 0d 2c ec 21 20  |er (from 0).,.! |
0000d360  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
0000d370  4f 56 53 20 20 20 20 52  30 2c 52 30 0d 2c f6 49  |OVS    R0,R0.,.I|
0000d380  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000d390  42 45 51 20 20 20 20 20  69 67 6e 6f 72 65 6d 65  |BEQ     ignoreme|
0000d3a0  6e 75 20 20 20 20 20 20  3b 20 49 74 65 6d 20 23  |nu      ; Item #|
0000d3b0  31 20 3d 20 49 6e 66 6f  20 28 64 6f 20 6e 6f 74  |1 = Info (do not|
0000d3c0  68 69 6e 67 29 0d 2d 00  3c 20 20 20 20 20 20 20  |hing).-.<       |
0000d3d0  20 20 20 20 20 20 20 20  20 43 4d 50 20 20 20 20  |         CMP    |
0000d3e0  20 52 30 2c 23 35 20 20  20 20 20 20 20 20 20 20  | R0,#5          |
0000d3f0  20 3b 20 49 74 65 6d 20  23 36 20 3d 20 51 75 69  | ; Item #6 = Qui|
0000d400  74 0d 2d 0a 26 20 20 20  20 20 20 20 20 20 20 20  |t.-.&           |
0000d410  20 20 20 20 20 4c 44 52  45 51 20 20 20 52 39 2c  |     LDREQ   R9,|
0000d420  5b 52 31 2c 23 34 5d 0d  2d 14 24 20 20 20 20 20  |[R1,#4].-.$     |
0000d430  20 20 20 20 20 20 20 20  20 20 20 42 45 51 20 20  |           BEQ  |
0000d440  20 20 20 6c 65 61 76 65  6e 6f 77 0d 2d 1e 43 20  |   leavenow.-.C |
0000d450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 43  |               C|
0000d460  4d 50 20 20 20 20 20 52  30 2c 23 34 20 20 20 20  |MP     R0,#4    |
0000d470  20 20 20 20 20 20 20 3b  20 49 74 65 6d 20 23 35  |       ; Item #5|
0000d480  20 3d 20 45 6d 70 74 79  20 54 72 61 73 68 0d 2d  | = Empty Trash.-|
0000d490  28 28 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |((              |
0000d4a0  20 20 42 45 51 20 20 20  20 20 64 6f 74 68 65 62  |  BEQ     dotheb|
0000d4b0  69 6e 6e 69 6e 67 0d 2d  32 4e 3b 20 49 74 20 69  |inning.-2N; It i|
0000d4c0  74 20 67 65 74 73 20 68  65 72 65 2c 20 74 68 65  |t gets here, the|
0000d4d0  6e 20 6d 75 73 74 20 62  65 20 49 74 65 6d 73 20  |n must be Items |
0000d4e0  23 32 2d 34 20 28 49 6d  6d 65 64 69 61 74 65 2c  |#2-4 (Immediate,|
0000d4f0  20 57 61 72 6e 69 6e 67  2c 20 41 6e 69 6d 61 74  | Warning, Animat|
0000d500  69 6f 6e 29 0d 2d 3c 48  20 20 20 20 20 20 20 20  |ion).-<H        |
0000d510  20 20 20 20 20 20 20 20  53 55 42 20 20 20 20 20  |        SUB     |
0000d520  52 30 2c 52 30 2c 23 31  20 20 20 20 20 20 20 20  |R0,R0,#1        |
0000d530  3b 20 49 6e 76 65 72 74  20 74 69 63 6b 20 6f 6e  |; Invert tick on|
0000d540  20 61 70 70 72 6f 70 72  69 61 74 65 0d 2d 46 4a  | appropriate.-FJ|
0000d550  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000d560  42 4c 20 20 20 20 20 20  74 6f 67 67 6c 65 62 69  |BL      togglebi|
0000d570  74 20 20 20 20 20 20 20  3b 20 6d 65 6e 75 20 28  |t       ; menu (|
0000d580  75 70 64 61 74 69 6e 67  20 43 4d 4f 53 20 52 41  |updating CMOS RA|
0000d590  4d 20 74 6f 6f 29 0d 2d  50 43 20 20 20 20 20 20  |M too).-PC      |
0000d5a0  20 20 20 20 20 20 20 20  20 20 4d 4f 56 53 20 20  |          MOVS  |
0000d5b0  20 20 52 30 2c 52 30 20  20 20 20 20 20 20 20 20  |  R0,R0         |
0000d5c0  20 20 3b 20 53 6b 69 70  20 69 66 20 6e 6f 74 20  |  ; Skip if not |
0000d5d0  49 6d 6d 65 64 69 61 74  65 0d 2d 5a 26 20 20 20  |Immediate.-Z&   |
0000d5e0  20 20 20 20 20 20 20 20  20 20 20 20 20 42 4e 45  |             BNE|
0000d5f0  20 20 20 20 20 69 67 6e  6f 72 65 6d 65 6e 75 0d  |     ignoremenu.|
0000d600  2d 64 4c 20 20 20 20 20  20 20 20 20 20 20 20 20  |-dL             |
0000d610  20 20 20 4d 4f 56 20 20  20 20 20 52 31 30 2c 23  |   MOV     R10,#|
0000d620  31 20 20 20 20 20 20 20  20 20 20 3b 20 49 66 20  |1          ; If |
0000d630  49 6d 6d 65 64 69 61 74  65 20 69 74 65 6d 20 74  |Immediate item t|
0000d640  6f 67 67 6c 65 64 20 74  68 65 6e 0d 2d 6e 4d 20  |oggled then.-nM |
0000d650  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 42  |               B|
0000d660  4c 20 20 20 20 20 20 63  68 65 63 6b 63 6f 6e 74  |L      checkcont|
0000d670  65 6e 74 73 20 20 20 3b  20 6d 69 67 68 74 20 6e  |ents   ; might n|
0000d680  65 65 64 20 74 6f 20 72  65 2d 65 6e 61 62 6c 65  |eed to re-enable|
0000d690  20 66 61 74 20 63 61 6e  0d 2d 78 4b 20 20 20 20  | fat can.-xK    |
0000d6a0  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 52 42  |            LDRB|
0000d6b0  20 20 20 20 52 30 2c 43  4d 4f 53 62 79 74 65 20  |    R0,CMOSbyte |
0000d6c0  20 20 20 20 3b 20 49 66  20 49 6d 6d 65 64 69 61  |    ; If Immedia|
0000d6d0  74 65 20 74 6f 67 67 6c  65 64 20 6f 6e 2c 20 74  |te toggled on, t|
0000d6e0  68 65 6e 0d 2d 82 4d 20  20 20 20 20 20 20 20 20  |hen.-.M         |
0000d6f0  20 20 20 20 20 20 20 54  53 54 20 20 20 20 20 52  |       TST     R|
0000d700  30 2c 23 25 30 30 31 20  20 20 20 20 20 20 20 3b  |0,#%001        ;|
0000d710  20 6d 75 73 74 20 73 68  75 74 20 64 6f 77 6e 20  | must shut down |
0000d720  54 72 61 73 68 20 43 61  6e 20 57 69 6e 64 6f 77  |Trash Can Window|
0000d730  0d 2d 8c 27 20 20 20 20  20 20 20 20 20 20 20 20  |.-.'            |
0000d740  20 20 20 20 42 4c 4e 45  20 20 20 20 6e 6f 74 72  |    BLNE    notr|
0000d750  61 73 68 77 69 6e 64 0d  2d 96 26 20 20 20 20 20  |ashwind.-.&     |
0000d760  20 20 20 20 20 20 20 20  20 20 20 42 20 20 20 20  |           B    |
0000d770  20 20 20 69 67 6e 6f 72  65 6d 65 6e 75 0d 2d a0  |   ignoremenu.-.|
0000d780  3e 3b 20 4d 75 73 74 20  62 65 20 49 74 65 6d 20  |>; Must be Item |
0000d790  23 35 2c 20 77 68 69 63  68 20 69 73 20 6f 6e 6c  |#5, which is onl|
0000d7a0  79 20 65 6e 61 62 6c 65  64 20 69 66 20 74 68 65  |y enabled if the|
0000d7b0  72 65 20 69 73 20 54 72  61 73 68 0d 2d aa 2c 2e  |re is Trash.-.,.|
0000d7c0  64 6f 74 68 65 62 69 6e  6e 69 6e 67 20 20 20 41  |dothebinning   A|
0000d7d0  44 52 20 20 20 20 20 52  36 2c 63 6c 65 61 6e 74  |DR     R6,cleant|
0000d7e0  72 61 73 68 64 69 72 0d  2d b4 40 20 20 20 20 20  |rashdir.-.@     |
0000d7f0  20 20 20 20 20 20 20 20  20 20 20 42 4c 20 20 20  |           BL   |
0000d800  20 20 20 64 6f 76 61 6e  61 6e 69 6d 61 74 69 6f  |   dovananimatio|
0000d810  6e 20 20 3b 20 54 72 75  6e 64 6c 65 20 76 61 6e  |n  ; Trundle van|
0000d820  20 74 69 6d 65 20 21 0d  2d be 35 2e 69 67 6e 6f  | time !.-.5.igno|
0000d830  72 65 6d 65 6e 75 20 20  20 20 20 4c 44 4d 46 44  |remenu     LDMFD|
0000d840  20 20 20 52 31 33 21 2c  7b 52 30 2d 52 32 2c 52  |   R13!,{R0-R2,R|
0000d850  36 2c 52 39 2c 52 31 30  2c 50 43 7d 0d 2d c8 04  |6,R9,R10,PC}.-..|
0000d860  0d 2d d2 12 2e 74 72 61  73 68 74 68 65 73 74 75  |.-...trashthestu|
0000d870  66 66 0d 2d dc 04 0d 2d  e6 48 3b 20 4f 6e 20 65  |ff.-...-.H; On e|
0000d880  6e 74 72 79 2c 20 20 20  20 20 52 36 20 20 20 20  |ntry,     R6    |
0000d890  20 20 3d 20 41 64 64 72  65 73 73 20 6f 66 20 72  |  = Address of r|
0000d8a0  6f 75 74 69 6e 65 20 74  6f 20 62 65 20 75 73 65  |outine to be use|
0000d8b0  64 20 66 6f 72 20 74 72  61 73 68 69 6e 67 0d 2d  |d for trashing.-|
0000d8c0  f0 04 0d 2d fa 4b 20 20  20 20 20 20 20 20 20 20  |...-.K          |
0000d8d0  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 50 43  |      MOV     PC|
0000d8e0  2c 52 36 20 20 20 20 20  20 20 20 20 20 20 3b 20  |,R6           ; |
0000d8f0  4e 6f 74 20 65 78 61 63  74 6c 79 20 74 72 69 63  |Not exactly tric|
0000d900  6b 79 20 74 6f 20 63 6f  64 65 2e 2e 2e 0d 2e 04  |ky to code......|
0000d910  04 0d 2e 0e 2c 2e 63 6c  65 61 6e 74 72 61 73 68  |....,.cleantrash|
0000d920  64 69 72 20 20 53 54 4d  46 44 20 20 20 52 31 33  |dir  STMFD   R13|
0000d930  21 2c 7b 52 30 2c 52 31  2c 52 31 34 7d 0d 2e 18  |!,{R0,R1,R14}...|
0000d940  3a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |:               |
0000d950  20 42 4c 20 20 20 20 20  20 73 74 61 72 74 67 6c  | BL      startgl|
0000d960  61 73 73 20 20 20 20 20  20 3b 20 48 6f 75 72 67  |ass      ; Hourg|
0000d970  6c 61 73 73 20 6f 6e 0d  2e 22 48 20 20 20 20 20  |lass on.."H     |
0000d980  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |           MOV  |
0000d990  20 20 20 52 30 2c 23 32  37 20 20 20 20 20 20 20  |   R0,#27       |
0000d9a0  20 20 20 3b 20 2a 57 49  50 45 20 72 65 61 73 6f  |   ; *WIPE reaso|
0000d9b0  6e 20 63 6f 64 65 2e 20  49 49 49 2d 39 31 35 0d  |n code. III-915.|
0000d9c0  2e 2c 28 20 20 20 20 20  20 20 20 20 20 20 20 20  |.,(             |
0000d9d0  20 20 20 41 44 52 20 20  20 20 20 52 31 2c 74 72  |   ADR     R1,tr|
0000d9e0  61 73 68 62 69 74 73 0d  2e 36 27 20 20 20 20 20  |ashbits..6'     |
0000d9f0  20 20 20 20 20 20 20 20  20 20 20 42 4c 20 20 20  |           BL   |
0000da00  20 20 20 64 6f 66 73 63  6f 6e 74 72 6f 6c 0d 2e  |   dofscontrol..|
0000da10  40 2b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |@+              |
0000da20  20 20 4c 44 4d 46 44 20  20 20 52 31 33 21 2c 7b  |  LDMFD   R13!,{|
0000da30  52 30 2c 52 31 2c 50 43  7d 0d 2e 4a 04 0d 2e 54  |R0,R1,PC}..J...T|
0000da40  10 2e 64 6f 66 73 63 6f  6e 74 72 6f 6c 0d 2e 5e  |..dofscontrol..^|
0000da50  04 0d 2e 68 36 3b 20 4f  6e 20 65 6e 74 72 79 2c  |...h6; On entry,|
0000da60  20 20 20 20 20 52 30 20  20 20 20 20 20 3d 20 4f  |     R0      = O|
0000da70  53 5f 46 53 43 6f 6e 74  72 6f 6c 20 72 65 61 73  |S_FSControl reas|
0000da80  6f 6e 20 63 6f 64 65 0d  2e 72 34 3b 20 20 20 20  |on code..r4;    |
0000da90  20 20 20 20 20 20 20 20  20 20 20 52 31 20 20 20  |           R1   |
0000daa0  20 20 20 3d 20 50 6f 69  6e 74 65 72 20 74 6f 20  |   = Pointer to |
0000dab0  73 6f 75 72 63 65 20 6e  61 6d 65 0d 2e 7c 48 3b  |source name..|H;|
0000dac0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 52  |               R|
0000dad0  32 20 20 20 20 20 20 3d  20 50 6f 69 6e 74 65 72  |2      = Pointer|
0000dae0  20 74 6f 20 64 65 73 74  20 6e 61 6d 65 20 28 6e  | to dest name (n|
0000daf0  6f 74 20 75 73 65 64 20  77 69 74 68 20 2a 57 49  |ot used with *WI|
0000db00  50 45 29 0d 2e 86 04 0d  2e 90 29 20 20 20 20 20  |PE).......)     |
0000db10  20 20 20 20 20 20 20 20  20 20 20 53 54 4d 46 44  |           STMFD|
0000db20  20 20 20 52 31 33 21 2c  7b 52 33 2c 52 31 34 7d  |   R13!,{R3,R14}|
0000db30  0d 2e 9a 24 20 20 20 20  20 20 20 20 20 20 20 20  |...$            |
0000db40  20 20 20 20 4d 4f 56 20  20 20 20 20 52 33 2c 23  |    MOV     R3,#|
0000db50  97 22 2e 22 0d 2e a4 28  20 20 20 20 20 20 20 20  |."."...(        |
0000db60  20 20 20 20 20 20 20 20  53 54 52 42 20 20 20 20  |        STRB    |
0000db70  52 33 2c 70 6f 6b 65 74  72 61 73 68 0d 2e ae 28  |R3,poketrash...(|
0000db80  2e 72 65 74 72 79 63 6f  70 79 77 69 70 65 20 20  |.retrycopywipe  |
0000db90  53 54 4d 46 44 20 20 20  52 31 33 21 2c 7b 52 30  |STMFD   R13!,{R0|
0000dba0  2d 52 32 7d 0d 2e b8 4a  20 20 20 20 20 20 20 20  |-R2}...J        |
0000dbb0  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
0000dbc0  52 33 2c 23 25 30 31 30  30 30 30 30 31 31 20 20  |R3,#%010000011  |
0000dbd0  3b 20 7e 51 46 7e 43 52  7e 56 20 61 6e 64 20 64  |; ~QF~CR~V and d|
0000dbe0  65 6c 65 74 65 20 6f 72  69 67 69 6e 61 6c 0d 2e  |elete original..|
0000dbf0  c2 2b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.+              |
0000dc00  20 20 53 57 49 20 20 20  20 20 22 58 4f 53 5f 46  |  SWI     "XOS_F|
0000dc10  53 43 6f 6e 74 72 6f 6c  22 0d 2e cc 48 20 20 20  |SControl"...H   |
0000dc20  20 20 20 20 20 20 20 20  20 20 20 20 20 42 4c 20  |             BL |
0000dc30  20 20 20 20 20 63 68 65  63 6b 65 72 72 6f 72 20  |     checkerror |
0000dc40  20 20 20 20 20 3b 20 4b  65 65 70 20 74 72 79 69  |     ; Keep tryi|
0000dc50  6e 67 20 75 6e 74 69 6c  20 6e 6f 20 65 72 72 6f  |ng until no erro|
0000dc60  72 0d 2e d6 42 20 20 20  20 20 20 20 20 20 20 20  |r...B           |
0000dc70  20 20 20 20 20 4c 44 4d  46 44 20 20 20 52 31 33  |     LDMFD   R13|
0000dc80  21 2c 7b 52 30 2d 52 32  7d 20 20 20 20 3b 20 6f  |!,{R0-R2}    ; o|
0000dc90  72 20 43 61 6e 63 65 6c  20 63 6c 69 63 6b 65 64  |r Cancel clicked|
0000dca0  20 6f 6e 0d 2e e0 29 20  20 20 20 20 20 20 20 20  | on...)         |
0000dcb0  20 20 20 20 20 20 20 42  45 51 20 20 20 20 20 72  |       BEQ     r|
0000dcc0  65 74 72 79 63 6f 70 79  77 69 70 65 0d 2e ea 47  |etrycopywipe...G|
0000dcd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000dce0  4c 44 4d 46 44 20 20 20  52 31 33 21 2c 7b 52 33  |LDMFD   R13!,{R3|
0000dcf0  2c 50 43 7d 20 3b 20 52  65 74 75 72 6e 20 28 46  |,PC} ; Return (F|
0000dd00  53 20 66 6c 61 67 20 77  69 6c 6c 20 62 65 20 73  |S flag will be s|
0000dd10  65 74 29 0d 2e f4 04 0d  2e fe 11 2e 63 68 65 63  |et).........chec|
0000dd20  6b 66 6f 72 64 72 61 67  0d 2f 08 4d 3b 20 4f 6e  |kfordrag./.M; On|
0000dd30  20 65 6e 74 72 79 2c 20  20 20 20 20 52 31 20 20  | entry,     R1  |
0000dd40  20 20 20 20 3d 20 50 6f  69 6e 74 65 72 20 74 6f  |    = Pointer to|
0000dd50  20 57 69 6d 70 5f 50 6f  6c 6c 20 62 6c 6f 63 6b  | Wimp_Poll block|
0000dd60  20 28 75 73 65 64 20 66  6f 72 20 77 6f 72 6b 73  | (used for works|
0000dd70  70 61 63 65 29 0d 2f 12  2c 20 20 20 20 20 20 20  |pace)./.,       |
0000dd80  20 20 20 20 20 20 20 20  20 53 54 4d 46 44 20 20  |         STMFD  |
0000dd90  20 52 31 33 21 2c 7b 52  30 2d 52 35 2c 52 31 34  | R13!,{R0-R5,R14|
0000dda0  7d 0d 2f 1c 32 20 20 20  20 20 20 20 20 20 20 20  |}./.2           |
0000ddb0  20 20 20 20 20 53 57 49  20 20 20 20 20 22 58 57  |     SWI     "XW|
0000ddc0  69 6d 70 5f 47 65 74 50  6f 69 6e 74 65 72 49 6e  |imp_GetPointerIn|
0000ddd0  66 6f 22 0d 2f 26 3f 20  20 20 20 20 20 20 20 20  |fo"./&?         |
0000dde0  20 20 20 20 20 20 20 4c  44 52 20 20 20 20 20 52  |       LDR     R|
0000ddf0  32 2c 5b 52 31 2c 23 31  32 5d 20 20 20 20 20 3b  |2,[R1,#12]     ;|
0000de00  20 47 65 74 20 77 69 6e  64 6f 77 20 68 61 6e 64  | Get window hand|
0000de10  6c 65 0d 2f 30 3d 20 20  20 20 20 20 20 20 20 20  |le./0=          |
0000de20  20 20 20 20 20 20 4c 44  52 20 20 20 20 20 52 33  |      LDR     R3|
0000de30  2c 5b 52 31 2c 23 31 36  5d 20 20 20 20 20 3b 20  |,[R1,#16]     ; |
0000de40  47 65 74 20 69 63 6f 6e  20 68 61 6e 64 6c 65 0d  |Get icon handle.|
0000de50  2f 3a 4a 20 20 20 20 20  20 20 20 20 20 20 20 20  |/:J             |
0000de60  20 20 20 4c 44 52 20 20  20 20 20 52 30 2c 5b 52  |   LDR     R0,[R|
0000de70  31 2c 23 38 5d 20 20 20  20 20 20 3b 20 4d 75 73  |1,#8]      ; Mus|
0000de80  74 20 68 61 76 65 20 6f  6e 65 20 6f 66 20 74 68  |t have one of th|
0000de90  65 20 62 75 74 74 6f 6e  73 0d 2f 44 42 20 20 20  |e buttons./DB   |
0000dea0  20 20 20 20 20 20 20 20  20 20 20 20 20 54 53 54  |             TST|
0000deb0  20 20 20 20 20 52 30 2c  23 25 31 30 31 20 20 20  |     R0,#%101   |
0000dec0  20 20 20 20 20 3b 20 64  6f 77 6e 20 74 6f 20 73  |     ; down to s|
0000ded0  74 61 72 74 20 61 20 64  72 61 67 0d 2f 4e 1e 20  |tart a drag./N. |
0000dee0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 ec  |               .|
0000def0  51 20 20 20 52 34 2c 23  30 0d 2f 58 4b 20 20 20  |Q   R4,#0./XK   |
0000df00  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 52  |             STR|
0000df10  45 51 20 20 20 52 34 2c  73 70 61 72 6b 77 69 6e  |EQ   R4,sparkwin|
0000df20  64 68 61 6e 64 3b 20 49  66 20 6e 6f 74 2c 20 77  |dhand; If not, w|
0000df30  65 20 64 6f 6e 27 74 20  6b 6e 6f 77 20 53 70 61  |e don't know Spa|
0000df40  72 6b 27 73 0d 2f 62 3b  20 20 20 20 20 20 20 20  |rk's./b;        |
0000df50  20 20 20 20 20 20 20 20  42 45 51 20 20 20 20 20  |        BEQ     |
0000df60  63 68 65 63 6b 66 6f 72  6d 65 6e 75 20 20 20 20  |checkformenu    |
0000df70  3b 20 77 69 6e 64 6f 77  20 68 61 6e 64 6c 65 0d  |; window handle.|
0000df80  2f 63 48 20 20 20 20 20  20 20 20 20 20 20 20 20  |/cH             |
0000df90  20 20 20 4d 4f 56 20 20  20 20 20 52 35 2c 23 31  |   MOV     R5,#1|
0000dfa0  20 20 20 20 20 20 20 20  20 20 20 3b 20 42 75 74  |           ; But|
0000dfb0  74 6f 6e 20 64 6f 77 6e  2c 20 61 77 61 79 20 66  |ton down, away f|
0000dfc0  72 6f 6d 20 63 61 6e 0d  2f 6c 45 20 20 20 20 20  |rom can./lE     |
0000dfd0  20 20 20 20 20 20 20 20  20 20 20 4c 44 52 20 20  |           LDR  |
0000dfe0  20 20 20 52 34 2c 73 70  61 72 6b 77 69 6e 64 68  |   R4,sparkwindh|
0000dff0  61 6e 64 3b 20 53 6b 69  70 20 69 66 20 77 65 20  |and; Skip if we |
0000e000  61 6c 72 65 61 64 79 20  6b 6e 6f 77 0d 2f 76 43  |already know./vC|
0000e010  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e020  4d 4f 56 53 20 20 20 20  52 34 2c 52 34 20 20 20  |MOVS    R4,R4   |
0000e030  20 20 20 20 20 20 20 20  3b 20 53 70 61 72 6b 27  |        ; Spark'|
0000e040  73 20 77 69 6e 64 6f 77  20 68 61 6e 64 6c 65 0d  |s window handle.|
0000e050  2f 80 29 20 20 20 20 20  20 20 20 20 20 20 20 20  |/.)             |
0000e060  20 20 20 42 4e 45 20 20  20 20 20 63 6f 75 6c 64  |   BNE     could|
0000e070  62 65 6f 76 65 72 6d 65  0d 2f 8a 47 20 20 20 20  |beoverme./.G    |
0000e080  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 53  |            MOVS|
0000e090  20 20 20 20 52 33 2c 52  33 20 20 20 20 20 20 20  |    R3,R3       |
0000e0a0  20 20 20 20 3b 20 4f 6e  6c 79 20 6c 6f 6f 6b 69  |    ; Only looki|
0000e0b0  6e 67 20 66 6f 72 20 61  6e 20 69 63 6f 6e 2c 0d  |ng for an icon,.|
0000e0c0  2f 94 42 20 20 20 20 20  20 20 20 20 20 20 20 20  |/.B             |
0000e0d0  20 20 20 42 4d 49 20 20  20 20 20 63 6f 75 6c 64  |   BMI     could|
0000e0e0  62 65 6f 76 65 72 6d 65  20 20 20 3b 20 6e 6f 74  |beoverme   ; not|
0000e0f0  20 70 61 72 74 20 6f 66  20 61 20 77 69 6e 64 6f  | part of a windo|
0000e100  77 0d 2f 9e 49 20 20 20  20 20 20 20 20 20 20 20  |w./.I           |
0000e110  20 20 20 20 20 4d 4f 56  53 20 20 20 20 52 34 2c  |     MOVS    R4,|
0000e120  52 32 20 20 20 20 20 20  20 20 20 20 20 3b 20 4d  |R2           ; M|
0000e130  61 6b 65 20 73 75 72 65  20 6e 6f 74 20 62 61 63  |ake sure not bac|
0000e140  6b 67 72 6f 75 6e 64 20  6f 72 0d 2f a8 36 20 20  |kground or./.6  |
0000e150  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 4d  |              BM|
0000e160  49 20 20 20 20 20 63 6f  75 6c 64 62 65 6f 76 65  |I     couldbeove|
0000e170  72 6d 65 20 20 20 3b 20  69 63 6f 6e 20 62 61 72  |rme   ; icon bar|
0000e180  0d 2f b2 2a 20 20 20 20  20 20 20 20 20 20 20 20  |./.*            |
0000e190  20 20 20 20 4c 44 52 20  20 20 20 20 52 31 2c 77  |    LDR     R1,w|
0000e1a0  69 6e 64 6f 77 73 70 61  63 65 0d 2f bc 22 20 20  |indowspace./."  |
0000e1b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4d 4f  |              MO|
0000e1c0  56 20 20 20 20 20 52 30  2c 23 32 30 0d 2f c6 38  |V     R0,#20./.8|
0000e1d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e1e0  53 54 52 20 20 20 20 20  52 30 2c 5b 52 31 5d 20  |STR     R0,[R1] |
0000e1f0  20 20 20 20 20 20 20 20  3b 20 42 6c 6f 63 6b 20  |        ; Block |
0000e200  73 69 7a 65 0d 2f d0 21  20 20 20 20 20 20 20 20  |size./.!        |
0000e210  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
0000e220  52 30 2c 23 30 0d 2f da  38 20 20 20 20 20 20 20  |R0,#0./.8       |
0000e230  20 20 20 20 20 20 20 20  20 53 54 52 20 20 20 20  |         STR    |
0000e240  20 52 30 2c 5b 52 31 2c  23 31 32 5d 20 20 20 20  | R0,[R1,#12]    |
0000e250  20 3b 20 6d 79 5f 72 65  66 20 3d 20 30 0d 2f e4  | ; my_ref = 0./.|
0000e260  22 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |"               |
0000e270  20 4d 4f 56 20 20 20 20  20 52 30 2c 23 31 39 0d  | MOV     R0,#19.|
0000e280  2f ee 4a 20 20 20 20 20  20 20 20 20 20 20 20 20  |/.J             |
0000e290  20 20 20 53 57 49 20 20  20 20 20 22 58 57 69 6d  |   SWI     "XWim|
0000e2a0  70 5f 53 65 6e 64 4d 65  73 73 61 67 65 22 20 20  |p_SendMessage"  |
0000e2b0  20 20 20 3b 20 41 73 6b  20 66 6f 72 20 6f 77 6e  |   ; Ask for own|
0000e2c0  65 72 20 68 61 6e 64 6c  65 0d 2f f8 2c 20 20 20  |er handle./.,   |
0000e2d0  20 20 20 20 20 20 20 20  20 20 20 20 20 4c 44 52  |             LDR|
0000e2e0  20 20 20 20 20 52 30 2c  73 70 61 72 6b 74 61 73  |     R0,sparktas|
0000e2f0  6b 68 61 6e 64 0d 30 02  43 20 20 20 20 20 20 20  |khand.0.C       |
0000e300  20 20 20 20 20 20 20 20  20 43 4d 50 20 20 20 20  |         CMP    |
0000e310  20 52 30 2c 52 32 20 20  20 20 20 20 20 20 20 20  | R0,R2          |
0000e320  20 3b 20 57 61 73 20 69  74 20 61 20 53 70 61 72  | ; Was it a Spar|
0000e330  6b 20 69 63 6f 6e 20 3f  0d 30 0c 28 20 20 20 20  |k icon ?.0.(    |
0000e340  20 20 20 20 20 20 20 20  20 20 20 20 42 4e 45 20  |            BNE |
0000e350  20 20 20 20 6e 6f 74 73  70 61 72 6b 64 72 61 67  |    notsparkdrag|
0000e360  0d 30 16 46 20 20 20 20  20 20 20 20 20 20 20 20  |.0.F            |
0000e370  20 20 20 20 53 54 52 20  20 20 20 20 52 34 2c 5b  |    STR     R4,[|
0000e380  52 31 5d 20 20 20 20 20  20 20 20 20 20 20 20 20  |R1]             |
0000e390  20 20 20 20 3b 20 4e 65  65 64 20 74 6f 20 67 65  |    ; Need to ge|
0000e3a0  74 20 6d 6f 72 65 0d 30  20 47 20 20 20 20 20 20  |t more.0 G      |
0000e3b0  20 20 20 20 20 20 20 20  20 20 53 57 49 20 20 20  |          SWI   |
0000e3c0  20 20 22 58 57 69 6d 70  5f 47 65 74 57 69 6e 64  |  "XWimp_GetWind|
0000e3d0  6f 77 49 6e 66 6f 22 20  20 20 3b 20 64 65 74 61  |owInfo"   ; deta|
0000e3e0  69 6c 73 2e 20 49 49 49  2d 31 32 31 30 0d 30 2a  |ils. III-1210.0*|
0000e3f0  3e 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |>               |
0000e400  20 4c 44 52 20 20 20 20  20 52 30 2c 5b 52 31 2c  | LDR     R0,[R1,|
0000e410  23 32 38 2b 34 5d 20 20  20 3b 20 47 65 74 20 77  |#28+4]   ; Get w|
0000e420  69 6e 64 6f 77 20 66 6c  61 67 73 0d 30 34 44 20  |indow flags.04D |
0000e430  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
0000e440  4f 56 20 20 20 20 20 52  30 2c 52 30 2c 4c 53 52  |OV     R0,R0,LSR|
0000e450  20 23 32 34 20 20 20 3b  20 47 65 74 20 69 63 6f  | #24   ; Get ico|
0000e460  6e 20 63 6f 6e 74 72 6f  6c 20 66 6c 61 67 73 0d  |n control flags.|
0000e470  30 3e 49 20 20 20 20 20  20 20 20 20 20 20 20 20  |0>I             |
0000e480  20 20 20 42 49 43 20 20  20 20 20 52 30 2c 52 30  |   BIC     R0,R0|
0000e490  2c 23 28 25 31 31 3c 3c  37 29 20 3b 20 49 67 6e  |,#(%11<<7) ; Ign|
0000e4a0  6f 72 65 20 62 69 74 20  73 65 6c 2f 68 6f 72 69  |ore bit sel/hori|
0000e4b0  7a 20 73 63 72 6f 6c 6c  0d 30 48 3f 20 20 20 20  |z scroll.0H?    |
0000e4c0  20 20 20 20 20 20 20 20  20 20 20 20 43 4d 50 20  |            CMP |
0000e4d0  20 20 20 20 52 30 2c 23  25 31 31 31 31 31 31 20  |    R0,#%111111 |
0000e4e0  20 20 20 20 3b 20 41 72  65 20 61 6c 6c 20 65 6e  |    ; Are all en|
0000e4f0  61 62 6c 65 64 20 3f 0d  30 52 28 20 20 20 20 20  |abled ?.0R(     |
0000e500  20 20 20 20 20 20 20 20  20 20 20 42 4e 45 20 20  |           BNE  |
0000e510  20 20 20 6e 6f 74 73 70  61 72 6b 64 72 61 67 0d  |   notsparkdrag.|
0000e520  30 5c 29 20 20 20 20 20  20 20 20 20 20 20 20 20  |0\)             |
0000e530  20 20 20 4c 44 52 20 20  20 20 20 52 30 2c 5b 52  |   LDR     R0,[R|
0000e540  31 2c 23 35 36 2b 34 5d  0d 30 66 46 20 20 20 20  |1,#56+4].0fF    |
0000e550  20 20 20 20 20 20 20 20  20 20 20 20 54 53 54 20  |            TST |
0000e560  20 20 20 20 52 30 2c 23  28 31 3c 3c 38 29 20 20  |    R0,#(1<<8)  |
0000e570  20 20 20 20 3b 20 49 73  20 74 69 74 6c 65 20 69  |    ; Is title i|
0000e580  6e 66 6f 20 69 6e 64 69  72 65 63 74 20 3f 0d 30  |nfo indirect ?.0|
0000e590  70 28 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |p(              |
0000e5a0  20 20 42 45 51 20 20 20  20 20 6e 6f 74 73 70 61  |  BEQ     notspa|
0000e5b0  72 6b 64 72 61 67 0d 30  7a 40 20 20 20 20 20 20  |rkdrag.0z@      |
0000e5c0  20 20 20 20 20 20 20 20  20 20 53 54 52 20 20 20  |          STR   |
0000e5d0  20 20 52 34 2c 73 70 61  72 6b 77 69 6e 64 68 61  |  R4,sparkwindha|
0000e5e0  6e 64 3b 20 53 61 76 65  20 77 69 6e 64 6f 77 20  |nd; Save window |
0000e5f0  68 61 6e 64 6c 65 0d 30  84 2c 20 20 20 20 20 20  |handle.0.,      |
0000e600  20 20 20 20 20 20 20 20  20 20 41 44 52 20 20 20  |          ADR   |
0000e610  20 20 52 30 2c 73 70 61  72 6b 72 6f 6f 74 63 6f  |  R0,sparkrootco|
0000e620  6d 6d 0d 30 8e 2c 20 20  20 20 20 20 20 20 20 20  |mm.0.,          |
0000e630  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 52 32  |      MOV     R2|
0000e640  2c 23 a9 28 73 70 61 72  6b 64 65 6c 24 29 0d 30  |,#.(sparkdel$).0|
0000e650  98 25 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.%              |
0000e660  20 20 41 44 44 20 20 20  20 20 52 33 2c 52 31 2c  |  ADD     R3,R1,|
0000e670  23 32 30 0d 30 a2 49 2e  73 74 69 6c 6c 63 6f 6d  |#20.0.I.stillcom|
0000e680  6d 6d 6f 76 65 20 20 4c  44 52 42 20 20 20 20 52  |mmove  LDRB    R|
0000e690  34 2c 5b 52 30 5d 2c 23  31 20 20 20 20 20 20 3b  |4,[R0],#1      ;|
0000e6a0  20 43 6f 70 79 20 73 74  61 72 74 20 6f 66 20 53  | Copy start of S|
0000e6b0  70 61 72 6b 20 63 6f 6d  6d 61 6e 64 0d 30 ac 41  |park command.0.A|
0000e6c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e6d0  53 54 52 42 20 20 20 20  52 34 2c 5b 52 33 5d 2c  |STRB    R4,[R3],|
0000e6e0  23 31 20 20 20 20 20 20  3b 20 69 6e 74 6f 20 77  |#1      ; into w|
0000e6f0  6f 72 6b 73 70 61 63 65  20 61 72 65 61 0d 30 b6  |orkspace area.0.|
0000e700  24 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |$               |
0000e710  20 53 55 42 53 20 20 20  20 52 32 2c 52 32 2c 23  | SUBS    R2,R2,#|
0000e720  31 0d 30 c0 29 20 20 20  20 20 20 20 20 20 20 20  |1.0.)           |
0000e730  20 20 20 20 20 42 4e 45  20 20 20 20 20 73 74 69  |     BNE     sti|
0000e740  6c 6c 63 6f 6d 6d 6d 6f  76 65 0d 30 ca 39 20 20  |llcommmove.0.9  |
0000e750  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |              LD|
0000e760  52 20 20 20 20 20 52 30  2c 73 70 61 72 6b 74 61  |R     R0,sparkta|
0000e770  73 6b 68 61 6e 64 3b 20  53 6f 75 72 63 65 20 74  |skhand; Source t|
0000e780  61 73 6b 0d 30 d4 3c 20  20 20 20 20 20 20 20 20  |ask.0.<         |
0000e790  20 20 20 20 20 20 20 4c  44 52 20 20 20 20 20 52  |       LDR     R|
0000e7a0  34 2c 5b 52 31 2c 23 37  32 2b 38 2b 34 5d 20 3b  |4,[R1,#72+8+4] ;|
0000e7b0  20 53 69 7a 65 20 6f 66  20 62 75 66 66 65 72 0d  | Size of buffer.|
0000e7c0  30 de 45 20 20 20 20 20  20 20 20 20 20 20 20 20  |0.E             |
0000e7d0  20 20 20 4c 44 52 20 20  20 20 20 52 31 2c 5b 52  |   LDR     R1,[R|
0000e7e0  31 2c 23 37 32 2b 34 5d  20 20 20 3b 20 50 6f 69  |1,#72+4]   ; Poi|
0000e7f0  6e 74 65 72 20 74 6f 20  77 69 6e 64 6f 77 20 74  |nter to window t|
0000e800  69 74 6c 65 0d 30 e8 3e  20 20 20 20 20 20 20 20  |itle.0.>        |
0000e810  20 20 20 20 20 20 20 20  4c 44 52 20 20 20 20 20  |        LDR     |
0000e820  52 32 2c 74 61 73 6b 68  61 6e 64 6c 65 20 20 20  |R2,taskhandle   |
0000e830  3b 20 44 65 73 74 69 6e  61 74 69 6f 6e 20 74 61  |; Destination ta|
0000e840  73 6b 0d 30 f2 3e 20 20  20 20 20 20 20 20 20 20  |sk.0.>          |
0000e850  20 20 20 20 20 20 53 57  49 20 20 20 20 20 22 58  |      SWI     "X|
0000e860  57 69 6d 70 5f 54 72 61  6e 73 66 65 72 42 6c 6f  |Wimp_TransferBlo|
0000e870  63 6b 22 20 20 20 3b 20  49 49 49 2d 31 32 38 33  |ck"   ; III-1283|
0000e880  0d 30 fc 04 0d 31 06 47  3b 20 41 6c 74 68 6f 75  |.0...1.G; Althou|
0000e890  67 68 20 77 65 20 27 74  68 69 6e 6b 27 20 77 65  |gh we 'think' we|
0000e8a0  20 6b 6e 6f 77 20 74 68  65 20 6c 65 6e 67 74 68  | know the length|
0000e8b0  20 6f 66 20 74 68 65 20  77 69 6e 64 6f 77 20 74  | of the window t|
0000e8c0  69 74 6c 65 2c 20 69 74  20 69 73 0d 31 10 43 3b  |itle, it is.1.C;|
0000e8d0  20 6f 6e 6c 79 20 74 68  65 20 62 75 66 66 65 72  | only the buffer|
0000e8e0  20 73 69 7a 65 20 2d 20  6d 75 73 74 20 66 69 6e  | size - must fin|
0000e8f0  64 20 74 68 65 20 74 65  72 6d 69 6e 61 74 69 6e  |d the terminatin|
0000e900  67 20 7a 65 72 6f 20 69  6e 73 74 65 61 64 0d 31  |g zero instead.1|
0000e910  1a 04 0d 31 24 23 2e 66  69 6e 64 70 61 74 68 7a  |...1$#.findpathz|
0000e920  65 72 6f 20 20 20 4c 44  52 42 20 20 20 20 52 30  |ero   LDRB    R0|
0000e930  2c 5b 52 33 5d 0d 31 2e  21 20 20 20 20 20 20 20  |,[R3].1.!       |
0000e940  20 20 20 20 20 20 20 20  20 4d 4f 56 53 20 20 20  |         MOVS   |
0000e950  20 52 30 2c 52 30 0d 31  38 24 20 20 20 20 20 20  | R0,R0.18$      |
0000e960  20 20 20 20 20 20 20 20  20 20 41 44 44 4e 45 20  |          ADDNE |
0000e970  20 20 52 33 2c 52 33 2c  23 31 0d 31 42 28 20 20  |  R3,R3,#1.1B(  |
0000e980  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 4e  |              BN|
0000e990  45 20 20 20 20 20 66 69  6e 64 70 61 74 68 7a 65  |E     findpathze|
0000e9a0  72 6f 0d 31 4c 48 20 20  20 20 20 20 20 20 20 20  |ro.1LH          |
0000e9b0  20 20 20 20 20 20 53 54  52 20 20 20 20 20 52 33  |      STR     R3|
0000e9c0  2c 70 75 74 6c 65 61 66  68 65 72 65 20 20 3b 20  |,putleafhere  ; |
0000e9d0  54 68 61 74 27 73 20 77  68 65 72 65 20 74 68 65  |That's where the|
0000e9e0  20 6c 65 61 66 20 67 6f  65 73 0d 31 56 28 20 20  | leaf goes.1V(  |
0000e9f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 20  |              B |
0000ea00  20 20 20 20 20 20 6e 6f  74 73 70 61 72 6b 64 72  |      notsparkdr|
0000ea10  61 67 0d 31 60 46 2e 63  6f 75 6c 64 62 65 6f 76  |ag.1`F.couldbeov|
0000ea20  65 72 6d 65 20 20 43 4d  4e 20 20 20 20 20 52 32  |erme  CMN     R2|
0000ea30  2c 23 32 20 20 20 20 20  20 20 20 20 20 20 3b 20  |,#2           ; |
0000ea40  57 69 6e 64 6f 77 20 3d  20 2d 32 20 28 69 63 6f  |Window = -2 (ico|
0000ea50  6e 20 62 61 72 29 20 3f  0d 31 6a 29 20 20 20 20  |n bar) ?.1j)    |
0000ea60  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 52 45  |            LDRE|
0000ea70  51 20 20 20 52 31 2c 69  63 6f 6e 68 61 6e 64 6c  |Q   R1,iconhandl|
0000ea80  65 0d 31 74 40 20 20 20  20 20 20 20 20 20 20 20  |e.1t@           |
0000ea90  20 20 20 20 20 43 4d 50  45 51 20 20 20 52 31 2c  |     CMPEQ   R1,|
0000eaa0  52 33 20 20 20 20 20 20  20 20 20 20 20 3b 20 49  |R3           ; I|
0000eab0  63 6f 6e 20 3d 20 54 72  61 73 68 20 43 61 6e 20  |con = Trash Can |
0000eac0  3f 0d 31 7e 28 20 20 20  20 20 20 20 20 20 20 20  |?.1~(           |
0000ead0  20 20 20 20 20 42 4e 45  20 20 20 20 20 6e 6f 74  |     BNE     not|
0000eae0  73 70 61 72 6b 64 72 61  67 0d 31 88 04 0d 31 92  |sparkdrag.1...1.|
0000eaf0  48 3b 20 49 66 20 69 74  20 67 65 74 73 20 68 65  |H; If it gets he|
0000eb00  72 65 2c 20 74 68 65 6e  20 61 20 62 75 74 74 6f  |re, then a butto|
0000eb10  6e 20 69 73 20 64 6f 77  6e 20 61 6e 64 20 74 68  |n is down and th|
0000eb20  65 20 70 6f 69 6e 74 65  72 20 69 73 20 6f 76 65  |e pointer is ove|
0000eb30  72 20 74 68 65 0d 31 9c  15 3b 20 54 72 61 73 68  |r the.1..; Trash|
0000eb40  20 43 61 6e 20 69 63 6f  6e 2e 0d 31 a6 04 0d 31  | Can icon..1...1|
0000eb50  b0 4d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.M              |
0000eb60  20 20 4c 44 52 42 20 20  20 20 52 30 2c 43 4d 4f  |  LDRB    R0,CMO|
0000eb70  53 62 79 74 65 20 20 20  20 20 3b 20 49 6d 6d 65  |Sbyte     ; Imme|
0000eb80  64 69 61 74 65 20 61 6e  64 20 57 61 72 6e 69 6e  |diate and Warnin|
0000eb90  67 20 65 6e 61 62 6c 65  64 20 3f 0d 31 ba 24 20  |g enabled ?.1.$ |
0000eba0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 80  |               .|
0000ebb0  20 20 20 20 20 52 30 2c  52 30 2c 23 25 31 31 0d  |     R0,R0,#%11.|
0000ebc0  31 c4 23 20 20 20 20 20  20 20 20 20 20 20 20 20  |1.#             |
0000ebd0  20 20 20 43 4d 50 20 20  20 20 20 52 30 2c 23 25  |   CMP     R0,#%|
0000ebe0  31 31 0d 31 ce 28 20 20  20 20 20 20 20 20 20 20  |11.1.(          |
0000ebf0  20 20 20 20 20 20 42 4e  45 20 20 20 20 20 6e 6f  |      BNE     no|
0000ec00  74 73 70 61 72 6b 64 72  61 67 0d 31 d8 04 0d 31  |tsparkdrag.1...1|
0000ec10  e2 42 3b 20 48 6f 77 65  76 65 72 2c 20 27 64 72  |.B; However, 'dr|
0000ec20  61 67 73 74 61 74 65 27  20 6d 75 73 74 20 68 61  |agstate' must ha|
0000ec30  76 65 20 62 65 65 6e 20  73 65 74 20 74 6f 20 31  |ve been set to 1|
0000ec40  20 28 61 77 61 79 20 66  72 6f 6d 20 63 61 6e 2c  | (away from can,|
0000ec50  0d 31 ec 49 3b 20 62 75  74 74 6f 6e 20 64 6f 77  |.1.I; button dow|
0000ec60  6e 29 20 72 61 74 68 65  72 20 74 68 61 6e 20 30  |n) rather than 0|
0000ec70  20 28 62 75 74 74 6f 6e  20 75 70 29 20 6f 72 20  | (button up) or |
0000ec80  32 20 28 6f 76 65 72 20  63 61 6e 2c 20 62 75 74  |2 (over can, but|
0000ec90  74 6f 6e 20 64 6f 77 6e  29 0d 31 f6 36 3b 20 70  |ton down).1.6; p|
0000eca0  72 69 6f 72 20 74 6f 20  74 68 69 73 20 69 66 20  |rior to this if |
0000ecb0  77 65 20 77 61 6e 74 20  74 6f 20 74 75 72 6e 20  |we want to turn |
0000ecc0  74 68 65 20 62 6f 72 64  65 72 20 72 65 64 2e 0d  |the border red..|
0000ecd0  32 00 04 0d 32 01 43 20  20 20 20 20 20 20 20 20  |2...2.C         |
0000ece0  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
0000ecf0  35 2c 23 32 20 20 20 20  20 20 20 20 20 20 20 3b  |5,#2           ;|
0000ed00  20 4f 76 65 72 20 63 61  6e 2c 20 62 75 74 74 6f  | Over can, butto|
0000ed10  6e 20 64 6f 77 6e 0d 32  0a 28 20 20 20 20 20 20  |n down.2.(      |
0000ed20  20 20 20 20 20 20 20 20  20 20 4c 44 52 42 20 20  |          LDRB  |
0000ed30  20 20 52 30 2c 64 72 61  67 73 74 61 74 65 0d 32  |  R0,dragstate.2|
0000ed40  14 21 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.!              |
0000ed50  20 20 43 4d 50 20 20 20  20 20 52 30 2c 23 31 0d  |  CMP     R0,#1.|
0000ed60  32 1e 48 20 20 20 20 20  20 20 20 20 20 20 20 20  |2.H             |
0000ed70  20 20 20 42 4c 45 51 20  20 20 20 74 75 72 6e 62  |   BLEQ    turnb|
0000ed80  6f 72 64 65 72 72 65 64  20 20 20 3b 20 4f 4b 2c  |orderred   ; OK,|
0000ed90  20 73 6f 20 77 61 72 6e  20 75 73 65 72 20 74 68  | so warn user th|
0000eda0  61 74 20 68 65 27 73 0d  32 28 44 20 20 20 20 20  |at he's.2(D     |
0000edb0  20 20 20 20 20 20 20 20  20 20 20 42 20 20 20 20  |           B    |
0000edc0  20 20 20 64 6f 6e 74 63  68 61 6e 67 65 20 20 20  |   dontchange   |
0000edd0  20 20 20 3b 20 61 62 6f  75 74 20 74 6f 20 64 65  |   ; about to de|
0000ede0  73 74 72 6f 79 20 66 69  6c 65 73 0d 32 32 04 0d  |stroy files.22..|
0000edf0  32 3c 26 3b 20 41 74 20  74 68 69 73 20 70 6f 69  |2<&; At this poi|
0000ee00  6e 74 2c 20 52 30 20 3d  20 42 75 74 74 6f 6e 20  |nt, R0 = Button |
0000ee10  73 74 61 74 65 0d 32 46  4b 3b 20 20 20 20 20 20  |state.2FK;      |
0000ee20  20 20 20 20 20 20 20 20  20 20 52 31 20 3d 20 47  |          R1 = G|
0000ee30  65 74 50 6f 69 6e 74 65  72 49 6e 66 6f 20 62 6c  |etPointerInfo bl|
0000ee40  6f 63 6b 2c 20 52 32 2f  52 33 20 3d 20 77 69 6e  |ock, R2/R3 = win|
0000ee50  64 6f 77 2f 69 63 6f 6e  20 68 61 6e 64 6c 65 73  |dow/icon handles|
0000ee60  0d 32 50 45 3b 20 4d 75  73 74 20 73 65 65 20 69  |.2PE; Must see i|
0000ee70  66 20 70 6f 69 6e 74 65  72 20 69 73 20 6f 76 65  |f pointer is ove|
0000ee80  72 20 27 45 6d 70 74 79  20 54 72 61 73 68 27 20  |r 'Empty Trash' |
0000ee90  28 65 6e 61 62 6c 65 64  29 20 6d 65 6e 75 20 6f  |(enabled) menu o|
0000eea0  70 74 69 6f 6e 0d 32 5a  04 0d 32 64 11 2e 63 68  |ption.2Z..2d..ch|
0000eeb0  65 63 6b 66 6f 72 6d 65  6e 75 0d 32 6e 05 5d 0d  |eckformenu.2n.].|
0000eec0  32 78 0e e7 20 64 65 62  75 67 25 20 8c 0d 32 82  |2x.. debug% ..2.|
0000eed0  0b 5b 4f 50 54 20 41 25  0d 32 8c 49 20 20 20 20  |.[OPT A%.2.I    |
0000eee0  20 20 20 20 20 20 20 20  20 20 20 20 42 4c 20 20  |            BL  |
0000eef0  20 20 20 20 73 68 6f 77  68 61 6e 64 6c 65 73 20  |    showhandles |
0000ef00  20 20 20 20 3b 20 44 69  73 70 6c 61 79 20 68 61  |    ; Display ha|
0000ef10  6e 64 6c 65 73 20 69 6e  20 74 6f 70 20 6c 65 66  |ndles in top lef|
0000ef20  74 0d 32 96 05 5d 0d 32  a0 05 cd 0d 32 aa 0b 5b  |t.2..].2....2..[|
0000ef30  4f 50 54 20 41 25 0d 32  ab 46 20 20 20 20 20 20  |OPT A%.2.F      |
0000ef40  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
0000ef50  20 20 52 35 2c 23 30 20  20 20 20 20 20 20 20 20  |  R5,#0         |
0000ef60  20 20 3b 20 42 75 74 74  6f 6e 20 75 70 2c 20 61  |  ; Button up, a|
0000ef70  77 61 79 20 66 72 6f 6d  20 63 61 6e 0d 32 b4 4b  |way from can.2.K|
0000ef80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000ef90  43 4d 50 20 20 20 20 20  52 33 2c 23 35 2a 33 2d  |CMP     R3,#5*3-|
0000efa0  32 20 20 20 20 20 20 20  3b 20 4f 6e 20 66 69 66  |2       ; On fif|
0000efb0  74 68 20 69 74 65 6d 20  28 45 6d 70 74 79 20 54  |th item (Empty T|
0000efc0  72 61 73 68 29 20 3f 0d  32 be 28 20 20 20 20 20  |rash) ?.2.(     |
0000efd0  20 20 20 20 20 20 20 20  20 20 20 42 4e 45 20 20  |           BNE  |
0000efe0  20 20 20 6e 6f 74 73 70  61 72 6b 64 72 61 67 0d  |   notsparkdrag.|
0000eff0  32 c8 3f 20 20 20 20 20  20 20 20 20 20 20 20 20  |2.?             |
0000f000  20 20 20 4c 44 52 42 20  20 20 20 52 30 2c 43 4d  |   LDRB    R0,CM|
0000f010  4f 53 62 79 74 65 20 20  20 20 20 3b 20 57 61 72  |OSbyte     ; War|
0000f020  6e 69 6e 67 20 65 6e 61  62 6c 65 64 20 3f 0d 32  |ning enabled ?.2|
0000f030  d2 24 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.$              |
0000f040  20 20 80 20 20 20 20 20  52 30 2c 52 30 2c 23 25  |  .     R0,R0,#%|
0000f050  31 30 0d 32 dc 23 20 20  20 20 20 20 20 20 20 20  |10.2.#          |
0000f060  20 20 20 20 20 20 43 4d  50 20 20 20 20 20 52 30  |      CMP     R0|
0000f070  2c 23 25 31 30 0d 32 e6  28 20 20 20 20 20 20 20  |,#%10.2.(       |
0000f080  20 20 20 20 20 20 20 20  20 42 4e 45 20 20 20 20  |         BNE    |
0000f090  20 6e 6f 74 73 70 61 72  6b 64 72 61 67 0d 32 f0  | notsparkdrag.2.|
0000f0a0  48 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |H               |
0000f0b0  20 42 4c 20 20 20 20 20  20 67 65 74 6d 65 6e 75  | BL      getmenu|
0000f0c0  69 63 6f 6e 69 6e 66 6f  20 3b 20 59 65 73 2c 20  |iconinfo ; Yes, |
0000f0d0  73 6f 20 67 65 74 20 6d  65 6e 75 20 69 74 65 6d  |so get menu item|
0000f0e0  20 74 65 78 74 0d 32 fa  21 20 20 20 20 20 20 20  | text.2.!       |
0000f0f0  20 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |         MOV    |
0000f100  20 52 34 2c 23 33 0d 33  04 48 2e 73 63 61 6e 66  | R4,#3.3.H.scanf|
0000f110  6f 72 6d 69 73 73 20 20  20 20 4c 44 52 20 20 20  |ormiss    LDR   |
0000f120  20 20 52 32 2c 5b 52 30  5d 2c 23 34 20 20 20 20  |  R2,[R0],#4    |
0000f130  20 20 3b 20 43 6f 6d 70  61 72 65 20 22 45 6d 70  |  ; Compare "Emp|
0000f140  74 79 20 54 72 61 73 68  22 20 77 69 74 68 0d 33  |ty Trash" with.3|
0000f150  0e 46 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.F              |
0000f160  20 20 4c 44 52 20 20 20  20 20 52 33 2c 5b 52 31  |  LDR     R3,[R1|
0000f170  5d 2c 23 34 20 20 20 20  20 20 3b 20 6d 65 6e 75  |],#4      ; menu|
0000f180  20 69 74 65 6d 20 74 65  78 74 20 74 6f 20 73 65  | item text to se|
0000f190  65 20 69 66 0d 33 18 4c  20 20 20 20 20 20 20 20  |e if.3.L        |
0000f1a0  20 20 20 20 20 20 20 20  43 4d 50 20 20 20 20 20  |        CMP     |
0000f1b0  52 32 2c 52 33 20 20 20  20 20 20 20 20 20 20 20  |R2,R3           |
0000f1c0  3b 20 69 74 27 73 20 6d  79 20 6d 65 6e 75 20 28  |; it's my menu (|
0000f1d0  6f 6e 6c 79 20 65 61 73  79 20 77 61 79 20 21 29  |only easy way !)|
0000f1e0  0d 33 22 28 20 20 20 20  20 20 20 20 20 20 20 20  |.3"(            |
0000f1f0  20 20 20 20 42 4e 45 20  20 20 20 20 6e 6f 74 73  |    BNE     nots|
0000f200  70 61 72 6b 64 72 61 67  0d 33 2c 24 20 20 20 20  |parkdrag.3,$    |
0000f210  20 20 20 20 20 20 20 20  20 20 20 20 53 55 42 53  |            SUBS|
0000f220  20 20 20 20 52 34 2c 52  34 2c 23 31 0d 33 36 27  |    R4,R4,#1.36'|
0000f230  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f240  42 4e 45 20 20 20 20 20  73 63 61 6e 66 6f 72 6d  |BNE     scanform|
0000f250  69 73 73 0d 33 40 48 20  20 20 20 20 20 20 20 20  |iss.3@H         |
0000f260  20 20 20 20 20 20 20 42  4c 20 20 20 20 20 20 74  |       BL      t|
0000f270  75 72 6e 62 6f 72 64 65  72 72 65 64 20 20 20 3b  |urnborderred   ;|
0000f280  20 54 75 72 6e 20 62 6f  72 64 65 72 20 72 65 64  | Turn border red|
0000f290  20 69 66 20 6f 6e 20 69  74 65 6d 0d 33 4a 26 20  | if on item.3J& |
0000f2a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 42  |               B|
0000f2b0  20 20 20 20 20 20 20 64  6f 6e 74 63 68 61 6e 67  |       dontchang|
0000f2c0  65 0d 33 54 49 2e 6e 6f  74 73 70 61 72 6b 64 72  |e.3TI.notsparkdr|
0000f2d0  61 67 20 20 20 42 4c 20  20 20 20 20 20 63 68 65  |ag   BL      che|
0000f2e0  63 6b 66 6f 72 72 65 64  20 20 20 20 20 3b 20 4e  |ckforred     ; N|
0000f2f0  6f 74 20 6f 76 65 72 20  63 61 6e 2c 20 73 6f 20  |ot over can, so |
0000f300  72 65 6d 6f 76 65 20 72  65 64 0d 33 68 28 2e 64  |remove red.3h(.d|
0000f310  6f 6e 74 63 68 61 6e 67  65 20 20 20 20 20 53 54  |ontchange     ST|
0000f320  52 42 20 20 20 20 52 35  2c 64 72 61 67 73 74 61  |RB    R5,dragsta|
0000f330  74 65 0d 33 69 2b 20 20  20 20 20 20 20 20 20 20  |te.3i+          |
0000f340  20 20 20 20 20 20 4c 44  4d 46 44 20 20 20 52 31  |      LDMFD   R1|
0000f350  33 21 2c 7b 52 30 2d 52  35 2c 50 43 7d 0d 33 72  |3!,{R0-R5,PC}.3r|
0000f360  1d 2e 70 75 74 6c 65 61  66 68 65 72 65 20 20 20  |..putleafhere   |
0000f370  20 45 51 55 44 20 20 20  20 30 0d 33 7c 25 2e 73  | EQUD    0.3|%.s|
0000f380  70 61 72 6b 72 6f 6f 74  63 6f 6d 6d 20 20 45 51  |parkrootcomm  EQ|
0000f390  55 53 20 20 20 20 73 70  61 72 6b 64 65 6c 24 0d  |US    sparkdel$.|
0000f3a0  33 86 19 20 20 20 20 20  20 20 20 20 20 20 20 20  |3..             |
0000f3b0  20 20 20 41 4c 49 47 4e  0d 33 90 05 5d 0d 33 9a  |   ALIGN.3..].3.|
0000f3c0  0e e7 20 64 65 62 75 67  25 20 8c 0d 33 a4 0b 5b  |.. debug% ..3..[|
0000f3d0  4f 50 54 20 41 25 0d 33  ae 1d 3b 20 53 74 61 72  |OPT A%.3..; Star|
0000f3e0  74 20 6f 66 20 64 65 62  75 67 67 69 6e 67 20 63  |t of debugging c|
0000f3f0  6f 64 65 0d 33 b8 04 0d  33 c2 10 2e 73 68 6f 77  |ode.3...3...show|
0000f400  68 61 6e 64 6c 65 73 0d  33 cc 04 0d 33 d6 47 3b  |handles.3...3.G;|
0000f410  20 4f 6e 20 65 6e 74 72  79 2c 20 20 20 20 20 52  | On entry,     R|
0000f420  32 2f 52 33 20 20 20 3d  20 57 69 6e 64 6f 77 2f  |2/R3   = Window/|
0000f430  69 63 6f 6e 20 68 61 6e  64 6c 65 73 20 28 66 72  |icon handles (fr|
0000f440  6f 6d 20 47 65 74 50 6f  69 6e 74 65 72 49 6e 66  |om GetPointerInf|
0000f450  6f 29 0d 33 e0 04 0d 33  ea 29 20 20 20 20 20 20  |o).3...3.)      |
0000f460  20 20 20 20 20 20 20 20  20 20 53 54 4d 46 44 20  |          STMFD |
0000f470  20 20 52 31 33 21 2c 7b  52 30 2c 52 31 34 7d 0d  |  R13!,{R0,R14}.|
0000f480  33 f4 3f 20 20 20 20 20  20 20 20 20 20 20 20 20  |3.?             |
0000f490  20 20 20 53 57 49 20 20  20 20 20 58 4f 53 5f 57  |   SWI     XOS_W|
0000f4a0  72 69 74 65 49 2b 34 20  20 20 20 3b 20 ef 20 34  |riteI+4    ; . 4|
0000f4b0  20 66 6f 72 20 66 61 73  74 20 74 65 78 74 0d 33  | for fast text.3|
0000f4c0  fe 46 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.F              |
0000f4d0  20 20 53 57 49 20 20 20  20 20 58 4f 53 5f 57 72  |  SWI     XOS_Wr|
0000f4e0  69 74 65 49 2b 33 30 20  20 20 3b 20 ef 20 33 30  |iteI+30   ; . 30|
0000f4f0  20 74 6f 20 6b 65 65 70  20 69 6e 20 74 6f 70 20  | to keep in top |
0000f500  6c 65 66 74 0d 34 08 43  20 20 20 20 20 20 20 20  |left.4.C        |
0000f510  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
0000f520  52 30 2c 52 32 20 20 20  20 20 20 20 20 20 20 20  |R0,R2           |
0000f530  3b 20 44 69 73 70 6c 61  79 20 77 69 6e 64 6f 77  |; Display window|
0000f540  20 68 61 6e 64 6c 65 0d  34 12 22 20 20 20 20 20  | handle.4."     |
0000f550  20 20 20 20 20 20 20 20  20 20 20 42 4c 20 20 20  |           BL   |
0000f560  20 20 20 6f 75 74 68 65  78 0d 34 1c 3e 20 20 20  |   outhex.4.>   |
0000f570  20 20 20 20 20 20 20 20  20 20 20 20 20 53 57 49  |             SWI|
0000f580  20 20 20 20 20 22 58 4f  53 5f 4e 65 77 4c 69 6e  |     "XOS_NewLin|
0000f590  65 22 20 20 20 3b 20 4e  65 78 74 20 6c 69 6e 65  |e"   ; Next line|
0000f5a0  2e 20 49 2d 31 36 36 0d  34 26 41 20 20 20 20 20  |. I-166.4&A     |
0000f5b0  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |           MOV  |
0000f5c0  20 20 20 52 30 2c 52 33  20 20 20 20 20 20 20 20  |   R0,R3        |
0000f5d0  20 20 20 3b 20 44 69 73  70 6c 61 79 20 69 63 6f  |   ; Display ico|
0000f5e0  6e 20 68 61 6e 64 6c 65  0d 34 30 22 20 20 20 20  |n handle.40"    |
0000f5f0  20 20 20 20 20 20 20 20  20 20 20 20 42 4c 20 20  |            BL  |
0000f600  20 20 20 20 6f 75 74 68  65 78 0d 34 3a 45 20 20  |    outhex.4:E  |
0000f610  20 20 20 20 20 20 20 20  20 20 20 20 20 20 53 57  |              SW|
0000f620  49 20 20 20 20 20 58 4f  53 5f 57 72 69 74 65 49  |I     XOS_WriteI|
0000f630  2b 35 20 20 20 20 3b 20  42 61 63 6b 20 74 6f 20  |+5    ; Back to |
0000f640  73 6c 6f 77 20 74 65 78  74 20 61 67 61 69 6e 0d  |slow text again.|
0000f650  34 44 28 20 20 20 20 20  20 20 20 20 20 20 20 20  |4D(             |
0000f660  20 20 20 4c 44 4d 46 44  20 20 20 52 31 33 21 2c  |   LDMFD   R13!,|
0000f670  7b 52 30 2c 50 43 7d 0d  34 4e 04 0d 34 58 0b 2e  |{R0,PC}.4N..4X..|
0000f680  6f 75 74 68 65 78 0d 34  62 04 0d 34 6c 3e 3b 20  |outhex.4b..4l>; |
0000f690  4f 6e 20 65 6e 74 72 79  2c 20 20 20 20 20 52 30  |On entry,     R0|
0000f6a0  20 20 20 20 20 20 3d 20  56 61 6c 75 65 20 74 6f  |      = Value to|
0000f6b0  20 70 72 69 6e 74 65 64  20 61 73 20 38 20 68 65  | printed as 8 he|
0000f6c0  78 20 64 69 67 69 74 73  0d 34 76 04 0d 34 80 2c  |x digits.4v..4.,|
0000f6d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f6e0  53 54 4d 46 44 20 20 20  52 31 33 21 2c 7b 52 30  |STMFD   R13!,{R0|
0000f6f0  2d 52 32 2c 52 31 34 7d  0d 34 8a 4b 20 20 20 20  |-R2,R14}.4.K    |
0000f700  20 20 20 20 20 20 20 20  20 20 20 20 41 44 52 20  |            ADR |
0000f710  20 20 20 20 52 31 2c 68  65 78 62 75 66 66 65 72  |    R1,hexbuffer|
0000f720  20 20 20 20 3b 20 43 6f  6e 76 65 72 74 20 52 30  |    ; Convert R0|
0000f730  20 69 6e 74 6f 20 38 20  7a 65 72 6f 2d 70 61 64  | into 8 zero-pad|
0000f740  64 65 64 0d 34 94 3b 20  20 20 20 20 20 20 20 20  |ded.4.;         |
0000f750  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
0000f760  32 2c 23 39 20 20 20 20  20 20 20 20 20 20 20 3b  |2,#9           ;|
0000f770  20 68 65 78 20 64 69 67  69 74 73 2e 2e 2e 0d 34  | hex digits....4|
0000f780  9e 36 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.6              |
0000f790  20 20 53 57 49 20 20 20  20 20 22 58 4f 53 5f 43  |  SWI     "XOS_C|
0000f7a0  6f 6e 76 65 72 74 48 65  78 38 22 20 3b 20 49 49  |onvertHex8" ; II|
0000f7b0  2d 36 30 31 0d 34 a8 43  20 20 20 20 20 20 20 20  |-601.4.C        |
0000f7c0  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
0000f7d0  52 31 2c 23 38 20 20 20  20 20 20 20 20 20 20 20  |R1,#8           |
0000f7e0  3b 20 2e 2e 2e 61 6e 64  20 70 72 69 6e 74 20 74  |; ...and print t|
0000f7f0  68 65 6d 20 6f 75 74 0d  34 b2 33 20 20 20 20 20  |hem out.4.3     |
0000f800  20 20 20 20 20 20 20 20  20 20 20 53 57 49 20 20  |           SWI  |
0000f810  20 20 20 22 58 4f 53 5f  57 72 69 74 65 4e 22 20  |   "XOS_WriteN" |
0000f820  20 20 20 3b 20 49 2d 31  38 39 0d 34 bc 2b 20 20  |   ; I-189.4.+  |
0000f830  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |              LD|
0000f840  4d 46 44 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |MFD   R13!,{R0-R|
0000f850  32 2c 50 43 7d 0d 34 c6  24 2e 68 65 78 62 75 66  |2,PC}.4.$.hexbuf|
0000f860  66 65 72 20 20 20 20 20  20 45 51 55 53 20 20 20  |fer      EQUS   |
0000f870  20 c4 31 32 2c 62 6c 24  29 0d 34 d0 04 0d 34 da  | .12,bl$).4...4.|
0000f880  1b 3b 20 45 6e 64 20 6f  66 20 64 65 62 75 67 67  |.; End of debugg|
0000f890  69 6e 67 20 63 6f 64 65  0d 34 e4 05 5d 0d 34 ee  |ing code.4..].4.|
0000f8a0  05 cd 0d 34 f8 0b 5b 4f  50 54 20 41 25 0d 35 02  |...4..[OPT A%.5.|
0000f8b0  2c 2e 63 68 65 63 6b 66  6f 72 72 65 64 20 20 20  |,.checkforred   |
0000f8c0  20 53 54 4d 46 44 20 20  20 52 31 33 21 2c 7b 52  | STMFD   R13!,{R|
0000f8d0  30 2c 52 32 2c 52 31 34  7d 0d 35 0c 3f 20 20 20  |0,R2,R14}.5.?   |
0000f8e0  20 20 20 20 20 20 20 20  20 20 20 20 20 4c 44 52  |             LDR|
0000f8f0  42 20 20 20 20 52 30 2c  6d 6f 64 69 66 69 65 64  |B    R0,modified|
0000f900  62 6f 72 64 20 3b 20 49  66 20 62 6f 72 64 65 72  |bord ; If border|
0000f910  20 69 73 20 72 65 64 2c  0d 35 16 21 20 20 20 20  | is red,.5.!    |
0000f920  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 53  |            MOVS|
0000f930  20 20 20 20 52 30 2c 52  30 0d 35 20 4a 20 20 20  |    R0,R0.5 J   |
0000f940  20 20 20 20 20 20 20 20  20 20 20 20 20 4c 44 52  |             LDR|
0000f950  4e 45 20 20 20 52 30 2c  63 75 72 62 6f 72 64 65  |NE   R0,curborde|
0000f960  72 63 6f 6c 20 3b 20 74  68 65 6e 20 72 65 73 74  |rcol ; then rest|
0000f970  6f 72 65 20 74 6f 20 69  74 73 20 70 72 65 76 69  |ore to its previ|
0000f980  6f 75 73 0d 35 2a 34 20  20 20 20 20 20 20 20 20  |ous.5*4         |
0000f990  20 20 20 20 20 20 20 4d  4f 56 4e 45 20 20 20 52  |       MOVNE   R|
0000f9a0  32 2c 23 30 20 20 20 20  20 20 20 20 20 20 20 3b  |2,#0           ;|
0000f9b0  20 63 6f 6c 6f 75 72 0d  35 34 29 20 20 20 20 20  | colour.54)     |
0000f9c0  20 20 20 20 20 20 20 20  20 20 20 42 4c 4e 45 20  |           BLNE |
0000f9d0  20 20 20 72 65 73 74 6f  72 65 62 6f 72 64 65 72  |   restoreborder|
0000f9e0  0d 35 3e 2b 20 20 20 20  20 20 20 20 20 20 20 20  |.5>+            |
0000f9f0  20 20 20 20 4c 44 4d 46  44 20 20 20 52 31 33 21  |    LDMFD   R13!|
0000fa00  2c 7b 52 30 2c 52 32 2c  50 43 7d 0d 35 48 04 0d  |,{R0,R2,PC}.5H..|
0000fa10  35 52 2c 2e 74 75 72 6e  62 6f 72 64 65 72 72 65  |5R,.turnborderre|
0000fa20  64 20 20 53 54 4d 46 44  20 20 20 52 31 33 21 2c  |d  STMFD   R13!,|
0000fa30  7b 52 30 2c 52 31 2c 52  31 34 7d 0d 35 5c 41 20  |{R0,R1,R14}.5\A |
0000fa40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
0000fa50  44 52 42 20 20 20 20 52  30 2c 6d 6f 64 69 66 69  |DRB    R0,modifi|
0000fa60  65 64 62 6f 72 64 20 3b  20 53 6b 69 70 20 69 66  |edbord ; Skip if|
0000fa70  20 61 6c 72 65 61 64 79  20 72 65 64 0d 35 66 21  | already red.5f!|
0000fa80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000fa90  4d 4f 56 53 20 20 20 20  52 30 2c 52 30 0d 35 70  |MOVS    R0,R0.5p|
0000faa0  29 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |)               |
0000fab0  20 42 4e 45 20 20 20 20  20 61 6c 72 65 61 64 79  | BNE     already|
0000fac0  63 6f 6f 6b 65 64 0d 35  7a 48 20 20 20 20 20 20  |cooked.5zH      |
0000fad0  20 20 20 20 20 20 20 20  20 20 41 44 52 20 20 20  |          ADR   |
0000fae0  20 20 52 31 2c 77 69 6d  70 70 61 6c 65 74 74 65  |  R1,wimppalette|
0000faf0  20 20 3b 20 53 69 6d 70  6c 79 20 72 65 61 64 20  |  ; Simply read |
0000fb00  61 6c 6c 20 31 36 20 63  6f 6c 6f 75 72 73 0d 35  |all 16 colours.5|
0000fb10  84 49 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.I              |
0000fb20  20 20 53 57 49 20 20 20  20 20 22 58 57 69 6d 70  |  SWI     "XWimp|
0000fb30  5f 52 65 61 64 50 61 6c  65 74 74 65 22 20 3b 20  |_ReadPalette" ; |
0000fb40  61 6e 64 20 73 61 76 65  20 74 68 65 6d 2e 20 49  |and save them. I|
0000fb50  49 49 2d 31 32 35 31 0d  35 8e 49 20 20 20 20 20  |II-1251.5.I     |
0000fb60  20 20 20 20 20 20 20 20  20 20 20 4c 44 52 20 20  |           LDR  |
0000fb70  20 20 20 52 30 2c 5b 52  31 2c 23 36 34 5d 20 20  |   R0,[R1,#64]  |
0000fb80  20 20 20 3b 20 52 65 61  64 20 61 6e 64 20 73 61  |   ; Read and sa|
0000fb90  76 65 20 62 6f 72 64 65  72 20 63 6f 6c 6f 75 72  |ve border colour|
0000fba0  0d 35 98 2b 20 20 20 20  20 20 20 20 20 20 20 20  |.5.+            |
0000fbb0  20 20 20 20 53 54 52 20  20 20 20 20 52 30 2c 63  |    STR     R0,c|
0000fbc0  75 72 62 6f 72 64 65 72  63 6f 6c 0d 35 a2 3f 20  |urbordercol.5.? |
0000fbd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
0000fbe0  4f 56 20 20 20 20 20 52  30 2c 23 26 30 30 46 30  |OV     R0,#&00F0|
0000fbf0  30 30 20 20 20 20 20 3b  20 52 65 64 20 69 6e 20  |00     ; Red in |
0000fc00  52 47 42 20 76 61 6c 75  65 73 0d 35 ac 3e 20 20  |RGB values.5.>  |
0000fc10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4d 4f  |              MO|
0000fc20  56 20 20 20 20 20 52 32  2c 23 31 20 20 20 20 20  |V     R2,#1     |
0000fc30  20 20 20 20 20 20 3b 20  46 6c 61 67 20 61 73 20  |      ; Flag as |
0000fc40  6d 6f 64 69 66 69 65 64  0d 35 b6 49 20 20 20 20  |modified.5.I    |
0000fc50  20 20 20 20 20 20 20 20  20 20 20 20 42 4c 20 20  |            BL  |
0000fc60  20 20 20 20 72 65 73 74  6f 72 65 62 6f 72 64 65  |    restoreborde|
0000fc70  72 20 20 20 3b 20 43 68  61 6e 67 65 20 62 6f 72  |r   ; Change bor|
0000fc80  64 65 72 20 63 6f 6c 6f  75 72 20 74 6f 20 72 65  |der colour to re|
0000fc90  64 0d 35 c0 2b 2e 61 6c  72 65 61 64 79 63 6f 6f  |d.5.+.alreadycoo|
0000fca0  6b 65 64 20 20 4c 44 4d  46 44 20 20 20 52 31 33  |ked  LDMFD   R13|
0000fcb0  21 2c 7b 52 30 2c 52 31  2c 50 43 7d 0d 35 ca 1d  |!,{R0,R1,PC}.5..|
0000fcc0  2e 63 75 72 62 6f 72 64  65 72 63 6f 6c 20 20 20  |.curbordercol   |
0000fcd0  45 51 55 44 20 20 20 20  30 0d 35 d4 24 2e 77 69  |EQUD    0.5.$.wi|
0000fce0  6d 70 70 61 6c 65 74 74  65 20 20 20 20 45 51 55  |mppalette    EQU|
0000fcf0  53 20 20 20 20 c4 38 30  2c 62 6c 24 29 0d 35 de  |S    .80,bl$).5.|
0000fd00  1d 2e 6d 6f 64 69 66 69  65 64 62 6f 72 64 20 20  |..modifiedbord  |
0000fd10  20 45 51 55 42 20 20 20  20 30 0d 35 e8 19 20 20  | EQUB    0.5..  |
0000fd20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 41 4c  |              AL|
0000fd30  49 47 4e 0d 35 f2 04 0d  35 fc 12 2e 72 65 73 74  |IGN.5...5...rest|
0000fd40  6f 72 65 62 6f 72 64 65  72 0d 36 06 04 0d 36 10  |oreborder.6...6.|
0000fd50  32 3b 20 4f 6e 20 65 6e  74 72 79 2c 20 20 20 20  |2; On entry,    |
0000fd60  20 52 30 20 20 20 20 20  20 3d 20 52 47 42 20 76  | R0      = RGB v|
0000fd70  61 6c 75 65 20 66 6f 72  20 62 6f 72 64 65 72 0d  |alue for border.|
0000fd80  36 1a 2b 3b 20 20 20 20  20 20 20 20 20 20 20 20  |6.+;            |
0000fd90  20 20 20 52 32 20 20 20  20 20 20 3d 20 4d 6f 64  |   R2      = Mod|
0000fda0  69 66 69 65 64 20 66 6c  61 67 0d 36 24 04 0d 36  |ified flag.6$..6|
0000fdb0  2e 29 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.)              |
0000fdc0  20 20 53 54 4d 46 44 20  20 20 52 31 33 21 2c 7b  |  STMFD   R13!,{|
0000fdd0  52 31 2c 52 31 34 7d 0d  36 38 2b 20 20 20 20 20  |R1,R14}.68+     |
0000fde0  20 20 20 20 20 20 20 20  20 20 20 53 54 52 42 20  |           STRB |
0000fdf0  20 20 20 52 32 2c 6d 6f  64 69 66 69 65 64 62 6f  |   R2,modifiedbo|
0000fe00  72 64 0d 36 42 2a 20 20  20 20 20 20 20 20 20 20  |rd.6B*          |
0000fe10  20 20 20 20 20 20 41 44  52 20 20 20 20 20 52 31  |      ADR     R1|
0000fe20  2c 77 69 6d 70 70 61 6c  65 74 74 65 0d 36 4c 41  |,wimppalette.6LA|
0000fe30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000fe40  53 54 52 20 20 20 20 20  52 30 2c 5b 52 31 2c 23  |STR     R0,[R1,#|
0000fe50  36 34 5d 20 20 20 20 20  3b 20 53 74 6f 72 65 20  |64]     ; Store |
0000fe60  62 6f 72 64 65 72 20 63  6f 6c 6f 75 72 0d 36 56  |border colour.6V|
0000fe70  3f 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |?               |
0000fe80  20 42 4c 20 20 20 20 20  20 76 69 64 65 6f 73 79  | BL      videosy|
0000fe90  6e 63 20 20 20 20 20 20  20 3b 20 53 6d 6f 6f 74  |nc       ; Smoot|
0000fea0  68 20 6f 75 74 20 63 68  61 6e 67 65 0d 36 60 4c  |h out change.6`L|
0000feb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000fec0  53 57 49 20 20 20 20 20  22 58 57 69 6d 70 5f 53  |SWI     "XWimp_S|
0000fed0  65 74 50 61 6c 65 74 74  65 22 20 3b 20 4d 6f 64  |etPalette" ; Mod|
0000fee0  20 62 6f 72 64 65 72 20  63 6f 6c 6f 75 72 2e 20  | border colour. |
0000fef0  49 49 49 2d 31 32 35 30  0d 36 6a 28 20 20 20 20  |III-1250.6j(    |
0000ff00  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 4d 46  |            LDMF|
0000ff10  44 20 20 20 52 31 33 21  2c 7b 52 31 2c 50 43 7d  |D   R13!,{R1,PC}|
0000ff20  0d 36 74 04 0d 36 7e 11  2e 63 6f 70 79 68 65 6c  |.6t..6~..copyhel|
0000ff30  70 6d 65 73 73 0d 36 88  04 0d 36 92 37 3b 20 4f  |pmess.6...6.7; O|
0000ff40  6e 20 65 6e 74 72 79 2c  20 20 20 20 20 52 30 20  |n entry,     R0 |
0000ff50  20 20 20 20 20 3d 20 53  6f 75 72 63 65 20 61 64  |     = Source ad|
0000ff60  64 72 65 73 73 20 6f 66  20 6d 65 73 73 61 67 65  |dress of message|
0000ff70  0d 36 9c 35 3b 20 20 20  20 20 20 20 20 20 20 20  |.6.5;           |
0000ff80  20 20 20 20 52 32 20 20  20 20 20 20 3d 20 44 65  |    R2      = De|
0000ff90  73 74 20 61 64 64 72 65  73 73 20 6f 66 20 6d 65  |st address of me|
0000ffa0  73 73 61 67 65 0d 36 a6  32 3b 20 4f 6e 20 65 78  |ssage.6.2; On ex|
0000ffb0  69 74 2c 20 20 20 20 20  20 52 32 20 20 20 20 20  |it,      R2     |
0000ffc0  20 3d 20 55 70 64 61 74  65 64 20 64 65 73 74 20  | = Updated dest |
0000ffd0  61 64 64 72 65 73 73 0d  36 b0 04 0d 36 ba 2c 20  |address.6...6., |
0000ffe0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
0000fff0  54 4d 46 44 20 20 20 52  31 33 21 2c 7b 52 30 2c  |TMFD   R13!,{R0,|
00010000  52 31 2c 52 31 34 7d 0d  36 c4 41 2e 73 75 63 6b  |R1,R14}.6.A.suck|
00010010  75 70 68 65 6c 70 20 20  20 20 20 4c 44 52 42 20  |uphelp     LDRB |
00010020  20 20 20 52 31 2c 5b 52  30 5d 2c 23 31 20 20 20  |   R1,[R0],#1   |
00010030  20 20 20 3b 20 43 6f 70  79 20 68 65 6c 70 20 74  |   ; Copy help t|
00010040  65 78 74 20 69 6e 74 6f  0d 36 ce 21 20 20 20 20  |ext into.6.!    |
00010050  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 53  |            MOVS|
00010060  20 20 20 20 52 31 2c 52  31 0d 36 d8 3c 20 20 20  |    R1,R1.6.<   |
00010070  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 52  |             STR|
00010080  4e 45 42 20 20 52 31 2c  5b 52 32 5d 2c 23 31 20  |NEB  R1,[R2],#1 |
00010090  20 20 20 20 20 3b 20 6d  65 73 73 61 67 65 20 70  |     ; message p|
000100a0  61 63 6b 65 74 0d 36 e2  26 20 20 20 20 20 20 20  |acket.6.&       |
000100b0  20 20 20 20 20 20 20 20  20 42 4e 45 20 20 20 20  |         BNE    |
000100c0  20 73 75 63 6b 75 70 68  65 6c 70 0d 36 ec 2b 20  | suckuphelp.6.+ |
000100d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
000100e0  44 4d 46 44 20 20 20 52  31 33 21 2c 7b 52 30 2c  |DMFD   R13!,{R0,|
000100f0  52 31 2c 50 43 7d 0d 36  f6 04 0d 37 00 11 2e 61  |R1,PC}.6...7...a|
00010100  73 6b 65 64 66 6f 72 68  65 6c 70 0d 37 0a 04 0d  |skedforhelp.7...|
00010110  37 14 38 3b 20 4f 6e 20  65 6e 74 72 79 2c 20 20  |7.8; On entry,  |
00010120  20 20 20 52 31 20 20 20  20 20 20 3d 20 50 6f 69  |   R1      = Poi|
00010130  6e 74 65 72 20 74 6f 20  57 69 6d 70 5f 50 6f 6c  |nter to Wimp_Pol|
00010140  6c 20 62 6c 6f 63 6b 0d  37 1e 3c 3b 20 20 20 20  |l block.7.<;    |
00010150  20 20 20 20 20 20 20 20  20 20 20 52 34 20 20 20  |           R4   |
00010160  20 20 20 3d 20 30 20 69  66 20 69 63 6f 6e 2c 20  |   = 0 if icon, |
00010170  3c 3e 20 30 20 69 66 20  49 6e 66 6f 20 57 69 6e  |<> 0 if Info Win|
00010180  64 6f 77 0d 37 28 04 0d  37 32 2c 20 20 20 20 20  |dow.7(..72,     |
00010190  20 20 20 20 20 20 20 20  20 20 20 53 54 4d 46 44  |           STMFD|
000101a0  20 20 20 52 31 33 21 2c  7b 52 30 2d 52 33 2c 52  |   R13!,{R0-R3,R|
000101b0  31 34 7d 0d 37 3c 4a 20  20 20 20 20 20 20 20 20  |14}.7<J         |
000101c0  20 20 20 20 20 20 20 41  44 44 20 20 20 20 20 52  |       ADD     R|
000101d0  32 2c 52 31 2c 23 32 30  20 20 20 20 20 20 20 3b  |2,R1,#20       ;|
000101e0  20 57 68 65 72 65 20 74  68 65 20 68 65 6c 70 20  | Where the help |
000101f0  74 65 78 74 20 69 73 20  74 6f 20 67 6f 0d 37 46  |text is to go.7F|
00010200  4d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |M               |
00010210  20 4d 4f 56 53 20 20 20  20 52 34 2c 52 34 20 20  | MOVS    R4,R4  |
00010220  20 20 20 20 20 20 20 20  20 3b 20 49 73 20 69 74  |         ; Is it|
00010230  20 74 68 65 20 69 63 6f  6e 20 6f 72 20 49 6e 66  | the icon or Inf|
00010240  6f 20 77 69 6e 64 6f 77  20 3f 0d 37 50 27 20 20  |o window ?.7P'  |
00010250  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 45  |              BE|
00010260  51 20 20 20 20 20 69 74  73 69 63 6f 6e 68 65 6c  |Q     itsiconhel|
00010270  70 0d 37 5a 3e 20 20 20  20 20 20 20 20 20 20 20  |p.7Z>           |
00010280  20 20 20 20 20 41 44 52  20 20 20 20 20 52 30 2c  |     ADR     R0,|
00010290  68 65 6c 70 6d 65 73 73  69 6e 66 6f 20 3b 20 49  |helpmessinfo ; I|
000102a0  6e 66 6f 20 57 69 6e 64  6f 77 20 68 65 6c 70 0d  |nfo Window help.|
000102b0  37 64 28 20 20 20 20 20  20 20 20 20 20 20 20 20  |7d(             |
000102c0  20 20 20 42 4c 20 20 20  20 20 20 63 6f 70 79 68  |   BL      copyh|
000102d0  65 6c 70 6d 65 73 73 0d  37 6e 29 20 20 20 20 20  |elpmess.7n)     |
000102e0  20 20 20 20 20 20 20 20  20 20 20 42 20 20 20 20  |           B    |
000102f0  20 20 20 66 69 6e 69 73  68 6d 65 73 73 6e 6f 77  |   finishmessnow|
00010300  0d 37 78 49 2e 69 74 73  69 63 6f 6e 68 65 6c 70  |.7xI.itsiconhelp|
00010310  20 20 20 20 41 44 52 20  20 20 20 20 52 30 2c 68  |    ADR     R0,h|
00010320  65 6c 70 6d 65 73 73 69  63 6f 6e 20 3b 20 46 69  |elpmessicon ; Fi|
00010330  72 73 74 20 68 65 6c 70  20 6c 69 6e 65 20 69 73  |rst help line is|
00010340  20 63 6f 6e 73 74 61 6e  74 0d 37 82 28 20 20 20  | constant.7.(   |
00010350  20 20 20 20 20 20 20 20  20 20 20 20 20 42 4c 20  |             BL |
00010360  20 20 20 20 20 63 6f 70  79 68 65 6c 70 6d 65 73  |     copyhelpmes|
00010370  73 0d 37 8c 4a 20 20 20  20 20 20 20 20 20 20 20  |s.7.J           |
00010380  20 20 20 20 20 4c 44 52  42 20 20 20 20 52 33 2c  |     LDRB    R3,|
00010390  43 4d 4f 53 62 79 74 65  20 20 20 20 20 3b 20 4e  |CMOSbyte     ; N|
000103a0  6f 77 20 64 65 63 69 64  65 20 6f 6e 20 49 6d 6d  |ow decide on Imm|
000103b0  65 64 69 61 74 65 20 74  65 78 74 0d 37 96 3f 20  |ediate text.7.? |
000103c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 54  |               T|
000103d0  53 54 20 20 20 20 20 52  33 2c 23 25 30 30 31 20  |ST     R3,#%001 |
000103e0  20 20 20 20 20 20 20 3b  20 6f 72 20 54 72 61 73  |       ; or Tras|
000103f0  68 24 44 69 72 20 69 6e  66 6f 0d 37 a0 28 20 20  |h$Dir info.7.(  |
00010400  20 20 20 20 20 20 20 20  20 20 20 20 20 20 41 44  |              AD|
00010410  52 4e 45 20 20 20 52 30  2c 68 65 6c 70 69 6d 6d  |RNE   R0,helpimm|
00010420  65 64 0d 37 aa 28 20 20  20 20 20 20 20 20 20 20  |ed.7.(          |
00010430  20 20 20 20 20 20 41 44  52 45 51 20 20 20 52 30  |      ADREQ   R0|
00010440  2c 68 65 6c 70 73 74 6f  72 65 0d 37 b4 28 20 20  |,helpstore.7.(  |
00010450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 4c  |              BL|
00010460  20 20 20 20 20 20 63 6f  70 79 68 65 6c 70 6d 65  |      copyhelpme|
00010470  73 73 0d 37 be 49 20 20  20 20 20 20 20 20 20 20  |ss.7.I          |
00010480  20 20 20 20 20 20 54 53  54 20 20 20 20 20 52 33  |      TST     R3|
00010490  2c 23 25 30 31 30 20 20  20 20 20 20 20 20 3b 20  |,#%010        ; |
000104a0  41 64 64 20 57 61 72 6e  69 6e 67 20 74 65 78 74  |Add Warning text|
000104b0  20 69 66 20 65 6e 61 62  6c 65 64 0d 37 c8 27 20  | if enabled.7.' |
000104c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 41  |               A|
000104d0  44 52 4e 45 20 20 20 52  30 2c 68 65 6c 70 77 61  |DRNE   R0,helpwa|
000104e0  72 6e 0d 37 d2 28 20 20  20 20 20 20 20 20 20 20  |rn.7.(          |
000104f0  20 20 20 20 20 20 42 4c  4e 45 20 20 20 20 63 6f  |      BLNE    co|
00010500  70 79 68 65 6c 70 6d 65  73 73 0d 37 dc 4b 20 20  |pyhelpmess.7.K  |
00010510  20 20 20 20 20 20 20 20  20 20 20 20 20 20 54 53  |              TS|
00010520  54 20 20 20 20 20 52 33  2c 23 25 31 30 30 20 20  |T     R3,#%100  |
00010530  20 20 20 20 20 20 3b 20  41 64 64 20 41 6e 69 6d  |      ; Add Anim|
00010540  61 74 69 6f 6e 20 74 65  78 74 20 69 66 20 65 6e  |ation text if en|
00010550  61 62 6c 65 64 0d 37 e6  27 20 20 20 20 20 20 20  |abled.7.'       |
00010560  20 20 20 20 20 20 20 20  20 41 44 52 4e 45 20 20  |         ADRNE  |
00010570  20 52 30 2c 68 65 6c 70  61 6e 69 6d 0d 37 f0 28  | R0,helpanim.7.(|
00010580  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00010590  42 4c 4e 45 20 20 20 20  63 6f 70 79 68 65 6c 70  |BLNE    copyhelp|
000105a0  6d 65 73 73 0d 37 fa 44  2e 66 69 6e 69 73 68 6d  |mess.7.D.finishm|
000105b0  65 73 73 6e 6f 77 20 20  4d 4f 56 20 20 20 20 20  |essnow  MOV     |
000105c0  52 30 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |R0,#0           |
000105d0  3b 20 4e 75 6c 6c 20 74  65 72 6d 69 6e 61 74 6f  |; Null terminato|
000105e0  72 20 6e 65 65 64 65 64  0d 38 04 27 20 20 20 20  |r needed.8.'    |
000105f0  20 20 20 20 20 20 20 20  20 20 20 20 53 54 52 42  |            STRB|
00010600  20 20 20 20 52 30 2c 5b  52 32 2c 23 2d 32 5d 0d  |    R0,[R2,#-2].|
00010610  38 0e 4c 20 20 20 20 20  20 20 20 20 20 20 20 20  |8.L             |
00010620  20 20 20 41 44 44 20 20  20 20 20 52 30 2c 52 32  |   ADD     R0,R2|
00010630  2c 23 32 20 20 20 20 20  20 20 20 3b 20 43 6f 6d  |,#2        ; Com|
00010640  70 75 74 65 20 77 6f 72  64 2d 72 6f 75 6e 64 65  |pute word-rounde|
00010650  64 20 6c 65 6e 67 74 68  20 6f 66 0d 38 18 3b 20  |d length of.8.; |
00010660  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 42  |               B|
00010670  49 43 20 20 20 20 20 52  30 2c 52 30 2c 23 25 31  |IC     R0,R0,#%1|
00010680  31 20 20 20 20 20 20 3b  20 6d 65 73 73 61 67 65  |1      ; message|
00010690  20 62 6c 6f 63 6b 0d 38  22 24 20 20 20 20 20 20  | block.8"$      |
000106a0  20 20 20 20 20 20 20 20  20 20 53 55 42 20 20 20  |          SUB   |
000106b0  20 20 52 30 2c 52 30 2c  52 31 0d 38 2c 42 20 20  |  R0,R0,R1.8,B  |
000106c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 53 54  |              ST|
000106d0  52 20 20 20 20 20 52 30  2c 5b 52 31 5d 20 20 20  |R     R0,[R1]   |
000106e0  20 20 20 20 20 20 3b 20  53 61 76 65 20 6c 65 6e  |      ; Save len|
000106f0  67 74 68 20 69 6e 20 62  6c 6f 63 6b 0d 38 36 45  |gth in block.86E|
00010700  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00010710  4c 44 52 20 20 20 20 20  52 32 2c 5b 52 31 2c 23  |LDR     R2,[R1,#|
00010720  34 5d 20 20 20 20 20 20  3b 20 54 61 73 6b 20 68  |4]      ; Task h|
00010730  61 6e 64 6c 65 20 74 6f  20 72 65 70 6c 79 20 74  |andle to reply t|
00010740  6f 0d 38 40 43 20 20 20  20 20 20 20 20 20 20 20  |o.8@C           |
00010750  20 20 20 20 20 4c 44 52  20 20 20 20 20 52 30 2c  |     LDR     R0,|
00010760  5b 52 31 2c 23 38 5d 20  20 20 20 20 20 3b 20 43  |[R1,#8]      ; C|
00010770  6f 70 79 20 72 65 66 65  72 65 6e 63 65 20 6e 75  |opy reference nu|
00010780  6d 62 65 72 0d 38 4a 27  20 20 20 20 20 20 20 20  |mber.8J'        |
00010790  20 20 20 20 20 20 20 20  53 54 52 20 20 20 20 20  |        STR     |
000107a0  52 30 2c 5b 52 31 2c 23  31 32 5d 0d 38 54 24 20  |R0,[R1,#12].8T$ |
000107b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
000107c0  4f 56 20 20 20 20 20 52  30 2c 23 26 35 30 30 0d  |OV     R0,#&500.|
000107d0  38 5e 43 20 20 20 20 20  20 20 20 20 20 20 20 20  |8^C             |
000107e0  20 20 20 41 44 44 20 20  20 20 20 52 30 2c 52 30  |   ADD     R0,R0|
000107f0  2c 23 33 20 20 20 20 20  20 20 20 3b 20 21 48 65  |,#3        ; !He|
00010800  6c 70 20 72 65 70 6c 79  20 49 44 20 3d 20 26 35  |lp reply ID = &5|
00010810  30 33 0d 38 68 27 20 20  20 20 20 20 20 20 20 20  |03.8h'          |
00010820  20 20 20 20 20 20 53 54  52 20 20 20 20 20 52 30  |      STR     R0|
00010830  2c 5b 52 31 2c 23 31 36  5d 0d 38 72 22 20 20 20  |,[R1,#16].8r"   |
00010840  20 20 20 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |             MOV|
00010850  20 20 20 20 20 52 30 2c  23 31 37 0d 38 7c 2f 20  |     R0,#17.8|/ |
00010860  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
00010870  57 49 20 20 20 20 20 22  58 57 69 6d 70 5f 53 65  |WI     "XWimp_Se|
00010880  6e 64 4d 65 73 73 61 67  65 22 0d 38 86 2b 20 20  |ndMessage".8.+  |
00010890  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |              LD|
000108a0  4d 46 44 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |MFD   R13!,{R0-R|
000108b0  33 2c 50 43 7d 0d 38 90  81 2e 68 65 6c 70 6d 65  |3,PC}.8...helpme|
000108c0  73 73 69 6e 66 6f 20 20  20 45 51 55 53 20 20 20  |ssinfo   EQUS   |
000108d0  20 22 54 68 69 73 20 69  73 20 74 68 65 20 49 6e  | "This is the In|
000108e0  66 6f 20 57 69 6e 64 6f  77 2e 7c 4d 49 74 20 73  |fo Window.|MIt s|
000108f0  68 6f 77 73 20 74 68 65  20 6e 61 6d 65 20 61 6e  |hows the name an|
00010900  64 20 70 75 72 70 6f 73  65 20 6f 66 20 74 68 69  |d purpose of thi|
00010910  73 20 61 70 70 6c 69 63  61 74 69 6f 6e 20 61 73  |s application as|
00010920  20 77 65 6c 6c 20 61 73  20 74 68 65 20 61 75 74  | well as the aut|
00010930  68 6f 72 2c 20 22 0d 38  9a 5f 20 20 20 20 20 20  |hor, ".8._      |
00010940  20 20 20 20 20 20 20 20  20 20 45 51 55 53 20 20  |          EQUS  |
00010950  20 20 22 76 65 72 73 69  6f 6e 20 6e 75 6d 62 65  |  "version numbe|
00010960  72 20 61 6e 64 20 64 61  74 65 20 64 65 76 65 6c  |r and date devel|
00010970  6f 70 65 64 2e 20 49 74  20 65 6d 70 6c 6f 79 73  |oped. It employs|
00010980  20 27 61 75 74 6f 2d 73  74 61 6d 70 69 6e 67 27  | 'auto-stamping'|
00010990  20 74 6f 20 22 0d 38 a4  64 20 20 20 20 20 20 20  | to ".8.d       |
000109a0  20 20 20 20 20 20 20 20  20 45 51 55 53 20 20 20  |         EQUS   |
000109b0  20 22 73 79 6e 63 68 72  6f 6e 69 73 65 20 22 2b  | "synchronise "+|
000109c0  70 72 6f 67 24 2b 22 20  6d 6f 64 75 6c 65 20 61  |prog$+" module a|
000109d0  6e 64 20 49 6e 66 6f 20  57 69 6e 64 6f 77 20 76  |nd Info Window v|
000109e0  65 72 73 69 6f 6e 73 20  61 6e 64 20 64 61 74 65  |ersions and date|
000109f0  73 2e 7c 4d 22 2b 62 6c  24 0d 38 ae 19 20 20 20  |s.|M"+bl$.8..   |
00010a00  20 20 20 20 20 20 20 20  20 20 20 20 20 41 4c 49  |             ALI|
00010a10  47 4e 0d 38 b8 54 2e 68  65 6c 70 6d 65 73 73 69  |GN.8.T.helpmessi|
00010a20  63 6f 6e 20 20 20 45 51  55 53 20 20 20 20 22 54  |con   EQUS    "T|
00010a30  68 69 73 20 69 73 20 74  68 65 20 22 2b 70 72 6f  |his is the "+pro|
00010a40  67 24 2b 22 20 69 63 6f  6e 2e 20 44 72 61 67 20  |g$+" icon. Drag |
00010a50  66 69 6c 65 73 20 6f 6e  74 6f 20 69 74 20 74 6f  |files onto it to|
00010a60  20 22 2b 62 6c 24 0d 38  c2 19 20 20 20 20 20 20  | "+bl$.8..      |
00010a70  20 20 20 20 20 20 20 20  20 20 41 4c 49 47 4e 0d  |          ALIGN.|
00010a80  38 cc 54 2e 68 65 6c 70  69 6d 6d 65 64 20 20 20  |8.T.helpimmed   |
00010a90  20 20 20 45 51 55 53 20  20 20 20 22 64 65 6c 65  |   EQUS    "dele|
00010aa0  74 65 20 74 68 65 6d 20  69 6d 6d 65 64 69 61 74  |te them immediat|
00010ab0  65 6c 79 2e 7c 4d 4d 45  4e 55 3a 20 54 6f 67 67  |ely.|MMENU: Togg|
00010ac0  6c 65 73 20 6f 70 74 69  6f 6e 73 2e 7c 4d 22 2b  |les options.|M"+|
00010ad0  62 6c 24 0d 38 d6 19 20  20 20 20 20 20 20 20 20  |bl$.8..         |
00010ae0  20 20 20 20 20 20 20 41  4c 49 47 4e 0d 38 e0 82  |       ALIGN.8..|
00010af0  2e 68 65 6c 70 73 74 6f  72 65 20 20 20 20 20 20  |.helpstore      |
00010b00  45 51 55 53 20 20 20 20  22 70 75 74 20 74 68 65  |EQUS    "put the|
00010b10  6d 20 69 6e 20 74 68 65  20 22 2b 70 72 6f 67 24  |m in the "+prog$|
00010b20  2b 22 2e 7c 4d 4d 45 4e  55 3a 20 54 6f 67 67 6c  |+".|MMENU: Toggl|
00010b30  65 73 20 6f 70 74 69 6f  6e 73 2f 65 6d 70 74 69  |es options/empti|
00010b40  65 73 20 74 72 61 73 68  2e 20 53 45 4c 45 43 54  |es trash. SELECT|
00010b50  20 6f 72 20 41 44 4a 55  53 54 3a 20 56 69 65 77  | or ADJUST: View|
00010b60  20 74 72 61 73 68 2e 7c  4d 22 2b 62 6c 24 0d 38  | trash.|M"+bl$.8|
00010b70  ea 19 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
00010b80  20 20 41 4c 49 47 4e 0d  38 f4 52 2e 68 65 6c 70  |  ALIGN.8.R.help|
00010b90  77 61 72 6e 20 20 20 20  20 20 20 45 51 55 53 20  |warn       EQUS |
00010ba0  20 20 20 22 41 20 72 65  64 20 62 6f 72 64 65 72  |   "A red border|
00010bb0  20 77 61 72 6e 69 6e 67  20 69 73 20 73 68 6f 77  | warning is show|
00010bc0  6e 20 62 65 66 6f 72 65  20 64 65 6c 65 74 69 6f  |n before deletio|
00010bd0  6e 2e 7c 4d 22 2b 62 6c  24 0d 38 fe 19 20 20 20  |n.|M"+bl$.8..   |
00010be0  20 20 20 20 20 20 20 20  20 20 20 20 20 41 4c 49  |             ALI|
00010bf0  47 4e 0d 39 08 47 2e 68  65 6c 70 61 6e 69 6d 20  |GN.9.G.helpanim |
00010c00  20 20 20 20 20 20 45 51  55 53 20 20 20 20 22 41  |      EQUS    "A|
00010c10  20 54 72 61 73 68 20 56  61 6e 20 77 69 6c 6c 20  | Trash Van will |
00010c20  70 69 63 6b 20 75 70 20  74 68 65 20 74 72 61 73  |pick up the tras|
00010c30  68 2e 7c 4d 22 2b 62 6c  24 0d 39 12 19 20 20 20  |h.|M"+bl$.9..   |
00010c40  20 20 20 20 20 20 20 20  20 20 20 20 20 41 4c 49  |             ALI|
00010c50  47 4e 0d 39 1c 04 0d 39  26 2c 2e 76 69 64 65 6f  |GN.9...9&,.video|
00010c60  73 79 6e 63 20 20 20 20  20 20 53 54 4d 46 44 20  |sync      STMFD |
00010c70  20 20 52 31 33 21 2c 7b  52 30 2d 52 32 2c 52 31  |  R13!,{R0-R2,R1|
00010c80  34 7d 0d 39 30 48 20 20  20 20 20 20 20 20 20 20  |4}.90H          |
00010c90  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 52 30  |      MOV     R0|
00010ca0  2c 23 31 39 20 20 20 20  20 20 20 20 20 20 3b 20  |,#19          ; |
00010cb0  c8 96 20 28 77 61 74 63  68 20 6f 75 74 20 2d 20  |.. (watch out - |
00010cc0  61 6e 6e 6f 79 69 6e 67  6c 79 0d 39 3a 4a 20 20  |annoyingly.9:J  |
00010cd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 53 57  |              SW|
00010ce0  49 20 20 20 20 20 22 58  4f 53 5f 42 79 74 65 22  |I     "XOS_Byte"|
00010cf0  20 20 20 20 20 20 3b 20  63 6f 72 72 75 70 74 73  |      ; corrupts|
00010d00  20 52 31 20 61 6e 64 20  52 32 20 21 29 2e 20 49  | R1 and R2 !). I|
00010d10  2d 32 39 38 0d 39 44 2b  20 20 20 20 20 20 20 20  |-298.9D+        |
00010d20  20 20 20 20 20 20 20 20  4c 44 4d 46 44 20 20 20  |        LDMFD   |
00010d30  52 31 33 21 2c 7b 52 30  2d 52 32 2c 50 43 7d 0d  |R13!,{R0-R2,PC}.|
00010d40  39 4e 04 0d 39 58 11 2e  77 69 6d 70 73 70 72 69  |9N..9X..wimpspri|
00010d50  74 65 6f 70 0d 39 62 04  0d 39 6c 35 3b 20 4f 6e  |teop.9b..9l5; On|
00010d60  20 65 6e 74 72 79 2c 20  20 20 20 20 52 30 20 20  | entry,     R0  |
00010d70  20 20 20 20 3d 20 4f 53  5f 53 70 72 69 74 65 4f  |    = OS_SpriteO|
00010d80  70 20 72 65 61 73 6f 6e  20 63 6f 64 65 0d 39 76  |p reason code.9v|
00010d90  42 3b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |B;              |
00010da0  20 52 32 20 20 20 20 20  20 3d 20 50 6f 69 6e 74  | R2      = Point|
00010db0  65 72 20 74 6f 20 73 70  72 69 74 65 20 6e 61 6d  |er to sprite nam|
00010dc0  65 20 28 6f 72 20 66 69  6c 65 6e 61 6d 65 29 0d  |e (or filename).|
00010dd0  39 80 36 3b 20 20 20 20  20 20 20 20 20 20 20 20  |9.6;            |
00010de0  20 20 20 52 33 2e 2e 20  20 20 20 3d 20 4f 74 68  |   R3..    = Oth|
00010df0  65 72 20 4f 53 5f 53 70  72 69 74 65 4f 70 20 70  |er OS_SpriteOp p|
00010e00  61 72 61 6d 73 0d 39 8a  04 0d 39 94 2c 20 20 20  |arams.9...9.,   |
00010e10  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 4d  |             STM|
00010e20  46 44 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 32  |FD   R13!,{R0-R2|
00010e30  2c 52 31 34 7d 0d 39 9e  04 0d 39 a8 4a 3b 20 4e  |,R14}.9...9.J; N|
00010e40  6f 74 65 20 74 6f 20 41  63 6f 72 6e 20 2d 20 49  |ote to Acorn - I|
00010e50  20 77 6f 75 6c 64 20 44  45 41 52 4c 59 20 6c 69  | would DEARLY li|
00010e60  6b 65 20 74 6f 20 75 73  65 20 57 69 6d 70 5f 53  |ke to use Wimp_S|
00010e70  70 72 69 74 65 4f 70 20  65 78 63 6c 75 73 69 76  |priteOp exclusiv|
00010e80  65 6c 79 0d 39 b2 45 3b  20 69 6e 20 74 68 69 73  |ely.9.E; in this|
00010e90  20 6d 6f 64 75 6c 65 2c  20 62 75 74 20 69 74 20  | module, but it |
00010ea0  64 6f 65 73 6e 27 74 20  73 75 70 70 6f 72 74 20  |doesn't support |
00010eb0  61 6e 79 20 22 77 72 69  74 65 22 20 6f 70 65 72  |any "write" oper|
00010ec0  61 74 69 6f 6e 73 20 21  0d 39 bc 04 0d 39 c6 4b  |ations !.9...9.K|
00010ed0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00010ee0  41 44 44 20 20 20 20 20  52 30 2c 52 30 2c 23 26  |ADD     R0,R0,#&|
00010ef0  31 30 30 20 20 20 20 20  3b 20 50 6f 69 6e 74 69  |100     ; Pointi|
00010f00  6e 67 20 74 6f 20 73 70  65 63 69 61 6c 20 75 73  |ng to special us|
00010f10  65 72 20 61 72 65 61 0d  39 d0 36 20 20 20 20 20  |er area.9.6     |
00010f20  20 20 20 20 20 20 20 20  20 20 20 53 57 49 20 20  |           SWI  |
00010f30  20 20 20 22 58 57 69 6d  70 5f 53 70 72 69 74 65  |   "XWimp_Sprite|
00010f40  4f 70 22 3b 20 49 49 49  2d 31 32 37 31 0d 39 da  |Op"; III-1271.9.|
00010f50  2b 2e 6c 65 61 76 65 73  70 72 69 74 65 6f 70 20  |+.leavespriteop |
00010f60  20 4c 44 4d 46 44 20 20  20 52 31 33 21 2c 7b 52  | LDMFD   R13!,{R|
00010f70  30 2d 52 32 2c 50 43 7d  0d 39 e4 04 0d 39 ee 0d  |0-R2,PC}.9...9..|
00010f80  2e 73 70 72 69 74 65 6f  70 0d 39 f8 04 0d 3a 02  |.spriteop.9...:.|
00010f90  35 3b 20 4f 6e 20 65 6e  74 72 79 2c 20 20 20 20  |5; On entry,    |
00010fa0  20 52 30 20 20 20 20 20  20 3d 20 4f 53 5f 53 70  | R0      = OS_Sp|
00010fb0  72 69 74 65 4f 70 20 72  65 61 73 6f 6e 20 63 6f  |riteOp reason co|
00010fc0  64 65 0d 3a 0c 42 3b 20  20 20 20 20 20 20 20 20  |de.:.B;         |
00010fd0  20 20 20 20 20 20 52 32  20 20 20 20 20 20 3d 20  |      R2      = |
00010fe0  50 6f 69 6e 74 65 72 20  74 6f 20 73 70 72 69 74  |Pointer to sprit|
00010ff0  65 20 6e 61 6d 65 20 28  6f 72 20 66 69 6c 65 6e  |e name (or filen|
00011000  61 6d 65 29 0d 3a 16 36  3b 20 20 20 20 20 20 20  |ame).:.6;       |
00011010  20 20 20 20 20 20 20 20  52 33 2e 2e 20 20 20 20  |        R3..    |
00011020  3d 20 4f 74 68 65 72 20  4f 53 5f 53 70 72 69 74  |= Other OS_Sprit|
00011030  65 4f 70 20 70 61 72 61  6d 73 0d 3a 20 04 0d 3a  |eOp params.: ..:|
00011040  2a 2c 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |*,              |
00011050  20 20 53 54 4d 46 44 20  20 20 52 31 33 21 2c 7b  |  STMFD   R13!,{|
00011060  52 30 2d 52 32 2c 52 31  34 7d 0d 3a 34 3c 20 20  |R0-R2,R14}.:4<  |
00011070  20 20 20 20 20 20 20 20  20 20 20 20 20 20 41 44  |              AD|
00011080  44 20 20 20 20 20 52 30  2c 52 30 2c 23 26 31 30  |D     R0,R0,#&10|
00011090  30 20 20 20 20 20 3b 20  46 6c 61 67 20 75 73 65  |0     ; Flag use|
000110a0  72 20 61 72 65 61 0d 3a  3e 29 20 20 20 20 20 20  |r area.:>)      |
000110b0  20 20 20 20 20 20 20 20  20 20 4c 44 52 20 20 20  |          LDR   |
000110c0  20 20 52 31 2c 73 70 72  69 74 65 61 72 65 61 0d  |  R1,spritearea.|
000110d0  3a 48 33 20 20 20 20 20  20 20 20 20 20 20 20 20  |:H3             |
000110e0  20 20 20 53 57 49 20 20  20 20 20 22 58 4f 53 5f  |   SWI     "XOS_|
000110f0  53 70 72 69 74 65 4f 70  22 20 20 3b 20 49 2d 33  |SpriteOp"  ; I-3|
00011100  39 33 0d 3a 52 2b 20 20  20 20 20 20 20 20 20 20  |93.:R+          |
00011110  20 20 20 20 20 20 4c 44  4d 46 44 20 20 20 52 31  |      LDMFD   R1|
00011120  33 21 2c 7b 52 30 2d 52  32 2c 50 43 7d 0d 3a 5c  |3!,{R0-R2,PC}.:\|
00011130  04 0d 3a 66 0f 2e 74 72  75 6e 64 6c 65 76 61 6e  |..:f..trundlevan|
00011140  0d 3a 70 04 0d 3a 7a 3b  3b 20 4f 6e 20 65 6e 74  |.:p..:z;; On ent|
00011150  72 79 2c 20 20 20 20 20  52 30 20 20 20 20 20 20  |ry,     R0      |
00011160  3d 20 50 6f 69 6e 74 65  72 20 74 6f 20 73 70 72  |= Pointer to spr|
00011170  69 74 65 20 66 61 6d 69  6c 79 20 6e 61 6d 65 0d  |ite family name.|
00011180  3a 84 2c 3b 20 20 20 20  20 20 20 20 20 20 20 20  |:.,;            |
00011190  20 20 20 52 31 20 20 20  20 20 20 3d 20 53 74 61  |   R1      = Sta|
000111a0  72 74 20 70 6f 73 69 74  69 6f 6e 0d 3a 8e 2d 3b  |rt position.:.-;|
000111b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 52  |               R|
000111c0  32 20 20 20 20 20 20 3d  20 46 69 6e 69 73 68 20  |2      = Finish |
000111d0  70 6f 73 69 74 69 6f 6e  0d 3a 98 49 3b 20 20 20  |position.:.I;   |
000111e0  20 20 20 20 20 20 20 20  20 20 20 20 52 33 20 20  |            R3  |
000111f0  20 20 20 20 3d 20 4f 53  20 75 6e 69 74 73 20 62  |    = OS units b|
00011200  65 74 77 65 65 6e 20 65  61 63 68 20 6d 6f 76 65  |etween each move|
00011210  6d 65 6e 74 20 28 63 61  6e 20 62 65 20 2d 76 65  |ment (can be -ve|
00011220  29 0d 3a a2 27 3b 20 20  20 20 20 20 20 20 20 20  |).:.';          |
00011230  20 20 20 20 20 52 37 2f  52 38 20 20 20 3d 20 58  |     R7/R8   = X|
00011240  2f 59 20 73 68 69 66 74  0d 3a ac 04 0d 3a b6 2d  |/Y shift.:...:.-|
00011250  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00011260  53 54 4d 46 44 20 20 20  52 31 33 21 2c 7b 52 30  |STMFD   R13!,{R0|
00011270  2d 52 31 30 2c 52 31 34  7d 0d 3a c0 28 20 20 20  |-R10,R14}.:.(   |
00011280  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 4d  |             STM|
00011290  46 44 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 33  |FD   R13!,{R0-R3|
000112a0  7d 0d 3a ca 21 20 20 20  20 20 20 20 20 20 20 20  |}.:.!           |
000112b0  20 20 20 20 20 4d 4f 56  20 20 20 20 20 52 32 2c  |     MOV     R2,|
000112c0  52 30 0d 3a d4 3f 20 20  20 20 20 20 20 20 20 20  |R0.:.?          |
000112d0  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 52 39  |      MOV     R9|
000112e0  2c 23 97 22 31 22 20 20  20 20 20 20 3b 20 53 65  |,#."1"      ; Se|
000112f0  6c 65 63 74 20 66 69 72  73 74 20 73 70 72 69 74  |lect first sprit|
00011300  65 0d 3a de 26 20 20 20  20 20 20 20 20 20 20 20  |e.:.&           |
00011310  20 20 20 20 20 53 54 52  42 20 20 20 20 52 39 2c  |     STRB    R9,|
00011320  5b 52 32 2c 23 36 5d 0d  3a e8 3e 20 20 20 20 20  |[R2,#6].:.>     |
00011330  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |           MOV  |
00011340  20 20 20 52 30 2c 23 34  30 20 20 20 20 20 20 20  |   R0,#40       |
00011350  20 20 20 3b 20 52 65 61  64 20 73 70 72 69 74 65  |   ; Read sprite|
00011360  20 69 6e 66 6f 0d 3a f2  33 20 20 20 20 20 20 20  | info.:.3       |
00011370  20 20 20 20 20 20 20 20  20 42 4c 20 20 20 20 20  |         BL     |
00011380  20 77 69 6d 70 73 70 72  69 74 65 6f 70 20 20 20  | wimpspriteop   |
00011390  20 3b 20 49 2d 34 32 33  0d 3a fc 42 20 20 20 20  | ; I-423.:.B    |
000113a0  20 20 20 20 20 20 20 20  20 20 20 20 42 56 53 20  |            BVS |
000113b0  20 20 20 20 73 70 72 69  74 65 66 61 69 6c 75 72  |    spritefailur|
000113c0  65 20 20 20 3b 20 47 69  76 65 20 75 70 20 69 66  |e   ; Give up if|
000113d0  20 6e 6f 20 73 70 72 69  74 65 0d 3b 06 4b 20 20  | no sprite.;.K  |
000113e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4d 4f  |              MO|
000113f0  56 20 20 20 20 20 52 35  2c 23 31 20 20 20 20 20  |V     R5,#1     |
00011400  20 20 20 20 20 20 3b 20  42 6f 74 74 6f 6d 20 6f  |      ; Bottom o|
00011410  66 20 76 61 6e 20 3d 20  31 20 70 69 78 65 6c 20  |f van = 1 pixel |
00011420  61 62 6f 76 65 0d 3b 10  46 20 20 20 20 20 20 20  |above.;.F       |
00011430  20 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |         MOV    |
00011440  20 52 35 2c 52 35 2c 41  53 4c 20 52 38 20 20 20  | R5,R5,ASL R8   |
00011450  20 3b 20 73 63 72 65 65  6e 20 62 6f 74 74 6f 6d  | ; screen bottom|
00011460  20 28 73 63 61 6c 65 20  69 74 29 0d 3b 1a 41 20  | (scale it).;.A |
00011470  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
00011480  55 42 53 20 20 20 20 52  33 2c 52 33 2c 23 31 20  |UBS    R3,R3,#1 |
00011490  20 20 20 20 20 20 20 3b  20 57 69 64 74 68 20 6f  |       ; Width o|
000114a0  66 20 73 70 72 69 74 65  20 2d 20 31 0d 3b 24 42  |f sprite - 1.;$B|
000114b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000114c0  42 4d 49 20 20 20 20 20  73 70 72 69 74 65 66 61  |BMI     spritefa|
000114d0  69 6c 75 72 65 20 20 20  3b 20 47 69 76 65 20 75  |ilure   ; Give u|
000114e0  70 20 69 66 20 77 69 64  74 68 20 3d 20 30 0d 3b  |p if width = 0.;|
000114f0  2e 4a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.J              |
00011500  20 20 4d 4f 56 20 20 20  20 20 52 37 2c 52 33 2c  |  MOV     R7,R3,|
00011510  41 53 4c 20 52 37 20 20  20 20 3b 20 74 68 65 6e  |ASL R7    ; then|
00011520  20 73 68 69 66 74 20 69  74 20 62 79 20 74 68 65  | shift it by the|
00011530  20 58 66 61 63 74 6f 72  0d 3b 38 42 20 20 20 20  | Xfactor.;8B    |
00011540  20 20 20 20 20 20 20 20  20 20 20 20 53 55 42 53  |            SUBS|
00011550  20 20 20 20 52 34 2c 52  34 2c 23 31 20 20 20 20  |    R4,R4,#1    |
00011560  20 20 20 20 3b 20 48 65  69 67 68 74 20 6f 66 20  |    ; Height of |
00011570  73 70 72 69 74 65 20 2d  20 31 0d 3b 42 43 20 20  |sprite - 1.;BC  |
00011580  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 4d  |              BM|
00011590  49 20 20 20 20 20 73 70  72 69 74 65 66 61 69 6c  |I     spritefail|
000115a0  75 72 65 20 20 20 3b 20  47 69 76 65 20 75 70 20  |ure   ; Give up |
000115b0  69 66 20 68 65 69 67 68  74 20 3d 20 30 0d 3b 4c  |if height = 0.;L|
000115c0  4a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |J               |
000115d0  20 4d 4f 56 20 20 20 20  20 52 38 2c 52 34 2c 41  | MOV     R8,R4,A|
000115e0  53 4c 20 52 38 20 20 20  20 3b 20 74 68 65 6e 20  |SL R8    ; then |
000115f0  73 68 69 66 74 20 69 74  20 62 79 20 74 68 65 20  |shift it by the |
00011600  59 66 61 63 74 6f 72 0d  3b 56 28 20 20 20 20 20  |Yfactor.;V(     |
00011610  20 20 20 20 20 20 20 20  20 20 20 4c 44 4d 46 44  |           LDMFD|
00011620  20 20 20 52 31 33 21 2c  7b 52 30 2d 52 33 7d 0d  |   R13!,{R0-R3}.|
00011630  3b 60 47 20 20 20 20 20  20 20 20 20 20 20 20 20  |;`G             |
00011640  20 20 20 42 4c 20 20 20  20 20 20 73 61 76 65 75  |   BL      saveu|
00011650  6e 64 65 72 76 61 6e 20  20 20 20 3b 20 49 6e 69  |ndervan    ; Ini|
00011660  74 69 61 6c 20 74 65 6d  70 20 73 70 72 69 74 65  |tial temp sprite|
00011670  20 73 65 74 75 70 0d 3b  6a 28 20 20 20 20 20 20  | setup.;j(      |
00011680  20 20 20 20 20 20 20 20  20 20 42 56 53 20 20 20  |          BVS   |
00011690  20 20 76 61 6e 68 69 74  66 69 6e 69 73 68 0d 3b  |  vanhitfinish.;|
000116a0  74 04 0d 3b 7e 48 3b 20  54 68 65 20 72 65 73 74  |t..;~H; The rest|
000116b0  20 6f 66 20 74 68 69 73  20 72 6f 75 74 69 6e 65  | of this routine|
000116c0  20 64 65 61 6c 73 20 77  69 74 68 20 6d 6f 76 69  | deals with movi|
000116d0  6e 67 20 74 68 65 20 76  61 6e 20 28 73 6d 6f 6f  |ng the van (smoo|
000116e0  74 68 6c 79 20 21 29 20  69 6e 0d 3b 88 46 3b 20  |thly !) in.;.F; |
000116f0  61 20 73 74 72 61 69 67  68 74 20 68 6f 72 69 7a  |a straight horiz|
00011700  6f 6e 74 61 6c 20 6c 69  6e 65 20 62 65 74 77 65  |ontal line betwe|
00011710  65 6e 20 52 31 20 61 6e  64 20 52 32 20 28 73 74  |en R1 and R2 (st|
00011720  65 70 20 52 33 29 2e 20  49 74 20 66 6c 69 70 73  |ep R3). It flips|
00011730  0d 3b 92 39 3b 20 62 65  74 77 65 65 6e 20 33 20  |.;.9; between 3 |
00011740  64 69 66 66 65 72 65 6e  74 20 73 70 72 69 74 65  |different sprite|
00011750  73 20 65 76 65 72 79 20  74 68 69 72 64 20 76 69  |s every third vi|
00011760  64 65 6f 20 73 79 6e 63  2e 0d 3b 9c 04 0d 3b a6  |deo sync..;...;.|
00011770  40 2e 61 6e 69 6d 61 74  69 6f 6e 66 6c 69 70 20  |@.animationflip |
00011780  20 4d 4f 56 20 20 20 20  20 52 31 30 2c 23 33 20  | MOV     R10,#3 |
00011790  20 20 20 20 20 20 20 20  20 3b 20 52 65 73 65 74  |         ; Reset|
000117a0  20 66 6c 69 70 20 63 6f  75 6e 74 65 72 0d 3b b0  | flip counter.;.|
000117b0  3b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |;               |
000117c0  20 53 54 52 42 20 20 20  20 52 39 2c 5b 52 30 2c  | STRB    R9,[R0,|
000117d0  23 36 5d 20 20 20 20 20  20 3b 20 53 65 6c 65 63  |#6]      ; Selec|
000117e0  74 20 73 70 72 69 74 65  0d 3b ba 42 2e 6e 6f 61  |t sprite.;.B.noa|
000117f0  6e 69 6d 66 6c 69 70 20  20 20 20 20 42 4c 20 20  |nimflip     BL  |
00011800  20 20 20 20 76 69 64 65  6f 73 79 6e 63 20 20 20  |    videosync   |
00011810  20 20 20 20 3b 20 53 6d  6f 6f 74 68 20 6f 75 74  |    ; Smooth out|
00011820  20 61 6e 69 6d 61 74 69  6f 6e 0d 3b c4 44 20 20  | animation.;.D  |
00011830  20 20 20 20 20 20 20 20  20 20 20 20 20 20 41 44  |              AD|
00011840  52 20 20 20 20 20 52 34  2c 74 65 6d 70 6f 75 74  |R     R4,tempout|
00011850  73 70 72 69 74 65 3b 20  53 65 6c 65 63 74 20 73  |sprite; Select s|
00011860  61 76 65 64 20 72 65 63  74 61 6e 67 6c 65 0d 3b  |aved rectangle.;|
00011870  ce 3e 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.>              |
00011880  20 20 4d 4f 56 20 20 20  20 20 52 36 2c 23 30 20  |  MOV     R6,#0 |
00011890  20 20 20 20 20 20 20 20  20 20 3b 20 4f 76 65 72  |          ; Over|
000118a0  77 72 69 74 65 20 73 63  72 65 65 6e 0d 3b d8 4a  |write screen.;.J|
000118b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000118c0  42 4c 20 20 20 20 20 20  70 6c 6f 74 73 70 72 69  |BL      plotspri|
000118d0  74 65 20 20 20 20 20 20  3b 20 52 65 73 74 6f 72  |te      ; Restor|
000118e0  65 20 75 6e 64 65 72 6e  65 61 74 68 20 72 65 63  |e underneath rec|
000118f0  74 61 6e 67 6c 65 0d 3b  e2 28 20 20 20 20 20 20  |tangle.;.(      |
00011900  20 20 20 20 20 20 20 20  20 20 42 56 53 20 20 20  |          BVS   |
00011910  20 20 76 61 6e 68 69 74  66 69 6e 69 73 68 0d 3b  |  vanhitfinish.;|
00011920  ec 3d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.=              |
00011930  20 20 41 44 44 20 20 20  20 20 52 31 2c 52 31 2c  |  ADD     R1,R1,|
00011940  52 33 20 20 20 20 20 20  20 20 3b 20 4d 6f 76 65  |R3        ; Move|
00011950  20 76 61 6e 20 78 63 6f  6f 72 64 0d 3b f6 4a 20  | van xcoord.;.J |
00011960  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
00011970  4f 56 53 20 20 20 20 52  33 2c 52 33 20 20 20 20  |OVS    R3,R3    |
00011980  20 20 20 20 20 20 20 3b  20 57 68 69 63 68 20 77  |       ; Which w|
00011990  61 79 20 69 73 20 74 68  65 20 76 61 6e 20 67 6f  |ay is the van go|
000119a0  69 6e 67 20 3f 0d 3c 00  27 20 20 20 20 20 20 20  |ing ?.<.'       |
000119b0  20 20 20 20 20 20 20 20  20 42 50 4c 20 20 20 20  |         BPL    |
000119c0  20 6c 65 66 74 74 6f 72  69 67 68 74 0d 3c 0a 4a  | lefttoright.<.J|
000119d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000119e0  43 4d 50 20 20 20 20 20  52 31 2c 52 32 20 20 20  |CMP     R1,R2   |
000119f0  20 20 20 20 20 20 20 20  3b 20 49 66 20 6c 65 66  |        ; If lef|
00011a00  74 2c 20 74 68 65 6e 20  73 74 6f 70 20 77 68 65  |t, then stop whe|
00011a10  6e 20 6c 65 73 73 0d 3c  14 28 20 20 20 20 20 20  |n less.<.(      |
00011a20  20 20 20 20 20 20 20 20  20 20 42 4c 54 20 20 20  |          BLT   |
00011a30  20 20 76 61 6e 68 69 74  66 69 6e 69 73 68 0d 3c  |  vanhitfinish.<|
00011a40  1e 29 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.)              |
00011a50  20 20 42 20 20 20 20 20  20 20 76 61 6e 73 74 69  |  B       vansti|
00011a60  6c 6c 67 6f 69 6e 67 0d  3c 28 4b 2e 6c 65 66 74  |llgoing.<(K.left|
00011a70  74 6f 72 69 67 68 74 20  20 20 20 43 4d 50 20 20  |toright    CMP  |
00011a80  20 20 20 52 31 2c 52 32  20 20 20 20 20 20 20 20  |   R1,R2        |
00011a90  20 20 20 3b 20 49 66 20  72 69 67 68 74 2c 20 74  |   ; If right, t|
00011aa0  68 65 6e 20 73 74 6f 70  20 77 68 65 6e 20 6d 6f  |hen stop when mo|
00011ab0  72 65 0d 3c 32 28 20 20  20 20 20 20 20 20 20 20  |re.<2(          |
00011ac0  20 20 20 20 20 20 42 47  54 20 20 20 20 20 76 61  |      BGT     va|
00011ad0  6e 68 69 74 66 69 6e 69  73 68 0d 3c 3c 43 2e 76  |nhitfinish.<<C.v|
00011ae0  61 6e 73 74 69 6c 6c 67  6f 69 6e 67 20 20 42 4c  |anstillgoing  BL|
00011af0  20 20 20 20 20 20 73 61  76 65 75 6e 64 65 72 76  |      saveunderv|
00011b00  61 6e 20 20 20 20 3b 20  53 61 76 65 20 75 6e 64  |an    ; Save und|
00011b10  65 72 6e 65 61 74 68 20  61 67 61 69 6e 0d 3c 46  |erneath again.<F|
00011b20  28 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |(               |
00011b30  20 42 56 53 20 20 20 20  20 76 61 6e 68 69 74 66  | BVS     vanhitf|
00011b40  69 6e 69 73 68 0d 3c 50  21 20 20 20 20 20 20 20  |inish.<P!       |
00011b50  20 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |         MOV    |
00011b60  20 52 34 2c 52 30 0d 3c  5a 44 20 20 20 20 20 20  | R4,R0.<ZD      |
00011b70  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
00011b80  20 20 52 36 2c 23 38 20  20 20 20 20 20 20 20 20  |  R6,#8         |
00011b90  20 20 3b 20 4f 76 65 72  77 72 69 74 65 20 62 75  |  ; Overwrite bu|
00011ba0  74 20 75 73 65 20 6d 61  73 6b 0d 3c 64 46 20 20  |t use mask.<dF  |
00011bb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 4c  |              BL|
00011bc0  20 20 20 20 20 20 70 6c  6f 74 73 70 72 69 74 65  |      plotsprite|
00011bd0  20 20 20 20 20 20 3b 20  50 6c 6f 74 20 76 61 6e  |      ; Plot van|
00011be0  20 69 6e 20 6e 65 77 20  70 6f 73 69 74 69 6f 6e  | in new position|
00011bf0  0d 3c 6e 28 20 20 20 20  20 20 20 20 20 20 20 20  |.<n(            |
00011c00  20 20 20 20 42 56 53 20  20 20 20 20 76 61 6e 68  |    BVS     vanh|
00011c10  69 74 66 69 6e 69 73 68  0d 3c 78 26 20 20 20 20  |itfinish.<x&    |
00011c20  20 20 20 20 20 20 20 20  20 20 20 20 53 55 42 53  |            SUBS|
00011c30  20 20 20 20 52 31 30 2c  52 31 30 2c 23 31 0d 3c  |    R10,R10,#1.<|
00011c40  82 44 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.D              |
00011c50  20 20 42 4e 45 20 20 20  20 20 6e 6f 61 6e 69 6d  |  BNE     noanim|
00011c60  66 6c 69 70 20 20 20 20  20 20 3b 20 48 61 76 65  |flip      ; Have|
00011c70  20 33 20 6d 6f 76 65 73  20 67 6f 6e 65 20 62 79  | 3 moves gone by|
00011c80  20 3f 0d 3c 8c 48 20 20  20 20 20 20 20 20 20 20  | ?.<.H          |
00011c90  20 20 20 20 20 20 41 44  44 20 20 20 20 20 52 39  |      ADD     R9|
00011ca0  2c 52 39 2c 23 31 20 20  20 20 20 20 20 20 3b 20  |,R9,#1        ; |
00011cb0  59 65 73 2c 20 73 6f 20  6e 65 78 74 20 73 70 72  |Yes, so next spr|
00011cc0  69 74 65 20 70 6c 65 61  73 65 0d 3c 96 24 20 20  |ite please.<.$  |
00011cd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 43 4d  |              CM|
00011ce0  50 20 20 20 20 20 52 39  2c 23 97 22 34 22 0d 3c  |P     R9,#."4".<|
00011cf0  a0 21 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.!              |
00011d00  20 20 ec 51 20 20 20 52  39 2c 23 97 22 31 22 0d  |  .Q   R9,#."1".|
00011d10  3c aa 29 20 20 20 20 20  20 20 20 20 20 20 20 20  |<.)             |
00011d20  20 20 20 42 20 20 20 20  20 20 20 61 6e 69 6d 61  |   B       anima|
00011d30  74 69 6f 6e 66 6c 69 70  0d 3c b4 28 2e 73 70 72  |tionflip.<.(.spr|
00011d40  69 74 65 66 61 69 6c 75  72 65 20 20 4c 44 4d 46  |itefailure  LDMF|
00011d50  44 20 20 20 52 31 33 21  2c 7b 52 30 2d 52 33 7d  |D   R13!,{R0-R3}|
00011d60  0d 3c be 2c 2e 76 61 6e  68 69 74 66 69 6e 69 73  |.<.,.vanhitfinis|
00011d70  68 20 20 20 4c 44 4d 46  44 20 20 20 52 31 33 21  |h   LDMFD   R13!|
00011d80  2c 7b 52 30 2d 52 31 30  2c 50 43 7d 0d 3c c8 04  |,{R0-R10,PC}.<..|
00011d90  0d 3c d2 11 2e 73 61 76  65 75 6e 64 65 72 76 61  |.<...saveunderva|
00011da0  6e 0d 3c dc 04 0d 3c e6  34 3b 20 4f 6e 20 65 6e  |n.<...<.4; On en|
00011db0  74 72 79 2c 20 20 20 20  20 52 31 20 20 20 20 20  |try,     R1     |
00011dc0  20 3d 20 4c 65 66 74 20  58 20 70 6f 73 69 74 69  | = Left X positi|
00011dd0  6f 6e 20 6f 66 20 76 61  6e 0d 3c f0 36 3b 20 20  |on of van.<.6;  |
00011de0  20 20 20 20 20 20 20 20  20 20 20 20 20 52 35 20  |             R5 |
00011df0  20 20 20 20 20 3d 20 42  6f 74 74 6f 6d 20 59 20  |     = Bottom Y |
00011e00  70 6f 73 69 74 69 6f 6e  20 6f 66 20 76 61 6e 0d  |position of van.|
00011e10  3c fa 46 3b 20 20 20 20  20 20 20 20 20 20 20 20  |<.F;            |
00011e20  20 20 20 52 37 2f 52 38  20 20 20 3d 20 56 61 6e  |   R7/R8   = Van|
00011e30  20 73 70 72 69 74 65 20  77 69 64 74 68 2f 68 65  | sprite width/he|
00011e40  69 67 68 74 20 28 6d 69  6e 75 73 20 6f 6e 65 20  |ight (minus one |
00011e50  75 6e 69 74 29 0d 3d 04  04 0d 3d 0e 2c 20 20 20  |unit).=...=.,   |
00011e60  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 4d  |             STM|
00011e70  46 44 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 37  |FD   R13!,{R0-R7|
00011e80  2c 52 31 34 7d 0d 3d 18  2c 20 20 20 20 20 20 20  |,R14}.=.,       |
00011e90  20 20 20 20 20 20 20 20  20 41 44 52 20 20 20 20  |         ADR    |
00011ea0  20 52 32 2c 74 65 6d 70  6f 75 74 73 70 72 69 74  | R2,tempoutsprit|
00011eb0  65 0d 3d 22 38 20 20 20  20 20 20 20 20 20 20 20  |e.="8           |
00011ec0  20 20 20 20 20 4d 4f 56  20 20 20 20 20 52 33 2c  |     MOV     R3,|
00011ed0  23 30 20 20 20 20 20 20  20 20 20 20 20 3b 20 4e  |#0           ; N|
00011ee0  6f 20 70 61 6c 65 74 74  65 0d 3d 2c 37 20 20 20  |o palette.=,7   |
00011ef0  20 20 20 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |             MOV|
00011f00  20 20 20 20 20 52 34 2c  52 31 20 20 20 20 20 20  |     R4,R1      |
00011f10  20 20 20 20 20 3b 20 4c  65 66 74 20 73 69 64 65  |     ; Left side|
00011f20  0d 3d 36 45 20 20 20 20  20 20 20 20 20 20 20 20  |.=6E            |
00011f30  20 20 20 20 41 44 44 20  20 20 20 20 52 36 2c 52  |    ADD     R6,R|
00011f40  34 2c 52 37 20 20 20 20  20 20 20 20 3b 20 52 69  |4,R7        ; Ri|
00011f50  67 68 74 20 73 69 64 65  20 28 4c 65 66 74 2b 57  |ght side (Left+W|
00011f60  69 64 74 68 29 0d 3d 40  46 20 20 20 20 20 20 20  |idth).=@F       |
00011f70  20 20 20 20 20 20 20 20  20 41 44 44 20 20 20 20  |         ADD    |
00011f80  20 52 37 2c 52 35 2c 52  38 20 20 20 20 20 20 20  | R7,R5,R8       |
00011f90  20 3b 20 54 6f 70 20 73  69 64 65 20 28 42 6f 74  | ; Top side (Bot|
00011fa0  74 6f 6d 2b 48 65 69 67  68 74 29 0d 3d 4a 46 20  |tom+Height).=JF |
00011fb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
00011fc0  4f 56 20 20 20 20 20 52  30 2c 23 31 36 20 20 20  |OV     R0,#16   |
00011fd0  20 20 20 20 20 20 20 3b  20 53 61 76 65 20 72 65  |       ; Save re|
00011fe0  63 74 61 6e 67 6c 65 20  74 6f 20 73 70 72 69 74  |ctangle to sprit|
00011ff0  65 0d 3d 54 33 20 20 20  20 20 20 20 20 20 20 20  |e.=T3           |
00012000  20 20 20 20 20 42 4c 20  20 20 20 20 20 73 70 72  |     BL      spr|
00012010  69 74 65 6f 70 20 20 20  20 20 20 20 20 3b 20 49  |iteop        ; I|
00012020  2d 34 30 35 0d 3d 5e 2b  20 20 20 20 20 20 20 20  |-405.=^+        |
00012030  20 20 20 20 20 20 20 20  4c 44 4d 46 44 20 20 20  |        LDMFD   |
00012040  52 31 33 21 2c 7b 52 30  2d 52 37 2c 50 43 7d 0d  |R13!,{R0-R7,PC}.|
00012050  3d 68 04 0d 3d 72 0f 2e  70 6c 6f 74 73 70 72 69  |=h..=r..plotspri|
00012060  74 65 0d 3d 7c 04 0d 3d  86 29 3b 20 4f 6e 20 65  |te.=|..=.); On e|
00012070  6e 74 72 79 2c 20 20 20  20 20 52 31 20 20 20 20  |ntry,     R1    |
00012080  20 20 3d 20 4c 65 66 74  20 78 63 6f 6f 72 64 0d  |  = Left xcoord.|
00012090  3d 90 34 3b 20 20 20 20  20 20 20 20 20 20 20 20  |=.4;            |
000120a0  20 20 20 52 34 20 20 20  20 20 20 3d 20 50 6f 69  |   R4      = Poi|
000120b0  6e 74 65 72 20 74 6f 20  73 70 72 69 74 65 20 6e  |nter to sprite n|
000120c0  61 6d 65 0d 3d 9a 2b 3b  20 20 20 20 20 20 20 20  |ame.=.+;        |
000120d0  20 20 20 20 20 20 20 52  35 20 20 20 20 20 20 3d  |       R5      =|
000120e0  20 42 6f 74 74 6f 6d 20  79 63 6f 6f 72 64 0d 3d  | Bottom ycoord.=|
000120f0  a4 4e 3b 20 20 20 20 20  20 20 20 20 20 20 20 20  |.N;             |
00012100  20 20 52 36 20 20 20 20  20 20 3d 20 41 63 74 69  |  R6      = Acti|
00012110  6f 6e 20 63 6f 64 65 20  28 30 20 3d 20 6f 76 65  |on code (0 = ove|
00012120  72 77 72 69 74 65 2c 20  38 20 3d 20 64 69 74 74  |rwrite, 8 = ditt|
00012130  6f 20 77 69 74 68 20 6d  61 73 6b 29 0d 3d ae 04  |o with mask).=..|
00012140  0d 3d b8 2f 20 20 20 20  20 20 20 20 20 20 20 20  |.=./            |
00012150  20 20 20 20 53 54 4d 46  44 20 20 20 52 31 33 21  |    STMFD   R13!|
00012160  2c 7b 52 30 2d 52 35 2c  52 39 2c 52 31 34 7d 0d  |,{R0-R5,R9,R14}.|
00012170  3d c2 41 20 20 20 20 20  20 20 20 20 20 20 20 20  |=.A             |
00012180  20 20 20 4d 4f 56 20 20  20 20 20 52 32 2c 52 34  |   MOV     R2,R4|
00012190  20 20 20 3b 20 4c 6f 74  73 20 6f 66 20 72 65 67  |   ; Lots of reg|
000121a0  69 73 74 65 72 20 6a 75  67 67 6c 69 6e 67 20 21  |ister juggling !|
000121b0  0d 3d cc 21 20 20 20 20  20 20 20 20 20 20 20 20  |.=.!            |
000121c0  20 20 20 20 4d 4f 56 20  20 20 20 20 52 33 2c 52  |    MOV     R3,R|
000121d0  31 0d 3d d6 21 20 20 20  20 20 20 20 20 20 20 20  |1.=.!           |
000121e0  20 20 20 20 20 4d 4f 56  20 20 20 20 20 52 34 2c  |     MOV     R4,|
000121f0  52 35 0d 3d e0 21 20 20  20 20 20 20 20 20 20 20  |R5.=.!          |
00012200  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 52 35  |      MOV     R5|
00012210  2c 52 36 0d 3d ea 42 20  20 20 20 20 20 20 20 20  |,R6.=.B         |
00012220  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
00012230  30 2c 23 33 34 20 20 20  20 20 20 20 20 20 20 20  |0,#34           |
00012240  20 3b 20 50 6c 6f 74 20  73 70 72 69 74 65 2e 20  | ; Plot sprite. |
00012250  49 2d 34 31 37 0d 3d f4  21 20 20 20 20 20 20 20  |I-417.=.!       |
00012260  20 20 20 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |         MOV    |
00012270  20 52 39 2c 52 36 0d 3d  fe 29 20 20 20 20 20 20  | R9,R6.=.)      |
00012280  20 20 20 20 20 20 20 20  20 20 42 4c 20 20 20 20  |          BL    |
00012290  20 20 63 68 6f 6f 73 65  73 70 72 63 61 6c 6c 0d  |  choosesprcall.|
000122a0  3e 08 2e 20 20 20 20 20  20 20 20 20 20 20 20 20  |>..             |
000122b0  20 20 20 4c 44 4d 46 44  20 20 20 52 31 33 21 2c  |   LDMFD   R13!,|
000122c0  7b 52 30 2d 52 35 2c 52  39 2c 50 43 7d 0d 3e 12  |{R0-R5,R9,PC}.>.|
000122d0  04 0d 3e 1c 12 2e 63 68  6f 6f 73 65 73 70 72 63  |..>...choosesprc|
000122e0  61 6c 6c 0d 3e 26 04 0d  3e 30 4d 3b 20 4f 6e 20  |all.>&..>0M; On |
000122f0  65 6e 74 72 79 2c 20 20  20 20 20 52 39 20 20 20  |entry,     R9   |
00012300  20 20 20 3d 20 30 20 3d  3e 20 55 73 65 20 4f 53  |   = 0 => Use OS|
00012310  5f 53 70 72 69 74 65 4f  70 2c 20 3c 3e 20 30 20  |_SpriteOp, <> 0 |
00012320  3d 3e 20 55 73 65 20 57  69 6d 70 5f 53 70 72 69  |=> Use Wimp_Spri|
00012330  74 65 4f 70 0d 3e 3a 04  0d 3e 44 26 20 20 20 20  |teOp.>:..>D&    |
00012340  20 20 20 20 20 20 20 20  20 20 20 20 53 54 4d 46  |            STMF|
00012350  44 20 20 20 52 31 33 21  2c 7b 52 31 34 7d 0d 3e  |D   R13!,{R14}.>|
00012360  4e 4d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |NM              |
00012370  20 20 4d 4f 56 53 20 20  20 20 52 39 2c 52 39 20  |  MOVS    R9,R9 |
00012380  20 20 20 20 20 20 20 20  20 20 3b 20 53 65 6c 65  |          ; Sele|
00012390  63 74 20 72 6f 75 74 69  6e 65 20 64 65 70 65 6e  |ct routine depen|
000123a0  64 69 6e 67 20 6f 6e 20  72 65 67 0d 3e 58 29 20  |ding on reg.>X) |
000123b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 42  |               B|
000123c0  45 51 20 20 20 20 20 64  6f 6e 6f 72 6d 73 70 72  |EQ     donormspr|
000123d0  63 61 6c 6c 0d 3e 62 28  20 20 20 20 20 20 20 20  |call.>b(        |
000123e0  20 20 20 20 20 20 20 20  42 4c 20 20 20 20 20 20  |        BL      |
000123f0  77 69 6d 70 73 70 72 69  74 65 6f 70 0d 3e 6c 29  |wimpspriteop.>l)|
00012400  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00012410  42 20 20 20 20 20 20 20  65 6e 64 74 68 65 73 70  |B       endthesp|
00012420  72 63 61 6c 6c 0d 3e 76  24 2e 64 6f 6e 6f 72 6d  |rcall.>v$.donorm|
00012430  73 70 72 63 61 6c 6c 20  20 42 4c 20 20 20 20 20  |sprcall  BL     |
00012440  20 73 70 72 69 74 65 6f  70 0d 3e 80 25 2e 65 6e  | spriteop.>.%.en|
00012450  64 74 68 65 73 70 72 63  61 6c 6c 20 20 4c 44 4d  |dthesprcall  LDM|
00012460  46 44 20 20 20 52 31 33  21 2c 7b 50 43 7d 0d 3e  |FD   R13!,{PC}.>|
00012470  8a 04 0d 3e 94 13 2e 64  6f 76 61 6e 61 6e 69 6d  |...>...dovananim|
00012480  61 74 69 6f 6e 0d 3e 9e  04 0d 3e a8 45 3b 20 4f  |ation.>...>.E; O|
00012490  6e 20 65 6e 74 72 79 2c  20 20 20 20 20 52 36 20  |n entry,     R6 |
000124a0  20 20 20 20 20 3d 20 41  64 64 72 65 73 73 20 6f  |     = Address o|
000124b0  66 20 72 6f 75 74 69 6e  65 20 74 6f 20 63 61 6c  |f routine to cal|
000124c0  6c 20 66 6f 72 20 74 72  61 73 68 69 6e 67 0d 3e  |l for trashing.>|
000124d0  b2 34 3b 20 4f 6e 20 65  78 69 74 2c 20 20 20 20  |.4; On exit,    |
000124e0  20 20 56 20 20 20 20 20  20 20 3d 20 53 65 74 20  |  V       = Set |
000124f0  69 66 20 74 72 61 73 68  69 6e 67 20 66 61 69 6c  |if trashing fail|
00012500  65 64 0d 3e bc 04 0d 3e  c6 2c 20 20 20 20 20 20  |ed.>...>.,      |
00012510  20 20 20 20 20 20 20 20  20 20 53 54 4d 46 44 20  |          STMFD |
00012520  20 20 52 31 33 21 2c 7b  52 30 2d 52 38 2c 52 31  |  R13!,{R0-R8,R1|
00012530  34 7d 0d 3e d0 27 20 20  20 20 20 20 20 20 20 20  |4}.>.'          |
00012540  20 20 20 20 20 20 4c 44  52 42 20 20 20 20 52 30  |      LDRB    R0|
00012550  2c 43 4d 4f 53 62 79 74  65 0d 3e da 41 20 20 20  |,CMOSbyte.>.A   |
00012560  20 20 20 20 20 20 20 20  20 20 20 20 20 54 53 54  |             TST|
00012570  20 20 20 20 20 52 30 2c  23 25 31 30 30 20 20 20  |     R0,#%100   |
00012580  20 20 20 20 20 3b 20 41  6e 69 6d 61 74 69 6f 6e  |     ; Animation|
00012590  20 65 6e 61 62 6c 65 64  20 3f 0d 3e e4 27 20 20  | enabled ?.>.'  |
000125a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 45  |              BE|
000125b0  51 20 20 20 20 20 6e 6f  61 6e 69 6d 74 6f 64 61  |Q     noanimtoda|
000125c0  79 0d 3e ee 29 20 20 20  20 20 20 20 20 20 20 20  |y.>.)           |
000125d0  20 20 20 20 20 41 44 52  20 20 20 20 20 52 30 2c  |     ADR     R0,|
000125e0  69 6e 70 75 74 62 6c 6f  63 6b 0d 3e f8 2a 20 20  |inputblock.>.*  |
000125f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 41 44  |              AD|
00012600  52 20 20 20 20 20 52 31  2c 6f 75 74 70 75 74 62  |R     R1,outputb|
00012610  6c 6f 63 6b 0d 3f 02 4a  20 20 20 20 20 20 20 20  |lock.?.J        |
00012620  20 20 20 20 20 20 20 20  53 57 49 20 20 20 20 20  |        SWI     |
00012630  22 58 4f 53 5f 52 65 61  64 56 64 75 56 61 72 69  |"XOS_ReadVduVari|
00012640  61 62 6c 65 73 22 20 20  3b 20 47 65 74 20 6d 6f  |ables"  ; Get mo|
00012650  64 65 20 69 6e 66 6f 2e  20 49 2d 33 34 35 0d 3f  |de info. I-345.?|
00012660  0c 43 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.C              |
00012670  20 20 4c 44 52 20 20 20  20 20 52 30 2c 5b 52 31  |  LDR     R0,[R1|
00012680  5d 20 20 20 20 20 20 20  20 20 3b 20 49 73 20 69  |]         ; Is i|
00012690  74 20 61 20 31 36 2d 63  6f 6c 6f 75 72 20 eb 20  |t a 16-colour . |
000126a0  3f 0d 3f 16 22 20 20 20  20 20 20 20 20 20 20 20  |?.?."           |
000126b0  20 20 20 20 20 43 4d 50  20 20 20 20 20 52 30 2c  |     CMP     R0,|
000126c0  23 31 35 0d 3f 20 25 20  20 20 20 20 20 20 20 20  |#15.? %         |
000126d0  20 20 20 20 20 20 20 42  45 51 20 20 20 20 20 69  |       BEQ     i|
000126e0  74 73 61 31 36 63 6f 6c  0d 3f 2a 4b 2e 6e 6f 61  |tsa16col.?*K.noa|
000126f0  6e 69 6d 74 6f 64 61 79  20 20 20 20 42 4c 20 20  |nimtoday    BL  |
00012700  20 20 20 20 74 72 61 73  68 74 68 65 73 74 75 66  |    trashthestuf|
00012710  66 20 20 20 3b 20 4e 6f  74 20 72 69 67 68 74 20  |f   ; Not right |
00012720  6d 6f 64 65 2c 20 73 6f  20 64 65 6c 65 74 65 20  |mode, so delete |
00012730  6e 6f 77 0d 3f 34 24 20  20 20 20 20 20 20 20 20  |now.?4$         |
00012740  20 20 20 20 20 20 20 42  20 20 20 20 20 20 20 65  |       B       e|
00012750  6e 64 6f 66 73 65 71 0d  3f 3e 48 2e 69 74 73 61  |ndofseq.?>H.itsa|
00012760  31 36 63 6f 6c 20 20 20  20 20 20 42 4c 20 20 20  |16col      BL   |
00012770  20 20 20 67 65 74 63 61  6e 69 63 6f 6e 69 6e 66  |   getcaniconinf|
00012780  6f 20 20 3b 20 52 32 20  3d 20 52 69 67 68 74 20  |o  ; R2 = Right |
00012790  58 20 63 6f 6f 72 64 20  6f 66 20 69 63 6f 6e 0d  |X coord of icon.|
000127a0  3f 48 48 20 20 20 20 20  20 20 20 20 20 20 20 20  |?HH             |
000127b0  20 20 20 42 4c 20 20 20  20 20 20 69 6e 69 74 75  |   BL      initu|
000127c0  73 65 72 61 72 65 61 20  20 20 20 3b 20 2a 53 4e  |serarea    ; *SN|
000127d0  65 77 20 74 68 65 20 75  73 65 72 20 73 70 72 69  |ew the user spri|
000127e0  74 65 20 61 72 65 61 0d  3f 52 3c 20 20 20 20 20  |te area.?R<     |
000127f0  20 20 20 20 20 20 20 20  20 20 20 4c 44 52 20 20  |           LDR  |
00012800  20 20 20 52 37 2c 5b 52  31 2c 23 34 5d 20 20 20  |   R7,[R1,#4]   |
00012810  20 20 20 3b 20 58 20 73  68 69 66 74 20 6e 65 65  |   ; X shift nee|
00012820  64 65 64 0d 3f 5c 3c 20  20 20 20 20 20 20 20 20  |ded.?\<         |
00012830  20 20 20 20 20 20 20 4c  44 52 20 20 20 20 20 52  |       LDR     R|
00012840  38 2c 5b 52 31 2c 23 38  5d 20 20 20 20 20 20 3b  |8,[R1,#8]      ;|
00012850  20 59 20 73 68 69 66 74  20 6e 65 65 64 65 64 0d  | Y shift needed.|
00012860  3f 66 44 20 20 20 20 20  20 20 20 20 20 20 20 20  |?fD             |
00012870  20 20 20 4c 44 52 20 20  20 20 20 52 31 2c 5b 52  |   LDR     R1,[R|
00012880  31 2c 23 31 32 5d 20 20  20 20 20 3b 20 4e 75 6d  |1,#12]     ; Num|
00012890  62 65 72 20 6f 66 20 58  20 70 69 78 65 6c 73 20  |ber of X pixels |
000128a0  2d 20 31 0d 3f 70 3f 20  20 20 20 20 20 20 20 20  |- 1.?p?         |
000128b0  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
000128c0  31 2c 52 31 2c 41 53 4c  20 52 37 20 20 20 20 3b  |1,R1,ASL R7    ;|
000128d0  20 53 74 61 72 74 20 3d  20 66 61 72 20 72 69 67  | Start = far rig|
000128e0  68 74 0d 3f 7a 48 20 20  20 20 20 20 20 20 20 20  |ht.?zH          |
000128f0  20 20 20 20 20 20 42 49  43 20 20 20 20 20 52 31  |      BIC     R1|
00012900  2c 52 31 2c 23 25 31 31  31 31 20 20 20 20 3b 20  |,R1,#%1111    ; |
00012910  4d 61 6b 65 20 73 75 72  65 20 61 20 6d 75 6c 74  |Make sure a mult|
00012920  69 70 6c 65 20 6f 66 20  31 36 0d 3f 84 21 20 20  |iple of 16.?.!  |
00012930  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4d 4f  |              MO|
00012940  56 20 20 20 20 20 52 30  2c 23 34 0d 3f 8e 4c 20  |V     R0,#4.?.L |
00012950  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 41  |               A|
00012960  44 44 20 20 20 20 20 52  32 2c 52 32 2c 52 30 2c  |DD     R2,R2,R0,|
00012970  41 53 4c 20 52 37 20 3b  20 46 69 6e 69 73 68 20  |ASL R7 ; Finish |
00012980  3d 20 34 20 70 69 78 65  6c 73 20 74 6f 20 63 61  |= 4 pixels to ca|
00012990  6e 20 72 69 67 68 74 0d  3f 98 43 20 20 20 20 20  |n right.?.C     |
000129a0  20 20 20 20 20 20 20 20  20 20 20 42 49 43 20 20  |           BIC  |
000129b0  20 20 20 52 32 2c 52 32  2c 23 25 31 31 31 31 20  |   R2,R2,#%1111 |
000129c0  20 20 20 3b 20 41 6c 73  6f 20 61 20 6d 75 6c 74  |   ; Also a mult|
000129d0  69 70 6c 65 20 6f 66 20  31 36 0d 3f a2 45 20 20  |iple of 16.?.E  |
000129e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 41 44  |              AD|
000129f0  52 20 20 20 20 20 52 30  2c 76 61 6e 6c 65 66 74  |R     R0,vanleft|
00012a00  6e 61 6d 65 20 20 3b 20  56 61 6e 20 69 73 20 70  |name  ; Van is p|
00012a10  6f 69 6e 74 69 6e 67 20  74 6f 20 6c 65 66 74 0d  |ointing to left.|
00012a20  3f ac 49 20 20 20 20 20  20 20 20 20 20 20 20 20  |?.I             |
00012a30  20 20 20 4d 56 4e 20 20  20 20 20 52 33 2c 23 31  |   MVN     R3,#1|
00012a40  35 20 20 20 20 20 20 20  20 20 20 3b 20 47 6f 20  |5          ; Go |
00012a50  6c 65 66 74 20 31 36 20  4f 53 20 75 6e 69 74 73  |left 16 OS units|
00012a60  20 61 74 20 74 69 6d 65  0d 3f b6 26 20 20 20 20  | at time.?.&    |
00012a70  20 20 20 20 20 20 20 20  20 20 20 20 42 4c 20 20  |            BL  |
00012a80  20 20 20 20 74 72 75 6e  64 6c 65 76 61 6e 0d 3f  |    trundlevan.?|
00012a90  c0 47 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.G              |
00012aa0  20 20 42 4c 20 20 20 20  20 20 74 72 61 73 68 74  |  BL      trasht|
00012ab0  68 65 73 74 75 66 66 20  20 20 3b 20 44 65 6c 65  |hestuff   ; Dele|
00012ac0  74 65 20 28 72 65 6e 61  6d 65 29 20 74 68 65 20  |te (rename) the |
00012ad0  73 74 75 66 66 0d 3f ca  24 20 20 20 20 20 20 20  |stuff.?.$       |
00012ae0  20 20 20 20 20 20 20 20  20 42 56 53 20 20 20 20  |         BVS    |
00012af0  20 65 6e 64 6f 66 73 65  71 0d 3f d4 44 20 20 20  | endofseq.?.D   |
00012b00  20 20 20 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |             MOV|
00012b10  20 20 20 20 20 52 30 2c  52 31 20 20 20 20 20 20  |     R0,R1      |
00012b20  20 20 20 20 20 3b 20 4e  65 77 20 53 74 61 72 74  |     ; New Start|
00012b30  20 3d 20 4f 6c 64 20 46  69 6e 69 73 68 0d 3f de  | = Old Finish.?.|
00012b40  3c 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |<               |
00012b50  20 4d 4f 56 20 20 20 20  20 52 31 2c 52 32 20 20  | MOV     R1,R2  |
00012b60  20 20 20 20 20 20 20 20  20 3b 20 61 6e 64 20 76  |         ; and v|
00012b70  69 63 65 20 76 65 72 73  61 0d 3f e8 21 20 20 20  |ice versa.?.!   |
00012b80  20 20 20 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |             MOV|
00012b90  20 20 20 20 20 52 32 2c  52 30 0d 3f f2 46 20 20  |     R2,R0.?.F  |
00012ba0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 41 44  |              AD|
00012bb0  52 20 20 20 20 20 52 30  2c 76 61 6e 72 69 67 68  |R     R0,vanrigh|
00012bc0  74 6e 61 6d 65 20 3b 20  56 61 6e 20 69 73 20 70  |tname ; Van is p|
00012bd0  6f 69 6e 74 69 6e 67 20  74 6f 20 72 69 67 68 74  |ointing to right|
00012be0  0d 3f fc 43 20 20 20 20  20 20 20 20 20 20 20 20  |.?.C            |
00012bf0  20 20 20 20 52 53 42 20  20 20 20 20 52 33 2c 52  |    RSB     R3,R|
00012c00  33 2c 23 30 20 20 20 20  20 20 20 20 3b 20 46 6c  |3,#0        ; Fl|
00012c10  69 70 20 74 72 61 76 65  6c 20 64 69 72 65 63 74  |ip travel direct|
00012c20  69 6f 6e 0d 40 06 26 20  20 20 20 20 20 20 20 20  |ion.@.&         |
00012c30  20 20 20 20 20 20 20 42  4c 20 20 20 20 20 20 74  |       BL      t|
00012c40  72 75 6e 64 6c 65 76 61  6e 0d 40 10 2b 2e 65 6e  |rundlevan.@.+.en|
00012c50  64 6f 66 73 65 71 20 20  20 20 20 20 20 4c 44 4d  |dofseq       LDM|
00012c60  46 44 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 38  |FD   R13!,{R0-R8|
00012c70  2c 50 43 7d 0d 40 1a 35  2e 69 6e 70 75 74 62 6c  |,PC}.@.5.inputbl|
00012c80  6f 63 6b 20 20 20 20 20  45 51 55 44 20 20 20 20  |ock     EQUD    |
00012c90  33 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |3               |
00012ca0  3b 20 4e 43 6f 6c 6f 75  72 0d 40 24 38 20 20 20  |; NColour.@$8   |
00012cb0  20 20 20 20 20 20 20 20  20 20 20 20 20 45 51 55  |             EQU|
00012cc0  44 20 20 20 20 34 20 20  20 20 20 20 20 20 20 20  |D    4          |
00012cd0  20 20 20 20 20 3b 20 58  45 69 67 46 61 63 74 6f  |     ; XEigFacto|
00012ce0  72 0d 40 2e 38 20 20 20  20 20 20 20 20 20 20 20  |r.@.8           |
00012cf0  20 20 20 20 20 45 51 55  44 20 20 20 20 35 20 20  |     EQUD    5  |
00012d00  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 59  |             ; Y|
00012d10  45 69 67 46 61 63 74 6f  72 0d 40 38 38 20 20 20  |EigFactor.@88   |
00012d20  20 20 20 20 20 20 20 20  20 20 20 20 20 45 51 55  |             EQU|
00012d30  44 20 20 20 20 31 31 20  20 20 20 20 20 20 20 20  |D    11         |
00012d40  20 20 20 20 20 3b 20 58  57 69 6e 64 4c 69 6d 69  |     ; XWindLimi|
00012d50  74 0d 40 42 1e 20 20 20  20 20 20 20 20 20 20 20  |t.@B.           |
00012d60  20 20 20 20 20 45 51 55  44 20 20 20 20 2d 31 0d  |     EQUD    -1.|
00012d70  40 4c 24 2e 6f 75 74 70  75 74 62 6c 6f 63 6b 20  |@L$.outputblock |
00012d80  20 20 20 45 51 55 53 20  20 20 20 c4 31 36 2c 62  |   EQUS    .16,b|
00012d90  6c 24 29 0d 40 56 29 2e  74 65 6d 70 6f 75 74 73  |l$).@V).tempouts|
00012da0  70 72 69 74 65 20 20 45  51 55 53 20 20 20 20 22  |prite  EQUS    "|
00012db0  74 65 6d 70 76 61 6e 22  2b 62 6c 24 0d 40 60 04  |tempvan"+bl$.@`.|
00012dc0  0d 40 6a 2c 2e 73 63 61  6e 74 72 61 73 68 73 70  |.@j,.scantrashsp|
00012dd0  72 20 20 20 53 54 4d 46  44 20 20 20 52 31 33 21  |r   STMFD   R13!|
00012de0  2c 7b 52 31 2c 52 32 2c  52 31 34 7d 0d 40 74 2d  |,{R1,R2,R14}.@t-|
00012df0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00012e00  41 44 52 20 20 20 20 20  52 31 2c 69 63 6f 6e 73  |ADR     R1,icons|
00012e10  70 72 69 74 65 6e 61 6d  65 0d 40 7e 2c 20 20 20  |pritename.@~,   |
00012e20  20 20 20 20 20 20 20 20  20 20 20 20 20 41 44 52  |             ADR|
00012e30  20 20 20 20 20 52 32 2c  74 72 61 73 68 69 63 6f  |     R2,trashico|
00012e40  6e 6e 61 6d 65 0d 40 88  47 20 20 20 20 20 20 20  |nname.@.G       |
00012e50  20 20 20 20 20 20 20 20  20 42 4c 20 20 20 20 20  |         BL     |
00012e60  20 69 63 6f 6e 73 70 72  69 74 65 73 20 20 20 20  | iconsprites    |
00012e70  20 3b 20 4c 6f 61 64 20  69 6e 20 74 72 61 73 68  | ; Load in trash|
00012e80  20 63 61 6e 20 73 70 72  69 74 65 73 0d 40 92 2b  | can sprites.@.+|
00012e90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00012ea0  4c 44 4d 46 44 20 20 20  52 31 33 21 2c 7b 52 31  |LDMFD   R13!,{R1|
00012eb0  2c 52 32 2c 50 43 7d 0d  40 9c 04 0d 40 a6 10 2e  |,R2,PC}.@...@...|
00012ec0  69 63 6f 6e 73 70 72 69  74 65 73 0d 40 b0 04 0d  |iconsprites.@...|
00012ed0  40 ba 47 3b 20 4f 6e 20  65 6e 74 72 79 2c 20 20  |@.G; On entry,  |
00012ee0  20 20 20 52 31 20 20 20  20 20 20 3d 20 46 69 6c  |   R1      = Fil|
00012ef0  65 6e 61 6d 65 20 74 6f  20 6c 6f 61 64 20 69 66  |ename to load if|
00012f00  20 52 32 20 73 70 72 69  74 65 20 6e 6f 74 20 70  | R2 sprite not p|
00012f10  72 65 73 65 6e 74 0d 40  c4 40 3b 20 20 20 20 20  |resent.@.@;     |
00012f20  20 20 20 20 20 20 20 20  20 20 52 32 20 20 20 20  |          R2    |
00012f30  20 20 3d 20 53 70 72 69  74 65 20 6e 61 6d 65 20  |  = Sprite name |
00012f40  74 6f 20 63 68 65 63 6b  20 66 6f 72 20 65 78 69  |to check for exi|
00012f50  73 74 65 6e 63 65 0d 40  ce 04 0d 40 d8 2c 20 20  |stence.@...@.,  |
00012f60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 53 54  |              ST|
00012f70  4d 46 44 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |MFD   R13!,{R0-R|
00012f80  36 2c 52 31 34 7d 0d 40  e2 4a 20 20 20 20 20 20  |6,R14}.@.J      |
00012f90  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
00012fa0  20 20 52 30 2c 23 34 30  20 20 20 20 20 20 20 20  |  R0,#40        |
00012fb0  20 20 3b 20 52 65 61 64  20 73 70 72 69 74 65 20  |  ; Read sprite |
00012fc0  69 6e 66 6f 20 72 65 61  73 6f 6e 20 63 6f 64 65  |info reason code|
00012fd0  0d 40 ec 47 20 20 20 20  20 20 20 20 20 20 20 20  |.@.G            |
00012fe0  20 20 20 20 42 4c 20 20  20 20 20 20 77 69 6d 70  |    BL      wimp|
00012ff0  73 70 72 69 74 65 6f 70  20 20 20 20 3b 20 44 6f  |spriteop    ; Do|
00013000  65 73 20 73 70 72 69 74  65 20 65 78 69 73 74 20  |es sprite exist |
00013010  3f 20 49 2d 34 32 33 0d  40 f6 4b 20 20 20 20 20  |? I-423.@.K     |
00013020  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 56 53  |           MOVVS|
00013030  20 20 20 52 30 2c 23 31  31 20 20 20 20 20 20 20  |   R0,#11       |
00013040  20 20 20 3b 20 4d 65 72  67 65 20 73 70 72 69 74  |   ; Merge sprit|
00013050  65 20 66 69 6c 65 20 72  65 61 73 6f 6e 20 63 6f  |e file reason co|
00013060  64 65 0d 41 00 21 20 20  20 20 20 20 20 20 20 20  |de.A.!          |
00013070  20 20 20 20 20 20 4d 4f  56 56 53 20 20 20 52 32  |      MOVVS   R2|
00013080  2c 52 31 0d 41 0a 33 20  20 20 20 20 20 20 20 20  |,R1.A.3         |
00013090  20 20 20 20 20 20 20 42  4c 56 53 20 20 20 20 77  |       BLVS    w|
000130a0  69 6d 70 73 70 72 69 74  65 6f 70 20 20 20 20 3b  |impspriteop    ;|
000130b0  20 49 2d 34 30 30 0d 41  14 29 20 20 20 20 20 20  | I-400.A.)      |
000130c0  20 20 20 20 20 20 20 20  20 20 41 44 52 56 53 20  |          ADRVS |
000130d0  20 20 52 30 2c 77 6f 74  6e 6f 69 63 6f 6e 73 0d  |  R0,wotnoicons.|
000130e0  41 1e 2e 20 20 20 20 20  20 20 20 20 20 20 20 20  |A..             |
000130f0  20 20 20 53 57 49 56 53  20 20 20 22 4f 53 5f 47  |   SWIVS   "OS_G|
00013100  65 6e 65 72 61 74 65 45  72 72 6f 72 22 0d 41 28  |enerateError".A(|
00013110  2b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |+               |
00013120  20 4c 44 4d 46 44 20 20  20 52 31 33 21 2c 7b 52  | LDMFD   R13!,{R|
00013130  30 2d 52 36 2c 50 43 7d  0d 41 32 1d 2e 77 6f 74  |0-R6,PC}.A2..wot|
00013140  6e 6f 69 63 6f 6e 73 20  20 20 20 20 45 51 55 44  |noicons     EQUD|
00013150  20 20 20 20 30 0d 41 3c  44 20 20 20 20 20 20 20  |    0.A<D       |
00013160  20 20 20 20 20 20 20 20  20 45 51 55 53 20 20 20  |         EQUS   |
00013170  20 70 72 6f 67 24 2b 22  20 73 70 72 69 74 65 73  | prog$+" sprites|
00013180  20 63 6f 75 6c 64 20 6e  6f 74 20 62 65 20 6c 6f  | could not be lo|
00013190  61 64 65 64 22 2b 62 6c  24 0d 41 46 19 20 20 20  |aded"+bl$.AF.   |
000131a0  20 20 20 20 20 20 20 20  20 20 20 20 20 41 4c 49  |             ALI|
000131b0  47 4e 0d 41 50 04 0d 41  5a 2c 2e 73 63 61 6e 76  |GN.AP..AZ,.scanv|
000131c0  61 6e 73 70 72 20 20 20  20 20 53 54 4d 46 44 20  |anspr     STMFD |
000131d0  20 20 52 31 33 21 2c 7b  52 31 2c 52 32 2c 52 31  |  R13!,{R1,R2,R1|
000131e0  34 7d 0d 41 64 2a 20 20  20 20 20 20 20 20 20 20  |4}.Ad*          |
000131f0  20 20 20 20 20 20 41 44  52 20 20 20 20 20 52 32  |      ADR     R2|
00013200  2c 76 61 6e 6c 65 66 74  6e 61 6d 65 0d 41 6e 24  |,vanleftname.An$|
00013210  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00013220  4d 4f 56 20 20 20 20 20  52 31 2c 23 97 22 33 22  |MOV     R1,#."3"|
00013230  0d 41 78 26 20 20 20 20  20 20 20 20 20 20 20 20  |.Ax&            |
00013240  20 20 20 20 53 54 52 42  20 20 20 20 52 31 2c 5b  |    STRB    R1,[|
00013250  52 32 2c 23 36 5d 0d 41  82 29 20 20 20 20 20 20  |R2,#6].A.)      |
00013260  20 20 20 20 20 20 20 20  20 20 41 44 52 20 20 20  |          ADR   |
00013270  20 20 52 31 2c 6c 6f 61  64 74 68 65 76 61 6e 0d  |  R1,loadthevan.|
00013280  41 8c 47 20 20 20 20 20  20 20 20 20 20 20 20 20  |A.G             |
00013290  20 20 20 42 4c 20 20 20  20 20 20 69 63 6f 6e 73  |   BL      icons|
000132a0  70 72 69 74 65 73 20 20  20 20 20 3b 20 4c 6f 61  |prites     ; Loa|
000132b0  64 20 69 6e 20 74 72 61  73 68 20 76 61 6e 20 73  |d in trash van s|
000132c0  70 72 69 74 65 73 0d 41  96 2b 20 20 20 20 20 20  |prites.A.+      |
000132d0  20 20 20 20 20 20 20 20  20 20 4c 44 4d 46 44 20  |          LDMFD |
000132e0  20 20 52 31 33 21 2c 7b  52 31 2c 52 32 2c 50 43  |  R13!,{R1,R2,PC|
000132f0  7d 0d 41 a0 29 2e 74 72  61 73 68 69 63 6f 6e 6e  |}.A.).trashiconn|
00013300  61 6d 65 20 20 45 51 55  53 20 20 20 20 22 21 74  |ame  EQUS    "!t|
00013310  72 61 73 68 32 22 2b 62  6c 24 0d 41 aa 3a 2e 69  |rash2"+bl$.A.:.i|
00013320  63 6f 6e 73 70 72 69 74  65 6e 61 6d 65 20 45 51  |conspritename EQ|
00013330  55 53 20 20 20 20 22 3c  54 72 61 73 68 57 6f 72  |US    "<TrashWor|
00013340  6b 24 44 69 72 3e 2e 21  53 70 72 69 74 65 73 22  |k$Dir>.!Sprites"|
00013350  2b 62 6c 24 0d 41 b4 19  20 20 20 20 20 20 20 20  |+bl$.A..        |
00013360  20 20 20 20 20 20 20 20  41 4c 49 47 4e 0d 41 be  |        ALIGN.A.|
00013370  29 2e 76 61 6e 6c 65 66  74 6e 61 6d 65 20 20 20  |).vanleftname   |
00013380  20 45 51 55 53 20 20 20  20 22 76 61 6e 6c 66 74  | EQUS    "vanlft|
00013390  31 22 2b 62 6c 24 0d 41  c8 29 2e 76 61 6e 72 69  |1"+bl$.A.).vanri|
000133a0  67 68 74 6e 61 6d 65 20  20 20 45 51 55 53 20 20  |ghtname   EQUS  |
000133b0  20 20 22 76 61 6e 72 67  74 31 22 2b 62 6c 24 0d  |  "vanrgt1"+bl$.|
000133c0  41 d2 3c 2e 6c 6f 61 64  74 68 65 76 61 6e 20 20  |A.<.loadthevan  |
000133d0  20 20 20 45 51 55 53 20  20 20 20 22 3c 54 72 61  |   EQUS    "<Tra|
000133e0  73 68 57 6f 72 6b 24 44  69 72 3e 2e 56 61 6e 53  |shWork$Dir>.VanS|
000133f0  70 72 69 74 65 73 22 2b  62 6c 24 0d 41 dc 19 20  |prites"+bl$.A.. |
00013400  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 41  |               A|
00013410  4c 49 47 4e 0d 41 e6 04  0d 41 f0 11 2e 6c 6f 61  |LIGN.A...A...loa|
00013420  64 74 65 6d 70 6c 61 74  65 0d 41 fa 04 0d 42 04  |dtemplate.A...B.|
00013430  4c 3b 20 4c 6f 61 64 20  69 6e 20 49 6e 66 6f 20  |L; Load in Info |
00013440  77 69 6e 64 6f 77 20 74  65 6d 70 6c 61 74 65 2e  |window template.|
00013450  20 49 27 6d 20 6e 6f 74  20 68 61 70 70 79 20 74  | I'm not happy t|
00013460  68 61 74 20 74 68 65 20  4c 6f 61 64 54 65 6d 70  |hat the LoadTemp|
00013470  6c 61 74 65 20 64 6f 63  73 0d 42 0e 4d 3b 20 69  |late docs.B.M; i|
00013480  6e 20 74 68 65 20 6e 65  77 20 50 52 4d 73 20 66  |n the new PRMs f|
00013490  61 69 6c 20 74 6f 20 72  65 66 65 72 20 79 6f 75  |ail to refer you|
000134a0  20 74 6f 20 4f 70 65 6e  54 65 6d 70 6c 61 74 65  | to OpenTemplate|
000134b0  20 28 77 68 69 63 68 20  4d 55 53 54 20 62 65 20  | (which MUST be |
000134c0  63 61 6c 6c 65 64 0d 42  18 4b 3b 20 66 69 72 73  |called.B.K; firs|
000134d0  74 20 74 6f 20 74 65 6c  6c 20 74 68 65 20 57 49  |t to tell the WI|
000134e0  4d 50 20 77 68 69 63 68  20 74 65 6d 70 6c 61 74  |MP which templat|
000134f0  65 20 66 69 6c 65 20 79  6f 75 27 72 65 20 64 65  |e file you're de|
00013500  61 6c 69 6e 67 20 77 69  74 68 29 2e 20 59 65 73  |aling with). Yes|
00013510  2c 0d 42 22 49 3b 20 79  6f 75 20 63 61 6e 20 66  |,.B"I; you can f|
00013520  69 6e 64 20 74 68 65 20  62 6c 75 72 62 20 6f 6e  |ind the blurb on|
00013530  20 49 49 49 2d 31 31 35  33 2c 20 62 75 74 20 49  | III-1153, but I|
00013540  20 77 6f 75 6c 64 27 76  65 20 6c 69 6b 65 64 20  | would've liked |
00013550  61 20 63 6c 75 65 20 2d  20 49 0d 42 2c 48 3b 20  |a clue - I.B,H; |
00013560  6b 65 70 74 20 67 65 74  74 69 6e 67 20 27 43 68  |kept getting 'Ch|
00013570  61 6e 6e 65 6c 27 20 65  72 72 6f 72 73 20 75 6e  |annel' errors un|
00013580  74 69 6c 20 49 20 72 65  61 6c 69 73 65 64 20 77  |til I realised w|
00013590  68 61 74 20 77 61 73 20  67 6f 69 6e 67 20 6f 6e  |hat was going on|
000135a0  20 21 0d 42 36 04 0d 42  40 2c 20 20 20 20 20 20  | !.B6..B@,      |
000135b0  20 20 20 20 20 20 20 20  20 20 53 54 4d 46 44 20  |          STMFD |
000135c0  20 20 52 31 33 21 2c 7b  52 30 2d 52 36 2c 52 31  |  R13!,{R0-R6,R1|
000135d0  34 7d 0d 42 4a 4c 20 20  20 20 20 20 20 20 20 20  |4}.BJL          |
000135e0  20 20 20 20 20 20 4c 44  52 20 20 20 20 20 52 31  |      LDR     R1|
000135f0  2c 74 65 6d 70 6c 61 74  65 68 61 6e 64 6c 65 20  |,templatehandle |
00013600  20 20 20 20 20 20 3b 20  41 6c 72 65 61 64 79 20  |      ; Already |
00013610  67 6f 74 20 74 65 6d 70  6c 61 74 65 20 3f 0d 42  |got template ?.B|
00013620  54 21 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |T!              |
00013630  20 20 4d 4f 56 53 20 20  20 20 52 31 2c 52 31 0d  |  MOVS    R1,R1.|
00013640  42 5e 28 20 20 20 20 20  20 20 20 20 20 20 20 20  |B^(             |
00013650  20 20 20 42 4e 45 20 20  20 20 20 68 61 76 65 74  |   BNE     havet|
00013660  65 6d 70 6c 61 74 65 0d  42 68 47 20 20 20 20 20  |emplate.BhG     |
00013670  20 20 20 20 20 20 20 20  20 20 20 41 44 52 20 20  |           ADR  |
00013680  20 20 20 52 31 2c 74 65  6d 70 66 69 6c 65 6e 61  |   R1,tempfilena|
00013690  6d 65 20 20 20 20 20 20  20 20 20 3b 20 4e 65 77  |me         ; New|
000136a0  20 74 65 6d 70 6c 61 74  65 20 66 69 6c 65 0d 42  | template file.B|
000136b0  72 3e 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |r>              |
000136c0  20 20 53 57 49 20 20 20  20 20 22 58 57 69 6d 70  |  SWI     "XWimp|
000136d0  5f 4f 70 65 6e 54 65 6d  70 6c 61 74 65 22 20 20  |_OpenTemplate"  |
000136e0  20 20 3b 20 49 49 49 2d  31 32 33 36 0d 42 7c 4b  |  ; III-1236.B|K|
000136f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00013700  41 44 52 56 53 20 20 20  52 30 2c 77 6f 74 6e 6f  |ADRVS   R0,wotno|
00013710  74 65 6d 70 66 69 6c 65  20 20 20 20 20 20 20 20  |tempfile        |
00013720  3b 20 43 65 72 74 61 69  6e 6c 79 20 63 61 6e 27  |; Certainly can'|
00013730  74 20 67 6f 20 6f 6e 0d  42 86 49 20 20 20 20 20  |t go on.B.I     |
00013740  20 20 20 20 20 20 20 20  20 20 20 53 57 49 56 53  |           SWIVS|
00013750  20 20 20 22 4f 53 5f 47  65 6e 65 72 61 74 65 45  |   "OS_GenerateE|
00013760  72 72 6f 72 22 20 20 20  20 20 20 3b 20 69 66 20  |rror"      ; if |
00013770  6e 6f 20 74 65 6d 70 6c  61 74 65 20 66 69 6c 65  |no template file|
00013780  0d 42 90 28 20 20 20 20  20 20 20 20 20 20 20 20  |.B.(            |
00013790  20 20 20 20 4c 44 52 20  20 20 20 20 52 31 2c 77  |    LDR     R1,w|
000137a0  6f 72 6b 73 70 61 63 65  0d 42 9a 4c 20 20 20 20  |orkspace.B.L    |
000137b0  20 20 20 20 20 20 20 20  20 20 20 20 53 55 42 20  |            SUB |
000137c0  20 20 20 20 52 31 2c 52  31 2c 23 73 74 61 63 6b  |    R1,R1,#stack|
000137d0  73 70 61 63 65 25 20 20  20 20 20 20 20 3b 20 50  |space%       ; P|
000137e0  6f 69 6e 74 20 74 6f 20  73 74 61 72 74 20 6f 66  |oint to start of|
000137f0  20 52 4d 41 0d 42 a4 47  20 20 20 20 20 20 20 20  | RMA.B.G        |
00013800  20 20 20 20 20 20 20 20  41 44 44 20 20 20 20 20  |        ADD     |
00013810  52 32 2c 52 31 2c 23 26  33 30 30 20 20 20 20 20  |R2,R1,#&300     |
00013820  3b 20 49 6e 64 69 72 65  63 74 65 64 20 64 61 74  |; Indirected dat|
00013830  61 20 67 6f 65 73 20 68  65 72 65 0d 42 ae 44 20  |a goes here.B.D |
00013840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 41  |               A|
00013850  44 44 20 20 20 20 20 52  33 2c 52 32 2c 23 26 31  |DD     R3,R2,#&1|
00013860  30 30 20 20 20 20 20 3b  20 45 6e 64 20 6f 66 20  |00     ; End of |
00013870  69 6e 64 69 72 65 63 74  65 64 20 64 61 74 61 0d  |indirected data.|
00013880  42 b8 3d 20 20 20 20 20  20 20 20 20 20 20 20 20  |B.=             |
00013890  20 20 20 4d 56 4e 20 20  20 20 20 52 34 2c 23 30  |   MVN     R4,#0|
000138a0  20 20 20 3b 20 2d 31 20  3d 3e 20 6e 6f 20 66 6f  |   ; -1 => no fo|
000138b0  6e 74 73 20 69 6e 76 6f  6c 76 65 64 0d 42 c2 44  |nts involved.B.D|
000138c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000138d0  41 44 52 20 20 20 20 20  52 35 2c 74 65 6d 70 6c  |ADR     R5,templ|
000138e0  61 74 65 6e 61 6d 65 20  3b 20 50 6f 69 6e 74 20  |atename ; Point |
000138f0  74 6f 20 74 65 6d 70 6c  61 74 65 20 6e 61 6d 65  |to template name|
00013900  0d 42 cc 4c 20 20 20 20  20 20 20 20 20 20 20 20  |.B.L            |
00013910  20 20 20 20 4d 4f 56 20  20 20 20 20 52 36 2c 23  |    MOV     R6,#|
00013920  30 20 20 20 3b 20 46 69  72 73 74 20 63 61 6c 6c  |0   ; First call|
00013930  20 28 61 63 74 75 61 6c  6c 79 20 77 61 6e 74 20  | (actually want |
00013940  49 6e 66 6f 20 77 69 6e  64 6f 77 29 0d 42 d6 3e  |Info window).B.>|
00013950  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00013960  53 57 49 20 20 20 20 20  22 58 57 69 6d 70 5f 4c  |SWI     "XWimp_L|
00013970  6f 61 64 54 65 6d 70 6c  61 74 65 22 20 20 20 20  |oadTemplate"    |
00013980  3b 20 49 49 49 2d 31 32  33 38 0d 42 e0 4d 20 20  |; III-1238.B.M  |
00013990  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4d 4f  |              MO|
000139a0  56 53 20 20 20 20 52 36  2c 52 36 20 20 20 20 20  |VS    R6,R6     |
000139b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
000139c0  49 20 77 61 6e 74 20 6d  79 20 49 6e 66 6f 20 77  |I want my Info w|
000139d0  69 6e 64 6f 77 20 21 0d  42 ea 49 20 20 20 20 20  |indow !.B.I     |
000139e0  20 20 20 20 20 20 20 20  20 20 20 41 44 52 45 51  |           ADREQ|
000139f0  20 20 20 52 30 2c 77 6f  74 6e 6f 69 6e 66 6f 77  |   R0,wotnoinfow|
00013a00  69 6e 64 20 20 20 20 20  20 20 20 3b 20 28 52 36  |ind        ; (R6|
00013a10  3d 30 20 69 66 20 6e 6f  74 20 66 6f 75 6e 64 29  |=0 if not found)|
00013a20  0d 42 f4 2e 20 20 20 20  20 20 20 20 20 20 20 20  |.B..            |
00013a30  20 20 20 20 53 57 49 45  51 20 20 20 22 4f 53 5f  |    SWIEQ   "OS_|
00013a40  47 65 6e 65 72 61 74 65  45 72 72 6f 72 22 0d 42  |GenerateError".B|
00013a50  fe 48 3b 20 57 69 6d 70  5f 4c 6f 61 64 54 65 6d  |.H; Wimp_LoadTem|
00013a60  70 6c 61 74 65 20 68 61  73 20 6c 65 66 74 20 52  |plate has left R|
00013a70  31 20 70 6f 69 6e 74 69  6e 67 20 74 6f 20 74 68  |1 pointing to th|
00013a80  65 20 49 6e 66 6f 20 77  69 6e 64 6f 77 20 74 65  |e Info window te|
00013a90  6d 70 6c 61 74 65 0d 43  08 41 3b 20 73 6f 20 69  |mplate.C.A; so i|
00013aa0  74 27 73 20 62 65 73 74  20 74 6f 20 73 74 6f 72  |t's best to stor|
00013ab0  65 20 74 68 65 20 68 61  6e 64 6c 65 20 61 6e 64  |e the handle and|
00013ac0  20 74 68 65 6e 20 63 72  65 61 74 65 20 74 68 65  | then create the|
00013ad0  20 77 69 6e 64 6f 77 0d  43 12 2d 20 20 20 20 20  | window.C.-     |
00013ae0  20 20 20 20 20 20 20 20  20 20 20 53 54 52 20 20  |           STR  |
00013af0  20 20 20 52 31 2c 74 65  6d 70 6c 61 74 65 68 61  |   R1,templateha|
00013b00  6e 64 6c 65 0d 43 1c 2a  20 20 20 20 20 20 20 20  |ndle.C.*        |
00013b10  20 20 20 20 20 20 20 20  41 44 52 20 20 20 20 20  |        ADR     |
00013b20  52 35 2c 73 70 65 63 69  61 6c 79 65 61 72 0d 43  |R5,specialyear.C|
00013b30  26 27 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |&'              |
00013b40  20 20 41 44 52 20 20 20  20 20 52 36 2c 61 75 74  |  ADR     R6,aut|
00013b50  6f 79 65 61 72 0d 43 30  3e 20 20 20 20 20 20 20  |oyear.C0>       |
00013b60  20 20 20 20 20 20 20 20  20 42 4c 20 20 20 20 20  |         BL     |
00013b70  20 61 75 74 6f 73 74 61  6d 70 74 65 6d 70 20 20  | autostamptemp  |
00013b80  20 20 20 20 20 20 20 20  20 3b 20 41 64 64 20 79  |         ; Add y|
00013b90  65 61 72 0d 43 3a 2b 20  20 20 20 20 20 20 20 20  |ear.C:+         |
00013ba0  20 20 20 20 20 20 20 41  44 52 20 20 20 20 20 52  |       ADR     R|
00013bb0  35 2c 73 70 65 63 69 61  6c 73 74 61 6d 70 0d 43  |5,specialstamp.C|
00013bc0  44 27 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |D'              |
00013bd0  20 20 41 44 52 20 20 20  20 20 52 36 2c 61 75 74  |  ADR     R6,aut|
00013be0  6f 64 61 74 65 0d 43 4e  46 20 20 20 20 20 20 20  |odate.CNF       |
00013bf0  20 20 20 20 20 20 20 20  20 42 4c 20 20 20 20 20  |         BL     |
00013c00  20 61 75 74 6f 73 74 61  6d 70 74 65 6d 70 20 20  | autostamptemp  |
00013c10  20 20 20 20 20 20 20 20  20 3b 20 41 64 64 20 76  |         ; Add v|
00013c20  65 72 73 69 6f 6e 2f 64  61 74 65 0d 43 58 4d 20  |ersion/date.CXM |
00013c30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
00013c40  57 49 20 20 20 20 20 22  58 57 69 6d 70 5f 43 6c  |WI     "XWimp_Cl|
00013c50  6f 73 65 54 65 6d 70 6c  61 74 65 22 20 20 20 3b  |oseTemplate"   ;|
00013c60  20 49 49 49 2d 31 32 33  37 20 28 69 67 6e 6f 72  | III-1237 (ignor|
00013c70  65 20 65 72 72 6f 72 29  0d 43 62 4d 2e 68 61 76  |e error).CbM.hav|
00013c80  65 74 65 6d 70 6c 61 74  65 20 20 20 53 57 49 20  |etemplate   SWI |
00013c90  20 20 20 20 22 58 57 69  6d 70 5f 43 72 65 61 74  |    "XWimp_Creat|
00013ca0  65 57 69 6e 64 6f 77 22  20 20 20 20 3b 20 49 49  |eWindow"    ; II|
00013cb0  49 2d 31 31 37 34 20 28  69 67 6e 6f 72 65 20 65  |I-1174 (ignore e|
00013cc0  72 72 6f 72 29 0d 43 6c  40 20 20 20 20 20 20 20  |rror).Cl@       |
00013cd0  20 20 20 20 20 20 20 20  20 53 54 52 20 20 20 20  |         STR    |
00013ce0  20 52 30 2c 73 75 62 6d  65 6e 75 70 6f 6b 65 20  | R0,submenupoke |
00013cf0  20 3b 20 49 6e 66 6f 20  73 75 62 2d 6d 65 6e 75  | ; Info sub-menu|
00013d00  20 69 74 65 6d 0d 43 76  2b 20 20 20 20 20 20 20  | item.Cv+       |
00013d10  20 20 20 20 20 20 20 20  20 4c 44 4d 46 44 20 20  |         LDMFD  |
00013d20  20 52 31 33 21 2c 7b 52  30 2d 52 36 2c 50 43 7d  | R13!,{R0-R6,PC}|
00013d30  0d 43 80 2a 2e 74 65 6d  70 6c 61 74 65 6e 61 6d  |.C.*.templatenam|
00013d40  65 20 20 20 45 51 55 53  20 20 20 20 22 49 6e 66  |e   EQUS    "Inf|
00013d50  6f 22 2b c4 38 2c 62 6c  24 29 0d 43 8a 1d 2e 74  |o"+.8,bl$).C...t|
00013d60  65 6d 70 6c 61 74 65 68  61 6e 64 6c 65 20 45 51  |emplatehandle EQ|
00013d70  55 44 20 20 20 20 30 0d  43 94 3b 2e 74 65 6d 70  |UD    0.C.;.temp|
00013d80  66 69 6c 65 6e 61 6d 65  20 20 20 45 51 55 53 20  |filename   EQUS |
00013d90  20 20 20 22 3c 54 72 61  73 68 57 6f 72 6b 24 44  |   "<TrashWork$D|
00013da0  69 72 3e 2e 54 65 6d 70  6c 61 74 65 73 22 2b 62  |ir>.Templates"+b|
00013db0  6c 24 0d 43 9e 19 20 20  20 20 20 20 20 20 20 20  |l$.C..          |
00013dc0  20 20 20 20 20 20 41 4c  49 47 4e 0d 43 a8 1d 2e  |      ALIGN.C...|
00013dd0  77 6f 74 6e 6f 74 65 6d  70 66 69 6c 65 20 20 45  |wotnotempfile  E|
00013de0  51 55 44 20 20 20 20 30  0d 43 b2 3c 20 20 20 20  |QUD    0.C.<    |
00013df0  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 53  |            EQUS|
00013e00  20 20 20 20 22 4e 6f 20  22 2b 70 72 6f 67 24 2b  |    "No "+prog$+|
00013e10  22 20 74 65 6d 70 6c 61  74 65 20 66 69 6c 65 22  |" template file"|
00013e20  2b 62 6c 24 0d 43 bc 19  20 20 20 20 20 20 20 20  |+bl$.C..        |
00013e30  20 20 20 20 20 20 20 20  41 4c 49 47 4e 0d 43 c6  |        ALIGN.C.|
00013e40  1d 2e 77 6f 74 6e 6f 69  6e 66 6f 77 69 6e 64 20  |..wotnoinfowind |
00013e50  20 45 51 55 44 20 20 20  20 30 0d 43 d0 41 20 20  | EQUD    0.C.A  |
00013e60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 45 51  |              EQ|
00013e70  55 53 20 20 20 20 22 4e  6f 20 49 6e 66 6f 20 77  |US    "No Info w|
00013e80  69 6e 64 6f 77 20 69 6e  20 74 65 6d 70 6c 61 74  |indow in templat|
00013e90  65 20 66 69 6c 65 22 2b  62 6c 24 0d 43 da 22 2e  |e file"+bl$.C.".|
00013ea0  73 70 65 63 69 61 6c 79  65 61 72 20 20 20 20 45  |specialyear    E|
00013eb0  51 55 53 20 20 20 20 22  59 59 59 59 22 0d 43 e4  |QUS    "YYYY".C.|
00013ec0  29 2e 61 75 74 6f 79 65  61 72 20 20 20 20 20 20  |).autoyear      |
00013ed0  20 45 51 55 53 20 20 20  20 c2 64 61 74 65 24 2c  | EQUS    .date$,|
00013ee0  34 29 2b 63 72 24 0d 43  ee 22 2e 73 70 65 63 69  |4)+cr$.C.".speci|
00013ef0  61 6c 73 74 61 6d 70 20  20 20 45 51 55 53 20 20  |alstamp   EQUS  |
00013f00  20 20 22 41 2e 42 42 22  0d 43 f8 28 2e 61 75 74  |  "A.BB".C.(.aut|
00013f10  6f 64 61 74 65 20 20 20  20 20 20 20 45 51 55 53  |odate       EQUS|
00013f20  20 20 20 20 72 65 73 64  61 74 65 24 2b 63 72 24  |    resdate$+cr$|
00013f30  0d 44 02 19 20 20 20 20  20 20 20 20 20 20 20 20  |.D..            |
00013f40  20 20 20 20 41 4c 49 47  4e 0d 44 0c 04 0d 44 16  |    ALIGN.D...D.|
00013f50  12 2e 61 75 74 6f 73 74  61 6d 70 74 65 6d 70 0d  |..autostamptemp.|
00013f60  44 20 04 0d 44 2a 31 3b  20 4f 6e 20 65 6e 74 72  |D ..D*1; On entr|
00013f70  79 2c 20 20 20 20 20 52  31 20 20 20 20 20 20 3d  |y,     R1      =|
00013f80  20 54 65 6d 70 6c 61 74  65 20 64 61 74 61 20 73  | Template data s|
00013f90  74 61 72 74 0d 44 34 2f  3b 20 20 20 20 20 20 20  |tart.D4/;       |
00013fa0  20 20 20 20 20 20 20 20  52 33 20 20 20 20 20 20  |        R3      |
00013fb0  3d 20 54 65 6d 70 6c 61  74 65 20 64 61 74 61 20  |= Template data |
00013fc0  65 6e 64 0d 44 3e 48 3b  20 20 20 20 20 20 20 20  |end.D>H;        |
00013fd0  20 20 20 20 20 20 20 52  35 20 20 20 20 20 20 3d  |       R5      =|
00013fe0  20 50 6f 69 6e 74 65 72  20 74 6f 20 73 70 65 63  | Pointer to spec|
00013ff0  69 61 6c 20 73 65 61 72  63 68 20 73 74 72 69 6e  |ial search strin|
00014000  67 20 28 34 20 62 79 74  65 73 29 0d 44 48 47 3b  |g (4 bytes).DHG;|
00014010  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 52  |               R|
00014020  36 20 20 20 20 20 20 3d  20 50 6f 69 6e 74 65 72  |6      = Pointer|
00014030  20 74 6f 20 72 65 70 6c  61 63 65 6d 65 6e 74 20  | to replacement |
00014040  73 74 72 69 6e 67 20 28  43 52 2d 74 65 72 6d 65  |string (CR-terme|
00014050  64 29 0d 44 52 04 0d 44  5c 2c 20 20 20 20 20 20  |d).DR..D\,      |
00014060  20 20 20 20 20 20 20 20  20 20 53 54 4d 46 44 20  |          STMFD |
00014070  20 20 52 31 33 21 2c 7b  52 30 2d 52 34 2c 52 31  |  R13!,{R0-R4,R1|
00014080  34 7d 0d 44 66 45 2e 73  63 61 6e 61 6c 6c 66 6f  |4}.DfE.scanallfo|
00014090  75 72 20 20 20 20 4d 4f  56 20 20 20 20 20 52 32  |ur    MOV     R2|
000140a0  2c 23 33 20 20 20 20 20  20 20 20 20 20 20 3b 20  |,#3           ; |
000140b0  53 65 61 72 63 68 20 73  74 72 69 6e 67 20 3d 20  |Search string = |
000140c0  34 20 62 79 74 65 73 0d  44 70 26 2e 73 74 69 6c  |4 bytes.Dp&.stil|
000140d0  6c 6e 6f 73 74 61 6d 70  20 20 20 4c 44 52 42 20  |lnostamp   LDRB |
000140e0  20 20 20 52 34 2c 5b 52  31 2c 52 32 5d 0d 44 7a  |   R4,[R1,R2].Dz|
000140f0  26 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |&               |
00014100  20 4c 44 52 42 20 20 20  20 52 30 2c 5b 52 35 2c  | LDRB    R0,[R5,|
00014110  52 32 5d 0d 44 84 21 20  20 20 20 20 20 20 20 20  |R2].D.!         |
00014120  20 20 20 20 20 20 20 43  4d 50 20 20 20 20 20 52  |       CMP     R|
00014130  34 2c 52 30 0d 44 8e 43  20 20 20 20 20 20 20 20  |4,R0.D.C        |
00014140  20 20 20 20 20 20 20 20  42 4e 45 20 20 20 20 20  |        BNE     |
00014150  6e 6f 73 75 62 6d 61 74  63 68 20 20 20 20 20 20  |nosubmatch      |
00014160  3b 20 4e 65 78 74 20 62  79 74 65 20 69 66 20 6e  |; Next byte if n|
00014170  6f 20 6d 61 74 63 68 0d  44 98 4a 20 20 20 20 20  |o match.D.J     |
00014180  20 20 20 20 20 20 20 20  20 20 20 53 55 42 53 20  |           SUBS |
00014190  20 20 20 52 32 2c 52 32  2c 23 31 20 20 20 20 20  |   R2,R2,#1     |
000141a0  20 20 20 3b 20 4b 65 65  70 20 73 63 61 6e 6e 69  |   ; Keep scanni|
000141b0  6e 67 20 75 6e 74 69 6c  20 61 6c 6c 20 66 6f 75  |ng until all fou|
000141c0  72 0d 44 a2 33 20 20 20  20 20 20 20 20 20 20 20  |r.D.3           |
000141d0  20 20 20 20 20 42 50 4c  20 20 20 20 20 73 74 69  |     BPL     sti|
000141e0  6c 6c 6e 6f 73 74 61 6d  70 20 20 20 20 3b 20 66  |llnostamp    ; f|
000141f0  6f 75 6e 64 0d 44 ac 25  20 20 20 20 20 20 20 20  |ound.D.%        |
00014200  20 20 20 20 20 20 20 20  42 20 20 20 20 20 20 20  |        B       |
00014210  65 78 61 63 74 64 61 74  65 0d 44 b6 4a 2e 6e 6f  |exactdate.D.J.no|
00014220  73 75 62 6d 61 74 63 68  20 20 20 20 20 41 44 44  |submatch     ADD|
00014230  20 20 20 20 20 52 31 2c  52 31 2c 23 31 20 20 20  |     R1,R1,#1   |
00014240  20 20 20 20 20 3b 20 4e  65 78 74 20 62 79 74 65  |     ; Next byte|
00014250  20 28 6c 65 61 76 65 20  69 66 20 6e 6f 20 6d 6f  | (leave if no mo|
00014260  72 65 29 0d 44 c0 21 20  20 20 20 20 20 20 20 20  |re).D.!         |
00014270  20 20 20 20 20 20 20 43  4d 50 20 20 20 20 20 52  |       CMP     R|
00014280  31 2c 52 33 0d 44 ca 27  20 20 20 20 20 20 20 20  |1,R3.D.'        |
00014290  20 20 20 20 20 20 20 20  42 4e 45 20 20 20 20 20  |        BNE     |
000142a0  73 63 61 6e 61 6c 6c 66  6f 75 72 0d 44 d4 2a 20  |scanallfour.D.* |
000142b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 42  |               B|
000142c0  20 20 20 20 20 20 20 6e  6f 63 68 61 6e 67 65 74  |       nochanget|
000142d0  6f 64 61 74 65 0d 44 de  48 2e 65 78 61 63 74 64  |odate.D.H.exactd|
000142e0  61 74 65 20 20 20 20 20  20 4d 4f 56 20 20 20 20  |ate      MOV    |
000142f0  20 52 30 2c 52 36 20 20  20 20 20 20 20 20 20 20  | R0,R6          |
00014300  20 3b 20 43 6f 70 79 20  72 65 70 6c 61 63 65 6d  | ; Copy replacem|
00014310  65 6e 74 20 73 74 72 69  6e 67 20 6f 6e 0d 44 e8  |ent string on.D.|
00014320  47 2e 64 6f 61 75 74 6f  73 74 61 6d 70 20 20 20  |G.doautostamp   |
00014330  20 4c 44 52 42 20 20 20  20 52 32 2c 5b 52 30 5d  | LDRB    R2,[R0]|
00014340  2c 23 31 20 20 20 20 20  20 3b 20 74 6f 70 20 6f  |,#1      ; top o|
00014350  66 20 73 65 61 72 63 68  20 72 65 73 75 6c 74 20  |f search result |
00014360  61 64 64 72 0d 44 f2 4c  20 20 20 20 20 20 20 20  |addr.D.L        |
00014370  20 20 20 20 20 20 20 20  53 54 52 42 20 20 20 20  |        STRB    |
00014380  52 32 2c 5b 52 31 5d 2c  23 31 20 20 20 20 20 20  |R2,[R1],#1      |
00014390  3b 20 75 70 20 75 6e 74  69 6c 20 61 20 43 52 20  |; up until a CR |
000143a0  28 69 6e 64 69 72 65 63  74 65 64 20 64 61 74 61  |(indirected data|
000143b0  0d 44 fc 43 20 20 20 20  20 20 20 20 20 20 20 20  |.D.C            |
000143c0  20 20 20 20 43 4d 50 20  20 20 20 20 52 32 2c 23  |    CMP     R2,#|
000143d0  31 33 20 20 20 20 20 20  20 20 20 20 3b 20 65 6e  |13          ; en|
000143e0  64 73 20 69 6e 20 61 20  43 52 2c 20 6e 6f 74 20  |ds in a CR, not |
000143f0  30 29 2e 0d 45 06 27 20  20 20 20 20 20 20 20 20  |0)..E.'         |
00014400  20 20 20 20 20 20 20 42  4e 45 20 20 20 20 20 64  |       BNE     d|
00014410  6f 61 75 74 6f 73 74 61  6d 70 0d 45 10 27 20 20  |oautostamp.E.'  |
00014420  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 20  |              B |
00014430  20 20 20 20 20 20 73 63  61 6e 61 6c 6c 66 6f 75  |      scanallfou|
00014440  72 0d 45 1a 2b 2e 6e 6f  63 68 61 6e 67 65 74 6f  |r.E.+.nochangeto|
00014450  64 61 74 65 20 4c 44 4d  46 44 20 20 20 52 31 33  |date LDMFD   R13|
00014460  21 2c 7b 52 30 2d 52 34  2c 50 43 7d 0d 45 24 04  |!,{R0-R4,PC}.E$.|
00014470  0d 45 2e 14 2e 67 65 74  6d 65 6e 75 69 63 6f 6e  |.E...getmenuicon|
00014480  69 6e 66 6f 0d 45 38 04  0d 45 42 2b 3b 20 4f 6e  |info.E8..EB+; On|
00014490  20 65 6e 74 72 79 2c 20  20 20 20 20 52 32 20 20  | entry,     R2  |
000144a0  20 20 20 20 3d 20 57 69  6e 64 6f 77 20 68 61 6e  |    = Window han|
000144b0  64 6c 65 0d 45 4c 29 3b  20 20 20 20 20 20 20 20  |dle.EL);        |
000144c0  20 20 20 20 20 20 20 52  33 20 20 20 20 20 20 3d  |       R3      =|
000144d0  20 49 63 6f 6e 20 68 61  6e 64 6c 65 0d 45 56 34  | Icon handle.EV4|
000144e0  3b 20 4f 6e 20 65 78 69  74 2c 20 20 20 20 20 20  |; On exit,      |
000144f0  52 30 20 20 20 20 20 20  3d 20 50 6f 69 6e 74 65  |R0      = Pointe|
00014500  72 20 74 6f 20 74 65 78  74 20 73 74 72 69 6e 67  |r to text string|
00014510  0d 45 60 42 3b 20 20 20  20 20 20 20 20 20 20 20  |.E`B;           |
00014520  20 20 20 20 52 31 20 20  20 20 20 20 3d 20 50 6f  |    R1      = Po|
00014530  69 6e 74 65 72 20 74 6f  20 27 45 6d 70 74 79 20  |inter to 'Empty |
00014540  54 72 61 73 68 27 20 6d  65 6e 75 20 73 74 72 69  |Trash' menu stri|
00014550  6e 67 0d 45 6a 2c 20 20  20 20 20 20 20 20 20 20  |ng.Ej,          |
00014560  20 20 20 20 20 20 53 54  4d 46 44 20 20 20 52 31  |      STMFD   R1|
00014570  33 21 2c 7b 52 32 2c 52  33 2c 52 31 34 7d 0d 45  |3!,{R2,R3,R14}.E|
00014580  74 27 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |t'              |
00014590  20 20 42 4c 20 20 20 20  20 20 67 65 74 69 63 6f  |  BL      getico|
000145a0  6e 69 6e 66 6f 0d 45 7e  42 20 20 20 20 20 20 20  |ninfo.E~B       |
000145b0  20 20 20 20 20 20 20 20  20 41 44 44 20 20 20 20  |         ADD    |
000145c0  20 52 30 2c 52 31 2c 23  32 38 20 20 20 20 20 20  | R0,R1,#28      |
000145d0  20 3b 20 50 6f 69 6e 74  65 72 20 74 6f 20 6d 65  | ; Pointer to me|
000145e0  6e 75 20 74 65 78 74 0d  45 88 2a 20 20 20 20 20  |nu text.E.*     |
000145f0  20 20 20 20 20 20 20 20  20 20 20 41 44 52 20 20  |           ADR  |
00014600  20 20 20 52 31 2c 74 72  61 73 68 73 74 61 74 2b  |   R1,trashstat+|
00014610  34 0d 45 92 2b 20 20 20  20 20 20 20 20 20 20 20  |4.E.+           |
00014620  20 20 20 20 20 4c 44 4d  46 44 20 20 20 52 31 33  |     LDMFD   R13|
00014630  21 2c 7b 52 32 2c 52 33  2c 50 43 7d 0d 45 9c 04  |!,{R2,R3,PC}.E..|
00014640  0d 45 a6 10 2e 6d 61 6b  65 6e 65 77 6d 65 6e 75  |.E...makenewmenu|
00014650  0d 45 b0 04 0d 45 ba 38  3b 20 4f 6e 20 65 6e 74  |.E...E.8; On ent|
00014660  72 79 2c 20 20 20 20 20  52 31 20 20 20 20 20 20  |ry,     R1      |
00014670  3d 20 50 6f 69 6e 74 65  72 20 74 6f 20 57 69 6d  |= Pointer to Wim|
00014680  70 5f 50 6f 6c 6c 20 62  6c 6f 63 6b 0d 45 c4 04  |p_Poll block.E..|
00014690  0d 45 ce 29 20 20 20 20  20 20 20 20 20 20 20 20  |.E.)            |
000146a0  20 20 20 20 53 54 4d 46  44 20 20 20 52 31 33 21  |    STMFD   R13!|
000146b0  2c 7b 52 32 2c 52 31 34  7d 0d 45 d8 4b 20 20 20  |,{R2,R14}.E.K   |
000146c0  20 20 20 20 20 20 20 20  20 20 20 20 20 4c 44 52  |             LDR|
000146d0  20 20 20 20 20 52 32 2c  5b 52 31 5d 20 20 20 20  |     R2,[R1]    |
000146e0  20 20 20 20 20 3b 20 47  65 74 20 58 20 72 65 74  |     ; Get X ret|
000146f0  75 72 6e 65 64 20 66 72  6f 6d 20 57 69 6d 70 5f  |urned from Wimp_|
00014700  50 6f 6c 6c 0d 45 e2 49  20 20 20 20 20 20 20 20  |Poll.E.I        |
00014710  20 20 20 20 20 20 20 20  53 55 42 20 20 20 20 20  |        SUB     |
00014720  52 32 2c 52 32 2c 23 36  34 20 20 20 20 20 20 20  |R2,R2,#64       |
00014730  3b 20 53 75 62 74 72 61  63 74 20 36 34 20 66 6f  |; Subtract 64 fo|
00014740  72 20 65 61 73 79 20 61  63 63 65 73 73 0d 45 ec  |r easy access.E.|
00014750  3a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |:               |
00014760  20 53 54 52 20 20 20 20  20 52 32 2c 6e 65 77 6d  | STR     R2,newm|
00014770  65 6e 75 78 20 20 20 20  20 3b 20 53 61 76 65 20  |enux     ; Save |
00014780  58 20 63 6f 6f 72 64 0d  45 f6 24 20 20 20 20 20  |X coord.E.$     |
00014790  20 20 20 20 20 20 20 20  20 20 20 42 4c 20 20 20  |           BL   |
000147a0  20 20 20 6d 61 6b 65 6d  65 6e 75 0d 46 00 28 20  |   makemenu.F.( |
000147b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
000147c0  44 4d 46 44 20 20 20 52  31 33 21 2c 7b 52 32 2c  |DMFD   R13!,{R2,|
000147d0  50 43 7d 0d 46 0a 04 0d  46 14 29 2e 6d 61 6b 65  |PC}.F...F.).make|
000147e0  6f 6c 64 6d 65 6e 75 20  20 20 20 53 54 4d 46 44  |oldmenu    STMFD|
000147f0  20 20 20 52 31 33 21 2c  7b 52 32 2c 52 31 34 7d  |   R13!,{R2,R14}|
00014800  0d 46 1e 3e 20 20 20 20  20 20 20 20 20 20 20 20  |.F.>            |
00014810  20 20 20 20 4c 44 52 20  20 20 20 20 52 32 2c 6e  |    LDR     R2,n|
00014820  65 77 6d 65 6e 75 78 20  20 20 20 20 3b 20 52 65  |ewmenux     ; Re|
00014830  74 72 69 65 76 65 20 58  20 63 6f 6f 72 64 0d 46  |trieve X coord.F|
00014840  28 24 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |($              |
00014850  20 20 42 4c 20 20 20 20  20 20 6d 61 6b 65 6d 65  |  BL      makeme|
00014860  6e 75 0d 46 32 28 20 20  20 20 20 20 20 20 20 20  |nu.F2(          |
00014870  20 20 20 20 20 20 4c 44  4d 46 44 20 20 20 52 31  |      LDMFD   R1|
00014880  33 21 2c 7b 52 32 2c 50  43 7d 0d 46 3c 04 0d 46  |3!,{R2,PC}.F<..F|
00014890  46 0d 2e 6d 61 6b 65 6d  65 6e 75 0d 46 50 04 0d  |F..makemenu.FP..|
000148a0  46 5a 2d 3b 20 4f 6e 20  65 6e 74 72 79 2c 20 20  |FZ-; On entry,  |
000148b0  20 20 20 52 32 20 20 20  20 20 20 3d 20 58 20 63  |   R2      = X c|
000148c0  6f 6f 72 64 20 6f 66 20  6d 65 6e 75 0d 46 64 30  |oord of menu.Fd0|
000148d0  3b 20 4d 75 73 74 20 64  69 73 70 6c 61 79 20 61  |; Must display a|
000148e0  20 6d 65 6e 75 20 75 73  69 6e 67 20 57 69 6d 70  | menu using Wimp|
000148f0  5f 43 72 65 61 74 65 4d  65 6e 75 2e 0d 46 6e 04  |_CreateMenu..Fn.|
00014900  0d 46 78 2c 20 20 20 20  20 20 20 20 20 20 20 20  |.Fx,            |
00014910  20 20 20 20 53 54 4d 46  44 20 20 20 52 31 33 21  |    STMFD   R13!|
00014920  2c 7b 52 31 2c 52 33 2c  52 31 34 7d 0d 46 82 49  |,{R1,R3,R14}.F.I|
00014930  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00014940  4d 4f 56 20 20 20 20 20  52 33 2c 23 32 32 38 20  |MOV     R3,#228 |
00014950  20 20 20 20 20 20 20 20  3b 20 4d 65 6e 75 20 59  |        ; Menu Y|
00014960  20 3d 20 32 32 38 20 69  66 20 6f 6e 20 69 63 6f  | = 228 if on ico|
00014970  6e 20 62 61 72 0d 46 8c  4a 20 20 20 20 20 20 20  |n bar.F.J       |
00014980  20 20 20 20 20 20 20 20  20 41 44 44 20 20 20 20  |         ADD    |
00014990  20 52 33 2c 52 33 2c 23  34 34 2a 33 20 20 20 20  | R3,R3,#44*3    |
000149a0  20 3b 20 2b 20 33 20 69  74 65 6d 73 20 77 6f 72  | ; + 3 items wor|
000149b0  74 68 20 66 6f 72 20 6e  65 77 20 62 69 74 73 0d  |th for new bits.|
000149c0  46 96 2c 20 20 20 20 20  20 20 20 20 20 20 20 20  |F.,             |
000149d0  20 20 20 41 44 52 20 20  20 20 20 52 31 2c 6d 75  |   ADR     R1,mu|
000149e0  6c 74 69 71 75 69 74 61  64 64 72 0d 46 a0 2c 20  |ltiquitaddr.F., |
000149f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
00014a00  54 52 20 20 20 20 20 52  31 2c 6d 75 6c 74 69 71  |TR     R1,multiq|
00014a10  75 69 74 70 6f 6b 65 0d  46 aa 28 20 20 20 20 20  |uitpoke.F.(     |
00014a20  20 20 20 20 20 20 20 20  20 20 20 41 44 52 20 20  |           ADR  |
00014a30  20 20 20 52 31 2c 6d 65  6e 75 62 6c 6f 63 6b 0d  |   R1,menublock.|
00014a40  46 b4 3e 20 20 20 20 20  20 20 20 20 20 20 20 20  |F.>             |
00014a50  20 20 20 53 57 49 20 20  20 20 20 22 58 57 69 6d  |   SWI     "XWim|
00014a60  70 5f 43 72 65 61 74 65  4d 65 6e 75 22 20 20 20  |p_CreateMenu"   |
00014a70  20 20 20 3b 20 49 49 49  2d 31 32 32 36 0d 46 be  |   ; III-1226.F.|
00014a80  2b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |+               |
00014a90  20 4c 44 4d 46 44 20 20  20 52 31 33 21 2c 7b 52  | LDMFD   R13!,{R|
00014aa0  31 2c 52 33 2c 50 43 7d  0d 46 c8 3c 2e 6e 65 77  |1,R3,PC}.F.<.new|
00014ab0  6d 65 6e 75 78 20 20 20  20 20 20 20 45 51 55 44  |menux       EQUD|
00014ac0  20 20 20 20 30 20 20 20  20 20 20 20 3b 20 53 61  |    0       ; Sa|
00014ad0  76 65 20 6d 65 6e 75 20  58 20 63 6f 6f 72 64 20  |ve menu X coord |
00014ae0  68 65 72 65 0d 46 d2 04  0d 46 dc 0e 2e 6d 65 6e  |here.F...F...men|
00014af0  75 62 6c 6f 63 6b 0d 46  e6 1d 3b 20 4d 65 6e 75  |ublock.F..; Menu|
00014b00  20 73 74 72 75 63 74 75  72 65 20 66 69 72 73 74  | structure first|
00014b10  2e 2e 2e 0d 46 f0 40 20  20 20 20 20 20 20 20 20  |....F.@         |
00014b20  20 20 20 20 20 20 20 45  51 55 53 20 20 20 20 70  |       EQUS    p|
00014b30  72 6f 67 24 2b c4 31 32  2d a9 28 70 72 6f 67 24  |rog$+.12-.(prog$|
00014b40  29 2c 62 6c 24 29 20 3b  20 4d 65 6e 75 20 74 69  |),bl$) ; Menu ti|
00014b50  74 6c 65 0d 46 fa 45 20  20 20 20 20 20 20 20 20  |tle.F.E         |
00014b60  20 20 20 20 20 20 20 45  51 55 42 20 20 20 20 37  |       EQUB    7|
00014b70  20 20 20 20 20 20 20 3b  20 46 6f 72 65 67 72 6f  |       ; Foregro|
00014b80  75 6e 64 20 3d 20 37 20  28 6e 6f 72 6d 61 6c 6c  |und = 7 (normall|
00014b90  79 20 62 6c 61 63 6b 29  0d 47 04 44 20 20 20 20  |y black).G.D    |
00014ba0  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 42  |            EQUB|
00014bb0  20 20 20 20 32 20 20 20  20 20 20 20 3b 20 42 61  |    2       ; Ba|
00014bc0  63 6b 67 72 6f 75 6e 64  20 3d 20 32 20 28 6e 6f  |ckground = 2 (no|
00014bd0  72 6d 61 6c 6c 79 20 67  72 65 79 29 0d 47 0e 45  |rmally grey).G.E|
00014be0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00014bf0  45 51 55 42 20 20 20 20  37 20 20 20 20 20 20 20  |EQUB    7       |
00014c00  3b 20 57 6f 72 6b 20 66  6f 72 65 20 20 3d 20 37  |; Work fore  = 7|
00014c10  20 28 6e 6f 72 6d 61 6c  6c 79 20 62 6c 61 63 6b  | (normally black|
00014c20  29 0d 47 18 45 20 20 20  20 20 20 20 20 20 20 20  |).G.E           |
00014c30  20 20 20 20 20 45 51 55  42 20 20 20 20 30 20 20  |     EQUB    0  |
00014c40  20 20 20 20 20 3b 20 57  6f 72 6b 20 62 61 63 6b  |     ; Work back|
00014c50  20 20 3d 20 30 20 28 6e  6f 72 6d 61 6c 6c 79 20  |  = 0 (normally |
00014c60  77 68 69 74 65 29 0d 47  22 3f 20 20 20 20 20 20  |white).G"?      |
00014c70  20 20 20 20 20 20 20 20  20 20 45 51 55 44 20 20  |          EQUD  |
00014c80  20 20 31 38 38 20 20 20  20 20 3b 20 54 6f 74 61  |  188     ; Tota|
00014c90  6c 20 77 69 64 74 68 20  6f 66 20 6d 65 6e 75 20  |l width of menu |
00014ca0  69 74 65 6d 73 0d 47 2c  40 20 20 20 20 20 20 20  |items.G,@       |
00014cb0  20 20 20 20 20 20 20 20  20 45 51 55 44 20 20 20  |         EQUD   |
00014cc0  20 34 34 20 20 20 20 20  20 3b 20 54 6f 74 61 6c  | 44      ; Total|
00014cd0  20 68 65 69 67 68 74 20  6f 66 20 6d 65 6e 75 20  | height of menu |
00014ce0  69 74 65 6d 73 0d 47 36  40 20 20 20 20 20 20 20  |items.G6@       |
00014cf0  20 20 20 20 20 20 20 20  20 45 51 55 44 20 20 20  |         EQUD   |
00014d00  20 30 20 20 20 20 20 20  20 3b 20 4c 69 6e 65 20  | 0       ; Line |
00014d10  73 70 61 63 69 6e 67 20  62 65 74 77 65 65 6e 20  |spacing between |
00014d20  69 74 65 6d 73 0d 47 40  1a 3b 20 2e 2e 2e 74 68  |items.G@.; ...th|
00014d30  65 6e 20 4d 65 6e 75 20  69 74 65 6d 20 23 31 0d  |en Menu item #1.|
00014d40  47 4a 35 20 20 20 20 20  20 20 20 20 20 20 20 20  |GJ5             |
00014d50  20 20 20 45 51 55 44 20  20 20 20 30 20 20 20 20  |   EQUD    0    |
00014d60  20 20 20 3b 20 4e 6f 74  68 69 6e 67 20 73 70 65  |   ; Nothing spe|
00014d70  63 69 61 6c 0d 47 54 41  2e 73 75 62 6d 65 6e 75  |cial.GTA.submenu|
00014d80  70 6f 6b 65 20 20 20 20  45 51 55 44 20 20 20 20  |poke    EQUD    |
00014d90  30 20 20 20 20 20 20 20  3b 20 53 75 62 2d 6d 65  |0       ; Sub-me|
00014da0  6e 75 20 61 64 64 72 20  70 6f 6b 65 64 20 69 6e  |nu addr poked in|
00014db0  20 68 65 72 65 0d 47 5e  44 20 20 20 20 20 20 20  | here.G^D       |
00014dc0  20 20 20 20 20 20 20 20  20 45 51 55 44 20 20 20  |         EQUD   |
00014dd0  20 28 37 3c 3c 32 34 29  20 84 20 31 20 3b 20 49  | (7<<24) . 1 ; I|
00014de0  74 65 6d 20 68 61 73 20  74 65 78 74 20 61 6e 64  |tem has text and|
00014df0  20 69 73 20 62 6c 61 63  6b 0d 47 68 2d 20 20 20  | is black.Gh-   |
00014e00  20 20 20 20 20 20 20 20  20 20 20 20 20 45 51 55  |             EQU|
00014e10  53 20 20 20 20 22 49 6e  66 6f 20 20 20 20 20 20  |S    "Info      |
00014e20  20 22 2b 62 6c 24 0d 47  72 1a 3b 20 2e 2e 2e 74  | "+bl$.Gr.; ...t|
00014e30  68 65 6e 20 4d 65 6e 75  20 69 74 65 6d 20 23 32  |hen Menu item #2|
00014e40  0d 47 7c 35 2e 69 6d 6d  65 64 69 61 74 65 73 74  |.G|5.immediatest|
00014e50  61 74 20 20 45 51 55 44  20 20 20 20 30 20 20 20  |at  EQUD    0   |
00014e60  20 20 20 20 3b 20 4e 6f  74 68 69 6e 67 20 73 70  |    ; Nothing sp|
00014e70  65 63 69 61 6c 0d 47 86  31 20 20 20 20 20 20 20  |ecial.G.1       |
00014e80  20 20 20 20 20 20 20 20  20 45 51 55 44 20 20 20  |         EQUD   |
00014e90  20 2d 31 20 20 20 20 20  20 3b 20 4e 6f 20 73 75  | -1      ; No su|
00014ea0  62 2d 6d 65 6e 75 0d 47  90 44 20 20 20 20 20 20  |b-menu.G.D      |
00014eb0  20 20 20 20 20 20 20 20  20 20 45 51 55 44 20 20  |          EQUD  |
00014ec0  20 20 28 37 3c 3c 32 34  29 20 84 20 31 20 3b 20  |  (7<<24) . 1 ; |
00014ed0  49 74 65 6d 20 68 61 73  20 74 65 78 74 20 61 6e  |Item has text an|
00014ee0  64 20 69 73 20 62 6c 61  63 6b 0d 47 9a 3f 20 20  |d is black.G.?  |
00014ef0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 45 51  |              EQ|
00014f00  55 53 20 20 20 20 22 49  6d 6d 65 64 69 61 74 65  |US    "Immediate|
00014f10  20 20 22 2b 62 6c 24 20  20 20 20 20 20 20 3b 20  |  "+bl$       ; |
00014f20  4d 65 6e 75 20 69 74 65  6d 0d 47 a4 1a 3b 20 2e  |Menu item.G..; .|
00014f30  2e 2e 74 68 65 6e 20 4d  65 6e 75 20 69 74 65 6d  |..then Menu item|
00014f40  20 23 33 0d 47 ae 35 2e  77 61 72 6e 69 6e 67 73  | #3.G.5.warnings|
00014f50  74 61 74 20 20 20 20 45  51 55 44 20 20 20 20 30  |tat    EQUD    0|
00014f60  20 20 20 20 20 20 20 3b  20 4e 6f 74 68 69 6e 67  |       ; Nothing|
00014f70  20 73 70 65 63 69 61 6c  0d 47 b8 31 20 20 20 20  | special.G.1    |
00014f80  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 44  |            EQUD|
00014f90  20 20 20 20 2d 31 20 20  20 20 20 20 3b 20 4e 6f  |    -1      ; No|
00014fa0  20 73 75 62 2d 6d 65 6e  75 0d 47 c2 44 20 20 20  | sub-menu.G.D   |
00014fb0  20 20 20 20 20 20 20 20  20 20 20 20 20 45 51 55  |             EQU|
00014fc0  44 20 20 20 20 28 37 3c  3c 32 34 29 20 84 20 31  |D    (7<<24) . 1|
00014fd0  20 3b 20 49 74 65 6d 20  68 61 73 20 74 65 78 74  | ; Item has text|
00014fe0  20 61 6e 64 20 69 73 20  62 6c 61 63 6b 0d 47 cc  | and is black.G.|
00014ff0  3f 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |?               |
00015000  20 45 51 55 53 20 20 20  20 22 57 61 72 6e 69 6e  | EQUS    "Warnin|
00015010  67 20 20 20 20 22 2b 62  6c 24 20 20 20 20 20 20  |g    "+bl$      |
00015020  20 3b 20 4d 65 6e 75 20  69 74 65 6d 0d 47 d6 1a  | ; Menu item.G..|
00015030  3b 20 2e 2e 2e 74 68 65  6e 20 4d 65 6e 75 20 69  |; ...then Menu i|
00015040  74 65 6d 20 23 34 0d 47  e0 35 2e 61 6e 69 6d 61  |tem #4.G.5.anima|
00015050  74 69 6f 6e 73 74 61 74  20 20 45 51 55 44 20 20  |tionstat  EQUD  |
00015060  20 20 30 20 20 20 20 20  20 20 3b 20 4e 6f 74 68  |  0       ; Noth|
00015070  69 6e 67 20 73 70 65 63  69 61 6c 0d 47 ea 31 20  |ing special.G.1 |
00015080  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 45  |               E|
00015090  51 55 44 20 20 20 20 2d  31 20 20 20 20 20 20 3b  |QUD    -1      ;|
000150a0  20 4e 6f 20 73 75 62 2d  6d 65 6e 75 0d 47 f4 44  | No sub-menu.G.D|
000150b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000150c0  45 51 55 44 20 20 20 20  28 37 3c 3c 32 34 29 20  |EQUD    (7<<24) |
000150d0  84 20 31 20 3b 20 49 74  65 6d 20 68 61 73 20 74  |. 1 ; Item has t|
000150e0  65 78 74 20 61 6e 64 20  69 73 20 62 6c 61 63 6b  |ext and is black|
000150f0  0d 47 fe 3f 20 20 20 20  20 20 20 20 20 20 20 20  |.G.?            |
00015100  20 20 20 20 45 51 55 53  20 20 20 20 22 41 6e 69  |    EQUS    "Ani|
00015110  6d 61 74 69 6f 6e 20 20  22 2b 62 6c 24 20 20 20  |mation  "+bl$   |
00015120  20 20 20 20 3b 20 4d 65  6e 75 20 69 74 65 6d 0d  |    ; Menu item.|
00015130  48 08 1a 3b 20 2e 2e 2e  74 68 65 6e 20 4d 65 6e  |H..; ...then Men|
00015140  75 20 69 74 65 6d 20 23  35 0d 48 12 35 20 20 20  |u item #5.H.5   |
00015150  20 20 20 20 20 20 20 20  20 20 20 20 20 45 51 55  |             EQU|
00015160  44 20 20 20 20 30 20 20  20 20 20 20 20 3b 20 4e  |D    0       ; N|
00015170  6f 74 68 69 6e 67 20 73  70 65 63 69 61 6c 0d 48  |othing special.H|
00015180  1c 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.1              |
00015190  20 20 45 51 55 44 20 20  20 20 2d 31 20 20 20 20  |  EQUD    -1    |
000151a0  20 20 3b 20 4e 6f 20 73  75 62 2d 6d 65 6e 75 0d  |  ; No sub-menu.|
000151b0  48 26 46 3b 20 54 68 69  73 20 77 6f 72 64 20 68  |H&F; This word h|
000151c0  61 73 20 74 6f 20 68 61  76 65 20 62 69 74 20 32  |as to have bit 2|
000151d0  32 20 63 68 61 6e 67 65  64 20 64 65 70 65 6e 64  |2 changed depend|
000151e0  69 6e 67 20 6f 6e 20 54  72 61 73 68 20 63 6f 6e  |ing on Trash con|
000151f0  74 65 6e 74 73 0d 48 30  47 3b 20 42 69 74 20 32  |tents.H0G; Bit 2|
00015200  32 20 72 65 66 65 72 73  20 74 6f 20 77 68 65 74  |2 refers to whet|
00015210  68 65 72 20 74 68 65 20  69 74 65 6d 20 69 73 20  |her the item is |
00015220  73 68 61 64 65 64 20 28  75 6e 73 65 6c 65 63 74  |shaded (unselect|
00015230  61 62 6c 65 29 20 6f 72  20 6e 6f 74 0d 48 3a 44  |able) or not.H:D|
00015240  2e 74 72 61 73 68 73 74  61 74 20 20 20 20 20 20  |.trashstat      |
00015250  45 51 55 44 20 20 20 20  28 37 3c 3c 32 34 29 20  |EQUD    (7<<24) |
00015260  84 20 31 20 3b 20 49 74  65 6d 20 68 61 73 20 74  |. 1 ; Item has t|
00015270  65 78 74 20 61 6e 64 20  69 73 20 62 6c 61 63 6b  |ext and is black|
00015280  0d 48 44 3f 20 20 20 20  20 20 20 20 20 20 20 20  |.HD?            |
00015290  20 20 20 20 45 51 55 53  20 20 20 20 22 45 6d 70  |    EQUS    "Emp|
000152a0  74 79 20 54 72 61 73 68  22 2b 62 6c 24 20 20 20  |ty Trash"+bl$   |
000152b0  20 20 20 20 3b 20 4d 65  6e 75 20 69 74 65 6d 0d  |    ; Menu item.|
000152c0  48 4e 21 3b 20 2e 2e 2e  61 6e 64 20 66 69 6e 61  |HN!; ...and fina|
000152d0  6c 6c 79 20 4d 65 6e 75  20 69 74 65 6d 20 23 36  |lly Menu item #6|
000152e0  0d 48 58 34 20 20 20 20  20 20 20 20 20 20 20 20  |.HX4            |
000152f0  20 20 20 20 45 51 55 44  20 20 20 20 26 38 30 20  |    EQUD    &80 |
00015300  20 20 20 20 3b 20 4c 61  73 74 20 6d 65 6e 75 20  |    ; Last menu |
00015310  69 74 65 6d 0d 48 62 46  2e 6d 75 6c 74 69 71 75  |item.HbF.multiqu|
00015320  69 74 70 6f 6b 65 20 20  45 51 55 44 20 20 20 20  |itpoke  EQUD    |
00015330  30 20 20 20 20 20 20 20  3b 20 51 75 69 74 20 73  |0       ; Quit s|
00015340  75 62 2d 6d 65 6e 75 20  61 64 64 72 20 70 6f 6b  |ub-menu addr pok|
00015350  65 64 20 69 6e 20 68 65  72 65 0d 48 6c 44 20 20  |ed in here.HlD  |
00015360  20 20 20 20 20 20 20 20  20 20 20 20 20 20 45 51  |              EQ|
00015370  55 44 20 20 20 20 28 37  3c 3c 32 34 29 20 84 20  |UD    (7<<24) . |
00015380  31 20 3b 20 49 74 65 6d  20 68 61 73 20 74 65 78  |1 ; Item has tex|
00015390  74 20 61 6e 64 20 69 73  20 62 6c 61 63 6b 0d 48  |t and is black.H|
000153a0  76 3f 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |v?              |
000153b0  20 20 45 51 55 53 20 20  20 20 22 51 75 69 74 20  |  EQUS    "Quit |
000153c0  20 20 20 20 20 20 22 2b  62 6c 24 20 20 20 20 20  |      "+bl$     |
000153d0  20 20 3b 20 4d 65 6e 75  20 69 74 65 6d 0d 48 80  |  ; Menu item.H.|
000153e0  26 3b 20 4e 6f 77 20 66  6f 72 20 74 68 65 20 51  |&; Now for the Q|
000153f0  75 69 74 20 6f 70 74 69  6f 6e 20 73 75 62 2d 6d  |uit option sub-m|
00015400  65 6e 75 0d 48 8a 37 2e  6d 75 6c 74 69 71 75 69  |enu.H.7.multiqui|
00015410  74 61 64 64 72 20 20 45  51 55 53 20 20 20 20 22  |taddr  EQUS    "|
00015420  51 75 69 74 22 2b c4 38  2c 62 6c 24 29 20 3b 20  |Quit"+.8,bl$) ; |
00015430  4d 65 6e 75 20 74 69 74  6c 65 0d 48 94 45 20 20  |Menu title.H.E  |
00015440  20 20 20 20 20 20 20 20  20 20 20 20 20 20 45 51  |              EQ|
00015450  55 42 20 20 20 20 37 20  20 20 20 20 20 20 3b 20  |UB    7       ; |
00015460  46 6f 72 65 67 72 6f 75  6e 64 20 3d 20 37 20 28  |Foreground = 7 (|
00015470  6e 6f 72 6d 61 6c 6c 79  20 62 6c 61 63 6b 29 0d  |normally black).|
00015480  48 9e 44 20 20 20 20 20  20 20 20 20 20 20 20 20  |H.D             |
00015490  20 20 20 45 51 55 42 20  20 20 20 32 20 20 20 20  |   EQUB    2    |
000154a0  20 20 20 3b 20 42 61 63  6b 67 72 6f 75 6e 64 20  |   ; Background |
000154b0  3d 20 32 20 28 6e 6f 72  6d 61 6c 6c 79 20 67 72  |= 2 (normally gr|
000154c0  65 79 29 0d 48 a8 45 20  20 20 20 20 20 20 20 20  |ey).H.E         |
000154d0  20 20 20 20 20 20 20 45  51 55 42 20 20 20 20 37  |       EQUB    7|
000154e0  20 20 20 20 20 20 20 3b  20 57 6f 72 6b 20 66 6f  |       ; Work fo|
000154f0  72 65 20 20 3d 20 37 20  28 6e 6f 72 6d 61 6c 6c  |re  = 7 (normall|
00015500  79 20 62 6c 61 63 6b 29  0d 48 b2 45 20 20 20 20  |y black).H.E    |
00015510  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 42  |            EQUB|
00015520  20 20 20 20 30 20 20 20  20 20 20 20 3b 20 57 6f  |    0       ; Wo|
00015530  72 6b 20 62 61 63 6b 20  20 3d 20 30 20 28 6e 6f  |rk back  = 0 (no|
00015540  72 6d 61 6c 6c 79 20 77  68 69 74 65 29 0d 48 bc  |rmally white).H.|
00015550  3f 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |?               |
00015560  20 45 51 55 44 20 20 20  20 31 35 36 20 20 20 20  | EQUD    156    |
00015570  20 3b 20 54 6f 74 61 6c  20 77 69 64 74 68 20 6f  | ; Total width o|
00015580  66 20 6d 65 6e 75 20 69  74 65 6d 73 0d 48 c6 40  |f menu items.H.@|
00015590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000155a0  45 51 55 44 20 20 20 20  34 34 20 20 20 20 20 20  |EQUD    44      |
000155b0  3b 20 54 6f 74 61 6c 20  68 65 69 67 68 74 20 6f  |; Total height o|
000155c0  66 20 6d 65 6e 75 20 69  74 65 6d 73 0d 48 d0 40  |f menu items.H.@|
000155d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000155e0  45 51 55 44 20 20 20 20  30 20 20 20 20 20 20 20  |EQUD    0       |
000155f0  3b 20 4c 69 6e 65 20 73  70 61 63 69 6e 67 20 62  |; Line spacing b|
00015600  65 74 77 65 65 6e 20 69  74 65 6d 73 0d 48 da 12  |etween items.H..|
00015610  3b 20 4d 65 6e 75 20 69  74 65 6d 20 23 31 0d 48  |; Menu item #1.H|
00015620  e4 35 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.5              |
00015630  20 20 45 51 55 44 20 20  20 20 30 20 20 20 20 20  |  EQUD    0     |
00015640  20 20 3b 20 4e 6f 74 68  69 6e 67 20 73 70 65 63  |  ; Nothing spec|
00015650  69 61 6c 0d 48 ee 31 20  20 20 20 20 20 20 20 20  |ial.H.1         |
00015660  20 20 20 20 20 20 20 45  51 55 44 20 20 20 20 2d  |       EQUD    -|
00015670  31 20 20 20 20 20 20 3b  20 4e 6f 20 73 75 62 2d  |1      ; No sub-|
00015680  6d 65 6e 75 0d 48 f8 44  20 20 20 20 20 20 20 20  |menu.H.D        |
00015690  20 20 20 20 20 20 20 20  45 51 55 44 20 20 20 20  |        EQUD    |
000156a0  28 37 3c 3c 32 34 29 20  84 20 31 20 3b 20 49 74  |(7<<24) . 1 ; It|
000156b0  65 6d 20 68 61 73 20 74  65 78 74 20 61 6e 64 20  |em has text and |
000156c0  69 73 20 62 6c 61 63 6b  0d 49 02 2d 20 20 20 20  |is black.I.-    |
000156d0  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 53  |            EQUS|
000156e0  20 20 20 20 22 54 65 6d  70 6f 72 61 72 79 20 20  |    "Temporary  |
000156f0  22 2b 62 6c 24 0d 49 0c  12 3b 20 4d 65 6e 75 20  |"+bl$.I..; Menu |
00015700  69 74 65 6d 20 23 32 0d  49 16 34 20 20 20 20 20  |item #2.I.4     |
00015710  20 20 20 20 20 20 20 20  20 20 20 45 51 55 44 20  |           EQUD |
00015720  20 20 20 26 38 30 20 20  20 20 20 3b 20 4c 61 73  |   &80     ; Las|
00015730  74 20 6d 65 6e 75 20 69  74 65 6d 0d 49 20 31 20  |t menu item.I 1 |
00015740  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 45  |               E|
00015750  51 55 44 20 20 20 20 2d  31 20 20 20 20 20 20 3b  |QUD    -1      ;|
00015760  20 4e 6f 20 73 75 62 2d  6d 65 6e 75 0d 49 2a 44  | No sub-menu.I*D|
00015770  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015780  45 51 55 44 20 20 20 20  28 37 3c 3c 32 34 29 20  |EQUD    (7<<24) |
00015790  84 20 31 20 3b 20 49 74  65 6d 20 68 61 73 20 74  |. 1 ; Item has t|
000157a0  65 78 74 20 61 6e 64 20  69 73 20 62 6c 61 63 6b  |ext and is black|
000157b0  0d 49 34 2d 20 20 20 20  20 20 20 20 20 20 20 20  |.I4-            |
000157c0  20 20 20 20 45 51 55 53  20 20 20 20 22 50 65 72  |    EQUS    "Per|
000157d0  6d 61 6e 65 6e 74 20 20  22 2b 62 6c 24 0d 49 3e  |manent  "+bl$.I>|
000157e0  06 5d ed 0d 49 48 04 0d  49 52 20 f4 20 53 61 76  |.]..IH..IR . Sav|
000157f0  65 20 61 73 20 61 20 6d  6f 64 75 6c 65 20 21 52  |e as a module !R|
00015800  75 6e 49 6d 61 67 65 0d  49 5c 1b 46 24 3d 22 24  |unImage.I\.F$="$|
00015810  2e 21 54 72 61 73 68 2e  21 52 75 6e 49 6d 61 67  |.!Trash.!RunImag|
00015820  65 22 0d 49 66 23 c8 99  20 22 4f 53 5f 46 69 6c  |e".If#.. "OS_Fil|
00015830  65 22 2c 26 41 2c 46 24  2c 26 46 46 41 2c 2c 6f  |e",&A,F$,&FFA,,o|
00015840  72 67 2c 50 25 0d 49 70  05 e0 0d 49 7a 04 0d 49  |rg,P%.Ip...Iz..I|
00015850  84 4c f4 20 4f 4b 2c 20  49 20 63 6f 75 6c 64 20  |.L. OK, I could |
00015860  63 68 61 6e 67 65 20 40  25 2c 20 62 75 74 20 63  |change @%, but c|
00015870  61 6e 20 59 4f 55 20 75  6e 64 65 72 73 74 61 6e  |an YOU understan|
00015880  64 20 74 68 65 20 76 61  72 69 6f 75 73 20 62 69  |d the various bi|
00015890  74 73 20 6f 66 20 40 25  20 3f 0d 49 8e 47 f4 20  |ts of @% ?.I.G. |
000158a0  57 68 79 20 6f 6e 20 65  61 72 74 68 20 64 69 64  |Why on earth did|
000158b0  6e 27 74 20 52 6f 67 65  72 20 70 75 74 20 6e 65  |n't Roger put ne|
000158c0  77 20 46 49 45 4c 44 2c  50 4c 41 43 45 53 20 65  |w FIELD,PLACES e|
000158d0  74 63 2e 20 6b 65 79 77  6f 72 64 73 20 69 6e 20  |tc. keywords in |
000158e0  3f 0d 49 98 36 dd a4 66  72 61 63 74 69 6f 6e 28  |?.I.6..fraction(|
000158f0  56 25 29 3d c3 28 56 25  20 81 20 31 30 30 29 2b  |V%)=.(V% . 100)+|
00015900  22 2e 22 2b c2 22 30 22  2b c3 28 56 25 20 83 20  |"."+."0"+.(V% . |
00015910  31 30 30 29 2c 32 29 0d  ff                       |100),2)..|
00015919