This repository has been archived by the owner on Feb 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ia2sl.sh
1906 lines (1858 loc) · 106 KB
/
ia2sl.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
# Subroutines defined here.
function startcycle() {
local worktype=${1^^}
# We use $1 instead of $worktype because BOTH can also be passed through
# worktype and that'll cause this to break. Instead we take what the caller
# gives us in $1
COUNTER=1
# Run to a maximum of 500, end with exit code 1 when we finally hit a dupe.
while [ $COUNTER -lt 499 ]; do
if ! (generator $COUNTER $1); then
aggregate $1
return 1
fi
let COUNTER=COUNTER+1
done
aggregate $1
}
function generator() {
# Remove and recreate certain work directories so they're clean.
rm -rf "$worktype"diskoutput 2>/dev/null
rm -rf "$worktype"diskstaging 2>/dev/null
mkdir "$worktype"diskoutput 2>/dev/null
mkdir "$worktype"diskstaging 2>/dev/null
# Do the actual search and download.
# This will depend on which type we're using, of course.
case ${2} in
"WOZADAY")
ia search 'collection:wozaday' --parameters="page=$1&rows=1" --sort="publicdate desc" -i >"$worktype"currentitems.txt
;;
"CLCRACKED")
ia search '@4am subject:"crack"' --parameters="page=$1&rows=1" --sort="publicdate desc" -i >"$worktype"currentitems.txt
;;
esac
# Output download URLs to currentdls.txt
ia download -d -i --no-directories --glob '*.zip|*.xml|*.dsk|*.2mg|*.po|*.bin|*.woz|*crack).zip|*.BIN' --itemlist="$worktype"currentitems.txt >"$worktype"currentdls.txt
# Let's remove the extras file and certain other unwanted materials
sed -i "/%20extras%20/d;/extras.zip/d;/0playable/d;/_files.xml/d;/demuffin\'d/d;/work%20disk/d" "$worktype"currentdls.txt
# Now we download.
wget -q -i "$worktype"currentdls.txt -nc -nv -nd -P ./"$worktype"diskstaging
# Let's decompress any ZIP files we got, forced lowercase names.
unzip -n -qq -LL -j "$worktype"'diskstaging/*.zip' -d "$worktype"diskoutput 2>/dev/null
# Before we go ANY further, let's clean up any .bin files into .2mg ...
cd "$worktype"diskstaging || exit
# Find all .bin files and rename them to 2mg. This should be Distro-agnostic,
# as opposed to the previous Debian-specific variation.
find . -name "*.bin" -exec sh -c 'mv "$1" "${1%.bin}.2mg"' _ {} \; 2>/dev/null
cd ..
# Move the meta XML and the disk images to the output folder for processing.
mv "$worktype"diskstaging/*.woz "$worktype"diskoutput 2>/dev/null
cp "$worktype"diskstaging/*meta.xml "$worktype"diskoutput 2>/dev/null
cd "$worktype"diskoutput || exit
# Remove stuff we don't want. We don't want to parse the playable.dsk because
# that's an exact copy of the properly named disk. We don't want pictures and
# videos in this case either.
rm ./00playable.dsk 2>/dev/null
rm ./00playable.2mg 2>/dev/null
rm ./00playable.woz 2>/dev/null
rm ./00playable2.dsk 2>/dev/null
rm ./playable.dsk 2>/dev/null
rm ./playable.2mg 2>/dev/null
rm ./playable.woz 2>/dev/null
rm ./*.a2r 2>/dev/null
rm ./*.png 2>/dev/null
rm ./*.mp4 2>/dev/null
rm ./*.jpg 2>/dev/null
rm ./*fastdsk\ rip\* 2>/dev/null
# These next two files seem to pop up a lot with MP4 files, which we don't want.
rm ./ProjFileList.xml 2>/dev/null
rm ./project.xml 2>/dev/null
# 4AM sometimes leaves his work disk in the package. We don't want to keep that.
rm ./*work\ disk* 2>/dev/null
rm ./*demuffin\'d\ only* 2>/dev/null
# Now, we parse the XML file(s), and there should only be one to parse.
for filename in *.xml; do
[ -e "$filename" ] || continue
# We'll have to handcraft the shortname ourselves.
echo -e '\t<software name="ia2slnewnamehere">' >../xml/"$worktype"disk/disk$1.xml
echo -e -n '\t\t<description>' >>../xml/"$worktype"disk/disk$1.xml
# Now, let's do a bit of adjusting with the description name, to change
# v1.0 to (Version 1.0) and so forth.
# We can add more special cases as they show up in the future.
# Also remove the "IIgs" from the end of GS-specific disks since they're
# going to go into a GS-specific software list.
# FIXME: Temporarily disable this while I try to figure out how to keep this from breaking things..
xmllint --xpath 'metadata/title/text()' "$filename" | tr -d '\n' >>../xml/"$worktype"disk/disk$1.xml
# xmllint --xpath 'metadata/title/text()' "$filename" | tr -d '\n' | sed -E 's/v([[:digit:]]*).([[:digit:]]*).([[:digit:]]*)/\(Version \1.\2.\3\)/;s/\.\)/) /;s/ IIga//' >>../xml/"$worktype"disk/disk$1.xml
echo -e '</description>' >>../xml/"$worktype"disk/disk$1.xml
echo -e -n '\t\t<year>' >>../xml/"$worktype"disk/disk$1.xml
xmllint --xpath 'metadata/description/text()' $filename | grep -o '19[0123456789][0123456789]' | tr -d '\n' >>../xml/"$worktype"disk/disk$1.xml
echo -e '</year>' >>../xml/"$worktype"disk/disk$1.xml
echo -e -n '\t\t<publisher>' >>../xml/"$worktype"disk/disk$1.xml
xmllint --xpath 'metadata/description/text()' $filename | grep -o -a -i -F -f ../publishers.txt | tr -d '\n' | sed -E -e 's/distributed by //g;s/published by //g;s/\&\;amp\;/and/g' >>../xml/"$worktype"disk/disk$1.xml
echo -e '</publisher>' >>../xml/"$worktype"disk/disk$1.xml
echo -e -n '\t\t<info name="release" value="' >>../xml/"$worktype"disk/disk$1.xml
xmllint --xpath 'metadata/publicdate/text()' $filename | awk '{print $1}' | tr -d '\n' >>../xml/"$worktype"disk/disk$1.xml
echo -e '"/>' >>../xml/"$worktype"disk/disk$1.xml
# Now, this next step only is done if we're doing WOZADAY where we have actual compatibility data at hand.
case ${2} in
"WOZADAY")
compatdata=$(xmllint --xpath 'metadata/description/text()' $filename | tr -d '\n')
case $compatdata in
# Copy Protection compatibility issues section -------------------
*"It requires a 48K Apple ][ or ][+. It will not run on later models."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 48K Apple ][ or ][+.' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tIt will not run on later models. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires an Apple ][ or ][+ with 48K. Due to compatibiltiy issues created by the copy protection, it will not run on later models. Even with a compatible ROM file, this game triggers bugs in several emulators, resulting in crashes or spontaneous reboots."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t\<!-- It requires an Apple II or II+ with 48K.' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t\Due to compatibility issues created by the copy protection,' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t\it will not run on later models. Even with a compatible ROM file,' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t\this game triggers bugs in several emulators,' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t\resulting in crashes or spontaneous reboots. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 48K Apple ][ or ][+, or an unenhanced Apple //e. Due to compatibility issues caused by the copy protection, it will not run on any later models."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 48K Apple II or II+,' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tor an unenhanced Apple //e. Due to compatibility' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tissues caused by the copy protection, it will not' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\trun on any later models. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 48K Apple II or ][+. Due to compatibility issues created by the copy protection, it will not run on later models."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 48K Apple II or II+.' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tDue to compatibility issues caused by the copy protection,' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tit will not run on any later models. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 48K Apple ][ or ][+. Due to compatibility issues caused by the copy protection, it will not run on any later models."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 48K Apple II or II+.' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tDue to compatibility issues caused by the copy protection,' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tit will not run on any later models. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 48K Apple ][ or Apple ][+. Due to compatibility problems created by the copy protection, it will not run on later models"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 48K Apple II or II+.' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tDue to compatibility issues caused by the copy protection,' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tit will not run on any later models. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 64K Apple ][+ or later. It was released with several different copy protections; this version was protected with the E7 bitstream. Game code and data is identical to other protected variants"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 64K Apple II+ or later.' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tThis was released with several different copy protections;' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tthis version was protected with the E7 bitstream. Game code and data' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tis identical to other protected variants. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It runs on any Apple ][ with 48K. Some emulators may have difficulty emulating this image due to its extreme copy protection methods"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on any Apple II with 48K.' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tSome emulators may have difficulty emulating this image due to its' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\textreme copy protection methods. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires an Apple ][ or Apple ][+. Due to restrictive copy protection, it will not boot on later models"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires an Apple II or Apple II+.' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tDue to restrictive copy protection,' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tit will not boot on later models. --> -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*'It runs on any Apple ][ with 48K. Note: due to subtle emulation bugs and extremely finicky copy protection, this disk may reboot one or more times before loading.'*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on any Apple II with 48K.' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tNote: due to subtle emulation bugs and extremely finicky copy' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tprotection, this disk may reboot one or more times before loading. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
# Non-copy protection-related special notes ----------------------
*"Attempting to run with less than 48K will appear to work, but copies will fail with an UNABLE TO WRITE error."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on any Apple II with 48K.' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t(Attempting to run with less than 48K will appear to work,' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tbut copies will fail with an UNABLE TO WRITE error.) -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 48K Apple ][ or ][+."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 48K Apple II or II+. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 48K Apple II or II+."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 48K Apple II or II+. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It runs on any Apple ][ with 48K. The double hi-res version is automatically selected if you have a 128K Apple //e or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on any Apple II with 48K.' >>../xml/"$worktype"disk/disk$1.xml
echo -e 'The double hi-res version is automatically selected' >>../xml/"$worktype"disk/disk$1.xml
echo -e 'if you have a 128K Apple //e or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 64K Apple ][+, //e, //c, or IIgs. Double hi-res mode requires a 128K Apple //e, //c, or IIgs"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 64K Apple ][+, //e, //c, or IIgs.' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tDouble hi-res mode requires a 128K Apple //e, //c, or IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It uses double hi-res graphics and thus requires a 128K Apple //e, //c, or IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It uses double hi-res graphics and thus requires a' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t128K Apple //e, //c, or IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"This version, using double hi-res graphics, requires a 128K Apple //e, //c, or IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- This version, using double hi-res graphics,' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\trequires a 128K Apple //e, //c, or IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 13-sector drive but otherwise runs on any Apple II with 48K."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 13-sector drive but otherwise' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\truns on any Apple II with 48K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 13-sector drive but otherwise runs on any Apple II with 32K."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 13-sector drive but otherwise' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\truns on any Apple II with 32K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 13-sector drive but otherwise runs on any Apple II with 24K."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 13-sector drive but otherwise' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\truns on any Apple II with 24K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 13-sector drive but otherwise runs on any Apple II with 16K."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 13-sector drive but otherwise' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\truns on any Apple II with 16K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 13-sector drive and a 48K Apple ][+ or later"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 13-sector drive and a 48K Apple II+ or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires an original Apple II with 48K and Integer BASIC in ROM."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires an original Apple II with 48K and Integer BASIC' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tin ROM. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 48K Apple II and Integer BASIC in ROM"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires an original Apple II with 48K and Integer BASIC' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tin ROM. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires an original Apple II with 32K and Integer BASIC in ROM."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires an original Apple II with 32K and Integer BASIC' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tin ROM. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 64K Apple ][+ or later. Double hi-res graphics are available on 128K Apple //e and later"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 64K Apple ][+ or later.' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tDouble hi-res graphics are available on 128K Apple //e and later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"This re-release requires a 64K Apple ][+ or later; the optional double hi-res graphics mode requires a 128K Apple //e or later. "*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- This re-release requires a 64K Apple II+ or later;' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tthe optional double hi-res graphics mode requires a' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t128K Apple //e or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"The disk label says it requires a 32K Apple II, but under emulation I could not get it to work on less than a 48K Apple II+"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- The disk label says it requires a 32K Apple II, but under' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\temulation I could not get it to work on less than a 48K Apple II+. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires an Apple ][ with an Integer BASIC ROM and at least 32K. Due to the reliance on Integer ROM, it will not run on later models"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires an Apple II with Integer BASIC ROM and at least 32K.' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tDue to reliance on Integer ROM, it will not run on later models. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"Due to its use of double hi-res graphics, it requires a 128K Apple //e or later"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- Due to its use of double hi-res graphics,' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\tit requires a 128K Apple //e or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires an Apple IIgs, Apple //c+, or a 128K Apple //e with a compatible drive controller card."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires an Apple IIgs, Apple //c+, or a 128K Apple //e with a compatible drive controller card. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires an Apple IIgs, Apple //c+, Apple //e, or 64K Apple ][+ with a compatible drive controller card."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires an Apple IIgs, Apple //c+, Apple //e, or 64K Apple ][+ with a compatible drive controller card. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires an Apple IIgs, Apple //c+, or 128K Apple //e with a compatible drive controller card."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires an Apple IIgs, Apple //c+, or 128K Apple //e with a compatible drive controller card. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 1.5MB Apple IIgs ROM 01 or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 1.5MB Apple IIgs ROM 01 or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 1.25MB Apple IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 1.25MB Apple IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 1.25M Apple IIgs ROM 00 or ROM 01."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 1.25M Apple IIgs ROM 00 or ROM 01. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 1.25MB Apple IIgs ROM 01 or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 1.25MB Apple IIgs ROM 01 or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 1MB Apple IIgs. (Music requires 1.25MB.)"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 1MB Apple IIgs. (Music requires 1.25MB.) -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 1MB Apple IIgs ROM01 or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 1MB Apple IIgs ROM01 or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 1MB Apple IIgs ROM 01 or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 1MB Apple IIgs ROM 01 or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 1 MB Apple IIgs ROM 01 or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 1 MB Apple IIgs ROM 01 or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 1MB Apple IIgs ROM 01 or later"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 1MB Apple IIgs ROM 01 or later -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 768K Apple IIgs ROM 01 or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 768K Apple IIgs ROM 01 or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 768K Apple IIgs ROM01 or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 768K Apple IIgs ROM01 or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 768K Apple IIgs ROM 00 or ROM 01."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 768K Apple IIgs ROM 00 or ROM 01. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 512K Apple IIgs ROM 01. Music requires 768K."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 512K Apple IIgs ROM 01. Music requires 768K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 512K Apple IIgs ROM 01 or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 512K Apple IIgs ROM 01 or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 512K Apple IIgs ROM01 or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 512K Apple IIgs ROM01 or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 512K Apple IIgs ROM 00 or ROM 01."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 512K Apple IIgs ROM 00 or ROM 01. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 512K Apple IIgs ROM 01 or earlier."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 512K Apple IIgs ROM 01 or earlier. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 256K Apple IIgs ROM 01."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 256K Apple IIgs ROM 01. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 256K Apple IIgs ROM 01 or earlier."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 256K Apple IIgs ROM 01 or earlier. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
# Normal section -------------------------------------------------
*"It requires a Apple IIgs, //c+, or 128K //e with a compatible drive controller card."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a Apple IIgs, //c+, or 128K //e with a compatible drive controller card. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 1MB Apple IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 1MB Apple IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 768K Apple IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 768K Apple IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 512K Apple IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 512K Apple IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 256K Apple IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 256K Apple IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 64K Apple II+, //e, //c, or IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 64K Apple II+, //e, //c, or IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 64K Apple ][+, //e, //c, or IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 64K Apple II+, //e, //c, or IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 48K Apple ][+, //e, //c, or IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 48K Apple II+, //e, //c, or IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It runs on an Apple //e with 128K, //c, or IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on an Apple //e with 128K, //c, or IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requirs a 64K Apple ][+ or later"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 64K Apple ][+ or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 64K Apple //e, //c, or IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 64K Apple //e, //c, or IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 48K Apple //e or later"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 48K Apple //e or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It runs on any Apple II."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on any Apple II. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It runs on any Apple II with 64K."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on any Apple II with 64K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It runs on any Apple II with 32K."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on any Apple II with 32K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It runs on any Apple ][ with 32K."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on any Apple II with 32K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It runs on any 48K Apple ][+, //e, //c, or IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on any 48K Apple II+, //e, //c, or IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It run on any Apple II with 48K."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on any Apple II with 48K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires an Apple II+ with 48K"*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires an Apple II+ with 48K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires an Apple ][+ with 48K."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires an Apple II+ with 48K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires an 64K Apple ][+ or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 64K Apple II+ or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It runs on any Apple ][ model with 48K."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on any Apple II with 48K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It runs on any Apple II with 48K."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on any Apple II with 48K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It runs on any Apple ][ with 48K."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It runs on any Apple II with 48K. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 48K Apple ][+ or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 48K Apple II+ or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires an 64K Apple ][+, //e, //c, or IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 64K Apple II+ or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 64K Apple ][+ or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 64K Apple II+ or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires 64K Apple ][+ or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 64K Apple II+ or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 64K Apple //e or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 64K Apple //e or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 128K Apple //e or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 128K Apple //e or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires 128K Apple //e or later."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 128K Apple //e or later. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*"It requires a 128K Apple //e, //c, or IIgs."*)
echo -e '\t\t<sharedfeat name="compatibility" value="A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- It requires a 128K Apple //e, //c, or IIgs. -->' >>../xml/"$worktype"disk/disk$1.xml
;;
*)
# Fallthrough: We don't know what the compatibility is.
# Output something we can easily regex to find these
echo -e '\t\t<sharedfeat name="compatibility" value="A2,A2P,A2E,A2EE,A2C,A2GS" />' >>../xml/"$worktype"disk/disk$1.xml
echo -e '\t\t<!-- -=-=UNKNOWNCOMPATIBILITY=-=- -->' >>../xml/"$worktype"disk/disk$1.xml
;;
esac
;;
esac
# Obviously you'll need to hand-tweak the compatibility because there's a lot of ways this can be described...
# We'll include the full description text as a comment, as eventually we need to get other metadata like authors
# We use perl to normalize the text since it uses escaping.
echo -e -n '\t\t<!--' >>../xml/"$worktype"disk/disk$1.xml
xmllint --xpath 'metadata/description/text()' $filename | perl -Mopen=locale -pe 's/&#x([\da-f]+);/chr hex $1/gie' | tr -d '\n' >>../xml/"$worktype"disk/disk$1.xml
echo -e -n '-->\n\n' >>../xml/"$worktype"disk/disk$1.xml
done
# Now we start working on the disk images. Here's where things get a LITTLE
# hairy. We need both the proper (possibly bad)-cased filename for tools, but
# we need a forced lowercase for the XML.
# clrmamepro/romcenter will rename files automagically so the the files are
# fine as-is; we won't be renaming.
disknum=1
for filename in *.woz *.po *.dsk *.2mg; do
[ -e "$filename" ] || continue
# Here we're generating a forced lowercase version of the name which we'll
# use in some places in the XML. We also strip invalid characters as well
# as double spaces.
lfilename=$(echo "$filename" | tr '[:upper:]' '[:lower:]' | sed 's/\!/ /g' | sed 's/\ / /g' | sed 's/\&/and/g')
echo -e "$worktype: [$disknum] '$lfilename'"
# Critical: Check for SHA1 dupes.
# Generate the SHA1 and put it in temp.
sha1sum $filename | awk '{print $1}' >temp
# If we got a dupe, put it in temp2, otherwise leave a 0-byte file.
# We'll use that a little later.
grep -a -i -F -n -R -f temp ~/projects/mame/mame-softlists/hash/apple*_flop*.xml >temp2
if [[ -s temp2 ]]; then
echo "dupe" >dupecheck
fi
# Start outputting disk information.
echo -e -n '\t\t<part name="flop' >>../xml/"$worktype"disk/disk$1.xml
echo -e -n $disknum >>../xml/"$worktype"disk/disk$1.xml
echo -e -n '" interface="' >>../xml/"$worktype"disk/disk$1.xml
# Now, is this a 5.25" or 3.5"?
# In the case of a .po it could technicaly be either, but...
case $lfilename in
*".po"*)
echo -e 'floppy_3_5">' >>../xml/"$worktype"disk/disk$1.xml
;;
*".dsk"*)
echo -e 'floppy_5_25">' >>../xml/"$worktype"disk/disk$1.xml
;;
*".2mg"*)
echo -e 'floppy_3_5">' >>../xml/"$worktype"disk/disk$1.xml
;;
*".woz"*)
# WOZ can be either. We need to pull the data from the WOZ itself.
# According to the WOZ 2.0 spec, certain info is always hard-set
# location-wise to help lower-end emulators.
# The disk type should ALWAYS be at offset 21, and
# should be "1" for 5.25" and "2" for 3.5" disks.
disktype=$((16#$(xxd -e -p -l1 -s 21 "$filename")))
case $disktype in
*"2"*)
echo -e 'floppy_3_5">' >>../xml/"$worktype"disk/disk$1.xml
;;
*)
echo -e 'floppy_5_25">' >>../xml/"$worktype"disk/disk$1.xml
;;
esac
;;
esac
# Generate side/disk number information.
case $lfilename in
# Special cases. Will add as they come up.
*"side 2 (boot)."*)
echo -e '\t\t\t<feature name="part_id" value="Side 2 - Boot"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"side a - master scenario disk."*)
echo -e '\t\t\t<feature name="part_id" value="Side A - Master scenario disk"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"side b - boot."*)
echo -e '\t\t\t<feature name="part_id" value="Side B - Boot disk"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"side a - master disk."*)
echo -e '\t\t\t<feature name="part_id" value="Side A - Master disk"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"side b - scenario disk."*)
echo -e '\t\t\t<feature name="part_id" value="Side B - Boot disk"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
# These two don't get a disk number because we don't know for sure what it should be.
# We use "-=-=UNKNOWNDISK=-=-" so we can easily regex it out of the whole file.
*"- program disk."*)
echo -e '\t\t\t<feature name="part_id" value="-=-=UNKNOWNDISK=-=- - Program disk"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"- player disk."*)
echo -e '\t\t\t<feature name="part_id" value=""-=-=UNKNOWNDISK=-=- - Player disk"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
# "Disk X - Title" type
# e.g. "swordthrust (4am crack) disk 1 - the king's testing ground.dsk"
*"disk 1 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 1 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 2 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 2 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 3 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 3 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 4 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 4 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 5 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 5 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 6 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 6 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 7 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 7 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 8 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 8 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 9 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 9 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 10 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 10 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 11 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 11 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 12 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 12 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 13 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 13 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 14 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 14 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 15 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 15 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 16 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 16 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 17 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 17 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 18 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 18 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 19 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 19 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 20 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 20 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 21 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 21 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 22 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 22 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 23 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 23 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 24 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 24 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 25 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 25 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 26 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 26 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 27 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 27 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 28 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 28 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 29 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 29 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 30 -"*)
echo -e '\t\t\t<feature name="part_id" value="Disk 30 - "/>' >>../xml/"$worktype"disk/disk$1.xml
;;
# "Disk X" type
# e.g. "read and spell - in the days of knights and castles (4am crack) disk 1.dsk"
*"disk 1."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 1"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 2."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 2"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 3."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 3"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 4."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 4"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 5."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 5"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 6."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 6"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 7."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 7"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 8."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 8"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 9."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 9"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 10."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 10"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
# "Disk X Side X" type
# e.g. "read n roll (4am crack) disk 2 side a.dsk"
*"disk 1 side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 1 Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 1 side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 1 Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 2 side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 2 Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 2 side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 2 Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 3 side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 3 Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 3 side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 3 Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 4 side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 4 Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 4 side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 4 Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 5 side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 5 Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 5 side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 5 Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 6 side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 6 Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 6 side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 6 Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 7 side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 7 Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 7 side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 7 Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 8 side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 8 Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 8 side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 8 Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 9 side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 9 Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 9 side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 9 Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 10 side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 10 Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk 10 side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk 10 Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
# "Disk X" type
*"disk a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk c."*)
echo -e '\t\t\t<feature name="part_id" value="Disk C"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk d."*)
echo -e '\t\t\t<feature name="part_id" value="Disk D"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk e."*)
echo -e '\t\t\t<feature name="part_id" value="Disk E"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk f."*)
echo -e '\t\t\t<feature name="part_id" value="Disk F"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk g."*)
echo -e '\t\t\t<feature name="part_id" value="Disk G"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk h."*)
echo -e '\t\t\t<feature name="part_id" value="Disk H"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk i."*)
echo -e '\t\t\t<feature name="part_id" value="Disk I"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk j."*)
echo -e '\t\t\t<feature name="part_id" value="Disk J"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk k."*)
echo -e '\t\t\t<feature name="part_id" value="Disk K"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk l."*)
echo -e '\t\t\t<feature name="part_id" value="Disk L"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk m."*)
echo -e '\t\t\t<feature name="part_id" value="Disk M"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk n."*)
echo -e '\t\t\t<feature name="part_id" value="Disk N"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk o."*)
echo -e '\t\t\t<feature name="part_id" value="Disk O"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk p."*)
echo -e '\t\t\t<feature name="part_id" value="Disk P"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk q."*)
echo -e '\t\t\t<feature name="part_id" value="Disk Q"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk r."*)
echo -e '\t\t\t<feature name="part_id" value="Disk R"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk s."*)
echo -e '\t\t\t<feature name="part_id" value="Disk S"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk t."*)
echo -e '\t\t\t<feature name="part_id" value="Disk T"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk u."*)
echo -e '\t\t\t<feature name="part_id" value="Disk U"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk v."*)
echo -e '\t\t\t<feature name="part_id" value="Disk V"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk w."*)
echo -e '\t\t\t<feature name="part_id" value="Disk W"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk x."*)
echo -e '\t\t\t<feature name="part_id" value="Disk X"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk y."*)
echo -e '\t\t\t<feature name="part_id" value="Disk Y"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk z."*)
echo -e '\t\t\t<feature name="part_id" value="Disk Z"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
# "Disk X Side A/B" type
*"disk a side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk A Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk a side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk A Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk b side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk B Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk b side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk B Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk c side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk C Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk c side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk C Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk d side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk D Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk d side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk D Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk e side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk E Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk e side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk E Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk f side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk F Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk f side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk F Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk g side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk G Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk g side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk G Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk h side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk H Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk h side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk H Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk i side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk I Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk i side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk I Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk j side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk J Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk j side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk J Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk k side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk K Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk k side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk K Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk l side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk L Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk l side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk L Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk m side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk M Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk m side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk M Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk n side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk N Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk n side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk N Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk o side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk O Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk o side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk O Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk p side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk P Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk p side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk P Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk q side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk Q Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk q side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk Q Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk r side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk R Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk r side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk R Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk s side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk S Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk s side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk S Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk t side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk T Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk t side b."*)
echo -e '\t\t\t<feature name="part_id" value="Disk T Side B"/>' >>../xml/"$worktype"disk/disk$1.xml
;;
*"disk u side a."*)
echo -e '\t\t\t<feature name="part_id" value="Disk U Side A"/>' >>../xml/"$worktype"disk/disk$1.xml
;;