Browse Source

Add information about different CPU or OS in CheckHeader local function of tppumodule.openppu method

Pierre Muller 3 months ago
parent
commit
d79db82ca2
2 changed files with 12 additions and 4 deletions
  1. 10 2
      compiler/fppu.pas
  2. 2 2
      compiler/msg/errore.msg

+ 10 - 2
compiler/fppu.pas

@@ -293,6 +293,9 @@ var
     function tppumodule.openppu(ppufiletime:longint):boolean;
     function tppumodule.openppu(ppufiletime:longint):boolean;
 
 
       function checkheader: boolean;
       function checkheader: boolean;
+        var
+          psi: psysteminfo;
+          system_name: shortstring;
         begin
         begin
           result:=false;
           result:=false;
           { check for a valid PPU file }
           { check for a valid PPU file }
@@ -310,13 +313,18 @@ var
           { check the target processor }
           { check the target processor }
             if tsystemcpu(ppufile.header.common.cpu)<>target_cpu then
             if tsystemcpu(ppufile.header.common.cpu)<>target_cpu then
              begin
              begin
-               Message(unit_u_ppu_invalid_processor,@queuecomment);
+               Message1(unit_u_ppu_invalid_processor,cpu2str[tsystemcpu(ppufile.header.common.cpu)],@queuecomment);
                exit;
                exit;
              end;
              end;
           { check target }
           { check target }
             if tsystem(ppufile.header.common.target)<>target_info.system then
             if tsystem(ppufile.header.common.target)<>target_info.system then
              begin
              begin
-               Message(unit_u_ppu_invalid_target,@queuecomment);
+               psi:=targetinfos[tsystem(ppufile.header.common.target)];
+               if assigned(psi) then
+                 system_name:=psi^.shortname
+               else
+                 system_name:='invalid';
+               Message1(unit_u_ppu_invalid_target,system_name,@queuecomment);
                exit;
                exit;
              end;
              end;
 {$ifdef cpufpemu}
 {$ifdef cpufpemu}

+ 2 - 2
compiler/msg/errore.msg

@@ -3332,10 +3332,10 @@ unit_u_ppu_invalid_header=10007_U_PPU Invalid Header (no PPU at the begin)
 unit_u_ppu_invalid_version=10008_U_PPU Invalid Version $1
 unit_u_ppu_invalid_version=10008_U_PPU Invalid Version $1
 % This unit file was compiled with a different version of the compiler, and
 % This unit file was compiled with a different version of the compiler, and
 % cannot be read.
 % cannot be read.
-unit_u_ppu_invalid_processor=10009_U_PPU is compiled for another processor
+unit_u_ppu_invalid_processor=10009_U_PPU is compiled for another processor %1
 % This unit file was compiled for a different processor type, and
 % This unit file was compiled for a different processor type, and
 % cannot be read.
 % cannot be read.
-unit_u_ppu_invalid_target=10010_U_PPU is compiled for another target
+unit_u_ppu_invalid_target=10010_U_PPU is compiled for another target %1
 % This unit file was compiled for a different target, and
 % This unit file was compiled for a different target, and
 % cannot be read.
 % cannot be read.
 unit_u_ppu_source=10011_U_PPU Source: $1
 unit_u_ppu_source=10011_U_PPU Source: $1