Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199607.adf » !CDFix/CDtype

!CDFix/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_199607.adf
Filename: !CDFix/CDtype
Read OK:
File size: 29F1 bytes
Load address: FFFFFB46
Exec address: 6D80504A
File contents
   10REM >CDType
   20REM
   30REM Original by: Martin Sperl
   40REM Changed by:  Mike Martin ( Softcorn )
   50REM
   60REM Significantly changed by Robin Watts (03/07/95) - (18/9/95)
   70REM to cope with more CDFS versions, and to work OK if the CDFS
   80REM module is resident in ROM. Now supports: 2.20, 2.21,
   90REM 2.21Y, 2.23, 2.28, 2.30d, 2.30e. If you have a version that
  100REM doesn't work, then please get in touch!
  110REM
  120REM Further changed by RJW to improve opaque/associated file
  130REM handling, and to allow unlimited numbers of mappings.
  140REM
  150REM This Program may be copied freely as long as the above lines
  160REM _are_ included.
  170
  180REM setup presets for different CDFS versions
  190REM i.e. offsets/values in virgin CDFS
  200REM if yours is not in the list below you probably only have to
  210REM add the correct values for your version.
  220
  230ON ERROR PRINTREPORT$;" at line ";ERL:END
  240
  250numb_vers%=7
  260DIM version$(numb_vers%)
  270DIM codeoff%(numb_vers%)
  280DIM endlstoff%(numb_vers%)
  290DIM workspcoff%(numb_vers%)
  300DIM first_opcode%(numb_vers%)
  310
  340REM setup for CDFS2.20
  350version$(0)      = "CDFS2.20 (23 Sep 1993)"
  360codeoff%(0)      = &2DF0     : REM offset of start of CDFS_GiveFileType code.
  370endlstoff%(0)    = &3088     : REM end of translation list (after RiscOS hex).
  380workspcoff%(0)   = &3204     : REM offset of Word holding - workspace offset used.
  390first_opcode%(0) = &E92D000F : REM value of first opcode in CDFS_GiveFileType.
  400
  440REM setup for CDFS2.21  (actually, identical to 2.20)
  450version$(1)      = "CDFS2.21 (02 Feb 1994)"
  460codeoff%(1)      = &2DF0
  470endlstoff%(1)    = &3088
  480workspcoff%(1)   = &3204
  490first_opcode%(1) = &E92D000F
  500
  530REM CDFS 2.23
  540version$(2)      = "CDFS2.23 (10 Aug 1994)"
  550codeoff%(2)      = &2FB4
  560endlstoff%(2)    = &3254
  570workspcoff%(2)   = &33D8
  580first_opcode%(2) = &E92D000F
  590
  620REM CDFS 2.30d
  630version$(3)      = "CDFS2.30d (07 Sep 1994)"
  640codeoff%(3)      = &307C
  650endlstoff%(3)    = &3318
  660workspcoff%(3)   = &3498
  670first_opcode%(3) = &E92D000F
  680
  710REM CDFS 2.30e
  720version$(4)      = "CDFS2.30e (19 Sep 1994)"
  730codeoff%(4)      = &3088
  740endlstoff%(4)    = &3328
  750workspcoff%(4)   = &34AC
  760first_opcode%(4) = &E92D000F
  770
  800REM setup for CDFS2.28
  810version$(5)      = "CDFS2.28 (28 Feb 1995)"
  820codeoff%(5)      = &2DA8
  830endlstoff%(5)    = &3040
  840workspcoff%(5)   = &31B8
  850first_opcode%(5) = &E92D000F
  860
  890REM setup for CDFS2.21Y
  900version$(6)      = "CDFS2.21Y (23 Feb 1994)"
  910codeoff%(6)      = &2DFC
  920endlstoff%(6)    = &3094
  930workspcoff%(6)   = &3210
  940first_opcode%(6) = &E92D000F
  950
  980Base% = FNgetbaseCDFS    : REM absolute address of start of module.
  990
 1000REM Check for CDFS in ROM... (move into RAM)
 1010REMIF Base%>&3000000 THEN
 1020REM OSCLI("RMFaster CDFS")
 1030REM Base% = FNgetbaseCDFS
 1040REMENDIF
 1050
 1060CDFSlength%=!(Base%-4)
 1070
 1080DIM newversion% CDFSlength%+1024*8
 1090PROCcopy(Base%, newversion%, CDFSlength%)
 1100
 1110REM find CDFS version & set up default parameters accordingly
 1120VERSION$ = ""
 1130vers% = 0
 1140REPEAT
 1150  IF FNcheckVersCDFS( Base%+Base%!20, version$(vers%) ) THEN
 1160    VERSION$     = version$(vers%)
 1170    CODEOFF      = codeoff%(vers%)
 1180    ENDLSTOFF    = endlstoff%(vers%)
 1190    WORKSPCOFF   = workspcoff%(vers%)
 1200    FIRST_OPCODE = first_opcode%(vers%)
 1210  ELSE
 1250    vers% += 1
 1260  ENDIF
 1270UNTIL (VERSION$ <> "") OR (vers% = numb_vers%)
 1280IF (VERSION$ = "") THEN ERROR EXT 27, "CDFS-Version not supported":END
 1290
 1300REM now we have setup correct presets we can start program proper
 1310DIM Data 256
 1320DIM Com$(3)
 1330
 1340endofcode%=-1
 1350REM set translation list values
 1360IF NOT FNvirginCDFS THEN
 1370  IF !(Base%+CODEOFF+4)=-1 THEN
 1380   REM my code in CDFS so find end of code
 1390   endofcode%=!(Base%+CODEOFF+8)
 1400  ENDIF
 1410ENDIF
 1420
 1430IF endofcode%=-1 THEN
 1440 PROCresourcedata(CDFSlength%)
 1450ELSE
 1460 CDFSlength%=endofcode%
 1470ENDIF
 1480PROCreadfile(CDFSlength%)
 1490IF endofcode%=-1 THEN PROCmakecode
 1500PROCreinsert(newversion%,CDFSlength%)
 1510
 1520END
 1530
 1540DEFFNvirginCDFS
 1550= (Base%!CODEOFF = FIRST_OPCODE)
 1560
 1570DEFPROCmakecode
 1580LOCAL pass%, code%, endlists%
 1590  code%     = Base% + CODEOFF
 1600  endlists% = Base% + ENDLSTOFF
 1610
 1620  FOR pass% = 0 TO 2 STEP 2
 1630    P% = code%
 1640    [ opt pass%
 1650
 1660         ; on entry
 1670         ; R0 = pointer to filename with terminating 0
 1680         ; R12 = private word
 1690
 1700         MOV   PC, R14   ; Only included initially in case call
 1710                         ; is made in the middle of me generating code
 1720                         ; after all code is generated it is changed to
 1730                         ; B   newstart
 1740
 1750      EQUD -1
 1760      EQUD filetypetable%-Base%
 1770
 1780      .newstart
 1790         STMDB   R13!,{R0-R1}
 1800         LDR     R1,(Base%+WORKSPCOFF)
 1810         ADD     R1,R1,R12
 1820         MOV     R11,R1             ;R11 = private workspace
 1830         LDMIA   R13!,{R0-R1}
 1840
 1850         ; get filename extent
 1860         MOV     R3,R0
 1870
 1880      .loop1
 1890         LDRB    R1,[R3],#1
 1900         TEQ     R1,#0
 1910         LDMEQIA R13!,{R0-R9,R14}
 1920         MOVEQ   R1,#0
 1930         BICEQS  PC,R14,#&10000000  ; exit if null filename or no extension
 1940         TEQ     R1,#&2E            ; ="."
 1950         BNE     loop1
 1960         MOV     R7,R3
 1970
 1980      .loop2
 1990         LDRB    R1,[R7],#1
 2000         TEQ     R1,#0
 2010         BNE     loop2
 2020         ADD     R6,R3,#4
 2030         CMP     R7,R6
 2040         LDMGTIA R13!,{R0-R9,R14}
 2050         MOVGT   R1,#0
 2060         BICGTS  PC,R14,#&10000000  ; exit if extent is not 3 characters
 2070
 2080         ;got, R3 points to extent
 2090
 2100         ;now see if it can be found in extent list
 2110
 2120         FNadr(4,filetypetable%)           ;start of extent list
 2130         SUB     R7,R7,#1
 2140
 2150      .nxt_ext1
 2160         LDRB    R1,[R4],#0
 2170         TEQ     R1,#0
 2180         LDMEQIA R13!,{R0-R9,R14}
 2190         MOVEQ   R1,#0
 2200         BICEQS  PC,R14,#&10000000  ;exit if not found in list
 2210         MOV     R5,R3
 2220
 2230         ;R5 = pointer to filename's extent
 2240
 2250      .nxt_ext2
 2260         LDRB    R2,[R5],#1
 2270         CMP     R2,#&61            ; ="a"
 2280         RSBGES  R14,R2,#&7A        ; ="z"
 2290         SUBGE   R2,R2,#&20         ; =" "
 2300         LDRB    R1,[R4],#1
 2310
 2320         ;R2=filename's extent
 2330         ;R1=extent from
 2340
 2350         TEQ     R1,#0
 2360         TEQEQ   R2,#0
 2370         BEQ     found
 2380
 2390         TEQ     R2,R1
 2400         BNE     notthisone
 2410         TEQ     R5,R7
 2420         BNE     nxt_ext2
 2430
 2440      .found
 2450         ADD R4,R4,#3
 2460         BIC R4,R4,#3
 2470         LDR     R10,[R4]
 2480         LDMIA   R13!,{R0-R9,R14}
 2490         MOV     R1,R10
 2500         BICS    PC,R14,#&10000000
 2510
 2520         ;set R1= start of next file extent
 2530         ; & increment index (R6)
 2540
 2550      .notthisone
 2560         ADD R4,R4,#7
 2570         BIC R4,R4,#3
 2580         B       nxt_ext1
 2590
 2600    ]
 2610
 2620    REM start of filetypes list
 2630  NEXT pass%
 2640
 2650  REM now all code is generated allow it to be entered
 2660  FOR pass% = 0 TO 2 STEP 2
 2670    P% = code%
 2680    [ opt pass%
 2690         B   newstart
 2700    ]
 2710  NEXT pass%
 2720ENDPROC
 2730
 2740
 2750DEFFNgetbaseCDFS
 2760LOCAL Base%
 2770  SYS "XOS_Module",18,"CDFS"TO,,,Base%;flag%
 2780  IF flag%AND1 THEN END
 2790= Base%
 2800
 2810DEFFNcheckVersCDFS( VersPtr%, VersNeeded$ )
 2820LOCAL CurrVers$
 2830  CurrVers$=""
 2840  REPEAT
 2850    IF (?VersPtr%)>31 THEN
 2860      CurrVers$+=CHR$(?VersPtr%)
 2870    ENDIF
 2880    VersPtr%+=1
 2890  UNTIL ?VersPtr%=0
 2900= (CurrVers$ = VersNeeded$)
 2910
 2920DEF FNadr(s%,x%)
 2930REM The instruction sequence must be of FIXED length
 2940a%=x%-P%-8
 2950IF (pass% AND 2) THEN
 2960 IF a%>=0 THEN
 2970  [OPT pass%
 2980   ADD s%,PC,#(a% AND &000003FC)
 2990   ADD s%,s%,#(a% AND &FFFFFC00)
 3000  ]
 3010 ELSE
 3020  a%=-a%
 3030  [OPT pass%
 3040   SUB s%,PC,#(a% AND &000003FC)
 3050   SUB s%,s%,#(a% AND &FFFFFC00)
 3060  ]
 3070 ENDIF
 3080ELSE
 3090 P%+=8:O%+=8
 3100ENDIF
 3110=""
 3120ENDPROC
 3130
 3140DEFPROCcopy(RETURN Base%, newversion%, CDFSlength%)
 3150LOCAL l%
 3160FOR l%=0 TO CDFSlength% STEP 4
 3170 newversion%!l%=Base%!l%
 3180NEXT
 3190Base%=newversion%
 3200ENDPROC
 3210
 3220DEFPROCreinsert(start%,len%)
 3230SYS"OS_Module",11,start%,len%
 3240ENDPROC
 3250:
 3260DEFPROCresourcedata(RETURN CDFSlength%)
 3270LOCAL l%,f%,n%,pass%,newmoduleend%
 3280n%=newversion%
 3290f%=0
 3300FOR l%=0 TO CDFSlength% STEP 4
 3310 IF n%!l%=&E3140002 AND n%!(l%+4)=&03A04001 AND n%!(l%+8)=&13A04002 THEN
 3320  f%=l%
 3330 ENDIF
 3340NEXT
 3350IF f%=0 THEN
 3360 FOR l%=CDFSlength%-4096 TO CDFSlength% STEP 4
 3370  IF FNstring(Base%+l%)="RJW was here too!" THEN f%=l%
 3380 NEXT
 3390 IF f%=0 THEN
 3400  ERROR EXT 27,"Couldn't find patch point for Resource/Data"
 3410 ELSE
 3420  REM Already patched...
 3430 ENDIF
 3440ELSE
 3450 resdatastart%=Base%+CDFSlength%
 3460 f%+=Base%
 3470 FOR pass%=0 TO 2 STEP 2
 3480  P%=f%
 3490  [OPT pass%
 3500         B resdatastart%  
 3510  ]
 3520  P%=resdatastart%
 3530  [OPT pass%
 3540         TST R4,#4
 3550         BNE opaque
 3560      .normal
 3570         TST R4,#2
 3580         B f%+4
 3590      .opaque
 3600         STMFD R13!,{R0,R6}
 3610         MOV R0,#0
 3620         ADD R6,R6,#24
 3630      .oploop
 3640         LDRB R4,[R6],#1
 3650         CMP R4,#ASC"/"
 3660         SUBEQ R0,R6,#1
 3670         CMP R4,#32
 3680         BGE oploop
 3690         MOV R4,#ASC"_"
 3700         CMP R0,#0
 3710         STRNEB R4,[R0]
 3720         STREQB R4,[R6,#-1]
 3730         LDMFD R13!,{R0,R6}
 3740         MOV R4,#1
 3750         B f%+12
 3760         EQUS"RJW "
 3770         EQUS"was "
 3780         EQUS"here"
 3790         EQUS" too"
 3800         EQUS"!":EQUB 0:EQUB 0:EQUB 0
 3810      .newmoduleend%
 3820         EQUD 0
 3830         EQUD 0
 3840         EQUD 0
 3850         EQUD 0
 3860  ]
 3870 NEXT
 3880 CDFSlength%=newmoduleend%-Base%
 3890ENDIF
 3900ENDPROC
 3910:
 3920DEFFNstring(l%)
 3930LOCAL a$
 3940a$=""
 3950WHILE ?l%>31 AND ?l%<127
 3960 a$+=CHR$(?l%)
 3970 l%+=1
 3980ENDWHILE
 3990=a$
 4000
 4010DEFPROCreadfile(RETURN len%)
 4020LOCAL file%,ext$,ft%,ftt%,error%
 4030error%=FALSE
 4040filetypetable%=Base%+len%
 4050ftt%=filetypetable%
 4060ext$=""
 4070ft%=0
 4080file%=OPENIN("<Obey$Dir>.Mappings")
 4090IF file%=0 THEN
 4100 ERROR EXT 27,"Mappings file not found!"
 4110ELSE
 4120 WHILE NOT EOF#file% AND NOT error%
 4130  error%=FNgetline(ext$,ft%)
 4140  IF NOT error% THEN
 4150   PROCequs(ftt%,ext$)
 4160   ftt%!4=ft%
 4170   ftt%+=8
 4180   len%+=8
 4190  ENDIF
 4200 ENDWHILE
 4210 CLOSE#file%
 4220 !ftt%=0
 4230 ftt%!4=0
 4240 len%+=8
 4250ENDIF
 4260IF error% THEN ERROR EXT 27,"Malformed Mappings file"
 4270ENDPROC
 4280:
 4290DEFFNgetline(RETURN ext$, RETURN ft%)
 4300LOCAL a%,error%
 4310error%=FALSE
 4320ext$=""
 4330a%=BGET#file%
 4340WHILE (a%>=ASC"A" AND a%<=ASC"Z") OR (a%>=ASC"0" AND a%<=ASC"9")
 4350 ext$+=CHR$(a%)
 4360 a%=BGET#file%
 4370ENDWHILE
 4380IF a%<>9 AND a%<>32 THEN
 4390 error%=TRUE
 4400ELSE
 4410 ext$=LEFT$(ext$,3)
 4420 ft%=FNeval(GET$#file%)
 4430 IF ft%=-1 THEN error%=TRUE
 4440ENDIF
 4450=error%
 4460:
 4470DEFPROCstrip(RETURN f$)
 4480WHILE ASC(LEFT$(f$,1))<=32
 4490 f$=MID$(f$,2)
 4500ENDWHILE
 4510WHILE ASC(RIGHT$(f$,1))<=32
 4520 f$=LEFT$(f$,LEN f$-1)
 4530ENDWHILE
 4540ENDPROC
 4550:
 4560DEFFNeval(s$)
 4570LOCAL ok$,error%,l%
 4580error%=0
 4590PROCstrip(s$)
 4600ok$="0123456789"
 4610IF LEFT$(s$,1)="&" THEN ok$+="&ABCDEFabcdef"
 4620IF LEN s$=0 THEN
 4630 error%=-1
 4640ELSE
 4650 FOR l%=1 TO LEN s$
 4660  IF INSTR(ok$,MID$(s$,l%,1))<=0 THEN error%=-1
 4670 NEXT
 4680 IF error%=0 THEN error%=EVAL(s$)
 4690ENDIF
 4700=error%
 4710:
 4720DEFPROCequs(p%,e$)
 4730!p%=0
 4740P%=p%
 4750[OPT 2
 4760EQUS e$
 4770]
 4780ENDPROC


� >CDType
�
� Original by: Martin Sperl
(+� Changed by:  Mike Martin ( Softcorn )
2�
<A� Significantly changed by Robin Watts (03/07/95) - (18/9/95)
FA� to cope with more CDFS versions, and to work OK if the CDFS
P:� module is resident in ROM. Now supports: 2.20, 2.21,
ZA� 2.21Y, 2.23, 2.28, 2.30d, 2.30e. If you have a version that
d-� doesn't work, then please get in touch!
n�
x>� Further changed by RJW to improve opaque/associated file
�;� handling, and to allow unlimited numbers of mappings.
��
�B� This Program may be copied freely as long as the above lines
�� _are_ included.
�
�/� setup presets for different CDFS versions
�(� i.e. offsets/values in virgin CDFS
�A� if yours is not in the list below you probably only have to
�.� add the correct values for your version.
�
�� � �$;" at line ";�:�
�
�numb_vers%=7
� version$(numb_vers%)
� codeoff%(numb_vers%)
� endlstoff%(numb_vers%)
"� workspcoff%(numb_vers%)
,� first_opcode%(numb_vers%)
6
T� setup for CDFS2.20
^/version$(0)      = "CDFS2.20 (23 Sep 1993)"
hOcodeoff%(0)      = &2DF0     : � offset of start of CDFS_GiveFileType code.
rPendlstoff%(0)    = &3088     : � end of translation list (after RiscOS hex).
|Tworkspcoff%(0)   = &3204     : � offset of Word holding - workspace offset used.
�Pfirst_opcode%(0) = &E92D000F : � value of first opcode in CDFS_GiveFileType.
�
�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
�
� CDFS 2.23
/version$(2)      = "CDFS2.23 (10 Aug 1994)"
&codeoff%(2)      = &2FB4
0endlstoff%(2)    = &3254
:workspcoff%(2)   = &33D8
D first_opcode%(2) = &E92D000F
N
l� CDFS 2.30d
v0version$(3)      = "CDFS2.30d (07 Sep 1994)"
�codeoff%(3)      = &307C
�endlstoff%(3)    = &3318
�workspcoff%(3)   = &3498
� first_opcode%(3) = &E92D000F
�
�� CDFS 2.30e
�0version$(4)      = "CDFS2.30e (19 Sep 1994)"
�codeoff%(4)      = &3088
�endlstoff%(4)    = &3328
�workspcoff%(4)   = &34AC
� first_opcode%(4) = &E92D000F

 � setup for CDFS2.28
*/version$(5)      = "CDFS2.28 (28 Feb 1995)"
4codeoff%(5)      = &2DA8
>endlstoff%(5)    = &3040
Hworkspcoff%(5)   = &31B8
R first_opcode%(5) = &E92D000F
\
z� setup for CDFS2.21Y
�0version$(6)      = "CDFS2.21Y (23 Feb 1994)"
�codeoff%(6)      = &2DFC
�endlstoff%(6)    = &3094
�workspcoff%(6)   = &3210
� first_opcode%(6) = &E92D000F
�
�DBase% = �getbaseCDFS    : � absolute address of start of module.
�
�.� Check for CDFS in ROM... (move into RAM)
��IF Base%>&3000000 THEN
�� OSCLI("RMFaster CDFS")
� Base% = FNgetbaseCDFS

�ENDIF

$CDFSlength%=!(Base%-4)
.
8$� newversion% CDFSlength%+1024*8
B*�copy(Base%, newversion%, CDFSlength%)
L
V?� find CDFS version & set up default parameters accordingly
`VERSION$ = ""
j
vers% = 0
t�
~;  � �checkVersCDFS( Base%+Base%!20, version$(vers%) ) �
�&    VERSION$     = version$(vers%)
�&    CODEOFF      = codeoff%(vers%)
�(    ENDLSTOFF    = endlstoff%(vers%)
�)    WORKSPCOFF   = workspcoff%(vers%)
�+    FIRST_OPCODE = first_opcode%(vers%)
�  �
�    vers% += 1
�  �
�-� (VERSION$ <> "") � (vers% = numb_vers%)
>� (VERSION$ = "") � � � 27, "CDFS-Version not supported":�


C� now we have setup correct presets we can start program proper
� Data 256
(
� Com$(3)
2
<endofcode%=-1
F!� set translation list values
P� � �virginCDFS �
Z  � !(Base%+CODEOFF+4)=-1 �
d,   � my code in CDFS so find end of code
n$   endofcode%=!(Base%+CODEOFF+8)
x  �
��
�
�� endofcode%=-1 �
� �resourcedata(CDFSlength%)
��
� CDFSlength%=endofcode%
��
��readfile(CDFSlength%)
�� endofcode%=-1 � �makecode
�&�reinsert(newversion%,CDFSlength%)
�
��
�
ݤvirginCDFS
$= (Base%!CODEOFF = FIRST_OPCODE)

"��makecode
,� pass%, code%, endlists%
6!  code%     = Base% + CODEOFF
@#  endlists% = Base% + ENDLSTOFF
J
T  � pass% = 0 � 2 � 2
^    P% = code%
h    [ opt pass%
r
|         ; on entry
�:         ; R0 = pointer to filename with terminating 0
�!         ; R12 = private word
�
�C         MOV   PC, R14   ; Only included initially in case call
�J                         ; is made in the middle of me generating code
�K                         ; after all code is generated it is changed to
�+                         ; B   newstart
�
�      EQUD -1
�#      EQUD filetypetable%-Base%
�
�      .newstart
�!         STMDB   R13!,{R0-R1}
*         LDR     R1,(Base%+WORKSPCOFF)
         ADD     R1,R1,R12
@         MOV     R11,R1             ;R11 = private workspace
&!         LDMIA   R13!,{R0-R1}
0
:"         ; get filename extent
D         MOV     R3,R0
N
X      .loop1
b         LDRB    R1,[R3],#1
l         TEQ     R1,#0
v%         LDMEQIA R13!,{R0-R9,R14}
�         �Q   R1,#0
�O         BICEQS  PC,R14,#&10000000  ; exit if null filename or no extension
�.         TEQ     R1,#&2E            ; ="."
�         BNE     loop1
�         MOV     R7,R3
�
�      .loop2
�         LDRB    R1,[R7],#1
�         TEQ     R1,#0
�         BNE     loop2
�         ADD     R6,R3,#4
�         CMP     R7,R6
�%         LDMGTIA R13!,{R0-R9,R14}
         MOVGT   R1,#0
L         BICGTS  PC,R14,#&10000000  ; exit if extent is not 3 characters

 &         ;got, R3 points to extent
*
47         ;now see if it can be found in extent list
>
HC         �adr(4,filetypetable%)           ;start of extent list
R         SUB     R7,R7,#1
\
f      .nxt_ext1
p         LDRB    R1,[R4],#0
z         TEQ     R1,#0
�%         LDMEQIA R13!,{R0-R9,R14}
�         �Q   R1,#0
�B         BICEQS  PC,R14,#&10000000  ;exit if not found in list
�         MOV     R5,R3
�
�/         ;R5 = pointer to filename's extent
�
�      .nxt_ext2
�         LDRB    R2,[R5],#1
�.         CMP     R2,#&61            ; ="a"
�.         RSBGES  R14,R2,#&7A        ; ="z"
�.         SUBGE   R2,R2,#&20         ; =" "
�         LDRB    R1,[R4],#1
	
	"         ;R2=filename's extent
	         ;R1=extent from
	$
	.         TEQ     R1,#0
	8         TEQEQ   R2,#0
	B         BEQ     found
	L
	V         TEQ     R2,R1
	`         BNE     notthisone
	j         TEQ     R5,R7
	t         BNE     nxt_ext2
	~
	�      .found
	�         ADD R4,R4,#3
	�         BIC R4,R4,#3
	�         LDR     R10,[R4]
	�%         LDMIA   R13!,{R0-R9,R14}
	�         MOV     R1,R10
	�&         BICS    PC,R14,#&10000000
	�
	�/         ;set R1= start of next file extent
	�%         ; & increment index (R6)
	�
	�      .notthisone
         ADD R4,R4,#7

         BIC R4,R4,#3
         B       nxt_ext1

(	    ]
2
<!    � start of filetypes list
F
  � pass%
P
Z8  � now all code is generated allow it to be entered
d  � pass% = 0 � 2 � 2
n    P% = code%
x    [ opt pass%
�         B   newstart
�	    ]
�
  � pass%
��
�
�
�ݤgetbaseCDFS
�� Base%
�.  ș "XOS_Module",18,"CDFS"�,,,Base%;flag%
�  � flag%�1 � �
�= Base%
�
�,ݤcheckVersCDFS( VersPtr%, VersNeeded$ )
� CurrVers$
  CurrVers$=""
  �
"    � (?VersPtr%)>31 �
,!      CurrVers$+=�(?VersPtr%)
6	    �
@    VersPtr%+=1
J  � ?VersPtr%=0
T= (CurrVers$ = VersNeeded$)
^
h� �adr(s%,x%)
r6� The instruction sequence must be of FIXED length
|a%=x%-P%-8
�� (pass% � 2) �
� � a%>=0 �
�  [OPT pass%
�"   ADD s%,PC,#(a% � &000003FC)
�"   ADD s%,s%,#(a% � &FFFFFC00)
�  ]
� �
�  a%=-a%
�  [OPT pass%
�"   SUB s%,PC,#(a% � &000003FC)
�"   SUB s%,s%,#(a% � &FFFFFC00)
�  ]
� �
�
 P%+=8:O%+=8
�
&=""
0�
:
D-��copy(� Base%, newversion%, CDFSlength%)
N� l%
X� l%=0 � CDFSlength% � 4
b newversion%!l%=Base%!l%
l�
vBase%=newversion%
��
�
���reinsert(start%,len%)
� ș"OS_Module",11,start%,len%
��
�:
�!��resourcedata(� CDFSlength%)
�"� l%,f%,n%,pass%,newmoduleend%
�n%=newversion%
�f%=0
�� l%=0 � CDFSlength% � 4
�D � n%!l%=&E3140002 � n%!(l%+4)=&03A04001 � n%!(l%+8)=&13A04002 �
�  f%=l%

 �

�

� f%=0 �

 , � l%=CDFSlength%-4096 � CDFSlength% � 4

*5  � �string(Base%+l%)="RJW was here too!" � f%=l%

4 �

>
 � f%=0 �

H:  � � 27,"Couldn't find patch point for Resource/Data"

R �

\  � Already patched...

f �

p�

z$ resdatastart%=Base%+CDFSlength%

� f%+=Base%

� � pass%=0 � 2 � 2

�  P%=f%

�  [OPT pass%

�         B resdatastart%  

�  ]

�  P%=resdatastart%

�  [OPT pass%

�         TST R4,#4

�         BNE opaque

�      .normal

�         TST R4,#2

�         B f%+4
      .opaque
         STMFD R13!,{R0,R6}
         MOV R0,#0
$         ADD R6,R6,#24
.      .oploop
8         LDRB R4,[R6],#1
B         CMP R4,#�"/"
L         SUBEQ R0,R6,#1
V         CMP R4,#32
`         BGE oploop
j         MOV R4,#�"_"
t         CMP R0,#0
~         STRNEB R4,[R0]
�         STREQB R4,[R6,#-1]
�         LDMFD R13!,{R0,R6}
�         MOV R4,#1
�         B f%+12
�         EQUS"RJW "
�         EQUS"was "
�         EQUS"here"
�         EQUS" too"
�)         EQUS"!":EQUB 0:EQUB 0:EQUB 0
�      .newmoduleend%
�         EQUD 0
�         EQUD 0
         EQUD 0

         EQUD 0
  ]
 �
($ CDFSlength%=newmoduleend%-Base%
2�
<�
F:
Pݤstring(l%)
Z� a$
d	a$=""
nȕ ?l%>31 � ?l%<127
x a$+=�(?l%)
�
 l%+=1
��
�=a$
�
���readfile(� len%)
� � file%,ext$,ft%,ftt%,error%
�error%=�
�filetypetable%=Base%+len%
�ftt%=filetypetable%
�ext$=""
�	ft%=0
�"file%=�("<Obey$Dir>.Mappings")
�� file%=0 �
& � � 27,"Mappings file not found!"
�
 ȕ � �#file% � � error%
"  error%=�getline(ext$,ft%)
,  � � error% �
6   �equs(ftt%,ext$)
@   ftt%!4=ft%
J   ftt%+=8
T   len%+=8
^  �
h �
r �#file%
| !ftt%=0
�
 ftt%!4=0
� len%+=8
��
�/� error% � � � 27,"Malformed Mappings file"
��
�:
�ݤgetline(� ext$, � ft%)
�� a%,error%
�error%=�
�ext$=""
�a%=�#file%
�4ȕ (a%>=�"A" � a%<=�"Z") � (a%>=�"0" � a%<=�"9")
� ext$+=�(a%)
 a%=�#file%
�
� a%<>9 � a%<>32 �
&
 error%=�
0�
: ext$=�ext$,3)
D ft%=�eval(�#file%)
N � ft%=-1 � error%=�
X�
b=error%
l:
v��strip(� f$)
�ȕ �(�f$,1))<=32
� f$=�f$,2)
��
�ȕ �(�f$,1))<=32
� f$=�f$,� f$-1)
��
��
�:
�ݤeval(s$)
�� ok$,error%,l%
�error%=0
��strip(s$)
�ok$="0123456789"
'� �s$,1)="&" � ok$+="&ABCDEFabcdef"
� � s$=0 �
 error%=-1
 �
* � l%=1 � � s$
4&  � �ok$,�s$,l%,1))<=0 � error%=-1
> �
H � error%=0 � error%=�(s$)
R�
\=error%
f:
p��equs(p%,e$)
z	!p%=0
�	P%=p%
�
[OPT 2
�EQUS e$
�]
��
�
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 2b f4 20 43  68 61 6e 67 65 64 20 62  |l..(+. Changed b|
00000040  79 3a 20 20 4d 69 6b 65  20 4d 61 72 74 69 6e 20  |y:  Mike Martin |
00000050  28 20 53 6f 66 74 63 6f  72 6e 20 29 0d 00 32 05  |( Softcorn )..2.|
00000060  f4 0d 00 3c 41 f4 20 53  69 67 6e 69 66 69 63 61  |...<A. Significa|
00000070  6e 74 6c 79 20 63 68 61  6e 67 65 64 20 62 79 20  |ntly changed by |
00000080  52 6f 62 69 6e 20 57 61  74 74 73 20 28 30 33 2f  |Robin Watts (03/|
00000090  30 37 2f 39 35 29 20 2d  20 28 31 38 2f 39 2f 39  |07/95) - (18/9/9|
000000a0  35 29 0d 00 46 41 f4 20  74 6f 20 63 6f 70 65 20  |5)..FA. to cope |
000000b0  77 69 74 68 20 6d 6f 72  65 20 43 44 46 53 20 76  |with more CDFS v|
000000c0  65 72 73 69 6f 6e 73 2c  20 61 6e 64 20 74 6f 20  |ersions, and to |
000000d0  77 6f 72 6b 20 4f 4b 20  69 66 20 74 68 65 20 43  |work OK if the C|
000000e0  44 46 53 0d 00 50 3a f4  20 6d 6f 64 75 6c 65 20  |DFS..P:. module |
000000f0  69 73 20 72 65 73 69 64  65 6e 74 20 69 6e 20 52  |is resident in R|
00000100  4f 4d 2e 20 4e 6f 77 20  73 75 70 70 6f 72 74 73  |OM. Now supports|
00000110  3a 20 32 2e 32 30 2c 20  32 2e 32 31 2c 0d 00 5a  |: 2.20, 2.21,..Z|
00000120  41 f4 20 32 2e 32 31 59  2c 20 32 2e 32 33 2c 20  |A. 2.21Y, 2.23, |
00000130  32 2e 32 38 2c 20 32 2e  33 30 64 2c 20 32 2e 33  |2.28, 2.30d, 2.3|
00000140  30 65 2e 20 49 66 20 79  6f 75 20 68 61 76 65 20  |0e. If you have |
00000150  61 20 76 65 72 73 69 6f  6e 20 74 68 61 74 0d 00  |a version that..|
00000160  64 2d f4 20 64 6f 65 73  6e 27 74 20 77 6f 72 6b  |d-. doesn't work|
00000170  2c 20 74 68 65 6e 20 70  6c 65 61 73 65 20 67 65  |, then please ge|
00000180  74 20 69 6e 20 74 6f 75  63 68 21 0d 00 6e 05 f4  |t in touch!..n..|
00000190  0d 00 78 3e f4 20 46 75  72 74 68 65 72 20 63 68  |..x>. Further ch|
000001a0  61 6e 67 65 64 20 62 79  20 52 4a 57 20 74 6f 20  |anged by RJW to |
000001b0  69 6d 70 72 6f 76 65 20  6f 70 61 71 75 65 2f 61  |improve opaque/a|
000001c0  73 73 6f 63 69 61 74 65  64 20 66 69 6c 65 0d 00  |ssociated file..|
000001d0  82 3b f4 20 68 61 6e 64  6c 69 6e 67 2c 20 61 6e  |.;. handling, an|
000001e0  64 20 74 6f 20 61 6c 6c  6f 77 20 75 6e 6c 69 6d  |d to allow unlim|
000001f0  69 74 65 64 20 6e 75 6d  62 65 72 73 20 6f 66 20  |ited numbers of |
00000200  6d 61 70 70 69 6e 67 73  2e 0d 00 8c 05 f4 0d 00  |mappings........|
00000210  96 42 f4 20 54 68 69 73  20 50 72 6f 67 72 61 6d  |.B. This Program|
00000220  20 6d 61 79 20 62 65 20  63 6f 70 69 65 64 20 66  | may be copied f|
00000230  72 65 65 6c 79 20 61 73  20 6c 6f 6e 67 20 61 73  |reely as long as|
00000240  20 74 68 65 20 61 62 6f  76 65 20 6c 69 6e 65 73  | the above lines|
00000250  0d 00 a0 15 f4 20 5f 61  72 65 5f 20 69 6e 63 6c  |..... _are_ incl|
00000260  75 64 65 64 2e 0d 00 aa  04 0d 00 b4 2f f4 20 73  |uded......../. s|
00000270  65 74 75 70 20 70 72 65  73 65 74 73 20 66 6f 72  |etup presets for|
00000280  20 64 69 66 66 65 72 65  6e 74 20 43 44 46 53 20  | different CDFS |
00000290  76 65 72 73 69 6f 6e 73  0d 00 be 28 f4 20 69 2e  |versions...(. i.|
000002a0  65 2e 20 6f 66 66 73 65  74 73 2f 76 61 6c 75 65  |e. offsets/value|
000002b0  73 20 69 6e 20 76 69 72  67 69 6e 20 43 44 46 53  |s in virgin CDFS|
000002c0  0d 00 c8 41 f4 20 69 66  20 79 6f 75 72 73 20 69  |...A. if yours i|
000002d0  73 20 6e 6f 74 20 69 6e  20 74 68 65 20 6c 69 73  |s not in the lis|
000002e0  74 20 62 65 6c 6f 77 20  79 6f 75 20 70 72 6f 62  |t below you prob|
000002f0  61 62 6c 79 20 6f 6e 6c  79 20 68 61 76 65 20 74  |ably only have t|
00000300  6f 0d 00 d2 2e f4 20 61  64 64 20 74 68 65 20 63  |o..... add the c|
00000310  6f 72 72 65 63 74 20 76  61 6c 75 65 73 20 66 6f  |orrect values fo|
00000320  72 20 79 6f 75 72 20 76  65 72 73 69 6f 6e 2e 0d  |r your version..|
00000330  00 dc 04 0d 00 e6 1b ee  20 85 20 f1 f6 24 3b 22  |........ . ..$;"|
00000340  20 61 74 20 6c 69 6e 65  20 22 3b 9e 3a e0 0d 00  | at line ";.:...|
00000350  f0 04 0d 00 fa 10 6e 75  6d 62 5f 76 65 72 73 25  |......numb_vers%|
00000360  3d 37 0d 01 04 1a de 20  76 65 72 73 69 6f 6e 24  |=7..... version$|
00000370  28 6e 75 6d 62 5f 76 65  72 73 25 29 0d 01 0e 1a  |(numb_vers%)....|
00000380  de 20 63 6f 64 65 6f 66  66 25 28 6e 75 6d 62 5f  |. codeoff%(numb_|
00000390  76 65 72 73 25 29 0d 01  18 1c de 20 65 6e 64 6c  |vers%)..... endl|
000003a0  73 74 6f 66 66 25 28 6e  75 6d 62 5f 76 65 72 73  |stoff%(numb_vers|
000003b0  25 29 0d 01 22 1d de 20  77 6f 72 6b 73 70 63 6f  |%)..".. workspco|
000003c0  66 66 25 28 6e 75 6d 62  5f 76 65 72 73 25 29 0d  |ff%(numb_vers%).|
000003d0  01 2c 1f de 20 66 69 72  73 74 5f 6f 70 63 6f 64  |.,.. first_opcod|
000003e0  65 25 28 6e 75 6d 62 5f  76 65 72 73 25 29 0d 01  |e%(numb_vers%)..|
000003f0  36 04 0d 01 54 18 f4 20  73 65 74 75 70 20 66 6f  |6...T.. setup fo|
00000400  72 20 43 44 46 53 32 2e  32 30 0d 01 5e 2f 76 65  |r CDFS2.20..^/ve|
00000410  72 73 69 6f 6e 24 28 30  29 20 20 20 20 20 20 3d  |rsion$(0)      =|
00000420  20 22 43 44 46 53 32 2e  32 30 20 28 32 33 20 53  | "CDFS2.20 (23 S|
00000430  65 70 20 31 39 39 33 29  22 0d 01 68 4f 63 6f 64  |ep 1993)"..hOcod|
00000440  65 6f 66 66 25 28 30 29  20 20 20 20 20 20 3d 20  |eoff%(0)      = |
00000450  26 32 44 46 30 20 20 20  20 20 3a 20 f4 20 6f 66  |&2DF0     : . of|
00000460  66 73 65 74 20 6f 66 20  73 74 61 72 74 20 6f 66  |fset of start of|
00000470  20 43 44 46 53 5f 47 69  76 65 46 69 6c 65 54 79  | CDFS_GiveFileTy|
00000480  70 65 20 63 6f 64 65 2e  0d 01 72 50 65 6e 64 6c  |pe code...rPendl|
00000490  73 74 6f 66 66 25 28 30  29 20 20 20 20 3d 20 26  |stoff%(0)    = &|
000004a0  33 30 38 38 20 20 20 20  20 3a 20 f4 20 65 6e 64  |3088     : . end|
000004b0  20 6f 66 20 74 72 61 6e  73 6c 61 74 69 6f 6e 20  | of translation |
000004c0  6c 69 73 74 20 28 61 66  74 65 72 20 52 69 73 63  |list (after Risc|
000004d0  4f 53 20 68 65 78 29 2e  0d 01 7c 54 77 6f 72 6b  |OS hex)...|Twork|
000004e0  73 70 63 6f 66 66 25 28  30 29 20 20 20 3d 20 26  |spcoff%(0)   = &|
000004f0  33 32 30 34 20 20 20 20  20 3a 20 f4 20 6f 66 66  |3204     : . off|
00000500  73 65 74 20 6f 66 20 57  6f 72 64 20 68 6f 6c 64  |set of Word hold|
00000510  69 6e 67 20 2d 20 77 6f  72 6b 73 70 61 63 65 20  |ing - workspace |
00000520  6f 66 66 73 65 74 20 75  73 65 64 2e 0d 01 86 50  |offset used....P|
00000530  66 69 72 73 74 5f 6f 70  63 6f 64 65 25 28 30 29  |first_opcode%(0)|
00000540  20 3d 20 26 45 39 32 44  30 30 30 46 20 3a 20 f4  | = &E92D000F : .|
00000550  20 76 61 6c 75 65 20 6f  66 20 66 69 72 73 74 20  | value of first |
00000560  6f 70 63 6f 64 65 20 69  6e 20 43 44 46 53 5f 47  |opcode in CDFS_G|
00000570  69 76 65 46 69 6c 65 54  79 70 65 2e 0d 01 90 04  |iveFileType.....|
00000580  0d 01 b8 37 f4 20 73 65  74 75 70 20 66 6f 72 20  |...7. setup for |
00000590  43 44 46 53 32 2e 32 31  20 20 28 61 63 74 75 61  |CDFS2.21  (actua|
000005a0  6c 6c 79 2c 20 69 64 65  6e 74 69 63 61 6c 20 74  |lly, identical t|
000005b0  6f 20 32 2e 32 30 29 0d  01 c2 2f 76 65 72 73 69  |o 2.20).../versi|
000005c0  6f 6e 24 28 31 29 20 20  20 20 20 20 3d 20 22 43  |on$(1)      = "C|
000005d0  44 46 53 32 2e 32 31 20  28 30 32 20 46 65 62 20  |DFS2.21 (02 Feb |
000005e0  31 39 39 34 29 22 0d 01  cc 1c 63 6f 64 65 6f 66  |1994)"....codeof|
000005f0  66 25 28 31 29 20 20 20  20 20 20 3d 20 26 32 44  |f%(1)      = &2D|
00000600  46 30 0d 01 d6 1c 65 6e  64 6c 73 74 6f 66 66 25  |F0....endlstoff%|
00000610  28 31 29 20 20 20 20 3d  20 26 33 30 38 38 0d 01  |(1)    = &3088..|
00000620  e0 1c 77 6f 72 6b 73 70  63 6f 66 66 25 28 31 29  |..workspcoff%(1)|
00000630  20 20 20 3d 20 26 33 32  30 34 0d 01 ea 20 66 69  |   = &3204... fi|
00000640  72 73 74 5f 6f 70 63 6f  64 65 25 28 31 29 20 3d  |rst_opcode%(1) =|
00000650  20 26 45 39 32 44 30 30  30 46 0d 01 f4 04 0d 02  | &E92D000F......|
00000660  12 0f f4 20 43 44 46 53  20 32 2e 32 33 0d 02 1c  |... CDFS 2.23...|
00000670  2f 76 65 72 73 69 6f 6e  24 28 32 29 20 20 20 20  |/version$(2)    |
00000680  20 20 3d 20 22 43 44 46  53 32 2e 32 33 20 28 31  |  = "CDFS2.23 (1|
00000690  30 20 41 75 67 20 31 39  39 34 29 22 0d 02 26 1c  |0 Aug 1994)"..&.|
000006a0  63 6f 64 65 6f 66 66 25  28 32 29 20 20 20 20 20  |codeoff%(2)     |
000006b0  20 3d 20 26 32 46 42 34  0d 02 30 1c 65 6e 64 6c  | = &2FB4..0.endl|
000006c0  73 74 6f 66 66 25 28 32  29 20 20 20 20 3d 20 26  |stoff%(2)    = &|
000006d0  33 32 35 34 0d 02 3a 1c  77 6f 72 6b 73 70 63 6f  |3254..:.workspco|
000006e0  66 66 25 28 32 29 20 20  20 3d 20 26 33 33 44 38  |ff%(2)   = &33D8|
000006f0  0d 02 44 20 66 69 72 73  74 5f 6f 70 63 6f 64 65  |..D first_opcode|
00000700  25 28 32 29 20 3d 20 26  45 39 32 44 30 30 30 46  |%(2) = &E92D000F|
00000710  0d 02 4e 04 0d 02 6c 10  f4 20 43 44 46 53 20 32  |..N...l.. CDFS 2|
00000720  2e 33 30 64 0d 02 76 30  76 65 72 73 69 6f 6e 24  |.30d..v0version$|
00000730  28 33 29 20 20 20 20 20  20 3d 20 22 43 44 46 53  |(3)      = "CDFS|
00000740  32 2e 33 30 64 20 28 30  37 20 53 65 70 20 31 39  |2.30d (07 Sep 19|
00000750  39 34 29 22 0d 02 80 1c  63 6f 64 65 6f 66 66 25  |94)"....codeoff%|
00000760  28 33 29 20 20 20 20 20  20 3d 20 26 33 30 37 43  |(3)      = &307C|
00000770  0d 02 8a 1c 65 6e 64 6c  73 74 6f 66 66 25 28 33  |....endlstoff%(3|
00000780  29 20 20 20 20 3d 20 26  33 33 31 38 0d 02 94 1c  |)    = &3318....|
00000790  77 6f 72 6b 73 70 63 6f  66 66 25 28 33 29 20 20  |workspcoff%(3)  |
000007a0  20 3d 20 26 33 34 39 38  0d 02 9e 20 66 69 72 73  | = &3498... firs|
000007b0  74 5f 6f 70 63 6f 64 65  25 28 33 29 20 3d 20 26  |t_opcode%(3) = &|
000007c0  45 39 32 44 30 30 30 46  0d 02 a8 04 0d 02 c6 10  |E92D000F........|
000007d0  f4 20 43 44 46 53 20 32  2e 33 30 65 0d 02 d0 30  |. CDFS 2.30e...0|
000007e0  76 65 72 73 69 6f 6e 24  28 34 29 20 20 20 20 20  |version$(4)     |
000007f0  20 3d 20 22 43 44 46 53  32 2e 33 30 65 20 28 31  | = "CDFS2.30e (1|
00000800  39 20 53 65 70 20 31 39  39 34 29 22 0d 02 da 1c  |9 Sep 1994)"....|
00000810  63 6f 64 65 6f 66 66 25  28 34 29 20 20 20 20 20  |codeoff%(4)     |
00000820  20 3d 20 26 33 30 38 38  0d 02 e4 1c 65 6e 64 6c  | = &3088....endl|
00000830  73 74 6f 66 66 25 28 34  29 20 20 20 20 3d 20 26  |stoff%(4)    = &|
00000840  33 33 32 38 0d 02 ee 1c  77 6f 72 6b 73 70 63 6f  |3328....workspco|
00000850  66 66 25 28 34 29 20 20  20 3d 20 26 33 34 41 43  |ff%(4)   = &34AC|
00000860  0d 02 f8 20 66 69 72 73  74 5f 6f 70 63 6f 64 65  |... first_opcode|
00000870  25 28 34 29 20 3d 20 26  45 39 32 44 30 30 30 46  |%(4) = &E92D000F|
00000880  0d 03 02 04 0d 03 20 18  f4 20 73 65 74 75 70 20  |...... .. setup |
00000890  66 6f 72 20 43 44 46 53  32 2e 32 38 0d 03 2a 2f  |for CDFS2.28..*/|
000008a0  76 65 72 73 69 6f 6e 24  28 35 29 20 20 20 20 20  |version$(5)     |
000008b0  20 3d 20 22 43 44 46 53  32 2e 32 38 20 28 32 38  | = "CDFS2.28 (28|
000008c0  20 46 65 62 20 31 39 39  35 29 22 0d 03 34 1c 63  | Feb 1995)"..4.c|
000008d0  6f 64 65 6f 66 66 25 28  35 29 20 20 20 20 20 20  |odeoff%(5)      |
000008e0  3d 20 26 32 44 41 38 0d  03 3e 1c 65 6e 64 6c 73  |= &2DA8..>.endls|
000008f0  74 6f 66 66 25 28 35 29  20 20 20 20 3d 20 26 33  |toff%(5)    = &3|
00000900  30 34 30 0d 03 48 1c 77  6f 72 6b 73 70 63 6f 66  |040..H.workspcof|
00000910  66 25 28 35 29 20 20 20  3d 20 26 33 31 42 38 0d  |f%(5)   = &31B8.|
00000920  03 52 20 66 69 72 73 74  5f 6f 70 63 6f 64 65 25  |.R first_opcode%|
00000930  28 35 29 20 3d 20 26 45  39 32 44 30 30 30 46 0d  |(5) = &E92D000F.|
00000940  03 5c 04 0d 03 7a 19 f4  20 73 65 74 75 70 20 66  |.\...z.. setup f|
00000950  6f 72 20 43 44 46 53 32  2e 32 31 59 0d 03 84 30  |or CDFS2.21Y...0|
00000960  76 65 72 73 69 6f 6e 24  28 36 29 20 20 20 20 20  |version$(6)     |
00000970  20 3d 20 22 43 44 46 53  32 2e 32 31 59 20 28 32  | = "CDFS2.21Y (2|
00000980  33 20 46 65 62 20 31 39  39 34 29 22 0d 03 8e 1c  |3 Feb 1994)"....|
00000990  63 6f 64 65 6f 66 66 25  28 36 29 20 20 20 20 20  |codeoff%(6)     |
000009a0  20 3d 20 26 32 44 46 43  0d 03 98 1c 65 6e 64 6c  | = &2DFC....endl|
000009b0  73 74 6f 66 66 25 28 36  29 20 20 20 20 3d 20 26  |stoff%(6)    = &|
000009c0  33 30 39 34 0d 03 a2 1c  77 6f 72 6b 73 70 63 6f  |3094....workspco|
000009d0  66 66 25 28 36 29 20 20  20 3d 20 26 33 32 31 30  |ff%(6)   = &3210|
000009e0  0d 03 ac 20 66 69 72 73  74 5f 6f 70 63 6f 64 65  |... first_opcode|
000009f0  25 28 36 29 20 3d 20 26  45 39 32 44 30 30 30 46  |%(6) = &E92D000F|
00000a00  0d 03 b6 04 0d 03 d4 44  42 61 73 65 25 20 3d 20  |.......DBase% = |
00000a10  a4 67 65 74 62 61 73 65  43 44 46 53 20 20 20 20  |.getbaseCDFS    |
00000a20  3a 20 f4 20 61 62 73 6f  6c 75 74 65 20 61 64 64  |: . absolute add|
00000a30  72 65 73 73 20 6f 66 20  73 74 61 72 74 20 6f 66  |ress of start of|
00000a40  20 6d 6f 64 75 6c 65 2e  0d 03 de 04 0d 03 e8 2e  | module.........|
00000a50  f4 20 43 68 65 63 6b 20  66 6f 72 20 43 44 46 53  |. Check for CDFS|
00000a60  20 69 6e 20 52 4f 4d 2e  2e 2e 20 28 6d 6f 76 65  | in ROM... (move|
00000a70  20 69 6e 74 6f 20 52 41  4d 29 0d 03 f2 1b f4 49  | into RAM).....I|
00000a80  46 20 42 61 73 65 25 3e  26 33 30 30 30 30 30 30  |F Base%>&3000000|
00000a90  20 54 48 45 4e 0d 03 fc  1c f4 20 4f 53 43 4c 49  | THEN..... OSCLI|
00000aa0  28 22 52 4d 46 61 73 74  65 72 20 43 44 46 53 22  |("RMFaster CDFS"|
00000ab0  29 0d 04 06 1b f4 20 42  61 73 65 25 20 3d 20 46  |)..... Base% = F|
00000ac0  4e 67 65 74 62 61 73 65  43 44 46 53 0d 04 10 0a  |NgetbaseCDFS....|
00000ad0  f4 45 4e 44 49 46 0d 04  1a 04 0d 04 24 1a 43 44  |.ENDIF......$.CD|
00000ae0  46 53 6c 65 6e 67 74 68  25 3d 21 28 42 61 73 65  |FSlength%=!(Base|
00000af0  25 2d 34 29 0d 04 2e 04  0d 04 38 24 de 20 6e 65  |%-4)......8$. ne|
00000b00  77 76 65 72 73 69 6f 6e  25 20 43 44 46 53 6c 65  |wversion% CDFSle|
00000b10  6e 67 74 68 25 2b 31 30  32 34 2a 38 0d 04 42 2a  |ngth%+1024*8..B*|
00000b20  f2 63 6f 70 79 28 42 61  73 65 25 2c 20 6e 65 77  |.copy(Base%, new|
00000b30  76 65 72 73 69 6f 6e 25  2c 20 43 44 46 53 6c 65  |version%, CDFSle|
00000b40  6e 67 74 68 25 29 0d 04  4c 04 0d 04 56 3f f4 20  |ngth%)..L...V?. |
00000b50  66 69 6e 64 20 43 44 46  53 20 76 65 72 73 69 6f  |find CDFS versio|
00000b60  6e 20 26 20 73 65 74 20  75 70 20 64 65 66 61 75  |n & set up defau|
00000b70  6c 74 20 70 61 72 61 6d  65 74 65 72 73 20 61 63  |lt parameters ac|
00000b80  63 6f 72 64 69 6e 67 6c  79 0d 04 60 11 56 45 52  |cordingly..`.VER|
00000b90  53 49 4f 4e 24 20 3d 20  22 22 0d 04 6a 0d 76 65  |SION$ = ""..j.ve|
00000ba0  72 73 25 20 3d 20 30 0d  04 74 05 f5 0d 04 7e 3b  |rs% = 0..t....~;|
00000bb0  20 20 e7 20 a4 63 68 65  63 6b 56 65 72 73 43 44  |  . .checkVersCD|
00000bc0  46 53 28 20 42 61 73 65  25 2b 42 61 73 65 25 21  |FS( Base%+Base%!|
00000bd0  32 30 2c 20 76 65 72 73  69 6f 6e 24 28 76 65 72  |20, version$(ver|
00000be0  73 25 29 20 29 20 8c 0d  04 88 26 20 20 20 20 56  |s%) ) ....&    V|
00000bf0  45 52 53 49 4f 4e 24 20  20 20 20 20 3d 20 76 65  |ERSION$     = ve|
00000c00  72 73 69 6f 6e 24 28 76  65 72 73 25 29 0d 04 92  |rsion$(vers%)...|
00000c10  26 20 20 20 20 43 4f 44  45 4f 46 46 20 20 20 20  |&    CODEOFF    |
00000c20  20 20 3d 20 63 6f 64 65  6f 66 66 25 28 76 65 72  |  = codeoff%(ver|
00000c30  73 25 29 0d 04 9c 28 20  20 20 20 45 4e 44 4c 53  |s%)...(    ENDLS|
00000c40  54 4f 46 46 20 20 20 20  3d 20 65 6e 64 6c 73 74  |TOFF    = endlst|
00000c50  6f 66 66 25 28 76 65 72  73 25 29 0d 04 a6 29 20  |off%(vers%)...) |
00000c60  20 20 20 57 4f 52 4b 53  50 43 4f 46 46 20 20 20  |   WORKSPCOFF   |
00000c70  3d 20 77 6f 72 6b 73 70  63 6f 66 66 25 28 76 65  |= workspcoff%(ve|
00000c80  72 73 25 29 0d 04 b0 2b  20 20 20 20 46 49 52 53  |rs%)...+    FIRS|
00000c90  54 5f 4f 50 43 4f 44 45  20 3d 20 66 69 72 73 74  |T_OPCODE = first|
00000ca0  5f 6f 70 63 6f 64 65 25  28 76 65 72 73 25 29 0d  |_opcode%(vers%).|
00000cb0  04 ba 07 20 20 cc 0d 04  e2 12 20 20 20 20 76 65  |...  .....    ve|
00000cc0  72 73 25 20 2b 3d 20 31  0d 04 ec 07 20 20 cd 0d  |rs% += 1....  ..|
00000cd0  04 f6 2d fd 20 28 56 45  52 53 49 4f 4e 24 20 3c  |..-. (VERSION$ <|
00000ce0  3e 20 22 22 29 20 84 20  28 76 65 72 73 25 20 3d  |> "") . (vers% =|
00000cf0  20 6e 75 6d 62 5f 76 65  72 73 25 29 0d 05 00 3e  | numb_vers%)...>|
00000d00  e7 20 28 56 45 52 53 49  4f 4e 24 20 3d 20 22 22  |. (VERSION$ = ""|
00000d10  29 20 8c 20 85 20 a2 20  32 37 2c 20 22 43 44 46  |) . . . 27, "CDF|
00000d20  53 2d 56 65 72 73 69 6f  6e 20 6e 6f 74 20 73 75  |S-Version not su|
00000d30  70 70 6f 72 74 65 64 22  3a e0 0d 05 0a 04 0d 05  |pported":.......|
00000d40  14 43 f4 20 6e 6f 77 20  77 65 20 68 61 76 65 20  |.C. now we have |
00000d50  73 65 74 75 70 20 63 6f  72 72 65 63 74 20 70 72  |setup correct pr|
00000d60  65 73 65 74 73 20 77 65  20 63 61 6e 20 73 74 61  |esets we can sta|
00000d70  72 74 20 70 72 6f 67 72  61 6d 20 70 72 6f 70 65  |rt program prope|
00000d80  72 0d 05 1e 0e de 20 44  61 74 61 20 32 35 36 0d  |r..... Data 256.|
00000d90  05 28 0d de 20 43 6f 6d  24 28 33 29 0d 05 32 04  |.(.. Com$(3)..2.|
00000da0  0d 05 3c 11 65 6e 64 6f  66 63 6f 64 65 25 3d 2d  |..<.endofcode%=-|
00000db0  31 0d 05 46 21 f4 20 73  65 74 20 74 72 61 6e 73  |1..F!. set trans|
00000dc0  6c 61 74 69 6f 6e 20 6c  69 73 74 20 76 61 6c 75  |lation list valu|
00000dd0  65 73 0d 05 50 15 e7 20  ac 20 a4 76 69 72 67 69  |es..P.. . .virgi|
00000de0  6e 43 44 46 53 20 8c 0d  05 5a 1f 20 20 e7 20 21  |nCDFS ...Z.  . !|
00000df0  28 42 61 73 65 25 2b 43  4f 44 45 4f 46 46 2b 34  |(Base%+CODEOFF+4|
00000e00  29 3d 2d 31 20 8c 0d 05  64 2c 20 20 20 f4 20 6d  |)=-1 ...d,   . m|
00000e10  79 20 63 6f 64 65 20 69  6e 20 43 44 46 53 20 73  |y code in CDFS s|
00000e20  6f 20 66 69 6e 64 20 65  6e 64 20 6f 66 20 63 6f  |o find end of co|
00000e30  64 65 0d 05 6e 24 20 20  20 65 6e 64 6f 66 63 6f  |de..n$   endofco|
00000e40  64 65 25 3d 21 28 42 61  73 65 25 2b 43 4f 44 45  |de%=!(Base%+CODE|
00000e50  4f 46 46 2b 38 29 0d 05  78 07 20 20 cd 0d 05 82  |OFF+8)..x.  ....|
00000e60  05 cd 0d 05 8c 04 0d 05  96 15 e7 20 65 6e 64 6f  |........... endo|
00000e70  66 63 6f 64 65 25 3d 2d  31 20 8c 0d 05 a0 1f 20  |fcode%=-1 ..... |
00000e80  f2 72 65 73 6f 75 72 63  65 64 61 74 61 28 43 44  |.resourcedata(CD|
00000e90  46 53 6c 65 6e 67 74 68  25 29 0d 05 aa 05 cc 0d  |FSlength%)......|
00000ea0  05 b4 1b 20 43 44 46 53  6c 65 6e 67 74 68 25 3d  |... CDFSlength%=|
00000eb0  65 6e 64 6f 66 63 6f 64  65 25 0d 05 be 05 cd 0d  |endofcode%......|
00000ec0  05 c8 1a f2 72 65 61 64  66 69 6c 65 28 43 44 46  |....readfile(CDF|
00000ed0  53 6c 65 6e 67 74 68 25  29 0d 05 d2 1f e7 20 65  |Slength%)..... e|
00000ee0  6e 64 6f 66 63 6f 64 65  25 3d 2d 31 20 8c 20 f2  |ndofcode%=-1 . .|
00000ef0  6d 61 6b 65 63 6f 64 65  0d 05 dc 26 f2 72 65 69  |makecode...&.rei|
00000f00  6e 73 65 72 74 28 6e 65  77 76 65 72 73 69 6f 6e  |nsert(newversion|
00000f10  25 2c 43 44 46 53 6c 65  6e 67 74 68 25 29 0d 05  |%,CDFSlength%)..|
00000f20  e6 04 0d 05 f0 05 e0 0d  05 fa 04 0d 06 04 10 dd  |................|
00000f30  a4 76 69 72 67 69 6e 43  44 46 53 0d 06 0e 24 3d  |.virginCDFS...$=|
00000f40  20 28 42 61 73 65 25 21  43 4f 44 45 4f 46 46 20  | (Base%!CODEOFF |
00000f50  3d 20 46 49 52 53 54 5f  4f 50 43 4f 44 45 29 0d  |= FIRST_OPCODE).|
00000f60  06 18 04 0d 06 22 0e dd  f2 6d 61 6b 65 63 6f 64  |....."...makecod|
00000f70  65 0d 06 2c 1d ea 20 70  61 73 73 25 2c 20 63 6f  |e..,.. pass%, co|
00000f80  64 65 25 2c 20 65 6e 64  6c 69 73 74 73 25 0d 06  |de%, endlists%..|
00000f90  36 21 20 20 63 6f 64 65  25 20 20 20 20 20 3d 20  |6!  code%     = |
00000fa0  42 61 73 65 25 20 2b 20  43 4f 44 45 4f 46 46 0d  |Base% + CODEOFF.|
00000fb0  06 40 23 20 20 65 6e 64  6c 69 73 74 73 25 20 3d  |.@#  endlists% =|
00000fc0  20 42 61 73 65 25 20 2b  20 45 4e 44 4c 53 54 4f  | Base% + ENDLSTO|
00000fd0  46 46 0d 06 4a 04 0d 06  54 19 20 20 e3 20 70 61  |FF..J...T.  . pa|
00000fe0  73 73 25 20 3d 20 30 20  b8 20 32 20 88 20 32 0d  |ss% = 0 . 2 . 2.|
00000ff0  06 5e 12 20 20 20 20 50  25 20 3d 20 63 6f 64 65  |.^.    P% = code|
00001000  25 0d 06 68 13 20 20 20  20 5b 20 6f 70 74 20 70  |%..h.    [ opt p|
00001010  61 73 73 25 0d 06 72 04  0d 06 7c 17 20 20 20 20  |ass%..r...|.    |
00001020  20 20 20 20 20 3b 20 6f  6e 20 65 6e 74 72 79 0d  |     ; on entry.|
00001030  06 86 3a 20 20 20 20 20  20 20 20 20 3b 20 52 30  |..:         ; R0|
00001040  20 3d 20 70 6f 69 6e 74  65 72 20 74 6f 20 66 69  | = pointer to fi|
00001050  6c 65 6e 61 6d 65 20 77  69 74 68 20 74 65 72 6d  |lename with term|
00001060  69 6e 61 74 69 6e 67 20  30 0d 06 90 21 20 20 20  |inating 0...!   |
00001070  20 20 20 20 20 20 3b 20  52 31 32 20 3d 20 70 72  |      ; R12 = pr|
00001080  69 76 61 74 65 20 77 6f  72 64 0d 06 9a 04 0d 06  |ivate word......|
00001090  a4 43 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |.C         MOV  |
000010a0  20 50 43 2c 20 52 31 34  20 20 20 3b 20 4f 6e 6c  | PC, R14   ; Onl|
000010b0  79 20 69 6e 63 6c 75 64  65 64 20 69 6e 69 74 69  |y included initi|
000010c0  61 6c 6c 79 20 69 6e 20  63 61 73 65 20 63 61 6c  |ally in case cal|
000010d0  6c 0d 06 ae 4a 20 20 20  20 20 20 20 20 20 20 20  |l...J           |
000010e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
000010f0  69 73 20 6d 61 64 65 20  69 6e 20 74 68 65 20 6d  |is made in the m|
00001100  69 64 64 6c 65 20 6f 66  20 6d 65 20 67 65 6e 65  |iddle of me gene|
00001110  72 61 74 69 6e 67 20 63  6f 64 65 0d 06 b8 4b 20  |rating code...K |
00001120  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001130  20 20 20 20 20 20 20 20  3b 20 61 66 74 65 72 20  |        ; after |
00001140  61 6c 6c 20 63 6f 64 65  20 69 73 20 67 65 6e 65  |all code is gene|
00001150  72 61 74 65 64 20 69 74  20 69 73 20 63 68 61 6e  |rated it is chan|
00001160  67 65 64 20 74 6f 0d 06  c2 2b 20 20 20 20 20 20  |ged to...+      |
00001170  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001180  20 20 20 3b 20 42 20 20  20 6e 65 77 73 74 61 72  |   ; B   newstar|
00001190  74 0d 06 cc 04 0d 06 d6  11 20 20 20 20 20 20 45  |t........      E|
000011a0  51 55 44 20 2d 31 0d 06  e0 23 20 20 20 20 20 20  |QUD -1...#      |
000011b0  45 51 55 44 20 66 69 6c  65 74 79 70 65 74 61 62  |EQUD filetypetab|
000011c0  6c 65 25 2d 42 61 73 65  25 0d 06 ea 04 0d 06 f4  |le%-Base%.......|
000011d0  13 20 20 20 20 20 20 2e  6e 65 77 73 74 61 72 74  |.      .newstart|
000011e0  0d 06 fe 21 20 20 20 20  20 20 20 20 20 53 54 4d  |...!         STM|
000011f0  44 42 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 31  |DB   R13!,{R0-R1|
00001200  7d 0d 07 08 2a 20 20 20  20 20 20 20 20 20 4c 44  |}...*         LD|
00001210  52 20 20 20 20 20 52 31  2c 28 42 61 73 65 25 2b  |R     R1,(Base%+|
00001220  57 4f 52 4b 53 50 43 4f  46 46 29 0d 07 12 1e 20  |WORKSPCOFF).... |
00001230  20 20 20 20 20 20 20 20  41 44 44 20 20 20 20 20  |        ADD     |
00001240  52 31 2c 52 31 2c 52 31  32 0d 07 1c 40 20 20 20  |R1,R1,R12...@   |
00001250  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 52 31  |      MOV     R1|
00001260  31 2c 52 31 20 20 20 20  20 20 20 20 20 20 20 20  |1,R1            |
00001270  20 3b 52 31 31 20 3d 20  70 72 69 76 61 74 65 20  | ;R11 = private |
00001280  77 6f 72 6b 73 70 61 63  65 0d 07 26 21 20 20 20  |workspace..&!   |
00001290  20 20 20 20 20 20 4c 44  4d 49 41 20 20 20 52 31  |      LDMIA   R1|
000012a0  33 21 2c 7b 52 30 2d 52  31 7d 0d 07 30 04 0d 07  |3!,{R0-R1}..0...|
000012b0  3a 22 20 20 20 20 20 20  20 20 20 3b 20 67 65 74  |:"         ; get|
000012c0  20 66 69 6c 65 6e 61 6d  65 20 65 78 74 65 6e 74  | filename extent|
000012d0  0d 07 44 1a 20 20 20 20  20 20 20 20 20 4d 4f 56  |..D.         MOV|
000012e0  20 20 20 20 20 52 33 2c  52 30 0d 07 4e 04 0d 07  |     R3,R0..N...|
000012f0  58 10 20 20 20 20 20 20  2e 6c 6f 6f 70 31 0d 07  |X.      .loop1..|
00001300  62 1f 20 20 20 20 20 20  20 20 20 4c 44 52 42 20  |b.         LDRB |
00001310  20 20 20 52 31 2c 5b 52  33 5d 2c 23 31 0d 07 6c  |   R1,[R3],#1..l|
00001320  1a 20 20 20 20 20 20 20  20 20 54 45 51 20 20 20  |.         TEQ   |
00001330  20 20 52 31 2c 23 30 0d  07 76 25 20 20 20 20 20  |  R1,#0..v%     |
00001340  20 20 20 20 4c 44 4d 45  51 49 41 20 52 31 33 21  |    LDMEQIA R13!|
00001350  2c 7b 52 30 2d 52 39 2c  52 31 34 7d 0d 07 80 17  |,{R0-R9,R14}....|
00001360  20 20 20 20 20 20 20 20  20 ec 51 20 20 20 52 31  |         .Q   R1|
00001370  2c 23 30 0d 07 8a 4f 20  20 20 20 20 20 20 20 20  |,#0...O         |
00001380  42 49 43 45 51 53 20 20  50 43 2c 52 31 34 2c 23  |BICEQS  PC,R14,#|
00001390  26 31 30 30 30 30 30 30  30 20 20 3b 20 65 78 69  |&10000000  ; exi|
000013a0  74 20 69 66 20 6e 75 6c  6c 20 66 69 6c 65 6e 61  |t if null filena|
000013b0  6d 65 20 6f 72 20 6e 6f  20 65 78 74 65 6e 73 69  |me or no extensi|
000013c0  6f 6e 0d 07 94 2e 20 20  20 20 20 20 20 20 20 54  |on....         T|
000013d0  45 51 20 20 20 20 20 52  31 2c 23 26 32 45 20 20  |EQ     R1,#&2E  |
000013e0  20 20 20 20 20 20 20 20  20 20 3b 20 3d 22 2e 22  |          ; ="."|
000013f0  0d 07 9e 1a 20 20 20 20  20 20 20 20 20 42 4e 45  |....         BNE|
00001400  20 20 20 20 20 6c 6f 6f  70 31 0d 07 a8 1a 20 20  |     loop1....  |
00001410  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
00001420  37 2c 52 33 0d 07 b2 04  0d 07 bc 10 20 20 20 20  |7,R3........    |
00001430  20 20 2e 6c 6f 6f 70 32  0d 07 c6 1f 20 20 20 20  |  .loop2....    |
00001440  20 20 20 20 20 4c 44 52  42 20 20 20 20 52 31 2c  |     LDRB    R1,|
00001450  5b 52 37 5d 2c 23 31 0d  07 d0 1a 20 20 20 20 20  |[R7],#1....     |
00001460  20 20 20 20 54 45 51 20  20 20 20 20 52 31 2c 23  |    TEQ     R1,#|
00001470  30 0d 07 da 1a 20 20 20  20 20 20 20 20 20 42 4e  |0....         BN|
00001480  45 20 20 20 20 20 6c 6f  6f 70 32 0d 07 e4 1d 20  |E     loop2.... |
00001490  20 20 20 20 20 20 20 20  41 44 44 20 20 20 20 20  |        ADD     |
000014a0  52 36 2c 52 33 2c 23 34  0d 07 ee 1a 20 20 20 20  |R6,R3,#4....    |
000014b0  20 20 20 20 20 43 4d 50  20 20 20 20 20 52 37 2c  |     CMP     R7,|
000014c0  52 36 0d 07 f8 25 20 20  20 20 20 20 20 20 20 4c  |R6...%         L|
000014d0  44 4d 47 54 49 41 20 52  31 33 21 2c 7b 52 30 2d  |DMGTIA R13!,{R0-|
000014e0  52 39 2c 52 31 34 7d 0d  08 02 1a 20 20 20 20 20  |R9,R14}....     |
000014f0  20 20 20 20 4d 4f 56 47  54 20 20 20 52 31 2c 23  |    MOVGT   R1,#|
00001500  30 0d 08 0c 4c 20 20 20  20 20 20 20 20 20 42 49  |0...L         BI|
00001510  43 47 54 53 20 20 50 43  2c 52 31 34 2c 23 26 31  |CGTS  PC,R14,#&1|
00001520  30 30 30 30 30 30 30 20  20 3b 20 65 78 69 74 20  |0000000  ; exit |
00001530  69 66 20 65 78 74 65 6e  74 20 69 73 20 6e 6f 74  |if extent is not|
00001540  20 33 20 63 68 61 72 61  63 74 65 72 73 0d 08 16  | 3 characters...|
00001550  04 0d 08 20 26 20 20 20  20 20 20 20 20 20 3b 67  |... &         ;g|
00001560  6f 74 2c 20 52 33 20 70  6f 69 6e 74 73 20 74 6f  |ot, R3 points to|
00001570  20 65 78 74 65 6e 74 0d  08 2a 04 0d 08 34 37 20  | extent..*...47 |
00001580  20 20 20 20 20 20 20 20  3b 6e 6f 77 20 73 65 65  |        ;now see|
00001590  20 69 66 20 69 74 20 63  61 6e 20 62 65 20 66 6f  | if it can be fo|
000015a0  75 6e 64 20 69 6e 20 65  78 74 65 6e 74 20 6c 69  |und in extent li|
000015b0  73 74 0d 08 3e 04 0d 08  48 43 20 20 20 20 20 20  |st..>...HC      |
000015c0  20 20 20 a4 61 64 72 28  34 2c 66 69 6c 65 74 79  |   .adr(4,filety|
000015d0  70 65 74 61 62 6c 65 25  29 20 20 20 20 20 20 20  |petable%)       |
000015e0  20 20 20 20 3b 73 74 61  72 74 20 6f 66 20 65 78  |    ;start of ex|
000015f0  74 65 6e 74 20 6c 69 73  74 0d 08 52 1d 20 20 20  |tent list..R.   |
00001600  20 20 20 20 20 20 53 55  42 20 20 20 20 20 52 37  |      SUB     R7|
00001610  2c 52 37 2c 23 31 0d 08  5c 04 0d 08 66 13 20 20  |,R7,#1..\...f.  |
00001620  20 20 20 20 2e 6e 78 74  5f 65 78 74 31 0d 08 70  |    .nxt_ext1..p|
00001630  1f 20 20 20 20 20 20 20  20 20 4c 44 52 42 20 20  |.         LDRB  |
00001640  20 20 52 31 2c 5b 52 34  5d 2c 23 30 0d 08 7a 1a  |  R1,[R4],#0..z.|
00001650  20 20 20 20 20 20 20 20  20 54 45 51 20 20 20 20  |         TEQ    |
00001660  20 52 31 2c 23 30 0d 08  84 25 20 20 20 20 20 20  | R1,#0...%      |
00001670  20 20 20 4c 44 4d 45 51  49 41 20 52 31 33 21 2c  |   LDMEQIA R13!,|
00001680  7b 52 30 2d 52 39 2c 52  31 34 7d 0d 08 8e 17 20  |{R0-R9,R14}.... |
00001690  20 20 20 20 20 20 20 20  ec 51 20 20 20 52 31 2c  |        .Q   R1,|
000016a0  23 30 0d 08 98 42 20 20  20 20 20 20 20 20 20 42  |#0...B         B|
000016b0  49 43 45 51 53 20 20 50  43 2c 52 31 34 2c 23 26  |ICEQS  PC,R14,#&|
000016c0  31 30 30 30 30 30 30 30  20 20 3b 65 78 69 74 20  |10000000  ;exit |
000016d0  69 66 20 6e 6f 74 20 66  6f 75 6e 64 20 69 6e 20  |if not found in |
000016e0  6c 69 73 74 0d 08 a2 1a  20 20 20 20 20 20 20 20  |list....        |
000016f0  20 4d 4f 56 20 20 20 20  20 52 35 2c 52 33 0d 08  | MOV     R5,R3..|
00001700  ac 04 0d 08 b6 2f 20 20  20 20 20 20 20 20 20 3b  |...../         ;|
00001710  52 35 20 3d 20 70 6f 69  6e 74 65 72 20 74 6f 20  |R5 = pointer to |
00001720  66 69 6c 65 6e 61 6d 65  27 73 20 65 78 74 65 6e  |filename's exten|
00001730  74 0d 08 c0 04 0d 08 ca  13 20 20 20 20 20 20 2e  |t........      .|
00001740  6e 78 74 5f 65 78 74 32  0d 08 d4 1f 20 20 20 20  |nxt_ext2....    |
00001750  20 20 20 20 20 4c 44 52  42 20 20 20 20 52 32 2c  |     LDRB    R2,|
00001760  5b 52 35 5d 2c 23 31 0d  08 de 2e 20 20 20 20 20  |[R5],#1....     |
00001770  20 20 20 20 43 4d 50 20  20 20 20 20 52 32 2c 23  |    CMP     R2,#|
00001780  26 36 31 20 20 20 20 20  20 20 20 20 20 20 20 3b  |&61            ;|
00001790  20 3d 22 61 22 0d 08 e8  2e 20 20 20 20 20 20 20  | ="a"....       |
000017a0  20 20 52 53 42 47 45 53  20 20 52 31 34 2c 52 32  |  RSBGES  R14,R2|
000017b0  2c 23 26 37 41 20 20 20  20 20 20 20 20 3b 20 3d  |,#&7A        ; =|
000017c0  22 7a 22 0d 08 f2 2e 20  20 20 20 20 20 20 20 20  |"z"....         |
000017d0  53 55 42 47 45 20 20 20  52 32 2c 52 32 2c 23 26  |SUBGE   R2,R2,#&|
000017e0  32 30 20 20 20 20 20 20  20 20 20 3b 20 3d 22 20  |20         ; =" |
000017f0  22 0d 08 fc 1f 20 20 20  20 20 20 20 20 20 4c 44  |"....         LD|
00001800  52 42 20 20 20 20 52 31  2c 5b 52 34 5d 2c 23 31  |RB    R1,[R4],#1|
00001810  0d 09 06 04 0d 09 10 22  20 20 20 20 20 20 20 20  |......."        |
00001820  20 3b 52 32 3d 66 69 6c  65 6e 61 6d 65 27 73 20  | ;R2=filename's |
00001830  65 78 74 65 6e 74 0d 09  1a 1c 20 20 20 20 20 20  |extent....      |
00001840  20 20 20 3b 52 31 3d 65  78 74 65 6e 74 20 66 72  |   ;R1=extent fr|
00001850  6f 6d 0d 09 24 04 0d 09  2e 1a 20 20 20 20 20 20  |om..$.....      |
00001860  20 20 20 54 45 51 20 20  20 20 20 52 31 2c 23 30  |   TEQ     R1,#0|
00001870  0d 09 38 1a 20 20 20 20  20 20 20 20 20 54 45 51  |..8.         TEQ|
00001880  45 51 20 20 20 52 32 2c  23 30 0d 09 42 1a 20 20  |EQ   R2,#0..B.  |
00001890  20 20 20 20 20 20 20 42  45 51 20 20 20 20 20 66  |       BEQ     f|
000018a0  6f 75 6e 64 0d 09 4c 04  0d 09 56 1a 20 20 20 20  |ound..L...V.    |
000018b0  20 20 20 20 20 54 45 51  20 20 20 20 20 52 32 2c  |     TEQ     R2,|
000018c0  52 31 0d 09 60 1f 20 20  20 20 20 20 20 20 20 42  |R1..`.         B|
000018d0  4e 45 20 20 20 20 20 6e  6f 74 74 68 69 73 6f 6e  |NE     notthison|
000018e0  65 0d 09 6a 1a 20 20 20  20 20 20 20 20 20 54 45  |e..j.         TE|
000018f0  51 20 20 20 20 20 52 35  2c 52 37 0d 09 74 1d 20  |Q     R5,R7..t. |
00001900  20 20 20 20 20 20 20 20  42 4e 45 20 20 20 20 20  |        BNE     |
00001910  6e 78 74 5f 65 78 74 32  0d 09 7e 04 0d 09 88 10  |nxt_ext2..~.....|
00001920  20 20 20 20 20 20 2e 66  6f 75 6e 64 0d 09 92 19  |      .found....|
00001930  20 20 20 20 20 20 20 20  20 41 44 44 20 52 34 2c  |         ADD R4,|
00001940  52 34 2c 23 33 0d 09 9c  19 20 20 20 20 20 20 20  |R4,#3....       |
00001950  20 20 42 49 43 20 52 34  2c 52 34 2c 23 33 0d 09  |  BIC R4,R4,#3..|
00001960  a6 1d 20 20 20 20 20 20  20 20 20 4c 44 52 20 20  |..         LDR  |
00001970  20 20 20 52 31 30 2c 5b  52 34 5d 0d 09 b0 25 20  |   R10,[R4]...% |
00001980  20 20 20 20 20 20 20 20  4c 44 4d 49 41 20 20 20  |        LDMIA   |
00001990  52 31 33 21 2c 7b 52 30  2d 52 39 2c 52 31 34 7d  |R13!,{R0-R9,R14}|
000019a0  0d 09 ba 1b 20 20 20 20  20 20 20 20 20 4d 4f 56  |....         MOV|
000019b0  20 20 20 20 20 52 31 2c  52 31 30 0d 09 c4 26 20  |     R1,R10...& |
000019c0  20 20 20 20 20 20 20 20  42 49 43 53 20 20 20 20  |        BICS    |
000019d0  50 43 2c 52 31 34 2c 23  26 31 30 30 30 30 30 30  |PC,R14,#&1000000|
000019e0  30 0d 09 ce 04 0d 09 d8  2f 20 20 20 20 20 20 20  |0......./       |
000019f0  20 20 3b 73 65 74 20 52  31 3d 20 73 74 61 72 74  |  ;set R1= start|
00001a00  20 6f 66 20 6e 65 78 74  20 66 69 6c 65 20 65 78  | of next file ex|
00001a10  74 65 6e 74 0d 09 e2 25  20 20 20 20 20 20 20 20  |tent...%        |
00001a20  20 3b 20 26 20 69 6e 63  72 65 6d 65 6e 74 20 69  | ; & increment i|
00001a30  6e 64 65 78 20 28 52 36  29 0d 09 ec 04 0d 09 f6  |ndex (R6).......|
00001a40  15 20 20 20 20 20 20 2e  6e 6f 74 74 68 69 73 6f  |.      .notthiso|
00001a50  6e 65 0d 0a 00 19 20 20  20 20 20 20 20 20 20 41  |ne....         A|
00001a60  44 44 20 52 34 2c 52 34  2c 23 37 0d 0a 0a 19 20  |DD R4,R4,#7.... |
00001a70  20 20 20 20 20 20 20 20  42 49 43 20 52 34 2c 52  |        BIC R4,R|
00001a80  34 2c 23 33 0d 0a 14 1d  20 20 20 20 20 20 20 20  |4,#3....        |
00001a90  20 42 20 20 20 20 20 20  20 6e 78 74 5f 65 78 74  | B       nxt_ext|
00001aa0  31 0d 0a 1e 04 0d 0a 28  09 20 20 20 20 5d 0d 0a  |1......(.    ]..|
00001ab0  32 04 0d 0a 3c 21 20 20  20 20 f4 20 73 74 61 72  |2...<!    . star|
00001ac0  74 20 6f 66 20 66 69 6c  65 74 79 70 65 73 20 6c  |t of filetypes l|
00001ad0  69 73 74 0d 0a 46 0d 20  20 ed 20 70 61 73 73 25  |ist..F.  . pass%|
00001ae0  0d 0a 50 04 0d 0a 5a 38  20 20 f4 20 6e 6f 77 20  |..P...Z8  . now |
00001af0  61 6c 6c 20 63 6f 64 65  20 69 73 20 67 65 6e 65  |all code is gene|
00001b00  72 61 74 65 64 20 61 6c  6c 6f 77 20 69 74 20 74  |rated allow it t|
00001b10  6f 20 62 65 20 65 6e 74  65 72 65 64 0d 0a 64 19  |o be entered..d.|
00001b20  20 20 e3 20 70 61 73 73  25 20 3d 20 30 20 b8 20  |  . pass% = 0 . |
00001b30  32 20 88 20 32 0d 0a 6e  12 20 20 20 20 50 25 20  |2 . 2..n.    P% |
00001b40  3d 20 63 6f 64 65 25 0d  0a 78 13 20 20 20 20 5b  |= code%..x.    [|
00001b50  20 6f 70 74 20 70 61 73  73 25 0d 0a 82 19 20 20  | opt pass%....  |
00001b60  20 20 20 20 20 20 20 42  20 20 20 6e 65 77 73 74  |       B   newst|
00001b70  61 72 74 0d 0a 8c 09 20  20 20 20 5d 0d 0a 96 0d  |art....    ]....|
00001b80  20 20 ed 20 70 61 73 73  25 0d 0a a0 05 e1 0d 0a  |  . pass%.......|
00001b90  aa 04 0d 0a b4 04 0d 0a  be 11 dd a4 67 65 74 62  |............getb|
00001ba0  61 73 65 43 44 46 53 0d  0a c8 0b ea 20 42 61 73  |aseCDFS..... Bas|
00001bb0  65 25 0d 0a d2 2e 20 20  c8 99 20 22 58 4f 53 5f  |e%....  .. "XOS_|
00001bc0  4d 6f 64 75 6c 65 22 2c  31 38 2c 22 43 44 46 53  |Module",18,"CDFS|
00001bd0  22 b8 2c 2c 2c 42 61 73  65 25 3b 66 6c 61 67 25  |".,,,Base%;flag%|
00001be0  0d 0a dc 13 20 20 e7 20  66 6c 61 67 25 80 31 20  |....  . flag%.1 |
00001bf0  8c 20 e0 0d 0a e6 0b 3d  20 42 61 73 65 25 0d 0a  |. .....= Base%..|
00001c00  f0 04 0d 0a fa 2c dd a4  63 68 65 63 6b 56 65 72  |.....,..checkVer|
00001c10  73 43 44 46 53 28 20 56  65 72 73 50 74 72 25 2c  |sCDFS( VersPtr%,|
00001c20  20 56 65 72 73 4e 65 65  64 65 64 24 20 29 0d 0b  | VersNeeded$ )..|
00001c30  04 0f ea 20 43 75 72 72  56 65 72 73 24 0d 0b 0e  |... CurrVers$...|
00001c40  12 20 20 43 75 72 72 56  65 72 73 24 3d 22 22 0d  |.  CurrVers$="".|
00001c50  0b 18 07 20 20 f5 0d 0b  22 1a 20 20 20 20 e7 20  |...  ...".    . |
00001c60  28 3f 56 65 72 73 50 74  72 25 29 3e 33 31 20 8c  |(?VersPtr%)>31 .|
00001c70  0d 0b 2c 21 20 20 20 20  20 20 43 75 72 72 56 65  |..,!      CurrVe|
00001c80  72 73 24 2b 3d bd 28 3f  56 65 72 73 50 74 72 25  |rs$+=.(?VersPtr%|
00001c90  29 0d 0b 36 09 20 20 20  20 cd 0d 0b 40 13 20 20  |)..6.    ...@.  |
00001ca0  20 20 56 65 72 73 50 74  72 25 2b 3d 31 0d 0b 4a  |  VersPtr%+=1..J|
00001cb0  13 20 20 fd 20 3f 56 65  72 73 50 74 72 25 3d 30  |.  . ?VersPtr%=0|
00001cc0  0d 0b 54 1f 3d 20 28 43  75 72 72 56 65 72 73 24  |..T.= (CurrVers$|
00001cd0  20 3d 20 56 65 72 73 4e  65 65 64 65 64 24 29 0d  | = VersNeeded$).|
00001ce0  0b 5e 04 0d 0b 68 11 dd  20 a4 61 64 72 28 73 25  |.^...h.. .adr(s%|
00001cf0  2c 78 25 29 0d 0b 72 36  f4 20 54 68 65 20 69 6e  |,x%)..r6. The in|
00001d00  73 74 72 75 63 74 69 6f  6e 20 73 65 71 75 65 6e  |struction sequen|
00001d10  63 65 20 6d 75 73 74 20  62 65 20 6f 66 20 46 49  |ce must be of FI|
00001d20  58 45 44 20 6c 65 6e 67  74 68 0d 0b 7c 0e 61 25  |XED length..|.a%|
00001d30  3d 78 25 2d 50 25 2d 38  0d 0b 86 13 e7 20 28 70  |=x%-P%-8..... (p|
00001d40  61 73 73 25 20 80 20 32  29 20 8c 0d 0b 90 0e 20  |ass% . 2) ..... |
00001d50  e7 20 61 25 3e 3d 30 20  8c 0d 0b 9a 10 20 20 5b  |. a%>=0 .....  [|
00001d60  4f 50 54 20 70 61 73 73  25 0d 0b a4 22 20 20 20  |OPT pass%..."   |
00001d70  41 44 44 20 73 25 2c 50  43 2c 23 28 61 25 20 80  |ADD s%,PC,#(a% .|
00001d80  20 26 30 30 30 30 30 33  46 43 29 0d 0b ae 22 20  | &000003FC)..." |
00001d90  20 20 41 44 44 20 73 25  2c 73 25 2c 23 28 61 25  |  ADD s%,s%,#(a%|
00001da0  20 80 20 26 46 46 46 46  46 43 30 30 29 0d 0b b8  | . &FFFFFC00)...|
00001db0  07 20 20 5d 0d 0b c2 06  20 cc 0d 0b cc 0c 20 20  |.  ].... .....  |
00001dc0  61 25 3d 2d 61 25 0d 0b  d6 10 20 20 5b 4f 50 54  |a%=-a%....  [OPT|
00001dd0  20 70 61 73 73 25 0d 0b  e0 22 20 20 20 53 55 42  | pass%..."   SUB|
00001de0  20 73 25 2c 50 43 2c 23  28 61 25 20 80 20 26 30  | s%,PC,#(a% . &0|
00001df0  30 30 30 30 33 46 43 29  0d 0b ea 22 20 20 20 53  |00003FC)..."   S|
00001e00  55 42 20 73 25 2c 73 25  2c 23 28 61 25 20 80 20  |UB s%,s%,#(a% . |
00001e10  26 46 46 46 46 46 43 30  30 29 0d 0b f4 07 20 20  |&FFFFFC00)....  |
00001e20  5d 0d 0b fe 06 20 cd 0d  0c 08 05 cc 0d 0c 12 10  |].... ..........|
00001e30  20 50 25 2b 3d 38 3a 4f  25 2b 3d 38 0d 0c 1c 05  | P%+=8:O%+=8....|
00001e40  cd 0d 0c 26 07 3d 22 22  0d 0c 30 05 e1 0d 0c 3a  |...&.=""..0....:|
00001e50  04 0d 0c 44 2d dd f2 63  6f 70 79 28 f8 20 42 61  |...D-..copy(. Ba|
00001e60  73 65 25 2c 20 6e 65 77  76 65 72 73 69 6f 6e 25  |se%, newversion%|
00001e70  2c 20 43 44 46 53 6c 65  6e 67 74 68 25 29 0d 0c  |, CDFSlength%)..|
00001e80  4e 08 ea 20 6c 25 0d 0c  58 1c e3 20 6c 25 3d 30  |N.. l%..X.. l%=0|
00001e90  20 b8 20 43 44 46 53 6c  65 6e 67 74 68 25 20 88  | . CDFSlength% .|
00001ea0  20 34 0d 0c 62 1c 20 6e  65 77 76 65 72 73 69 6f  | 4..b. newversio|
00001eb0  6e 25 21 6c 25 3d 42 61  73 65 25 21 6c 25 0d 0c  |n%!l%=Base%!l%..|
00001ec0  6c 05 ed 0d 0c 76 15 42  61 73 65 25 3d 6e 65 77  |l....v.Base%=new|
00001ed0  76 65 72 73 69 6f 6e 25  0d 0c 80 05 e1 0d 0c 8a  |version%........|
00001ee0  04 0d 0c 94 1b dd f2 72  65 69 6e 73 65 72 74 28  |.......reinsert(|
00001ef0  73 74 61 72 74 25 2c 6c  65 6e 25 29 0d 0c 9e 20  |start%,len%)... |
00001f00  c8 99 22 4f 53 5f 4d 6f  64 75 6c 65 22 2c 31 31  |.."OS_Module",11|
00001f10  2c 73 74 61 72 74 25 2c  6c 65 6e 25 0d 0c a8 05  |,start%,len%....|
00001f20  e1 0d 0c b2 05 3a 0d 0c  bc 21 dd f2 72 65 73 6f  |.....:...!..reso|
00001f30  75 72 63 65 64 61 74 61  28 f8 20 43 44 46 53 6c  |urcedata(. CDFSl|
00001f40  65 6e 67 74 68 25 29 0d  0c c6 22 ea 20 6c 25 2c  |ength%)...". l%,|
00001f50  66 25 2c 6e 25 2c 70 61  73 73 25 2c 6e 65 77 6d  |f%,n%,pass%,newm|
00001f60  6f 64 75 6c 65 65 6e 64  25 0d 0c d0 12 6e 25 3d  |oduleend%....n%=|
00001f70  6e 65 77 76 65 72 73 69  6f 6e 25 0d 0c da 08 66  |newversion%....f|
00001f80  25 3d 30 0d 0c e4 1c e3  20 6c 25 3d 30 20 b8 20  |%=0..... l%=0 . |
00001f90  43 44 46 53 6c 65 6e 67  74 68 25 20 88 20 34 0d  |CDFSlength% . 4.|
00001fa0  0c ee 44 20 e7 20 6e 25  21 6c 25 3d 26 45 33 31  |..D . n%!l%=&E31|
00001fb0  34 30 30 30 32 20 80 20  6e 25 21 28 6c 25 2b 34  |40002 . n%!(l%+4|
00001fc0  29 3d 26 30 33 41 30 34  30 30 31 20 80 20 6e 25  |)=&03A04001 . n%|
00001fd0  21 28 6c 25 2b 38 29 3d  26 31 33 41 30 34 30 30  |!(l%+8)=&13A0400|
00001fe0  32 20 8c 0d 0c f8 0b 20  20 66 25 3d 6c 25 0d 0d  |2 .....  f%=l%..|
00001ff0  02 06 20 cd 0d 0d 0c 05  ed 0d 0d 16 0c e7 20 66  |.. ........... f|
00002000  25 3d 30 20 8c 0d 0d 20  2c 20 e3 20 6c 25 3d 43  |%=0 ... , . l%=C|
00002010  44 46 53 6c 65 6e 67 74  68 25 2d 34 30 39 36 20  |DFSlength%-4096 |
00002020  b8 20 43 44 46 53 6c 65  6e 67 74 68 25 20 88 20  |. CDFSlength% . |
00002030  34 0d 0d 2a 35 20 20 e7  20 a4 73 74 72 69 6e 67  |4..*5  . .string|
00002040  28 42 61 73 65 25 2b 6c  25 29 3d 22 52 4a 57 20  |(Base%+l%)="RJW |
00002050  77 61 73 20 68 65 72 65  20 74 6f 6f 21 22 20 8c  |was here too!" .|
00002060  20 66 25 3d 6c 25 0d 0d  34 06 20 ed 0d 0d 3e 0d  | f%=l%..4. ...>.|
00002070  20 e7 20 66 25 3d 30 20  8c 0d 0d 48 3a 20 20 85  | . f%=0 ...H:  .|
00002080  20 a2 20 32 37 2c 22 43  6f 75 6c 64 6e 27 74 20  | . 27,"Couldn't |
00002090  66 69 6e 64 20 70 61 74  63 68 20 70 6f 69 6e 74  |find patch point|
000020a0  20 66 6f 72 20 52 65 73  6f 75 72 63 65 2f 44 61  | for Resource/Da|
000020b0  74 61 22 0d 0d 52 06 20  cc 0d 0d 5c 1a 20 20 f4  |ta"..R. ...\.  .|
000020c0  20 41 6c 72 65 61 64 79  20 70 61 74 63 68 65 64  | Already patched|
000020d0  2e 2e 2e 0d 0d 66 06 20  cd 0d 0d 70 05 cc 0d 0d  |.....f. ...p....|
000020e0  7a 24 20 72 65 73 64 61  74 61 73 74 61 72 74 25  |z$ resdatastart%|
000020f0  3d 42 61 73 65 25 2b 43  44 46 53 6c 65 6e 67 74  |=Base%+CDFSlengt|
00002100  68 25 0d 0d 84 0e 20 66  25 2b 3d 42 61 73 65 25  |h%.... f%+=Base%|
00002110  0d 0d 8e 16 20 e3 20 70  61 73 73 25 3d 30 20 b8  |.... . pass%=0 .|
00002120  20 32 20 88 20 32 0d 0d  98 0b 20 20 50 25 3d 66  | 2 . 2....  P%=f|
00002130  25 0d 0d a2 10 20 20 5b  4f 50 54 20 70 61 73 73  |%....  [OPT pass|
00002140  25 0d 0d ac 1e 20 20 20  20 20 20 20 20 20 42 20  |%....         B |
00002150  72 65 73 64 61 74 61 73  74 61 72 74 25 20 20 0d  |resdatastart%  .|
00002160  0d b6 07 20 20 5d 0d 0d  c0 16 20 20 50 25 3d 72  |...  ]....  P%=r|
00002170  65 73 64 61 74 61 73 74  61 72 74 25 0d 0d ca 10  |esdatastart%....|
00002180  20 20 5b 4f 50 54 20 70  61 73 73 25 0d 0d d4 16  |  [OPT pass%....|
00002190  20 20 20 20 20 20 20 20  20 54 53 54 20 52 34 2c  |         TST R4,|
000021a0  23 34 0d 0d de 17 20 20  20 20 20 20 20 20 20 42  |#4....         B|
000021b0  4e 45 20 6f 70 61 71 75  65 0d 0d e8 11 20 20 20  |NE opaque....   |
000021c0  20 20 20 2e 6e 6f 72 6d  61 6c 0d 0d f2 16 20 20  |   .normal....  |
000021d0  20 20 20 20 20 20 20 54  53 54 20 52 34 2c 23 32  |       TST R4,#2|
000021e0  0d 0d fc 13 20 20 20 20  20 20 20 20 20 42 20 66  |....         B f|
000021f0  25 2b 34 0d 0e 06 11 20  20 20 20 20 20 2e 6f 70  |%+4....      .op|
00002200  61 71 75 65 0d 0e 10 1f  20 20 20 20 20 20 20 20  |aque....        |
00002210  20 53 54 4d 46 44 20 52  31 33 21 2c 7b 52 30 2c  | STMFD R13!,{R0,|
00002220  52 36 7d 0d 0e 1a 16 20  20 20 20 20 20 20 20 20  |R6}....         |
00002230  4d 4f 56 20 52 30 2c 23  30 0d 0e 24 1a 20 20 20  |MOV R0,#0..$.   |
00002240  20 20 20 20 20 20 41 44  44 20 52 36 2c 52 36 2c  |      ADD R6,R6,|
00002250  23 32 34 0d 0e 2e 11 20  20 20 20 20 20 2e 6f 70  |#24....      .op|
00002260  6c 6f 6f 70 0d 0e 38 1c  20 20 20 20 20 20 20 20  |loop..8.        |
00002270  20 4c 44 52 42 20 52 34  2c 5b 52 36 5d 2c 23 31  | LDRB R4,[R6],#1|
00002280  0d 0e 42 19 20 20 20 20  20 20 20 20 20 43 4d 50  |..B.         CMP|
00002290  20 52 34 2c 23 97 22 2f  22 0d 0e 4c 1b 20 20 20  | R4,#."/"..L.   |
000022a0  20 20 20 20 20 20 53 55  42 45 51 20 52 30 2c 52  |      SUBEQ R0,R|
000022b0  36 2c 23 31 0d 0e 56 17  20 20 20 20 20 20 20 20  |6,#1..V.        |
000022c0  20 43 4d 50 20 52 34 2c  23 33 32 0d 0e 60 17 20  | CMP R4,#32..`. |
000022d0  20 20 20 20 20 20 20 20  42 47 45 20 6f 70 6c 6f  |        BGE oplo|
000022e0  6f 70 0d 0e 6a 19 20 20  20 20 20 20 20 20 20 4d  |op..j.         M|
000022f0  4f 56 20 52 34 2c 23 97  22 5f 22 0d 0e 74 16 20  |OV R4,#."_"..t. |
00002300  20 20 20 20 20 20 20 20  43 4d 50 20 52 30 2c 23  |        CMP R0,#|
00002310  30 0d 0e 7e 1b 20 20 20  20 20 20 20 20 20 53 54  |0..~.         ST|
00002320  52 4e 45 42 20 52 34 2c  5b 52 30 5d 0d 0e 88 1f  |RNEB R4,[R0]....|
00002330  20 20 20 20 20 20 20 20  20 53 54 52 45 51 42 20  |         STREQB |
00002340  52 34 2c 5b 52 36 2c 23  2d 31 5d 0d 0e 92 1f 20  |R4,[R6,#-1].... |
00002350  20 20 20 20 20 20 20 20  4c 44 4d 46 44 20 52 31  |        LDMFD R1|
00002360  33 21 2c 7b 52 30 2c 52  36 7d 0d 0e 9c 16 20 20  |3!,{R0,R6}....  |
00002370  20 20 20 20 20 20 20 4d  4f 56 20 52 34 2c 23 31  |       MOV R4,#1|
00002380  0d 0e a6 14 20 20 20 20  20 20 20 20 20 42 20 66  |....         B f|
00002390  25 2b 31 32 0d 0e b0 17  20 20 20 20 20 20 20 20  |%+12....        |
000023a0  20 45 51 55 53 22 52 4a  57 20 22 0d 0e ba 17 20  | EQUS"RJW ".... |
000023b0  20 20 20 20 20 20 20 20  45 51 55 53 22 77 61 73  |        EQUS"was|
000023c0  20 22 0d 0e c4 17 20 20  20 20 20 20 20 20 20 45  | "....         E|
000023d0  51 55 53 22 68 65 72 65  22 0d 0e ce 17 20 20 20  |QUS"here"....   |
000023e0  20 20 20 20 20 20 45 51  55 53 22 20 74 6f 6f 22  |      EQUS" too"|
000023f0  0d 0e d8 29 20 20 20 20  20 20 20 20 20 45 51 55  |...)         EQU|
00002400  53 22 21 22 3a 45 51 55  42 20 30 3a 45 51 55 42  |S"!":EQUB 0:EQUB|
00002410  20 30 3a 45 51 55 42 20  30 0d 0e e2 18 20 20 20  | 0:EQUB 0....   |
00002420  20 20 20 2e 6e 65 77 6d  6f 64 75 6c 65 65 6e 64  |   .newmoduleend|
00002430  25 0d 0e ec 13 20 20 20  20 20 20 20 20 20 45 51  |%....         EQ|
00002440  55 44 20 30 0d 0e f6 13  20 20 20 20 20 20 20 20  |UD 0....        |
00002450  20 45 51 55 44 20 30 0d  0f 00 13 20 20 20 20 20  | EQUD 0....     |
00002460  20 20 20 20 45 51 55 44  20 30 0d 0f 0a 13 20 20  |    EQUD 0....  |
00002470  20 20 20 20 20 20 20 45  51 55 44 20 30 0d 0f 14  |       EQUD 0...|
00002480  07 20 20 5d 0d 0f 1e 06  20 ed 0d 0f 28 24 20 43  |.  ].... ...($ C|
00002490  44 46 53 6c 65 6e 67 74  68 25 3d 6e 65 77 6d 6f  |DFSlength%=newmo|
000024a0  64 75 6c 65 65 6e 64 25  2d 42 61 73 65 25 0d 0f  |duleend%-Base%..|
000024b0  32 05 cd 0d 0f 3c 05 e1  0d 0f 46 05 3a 0d 0f 50  |2....<....F.:..P|
000024c0  10 dd a4 73 74 72 69 6e  67 28 6c 25 29 0d 0f 5a  |...string(l%)..Z|
000024d0  08 ea 20 61 24 0d 0f 64  09 61 24 3d 22 22 0d 0f  |.. a$..d.a$=""..|
000024e0  6e 17 c8 95 20 3f 6c 25  3e 33 31 20 80 20 3f 6c  |n... ?l%>31 . ?l|
000024f0  25 3c 31 32 37 0d 0f 78  0f 20 61 24 2b 3d bd 28  |%<127..x. a$+=.(|
00002500  3f 6c 25 29 0d 0f 82 0a  20 6c 25 2b 3d 31 0d 0f  |?l%).... l%+=1..|
00002510  8c 05 ce 0d 0f 96 07 3d  61 24 0d 0f a0 04 0d 0f  |.......=a$......|
00002520  aa 16 dd f2 72 65 61 64  66 69 6c 65 28 f8 20 6c  |....readfile(. l|
00002530  65 6e 25 29 0d 0f b4 20  ea 20 66 69 6c 65 25 2c  |en%)... . file%,|
00002540  65 78 74 24 2c 66 74 25  2c 66 74 74 25 2c 65 72  |ext$,ft%,ftt%,er|
00002550  72 6f 72 25 0d 0f be 0c  65 72 72 6f 72 25 3d a3  |ror%....error%=.|
00002560  0d 0f c8 1d 66 69 6c 65  74 79 70 65 74 61 62 6c  |....filetypetabl|
00002570  65 25 3d 42 61 73 65 25  2b 6c 65 6e 25 0d 0f d2  |e%=Base%+len%...|
00002580  17 66 74 74 25 3d 66 69  6c 65 74 79 70 65 74 61  |.ftt%=filetypeta|
00002590  62 6c 65 25 0d 0f dc 0b  65 78 74 24 3d 22 22 0d  |ble%....ext$="".|
000025a0  0f e6 09 66 74 25 3d 30  0d 0f f0 22 66 69 6c 65  |...ft%=0..."file|
000025b0  25 3d 8e 28 22 3c 4f 62  65 79 24 44 69 72 3e 2e  |%=.("<Obey$Dir>.|
000025c0  4d 61 70 70 69 6e 67 73  22 29 0d 0f fa 0f e7 20  |Mappings")..... |
000025d0  66 69 6c 65 25 3d 30 20  8c 0d 10 04 26 20 85 20  |file%=0 ....& . |
000025e0  a2 20 32 37 2c 22 4d 61  70 70 69 6e 67 73 20 66  |. 27,"Mappings f|
000025f0  69 6c 65 20 6e 6f 74 20  66 6f 75 6e 64 21 22 0d  |ile not found!".|
00002600  10 0e 05 cc 0d 10 18 1c  20 c8 95 20 ac 20 c5 23  |........ .. . .#|
00002610  66 69 6c 65 25 20 80 20  ac 20 65 72 72 6f 72 25  |file% . . error%|
00002620  0d 10 22 1f 20 20 65 72  72 6f 72 25 3d a4 67 65  |..".  error%=.ge|
00002630  74 6c 69 6e 65 28 65 78  74 24 2c 66 74 25 29 0d  |tline(ext$,ft%).|
00002640  10 2c 12 20 20 e7 20 ac  20 65 72 72 6f 72 25 20  |.,.  . . error% |
00002650  8c 0d 10 36 17 20 20 20  f2 65 71 75 73 28 66 74  |...6.   .equs(ft|
00002660  74 25 2c 65 78 74 24 29  0d 10 40 11 20 20 20 66  |t%,ext$)..@.   f|
00002670  74 74 25 21 34 3d 66 74  25 0d 10 4a 0e 20 20 20  |tt%!4=ft%..J.   |
00002680  66 74 74 25 2b 3d 38 0d  10 54 0e 20 20 20 6c 65  |ftt%+=8..T.   le|
00002690  6e 25 2b 3d 38 0d 10 5e  07 20 20 cd 0d 10 68 06  |n%+=8..^.  ...h.|
000026a0  20 ce 0d 10 72 0c 20 d9  23 66 69 6c 65 25 0d 10  | ...r. .#file%..|
000026b0  7c 0c 20 21 66 74 74 25  3d 30 0d 10 86 0d 20 66  ||. !ftt%=0.... f|
000026c0  74 74 25 21 34 3d 30 0d  10 90 0c 20 6c 65 6e 25  |tt%!4=0.... len%|
000026d0  2b 3d 38 0d 10 9a 05 cd  0d 10 a4 2f e7 20 65 72  |+=8......../. er|
000026e0  72 6f 72 25 20 8c 20 85  20 a2 20 32 37 2c 22 4d  |ror% . . . 27,"M|
000026f0  61 6c 66 6f 72 6d 65 64  20 4d 61 70 70 69 6e 67  |alformed Mapping|
00002700  73 20 66 69 6c 65 22 0d  10 ae 05 e1 0d 10 b8 05  |s file".........|
00002710  3a 0d 10 c2 1c dd a4 67  65 74 6c 69 6e 65 28 f8  |:......getline(.|
00002720  20 65 78 74 24 2c 20 f8  20 66 74 25 29 0d 10 cc  | ext$, . ft%)...|
00002730  0f ea 20 61 25 2c 65 72  72 6f 72 25 0d 10 d6 0c  |.. a%,error%....|
00002740  65 72 72 6f 72 25 3d a3  0d 10 e0 0b 65 78 74 24  |error%=.....ext$|
00002750  3d 22 22 0d 10 ea 0e 61  25 3d 9a 23 66 69 6c 65  |=""....a%=.#file|
00002760  25 0d 10 f4 34 c8 95 20  28 61 25 3e 3d 97 22 41  |%...4.. (a%>=."A|
00002770  22 20 80 20 61 25 3c 3d  97 22 5a 22 29 20 84 20  |" . a%<=."Z") . |
00002780  28 61 25 3e 3d 97 22 30  22 20 80 20 61 25 3c 3d  |(a%>=."0" . a%<=|
00002790  97 22 39 22 29 0d 10 fe  10 20 65 78 74 24 2b 3d  |."9").... ext$+=|
000027a0  bd 28 61 25 29 0d 11 08  0f 20 61 25 3d 9a 23 66  |.(a%).... a%=.#f|
000027b0  69 6c 65 25 0d 11 12 05  ce 0d 11 1c 16 e7 20 61  |ile%.......... a|
000027c0  25 3c 3e 39 20 80 20 61  25 3c 3e 33 32 20 8c 0d  |%<>9 . a%<>32 ..|
000027d0  11 26 0d 20 65 72 72 6f  72 25 3d b9 0d 11 30 05  |.&. error%=...0.|
000027e0  cc 0d 11 3a 12 20 65 78  74 24 3d c0 65 78 74 24  |...:. ext$=.ext$|
000027f0  2c 33 29 0d 11 44 17 20  66 74 25 3d a4 65 76 61  |,3)..D. ft%=.eva|
00002800  6c 28 be 23 66 69 6c 65  25 29 0d 11 4e 18 20 e7  |l(.#file%)..N. .|
00002810  20 66 74 25 3d 2d 31 20  8c 20 65 72 72 6f 72 25  | ft%=-1 . error%|
00002820  3d b9 0d 11 58 05 cd 0d  11 62 0b 3d 65 72 72 6f  |=...X....b.=erro|
00002830  72 25 0d 11 6c 05 3a 0d  11 76 11 dd f2 73 74 72  |r%..l.:..v...str|
00002840  69 70 28 f8 20 66 24 29  0d 11 80 14 c8 95 20 97  |ip(. f$)...... .|
00002850  28 c0 66 24 2c 31 29 29  3c 3d 33 32 0d 11 8a 0e  |(.f$,1))<=32....|
00002860  20 66 24 3d c1 66 24 2c  32 29 0d 11 94 05 ce 0d  | f$=.f$,2)......|
00002870  11 9e 14 c8 95 20 97 28  c2 66 24 2c 31 29 29 3c  |..... .(.f$,1))<|
00002880  3d 33 32 0d 11 a8 13 20  66 24 3d c0 66 24 2c a9  |=32.... f$=.f$,.|
00002890  20 66 24 2d 31 29 0d 11  b2 05 ce 0d 11 bc 05 e1  | f$-1)..........|
000028a0  0d 11 c6 05 3a 0d 11 d0  0e dd a4 65 76 61 6c 28  |....:......eval(|
000028b0  73 24 29 0d 11 da 13 ea  20 6f 6b 24 2c 65 72 72  |s$)..... ok$,err|
000028c0  6f 72 25 2c 6c 25 0d 11  e4 0c 65 72 72 6f 72 25  |or%,l%....error%|
000028d0  3d 30 0d 11 ee 0e f2 73  74 72 69 70 28 73 24 29  |=0.....strip(s$)|
000028e0  0d 11 f8 14 6f 6b 24 3d  22 30 31 32 33 34 35 36  |....ok$="0123456|
000028f0  37 38 39 22 0d 12 02 27  e7 20 c0 73 24 2c 31 29  |789"...'. .s$,1)|
00002900  3d 22 26 22 20 8c 20 6f  6b 24 2b 3d 22 26 41 42  |="&" . ok$+="&AB|
00002910  43 44 45 46 61 62 63 64  65 66 22 0d 12 0c 0e e7  |CDEFabcdef".....|
00002920  20 a9 20 73 24 3d 30 20  8c 0d 12 16 0e 20 65 72  | . s$=0 ..... er|
00002930  72 6f 72 25 3d 2d 31 0d  12 20 05 cc 0d 12 2a 12  |ror%=-1.. ....*.|
00002940  20 e3 20 6c 25 3d 31 20  b8 20 a9 20 73 24 0d 12  | . l%=1 . . s$..|
00002950  34 26 20 20 e7 20 a7 6f  6b 24 2c c1 73 24 2c 6c  |4&  . .ok$,.s$,l|
00002960  25 2c 31 29 29 3c 3d 30  20 8c 20 65 72 72 6f 72  |%,1))<=0 . error|
00002970  25 3d 2d 31 0d 12 3e 06  20 ed 0d 12 48 1e 20 e7  |%=-1..>. ...H. .|
00002980  20 65 72 72 6f 72 25 3d  30 20 8c 20 65 72 72 6f  | error%=0 . erro|
00002990  72 25 3d a0 28 73 24 29  0d 12 52 05 cd 0d 12 5c  |r%=.(s$)..R....\|
000029a0  0b 3d 65 72 72 6f 72 25  0d 12 66 05 3a 0d 12 70  |.=error%..f.:..p|
000029b0  11 dd f2 65 71 75 73 28  70 25 2c 65 24 29 0d 12  |...equs(p%,e$)..|
000029c0  7a 09 21 70 25 3d 30 0d  12 84 09 50 25 3d 70 25  |z.!p%=0....P%=p%|
000029d0  0d 12 8e 0a 5b 4f 50 54  20 32 0d 12 98 0b 45 51  |....[OPT 2....EQ|
000029e0  55 53 20 65 24 0d 12 a2  05 5d 0d 12 ac 05 e1 0d  |US e$....]......|
000029f0  ff                                                |.|
000029f1
!CDFix/CDtype.m0
!CDFix/CDtype.m1
!CDFix/CDtype.m2
!CDFix/CDtype.m4
!CDFix/CDtype.m5