@@ -269,23 +269,22 @@ begin |
| 269 |
if Instruments[I].CounterStep = swSeven then |
269 |
if Instruments[I].CounterStep = swSeven then |
| 270 |
HighMask := HighMask or %10000000; |
270 |
HighMask := HighMask or %10000000; |
| 271 |
SL.Add(IntToStr(HighMask)); |
271 |
SL.Add(IntToStr(HighMask)); |
| 272 |
|
|
|
| 273 |
for J := Low(TNoiseMacro) to High(TNoiseMacro) do |
|
|
| 274 |
SL.Add(IntToStr(0)); |
|
|
| 275 |
end |
272 |
end |
| 276 |
else begin |
273 |
else begin |
| 277 |
for J := Low(AsmInstrument) to High(AsmInstrument) do |
274 |
for J := Low(AsmInstrument) to High(AsmInstrument) do |
| 278 |
SL.Add(IntToStr(AsmInstrument[J])); |
275 |
SL.Add(IntToStr(AsmInstrument[J])); |
| 279 |
SL.Add('0'); |
|
|
| 280 |
SL.Add('0'); |
|
|
| 281 |
SL.Add('0'); |
|
|
| 282 |
SL.Add('0'); |
|
|
| 283 |
end; |
276 |
end; |
| 284 |
|
277 |
|
| 285 |
WriteStr(TypePrefix, Instruments[I].Type_); |
278 |
WriteStr(TypePrefix, Instruments[I].Type_); |
| 286 |
ResultSL.Add(Format('%s%s: db %s', [TypePrefix, 'inst' + IntToStr(I), |
279 |
ResultSL.Add(Format('%s%s:'+LineEnding+'db %s', [TypePrefix, 'inst' + IntToStr(I), |
| 287 |
SL.DelimitedText])); |
280 |
SL.DelimitedText])); |
| 288 |
SL.Free; |
281 |
SL.Free; |
|
|
282 |
|
|
|
283 |
if Instruments[I].SubpatternEnabled then |
|
|
284 |
ResultSL.Add(Format('dw %sSP%d', [TypePrefix, I])) |
|
|
285 |
else |
|
|
286 |
ResultSL.Add('dw 0'); |
|
|
287 |
ResultSL.Add('ds '+IfThen(Instruments[I].Type_ = itNoise, '4', '2')); |
| 289 |
end; |
288 |
end; |
| 290 |
|
289 |
|
| 291 |
Result := ResultSL.Text; |
290 |
Result := ResultSL.Text; |
@@ -452,6 +451,7 @@ procedure AssembleSong(Song: TSong; Filename: string; Mode: TExportMode); |
| 452 |
var |
451 |
var |
| 453 |
OutFile: Text; |
452 |
OutFile: Text; |
| 454 |
I: integer; |
453 |
I: integer; |
|
|
454 |
TypePrefix: String; |
| 455 |
Proc: TProcess; |
455 |
Proc: TProcess; |
| 456 |
FilePath: string; |
456 |
FilePath: string; |
| 457 |
RenameSucceeded: Boolean; |
457 |
RenameSucceeded: Boolean; |
@@ -555,6 +555,21 @@ begin |
| 555 |
|
555 |
|
| 556 |
CloseFile(OutFile); |
556 |
CloseFile(OutFile); |
| 557 |
|
557 |
|
|
|
558 |
AssignFile(OutFile, 'render/subpattern.htt'); |
|
|
559 |
Rewrite(OutFile); |
|
|
560 |
|
|
|
561 |
// TODO: Are keys and data defined to be aligned? Seems like they are but |
|
|
562 |
// should probably find out if that's just an implementation detail... |
|
|
563 |
for I := Low(Song.Instruments.All) to High(Song.Instruments.All) do |
|
|
564 |
with Song.Instruments.All[I] do begin |
|
|
565 |
if SubpatternEnabled then begin |
|
|
566 |
WriteStr(TypePrefix, Type_); |
|
|
567 |
Write(OutFile, RenderPattern(TypePrefix+'SP' + IntToStr(I), Subpattern)); |
|
|
568 |
end; |
|
|
569 |
end; |
|
|
570 |
|
|
|
571 |
CloseFile(OutFile); |
|
|
572 |
|
| 558 |
// Build the file |
573 |
// Build the file |
| 559 |
Proc := TProcess.Create(nil); |
574 |
Proc := TProcess.Create(nil); |
| 560 |
Proc.Options := Proc.Options + [poWaitOnExit, poUsePipes, poStdErrToOutput, poNoConsole]; |
575 |
Proc.Options := Proc.Options + [poWaitOnExit, poUsePipes, poStdErrToOutput, poNoConsole]; |