Commit 93d4262

Nick committed on
Work on linux font installation
commit 93d4262790fa76de41bdf01742b6f324c530f13b parent f51c3f2
6 changed files +24−35
ModifiedGBEmu.lpi +0−3
@@ -131,9 +131,6 @@
131 <ShowHintsForSenderNotUsed Value="True"/> 131 <ShowHintsForSenderNotUsed Value="True"/>
132 </Verbosity> 132 </Verbosity>
133 <CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL -dPRODUCTION"/> 133 <CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL -dPRODUCTION"/>
134 <ExecuteAfter>
135 <Command Value="$MakeExe(ide,$Path($(CompPath))/instantfpc) --compiler=&quot;$(CompPath)&quot; PostBuild.pas &quot;$Path($(TargetFile))&quot;"/>
136 </ExecuteAfter>
137 </Other> 134 </Other>
138 </CompilerOptions> 135 </CompilerOptions>
139 </Item3> 136 </Item3>
ModifiedGBEmu.lpr +18−19
@@ -2,28 +2,19 @@ program GBEmu;
2 2
3 {$MODE Delphi} 3 {$MODE Delphi}
4 4
5 {$ifdef DARWIN}
6 {$linklib SDL2}
7 {$endif}
8
5 uses 9 uses
6 {$ifdef unix} 10 {$ifdef unix}
7 cthreads, 11 // cthreads,
8 // cmem, // the c memory manager is on some systems much faster for multi-threading
9 {$endif} 12 {$endif}
10
11 {$ifdef MSWINDOWS} 13 {$ifdef MSWINDOWS}
12 windows, 14 Windows,
13 {$endif} 15 {$endif}
14 16 FileUtil,
15 {$ifdef UNIX} 17 SysUtils,
16 // font includes here
17 {$endif}
18
19 {$ifdef DARWIN}
20 // font includes here
21 {$endif}
22
23 {$ifdef DEVELOPMENT}
24 SysUtils,
25 {$endif}
26
27 Forms, 18 Forms,
28 Interfaces, 19 Interfaces,
29 Tracker in 'Tracker.pas', 20 Tracker in 'Tracker.pas',
@@ -58,8 +49,7 @@ begin
58 {$endIf} 49 {$endIf}
59 50
60 { Before the LCL starts, embed Pixelite so users dont have to install it. 51 { Before the LCL starts, embed Pixelite so users dont have to install it.
61 Unfortunately there isn't really a cross-platform way to do it, so here's an 52 Unfortunately there isn't really a cross-platform way to do it. }
62 ifdef mess. }
63 53
64 {$ifdef MSWINDOWS} 54 {$ifdef MSWINDOWS}
65 // $10 is FR_PRIVATE which uninstalls the font when the process ends 55 // $10 is FR_PRIVATE which uninstalls the font when the process ends
@@ -67,6 +57,15 @@ begin
67 Writeln(StdErr, '[ERROR] Couldn''t load Pixelite!!!'); 57 Writeln(StdErr, '[ERROR] Couldn''t load Pixelite!!!');
68 {$endif} 58 {$endif}
69 59
60 {$ifdef UNIX}
61 if not DirectoryExists(GetUserDir+'.fonts') then
62 CreateDir(GetUserDir+'.fonts');
63
64 if not (CopyFile('./PixeliteTTF.ttf', GetUserDir+'.fonts/PixeliteTTF.ttf')
65 and (ExecuteProcess('/bin/bash', '-c fc-cache') = 0))
66 then Writeln(StdErr, '[ERROR] Couldn''t copy Pixelite to ~/.fonts !!!');
67 {$endif}
68
70 {$ifdef PRODUCTION} 69 {$ifdef PRODUCTION}
71 Assign(Output, 'output.log'); 70 Assign(Output, 'output.log');
72 Rewrite(Output); 71 Rewrite(Output);
Modifiedsong.pas +1−1
@@ -571,7 +571,7 @@ var
571 571
572 Ch4Freq := Trunc((524288 / RealR) / 2**(PolyCounter.ShiftClockFrequency+1)); 572 Ch4Freq := Trunc((524288 / RealR) / 2**(PolyCounter.ShiftClockFrequency+1));
573 if not Ch4FreqToNoteCodeMap.TryGetData(Ch4Freq, Pat[I].Note) then 573 if not Ch4FreqToNoteCodeMap.TryGetData(Ch4Freq, Pat[I].Note) then
574 writeln('[DEBUG] Note value ', Pat[I].Note, ' not found.'); 574 writeln(StdErr, '[DEBUG] Note value ', Pat[I].Note, ' not found.');
575 end; 575 end;
576 end; 576 end;
577 begin 577 begin
Modifiedsymparser.pas +5−5
@@ -55,7 +55,7 @@ end;
55 function SymbolAddress(Symbol: String): Integer; 55 function SymbolAddress(Symbol: String): Integer;
56 begin 56 begin
57 if not SymbolTable.TryGetData(Symbol, Result) then begin 57 if not SymbolTable.TryGetData(Symbol, Result) then begin
58 Writeln('[WARNING] Attempting to read address of unloaded symbol: ', symbol); 58 Writeln(StdErr, '[WARNING] Attempting to read address of unloaded symbol: ', symbol);
59 Result := 0; 59 Result := 0;
60 end; 60 end;
61 end; 61 end;
@@ -64,7 +64,7 @@ function PeekSymbol(Symbol: String): Integer;
64 begin 64 begin
65 if SymbolTable = nil then exit(0); 65 if SymbolTable = nil then exit(0);
66 if SymbolTable.IndexOf(Symbol) = -1 then begin 66 if SymbolTable.IndexOf(Symbol) = -1 then begin
67 WriteLn('[WARNING] Attempting to peek unloaded symbol: ', symbol); 67 WriteLn(StdErr, '[WARNING] Attempting to peek unloaded symbol: ', symbol);
68 Exit(0); 68 Exit(0);
69 end; 69 end;
70 70
@@ -75,7 +75,7 @@ procedure PokeSymbol(Symbol: String; Value: Byte);
75 begin 75 begin
76 if SymbolTable = nil then exit; 76 if SymbolTable = nil then exit;
77 if SymbolTable.IndexOf(Symbol) = -1 then begin 77 if SymbolTable.IndexOf(Symbol) = -1 then begin
78 WriteLn('[WARNING] Attempting to poke unloaded symbol: ', symbol); 78 WriteLn(StdErr, '[WARNING] Attempting to poke unloaded symbol: ', symbol);
79 Exit; 79 Exit;
80 end; 80 end;
81 spokeb(SymbolTable.KeyData[Symbol], Value); 81 spokeb(SymbolTable.KeyData[Symbol], Value);
@@ -85,7 +85,7 @@ function WordPeekSymbol(Symbol: String): Integer;
85 begin 85 begin
86 if SymbolTable = nil then exit(0); 86 if SymbolTable = nil then exit(0);
87 if SymbolTable.IndexOf(Symbol) = -1 then begin 87 if SymbolTable.IndexOf(Symbol) = -1 then begin
88 WriteLn('[WARNING] Attempting to wordpeek unloaded symbol: ', symbol); 88 WriteLn(StdErr, '[WARNING] Attempting to wordpeek unloaded symbol: ', symbol);
89 Exit(0); 89 Exit(0);
90 end; 90 end;
91 91
@@ -96,7 +96,7 @@ procedure WordPokeSymbol(Symbol: String; Value: Word);
96 begin 96 begin
97 if SymbolTable = nil then exit; 97 if SymbolTable = nil then exit;
98 if SymbolTable.IndexOf(Symbol) = -1 then begin 98 if SymbolTable.IndexOf(Symbol) = -1 then begin
99 WriteLn('[WARNING] Attempting to wordpoke unloaded symbol: ', symbol); 99 WriteLn(StdErr, '[WARNING] Attempting to wordpoke unloaded symbol: ', symbol);
100 Exit; 100 Exit;
101 end; 101 end;
102 wordpoke(SymbolTable.KeyData[Symbol], Value); 102 wordpoke(SymbolTable.KeyData[Symbol], Value);
Modifiedtracker.lfm +0−1
@@ -2023,7 +2023,6 @@ object frmTracker: TfrmTracker
2023 object DebugShiteButton: TMenuItem 2023 object DebugShiteButton: TMenuItem
2024 Caption = 'Debug shite' 2024 Caption = 'Debug shite'
2025 Visible = False 2025 Visible = False
2026 OnClick = DebugShiteButtonClick
2027 end 2026 end
2028 end 2027 end
2029 object MenuBarActionList: TActionList 2028 object MenuBarActionList: TActionList
Modifiedtracker.pas +0−6
@@ -258,7 +258,6 @@ type
258 TreeView1: TTreeView; 258 TreeView1: TTreeView;
259 TrackerGrid: TTrackerGrid; 259 TrackerGrid: TTrackerGrid;
260 procedure Button1Click(Sender: TObject); 260 procedure Button1Click(Sender: TObject);
261 procedure DebugShiteButtonClick(Sender: TObject);
262 procedure DecrementCurrentInstrumentActionExecute(Sender: TObject); 261 procedure DecrementCurrentInstrumentActionExecute(Sender: TObject);
263 procedure DeleteRowActionExecute(Sender: TObject); 262 procedure DeleteRowActionExecute(Sender: TObject);
264 procedure DeleteRowActionUpdate(Sender: TObject); 263 procedure DeleteRowActionUpdate(Sender: TObject);
@@ -1896,11 +1895,6 @@ begin
1896 PreviewC5; 1895 PreviewC5;
1897 end; 1896 end;
1898 1897
1899 procedure TfrmTracker.DebugShiteButtonClick(Sender: TObject);
1900 begin
1901 Writeln('current row is ', OrderEditStringGrid.row);
1902 end;
1903
1904 procedure TfrmTracker.DecrementCurrentInstrumentActionExecute(Sender: TObject); 1898 procedure TfrmTracker.DecrementCurrentInstrumentActionExecute(Sender: TObject);
1905 begin 1899 begin
1906 InstrumentComboBox.ItemIndex := EnsureRange(InstrumentComboBox.ItemIndex-1, 0, InstrumentComboBox.Items.Count-1); 1900 InstrumentComboBox.ItemIndex := EnsureRange(InstrumentComboBox.ItemIndex-1, 0, InstrumentComboBox.Items.Count-1);