This commit is contained in:
red-prig 2022-12-21 20:45:08 +03:00
parent 641d0d3f7f
commit 637c2499e5
2 changed files with 18 additions and 12 deletions

View File

@ -731,8 +731,8 @@ end;
function ps4_sceSysmoduleLoadModule(id:DWord):Integer; SysV_ABI_CDecl;
begin
if (Word(id)=0) then Exit(-2141581312);
if ((Word(id)=$80) and (SDK_VERSION>=$3000000)) then Exit(-2141581312);
if (Word(id)=0) then Exit(SCE_SYSMODULE_ERROR_INVALID_VALUE);
if ((Word(id)=$80) and (SDK_VERSION>=$3000000)) then Exit(SCE_SYSMODULE_ERROR_INVALID_VALUE);
Writeln('sceSysmoduleLoadModule:',GetSysmoduleName(id));
Result:=0;
@ -740,7 +740,7 @@ end;
function ps4_sceSysmoduleUnloadModule(id:DWord):Integer; SysV_ABI_CDecl;
begin
if (Word(id)=0) then Exit(-2141581312);
if (Word(id)=0) then Exit(SCE_SYSMODULE_ERROR_INVALID_VALUE);
Writeln('sceSysmoduleUnloadModule:',GetSysmoduleName(id));
Result:=0;
@ -748,20 +748,20 @@ end;
function ps4_sceSysmoduleIsLoaded(id:DWord):Integer; SysV_ABI_CDecl;
begin
if (Word(id)=0) then Exit(-2141581312);
if (Word(id)=0) then Exit(SCE_SYSMODULE_ERROR_INVALID_VALUE);
Writeln('sceSysmoduleIsLoaded:',GetSysmoduleName(id));
Result:=0; //0 -> loaded ; -2141581311 -> not loaded
Result:=0; //0 -> loaded ; SCE_SYSMODULE_ERROR_UNLOADED -> not loaded
end;
//
function ps4_sceSysmoduleIsLoadedInternal(id:DWord):Integer; SysV_ABI_CDecl;
begin
if ((id or $80000000)=$80000000) then Exit(-2141581312);
if ((id or $80000000)=$80000000) then Exit(SCE_SYSMODULE_ERROR_INVALID_VALUE);
Writeln('sceSysmoduleIsLoadedInternal:',GetSysmoduleName(id));
Result:=0; //0 -> loaded ; -2141581311 -> not loaded
Result:=0; //0 -> loaded ; SCE_SYSMODULE_ERROR_UNLOADED -> not loaded
end;
function ps4_sceSysmoduleLoadModuleInternalWithArg(id:Word;
@ -770,8 +770,8 @@ function ps4_sceSysmoduleLoadModuleInternalWithArg(id:Word;
flags:DWORD;
pRes:PInteger):Integer; SysV_ABI_CDecl;
begin
if ((id or $80000000)=$80000000) or (flags<>0) then Exit(-2141581312);
if ((Word(id)=$80) and (SDK_VERSION>=$3000000)) then Exit(-2141581312);
if ((id or $80000000)=$80000000) or (flags<>0) then Exit(SCE_SYSMODULE_ERROR_INVALID_VALUE);
if ((Word(id)=$80) and (SDK_VERSION>=$3000000)) then Exit(SCE_SYSMODULE_ERROR_INVALID_VALUE);
Writeln('sceSysmoduleLoadModuleInternalWithArg:',GetSysmoduleName(id));
if (pRes<>nil) then pRes^:=0;

View File

@ -58,7 +58,8 @@ function ParamSfoGetInt(const name:RawByteString):Integer;
implementation
uses
atomic;
atomic,
spinlock;
function LoadParamSfoFile(path:PChar):TParamSfoFile;
Var
@ -77,6 +78,7 @@ Var
key_table:PChar;
value_table:PByte;
size:DWORD;
name,value:RawByteString;
function load_chunk(offset,size:DWORD):Pointer;
@ -158,8 +160,9 @@ begin
name :=PChar(key_table+entry_table[i].key_offset);
value:='';
SetLength(value,entry_table[i].max_size);
Move(PChar(value_table+entry_table[i].value_offset)^,PChar(value)^,entry_table[i].max_size);
size:=entry_table[i].max_size;
SetLength(value,size);
Move(PChar(value_table+entry_table[i].value_offset)^,PChar(value)^,size);
Result.params[i].format:=entry_table[i].format;
Result.params[i].name :=name;
@ -222,6 +225,9 @@ begin
begin
param_sfo_file:=LoadParamSfoFile('/app0/sce_sys/param.sfo');
param_sfo_lazy_init:=2;
end else
begin
wait_until_equal(param_sfo_lazy_init,1);
end;
end;