Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199609.adf » Regulars » StarInfo/Tanner/!FileTypes/CDtype

StarInfo/Tanner/!FileTypes/CDtype

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 » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199609.adf » Regulars
Filename: StarInfo/Tanner/!FileTypes/CDtype
Read OK:
File size: 3D27 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >CDType
   20REM
   30REM Original by: Martin Sperl
   40REM              Nattergasse 12/32
   50REM              A-1170 Vienna
   60REM              Austria
   70REM
   80REM Contact:     Fido   : 2:313/16.6
   90REM              E-Mail : Sperl@Astro1.auniw.ac.at
  100REM
  110REM Significantly changed by Mike Martin ( Softcorn )
  120REM Now allows lots of filetypes to be defined. It achieves this by re-writing
  130REM the whole of Acorn's function for "CDFS_GiveFileType".
  140REM
  150REM 5 Feb 96
  160REM Seriously hacked by Tom Tanner (ttehtann@argonet.co.uk)
  170REM Allows huge numbers of translations on RiscOS 3.50 by placing table in a
  180REM dynamic area. Also fixed a few problems with full tables, and tweaked the
  190REM code a bit (well, OK, a lot) to allow more translations for older versions
  200REM of RISCOS.
  210REM Added a call to set up list = DOS map
  220REM If a translation already exists with the "-Add" option, it is replaced by
  230REM the new version.
  240
  250REM
  260REM This Program may be copied freely as long as the above lines
  270REM _are_ included.
  280
  290REM *** TO DO
  300REM Grow area with new .EXT
  310REM Shrink area with deletion
  320
  330REM Number of translations for R/OS 3.5+
  331REM This is how many I can fit in one small dynamic area!
  340max_trans% = 4096 / 8 - 1
  350
  360REM Get OS Version number (this is a useful variable, but not well documented)
  370DIM OsVersion% 4
  380SYS "OS_ReadVarVal", "SYS$OSVersion", OsVersion%, 4, 0, 0 TO , , C%, , E%
  390IF C% <> 0 AND E% = 1
  400   OsVersion% = !OsVersion%
  410ELSE
  420   OsVersion% = 0
  430ENDIF
  440
  450
  460REM setup presets for different CDFS versions
  470REM i.e. offsets/values in virgin CDFS
  480REM if yours is not in the list below you probably only have to set
  490REM  add the correct values for your version.
  500numb_vers%=2
  510DIM version$(numb_vers%)
  520DIM codeoff%(numb_vers%)
  530DIM endlstoff%(numb_vers%)
  540DIM workspcoff%(numb_vers%)
  550DIM first_opcode%(numb_vers%)
  560DIM numbtrans%(numb_vers%)
  570DIM nameoff%(numb_vers%)
  580
  590REM setup for CDFS2.20
  600version$(0)      = "CDFS2.20 (23 Sep 1993)"
  610codeoff%(0)      = &2DF0     : REM offset of start of CDFS_GiveFileType code.
  620endlstoff%(0)    = &3088     : REM end of translation list (after RiscOS hex).
  630workspcoff%(0)   = &3204     : REM offset of Word holding workspace offset.
  640first_opcode%(0) = &E92D000F : REM value of first opcode in CDFS_GiveFileType.
  650numbtrans%(0)    = 8         : REM number of entries in modules translate table.
  660nameoff%(0)      = &3064     : REM offset of start of DOS name part of table.
  670
  680REM setup for CDFS2.21  (actually, identical to 2.20)
  690version$(1)      = "CDFS2.21 (02 Feb 1994)"
  700codeoff%(1)      = &2DF0
  710endlstoff%(1)    = &3088
  720workspcoff%(1)   = &3204
  730first_opcode%(1) = &E92D000F
  740numbtrans%(1)    = 8
  750nameoff%(1)      = &3064
  760
  770
  780CDFS_Base_Addr% = FNgetbaseCDFS    : REM absolute address of start of module.
  790
  800REM find CDFS version & set up default parameters accordingly
  810CDFS_Version$ = ""
  820vers% = 0
  830REPEAT
  840  IF FNcheckVersCDFS(CDFS_Base_Addr% + CDFS_Base_Addr%!20, version$(vers%)) THEN
  850     CDFS_Version$                      = version$(vers%)
  860     CDFS_GiveFileType_Code_Off%        = codeoff%(vers%)
  870     CDFS_GiveFileType_EndList_Off%     = endlstoff%(vers%)
  880     CDFS_Workspace_Off%                = workspcoff%(vers%)
  890     CDFS_GiveFileType_Orig_Opcode%     = first_opcode%(vers%)
  900     CDFS_GiveFileType_Num_Trans%       = numbtrans%(vers%)
  910     CDFS_GiveFileType_DOS_Ext_Addr%    = CDFS_Base_Addr% + nameoff%(vers%)
  920  ELSE
  930     vers% += 1
  940  ENDIF
  950UNTIL (CDFS_Version$ <> "") OR (vers% = numb_vers%)
  960IF (CDFS_Version$ = "") THEN ERROR EXT 27, "CDFS-Version not supported":END
  970
  980REM now we have setup correct presets we can start program proper
  990DIM Data 256
 1000DIM Com$(3)
 1010
 1020IF FNvirginCDFS THEN
 1030   PROCmakecode
 1040   PROCstandard
 1050ELSE
 1060   PROC_get_patch_pointers
 1070ENDIF
 1080
 1090
 1100REM get any command string & put in
 1110REM com$(0) = command
 1120REM com$(1) = option1 [optional]
 1130REM com$(2) = option2 [optional]
 1140PROCgetCommand
 1150
 1160CASE LEFT$(Com$(0),2) OF
 1170  WHEN "-S":PROCstandard
 1180  WHEN "-D":PROC_dosmap
 1190  WHEN "-U":PROCUser(Com$(1))
 1200  WHEN "-A":PROCAdd(Com$(1),Com$(2))
 1210  WHEN "-R":PROCRemove(Com$(1))
 1220  WHEN "-C":PROCClear
 1230  WHEN "-L":PROCList
 1240  OTHERWISE
 1250     PRINT "Wrong Option ..."
 1260     PROCUsage
 1270ENDCASE
 1280
 1290END
 1300
 1310
 1320DEF FNvirginCDFS
 1330= (CDFS_Base_Addr%!CDFS_GiveFileType_Code_Off% = CDFS_GiveFileType_Orig_Opcode%)
 1340
 1350
 1360REM set file translations to default
 1370DEF PROCstandard
 1380RESTORE 1490
 1390LOCAL I%, Count, DosTyp$, ArchiTyp$
 1400  READ Count
 1410  IF Count > CDFS_GiveFileType_Num_Trans% THEN
 1420     Count = CDFS_GiveFileType_Num_Trans%
 1430  ENDIF
 1440  FOR I% = 0 TO Count - 1
 1450    READ DosTyp$, ArchiTyp$
 1460    PROCSetTrans(I%, DosTyp$, ArchiTyp$)
 1470  NEXT I%
 1480  PROCSetTrans(Count, "", "000")
 1490  DATA 8
 1500  DATA "DOC","FFF"
 1510  DATA "TXT","FFF"
 1520  DATA "BAT","FDA"
 1530  DATA "EXE","FD9"
 1540  DATA "BIN","FFD"
 1550  DATA "TIF","FF0"
 1560  DATA "COM","FD8"
 1570  DATA "PCD","BE8"
 1580ENDPROC
 1590
 1600DEF PROCSetTrans(I%, A$, B$)
 1610WHILE RIGHT$(A$, 1) = " "
 1620      A$ = LEFT$(A$, LEN(A$) - 1)
 1630ENDWHILE
 1640$Data=LEFT$(A$ + CHR$(0) + CHR$(0) + CHR$(0), 3) + CHR$(0)
 1650SYS "OS_FSControl", 31, B$ TO , , Type%
 1660CDFS_GiveFileType_DOS_Ext_Addr%!(I% * 8) = !Data
 1670CDFS_GiveFileType_DOS_Ext_Addr%!(I% * 8 + 4) = Type%
 1680ENDPROC
 1690
 1700DEF FNGetTransDos(I%)
 1710LOCAL A$, J%
 1720J% = CDFS_GiveFileType_DOS_Ext_Addr% + I% * 8
 1730A$ = ""
 1740WHILE ?J% > 31 AND LEN(A$) <= 4
 1750  A$ += CHR$(?J%)
 1760  J% += 1
 1770ENDWHILE
 1780=A$
 1790
 1800DEF FNGetTransArchi(I%)
 1810=CDFS_GiveFileType_DOS_Ext_Addr%!(I% * 8 + 4)
 1820
 1830DEF FNTranslate(I%)
 1840LOCAL t1%, t2%, J%
 1850J% = FNGetTransArchi(I%)
 1860SYS "OS_FSControl", 18, , J% TO , , t1%, t2%
 1870Data!0 = t1%  
 1880Data!4 = t2%
 1890Data?8 = 13
 1900=$Data
 1910
 1920
 1930REM add a new filetype translation
 1940DEF PROCAdd(A$, B$)
 1950LOCAL C$
 1960IF A$="" OR B$="" THEN PRINT "Wrong number of arguments - 2 needed !!!":ENDPROC
 1970LOCAL I%
 1980I% = 0
 1990C$ = FNGetTransDos(I%)
 2000WHILE C$ <> "" AND C$ <> A$
 2010      I% += 1 
 2020      C$ = FNGetTransDos(I%)
 2030ENDWHILE
 2040IF I% < CDFS_GiveFileType_Num_Trans% THEN
 2050   PROCSetTrans(I%, A$, B$)
 2060   PROCSetTrans(I% + 1, "", "&000")
 2070ELSE
 2080   PRINT "Sorry only " + STR$(CDFS_GiveFileType_Num_Trans%) + " Translations possible !!!"
 2090ENDIF
 2100ENDPROC
 2110
 2120DEF PROCClear
 2130PROCSetTrans(0, "", "&000")
 2140ENDPROC
 2150
 2160DEF PROCRemove(A$)
 2170IF A$="" THEN PRINT "Wrong number of arguments - 1 needed !!!":ENDPROC
 2180LOCAL I%, B$, C%, D$
 2190I% = 0
 2200B$ = FNGetTransDos(I%)
 2210WHILE (B$ <> "" AND B$ <> A$)
 2220      I% += 1
 2230      B$ = FNGetTransDos(I%)
 2240ENDWHILE
 2250IF B$ = "" THEN
 2260   PRINT "Dos type " + A$ + " not found in translation table"
 2270ELSE
 2280   REPEAT
 2290         C$ = FNGetTransDos(I% + 1)
 2300         D$ = FNTranslate(I% + 1)
 2310         PROCSetTrans(I%, C$, D$)
 2320         I% += 1
 2330   UNTIL C$=""
 2340ENDIF
 2350ENDPROC
 2360
 2370DEF PROCUser(File$)
 2380IF File$="" THEN PRINT "Wrong number of arguments - 1 needed !!!":ENDPROC
 2390A% = OPENIN(File$)
 2400IF A% = 0 THEN PRINT "File "+File$+" does not exist !!!":ENDPROC
 2410J% = 0
 2420REPEAT
 2430  A$ = GET$#A%
 2440  WHILE LEFT$(A$, 1) = " "
 2450    A$ = MID$(A$, 2)
 2460  ENDWHILE
 2470  B$ = ""
 2480  I% = 1
 2490  REPEAT
 2500    B$ += MID$(A$, I%, 1)
 2510    I% += 1
 2520  UNTIL MID$(A$ + " ", I%, 1) = " "
 2530  B$ = LEFT$(B$ + "   ", 3)
 2540  C$ = ""
 2550  REPEAT
 2560    I% += 1
 2570  UNTIL MID$(A$ + "*", I%, 1) > " "
 2580  REPEAT
 2590    C$ += MID$(A$, I%, 1)
 2600    I% += 1
 2610  UNTIL MID$(A$ + " ", I%) = " "
 2620  IF J% < CDFS_GiveFileType_Num_Trans% THEN
 2630    PROCSetTrans(J%, B$, C$)
 2640    J% += 1
 2650  ELSE
 2660    PRINT "Sorry only " + STR$CDFS_GiveFileType_Num_Trans% + " Translations possible !!!" : PTR#A%=EXT#A%
 2670  ENDIF
 2680UNTIL EOF#A%
 2690PROCSetTrans(J%, "", "&000")
 2700CLOSE#A%
 2710ENDPROC
 2720
 2730DEF PROCList
 2740LOCAL K%
 2750K%=0
 2760PRINT
 2770PRINT "    CDFS type translation    "
 2780PRINT "    Number  Dos      RiscOS  "
 2790PRINT "-----------------------------"
 2800WHILE (FNGetTransDos(K%) <> "")
 2810    PRINT K%, LEFT$("  " + FNGetTransDos(K%) + STRING$(11, " "), 11) + FNTranslate(K%)
 2820    K% += 1
 2830ENDWHILE
 2840IF K% = 0 THEN PRINT "No translations!!!"
 2850ENDPROC
 2860
 2870DEF PROCmakecode
 2880LOCAL pass%, code%, endlists%
 2890code%     = CDFS_Base_Addr% + CDFS_GiveFileType_Code_Off%
 2900endlists% = CDFS_Base_Addr% + CDFS_GiveFileType_EndList_Off%
 2910
 2920FOR pass% = 0 TO 2 STEP 2
 2930    P% = code%
 2940    [ opt pass%
 2950
 2960; on entry
 2970; R0 = pointer to filename with terminating 0
 2980; R12 = private word
 2990
 3000          MOV       PC, R14                       ; Only included initially in
 3010                                                  ; case a call is made in the
 3020                                                  ; middle of me generating code
 3030                                                  ; After all code is generated
 3040                                                  ; it is changed to B newstart
 3050
 3060.ntrans%  EQUD      CDFS_GiveFileType_Num_Trans%  ; items in translation list
 3070.extoff%  EQUD      CDFS_GiveFileType_DOS_Ext_Off%; offset of extension list
 3080.dynarea% EQUD      0                             ; dynamic area (or 0)
 3090.codeof1% EQUD      CDFS_GiveFileType_Code_Off%   ; Address of code in module
 3100
 3110.newstart STMDB     R13!, {R0-R1}
 3120          LDR       R1, CDFS_Base_Addr% + CDFS_Workspace_Off%
 3130          ADD       R1, R1, R12
 3140          MOV       R11, R1                       ; R11 = private workspace
 3150          LDMIA     R13!, {R0-R1}
 3160
 3170; get filename extension
 3180          MOV       R3, R0
 3190
 3200.loop1    LDRB      R1, [R3], #1
 3210          CMP       R1, #0
 3220          LDMEQIA   R13!, {R0-R9,R14}
 3230          MOVEQ     R1, #0                        ; Just been wiped out
 3240          BICEQS    PC, R14, #&10000000           ; exit if null filename or no
 3250                                                  ; extension
 3260          TEQ       R1, #ASC"."
 3270          BNE       loop1
 3280          MOV       R7, R3
 3290
 3300; R3 points to start of extension (after the ".")
 3310; Calculate 4 byte extension word in R0
 3320          MOV       R0, #0
 3330          MOV       R2, #0
 3340
 3350.loop2    LDRB      R1, [R7], #1
 3380          RSBS      R4, R1, #ASC"a"               ; 'a' <= R1
 3390          CMPLE     R1, #ASC"z"                   ; & R1 <= 'z'
 3400          SUBLE     R1, R1, #(ASC"a"-ASC"A")
 3410          ADD       R0, R0, R1, LSL R2            ; Insert byte (backwards!)
 3420          ADD       R2, R2, #8
 3440
 3441          CMP       R1, #0
 3450          BNE       loop2
 3460
 3470; R3 = start of extension
 3480; R7 = end of extension + 1 byte (i.e. the null)
 3490          SUB       R7, R7, R3                    ; Length of extension + 1.
 3500                                                  ; 2 to 4 are valid
 3510          RSBS      R1, R7, #2                    ; 2 <= R7
 3520          CMPLE     R7, #4                        ; & R7 <= 4
 3530          LDMGTIA   R13!, {R0-R9, R14}
 3540          MOVGT     R1, #0
 3550          BICGTS    PC, R14, #&10000000           ; exit if extension is more
 3560                                                  ; than 3 characters
 3570
 3580; now see if it can be found in extension list
 3590          LDR       R4, extoff%                   ; Address of extension list
 3600          LDR       R6, dynarea%                  ; start of code
 3610          CMP       R6, #0
 3620          ADREQ     R6, code%                     ; Needs relocating
 3630          LDREQ     R7, codeof1%                  ; Offset of code from start
 3640          SUBEQ     R6, R6, R7
 3650          ADD       R4, R4, R6                    ; Start of list
 3660
 3670.nxt_ext  LDMIA     R4!, {R9, R10}
 3680          CMP       R0, R9
 3690          BEQ       found
 3700          CMP       R9, #0
 3710          BNE       nxt_ext
 3720
 3730
 3740          LDMIA     R13!, {R0-R9, R14}
 3750          MOV       R1,#0
 3760          BICS      PC, R14, #&10000000           ; Exit if not found in list
 3770
 3780
 3790; If you get here, R10 is the file type
 3800
 3810.found    LDMIA     R13!, {R0-R9, R14}
 3820          MOV       R1, R10
 3830          BICS      PC, R14, #&10000000           ; Tatty bye
 3840
 3850.end_of_code%
 3860           ;start of list of extensions, terminated by word=0
 3870
 3880    ]
 3890
 3900    REM Remember to allow room for the null terminator
 3910    CDFS_GiveFileType_Num_Trans%   = (endlists% - end_of_code%) / 8 - 1
 3920    CDFS_GiveFileType_DOS_Ext_Off% = end_of_code% - CDFS_Base_Addr%
 3930NEXT
 3940
 3950REM If we are ROS3.5, use a dynamic area.
 3960IF OsVersion% >= 350 THEN
 3970   CDFS_GiveFileType_Num_Trans% = max_trans%
 3980   !ntrans% = max_trans%
 3990   !extoff% = 0
 4000   SYS "OS_DynamicArea", 0, -1, (max_trans% + 1) * 8, -1, 1 << 7, (max_trans% + 1) * 8, 0, 0, "CD Translations" + CHR$0 TO , !codeof1%, , !dynarea%
 4010ENDIF
 4020
 4030REM now all code is generated allow it to be entered
 4040FOR pass% = 0 TO 2 STEP 2
 4050    P% = code%
 4060    [ opt pass%
 4070          B     newstart
 4080    ]
 4090NEXT
 4100
 4110REM Set up base pointers
 4120PROC_get_patch_pointers
 4130ENDPROC
 4140
 4150
 4160DEF FNgetbaseCDFS
 4170LOCAL CDFS_Base_Addr%
 4180SYS "XOS_Module", 18, "CDFS" TO , , , CDFS_Base_Addr%;flag%
 4190IF flag% AND 1 THEN ERROR EXT 27,"Module CDFS does not exist !!!"
 4200= CDFS_Base_Addr%
 4210
 4220
 4230DEF FNcheckVersCDFS(VersPtr%, VersNeeded$)
 4240LOCAL CurrVers$
 4250CurrVers$ = ""
 4260REPEAT
 4270    IF (?VersPtr%) > 31 THEN
 4280      CurrVers$ += CHR$(?VersPtr%)
 4290    ENDIF
 4300    VersPtr% += 1
 4310UNTIL ?VersPtr% = 0
 4320= (CurrVers$ = VersNeeded$)
 4330
 4340
 4350REM get any command string & put in
 4360REM com$(0) = command
 4370REM com$(1) = option1 [optionlal]
 4380REM com$(2) = option2 [optional]
 4390DEF PROCgetCommand
 4400LOCAL I%, J%, found%, Env$
 4410  SYS "OS_GetEnv" TO I%
 4420  found%=0
 4430  REPEAT
 4440    IF ?I%=34 THEN found%+=1
 4450    I%+=1
 4460  UNTIL (found%=2)OR(?I%=0)
 4470  I%+=1
 4480  IF ?I%=0 THEN PROCUsage:END
 4490  Env$=""
 4500  REPEAT
 4510    IF (?I%<123 AND ?I%>96) THEN ?I%=?I% AND %11011111
 4520    Env$+=CHR$(?I%)
 4530    I%+=1
 4540  UNTIL ?I%=0
 4550  I%=0
 4560  REPEAT
 4570    J%=INSTR(Env$," ")
 4580    IF J%<>0 THEN
 4590      Com$(I%)=LEFT$(Env$,J%)
 4600      Env$=MID$(Env$,J%+1)
 4610      I%+=1
 4620    ELSE
 4630      Com$(I%)=Env$
 4640      I%=-1
 4650    ENDIF
 4660  UNTIL I%=-1 OR I%>3
 4670ENDPROC
 4680
 4690DEF PROC_get_patch_pointers
 4700REM my code in CDFS so get list's length & pointers that I saved on generation
 4710CDFS_GiveFileType_Num_Trans% = CDFS_Base_Addr%!(CDFS_GiveFileType_Code_Off% + 4)
 4720IF CDFS_Base_Addr%!(CDFS_GiveFileType_Code_Off% + 12) = 0 THEN
 4730   CDFS_GiveFileType_DOS_Ext_Addr% = CDFS_Base_Addr%!(CDFS_GiveFileType_Code_Off% + 8)
 4740   CDFS_GiveFileType_DOS_Ext_Addr% += CDFS_Base_Addr%
 4750ELSE
 4760   CDFS_GiveFileType_DOS_Ext_Addr% = CDFS_Base_Addr%!(CDFS_GiveFileType_Code_Off% + 12)
 4770   CDFS_GiveFileType_Dynamic_Area% = CDFS_Base_Addr%!(CDFS_GiveFileType_Code_Off% + 16)
 4780ENDIF
 4790ENDPROC
 4800
 4810
 4820DEFPROCUsage
 4830PRINT "CDType <command> [options]"
 4840PRINT "Where <Command> may be:"
 4850PRINT "-Standard            - Reset CDFS translation table"
 4860PRINT "-Dosmap              - Set CDFS translation table to"
 4870PRINT "                        DOSMAP mappings"
 4880PRINT "-User [<file>]       - Set CDFS user translation table"
 4890PRINT "                        to table in <file>"
 4900PRINT "-Add <Dos> <RiscOS>  - Add a translation:- "
 4910PRINT "                        <DosType> to <RiscOSType>"
 4920PRINT "-Remove <DosType>    - Remove <DosType> from"
 4930PRINT "                        translation table"
 4940PRINT "-Clear               - Clear the translation table"
 4950PRINT "-List                - List translation table"
 4960PRINT
 4970ENDPROC
 4980
 4990DEF PROC_dosmap
 5000LOCAL C%, I%, A%, J%, A$, B$
 5010REM Use the "DOSMAP" mappings to set the translation table
 5020OSCLI"REMOVE <Wimp$Scrap>"
 5030OSCLI"DOSMAP { > <Wimp$Scrap> }"
 5031PROCSetTrans(J%, "", "&000") : REM Just in case nothing there
 5040C% = OPENIN("<Wimp$Scrap>")
 5050IF C% = 0 THEN ENDPROC
 5060IF EOF#C% THEN CLOSE#C% : ENDPROC
 5070REPEAT : UNTIL BGET#C% = &0A
 5071IF EOF#C% THEN CLOSE#C% : ENDPROC
 5080REPEAT : UNTIL BGET#C% = &0A
 5090J% = 0
 5100REPEAT
 5110   FOR I% = 1 TO 5 : A% = BGET#C% : NEXT
 5120   A$ = ""
 5130   B$ = ""
 5140   FOR I% = 1 TO 3
 5150       A$ += CHR$ BGET#C%
 5160   NEXT
 5170   FOR I% = 1 TO 7 : A% = BGET#C% : NEXT
 5180   FOR I% = 1 TO 8
 5190       B$ += CHR$ BGET#C%
 5200   NEXT
 5210   REPEAT : UNTIL BGET#C% = &0A
 5220   IF A$ <> "---" THEN
 5230      IF J% < CDFS_GiveFileType_Num_Trans% THEN
 5240         PROCSetTrans(J%, A$, B$)
 5250         J% += 1
 5260      ELSE
 5270         PRINT "Sorry only " + STR$CDFS_GiveFileType_Num_Trans% + " Translations possible !!!"
 5280         PTR#C% = EXT#C%
 5290      ENDIF
 5300   ENDIF
 5310UNTIL EOF#C%
 5320PROCSetTrans(J%, "", "&000")
 5330CLOSE#C%
 5340ENDPROC


� >CDType
�
� Original by: Martin Sperl
($�              Nattergasse 12/32
2 �              A-1170 Vienna
<�              Austria
F�
P&� Contact:     Fido   : 2:313/16.6
Z4�              E-Mail : Sperl@Astro1.auniw.ac.at
d�
n7� Significantly changed by Mike Martin ( Softcorn )
xP� Now allows lots of filetypes to be defined. It achieves this by re-writing
�<� the whole of Acorn's function for "CDFS_GiveFileType".
��
�� 5 Feb 96
�=� Seriously hacked by Tom Tanner (ttehtann@argonet.co.uk)
�N� Allows huge numbers of translations on RiscOS 3.50 by placing table in a
�O� dynamic area. Also fixed a few problems with full tables, and tweaked the
�P� code a bit (well, OK, a lot) to allow more translations for older versions
�� of RISCOS.
�+� Added a call to set up list = DOS map
�O� If a translation already exists with the "-Add" option, it is replaced by
�� the new version.
�
��
B� This Program may be copied freely as long as the above lines
� _are_ included.

"� *** TO DO
,� Grow area with new .EXT
6� Shrink area with deletion
@
J*� Number of translations for R/OS 3.5+
K;� This is how many I can fit in one small dynamic area!
Tmax_trans% = 4096 / 8 - 1
^
hP� Get OS Version number (this is a useful variable, but not well documented)
r� OsVersion% 4
|Kș "OS_ReadVarVal", "SYS$OSVersion", OsVersion%, 4, 0, 0 � , , C%, , E%
�� C% <> 0 � E% = 1
�   OsVersion% = !OsVersion%
��
�   OsVersion% = 0
��
�
�
�/� setup presets for different CDFS versions
�(� i.e. offsets/values in virgin CDFS
�E� if yours is not in the list below you probably only have to set
�/�  add the correct values for your version.
�numb_vers%=2
�� version$(numb_vers%)
� codeoff%(numb_vers%)
� endlstoff%(numb_vers%)
� workspcoff%(numb_vers%)
&� first_opcode%(numb_vers%)
0� numbtrans%(numb_vers%)
:� nameoff%(numb_vers%)
D
N� setup for CDFS2.20
X/version$(0)      = "CDFS2.20 (23 Sep 1993)"
bOcodeoff%(0)      = &2DF0     : � offset of start of CDFS_GiveFileType code.
lPendlstoff%(0)    = &3088     : � end of translation list (after RiscOS hex).
vMworkspcoff%(0)   = &3204     : � offset of Word holding workspace offset.
�Pfirst_opcode%(0) = &E92D000F : � value of first opcode in CDFS_GiveFileType.
�Rnumbtrans%(0)    = 8         : � number of entries in modules translate table.
�Onameoff%(0)      = &3064     : � offset of start of DOS name part of table.
�
�7� setup for CDFS2.21  (actually, identical to 2.20)
�/version$(1)      = "CDFS2.21 (02 Feb 1994)"
�codeoff%(1)      = &2DF0
�endlstoff%(1)    = &3088
�workspcoff%(1)   = &3204
� first_opcode%(1) = &E92D000F
�numbtrans%(1)    = 8
�nameoff%(1)      = &3064
�

NCDFS_Base_Addr% = �getbaseCDFS    : � absolute address of start of module.

 ?� find CDFS version & set up default parameters accordingly
*CDFS_Version$ = ""
4
vers% = 0
>�
HO  � �checkVersCDFS(CDFS_Base_Addr% + CDFS_Base_Addr%!20, version$(vers%)) �
R=     CDFS_Version$                      = version$(vers%)
\=     CDFS_GiveFileType_Code_Off%        = codeoff%(vers%)
f?     CDFS_GiveFileType_EndList_Off%     = endlstoff%(vers%)
p@     CDFS_Workspace_Off%                = workspcoff%(vers%)
zB     CDFS_GiveFileType_Orig_Opcode%     = first_opcode%(vers%)
�?     CDFS_GiveFileType_Num_Trans%       = numbtrans%(vers%)
�O     CDFS_GiveFileType_DOS_Ext_Addr%    = CDFS_Base_Addr% + nameoff%(vers%)
�  �
�     vers% += 1
�  �
�2� (CDFS_Version$ <> "") � (vers% = numb_vers%)
�C� (CDFS_Version$ = "") � � � 27, "CDFS-Version not supported":�
�
�C� now we have setup correct presets we can start program proper
�� Data 256
�
� Com$(3)
�
�� �virginCDFS �
   �makecode
   �standard
�
$   �_get_patch_pointers
.�
8
B
L%� get any command string & put in
V� com$(0) = command
`"� com$(1) = option1 [optional]
j"� com$(2) = option2 [optional]
t�getCommand
~
�Ȏ �Com$(0),2) �
�  � "-S":�standard
�  � "-D":�_dosmap
�  � "-U":�User(Com$(1))
�"  � "-A":�Add(Com$(1),Com$(2))
�  � "-R":�Remove(Com$(1))
�  � "-C":�Clear
�  � "-L":�List
�  
�     � "Wrong Option ..."
�     �Usage
��


�


(� �virginCDFS
2T= (CDFS_Base_Addr%!CDFS_GiveFileType_Code_Off% = CDFS_GiveFileType_Orig_Opcode%)
<
F
P&� set file translations to default
Z� �standard
d
� �dRE
n#� I%, Count, DosTyp$, ArchiTyp$
x
  � Count
�.  � Count > CDFS_GiveFileType_Num_Trans% �
�-     Count = CDFS_GiveFileType_Num_Trans%
�  �
�  � I% = 0 � Count - 1
�    � DosTyp$, ArchiTyp$
�)    �SetTrans(I%, DosTyp$, ArchiTyp$)
�
  � I%
�!  �SetTrans(Count, "", "000")
�	  � 8
�  � "DOC","FFF"
�  � "TXT","FFF"
�  � "BAT","FDA"
�  � "EXE","FD9"
  � "BIN","FFD"
  � "TIF","FF0"
  � "COM","FD8"
"  � "PCD","BE8"
,�
6
@� �SetTrans(I%, A$, B$)
Jȕ �A$, 1) = " "
T      A$ = �A$, �(A$) - 1)
^�
h-$Data=�A$ + �(0) + �(0) + �(0), 3) + �(0)
r)ș "OS_FSControl", 31, B$ � , , Type%
|4CDFS_GiveFileType_DOS_Ext_Addr%!(I% * 8) = !Data
�8CDFS_GiveFileType_DOS_Ext_Addr%!(I% * 8 + 4) = Type%
��
�
�� �GetTransDos(I%)
�� A$, J%
�1J% = CDFS_GiveFileType_DOS_Ext_Addr% + I% * 8
�A$ = ""
�ȕ ?J% > 31 � �(A$) <= 4
�  A$ += �(?J%)
�
  J% += 1
��
�=A$
�
� �GetTransArchi(I%)
1=CDFS_GiveFileType_DOS_Ext_Addr%!(I% * 8 + 4)

&� �Translate(I%)
0� t1%, t2%, J%
:J% = �GetTransArchi(I%)
D.ș "OS_FSControl", 18, , J% � , , t1%, t2%
NData!0 = t1%  
XData!4 = t2%
bData?8 = 13
l
=$Data
v
�
�$� add a new filetype translation
�� �Add(A$, B$)
�� C$
�D� A$="" � B$="" � � "Wrong number of arguments - 2 needed !!!":�
�� I%
�
I% = 0
�C$ = �GetTransDos(I%)
�ȕ C$ <> "" � C$ <> A$
�      I% += 1 
�      C$ = �GetTransDos(I%)
��
�)� I% < CDFS_GiveFileType_Num_Trans% �
   �SetTrans(I%, A$, B$)
$   �SetTrans(I% + 1, "", "&000")
�
 W   � "Sorry only " + �(CDFS_GiveFileType_Num_Trans%) + " Translations possible !!!"
*�
4�
>
H� �Clear
R�SetTrans(0, "", "&000")
\�
f
p� �Remove(A$)
z<� A$="" � � "Wrong number of arguments - 1 needed !!!":�
�� I%, B$, C%, D$
�
I% = 0
�B$ = �GetTransDos(I%)
�ȕ (B$ <> "" � B$ <> A$)
�      I% += 1
�      B$ = �GetTransDos(I%)
��
�� B$ = "" �
�=   � "Dos type " + A$ + " not found in translation table"
��
�   �
�&         C$ = �GetTransDos(I% + 1)
�$         D$ = �Translate(I% + 1)
	"         �SetTrans(I%, C$, D$)
	         I% += 1
	   � C$=""
	$�
	.�
	8
	B� �User(File$)
	L?� File$="" � � "Wrong number of arguments - 1 needed !!!":�
	VA% = �(File$)
	`6� A% = 0 � � "File "+File$+" does not exist !!!":�
	j
J% = 0
	t�
	~  A$ = �#A%
	�  ȕ �A$, 1) = " "
	�    A$ = �A$, 2)
	�  �
	�
  B$ = ""
	�  I% = 1
	�  �
	�    B$ += �A$, I%, 1)
	�    I% += 1
	�  � �A$ + " ", I%, 1) = " "
	�  B$ = �B$ + "   ", 3)
	�
  C$ = ""
	�  �
    I% += 1

  � �A$ + "*", I%, 1) > " "
  �
    C$ += �A$, I%, 1)
(    I% += 1
2  � �A$ + " ", I%) = " "
<+  � J% < CDFS_GiveFileType_Num_Trans% �
F    �SetTrans(J%, B$, C$)
P    J% += 1
Z  �
db    � "Sorry only " + �CDFS_GiveFileType_Num_Trans% + " Translations possible !!!" : �#A%=�#A%
n  �
x
� �#A%
��SetTrans(J%, "", "&000")
��#A%
��
�
�� �List
�� K%
�K%=0
��
�%� "    CDFS type translation    "
�%� "    Number  Dos      RiscOS  "
�%� "-----------------------------"
�ȕ (�GetTransDos(K%) <> "")
�H    � K%, �"  " + �GetTransDos(K%) + �11, " "), 11) + �Translate(K%)
    K% += 1
�
%� K% = 0 � � "No translations!!!"
"�
,
6� �makecode
@� pass%, code%, endlists%
J=code%     = CDFS_Base_Addr% + CDFS_GiveFileType_Code_Off%
T@endlists% = CDFS_Base_Addr% + CDFS_GiveFileType_EndList_Off%
^
h� pass% = 0 � 2 � 2
r    P% = code%
|    [ opt pass%
�
�; on entry
�1; R0 = pointer to filename with terminating 0
�; R12 = private word
�
�R          MOV       PC, R14                       ; Only included initially in
�R                                                  ; case a call is made in the
�T                                                  ; middle of me generating code
�S                                                  ; After all code is generated
�S                                                  ; it is changed to B newstart
�
�Q.ntrans%  EQUD      CDFS_GiveFileType_Num_Trans%  ; items in translation list
�P.extoff%  EQUD      CDFS_GiveFileType_DOS_Ext_Off%; offset of extension list
K.dynarea% EQUD      0                             ; dynamic area (or 0)
Q.codeof1% EQUD      CDFS_GiveFileType_Code_Off%   ; Address of code in module

&%.newstart STMDB     R13!, {R0-R1}
0A          LDR       R1, CDFS_Base_Addr% + CDFS_Workspace_Off%
:#          ADD       R1, R1, R12
DO          MOV       R11, R1                       ; R11 = private workspace
N%          LDMIA     R13!, {R0-R1}
X
b; get filename extension
l          MOV       R3, R0
v
�$.loop1    LDRB      R1, [R3], #1
�          CMP       R1, #0
�)          LDMEQIA   R13!, {R0-R9,R14}
�H          �Q     R1, #0                        ; Just been wiped out
�S          BICEQS    PC, R14, #&10000000           ; exit if null filename or no
�A                                                  ; extension
�!          TEQ       R1, #�"."
�          BNE       loop1
�          MOV       R7, R3
�
�5; R3 points to start of extension (after the ".")
�+; Calculate 4 byte extension word in R0
�          MOV       R0, #0

          MOV       R2, #0



$.loop2    LDRB      R1, [R7], #1

4?          RSBS      R4, R1, #�"a"               ; 'a' <= R1

>A          CMPLE     R1, #�"z"                   ; & R1 <= 'z'

H,          SUBLE     R1, R1, #(�"a"-�"A")

RP          ADD       R0, R0, R1, LSL R2            ; Insert byte (backwards!)

\"          ADD       R2, R2, #8

p

q          CMP       R1, #0

z          BNE       loop2

�

�; R3 = start of extension

�4; R7 = end of extension + 1 byte (i.e. the null)

�P          SUB       R7, R7, R3                    ; Length of extension + 1.

�H                                                  ; 2 to 4 are valid

�?          RSBS      R1, R7, #2                    ; 2 <= R7

�A          CMPLE     R7, #4                        ; & R7 <= 4

�*          LDMGTIA   R13!, {R0-R9, R14}

�          MOVGT     R1, #0

�Q          BICGTS    PC, R14, #&10000000           ; exit if extension is more

�I                                                  ; than 3 characters

�

�2; now see if it can be found in extension list
Q          LDR       R4, extoff%                   ; Address of extension list
E          LDR       R6, dynarea%                  ; start of code
          CMP       R6, #0
$H          ADREQ     R6, code%                     ; Needs relocating
.Q          LDREQ     R7, codeof1%                  ; Offset of code from start
8"          SUBEQ     R6, R6, R7
BE          ADD       R4, R4, R6                    ; Start of list
L
V&.nxt_ext  LDMIA     R4!, {R9, R10}
`          CMP       R0, R9
j          BEQ       found
t          CMP       R9, #0
~          BNE       nxt_ext
�
�
�*          LDMIA     R13!, {R0-R9, R14}
�          MOV       R1,#0
�Q          BICS      PC, R14, #&10000000           ; Exit if not found in list
�
�
�+; If you get here, R10 is the file type
�
�*.found    LDMIA     R13!, {R0-R9, R14}
�          MOV       R1, R10
�A          BICS      PC, R14, #&10000000           ; Tatty bye


.end_of_code%
A           ;start of list of extensions, terminated by word=0

(	    ]
2
<8    � Remember to allow room for the null terminator
FK    CDFS_GiveFileType_Num_Trans%   = (endlists% - end_of_code%) / 8 - 1
PG    CDFS_GiveFileType_DOS_Ext_Off% = end_of_code% - CDFS_Base_Addr%
Z�
d
n+� If we are ROS3.5, use a dynamic area.
x� OsVersion% >= 350 �
�0   CDFS_GiveFileType_Num_Trans% = max_trans%
�   !ntrans% = max_trans%
�   !extoff% = 0
��   ș "OS_DynamicArea", 0, -1, (max_trans% + 1) * 8, -1, 1 << 7, (max_trans% + 1) * 8, 0, 0, "CD Translations" + �0 � , !codeof1%, , !dynarea%
��
�
�6� now all code is generated allow it to be entered
�� pass% = 0 � 2 � 2
�    P% = code%
�    [ opt pass%
�          B     newstart
�	    ]
��

� Set up base pointers
�_get_patch_pointers
"�
,
6
@� �getbaseCDFS
J� CDFS_Base_Addr%
T=ș "XOS_Module", 18, "CDFS" � , , , CDFS_Base_Addr%;flag%
^9� flag% � 1 � � � 27,"Module CDFS does not exist !!!"
h= CDFS_Base_Addr%
r
|
�+� �checkVersCDFS(VersPtr%, VersNeeded$)
�� CurrVers$
�CurrVers$ = ""
��
�    � (?VersPtr%) > 31 �
�#      CurrVers$ += �(?VersPtr%)
�	    �
�    VersPtr% += 1
�� ?VersPtr% = 0
�= (CurrVers$ = VersNeeded$)
�
�
�%� get any command string & put in
� com$(0) = command
#� com$(1) = option1 [optionlal]
"� com$(2) = option2 [optional]
&� �getCommand
0� I%, J%, found%, Env$
:  ș "OS_GetEnv" � I%
D  found%=0
N  �
X    � ?I%=34 � found%+=1
b
    I%+=1
l  � (found%=2)�(?I%=0)
v  I%+=1
�  � ?I%=0 � �Usage:�
�
  Env$=""
�  �
�2    � (?I%<123 � ?I%>96) � ?I%=?I% � %11011111
�    Env$+=�(?I%)
�
    I%+=1
�
  � ?I%=0
�
  I%=0
�  �
�    J%=�Env$," ")
�    � J%<>0 �
�      Com$(I%)=�Env$,J%)
�      Env$=�Env$,J%+1)
      I%+=1
	    �
      Com$(I%)=Env$
       I%=-1
*	    �
4  � I%=-1 � I%>3
>�
H
R� �_get_patch_pointers
\P� my code in CDFS so get list's length & pointers that I saved on generation
fTCDFS_GiveFileType_Num_Trans% = CDFS_Base_Addr%!(CDFS_GiveFileType_Code_Off% + 4)
p>� CDFS_Base_Addr%!(CDFS_GiveFileType_Code_Off% + 12) = 0 �
zZ   CDFS_GiveFileType_DOS_Ext_Addr% = CDFS_Base_Addr%!(CDFS_GiveFileType_Code_Off% + 8)
�9   CDFS_GiveFileType_DOS_Ext_Addr% += CDFS_Base_Addr%
��
�[   CDFS_GiveFileType_DOS_Ext_Addr% = CDFS_Base_Addr%!(CDFS_GiveFileType_Code_Off% + 12)
�[   CDFS_GiveFileType_Dynamic_Area% = CDFS_Base_Addr%!(CDFS_GiveFileType_Code_Off% + 16)
��
��
�
�
���Usage
�"� "CDType <command> [options]"
�� "Where <Command> may be:"
�;� "-Standard            - Reset CDFS translation table"
�<� "-Dosmap              - Set CDFS translation table to"
/� "                        DOSMAP mappings"
>� "-User [<file>]       - Set CDFS user translation table"
2� "                        to table in <file>"
$3� "-Add <Dos> <RiscOS>  - Add a translation:- "
.9� "                        <DosType> to <RiscOSType>"
84� "-Remove <DosType>    - Remove <DosType> from"
B1� "                        translation table"
L:� "-Clear               - Clear the translation table"
V5� "-List                - List translation table"
`�
j�
t
~� �_dosmap
�� C%, I%, A%, J%, A$, B$
�<� Use the "DOSMAP" mappings to set the translation table
��"REMOVE <Wimp$Scrap>"
� �"DOSMAP { > <Wimp$Scrap> }"
�<�SetTrans(J%, "", "&000") : � Just in case nothing there
�C% = �("<Wimp$Scrap>")
�� C% = 0 � �
�� �#C% � �#C% : �
�� : � �#C% = &0A
�� �#C% � �#C% : �
�� : � �#C% = &0A
�
J% = 0
��
�#   � I% = 1 � 5 : A% = �#C% : �
   A$ = ""

   B$ = ""
   � I% = 1 � 3
       A$ += � �#C%
(   �
2#   � I% = 1 � 7 : A% = �#C% : �
<   � I% = 1 � 8
F       B$ += � �#C%
P   �
Z   � : � �#C% = &0A
d   � A$ <> "---" �
n/      � J% < CDFS_GiveFileType_Num_Trans% �
x"         �SetTrans(J%, A$, B$)
�         J% += 1
�      �
�[         � "Sorry only " + �CDFS_GiveFileType_Num_Trans% + " Translations possible !!!"
�         �#C% = �#C%
�      �
�   �
�
� �#C%
��SetTrans(J%, "", "&000")
��#C%
��
�
00000000  0d 00 0a 0d f4 20 3e 43  44 54 79 70 65 0d 00 14  |..... >CDType...|
00000010  05 f4 0d 00 1e 1f f4 20  4f 72 69 67 69 6e 61 6c  |....... Original|
00000020  20 62 79 3a 20 4d 61 72  74 69 6e 20 53 70 65 72  | by: Martin Sper|
00000030  6c 0d 00 28 24 f4 20 20  20 20 20 20 20 20 20 20  |l..($.          |
00000040  20 20 20 20 4e 61 74 74  65 72 67 61 73 73 65 20  |    Nattergasse |
00000050  31 32 2f 33 32 0d 00 32  20 f4 20 20 20 20 20 20  |12/32..2 .      |
00000060  20 20 20 20 20 20 20 20  41 2d 31 31 37 30 20 56  |        A-1170 V|
00000070  69 65 6e 6e 61 0d 00 3c  1a f4 20 20 20 20 20 20  |ienna..<..      |
00000080  20 20 20 20 20 20 20 20  41 75 73 74 72 69 61 0d  |        Austria.|
00000090  00 46 05 f4 0d 00 50 26  f4 20 43 6f 6e 74 61 63  |.F....P&. Contac|
000000a0  74 3a 20 20 20 20 20 46  69 64 6f 20 20 20 3a 20  |t:     Fido   : |
000000b0  32 3a 33 31 33 2f 31 36  2e 36 0d 00 5a 34 f4 20  |2:313/16.6..Z4. |
000000c0  20 20 20 20 20 20 20 20  20 20 20 20 20 45 2d 4d  |             E-M|
000000d0  61 69 6c 20 3a 20 53 70  65 72 6c 40 41 73 74 72  |ail : Sperl@Astr|
000000e0  6f 31 2e 61 75 6e 69 77  2e 61 63 2e 61 74 0d 00  |o1.auniw.ac.at..|
000000f0  64 05 f4 0d 00 6e 37 f4  20 53 69 67 6e 69 66 69  |d....n7. Signifi|
00000100  63 61 6e 74 6c 79 20 63  68 61 6e 67 65 64 20 62  |cantly changed b|
00000110  79 20 4d 69 6b 65 20 4d  61 72 74 69 6e 20 28 20  |y Mike Martin ( |
00000120  53 6f 66 74 63 6f 72 6e  20 29 0d 00 78 50 f4 20  |Softcorn )..xP. |
00000130  4e 6f 77 20 61 6c 6c 6f  77 73 20 6c 6f 74 73 20  |Now allows lots |
00000140  6f 66 20 66 69 6c 65 74  79 70 65 73 20 74 6f 20  |of filetypes to |
00000150  62 65 20 64 65 66 69 6e  65 64 2e 20 49 74 20 61  |be defined. It a|
00000160  63 68 69 65 76 65 73 20  74 68 69 73 20 62 79 20  |chieves this by |
00000170  72 65 2d 77 72 69 74 69  6e 67 0d 00 82 3c f4 20  |re-writing...<. |
00000180  74 68 65 20 77 68 6f 6c  65 20 6f 66 20 41 63 6f  |the whole of Aco|
00000190  72 6e 27 73 20 66 75 6e  63 74 69 6f 6e 20 66 6f  |rn's function fo|
000001a0  72 20 22 43 44 46 53 5f  47 69 76 65 46 69 6c 65  |r "CDFS_GiveFile|
000001b0  54 79 70 65 22 2e 0d 00  8c 05 f4 0d 00 96 0e f4  |Type"...........|
000001c0  20 35 20 46 65 62 20 39  36 0d 00 a0 3d f4 20 53  | 5 Feb 96...=. S|
000001d0  65 72 69 6f 75 73 6c 79  20 68 61 63 6b 65 64 20  |eriously hacked |
000001e0  62 79 20 54 6f 6d 20 54  61 6e 6e 65 72 20 28 74  |by Tom Tanner (t|
000001f0  74 65 68 74 61 6e 6e 40  61 72 67 6f 6e 65 74 2e  |tehtann@argonet.|
00000200  63 6f 2e 75 6b 29 0d 00  aa 4e f4 20 41 6c 6c 6f  |co.uk)...N. Allo|
00000210  77 73 20 68 75 67 65 20  6e 75 6d 62 65 72 73 20  |ws huge numbers |
00000220  6f 66 20 74 72 61 6e 73  6c 61 74 69 6f 6e 73 20  |of translations |
00000230  6f 6e 20 52 69 73 63 4f  53 20 33 2e 35 30 20 62  |on RiscOS 3.50 b|
00000240  79 20 70 6c 61 63 69 6e  67 20 74 61 62 6c 65 20  |y placing table |
00000250  69 6e 20 61 0d 00 b4 4f  f4 20 64 79 6e 61 6d 69  |in a...O. dynami|
00000260  63 20 61 72 65 61 2e 20  41 6c 73 6f 20 66 69 78  |c area. Also fix|
00000270  65 64 20 61 20 66 65 77  20 70 72 6f 62 6c 65 6d  |ed a few problem|
00000280  73 20 77 69 74 68 20 66  75 6c 6c 20 74 61 62 6c  |s with full tabl|
00000290  65 73 2c 20 61 6e 64 20  74 77 65 61 6b 65 64 20  |es, and tweaked |
000002a0  74 68 65 0d 00 be 50 f4  20 63 6f 64 65 20 61 20  |the...P. code a |
000002b0  62 69 74 20 28 77 65 6c  6c 2c 20 4f 4b 2c 20 61  |bit (well, OK, a|
000002c0  20 6c 6f 74 29 20 74 6f  20 61 6c 6c 6f 77 20 6d  | lot) to allow m|
000002d0  6f 72 65 20 74 72 61 6e  73 6c 61 74 69 6f 6e 73  |ore translations|
000002e0  20 66 6f 72 20 6f 6c 64  65 72 20 76 65 72 73 69  | for older versi|
000002f0  6f 6e 73 0d 00 c8 10 f4  20 6f 66 20 52 49 53 43  |ons..... of RISC|
00000300  4f 53 2e 0d 00 d2 2b f4  20 41 64 64 65 64 20 61  |OS....+. Added a|
00000310  20 63 61 6c 6c 20 74 6f  20 73 65 74 20 75 70 20  | call to set up |
00000320  6c 69 73 74 20 3d 20 44  4f 53 20 6d 61 70 0d 00  |list = DOS map..|
00000330  dc 4f f4 20 49 66 20 61  20 74 72 61 6e 73 6c 61  |.O. If a transla|
00000340  74 69 6f 6e 20 61 6c 72  65 61 64 79 20 65 78 69  |tion already exi|
00000350  73 74 73 20 77 69 74 68  20 74 68 65 20 22 2d 41  |sts with the "-A|
00000360  64 64 22 20 6f 70 74 69  6f 6e 2c 20 69 74 20 69  |dd" option, it i|
00000370  73 20 72 65 70 6c 61 63  65 64 20 62 79 0d 00 e6  |s replaced by...|
00000380  16 f4 20 74 68 65 20 6e  65 77 20 76 65 72 73 69  |.. the new versi|
00000390  6f 6e 2e 0d 00 f0 04 0d  00 fa 05 f4 0d 01 04 42  |on.............B|
000003a0  f4 20 54 68 69 73 20 50  72 6f 67 72 61 6d 20 6d  |. This Program m|
000003b0  61 79 20 62 65 20 63 6f  70 69 65 64 20 66 72 65  |ay be copied fre|
000003c0  65 6c 79 20 61 73 20 6c  6f 6e 67 20 61 73 20 74  |ely as long as t|
000003d0  68 65 20 61 62 6f 76 65  20 6c 69 6e 65 73 0d 01  |he above lines..|
000003e0  0e 15 f4 20 5f 61 72 65  5f 20 69 6e 63 6c 75 64  |... _are_ includ|
000003f0  65 64 2e 0d 01 18 04 0d  01 22 0f f4 20 2a 2a 2a  |ed.......".. ***|
00000400  20 54 4f 20 44 4f 0d 01  2c 1d f4 20 47 72 6f 77  | TO DO..,.. Grow|
00000410  20 61 72 65 61 20 77 69  74 68 20 6e 65 77 20 2e  | area with new .|
00000420  45 58 54 0d 01 36 1f f4  20 53 68 72 69 6e 6b 20  |EXT..6.. Shrink |
00000430  61 72 65 61 20 77 69 74  68 20 64 65 6c 65 74 69  |area with deleti|
00000440  6f 6e 0d 01 40 04 0d 01  4a 2a f4 20 4e 75 6d 62  |on..@...J*. Numb|
00000450  65 72 20 6f 66 20 74 72  61 6e 73 6c 61 74 69 6f  |er of translatio|
00000460  6e 73 20 66 6f 72 20 52  2f 4f 53 20 33 2e 35 2b  |ns for R/OS 3.5+|
00000470  0d 01 4b 3b f4 20 54 68  69 73 20 69 73 20 68 6f  |..K;. This is ho|
00000480  77 20 6d 61 6e 79 20 49  20 63 61 6e 20 66 69 74  |w many I can fit|
00000490  20 69 6e 20 6f 6e 65 20  73 6d 61 6c 6c 20 64 79  | in one small dy|
000004a0  6e 61 6d 69 63 20 61 72  65 61 21 0d 01 54 1d 6d  |namic area!..T.m|
000004b0  61 78 5f 74 72 61 6e 73  25 20 3d 20 34 30 39 36  |ax_trans% = 4096|
000004c0  20 2f 20 38 20 2d 20 31  0d 01 5e 04 0d 01 68 50  | / 8 - 1..^...hP|
000004d0  f4 20 47 65 74 20 4f 53  20 56 65 72 73 69 6f 6e  |. Get OS Version|
000004e0  20 6e 75 6d 62 65 72 20  28 74 68 69 73 20 69 73  | number (this is|
000004f0  20 61 20 75 73 65 66 75  6c 20 76 61 72 69 61 62  | a useful variab|
00000500  6c 65 2c 20 62 75 74 20  6e 6f 74 20 77 65 6c 6c  |le, but not well|
00000510  20 64 6f 63 75 6d 65 6e  74 65 64 29 0d 01 72 12  | documented)..r.|
00000520  de 20 4f 73 56 65 72 73  69 6f 6e 25 20 34 0d 01  |. OsVersion% 4..|
00000530  7c 4b c8 99 20 22 4f 53  5f 52 65 61 64 56 61 72  ||K.. "OS_ReadVar|
00000540  56 61 6c 22 2c 20 22 53  59 53 24 4f 53 56 65 72  |Val", "SYS$OSVer|
00000550  73 69 6f 6e 22 2c 20 4f  73 56 65 72 73 69 6f 6e  |sion", OsVersion|
00000560  25 2c 20 34 2c 20 30 2c  20 30 20 b8 20 2c 20 2c  |%, 4, 0, 0 . , ,|
00000570  20 43 25 2c 20 2c 20 45  25 0d 01 86 16 e7 20 43  | C%, , E%..... C|
00000580  25 20 3c 3e 20 30 20 80  20 45 25 20 3d 20 31 0d  |% <> 0 . E% = 1.|
00000590  01 90 1f 20 20 20 4f 73  56 65 72 73 69 6f 6e 25  |...   OsVersion%|
000005a0  20 3d 20 21 4f 73 56 65  72 73 69 6f 6e 25 0d 01  | = !OsVersion%..|
000005b0  9a 05 cc 0d 01 a4 15 20  20 20 4f 73 56 65 72 73  |.......   OsVers|
000005c0  69 6f 6e 25 20 3d 20 30  0d 01 ae 05 cd 0d 01 b8  |ion% = 0........|
000005d0  04 0d 01 c2 04 0d 01 cc  2f f4 20 73 65 74 75 70  |......../. setup|
000005e0  20 70 72 65 73 65 74 73  20 66 6f 72 20 64 69 66  | presets for dif|
000005f0  66 65 72 65 6e 74 20 43  44 46 53 20 76 65 72 73  |ferent CDFS vers|
00000600  69 6f 6e 73 0d 01 d6 28  f4 20 69 2e 65 2e 20 6f  |ions...(. i.e. o|
00000610  66 66 73 65 74 73 2f 76  61 6c 75 65 73 20 69 6e  |ffsets/values in|
00000620  20 76 69 72 67 69 6e 20  43 44 46 53 0d 01 e0 45  | virgin CDFS...E|
00000630  f4 20 69 66 20 79 6f 75  72 73 20 69 73 20 6e 6f  |. if yours is no|
00000640  74 20 69 6e 20 74 68 65  20 6c 69 73 74 20 62 65  |t in the list be|
00000650  6c 6f 77 20 79 6f 75 20  70 72 6f 62 61 62 6c 79  |low you probably|
00000660  20 6f 6e 6c 79 20 68 61  76 65 20 74 6f 20 73 65  | only have to se|
00000670  74 0d 01 ea 2f f4 20 20  61 64 64 20 74 68 65 20  |t.../.  add the |
00000680  63 6f 72 72 65 63 74 20  76 61 6c 75 65 73 20 66  |correct values f|
00000690  6f 72 20 79 6f 75 72 20  76 65 72 73 69 6f 6e 2e  |or your version.|
000006a0  0d 01 f4 10 6e 75 6d 62  5f 76 65 72 73 25 3d 32  |....numb_vers%=2|
000006b0  0d 01 fe 1a de 20 76 65  72 73 69 6f 6e 24 28 6e  |..... version$(n|
000006c0  75 6d 62 5f 76 65 72 73  25 29 0d 02 08 1a de 20  |umb_vers%)..... |
000006d0  63 6f 64 65 6f 66 66 25  28 6e 75 6d 62 5f 76 65  |codeoff%(numb_ve|
000006e0  72 73 25 29 0d 02 12 1c  de 20 65 6e 64 6c 73 74  |rs%)..... endlst|
000006f0  6f 66 66 25 28 6e 75 6d  62 5f 76 65 72 73 25 29  |off%(numb_vers%)|
00000700  0d 02 1c 1d de 20 77 6f  72 6b 73 70 63 6f 66 66  |..... workspcoff|
00000710  25 28 6e 75 6d 62 5f 76  65 72 73 25 29 0d 02 26  |%(numb_vers%)..&|
00000720  1f de 20 66 69 72 73 74  5f 6f 70 63 6f 64 65 25  |.. first_opcode%|
00000730  28 6e 75 6d 62 5f 76 65  72 73 25 29 0d 02 30 1c  |(numb_vers%)..0.|
00000740  de 20 6e 75 6d 62 74 72  61 6e 73 25 28 6e 75 6d  |. numbtrans%(num|
00000750  62 5f 76 65 72 73 25 29  0d 02 3a 1a de 20 6e 61  |b_vers%)..:.. na|
00000760  6d 65 6f 66 66 25 28 6e  75 6d 62 5f 76 65 72 73  |meoff%(numb_vers|
00000770  25 29 0d 02 44 04 0d 02  4e 18 f4 20 73 65 74 75  |%)..D...N.. setu|
00000780  70 20 66 6f 72 20 43 44  46 53 32 2e 32 30 0d 02  |p for CDFS2.20..|
00000790  58 2f 76 65 72 73 69 6f  6e 24 28 30 29 20 20 20  |X/version$(0)   |
000007a0  20 20 20 3d 20 22 43 44  46 53 32 2e 32 30 20 28  |   = "CDFS2.20 (|
000007b0  32 33 20 53 65 70 20 31  39 39 33 29 22 0d 02 62  |23 Sep 1993)"..b|
000007c0  4f 63 6f 64 65 6f 66 66  25 28 30 29 20 20 20 20  |Ocodeoff%(0)    |
000007d0  20 20 3d 20 26 32 44 46  30 20 20 20 20 20 3a 20  |  = &2DF0     : |
000007e0  f4 20 6f 66 66 73 65 74  20 6f 66 20 73 74 61 72  |. offset of star|
000007f0  74 20 6f 66 20 43 44 46  53 5f 47 69 76 65 46 69  |t of CDFS_GiveFi|
00000800  6c 65 54 79 70 65 20 63  6f 64 65 2e 0d 02 6c 50  |leType code...lP|
00000810  65 6e 64 6c 73 74 6f 66  66 25 28 30 29 20 20 20  |endlstoff%(0)   |
00000820  20 3d 20 26 33 30 38 38  20 20 20 20 20 3a 20 f4  | = &3088     : .|
00000830  20 65 6e 64 20 6f 66 20  74 72 61 6e 73 6c 61 74  | end of translat|
00000840  69 6f 6e 20 6c 69 73 74  20 28 61 66 74 65 72 20  |ion list (after |
00000850  52 69 73 63 4f 53 20 68  65 78 29 2e 0d 02 76 4d  |RiscOS hex)...vM|
00000860  77 6f 72 6b 73 70 63 6f  66 66 25 28 30 29 20 20  |workspcoff%(0)  |
00000870  20 3d 20 26 33 32 30 34  20 20 20 20 20 3a 20 f4  | = &3204     : .|
00000880  20 6f 66 66 73 65 74 20  6f 66 20 57 6f 72 64 20  | offset of Word |
00000890  68 6f 6c 64 69 6e 67 20  77 6f 72 6b 73 70 61 63  |holding workspac|
000008a0  65 20 6f 66 66 73 65 74  2e 0d 02 80 50 66 69 72  |e offset....Pfir|
000008b0  73 74 5f 6f 70 63 6f 64  65 25 28 30 29 20 3d 20  |st_opcode%(0) = |
000008c0  26 45 39 32 44 30 30 30  46 20 3a 20 f4 20 76 61  |&E92D000F : . va|
000008d0  6c 75 65 20 6f 66 20 66  69 72 73 74 20 6f 70 63  |lue of first opc|
000008e0  6f 64 65 20 69 6e 20 43  44 46 53 5f 47 69 76 65  |ode in CDFS_Give|
000008f0  46 69 6c 65 54 79 70 65  2e 0d 02 8a 52 6e 75 6d  |FileType....Rnum|
00000900  62 74 72 61 6e 73 25 28  30 29 20 20 20 20 3d 20  |btrans%(0)    = |
00000910  38 20 20 20 20 20 20 20  20 20 3a 20 f4 20 6e 75  |8         : . nu|
00000920  6d 62 65 72 20 6f 66 20  65 6e 74 72 69 65 73 20  |mber of entries |
00000930  69 6e 20 6d 6f 64 75 6c  65 73 20 74 72 61 6e 73  |in modules trans|
00000940  6c 61 74 65 20 74 61 62  6c 65 2e 0d 02 94 4f 6e  |late table....On|
00000950  61 6d 65 6f 66 66 25 28  30 29 20 20 20 20 20 20  |ameoff%(0)      |
00000960  3d 20 26 33 30 36 34 20  20 20 20 20 3a 20 f4 20  |= &3064     : . |
00000970  6f 66 66 73 65 74 20 6f  66 20 73 74 61 72 74 20  |offset of start |
00000980  6f 66 20 44 4f 53 20 6e  61 6d 65 20 70 61 72 74  |of DOS name part|
00000990  20 6f 66 20 74 61 62 6c  65 2e 0d 02 9e 04 0d 02  | of table.......|
000009a0  a8 37 f4 20 73 65 74 75  70 20 66 6f 72 20 43 44  |.7. setup for CD|
000009b0  46 53 32 2e 32 31 20 20  28 61 63 74 75 61 6c 6c  |FS2.21  (actuall|
000009c0  79 2c 20 69 64 65 6e 74  69 63 61 6c 20 74 6f 20  |y, identical to |
000009d0  32 2e 32 30 29 0d 02 b2  2f 76 65 72 73 69 6f 6e  |2.20).../version|
000009e0  24 28 31 29 20 20 20 20  20 20 3d 20 22 43 44 46  |$(1)      = "CDF|
000009f0  53 32 2e 32 31 20 28 30  32 20 46 65 62 20 31 39  |S2.21 (02 Feb 19|
00000a00  39 34 29 22 0d 02 bc 1c  63 6f 64 65 6f 66 66 25  |94)"....codeoff%|
00000a10  28 31 29 20 20 20 20 20  20 3d 20 26 32 44 46 30  |(1)      = &2DF0|
00000a20  0d 02 c6 1c 65 6e 64 6c  73 74 6f 66 66 25 28 31  |....endlstoff%(1|
00000a30  29 20 20 20 20 3d 20 26  33 30 38 38 0d 02 d0 1c  |)    = &3088....|
00000a40  77 6f 72 6b 73 70 63 6f  66 66 25 28 31 29 20 20  |workspcoff%(1)  |
00000a50  20 3d 20 26 33 32 30 34  0d 02 da 20 66 69 72 73  | = &3204... firs|
00000a60  74 5f 6f 70 63 6f 64 65  25 28 31 29 20 3d 20 26  |t_opcode%(1) = &|
00000a70  45 39 32 44 30 30 30 46  0d 02 e4 18 6e 75 6d 62  |E92D000F....numb|
00000a80  74 72 61 6e 73 25 28 31  29 20 20 20 20 3d 20 38  |trans%(1)    = 8|
00000a90  0d 02 ee 1c 6e 61 6d 65  6f 66 66 25 28 31 29 20  |....nameoff%(1) |
00000aa0  20 20 20 20 20 3d 20 26  33 30 36 34 0d 02 f8 04  |     = &3064....|
00000ab0  0d 03 02 04 0d 03 0c 4e  43 44 46 53 5f 42 61 73  |.......NCDFS_Bas|
00000ac0  65 5f 41 64 64 72 25 20  3d 20 a4 67 65 74 62 61  |e_Addr% = .getba|
00000ad0  73 65 43 44 46 53 20 20  20 20 3a 20 f4 20 61 62  |seCDFS    : . ab|
00000ae0  73 6f 6c 75 74 65 20 61  64 64 72 65 73 73 20 6f  |solute address o|
00000af0  66 20 73 74 61 72 74 20  6f 66 20 6d 6f 64 75 6c  |f start of modul|
00000b00  65 2e 0d 03 16 04 0d 03  20 3f f4 20 66 69 6e 64  |e....... ?. find|
00000b10  20 43 44 46 53 20 76 65  72 73 69 6f 6e 20 26 20  | CDFS version & |
00000b20  73 65 74 20 75 70 20 64  65 66 61 75 6c 74 20 70  |set up default p|
00000b30  61 72 61 6d 65 74 65 72  73 20 61 63 63 6f 72 64  |arameters accord|
00000b40  69 6e 67 6c 79 0d 03 2a  16 43 44 46 53 5f 56 65  |ingly..*.CDFS_Ve|
00000b50  72 73 69 6f 6e 24 20 3d  20 22 22 0d 03 34 0d 76  |rsion$ = ""..4.v|
00000b60  65 72 73 25 20 3d 20 30  0d 03 3e 05 f5 0d 03 48  |ers% = 0..>....H|
00000b70  4f 20 20 e7 20 a4 63 68  65 63 6b 56 65 72 73 43  |O  . .checkVersC|
00000b80  44 46 53 28 43 44 46 53  5f 42 61 73 65 5f 41 64  |DFS(CDFS_Base_Ad|
00000b90  64 72 25 20 2b 20 43 44  46 53 5f 42 61 73 65 5f  |dr% + CDFS_Base_|
00000ba0  41 64 64 72 25 21 32 30  2c 20 76 65 72 73 69 6f  |Addr%!20, versio|
00000bb0  6e 24 28 76 65 72 73 25  29 29 20 8c 0d 03 52 3d  |n$(vers%)) ...R=|
00000bc0  20 20 20 20 20 43 44 46  53 5f 56 65 72 73 69 6f  |     CDFS_Versio|
00000bd0  6e 24 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |n$              |
00000be0  20 20 20 20 20 20 20 20  3d 20 76 65 72 73 69 6f  |        = versio|
00000bf0  6e 24 28 76 65 72 73 25  29 0d 03 5c 3d 20 20 20  |n$(vers%)..\=   |
00000c00  20 20 43 44 46 53 5f 47  69 76 65 46 69 6c 65 54  |  CDFS_GiveFileT|
00000c10  79 70 65 5f 43 6f 64 65  5f 4f 66 66 25 20 20 20  |ype_Code_Off%   |
00000c20  20 20 20 20 20 3d 20 63  6f 64 65 6f 66 66 25 28  |     = codeoff%(|
00000c30  76 65 72 73 25 29 0d 03  66 3f 20 20 20 20 20 43  |vers%)..f?     C|
00000c40  44 46 53 5f 47 69 76 65  46 69 6c 65 54 79 70 65  |DFS_GiveFileType|
00000c50  5f 45 6e 64 4c 69 73 74  5f 4f 66 66 25 20 20 20  |_EndList_Off%   |
00000c60  20 20 3d 20 65 6e 64 6c  73 74 6f 66 66 25 28 76  |  = endlstoff%(v|
00000c70  65 72 73 25 29 0d 03 70  40 20 20 20 20 20 43 44  |ers%)..p@     CD|
00000c80  46 53 5f 57 6f 72 6b 73  70 61 63 65 5f 4f 66 66  |FS_Workspace_Off|
00000c90  25 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |%               |
00000ca0  20 3d 20 77 6f 72 6b 73  70 63 6f 66 66 25 28 76  | = workspcoff%(v|
00000cb0  65 72 73 25 29 0d 03 7a  42 20 20 20 20 20 43 44  |ers%)..zB     CD|
00000cc0  46 53 5f 47 69 76 65 46  69 6c 65 54 79 70 65 5f  |FS_GiveFileType_|
00000cd0  4f 72 69 67 5f 4f 70 63  6f 64 65 25 20 20 20 20  |Orig_Opcode%    |
00000ce0  20 3d 20 66 69 72 73 74  5f 6f 70 63 6f 64 65 25  | = first_opcode%|
00000cf0  28 76 65 72 73 25 29 0d  03 84 3f 20 20 20 20 20  |(vers%)...?     |
00000d00  43 44 46 53 5f 47 69 76  65 46 69 6c 65 54 79 70  |CDFS_GiveFileTyp|
00000d10  65 5f 4e 75 6d 5f 54 72  61 6e 73 25 20 20 20 20  |e_Num_Trans%    |
00000d20  20 20 20 3d 20 6e 75 6d  62 74 72 61 6e 73 25 28  |   = numbtrans%(|
00000d30  76 65 72 73 25 29 0d 03  8e 4f 20 20 20 20 20 43  |vers%)...O     C|
00000d40  44 46 53 5f 47 69 76 65  46 69 6c 65 54 79 70 65  |DFS_GiveFileType|
00000d50  5f 44 4f 53 5f 45 78 74  5f 41 64 64 72 25 20 20  |_DOS_Ext_Addr%  |
00000d60  20 20 3d 20 43 44 46 53  5f 42 61 73 65 5f 41 64  |  = CDFS_Base_Ad|
00000d70  64 72 25 20 2b 20 6e 61  6d 65 6f 66 66 25 28 76  |dr% + nameoff%(v|
00000d80  65 72 73 25 29 0d 03 98  07 20 20 cc 0d 03 a2 13  |ers%)....  .....|
00000d90  20 20 20 20 20 76 65 72  73 25 20 2b 3d 20 31 0d  |     vers% += 1.|
00000da0  03 ac 07 20 20 cd 0d 03  b6 32 fd 20 28 43 44 46  |...  ....2. (CDF|
00000db0  53 5f 56 65 72 73 69 6f  6e 24 20 3c 3e 20 22 22  |S_Version$ <> ""|
00000dc0  29 20 84 20 28 76 65 72  73 25 20 3d 20 6e 75 6d  |) . (vers% = num|
00000dd0  62 5f 76 65 72 73 25 29  0d 03 c0 43 e7 20 28 43  |b_vers%)...C. (C|
00000de0  44 46 53 5f 56 65 72 73  69 6f 6e 24 20 3d 20 22  |DFS_Version$ = "|
00000df0  22 29 20 8c 20 85 20 a2  20 32 37 2c 20 22 43 44  |") . . . 27, "CD|
00000e00  46 53 2d 56 65 72 73 69  6f 6e 20 6e 6f 74 20 73  |FS-Version not s|
00000e10  75 70 70 6f 72 74 65 64  22 3a e0 0d 03 ca 04 0d  |upported":......|
00000e20  03 d4 43 f4 20 6e 6f 77  20 77 65 20 68 61 76 65  |..C. now we have|
00000e30  20 73 65 74 75 70 20 63  6f 72 72 65 63 74 20 70  | setup correct p|
00000e40  72 65 73 65 74 73 20 77  65 20 63 61 6e 20 73 74  |resets we can st|
00000e50  61 72 74 20 70 72 6f 67  72 61 6d 20 70 72 6f 70  |art program prop|
00000e60  65 72 0d 03 de 0e de 20  44 61 74 61 20 32 35 36  |er..... Data 256|
00000e70  0d 03 e8 0d de 20 43 6f  6d 24 28 33 29 0d 03 f2  |..... Com$(3)...|
00000e80  04 0d 03 fc 13 e7 20 a4  76 69 72 67 69 6e 43 44  |...... .virginCD|
00000e90  46 53 20 8c 0d 04 06 10  20 20 20 f2 6d 61 6b 65  |FS .....   .make|
00000ea0  63 6f 64 65 0d 04 10 10  20 20 20 f2 73 74 61 6e  |code....   .stan|
00000eb0  64 61 72 64 0d 04 1a 05  cc 0d 04 24 1b 20 20 20  |dard.......$.   |
00000ec0  f2 5f 67 65 74 5f 70 61  74 63 68 5f 70 6f 69 6e  |._get_patch_poin|
00000ed0  74 65 72 73 0d 04 2e 05  cd 0d 04 38 04 0d 04 42  |ters.......8...B|
00000ee0  04 0d 04 4c 25 f4 20 67  65 74 20 61 6e 79 20 63  |...L%. get any c|
00000ef0  6f 6d 6d 61 6e 64 20 73  74 72 69 6e 67 20 26 20  |ommand string & |
00000f00  70 75 74 20 69 6e 0d 04  56 17 f4 20 63 6f 6d 24  |put in..V.. com$|
00000f10  28 30 29 20 3d 20 63 6f  6d 6d 61 6e 64 0d 04 60  |(0) = command..`|
00000f20  22 f4 20 63 6f 6d 24 28  31 29 20 3d 20 6f 70 74  |". com$(1) = opt|
00000f30  69 6f 6e 31 20 5b 6f 70  74 69 6f 6e 61 6c 5d 0d  |ion1 [optional].|
00000f40  04 6a 22 f4 20 63 6f 6d  24 28 32 29 20 3d 20 6f  |.j". com$(2) = o|
00000f50  70 74 69 6f 6e 32 20 5b  6f 70 74 69 6f 6e 61 6c  |ption2 [optional|
00000f60  5d 0d 04 74 0f f2 67 65  74 43 6f 6d 6d 61 6e 64  |]..t..getCommand|
00000f70  0d 04 7e 04 0d 04 88 14  c8 8e 20 c0 43 6f 6d 24  |..~....... .Com$|
00000f80  28 30 29 2c 32 29 20 ca  0d 04 92 16 20 20 c9 20  |(0),2) .....  . |
00000f90  22 2d 53 22 3a f2 73 74  61 6e 64 61 72 64 0d 04  |"-S":.standard..|
00000fa0  9c 15 20 20 c9 20 22 2d  44 22 3a f2 5f 64 6f 73  |..  . "-D":._dos|
00000fb0  6d 61 70 0d 04 a6 1b 20  20 c9 20 22 2d 55 22 3a  |map....  . "-U":|
00000fc0  f2 55 73 65 72 28 43 6f  6d 24 28 31 29 29 0d 04  |.User(Com$(1))..|
00000fd0  b0 22 20 20 c9 20 22 2d  41 22 3a f2 41 64 64 28  |."  . "-A":.Add(|
00000fe0  43 6f 6d 24 28 31 29 2c  43 6f 6d 24 28 32 29 29  |Com$(1),Com$(2))|
00000ff0  0d 04 ba 1d 20 20 c9 20  22 2d 52 22 3a f2 52 65  |....  . "-R":.Re|
00001000  6d 6f 76 65 28 43 6f 6d  24 28 31 29 29 0d 04 c4  |move(Com$(1))...|
00001010  13 20 20 c9 20 22 2d 43  22 3a f2 43 6c 65 61 72  |.  . "-C":.Clear|
00001020  0d 04 ce 12 20 20 c9 20  22 2d 4c 22 3a f2 4c 69  |....  . "-L":.Li|
00001030  73 74 0d 04 d8 07 20 20  7f 0d 04 e2 1d 20 20 20  |st....  .....   |
00001040  20 20 f1 20 22 57 72 6f  6e 67 20 4f 70 74 69 6f  |  . "Wrong Optio|
00001050  6e 20 2e 2e 2e 22 0d 04  ec 0f 20 20 20 20 20 f2  |n ..."....     .|
00001060  55 73 61 67 65 0d 04 f6  05 cb 0d 05 00 04 0d 05  |Usage...........|
00001070  0a 05 e0 0d 05 14 04 0d  05 1e 04 0d 05 28 11 dd  |.............(..|
00001080  20 a4 76 69 72 67 69 6e  43 44 46 53 0d 05 32 54  | .virginCDFS..2T|
00001090  3d 20 28 43 44 46 53 5f  42 61 73 65 5f 41 64 64  |= (CDFS_Base_Add|
000010a0  72 25 21 43 44 46 53 5f  47 69 76 65 46 69 6c 65  |r%!CDFS_GiveFile|
000010b0  54 79 70 65 5f 43 6f 64  65 5f 4f 66 66 25 20 3d  |Type_Code_Off% =|
000010c0  20 43 44 46 53 5f 47 69  76 65 46 69 6c 65 54 79  | CDFS_GiveFileTy|
000010d0  70 65 5f 4f 72 69 67 5f  4f 70 63 6f 64 65 25 29  |pe_Orig_Opcode%)|
000010e0  0d 05 3c 04 0d 05 46 04  0d 05 50 26 f4 20 73 65  |..<...F...P&. se|
000010f0  74 20 66 69 6c 65 20 74  72 61 6e 73 6c 61 74 69  |t file translati|
00001100  6f 6e 73 20 74 6f 20 64  65 66 61 75 6c 74 0d 05  |ons to default..|
00001110  5a 0f dd 20 f2 73 74 61  6e 64 61 72 64 0d 05 64  |Z.. .standard..d|
00001120  0a f7 20 8d 64 52 45 0d  05 6e 23 ea 20 49 25 2c  |.. .dRE..n#. I%,|
00001130  20 43 6f 75 6e 74 2c 20  44 6f 73 54 79 70 24 2c  | Count, DosTyp$,|
00001140  20 41 72 63 68 69 54 79  70 24 0d 05 78 0d 20 20  | ArchiTyp$..x.  |
00001150  f3 20 43 6f 75 6e 74 0d  05 82 2e 20 20 e7 20 43  |. Count....  . C|
00001160  6f 75 6e 74 20 3e 20 43  44 46 53 5f 47 69 76 65  |ount > CDFS_Give|
00001170  46 69 6c 65 54 79 70 65  5f 4e 75 6d 5f 54 72 61  |FileType_Num_Tra|
00001180  6e 73 25 20 8c 0d 05 8c  2d 20 20 20 20 20 43 6f  |ns% ....-     Co|
00001190  75 6e 74 20 3d 20 43 44  46 53 5f 47 69 76 65 46  |unt = CDFS_GiveF|
000011a0  69 6c 65 54 79 70 65 5f  4e 75 6d 5f 54 72 61 6e  |ileType_Num_Tran|
000011b0  73 25 0d 05 96 07 20 20  cd 0d 05 a0 1a 20 20 e3  |s%....  .....  .|
000011c0  20 49 25 20 3d 20 30 20  b8 20 43 6f 75 6e 74 20  | I% = 0 . Count |
000011d0  2d 20 31 0d 05 aa 1c 20  20 20 20 f3 20 44 6f 73  |- 1....    . Dos|
000011e0  54 79 70 24 2c 20 41 72  63 68 69 54 79 70 24 0d  |Typ$, ArchiTyp$.|
000011f0  05 b4 29 20 20 20 20 f2  53 65 74 54 72 61 6e 73  |..)    .SetTrans|
00001200  28 49 25 2c 20 44 6f 73  54 79 70 24 2c 20 41 72  |(I%, DosTyp$, Ar|
00001210  63 68 69 54 79 70 24 29  0d 05 be 0a 20 20 ed 20  |chiTyp$)....  . |
00001220  49 25 0d 05 c8 21 20 20  f2 53 65 74 54 72 61 6e  |I%...!  .SetTran|
00001230  73 28 43 6f 75 6e 74 2c  20 22 22 2c 20 22 30 30  |s(Count, "", "00|
00001240  30 22 29 0d 05 d2 09 20  20 dc 20 38 0d 05 dc 13  |0")....  . 8....|
00001250  20 20 dc 20 22 44 4f 43  22 2c 22 46 46 46 22 0d  |  . "DOC","FFF".|
00001260  05 e6 13 20 20 dc 20 22  54 58 54 22 2c 22 46 46  |...  . "TXT","FF|
00001270  46 22 0d 05 f0 13 20 20  dc 20 22 42 41 54 22 2c  |F"....  . "BAT",|
00001280  22 46 44 41 22 0d 05 fa  13 20 20 dc 20 22 45 58  |"FDA"....  . "EX|
00001290  45 22 2c 22 46 44 39 22  0d 06 04 13 20 20 dc 20  |E","FD9"....  . |
000012a0  22 42 49 4e 22 2c 22 46  46 44 22 0d 06 0e 13 20  |"BIN","FFD".... |
000012b0  20 dc 20 22 54 49 46 22  2c 22 46 46 30 22 0d 06  | . "TIF","FF0"..|
000012c0  18 13 20 20 dc 20 22 43  4f 4d 22 2c 22 46 44 38  |..  . "COM","FD8|
000012d0  22 0d 06 22 13 20 20 dc  20 22 50 43 44 22 2c 22  |"..".  . "PCD","|
000012e0  42 45 38 22 0d 06 2c 05  e1 0d 06 36 04 0d 06 40  |BE8"..,....6...@|
000012f0  1b dd 20 f2 53 65 74 54  72 61 6e 73 28 49 25 2c  |.. .SetTrans(I%,|
00001300  20 41 24 2c 20 42 24 29  0d 06 4a 14 c8 95 20 c2  | A$, B$)..J... .|
00001310  41 24 2c 20 31 29 20 3d  20 22 20 22 0d 06 54 1e  |A$, 1) = " "..T.|
00001320  20 20 20 20 20 20 41 24  20 3d 20 c0 41 24 2c 20  |      A$ = .A$, |
00001330  a9 28 41 24 29 20 2d 20  31 29 0d 06 5e 05 ce 0d  |.(A$) - 1)..^...|
00001340  06 68 2d 24 44 61 74 61  3d c0 41 24 20 2b 20 bd  |.h-$Data=.A$ + .|
00001350  28 30 29 20 2b 20 bd 28  30 29 20 2b 20 bd 28 30  |(0) + .(0) + .(0|
00001360  29 2c 20 33 29 20 2b 20  bd 28 30 29 0d 06 72 29  |), 3) + .(0)..r)|
00001370  c8 99 20 22 4f 53 5f 46  53 43 6f 6e 74 72 6f 6c  |.. "OS_FSControl|
00001380  22 2c 20 33 31 2c 20 42  24 20 b8 20 2c 20 2c 20  |", 31, B$ . , , |
00001390  54 79 70 65 25 0d 06 7c  34 43 44 46 53 5f 47 69  |Type%..|4CDFS_Gi|
000013a0  76 65 46 69 6c 65 54 79  70 65 5f 44 4f 53 5f 45  |veFileType_DOS_E|
000013b0  78 74 5f 41 64 64 72 25  21 28 49 25 20 2a 20 38  |xt_Addr%!(I% * 8|
000013c0  29 20 3d 20 21 44 61 74  61 0d 06 86 38 43 44 46  |) = !Data...8CDF|
000013d0  53 5f 47 69 76 65 46 69  6c 65 54 79 70 65 5f 44  |S_GiveFileType_D|
000013e0  4f 53 5f 45 78 74 5f 41  64 64 72 25 21 28 49 25  |OS_Ext_Addr%!(I%|
000013f0  20 2a 20 38 20 2b 20 34  29 20 3d 20 54 79 70 65  | * 8 + 4) = Type|
00001400  25 0d 06 90 05 e1 0d 06  9a 04 0d 06 a4 16 dd 20  |%.............. |
00001410  a4 47 65 74 54 72 61 6e  73 44 6f 73 28 49 25 29  |.GetTransDos(I%)|
00001420  0d 06 ae 0c ea 20 41 24  2c 20 4a 25 0d 06 b8 31  |..... A$, J%...1|
00001430  4a 25 20 3d 20 43 44 46  53 5f 47 69 76 65 46 69  |J% = CDFS_GiveFi|
00001440  6c 65 54 79 70 65 5f 44  4f 53 5f 45 78 74 5f 41  |leType_DOS_Ext_A|
00001450  64 64 72 25 20 2b 20 49  25 20 2a 20 38 0d 06 c2  |ddr% + I% * 8...|
00001460  0b 41 24 20 3d 20 22 22  0d 06 cc 1c c8 95 20 3f  |.A$ = ""...... ?|
00001470  4a 25 20 3e 20 33 31 20  80 20 a9 28 41 24 29 20  |J% > 31 . .(A$) |
00001480  3c 3d 20 34 0d 06 d6 12  20 20 41 24 20 2b 3d 20  |<= 4....  A$ += |
00001490  bd 28 3f 4a 25 29 0d 06  e0 0d 20 20 4a 25 20 2b  |.(?J%)....  J% +|
000014a0  3d 20 31 0d 06 ea 05 ce  0d 06 f4 07 3d 41 24 0d  |= 1.........=A$.|
000014b0  06 fe 04 0d 07 08 18 dd  20 a4 47 65 74 54 72 61  |........ .GetTra|
000014c0  6e 73 41 72 63 68 69 28  49 25 29 0d 07 12 31 3d  |nsArchi(I%)...1=|
000014d0  43 44 46 53 5f 47 69 76  65 46 69 6c 65 54 79 70  |CDFS_GiveFileTyp|
000014e0  65 5f 44 4f 53 5f 45 78  74 5f 41 64 64 72 25 21  |e_DOS_Ext_Addr%!|
000014f0  28 49 25 20 2a 20 38 20  2b 20 34 29 0d 07 1c 04  |(I% * 8 + 4)....|
00001500  0d 07 26 14 dd 20 a4 54  72 61 6e 73 6c 61 74 65  |..&.. .Translate|
00001510  28 49 25 29 0d 07 30 12  ea 20 74 31 25 2c 20 74  |(I%)..0.. t1%, t|
00001520  32 25 2c 20 4a 25 0d 07  3a 1b 4a 25 20 3d 20 a4  |2%, J%..:.J% = .|
00001530  47 65 74 54 72 61 6e 73  41 72 63 68 69 28 49 25  |GetTransArchi(I%|
00001540  29 0d 07 44 2e c8 99 20  22 4f 53 5f 46 53 43 6f  |)..D... "OS_FSCo|
00001550  6e 74 72 6f 6c 22 2c 20  31 38 2c 20 2c 20 4a 25  |ntrol", 18, , J%|
00001560  20 b8 20 2c 20 2c 20 74  31 25 2c 20 74 32 25 0d  | . , , t1%, t2%.|
00001570  07 4e 12 44 61 74 61 21  30 20 3d 20 74 31 25 20  |.N.Data!0 = t1% |
00001580  20 0d 07 58 10 44 61 74  61 21 34 20 3d 20 74 32  | ..X.Data!4 = t2|
00001590  25 0d 07 62 0f 44 61 74  61 3f 38 20 3d 20 31 33  |%..b.Data?8 = 13|
000015a0  0d 07 6c 0a 3d 24 44 61  74 61 0d 07 76 04 0d 07  |..l.=$Data..v...|
000015b0  80 04 0d 07 8a 24 f4 20  61 64 64 20 61 20 6e 65  |.....$. add a ne|
000015c0  77 20 66 69 6c 65 74 79  70 65 20 74 72 61 6e 73  |w filetype trans|
000015d0  6c 61 74 69 6f 6e 0d 07  94 12 dd 20 f2 41 64 64  |lation..... .Add|
000015e0  28 41 24 2c 20 42 24 29  0d 07 9e 08 ea 20 43 24  |(A$, B$)..... C$|
000015f0  0d 07 a8 44 e7 20 41 24  3d 22 22 20 84 20 42 24  |...D. A$="" . B$|
00001600  3d 22 22 20 8c 20 f1 20  22 57 72 6f 6e 67 20 6e  |="" . . "Wrong n|
00001610  75 6d 62 65 72 20 6f 66  20 61 72 67 75 6d 65 6e  |umber of argumen|
00001620  74 73 20 2d 20 32 20 6e  65 65 64 65 64 20 21 21  |ts - 2 needed !!|
00001630  21 22 3a e1 0d 07 b2 08  ea 20 49 25 0d 07 bc 0a  |!":...... I%....|
00001640  49 25 20 3d 20 30 0d 07  c6 19 43 24 20 3d 20 a4  |I% = 0....C$ = .|
00001650  47 65 74 54 72 61 6e 73  44 6f 73 28 49 25 29 0d  |GetTransDos(I%).|
00001660  07 d0 1a c8 95 20 43 24  20 3c 3e 20 22 22 20 80  |..... C$ <> "" .|
00001670  20 43 24 20 3c 3e 20 41  24 0d 07 da 12 20 20 20  | C$ <> A$....   |
00001680  20 20 20 49 25 20 2b 3d  20 31 20 0d 07 e4 1f 20  |   I% += 1 .... |
00001690  20 20 20 20 20 43 24 20  3d 20 a4 47 65 74 54 72  |     C$ = .GetTr|
000016a0  61 6e 73 44 6f 73 28 49  25 29 0d 07 ee 05 ce 0d  |ansDos(I%)......|
000016b0  07 f8 29 e7 20 49 25 20  3c 20 43 44 46 53 5f 47  |..). I% < CDFS_G|
000016c0  69 76 65 46 69 6c 65 54  79 70 65 5f 4e 75 6d 5f  |iveFileType_Num_|
000016d0  54 72 61 6e 73 25 20 8c  0d 08 02 1c 20 20 20 f2  |Trans% .....   .|
000016e0  53 65 74 54 72 61 6e 73  28 49 25 2c 20 41 24 2c  |SetTrans(I%, A$,|
000016f0  20 42 24 29 0d 08 0c 24  20 20 20 f2 53 65 74 54  | B$)...$   .SetT|
00001700  72 61 6e 73 28 49 25 20  2b 20 31 2c 20 22 22 2c  |rans(I% + 1, "",|
00001710  20 22 26 30 30 30 22 29  0d 08 16 05 cc 0d 08 20  | "&000")....... |
00001720  57 20 20 20 f1 20 22 53  6f 72 72 79 20 6f 6e 6c  |W   . "Sorry onl|
00001730  79 20 22 20 2b 20 c3 28  43 44 46 53 5f 47 69 76  |y " + .(CDFS_Giv|
00001740  65 46 69 6c 65 54 79 70  65 5f 4e 75 6d 5f 54 72  |eFileType_Num_Tr|
00001750  61 6e 73 25 29 20 2b 20  22 20 54 72 61 6e 73 6c  |ans%) + " Transl|
00001760  61 74 69 6f 6e 73 20 70  6f 73 73 69 62 6c 65 20  |ations possible |
00001770  21 21 21 22 0d 08 2a 05  cd 0d 08 34 05 e1 0d 08  |!!!"..*....4....|
00001780  3e 04 0d 08 48 0c dd 20  f2 43 6c 65 61 72 0d 08  |>...H.. .Clear..|
00001790  52 1c f2 53 65 74 54 72  61 6e 73 28 30 2c 20 22  |R..SetTrans(0, "|
000017a0  22 2c 20 22 26 30 30 30  22 29 0d 08 5c 05 e1 0d  |", "&000")..\...|
000017b0  08 66 04 0d 08 70 11 dd  20 f2 52 65 6d 6f 76 65  |.f...p.. .Remove|
000017c0  28 41 24 29 0d 08 7a 3c  e7 20 41 24 3d 22 22 20  |(A$)..z<. A$="" |
000017d0  8c 20 f1 20 22 57 72 6f  6e 67 20 6e 75 6d 62 65  |. . "Wrong numbe|
000017e0  72 20 6f 66 20 61 72 67  75 6d 65 6e 74 73 20 2d  |r of arguments -|
000017f0  20 31 20 6e 65 65 64 65  64 20 21 21 21 22 3a e1  | 1 needed !!!":.|
00001800  0d 08 84 14 ea 20 49 25  2c 20 42 24 2c 20 43 25  |..... I%, B$, C%|
00001810  2c 20 44 24 0d 08 8e 0a  49 25 20 3d 20 30 0d 08  |, D$....I% = 0..|
00001820  98 19 42 24 20 3d 20 a4  47 65 74 54 72 61 6e 73  |..B$ = .GetTrans|
00001830  44 6f 73 28 49 25 29 0d  08 a2 1c c8 95 20 28 42  |Dos(I%)...... (B|
00001840  24 20 3c 3e 20 22 22 20  80 20 42 24 20 3c 3e 20  |$ <> "" . B$ <> |
00001850  41 24 29 0d 08 ac 11 20  20 20 20 20 20 49 25 20  |A$)....      I% |
00001860  2b 3d 20 31 0d 08 b6 1f  20 20 20 20 20 20 42 24  |+= 1....      B$|
00001870  20 3d 20 a4 47 65 74 54  72 61 6e 73 44 6f 73 28  | = .GetTransDos(|
00001880  49 25 29 0d 08 c0 05 ce  0d 08 ca 0f e7 20 42 24  |I%).......... B$|
00001890  20 3d 20 22 22 20 8c 0d  08 d4 3d 20 20 20 f1 20  | = "" ....=   . |
000018a0  22 44 6f 73 20 74 79 70  65 20 22 20 2b 20 41 24  |"Dos type " + A$|
000018b0  20 2b 20 22 20 6e 6f 74  20 66 6f 75 6e 64 20 69  | + " not found i|
000018c0  6e 20 74 72 61 6e 73 6c  61 74 69 6f 6e 20 74 61  |n translation ta|
000018d0  62 6c 65 22 0d 08 de 05  cc 0d 08 e8 08 20 20 20  |ble".........   |
000018e0  f5 0d 08 f2 26 20 20 20  20 20 20 20 20 20 43 24  |....&         C$|
000018f0  20 3d 20 a4 47 65 74 54  72 61 6e 73 44 6f 73 28  | = .GetTransDos(|
00001900  49 25 20 2b 20 31 29 0d  08 fc 24 20 20 20 20 20  |I% + 1)...$     |
00001910  20 20 20 20 44 24 20 3d  20 a4 54 72 61 6e 73 6c  |    D$ = .Transl|
00001920  61 74 65 28 49 25 20 2b  20 31 29 0d 09 06 22 20  |ate(I% + 1)..." |
00001930  20 20 20 20 20 20 20 20  f2 53 65 74 54 72 61 6e  |        .SetTran|
00001940  73 28 49 25 2c 20 43 24  2c 20 44 24 29 0d 09 10  |s(I%, C$, D$)...|
00001950  14 20 20 20 20 20 20 20  20 20 49 25 20 2b 3d 20  |.         I% += |
00001960  31 0d 09 1a 0e 20 20 20  fd 20 43 24 3d 22 22 0d  |1....   . C$="".|
00001970  09 24 05 cd 0d 09 2e 05  e1 0d 09 38 04 0d 09 42  |.$.........8...B|
00001980  12 dd 20 f2 55 73 65 72  28 46 69 6c 65 24 29 0d  |.. .User(File$).|
00001990  09 4c 3f e7 20 46 69 6c  65 24 3d 22 22 20 8c 20  |.L?. File$="" . |
000019a0  f1 20 22 57 72 6f 6e 67  20 6e 75 6d 62 65 72 20  |. "Wrong number |
000019b0  6f 66 20 61 72 67 75 6d  65 6e 74 73 20 2d 20 31  |of arguments - 1|
000019c0  20 6e 65 65 64 65 64 20  21 21 21 22 3a e1 0d 09  | needed !!!":...|
000019d0  56 11 41 25 20 3d 20 8e  28 46 69 6c 65 24 29 0d  |V.A% = .(File$).|
000019e0  09 60 36 e7 20 41 25 20  3d 20 30 20 8c 20 f1 20  |.`6. A% = 0 . . |
000019f0  22 46 69 6c 65 20 22 2b  46 69 6c 65 24 2b 22 20  |"File "+File$+" |
00001a00  64 6f 65 73 20 6e 6f 74  20 65 78 69 73 74 20 21  |does not exist !|
00001a10  21 21 22 3a e1 0d 09 6a  0a 4a 25 20 3d 20 30 0d  |!!":...j.J% = 0.|
00001a20  09 74 05 f5 0d 09 7e 0f  20 20 41 24 20 3d 20 be  |.t....~.  A$ = .|
00001a30  23 41 25 0d 09 88 16 20  20 c8 95 20 c0 41 24 2c  |#A%....  .. .A$,|
00001a40  20 31 29 20 3d 20 22 20  22 0d 09 92 14 20 20 20  | 1) = " "....   |
00001a50  20 41 24 20 3d 20 c1 41  24 2c 20 32 29 0d 09 9c  | A$ = .A$, 2)...|
00001a60  07 20 20 ce 0d 09 a6 0d  20 20 42 24 20 3d 20 22  |.  .....  B$ = "|
00001a70  22 0d 09 b0 0c 20 20 49  25 20 3d 20 31 0d 09 ba  |"....  I% = 1...|
00001a80  07 20 20 f5 0d 09 c4 19  20 20 20 20 42 24 20 2b  |.  .....    B$ +|
00001a90  3d 20 c1 41 24 2c 20 49  25 2c 20 31 29 0d 09 ce  |= .A$, I%, 1)...|
00001aa0  0f 20 20 20 20 49 25 20  2b 3d 20 31 0d 09 d8 1f  |.    I% += 1....|
00001ab0  20 20 fd 20 c1 41 24 20  2b 20 22 20 22 2c 20 49  |  . .A$ + " ", I|
00001ac0  25 2c 20 31 29 20 3d 20  22 20 22 0d 09 e2 1a 20  |%, 1) = " ".... |
00001ad0  20 42 24 20 3d 20 c0 42  24 20 2b 20 22 20 20 20  | B$ = .B$ + "   |
00001ae0  22 2c 20 33 29 0d 09 ec  0d 20 20 43 24 20 3d 20  |", 3)....  C$ = |
00001af0  22 22 0d 09 f6 07 20 20  f5 0d 0a 00 0f 20 20 20  |""....  .....   |
00001b00  20 49 25 20 2b 3d 20 31  0d 0a 0a 1f 20 20 fd 20  | I% += 1....  . |
00001b10  c1 41 24 20 2b 20 22 2a  22 2c 20 49 25 2c 20 31  |.A$ + "*", I%, 1|
00001b20  29 20 3e 20 22 20 22 0d  0a 14 07 20 20 f5 0d 0a  |) > " "....  ...|
00001b30  1e 19 20 20 20 20 43 24  20 2b 3d 20 c1 41 24 2c  |..    C$ += .A$,|
00001b40  20 49 25 2c 20 31 29 0d  0a 28 0f 20 20 20 20 49  | I%, 1)..(.    I|
00001b50  25 20 2b 3d 20 31 0d 0a  32 1c 20 20 fd 20 c1 41  |% += 1..2.  . .A|
00001b60  24 20 2b 20 22 20 22 2c  20 49 25 29 20 3d 20 22  |$ + " ", I%) = "|
00001b70  20 22 0d 0a 3c 2b 20 20  e7 20 4a 25 20 3c 20 43  | "..<+  . J% < C|
00001b80  44 46 53 5f 47 69 76 65  46 69 6c 65 54 79 70 65  |DFS_GiveFileType|
00001b90  5f 4e 75 6d 5f 54 72 61  6e 73 25 20 8c 0d 0a 46  |_Num_Trans% ...F|
00001ba0  1d 20 20 20 20 f2 53 65  74 54 72 61 6e 73 28 4a  |.    .SetTrans(J|
00001bb0  25 2c 20 42 24 2c 20 43  24 29 0d 0a 50 0f 20 20  |%, B$, C$)..P.  |
00001bc0  20 20 4a 25 20 2b 3d 20  31 0d 0a 5a 07 20 20 cc  |  J% += 1..Z.  .|
00001bd0  0d 0a 64 62 20 20 20 20  f1 20 22 53 6f 72 72 79  |..db    . "Sorry|
00001be0  20 6f 6e 6c 79 20 22 20  2b 20 c3 43 44 46 53 5f  | only " + .CDFS_|
00001bf0  47 69 76 65 46 69 6c 65  54 79 70 65 5f 4e 75 6d  |GiveFileType_Num|
00001c00  5f 54 72 61 6e 73 25 20  2b 20 22 20 54 72 61 6e  |_Trans% + " Tran|
00001c10  73 6c 61 74 69 6f 6e 73  20 70 6f 73 73 69 62 6c  |slations possibl|
00001c20  65 20 21 21 21 22 20 3a  20 cf 23 41 25 3d a2 23  |e !!!" : .#A%=.#|
00001c30  41 25 0d 0a 6e 07 20 20  cd 0d 0a 78 0a fd 20 c5  |A%..n.  ...x.. .|
00001c40  23 41 25 0d 0a 82 1d f2  53 65 74 54 72 61 6e 73  |#A%.....SetTrans|
00001c50  28 4a 25 2c 20 22 22 2c  20 22 26 30 30 30 22 29  |(J%, "", "&000")|
00001c60  0d 0a 8c 08 d9 23 41 25  0d 0a 96 05 e1 0d 0a a0  |.....#A%........|
00001c70  04 0d 0a aa 0b dd 20 f2  4c 69 73 74 0d 0a b4 08  |...... .List....|
00001c80  ea 20 4b 25 0d 0a be 08  4b 25 3d 30 0d 0a c8 05  |. K%....K%=0....|
00001c90  f1 0d 0a d2 25 f1 20 22  20 20 20 20 43 44 46 53  |....%. "    CDFS|
00001ca0  20 74 79 70 65 20 74 72  61 6e 73 6c 61 74 69 6f  | type translatio|
00001cb0  6e 20 20 20 20 22 0d 0a  dc 25 f1 20 22 20 20 20  |n    "...%. "   |
00001cc0  20 4e 75 6d 62 65 72 20  20 44 6f 73 20 20 20 20  | Number  Dos    |
00001cd0  20 20 52 69 73 63 4f 53  20 20 22 0d 0a e6 25 f1  |  RiscOS  "...%.|
00001ce0  20 22 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  | "--------------|
00001cf0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 22  |---------------"|
00001d00  0d 0a f0 1f c8 95 20 28  a4 47 65 74 54 72 61 6e  |...... (.GetTran|
00001d10  73 44 6f 73 28 4b 25 29  20 3c 3e 20 22 22 29 0d  |sDos(K%) <> "").|
00001d20  0a fa 48 20 20 20 20 f1  20 4b 25 2c 20 c0 22 20  |..H    . K%, ." |
00001d30  20 22 20 2b 20 a4 47 65  74 54 72 61 6e 73 44 6f  | " + .GetTransDo|
00001d40  73 28 4b 25 29 20 2b 20  c4 31 31 2c 20 22 20 22  |s(K%) + .11, " "|
00001d50  29 2c 20 31 31 29 20 2b  20 a4 54 72 61 6e 73 6c  |), 11) + .Transl|
00001d60  61 74 65 28 4b 25 29 0d  0b 04 0f 20 20 20 20 4b  |ate(K%)....    K|
00001d70  25 20 2b 3d 20 31 0d 0b  0e 05 ce 0d 0b 18 25 e7  |% += 1........%.|
00001d80  20 4b 25 20 3d 20 30 20  8c 20 f1 20 22 4e 6f 20  | K% = 0 . . "No |
00001d90  74 72 61 6e 73 6c 61 74  69 6f 6e 73 21 21 21 22  |translations!!!"|
00001da0  0d 0b 22 05 e1 0d 0b 2c  04 0d 0b 36 0f dd 20 f2  |.."....,...6.. .|
00001db0  6d 61 6b 65 63 6f 64 65  0d 0b 40 1d ea 20 70 61  |makecode..@.. pa|
00001dc0  73 73 25 2c 20 63 6f 64  65 25 2c 20 65 6e 64 6c  |ss%, code%, endl|
00001dd0  69 73 74 73 25 0d 0b 4a  3d 63 6f 64 65 25 20 20  |ists%..J=code%  |
00001de0  20 20 20 3d 20 43 44 46  53 5f 42 61 73 65 5f 41  |   = CDFS_Base_A|
00001df0  64 64 72 25 20 2b 20 43  44 46 53 5f 47 69 76 65  |ddr% + CDFS_Give|
00001e00  46 69 6c 65 54 79 70 65  5f 43 6f 64 65 5f 4f 66  |FileType_Code_Of|
00001e10  66 25 0d 0b 54 40 65 6e  64 6c 69 73 74 73 25 20  |f%..T@endlists% |
00001e20  3d 20 43 44 46 53 5f 42  61 73 65 5f 41 64 64 72  |= CDFS_Base_Addr|
00001e30  25 20 2b 20 43 44 46 53  5f 47 69 76 65 46 69 6c  |% + CDFS_GiveFil|
00001e40  65 54 79 70 65 5f 45 6e  64 4c 69 73 74 5f 4f 66  |eType_EndList_Of|
00001e50  66 25 0d 0b 5e 04 0d 0b  68 17 e3 20 70 61 73 73  |f%..^...h.. pass|
00001e60  25 20 3d 20 30 20 b8 20  32 20 88 20 32 0d 0b 72  |% = 0 . 2 . 2..r|
00001e70  12 20 20 20 20 50 25 20  3d 20 63 6f 64 65 25 0d  |.    P% = code%.|
00001e80  0b 7c 13 20 20 20 20 5b  20 6f 70 74 20 70 61 73  |.|.    [ opt pas|
00001e90  73 25 0d 0b 86 04 0d 0b  90 0e 3b 20 6f 6e 20 65  |s%........; on e|
00001ea0  6e 74 72 79 0d 0b 9a 31  3b 20 52 30 20 3d 20 70  |ntry...1; R0 = p|
00001eb0  6f 69 6e 74 65 72 20 74  6f 20 66 69 6c 65 6e 61  |ointer to filena|
00001ec0  6d 65 20 77 69 74 68 20  74 65 72 6d 69 6e 61 74  |me with terminat|
00001ed0  69 6e 67 20 30 0d 0b a4  18 3b 20 52 31 32 20 3d  |ing 0....; R12 =|
00001ee0  20 70 72 69 76 61 74 65  20 77 6f 72 64 0d 0b ae  | private word...|
00001ef0  04 0d 0b b8 52 20 20 20  20 20 20 20 20 20 20 4d  |....R          M|
00001f00  4f 56 20 20 20 20 20 20  20 50 43 2c 20 52 31 34  |OV       PC, R14|
00001f10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001f20  20 20 20 20 20 20 20 3b  20 4f 6e 6c 79 20 69 6e  |       ; Only in|
00001f30  63 6c 75 64 65 64 20 69  6e 69 74 69 61 6c 6c 79  |cluded initially|
00001f40  20 69 6e 0d 0b c2 52 20  20 20 20 20 20 20 20 20  | in...R         |
00001f50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00001f70  20 20 20 20 20 20 20 20  20 3b 20 63 61 73 65 20  |         ; case |
00001f80  61 20 63 61 6c 6c 20 69  73 20 6d 61 64 65 20 69  |a call is made i|
00001f90  6e 20 74 68 65 0d 0b cc  54 20 20 20 20 20 20 20  |n the...T       |
00001fa0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00001fc0  20 20 20 20 20 20 20 20  20 20 20 3b 20 6d 69 64  |           ; mid|
00001fd0  64 6c 65 20 6f 66 20 6d  65 20 67 65 6e 65 72 61  |dle of me genera|
00001fe0  74 69 6e 67 20 63 6f 64  65 0d 0b d6 53 20 20 20  |ting code...S   |
00001ff0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00002010  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00002020  20 41 66 74 65 72 20 61  6c 6c 20 63 6f 64 65 20  | After all code |
00002030  69 73 20 67 65 6e 65 72  61 74 65 64 0d 0b e0 53  |is generated...S|
00002040  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00002070  20 20 3b 20 69 74 20 69  73 20 63 68 61 6e 67 65  |  ; it is change|
00002080  64 20 74 6f 20 42 20 6e  65 77 73 74 61 72 74 0d  |d to B newstart.|
00002090  0b ea 04 0d 0b f4 51 2e  6e 74 72 61 6e 73 25 20  |......Q.ntrans% |
000020a0  20 45 51 55 44 20 20 20  20 20 20 43 44 46 53 5f  | EQUD      CDFS_|
000020b0  47 69 76 65 46 69 6c 65  54 79 70 65 5f 4e 75 6d  |GiveFileType_Num|
000020c0  5f 54 72 61 6e 73 25 20  20 3b 20 69 74 65 6d 73  |_Trans%  ; items|
000020d0  20 69 6e 20 74 72 61 6e  73 6c 61 74 69 6f 6e 20  | in translation |
000020e0  6c 69 73 74 0d 0b fe 50  2e 65 78 74 6f 66 66 25  |list...P.extoff%|
000020f0  20 20 45 51 55 44 20 20  20 20 20 20 43 44 46 53  |  EQUD      CDFS|
00002100  5f 47 69 76 65 46 69 6c  65 54 79 70 65 5f 44 4f  |_GiveFileType_DO|
00002110  53 5f 45 78 74 5f 4f 66  66 25 3b 20 6f 66 66 73  |S_Ext_Off%; offs|
00002120  65 74 20 6f 66 20 65 78  74 65 6e 73 69 6f 6e 20  |et of extension |
00002130  6c 69 73 74 0d 0c 08 4b  2e 64 79 6e 61 72 65 61  |list...K.dynarea|
00002140  25 20 45 51 55 44 20 20  20 20 20 20 30 20 20 20  |% EQUD      0   |
00002150  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002160  20 20 20 20 20 20 20 20  20 20 3b 20 64 79 6e 61  |          ; dyna|
00002170  6d 69 63 20 61 72 65 61  20 28 6f 72 20 30 29 0d  |mic area (or 0).|
00002180  0c 12 51 2e 63 6f 64 65  6f 66 31 25 20 45 51 55  |..Q.codeof1% EQU|
00002190  44 20 20 20 20 20 20 43  44 46 53 5f 47 69 76 65  |D      CDFS_Give|
000021a0  46 69 6c 65 54 79 70 65  5f 43 6f 64 65 5f 4f 66  |FileType_Code_Of|
000021b0  66 25 20 20 20 3b 20 41  64 64 72 65 73 73 20 6f  |f%   ; Address o|
000021c0  66 20 63 6f 64 65 20 69  6e 20 6d 6f 64 75 6c 65  |f code in module|
000021d0  0d 0c 1c 04 0d 0c 26 25  2e 6e 65 77 73 74 61 72  |......&%.newstar|
000021e0  74 20 53 54 4d 44 42 20  20 20 20 20 52 31 33 21  |t STMDB     R13!|
000021f0  2c 20 7b 52 30 2d 52 31  7d 0d 0c 30 41 20 20 20  |, {R0-R1}..0A   |
00002200  20 20 20 20 20 20 20 4c  44 52 20 20 20 20 20 20  |       LDR      |
00002210  20 52 31 2c 20 43 44 46  53 5f 42 61 73 65 5f 41  | R1, CDFS_Base_A|
00002220  64 64 72 25 20 2b 20 43  44 46 53 5f 57 6f 72 6b  |ddr% + CDFS_Work|
00002230  73 70 61 63 65 5f 4f 66  66 25 0d 0c 3a 23 20 20  |space_Off%..:#  |
00002240  20 20 20 20 20 20 20 20  41 44 44 20 20 20 20 20  |        ADD     |
00002250  20 20 52 31 2c 20 52 31  2c 20 52 31 32 0d 0c 44  |  R1, R1, R12..D|
00002260  4f 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |O          MOV  |
00002270  20 20 20 20 20 52 31 31  2c 20 52 31 20 20 20 20  |     R11, R1    |
00002280  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002290  20 20 20 3b 20 52 31 31  20 3d 20 70 72 69 76 61  |   ; R11 = priva|
000022a0  74 65 20 77 6f 72 6b 73  70 61 63 65 0d 0c 4e 25  |te workspace..N%|
000022b0  20 20 20 20 20 20 20 20  20 20 4c 44 4d 49 41 20  |          LDMIA |
000022c0  20 20 20 20 52 31 33 21  2c 20 7b 52 30 2d 52 31  |    R13!, {R0-R1|
000022d0  7d 0d 0c 58 04 0d 0c 62  1c 3b 20 67 65 74 20 66  |}..X...b.; get f|
000022e0  69 6c 65 6e 61 6d 65 20  65 78 74 65 6e 73 69 6f  |ilename extensio|
000022f0  6e 0d 0c 6c 1e 20 20 20  20 20 20 20 20 20 20 4d  |n..l.          M|
00002300  4f 56 20 20 20 20 20 20  20 52 33 2c 20 52 30 0d  |OV       R3, R0.|
00002310  0c 76 04 0d 0c 80 24 2e  6c 6f 6f 70 31 20 20 20  |.v....$.loop1   |
00002320  20 4c 44 52 42 20 20 20  20 20 20 52 31 2c 20 5b  | LDRB      R1, [|
00002330  52 33 5d 2c 20 23 31 0d  0c 8a 1e 20 20 20 20 20  |R3], #1....     |
00002340  20 20 20 20 20 43 4d 50  20 20 20 20 20 20 20 52  |     CMP       R|
00002350  31 2c 20 23 30 0d 0c 94  29 20 20 20 20 20 20 20  |1, #0...)       |
00002360  20 20 20 4c 44 4d 45 51  49 41 20 20 20 52 31 33  |   LDMEQIA   R13|
00002370  21 2c 20 7b 52 30 2d 52  39 2c 52 31 34 7d 0d 0c  |!, {R0-R9,R14}..|
00002380  9e 48 20 20 20 20 20 20  20 20 20 20 ec 51 20 20  |.H          .Q  |
00002390  20 20 20 52 31 2c 20 23  30 20 20 20 20 20 20 20  |   R1, #0       |
000023a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000023b0  20 3b 20 4a 75 73 74 20  62 65 65 6e 20 77 69 70  | ; Just been wip|
000023c0  65 64 20 6f 75 74 0d 0c  a8 53 20 20 20 20 20 20  |ed out...S      |
000023d0  20 20 20 20 42 49 43 45  51 53 20 20 20 20 50 43  |    BICEQS    PC|
000023e0  2c 20 52 31 34 2c 20 23  26 31 30 30 30 30 30 30  |, R14, #&1000000|
000023f0  30 20 20 20 20 20 20 20  20 20 20 20 3b 20 65 78  |0           ; ex|
00002400  69 74 20 69 66 20 6e 75  6c 6c 20 66 69 6c 65 6e  |it if null filen|
00002410  61 6d 65 20 6f 72 20 6e  6f 0d 0c b2 41 20 20 20  |ame or no...A   |
00002420  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00002440  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00002450  20 65 78 74 65 6e 73 69  6f 6e 0d 0c bc 21 20 20  | extension...!  |
00002460  20 20 20 20 20 20 20 20  54 45 51 20 20 20 20 20  |        TEQ     |
00002470  20 20 52 31 2c 20 23 97  22 2e 22 0d 0c c6 1d 20  |  R1, #.".".... |
00002480  20 20 20 20 20 20 20 20  20 42 4e 45 20 20 20 20  |         BNE    |
00002490  20 20 20 6c 6f 6f 70 31  0d 0c d0 1e 20 20 20 20  |   loop1....    |
000024a0  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 20 20  |      MOV       |
000024b0  52 37 2c 20 52 33 0d 0c  da 04 0d 0c e4 35 3b 20  |R7, R3.......5; |
000024c0  52 33 20 70 6f 69 6e 74  73 20 74 6f 20 73 74 61  |R3 points to sta|
000024d0  72 74 20 6f 66 20 65 78  74 65 6e 73 69 6f 6e 20  |rt of extension |
000024e0  28 61 66 74 65 72 20 74  68 65 20 22 2e 22 29 0d  |(after the ".").|
000024f0  0c ee 2b 3b 20 43 61 6c  63 75 6c 61 74 65 20 34  |..+; Calculate 4|
00002500  20 62 79 74 65 20 65 78  74 65 6e 73 69 6f 6e 20  | byte extension |
00002510  77 6f 72 64 20 69 6e 20  52 30 0d 0c f8 1e 20 20  |word in R0....  |
00002520  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
00002530  20 20 52 30 2c 20 23 30  0d 0d 02 1e 20 20 20 20  |  R0, #0....    |
00002540  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 20 20  |      MOV       |
00002550  52 32 2c 20 23 30 0d 0d  0c 04 0d 0d 16 24 2e 6c  |R2, #0.......$.l|
00002560  6f 6f 70 32 20 20 20 20  4c 44 52 42 20 20 20 20  |oop2    LDRB    |
00002570  20 20 52 31 2c 20 5b 52  37 5d 2c 20 23 31 0d 0d  |  R1, [R7], #1..|
00002580  34 3f 20 20 20 20 20 20  20 20 20 20 52 53 42 53  |4?          RSBS|
00002590  20 20 20 20 20 20 52 34  2c 20 52 31 2c 20 23 97  |      R4, R1, #.|
000025a0  22 61 22 20 20 20 20 20  20 20 20 20 20 20 20 20  |"a"             |
000025b0  20 20 3b 20 27 61 27 20  3c 3d 20 52 31 0d 0d 3e  |  ; 'a' <= R1..>|
000025c0  41 20 20 20 20 20 20 20  20 20 20 43 4d 50 4c 45  |A          CMPLE|
000025d0  20 20 20 20 20 52 31 2c  20 23 97 22 7a 22 20 20  |     R1, #."z"  |
000025e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000025f0  20 3b 20 26 20 52 31 20  3c 3d 20 27 7a 27 0d 0d  | ; & R1 <= 'z'..|
00002600  48 2c 20 20 20 20 20 20  20 20 20 20 53 55 42 4c  |H,          SUBL|
00002610  45 20 20 20 20 20 52 31  2c 20 52 31 2c 20 23 28  |E     R1, R1, #(|
00002620  97 22 61 22 2d 97 22 41  22 29 0d 0d 52 50 20 20  |."a"-."A")..RP  |
00002630  20 20 20 20 20 20 20 20  41 44 44 20 20 20 20 20  |        ADD     |
00002640  20 20 52 30 2c 20 52 30  2c 20 52 31 2c 20 4c 53  |  R0, R0, R1, LS|
00002650  4c 20 52 32 20 20 20 20  20 20 20 20 20 20 20 20  |L R2            |
00002660  3b 20 49 6e 73 65 72 74  20 62 79 74 65 20 28 62  |; Insert byte (b|
00002670  61 63 6b 77 61 72 64 73  21 29 0d 0d 5c 22 20 20  |ackwards!)..\"  |
00002680  20 20 20 20 20 20 20 20  41 44 44 20 20 20 20 20  |        ADD     |
00002690  20 20 52 32 2c 20 52 32  2c 20 23 38 0d 0d 70 04  |  R2, R2, #8..p.|
000026a0  0d 0d 71 1e 20 20 20 20  20 20 20 20 20 20 43 4d  |..q.          CM|
000026b0  50 20 20 20 20 20 20 20  52 31 2c 20 23 30 0d 0d  |P       R1, #0..|
000026c0  7a 1d 20 20 20 20 20 20  20 20 20 20 42 4e 45 20  |z.          BNE |
000026d0  20 20 20 20 20 20 6c 6f  6f 70 32 0d 0d 84 04 0d  |      loop2.....|
000026e0  0d 8e 1d 3b 20 52 33 20  3d 20 73 74 61 72 74 20  |...; R3 = start |
000026f0  6f 66 20 65 78 74 65 6e  73 69 6f 6e 0d 0d 98 34  |of extension...4|
00002700  3b 20 52 37 20 3d 20 65  6e 64 20 6f 66 20 65 78  |; R7 = end of ex|
00002710  74 65 6e 73 69 6f 6e 20  2b 20 31 20 62 79 74 65  |tension + 1 byte|
00002720  20 28 69 2e 65 2e 20 74  68 65 20 6e 75 6c 6c 29  | (i.e. the null)|
00002730  0d 0d a2 50 20 20 20 20  20 20 20 20 20 20 53 55  |...P          SU|
00002740  42 20 20 20 20 20 20 20  52 37 2c 20 52 37 2c 20  |B       R7, R7, |
00002750  52 33 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R3              |
00002760  20 20 20 20 20 20 3b 20  4c 65 6e 67 74 68 20 6f  |      ; Length o|
00002770  66 20 65 78 74 65 6e 73  69 6f 6e 20 2b 20 31 2e  |f extension + 1.|
00002780  0d 0d ac 48 20 20 20 20  20 20 20 20 20 20 20 20  |...H            |
00002790  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000027b0  20 20 20 20 20 20 3b 20  32 20 74 6f 20 34 20 61  |      ; 2 to 4 a|
000027c0  72 65 20 76 61 6c 69 64  0d 0d b6 3f 20 20 20 20  |re valid...?    |
000027d0  20 20 20 20 20 20 52 53  42 53 20 20 20 20 20 20  |      RSBS      |
000027e0  52 31 2c 20 52 37 2c 20  23 32 20 20 20 20 20 20  |R1, R7, #2      |
000027f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00002800  32 20 3c 3d 20 52 37 0d  0d c0 41 20 20 20 20 20  |2 <= R7...A     |
00002810  20 20 20 20 20 43 4d 50  4c 45 20 20 20 20 20 52  |     CMPLE     R|
00002820  37 2c 20 23 34 20 20 20  20 20 20 20 20 20 20 20  |7, #4           |
00002830  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 26  |             ; &|
00002840  20 52 37 20 3c 3d 20 34  0d 0d ca 2a 20 20 20 20  | R7 <= 4...*    |
00002850  20 20 20 20 20 20 4c 44  4d 47 54 49 41 20 20 20  |      LDMGTIA   |
00002860  52 31 33 21 2c 20 7b 52  30 2d 52 39 2c 20 52 31  |R13!, {R0-R9, R1|
00002870  34 7d 0d 0d d4 1e 20 20  20 20 20 20 20 20 20 20  |4}....          |
00002880  4d 4f 56 47 54 20 20 20  20 20 52 31 2c 20 23 30  |MOVGT     R1, #0|
00002890  0d 0d de 51 20 20 20 20  20 20 20 20 20 20 42 49  |...Q          BI|
000028a0  43 47 54 53 20 20 20 20  50 43 2c 20 52 31 34 2c  |CGTS    PC, R14,|
000028b0  20 23 26 31 30 30 30 30  30 30 30 20 20 20 20 20  | #&10000000     |
000028c0  20 20 20 20 20 20 3b 20  65 78 69 74 20 69 66 20  |      ; exit if |
000028d0  65 78 74 65 6e 73 69 6f  6e 20 69 73 20 6d 6f 72  |extension is mor|
000028e0  65 0d 0d e8 49 20 20 20  20 20 20 20 20 20 20 20  |e...I           |
000028f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00002910  20 20 20 20 20 20 20 3b  20 74 68 61 6e 20 33 20  |       ; than 3 |
00002920  63 68 61 72 61 63 74 65  72 73 0d 0d f2 04 0d 0d  |characters......|
00002930  fc 32 3b 20 6e 6f 77 20  73 65 65 20 69 66 20 69  |.2; now see if i|
00002940  74 20 63 61 6e 20 62 65  20 66 6f 75 6e 64 20 69  |t can be found i|
00002950  6e 20 65 78 74 65 6e 73  69 6f 6e 20 6c 69 73 74  |n extension list|
00002960  0d 0e 06 51 20 20 20 20  20 20 20 20 20 20 4c 44  |...Q          LD|
00002970  52 20 20 20 20 20 20 20  52 34 2c 20 65 78 74 6f  |R       R4, exto|
00002980  66 66 25 20 20 20 20 20  20 20 20 20 20 20 20 20  |ff%             |
00002990  20 20 20 20 20 20 3b 20  41 64 64 72 65 73 73 20  |      ; Address |
000029a0  6f 66 20 65 78 74 65 6e  73 69 6f 6e 20 6c 69 73  |of extension lis|
000029b0  74 0d 0e 10 45 20 20 20  20 20 20 20 20 20 20 4c  |t...E          L|
000029c0  44 52 20 20 20 20 20 20  20 52 36 2c 20 64 79 6e  |DR       R6, dyn|
000029d0  61 72 65 61 25 20 20 20  20 20 20 20 20 20 20 20  |area%           |
000029e0  20 20 20 20 20 20 20 3b  20 73 74 61 72 74 20 6f  |       ; start o|
000029f0  66 20 63 6f 64 65 0d 0e  1a 1e 20 20 20 20 20 20  |f code....      |
00002a00  20 20 20 20 43 4d 50 20  20 20 20 20 20 20 52 36  |    CMP       R6|
00002a10  2c 20 23 30 0d 0e 24 48  20 20 20 20 20 20 20 20  |, #0..$H        |
00002a20  20 20 41 44 52 45 51 20  20 20 20 20 52 36 2c 20  |  ADREQ     R6, |
00002a30  63 6f 64 65 25 20 20 20  20 20 20 20 20 20 20 20  |code%           |
00002a40  20 20 20 20 20 20 20 20  20 20 3b 20 4e 65 65 64  |          ; Need|
00002a50  73 20 72 65 6c 6f 63 61  74 69 6e 67 0d 0e 2e 51  |s relocating...Q|
00002a60  20 20 20 20 20 20 20 20  20 20 4c 44 52 45 51 20  |          LDREQ |
00002a70  20 20 20 20 52 37 2c 20  63 6f 64 65 6f 66 31 25  |    R7, codeof1%|
00002a80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002a90  20 20 3b 20 4f 66 66 73  65 74 20 6f 66 20 63 6f  |  ; Offset of co|
00002aa0  64 65 20 66 72 6f 6d 20  73 74 61 72 74 0d 0e 38  |de from start..8|
00002ab0  22 20 20 20 20 20 20 20  20 20 20 53 55 42 45 51  |"          SUBEQ|
00002ac0  20 20 20 20 20 52 36 2c  20 52 36 2c 20 52 37 0d  |     R6, R6, R7.|
00002ad0  0e 42 45 20 20 20 20 20  20 20 20 20 20 41 44 44  |.BE          ADD|
00002ae0  20 20 20 20 20 20 20 52  34 2c 20 52 34 2c 20 52  |       R4, R4, R|
00002af0  36 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |6               |
00002b00  20 20 20 20 20 3b 20 53  74 61 72 74 20 6f 66 20  |     ; Start of |
00002b10  6c 69 73 74 0d 0e 4c 04  0d 0e 56 26 2e 6e 78 74  |list..L...V&.nxt|
00002b20  5f 65 78 74 20 20 4c 44  4d 49 41 20 20 20 20 20  |_ext  LDMIA     |
00002b30  52 34 21 2c 20 7b 52 39  2c 20 52 31 30 7d 0d 0e  |R4!, {R9, R10}..|
00002b40  60 1e 20 20 20 20 20 20  20 20 20 20 43 4d 50 20  |`.          CMP |
00002b50  20 20 20 20 20 20 52 30  2c 20 52 39 0d 0e 6a 1d  |      R0, R9..j.|
00002b60  20 20 20 20 20 20 20 20  20 20 42 45 51 20 20 20  |          BEQ   |
00002b70  20 20 20 20 66 6f 75 6e  64 0d 0e 74 1e 20 20 20  |    found..t.   |
00002b80  20 20 20 20 20 20 20 43  4d 50 20 20 20 20 20 20  |       CMP      |
00002b90  20 52 39 2c 20 23 30 0d  0e 7e 1f 20 20 20 20 20  | R9, #0..~.     |
00002ba0  20 20 20 20 20 42 4e 45  20 20 20 20 20 20 20 6e  |     BNE       n|
00002bb0  78 74 5f 65 78 74 0d 0e  88 04 0d 0e 92 04 0d 0e  |xt_ext..........|
00002bc0  9c 2a 20 20 20 20 20 20  20 20 20 20 4c 44 4d 49  |.*          LDMI|
00002bd0  41 20 20 20 20 20 52 31  33 21 2c 20 7b 52 30 2d  |A     R13!, {R0-|
00002be0  52 39 2c 20 52 31 34 7d  0d 0e a6 1d 20 20 20 20  |R9, R14}....    |
00002bf0  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 20 20  |      MOV       |
00002c00  52 31 2c 23 30 0d 0e b0  51 20 20 20 20 20 20 20  |R1,#0...Q       |
00002c10  20 20 20 42 49 43 53 20  20 20 20 20 20 50 43 2c  |   BICS      PC,|
00002c20  20 52 31 34 2c 20 23 26  31 30 30 30 30 30 30 30  | R14, #&10000000|
00002c30  20 20 20 20 20 20 20 20  20 20 20 3b 20 45 78 69  |           ; Exi|
00002c40  74 20 69 66 20 6e 6f 74  20 66 6f 75 6e 64 20 69  |t if not found i|
00002c50  6e 20 6c 69 73 74 0d 0e  ba 04 0d 0e c4 04 0d 0e  |n list..........|
00002c60  ce 2b 3b 20 49 66 20 79  6f 75 20 67 65 74 20 68  |.+; If you get h|
00002c70  65 72 65 2c 20 52 31 30  20 69 73 20 74 68 65 20  |ere, R10 is the |
00002c80  66 69 6c 65 20 74 79 70  65 0d 0e d8 04 0d 0e e2  |file type.......|
00002c90  2a 2e 66 6f 75 6e 64 20  20 20 20 4c 44 4d 49 41  |*.found    LDMIA|
00002ca0  20 20 20 20 20 52 31 33  21 2c 20 7b 52 30 2d 52  |     R13!, {R0-R|
00002cb0  39 2c 20 52 31 34 7d 0d  0e ec 1f 20 20 20 20 20  |9, R14}....     |
00002cc0  20 20 20 20 20 4d 4f 56  20 20 20 20 20 20 20 52  |     MOV       R|
00002cd0  31 2c 20 52 31 30 0d 0e  f6 41 20 20 20 20 20 20  |1, R10...A      |
00002ce0  20 20 20 20 42 49 43 53  20 20 20 20 20 20 50 43  |    BICS      PC|
00002cf0  2c 20 52 31 34 2c 20 23  26 31 30 30 30 30 30 30  |, R14, #&1000000|
00002d00  30 20 20 20 20 20 20 20  20 20 20 20 3b 20 54 61  |0           ; Ta|
00002d10  74 74 79 20 62 79 65 0d  0f 00 04 0d 0f 0a 11 2e  |tty bye.........|
00002d20  65 6e 64 5f 6f 66 5f 63  6f 64 65 25 0d 0f 14 41  |end_of_code%...A|
00002d30  20 20 20 20 20 20 20 20  20 20 20 3b 73 74 61 72  |           ;star|
00002d40  74 20 6f 66 20 6c 69 73  74 20 6f 66 20 65 78 74  |t of list of ext|
00002d50  65 6e 73 69 6f 6e 73 2c  20 74 65 72 6d 69 6e 61  |ensions, termina|
00002d60  74 65 64 20 62 79 20 77  6f 72 64 3d 30 0d 0f 1e  |ted by word=0...|
00002d70  04 0d 0f 28 09 20 20 20  20 5d 0d 0f 32 04 0d 0f  |...(.    ]..2...|
00002d80  3c 38 20 20 20 20 f4 20  52 65 6d 65 6d 62 65 72  |<8    . Remember|
00002d90  20 74 6f 20 61 6c 6c 6f  77 20 72 6f 6f 6d 20 66  | to allow room f|
00002da0  6f 72 20 74 68 65 20 6e  75 6c 6c 20 74 65 72 6d  |or the null term|
00002db0  69 6e 61 74 6f 72 0d 0f  46 4b 20 20 20 20 43 44  |inator..FK    CD|
00002dc0  46 53 5f 47 69 76 65 46  69 6c 65 54 79 70 65 5f  |FS_GiveFileType_|
00002dd0  4e 75 6d 5f 54 72 61 6e  73 25 20 20 20 3d 20 28  |Num_Trans%   = (|
00002de0  65 6e 64 6c 69 73 74 73  25 20 2d 20 65 6e 64 5f  |endlists% - end_|
00002df0  6f 66 5f 63 6f 64 65 25  29 20 2f 20 38 20 2d 20  |of_code%) / 8 - |
00002e00  31 0d 0f 50 47 20 20 20  20 43 44 46 53 5f 47 69  |1..PG    CDFS_Gi|
00002e10  76 65 46 69 6c 65 54 79  70 65 5f 44 4f 53 5f 45  |veFileType_DOS_E|
00002e20  78 74 5f 4f 66 66 25 20  3d 20 65 6e 64 5f 6f 66  |xt_Off% = end_of|
00002e30  5f 63 6f 64 65 25 20 2d  20 43 44 46 53 5f 42 61  |_code% - CDFS_Ba|
00002e40  73 65 5f 41 64 64 72 25  0d 0f 5a 05 ed 0d 0f 64  |se_Addr%..Z....d|
00002e50  04 0d 0f 6e 2b f4 20 49  66 20 77 65 20 61 72 65  |...n+. If we are|
00002e60  20 52 4f 53 33 2e 35 2c  20 75 73 65 20 61 20 64  | ROS3.5, use a d|
00002e70  79 6e 61 6d 69 63 20 61  72 65 61 2e 0d 0f 78 19  |ynamic area...x.|
00002e80  e7 20 4f 73 56 65 72 73  69 6f 6e 25 20 3e 3d 20  |. OsVersion% >= |
00002e90  33 35 30 20 8c 0d 0f 82  30 20 20 20 43 44 46 53  |350 ....0   CDFS|
00002ea0  5f 47 69 76 65 46 69 6c  65 54 79 70 65 5f 4e 75  |_GiveFileType_Nu|
00002eb0  6d 5f 54 72 61 6e 73 25  20 3d 20 6d 61 78 5f 74  |m_Trans% = max_t|
00002ec0  72 61 6e 73 25 0d 0f 8c  1c 20 20 20 21 6e 74 72  |rans%....   !ntr|
00002ed0  61 6e 73 25 20 3d 20 6d  61 78 5f 74 72 61 6e 73  |ans% = max_trans|
00002ee0  25 0d 0f 96 13 20 20 20  21 65 78 74 6f 66 66 25  |%....   !extoff%|
00002ef0  20 3d 20 30 0d 0f a0 92  20 20 20 c8 99 20 22 4f  | = 0....   .. "O|
00002f00  53 5f 44 79 6e 61 6d 69  63 41 72 65 61 22 2c 20  |S_DynamicArea", |
00002f10  30 2c 20 2d 31 2c 20 28  6d 61 78 5f 74 72 61 6e  |0, -1, (max_tran|
00002f20  73 25 20 2b 20 31 29 20  2a 20 38 2c 20 2d 31 2c  |s% + 1) * 8, -1,|
00002f30  20 31 20 3c 3c 20 37 2c  20 28 6d 61 78 5f 74 72  | 1 << 7, (max_tr|
00002f40  61 6e 73 25 20 2b 20 31  29 20 2a 20 38 2c 20 30  |ans% + 1) * 8, 0|
00002f50  2c 20 30 2c 20 22 43 44  20 54 72 61 6e 73 6c 61  |, 0, "CD Transla|
00002f60  74 69 6f 6e 73 22 20 2b  20 bd 30 20 b8 20 2c 20  |tions" + .0 . , |
00002f70  21 63 6f 64 65 6f 66 31  25 2c 20 2c 20 21 64 79  |!codeof1%, , !dy|
00002f80  6e 61 72 65 61 25 0d 0f  aa 05 cd 0d 0f b4 04 0d  |narea%..........|
00002f90  0f be 36 f4 20 6e 6f 77  20 61 6c 6c 20 63 6f 64  |..6. now all cod|
00002fa0  65 20 69 73 20 67 65 6e  65 72 61 74 65 64 20 61  |e is generated a|
00002fb0  6c 6c 6f 77 20 69 74 20  74 6f 20 62 65 20 65 6e  |llow it to be en|
00002fc0  74 65 72 65 64 0d 0f c8  17 e3 20 70 61 73 73 25  |tered..... pass%|
00002fd0  20 3d 20 30 20 b8 20 32  20 88 20 32 0d 0f d2 12  | = 0 . 2 . 2....|
00002fe0  20 20 20 20 50 25 20 3d  20 63 6f 64 65 25 0d 0f  |    P% = code%..|
00002ff0  dc 13 20 20 20 20 5b 20  6f 70 74 20 70 61 73 73  |..    [ opt pass|
00003000  25 0d 0f e6 1c 20 20 20  20 20 20 20 20 20 20 42  |%....          B|
00003010  20 20 20 20 20 6e 65 77  73 74 61 72 74 0d 0f f0  |     newstart...|
00003020  09 20 20 20 20 5d 0d 0f  fa 05 ed 0d 10 04 04 0d  |.    ]..........|
00003030  10 0e 1a f4 20 53 65 74  20 75 70 20 62 61 73 65  |.... Set up base|
00003040  20 70 6f 69 6e 74 65 72  73 0d 10 18 18 f2 5f 67  | pointers....._g|
00003050  65 74 5f 70 61 74 63 68  5f 70 6f 69 6e 74 65 72  |et_patch_pointer|
00003060  73 0d 10 22 05 e1 0d 10  2c 04 0d 10 36 04 0d 10  |s.."....,...6...|
00003070  40 12 dd 20 a4 67 65 74  62 61 73 65 43 44 46 53  |@.. .getbaseCDFS|
00003080  0d 10 4a 15 ea 20 43 44  46 53 5f 42 61 73 65 5f  |..J.. CDFS_Base_|
00003090  41 64 64 72 25 0d 10 54  3d c8 99 20 22 58 4f 53  |Addr%..T=.. "XOS|
000030a0  5f 4d 6f 64 75 6c 65 22  2c 20 31 38 2c 20 22 43  |_Module", 18, "C|
000030b0  44 46 53 22 20 b8 20 2c  20 2c 20 2c 20 43 44 46  |DFS" . , , , CDF|
000030c0  53 5f 42 61 73 65 5f 41  64 64 72 25 3b 66 6c 61  |S_Base_Addr%;fla|
000030d0  67 25 0d 10 5e 39 e7 20  66 6c 61 67 25 20 80 20  |g%..^9. flag% . |
000030e0  31 20 8c 20 85 20 a2 20  32 37 2c 22 4d 6f 64 75  |1 . . . 27,"Modu|
000030f0  6c 65 20 43 44 46 53 20  64 6f 65 73 20 6e 6f 74  |le CDFS does not|
00003100  20 65 78 69 73 74 20 21  21 21 22 0d 10 68 15 3d  | exist !!!"..h.=|
00003110  20 43 44 46 53 5f 42 61  73 65 5f 41 64 64 72 25  | CDFS_Base_Addr%|
00003120  0d 10 72 04 0d 10 7c 04  0d 10 86 2b dd 20 a4 63  |..r...|....+. .c|
00003130  68 65 63 6b 56 65 72 73  43 44 46 53 28 56 65 72  |heckVersCDFS(Ver|
00003140  73 50 74 72 25 2c 20 56  65 72 73 4e 65 65 64 65  |sPtr%, VersNeede|
00003150  64 24 29 0d 10 90 0f ea  20 43 75 72 72 56 65 72  |d$)..... CurrVer|
00003160  73 24 0d 10 9a 12 43 75  72 72 56 65 72 73 24 20  |s$....CurrVers$ |
00003170  3d 20 22 22 0d 10 a4 05  f5 0d 10 ae 1c 20 20 20  |= "".........   |
00003180  20 e7 20 28 3f 56 65 72  73 50 74 72 25 29 20 3e  | . (?VersPtr%) >|
00003190  20 33 31 20 8c 0d 10 b8  23 20 20 20 20 20 20 43  | 31 ....#      C|
000031a0  75 72 72 56 65 72 73 24  20 2b 3d 20 bd 28 3f 56  |urrVers$ += .(?V|
000031b0  65 72 73 50 74 72 25 29  0d 10 c2 09 20 20 20 20  |ersPtr%)....    |
000031c0  cd 0d 10 cc 15 20 20 20  20 56 65 72 73 50 74 72  |.....    VersPtr|
000031d0  25 20 2b 3d 20 31 0d 10  d6 13 fd 20 3f 56 65 72  |% += 1..... ?Ver|
000031e0  73 50 74 72 25 20 3d 20  30 0d 10 e0 1f 3d 20 28  |sPtr% = 0....= (|
000031f0  43 75 72 72 56 65 72 73  24 20 3d 20 56 65 72 73  |CurrVers$ = Vers|
00003200  4e 65 65 64 65 64 24 29  0d 10 ea 04 0d 10 f4 04  |Needed$)........|
00003210  0d 10 fe 25 f4 20 67 65  74 20 61 6e 79 20 63 6f  |...%. get any co|
00003220  6d 6d 61 6e 64 20 73 74  72 69 6e 67 20 26 20 70  |mmand string & p|
00003230  75 74 20 69 6e 0d 11 08  17 f4 20 63 6f 6d 24 28  |ut in..... com$(|
00003240  30 29 20 3d 20 63 6f 6d  6d 61 6e 64 0d 11 12 23  |0) = command...#|
00003250  f4 20 63 6f 6d 24 28 31  29 20 3d 20 6f 70 74 69  |. com$(1) = opti|
00003260  6f 6e 31 20 5b 6f 70 74  69 6f 6e 6c 61 6c 5d 0d  |on1 [optionlal].|
00003270  11 1c 22 f4 20 63 6f 6d  24 28 32 29 20 3d 20 6f  |..". com$(2) = o|
00003280  70 74 69 6f 6e 32 20 5b  6f 70 74 69 6f 6e 61 6c  |ption2 [optional|
00003290  5d 0d 11 26 11 dd 20 f2  67 65 74 43 6f 6d 6d 61  |]..&.. .getComma|
000032a0  6e 64 0d 11 30 1a ea 20  49 25 2c 20 4a 25 2c 20  |nd..0.. I%, J%, |
000032b0  66 6f 75 6e 64 25 2c 20  45 6e 76 24 0d 11 3a 19  |found%, Env$..:.|
000032c0  20 20 c8 99 20 22 4f 53  5f 47 65 74 45 6e 76 22  |  .. "OS_GetEnv"|
000032d0  20 b8 20 49 25 0d 11 44  0e 20 20 66 6f 75 6e 64  | . I%..D.  found|
000032e0  25 3d 30 0d 11 4e 07 20  20 f5 0d 11 58 1c 20 20  |%=0..N.  ...X.  |
000032f0  20 20 e7 20 3f 49 25 3d  33 34 20 8c 20 66 6f 75  |  . ?I%=34 . fou|
00003300  6e 64 25 2b 3d 31 0d 11  62 0d 20 20 20 20 49 25  |nd%+=1..b.    I%|
00003310  2b 3d 31 0d 11 6c 1a 20  20 fd 20 28 66 6f 75 6e  |+=1..l.  . (foun|
00003320  64 25 3d 32 29 84 28 3f  49 25 3d 30 29 0d 11 76  |d%=2).(?I%=0)..v|
00003330  0b 20 20 49 25 2b 3d 31  0d 11 80 18 20 20 e7 20  |.  I%+=1....  . |
00003340  3f 49 25 3d 30 20 8c 20  f2 55 73 61 67 65 3a e0  |?I%=0 . .Usage:.|
00003350  0d 11 8a 0d 20 20 45 6e  76 24 3d 22 22 0d 11 94  |....  Env$=""...|
00003360  07 20 20 f5 0d 11 9e 32  20 20 20 20 e7 20 28 3f  |.  ....2    . (?|
00003370  49 25 3c 31 32 33 20 80  20 3f 49 25 3e 39 36 29  |I%<123 . ?I%>96)|
00003380  20 8c 20 3f 49 25 3d 3f  49 25 20 80 20 25 31 31  | . ?I%=?I% . %11|
00003390  30 31 31 31 31 31 0d 11  a8 14 20 20 20 20 45 6e  |011111....    En|
000033a0  76 24 2b 3d bd 28 3f 49  25 29 0d 11 b2 0d 20 20  |v$+=.(?I%)....  |
000033b0  20 20 49 25 2b 3d 31 0d  11 bc 0d 20 20 fd 20 3f  |  I%+=1....  . ?|
000033c0  49 25 3d 30 0d 11 c6 0a  20 20 49 25 3d 30 0d 11  |I%=0....  I%=0..|
000033d0  d0 07 20 20 f5 0d 11 da  15 20 20 20 20 4a 25 3d  |..  .....    J%=|
000033e0  a7 45 6e 76 24 2c 22 20  22 29 0d 11 e4 11 20 20  |.Env$," ")....  |
000033f0  20 20 e7 20 4a 25 3c 3e  30 20 8c 0d 11 ee 1c 20  |  . J%<>0 ..... |
00003400  20 20 20 20 20 43 6f 6d  24 28 49 25 29 3d c0 45  |     Com$(I%)=.E|
00003410  6e 76 24 2c 4a 25 29 0d  11 f8 1a 20 20 20 20 20  |nv$,J%)....     |
00003420  20 45 6e 76 24 3d c1 45  6e 76 24 2c 4a 25 2b 31  | Env$=.Env$,J%+1|
00003430  29 0d 12 02 0f 20 20 20  20 20 20 49 25 2b 3d 31  |)....      I%+=1|
00003440  0d 12 0c 09 20 20 20 20  cc 0d 12 16 17 20 20 20  |....    .....   |
00003450  20 20 20 43 6f 6d 24 28  49 25 29 3d 45 6e 76 24  |   Com$(I%)=Env$|
00003460  0d 12 20 0f 20 20 20 20  20 20 49 25 3d 2d 31 0d  |.. .      I%=-1.|
00003470  12 2a 09 20 20 20 20 cd  0d 12 34 14 20 20 fd 20  |.*.    ...4.  . |
00003480  49 25 3d 2d 31 20 84 20  49 25 3e 33 0d 12 3e 05  |I%=-1 . I%>3..>.|
00003490  e1 0d 12 48 04 0d 12 52  1a dd 20 f2 5f 67 65 74  |...H...R.. ._get|
000034a0  5f 70 61 74 63 68 5f 70  6f 69 6e 74 65 72 73 0d  |_patch_pointers.|
000034b0  12 5c 50 f4 20 6d 79 20  63 6f 64 65 20 69 6e 20  |.\P. my code in |
000034c0  43 44 46 53 20 73 6f 20  67 65 74 20 6c 69 73 74  |CDFS so get list|
000034d0  27 73 20 6c 65 6e 67 74  68 20 26 20 70 6f 69 6e  |'s length & poin|
000034e0  74 65 72 73 20 74 68 61  74 20 49 20 73 61 76 65  |ters that I save|
000034f0  64 20 6f 6e 20 67 65 6e  65 72 61 74 69 6f 6e 0d  |d on generation.|
00003500  12 66 54 43 44 46 53 5f  47 69 76 65 46 69 6c 65  |.fTCDFS_GiveFile|
00003510  54 79 70 65 5f 4e 75 6d  5f 54 72 61 6e 73 25 20  |Type_Num_Trans% |
00003520  3d 20 43 44 46 53 5f 42  61 73 65 5f 41 64 64 72  |= CDFS_Base_Addr|
00003530  25 21 28 43 44 46 53 5f  47 69 76 65 46 69 6c 65  |%!(CDFS_GiveFile|
00003540  54 79 70 65 5f 43 6f 64  65 5f 4f 66 66 25 20 2b  |Type_Code_Off% +|
00003550  20 34 29 0d 12 70 3e e7  20 43 44 46 53 5f 42 61  | 4)..p>. CDFS_Ba|
00003560  73 65 5f 41 64 64 72 25  21 28 43 44 46 53 5f 47  |se_Addr%!(CDFS_G|
00003570  69 76 65 46 69 6c 65 54  79 70 65 5f 43 6f 64 65  |iveFileType_Code|
00003580  5f 4f 66 66 25 20 2b 20  31 32 29 20 3d 20 30 20  |_Off% + 12) = 0 |
00003590  8c 0d 12 7a 5a 20 20 20  43 44 46 53 5f 47 69 76  |...zZ   CDFS_Giv|
000035a0  65 46 69 6c 65 54 79 70  65 5f 44 4f 53 5f 45 78  |eFileType_DOS_Ex|
000035b0  74 5f 41 64 64 72 25 20  3d 20 43 44 46 53 5f 42  |t_Addr% = CDFS_B|
000035c0  61 73 65 5f 41 64 64 72  25 21 28 43 44 46 53 5f  |ase_Addr%!(CDFS_|
000035d0  47 69 76 65 46 69 6c 65  54 79 70 65 5f 43 6f 64  |GiveFileType_Cod|
000035e0  65 5f 4f 66 66 25 20 2b  20 38 29 0d 12 84 39 20  |e_Off% + 8)...9 |
000035f0  20 20 43 44 46 53 5f 47  69 76 65 46 69 6c 65 54  |  CDFS_GiveFileT|
00003600  79 70 65 5f 44 4f 53 5f  45 78 74 5f 41 64 64 72  |ype_DOS_Ext_Addr|
00003610  25 20 2b 3d 20 43 44 46  53 5f 42 61 73 65 5f 41  |% += CDFS_Base_A|
00003620  64 64 72 25 0d 12 8e 05  cc 0d 12 98 5b 20 20 20  |ddr%........[   |
00003630  43 44 46 53 5f 47 69 76  65 46 69 6c 65 54 79 70  |CDFS_GiveFileTyp|
00003640  65 5f 44 4f 53 5f 45 78  74 5f 41 64 64 72 25 20  |e_DOS_Ext_Addr% |
00003650  3d 20 43 44 46 53 5f 42  61 73 65 5f 41 64 64 72  |= CDFS_Base_Addr|
00003660  25 21 28 43 44 46 53 5f  47 69 76 65 46 69 6c 65  |%!(CDFS_GiveFile|
00003670  54 79 70 65 5f 43 6f 64  65 5f 4f 66 66 25 20 2b  |Type_Code_Off% +|
00003680  20 31 32 29 0d 12 a2 5b  20 20 20 43 44 46 53 5f  | 12)...[   CDFS_|
00003690  47 69 76 65 46 69 6c 65  54 79 70 65 5f 44 79 6e  |GiveFileType_Dyn|
000036a0  61 6d 69 63 5f 41 72 65  61 25 20 3d 20 43 44 46  |amic_Area% = CDF|
000036b0  53 5f 42 61 73 65 5f 41  64 64 72 25 21 28 43 44  |S_Base_Addr%!(CD|
000036c0  46 53 5f 47 69 76 65 46  69 6c 65 54 79 70 65 5f  |FS_GiveFileType_|
000036d0  43 6f 64 65 5f 4f 66 66  25 20 2b 20 31 36 29 0d  |Code_Off% + 16).|
000036e0  12 ac 05 cd 0d 12 b6 05  e1 0d 12 c0 04 0d 12 ca  |................|
000036f0  04 0d 12 d4 0b dd f2 55  73 61 67 65 0d 12 de 22  |.......Usage..."|
00003700  f1 20 22 43 44 54 79 70  65 20 3c 63 6f 6d 6d 61  |. "CDType <comma|
00003710  6e 64 3e 20 5b 6f 70 74  69 6f 6e 73 5d 22 0d 12  |nd> [options]"..|
00003720  e8 1f f1 20 22 57 68 65  72 65 20 3c 43 6f 6d 6d  |... "Where <Comm|
00003730  61 6e 64 3e 20 6d 61 79  20 62 65 3a 22 0d 12 f2  |and> may be:"...|
00003740  3b f1 20 22 2d 53 74 61  6e 64 61 72 64 20 20 20  |;. "-Standard   |
00003750  20 20 20 20 20 20 20 20  20 2d 20 52 65 73 65 74  |         - Reset|
00003760  20 43 44 46 53 20 74 72  61 6e 73 6c 61 74 69 6f  | CDFS translatio|
00003770  6e 20 74 61 62 6c 65 22  0d 12 fc 3c f1 20 22 2d  |n table"...<. "-|
00003780  44 6f 73 6d 61 70 20 20  20 20 20 20 20 20 20 20  |Dosmap          |
00003790  20 20 20 20 2d 20 53 65  74 20 43 44 46 53 20 74  |    - Set CDFS t|
000037a0  72 61 6e 73 6c 61 74 69  6f 6e 20 74 61 62 6c 65  |ranslation table|
000037b0  20 74 6f 22 0d 13 06 2f  f1 20 22 20 20 20 20 20  | to".../. "     |
000037c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000037d0  20 20 20 44 4f 53 4d 41  50 20 6d 61 70 70 69 6e  |   DOSMAP mappin|
000037e0  67 73 22 0d 13 10 3e f1  20 22 2d 55 73 65 72 20  |gs"...>. "-User |
000037f0  5b 3c 66 69 6c 65 3e 5d  20 20 20 20 20 20 20 2d  |[<file>]       -|
00003800  20 53 65 74 20 43 44 46  53 20 75 73 65 72 20 74  | Set CDFS user t|
00003810  72 61 6e 73 6c 61 74 69  6f 6e 20 74 61 62 6c 65  |ranslation table|
00003820  22 0d 13 1a 32 f1 20 22  20 20 20 20 20 20 20 20  |"...2. "        |
00003830  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003840  74 6f 20 74 61 62 6c 65  20 69 6e 20 3c 66 69 6c  |to table in <fil|
00003850  65 3e 22 0d 13 24 33 f1  20 22 2d 41 64 64 20 3c  |e>"..$3. "-Add <|
00003860  44 6f 73 3e 20 3c 52 69  73 63 4f 53 3e 20 20 2d  |Dos> <RiscOS>  -|
00003870  20 41 64 64 20 61 20 74  72 61 6e 73 6c 61 74 69  | Add a translati|
00003880  6f 6e 3a 2d 20 22 0d 13  2e 39 f1 20 22 20 20 20  |on:- "...9. "   |
00003890  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000038a0  20 20 20 20 20 3c 44 6f  73 54 79 70 65 3e 20 74  |     <DosType> t|
000038b0  6f 20 3c 52 69 73 63 4f  53 54 79 70 65 3e 22 0d  |o <RiscOSType>".|
000038c0  13 38 34 f1 20 22 2d 52  65 6d 6f 76 65 20 3c 44  |.84. "-Remove <D|
000038d0  6f 73 54 79 70 65 3e 20  20 20 20 2d 20 52 65 6d  |osType>    - Rem|
000038e0  6f 76 65 20 3c 44 6f 73  54 79 70 65 3e 20 66 72  |ove <DosType> fr|
000038f0  6f 6d 22 0d 13 42 31 f1  20 22 20 20 20 20 20 20  |om"..B1. "      |
00003900  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003910  20 20 74 72 61 6e 73 6c  61 74 69 6f 6e 20 74 61  |  translation ta|
00003920  62 6c 65 22 0d 13 4c 3a  f1 20 22 2d 43 6c 65 61  |ble"..L:. "-Clea|
00003930  72 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |r               |
00003940  2d 20 43 6c 65 61 72 20  74 68 65 20 74 72 61 6e  |- Clear the tran|
00003950  73 6c 61 74 69 6f 6e 20  74 61 62 6c 65 22 0d 13  |slation table"..|
00003960  56 35 f1 20 22 2d 4c 69  73 74 20 20 20 20 20 20  |V5. "-List      |
00003970  20 20 20 20 20 20 20 20  20 20 2d 20 4c 69 73 74  |          - List|
00003980  20 74 72 61 6e 73 6c 61  74 69 6f 6e 20 74 61 62  | translation tab|
00003990  6c 65 22 0d 13 60 05 f1  0d 13 6a 05 e1 0d 13 74  |le"..`....j....t|
000039a0  04 0d 13 7e 0e dd 20 f2  5f 64 6f 73 6d 61 70 0d  |...~.. ._dosmap.|
000039b0  13 88 1c ea 20 43 25 2c  20 49 25 2c 20 41 25 2c  |.... C%, I%, A%,|
000039c0  20 4a 25 2c 20 41 24 2c  20 42 24 0d 13 92 3c f4  | J%, A$, B$...<.|
000039d0  20 55 73 65 20 74 68 65  20 22 44 4f 53 4d 41 50  | Use the "DOSMAP|
000039e0  22 20 6d 61 70 70 69 6e  67 73 20 74 6f 20 73 65  |" mappings to se|
000039f0  74 20 74 68 65 20 74 72  61 6e 73 6c 61 74 69 6f  |t the translatio|
00003a00  6e 20 74 61 62 6c 65 0d  13 9c 1a ff 22 52 45 4d  |n table....."REM|
00003a10  4f 56 45 20 3c 57 69 6d  70 24 53 63 72 61 70 3e  |OVE <Wimp$Scrap>|
00003a20  22 0d 13 a6 20 ff 22 44  4f 53 4d 41 50 20 7b 20  |"... ."DOSMAP { |
00003a30  3e 20 3c 57 69 6d 70 24  53 63 72 61 70 3e 20 7d  |> <Wimp$Scrap> }|
00003a40  22 0d 13 a7 3c f2 53 65  74 54 72 61 6e 73 28 4a  |"...<.SetTrans(J|
00003a50  25 2c 20 22 22 2c 20 22  26 30 30 30 22 29 20 3a  |%, "", "&000") :|
00003a60  20 f4 20 4a 75 73 74 20  69 6e 20 63 61 73 65 20  | . Just in case |
00003a70  6e 6f 74 68 69 6e 67 20  74 68 65 72 65 0d 13 b0  |nothing there...|
00003a80  1a 43 25 20 3d 20 8e 28  22 3c 57 69 6d 70 24 53  |.C% = .("<Wimp$S|
00003a90  63 72 61 70 3e 22 29 0d  13 ba 10 e7 20 43 25 20  |crap>")..... C% |
00003aa0  3d 20 30 20 8c 20 e1 0d  13 c4 15 e7 20 c5 23 43  |= 0 . ...... .#C|
00003ab0  25 20 8c 20 d9 23 43 25  20 3a 20 e1 0d 13 ce 14  |% . .#C% : .....|
00003ac0  f5 20 3a 20 fd 20 9a 23  43 25 20 3d 20 26 30 41  |. : . .#C% = &0A|
00003ad0  0d 13 cf 15 e7 20 c5 23  43 25 20 8c 20 d9 23 43  |..... .#C% . .#C|
00003ae0  25 20 3a 20 e1 0d 13 d8  14 f5 20 3a 20 fd 20 9a  |% : ...... : . .|
00003af0  23 43 25 20 3d 20 26 30  41 0d 13 e2 0a 4a 25 20  |#C% = &0A....J% |
00003b00  3d 20 30 0d 13 ec 05 f5  0d 13 f6 23 20 20 20 e3  |= 0........#   .|
00003b10  20 49 25 20 3d 20 31 20  b8 20 35 20 3a 20 41 25  | I% = 1 . 5 : A%|
00003b20  20 3d 20 9a 23 43 25 20  3a 20 ed 0d 14 00 0e 20  | = .#C% : ..... |
00003b30  20 20 41 24 20 3d 20 22  22 0d 14 0a 0e 20 20 20  |  A$ = ""....   |
00003b40  42 24 20 3d 20 22 22 0d  14 14 13 20 20 20 e3 20  |B$ = ""....   . |
00003b50  49 25 20 3d 20 31 20 b8  20 33 0d 14 1e 17 20 20  |I% = 1 . 3....  |
00003b60  20 20 20 20 20 41 24 20  2b 3d 20 bd 20 9a 23 43  |     A$ += . .#C|
00003b70  25 0d 14 28 08 20 20 20  ed 0d 14 32 23 20 20 20  |%..(.   ...2#   |
00003b80  e3 20 49 25 20 3d 20 31  20 b8 20 37 20 3a 20 41  |. I% = 1 . 7 : A|
00003b90  25 20 3d 20 9a 23 43 25  20 3a 20 ed 0d 14 3c 13  |% = .#C% : ...<.|
00003ba0  20 20 20 e3 20 49 25 20  3d 20 31 20 b8 20 38 0d  |   . I% = 1 . 8.|
00003bb0  14 46 17 20 20 20 20 20  20 20 42 24 20 2b 3d 20  |.F.       B$ += |
00003bc0  bd 20 9a 23 43 25 0d 14  50 08 20 20 20 ed 0d 14  |. .#C%..P.   ...|
00003bd0  5a 17 20 20 20 f5 20 3a  20 fd 20 9a 23 43 25 20  |Z.   . : . .#C% |
00003be0  3d 20 26 30 41 0d 14 64  16 20 20 20 e7 20 41 24  |= &0A..d.   . A$|
00003bf0  20 3c 3e 20 22 2d 2d 2d  22 20 8c 0d 14 6e 2f 20  | <> "---" ...n/ |
00003c00  20 20 20 20 20 e7 20 4a  25 20 3c 20 43 44 46 53  |     . J% < CDFS|
00003c10  5f 47 69 76 65 46 69 6c  65 54 79 70 65 5f 4e 75  |_GiveFileType_Nu|
00003c20  6d 5f 54 72 61 6e 73 25  20 8c 0d 14 78 22 20 20  |m_Trans% ...x"  |
00003c30  20 20 20 20 20 20 20 f2  53 65 74 54 72 61 6e 73  |       .SetTrans|
00003c40  28 4a 25 2c 20 41 24 2c  20 42 24 29 0d 14 82 14  |(J%, A$, B$)....|
00003c50  20 20 20 20 20 20 20 20  20 4a 25 20 2b 3d 20 31  |         J% += 1|
00003c60  0d 14 8c 0b 20 20 20 20  20 20 cc 0d 14 96 5b 20  |....      ....[ |
00003c70  20 20 20 20 20 20 20 20  f1 20 22 53 6f 72 72 79  |        . "Sorry|
00003c80  20 6f 6e 6c 79 20 22 20  2b 20 c3 43 44 46 53 5f  | only " + .CDFS_|
00003c90  47 69 76 65 46 69 6c 65  54 79 70 65 5f 4e 75 6d  |GiveFileType_Num|
00003ca0  5f 54 72 61 6e 73 25 20  2b 20 22 20 54 72 61 6e  |_Trans% + " Tran|
00003cb0  73 6c 61 74 69 6f 6e 73  20 70 6f 73 73 69 62 6c  |slations possibl|
00003cc0  65 20 21 21 21 22 0d 14  a0 18 20 20 20 20 20 20  |e !!!"....      |
00003cd0  20 20 20 cf 23 43 25 20  3d 20 a2 23 43 25 0d 14  |   .#C% = .#C%..|
00003ce0  aa 0b 20 20 20 20 20 20  cd 0d 14 b4 08 20 20 20  |..      .....   |
00003cf0  cd 0d 14 be 0a fd 20 c5  23 43 25 0d 14 c8 1d f2  |...... .#C%.....|
00003d00  53 65 74 54 72 61 6e 73  28 4a 25 2c 20 22 22 2c  |SetTrans(J%, "",|
00003d10  20 22 26 30 30 30 22 29  0d 14 d2 08 d9 23 43 25  | "&000").....#C%|
00003d20  0d 14 dc 05 e1 0d ff                              |.......|
00003d27