Commit a7779ed

Nick Faro committed on
Use proper logging instead of writeln
commit a7779eda4ae7d424e90f41d9902de23c7a23df11 parent 763a380
10 changed files +49−54
Modifiedsrc/hUGEDriver +1−1
@@ -1 +1 @@
1 Subproject commit e543ffb071266daad41f09d04689442abe1e27ce 1 Subproject commit ea2161fae768b5cfebee086b0227df86517bf17f
Modifiedsrc/hUGETracker.lpr +4−8
@@ -17,7 +17,7 @@ uses
17 SysUtils, 17 SysUtils,
18 Forms, 18 Forms,
19 Interfaces, 19 Interfaces,
20 20 LazLogger,
21 hUGESettings, 21 hUGESettings,
22 22
23 Tracker, EffectEditor, options, about_hugetracker, rendertowave, findreplace, 23 Tracker, EffectEditor, options, about_hugetracker, rendertowave, findreplace,
@@ -50,7 +50,7 @@ begin
50 DeleteFile('heap.trc'); 50 DeleteFile('heap.trc');
51 SetHeapTraceOutput('heap.trc'); 51 SetHeapTraceOutput('heap.trc');
52 52
53 Writeln(StdErr, '[DEBUG] Using heaptrc...'); 53 DebugLn('[DEBUG] Using heaptrc...');
54 {$endIf} 54 {$endIf}
55 55
56 { Before the LCL starts, embed Pixelite so users dont have to install it. 56 { Before the LCL starts, embed Pixelite so users dont have to install it.
@@ -59,21 +59,17 @@ begin
59 {$ifdef MSWINDOWS} 59 {$ifdef MSWINDOWS}
60 // $10 is FR_PRIVATE which uninstalls the font when the process ends 60 // $10 is FR_PRIVATE which uninstalls the font when the process ends
61 if not AddFontResourceExA(PChar('PixeliteTTF.ttf'), $10) then 61 if not AddFontResourceExA(PChar('PixeliteTTF.ttf'), $10) then
62 Writeln(StdErr, '[ERROR] Couldn''t load Pixelite!!!'); 62 DebugLn('[ERROR] Couldn''t load Pixelite!!!');
63 {$endif} 63 {$endif}
64 64
65 {$if defined(LINUX) or defined(FREEBSD) or defined(OPENBSD)} 65 {$if defined(LINUX) or defined(FREEBSD) or defined(OPENBSD)}
66 // https://gitlab.gnome.org/GNOME/gtk/-/issues/3886 66 // https://gitlab.gnome.org/GNOME/gtk/-/issues/3886
67 if FcConfigAppFontAddFile(nil, PChar('PixeliteTTF.ttf')) = 0 then 67 if FcConfigAppFontAddFile(nil, PChar('PixeliteTTF.ttf')) = 0 then
68 Writeln(StdErr, '[ERROR] Couldn''t load Pixelite!!!'); 68 DebugLn('[ERROR] Couldn''t load Pixelite!!!');
69 69
70 PangoFcFontMapConfigChanged(PangoCairoFontMapGetDefault); 70 PangoFcFontMapConfigChanged(PangoCairoFontMapGetDefault);
71 {$endif} 71 {$endif}
72 72
73 {$ifdef PRODUCTION}
74 Output := StdErr;
75 {$endif}
76
77 Application.Scaled:=True; 73 Application.Scaled:=True;
78 Application.Initialize; 74 Application.Initialize;
79 Application.CreateForm(TfrmTracker, frmTracker); 75 Application.CreateForm(TfrmTracker, frmTracker);
Modifiedsrc/modimport.pas +3−3
@@ -6,7 +6,7 @@ interface
6 6
7 uses 7 uses
8 Classes, SysUtils, Song, hugedatatypes, fgl, math, constants, 8 Classes, SysUtils, Song, hugedatatypes, fgl, math, constants,
9 instruments; 9 instruments, LazLoggerBase;
10 10
11 function LoadSongFromModStream(Stream: TStream): TSong; 11 function LoadSongFromModStream(Stream: TStream): TSong;
12 12
@@ -184,7 +184,7 @@ begin
184 NoiseBreak := 0; 184 NoiseBreak := 0;
185 185
186 if (MR.Instrument < 16) then 186 if (MR.Instrument < 16) then
187 writeln(StdErr, '[DEBUG] Note value ', MR.Note, ' was accompanied by incorrect instrument ', MR.Instrument); 187 DebugLn(['[DEBUG] Note value ', MR.Note, ' was accompanied by incorrect instrument ', MR.Instrument]);
188 188
189 if (MR.Instrument < 32) and (MR.Instrument > 16) then begin 189 if (MR.Instrument < 32) and (MR.Instrument > 16) then begin
190 Instrument := GBT_NOISE[((MR.Instrument - 16) and $1F)]; // Only 0 - 0xF implemented 190 Instrument := GBT_NOISE[((MR.Instrument - 16) and $1F)]; // Only 0 - 0xF implemented
@@ -204,7 +204,7 @@ begin
204 204
205 Ch4Freq := Trunc((524288 / RealR) / 2**(PolyCounter.ShiftClockFrequency+1)); 205 Ch4Freq := Trunc((524288 / RealR) / 2**(PolyCounter.ShiftClockFrequency+1));
206 if not Ch4FreqToNoteCodeMap.TryGetData(Ch4Freq, Result.Note) then 206 if not Ch4FreqToNoteCodeMap.TryGetData(Ch4Freq, Result.Note) then
207 writeln(StdErr, '[DEBUG] Note value ', Result.Note, ' not found.'); 207 DebugLn(['[DEBUG] Note value ', Result.Note, ' not found.']);
208 end else 208 end else
209 Result.Note := NO_NOTE; 209 Result.Note := NO_NOTE;
210 end else 210 end else
Modifiedsrc/song.pas +3−3
@@ -7,7 +7,7 @@ unit Song;
7 7
8 interface 8 interface
9 9
10 uses Classes, HugeDatatypes, instruments, Constants, math, sysutils; 10 uses Classes, HugeDatatypes, instruments, Constants, math, sysutils, LazLoggerBase;
11 11
12 type 12 type
13 ESongVersionException = class(Exception); 13 ESongVersionException = class(Exception);
@@ -701,7 +701,7 @@ var
701 701
702 Ch4Freq := Trunc((524288 / RealR) / 2**(PolyCounter.ShiftClockFrequency+1)); 702 Ch4Freq := Trunc((524288 / RealR) / 2**(PolyCounter.ShiftClockFrequency+1));
703 if not Ch4FreqToNoteCodeMap.TryGetData(Ch4Freq, Pat[I].Note) then 703 if not Ch4FreqToNoteCodeMap.TryGetData(Ch4Freq, Pat[I].Note) then
704 writeln(StdErr, '[DEBUG] Note value ', Pat[I].Note, ' not found.'); 704 DebugLn(['[DEBUG] Note value ', Pat[I].Note, ' not found.']);
705 end; 705 end;
706 end; 706 end;
707 begin 707 begin
@@ -833,7 +833,7 @@ begin
833 for I := Low(Result.OrderMatrix) to High(Result.OrderMatrix) do 833 for I := Low(Result.OrderMatrix) to High(Result.OrderMatrix) do
834 for J := Low(Result.OrderMatrix[I]) to High(Result.OrderMatrix[I])-1 do begin 834 for J := Low(Result.OrderMatrix[I]) to High(Result.OrderMatrix[I])-1 do begin
835 if Result.Patterns.IndexOf(Result.OrderMatrix[I, J]) = -1 then 835 if Result.Patterns.IndexOf(Result.OrderMatrix[I, J]) = -1 then
836 WriteLn(StdErr, '[ERROR] Nonexistent pattern number in order table: ', Result.OrderMatrix[I, J], '!!!'); 836 DebugLn(['[ERROR] Nonexistent pattern number in order table: ', Result.OrderMatrix[I, J], '!!!']);
837 Result.OrderMatrix[I, J] := FindMatchingPattern(Result.Patterns.GetOrCreateNew(Result.OrderMatrix[I, J])^); 837 Result.OrderMatrix[I, J] := FindMatchingPattern(Result.Patterns.GetOrCreateNew(Result.OrderMatrix[I, J])^);
838 end; 838 end;
839 end; 839 end;
Modifiedsrc/sound.pas +2−3
@@ -128,7 +128,7 @@ Bit0 Sound 1 on[1]/off[0]
128 128
129 *) 129 *)
130 130
131 uses Classes, sysutils, sdl2; 131 uses Classes, sysutils, sdl2, LazLoggerBase;
132 132
133 const 133 const
134 SAMPLE_BUFFER_SIZE = 1024; 134 SAMPLE_BUFFER_SIZE = 1024;
@@ -252,8 +252,7 @@ begin
252 z80_decode; 252 z80_decode;
253 253
254 if sndBytesWritten > len then 254 if sndBytesWritten > len then
255 Writeln(StdErr, 255 DebugLn('[WARNING] Audio callback wrote into uninitialized ram! (%d written, %d requested)', [sndBytesWritten, len]);
256 Format('[WARNING] Audio callback wrote into uninitialized ram! (%d written, %d requested)', [sndBytesWritten, len]));
257 end; 256 end;
258 257
259 procedure EnableSound; 258 procedure EnableSound;
Modifiedsrc/symparser.pas +6−6
@@ -5,7 +5,7 @@ unit SymParser;
5 interface 5 interface
6 6
7 uses 7 uses
8 Classes, SysUtils, fgl; 8 Classes, SysUtils, fgl, LazLoggerBase;
9 9
10 type 10 type
11 TSymbolMap = specialize TFPGMap<String, Integer>; 11 TSymbolMap = specialize TFPGMap<String, Integer>;
@@ -69,7 +69,7 @@ end;
69 function SymbolAddress(Symbol: String): Integer; 69 function SymbolAddress(Symbol: String): Integer;
70 begin 70 begin
71 if not SymbolTable.TryGetData(Symbol, Result) then begin 71 if not SymbolTable.TryGetData(Symbol, Result) then begin
72 Writeln(StdErr, '[WARNING] Attempting to read address of unloaded symbol: ', symbol); 72 DebugLn(['[WARNING] Attempting to read address of unloaded symbol: ', symbol]);
73 Result := 0; 73 Result := 0;
74 end; 74 end;
75 end; 75 end;
@@ -77,7 +77,7 @@ end;
77 function PeekSymbol(Symbol: String): Integer; 77 function PeekSymbol(Symbol: String): Integer;
78 begin 78 begin
79 if SymbolTable.IndexOf(Symbol) = -1 then begin 79 if SymbolTable.IndexOf(Symbol) = -1 then begin
80 WriteLn(StdErr, '[WARNING] Attempting to peek unloaded symbol: ', symbol); 80 DebugLn(['[WARNING] Attempting to peek unloaded symbol: ', symbol]);
81 Exit(0); 81 Exit(0);
82 end; 82 end;
83 83
@@ -87,7 +87,7 @@ end;
87 procedure PokeSymbol(Symbol: String; Value: Byte); 87 procedure PokeSymbol(Symbol: String; Value: Byte);
88 begin 88 begin
89 if SymbolTable.IndexOf(Symbol) = -1 then begin 89 if SymbolTable.IndexOf(Symbol) = -1 then begin
90 WriteLn(StdErr, '[WARNING] Attempting to poke unloaded symbol: ', symbol); 90 DebugLn(['[WARNING] Attempting to poke unloaded symbol: ', symbol]);
91 Exit; 91 Exit;
92 end; 92 end;
93 93
@@ -97,7 +97,7 @@ end;
97 function WordPeekSymbol(Symbol: String): Integer; 97 function WordPeekSymbol(Symbol: String): Integer;
98 begin 98 begin
99 if SymbolTable.IndexOf(Symbol) = -1 then begin 99 if SymbolTable.IndexOf(Symbol) = -1 then begin
100 WriteLn(StdErr, '[WARNING] Attempting to wordpeek unloaded symbol: ', symbol); 100 DebugLn('[WARNING] Attempting to wordpeek unloaded symbol: ', symbol);
101 Exit(0); 101 Exit(0);
102 end; 102 end;
103 103
@@ -107,7 +107,7 @@ end;
107 procedure WordPokeSymbol(Symbol: String; Value: Word); 107 procedure WordPokeSymbol(Symbol: String; Value: Word);
108 begin 108 begin
109 if SymbolTable.IndexOf(Symbol) = -1 then begin 109 if SymbolTable.IndexOf(Symbol) = -1 then begin
110 WriteLn(StdErr, '[WARNING] Attempting to wordpoke unloaded symbol: ', symbol); 110 DebugLn('[WARNING] Attempting to wordpoke unloaded symbol: ', symbol);
111 Exit; 111 Exit;
112 end; 112 end;
113 wordpoke(SymbolTable.KeyData[Symbol], Value); 113 wordpoke(SymbolTable.KeyData[Symbol], Value);
Modifiedsrc/tracker.lfm +21−21
@@ -1,7 +1,7 @@
1 object frmTracker: TfrmTracker 1 object frmTracker: TfrmTracker
2 Left = 1027 2 Left = 1751
3 Height = 819 3 Height = 819
4 Top = 223 4 Top = 191
5 Width = 1301 5 Width = 1301
6 AllowDropFiles = True 6 AllowDropFiles = True
7 Caption = 'hUGETracker' 7 Caption = 'hUGETracker'
@@ -1855,7 +1855,7 @@ object frmTracker: TfrmTracker
1855 ParentShowHint = False 1855 ParentShowHint = False
1856 end 1856 end
1857 object PanicToolButton: TToolButton 1857 object PanicToolButton: TToolButton
1858 Left = 474 1858 Left = 482
1859 Hint = 'Stops all sound output' 1859 Hint = 'Stops all sound output'
1860 Top = 0 1860 Top = 0
1861 AutoSize = True 1861 AutoSize = True
@@ -1866,17 +1866,17 @@ object frmTracker: TfrmTracker
1866 ShowHint = True 1866 ShowHint = True
1867 end 1867 end
1868 object ToolButton2: TToolButton 1868 object ToolButton2: TToolButton
1869 Left = 114 1869 Left = 116
1870 Top = 0 1870 Top = 0
1871 Action = PlayCursorAction 1871 Action = PlayCursorAction
1872 end 1872 end
1873 object ToolButton4: TToolButton 1873 object ToolButton4: TToolButton
1874 Left = 143 1874 Left = 145
1875 Top = 0 1875 Top = 0
1876 Action = StopAction 1876 Action = StopAction
1877 end 1877 end
1878 object ExportGBButton: TToolButton 1878 object ExportGBButton: TToolButton
1879 Left = 207 1879 Left = 213
1880 Hint = 'Export the song as a standalone ROM' 1880 Hint = 'Export the song as a standalone ROM'
1881 Top = 0 1881 Top = 0
1882 AutoSize = True 1882 AutoSize = True
@@ -1892,21 +1892,21 @@ object frmTracker: TfrmTracker
1892 Style = tbsDivider 1892 Style = tbsDivider
1893 end 1893 end
1894 object ToolButton6: TToolButton 1894 object ToolButton6: TToolButton
1895 Left = 172 1895 Left = 174
1896 Height = 22 1896 Height = 22
1897 Top = 0 1897 Top = 0
1898 Caption = 'ToolButton6' 1898 Caption = 'ToolButton6'
1899 Style = tbsDivider 1899 Style = tbsDivider
1900 end 1900 end
1901 object ToolButton7: TToolButton 1901 object ToolButton7: TToolButton
1902 Left = 1014 1902 Left = 1025
1903 Height = 22 1903 Height = 22
1904 Top = 0 1904 Top = 0
1905 Caption = 'ToolButton7' 1905 Caption = 'ToolButton7'
1906 Style = tbsSeparator 1906 Style = tbsSeparator
1907 end 1907 end
1908 object OctaveSpinEdit: TSpinEdit 1908 object OctaveSpinEdit: TSpinEdit
1909 Left = 580 1909 Left = 591
1910 Height = 23 1910 Height = 23
1911 Hint = 'The octave offset for entering new notes' 1911 Hint = 'The octave offset for entering new notes'
1912 Top = 0 1912 Top = 0
@@ -1917,14 +1917,14 @@ object frmTracker: TfrmTracker
1917 TabOrder = 0 1917 TabOrder = 0
1918 end 1918 end
1919 object ToolButton9: TToolButton 1919 object ToolButton9: TToolButton
1920 Left = 532 1920 Left = 540
1921 Height = 22 1921 Height = 22
1922 Top = 0 1922 Top = 0
1923 Caption = 'ToolButton9' 1923 Caption = 'ToolButton9'
1924 Style = tbsSeparator 1924 Style = tbsSeparator
1925 end 1925 end
1926 object Label22: TLabel 1926 object Label22: TLabel
1927 Left = 537 1927 Left = 548
1928 Height = 22 1928 Height = 22
1929 Top = 0 1929 Top = 0
1930 Width = 43 1930 Width = 43
@@ -1935,7 +1935,7 @@ object frmTracker: TfrmTracker
1935 ParentFont = False 1935 ParentFont = False
1936 end 1936 end
1937 object Label23: TLabel 1937 object Label23: TLabel
1938 Left = 645 1938 Left = 656
1939 Height = 22 1939 Height = 22
1940 Top = 0 1940 Top = 0
1941 Width = 70 1941 Width = 70
@@ -1946,7 +1946,7 @@ object frmTracker: TfrmTracker
1946 ParentFont = False 1946 ParentFont = False
1947 end 1947 end
1948 object InstrumentComboBox: TComboBox 1948 object InstrumentComboBox: TComboBox
1949 Left = 715 1949 Left = 726
1950 Height = 23 1950 Height = 23
1951 Hint = 'The selected instrument for new notes' 1951 Hint = 'The selected instrument for new notes'
1952 Top = 0 1952 Top = 0
@@ -1964,7 +1964,7 @@ object frmTracker: TfrmTracker
1964 Text = '(no instrument)' 1964 Text = '(no instrument)'
1965 end 1965 end
1966 object Label24: TLabel 1966 object Label24: TLabel
1967 Left = 929 1967 Left = 940
1968 Height = 22 1968 Height = 22
1969 Top = 0 1969 Top = 0
1970 Width = 35 1970 Width = 35
@@ -1975,7 +1975,7 @@ object frmTracker: TfrmTracker
1975 ParentFont = False 1975 ParentFont = False
1976 end 1976 end
1977 object StepSpinEdit: TSpinEdit 1977 object StepSpinEdit: TSpinEdit
1978 Left = 964 1978 Left = 975
1979 Height = 23 1979 Height = 23
1980 Hint = 'How many rows to step down after entering a new note' 1980 Hint = 'How many rows to step down after entering a new note'
1981 Top = 0 1981 Top = 0
@@ -1986,12 +1986,12 @@ object frmTracker: TfrmTracker
1986 TabOrder = 2 1986 TabOrder = 2
1987 end 1987 end
1988 object ToolButton3: TToolButton 1988 object ToolButton3: TToolButton
1989 Left = 85 1989 Left = 87
1990 Top = 0 1990 Top = 0
1991 Action = PlayStartAction 1991 Action = PlayStartAction
1992 end 1992 end
1993 object ExportGBSButton: TToolButton 1993 object ExportGBSButton: TToolButton
1994 Left = 288 1994 Left = 294
1995 Hint = 'Export the song as a GBS soundtrack' 1995 Hint = 'Export the song as a GBS soundtrack'
1996 Top = 0 1996 Top = 0
1997 Caption = 'Export GBS' 1997 Caption = 'Export GBS'
@@ -1999,14 +1999,14 @@ object frmTracker: TfrmTracker
1999 OnClick = ExportGBSButtonClick 1999 OnClick = ExportGBSButtonClick
2000 end 2000 end
2001 object ToolButton5: TToolButton 2001 object ToolButton5: TToolButton
2002 Left = 471 2002 Left = 477
2003 Height = 22 2003 Height = 22
2004 Top = 0 2004 Top = 0
2005 Caption = 'ToolButton5' 2005 Caption = 'ToolButton5'
2006 Style = tbsDivider 2006 Style = tbsDivider
2007 end 2007 end
2008 object ToolButton10: TToolButton 2008 object ToolButton10: TToolButton
2009 Left = 375 2009 Left = 381
2010 Hint = 'Export the song as WAV or MP3' 2010 Hint = 'Export the song as WAV or MP3'
2011 Top = 0 2011 Top = 0
2012 Caption = 'Render Song' 2012 Caption = 'Render Song'
@@ -2014,14 +2014,14 @@ object frmTracker: TfrmTracker
2014 OnClick = ToolButton10Click 2014 OnClick = ToolButton10Click
2015 end 2015 end
2016 object ToolButton11: TToolButton 2016 object ToolButton11: TToolButton
2017 Left = 204 2017 Left = 208
2018 Height = 22 2018 Height = 22
2019 Top = 0 2019 Top = 0
2020 Caption = 'ToolButton11' 2020 Caption = 'ToolButton11'
2021 Style = tbsDivider 2021 Style = tbsDivider
2022 end 2022 end
2023 object LoopSongToolButton: TToolButton 2023 object LoopSongToolButton: TToolButton
2024 Left = 175 2024 Left = 179
2025 Top = 0 2025 Top = 0
2026 ImageIndex = 87 2026 ImageIndex = 87
2027 OnClick = LoopSongToolButtonClick 2027 OnClick = LoopSongToolButtonClick
Modifiedsrc/tracker.pas +1−1
@@ -2022,7 +2022,7 @@ end;
2022 2022
2023 procedure TfrmTracker.MenuItem26Click(Sender: TObject); 2023 procedure TfrmTracker.MenuItem26Click(Sender: TObject);
2024 begin 2024 begin
2025 frmFindReplace.ShowModal; 2025 //frmFindReplace.ShowModal;
2026 end; 2026 end;
2027 2027
2028 procedure TfrmTracker.MenuItem55Click(Sender: TObject); 2028 procedure TfrmTracker.MenuItem55Click(Sender: TObject);
Modifiedsrc/trackergrid.pas +5−5
@@ -7,7 +7,7 @@ interface
7 uses 7 uses
8 Classes, SysUtils, Controls, Graphics, Constants, LCLType, math, LCLIntf, 8 Classes, SysUtils, Controls, Graphics, Constants, LCLType, math, LCLIntf,
9 LMessages, HugeDatatypes, ClipboardUtils, gdeque, gstack, utils, effecteditor, 9 LMessages, HugeDatatypes, ClipboardUtils, gdeque, gstack, utils, effecteditor,
10 Keymap; 10 Keymap, LazLoggerBase;
11 11
12 const 12 const
13 UNDO_STACK_SIZE = 100; 13 UNDO_STACK_SIZE = 100;
@@ -639,7 +639,7 @@ begin
639 Cursor.SelectedPart := High(TCellPart); 639 Cursor.SelectedPart := High(TCellPart);
640 except 640 except
641 on E: Exception do 641 on E: Exception do
642 WriteLn(StdErr, '[DEBUG] Clipboard did not contain valid note data!'); 642 DebugLn('[DEBUG] Clipboard did not contain valid note data!');
643 end; 643 end;
644 end; 644 end;
645 645
@@ -670,7 +670,7 @@ begin
670 end; 670 end;
671 except 671 except
672 on E: EClipboardFormatException do begin 672 on E: EClipboardFormatException do begin
673 WriteLn(StdErr, '[WARNING] ', E.Message); 673 DebugLn('[WARNING] ', E.Message);
674 RevertUndoAction; 674 RevertUndoAction;
675 Exit 675 Exit
676 end; 676 end;
@@ -688,7 +688,7 @@ begin
688 PerformPaste(GetPastedCells, True); 688 PerformPaste(GetPastedCells, True);
689 except 689 except
690 on E: EClipboardFormatException do begin 690 on E: EClipboardFormatException do begin
691 WriteLn(StdErr, '[WARNING] ', E.Message); 691 DebugLn('[WARNING] ', E.Message);
692 RevertUndoAction; 692 RevertUndoAction;
693 Exit 693 Exit
694 end; 694 end;
@@ -706,7 +706,7 @@ begin
706 PerformPaste(GetPastedCells); 706 PerformPaste(GetPastedCells);
707 except 707 except
708 on E: EClipboardFormatException do begin 708 on E: EClipboardFormatException do begin
709 WriteLn(StdErr, '[WARNING] ', E.Message); 709 DebugLn('[WARNING] ', E.Message);
710 RevertUndoAction; 710 RevertUndoAction;
711 Exit 711 Exit
712 end; 712 end;
Modifiedsrc/z80cpu.pas +3−3
@@ -16,7 +16,7 @@ var
16 16
17 implementation 17 implementation
18 18
19 uses vars, machine, cpu_tables; 19 uses vars, machine, cpu_tables, LazLoggerBase;
20 20
21 // temporary variables 21 // temporary variables
22 var 22 var
@@ -2012,9 +2012,9 @@ var
2012 begin 2012 begin
2013 I := speekb(pc.w); 2013 I := speekb(pc.w);
2014 Inc(pc.w); 2014 Inc(pc.w);
2015 if I <> 0 then writeln('DEBUG: ', I); 2015 if I <> 0 then DebugLn(['DEBUG: ', I]);
2016 if I = 0 then begin 2016 if I = 0 then begin
2017 writeln('MEM: ', speekb(wordpeek(pc.w))); 2017 DebugLn(['MEM: ', speekb(wordpeek(pc.w))]);
2018 Inc(pc.w,2); 2018 Inc(pc.w,2);
2019 end; 2019 end;
2020 Result := 0; 2020 Result := 0;