SceCompat: Difference between revisions

From Vita Development Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 27: Line 27:
| 0.990-3.65 || [[SceCompat#SceCompat|SceCompat]] || Non-secure || User || 0x0F35909D
| 0.990-3.65 || [[SceCompat#SceCompat|SceCompat]] || Non-secure || User || 0x0F35909D
|}
|}
== Types ==
<source lang="C">
typedef struct SceCompatSettings { // size is 8 on FW 1.03
  SceUInt32 disp_filter : 1;
  SceUInt32 camera_direction : 1;
  SceUInt32 ra_up : 4;
  SceUInt32 ra_down : 4;
  SceUInt32 ra_left : 4;
  SceUInt32 ra_right : 4;
  SceUInt32 reserved : 46;
} SceCompatSettings;
typedef struct SceCompatInitParam { // size is 0x40 on FW 1.03
  char unk[0x40];
} SceCompatInitParam;
</source>


== SceCompatForDriver ==
== SceCompatForDriver ==
Line 79: Line 97:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || not present
| 0.990-1.03 || not present
|-
|-
| 3.60 || 0x0CDE9EC5
| 3.60 || 0x0CDE9EC5
Line 91: Line 109:
| 0.990 || not present
| 0.990 || not present
|-
|-
| 1.69-3.60 || 0x138006A8
| 1.03-3.60 || 0x138006A8
|}
|}
Calls sceIoDevctlForDriver("ux0", 0x3001, NULL, 0, pInf, sizeof(SceIoDevInfo));.
<source lang="C">int sceCompatGetDevInf(SceIoDevInfo *pInfo);</source>


=== sceCompatGetPeripheralState ===
=== sceCompatGetPeripheralState ===
Line 127: Line 149:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || not present
| 0.990-1.03 || not present
|-
|-
| 1.69-3.60 || 0x2306FFED
| 3.60 || 0x2306FFED
|}
|}


Line 149: Line 171:
|}
|}


<source lang="C">
<source lang="C">int sceCompatSetSettings(SceCompatSettings settings);</source>
typedef struct SceCompatSettings { // size is 4 on FW 1.03
  SceUInt32 disp_filter : 1;
  SceUInt32 camera_direction : 1;
  SceUInt32 ra_up : 4;
  SceUInt32 ra_down : 4;
  SceUInt32 ra_left : 4;
  SceUInt32 ra_right : 4;
  SceUInt32 reserved : 14;
} SceCompatSettings;
 
int sceCompatSetSettings(SceCompatSettings settings);
</source>


=== sceCompatSuspendResume ===
=== sceCompatSuspendResume ===
Line 184: Line 194:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || not present
| 0.990-1.03 || not present
|-
|-
| 1.69 || 0x32BA3DCF
| 1.69 || 0x32BA3DCF
Line 199: Line 209:
|}
|}


<source lang="C">int sceCompatRegRead(SceUInt32 unk_bool, SceUInt32 offset, void *pBuf, SceSize size);</source>
<source lang="C">
// unk_id: if unk_id equals 0, offset + size must be less than 0x3a5d,
// else if unk_id equals 1, offset + size must be less than 0x20000
int sceCompatRegRead(SceUInt32 unk_id, SceUInt32 offset, void *pBuf, SceSize size);
</source>


=== sceCompatAvailableColorSpaceSetting ===
=== sceCompatAvailableColorSpaceSetting ===
Line 206: Line 220:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || not present
| 0.990-1.03 || not present
|-
|-
| 3.60 || 0x456226DD
| 3.60 || 0x456226DD
Line 266: Line 280:
| 0.990 || not present
| 0.990 || not present
|-
|-
| 1.69 || 0x782C980E
| 1.03-1.69 || 0x782C980E
|-
|-
| 3.60 || not present
| 3.60 || not present
|}
|}
<source lang="C">int sceCompatGetSettings(SceCompatSettings *pSettings);</source>


=== sceCompatIsPocketStationTitle ===
=== sceCompatIsPocketStationTitle ===
Line 286: Line 302:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || not present
| 0.990-1.03 || not present
|-
|-
| 3.60 || 0x8176C238
| 3.60 || 0x8176C238
Line 298: Line 314:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || not present
| 0.990-1.03 || not present
|-
|-
| 3.60 || 0x8A44206F
| 3.60 || 0x8A44206F
Line 310: Line 326:
| 0.940-3.60 || 0x8CA1632D
| 0.940-3.60 || 0x8CA1632D
|}
|}
=== init ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.940 || not present
|-
| 1.03 || 0x78E469D6
|-
| 3.60 || not present
|}
Loads Pcff (PSP Compat Flash Files) and Pcbc (PSP Compat Boot Code).
<source lang="C">int init(void);</source>


=== sceCompatRegWrite ===
=== sceCompatRegWrite ===
Line 321: Line 353:
|}
|}


<source lang="C">int sceCompatRegWrite(SceUInt32 unk_bool, SceUInt32 offset, const void *pBuf, SceSize size);</source>
<source lang="C">
// unk_id: if unk_id equals 0, offset + size must be less than 0x3a5d,
// else if unk_id equals 1, offset + size must be less than 0x20000
int sceCompatRegWrite(SceUInt32 unk_id, SceUInt32 offset, const void *pBuf, SceSize size);
</source>


=== sceCompatIdStorageLookup ===
=== sceCompatIdStorageLookup ===
Line 340: Line 376:
| 0.990 || not present
| 0.990 || not present
|-
|-
| 3.60 || 0x96FC2A87
| 1.03-3.60 || 0x96FC2A87
|}
|}


Line 348: Line 384:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || not present
| 0.990-1.03 || not present
|-
|-
| 3.60 || 0x99F13E04
| 3.60 || 0x99F13E04
Line 358: Line 394:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || not present
| 0.990-1.03 || not present
|-
|-
| 3.60 || 0xA073EBEE
| 3.60 || 0xA073EBEE
Line 364: Line 400:


=== sceCompatAllocCdramWithHole ===
=== sceCompatAllocCdramWithHole ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990-1.03 || not present
|-
| 3.60 || 0xA5039FFA
|}
=== alloc_cdram ===
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 370: Line 416:
| 0.990 || not present
| 0.990 || not present
|-
|-
| 3.60 || 0xA5039FFA
| 1.03 || 0xC6B19D35
|-
| 3.60 || not present
|}
|}
<source lang="C">
// size must be 0x4000000 (64MB)
int alloc_cdram(SceUID memblock_uid, SceSize size);
</source>


=== sceCompatGetPspSystemSoftwareVersion ===
=== sceCompatGetPspSystemSoftwareVersion ===
Line 380: Line 433:
| 0.990-3.60 || 0xB113DCC0
| 0.990-3.60 || 0xB113DCC0
|}
|}
On PSP FW 6.60, it returns 660.


<source lang="C">int sceCompatGetPspSystemSoftwareVersion(void);</source>
<source lang="C">int sceCompatGetPspSystemSoftwareVersion(void);</source>
Line 390: Line 445:
| 0.990 || not present
| 0.990 || not present
|-
|-
| 1.69-3.60 || 0xBC0E2B4C
| 1.03-3.60 || 0xBC0E2B4C
|}
|}
<source lang="C">int sceCompatFrameBufferInit(void *base);</source>


=== sceCompatLCDCSync ===
=== sceCompatLCDCSync ===
Line 410: Line 467:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || not present
| 0.990-1.03 || not present
|-
|-
| 3.60 || 0xC1E14CF5
| 3.60 || 0xC1E14CF5
Line 420: Line 477:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || not present
| 0.990-1.03 || not present
|-
|-
| 1.69 || 0xCB9F607B
| 1.69 || 0xCB9F607B
|-
| 3.60 || not present
|}
|}


Line 511: Line 570:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || not present
| 0.990-1.03 || not present
|-
|-
| 1.69-3.60 || 0xE97C1B5F
| 1.69-3.60 || 0xE97C1B5F
Line 541: Line 600:
! Version !! NID
! Version !! NID
|-
|-
| 0.940-0.990 || 0xB9DBD54A
| 0.940-1.03 || 0xB9DBD54A
|-
|-
| 3.60 || not present
| 3.60 || not present
|}
|}


Loads Pcff and Pcbc.
Loads Pcff (PSP Compat Flash Files) and Pcbc (PSP Compat Boot Code).
 
<source lang="C">int sceCompatInit(SceSize size, SceUInt32 a2, SceCompatInitParam *pParam);</source>


=== sceCompatLCDCInit ===
=== sceCompatLCDCInit ===
Line 554: Line 615:
|-
|-
| 0.940-0.990 || 0x3021D626
| 0.940-0.990 || 0x3021D626
|-
| 1.03-3.60 || not present
|}
|}


<source lang="C">int sceCompatLCDCInit(const SceDisplayFrameBuf *pFrameBuf);</source>
<source lang="C">int sceCompatLCDCInit(void *base);</source>


=== sceCompatLCDCExec ===
=== sceCompatLCDCExec ===
Line 564: Line 627:
|-
|-
| 0.940-0.990 || 0x7E3E266D
| 0.940-0.990 || 0x7E3E266D
|-
| 1.03-3.60 || not present
|}
|}


Line 575: Line 640:
| 0.990 || 0xCA184D5B
| 0.990 || 0xCA184D5B
|-
|-
| 3.60 || not present
| 1.03-3.60 || not present
|}
|}


Line 590: Line 655:
| 0.990 || 0x9EFFE36E
| 0.990 || 0x9EFFE36E
|-
|-
| 3.60 || not present
| 1.03-3.60 || not present
|}
|}


Line 605: Line 670:
| 0.990 || 0xC37A463C
| 0.990 || 0xC37A463C
|-
|-
| 3.60 || not present
| 1.03-3.60 || not present
|}
|}


Line 617: Line 682:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || 0x434BDAB0
| 0.990-1.03 || 0x434BDAB0
|-
|-
| 3.60 || not present
| 3.60 || not present
Line 631: Line 696:
| 0.990 || 0x02F5CF19
| 0.990 || 0x02F5CF19
|-
|-
| 3.60 || not present
| 1.03-3.60 || not present
|}
|}


Line 641: Line 706:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || 0x61DB492A
| 0.990-1.03 || 0x61DB492A
|-
|-
| 3.60 || not present
| 3.60 || not present
Line 653: Line 718:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || 0xC820EC43
| 0.990-1.03 || 0xC820EC43
|-
|-
| 3.60 || not present
| 3.60 || not present
Line 667: Line 732:
| 0.990 || 0xC983287E
| 0.990 || 0xC983287E
|-
|-
| 3.60 || not present
| 1.03-3.60 || not present
|}
|}



Revision as of 14:33, 12 April 2020

This is the primary kernel interface to the PSP Emulator.

Module

Known NIDs

Version Name World Privilege NID
1.69 SceCompat Non-secure Kernel 0x7FA33B9B
3.60-3.65 SceCompat Non-secure Kernel 0x8F2D0378

Libraries

Known NIDs

Version Name World Visibility NID
3.60-3.65 SceCompatForDriver Non-secure Kernel 0x7CFA62CD
3.60-3.65 SceCompatForVsh Non-secure User 0xF68A1AD0
0.990-3.65 SceCompat Non-secure User 0x0F35909D

Types

typedef struct SceCompatSettings { // size is 8 on FW 1.03
   SceUInt32 disp_filter : 1;
   SceUInt32 camera_direction : 1;
   SceUInt32 ra_up : 4;
   SceUInt32 ra_down : 4;
   SceUInt32 ra_left : 4;
   SceUInt32 ra_right : 4;
   SceUInt32 reserved : 46;
} SceCompatSettings;

typedef struct SceCompatInitParam { // size is 0x40 on FW 1.03
   char unk[0x40];
} SceCompatInitParam;

SceCompatForDriver

SceCompatForDriver_6EBD9E01

Version NID
0.990 not present
3.60 0x6EBD9E01

SceCompatForVsh

SceCompatForVsh_4915DEE7

Version NID
0.990 not present
3.60 0x4915DEE7

SceCompatForVsh_70997F92

Version NID
0.990 not present
3.60 0x70997F92

SceCompatForVsh_9C107CC9

Version NID
0.990 not present
3.60 0x9C107CC9

SceCompat

sceCompatGetUpdateState

Version NID
0.990-1.03 not present
3.60 0x0CDE9EC5

sceCompatGetDevInf

Version NID
0.990 not present
1.03-3.60 0x138006A8

Calls sceIoDevctlForDriver("ux0", 0x3001, NULL, 0, pInf, sizeof(SceIoDevInfo));.

int sceCompatGetDevInf(SceIoDevInfo *pInfo);

sceCompatGetPeripheralState

Version NID
0.990-3.60 0x176B2906
// periph_id: 1: IsHeadphoneExist, 2: GetBatteryLifePercent, 3: GetBatteryLifeTime, 4: IsSuspendRequired
int sceCompatGetPeripheralState(SceUInt32 periph_id);

sceCompatWriteShared32

Version NID
0.990 not present
1.03-3.60 0x1CD51530
// some_id must be between 0x80 and 0x8A
int sceCompatWriteShared32(SceUInt32 some_id, SceUInt32 value);

sceCompatWriteSharedCtrl

Version NID
0.990-1.03 not present
3.60 0x2306FFED
// buf max size is 0x10, but only 0xC bytes are written to Shared SRAM
int sceCompatWriteSharedCtrl(void *buf);

sceCompatSetSettings

Version NID
0.990 not present
1.03-1.69 0x312782DC
3.60 not present
int sceCompatSetSettings(SceCompatSettings settings);

sceCompatSuspendResume

Version NID
0.990 not present
1.69-3.60 0x324112CA
// mode: 0: suspend, 1: resume
// step: 1: first step, 2: second step
int sceCompatSuspendResume(SceUInt32 mode, SceUInt32 step);

sceCompatSetDisplayConfig

Version NID
0.990-1.03 not present
1.69 0x32BA3DCF

sceCompatRegRead

Version NID
0.990-1.69 0x4521505D
3.60 not present
// unk_id: if unk_id equals 0, offset + size must be less than 0x3a5d,
// else if unk_id equals 1, offset + size must be less than 0x20000
int sceCompatRegRead(SceUInt32 unk_id, SceUInt32 offset, void *pBuf, SceSize size);

sceCompatAvailableColorSpaceSetting

Version NID
0.990-1.03 not present
3.60 0x456226DD

sceCompatCache

Version NID
0.940-3.60 0x6777390E
// mode: 1: Invalidate, 2: Clean and Invalidate, 3: Clean
int sceCompatCache(SceUInt32 mode, void *base, SceSize size);

sceCompatAllocCdram

Version NID
0.990 not present
1.69 0x6E8E3BA8

sceCompatWaitSpecialRequest

Version NID
0.940-3.60 0x714F7ED6
int sceCompatWaitSpecialRequest(SceUInt32 req_id);

sceCompatReadShared32

Version NID
0.990 not present
1.03-3.60 0x73AA4871
// some_id must be between 0 and 6
int sceCompatReadShared32(SceUInt32 some_id, SceUInt32 *pValue);

sceCompatGetSettings

Version NID
0.990 not present
1.03-1.69 0x782C980E
3.60 not present
int sceCompatGetSettings(SceCompatSettings *pSettings);

sceCompatIsPocketStationTitle

Version NID
0.990 not present
3.60 0x7DCFBCCE

sceCompatWaitAndGetRequest

Version NID
0.990-1.03 not present
3.60 0x8176C238
int sceCompatWaitAndGetRequest(SceUInt32 req_id, SceUInt32 a2);

sceCompatSetUpdateState

Version NID
0.990-1.03 not present
3.60 0x8A44206F

sceCompatStart

Version NID
0.940-3.60 0x8CA1632D

init

Version NID
0.940 not present
1.03 0x78E469D6
3.60 not present

Loads Pcff (PSP Compat Flash Files) and Pcbc (PSP Compat Boot Code).

int init(void);

sceCompatRegWrite

Version NID
0.990-1.69 0x912B1C28
3.60 not present
// unk_id: if unk_id equals 0, offset + size must be less than 0x3a5d,
// else if unk_id equals 1, offset + size must be less than 0x20000
int sceCompatRegWrite(SceUInt32 unk_id, SceUInt32 offset, const void *pBuf, SceSize size);

sceCompatIdStorageLookup

Version NID
0.940-3.60 0x94AAA245
int sceCompatIdStorageLookup(SceUInt16 key, SceUInt32 offset, void *pBuf, SceSize size);

sceCompatCheckPocketStation

Version NID
0.990 not present
1.03-3.60 0x96FC2A87

sceCompatGetTitleList

Version NID
0.990-1.03 not present
3.60 0x99F13E04

sceCompatGetCurrentSecureTick

Version NID
0.990-1.03 not present
3.60 0xA073EBEE

sceCompatAllocCdramWithHole

Version NID
0.990-1.03 not present
3.60 0xA5039FFA

alloc_cdram

Version NID
0.990 not present
1.03 0xC6B19D35
3.60 not present
// size must be 0x4000000 (64MB)
int alloc_cdram(SceUID memblock_uid, SceSize size);

sceCompatGetPspSystemSoftwareVersion

Version NID
0.990-3.60 0xB113DCC0

On PSP FW 6.60, it returns 660.

int sceCompatGetPspSystemSoftwareVersion(void);

sceCompatFrameBufferInit

Version NID
0.990 not present
1.03-3.60 0xBC0E2B4C
int sceCompatFrameBufferInit(void *base);

sceCompatLCDCSync

Version NID
0.990 not present
1.03-3.60 0xBD177787
int sceCompatLCDCSync(void);

sceCompatWaitIntr

Version NID
0.990-1.03 not present
3.60 0xC1E14CF5

sceCompatGetRequest

Version NID
0.990-1.03 not present
1.69 0xCB9F607B
3.60 not present

sceCompatDatRead

Version NID
0.990-3.60 0xCBE73EBE
// index must be 0
// offset + size must be lower or equal to 0x1038
int sceCompatDatRead(SceUInt32 index, SceUInt32 offset, void *pBuf, SceSize size);

sceCompatReturnValueEx

Version NID
0.990 not present
1.69-3.60 0xCC02A9FF

sceCompatGetStatus

Version NID
0.990 not present
1.69-3.60 0xD2E3370E

sceCompatInterrupt

Version NID
0.940-3.60 0xD6AA36DD

Use a custom SceCompatMailbox address.

int sceCompatInterrupt(void *pMailbox);

sceCompatSetRif

Version NID
0.990 not present
1.03-3.60 0xD8B69F23
// Example of entitlementId: AA0000-AAAA00000_00-0000000000000000
int sceCompatSetRif(const char *entitlementId);

sceCompatGetPrimaryHead

Version NID
0.990 not present
1.69 0xDC9EE33A

sceCompatSetSuspendSema

Version NID
0.990 not present
1.69-3.60 0xDD30239E

sceCompatInitEx

Version NID
0.990-1.03 not present
1.69-3.60 0xE97C1B5F

sceCompatUninit

Version NID
0.990-3.60 0xEF929397
int sceCompatUninit(void);

sceCompatStop

Version NID
0.990-3.60 0xFCE2422F
int sceCompatStop(void);

sceCompatInit

Version NID
0.940-1.03 0xB9DBD54A
3.60 not present

Loads Pcff (PSP Compat Flash Files) and Pcbc (PSP Compat Boot Code).

int sceCompatInit(SceSize size, SceUInt32 a2, SceCompatInitParam *pParam);

sceCompatLCDCInit

Version NID
0.940-0.990 0x3021D626
1.03-3.60 not present
int sceCompatLCDCInit(void *base);

sceCompatLCDCExec

Version NID
0.940-0.990 0x7E3E266D
1.03-3.60 not present
int sceCompatLCDCExec(void);

sceCompatResume

Version NID
0.990 0xCA184D5B
1.03-3.60 not present
// step: must be either 1 (resume Pervasive, restore CPU speed) or 2 (init lcd dmac, write resume payload, reload act.dat)
int sceCompatResume(SceUInt32 step, int maybe_addr);

sceCompatSuspend

Version NID
0.990 0x9EFFE36E
1.03-3.60 not present
// step: must be either 1 (black screen) or 2 (suspend Pervasive, slow down CPU, wipe act.dat in memory)
int sceCompatSuspend(SceUInt32 step);

sceCompatWriteShared

Version NID
0.990 0xC37A463C
1.03-3.60 not present

Writes to SceCompatSharedSram.

int sceCompatWriteShared(SceUInt32 offset, const void *pBuf, SceSize size);

sceCompatWaitRequest

Version NID
0.990-1.03 0x434BDAB0
3.60 not present
int sceCompatWaitRequest(SceUInt32 req_id);

sceCompatReturnResult

Version NID
0.990 0x02F5CF19
1.03-3.60 not present
int sceCompatReturnResult(SceUInt32 req_id);

sceCompatReturnValue

Version NID
0.990-1.03 0x61DB492A
3.60 not present
int sceCompatReturnValue(SceUInt32 req_id, uint a2, uint a3);

sceCompatSetDisplayBuffer

Version NID
0.990-1.03 0xC820EC43
3.60 not present
int sceCompatSetDisplayBuffer(const SceDisplayFrameBuf *pFrameBuf);

sceCompatReadShared

Version NID
0.990 0xC983287E
1.03-3.60 not present
int sceCompatReadShared(SceUInt32 offset, void *pBuf, SceSize size);