-
Notifications
You must be signed in to change notification settings - Fork 23
/
IT_PE.ASM
12312 lines (8943 loc) · 343 KB
/
IT_PE.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
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ PatternEdit module ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Jumps
.386
include switch.inc
include network.inc
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ Externals ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Segment Object1 BYTE Public 'Data'
EndS
Segment Disk BYTE Public 'Code'
EndS
Segment Inst BYTE Public 'Code'
Extrn InstrumentEdit:Byte
Extrn NodeHeld:Byte
EndS
Extrn E_GetFreeEMS:Far
Extrn E_UnInitEMS:Far
Extrn E_ReleaseEMS:Far
Extrn E_AllocateEMS:Far
Extrn E_MapAvailableEMSMemory:Far
Extrn E_GetEMSPageFrame:Far
Extrn Glbl_F2:Far, Glbl_F6:Far
Extrn Glbl_GetHeaderMode:Far
Extrn Glbl_LeftBrace:Far, Glbl_RightBrace:Far
Extrn Glbl_LeftSquareBracket:Far, Glbl_RightSquareBracket:Far
Extrn I_ClearTables:Far
Extrn K_UnInitKeyBoard:Far
Extrn K_SetScrollLock:Far
Extrn K_IsKeyDown:Far
Extrn M_FunctionHandler:Far
Extrn M_Object1List:Far
Extrn M_FunctionDivider:Far
Extrn Music_PlayPartSong:Far
Extrn Music_GetSongSegment:Far
Extrn Music_UnInitMusic:Far
Extrn Music_ReleasePattern:Far
Extrn Music_AllocatePattern:Far
Extrn Music_GetPattern:Far
Extrn Music_GetInstrumentMode:Far
Extrn Music_UpdatePatternOffset:Far
Extrn Music_PlayNote:Far
Extrn Music_InitMixTable:Far
Extrn Music_InitMuteTable:Far
Extrn Music_InitStereo:Far
Extrn Music_ToggleChannel:Far
Extrn Music_SoloChannel:Far
Extrn Music_GetPlayMode:Far
Extrn Music_PlayPattern:Far
Extrn Music_GetLastChannel:Far
Extrn Music_SetNextOrder:Far
Extrn Music_NextOrder:Far
Extrn Music_LastOrder:Far
Extrn Music_Stop:Far
Extrn Music_UnmuteAll:Far
Extrn Music_SoundCardLoadSample:Far
Extrn Music_SoundCardLoadAllSamples:Far
Extrn Music_GetDisplayVariables:Far
Extrn Network_UpdatePattern:Far
Extrn FileName:Byte
Extrn O1_ConfirmNoSave:Far
Extrn O1_NoBlockMarkedList:Far
Extrn O1_SwapOutOfRangeList:Far
Extrn O1_OverlapBlockList:Far
Extrn O1_OutOfMemoryList:Far
Extrn O1_NoBlockDataList:Far
Extrn O1_GetAmpList:Far
Extrn O1_GetFastAmpList:Far
IF SHOWPATTERNLENGTH
Extrn O1_ShowPatternLengthList:Far
ENDIF
Extrn O1_TemplateErrorList:Far
Extrn O1_PatternTooLongList:Far
Extrn O1_SelectMultiChannel:Far
Extrn O1_UndoList:Far
Extrn O1_SetPatternLength:Far
Extrn O1_PatternSizeMismatchList:Far
Extrn S_UnInitScreen:Far
Extrn S_DrawBox:Far
Extrn S_DrawString:Far
Extrn S_GetDestination:Far
Extrn S_SaveScreen:Far
Extrn S_RestoreScreen:Far
Extrn S_SetDirectMode:Far
Extrn S_DrawSmallBox:Far
Extrn S_InvertCursor:Far
Extrn PatternLength
Extrn UpdateInfoLine:Far
Extrn SetInfoLine:Far
Extrn MouseUpdateDisable:Far
Extrn UpdateWAVEForm:Far
Extrn MIDI_AllocateChannel:Far, MIDI_FindChannel:Far
Extrn Music_GetDelay:Far, MIDI_GetChannel:Far
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ Globals ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Global PE_ClearUndoBuffer:Far
Global PE_ShowOrder:Far
Global PE_NewPattern:Far
Global PE_InitPatternEdit:Far
Global PE_UnInitPatternEdit:Far
Global PE_DrawOrderList:Far
Global PE_FillHeader:Far
Global PE_PreOrderList:Far
Global PE_PostOrderList:Far
Global PE_ConvAX2Num:Far
Global PE_GetCurrentPattern:Far
Global PE_GetMaxPattern:Far
Global PE_FillSpeedTempo:Far
Global PE_SetPatternModified:Far
Global PE_GetLastInstrument:Far
Global PE_DrawPatternEdit:Far
Global PE_PrePatternEdit:Far
Global PE_PostPatternEdit:Far
Global PE_SetCommandCursor:Far
Global PEFunction_IncreaseOctave:Far
Global PEFunction_DecreaseOctave:Far
Global PE_F7:Far
Global PE_GetPatternConfigOffset:Far
Global PE_SwapInstruments:Far
Global PE_GetMaxOrder:Far
Global PE_GotoPattern:Far
Global PECheckModified:Far
Global PE_TranslateXMPattern:Far
Global PE_TranslateS3MPattern:Far
Global PE_TranslateMODPattern:Far
Global PE_TranslateMTMPattern:Far
Global PE_Translate669Pattern:Far
Global PE_ResetOrderPattern:Far
Global PEFunction_OutOfMemoryMessage:Far
Global PE_UpdateInstruments:Far
Global PEFunction_DrawUndo:Far
Global PEFunction_PreUndo:Far
Global PEFunction_PostUndo:Far
Global PEResetModified:Far
Global PE_SaveCurrentPattern:Far
Global PE_RestoreCurrentPattern:Far
Global PEFunction_StoreCurrentPattern:Far
Global BaseOctave
Global SkipValue
Global RowHiLight1:Byte
Global RowHiLight2:Byte
Global MaxRow:Word
Global NumberOfRows:Word
Global Amplification
Global FastVolumeAmplification
Global CommandToValue:Byte
Global LastInstrument:Byte
Public MultiChannelInfo
Public PatternDataArea
Public Order, CentraliseCursor
Public PatternSetLength, PatternLengthStart, PatternLengthEnd
Public MIDI_SetInstrument, PE_TranslateMIDI
Public MIDIAmplification, MIDICentralNote, PE_RestoreMIDINote
Public PE_InsertInstrument, PE_DeleteInstrument
Public Flags, Modified, PatternModified
Public LastKeyBoard1, PatternNumber
;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
Segment Pattern WORD Public 'Code' USE16
Assume CS:Pattern, DS:Nothing
CREATENEWLOGFILE EQU 0
include debug.inc
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ Variables ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
NONOTE EQU 0FDh
MAXNOTE EQU 119
;PatternSize DW 0
;PatternEnd DW 0
PatternDataArea DW PatternData
TempVariableArea DW 0
TempVariableArea2 DW 0
TempVariableArea3 DW 0
TempVariableArea4 DW 0
TempVariableArea5 DW 0
TempVariableArea6 DW 0
TopOrder DW 0
Order DW 0
OrderCursor DW 0
PatternNumber DW 0
TopRow DW 0
Row DW 0
MaxRow DW 63
NumberOfRows DW 64
LeftChannel DW 0
Channel DW 0
MIDIChannel DW 0
PatternCursor DW 0
BaseOctave DW 4
SkipValue DW 1
MultiChannelInfo DB 64 Dup (0)
BlockMark DW 0 ; 0 if no block marked, 1 if block is marked
BlockLeft DW 0
BlockTop DW 0
BlockRight DW 0
BlockBottom DW 0
BlockDataArea DW 0
BlockAnchorChannel DW 0
BlockAnchorRow DW 0
BlockReset DW 0
LastKeyBoard1 DW 0, 0
LastKeyBoard2 DW 0, 0
LastKeyBoard3 DW 0, 0
EmptyRow DB 64 Dup ( NONOTE, 0, 0FFh, 0, 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
DW 0FFFFh
MODPeriodTable DW 1712, 1616, 1525, 1440, 1357, 1281 ; Octave 0
DW 1209, 1141, 1077, 1017, 961, 907
DW 856, 808, 762, 720, 678, 640 ; Octave 1
DW 604, 570, 538, 508, 480, 453
DW 428, 404, 381, 360, 339, 320 ; Octave 2
DW 302, 285, 269, 254, 240, 226
DW 214, 202, 190, 180, 170, 160 ; Octave 3
DW 151, 143, 135, 127, 120, 113
DW 107, 101, 95, 90, 85, 80 ; Octave 4
DW 75, 71, 67, 63, 60, 56
DW 53, 50, 47, 45, 42, 40 ; Octave 5
DW 37, 35, 33, 31, 30, 28
Amplification DW 100
PlayMarkPattern DW 0
PlayMarkRow DW 0
PlayMarkOn DB 0
VolumePan DB 0
UndoBuffer DW 20 Dup (0) ; Word for segment, word for
; type:
UndoBufferTypes Label Word
DW Offset UndoBufferType0, Offset UndoBufferType1
DW Offset UndoBufferType2, Offset UndoBufferType3
DW Offset UndoBufferType4, Offset UndoBufferType5
DW Offset UndoBufferType6, Offset UndoBufferType7
DW Offset UndoBufferType8, Offset UndoBufferType9
DW Offset UndoBufferType10, Offset UndoBufferType11
DW Offset UndoBufferType12, Offset UndoBufferType13
DW Offset UndoBufferType14, Offset UndoBufferType15
DW Offset UndoBufferType16, Offset UndoBufferType17
DW Offset UndoBufferType18, Offset UndoBufferType19
DW Offset UndoBufferType20, Offset UndoBufferType21
DW Offset UndoBufferType22
UndoBufferType0 DB "Empty", 0
UndoBufferType1 DB "Undo revert pattern data (Alt-BkSpace)", 0
UndoBufferType2 DB "Undo transposition up", 0FFh, 10, " (Alt-Q)", 0
UndoBufferType3 DB "Undo transposition down", 0FFh, 8, " (Alt-A)", 0
UndoBufferType4 DB "Undo block length double", 0FFh, 7, " (Alt-F)", 0
UndoBufferType5 DB "Undo block length halve", 0FFh, 8, " (Alt-G)", 0
UndoBufferType6 DB "Undo volume amplification", 0FFh, 6, " (Alt-J)", 0
UndoBufferType7 DB "Undo volume or panning slide (Alt-K)", 0
UndoBufferType8 DB "Recover volumes/pannings", 0FFh, 5, " (2*Alt-K)", 0
UndoBufferType9 DB "Replace mixed data", 0FFh, 13, " (Alt-M)", 0
UndoBufferType10 DB "Replace overwritten data", 0FFh, 7, " (Alt-O)", 0
UndoBufferType11 DB "Undo paste data", 0FFh, 16, " (Alt-P)", 0
UndoBufferType12 DB "Undo set sample/instrument", 0FFh, 5, " (Alt-S)", 0
UndoBufferType13 DB "Undo set volume/panning", 0FFh, 8, " (Alt-V)", 0
UndoBufferType14 DB "Replace extra volumes/pannings (Alt-W)", 0
UndoBufferType15 DB "Undo effect data slide", 0FFh, 9, " (Alt-X)", 0
UndoBufferType16 DB "Recover effects/effect data (2*Alt-X)", 0
UndoBufferType17 DB "Undo swap block", 0FFh, 16, " (Alt-Y)", 0
UndoBufferType18 DB "Undo block cut", 0FFh, 17, " (Alt-Z)", 0
UndoBufferType19 DB "Remove inserted row(s)", 0FFh, 4, " (Alt-Insert)", 0
UndoBufferType20 DB "Replace deleted row(s)", 0FFh, 4, " (Alt-Delete)", 0
UndoBufferType21 DB "Redo", 0FFh, 28, " (Undo)", 0
UndoBufferType22 DB "Pattern ", 0FDh, "D", 0
SelectUndo DW 0
ShiftPressed DB 0
NoteEntered DB 0
PreviewNote DB 0, 0, 0FFh, 0, 0
Modified DB 0 ; } Order important
PatternModified DB 0 ; }
MIDIPlayTrigger DB 0 ; 0 = nothing, 1 = play
; pattern, 2 = play song.
CompleteMsg DB 0FDh, "D% Complete", 0
Template DB 0
TemplateMsg1 DB "Template, Overwrite", 0
TemplateMsg2 DB "Template, Mix - Pattern data precedence", 0
TemplateMsg3 DB "Template, Mix - Clipboard data precedence", 0
TemplateMsg4 DB "Template, Notes only", 0
TriggerMsg1 DB "No MIDI Trigger", 0
TriggerMsg2 DB "Pattern MIDI Trigger", 0
TriggerMsg3 DB "Song MIDI Trigger", 0
NextOrderMsg DB "Playing order ", 0FDh, "D next", 0
CursorStepMSg DB "Cursor step set to ", 0FDh, "D", 0
EncodingInfo DB 384 Dup (0)
PatternSetLength DW 64
PatternLengthStart DW 0
PatternLengthEnd DW 0
TempData DB 320 Dup (0)
PEFunctions Label Word
DB 0
DW 11Ch ; Enter
DW Offset PEFunction_PickUp
IF SHOWPATTERNLENGTH
DB 0
DW 111Ch ; Right Ctrl+Enter
DW Offset PE_ShowPatternLength
ENDIF
DB 1
DW '{'
DW Near Ptr PE_LeftBrace
DB 1
DW '}'
DW Near Ptr PE_RightBrace
DB 1
DW '['
DW Near Ptr PE_LeftSquareBracket
DB 1
DW ']'
DW Near Ptr PE_RightSquareBracket
DB 0
DW 1C8h
DW Offset PEFunction_Up
DB 0
DW 1D0h
DW Offset PEFunction_Down
DB 0
DW 1CBh
DW Offset PEFunction_Left
DB 0
DW 1CDh
DW Offset PEFunction_Right
DB 0
DW 1C9h
DW PEFunction_PgUp
DB 0
DW 1D1h
DW PEFunction_PgDn
DB 2
DW 1C7h
DW Offset PEFunction_Alt_Home
DB 2
DW 1CFh
DW Offset PEFunction_Alt_End
DB 0
DW 1C7h
DW Offset PEFunction_Home
DB 0
DW 1CFh
DW Offset PEFunction_End
DB 3
DW 1C9h
DW PEFunction_Ctrl_PgUp
DB 3
DW 1D1h
DW PEFunction_Ctrl_PgDn
DB 2 ; Alt...
DW 1CBh ; Left Arrow
DW Offset PEFunction_AltLeft
DB 2 ; Alt...
DW 1CDh ; Right Arrow
DW Offset PEFunction_AltRight
DB 3 ; Ctrl...
DW 1CBh ; Left Arrow
DW Offset PEFunction_ViewLeft
DB 3
DW 1CDh
DW Offset PEFunction_ViewRight
DB 2 ; Alt...
DW 1C8h ; Up Arrow
DW Offset PEFunction_AltUp
DB 2
DW 1D0h
DW Offset PEFunction_AltDown
DB 3
DW 1C7h
DW Offset PEFunction_Ctrl_Home
DB 3
DW 1CFh
DW Offset PEFunction_Ctrl_End
DB 4
DW 1C8h
DW Offset PEFunction_Up
DB 4
DW 1D0h
DW Offset PEFunction_Down
DB 4
DW 1CBh
DW Offset PEFunction_AltLeft
DB 4
DW 1CDh
DW Offset PEFunction_AltRight
DB 4
DW 1C9h
DW PEFunction_ShiftPgUp
DB 4
DW 1D1h
DW PEFunction_ShiftPgDn
DB 4
DW 1C7h
DW Offset PEFunction_Home
DB 4
DW 1CFh
DW Offset PEFunction_End
DB 4
DW 12Ah
DW Offset PEFunction_Press_Shift
DB 4
DW 136h
DW Offset PEFunction_Press_Shift
DB 0
DW 2Ah
DW Offset PEFunction_Release_Shift
DB 0
DW 36h
DW Offset PEFunction_Release_Shift
DB 0
DW 10Fh
DW Offset PEFunction_Tab
DB 4
DW 10Fh
DW Offset PEFunction_ShiftTab
DB 1
DW ','
DW Offset PEFunction_SetMask
DB 0
DW 1D2h
DW Offset PEFunction_Insert
DB 0
DW 1D3h ; Delete
DW Offset PEFunction_Delete
DB 2 ; Alt...
DW 1D2h ; Insert
DW Offset PEFunction_RowInsert
DB 2 ; Alt...
DW 1D3h ; Delete
DW Offset PEFunction_RowDelete
DB 3 ; Ctrl...
DW 1D2h ; Insert
DW Offset PEFunction_RollDown
DB 3 ; Ctrl...
DW 1D3h ; Delete
DW Offset PEFunction_RollUp
DB 0
DW 10Eh
DW Offset PEFunction_BackSpace
DB 3 ; Ctrl...
DW 10Eh ; Backspace
DW Offset PEFunction_Undo
DB 1
DW '<'
DW Offset PEFunction_DecreaseInstrument
DB 1
DW '>'
DW Offset PEFunction_IncreaseInstrument
DB 1
DW ';'
DW Offset PEFunction_DecreaseInstrument
DB 1
DW "'"
DW Offset PEFunction_IncreaseInstrument
DB 3 ; Ctrl
DW 1C8h
DW Offset PEFunction_DecreaseInstrument
DB 3
DW 1D0h
DW Offset PEFunction_IncreaseInstrument
DB 1
DW 3000h ; Alt 'B'
DW Offset PEFunction_MarkBeginBlock
DB 1
DW 3100h ; Alt 'N'
DW Offset PEFunction_ToggleMultiChannel
DB 1
DW 1200h ; Alt 'E'
DW Offset PEFunction_MarkEndBlock
DB 1
DW 1600h ; Alt 'U'
DW Offset PEFunction_UnMarkBlock
DB 1
DW 1700h ; Alt 'I'
DW Offset PEFunction_ToggleTemplate
DB 1
DW ':'
DW Offset PEFunction_TemplateOff
DB 1
DW 2000h ; Alt 'D'
DW Offset PEFunction_AltD
DB 1
DW 1F00h ; Alt 'S'
DW Offset PEFunction_AltS
DB 1
DW 2500h ; Alt 'K'
DW Offset PEFunction_AltK
DB 1
DW 2C00h ; Alt 'Z'
DW Offset PEFunction_WipeBlock
DB 1
DW 2600h ; Alt 'L'
DW Offset PEFunction_AltL
DB 1
DW 1800h ; Alt 'O'
DW Offset PEFunction_BlockOverwrite
DB 1
DW 1900h ; Alt 'P'
DW Offset PEFunction_BlockPaste
DB 1
DW 2E00h ; Alt 'C'
DW Offset PEFunction_BlockCopy
DB 1
DW 3h ; Ctrl 'C'
DW Offset PEFunction_ToggleCentralise
DB 0
DW 146h ; Scroll Lock
DW Offset PEFunction_ToggleTrace
DB 2 ; Alt Scroll Lock
DW 146h
DW Offset MIDIInputToggle
DB 1
DW 3200h ; Alt 'M'
DW Offset PEFunction_BlockMix
DB 1
DW 1000h ; Alt 'Q'
DW Offset PEFunction_SemiUp
DB 1
DW 1E00h ; Alt 'A'
DW Offset PEFunction_SemiDown
DB 1
DW 2D00h ; Alt 'X'
DW Offset PEFunction_WipeCommands
DB 1
DW 2400h ; Alt 'J'
DW Offset PEFunction_VolumeAmp
DB 1 ; Ctrl...
DW 0Ah ; 'J'
DW Offset ToggleFastVolume
DB 1
DW 2F00h ; Alt 'V'
DW Offset PEFunction_BlockVolume
DB 1
DW 1100h ; Alt 'W'
DW Offset PEFunction_WipeExcessVolumes
DB 1
DW 1400h ; Alt 'T'
DW Offset PEFunction_ViewTrack
DB 1 ; Ctrl...
DW 14h ; 'T'
DW Offset PEFunction_ToggleTracking
DB 1 ; Ctrl...
DW 8h ; 'H'
DW Offset PEFunction_ToggleRowHilight
DB 1
DW 2300h ; Alt 'H'
DW Offset PEFunction_ToggleDivision
DB 1
DW 1300h ; Alt 'R'
DW Offset PEFunction_ClearViews
DB 1
DW 1500h ; Alt 'Y'
DW Offset PEFunction_BlockSwap
DB 1
DW 2200h ; Alt 'G'
DW Offset PEFunction_BlockHalve
DB 1
DW 2100h ; Alt 'F'
DW Offset PEFunction_BlockDouble
; DB 0
; DW 14Eh ; Grey Plus
; DW Offset PEFunction_NextPattern
;
; DB 0
; DW 14Ah ; Grey Minus
; DW Offset PEFunction_LastPattern
DB 4 ; Shift
DW 14Eh
DW Offset PEFunction_Next4Patterns
DB 4
DW 14Ah
DW Offset PEFunction_Last4Patterns
DB 3 ; Ctrl..
DW 14Eh ; Grey Plus
DW Offset PEFunction_NextOrderPattern
DB 3 ; Ctrl..
DW 14Ah ; Grey Minus
DW Offset PEFunction_LastOrderPattern
DB 1
DW '+'
DW Offset PEFunction_NextPattern
DB 1
DW '-'
DW Offset PEFunction_LastPattern
DB 3 ; Ctrl
DW 141h ; F7
DW Offset PEFunction_SetPlayMark
DB 2
DW 10Bh
DW Offset PEFunction_Alt0
DB 2 ; Alt Backspace
DW 10Eh
DW Offset PEFunction_RestoreData
DB 2 ; Alt..
DW 11Ch ; Enter
DW Offset PEFunction_StoreCurrentPattern
DB 0
DW 0B02h ; Left-Shift, Left-Ctrl '1'
DW Offset PEFunction_Ctrl_Shift1
DB 0
DW 0B03h ; Left-Shift, Left-Ctrl '2'
DW Offset PEFunction_Ctrl_Shift2
DB 0
DW 0B04h ; Left-Shift, Left-Ctrl '3'
DW Offset PEFunction_Ctrl_Shift3
DB 0
DW 0B05h ; Left-Shift, Left-Ctrl '4'
DW Offset PEFunction_Ctrl_Shift4
DB 3 ; Ctrl..
DW 10Bh ; '0'
DW Offset PEFunction_Ctrl0
DB 3 ; Ctrl...
DW 102h ; '1'
DW Offset PEFunction_Ctrl1
DB 3 ; Ctrl...
DW 103h ; '2'
DW Offset PEFunction_Ctrl2
DB 3 ; Ctrl...
DW 104h ; '3'
DW Offset PEFunction_Ctrl3
DB 3 ; Ctrl...
DW 105h ; '4'
DW Offset PEFunction_Ctrl4
DB 3 ; Ctrl...
DW 106h ; '5'
DW Offset PEFunction_Ctrl5
DB 1
DW '\'
DW Offset PEFunction_Alt_F9
DB 0
DW 135h
DW Offset PEFunction_MuteNext
DB 1
DW '?'
DW Offset PEFunction_MutePrevious
DB 2 ; Alt
DW 143h ; F9
DW Offset PEFunction_Alt_F9
DB 1
DW '|'
DW Offset PEFunction_SoloGotoNext
DB 2 ; Alt \
DW 12Bh
DW Offset PEFunction_UnmuteAll
DB 2 ; Alt
DW 144h ; F10
DW Offset PEFunction_Alt_F10
DB 3 ; Ctrl
DW 140h ; F6
DW Offset PE_PlayCurrentPosition
DB 3 ; Ctrl
DW 13Ch ; F2
DW Offset PE_SetPatternLength
DB 1 ; Ctrl 'V'
DW 16h
DW Offset PE_ToggleDefaultVolume
DB 1 ; Ctrl 'Z'
DW 1Ah
DW Offset PE_CycleMIDIPlayTrigger
DB 6 ; MIDI message
DW 8000h
DW Offset PE_MIDINoteOff
DB 6 ; MIDI message
DW 9000h
DW Offset PE_MIDINote
DB 6 ; MIDI message
DW 0A000h
DW Offset PE_MIDIAftertouch
DB 0FFh
CursorPositions DB 0, 2, 4, 5, 7, 8, 10, 11, 12
DB 0, 2, 3, 4, 5, 6, 7, 8, 9
DB 0, 2, 3, 3, 4, 4, 5, 6, 6
DB 20h, 2, 1, 2, 1, 2, 0, 1, 2
DB 10h, 1, 0, 1, 0, 1, 0, 1, 1
MaskChange DB 0, 0, 1, 1, 2, 2, 4, 4, 4
ChannelMsg DB " Channel xx ", 0
ChannelMsg2 DB "Channel xx", 0
ChannelMsg3 DB " Chnl xx", 0
ChannelMsg4 DB " xx", 0
ChannelMsg5 DB "xx", 0
ChannelMsg6 DB "Ch xx", 0
ChannelMsg7 DB "Chnl xx", 0
NoteNames Label Byte
DB "C-C#D-D#E-F-F#G-G#A-A#B-" ; Cmaj
StartChannelEdit DW 5
;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
; Don't change order of variables within here!!!!
KeySignature DW 0
NumChannelsEdit DW 5
RowHiLight1 DB 4
RowHiLight2 DB 16
EditMask DB 3 ; Bit 0 = ins
; Bit 1 = vol
; Bit 2 = commands
ViewDivision DB 1
ViewWidth DW 0
ViewChannels DW 100 Dup (0FFFFh) ; Contains channel/viewmethod
ViewChannelTracking DB 0
CommandToValue DB 0
CentraliseCursor DB 0E8h ; Bit 0 = centralise cursor
; Bit 1 = hilight row
; Bit 2 = fast volume changes
; Bit 3 = Record tick base
; Bit 4 = Program base 1
; Bit 5 = Record note off
; Bit 6 = Record velocity
; Bit 7 = Record aftertouch
MIDIAmplification DB 100
MIDICentralNote DB 60
FastVolumeAmplification DW 67
Flags DB 0 ; Extra flags
; Bit 0 = display defaults.
; Bit 1 = Record note cuts.
;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
ViewMethodInfo Label
DW Offset ViewFull
DW 13 ; Width
DW Offset ViewCompress
DW 10 ; Width
DW Offset ViewAllSmall
DW 7
DW Offset ViewNote
DW 3
DW Offset ViewTiny
DW 2
EmptyData DB 253, 0, 255, 0, 0
TempNumbers DB 3 Dup (0)
ErrorMsg DB "Unable to allocate memory for pattern edit area.", 13, 10
DB "Sorry, more conventional memory is required to run this program.", 13, 10, "$"
ViewChannelTrackingMsg DB "View-Channel cursor tracking enabled", 0
NoViewChannelTrackingMsg DB "View-Channel cursor tracking disabled", 0
CentraliseCursorMsg DB "Centralise cursor enabled", 0
NoCentraliseCursorMsg DB "Centralise cursor disabled", 0
TraceMsg DB "Playback tracing enabled", 0
NoTraceMsg DB "Playback tracing disabled", 0
PanningControlSetMsg DB "Panning control set", 0
VolumeControlSetMsg DB "Volume control set", 0
NoRowHilightMsg DB "Row hilight disabled", 0
RowHilightMsg DB "Row hilight enabled", 0
NoFastVolumeMsg DB "Alt-I / Alt-J fast volume changes disabled", 0
FastVolumeMsg DB "Alt-I / Alt-J fast volume changes enabled", 0
FastVolumeNotEnabledMsg DB "Alt-I / Alt-J fast volume changes not enabled", 0
DefaultVolumeOn DB "Default volumes enabled", 0
DefaultVolumeOff DB "Default volumes disabled", 0
MIDIInputDisabledMsg DB "MIDI Input Disabled", 0
MIDIInputEnabledMsg DB "MIDI Input Enabled", 0
MIDIInputEnabled DB 1
LastNote DB 60
LastInstrument DB 1
LastVolume DB 0FFh
LastCommand DB 0
LastCommandValue DB 0
TracePlayback DB 0
OrderListKeys Label
IF ORDERSORT
DB 1
DW 1300h ; Alt-R
DW Offset PE_PostOrderListReorder
ENDIF
DB 0
DW 10Fh
DW Offset PE_PostOrderList20
DB 1
DW 0F00h
DW Offset PE_PostOrderList21
DB 3 ; Ctrl-F7
DW 141h
DW Offset PE_PostOrderListNextOrder
DB 1 ; Spacebar
DW ' '
DW Offset PE_PostOrderListNextOrder
DB 0
DW 1C8h ; Up
DW Offset PE_PostOrderList1
DB 0
DW 1D0h ; Down
DW Offset PE_PostOrderList3
DB 0
DW 1C9h ; PgUp
DW Offset PE_PostOrderList4
DB 0
DW 1D1h ; PgDn
DW Offset PE_PostOrderList6
DB 0
DW 1CBh ; Left