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

This commit is contained in:
Pierre Muller 2025-04-28 14:00:29 +00:00
parent be82caf5a0
commit d79db82ca2
2 changed files with 12 additions and 4 deletions

View File

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

View File

@ -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
% This unit file was compiled with a different version of the compiler, and
% 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
% 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
% cannot be read.
unit_u_ppu_source=10011_U_PPU Source: $1