Commit c348cd8

Nick committed on
WIP order callback, uge2source banking switch
commit c348cd81d4485a169d3418453ede3b94975e549e parent 4463842
8 changed files +115−93
ModifiedCpu/z80cpu.pas +10−3
@@ -2120,12 +2120,19 @@ begin
2120 Result := 12; 2120 Result := 12;
2121 end; 2121 end;
2122 2122
2123 function PFX_FD: byte; 2123 function uge_fd: byte;
2124 begin 2124 begin
2125 if Assigned(FDCallback) then FDCallback; 2125 if Assigned(FDCallback) then FDCallback;
2126 Result := 0; 2126 Result := 0;
2127 end; 2127 end;
2128 2128
2129 function uge_fc: byte;
2130 begin
2131 if Assigned(FCCallback) then FCCallback;
2132 writeln('fc');
2133 Result := 0;
2134 end;
2135
2129 function rlc_b: byte; 2136 function rlc_b: byte;
2130 begin 2137 begin
2131 af.l := rlcr_f[bc.h]; 2138 af.l := rlcr_f[bc.h];
@@ -4383,8 +4390,8 @@ begin
4383 Z80[249] := @ld_sp_hl; 4390 Z80[249] := @ld_sp_hl;
4384 Z80[250] := @ld_a_nn; 4391 Z80[250] := @ld_a_nn;
4385 Z80[251] := @ei; 4392 Z80[251] := @ei;
4386 Z80[252] := @unimplemented; 4393 Z80[252] := @uge_fc;
4387 Z80[253] := @PFX_FD; 4394 Z80[253] := @uge_fd;
4388 Z80[254] := @cp_XX; 4395 Z80[254] := @cp_XX;
4389 Z80[255] := @rst_56; 4396 Z80[255] := @rst_56;
4390 4397
ModifiedGlobal/vars.pas +2−2
@@ -8,7 +8,7 @@ unit vars;
8 interface 8 interface
9 9
10 type 10 type
11 TFDCallback = procedure of object; 11 TCPUCallback = procedure of object;
12 12
13 const 13 const
14 thr_f: integer = 1; 14 thr_f: integer = 1;
@@ -16,7 +16,7 @@ const
16 isddraw: boolean = True; // DirectDraw; 16 isddraw: boolean = True; // DirectDraw;
17 17
18 var 18 var
19 FDCallback: TFDCallback; 19 FDCallback, FCCallback: TCPUCallback;
20 20
21 bdrop, dirname, dirload: string; 21 bdrop, dirname, dirload: string;
22 romname, speicher: string[128]; 22 romname, speicher: string[128];
Modifiedcodegen.pas +12−3
@@ -23,12 +23,12 @@ type
23 TExportMode = (emNormal, emPreview, emGBS); 23 TExportMode = (emNormal, emPreview, emGBS);
24 24
25 procedure AssembleSong(Song: TSong; Filename: string; Mode: TExportMode = emNormal); 25 procedure AssembleSong(Song: TSong; Filename: string; Mode: TExportMode = emNormal);
26 procedure RenderSongToGBDKC(Song: TSong; DescriptorName: String; Filename: string); 26 procedure RenderSongToGBDKC(Song: TSong; DescriptorName: String; Filename: string; Bank: Integer = -1);
27 procedure RenderSongToRGBDSAsm(Song: TSong; DescriptorName: String; Filename: string); 27 procedure RenderSongToRGBDSAsm(Song: TSong; DescriptorName: String; Filename: string);
28 28
29 implementation 29 implementation
30 30
31 procedure RenderSongToGBDKC(Song: TSong; DescriptorName: String; Filename: string); 31 procedure RenderSongToGBDKC(Song: TSong; DescriptorName: String; Filename: string; Bank: Integer = -1);
32 function RenderGBDKCell(Cell: TCell): string; 32 function RenderGBDKCell(Cell: TCell): string;
33 var 33 var
34 SL: TStringList; 34 SL: TStringList;
@@ -154,6 +154,12 @@ begin
154 Song := OptimizeSong(Song); 154 Song := OptimizeSong(Song);
155 155
156 OutSL := TStringList.Create; 156 OutSL := TStringList.Create;
157
158 if Bank <> -1 then begin
159 OutSL.Add('#pragma bank '+IntToStr(Bank));
160 OutSL.Add('');
161 end;
162
157 OutSL.Add('#include "hUGEDriver.h"'); 163 OutSL.Add('#include "hUGEDriver.h"');
158 OutSL.Add('#include <stddef.h>'); 164 OutSL.Add('#include <stddef.h>');
159 OutSL.Add(''); 165 OutSL.Add('');
@@ -187,6 +193,9 @@ begin
187 OutSL.Add(RenderGBDKWaves(Song.Waves)); 193 OutSL.Add(RenderGBDKWaves(Song.Waves));
188 OutSL.Add(''); 194 OutSL.Add('');
189 195
196 if Bank <> -1 then
197 OutSL.Add(Format('const void __at(%d) __bank_%s;', [Bank, DescriptorName]));
198
190 OutSL.Add(Format( 199 OutSL.Add(Format(
191 'const hUGESong_t %s = {%d, &order_cnt, order1, order2, order3,'+ 200 'const hUGESong_t %s = {%d, &order_cnt, order1, order2, order3,'+
192 'order4, duty_instruments, wave_instruments, noise_instruments, NULL, waves};', 201 'order4, duty_instruments, wave_instruments, noise_instruments, NULL, waves};',
@@ -434,7 +443,7 @@ begin
434 Stream.Free; 443 Stream.Free;
435 end; 444 end;
436 445
437 procedure AssembleSong(Song: TSong; Filename: String; Mode: TExportMode = emNormal); 446 procedure AssembleSong(Song: TSong; Filename: string; Mode: TExportMode);
438 var 447 var
439 OutFile: Text; 448 OutFile: Text;
440 I: integer; 449 I: integer;
ModifiedhUGEDriver +1−1
@@ -1 +1 @@
1 Subproject commit e9964787c7183c4f3e67e4c0967fe64f4ea19916 1 Subproject commit 814470995faf3bb7b732d4d7eea2f2deb62fc108
Modifiedrendertowave.pas +2−2
@@ -174,7 +174,7 @@ end;
174 174
175 procedure TfrmRenderToWave.RenderEntireSong(Times: Integer); 175 procedure TfrmRenderToWave.RenderEntireSong(Times: Integer);
176 var 176 var
177 OldFD: TFDCallback; 177 OldFD: TCPUCallback;
178 begin 178 begin
179 OldFD := FDCallback; 179 OldFD := FDCallback;
180 FDCallback := @OrderCheckFD; 180 FDCallback := @OrderCheckFD;
@@ -194,7 +194,7 @@ end;
194 194
195 procedure TfrmRenderToWave.RenderFromPosition(FromPos, ToPos: Integer); 195 procedure TfrmRenderToWave.RenderFromPosition(FromPos, ToPos: Integer);
196 var 196 var
197 OldFD: TFDCallback; 197 OldFD: TCPUCallback;
198 StartPattern, TargetPattern: Integer; 198 StartPattern, TargetPattern: Integer;
199 SawTargetPattern: Boolean; 199 SawTargetPattern: Boolean;
200 begin 200 begin
Modifiedtracker.lfm +78−78
@@ -1,12 +1,12 @@
1 object frmTracker: TfrmTracker 1 object frmTracker: TfrmTracker
2 Left = 899 2 Left = 744
3 Height = 653 3 Height = 653
4 Top = 424 4 Top = 270
5 Width = 1232 5 Width = 1232
6 AllowDropFiles = True 6 AllowDropFiles = True
7 Caption = 'hUGETracker' 7 Caption = 'hUGETracker'
8 ClientHeight = 0 8 ClientHeight = 633
9 ClientWidth = 0 9 ClientWidth = 1232
10 KeyPreview = True 10 KeyPreview = True
11 Menu = MainMenu1 11 Menu = MainMenu1
12 OnCloseQuery = FormCloseQuery 12 OnCloseQuery = FormCloseQuery
@@ -20,8 +20,8 @@ object frmTracker: TfrmTracker
20 LCLVersion = '2.0.11.0' 20 LCLVersion = '2.0.11.0'
21 object TreeView1: TTreeView 21 object TreeView1: TTreeView
22 Left = 0 22 Left = 0
23 Height = 0 23 Height = 521
24 Top = 0 24 Top = 89
25 Width = 193 25 Width = 193
26 Align = alLeft 26 Align = alLeft
27 ParentFont = False 27 ParentFont = False
@@ -40,27 +40,27 @@ object frmTracker: TfrmTracker
40 } 40 }
41 end 41 end
42 object Splitter1: TSplitter 42 object Splitter1: TSplitter
43 Left = 0 43 Left = 193
44 Height = 0 44 Height = 521
45 Top = 0 45 Top = 89
46 Width = 5 46 Width = 5
47 end 47 end
48 object Panel1: TPanel 48 object Panel1: TPanel
49 Left = 0 49 Left = 198
50 Height = 0 50 Height = 521
51 Top = 0 51 Top = 89
52 Width = 0 52 Width = 1034
53 Align = alClient 53 Align = alClient
54 BevelOuter = bvNone 54 BevelOuter = bvNone
55 ClientHeight = 0 55 ClientHeight = 521
56 ClientWidth = 0 56 ClientWidth = 1034
57 ParentFont = False 57 ParentFont = False
58 TabOrder = 2 58 TabOrder = 2
59 object PageControl1: TPageControl 59 object PageControl1: TPageControl
60 Left = 0 60 Left = 0
61 Height = 0 61 Height = 521
62 Top = 0 62 Top = 0
63 Width = 0 63 Width = 1034
64 ActivePage = InstrumentTabSheet 64 ActivePage = InstrumentTabSheet
65 Align = alClient 65 Align = alClient
66 ParentFont = False 66 ParentFont = False
@@ -313,8 +313,8 @@ object frmTracker: TfrmTracker
313 end 313 end
314 object InstrumentTabSheet: TTabSheet 314 object InstrumentTabSheet: TTabSheet
315 Caption = 'Instruments' 315 Caption = 'Instruments'
316 ClientHeight = 0 316 ClientHeight = 493
317 ClientWidth = 0 317 ClientWidth = 1026
318 ParentFont = False 318 ParentFont = False
319 object PaintBox1: TPaintBox 319 object PaintBox1: TPaintBox
320 AnchorSideTop.Control = FlowPanel1 320 AnchorSideTop.Control = FlowPanel1
@@ -323,8 +323,8 @@ object frmTracker: TfrmTracker
323 Left = 0 323 Left = 0
324 Height = 0 324 Height = 0
325 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'
326 Top = 0 326 Top = 493
327 Width = 0 327 Width = 1026
328 Align = alClient 328 Align = alClient
329 Color = clBlack 329 Color = clBlack
330 ParentColor = False 330 ParentColor = False
@@ -334,9 +334,9 @@ object frmTracker: TfrmTracker
334 end 334 end
335 object FlowPanel1: TFlowPanel 335 object FlowPanel1: TFlowPanel
336 Left = 0 336 Left = 0
337 Height = 1008 337 Height = 675
338 Top = 0 338 Top = 0
339 Width = 0 339 Width = 1026
340 Align = alTop 340 Align = alTop
341 AutoSize = True 341 AutoSize = True
342 BevelOuter = bvNone 342 BevelOuter = bvNone
@@ -512,9 +512,9 @@ object frmTracker: TfrmTracker
512 end 512 end
513 end 513 end
514 object EnvelopeGroupBox: TGroupBox 514 object EnvelopeGroupBox: TGroupBox
515 Left = 7 515 Left = 292
516 Height = 136 516 Height = 136
517 Top = 262 517 Top = 7
518 Width = 582 518 Width = 582
519 Anchors = [] 519 Anchors = []
520 BorderSpacing.Left = 7 520 BorderSpacing.Left = 7
@@ -618,7 +618,7 @@ object frmTracker: TfrmTracker
618 object SquareGroupBox: TGroupBox 618 object SquareGroupBox: TGroupBox
619 Left = 7 619 Left = 7
620 Height = 169 620 Height = 169
621 Top = 412 621 Top = 262
622 Width = 319 622 Width = 319
623 Anchors = [] 623 Anchors = []
624 BorderSpacing.Left = 7 624 BorderSpacing.Left = 7
@@ -747,9 +747,9 @@ object frmTracker: TfrmTracker
747 end 747 end
748 end 748 end
749 object WaveGroupBox: TGroupBox 749 object WaveGroupBox: TGroupBox
750 Left = 7 750 Left = 340
751 Height = 169 751 Height = 169
752 Top = 595 752 Top = 262
753 Width = 297 753 Width = 297
754 Anchors = [] 754 Anchors = []
755 BorderSpacing.Left = 7 755 BorderSpacing.Left = 7
@@ -858,7 +858,7 @@ object frmTracker: TfrmTracker
858 object NoiseGroupBox: TGroupBox 858 object NoiseGroupBox: TGroupBox
859 Left = 7 859 Left = 7
860 Height = 223 860 Height = 223
861 Top = 778 861 Top = 445
862 Width = 397 862 Width = 397
863 Anchors = [] 863 Anchors = []
864 BorderSpacing.Left = 7 864 BorderSpacing.Left = 7
@@ -1588,12 +1588,12 @@ object frmTracker: TfrmTracker
1588 object Panel2: TPanel 1588 object Panel2: TPanel
1589 Left = 0 1589 Left = 0
1590 Height = 64 1590 Height = 64
1591 Top = 0 1591 Top = 25
1592 Width = 0 1592 Width = 1232
1593 Align = alTop 1593 Align = alTop
1594 BevelOuter = bvNone 1594 BevelOuter = bvNone
1595 ClientHeight = 64 1595 ClientHeight = 64
1596 ClientWidth = 0 1596 ClientWidth = 1232
1597 ParentFont = False 1597 ParentFont = False
1598 TabOrder = 3 1598 TabOrder = 3
1599 object LEDMeter1: TLEDMeter 1599 object LEDMeter1: TLEDMeter
@@ -1601,7 +1601,7 @@ object frmTracker: TfrmTracker
1601 Left = 0 1601 Left = 0
1602 Height = 32 1602 Height = 32
1603 Top = 32 1603 Top = 32
1604 Width = 0 1604 Width = 444
1605 Anchors = [akTop, akLeft, akRight] 1605 Anchors = [akTop, akLeft, akRight]
1606 BevelStyle = bvLowered 1606 BevelStyle = bvLowered
1607 Colors.Border = 2168839 1607 Colors.Border = 2168839
@@ -1624,7 +1624,7 @@ object frmTracker: TfrmTracker
1624 Left = 0 1624 Left = 0
1625 Height = 32 1625 Height = 32
1626 Top = 0 1626 Top = 0
1627 Width = 0 1627 Width = 444
1628 Anchors = [akTop, akLeft, akRight] 1628 Anchors = [akTop, akLeft, akRight]
1629 BevelStyle = bvLowered 1629 BevelStyle = bvLowered
1630 Colors.Border = 2168839 1630 Colors.Border = 2168839
@@ -1643,7 +1643,7 @@ object frmTracker: TfrmTracker
1643 Section3Value = 48 1643 Section3Value = 48
1644 end 1644 end
1645 object Duty1Visualizer: TPaintBox 1645 object Duty1Visualizer: TPaintBox
1646 Left = -197 1646 Left = 444
1647 Height = 64 1647 Height = 64
1648 Top = 0 1648 Top = 0
1649 Width = 197 1649 Width = 197
@@ -1653,7 +1653,7 @@ object frmTracker: TfrmTracker
1653 OnPaint = Duty1VisualizerPaint 1653 OnPaint = Duty1VisualizerPaint
1654 end 1654 end
1655 object Duty2Visualizer: TPaintBox 1655 object Duty2Visualizer: TPaintBox
1656 Left = -197 1656 Left = 641
1657 Height = 64 1657 Height = 64
1658 Top = 0 1658 Top = 0
1659 Width = 197 1659 Width = 197
@@ -1663,7 +1663,7 @@ object frmTracker: TfrmTracker
1663 OnPaint = Duty2VisualizerPaint 1663 OnPaint = Duty2VisualizerPaint
1664 end 1664 end
1665 object WaveVisualizer: TPaintBox 1665 object WaveVisualizer: TPaintBox
1666 Left = -197 1666 Left = 838
1667 Height = 64 1667 Height = 64
1668 Top = 0 1668 Top = 0
1669 Width = 197 1669 Width = 197
@@ -1673,7 +1673,7 @@ object frmTracker: TfrmTracker
1673 OnPaint = WaveVisualizerPaint 1673 OnPaint = WaveVisualizerPaint
1674 end 1674 end
1675 object NoiseVisualizer: TPaintBox 1675 object NoiseVisualizer: TPaintBox
1676 Left = -197 1676 Left = 1035
1677 Height = 64 1677 Height = 64
1678 Top = 0 1678 Top = 0
1679 Width = 197 1679 Width = 197
@@ -1686,8 +1686,8 @@ object frmTracker: TfrmTracker
1686 object StatusBar1: TStatusBar 1686 object StatusBar1: TStatusBar
1687 Left = 0 1687 Left = 0
1688 Height = 23 1688 Height = 23
1689 Top = -23 1689 Top = 610
1690 Width = 0 1690 Width = 1232
1691 AutoHint = True 1691 AutoHint = True
1692 Panels = < 1692 Panels = <
1693 item 1693 item
@@ -1706,9 +1706,9 @@ object frmTracker: TfrmTracker
1706 end 1706 end
1707 object ToolBar1: TToolBar 1707 object ToolBar1: TToolBar
1708 Left = 0 1708 Left = 0
1709 Height = 420 1709 Height = 25
1710 Top = 0 1710 Top = 0
1711 Width = 0 1711 Width = 1232
1712 AutoSize = True 1712 AutoSize = True
1713 Caption = 'ToolBar1' 1713 Caption = 'ToolBar1'
1714 EdgeBorders = [ebBottom] 1714 EdgeBorders = [ebBottom]
@@ -1725,9 +1725,9 @@ object frmTracker: TfrmTracker
1725 ParentShowHint = False 1725 ParentShowHint = False
1726 end 1726 end
1727 object PanicToolButton: TToolButton 1727 object PanicToolButton: TToolButton
1728 Left = 1 1728 Left = 557
1729 Hint = 'Stops all sound output' 1729 Hint = 'Stops all sound output'
1730 Top = 220 1730 Top = 0
1731 AutoSize = True 1731 AutoSize = True
1732 Caption = 'Panic' 1732 Caption = 'Panic'
1733 ImageIndex = 72 1733 ImageIndex = 72
@@ -1736,50 +1736,50 @@ object frmTracker: TfrmTracker
1736 ShowHint = True 1736 ShowHint = True
1737 end 1737 end
1738 object ToolButton2: TToolButton 1738 object ToolButton2: TToolButton
1739 Left = 1 1739 Left = 147
1740 Top = 66 1740 Top = 0
1741 Action = PlayCursorAction 1741 Action = PlayCursorAction
1742 end 1742 end
1743 object ToolButton4: TToolButton 1743 object ToolButton4: TToolButton
1744 Left = 1 1744 Left = 221
1745 Top = 88 1745 Top = 0
1746 Action = StopAction 1746 Action = StopAction
1747 end 1747 end
1748 object ExportGBButton: TToolButton 1748 object ExportGBButton: TToolButton
1749 Left = 1 1749 Left = 291
1750 Hint = 'Export the song as a standalone ROM' 1750 Hint = 'Export the song as a standalone ROM'
1751 Top = 132 1751 Top = 0
1752 AutoSize = True 1752 AutoSize = True
1753 Caption = 'Export .GB' 1753 Caption = 'Export .GB'
1754 ImageIndex = 76 1754 ImageIndex = 76
1755 OnClick = ExportGBButtonClick 1755 OnClick = ExportGBButtonClick
1756 end 1756 end
1757 object ToolButton8: TToolButton 1757 object ToolButton8: TToolButton
1758 Left = 1 1758 Left = 79
1759 Height = 22 1759 Height = 22
1760 Top = 22 1760 Top = 0
1761 Caption = 'ToolButton8' 1761 Caption = 'ToolButton8'
1762 Style = tbsDivider 1762 Style = tbsDivider
1763 end 1763 end
1764 object ToolButton6: TToolButton 1764 object ToolButton6: TToolButton
1765 Left = 1 1765 Left = 286
1766 Height = 22 1766 Height = 22
1767 Top = 110 1767 Top = 0
1768 Caption = 'ToolButton6' 1768 Caption = 'ToolButton6'
1769 Style = tbsDivider 1769 Style = tbsDivider
1770 end 1770 end
1771 object ToolButton7: TToolButton 1771 object ToolButton7: TToolButton
1772 Left = 1 1772 Left = 1097
1773 Height = 22 1773 Height = 22
1774 Top = 396 1774 Top = 0
1775 Caption = 'ToolButton7' 1775 Caption = 'ToolButton7'
1776 Style = tbsSeparator 1776 Style = tbsSeparator
1777 end 1777 end
1778 object OctaveSpinEdit: TSpinEdit 1778 object OctaveSpinEdit: TSpinEdit
1779 Left = 1 1779 Left = 663
1780 Height = 23 1780 Height = 23
1781 Hint = 'The octave offset for entering new notes' 1781 Hint = 'The octave offset for entering new notes'
1782 Top = 286 1782 Top = 0
1783 Width = 65 1783 Width = 65
1784 MaxValue = 5 1784 MaxValue = 5
1785 OnChange = OctaveSpinEditChange 1785 OnChange = OctaveSpinEditChange
@@ -1787,16 +1787,16 @@ object frmTracker: TfrmTracker
1787 TabOrder = 0 1787 TabOrder = 0
1788 end 1788 end
1789 object ToolButton9: TToolButton 1789 object ToolButton9: TToolButton
1790 Left = 1 1790 Left = 612
1791 Height = 22 1791 Height = 22
1792 Top = 242 1792 Top = 0
1793 Caption = 'ToolButton9' 1793 Caption = 'ToolButton9'
1794 Style = tbsSeparator 1794 Style = tbsSeparator
1795 end 1795 end
1796 object Label22: TLabel 1796 object Label22: TLabel
1797 Left = 1 1797 Left = 620
1798 Height = 22 1798 Height = 22
1799 Top = 264 1799 Top = 0
1800 Width = 43 1800 Width = 43
1801 AutoSize = False 1801 AutoSize = False
1802 Caption = 'Octave ' 1802 Caption = 'Octave '
@@ -1805,9 +1805,9 @@ object frmTracker: TfrmTracker
1805 ParentFont = False 1805 ParentFont = False
1806 end 1806 end
1807 object Label23: TLabel 1807 object Label23: TLabel
1808 Left = 1 1808 Left = 728
1809 Height = 22 1809 Height = 22
1810 Top = 308 1810 Top = 0
1811 Width = 70 1811 Width = 70
1812 AutoSize = False 1812 AutoSize = False
1813 Caption = ' Instrument ' 1813 Caption = ' Instrument '
@@ -1816,10 +1816,10 @@ object frmTracker: TfrmTracker
1816 ParentFont = False 1816 ParentFont = False
1817 end 1817 end
1818 object InstrumentComboBox: TComboBox 1818 object InstrumentComboBox: TComboBox
1819 Left = 1 1819 Left = 798
1820 Height = 23 1820 Height = 23
1821 Hint = 'The selected instrument for new notes' 1821 Hint = 'The selected instrument for new notes'
1822 Top = 330 1822 Top = 0
1823 Width = 214 1823 Width = 214
1824 DropDownCount = 999 1824 DropDownCount = 999
1825 ItemHeight = 15 1825 ItemHeight = 15
@@ -1834,9 +1834,9 @@ object frmTracker: TfrmTracker
1834 Text = '(no instrument)' 1834 Text = '(no instrument)'
1835 end 1835 end
1836 object Label24: TLabel 1836 object Label24: TLabel
1837 Left = 1 1837 Left = 1012
1838 Height = 22 1838 Height = 22
1839 Top = 352 1839 Top = 0
1840 Width = 35 1840 Width = 35
1841 AutoSize = False 1841 AutoSize = False
1842 Caption = ' Step ' 1842 Caption = ' Step '
@@ -1845,10 +1845,10 @@ object frmTracker: TfrmTracker
1845 ParentFont = False 1845 ParentFont = False
1846 end 1846 end
1847 object StepSpinEdit: TSpinEdit 1847 object StepSpinEdit: TSpinEdit
1848 Left = 1 1848 Left = 1047
1849 Height = 23 1849 Height = 23
1850 Hint = 'How many rows to step down after entering a new note' 1850 Hint = 'How many rows to step down after entering a new note'
1851 Top = 374 1851 Top = 0
1852 Width = 50 1852 Width = 50
1853 MaxValue = 63 1853 MaxValue = 63
1854 OnChange = StepSpinEditChange 1854 OnChange = StepSpinEditChange
@@ -1856,29 +1856,29 @@ object frmTracker: TfrmTracker
1856 TabOrder = 2 1856 TabOrder = 2
1857 end 1857 end
1858 object ToolButton3: TToolButton 1858 object ToolButton3: TToolButton
1859 Left = 1 1859 Left = 84
1860 Top = 44 1860 Top = 0
1861 Action = PlayStartAction 1861 Action = PlayStartAction
1862 end 1862 end
1863 object ExportGBSButton: TToolButton 1863 object ExportGBSButton: TToolButton
1864 Left = 1 1864 Left = 372
1865 Hint = 'Export the song as a GBS soundtrack' 1865 Hint = 'Export the song as a GBS soundtrack'
1866 Top = 154 1866 Top = 0
1867 Caption = 'Export .GBS' 1867 Caption = 'Export .GBS'
1868 ImageIndex = 76 1868 ImageIndex = 76
1869 OnClick = ExportGBSButtonClick 1869 OnClick = ExportGBSButtonClick
1870 end 1870 end
1871 object ToolButton5: TToolButton 1871 object ToolButton5: TToolButton
1872 Left = 1 1872 Left = 552
1873 Height = 22 1873 Height = 22
1874 Top = 198 1874 Top = 0
1875 Caption = 'ToolButton5' 1875 Caption = 'ToolButton5'
1876 Style = tbsDivider 1876 Style = tbsDivider
1877 end 1877 end
1878 object ToolButton10: TToolButton 1878 object ToolButton10: TToolButton
1879 Left = 1 1879 Left = 459
1880 Hint = 'Export the song as WAV or MP3' 1880 Hint = 'Export the song as WAV or MP3'
1881 Top = 176 1881 Top = 0
1882 Caption = 'Render Song' 1882 Caption = 'Render Song'
1883 ImageIndex = 77 1883 ImageIndex = 77
1884 OnClick = ToolButton10Click 1884 OnClick = ToolButton10Click
Modifieduge2source.lpi +1−1
@@ -76,7 +76,7 @@
76 </Target> 76 </Target>
77 <SearchPaths> 77 <SearchPaths>
78 <IncludeFiles Value="$(ProjOutDir)"/> 78 <IncludeFiles Value="$(ProjOutDir)"/>
79 <OtherUnitFiles Value="C:\Projects\GB-Stuff\uge"/> 79 <OtherUnitFiles Value="."/>
80 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 80 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
81 </SearchPaths> 81 </SearchPaths>
82 </CompilerOptions> 82 </CompilerOptions>
Modifieduge2source.lpr +9−3
@@ -30,9 +30,10 @@ var
30 Song: TSong; 30 Song: TSong;
31 NonOpts: TStringArray; 31 NonOpts: TStringArray;
32 S: TStream; 32 S: TStream;
33 Bank: Integer;
33 begin 34 begin
34 // quick check parameters 35 // quick check parameters
35 ErrorMsg:=CheckOptions('h', 'help'); 36 ErrorMsg:=CheckOptions('hb:', ['help', 'bank:']);
36 if ErrorMsg<>'' then begin 37 if ErrorMsg<>'' then begin
37 ShowException(Exception.Create(ErrorMsg)); 38 ShowException(Exception.Create(ErrorMsg));
38 Terminate; 39 Terminate;
@@ -47,7 +48,7 @@ begin
47 end; 48 end;
48 49
49 // Grab non-options 50 // Grab non-options
50 NonOpts := GetNonOptions('h', ['help']); 51 NonOpts := GetNonOptions('hb:', ['help', 'bank:']);
51 52
52 S := TFileStream.Create(NonOpts[0], fmOpenRead); 53 S := TFileStream.Create(NonOpts[0], fmOpenRead);
53 54
@@ -57,9 +58,14 @@ begin
57 S.Free; 58 S.Free;
58 end; 59 end;
59 60
61 if HasOption('b', 'bank') then
62 Bank := StrToInt(GetOptionValue('b', 'bank'))
63 else
64 Bank := -1;
65
60 case LowerCase(ExtractFileExt(NonOpts[2])) of 66 case LowerCase(ExtractFileExt(NonOpts[2])) of
61 '.c': begin 67 '.c': begin
62 RenderSongToGBDKC(Song, NonOpts[1], NonOpts[2]); 68 RenderSongToGBDKC(Song, NonOpts[1], NonOpts[2], Bank);
63 end; 69 end;
64 '.asm': begin 70 '.asm': begin
65 RenderSongToRGBDSAsm(Song, NonOpts[1], NonOpts[2]); 71 RenderSongToRGBDSAsm(Song, NonOpts[1], NonOpts[2]);