@@ -844,6 +844,7 @@ var |
| 844 |
Regs: TRegisters; |
844 |
Regs: TRegisters; |
| 845 |
AsmInstrument: TAsmInstrument; |
845 |
AsmInstrument: TAsmInstrument; |
| 846 |
I, Addr, Freq: Integer; |
846 |
I, Addr, Freq: Integer; |
|
|
847 |
HighMask: Integer; |
| 847 |
begin |
848 |
begin |
| 848 |
Freq := NotesToFreqs.KeyData[Note]; |
849 |
Freq := NotesToFreqs.KeyData[Note]; |
| 849 |
AsmInstrument := InstrumentToBytes(Instr); |
850 |
AsmInstrument := InstrumentToBytes(Instr); |
@@ -860,6 +861,8 @@ begin |
| 860 |
WriteBufferToSymbol('subpattern1', SubpatternToBytes(Instr.Subpattern), SizeOf(TSubpatternBytes)); |
861 |
WriteBufferToSymbol('subpattern1', SubpatternToBytes(Instr.Subpattern), SizeOf(TSubpatternBytes)); |
| 861 |
|
862 |
|
| 862 |
PokeSymbol('start_ch1', 1); |
863 |
PokeSymbol('start_ch1', 1); |
|
|
864 |
if Instr.SubpatternEnabled then |
|
|
865 |
PokeSymbol('running_ch1', 1); |
| 863 |
end; |
866 |
end; |
| 864 |
itWave: begin |
867 |
itWave: begin |
| 865 |
CopyWaveIntoWaveRam(Waveform); |
868 |
CopyWaveIntoWaveRam(Waveform); |
@@ -870,9 +873,26 @@ begin |
| 870 |
WriteBufferToSymbol('subpattern3', SubpatternToBytes(Instr.Subpattern), SizeOf(TSubpatternBytes)); |
873 |
WriteBufferToSymbol('subpattern3', SubpatternToBytes(Instr.Subpattern), SizeOf(TSubpatternBytes)); |
| 871 |
|
874 |
|
| 872 |
PokeSymbol('start_ch3', 1); |
875 |
PokeSymbol('start_ch3', 1); |
|
|
876 |
if Instr.SubpatternEnabled then |
|
|
877 |
PokeSymbol('running_ch3', 1); |
| 873 |
end; |
878 |
end; |
| 874 |
itNoise: begin |
879 |
itNoise: begin |
| 875 |
|
880 |
Addr := SymbolAddress('instrument4'); |
|
|
881 |
spokeb(Addr, AsmInstrument[1]); |
|
|
882 |
|
|
|
883 |
HighMask := AsmInstrument[0]; |
|
|
884 |
if Instr.LengthEnabled then |
|
|
885 |
HighMask := HighMask or %01000000; |
|
|
886 |
if Instr.CounterStep = swSeven then |
|
|
887 |
HighMask := HighMask or %10000000; |
|
|
888 |
spokeb(Addr+3, HighMask); |
|
|
889 |
|
|
|
890 |
PokeSymbol('channel_note4', Note); |
|
|
891 |
WriteBufferToSymbol('subpattern4', SubpatternToBytes(Instr.Subpattern), SizeOf(TSubpatternBytes)); |
|
|
892 |
|
|
|
893 |
PokeSymbol('start_ch4', 1); |
|
|
894 |
if Instr.SubpatternEnabled then |
|
|
895 |
PokeSymbol('running_ch4', 1); |
| 876 |
end; |
896 |
end; |
| 877 |
end; |
897 |
end; |
| 878 |
end; |
898 |
end; |
@@ -905,6 +925,13 @@ begin |
| 905 |
// Silence CH4 |
925 |
// Silence CH4 |
| 906 |
Spokeb(NR42, 0); |
926 |
Spokeb(NR42, 0); |
| 907 |
Spokeb(NR44, %10000000); |
927 |
Spokeb(NR44, %10000000); |
|
|
928 |
|
|
|
929 |
// Stop running subpatterns |
|
|
930 |
PokeSymbol('running_ch1', 0); |
|
|
931 |
PokeSymbol('running_ch2', 0); |
|
|
932 |
PokeSymbol('running_ch3', 0); |
|
|
933 |
PokeSymbol('running_ch4', 0); |
|
|
934 |
|
| 908 |
UnlockPlayback; |
935 |
UnlockPlayback; |
| 909 |
end; |
936 |
end; |
| 910 |
|
937 |
|