Sfoglia il codice sorgente

* 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 -

pierre 4 anni fa
parent
commit
81402bb077
1 ha cambiato i file con 13 aggiunte e 13 eliminazioni
  1. 13 13
      compiler/entfile.pas

+ 13 - 13
compiler/entfile.pas

@@ -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;