* Improve DEBUG_PPU code

* Move flog file closing from closefile method to destroy destructor.
  * Fix write_data output into flog

git-svn-id: trunk@48890 -
This commit is contained in:
pierre 2021-03-06 22:00:30 +00:00
parent bb83bb4203
commit 81402bb077

View File

@ -380,6 +380,11 @@ end;
destructor tentryfile.destroy;
begin
closefile;
{$ifdef DEBUG_PPU}
if flog_open then
close(flog);
flog_open:=false;
{$endif DEBUG_PPU}
if assigned(buf) then
freemem(buf,entryfilebufsize);
end;
@ -573,11 +578,6 @@ begin
f.Free;
mode:=0;
closed:=true;
{$ifdef DEBUG_PPU}
if flog_open then
close(flog);
flog_open:=false;
{$endif DEBUG_PPU}
end;
end;
@ -683,14 +683,6 @@ var
begin
p:=pchar(@b);
pbuf:=@buf[bufidx];
{$ifdef DEBUG_PPU}
if ppu_log_level <= 0 then
begin
ppu_log('writedata, length='+tostr(len)+' level='+tostr(ppu_log_level));
for i:=0 to len-1 do
ppu_log_val('p['+tostr(i)+']=$'+hexstr(byte(p[i]),2));
end;
{$endif DEBUG_PPU}
repeat
left:=bufsize-bufidx;
if len<left then
@ -704,6 +696,14 @@ begin
exit;
until false;
move(pbuf^,p^,len);
{$ifdef DEBUG_PPU}
if ppu_log_level <= 0 then
begin
ppu_log('writedata, length='+tostr(len)+' level='+tostr(ppu_log_level));
for i:=0 to len-1 do
ppu_log_val('p['+tostr(i)+']=$'+hexstr(byte(p[i]),2));
end;
{$endif DEBUG_PPU}
inc(bufidx,len);
end;