Commit 8a7b7cf

Nick committed on
Fix wave length bug
commit 8a7b7cf5152d35a752d404564f2797ec3426d3e8 parent 0302ad9
4 changed files +15−11
Modifiedhugedatatypes.pas +3−1
@@ -19,7 +19,9 @@ type
19 True: (All: packed array[1..45] of TInstrument); 19 True: (All: packed array[1..45] of TInstrument);
20 end; 20 end;
21 21
22 TWaveBank = packed array[0..15] of TWave; 22 TWaveBankV1 = packed array[0..15] of TWaveV1;
23 TWaveBankV2 = packed array[0..15] of TWaveV2;
24 TWaveBank = TWaveBankV2;
23 TRoutineBank = packed array[0..15] of TRoutine; 25 TRoutineBank = packed array[0..15] of TRoutine;
24 26
25 TEffectParams = bitpacked record 27 TEffectParams = bitpacked record
Modifiedsong.pas +7−5
@@ -7,7 +7,7 @@ unit Song;
7 7
8 interface 8 interface
9 9
10 uses Classes, HugeDatatypes, instruments, Constants; 10 uses Classes, HugeDatatypes, instruments, Constants, waves;
11 11
12 type 12 type
13 TSongV1 = packed record 13 TSongV1 = packed record
@@ -18,7 +18,7 @@ type
18 Comment: ShortString; 18 Comment: ShortString;
19 19
20 Instruments: TInstrumentBank; 20 Instruments: TInstrumentBank;
21 Waves: TWaveBank; 21 Waves: TWaveBankV1;
22 22
23 TicksPerRow: Integer; 23 TicksPerRow: Integer;
24 24
@@ -34,7 +34,7 @@ type
34 Comment: ShortString; 34 Comment: ShortString;
35 35
36 Instruments: TInstrumentBank; 36 Instruments: TInstrumentBank;
37 Waves: TWaveBank; 37 Waves: TWaveBankV1;
38 38
39 TicksPerRow: Integer; 39 TicksPerRow: Integer;
40 40
@@ -305,7 +305,7 @@ begin
305 end; 305 end;
306 306
307 for I := Low(S.Waves) to High(S.Waves) do begin 307 for I := Low(S.Waves) to High(S.Waves) do begin
308 for J := 0 to 32 do 308 for J := Low(TWave) to High(TWave) do
309 S.Waves[I][J] := random($F); 309 S.Waves[I][J] := random($F);
310 end; 310 end;
311 311
@@ -363,7 +363,9 @@ begin
363 end; 363 end;
364 end; 364 end;
365 365
366 SV3.Waves:=S.Waves; 366 for I := Low(TWaveBank) to High(TWaveBank) do
367 Move(S.Waves[I], SV3.Waves[I], SizeOf(TWave));
368
367 SV3.TicksPerRow:=S.TicksPerRow; 369 SV3.TicksPerRow:=S.TicksPerRow;
368 SV3.Patterns:=S.Patterns; 370 SV3.Patterns:=S.Patterns;
369 SV3.OrderMatrix:=S.OrderMatrix; 371 SV3.OrderMatrix:=S.OrderMatrix;
Modifiedtracker.pas +2−4
@@ -507,7 +507,7 @@ begin
507 W := PB.Width; 507 W := PB.Width;
508 H := PB.Height; 508 H := PB.Height;
509 509
510 Interval := W div 32; 510 Interval := W div 31;
511 //HInterval := H div $10; 511 //HInterval := H div $10;
512 With PB.Canvas do begin 512 With PB.Canvas do begin
513 Brush.Color := clBlack; 513 Brush.Color := clBlack;
@@ -1350,10 +1350,8 @@ begin
1350 if S.Length < High(TWave) then Exit; 1350 if S.Length < High(TWave) then Exit;
1351 1351
1352 try 1352 try
1353 for I := Low(TWave) to High(TWave) do begin 1353 for I := Low(TWave) to High(TWave) do
1354 writeln(Hex2Dec(S.Substring(I,1)));
1355 CurrentWave^[I] := Hex2Dec(S.Substring(I,1)); 1354 CurrentWave^[I] := Hex2Dec(S.Substring(I,1));
1356 end;
1357 HexWaveEdit.Text := S; 1355 HexWaveEdit.Text := S;
1358 WaveEditPaintBox.Invalidate; 1356 WaveEditPaintBox.Invalidate;
1359 except 1357 except
Modifiedwaves.pas +3−1
@@ -8,7 +8,9 @@ uses
8 Classes, SysUtils; 8 Classes, SysUtils;
9 9
10 type 10 type
11 TWave = packed array[0..32] of Byte; 11 TWaveV1 = packed array[0..32] of Byte;
12 TWaveV2 = packed array[0..31] of Byte;
13 TWave = TWaveV2;
12 T4bitWave = packed array[0..15] of Byte; 14 T4bitWave = packed array[0..15] of Byte;
13 15
14 implementation 16 implementation