-
Notifications
You must be signed in to change notification settings - Fork 12
/
IT_DISK.ASM
10940 lines (7922 loc) · 309 KB
/
IT_DISK.ASM
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
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ Disk Module ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
include switch.inc
include network.inc
Jumps
.386
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ Externals ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Segment Object1 BYTE Public 'Data'
EndS
Segment Pattern BYTE Public 'Code'
Extrn BaseOctave:Byte
Extrn RowHilight1:Byte
Extrn RowHilight2:Byte
EndS
Segment Pattern BYTE Public 'Code'
Extrn PatternDataArea:Word
EndS
Segment Music BYTE Public 'Code'
EndS
Extrn Display_GetDisplayWindowData:Far
Extrn E_UnInitEMS:Far
Extrn E_MapEMSMemory:Far
Extrn E_GetEMSPageFrame:Far
Extrn Glbl_F3:Far
Extrn Glbl_F4:Far
Extrn I_GetSampleOffset:Far
Extrn I_GetInstrumentOffset:Far
Extrn I_ClearTables:Far
Extrn I_GetPresetEnvelopeOffset:Far
Extrn K_UnInitKeyBoard:Far
Extrn K_IsAnyKeyDown:Far
Extrn K_ClearKeyBoardQueue:Far
Extrn K_GetKey:Far
Extrn M_FunctionDivider:Far
Extrn M_Object1List:Far
Extrn Music_PlayNote:Far
Extrn Music_PlaySample:Far
Extrn Music_ReleaseAllPatterns:Far
Extrn Music_ReleaseAllSamples:Far
Extrn Music_ReleaseSample:Far
Extrn Music_GetSongSegment:Far
Extrn Music_AllocateSample:Far
Extrn Music_ClearAllSampleNames:Far
Extrn Music_GetNumberOfSamples:Far
Extrn Music_GetNumberOfInstruments:Far
Extrn Music_GetPattern:Far
Extrn Music_AllocatePattern:Far
Extrn Music_AllocateSample:Far
Extrn Music_GetSampleLocation:Far
Extrn Music_ClearAllInstruments:Far
Extrn Music_GetInstrumentMode:Far
Extrn Music_AssignSampleToInstrument:Far
Extrn Music_SoundCardLoadSample:Far
Extrn Music_SoundCardLoadAllSamples:Far
Extrn Music_GetPitchTable:Far
Extrn Music_GetMIDIDataArea:Far
Extrn Music_Stop:Far
Extrn Msg_ResetMessage:Far
Extrn Msg_GetMessageOffset:Far
Extrn Msg_GetMessageLength:Far
IF TUTORIAL
ELSE
Extrn O1_LoadS3MList:Far
Extrn O1_LoadXMList:Far
Extrn O1_LoadMODList:Far
Extrn O1_LoadMTMList:Far
Extrn O1_Load669List:Far
Extrn O1_LoadITList:Far
ENDIF
Extrn O1_ConfirmOverWriteList:Far
Extrn O1_UnableToSaveList:Far
Extrn O1_SaveITList:Far
Extrn O1_SaveS3MList:Far
Extrn O1_ConfirmDelete:Far ; Updates Song name loader.
Extrn O1_ConfirmDelete2:Far
Extrn O1_ConfirmDelete3:Far
Extrn O1_ConfirmSaveRenameList:Far
Extrn O1_ConfirmResaveList:Far
Extrn O1_ConfirmDiscardList:Far
Extrn O1_InitInstrument:Far
Extrn O1_EditSampleName:Far
Extrn O1_OutOfSamplesList:Far
Extrn O1_EnableInstrumentMode:Far
Extrn O1_StereoSampleList:Far
Extrn PE_TranslateXMPattern:Far
Extrn PE_Translate669Pattern:Far
Extrn PE_TranslateS3MPattern:Far
Extrn PE_TranslateMTMPattern:Far
Extrn PE_TranslateMODPattern:Far
Extrn PE_ResetOrderPattern:Far
Extrn PE_UnInitPatternEdit:Far
Extrn PEFunction_OutOfMemoryMessage:Far
Extrn PECheckModified:Far
Extrn PEResetModified:Far
Extrn PE_GetMaxPattern:Far
Extrn PE_ConvAX2Num:Far
Extrn PE_GetLastInstrument:Far
Extrn PE_GetPatternConfigOffset:Far
Extrn PE_SaveCurrentPattern:Far
Extrn PE_RestoreCurrentPattern:Far
Extrn S_UnInitScreen:Far
Extrn S_GetDestination:Far
Extrn S_DrawString:Far
Extrn S_SaveScreen:Far
Extrn S_RestoreScreen:Far
Extrn S_GetGenerationTableOffset:Far
Extrn S_GenerateCharacters:Far
Extrn S_RedefineCharacters:Far
Extrn S_GetPaletteOffset:Far
Extrn S_SetPalette:Far
Extrn SetInfoLine:Far
Extrn ClearInfoLine:Far
Extrn Glbl_SetCurrentMode:Far
Extrn Glbl_F10:Far
Extrn GetKeyboardLock:Far, GetTimerCounter:Far
Extrn MouseUpdateEnable:Far, MouseUpdateDisable:Far
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ Globals ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Global D_GetFileName:Far
Global D_SetDriveDirectoryFar:Far
Global D_RestorePreShellDirectory:Far
Global D_GetPreShellDirectory:Far
Global D_SaveInstrument:Far
Global D_ClearFileName:Far
Global D_GetFormatType:Far
Global D_LSCheckLoopValues:Far
Global D_LSCheckSusLoopValues:Far
Global D_SaveSong:Far
Global D_InitDisk:Far
Global D_UnInitDisk:Far
Global D_InitLoadModule:Far
Global D_InitLoadSamples:Far
Global D_LoadSampleNames:Far
Global D_NewSpecifier:Far
Global D_NewDirectory:Far
Global D_SaveIT:Far
Global D_DrawWaveForm:Far
Global D_InitLoadInstruments:Far
Global D_DrawLoadInstrument:Far
Global D_PreLoadInstrument:Far
Global D_PostLoadInstrument:Far
Global D_LoadInstrumentNames:Far
Global D_ViewInstrument:Far
Global D_SlowSampleSort:Far
Global D_SlowInstrumentSort:Far
Global D_SaveS3M:Far
Global D_SaveDirectoryConfiguration:Far
Global D_DisableFileColours:Far
Global D_GetLoadSampleVars:Far
Global D_DrawLoadSampleWindow:Far
Global D_PreLoadSampleWindow:Far
Global D_PostLoadSampleWindow:Far
Global D_PostViewSampleLibrary:Far
Global D_LSDrawDriveWindow:Far
Global D_LSPreDriveWindow:Far
Global D_LSPostDriveWindow:Far
Global D_LIDrawDriveWindow:Far
Global D_LIPreDriveWindow:Far
Global D_LIPostDriveWindow:Far
Global D_DeleteSampleFile:Far
Global D_PostSaveDriveWindow:Far
Global D_ClearFileSpecifier:Far
Global D_LoadSongNames:Far
Global D_DrawFileWindow:Far
Global D_DrawDirectoryWindow:Far
Global D_DrawDriveWindow:Far
Global D_PreFileWindow:Far
Global D_PostFileWindow:Far
Global D_PreDirectoryWindow:Far
Global D_PostDirectoryWindow:Far
Global D_PreDriveWindow:Far
Global D_PostDriveWindow:Far
Global D_PostFileLoadWindow:Far
Global D_PostFileSaveWindow:Far
Global D_SaveModule:Far
Global FileSpecifier:Byte
Global SongDirectory:Byte
Global SampleDirectory:Byte
Global InstrumentDirectory:Byte
Global FileName:Byte
Global D_SaveSample:Far
Global D_SaveRawSample:Far
Global D_SaveST3Sample:Far
Global D_GotoStartingDirectory:Far
Global LSWindow_Up:Far
Global LSWindow_Down:Far
Global DiskDataArea:Word
Global SampleName:Byte
Global DiskOptions:Byte
Public D_Resettimer
Public D_ShowTime
IF TIMERSCREEN
Public D_DrawTimer
Public D_PostTimerList
ENDIF
IF TUTORIAL
Public SamplesInModule
Public InSampleFileName
ELSE
Public D_LoadS3M
Public D_LoadMTM
Public D_LoadMOD
Public D_Load669
Public D_LoadIT
Public D_LoadXM
ENDIF
;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
Segment Disk BYTE Public 'Code' USE16
Assume CS:Disk, DS:Nothing
CREATENEWLOGFILE EQU 0
include debug.inc
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ Variables ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
SampleInMemory DW 0FFFFh
NoSaveError DB 0
Specific DB 0
DiskDataArea DW DiskData
OldCacheTime DD 0
Time DW 0
Date DW 0
LoadDate DW 0
LoadTime DW 0
DrivesAvail DB 27 Dup (0)
UnusedSamples DW 0
InitialInstruments DW 0 ;
NumInstruments DW 0 ; Order important!
InstrumentCachefileVersion DW TRACKERVERSION ;
LoadInstrumentNameCount DW 0
TopInstrument DW 0
CurrentInstrument DW 0
LoadSongNameCount DW 0
LoadSampleNameCount DW 0
CurrentSample DW 0
NumSamples DW 0 ; Order important!
SampleCachefileVersion DW TRACKERVERSION ;
TopSample DW 0
CurrentDrive DB 0
NumDrives DB 0
TopDrive DB 0
NumEntries DW 0
NumFiles DW 0
NumFileInfo DW 0
NumDirectories DW 0
TopDirectory DW 0
CurrentDirectory DW 0
CurrentFile DW 0
TopFile DW 0
FileName DB 0
DB 13 Dup (0)
SaveFileName DB 0
DB 79 Dup (0)
FileSpecifier DB 0
DB 64 Dup (0)
StartingDrive DB 0
StartingDirectory DB 70 Dup (0)
PreShellDirectory DB 70 Dup (0)
DOSDirectory DB 70 Dup (0)
SongDirectory DB 0
DB 69 Dup (0)
SampleDirectory DB 0
DB 69 Dup (0)
InstrumentDirectory DB 0
DB 69 Dup (0)
CountryTableConfig DB 0
SampleName DB 0
DB 26 Dup (0)
MODNumberOfChannels DB 0
MODNumberOfInstruments DB 0
MODNumberOfOrders DB 0
MODOrderOffset DW 0
MODPatternOffset DW 0
LastKey DW 0
SampleCacheFileComplete DB 0
InstrumentCacheFileComplete DB 0
Resolution DB 0
FileTempSpecifier DB 70 Dup (0)
CurrentSearchPos DB 0
Search DB 13 Dup (0)
InstrumentTable DB 100 Dup (0)
InstrumentLoaderTable Label Word
DW Offset LoadITInstrument ; 3
DW Offset LoadXIInstrument ; 4
DW Offset LoadInITInstrument ; 5
DW Offset LoadInXMInstrument ; 6
DW 0 ; 7
DW Offset LoadITInModuleInstrument ; 8
DW Offset LoadXMInModuleInstrument ; 9
InstrumentLoader DW 0
InSampleFileName DB 13 Dup (0)
InSampleDateTime DD 0
InSampleFormat DB 0 ; Do *NOT* change order
InSampleChannels DB 0 ; Do *NOT* change order
InInstrumentFileName DB 13 Dup (0)
InInstrumentFormat DB 0
ExitLibraryDirectory Label
DB "IMPS. ", 0, 0, 0, 0
DB 8 Dup(154), "Directory", 8 Dup(154), 0, 0, 0
DW 0, 0, 0, 0, 0, 0, 0, 0
DW 0, 0, 0, 0, 0, 0, 0, 0
DW 0, 0, 0, 0
DB 1
ExitInstrumentLibraryDirectory Label
DB 1, ". ", 0
DB 8 Dup(154), "Directory", 8 Dup(154), 0 ; Instrument name
DW 0, 0 ; NoSamples, FileSize
DD 0 ; File offset
AllFilesMask DB "*.*", 0
FileSpecifierDefault DB "*.IT, *.XM, *.S3M, *.MTM, *.669, *.MOD", 0
DriveMsg DB "Drive X:"
NoFilesMsg DB "No files.", 0
NoDirsMsg DB "No dirs.", 0
WAVEfmtID DB "WAVEfmt ", 0, 0, 1, 0
XIIdentification DB "Extended Instrument: "
XMIdentification DB "Extended Module: "
TXWAVEIdentification DB "LM8953", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
GUSPATIdentification DB "GF1PATCH110", 0, "ID#000002", 0 ; 22 bytes
OpenErrorMsg DB "Error opening file.", 0
HeaderMsg DB "File Header", 0
SampleMsg DB "Sample ", 0FDh, 'D', 0
SHLoadMsg DB "Sample Header ", 0FDh, 'D', 0
InstrumentMsg DB "Instrument ", 0FDh, 'D', 0
PatternMsg DB "Pattern ", 0FDh, 'D', 0
TrackMsg DB "Channel ", 0FDh, 'D ', 13
DB "Track ", 0FDh, 'D ', 0
CompleteMsg DB "Done", 0
InstrumentHeaderMsg DB "Instrument Headers", 0
SampleHeaderMsg DB "Sample Headers", 0
Quality8Msg DB "8 Bit", 0
Quality16Msg DB "16 Bit", 0
Quality8StereoMsg DB "8 Bit Stereo", 0
Quality16StereoMsg DB "16 Bit Stereo", 0
LengthMsg DB 0FDh, 'L', 0
DirectoryMsg DB 8 Dup(154), "Directory", 8 Dup(154), 0
LibraryMsg DB 9 Dup(154), "Library", 9 Dup(154), 0
FontFileName DB "FONT.CFG", 0
ConfigFileName DB "IT.CFG", 0
ST3CacheFileName DB "########.ST3", 0
SampleCacheFileName DB "CACHE.ITS", 0
InstrumentCacheFileName DB "CACHE.ITI", 0
SaveFormat DB DEFAULTFORMAT
SaveFormatError DB 0 ; This will get erased whenever the
; saveformat changes.
SamplesInModule DB 0
InstrumentsInModule DB 0
FileColours DB 1
NoteData DB 0FFh, 0, 0FFh, 0, 0
CheckDataArea DB 96 Dup(0)
KeyBoardTable DW 12Ch, 0, 11Fh, 1, 12Dh, 2, 120h, 3, 12Eh, 4
DW 12Fh, 5, 122h, 6, 130h, 7, 123h, 8, 131h, 9
DW 124h, 10, 132h, 11, 110h, 12, 103h, 13, 111h, 14
DW 104h, 15, 112h, 16, 113h, 17, 106h, 18, 114h, 19
DW 107h, 20, 115h, 21, 108h, 22, 116h, 23, 117h, 24
DW 10Ah, 25, 118h, 26, 10Bh, 27, 119h, 28, 0FFFFh
SampleCheck DW 0FFFFh
MonthNames Label
DW Offset Empty
DW Offset January
DW Offset February
DW Offset March
DW Offset April
DW Offset May
DW Offset June
DW Offset July
DW Offset August
DW Offset September
DW Offset October
DW Offset November
DW Offset December
DW Offset Empty
DW Offset Empty
DW Offset Empty
January DB "January", 0
February DB "February", 0
March DB "March", 0
April DB "April", 0
May DB "May", 0
June DB "June", 0
July DB "July", 0
August DB "August", 0
September DB "September", 0
October DB "October", 0
November DB "November", 0
December DB "December"
Empty DB 0
TimerData DW 0
NumTimerData DW 0
TopTimerData DW 0
SampleFormatNames Label
DW Offset Unchecked ; 0
DW Offset DirectoryFormat
DW Offset ITSampleFormat
DW Offset STSampleFormat
DW Offset UnknownSampleFormat
DW Offset WAV8BitFormat
DW Offset XMSample
DW Offset WAV16BitFormat
DW Offset XMSample
DW Offset PTMSample
DW Offset MTMSample
DW Offset C669Sample
DW Offset FARSample
DW Offset TXWaveSample ; 13
DW Offset MODSample
DW Offset KRZSample ; 15
DW Offset PATFormat
DW Offset IFFFormat ; 17
DW 0, 0
DW 0, 0, 0, 0
DW 0, 0, 0, 0
DW 0, 0, 0, 0
DW Offset ST3Module ; 20h
DW Offset ITModule
DW Offset XMModule
DW Offset PTMModule
DW Offset MTMModule
DW Offset C669Module
DW Offset FARModule
DW Offset MODModule1
DW Offset XMModule
DW Offset KRZFormat ; 29h
DW Offset PATFormat
LoadSamplesInModuleTable Label Word
DW Offset LoadS3MSamplesInModule
DW Offset LoadITSamplesInModule
DW Offset LoadXMSamplesInModule
DW Offset LoadPTMSamplesInModule
DW Offset LoadMTMSamplesInModule
DW Offset Load669SamplesInModule
DW Offset LoadFARSamplesInModule
DW Offset LoadMODSamplesInModule
DW Offset LoadMODSamplesInModule
DW Offset LoadKRZSamples
DW Offset LoadPATSamples
; DW Offset LoadULTSamplesInModule
FormatNames Label
DW Offset Unchecked ; 0
DW Offset UnknownFormat ; 1
DW Offset ITFormat2_0 ; 2
DW Offset ITFormat? ; 3
DW Offset ST3Format ; 4
DW Offset XMModule ; 5
DW Offset C669Module ; 6
DW Offset CompressedITModule ; 7
DW 0
DW Offset MODFormat ; 9
DW Offset Protracker ; 10
DW Offset Channel4 ; 11
DW Offset Channel6 ; 12
DW Offset Channel8 ; 13
DW Offset StarTrekker4 ; 14
DW Offset StarTrekker8 ; 15
DW Offset OldMod ; 16
DW Offset ChannelXX ; 17
DW Offset MultiTrackerModule ; 18
PanningPositions DB 0, 4, 9, 13, 17, 21, 26, 30
DB 34, 38, 43, 47, 51, 55, 60, 64
MODChannelTable DB 4, 4, 4, 6, 8, 4, 8, 4
FineTuneTable DW 8363, 8413, 8463, 8529
DW 8581, 8651, 8723, 8757
DW 7895, 7941, 7985, 8046
DW 8107, 8169, 8232, 8280
DirectoryFormat DB "Directory", 0
ITSampleFormat DB "Impulse Tracker Sample", 0
STSampleFormat DB "Scream Tracker Sample", 0
UnknownSampleFormat DB "Unknown sample format", 0
WAV8BitFormat DB "8 Bit WAV Format", 0
WAV16BitFormat DB "16 Bit WAV Format", 0
XMSample DB "Fast Tracker 2 Sample", 0
PTMSample DB "Poly Tracker Sample", 0
MTMSample DB "Multi Tracker Sample", 0
C669Sample DB "Composer 669 Sample", 0
FARSample DB "Farandole Sample", 0
; ULTSample DB "Ultra Tracker Sample", 0
TXWaveSample DB "TX Wave Sample", 0
MODSample DB "MOD Sample", 0
KRZSample DB "KRZ Sample", 0
ST3Module DB "Scream Tracker 3 Module", 0
ITModule DB "Impulse Tracker Module", 0
XMModule DB "Fast Tracker 2 Module", 0
PTMModule DB "Poly Tracker Module", 0
MTMModule DB "Multi Tracker Module", 0
C669Module DB "Composer 669 Module", 0
FARModule DB "Farandole Module", 0
MODModule1 DB "MOD Format", 0
; ULTModule DB "Ultra Tracker Module", 0
KRZFormat DB "Kurzweil Synth File", 0
PATFormat DB "Gravis UltraSound Patch", 0
IFFFormat DB "AIFF Sample", 0
Unchecked DB "Unchecked", 0
UnknownFormat DB "Unknown module format", 0
CompressedITModule DB "Compressed "
ITFormat2_0 DB "Impulse Tracker", 0
ITFormat? DB "Impulse Tracker ?.??", 0
ST3Format DB "Scream Tracker 3", 0
MODFormat DB "Amiga-NewTracker", 0
ProTracker DB "Amiga-ProTracker", 0
StarTrekker4 DB "4 Channel Startrekker", 0
StarTrekker8 DB "8 Channel Startrekker", 0
Channel4 DB "4 Channel MOD", 0
Channel6 DB "6 Channel MOD", 0
Channel8 DB "8 Channel MOD", 0
OldMod DB "Old Amiga-MOD format ? ", 0
ChannelXX DB 0FDh, "D Channel MOD", 0
MultiTrackerModule DB "MultiTracker Module", 0
ITInstrumentSavedMsg DB "Instrument saved (instrument ", 0FDh, "D)", 0
InstrumentErrorMsg DB "Error: Instrument ", 0FDh, "D NOT saved! (No Filename?)", 0
ITSampleSavedMsg DB "Impulse Tracker sample saved (sample ", 0FDh, "D)", 0
ST3SampleSavedMsg DB "Scream Tracker sample saved (sample ", 0FDh, "D)", 0
IF SAVESAMPLEWAV
RawSampleSavedMsg DB "WAV Sample saved (sample ", 0FDh, "D)", 0
ELSE
RawSampleSavedMsg DB "RAW Sample saved (sample ", 0FDh, "D)", 0
ENDIF
SampleErrorMsg DB "Error: Sample ", 0FDh, "D NOT saved! (No Filename?)", 0
InitInstrumentMsg DB "Sample assigned to Instrument ", 0FDh, "D", 0
InitInstrumentErrorMsg DB "Error: No available Instruments!", 0
TooManyPatternsMsg DB "Warning: Only 100 patterns supported in S3M format", 0
ChannelVolumeErrorMsg DB "Warning: Channel volumes unsupported in S3M format", 0
LinearSlideMsg DB "Warning: Linear slides unsupported in S3M format", 0
LoopMsg DB "Warning: Sustain and Ping Pong loops unsupported in S3M format", 0
SampleVolumeMsg DB "Warning: Sample volumes unsupported in S3M format", 0
SampleVibratoMsg DB "Warning: Sample vibrato unsupported in S3M format", 0
ST3InstrumentErrorMsg DB "Warning: Instrument functions unsupported in S3M format", 0
PatternLengthMsg DB "Warning: Pattern lengths other than 64 rows unsupported in S3M format", 0
ChannelErrorMsg DB "Warning: Data outside 16 channels unsupported in S3M format", 0
NoteRangeMsg DB "Warning: Notes outside the range C-1 to B-8 are unsupported in S3M format", 0
PanningErrorMsg DB "Warning: Extended volume column effects are unsupported in S3M format", 0
InstrumentLibrary DB 154, 154, "Module", 154, 154, 0
InstrumentNoSample DB "No Samples", 0
InstrumentSingleSample DB "1 Sample", 0
InstrumentSeveralSamples DB 0FDh, "D Samples", 0
InstrumentUnknownSamples DB "???", 0
FileSizeMsg DB 0FDh, "Dk", 0
FreeSampleMsg DB "Available", 13
DB "Samples: ", 0FDh, 'D', 0
IF SAVESAMPLEWAV
WAVEFileHeader DB "RIFF"
WAVEFileSize DD 0
WAVEFileHeader2 DB "WAVEfmt "
WAVEFileHeaderLength DD 10h
WAVEFileID DW 1
WAVEChannels DW 1
WAVEMixSpeed DD 44100 ; Default to CD quality
WAVEBytesPerSecond DD 0
WAVEBytesPerSample DW 2
WAVEBits DW 16
WAVEHeader3 DB "data"
WAVEDataSize DD 0
ENDIF
DiskOptions DB 0
EditTimer DD 0
CDRomStartDrive DB 0 ; The first CDRom Drive letter
CDRomEndDrive DB 0 ; The drive AFTER the last cdrom
FileWindowKeys Label
DB 0
DW 1C8h ; Up arrow
DW FileWindow_Up
DB 0
DW 1D0h ; Down arrow
DW FileWindow_Down
DB 0
DW 1C9h ; PgUp
DW FileWindow_PgUp
DB 0
DW 1D1h ; PgDn
DW FileWindow_PgDn
DB 0
DW 1C7h ; Home
DW FileWindow_Home
DB 0
DW 1CFh ; End
DW FileWindow_End
DB 4
DW 10Fh ; Shift Tab
DW FileWindow_ShiftTab
DB 0
DW 10Fh ; Tab
DW FileWindow_Right
DB 0
DW 1CDh ; Right arrow
DW FileWindow_Right
DB 0
DW 1CBh ; Left arrow
DW FileWindow_Left
DB 0
DW 1D3h ; Delete
DW FileWindow_DeleteFile
DB 0FFh
DirectoryWindowKeys Label
DB 0
DW 1C8h
DW DirectoryWindow_Up
DB 0
DW 1D0h
DW DirectoryWindow_Down
DB 0
DW 1C9h ; PgUp
DW DirectoryWindow_PgUp
DB 0
DW 1D1h ; PgDn
DW DirectoryWindow_PgDn
DB 0
DW 1C7h ; Home
DW DirectoryWindow_Home
DB 0
DW 1CFh ; End
DW DirectoryWindow_End
DB 4
DW 10Fh ; Shift Tab
DW DirectoryWindow_Left
DB 0
DW 10Fh ; Tab
DW FileWindow_Left ; Same object num
DB 0
DW 1CDh ; Right arrow
DW FileWindow_Left
DB 0
DW 1CBh ; Left arrow
DW DirectoryWindow_Left
DB 0
DW 11Ch ; Enter
DW DirectoryWindow_Enter
DB 0FFh
DriveWindowKeys Label
DB 0
DW 1C8h
DW DriveWindow_Up
DB 0
DW 1D0h
DW DriveWindow_Down
DB 4
DW 10Fh ; Shift-Tab
DW FileWindow_Right
DB 0
DW 10Fh ; Tab
DW DriveWindow_Tab
DB 0
DW 1CDh ; Right arrow
DW DirectoryWindow_Left
DB 0
DW 1CBh ; Left arrow
DW FileWindow_Right
DB 0
DW 11Ch ; Enter
DW DriveWindow_Enter
DB 0FFh
SaveDriveWindowKeys Label
DB 0
DW 1C8h
DW DriveWindow_Up
DB 0
DW 1D0h
DW DriveWindow_Down
DB 4
DW 10Fh ; Shift-Tab
DW FileWindow_Right
DB 0
DW 10Fh ; Tab
DW SaveDriveWindow_Tab
DB 0
DW 1CDh ; Right arrow
DW SaveDriveWindow_Tab
DB 0
DW 1CBh ; Left arrow
DW FileWindow_Right
DB 0
DW 11Ch ; Enter
DW DriveWindow_Enter
DB 0FFh
LSDriveWindowKeys Label
DB 0
DW 1C8h
DW DriveWindow_Up
DB 0
DW 1D0h
DW DriveWindow_Down
DB 4
DW 10Fh ; Shift-Tab
DW DriveWindow_Tab ; goto object number 15
DB 0
DW 10Fh ; Tab
DW LSDriveWindow_Right
DB 0
DW 1CDh ; Right arrow
DW LSDriveWindow_Right
DB 0
DW 1CBh ; Left arrow
DW DriveWindow_Tab
DB 0
DW 11Ch ; Enter
DW LS_DriveWindow_Enter
DB 0FFh
LIDriveWindowKeys Label
DB 0
DW 1C8h
DW DriveWindow_Up
DB 0
DW 1D0h
DW DriveWindow_Down
DB 0
DW 1CBh ; Left arrow
DW LIDriveWindow_Tab
DB 0
DW 10Fh ; Tab
DW LIDriveWindow_Tab
DB 0
DW 11Ch ; Enter
DW LI_DriveWindow_Enter
DB 0FFh
LoadInstrumentKeys Label
DB 0
DW 11Ch ; Enter
DW LIWindow_Enter
ViewInstrumentKeys Label
DB 0
DW 1C8h
DW LIWindow_Up
DB 0
DW 1D0h
DW LIWindow_Down
DB 0
DW 1C9h ; PgUp
DW LIWindow_PgUp
DB 0
DW 1D1h ; PgDn
DW LIWindow_PgDn
DB 0
DW 1C7h ; Home
DW LIWindow_Home
DB 0
DW 1CFh ; End
DW LIWindow_End
DB 0
DW 1D3h ; Delete
DW D_DeleteInstrumentFile
DB 0
DW 11Ch ; Enter
DW LIViewWindow_Enter
DB 0
DW 1CDh ; Right arrow
DW LIViewWindow_Tab
DB 0
DW 10Fh ; Tab
DW LIViewWindow_Tab
DB 0FFh
LSWindowKeys Label
DB 0
DW 11Ch ; Enter
DW LSWindow_Enter
LSViewWindowKeys Label
DB 0
DW 139h
DW LSWindow_Space ; Edit sample name
DB 0
DW 1C8h
DW LSWindow_Up
DB 0
DW 1D0h
DW LSWindow_Down
DB 0
DW 1C9h ; PgUp
DW LSWindow_PgUp
DB 0
DW 1D1h ; PgDn
DW LSWindow_PgDn
DB 0
DW 1C7h ; Home
DW LSWindow_Home
DB 0
DW 1CFh ; End
DW LSWindow_End
DB 0
DW 1CDh ; Right arrow
DW FileWindow_ShiftTab
DB 0
DW 10Fh ; Tab
DW FileWindow_ShiftTab ; Object 16
DB 0
DW 1D3h ; Delete
DW D_DeleteSampleFile
DB 0
DW 11Ch ; Enter
DW LSViewWindow_Enter
DB 0FFh
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ Functions ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Proc D_InitDisk Far
Push DS
Push CS
Pop DS
Assume DS:Disk
; Get date/time for CACHE.IT file
Trace " - Finding CDROM Drives"
Mov AX, 1500h
Xor BX, BX
Int 2Fh
Cmp AL, 0FFh
JNE D_InitDiskNoCDROM
Test BX, BX
JZ D_InitDiskNoCDROM
Add CL, 'A'
Mov CDRomStartDrive, CL
Add CX, BX
Mov CDRomEndDrive, CL
D_InitDiskNoCDROM:
Trace " - Determining main directory"