mirror of https://github.com/red-prig/fpPS4.git
This commit is contained in:
parent
fb69f39113
commit
f6d88d3561
|
@ -312,7 +312,7 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{
|
{
|
||||||
if (Result<>nil) and (Info^.sType=STT_FUN) then //trace
|
if (Result<>nil) and ((Info^.sType=STT_FUN) or (Info^.sType=STT_SCE)) then //trace
|
||||||
begin
|
begin
|
||||||
|
|
||||||
Case Info^.lib^.strName of
|
Case Info^.lib^.strName of
|
||||||
|
@ -406,11 +406,11 @@ begin
|
||||||
|
|
||||||
if (Result=nil) then
|
if (Result=nil) then
|
||||||
begin
|
begin
|
||||||
if (Info^.sType=STT_FUN) then
|
if (Info^.sType=STT_FUN) or (Info^.sType=STT_SCE) then
|
||||||
begin
|
begin
|
||||||
Result:=Stub.NewNopStub(Info^.Nid,Info^.lib,@print_stub);
|
Result:=Stub.NewNopStub(Info^.Nid,Info^.lib,@print_stub);
|
||||||
//Writeln('Warn^:',Info^.lib^.strName,':',ps4libdoc.GetFunctName(Info^.Nid),':',HexStr(Info^.Nid,16));
|
|
||||||
end else
|
end else
|
||||||
|
if (Info^.sBind<>STB_WEAK) then
|
||||||
begin
|
begin
|
||||||
Writeln(StdErr,'Warn^:',Info^.lib^.strName,':',ps4libdoc.GetFunctName(Info^.Nid),':',HexStr(Info^.Nid,16));
|
Writeln(StdErr,'Warn^:',Info^.lib^.strName,':',ps4libdoc.GetFunctName(Info^.Nid),':',HexStr(Info^.Nid,16));
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -221,7 +221,8 @@ begin
|
||||||
BT_PRIV,
|
BT_PRIV,
|
||||||
BT_GPUM:
|
BT_GPUM:
|
||||||
begin
|
begin
|
||||||
err:=_VirtualReserve(Pointer(FOffset),ASize,prot);
|
//err:=_VirtualReserve(Pointer(FOffset),ASize,prot);
|
||||||
|
err:=_VirtualAlloc(Pointer(FOffset),ASize,prot);
|
||||||
if (err<>0) then
|
if (err<>0) then
|
||||||
begin
|
begin
|
||||||
Writeln(StdErr,'_VirtualReserve(',HexStr(FOffset),',',HexStr(ASize,16),'):',err);
|
Writeln(StdErr,'_VirtualReserve(',HexStr(FOffset),',',HexStr(ASize,16),'):',err);
|
||||||
|
@ -394,7 +395,8 @@ begin
|
||||||
BT_PRIV,
|
BT_PRIV,
|
||||||
BT_GPUM:
|
BT_GPUM:
|
||||||
begin
|
begin
|
||||||
Result:=_VirtualCommit(Pointer(key^.Offset),key^.Size,prot);
|
//Result:=_VirtualCommit(Pointer(key^.Offset),key^.Size,prot);
|
||||||
|
Result:=0;
|
||||||
if (Result=0) then
|
if (Result=0) then
|
||||||
begin
|
begin
|
||||||
key^.F.prot:=prot;
|
key^.F.prot:=prot;
|
||||||
|
@ -452,7 +454,8 @@ begin
|
||||||
Rsrv:=Rsrv+key^.Size; //+
|
Rsrv:=Rsrv+key^.Size; //+
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result:=_VirtualDecommit(Pointer(key^.Offset),key^.Size);
|
//Result:=_VirtualDecommit(Pointer(key^.Offset),key^.Size);
|
||||||
|
Result:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TVirtualAdrBlock.Protect(key:PVirtualAdrNode;prot:Integer):Integer;
|
function TVirtualAdrBlock.Protect(key:PVirtualAdrNode;prot:Integer):Integer;
|
||||||
|
@ -1980,6 +1983,10 @@ begin
|
||||||
begin
|
begin
|
||||||
Result:='FREE';
|
Result:='FREE';
|
||||||
end else
|
end else
|
||||||
|
if (key.block=nil) then
|
||||||
|
begin
|
||||||
|
Result:='SYST';
|
||||||
|
end else
|
||||||
if (key.F.reserv<>0) then
|
if (key.F.reserv<>0) then
|
||||||
begin
|
begin
|
||||||
Result:='RSRV';
|
Result:='RSRV';
|
||||||
|
|
|
@ -23,6 +23,10 @@ const
|
||||||
SCE_AJM_CODEC_CELP_DEC =12;
|
SCE_AJM_CODEC_CELP_DEC =12;
|
||||||
SCE_AJM_CODEC_CELP_ENC =13;
|
SCE_AJM_CODEC_CELP_ENC =13;
|
||||||
|
|
||||||
|
SCE_AJM_FLAG_SIDEBAND_STREAM =(1 shl 47);
|
||||||
|
SCE_AJM_FLAG_SIDEBAND_FORMAT =(1 shl 46);
|
||||||
|
SCE_AJM_FLAG_SIDEBAND_GAPLESS_DECODE=(1 shl 45);
|
||||||
|
|
||||||
var
|
var
|
||||||
FAjmMap:TIntegerHandles;
|
FAjmMap:TIntegerHandles;
|
||||||
|
|
||||||
|
@ -41,6 +45,25 @@ type
|
||||||
iInternalResult:SceAjmResult;
|
iInternalResult:SceAjmResult;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
SceAjmSidebandStream=packed record
|
||||||
|
iSizeConsumed:Integer;
|
||||||
|
iSizeProduced:Integer;
|
||||||
|
uiTotalDecodedSamples:QWORD;
|
||||||
|
end;
|
||||||
|
|
||||||
|
SceAjmSidebandDecAt9CodecInfo=packed record
|
||||||
|
uiSuperFrameSize:DWORD;
|
||||||
|
uiFramesInSuperFrame:DWORD;
|
||||||
|
uiNextFrameSize:DWORD;
|
||||||
|
uiFrameSamples:DWORD;
|
||||||
|
end;
|
||||||
|
|
||||||
|
pSceAjmDecAt9GetCodecInfoResult=^SceAjmDecAt9GetCodecInfoResult;
|
||||||
|
SceAjmDecAt9GetCodecInfoResult=packed record
|
||||||
|
sResult:SceAjmSidebandResult;
|
||||||
|
sCodecInfo:SceAjmSidebandDecAt9CodecInfo;
|
||||||
|
end;
|
||||||
|
|
||||||
pSceAjmBuffer=^SceAjmBuffer;
|
pSceAjmBuffer=^SceAjmBuffer;
|
||||||
SceAjmBuffer=packed record
|
SceAjmBuffer=packed record
|
||||||
pAddress:Pointer;
|
pAddress:Pointer;
|
||||||
|
@ -332,6 +355,23 @@ begin
|
||||||
H.Release;
|
H.Release;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
type
|
||||||
|
pSceAjmSidebandStreamResult=^SceAjmSidebandStreamResult;
|
||||||
|
SceAjmSidebandStreamResult=packed record
|
||||||
|
sResult:SceAjmSidebandResult;
|
||||||
|
sStream:SceAjmSidebandStream;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure FixSideband(uiFlags:qword;pSidebandOutput:Pointer;szSidebandOutputSize:qword);
|
||||||
|
begin
|
||||||
|
if ((uiFlags and SCE_AJM_FLAG_SIDEBAND_STREAM)<>0) then
|
||||||
|
begin
|
||||||
|
pSceAjmSidebandStreamResult(pSidebandOutput)^.sStream.iSizeConsumed:=1;
|
||||||
|
pSceAjmSidebandStreamResult(pSidebandOutput)^.sStream.iSizeProduced:=1;
|
||||||
|
pSceAjmSidebandStreamResult(pSidebandOutput)^.sStream.uiTotalDecodedSamples:=1; //loop or div to zero
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function ps4_sceAjmBatchJobControlBufferRa(
|
function ps4_sceAjmBatchJobControlBufferRa(
|
||||||
pBatchPosition:Pointer;
|
pBatchPosition:Pointer;
|
||||||
uiInstance:SceAjmInstanceId;
|
uiInstance:SceAjmInstanceId;
|
||||||
|
@ -346,7 +386,9 @@ begin
|
||||||
if (pSidebandOutput<>nil) then
|
if (pSidebandOutput<>nil) then
|
||||||
begin
|
begin
|
||||||
FillChar(pSidebandOutput^,szSidebandOutputSize,0);
|
FillChar(pSidebandOutput^,szSidebandOutputSize,0);
|
||||||
|
FixSideband(uiFlags,pSidebandOutput,szSidebandOutputSize);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps4_sceAjmBatchJobRunBufferRa(
|
function ps4_sceAjmBatchJobRunBufferRa(
|
||||||
|
@ -362,9 +404,11 @@ function ps4_sceAjmBatchJobRunBufferRa(
|
||||||
pReturnAddress:PPointer):Pointer; SysV_ABI_CDecl;
|
pReturnAddress:PPointer):Pointer; SysV_ABI_CDecl;
|
||||||
begin
|
begin
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
|
|
||||||
if (pSidebandOutput<>nil) then
|
if (pSidebandOutput<>nil) then
|
||||||
begin
|
begin
|
||||||
FillChar(pSidebandOutput^,szSidebandOutputSize,0);
|
FillChar(pSidebandOutput^,szSidebandOutputSize,0);
|
||||||
|
FixSideband(uiFlags,pSidebandOutput,szSidebandOutputSize);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FillChar(pDataOutput^,szDataOutputSize,0);
|
FillChar(pDataOutput^,szDataOutputSize,0);
|
||||||
|
@ -388,6 +432,7 @@ begin
|
||||||
if (pSidebandOutput<>nil) then
|
if (pSidebandOutput<>nil) then
|
||||||
begin
|
begin
|
||||||
FillChar(pSidebandOutput^,szSidebandOutputSize,0);
|
FillChar(pSidebandOutput^,szSidebandOutputSize,0);
|
||||||
|
FixSideband(uiFlags,pSidebandOutput,szSidebandOutputSize);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (pDataOutputBuffers<>nil) and (szNumDataOutputBuffers<>0) then
|
if (pDataOutputBuffers<>nil) and (szNumDataOutputBuffers<>0) then
|
||||||
|
|
|
@ -5,6 +5,7 @@ unit ps4_libSceNpManager;
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
windows,
|
||||||
ps4_program,
|
ps4_program,
|
||||||
Classes,
|
Classes,
|
||||||
SysUtils;
|
SysUtils;
|
||||||
|
@ -14,6 +15,7 @@ Const
|
||||||
|
|
||||||
type
|
type
|
||||||
// Np country code (ISO 3166-1 two-letter system)
|
// Np country code (ISO 3166-1 two-letter system)
|
||||||
|
pSceNpCountryCode=^SceNpCountryCode;
|
||||||
SceNpCountryCode=packed record
|
SceNpCountryCode=packed record
|
||||||
data:array[0..SCE_NP_COUNTRY_CODE_LENGTH-1] of AnsiChar;
|
data:array[0..SCE_NP_COUNTRY_CODE_LENGTH-1] of AnsiChar;
|
||||||
term:AnsiChar;
|
term:AnsiChar;
|
||||||
|
@ -130,6 +132,50 @@ begin
|
||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
const
|
||||||
|
GEOCLASS_NATION = 16;
|
||||||
|
|
||||||
|
GEO_ISO2 = $0004;
|
||||||
|
|
||||||
|
type
|
||||||
|
GEOID = LONG;
|
||||||
|
GEOTYPE = DWORD;
|
||||||
|
GEOCLASS = DWORD;
|
||||||
|
|
||||||
|
function GetUserGeoID(GeoClass: GEOCLASS):GEOID; stdcall external kernel32;
|
||||||
|
|
||||||
|
function GetGeoInfoA(Location: GEOID; GeoType: GEOTYPE; lpGeoData: LPSTR;
|
||||||
|
cchData: Integer; LangId: LANGID): Integer; stdcall external kernel32;
|
||||||
|
|
||||||
|
function ps4_sceNpGetAccountCountry(onlineId:pSceNpOnlineId;pCountryCode:pSceNpCountryCode):Integer; SysV_ABI_CDecl;
|
||||||
|
var
|
||||||
|
g:GEOID;
|
||||||
|
s:integer;
|
||||||
|
b:RawByteString;
|
||||||
|
begin
|
||||||
|
if (onlineId=nil) then Exit(SCE_NP_ERROR_INVALID_ARGUMENT);
|
||||||
|
if (pCountryCode=nil) then Exit(SCE_NP_ERROR_INVALID_ARGUMENT);
|
||||||
|
|
||||||
|
g:=GetUserGeoID(GEOCLASS_NATION);
|
||||||
|
s:=GetGeoInfoA(g,GEO_ISO2,nil,0,0);
|
||||||
|
SetLength(b,s);
|
||||||
|
GetGeoInfoA(g,GEO_ISO2,PChar(b),s,0);
|
||||||
|
|
||||||
|
if (s>=2) then
|
||||||
|
begin
|
||||||
|
pCountryCode^:=Default(SceNpCountryCode);
|
||||||
|
pCountryCode^.data[0]:=LowerCase(b[1]);
|
||||||
|
pCountryCode^.data[1]:=LowerCase(b[2]);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
pCountryCode^:=Default(SceNpCountryCode);
|
||||||
|
pCountryCode^.data[0]:='u';
|
||||||
|
pCountryCode^.data[1]:='s';
|
||||||
|
end;
|
||||||
|
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
function ps4_sceNpGetNpId(userId:Integer;npId:PSceNpId):Integer; SysV_ABI_CDecl;
|
function ps4_sceNpGetNpId(userId:Integer;npId:PSceNpId):Integer; SysV_ABI_CDecl;
|
||||||
begin
|
begin
|
||||||
npId^:=Default(SceNpId);
|
npId^:=Default(SceNpId);
|
||||||
|
@ -365,6 +411,7 @@ begin
|
||||||
lib:=Result._add_lib('libSceNpManager');
|
lib:=Result._add_lib('libSceNpManager');
|
||||||
lib^.set_proc($036090DE4812A294,@ps4_sceNpSetContentRestriction);
|
lib^.set_proc($036090DE4812A294,@ps4_sceNpSetContentRestriction);
|
||||||
lib^.set_proc($ADB9276948E9A96A,@ps4_sceNpGetAccountIdA);
|
lib^.set_proc($ADB9276948E9A96A,@ps4_sceNpGetAccountIdA);
|
||||||
|
lib^.set_proc($1A1CFD8960D4B42E,@ps4_sceNpGetAccountCountry);
|
||||||
lib^.set_proc($A7FA3BE029E83736,@ps4_sceNpGetNpId);
|
lib^.set_proc($A7FA3BE029E83736,@ps4_sceNpGetNpId);
|
||||||
lib^.set_proc($5C39DC5D02095129,@ps4_sceNpGetOnlineId);
|
lib^.set_proc($5C39DC5D02095129,@ps4_sceNpGetOnlineId);
|
||||||
lib^.set_proc($7901FB9D63DC0207,@ps4_sceNpGetState);
|
lib^.set_proc($7901FB9D63DC0207,@ps4_sceNpGetState);
|
||||||
|
|
Loading…
Reference in New Issue