|
@@ -144,6 +144,10 @@ type
|
|
|
{$ifdef DEBUG_PPU}
|
|
|
procedure ppu_log(st :string);override;
|
|
|
{$endif}
|
|
|
+{$ifdef DEBUG_GENERATE_INTERFACE_PPU}
|
|
|
+ public
|
|
|
+ writing_interface_ppu : boolean;
|
|
|
+{$endif DEBUG_GENERATE_INTERFACE_PPU}
|
|
|
public
|
|
|
header : tppuheader;
|
|
|
{ crc for the entire unit }
|
|
@@ -212,6 +216,9 @@ constructor tppufile.Create(const fn:string);
|
|
|
begin
|
|
|
inherited Create(fn);
|
|
|
crc_only:=false;
|
|
|
+{$ifdef DEBUG_GENERATE_INTERFACE_PPU}
|
|
|
+ writing_interface_ppu:=false;
|
|
|
+{$endif}
|
|
|
{$ifdef Test_Double_checksum}
|
|
|
if not assigned(interface_crc_array) then
|
|
|
begin
|
|
@@ -326,10 +333,30 @@ begin
|
|
|
begin
|
|
|
if do_crc and (ppu_log_idx < bufstart+bufidx) then
|
|
|
begin
|
|
|
- writeln(flog,'New crc : ',hexstr(dword(crc),8));
|
|
|
- writeln(flog,'New interface crc : ',hexstr(dword(interface_crc),8));
|
|
|
- writeln(flog,'New indirect crc : ',hexstr(dword(indirect_crc),8));
|
|
|
- ppu_log_idx:=bufstart+bufidx;
|
|
|
+ write(flog,'New crc : ',hexstr(dword(crc),8));
|
|
|
+{$ifdef Test_Double_checksum}
|
|
|
+ if implementation_read_crc_index>0 then
|
|
|
+ write(flog,' read_index=',implementation_read_crc_index)
|
|
|
+ else if implementation_write_crc_index>0 then
|
|
|
+ write(flog,' write_index=',implementation_write_crc_index);
|
|
|
+{$endif def Test_Double_checksum}
|
|
|
+ writeln(flog);
|
|
|
+ write(flog,'New interface crc : ',hexstr(dword(interface_crc),8));
|
|
|
+{$ifdef Test_Double_checksum}
|
|
|
+ if interface_read_crc_index>0 then
|
|
|
+ write(flog,' read_index=',interface_read_crc_index)
|
|
|
+ else if interface_write_crc_index>0 then
|
|
|
+ write(flog,' write_index=',interface_write_crc_index);
|
|
|
+{$endif def Test_Double_checksum}
|
|
|
+ writeln(flog);
|
|
|
+ write(flog,'New indirect crc : ',hexstr(dword(indirect_crc),8));
|
|
|
+{$ifdef Test_Double_checksum}
|
|
|
+ if indirect_read_crc_index>0 then
|
|
|
+ write(flog,' read_index=',indirect_read_crc_index)
|
|
|
+ else if indirect_write_crc_index>0 then
|
|
|
+ write(flog,' write_index=',indirect_write_crc_index);
|
|
|
+{$endif def Test_Double_checksum}
|
|
|
+ writeln(flog);
|
|
|
end;
|
|
|
end;
|
|
|
{$ifdef IN_PPUDUMP}
|
|
@@ -357,12 +384,20 @@ function tppufile.createfile:boolean;
|
|
|
begin
|
|
|
{$ifdef DEBUG_GENERATE_INTERFACE_PPU}
|
|
|
if crc_only then
|
|
|
- begin
|
|
|
- fname:=fname+'.intf';
|
|
|
- crc_only:=false;
|
|
|
- end;
|
|
|
+ begin
|
|
|
+ fname:=fname+'.intf';
|
|
|
+ crc_only:=false;
|
|
|
+ writing_interface_ppu:=true;
|
|
|
+ end;
|
|
|
{$endif}
|
|
|
result:=inherited createfile;
|
|
|
+{$ifdef DEBUG_GENERATE_INTERFACE_PPU}
|
|
|
+ if writing_interface_ppu then
|
|
|
+ begin
|
|
|
+ crc_only:=true;
|
|
|
+ writing_interface_ppu:=false;
|
|
|
+ end;
|
|
|
+{$endif DEBUG_GENERATE_INTERFACE_PPU}
|
|
|
end;
|
|
|
|
|
|
|
|
@@ -412,12 +447,16 @@ begin
|
|
|
begin
|
|
|
crc:=UpdateCrc32(crc,b,len);
|
|
|
{$ifdef Test_Double_checksum}
|
|
|
- if crc_only then
|
|
|
+ if crc_only
|
|
|
+{$ifdef DEBUG_GENERATE_INTERFACE_PPU}
|
|
|
+ or writing_interface_ppu
|
|
|
+{$endif DEBUG_GENERATE_INTERFACE_PPU}
|
|
|
+ then
|
|
|
begin
|
|
|
implementation_crc_array^[implementation_write_crc_index]:=crc;
|
|
|
{$ifdef Test_Double_checksum_write}
|
|
|
- Write(CRCFile,'imp_crc ',implementation_write_crc_index:6,' $',hexstr(crc,8),' ',len);
|
|
|
- pb:=@b;
|
|
|
+ Write(CRCFile,'imp_crc ',implementation_write_crc_index:5,' $',hexstr(crc,8),' ',len);
|
|
|
+ pb:=@b;
|
|
|
for ind:=0 to len-1 do
|
|
|
Write(CRCFile,' ',hexstr(pb[ind],2));
|
|
|
Writeln(CRCFile);
|
|
@@ -437,11 +476,19 @@ begin
|
|
|
do_internalerror(2020113001);
|
|
|
{$ENDIF}
|
|
|
{$ifdef Test_Double_checksum_write}
|
|
|
- Writeln(CRCFile,'!!!imp_crc ',implementation_read_crc_index:5,' $',hexstr(crc,8),'<>$',hexstr(implementation_crc_array^[implementation_read_crc_index],8));
|
|
|
+ Write(CRCFile,'!!!imp_crc ',implementation_read_crc_index:5,' $',hexstr(crc,8),'<>$',hexstr(implementation_crc_array^[implementation_read_crc_index],8),' ',len);
|
|
|
+ pb:=@b;
|
|
|
+ for ind:=0 to len-1 do
|
|
|
+ Write(CRCFile,' ',hexstr(pb[ind],2));
|
|
|
+ Writeln(CRCFile);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
- Writeln(CRCFile,'imp_crc ',implementation_read_crc_index:5,' $',hexstr(crc,8),' OK');
|
|
|
+ Write(CRCFile,'imp_crc ',implementation_read_crc_index:5,' $',hexstr(crc,8),' ',len);
|
|
|
+ pb:=@b;
|
|
|
+ for ind:=0 to len-1 do
|
|
|
+ Write(CRCFile,' ',hexstr(pb[ind],2));
|
|
|
+ Writeln(CRCFile);
|
|
|
{$endif Test_Double_checksum_write}
|
|
|
end;
|
|
|
inc(implementation_read_crc_index);
|
|
@@ -451,7 +498,11 @@ begin
|
|
|
begin
|
|
|
interface_crc:=UpdateCrc32(interface_crc,b,len);
|
|
|
{$ifdef Test_Double_checksum}
|
|
|
- if crc_only then
|
|
|
+ if crc_only
|
|
|
+{$ifdef DEBUG_GENERATE_INTERFACE_PPU}
|
|
|
+ or writing_interface_ppu
|
|
|
+{$endif DEBUG_GENERATE_INTERFACE_PPU}
|
|
|
+ then
|
|
|
begin
|
|
|
interface_crc_array^[interface_write_crc_index]:=interface_crc;
|
|
|
{$ifdef Test_Double_checksum_write}
|
|
@@ -476,11 +527,19 @@ begin
|
|
|
do_internalerror(2020113002);
|
|
|
{$ENDIF}
|
|
|
{$ifdef Test_Double_checksum_write}
|
|
|
- Writeln(CRCFile,'!!!int_crc ',interface_read_crc_index:5,' $',hexstr(interface_crc,8),'<>$',hexstr(interface_crc_array^[interface_read_crc_index],8));
|
|
|
+ Write(CRCFile,'!!!int_crc ',interface_read_crc_index:5,' $',hexstr(interface_crc,8),'<>$',hexstr(interface_crc_array^[interface_read_crc_index],8),' ',len);
|
|
|
+ pb:=@b;
|
|
|
+ for ind:=0 to len-1 do
|
|
|
+ Write(CRCFile,' ',hexstr(pb[ind],2));
|
|
|
+ Writeln(CRCFile);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
- Writeln(CRCFile,'int_crc ',interface_read_crc_index:5,' $',hexstr(interface_crc,8),' OK');
|
|
|
+ Write(CRCFile,'int_crc ',interface_read_crc_index:5,' $',hexstr(interface_crc,8),' ',len);
|
|
|
+ pb:=@b;
|
|
|
+ for ind:=0 to len-1 do
|
|
|
+ Write(CRCFile,' ',hexstr(pb[ind],2));
|
|
|
+ Writeln(CRCFile);
|
|
|
{$endif Test_Double_checksum_write}
|
|
|
end;
|
|
|
inc(interface_read_crc_index);
|
|
@@ -493,7 +552,11 @@ begin
|
|
|
begin
|
|
|
indirect_crc:=UpdateCrc32(indirect_crc,b,len);
|
|
|
{$ifdef Test_Double_checksum}
|
|
|
- if crc_only then
|
|
|
+ if crc_only
|
|
|
+{$ifdef DEBUG_GENERATE_INTERFACE_PPU}
|
|
|
+ or writing_interface_ppu
|
|
|
+{$endif DEBUG_GENERATE_INTERFACE_PPU}
|
|
|
+ then
|
|
|
begin
|
|
|
indirect_crc_array^[indirect_write_crc_index]:=indirect_crc;
|
|
|
{$ifdef Test_Double_checksum_write}
|
|
@@ -518,11 +581,19 @@ begin
|
|
|
do_internalerror(2020113003);
|
|
|
{$ENDIF}
|
|
|
{$ifdef Test_Double_checksum_write}
|
|
|
- Writeln(CRCFile,'!!!ind_crc ',indirect_read_crc_index:5,' $',hexstr(indirect_crc,8),'<>$',hexstr(indirect_crc_array^[indirect_read_crc_index],8));
|
|
|
+ Write(CRCFile,'!!!ind_crc ',indirect_read_crc_index:5,' $',hexstr(indirect_crc,8),'<>$',hexstr(indirect_crc_array^[indirect_read_crc_index],8),' ',len);
|
|
|
+ pb:=@b;
|
|
|
+ for ind:=0 to len-1 do
|
|
|
+ Write(CRCFile,' ',hexstr(pb[ind],2));
|
|
|
+ Writeln(CRCFile);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
- Writeln(CRCFile,'ind_crc ',indirect_read_crc_index:5,' $',hexstr(indirect_crc,8),' OK');
|
|
|
+ Write(CRCFile,'ind_crc ',indirect_read_crc_index:5,' $',hexstr(indirect_crc,8),' ',len);
|
|
|
+ pb:=@b;
|
|
|
+ for ind:=0 to len-1 do
|
|
|
+ Write(CRCFile,' ',hexstr(pb[ind],2));
|
|
|
+ Writeln(CRCFile);
|
|
|
{$endif Test_Double_checksum_write}
|
|
|
end;
|
|
|
inc(indirect_read_crc_index);
|