Commit 00acecf

Nick committed on
Work towards new release
commit 00acecf6801cdd29f232d74139f4d3ae07b302ff parent 0450394
10 changed files +864−623
ModifiedCpu/z80cpu.pas +10−1
@@ -27,6 +27,7 @@ var
27 ptemp: Pair; 27 ptemp: Pair;
28 w1, w2: word; 28 w1, w2: word;
29 29
30 {$push}{$R-}
30 {$include procs.inc} 31 {$include procs.inc}
31 32
32 function nop: byte; 33 function nop: byte;
@@ -1795,9 +1796,16 @@ begin
1795 end; 1796 end;
1796 1797
1797 function dd_debug: byte; 1798 function dd_debug: byte;
1799 var
1800 I: Byte;
1798 begin 1801 begin
1799 writeln('DEBUG: ', speekb(pc.w)); 1802 I := speekb(pc.w);
1800 Inc(pc.w); 1803 Inc(pc.w);
1804 if I <> 0 then writeln('DEBUG: ', I);
1805 if I = 0 then begin
1806 writeln('MEM: ', speekb(wordpeek(pc.w)));
1807 Inc(pc.w,2);
1808 end;
1801 Result := 0; 1809 Result := 0;
1802 end; 1810 end;
1803 1811
@@ -4094,6 +4102,7 @@ begin
4094 4102
4095 Result := 8; 4103 Result := 8;
4096 end; 4104 end;
4105 {$pop}
4097 4106
4098 begin 4107 begin
4099 Z80[0] := nop; 4108 Z80[0] := nop;
ModifiedGBEmu.lpi +8−0
@@ -375,10 +375,18 @@
375 <Parsing> 375 <Parsing>
376 <SyntaxOptions> 376 <SyntaxOptions>
377 <CStyleOperator Value="False"/> 377 <CStyleOperator Value="False"/>
378 <IncludeAssertionCode Value="True"/>
378 <CPPInline Value="False"/> 379 <CPPInline Value="False"/>
379 </SyntaxOptions> 380 </SyntaxOptions>
380 </Parsing> 381 </Parsing>
381 <CodeGeneration> 382 <CodeGeneration>
383 <Checks>
384 <IOChecks Value="True"/>
385 <RangeChecks Value="True"/>
386 <OverflowChecks Value="True"/>
387 <StackChecks Value="True"/>
388 </Checks>
389 <VerifyObjMethodCallValidity Value="True"/>
382 <Optimizations> 390 <Optimizations>
383 <OptimizationLevel Value="0"/> 391 <OptimizationLevel Value="0"/>
384 </Optimizations> 392 </Optimizations>
ModifiedGBEmu.lpr +0−2
@@ -35,8 +35,6 @@ uses
35 about_hugetracker in 'about_hugetracker.pas', 35 about_hugetracker in 'about_hugetracker.pas',
36 rendertowave in 'rendertowave.pas'; 36 rendertowave in 'rendertowave.pas';
37 37
38 {.$R *.RES}
39
40 {$R *.res} 38 {$R *.res}
41 39
42 {$ifdef MSWINDOWS} 40 {$ifdef MSWINDOWS}
ModifiedResources/z80/halt.z80 +150−9
@@ -1,7 +1,44 @@
1 include "hugedriver/hardware.inc" 1 include "hugedriver/include/hardware.inc"
2 SECTION "init", ROM0[$0100] 2
3 jp yeah 3 ;; This is a short program which just contains the noise macro logic found
4 ;; in hUGEDriver. Values are poked by the tracker into RAM, and they are played back
5 ;; by this routine, which is constantly running when the tracker is not playing a song.
6
7 add_a_to_r16: MACRO
8 add \2
9 ld \2, a
10 adc \1
11 sub \2
12 ld \1, a
13 ENDM
14
15 add_a_to_hl: MACRO
16 add_a_to_r16 h, l
17 ENDM
18
19 add_a_to_de: MACRO
20 add_a_to_r16 d, e
21 ENDM
4 22
23 SECTION "Vars", WRAM0
24
25 instr: ds 8
26 note: db
27
28 macro_index: db
29
30 SECTION "LCD controller status interrupt", ROM0[$0048]
31 ;; HACK!!!!!!!!!!!!!
32 ;; there's some sort of bug in the emulator which needs to be fixed,
33 ;; which screws up the program counter immediately after it exits a halt.
34 ;; this nop protects against that for now.
35 nop
36 nop
37 nop
38 jp _domacro
39
40 SECTION "init", ROM0[$0100]
41 jp init
5 42
6 SECTION "romname", ROM0[$0134] 43 SECTION "romname", ROM0[$0134]
7 ; $0134 - $013E: The title, in upper-case letters, followed by zeroes. 44 ; $0134 - $013E: The title, in upper-case letters, followed by zeroes.
@@ -13,8 +50,100 @@ DS 1
13 ; $0144 - $0145: "New" Licensee Code, a two character name. 50 ; $0144 - $0145: "New" Licensee Code, a two character name.
14 DB "NF" 51 DB "NF"
15 52
16 SECTION "code", ROM0 53 SECTION "code", ROM0[$400]
17 yeah: 54
55 _domacro:
56 ld a, [macro_index]
57 cp 1
58 jp z, _macro_begin
59 jp nc, _macro_update
60 reti
61
62 _macro_begin:
63 ld a, [instr]
64 ld [rAUD4ENV], a
65
66 ld a, [note]
67 call _convert_ch4_note
68 ld [rAUD4POLY], a
69
70 ld a, [instr+1]
71 and %01000000 ; get only length enabled
72 or %10000000 ; restart sound
73 ld [rAUD4GO], a
74
75 ld hl, macro_index
76 inc [hl]
77 reti
78
79 _macro_update:
80 ld a, [macro_index]
81
82 ld de, instr
83 add_a_to_de
84 ld a, [de]
85 ld b, a
86
87 ld a, [note]
88 add b
89
90 call _convert_ch4_note
91 ld [rAUD4POLY], a
92
93 xor a
94 ld [rAUD4GO], a
95
96 ld a, [macro_index]
97 inc a
98 cp 8
99 jp nz, .done
100 xor a
101 .done:
102 ld [macro_index], a
103 reti
104
105 _convert_ch4_note:
106 ;; Call with:
107 ;; Note number in A
108 ;; Stores polynomial counter in A
109 ;; Free: HL
110
111 ;; Invert the order of the numbers
112 add 192 ; (255 - 63)
113 cpl
114
115 ;; Thanks to RichardULZ for this formula
116 ;; https://docs.google.com/spreadsheets/d/1O9OTAHgLk1SUt972w88uVHp44w7HKEbS/edit#gid=75028951
117 ; if A > 7 then begin
118 ; B := (A-4) div 4;
119 ; C := (A mod 4)+4;
120 ; A := (C or (B shl 4))
121 ; end;
122
123 ; if A < 7 then return
124 cp 7
125 ret c
126
127 ld h, a
128
129 ; B := (A-4) div 4;
130 sub 4
131 srl a
132 srl a
133 ld l, a
134
135 ; C := (A mod 4)+4;
136 ld a, h
137 and 3
138 add 4
139
140 ; A := (C or (B shl 4))
141 swap l
142 or l
143 ret
144
145 init:
146 ; jp _halt
18 _addr = _AUD3WAVERAM 147 _addr = _AUD3WAVERAM
19 REPT 16 148 REPT 16
20 ld a, $FF 149 ld a, $FF
@@ -33,7 +162,19 @@ _addr = _addr + 1
33 ; silence ch3 162 ; silence ch3
34 ld a, 0 163 ld a, 0
35 ld [rAUD3LEVEL], a 164 ld [rAUD3LEVEL], a
36 bing: 165
37 jr bing ; the same as a halt on an emulator, yet 166 ;; Enable the HBlank interrupt on scanline 0
38 ; allows for ch3 playback. it's a hack. 167 ld a, [rSTAT]
39 ; halt 168 or a, STATF_LYC
169 ld [rSTAT], a
170 xor a ; ld a, 0
171 ld [rLYC], a
172
173 ld a, IEF_LCDC
174 ld [rIE], a
175 ei
176
177 _halt:
178 halt
179 nop
180 jr _halt
Modifiedcodegen.pas +216−151
@@ -5,44 +5,46 @@ unit Codegen;
5 interface 5 interface
6 6
7 uses 7 uses
8 Classes, SysUtils, math, Instruments, Song, Utils, 8 Classes, SysUtils, Math, Instruments, Song, Utils,
9 HugeDatatypes, Constants, dialogs, strutils, FileUtil, LazFileUtils, 9 HugeDatatypes, Constants, Dialogs, strutils, FileUtil, LazFileUtils,
10 lclintf; 10 lclintf;
11 11
12 type 12 type
13 TExportMode = (emNormal, emPreview, emGBS); 13 TExportMode = (emNormal, emPreview, emGBS);
14 14
15 function RenderPreviewRom(Song: TSong): Boolean; 15 function RenderPreviewRom(Song: TSong): boolean;
16 function RenderSongToFile(Song: TSong; Filename: String; Mode: TExportMode = emNormal): Boolean; 16 function RenderSongToFile(Song: TSong; Filename: string;
17 Mode: TExportMode = emNormal): boolean;
17 18
18 implementation 19 implementation
19 20
20 uses process; 21 uses process;
21 22
22 function RenderOrderTable(OrderMatrix: TOrderMatrix): String; 23 function RenderOrderTable(OrderMatrix: TOrderMatrix): string;
23 function ArrayHelper(Ints: array of Integer): String; 24
24 var 25 function ArrayHelper(Ints: array of integer): string;
25 I: Integer; 26 var
26 SL: TStringList; 27 I: integer;
27 begin 28 SL: TStringList;
28 SL := TStringList.Create; 29 begin
29 SL.StrictDelimiter := True; 30 SL := TStringList.Create;
30 SL.Delimiter := ','; 31 SL.StrictDelimiter := True;
31 for I := Low(Ints) to High(Ints) do 32 SL.Delimiter := ',';
32 SL.Add('P'+IntToStr(Ints[I])); 33 for I := Low(Ints) to High(Ints) do
33 Result := SL.DelimitedText; 34 SL.Add('P' + IntToStr(Ints[I]));
34 SL.Free; 35 Result := SL.DelimitedText;
35 end; 36 SL.Free;
37 end;
36 38
37 var 39 var
38 Res: TStringList; 40 Res: TStringList;
39 OrderCnt: Integer; 41 OrderCnt: integer;
40 begin 42 begin
41 Res := TStringList.Create; 43 Res := TStringList.Create;
42 OrderCnt := MaxIntValue([High(OrderMatrix[0]), High(OrderMatrix[1]), 44 OrderCnt := MaxIntValue([High(OrderMatrix[0]), High(OrderMatrix[1]),
43 High(OrderMatrix[2]), High(OrderMatrix[3])]); 45 High(OrderMatrix[2]), High(OrderMatrix[3])]);
44 46
45 Res.Add('order_cnt: db ' + IntToStr(OrderCnt*2)); 47 Res.Add('order_cnt: db ' + IntToStr(OrderCnt * 2));
46 Res.Add('order1: dw ' + ArrayHelper(OrderMatrix[0])); 48 Res.Add('order1: dw ' + ArrayHelper(OrderMatrix[0]));
47 Res.Add('order2: dw ' + ArrayHelper(OrderMatrix[1])); 49 Res.Add('order2: dw ' + ArrayHelper(OrderMatrix[1]));
48 Res.Add('order3: dw ' + ArrayHelper(OrderMatrix[2])); 50 Res.Add('order3: dw ' + ArrayHelper(OrderMatrix[2]));
@@ -52,23 +54,25 @@ begin
52 Res.Free; 54 Res.Free;
53 end; 55 end;
54 56
55 function RenderInstruments(Instruments: TInstrumentBank): String; 57 function RenderInstruments(Instruments: TInstrumentBank): string;
56 var 58 var
57 SL, ResultSL: TStringList; 59 SL, ResultSL: TStringList;
58 AsmInstrument: TAsmInstrument; 60 AsmInstrument: TAsmInstrument;
59 I, J: Integer; 61 I, J: integer;
60 TypePrefix: String; 62 TypePrefix: string;
61 HighMask: Byte; 63 HighMask: byte;
62 begin 64 begin
63 ResultSL := TStringList.Create; 65 ResultSL := TStringList.Create;
64 66
65 for I := Low(Instruments) to High(Instruments) do begin 67 for I := Low(Instruments) to High(Instruments) do
68 begin
66 AsmInstrument := InstrumentToBytes(Instruments[I]); 69 AsmInstrument := InstrumentToBytes(Instruments[I]);
67 SL := TStringList.Create; 70 SL := TStringList.Create;
68 SL.StrictDelimiter := True; 71 SL.StrictDelimiter := True;
69 SL.Delimiter := ','; 72 SL.Delimiter := ',';
70 73
71 if Instruments[I].Type_ = itNoise then begin 74 if Instruments[I].Type_ = itNoise then
75 begin
72 SL.Add(IntToStr(AsmInstrument[1])); 76 SL.Add(IntToStr(AsmInstrument[1]));
73 77
74 HighMask := %00000000; 78 HighMask := %00000000;
@@ -86,7 +90,8 @@ begin
86 SL.Add(IntToStr(AsmInstrument[J])); 90 SL.Add(IntToStr(AsmInstrument[J]));
87 91
88 WriteStr(TypePrefix, Instruments[I].Type_); 92 WriteStr(TypePrefix, Instruments[I].Type_);
89 ResultSL.Add(Format('%s%s: db %s', [TypePrefix, 'inst'+IntToStr(I), SL.DelimitedText])); 93 ResultSL.Add(Format('%s%s: db %s', [TypePrefix, 'inst' + IntToStr(I),
94 SL.DelimitedText]));
90 SL.Free; 95 SL.Free;
91 end; 96 end;
92 97
@@ -94,7 +99,7 @@ begin
94 ResultSL.Free; 99 ResultSL.Free;
95 end; 100 end;
96 101
97 function RenderCell(Cell: TCell): String; 102 function RenderCell(Cell: TCell): string;
98 var 103 var
99 SL: TStringList; 104 SL: TStringList;
100 begin 105 begin
@@ -119,10 +124,10 @@ begin
119 SL.Free; 124 SL.Free;
120 end; 125 end;
121 126
122 function RenderPattern(Name: String; Pattern: TPattern): String; 127 function RenderPattern(Name: string; Pattern: TPattern): string;
123 var 128 var
124 SL: TStringList; 129 SL: TStringList;
125 I: Integer; 130 I: integer;
126 begin 131 begin
127 SL := TStringList.Create; 132 SL := TStringList.Create;
128 SL.Add(Name + ':'); 133 SL.Add(Name + ':');
@@ -134,21 +139,23 @@ begin
134 SL.Free; 139 SL.Free;
135 end; 140 end;
136 141
137 function RenderWaveforms(Waves: TWaveBank): String; 142 function RenderWaveforms(Waves: TWaveBank): string;
138 var 143 var
139 SL, ResultSL: TStringList; 144 SL, ResultSL: TStringList;
140 I, J: Integer; 145 I, J: integer;
141 begin 146 begin
142 ResultSL := TStringList.Create; 147 ResultSL := TStringList.Create;
143 148
144 for I := Low(Waves) to High(Waves) do begin 149 for I := Low(Waves) to High(Waves) do
150 begin
145 SL := TStringList.Create; 151 SL := TStringList.Create;
146 SL.StrictDelimiter := True; 152 SL.StrictDelimiter := True;
147 SL.Delimiter := ','; 153 SL.Delimiter := ',';
148 154
149 J := Low(Waves[I]); 155 J := Low(Waves[I]);
150 while J < High(Waves[I]) do begin 156 while J < High(Waves[I]) do
151 SL.Add(IntToStr((Waves[I, J] shl 4) or Waves[I, J+1])); 157 begin
158 SL.Add(IntToStr((Waves[I, J] shl 4) or Waves[I, J + 1]));
152 Inc(J, 2); 159 Inc(J, 2);
153 end; 160 end;
154 ResultSL.Add(Format('wave%d: db %s', [I, SL.DelimitedText])); 161 ResultSL.Add(Format('wave%d: db %s', [I, SL.DelimitedText]));
@@ -159,22 +166,23 @@ begin
159 ResultSL.Free; 166 ResultSL.Free;
160 end; 167 end;
161 168
162 function RenderConstants(Song: TSong; Mode: TExportMode): String; 169 function RenderConstants(Song: TSong; Mode: TExportMode): string;
163 var 170 var
164 SL: TStringList; 171 SL: TStringList;
165 begin 172 begin
166 SL := TSTringList.Create; 173 SL := TStringList.Create;
167 SL.Add('STANDALONE_MODE EQU 1'); 174 SL.Add('STANDALONE_MODE EQU 1');
168 175
169 if Mode = emPreview then 176 if Mode = emPreview then
170 SL.Add('PREVIEW_MODE EQU 1') 177 SL.Add('PREVIEW_MODE EQU 1')
171 else if Mode = emGBS then begin 178 else if Mode = emGBS then
179 begin
172 SL.Add('GBS_MODE EQU 1'); 180 SL.Add('GBS_MODE EQU 1');
173 SL.Add('GBS_TITLE EQUS "\"' + PadRight(Song.Name, 32) + '\""'); 181 SL.Add('GBS_TITLE EQUS "\"' + PadRight(Song.Name, 32) + '\""');
174 SL.Add('GBS_AUTHOR EQUS "\"' + PadRight(Song.Artist, 32) + '\""'); 182 SL.Add('GBS_AUTHOR EQUS "\"' + PadRight(Song.Artist, 32) + '\""');
175 SL.Add('GBS_COPYRIGHT EQUS "\"' + PadRight(IntToStr(CurrentYear), 32) + '\""'); 183 SL.Add('GBS_COPYRIGHT EQUS "\"' + PadRight(IntToStr(CurrentYear), 32) + '\""');
176 end; 184 end;
177 SL.Add('TICKS EQU '+IntToStr(Song.TicksPerRow)); 185 SL.Add('TICKS EQU ' + IntToStr(Song.TicksPerRow));
178 186
179 Result := SL.Text; 187 Result := SL.Text;
180 SL.Free; 188 SL.Free;
@@ -182,64 +190,118 @@ end;
182 190
183 procedure WriteRoutinesToFile(Routines: TRoutineBank); 191 procedure WriteRoutinesToFile(Routines: TRoutineBank);
184 var 192 var
185 I: Integer; 193 I: integer;
186 F: Text; 194 F: Text;
187 begin 195 begin
188 for I := Low(TRoutineBank) to High(TRoutineBank) do begin 196 for I := Low(TRoutineBank) to High(TRoutineBank) do
189 AssignFile(F, './hUGEDriver/routine'+IntToStr(I)+'.htt'); 197 begin
198 AssignFile(F, './hUGEDriver/routine' + IntToStr(I) + '.htt');
190 Rewrite(F); 199 Rewrite(F);
191 Write(F, Routines[I]); 200 Write(F, Routines[I]);
192 CloseFile(F); 201 CloseFile(F);
193 end; 202 end;
194 end; 203 end;
195 204
196 function RenderPreviewROM(Song: TSong): Boolean; 205 procedure RectifyGBSFile(GBSFile: String);
206 { This procedure removes the useless $400 bytes located after the GBS header.
207 Since RGBDS has no feature to simply offset a section of code, we have to
208 manually introduce padding and then remove it with this silly routine. }
209 var
210 Stream: TFileStream;
211 Buffer: array of Byte;
212 begin
213 Stream := TFileStream.Create(GBSFile, fmOpenRead);
214 SetLength(Buffer, Stream.Size - $400);
215 Stream.Read(Buffer[0], $70);
216 Stream.Seek($400, soCurrent); // Skip the empty byte padding
217 Stream.Read(Buffer[$70], Stream.Size - Stream.Position);
218 Stream.Free;
219
220 Stream := TFileStream.Create(GBSFile, fmOpenWrite);
221 Stream.Write(Buffer[0], Length(Buffer));
222 Stream.Free;
223 end;
224
225 function RenderPreviewROM(Song: TSong): boolean;
197 begin 226 begin
198 Result := RenderSongToFile(Song, 'preview.gb', emPreview); 227 Result := RenderSongToFile(Song, 'preview.gb', emPreview);
199 end; 228 end;
200 229
201 function RenderSongToFile(Song: TSong; Filename: String; Mode: TExportMode = emNormal): Boolean; 230 function RenderSongToFile(Song: TSong; Filename: string;
231 Mode: TExportMode = emNormal): boolean;
202 var 232 var
203 OutFile: Text; 233 OutFile: Text;
204 I: Integer; 234 I: integer;
205 Proc: TProcess; 235 Proc: TProcess;
206 OutSL: TStringList; 236 OutSL: TStringList;
207 FilePath: String; 237 FilePath: string;
208 label AssemblyError, Cleanup; // Eh, screw good practice. How bad can it be? 238
209 begin 239 procedure WriteHTT(F: String; S: String);
210 FilePath := Filename; 240 begin
211 Filename := ExtractFileNameWithoutExt(ExtractFileNameOnly(Filename)); 241 AssignFile(OutFile, F);
242 Rewrite(OutFile);
243 Write(OutFile, S);
244 CloseFile(OutFile);
245 end;
212 246
213 AssignFile(OutFile, './hUGEDriver/constants.htt'); 247 function Assemble(OutFile: string; InFile: string; Defines: array of string): integer;
214 Rewrite(OutFile); 248 var
215 Write(OutFile, RenderConstants(Song, Mode)); 249 Define: string;
216 CloseFile(OutFile); 250 begin
251 Proc.Executable := 'rgbasm';
252 Proc.Parameters.Clear;
253 Proc.Parameters.Add('-o' + OutFile);
254 for Define in Defines do
255 Proc.Parameters.Add('-D' + Define);
256 Proc.Parameters.Add(InFile);
257 Proc.Execute;
217 258
218 AssignFile(OutFile, './hUGEDriver/wave.htt'); 259 Result := Proc.ExitCode;
219 Rewrite(OutFile); 260 end;
220 Write(OutFile, RenderWaveforms(Song.Waves));
221 CloseFile(OutFile);
222 261
223 AssignFile(OutFile, './hUGEDriver/order.htt'); 262 function Link(OutFile: string; InFiles: array of string; Map: string = '';
224 Rewrite(OutFile); 263 Sym: string = ''): integer;
225 Write(OutFile, RenderOrderTable(Song.OrderMatrix)); 264 var
226 CloseFile(OutFile); 265 InFile: string;
266 begin
267 Proc.Executable := 'rgblink';
268 Proc.Parameters.Clear;
269 Proc.Parameters.Add('-o' + OutFile);
270 if Map <> '' then
271 Proc.Parameters.Add('-m' + Map);
272 if Sym <> '' then
273 Proc.Parameters.Add('-n' + Sym);
274 for InFile in InFiles do
275 Proc.Parameters.Add(InFile);
276 Proc.Execute;
227 277
228 AssignFile(OutFile, './hUGEDriver/duty_instrument.htt'); 278 Result := Proc.ExitCode;
229 Rewrite(OutFile); 279 end;
230 Write(OutFile, RenderInstruments(Song.Instruments.Duty));
231 CloseFile(OutFile);
232 280
233 AssignFile(OutFile, './hUGEDriver/wave_instrument.htt'); 281 function Fix(GBFile: string): integer;
234 Rewrite(OutFile); 282 begin
235 Write(OutFile, RenderInstruments(Song.Instruments.Wave)); 283 Proc.Executable := 'rgbfix';
236 CloseFile(OutFile); 284 Proc.Parameters.Clear;
285 Proc.Parameters.Add('-p0');
286 Proc.Parameters.Add('-v');
287 Proc.Parameters.Add(GBFile);
288 Proc.Execute;
237 289
238 AssignFile(OutFile, './hUGEDriver/noise_instrument.htt'); 290 Result := Proc.ExitCode;
239 Rewrite(OutFile); 291 end;
240 Write(OutFile, RenderInstruments(Song.Instruments.Noise)); 292
241 CloseFile(OutFile); 293 label
294 AssemblyError, Cleanup; // Eh, screw good practice. How bad can it be?
295 begin
296 FilePath := Filename;
297 Filename := ExtractFileNameWithoutExt(ExtractFileNameOnly(Filename));
242 298
299 WriteHTT('./hUGEDriver/constants.htt', RenderConstants(Song, Mode));
300 WriteHTT('./hUGEDriver/wave.htt', RenderWaveforms(Song.Waves));
301 WriteHTT('./hUGEDriver/order.htt', RenderOrderTable(Song.OrderMatrix));
302 WriteHTT('./hUGEDriver/duty_instrument.htt', RenderInstruments(Song.Instruments.Duty));
303 WriteHTT('./hUGEDriver/wave_instrument.htt', RenderInstruments(Song.Instruments.Wave));
304 WriteHTT('./hUGEDriver/noise_instrument.htt', RenderInstruments(Song.Instruments.Noise));
243 WriteRoutinesToFile(Song.Routines); 305 WriteRoutinesToFile(Song.Routines);
244 306
245 AssignFile(OutFile, './hUGEDriver/pattern.htt'); 307 AssignFile(OutFile, './hUGEDriver/pattern.htt');
@@ -247,88 +309,91 @@ begin
247 309
248 // TODO: Are keys and data defined to be aligned? Seems like they are but 310 // TODO: Are keys and data defined to be aligned? Seems like they are but
249 // should probably find out if that's just an implementation detail... 311 // should probably find out if that's just an implementation detail...
250 for I := 0 to Song.Patterns.Count-1 do 312 for I := 0 to Song.Patterns.Count - 1 do
251 Write(OutFile, RenderPattern('P'+IntToStr(Song.Patterns.Keys[I]), 313 Write(OutFile, RenderPattern('P' + IntToStr(Song.Patterns.Keys[I]),
252 Song.Patterns.Data[I]^)); 314 Song.Patterns.Data[I]^));
253 315
254 CloseFile(OutFile); 316 CloseFile(OutFile);
255 317
256 // Assemble the ROM 318 // Build the file
257 Chdir('hUGEDriver'); 319 Chdir('hUGEDriver');
258 320
259 OutSL := TStringList.Create; 321 OutSL := TStringList.Create;
260 Proc := TProcess.Create(nil); 322 Proc := TProcess.Create(nil);
261 Proc.Options := Proc.Options + [poWaitOnExit, poUsePipes, poStdErrToOutput, 323 Proc.Options := Proc.Options + [poWaitOnExit, poUsePipes, poStdErrToOutput,
262 poNoConsole]; 324 poNoConsole];
263 325
264 Proc.Executable := 'rgbasm'; 326 // Assemble
265 Proc.Parameters.Clear; 327
266 Proc.Parameters.add('-o'+Filename+'_driver.obj'); 328 // TODO: this is fugly, wish there was a ternary operator in this language...
267 Proc.Parameters.add('-DPREVIEW_MODE'); 329 if Mode = emPreview then begin
268 Proc.Parameters.add('driver.z80'); 330 if Assemble(Filename + '_driver.obj', 'driver.z80', ['PREVIEW_MODE']) <> 0 then
269 Proc.Execute; 331 goto AssemblyError;
270 if Proc.ExitCode <> 0 then goto AssemblyError; 332 end else begin
271 333 if Assemble(Filename + '_driver.obj', 'driver.z80', []) <> 0 then
272 Proc.Executable := 'rgbasm'; 334 goto AssemblyError;
273 Proc.Parameters.Clear; 335 end;
274 Proc.Parameters.add('-o'+Filename+'_song.obj'); 336
275 Proc.Parameters.add('song.z80'); 337 if Assemble(Filename + '_song.obj', 'song.z80', []) <> 0 then
276 Proc.Execute; 338 goto AssemblyError;
277 if Proc.ExitCode <> 0 then goto AssemblyError; 339
278 340 if Mode = emGBS then begin
279 Proc.Executable := 'rgbasm'; 341 if Assemble(Filename + '_gbs.obj', 'gbs.z80', []) <> 0 then
280 Proc.Parameters.Clear; 342 goto AssemblyError;
281 Proc.Parameters.add('-o'+Filename+'_player.obj'); 343 end
282 Proc.Parameters.add('player.z80'); 344 else begin
283 Proc.Execute; 345 if Assemble(Filename + '_player.obj', 'player.z80', []) <> 0 then
284 if Proc.ExitCode <> 0 then goto AssemblyError; 346 goto AssemblyError;
285 347 end;
286 Proc.Executable := 'rgblink'; 348
287 Proc.Parameters.Clear; 349 // Link
288 Proc.Parameters.add('-m'+Filename+'.map');
289 Proc.Parameters.add('-n'+Filename+'.sym');
290 if Mode = emGBS then 350 if Mode = emGBS then
291 Proc.Parameters.add('-o'+Filename+'.gbs') 351 begin
292 else 352 if Link(Filename+'.gbs', [Filename + '_driver.obj',
293 Proc.Parameters.add('-o'+Filename+'.gb'); 353 Filename + '_song.obj', Filename + '_gbs.obj']) <> 0 then
294 Proc.Parameters.add('-p0xDD'); 354 goto AssemblyError;
295 Proc.Parameters.add(Filename+'_driver.obj'); 355 end
296 Proc.Parameters.add(Filename+'_song.obj'); 356 else begin
297 Proc.Parameters.add(Filename+'_player.obj'); 357 if Link(Filename + '.gb', [Filename + '_driver.obj',
298 Proc.Execute; 358 Filename + '_song.obj', Filename + '_player.obj'], Filename + '.map',
299 if Proc.ExitCode <> 0 then goto AssemblyError; 359 Filename + '.sym') <> 0 then
300 360 goto AssemblyError;
301 if Mode <> emGBS then begin
302 Proc.Executable := 'rgbfix';
303 Proc.Parameters.Clear;
304 Proc.Parameters.add('-p0');
305 Proc.Parameters.add('-v');
306 Proc.Parameters.add(Filename+'.gb');
307 Proc.Execute;
308 if Proc.ExitCode <> 0 then goto AssemblyError;
309 end; 361 end;
310 362
311 if Mode <> emPreview then begin 363 // Fix
312 if FileExists(FilePath) then DeleteFile(FilePath); 364 if Mode = emGBS then
365 RectifyGBSFile(Filename+'.gbs')
366 else begin
367 if (Fix(Filename + '.gb') <> 0) then
368 goto AssemblyError;
369 end;
370
371 // Move to destination
372 if Mode <> emPreview then
373 begin
374 if FileExists(FilePath) then
375 DeleteFile(FilePath);
313 376
314 if not RenameFile(Filename+IfThen(Mode = emGBS, '.gbs', '.gb'), FilePath) then begin 377 if not RenameFile(Filename + IfThen(Mode = emGBS, '.gbs', '.gb'), FilePath) then
378 begin
315 MessageDlg('Error!', 379 MessageDlg('Error!',
316 'Couldn''t create file at '+FilePath+'. Make sure your path is correct!', 380 'Couldn''t create file at ' + FilePath +
317 mtError, 381 '. Make sure your path is correct!',
318 [mbOk], 382 mtError,
319 0); 383 [mbOK],
384 0);
320 Result := False; 385 Result := False;
321 goto Cleanup; 386 goto Cleanup;
322 end; 387 end;
323 {$ifdef DEVELOPMENT} 388 {$ifdef DEVELOPMENT}
324 RenameFile(Filename+'.obj', FilePath+'.obj'); 389 RenameFile(Filename + '.obj', FilePath + '.obj');
325 RenameFile(Filename+'.sym', FilePath+'.sym'); 390 RenameFile(Filename + '.sym', FilePath + '.sym');
326 RenameFile(Filename+'.map', FilePath+'.map'); 391 RenameFile(Filename + '.map', FilePath + '.map');
327 {$endif} 392 {$endif}
328 {$ifdef PRODUCTION} 393 {$ifdef PRODUCTION}
329 DeleteFile(Filename+'.obj'); 394 DeleteFile(Filename + '.obj');
330 DeleteFile(Filename+'.sym'); 395 DeleteFile(Filename + '.sym');
331 DeleteFile(Filename+'.map'); 396 DeleteFile(Filename + '.map');
332 {$endif} 397 {$endif}
333 end; 398 end;
334 399
@@ -336,38 +401,38 @@ begin
336 goto Cleanup; 401 goto Cleanup;
337 402
338 AssemblyError: 403 AssemblyError:
339 Result := False; 404 Result := False;
340 OutSL.LoadFromStream(Proc.Output); 405 OutSL.LoadFromStream(Proc.Output);
341 406
342 if OutSL.Text.Contains('routine') then 407 if OutSL.Text.Contains('routine') then
343 MessageDlg( 408 MessageDlg(
344 'Error!', 409 'Error!',
345 'There was an error assembling the song for playback.'+LineEnding+LineEnding+ 410 'There was an error assembling the song for playback.' + LineEnding + LineEnding +
346 Proc.Executable+' output:'+LineEnding+ 411 Proc.Executable + ' output:' + LineEnding + OutSL.Text,
347 OutSL.Text,
348 mtError, 412 mtError,
349 [mbOK], 413 [mbOK],
350 0) 414 0)
351 else begin 415 else
416 begin
352 MessageDlg( 417 MessageDlg(
353 'Error!', 418 'Error!',
354 'There was an error assembling the song for playback.'+LineEnding+LineEnding+ 419 'There was an error assembling the song for playback.' + LineEnding + LineEnding +
355 Proc.Executable+' output:'+LineEnding+ 420 Proc.Executable + ' output:' + LineEnding + OutSL.Text + LineEnding + LineEnding +
356 OutSL.Text+LineEnding+LineEnding+ 421 'Please report this issue on the hUGETracker GitHub issues page, and ' +
357 'Please report this issue on the hUGETracker GitHub issues page, and '+ 422 'post your song file!',
358 'post your song file!',
359 mtError, 423 mtError,
360 [mbOK], 424 [mbOK],
361 0); 425 0);
362 426
363 {$ifdef PRODUCTION}OpenURL('https://github.com/SuperDisk/hUGETracker/issues');{$endif} 427 {$ifdef PRODUCTION}
428 OpenURL('https://github.com/SuperDisk/hUGETracker/issues');
429 {$endif}
364 end; 430 end;
365 431
366 Cleanup: 432 Cleanup:
367 Proc.Free; 433 Proc.Free;
368 OutSL.Free; 434 OutSL.Free;
369 Chdir('..'); 435 Chdir('..');
370 end; 436 end;
371 437
372 end. 438 end.
373
Modifiedconstants.pas +4−0
@@ -38,6 +38,10 @@ const
38 SYM_TICKS_PER_ROW = 'ticks_per_row'; 38 SYM_TICKS_PER_ROW = 'ticks_per_row';
39 SYM_ORDER_COUNT = 'order_cnt'; 39 SYM_ORDER_COUNT = 'order_cnt';
40 40
41 SYM_HALT_NOTE = 'note';
42 SYM_HALT_INSTR = 'instr';
43 SYM_HALT_MACRO_INDEX = 'macro_index';
44
41 // Sound controller registers 45 // Sound controller registers
42 NR10 = $FF10; 46 NR10 = $FF10;
43 NR11 = $FF11; 47 NR11 = $FF11;
ModifiedhUGEDriver +1−1
@@ -1 +1 @@
1 Subproject commit aa31877d2be9be9ca842e3ec1f355b2cc9ea382d 1 Subproject commit 54fbcc1162a9cfbec60071d6ff61f6e3464eb2c7
Modifiedtracker.lfm +431−423
@@ -1,12 +1,13 @@
1 object frmTracker: TfrmTracker 1 object frmTracker: TfrmTracker
2 Left = 1394 2 Left = 474
3 Height = 806 3 Height = 1410
4 Top = 254 4 Top = 184
5 Width = 1270 5 Width = 2222
6 AllowDropFiles = True 6 AllowDropFiles = True
7 Caption = 'hUGETracker' 7 Caption = 'hUGETracker'
8 ClientHeight = 786 8 ClientHeight = 1376
9 ClientWidth = 1270 9 ClientWidth = 2222
10 DesignTimePPI = 168
10 KeyPreview = True 11 KeyPreview = True
11 Menu = MainMenu1 12 Menu = MainMenu1
12 OnCloseQuery = FormCloseQuery 13 OnCloseQuery = FormCloseQuery
@@ -20,9 +21,9 @@ object frmTracker: TfrmTracker
20 LCLVersion = '2.0.9.0' 21 LCLVersion = '2.0.9.0'
21 object TreeView1: TTreeView 22 object TreeView1: TTreeView
22 Left = 0 23 Left = 0
23 Height = 674 24 Height = 1180
24 Top = 89 25 Top = 153
25 Width = 193 26 Width = 338
26 Align = alLeft 27 Align = alLeft
27 ParentFont = False 28 ParentFont = False
28 ReadOnly = True 29 ReadOnly = True
@@ -40,27 +41,27 @@ object frmTracker: TfrmTracker
40 } 41 }
41 end 42 end
42 object Splitter1: TSplitter 43 object Splitter1: TSplitter
43 Left = 193 44 Left = 338
44 Height = 674 45 Height = 1180
45 Top = 89 46 Top = 153
46 Width = 5 47 Width = 9
47 end 48 end
48 object Panel1: TPanel 49 object Panel1: TPanel
49 Left = 198 50 Left = 347
50 Height = 674 51 Height = 1180
51 Top = 89 52 Top = 153
52 Width = 1072 53 Width = 1875
53 Align = alClient 54 Align = alClient
54 BevelOuter = bvNone 55 BevelOuter = bvNone
55 ClientHeight = 674 56 ClientHeight = 1180
56 ClientWidth = 1072 57 ClientWidth = 1875
57 ParentFont = False 58 ParentFont = False
58 TabOrder = 2 59 TabOrder = 2
59 object PageControl1: TPageControl 60 object PageControl1: TPageControl
60 Left = 0 61 Left = 0
61 Height = 674 62 Height = 1180
62 Top = 0 63 Top = 0
63 Width = 1072 64 Width = 1875
64 ActivePage = InstrumentTabSheet 65 ActivePage = InstrumentTabSheet
65 Align = alClient 66 Align = alClient
66 ParentFont = False 67 ParentFont = False
@@ -72,68 +73,68 @@ object frmTracker: TfrmTracker
72 ClientWidth = 1064 73 ClientWidth = 1064
73 ParentFont = False 74 ParentFont = False
74 object SongInformationGroupbox: TGroupBox 75 object SongInformationGroupbox: TGroupBox
75 Left = 8 76 Left = 14
76 Height = 136 77 Height = 238
77 Top = 8 78 Top = 14
78 Width = 305 79 Width = 534
79 Caption = 'Song information' 80 Caption = 'Song information'
80 ClientHeight = 116 81 ClientHeight = 203
81 ClientWidth = 301 82 ClientWidth = 530
82 ParentFont = False 83 ParentFont = False
83 TabOrder = 0 84 TabOrder = 0
84 object Label15: TLabel 85 object Label15: TLabel
85 Left = 8 86 Left = 14
86 Height = 15 87 Height = 15
87 Top = 16 88 Top = 28
88 Width = 27 89 Width = 27
89 Caption = 'Song' 90 Caption = 'Song'
90 ParentColor = False 91 ParentColor = False
91 ParentFont = False 92 ParentFont = False
92 end 93 end
93 object Label16: TLabel 94 object Label16: TLabel
94 Left = 7 95 Left = 12
95 Height = 15 96 Height = 15
96 Top = 48 97 Top = 84
97 Width = 28 98 Width = 28
98 Caption = 'Artist' 99 Caption = 'Artist'
99 ParentColor = False 100 ParentColor = False
100 ParentFont = False 101 ParentFont = False
101 end 102 end
102 object SongEdit: TEdit 103 object SongEdit: TEdit
103 Left = 56 104 Left = 98
104 Height = 23 105 Height = 23
105 Hint = 'The name of your composition' 106 Hint = 'The name of your composition'
106 Top = 8 107 Top = 14
107 Width = 216 108 Width = 378
108 OnChange = SongEditChange 109 OnChange = SongEditChange
109 ParentFont = False 110 ParentFont = False
110 TabOrder = 0 111 TabOrder = 0
111 end 112 end
112 object ArtistEdit: TEdit 113 object ArtistEdit: TEdit
113 Left = 56 114 Left = 98
114 Height = 23 115 Height = 23
115 Hint = 'Your name or handle' 116 Hint = 'Your name or handle'
116 Top = 40 117 Top = 70
117 Width = 216 118 Width = 378
118 OnChange = ArtistEditChange 119 OnChange = ArtistEditChange
119 ParentFont = False 120 ParentFont = False
120 TabOrder = 1 121 TabOrder = 1
121 end 122 end
122 object Label21: TLabel 123 object Label21: TLabel
123 Left = 8 124 Left = 14
124 Height = 15 125 Height = 15
125 Top = 78 126 Top = 136
126 Width = 114 127 Width = 114
127 Caption = 'Tempo (ticks per row)' 128 Caption = 'Tempo (ticks per row)'
128 ParentColor = False 129 ParentColor = False
129 ParentFont = False 130 ParentFont = False
130 end 131 end
131 object TicksPerRowSpinEdit: TSpinEdit 132 object TicksPerRowSpinEdit: TSpinEdit
132 Left = 133 133 Left = 233
133 Height = 23 134 Height = 23
134 Hint = 'How many ticks should happen before the row changes. Higher means slower' 135 Hint = 'How many ticks should happen before the row changes. Higher means slower'
135 Top = 73 136 Top = 128
136 Width = 50 137 Width = 88
137 MaxValue = 20 138 MaxValue = 20
138 MinValue = 1 139 MinValue = 1
139 OnChange = TicksPerRowSpinEditChange 140 OnChange = TicksPerRowSpinEditChange
@@ -160,7 +161,7 @@ object frmTracker: TfrmTracker
160 TabOrder = 0 161 TabOrder = 0
161 object HeaderControl1: THeaderControl 162 object HeaderControl1: THeaderControl
162 Left = 1 163 Left = 1
163 Height = 30 164 Height = 52
164 Hint = 'Left click to mute, right click to solo' 165 Hint = 'Left click to mute, right click to solo'
165 Top = 1 166 Top = 1
166 Width = 838 167 Width = 838
@@ -169,35 +170,35 @@ object frmTracker: TfrmTracker
169 Sections = < 170 Sections = <
170 item 171 item
171 Alignment = taLeftJustify 172 Alignment = taLeftJustify
172 Width = 32 173 Width = 56
173 Visible = True 174 Visible = True
174 end 175 end
175 item 176 item
176 Alignment = taCenter 177 Alignment = taCenter
177 ImageIndex = 1 178 ImageIndex = 1
178 Text = 'Duty 1' 179 Text = 'Duty 1'
179 Width = 133 180 Width = 233
180 Visible = True 181 Visible = True
181 end 182 end
182 item 183 item
183 Alignment = taCenter 184 Alignment = taCenter
184 ImageIndex = 1 185 ImageIndex = 1
185 Text = 'Duty 2' 186 Text = 'Duty 2'
186 Width = 133 187 Width = 233
187 Visible = True 188 Visible = True
188 end 189 end
189 item 190 item
190 Alignment = taCenter 191 Alignment = taCenter
191 ImageIndex = 1 192 ImageIndex = 1
192 Text = 'Wave' 193 Text = 'Wave'
193 Width = 133 194 Width = 233
194 Visible = True 195 Visible = True
195 end 196 end
196 item 197 item
197 Alignment = taCenter 198 Alignment = taCenter
198 ImageIndex = 1 199 ImageIndex = 1
199 Text = 'Noise' 200 Text = 'Noise'
200 Width = 133 201 Width = 233
201 Visible = True 202 Visible = True
202 end> 203 end>
203 OnSectionClick = HeaderControl1SectionClick 204 OnSectionClick = HeaderControl1SectionClick
@@ -231,12 +232,13 @@ object frmTracker: TfrmTracker
231 Left = 0 232 Left = 0
232 Height = 614 233 Height = 614
233 Top = 0 234 Top = 0
234 Width = 32 235 Width = 56
235 Align = alLeft 236 Align = alLeft
236 BorderStyle = bsNone 237 BorderStyle = bsNone
237 ColCount = 1 238 ColCount = 1
238 DefaultColWidth = 32 239 DefaultColWidth = 56
239 Enabled = False 240 Enabled = False
241 ParentFont = False
240 RowCount = 64 242 RowCount = 64
241 ScrollBars = ssNone 243 ScrollBars = ssNone
242 TabOrder = 0 244 TabOrder = 0
@@ -247,41 +249,41 @@ object frmTracker: TfrmTracker
247 Left = 0 249 Left = 0
248 Height = 646 250 Height = 646
249 Top = 0 251 Top = 0
250 Width = 224 252 Width = 392
251 Align = alLeft 253 Align = alLeft
252 AutoEdit = False 254 AutoEdit = False
253 AutoFillColumns = True 255 AutoFillColumns = True
254 Columns = < 256 Columns = <
255 item 257 item
256 Alignment = taCenter 258 Alignment = taCenter
257 MinSize = 33 259 MinSize = 58
258 MaxSize = 33 260 MaxSize = 58
259 Title.Caption = 'Dty1' 261 Title.Caption = 'Dty1'
260 Width = 34 262 Width = 61
261 end 263 end
262 item 264 item
263 Alignment = taCenter 265 Alignment = taCenter
264 MinSize = 33 266 MinSize = 58
265 MaxSize = 33 267 MaxSize = 58
266 Title.Caption = 'Dty2' 268 Title.Caption = 'Dty2'
267 Width = 34 269 Width = 61
268 end 270 end
269 item 271 item
270 Alignment = taCenter 272 Alignment = taCenter
271 MinSize = 33 273 MinSize = 58
272 MaxSize = 33 274 MaxSize = 58
273 Title.Caption = 'Wav' 275 Title.Caption = 'Wav'
274 Width = 34 276 Width = 61
275 end 277 end
276 item 278 item
277 Alignment = taCenter 279 Alignment = taCenter
278 MinSize = 33 280 MinSize = 58
279 MaxSize = 33 281 MaxSize = 58
280 Title.Caption = 'Nse' 282 Title.Caption = 'Nse'
281 Width = 37 283 Width = 63
282 end> 284 end>
283 DefaultColWidth = 17 285 DefaultColWidth = 30
284 DefaultRowHeight = 21 286 DefaultRowHeight = 37
285 ExtendedSelect = False 287 ExtendedSelect = False
286 Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goRangeSelect, goRowMoving, goEditing, goTabs, goSmoothScroll, goFixedRowNumbering, goRowHighlight] 288 Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goRangeSelect, goRowMoving, goEditing, goTabs, goSmoothScroll, goFixedRowNumbering, goRowHighlight]
287 ParentFont = False 289 ParentFont = False
@@ -301,28 +303,28 @@ object frmTracker: TfrmTracker
301 OnKeyDown = OrderEditStringGridKeyDown 303 OnKeyDown = OrderEditStringGridKeyDown
302 OnValidateEntry = OrderEditStringGridValidateEntry 304 OnValidateEntry = OrderEditStringGridValidateEntry
303 ColWidths = ( 305 ColWidths = (
304 64 306 112
305 34 307 61
306 34 308 61
307 34 309 61
308 37 310 63
309 ) 311 )
310 end 312 end
311 end 313 end
312 object InstrumentTabSheet: TTabSheet 314 object InstrumentTabSheet: TTabSheet
313 Caption = 'Instruments' 315 Caption = 'Instruments'
314 ClientHeight = 646 316 ClientHeight = 1137
315 ClientWidth = 1064 317 ClientWidth = 1867
316 ParentFont = False 318 ParentFont = False
317 object PaintBox1: TPaintBox 319 object PaintBox1: TPaintBox
318 AnchorSideTop.Control = FlowPanel1 320 AnchorSideTop.Control = FlowPanel1
319 AnchorSideTop.Side = asrBottom 321 AnchorSideTop.Side = asrBottom
320 AnchorSideBottom.Side = asrBottom 322 AnchorSideBottom.Side = asrBottom
321 Left = 0 323 Left = 0
322 Height = 154 324 Height = 277
323 Hint = 'Preview of how the resulting waveform will look with envelope applied' 325 Hint = 'Preview of how the resulting waveform will look with envelope applied'
324 Top = 492 326 Top = 860
325 Width = 1064 327 Width = 1867
326 Align = alClient 328 Align = alClient
327 Color = clBlack 329 Color = clBlack
328 ParentColor = False 330 ParentColor = False
@@ -332,9 +334,9 @@ object frmTracker: TfrmTracker
332 end 334 end
333 object FlowPanel1: TFlowPanel 335 object FlowPanel1: TFlowPanel
334 Left = 0 336 Left = 0
335 Height = 492 337 Height = 860
336 Top = 0 338 Top = 0
337 Width = 1064 339 Width = 1867
338 Align = alTop 340 Align = alTop
339 AutoSize = True 341 AutoSize = True
340 BevelOuter = bvNone 342 BevelOuter = bvNone
@@ -369,26 +371,26 @@ object frmTracker: TfrmTracker
369 ParentFont = False 371 ParentFont = False
370 TabOrder = 0 372 TabOrder = 0
371 object InstrumentGroupBox: TGroupBox 373 object InstrumentGroupBox: TGroupBox
372 Left = 7 374 Left = 12
373 Height = 241 375 Height = 422
374 Top = 7 376 Top = 12
375 Width = 271 377 Width = 474
376 Anchors = [] 378 Anchors = []
377 BorderSpacing.Left = 7 379 BorderSpacing.Left = 12
378 BorderSpacing.Top = 7 380 BorderSpacing.Top = 12
379 BorderSpacing.Right = 7 381 BorderSpacing.Right = 12
380 BorderSpacing.Bottom = 7 382 BorderSpacing.Bottom = 12
381 Caption = 'Instrument' 383 Caption = 'Instrument'
382 ClientHeight = 221 384 ClientHeight = 387
383 ClientWidth = 267 385 ClientWidth = 470
384 ParentFont = False 386 ParentFont = False
385 TabOrder = 0 387 TabOrder = 0
386 object InstrumentNumberSpinner: TSpinEdit 388 object InstrumentNumberSpinner: TSpinEdit
387 Left = 80 389 Left = 140
388 Height = 23 390 Height = 38
389 Hint = 'What instrument to edit' 391 Hint = 'What instrument to edit'
390 Top = 38 392 Top = 66
391 Width = 176 393 Width = 308
392 MaxValue = 15 394 MaxValue = 15
393 MinValue = 1 395 MinValue = 1
394 OnChange = InstrumentNumberSpinnerChange 396 OnChange = InstrumentNumberSpinnerChange
@@ -397,50 +399,50 @@ object frmTracker: TfrmTracker
397 Value = 1 399 Value = 1
398 end 400 end
399 object Label1: TLabel 401 object Label1: TLabel
400 Left = 8 402 Left = 14
401 Height = 15 403 Height = 30
402 Top = 46 404 Top = 80
403 Width = 58 405 Width = 101
404 Caption = 'Instrument' 406 Caption = 'Instrument'
405 ParentColor = False 407 ParentColor = False
406 ParentFont = False 408 ParentFont = False
407 end 409 end
408 object Label2: TLabel 410 object Label2: TLabel
409 Left = 8 411 Left = 14
410 Height = 15 412 Height = 30
411 Top = 78 413 Top = 136
412 Width = 32 414 Width = 56
413 Caption = 'Name' 415 Caption = 'Name'
414 ParentColor = False 416 ParentColor = False
415 ParentFont = False 417 ParentFont = False
416 end 418 end
417 object InstrumentNameEdit: TEdit 419 object InstrumentNameEdit: TEdit
418 Left = 80 420 Left = 140
419 Height = 23 421 Height = 38
420 Hint = 'The name of the instrument' 422 Hint = 'The name of the instrument'
421 Top = 70 423 Top = 122
422 Width = 176 424 Width = 308
423 OnChange = InstrumentNameEditChange 425 OnChange = InstrumentNameEditChange
424 ParentFont = False 426 ParentFont = False
425 TabOrder = 1 427 TabOrder = 1
426 end 428 end
427 object Label3: TLabel 429 object Label3: TLabel
428 Left = 8 430 Left = 14
429 Height = 15 431 Height = 30
430 Top = 16 432 Top = 28
431 Width = 44 433 Width = 80
432 Caption = 'Channel' 434 Caption = 'Channel'
433 Font.Style = [fsBold] 435 Font.Style = [fsBold]
434 ParentColor = False 436 ParentColor = False
435 ParentFont = False 437 ParentFont = False
436 end 438 end
437 object InstrumentTypeCombobox: TComboBox 439 object InstrumentTypeCombobox: TComboBox
438 Left = 78 440 Left = 136
439 Height = 23 441 Height = 38
440 Hint = 'What type of channel this instrument will be played on' 442 Hint = 'What type of channel this instrument will be played on'
441 Top = 8 443 Top = 14
442 Width = 178 444 Width = 312
443 ItemHeight = 15 445 ItemHeight = 30
444 ItemIndex = 0 446 ItemIndex = 0
445 Items.Strings = ( 447 Items.Strings = (
446 'Square' 448 'Square'
@@ -454,52 +456,52 @@ object frmTracker: TfrmTracker
454 Text = 'Square' 456 Text = 'Square'
455 end 457 end
456 object LengthEnabledCheckbox: TCheckBox 458 object LengthEnabledCheckbox: TCheckBox
457 Left = 12 459 Left = 21
458 Height = 19 460 Height = 34
459 Hint = 'Cut the sound after a certain length of time' 461 Hint = 'Cut the sound after a certain length of time'
460 Top = 118 462 Top = 206
461 Width = 57 463 Width = 98
462 Caption = 'Length' 464 Caption = 'Length'
463 OnChange = LengthEnabledCheckboxChange 465 OnChange = LengthEnabledCheckboxChange
464 ParentFont = False 466 ParentFont = False
465 TabOrder = 3 467 TabOrder = 3
466 end 468 end
467 object InstrumentImportButton: TButton 469 object InstrumentImportButton: TButton
468 Left = 12 470 Left = 21
469 Height = 25 471 Height = 44
470 Top = 184 472 Top = 322
471 Width = 116 473 Width = 203
472 Caption = 'Import' 474 Caption = 'Import'
473 OnClick = InstrumentImportButtonClick 475 OnClick = InstrumentImportButtonClick
474 ParentFont = False 476 ParentFont = False
475 TabOrder = 4 477 TabOrder = 4
476 end 478 end
477 object InstrumentExportButton: TButton 479 object InstrumentExportButton: TButton
478 Left = 138 480 Left = 242
479 Height = 25 481 Height = 44
480 Top = 184 482 Top = 322
481 Width = 116 483 Width = 203
482 Caption = 'Export' 484 Caption = 'Export'
483 OnClick = InstrumentExportButtonClick 485 OnClick = InstrumentExportButtonClick
484 ParentFont = False 486 ParentFont = False
485 TabOrder = 5 487 TabOrder = 5
486 end 488 end
487 object Button1: TButton 489 object Button1: TButton
488 Left = 12 490 Left = 21
489 Height = 25 491 Height = 44
490 Hint = 'Test out the instrument with a C-5 note' 492 Hint = 'Test out the instrument with a C-5 note'
491 Top = 152 493 Top = 266
492 Width = 242 494 Width = 424
493 Caption = 'Test C-5' 495 Caption = 'Test C-5'
494 OnClick = Button1Click 496 OnClick = Button1Click
495 ParentFont = False 497 ParentFont = False
496 TabOrder = 6 498 TabOrder = 6
497 end 499 end
498 object LengthTrackbar: TTrackBar 500 object LengthTrackbar: TTrackBar
499 Left = 76 501 Left = 133
500 Height = 25 502 Height = 44
501 Top = 112 503 Top = 196
502 Width = 178 504 Width = 312
503 Max = 63 505 Max = 63
504 OnChange = LengthSpinnerChange 506 OnChange = LengthSpinnerChange
505 Position = 0 507 Position = 0
@@ -509,45 +511,45 @@ object frmTracker: TfrmTracker
509 end 511 end
510 end 512 end
511 object EnvelopeGroupBox: TGroupBox 513 object EnvelopeGroupBox: TGroupBox
512 Left = 292 514 Left = 510
513 Height = 136 515 Height = 238
514 Top = 7 516 Top = 12
515 Width = 582 517 Width = 1018
516 Anchors = [] 518 Anchors = []
517 BorderSpacing.Left = 7 519 BorderSpacing.Left = 12
518 BorderSpacing.Top = 7 520 BorderSpacing.Top = 12
519 BorderSpacing.Right = 7 521 BorderSpacing.Right = 12
520 BorderSpacing.Bottom = 7 522 BorderSpacing.Bottom = 12
521 Caption = 'Envelope' 523 Caption = 'Envelope'
522 ClientHeight = 116 524 ClientHeight = 203
523 ClientWidth = 578 525 ClientWidth = 1014
524 ParentFont = False 526 ParentFont = False
525 TabOrder = 1 527 TabOrder = 1
526 object Label4: TLabel 528 object Label4: TLabel
527 Left = 8 529 Left = 14
528 Height = 15 530 Height = 30
529 Top = 9 531 Top = 16
530 Width = 46 532 Width = 80
531 Caption = 'Start vol.' 533 Caption = 'Start vol.'
532 ParentColor = False 534 ParentColor = False
533 ParentFont = False 535 ParentFont = False
534 end 536 end
535 object Label5: TLabel 537 object Label5: TLabel
536 Left = 8 538 Left = 14
537 Height = 15 539 Height = 30
538 Top = 48 540 Top = 84
539 Width = 48 541 Width = 84
540 Caption = 'Direction' 542 Caption = 'Direction'
541 ParentColor = False 543 ParentColor = False
542 ParentFont = False 544 ParentFont = False
543 end 545 end
544 object DirectionComboBox: TComboBox 546 object DirectionComboBox: TComboBox
545 Left = 82 547 Left = 144
546 Height = 23 548 Height = 38
547 Hint = 'Whether to fade the sound in or out' 549 Hint = 'Whether to fade the sound in or out'
548 Top = 46 550 Top = 80
549 Width = 198 551 Width = 346
550 ItemHeight = 15 552 ItemHeight = 30
551 ItemIndex = 1 553 ItemIndex = 1
552 Items.Strings = ( 554 Items.Strings = (
553 'Up' 555 'Up'
@@ -560,40 +562,40 @@ object frmTracker: TfrmTracker
560 Text = 'Down' 562 Text = 'Down'
561 end 563 end
562 object Label6: TLabel 564 object Label6: TLabel
563 Left = 8 565 Left = 14
564 Height = 15 566 Height = 30
565 Top = 86 567 Top = 150
566 Width = 41 568 Width = 71
567 Caption = 'Change' 569 Caption = 'Change'
568 ParentColor = False 570 ParentColor = False
569 ParentFont = False 571 ParentFont = False
570 end 572 end
571 object Panel5: TPanel 573 object Panel5: TPanel
572 Left = 300 574 Left = 525
573 Height = 104 575 Height = 182
574 Top = 0 576 Top = 0
575 Width = 270 577 Width = 472
576 BevelOuter = bvLowered 578 BevelOuter = bvLowered
577 ClientHeight = 104 579 ClientHeight = 182
578 ClientWidth = 270 580 ClientWidth = 472
579 ParentFont = False 581 ParentFont = False
580 TabOrder = 1 582 TabOrder = 1
581 object EnvelopePaintbox: TPaintBox 583 object EnvelopePaintbox: TPaintBox
582 Left = 1 584 Left = 1
583 Height = 102 585 Height = 180
584 Hint = 'Preview of the volume envelope' 586 Hint = 'Preview of the volume envelope'
585 Top = 1 587 Top = 1
586 Width = 268 588 Width = 470
587 Align = alClient 589 Align = alClient
588 ParentFont = False 590 ParentFont = False
589 OnPaint = EnvelopePaintboxPaint 591 OnPaint = EnvelopePaintboxPaint
590 end 592 end
591 end 593 end
592 object StartVolTrackbar: TTrackBar 594 object StartVolTrackbar: TTrackBar
593 Left = 82 595 Left = 144
594 Height = 25 596 Height = 44
595 Top = 8 597 Top = 14
596 Width = 196 598 Width = 343
597 Max = 15 599 Max = 15
598 OnChange = StartVolSpinnerChange 600 OnChange = StartVolSpinnerChange
599 Position = 0 601 Position = 0
@@ -601,10 +603,10 @@ object frmTracker: TfrmTracker
601 TabOrder = 2 603 TabOrder = 2
602 end 604 end
603 object EnvChangeTrackbar: TTrackBar 605 object EnvChangeTrackbar: TTrackBar
604 Left = 82 606 Left = 144
605 Height = 25 607 Height = 44
606 Top = 82 608 Top = 144
607 Width = 196 609 Width = 343
608 Max = 7 610 Max = 7
609 OnChange = EnvChangeSpinnerChange 611 OnChange = EnvChangeSpinnerChange
610 Position = 0 612 Position = 0
@@ -613,36 +615,36 @@ object frmTracker: TfrmTracker
613 end 615 end
614 end 616 end
615 object SquareGroupBox: TGroupBox 617 object SquareGroupBox: TGroupBox
616 Left = 7 618 Left = 12
617 Height = 169 619 Height = 296
618 Top = 262 620 Top = 458
619 Width = 319 621 Width = 558
620 Anchors = [] 622 Anchors = []
621 BorderSpacing.Left = 7 623 BorderSpacing.Left = 12
622 BorderSpacing.Top = 7 624 BorderSpacing.Top = 12
623 BorderSpacing.Right = 7 625 BorderSpacing.Right = 12
624 BorderSpacing.Bottom = 7 626 BorderSpacing.Bottom = 12
625 Caption = 'Square' 627 Caption = 'Square'
626 ClientHeight = 149 628 ClientHeight = 261
627 ClientWidth = 315 629 ClientWidth = 554
628 ParentFont = False 630 ParentFont = False
629 TabOrder = 2 631 TabOrder = 2
630 object Label7: TLabel 632 object Label7: TLabel
631 Left = 8 633 Left = 14
632 Height = 15 634 Height = 30
633 Top = 16 635 Top = 28
634 Width = 61 636 Width = 107
635 Caption = 'Sweep time' 637 Caption = 'Sweep time'
636 ParentColor = False 638 ParentColor = False
637 ParentFont = False 639 ParentFont = False
638 end 640 end
639 object SweepTimeCombobox: TComboBox 641 object SweepTimeCombobox: TComboBox
640 Left = 104 642 Left = 182
641 Height = 23 643 Height = 38
642 Hint = 'How long to sweep' 644 Hint = 'How long to sweep'
643 Top = 8 645 Top = 14
644 Width = 200 646 Width = 350
645 ItemHeight = 15 647 ItemHeight = 30
646 ItemIndex = 0 648 ItemIndex = 0
647 Items.Strings = ( 649 Items.Strings = (
648 'Off - no frequency change' 650 'Off - no frequency change'
@@ -663,12 +665,12 @@ object frmTracker: TfrmTracker
663 Text = 'Off - no frequency change' 665 Text = 'Off - no frequency change'
664 end 666 end
665 object SweepDirectionCombobox: TComboBox 667 object SweepDirectionCombobox: TComboBox
666 Left = 104 668 Left = 182
667 Height = 23 669 Height = 38
668 Hint = 'The direction of the sweep' 670 Hint = 'The direction of the sweep'
669 Top = 40 671 Top = 70
670 Width = 200 672 Width = 350
671 ItemHeight = 15 673 ItemHeight = 30
672 ItemIndex = 1 674 ItemIndex = 1
673 Items.Strings = ( 675 Items.Strings = (
674 'Up' 676 'Up'
@@ -683,39 +685,39 @@ object frmTracker: TfrmTracker
683 Text = 'Down' 685 Text = 'Down'
684 end 686 end
685 object Label8: TLabel 687 object Label8: TLabel
686 Left = 8 688 Left = 14
687 Height = 15 689 Height = 30
688 Top = 48 690 Top = 84
689 Width = 84 691 Width = 147
690 Caption = 'Sweep direction' 692 Caption = 'Sweep direction'
691 ParentColor = False 693 ParentColor = False
692 ParentFont = False 694 ParentFont = False
693 end 695 end
694 object Label9: TLabel 696 object Label9: TLabel
695 Left = 8 697 Left = 14
696 Height = 15 698 Height = 30
697 Top = 84 699 Top = 147
698 Width = 56 700 Width = 101
699 Caption = 'Sweep size' 701 Caption = 'Sweep size'
700 ParentColor = False 702 ParentColor = False
701 ParentFont = False 703 ParentFont = False
702 end 704 end
703 object Label10: TLabel 705 object Label10: TLabel
704 Left = 8 706 Left = 14
705 Height = 15 707 Height = 30
706 Top = 120 708 Top = 210
707 Width = 25 709 Width = 44
708 Caption = 'Duty' 710 Caption = 'Duty'
709 ParentColor = False 711 ParentColor = False
710 ParentFont = False 712 ParentFont = False
711 end 713 end
712 object DutyCombobox: TComboBox 714 object DutyCombobox: TComboBox
713 Left = 104 715 Left = 182
714 Height = 23 716 Height = 38
715 Hint = 'Which duty cycle to use (changes timbre of wave)' 717 Hint = 'Which duty cycle to use (changes timbre of wave)'
716 Top = 112 718 Top = 196
717 Width = 200 719 Width = 350
718 ItemHeight = 15 720 ItemHeight = 30
719 ItemIndex = 2 721 ItemIndex = 2
720 Items.Strings = ( 722 Items.Strings = (
721 '12.5%' 723 '12.5%'
@@ -732,10 +734,10 @@ object frmTracker: TfrmTracker
732 Text = '50% (square)' 734 Text = '50% (square)'
733 end 735 end
734 object SweepSizeTrackbar: TTrackBar 736 object SweepSizeTrackbar: TTrackBar
735 Left = 105 737 Left = 184
736 Height = 25 738 Height = 44
737 Top = 80 739 Top = 140
738 Width = 196 740 Width = 343
739 Max = 7 741 Max = 7
740 OnChange = SweepSizeSpinnerChange 742 OnChange = SweepSizeSpinnerChange
741 Position = 0 743 Position = 0
@@ -744,45 +746,45 @@ object frmTracker: TfrmTracker
744 end 746 end
745 end 747 end
746 object WaveGroupBox: TGroupBox 748 object WaveGroupBox: TGroupBox
747 Left = 340 749 Left = 594
748 Height = 169 750 Height = 296
749 Top = 262 751 Top = 458
750 Width = 297 752 Width = 520
751 Anchors = [] 753 Anchors = []
752 BorderSpacing.Left = 7 754 BorderSpacing.Left = 12
753 BorderSpacing.Top = 7 755 BorderSpacing.Top = 12
754 BorderSpacing.Right = 7 756 BorderSpacing.Right = 12
755 BorderSpacing.Bottom = 7 757 BorderSpacing.Bottom = 12
756 Caption = 'Wave' 758 Caption = 'Wave'
757 ClientHeight = 149 759 ClientHeight = 261
758 ClientWidth = 293 760 ClientWidth = 516
759 ParentFont = False 761 ParentFont = False
760 TabOrder = 3 762 TabOrder = 3
761 object Label11: TLabel 763 object Label11: TLabel
762 Left = 8 764 Left = 14
763 Height = 15 765 Height = 30
764 Top = 16 766 Top = 28
765 Width = 40 767 Width = 70
766 Caption = 'Volume' 768 Caption = 'Volume'
767 ParentColor = False 769 ParentColor = False
768 ParentFont = False 770 ParentFont = False
769 end 771 end
770 object Label12: TLabel 772 object Label12: TLabel
771 Left = 8 773 Left = 14
772 Height = 15 774 Height = 30
773 Top = 48 775 Top = 84
774 Width = 55 776 Width = 95
775 Caption = 'Waveform' 777 Caption = 'Waveform'
776 ParentColor = False 778 ParentColor = False
777 ParentFont = False 779 ParentFont = False
778 end 780 end
779 object WaveformCombobox: TComboBox 781 object WaveformCombobox: TComboBox
780 Left = 104 782 Left = 182
781 Height = 23 783 Height = 38
782 Hint = 'Which waveform is associated with this instrument' 784 Hint = 'Which waveform is associated with this instrument'
783 Top = 40 785 Top = 70
784 Width = 176 786 Width = 308
785 ItemHeight = 15 787 ItemHeight = 30
786 ItemIndex = 0 788 ItemIndex = 0
787 Items.Strings = ( 789 Items.Strings = (
788 'Wave #0' 790 'Wave #0'
@@ -809,21 +811,21 @@ object frmTracker: TfrmTracker
809 Text = 'Wave #0' 811 Text = 'Wave #0'
810 end 812 end
811 object Panel4: TPanel 813 object Panel4: TPanel
812 Left = 8 814 Left = 14
813 Height = 59 815 Height = 103
814 Top = 80 816 Top = 140
815 Width = 272 817 Width = 476
816 BevelOuter = bvLowered 818 BevelOuter = bvLowered
817 ClientHeight = 59 819 ClientHeight = 103
818 ClientWidth = 272 820 ClientWidth = 476
819 ParentFont = False 821 ParentFont = False
820 TabOrder = 1 822 TabOrder = 1
821 object WavePaintbox: TPaintBox 823 object WavePaintbox: TPaintBox
822 Left = 1 824 Left = 1
823 Height = 57 825 Height = 101
824 Hint = 'Preview of the waveform associated with this instrument' 826 Hint = 'Preview of the waveform associated with this instrument'
825 Top = 1 827 Top = 1
826 Width = 270 828 Width = 474
827 Align = alClient 829 Align = alClient
828 Color = clBlack 830 Color = clBlack
829 ParentColor = False 831 ParentColor = False
@@ -832,12 +834,12 @@ object frmTracker: TfrmTracker
832 end 834 end
833 end 835 end
834 object WaveVolumeCombobox: TComboBox 836 object WaveVolumeCombobox: TComboBox
835 Left = 104 837 Left = 182
836 Height = 23 838 Height = 38
837 Hint = 'The initial volume of the wave' 839 Hint = 'The initial volume of the wave'
838 Top = 8 840 Top = 14
839 Width = 176 841 Width = 308
840 ItemHeight = 15 842 ItemHeight = 30
841 ItemIndex = 1 843 ItemIndex = 1
842 Items.Strings = ( 844 Items.Strings = (
843 'Mute (No sound)' 845 'Mute (No sound)'
@@ -853,26 +855,26 @@ object frmTracker: TfrmTracker
853 end 855 end
854 end 856 end
855 object NoiseGroupBox: TGroupBox 857 object NoiseGroupBox: TGroupBox
856 Left = 651 858 Left = 1138
857 Height = 223 859 Height = 390
858 Top = 262 860 Top = 458
859 Width = 397 861 Width = 695
860 Anchors = [] 862 Anchors = []
861 BorderSpacing.Left = 7 863 BorderSpacing.Left = 12
862 BorderSpacing.Top = 7 864 BorderSpacing.Top = 12
863 BorderSpacing.Right = 7 865 BorderSpacing.Right = 12
864 BorderSpacing.Bottom = 7 866 BorderSpacing.Bottom = 12
865 Caption = 'Noise' 867 Caption = 'Noise'
866 ClientHeight = 203 868 ClientHeight = 355
867 ClientWidth = 393 869 ClientWidth = 691
868 ParentFont = False 870 ParentFont = False
869 TabOrder = 4 871 TabOrder = 4
870 object SevenBitCounterCheckbox: TCheckBox 872 object SevenBitCounterCheckbox: TCheckBox
871 Left = 8 873 Left = 14
872 Height = 19 874 Height = 34
873 Hint = 'Select LFSR width. When checked, output will sound like a tone rather than noise' 875 Hint = 'Select LFSR width. When checked, output will sound like a tone rather than noise'
874 Top = 8 876 Top = 14
875 Width = 215 877 Width = 373
876 Alignment = taLeftJustify 878 Alignment = taLeftJustify
877 Caption = '7 bit counter (more tone-like output)' 879 Caption = '7 bit counter (more tone-like output)'
878 OnChange = SevenBitCounterCheckboxChange 880 OnChange = SevenBitCounterCheckboxChange
@@ -880,20 +882,22 @@ object frmTracker: TfrmTracker
880 TabOrder = 0 882 TabOrder = 0
881 end 883 end
882 object Panel6: TPanel 884 object Panel6: TPanel
883 Left = 8 885 Left = 14
884 Height = 152 886 Height = 266
885 Top = 40 887 Top = 70
886 Width = 376 888 Width = 658
887 BevelOuter = bvLowered 889 BevelOuter = bvLowered
888 ClientHeight = 152 890 ClientHeight = 266
889 ClientWidth = 376 891 ClientWidth = 658
892 ParentFont = False
890 TabOrder = 1 893 TabOrder = 1
891 object NoiseMacroPaintbox: TPaintBox 894 object NoiseMacroPaintbox: TPaintBox
892 Left = 1 895 Left = 1
893 Height = 150 896 Height = 264
894 Top = 1 897 Top = 1
895 Width = 374 898 Width = 656
896 Align = alClient 899 Align = alClient
900 ParentFont = False
897 OnMouseDown = NoiseMacroPaintboxMouseDown 901 OnMouseDown = NoiseMacroPaintboxMouseDown
898 OnMouseMove = NoiseMacroPaintboxMouseMove 902 OnMouseMove = NoiseMacroPaintboxMouseMove
899 OnMouseUp = NoiseMacroPaintboxMouseUp 903 OnMouseUp = NoiseMacroPaintboxMouseUp
@@ -917,7 +921,7 @@ object frmTracker: TfrmTracker
917 Width = 1064 921 Width = 1064
918 Align = alBottom 922 Align = alBottom
919 Anchors = [akTop, akLeft, akRight, akBottom] 923 Anchors = [akTop, akLeft, akRight, akBottom]
920 BorderSpacing.Top = 13 924 BorderSpacing.Top = 23
921 ParentFont = False 925 ParentFont = False
922 PopupMenu = WaveEditPopup 926 PopupMenu = WaveEditPopup
923 OnMouseDown = WaveEditPaintBoxMouseDown 927 OnMouseDown = WaveEditPaintBoxMouseDown
@@ -926,80 +930,83 @@ object frmTracker: TfrmTracker
926 OnPaint = WaveEditPaintBoxPaint 930 OnPaint = WaveEditPaintBoxPaint
927 end 931 end
928 object WaveEditGroupBox: TGroupBox 932 object WaveEditGroupBox: TGroupBox
929 Left = 8 933 Left = 14
930 Height = 139 934 Height = 243
931 Top = 8 935 Top = 14
932 Width = 568 936 Width = 994
933 Caption = 'Wave Editor' 937 Caption = 'Wave Editor'
934 ClientHeight = 119 938 ClientHeight = 208
935 ClientWidth = 564 939 ClientWidth = 990
936 ParentFont = False 940 ParentFont = False
937 TabOrder = 0 941 TabOrder = 0
938 object Label20: TLabel 942 object Label20: TLabel
939 Left = 16 943 Left = 28
940 Height = 15 944 Height = 15
941 Top = 16 945 Top = 28
942 Width = 29 946 Width = 29
943 Caption = 'Wave' 947 Caption = 'Wave'
944 ParentColor = False 948 ParentColor = False
945 ParentFont = False 949 ParentFont = False
946 end 950 end
947 object WaveEditNumberSpinner: TSpinEdit 951 object WaveEditNumberSpinner: TSpinEdit
948 Left = 64 952 Left = 112
949 Height = 23 953 Height = 23
950 Top = 8 954 Top = 14
951 Width = 80 955 Width = 140
952 MaxValue = 15 956 MaxValue = 15
953 OnChange = WaveEditNumberSpinnerChange 957 OnChange = WaveEditNumberSpinnerChange
954 ParentFont = False 958 ParentFont = False
955 TabOrder = 0 959 TabOrder = 0
956 end 960 end
957 object ImportWaveButton: TButton 961 object ImportWaveButton: TButton
958 Left = 16 962 Left = 28
959 Height = 25 963 Height = 44
960 Hint = 'Import a wave' 964 Hint = 'Import a wave'
961 Top = 48 965 Top = 84
962 Width = 147 966 Width = 257
963 Caption = 'Import' 967 Caption = 'Import'
964 OnClick = ImportWaveButtonClick 968 OnClick = ImportWaveButtonClick
965 ParentFont = False 969 ParentFont = False
966 TabOrder = 1 970 TabOrder = 1
967 end 971 end
968 object ExportWaveButton: TButton 972 object ExportWaveButton: TButton
969 Left = 16 973 Left = 28
970 Height = 25 974 Height = 44
971 Hint = 'Export a wave' 975 Hint = 'Export a wave'
972 Top = 80 976 Top = 140
973 Width = 147 977 Width = 257
974 Caption = 'Export' 978 Caption = 'Export'
975 OnClick = ExportWaveButtonClick 979 OnClick = ExportWaveButtonClick
976 ParentFont = False 980 ParentFont = False
977 TabOrder = 2 981 TabOrder = 2
978 end 982 end
979 object HexWaveEdit: TEdit 983 object HexWaveEdit: TEdit
980 Left = 288 984 Left = 504
981 Height = 23 985 Height = 23
982 Top = 8 986 Top = 14
983 Width = 264 987 Width = 462
984 MaxLength = 32 988 MaxLength = 32
985 OnChange = HexWaveEditEditingDone 989 OnChange = HexWaveEditEditingDone
986 OnEditingDone = HexWaveEditEditingDone 990 OnEditingDone = HexWaveEditEditingDone
991 ParentFont = False
987 TabOrder = 3 992 TabOrder = 3
988 end 993 end
989 object Label13: TLabel 994 object Label13: TLabel
990 Left = 176 995 Left = 308
991 Height = 15 996 Height = 15
992 Top = 16 997 Top = 28
993 Width = 100 998 Width = 100
994 Caption = 'Hex representation' 999 Caption = 'Hex representation'
995 ParentColor = False 1000 ParentColor = False
1001 ParentFont = False
996 end 1002 end
997 object PlayWaveWhileDrawingCheckbox: TCheckBox 1003 object PlayWaveWhileDrawingCheckbox: TCheckBox
998 Left = 176 1004 Left = 308
999 Height = 19 1005 Height = 19
1000 Top = 40 1006 Top = 70
1001 Width = 149 1007 Width = 149
1002 Caption = 'Play wave while drawing' 1008 Caption = 'Play wave while drawing'
1009 ParentFont = False
1003 TabOrder = 4 1010 TabOrder = 4
1004 end 1011 end
1005 end 1012 end
@@ -1019,16 +1026,16 @@ object frmTracker: TfrmTracker
1019 Width = 939 1026 Width = 939
1020 Align = alBottom 1027 Align = alBottom
1021 Anchors = [akTop, akLeft, akRight, akBottom] 1028 Anchors = [akTop, akLeft, akRight, akBottom]
1022 BorderSpacing.Top = 13 1029 BorderSpacing.Top = 23
1023 MaxLength = 255 1030 MaxLength = 255
1024 OnChange = CommentMemoChange 1031 OnChange = CommentMemoChange
1025 ParentFont = False 1032 ParentFont = False
1026 TabOrder = 0 1033 TabOrder = 0
1027 end 1034 end
1028 object Label17: TLabel 1035 object Label17: TLabel
1029 Left = 8 1036 Left = 14
1030 Height = 15 1037 Height = 15
1031 Top = 8 1038 Top = 14
1032 Width = 333 1039 Width = 333
1033 Caption = 'This is an area to write comments for anyone editing your tune.' 1040 Caption = 'This is an area to write comments for anyone editing your tune.'
1034 ParentColor = False 1041 ParentColor = False
@@ -1048,16 +1055,16 @@ object frmTracker: TfrmTracker
1048 Top = 128 1055 Top = 128
1049 Width = 939 1056 Width = 939
1050 Align = alBottom 1057 Align = alBottom
1051 BorderSpacing.Top = 13 1058 BorderSpacing.Top = 23
1052 Anchors = [akTop, akLeft, akRight, akBottom] 1059 Anchors = [akTop, akLeft, akRight, akBottom]
1053 Font.Height = -13 1060 Font.Height = -23
1054 Font.Name = 'Courier New' 1061 Font.Name = 'Courier New'
1055 Font.Pitch = fpFixed 1062 Font.Pitch = fpFixed
1056 Font.Quality = fqNonAntialiased 1063 Font.Quality = fqNonAntialiased
1057 ParentColor = False 1064 ParentColor = False
1058 ParentFont = False 1065 ParentFont = False
1059 TabOrder = 0 1066 TabOrder = 0
1060 Gutter.Width = 57 1067 Gutter.Width = 100
1061 Gutter.MouseActions = <> 1068 Gutter.MouseActions = <>
1062 RightGutter.Width = 0 1069 RightGutter.Width = 0
1063 RightGutter.MouseActions = <> 1070 RightGutter.MouseActions = <>
@@ -1511,11 +1518,11 @@ object frmTracker: TfrmTracker
1511 OnChange = RoutineSyneditChange 1518 OnChange = RoutineSyneditChange
1512 inline SynLeftGutterPartList1: TSynGutterPartList 1519 inline SynLeftGutterPartList1: TSynGutterPartList
1513 object SynGutterMarks1: TSynGutterMarks 1520 object SynGutterMarks1: TSynGutterMarks
1514 Width = 24 1521 Width = 42
1515 MouseActions = <> 1522 MouseActions = <>
1516 end 1523 end
1517 object SynGutterLineNumber1: TSynGutterLineNumber 1524 object SynGutterLineNumber1: TSynGutterLineNumber
1518 Width = 17 1525 Width = 29
1519 MouseActions = <> 1526 MouseActions = <>
1520 MarkupInfo.Background = clBtnFace 1527 MarkupInfo.Background = clBtnFace
1521 MarkupInfo.Foreground = clNone 1528 MarkupInfo.Foreground = clNone
@@ -1525,18 +1532,19 @@ object frmTracker: TfrmTracker
1525 LeadingZeros = False 1532 LeadingZeros = False
1526 end 1533 end
1527 object SynGutterChanges1: TSynGutterChanges 1534 object SynGutterChanges1: TSynGutterChanges
1528 Width = 4 1535 Width = 7
1529 MouseActions = <> 1536 MouseActions = <>
1530 ModifiedColor = 59900 1537 ModifiedColor = 59900
1531 SavedColor = clGreen 1538 SavedColor = clGreen
1532 end 1539 end
1533 object SynGutterSeparator1: TSynGutterSeparator 1540 object SynGutterSeparator1: TSynGutterSeparator
1534 Width = 2 1541 Width = 4
1535 MouseActions = <> 1542 MouseActions = <>
1536 MarkupInfo.Background = clWhite 1543 MarkupInfo.Background = clWhite
1537 MarkupInfo.Foreground = clGray 1544 MarkupInfo.Foreground = clGray
1538 end 1545 end
1539 object SynGutterCodeFolding1: TSynGutterCodeFolding 1546 object SynGutterCodeFolding1: TSynGutterCodeFolding
1547 Width = 18
1540 MouseActions = <> 1548 MouseActions = <>
1541 MarkupInfo.Background = clNone 1549 MarkupInfo.Background = clNone
1542 MarkupInfo.Foreground = clGray 1550 MarkupInfo.Foreground = clGray
@@ -1546,19 +1554,19 @@ object frmTracker: TfrmTracker
1546 end 1554 end
1547 end 1555 end
1548 object Label18: TLabel 1556 object Label18: TLabel
1549 Left = 8 1557 Left = 14
1550 Height = 15 1558 Height = 15
1551 Top = 16 1559 Top = 28
1552 Width = 41 1560 Width = 41
1553 Caption = 'Routine' 1561 Caption = 'Routine'
1554 ParentColor = False 1562 ParentColor = False
1555 ParentFont = False 1563 ParentFont = False
1556 end 1564 end
1557 object RoutineNumberSpinner: TSpinEdit 1565 object RoutineNumberSpinner: TSpinEdit
1558 Left = 64 1566 Left = 112
1559 Height = 23 1567 Height = 23
1560 Top = 8 1568 Top = 14
1561 Width = 176 1569 Width = 308
1562 MaxValue = 15 1570 MaxValue = 15
1563 MinValue = 1 1571 MinValue = 1
1564 OnChange = RoutineNumberSpinnerChange 1572 OnChange = RoutineNumberSpinnerChange
@@ -1567,9 +1575,9 @@ object frmTracker: TfrmTracker
1567 Value = 1 1575 Value = 1
1568 end 1576 end
1569 object Label19: TLabel 1577 object Label19: TLabel
1570 Left = 8 1578 Left = 14
1571 Height = 75 1579 Height = 75
1572 Top = 40 1580 Top = 70
1573 Width = 506 1581 Width = 506
1574 Caption = 'Routines are an advanced feature of hUGETracker, and you likely won''t need them at all'#13#10'if you are only interested in composing music. If you want to create a custom effect, or interface'#13#10'with game code that you''re writing a soundtrack for, then routines will come in handy.'#13#10#13#10'Refer to the user manual for more information!' 1582 Caption = 'Routines are an advanced feature of hUGETracker, and you likely won''t need them at all'#13#10'if you are only interested in composing music. If you want to create a custom effect, or interface'#13#10'with game code that you''re writing a soundtrack for, then routines will come in handy.'#13#10#13#10'Refer to the user manual for more information!'
1575 ParentColor = False 1583 ParentColor = False
@@ -1580,21 +1588,21 @@ object frmTracker: TfrmTracker
1580 end 1588 end
1581 object Panel2: TPanel 1589 object Panel2: TPanel
1582 Left = 0 1590 Left = 0
1583 Height = 64 1591 Height = 112
1584 Top = 25 1592 Top = 41
1585 Width = 1270 1593 Width = 2222
1586 Align = alTop 1594 Align = alTop
1587 BevelOuter = bvNone 1595 BevelOuter = bvNone
1588 ClientHeight = 64 1596 ClientHeight = 112
1589 ClientWidth = 1270 1597 ClientWidth = 2222
1590 ParentFont = False 1598 ParentFont = False
1591 TabOrder = 3 1599 TabOrder = 3
1592 object LEDMeter1: TLEDMeter 1600 object LEDMeter1: TLEDMeter
1593 AnchorSideRight.Control = Duty1Visualizer 1601 AnchorSideRight.Control = Duty1Visualizer
1594 Left = 0 1602 Left = 0
1595 Height = 32 1603 Height = 56
1596 Top = 32 1604 Top = 56
1597 Width = 482 1605 Width = 842
1598 Anchors = [akTop, akLeft, akRight] 1606 Anchors = [akTop, akLeft, akRight]
1599 BevelStyle = bvLowered 1607 BevelStyle = bvLowered
1600 Colors.Border = 2168839 1608 Colors.Border = 2168839
@@ -1615,9 +1623,9 @@ object frmTracker: TfrmTracker
1615 object LEDMeter2: TLEDMeter 1623 object LEDMeter2: TLEDMeter
1616 AnchorSideRight.Control = Duty1Visualizer 1624 AnchorSideRight.Control = Duty1Visualizer
1617 Left = 0 1625 Left = 0
1618 Height = 32 1626 Height = 56
1619 Top = 0 1627 Top = 0
1620 Width = 482 1628 Width = 842
1621 Anchors = [akTop, akLeft, akRight] 1629 Anchors = [akTop, akLeft, akRight]
1622 BevelStyle = bvLowered 1630 BevelStyle = bvLowered
1623 Colors.Border = 2168839 1631 Colors.Border = 2168839
@@ -1636,40 +1644,40 @@ object frmTracker: TfrmTracker
1636 Section3Value = 48 1644 Section3Value = 48
1637 end 1645 end
1638 object Duty1Visualizer: TPaintBox 1646 object Duty1Visualizer: TPaintBox
1639 Left = 482 1647 Left = 842
1640 Height = 64 1648 Height = 112
1641 Top = 0 1649 Top = 0
1642 Width = 197 1650 Width = 345
1643 Align = alRight 1651 Align = alRight
1644 ParentFont = False 1652 ParentFont = False
1645 OnClick = Duty1VisualizerClick 1653 OnClick = Duty1VisualizerClick
1646 OnPaint = Duty1VisualizerPaint 1654 OnPaint = Duty1VisualizerPaint
1647 end 1655 end
1648 object Duty2Visualizer: TPaintBox 1656 object Duty2Visualizer: TPaintBox
1649 Left = 679 1657 Left = 1187
1650 Height = 64 1658 Height = 112
1651 Top = 0 1659 Top = 0
1652 Width = 197 1660 Width = 345
1653 Align = alRight 1661 Align = alRight
1654 ParentFont = False 1662 ParentFont = False
1655 OnClick = Duty1VisualizerClick 1663 OnClick = Duty1VisualizerClick
1656 OnPaint = Duty2VisualizerPaint 1664 OnPaint = Duty2VisualizerPaint
1657 end 1665 end
1658 object WaveVisualizer: TPaintBox 1666 object WaveVisualizer: TPaintBox
1659 Left = 876 1667 Left = 1532
1660 Height = 64 1668 Height = 112
1661 Top = 0 1669 Top = 0
1662 Width = 197 1670 Width = 345
1663 Align = alRight 1671 Align = alRight
1664 ParentFont = False 1672 ParentFont = False
1665 OnClick = Duty1VisualizerClick 1673 OnClick = Duty1VisualizerClick
1666 OnPaint = WaveVisualizerPaint 1674 OnPaint = WaveVisualizerPaint
1667 end 1675 end
1668 object NoiseVisualizer: TPaintBox 1676 object NoiseVisualizer: TPaintBox
1669 Left = 1073 1677 Left = 1877
1670 Height = 64 1678 Height = 112
1671 Top = 0 1679 Top = 0
1672 Width = 197 1680 Width = 345
1673 Align = alRight 1681 Align = alRight
1674 ParentFont = False 1682 ParentFont = False
1675 OnClick = Duty1VisualizerClick 1683 OnClick = Duty1VisualizerClick
@@ -1678,19 +1686,19 @@ object frmTracker: TfrmTracker
1678 end 1686 end
1679 object StatusBar1: TStatusBar 1687 object StatusBar1: TStatusBar
1680 Left = 0 1688 Left = 0
1681 Height = 23 1689 Height = 43
1682 Top = 763 1690 Top = 1333
1683 Width = 1270 1691 Width = 2222
1684 AutoHint = True 1692 AutoHint = True
1685 Panels = < 1693 Panels = <
1686 item 1694 item
1687 Width = 467 1695 Width = 817
1688 end 1696 end
1689 item 1697 item
1690 Width = 200 1698 Width = 350
1691 end 1699 end
1692 item 1700 item
1693 Width = 200 1701 Width = 350
1694 end> 1702 end>
1695 ParentFont = False 1703 ParentFont = False
1696 ParentShowHint = False 1704 ParentShowHint = False
@@ -1699,9 +1707,9 @@ object frmTracker: TfrmTracker
1699 end 1707 end
1700 object ToolBar1: TToolBar 1708 object ToolBar1: TToolBar
1701 Left = 0 1709 Left = 0
1702 Height = 25 1710 Height = 41
1703 Top = 0 1711 Top = 0
1704 Width = 1270 1712 Width = 2222
1705 AutoSize = True 1713 AutoSize = True
1706 Caption = 'ToolBar1' 1714 Caption = 'ToolBar1'
1707 EdgeBorders = [ebBottom] 1715 EdgeBorders = [ebBottom]
@@ -1718,7 +1726,7 @@ object frmTracker: TfrmTracker
1718 ParentShowHint = False 1726 ParentShowHint = False
1719 end 1727 end
1720 object PanicToolButton: TToolButton 1728 object PanicToolButton: TToolButton
1721 Left = 557 1729 Left = 851
1722 Hint = 'Stops all sound output' 1730 Hint = 'Stops all sound output'
1723 Top = 0 1731 Top = 0
1724 AutoSize = True 1732 AutoSize = True
@@ -1729,17 +1737,17 @@ object frmTracker: TfrmTracker
1729 ShowHint = True 1737 ShowHint = True
1730 end 1738 end
1731 object ToolButton2: TToolButton 1739 object ToolButton2: TToolButton
1732 Left = 147 1740 Left = 221
1733 Top = 0 1741 Top = 0
1734 Action = PlayCursorAction 1742 Action = PlayCursorAction
1735 end 1743 end
1736 object ToolButton4: TToolButton 1744 object ToolButton4: TToolButton
1737 Left = 221 1745 Left = 331
1738 Top = 0 1746 Top = 0
1739 Action = StopAction 1747 Action = StopAction
1740 end 1748 end
1741 object ExportGBButton: TToolButton 1749 object ExportGBButton: TToolButton
1742 Left = 291 1750 Left = 442
1743 Hint = 'Export the song as a standalone ROM' 1751 Hint = 'Export the song as a standalone ROM'
1744 Top = 0 1752 Top = 0
1745 AutoSize = True 1753 AutoSize = True
@@ -1748,49 +1756,49 @@ object frmTracker: TfrmTracker
1748 OnClick = ExportGBButtonClick 1756 OnClick = ExportGBButtonClick
1749 end 1757 end
1750 object ToolButton8: TToolButton 1758 object ToolButton8: TToolButton
1751 Left = 79 1759 Left = 120
1752 Height = 22 1760 Height = 39
1753 Top = 0 1761 Top = 0
1754 Caption = 'ToolButton8' 1762 Caption = 'ToolButton8'
1755 Style = tbsDivider 1763 Style = tbsDivider
1756 end 1764 end
1757 object ToolButton6: TToolButton 1765 object ToolButton6: TToolButton
1758 Left = 286 1766 Left = 433
1759 Height = 22 1767 Height = 39
1760 Top = 0 1768 Top = 0
1761 Caption = 'ToolButton6' 1769 Caption = 'ToolButton6'
1762 Style = tbsDivider 1770 Style = tbsDivider
1763 end 1771 end
1764 object ToolButton7: TToolButton 1772 object ToolButton7: TToolButton
1765 Left = 1097 1773 Left = 1775
1766 Height = 22 1774 Height = 39
1767 Top = 0 1775 Top = 0
1768 Caption = 'ToolButton7' 1776 Caption = 'ToolButton7'
1769 Style = tbsSeparator 1777 Style = tbsSeparator
1770 end 1778 end
1771 object OctaveSpinEdit: TSpinEdit 1779 object OctaveSpinEdit: TSpinEdit
1772 Left = 663 1780 Left = 1016
1773 Height = 23 1781 Height = 38
1774 Hint = 'The octave offset for entering new notes' 1782 Hint = 'The octave offset for entering new notes'
1775 Top = 0 1783 Top = 0
1776 Width = 65 1784 Width = 114
1777 MaxValue = 5 1785 MaxValue = 5
1778 OnChange = OctaveSpinEditChange 1786 OnChange = OctaveSpinEditChange
1779 ParentFont = False 1787 ParentFont = False
1780 TabOrder = 0 1788 TabOrder = 0
1781 end 1789 end
1782 object ToolButton9: TToolButton 1790 object ToolButton9: TToolButton
1783 Left = 612 1791 Left = 927
1784 Height = 22 1792 Height = 39
1785 Top = 0 1793 Top = 0
1786 Caption = 'ToolButton9' 1794 Caption = 'ToolButton9'
1787 Style = tbsSeparator 1795 Style = tbsSeparator
1788 end 1796 end
1789 object Label22: TLabel 1797 object Label22: TLabel
1790 Left = 620 1798 Left = 941
1791 Height = 22 1799 Height = 39
1792 Top = 0 1800 Top = 0
1793 Width = 43 1801 Width = 75
1794 AutoSize = False 1802 AutoSize = False
1795 Caption = 'Octave ' 1803 Caption = 'Octave '
1796 Layout = tlCenter 1804 Layout = tlCenter
@@ -1798,10 +1806,10 @@ object frmTracker: TfrmTracker
1798 ParentFont = False 1806 ParentFont = False
1799 end 1807 end
1800 object Label23: TLabel 1808 object Label23: TLabel
1801 Left = 728 1809 Left = 1130
1802 Height = 22 1810 Height = 39
1803 Top = 0 1811 Top = 0
1804 Width = 70 1812 Width = 122
1805 AutoSize = False 1813 AutoSize = False
1806 Caption = ' Instrument ' 1814 Caption = ' Instrument '
1807 Layout = tlCenter 1815 Layout = tlCenter
@@ -1809,13 +1817,13 @@ object frmTracker: TfrmTracker
1809 ParentFont = False 1817 ParentFont = False
1810 end 1818 end
1811 object InstrumentComboBox: TComboBox 1819 object InstrumentComboBox: TComboBox
1812 Left = 798 1820 Left = 1252
1813 Height = 23 1821 Height = 38
1814 Hint = 'The selected instrument for new notes' 1822 Hint = 'The selected instrument for new notes'
1815 Top = 0 1823 Top = 0
1816 Width = 214 1824 Width = 374
1817 DropDownCount = 999 1825 DropDownCount = 999
1818 ItemHeight = 15 1826 ItemHeight = 30
1819 ItemIndex = 0 1827 ItemIndex = 0
1820 Items.Strings = ( 1828 Items.Strings = (
1821 '(no instrument)' 1829 '(no instrument)'
@@ -1827,10 +1835,10 @@ object frmTracker: TfrmTracker
1827 Text = '(no instrument)' 1835 Text = '(no instrument)'
1828 end 1836 end
1829 object Label24: TLabel 1837 object Label24: TLabel
1830 Left = 1012 1838 Left = 1626
1831 Height = 22 1839 Height = 39
1832 Top = 0 1840 Top = 0
1833 Width = 35 1841 Width = 61
1834 AutoSize = False 1842 AutoSize = False
1835 Caption = ' Step ' 1843 Caption = ' Step '
1836 Layout = tlCenter 1844 Layout = tlCenter
@@ -1838,23 +1846,23 @@ object frmTracker: TfrmTracker
1838 ParentFont = False 1846 ParentFont = False
1839 end 1847 end
1840 object StepSpinEdit: TSpinEdit 1848 object StepSpinEdit: TSpinEdit
1841 Left = 1047 1849 Left = 1687
1842 Height = 23 1850 Height = 38
1843 Hint = 'How many rows to step down after entering a new note' 1851 Hint = 'How many rows to step down after entering a new note'
1844 Top = 0 1852 Top = 0
1845 Width = 50 1853 Width = 88
1846 MaxValue = 63 1854 MaxValue = 63
1847 OnChange = StepSpinEditChange 1855 OnChange = StepSpinEditChange
1848 ParentFont = False 1856 ParentFont = False
1849 TabOrder = 2 1857 TabOrder = 2
1850 end 1858 end
1851 object ToolButton3: TToolButton 1859 object ToolButton3: TToolButton
1852 Left = 84 1860 Left = 129
1853 Top = 0 1861 Top = 0
1854 Action = PlayStartAction 1862 Action = PlayStartAction
1855 end 1863 end
1856 object ExportGBSButton: TToolButton 1864 object ExportGBSButton: TToolButton
1857 Left = 372 1865 Left = 564
1858 Hint = 'Export the song as a GBS soundtrack' 1866 Hint = 'Export the song as a GBS soundtrack'
1859 Top = 0 1867 Top = 0
1860 Caption = 'Export .GBS' 1868 Caption = 'Export .GBS'
@@ -1862,14 +1870,14 @@ object frmTracker: TfrmTracker
1862 OnClick = ExportGBSButtonClick 1870 OnClick = ExportGBSButtonClick
1863 end 1871 end
1864 object ToolButton5: TToolButton 1872 object ToolButton5: TToolButton
1865 Left = 552 1873 Left = 842
1866 Height = 22 1874 Height = 39
1867 Top = 0 1875 Top = 0
1868 Caption = 'ToolButton5' 1876 Caption = 'ToolButton5'
1869 Style = tbsDivider 1877 Style = tbsDivider
1870 end 1878 end
1871 object ToolButton10: TToolButton 1879 object ToolButton10: TToolButton
1872 Left = 459 1880 Left = 697
1873 Hint = 'Export the song as WAV or MP3' 1881 Hint = 'Export the song as WAV or MP3'
1874 Top = 0 1882 Top = 0
1875 Caption = 'Render Song' 1883 Caption = 'Render Song'
@@ -1879,8 +1887,8 @@ object frmTracker: TfrmTracker
1879 end 1887 end
1880 object MainMenu1: TMainMenu 1888 object MainMenu1: TMainMenu
1881 Images = ImageList1 1889 Images = ImageList1
1882 Left = 40 1890 Left = 70
1883 Top = 32 1891 Top = 56
1884 object MenuItem1: TMenuItem 1892 object MenuItem1: TMenuItem
1885 Caption = 'File' 1893 Caption = 'File'
1886 object MenuItem33: TMenuItem 1894 object MenuItem33: TMenuItem
@@ -1995,8 +2003,8 @@ object frmTracker: TfrmTracker
1995 end 2003 end
1996 object MenuBarActionList: TActionList 2004 object MenuBarActionList: TActionList
1997 Images = ImageList1 2005 Images = ImageList1
1998 Left = 104 2006 Left = 182
1999 Top = 72 2007 Top = 126
2000 object FileOpen1: TFileOpen 2008 object FileOpen1: TFileOpen
2001 Category = 'File' 2009 Category = 'File'
2002 Caption = '&Open ...' 2010 Caption = '&Open ...'
@@ -2099,8 +2107,8 @@ object frmTracker: TfrmTracker
2099 end 2107 end
2100 end 2108 end
2101 object ImageList1: TImageList 2109 object ImageList1: TImageList
2102 Left = 141 2110 Left = 247
2103 Top = 36 2111 Top = 63
2104 Bitmap = { 2112 Bitmap = {
2105 4C694E0000001000000010000000000000000000000000000000000000000000 2113 4C694E0000001000000010000000000000000000000000000000000000000000
2106 0000000000000000000000000000000000000000000000000000000000000000 2114 0000000000000000000000000000000000000000000000000000000000000000
@@ -4603,17 +4611,17 @@ object frmTracker: TfrmTracker
4603 end 4611 end
4604 object OpenDialog1: TOpenDialog 4612 object OpenDialog1: TOpenDialog
4605 Filter = 'hUGETracker Instruments|*.ugi' 4613 Filter = 'hUGETracker Instruments|*.ugi'
4606 Left = 80 4614 Left = 140
4607 Top = 56 4615 Top = 98
4608 end 4616 end
4609 object InstrumentSaveDialog: TSaveDialog 4617 object InstrumentSaveDialog: TSaveDialog
4610 Filter = 'hUGETracker Instruments|*.ugi' 4618 Filter = 'hUGETracker Instruments|*.ugi'
4611 Left = 80 4619 Left = 140
4612 Top = 56 4620 Top = 98
4613 end 4621 end
4614 object OrderEditPopup: TPopupMenu 4622 object OrderEditPopup: TPopupMenu
4615 Left = 288 4623 Left = 504
4616 Top = 32 4624 Top = 56
4617 object MenuItem17: TMenuItem 4625 object MenuItem17: TMenuItem
4618 Caption = 'Insert new row' 4626 Caption = 'Insert new row'
4619 Hint = 'Insert a new row filled with brand new patterns' 4627 Hint = 'Insert a new row filled with brand new patterns'
@@ -4644,8 +4652,8 @@ object frmTracker: TfrmTracker
4644 object ImageList2: TImageList 4652 object ImageList2: TImageList
4645 Height = 32 4653 Height = 32
4646 Width = 32 4654 Width = 32
4647 Left = 48 4655 Left = 84
4648 Top = 86 4656 Top = 151
4649 Bitmap = { 4657 Bitmap = {
4650 4C69020000002000000020000000000000000000000000000000000000000000 4658 4C69020000002000000020000000000000000000000000000000000000000000
4651 0000000000000000000000000000000000000000000000000000000000000000 4659 0000000000000000000000000000000000000000000000000000000000000000
@@ -4910,33 +4918,33 @@ object frmTracker: TfrmTracker
4910 Enabled = False 4918 Enabled = False
4911 Interval = 200 4919 Interval = 200
4912 OnTimer = OscilloscopeUpdateTimerTimer 4920 OnTimer = OscilloscopeUpdateTimerTimer
4913 Left = 88 4921 Left = 154
4914 Top = 48 4922 Top = 84
4915 end 4923 end
4916 object GBSSaveDialog: TSaveDialog 4924 object GBSSaveDialog: TSaveDialog
4917 Filter = 'Gameboy Soundtrack|*.gbs' 4925 Filter = 'Gameboy Soundtrack|*.gbs'
4918 Left = 64 4926 Left = 112
4919 Top = 56 4927 Top = 98
4920 end 4928 end
4921 object WaveSaveDialog: TSaveDialog 4929 object WaveSaveDialog: TSaveDialog
4922 Filter = 'hUGETracker Waves|*.ugw' 4930 Filter = 'hUGETracker Waves|*.ugw'
4923 Left = 64 4931 Left = 112
4924 Top = 48 4932 Top = 84
4925 end 4933 end
4926 object GBSaveDialog: TSaveDialog 4934 object GBSaveDialog: TSaveDialog
4927 Filter = 'Gameboy ROM|*.GB' 4935 Filter = 'Gameboy ROM|*.GB'
4928 Left = 120 4936 Left = 210
4929 Top = 88 4937 Top = 154
4930 end 4938 end
4931 object NoteHaltTimer: TTimer 4939 object NoteHaltTimer: TTimer
4932 Enabled = False 4940 Enabled = False
4933 OnTimer = NoteHaltTimerTimer 4941 OnTimer = NoteHaltTimerTimer
4934 Left = 80 4942 Left = 140
4935 Top = 86 4943 Top = 151
4936 end 4944 end
4937 object TrackerGridPopup: TPopupMenu 4945 object TrackerGridPopup: TPopupMenu
4938 Left = 248 4946 Left = 434
4939 Top = 32 4947 Top = 56
4940 object TrackerPopupEditEffect: TMenuItem 4948 object TrackerPopupEditEffect: TMenuItem
4941 Caption = 'Edit effect ...' 4949 Caption = 'Edit effect ...'
4942 OnClick = TrackerPopupEditEffectClick 4950 OnClick = TrackerPopupEditEffectClick
@@ -5083,8 +5091,8 @@ object frmTracker: TfrmTracker
5083 object WavSaveDialog: TSaveDialog 5091 object WavSaveDialog: TSaveDialog
5084 DefaultExt = '.wav' 5092 DefaultExt = '.wav'
5085 Filter = 'Wave files|*.wav' 5093 Filter = 'Wave files|*.wav'
5086 Left = 72 5094 Left = 126
5087 Top = 32 5095 Top = 56
5088 end 5096 end
5089 object SynAnySyn1: TSynAnySyn 5097 object SynAnySyn1: TSynAnySyn
5090 Enabled = False 5098 Enabled = False
@@ -5208,18 +5216,18 @@ object frmTracker: TfrmTracker
5208 Entity = False 5216 Entity = False
5209 DollarVariables = False 5217 DollarVariables = False
5210 ActiveDot = False 5218 ActiveDot = False
5211 Left = 8 5219 Left = 14
5212 Top = 86 5220 Top = 151
5213 end 5221 end
5214 object MODOpenDialog: TOpenDialog 5222 object MODOpenDialog: TOpenDialog
5215 DefaultExt = '.mod' 5223 DefaultExt = '.mod'
5216 Filter = 'GBT Player MOD files|*.mod' 5224 Filter = 'GBT Player MOD files|*.mod'
5217 Left = 104 5225 Left = 182
5218 Top = 32 5226 Top = 56
5219 end 5227 end
5220 object WaveEditPopup: TPopupMenu 5228 object WaveEditPopup: TPopupMenu
5221 Left = 8 5229 Left = 14
5222 Top = 32 5230 Top = 56
5223 object MenuItem37: TMenuItem 5231 object MenuItem37: TMenuItem
5224 Caption = 'Copy' 5232 Caption = 'Copy'
5225 OnClick = MenuItem37Click 5233 OnClick = MenuItem37Click
@@ -5231,8 +5239,8 @@ object frmTracker: TfrmTracker
5231 end 5239 end
5232 object ShortcutsActionList: TActionList 5240 object ShortcutsActionList: TActionList
5233 Images = ImageList1 5241 Images = ImageList1
5234 Left = 208 5242 Left = 364
5235 Top = 32 5243 Top = 56
5236 object PlayStartAction: TAction 5244 object PlayStartAction: TAction
5237 Caption = '▶️ Start' 5245 Caption = '▶️ Start'
5238 DisableIfNoHandler = False 5246 DisableIfNoHandler = False
Modifiedtracker.pas +44−36
@@ -455,8 +455,8 @@ type
455 procedure DrawEnvelope(PB: TPaintBox); 455 procedure DrawEnvelope(PB: TPaintBox);
456 procedure DrawVizualizer(PB: TPaintBox; Channel: Integer); 456 procedure DrawVizualizer(PB: TPaintBox; Channel: Integer);
457 457
458 procedure PreviewInstrument(Freq: Integer; Instr: Integer; SquareOnCh2: Boolean = False); overload; 458 procedure PreviewInstrument(Note: Integer; Instr: Integer; SquareOnCh2: Boolean = False); overload;
459 procedure PreviewInstrument(Freq: Integer; Instr: TInstrument; SquareOnCh2: Boolean = False); overload; 459 procedure PreviewInstrument(Note: Integer; Instr: TInstrument; SquareOnCh2: Boolean = False); overload;
460 procedure PreviewC5; 460 procedure PreviewC5;
461 procedure Panic; 461 procedure Panic;
462 public 462 public
@@ -685,7 +685,7 @@ begin
685 end; 685 end;
686 end 686 end
687 else begin 687 else begin
688 Pen.Color := TColor($0C0094); // what color is this? 688 Pen.Color := TColor($0C0094); // TODO: what color is this?
689 Line(0, 0, PB.Width, PB.Height); 689 Line(0, 0, PB.Width, PB.Height);
690 Line(0, PB.Height, PB.Width, 0); 690 Line(0, PB.Height, PB.Width, 0);
691 end; 691 end;
@@ -694,17 +694,20 @@ begin
694 VisualizerBuffer.Draw(PB.Canvas, 0, 0, True); 694 VisualizerBuffer.Draw(PB.Canvas, 0, 0, True);
695 end; 695 end;
696 696
697 procedure TfrmTracker.PreviewInstrument(Freq: Integer; Instr: Integer; 697 procedure TfrmTracker.PreviewInstrument(Note: Integer; Instr: Integer;
698 SquareOnCh2: Boolean = False); 698 SquareOnCh2: Boolean = False);
699 begin 699 begin
700 PreviewInstrument(Freq, Song.Instruments.All[Instr], SquareOnCh2); 700 PreviewInstrument(Note, Song.Instruments.All[Instr], SquareOnCh2);
701 end; 701 end;
702 702
703 procedure TfrmTracker.PreviewInstrument(Freq: Integer; Instr: TInstrument; 703 procedure TfrmTracker.PreviewInstrument(Note: Integer; Instr: TInstrument;
704 SquareOnCh2: Boolean = False); 704 SquareOnCh2: Boolean = False);
705 var 705 var
706 Regs: TRegisters; 706 Regs: TRegisters;
707 I, Addr, Freq: Integer;
707 begin 708 begin
709 Freq := NotesToFreqs.KeyData[Note];
710
708 LockPlayback; 711 LockPlayback;
709 with Instr do 712 with Instr do
710 begin 713 begin
@@ -737,10 +740,22 @@ begin
737 end; 740 end;
738 itNoise: begin 741 itNoise: begin
739 Regs := NoiseInstrumentToRegisters(Freq, True, Instr); 742 Regs := NoiseInstrumentToRegisters(Freq, True, Instr);
743 Addr := SymbolTable.KeyData['instr'];
744 Spokeb(Addr, Regs.NR42);
745 Spokeb(Addr+1, Regs.NR41);
746
747 for I := 0 to 5 do begin
748 Spokeb(Addr+2+I, Byte(Instr.NoiseMacro[I]));
749 end;
750
751 PokeSymbol('macro_index', 1);
752 PokeSymbol('note', Note);
753
754 {Regs := NoiseInstrumentToRegisters(Freq, True, Instr);
740 Spokeb(NR41, Regs.NR41); 755 Spokeb(NR41, Regs.NR41);
741 Spokeb(NR42, Regs.NR42); 756 Spokeb(NR42, Regs.NR42);
742 Spokeb(NR43, Regs.NR43); 757 Spokeb(NR43, Regs.NR43);
743 Spokeb(NR44, Regs.NR44); 758 Spokeb(NR44, Regs.NR44);}
744 end; 759 end;
745 end; 760 end;
746 end; 761 end;
@@ -750,7 +765,7 @@ end;
750 procedure TfrmTracker.PreviewC5; 765 procedure TfrmTracker.PreviewC5;
751 begin 766 begin
752 if not LoadingFile then begin 767 if not LoadingFile then begin
753 PreviewInstrument(NotesToFreqs.Data[C_5], UnmodInst(CurrentInstrumentBank, InstrumentNumberSpinner.Value)); 768 PreviewInstrument(C_5, UnmodInst(CurrentInstrumentBank, InstrumentNumberSpinner.Value));
754 NoteHaltTimer.Enabled := False; 769 NoteHaltTimer.Enabled := False;
755 NoteHaltTimer.Enabled := True 770 NoteHaltTimer.Enabled := True
756 end; 771 end;
@@ -954,6 +969,7 @@ begin
954 969
955 LockPlayback; 970 LockPlayback;
956 GetROMReady('halt.gb'); 971 GetROMReady('halt.gb');
972 ParseSymFile('halt.sym');
957 UnlockPlayback; 973 UnlockPlayback;
958 end; 974 end;
959 975
@@ -982,7 +998,7 @@ end;
982 998
983 procedure TfrmTracker.OnNotePlaced(var Msg: TLMessage); 999 procedure TfrmTracker.OnNotePlaced(var Msg: TLMessage);
984 begin 1000 begin
985 PreviewInstrument(NotesToFreqs.KeyData[msg.wParam], msg.lParam); 1001 PreviewInstrument(msg.wParam, msg.lParam);
986 end; 1002 end;
987 1003
988 procedure TfrmTracker.OnSampleSongMenuItemClicked(Sender: TObject); 1004 procedure TfrmTracker.OnSampleSongMenuItemClicked(Sender: TObject);
@@ -1364,9 +1380,9 @@ begin
1364 end; 1380 end;
1365 1381
1366 if TrackerGrid.Cursor.X = 1 then 1382 if TrackerGrid.Cursor.X = 1 then
1367 PreviewInstrument(Freq, InstrumentComboBox.ItemIndex, True) 1383 PreviewInstrument(Note, InstrumentComboBox.ItemIndex, True)
1368 else 1384 else
1369 PreviewInstrument(Freq, InstrumentComboBox.ItemIndex, False); 1385 PreviewInstrument(Note, InstrumentComboBox.ItemIndex, False);
1370 1386
1371 PreviewingInstrument := Note; 1387 PreviewingInstrument := Note;
1372 end; 1388 end;
@@ -1935,34 +1951,26 @@ begin
1935 end; 1951 end;
1936 1952
1937 procedure TfrmTracker.DebugShiteButtonClick(Sender: TObject); 1953 procedure TfrmTracker.DebugShiteButtonClick(Sender: TObject);
1938 procedure note(A: Byte);
1939 var
1940 B, C: Integer;
1941 begin
1942 LockPlayback;
1943
1944 //A := A or %00001000;
1945 if A > 7 then begin
1946 B := (A-4) div 4; //high
1947 C := (A mod 4)+4; //low
1948 A := (C or (B shl 4)) or %00001000; // and %11110111;
1949 end;
1950
1951 spokeb($FF21, %11110000);
1952 spokeb($FF22, A or %00001000);
1953 writeln('spoking ', IntTobin(A or %00001000, 8));
1954 spokeb($FF23, %10000000);
1955
1956 UnlockPlayback;
1957 end;
1958
1959 var 1954 var
1960 I: Integer; 1955 I: Integer;
1956 AsmInstrument: TAsmInstrument;
1957 Addr: Integer;
1961 begin 1958 begin
1962 for I := 0 to 64 do begin 1959 LockPlayback;
1963 note(I); 1960
1964 Sleep(150); 1961 AsmInstrument := InstrumentToBytes(Song.Instruments.Noise[1]);
1962 Addr := SymbolTable.KeyData['instr'];
1963 Spokeb(Addr, AsmInstrument[1]);
1964 Spokeb(Addr+1, AsmInstrument[0]);
1965
1966 for I := 0 to 5 do begin
1967 Spokeb(Addr+2+I, Byte(Song.Instruments.Noise[1].NoiseMacro[I]));
1965 end; 1968 end;
1969
1970 PokeSymbol('macro_index', 1);
1971 PokeSymbol('note', C_7);
1972
1973 UnlockPlayback;
1966 end; 1974 end;
1967 1975
1968 procedure TfrmTracker.MenuItem11Click(Sender: TObject); 1976 procedure TfrmTracker.MenuItem11Click(Sender: TObject);
@@ -2456,7 +2464,7 @@ begin
2456 2464
2457 DrawingWave := True; 2465 DrawingWave := True;
2458 if PlayWaveWhileDrawingCheckbox.Checked then 2466 if PlayWaveWhileDrawingCheckbox.Checked then
2459 PreviewInstrument(NotesToFreqs.Data[C_5], TestInstrument); 2467 PreviewInstrument(C_5, TestInstrument);
2460 end 2468 end
2461 end; 2469 end;
2462 2470