Editing PSP Emulation

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
=='''PSPHD'''==
=='''PSPHD'''==
The new PS Plus PSP emulator includes plenty of undiscovered functionalities, it even allows patches directly to the emulated Allegrex cpu.
The new ps plus psp emulator has a lot of undiscovered functionalities. It even allows patches directly to the emulated Allegrex cpu.
Not many CLI commands were added this time around. Very few commands have a description to their usage inside of the eboot.bin, everything else is just guesswork from the scene. Plenty of LUA commands need to be understood before the compatibility of games can improve. The PSP emulator has not gained the same popularity as the ps2 emulator due to the existence of an unofficial PPSSPP core in the unofficial Retroarch port for the PS4. As far as the compatibility and performance go, the Retroarch core is yet to be bested. This emulator may hold potential, but the potential can only go so far as it seems not to have support for gamedata installation, which in turn will render many games unplayable.
Sadly sony has not made it easy for users to use CLI commands. Since sony mostly uses lua patches for the psp releases, not many cli commands were added. Very few commands have a description to their usage inside of the eboot.bin. Everything else is just guesswork from the scene. The psp emulator has not gained the same popularity as the ps2 emulator because currently, there is an unofficial PPSSPP core in the unofficial retroarch port for the ps4. and as far as the compatibility and performance goes, the retroarch core is second to no one. This emulator may still hold potential, though sadly it does not seem to have support for gamedata installation. and that has led to many games becoming currently unusable. with an official retroarch release coming into ps4's way it seems delving deeper into the PSPHD emulator and the PS1's new psplus emulator is pretty useless.


== Commands ==
== Commands ==
'''Known functions:''' Require cleanup.
'''Known functions:''' Require cleanup.
<br>The rest of the cli and lua commands can all be found inside of an emu's decrypted '''eboot.bin'''.
<br>The rest of the cli and lua commands can all be found inside of an emu's decrypted '''eboot.bin'''.
=== CLI commands ===
=== config-emu-ps4.txt commands ===
These commands can be added to any of these files:
''General purpose CLI commands, or unknown usage''
* '''config-title.txt'''
* '''package-ps4.conf'''
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
! Command !! Values !! Notes !! Usage  
! Command !! Values !! Notes !! Usage  
Line 18: Line 16:
|-
|-
| --notrophies || || Enable/disable trophies||  
| --notrophies || || Enable/disable trophies||  
|-
| --ps4-trophies  || || ||
|-
|-
| --locale || || ||
| --locale || || ||
Line 29: Line 25:
| --addon || || ||
| --addon || || ||
|-
|-
| --host || Sets host directory || --host="/hostapp/" ||
| --host || || Sets host directory || --host="/hostapp/"
|-
|-
| --loglevel || none, all, warn, info, error, debug, trace || debug logging ||
| --loglevel || none, all, warn, info, error, debug, trace || debug logging  
|-
|-
| --xobuttonmode || oenter, ocancel || Switcher between x and circle button, made specifically for japanese gamers ||
| --xobuttonmode || oenter, ocancel || Switcher between x and circle button, made specifically for japanese gamers  
|-
|-
| --lang || Including but not limited to "en" "jp" "fr" "it"  || Language selector || --lang="en"
| --lang || Including but not limited to "en" "jp" "fr" "it"  || Language selector || --lang="en"
Line 44: Line 40:
|-
|-
| --samplesave || ? || ? ||
| --samplesave || ? || ? ||
|-
| --vramcopyback || 0, 10000000 || for games that download data from GPU to Allegrex || --vramcopyback=45
|-
| --msxxadhoc || true?, false? || ad hoc support ? ||
|-style="background-color:#ff99c2"
|-style="background-color:#ff99c2"
| || Graphical fixes || ||
| || Graphical fixes || ||
|-
| --parappareplacecolor || The command expects 8 Hex values || (rgb?) ||
|-
|-
| --antialias || off, MSAA4x, SSAA4x|| Anti-aliasing options || --antialias=off
| --antialias || off, MSAA4x, SSAA4x|| Anti-aliasing options || --antialias=off
|-
| --clamp-line-thickness-min || ? || ? ||
|-
| --clamp-line-thickness-max || ? || ? ||
|-
|-
| --texcachemode || patchworkheroes drawbounds, drawboundsloco, patchworkheroes, locoroco2, rondo, full || for issues with texture cache (modes lower than full possibly read some textures directly without cache). || --texcachemode=patchworkheroes
| --texcachemode || patchworkheroes drawbounds, drawboundsloco, patchworkheroes, locoroco2, rondo, full || for issues with texture cache (modes lower than full possibly read some textures directly without cache). || --texcachemode=patchworkheroes
Line 56: Line 62:
|-
|-
| --depthscalehack || true?, false? || ||--depthscalehack=true
| --depthscalehack || true?, false? || ||--depthscalehack=true
|-
| --texloadcores || 0, 100 || textures to load || texloadcores=2
|-
| --smoothlevel || 0, 100 ||  Mesh smoothing level? || --smoothlevel=0
|-
| --anisolevel || 0, 100 || Anisotropic filtering level?? ||
|-
| --parappajapanesefonthack || true?, false? || Enables Support For Japanese Fonts ??|| --parappajapanesefonthack=true
|-
|-
| --depthscalehack || true?, false? || ||--depthscalehack=true
| --depthscalehack || true?, false? || ||--depthscalehack=true
|-
|-
| --locorocomeshsmooth || true, false || Custom mesh smoothing for loco roco games(?)|| --locorocomeshsmooth=true
| --locorocomeshsmooth || true, false || Custom mesh smoothing for loco roco games|| --locorocomeshsmooth=true
|-
|-
| --locorocomeshsmoothnonindexed || true, false || Turns "locorocomeshsmooth" mesh smoothing into non-indexed(?) ||--locorocomeshsmoothnonindexed=true
| --locorocomeshsmoothnonindexed || true, false || Non-indexed mesh smoothing ||--locorocomeshsmoothnonindexed=true
|-
|-
| --forcenobilinear || true, false || Turn bilinear filtering on/off, setting it to True will fix many graphical glitches in games that use 2D Images ||--forcenobilinear=true
| --forcenobilinear || true, false || Turn bilinear filtering on/off, setting it to True will fix many graphical glitches in games that use 2D Images ||--forcenobilinear=true
Line 67: Line 81:
|  || Game fixes || ||
|  || Game fixes || ||
|-
|-
| --godofwarhack || true, false || Likely a performance patch for games that go way above the fps cap. Managed to help '''God Of War - Ghost Of Sparta''' skip intro freeze. it could possibly be used as a speedhack. [https://github.com/hrydgard/ppsspp/pull/15640 Might be this?]|| --godofwarhack=true
| --umddelay || ? || Seems to be I/O timing method, Some games need a delay to work properly. [https://github.com/hrydgard/ppsspp/issues/7647 More here]  ||
|-style="background-color:#03fcc2"
| || No effect / unknown values || ||
|-
|-
| --texloadcores || 0, 100 || textures to load || texloadcores=2
| --godofwarhack || true?, false? || Seems specifically made for god of war, unknown effect || --godofwarhack=true
|-
|-
| --smoothlevel || 0, 100 || Mesh smoothing level? || --smoothlevel=0
| --parappaalphahack || true?, false? || || --parappaalphahack=true
|-style="background-color:#7698FF"
|  || Speedhacks || ||
|-
|-
| --anisolevel || 0, 100 || Anisotropic filtering level?? ||
| --antialias || off || Turning Anti-Alias Off Improves Performance||--antialias=off
|-
|-
| --parappajapanesefonthack || true?, false? || Enables Support For Japanese Fonts ??|| --parappajapanesefonthack=true
| --texclutmode || full || Turns on filtering of CLUT hashes to avoid repeat indexed textures ||--texclutmode=full
|-
|-
| --clamp-line-thickness-min || ? || ? ||
| --texloadcores || 0 || Textures to load ||--texloadcores=12
|-
| --clamp-line-thickness-max || ? || ? ||
|-
| --parappareplacecolor || The command expects 8 Hex values || (rgb?) ||
|-
| --msxxadhoc || true?, false? || ad hoc support ? ||
|-
| --parappaalphahack || true?, false? || Doesn't seem to have any effect.|| --parappaalphahack=true
|-
| --umddelay || ? || Seems to be I/O timing method. Doesn't seem to have any effect  ||
|-
| --vramcopyback || 0, 10000000 || for games that download data from GPU to Allegrex || --vramcopyback=45
|-
|-style="background-color:#7698FF"
|  || Speedhacks / Possible duplicates|| ||
|-
| --antialias || off || Turning Anti-Alias Off Improves Performance||--antialias=off
|-
| --texclutmode ||  full || Turns on filtering of CLUT hashes to avoid repeat indexed textures ||--texclutmode=full
|-
| --texloadcores || 0 || Textures to load ||--texloadcores=12
|-
|-
| --smoothlevel || 0 || Set mesh smooth level||--smoothlevel=0
| --smoothlevel || 0 || Set mesh smooth level||--smoothlevel=0
Line 110: Line 103:
| --anisolevel || 0, 100 || Anisotropic filtering level?? ||
| --anisolevel || 0, 100 || Anisotropic filtering level?? ||
|-
|-
| --present || vblankstart, setframebuf, drawsync|| set when frame is presented. Sync issues, flickering screen, tearing, input lag, etc. Doesn't seem to have any effect. ||--present=setframebuf
| --present || vblankstart, setframebuf, drawsync|| set when frame is presented. Sync issues, flickering screen, tearing, input lag, etc. ||--present=setframebuf
|-
|-
| --texrecent || true || Optimize texture hashes ||--texrecent=true
| --texrecent || true || Optimize texture hashes ||--texrecent=true
|}
|}
====Syphon Filter Dark Mirror====
 
====Texture replacement====
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
! Command !! Values !! Notes !! Usage   
! Command !! Values !! Notes !! Usage   
|-
|-
| --force-native-aspect-ratio || || ||
| --texswitch||true, false|| Enables Texture replacement || --texswitch=true
|-
|-
| --use-higher-precision-depth || || ||
| --texsave || || ||
|-
|-
| --optimize-fb-self-resolves || || ||
| --texmissingsave || || ||
|-
|-
| --force-dsf-present || || ||
| --autoresampler || true, false|| Turns on the auto-resampler. Assumes textures in texreplace are at 8x resolution and resamples them at load, May only work on new LocoRoco Midnight Carnival emu || --autoresampler=true
|-
|-
| --bend-30hz-lock|| || ||
| --texreplace || Directory || Set directory of texture replacement folder || --texreplace="host0:texreplace"
|-
|-
| --setframebuf-auto-vblank-wait-threshold|| || ||
| --replacementfilter || true, false || This forces alpha blending to on for replaced textures. || --replacementfilter=true
|-
|-
| --gpu-renderthread|| || ||
| --replacementalpha || true, false || || --replacementalpha=true
|-
|-
| --force-triangle-clip-off|| || ||
|}
|-
 
| --hack-use-sku-vms|| || ||
|-
| --active-sku || || ||
|-
| --psp-right-stick-action || 0,1 || ||--psp-right-stick-action=1
|-
| --psp-right-stick-deadzone-x || || ||--psp-right-stick-deadzone-x=15
|-
| --psp-right-stick-deadzone-y || || ||--psp-right-stick-deadzone-y=15
|-
| --psp-right-stick-deadzone-semicircle-arc || || ||--psp-right-stick-deadzone-semicircle-arc=40
|-
|}
 
====Texture replacement====
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
! Command !! Values !! Notes !! Usage 
|-
| --texswitch||true, false|| Enables Texture replacement || --texswitch=true
|-
| --texsave || || ||
|-
| --texmissingsave || || ||
|-
| --autoresampler || true, false|| Turns on the auto-resampler. Assumes textures in texreplace are at 8x resolution and resamples them at load, May only work on new LocoRoco Midnight Carnival emu || --autoresampler=true
|-
| --texreplace || Directory || Set directory of texture replacement folder || --texreplace="host0:texreplace"
|-
| --replacementfilter || true, false || This forces alpha blending to on for replaced textures. || --replacementfilter=true
|-
| --replacementalpha || true, false || || --replacementalpha=true
|-
|}
 
===XXXXYYYYY_patches.lua===
===XXXXYYYYY_patches.lua===
The lua can be placed as: '''scripts\XXXXYYYYY_patches.lua'''  
Your lua can be placed as '''scripts\XXXXYYYYY_patches.lua'''  
<br>'''Requires Cleanup'''.


====Emulator commands====
====Emulator commands====
Line 203: Line 164:
| SaveState ||emuObj.SaveState()||  
| SaveState ||emuObj.SaveState()||  
|-
|-
| SetFDExtraDelay ||emuObj.SetFDExtraDelay()|| 0? 1?
| SetFDExtraDelay ||emuObj.SetFDExtraDelay()||
|-
|-
| MeshSmooth ||emuObj.MeshSmooth()||
| MeshSmooth ||emuObj.MeshSmooth()||
Line 368: Line 329:
|GetReg||axObj.GetReg()||
|GetReg||axObj.GetReg()||
|-style="background-color:#D7EF54"
|-style="background-color:#D7EF54"
| Memory editing || || Do note that the offsets on PPSSPP are mapped differently than the ones on the PS4  
| Memory editing || || Do note that the offsets on PPSSPP are different than the ones on the PS4  
|-
|-
| ReadMem32 || axObj.ReadMem32() || Read 4 bytes from offset
| ReadMem32 || axObj.ReadMem32() || Read 4 bytes from offset
Line 422: Line 383:
[https://www.psdevwiki.com/ps4/Talk:PSP_Emulator_Compatibility_List#Official_PSPemu_Configuration_Files More patches can be found here]
[https://www.psdevwiki.com/ps4/Talk:PSP_Emulator_Compatibility_List#Official_PSPemu_Configuration_Files More patches can be found here]
=====Patches.lua=====
=====Patches.lua=====
======Syphon Filter: Dark Mirror======
'''An official lua created by sony for Patapon 2'''
 
<pre>
-- Lua 5.3
-- Title: Syphon Filter: Dark Mirror
 
-- Patches for fixing issues with post fx in games using the Syphon Filter/Resistance engine
 
apiRequest(1.0) -- request version 1.0 API. Calling apiRequest() is mandatory.
 
local emuObj = getEmuObject()
local cpu = getAXObject()
 
-- The bloom filter uses 1.5 pixel jitter to make a ghetto blur. When up-ressed, this doesn't look good.
-- To compensate, reduce the jitter amount before rendering.
function BloomJitterPlusAdjust()
-- 1.5 pixel "+" pattern
emuObj.AdjustUVJitter(0, 4, 0.0, 1.5)
emuObj.AdjustUVJitter(4, 4, 0.0, -1.5)
emuObj.AdjustUVJitter(8, 4, 1.5, 0.0)
emuObj.AdjustUVJitter(12, 4, -1.5, 0.0)
end
 
function BloomJitterCrossAdjust()
-- 1.5 pixel "x" pattern
emuObj.AdjustUVJitter(0, 4, 1.5, 1.5)
emuObj.AdjustUVJitter(4, 4, -1.5, 1.5)
emuObj.AdjustUVJitter(8, 4, 1.5, -1.5)
emuObj.AdjustUVJitter(12, 4, -1.5, -1.5)
end
 
local jitterFixPlus = emuObj.AddGPUHook(0x40dc000, 0, 16, 0x40d4000, BloomJitterPlusAdjust)
local jitterFixCross = emuObj.AddGPUHook(0x40d4000, 0, 16, 0x40dc000, BloomJitterCrossAdjust)
 
function depthquery()
local querystruct = 0x8eda968 -- this is always in a fixed location
-- the depth query struct is fixed to 24 entries
-- 0..15 seem to be always used for lights, 16..23 are for npcs
for i=0,23 do
local querytype = cpu.ReadMem32(querystruct+0)
local valid = cpu.ReadMem32(querystruct+1*4)
if valid ~= 0xffffffff then
--local queryx = cpu.ReadMem32(querystruct+2*4)
--local queryy = cpu.ReadMem32(querystruct+3*4)
--local querydepth = cpu.ReadMem32(querystruct+4*4)
--local querywidth = cpu.ReadMem32(querystruct+5*4)
--local queryheight = cpu.ReadMem32(querystruct+6*4)
--local param1c = cpu.ReadMem32(querystruct+7*4)
--local param20 = cpu.ReadMem32(querystruct+8*4)
local param24 = cpu.ReadMem32(querystruct+9*4)
--local result = cpu.ReadMemFloat(querystruct+10*4)
if param24 <= 0 then
cpu.WriteMem32(querystruct+1*4, 0xffffffff) -- to be removed from the list -> mark as invalid
else
if querytype == 3 then -- n x n coverage based occlusion used by lights. Object opacity is set to (visible_samples / total_samples)
cpu.WriteMemFloat(querystruct+10*4, 0.0) -- always hide lights
else -- Enemies use a 5-point (corners + center) occlusion check. Object is visible if any of the points is visible.
cpu.WriteMemFloat(querystruct+10*4, 1.0) -- set always visible
end
end
end
querystruct = querystruct + 0x2c
end
end
 
cpu.AddHook(0x8c163d4, 0x27bdff80, depthquery) -- = addiu sp, sp, -0x80
-- the hook code replaces the occlusion function, so just adjust the stack and return
cpu.InsnReplace(0x8c163d8, 0x34040000, 0x27bd0080) -- addiu sp, sp, 0x80
cpu.InsnReplace(0x8c163dc, 0xafa40048, 0x03e00008) -- jr ra
cpu.InsnReplace(0x8c163e0, 0x3c0408ee, 0x00000000) -- nop
</pre>
======Patapon 2'''======
<pre>
<pre>
-- Lua 5.3
-- Lua 5.3
Line 899: Line 789:


== Emulators ==
== Emulators ==
<pre>Every emulator is programmed in a differently. Sometimes choosing the right emulator is the only possible way to fix a game. Emulators are not provided pre-installed on the ps4, they have to be unpacked from a backup that's downloaded from the ps store from that specific game. This list includes The typical usage of some of The emulators.</pre>
<pre>Every emulator is programmed in a different way, sometimes choosing the right emulator is the only possible way to fix a game. Emulators are not provided pre-installed on the ps4, they have to be unpacked from a backup that's downloaded from the ps store from that specific game. this list includes The typical usage of some of The emulators.</pre>
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
! Emulator !! Usage !! API Version !! Similar emulators (compatibility)
! Emulator !! Usage !! API Version !! Similar emulators (Usage)
|-
|-
| Echochrome || The default psp emulator for PSPFPKG tool at the time of writing and the best in terms of compatibility. || ? || ?
| Echochrome || The default psp emulator for PSPFPKG tool at the time of writing and the best in terms of compatibility. || ? || ?
Line 916: Line 806:
|-
|-
| PaRappa the Rapper || An unofficial emulator developed by sony with very bad compatibility ||  ? || ?
| PaRappa the Rapper || An unofficial emulator developed by sony with very bad compatibility ||  ? || ?
|-
| Syphon Filter: Dark Mirror || ? || ? || ?
|-
|-
|}
|}


==Memory mapping==
==Memory mapping==
<br>'''Note''': The memory on PPSSPP is 0x4000 offsets ahead of the memory on the PS4
<br>'''Note''': The memory in PPSSPP is 0x4000 values ahead of the memory on the PS4
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
! Size !! Offset From -> Offset To !! Name
! Offset From !! Offset To !! Name
|-
| 0x1008000000 || 0x10887FFFFF  ||  Allegrex memory(?)
|-
|-
| || 1008000000 -> 10887FFFFF ||  Allegrex memory(?)
|}
 
==Register map==
<br>Registers with (?) are untested.
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
! Register !! Offset
|-
|-
|640.00MB  || 228200000 -> 250200000 ||
| v0 || 0x200414CB0
|-
|-
|64.00MB  ||  250200000 -> 254200000 ||
| v1 || 0x200414CB4
|-
|-
|32.00MB  ||  254200000 -> 256200000 ||
| a0 || 0x200414CB8
|-
|-
|2048.00MB ||  256200000 -> 2d6200000 ||
| a1 || 0x200414CBC?
|-
|-
|16.00MB  ||  2d6200000 -> 2d7200000 ||
| a2 || 0x200414CC0?
|-
|-
|16.00MB  ||  2d7200000 -> 2d8200000 ||
| a3 ||  0x200414CC4?
|-
|-
|16.00MB  ||  2d8200000 -> 2d9200000 ||
| t0 || 0x200414CC8?
|-
|-
|16.00MB  ||  2d9200000 -> 2da200000 ||
| t1 || 0x200414CCC?
|-
|-
|}
| t2 || 0x200414CD0?
 
===Registers map===
<br>Registers that are marked with '''(?)''' are untested but should be accurate.
<br>*'''Note''': The offsets' positions change as the CLI file's content increases, but the offsets should still be somewhere nearby the offsets listed below and the layout should be the same regardless. The PC pointer script can be used to locate another PC register properly in Echochrome's emulator
{| class=wikitable style="border: none; background: none;"
! scope=col | GPR
! scope=col | Offset
! scope=col | Notes
| rowspan=900 style="border: none; background: none;"|
! scope=col | FPU
! scope=col | Offset
|-
|-
| zero || 0x200414CA8? || || f0 || 0x200414D4C?
| t3 ||  0x200414CD4?
|--style="background-color:#EEEFF2"
| at || 0x200414CAC? || || f1 || 0x200414D50
|-
|-
| v0 || 0x200414CB0 || || f2 || 0x200414D54?
| t4 ||  0x200414CD8?
|--style="background-color:#EEEFF2"
| v1 || 0x200414CB4  || || f3 || 0x200414D58?
|-
|-
| a0 || 0x200414CB8 || || f4 || 0x200414D5C?
| t5 ||  0x200414CDC?
|--style="background-color:#EEEFF2"
| a1 || 0x200414CBC? || || f5 || 0x200414D60?
|-
|-
| a2 || 0x200414CC0? || || f6 || 0x200414D64?
| t6 || 0x200414CE0?
|--style="background-color:#EEEFF2"
| a3 ||  0x200414CC4? || || f7 || 0x200414D68?
|-
|-
| t0 || 0x200414CC8? || ||f8|| 0x200414D6C?
| t7 || 0x200414CE4?
|--style="background-color:#EEEFF2"
| t1 || 0x200414CCC? || ||f9 || 0x200414D70?
|-
|-
| t2 ||  0x200414CD0? || || f10 || 0x200414D74?
| s0 ||  0x200414CE8?
|--style="background-color:#EEEFF2"
| t3 ||  0x200414CD4? || ||f11|| 0x200414D78?
|-
|-
| t4 || 0x200414CD8? || || f12 || 0x200414D7C?
| s1 || 0x200414CEC?
|--style="background-color:#EEEFF2"
| t5 ||  0x200414CDC? || || f13 || 0x200414D80?
|-
|-
| t6 || 0x200414CE0? || || f14 || 0x200414D84?
| s2 || 0x200414CF0?
|--style="background-color:#EEEFF2"
| t7 || 0x200414CE4? || || f15 || 0x200414D88?
|-
|-
| s0 || 0x200414CE8? || || f16 || 0x200414D8C?
| s3 || 0x200414CF4?
|--style="background-color:#EEEFF2"
| s1 || 0x200414CEC? || || f17 || 0x200414D90?
|-
|-
| s2 ||  0x200414CF0? || || f18 || 0x200414D94?
| s4 ||  0x200414CF8?
|--style="background-color:#EEEFF2"
| s3 || 0x200414CF4? || || f19 || 0x200414D98?
|-
|-
| s4 ||  0x200414CF8? || || f20|| 0x200414D9C?
| s5 ||  0x200414CFC?
|--style="background-color:#EEEFF2"
| s5 ||  0x200414CFC? || || f21 || 0x200414DA0?
|-
|-
| s6 ||  0x200414D00? || || f22 || 0x200414DA4?
| s6 ||  0x200414D00?
|--style="background-color:#EEEFF2"
| s7 ||  0x200414D04? || || f23|| 0x200414DA8?
|-
|-
| t8 ||  0x200414D08? || || f24 || 0x200414DAC?
| s7 ||  0x200414D04?
|--style="background-color:#EEEFF2"
| t9 ||  0x200414D0C? || || f25 || 0x200414DB0?
|-
|-
| k0 ||  0x200414D10 || ||f26 || 0x200414DB4?
| t8 ||  0x200414D08?
|--style="background-color:#EEEFF2"
| k1 ||  0x200414D14 || || f27 || 0x200414DB8?
|-
|-
| gp ||  0x200414D18 || || f28|| 0x200414DBC?
| t9 ||  0x200414D0C?
|--style="background-color:#EEEFF2"
| sp || 0x200414D1C || || f29 || 0x200414DC0?
|-
|-
| fp || 0x200414D20 ||  || f30 || 0x200414DC4?
| k0 ||  0x200414D10
|--style="background-color:#EEEFF2"
| {{cellcolors|#D7EF54|#000000}}ra || 0x200414D24 || || f31 || 0x200414DC8
|-
|-
| ? || 0x20AD14D28 || ||  ||
| k1 ||  0x200414D14
|--style="background-color:#EEEFF2"
| last syscall? || 0x20AD14D2C || ||  ||
|-
|-
| {{cellcolors|#7698FF|#000000}}pc || 0x200414D34 || Will show "0x0", "0x1", "0x5", if the Allegrex cpu is idle(?). || ||
| gp ||  0x200414D18
|--style="background-color:#EEEFF2"
| hi || 0x200414D38 || ||  ||
|-
|-
| lo || 0x200414D3C || ||  ||
| sp || 0x200414D1C
|--style="background-color:#EEEFF2"
| Memory base? || 0x200414D48 || Shows "0x08800000", could be used as pointer or something?|| ||
|-
|-
|}
| fp || 0x200414D20
====PC pointer====
|-style="background-color:#D7EF54"
<br>PS4CHEATER
| ra || 0x200414D24
<br>'''PSP.cht'''
|-style="background-color:#7698FF"
<pre>
| pc || 0x200414D34
1.5|eboot.bin|ID:|VER:01.00|FM:505
|-
simple pointer|pointer|4 bytes|@C6B8C8_2_6B8C8+210+108|data|4 bytes|143011412|0||
|}
</pre>
 
'''VFPU'''
= Known issues =
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
! Register !! Offset !! Register !! Offset !! Register !! Offset !! Register !! Offset
! Issue !! Games affected !! Solution !! Description
|-
|-
| S000|| 0x200414DE0 || S001|| 0x200414DE4 || S002|| 0x200414DE8 || S003|| 0x200414DEC
| - || || ||
|-
|-
| S010|| 0x200414DF0 || S011|| 0x200414DF4 || S012|| 0x200414DF8  || S013|| 0x200414DFC
|}
|-
 
| S020|| 0x200414E00 || S021|| 0x200414E04 || S022||  0x200414E08 || S023|| 0x200414E0C
=LUA include files=
|-
<br>Files that need to be placed in the '''/lua_include/''' folder
|S030|| 0x200414E10 || S031|| 0x200414E14 || S032|| 0x200414E18  || S033|| 0x200414E1C
 
|-
'''ax-gpr-alias.lua'''
|S100|| 0x200414E20  || S101|| 0x200414E24  || S102||  0x200414E28  || S103|| 0x200414E2C
<pre>
|-
 
| S110 || 0x200414E30  || S111|| 0x200414E34 || S112||  0x200414E38 || S113||0x200414E3C
-- Recommended method to import this module:
|-
--  local gpr = require("ax-gpr-alias")
| S120|| 0x200414E40  || S121|| 0x200414E44 || S122|| 0x200414E48 || S123|| 0x200414E4C
 
|-
 
|S130|| 0x200414E50 || S131||0x200414E54  || S132|| 0x200414E58  || S133|| 0x200414E5C
gpr = {}
|-
|S200|| 0x200414E60  || S201|| 0x200414E64 || S202||  0x200414E68 || S203||0x200414E6C
|-
|S210|| 0x200414E70  || S211|| 0x200414E74 || S212||  0x200414E78 || S213|| 0x200414E7C
|-
|S220|| 0x200414E80  || S221|| 0x200414E84 || S222|| 0x200414E88 || S223|| 0x200414E8C
|-
|S230|| 0x200414E90 || S231|| 0x200414E94 || S232||  0x200414E98 || S233|| 0x200414E9C
|-
|S300|| 0x200414EA0  || S301|| 0x200414EA4 || S302||  0x200414EA8 || S303|| 0x200414EAC
|-
|S310|| 0x200414EB0  || S311|| 0x200414EB4 || S312|| 0x200414EB8  || S313|| 0x200414EBC
|-
|S320|| 0x200414EC0  || S321|| 0x200414EC4 || S322|| 0x200414EC8 || S323||0x200414ECC
|-
|S330|| 0x200414ED0 || S331|| 0x200414ED4 || S332|| 0x200414ED8 || S333||0x200414EDC
|-
|S400|| 0x200414EE0  || S401||  0x200414EE4 || S402|| 0x200414EE8 || S403|| 0x200414EEC
|-
|S410|| 0x200414EF0  || S411||  0x200414EF4 || S412||   0x200414EF8 || S413|| 0x200414EFC
|-
|S420|| 0x200414F00 || S421|| 0x200414F04 || S422||  0x200414F08 || S423|| 0x200414F0C
|-
|S430|| 0x200414F10 || S431|| 0x200414F14 || S432||  0x200414F18 || S433|| 0x200414F1C
|-
|S500|| 0x200414F20 || S501|| 0x200414F24|| S502|| 0x200414F28 || S503|| 0x200414F2C
|-
|S510|| 0x200414F30  || S511|| 0x200414F34 || S512|| 0x200414F38 || S513|| 0x200414F3C
|-
|S520|| 0x200414F40 || S521|| 0x200414F44 || S522|| 0x200414F48 || S523||0x200414F4C
|-
|S530 || 0x200414F50|| S531|| 0x200414F54 || S532||  0x200414F58|| S533|| 0x200414F5C
|-
|S600|| 0x200414F60 || S601|| 0x200414F64 || S602|| 0x200414F68 || S603|| 0x200414F6C
|-
|S610|| 0x200414F70  || S611|| 0x200414F74 || S612||  0x200414F78 || S613||0x200414F7C
|-
|S620|| 0x200414F80  || S621|| 0x200414F84 || S622|| 0x200414F88 || S623|| 0x200414F8C
|-
|S630 || 0x200414F90 || S631|| 0x200414F94 || S632||  0x200414F98 || S633|| 0x200414F9C
|-
|S700|| 0x200414FA0 || S701 || 0x200414FA4 || S702|| 0x200414FA8  || S703|| 0x200414FAC
|-
|S710|| 0x200414FB0  || S711|| 0x200414FB4 || S712||  0x200414FB8 || S713|| 0x200414FBC
|-
|S720|| 0x200414FC0  || S721|| 0x200414FC4 || S722|| 0x200414FC8 || S723|| 0x200414FCC
|-
|S730 || 0x200414FD0|| S731|| 0x200414FD4 || S732||  0x200414FD8 || S733|| 0x200414FDC
|-
|}


= Known issues =
gpr.zero = 0
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
gpr.at  = 1
! Issue !! Games affected !! Solution !! Description
gpr.v0  = 2
|-
gpr.v1  = 3
| No gamdata installation functionality (?)|| || ||
gpr.a0  = 4
|-
gpr.a1  = 5
| Highly unoptimized graphics renderer || || || Low fps
gpr.a2  = 6
|-
gpr.a3  = 7
| No support for some syscalls || || ||
gpr.t0  = 8
|-
gpr.t1  = 9
|}
gpr.t2  = 10
 
gpr.t3  = 11
=LUA include files=
gpr.t4  = 12
<br>Files that need to be placed in the '''/lua_include/''' folder
gpr.t5  = 13
 
gpr.t6  = 14
'''uv-clamping.lua'''
gpr.t7  = 15
<pre>
gpr.s0  = 16
print ("Loading uv-clamping.lua from global scripts")
gpr.s1  = 17
 
gpr.s2  = 18
UV_CLAMPING_ENABLE = true
gpr.s3  = 19
UV_CLAMPING_DISABLE = false
gpr.s4  = 20
 
gpr.s5  = 21
UV_CLAMPING_USE_ZERO_EDGE_ALPHA = true
gpr.s6  = 22
UV_CLAMPING_DONT_USE_ZERO_EDGE_ALPHA = false
gpr.s7  = 23
 
gpr.t8  = 24
emuObj = getEmuObject()
gpr.t9  = 25
 
gpr.k0  = 26
-- Turns off UV clamping for the given list of textures.
gpr.k1  = 27
-- textureTable: A list of texture base addresses.
gpr.gp  = 28
DisableUvClampingForTextures = function(textureTable)
gpr.sp  = 29
gpr.fp  = 30
if emuObj.OverrideUvClampingState then
gpr.ra  = 31
for _, texAddr in ipairs(textureTable) do
 
emuObj.OverrideUvClampingState(texAddr, UV_CLAMPING_DISABLE, UV_CLAMPING_DONT_USE_ZERO_EDGE_ALPHA);
return gpr
end
else
print ("This emulator does not support OverrideUvClampingState()")
end
end


</pre>
</pre>
'''sce-locale.lua'''
'''multiapp.lua'''
<pre>
<pre>
print ("Loading sce-locale.lua from global scripts")
-- Recommended method to import this module:
 
--  local mapp = require("mapp")
-- Language codes
--
-- Multi-application support module
-- Wraps common hook calls to support multiple executables
--
--
-- ja    Japanese
-- en    English (US)
-- fr    French (France)
-- es    Spanish (Spain)
-- de    German
-- it    Italian
-- nl    Dutch
-- pt    Portuguese (Portugal)
-- ru    Russian
-- ko    Korean
-- zh-TW  Chinese (traditional)
-- zh-CN  Chinese (simplified)
-- fi    Finnish
-- sv    Swedish
-- da    Danish
-- no    Norwegian
-- pl    Polish
-- pt-BR  Portuguese (Brazil)
-- en-GB  English (UK)
-- tr    Turkish
-- es-MX  Spanish (Latin America)
-- ar    Arabic
-- fr-CA  French (Canada)
-- cs    Czech
-- hu    Hungarian
-- el    Greek ("Ελληνικά" in the system language menu)
-- ro    Romanian
-- th    Thai
-- vi    Vietnamese
-- id    Indonesian
-- uk    Ukrainian


-- returns locale (en-US) and language only (us), useful for lookups with fallback.
local emuObj = getEmuObject() -- emulator
GetLocaleLangPair = function()
local axObj = getAXObject() -- allegrex
local locale, lang
locale = AppHost_GetLocaleTag()
lang = locale:sub(1,2)     -- grab first two digits, eg. en-US -> en


print ("[BOOT] App Host Langauge =", lang)
mapp = {}
mapp.curAppName = emuObj.GetAppName()


if locale ~= nil then
mapp.AddBootHook = function(app, func)
print ("[BOOT] App Host Locale =", locale)
if mapp[app] == nil then
else
mapp[app] = {}
print ("[BOOT] Deprecated Native Language =", lang)
end
end


return locale, lang
mapp[app].boot = func
end
end


FindLocaleTableKey = function(table, primary, fallback, default)
mapp.AddHook = function(app, pc, verify, func)
-- try for a specific Locale, and if that fails fallback on just a language (without region),
if mapp[app] == nil then
-- and if that fails fallback on default.
mapp[app] = {}
 
local keyres = primary
if keyres == nil or table[keyres] == nil then
keyres = fallback
end
end
 
if keyres == nil or table[keyres] == nil then
if mapp[app].hooks == nil then
print ("WARNING: No table entry for locale", primary, "or language", fallback, ", using default", default);
mapp[app].hooks = {}
keyres = default
mapp[app].hookids = 1
else
print ("Found locale table entry", keyres);
end
end
 
return keyres
local localid = mapp[app].hookids
end
mapp[app].hookids = mapp[app].hookids + 1
 
</pre>
local handler = { addr = pc, v = verify, f = func, id = 0 }
'''disc-selection.lua'''
<pre>
if mapp.curAppName == app then
print ("Loading disc-selection.lua from global scripts")
handler.id = axObj.AddHook(pc, verify, func)
require "sce-locale"
 
-- Determines and sets the active SKU.
--
-- sku_map: Cannot be nil.  A table of the form
-- {
-- en = <sku dir name>,
-- fr = <sku dir name>,
-- de = <sku dir name>,
-- it = <sku dir name>,
-- es = <sku dir name>,
--  ...
-- }
--
RegisterSkus = function(sku_map, default_locale)
if default_locale == nil then
default_locale = "en"
end
end
local locale, lang = GetLocaleLangPair()
local key = FindLocaleTableKey(sku_map, locale, lang, default_locale)
-- print(string.format("Added Hook for app: %s, pc=%08x, handler=%d", app, pc, localid))
local sku_name = sku_map[key]
mapp[app].hooks[localid] = handler
return localid
end


if EM_SetActiveSku == nil then
mapp.RemoveHook = function(app, hookid)
print "EM_SetActiveSku is undefined, use the stable branch of the packager or use a new version of the emulator."
-- print(string.format("RemoveHook for app: %s, id=%d", app, hookid))
if mapp[app] ~= nil then
if mapp[app].hooks ~= nil then
if mapp[app].hooks[hookid] ~= nil then
local id = mapp[app].hooks[hookid].id
mapp[app].hooks[hookid] = nil -- WBD 7/6/2018
if mapp.curAppName == app and id > 0 then
axObj.RemoveHook(id)
end
end
end
end
end
EM_SetActiveSku(sku_name)
end
end


</pre>
mapp.GetHookPC = function(app, hookid)
 
if mapp[app] ~= nil then
'''ax-gpr-alias.lua'''
if mapp[app].hooks ~= nil then
<pre>
if mapp[app].hooks[hookid] ~= nil then
return mapp[app].hooks[hookid].addr
end
end
end
return 0
end


-- Recommended method to import this module:
mapp.AddVSyncHook = function(app, func)
--  local gpr = require("ax-gpr-alias")
if mapp[app] == nil then
mapp[app] = {}
end
mapp[app].vsync = func
if mapp.curAppName == app then
emuObj.AddVsyncHook(func)
end
end


mapp.RemoveVSyncHook = function(app)
if mapp[app] == nil then
mapp[app] = {}
end
if mapp[app].vsync ~= nil then
table.remove(mapp[app].vsync)
end
if mapp.curAppName == app then
emuObj.RemoveVsyncHook(func)
end
end


gpr = {}
-- Actual switch functionality
 
emuObj.AddBootHook(function()
gpr.zero = 0
local app = emuObj.GetAppName()
gpr.at  = 1
 
gpr.v0  = 2
if app ~= mapp.curAppName then
gpr.v1  = 3
-- switch out the old handlers
gpr.a0  = 4
-- print(string.format("Switching out handlers for app: %s", mapp.curAppName))
gpr.a1  = 5
if mapp[mapp.curAppName] ~= nil then
gpr.a2  = 6
if mapp[mapp.curAppName].vsync ~= nil then
gpr.a3  = 7
emuObj.RemoveVsyncHook()
gpr.t0  = 8
end
gpr.t1  = 9
gpr.t2  = 10
if mapp[mapp.curAppName].hooks ~= nil then
gpr.t3  = 11
local hooks = mapp[mapp.curAppName].hooks
gpr.t4  = 12
gpr.t5  = 13
-- print(string.format("hooks: %d", #hooks))
gpr.t6  = 14
gpr.t7  = 15
for k,v in pairs(hooks) do
gpr.s0  = 16
if v.id > 0 then
gpr.s1  = 17
axObj.RemoveHook(v.id)
gpr.s2  = 18
v.id = 0
gpr.s3  = 19
end
gpr.s4  = 20
end
gpr.s5  = 21
end
gpr.s6  = 22
end
gpr.s7  = 23
gpr.t8  = 24
-- switch current app name
gpr.t9  = 25
mapp.curAppName = app
gpr.k0  = 26
gpr.k1  = 27
-- install the new handlers
gpr.gp  = 28
-- print(string.format("Switching in handlers for app: %s", mapp.curAppName))
gpr.sp  = 29
if mapp[mapp.curAppName] ~= nil then
gpr.fp  = 30
if mapp[mapp.curAppName].vsync ~= nil then
gpr.ra  = 31
emuObj.AddVsyncHook(mapp[mapp.curAppName].vsync)
 
end
return gpr
 
if mapp[mapp.curAppName].hooks ~= nil then
</pre>
local hooks = mapp[mapp.curAppName].hooks
'''multiapp.lua'''
-- print(string.format("hooks: %d", #hooks))
for k,v in pairs(hooks) do
v.id = axObj.AddHook(v.addr, v.v, v.f)
end
end
end
end
if mapp[mapp.curAppName] ~= nil then
if mapp[mapp.curAppName].boot ~= nil then
mapp[mapp.curAppName].boot()
end
end
end)
 
return mapp
 
</pre>
 
'''pad.lua'''
<pre>
<pre>
-- Recommended method to import this module:
-- Recommended method to import this module:
--  local mapp = require("mapp")
--  local pad = require("pad")
--
-- Buttons marked PS4 are not used by the emulator, but can be read from Lua
--
--
-- Multi-application support module
-- Read the Pad state with getEmuObject().PadRead()
-- Wraps common hook calls to support multiple executables
-- ie:
-- local padstate = getEmuObject().PadRead()
--
--


local emuObj = getEmuObject() -- emulator
pad = {}
local axObj = getAXObject() -- allegrex


mapp = {}
pad.L3        = 0x00000002 -- L3 (PS4)
mapp.curAppName = emuObj.GetAppName()
pad.R3        = 0x00000004 -- R3 (PS4)
pad.OPTIONS  = 0x00000008 -- Options (PS4)
pad.UP        = 0x00000010 -- Up
pad.RIGHT    = 0x00000020 -- Right
pad.DOWN      = 0x00000040 -- Down
pad.LEFT      = 0x00000080 -- Left
pad.L2        = 0x00000100 -- L2 (PS4)
pad.R2        = 0x00000200 -- R2 (PS4)
pad.L1        = 0x00000400 -- L1
pad.R1        = 0x00000800 -- R1
pad.TRIANGLE  = 0x00001000 -- Triangle
pad.CIRCLE    = 0x00002000 -- Circle
pad.CROSS    = 0x00004000 -- Cross
pad.SQUARE    = 0x00008000 -- Square
pad.SELECT    = 0x00010000 -- Select
pad.START    = 0x00020000 -- Start


mapp.AddBootHook = function(app, func)
-- Automap SELECT or START to the Options Button, leaving the full touchar for the opposite, with getEmuObject().PadSetButtonsMode(mode)
if mapp[app] == nil then
-- ie:
mapp[app] = {}
-- getEmuObject().PadSetButtonsMode(pad.BUTTONS_MODE_OPTION_IS_SELECT)
end


mapp[app].boot = func
pad.BUTTONS_MODE_NORMAL = 0 -- Touch bar is split in two for Start/Select. Option is unmapped (default behaviour)
end
pad.BUTTONS_MODE_OPTION_IS_SELECT = 1 -- Touch bar is Start. Option is Select
pad.BUTTONS_MODE_OPTION_IS_START = 2 -- Touch bar is Select. Option is Start
 
return pad
 
</pre>


mapp.AddHook = function(app, pc, verify, func)
=Information=
if mapp[app] == nil then
Note: Missing entries
mapp[app] = {}
==Folder/File layout==
end
<pre>
├── assets
if mapp[app].hooks == nil then
│  ├── common
mapp[app].hooks = {}
│  └── PSPHD
mapp[app].hookids = 1
├── app
end
│  └── USER_L0.IMG
├── lua_include
local localid = mapp[app].hookids
│  ├── ax-gpr-alias.lua
mapp[app].hookids = mapp[app].hookids + 1
│  ├── multiapp.lua
│  └── pad.lua
local handler = { addr = pc, v = verify, f = func, id = 0 }
├── scripts
│  ├──XXXXYYYYY_patches.lua
if mapp.curAppName == app then
│  ├──XXXXYYYYY_features.lua
handler.id = axObj.AddHook(pc, verify, func)
│  ├──XXXXYYYYY_tooling.lua
end
│  └──XXXXYYYYY_trophies.lua
├── sce_module
-- print(string.format("Added Hook for app: %s, pc=%08x, handler=%d", app, pc, localid))
├── sce_sys
├── vms
mapp[app].hooks[localid] = handler
├── trophy_data
return localid
├── usermodule
end
│  └──libfont.lib
 
├── sce_discmap.plt
mapp.RemoveHook = function(app, hookid)
├── eboot.bin
-- print(string.format("RemoveHook for app: %s, id=%d", app, hookid))
├── revision.conf
├── package-ps4.conf
if mapp[app] ~= nil then
└── config-title.txt
if mapp[app].hooks ~= nil then
</pre>
if mapp[app].hooks[hookid] ~= nil then
local id = mapp[app].hooks[hookid].id
mapp[app].hooks[hookid] = nil -- WBD 7/6/2018
if mapp.curAppName == app and id > 0 then
axObj.RemoveHook(id)
end
end
end
end
end


mapp.GetHookPC = function(app, hookid)
==Other==
if mapp[app] ~= nil then
<pre>
if mapp[app].hooks ~= nil then
XXXXYYYYY_config.txt
if mapp[app].hooks[hookid] ~= nil then
videos/
return mapp[app].hooks[hookid].addr
.mp4
end
videos/%08x.mp4
end
audio/%08x.ogg
end
return 0
end


mapp.AddVSyncHook = function(app, func)
Paths:
if mapp[app] == nil then
mapp[app] = {}
end
mapp[app].vsync = func
if mapp.curAppName == app then
emuObj.AddVsyncHook(func)
end
end


mapp.RemoveVSyncHook = function(app)
/app0/
if mapp[app] == nil then
/download0/
mapp[app] = {}
/savedata
end
/host/
/hostapp/
if mapp[app].vsync ~= nil then
/data/
table.remove(mapp[app].vsync)
</pre>
end
if mapp.curAppName == app then
emuObj.RemoveVsyncHook(func)
end
end


-- Actual switch functionality
==Sample==
emuObj.AddBootHook(function()
local app = emuObj.GetAppName()
 
if app ~= mapp.curAppName then
-- switch out the old handlers
-- print(string.format("Switching out handlers for app: %s", mapp.curAppName))
if mapp[mapp.curAppName] ~= nil then
if mapp[mapp.curAppName].vsync ~= nil then
emuObj.RemoveVsyncHook()
end
if mapp[mapp.curAppName].hooks ~= nil then
local hooks = mapp[mapp.curAppName].hooks
-- print(string.format("hooks: %d", #hooks))
for k,v in pairs(hooks) do
if v.id > 0 then
axObj.RemoveHook(v.id)
v.id = 0
end
end
end
end
-- switch current app name
mapp.curAppName = app
-- install the new handlers
-- print(string.format("Switching in handlers for app: %s", mapp.curAppName))
if mapp[mapp.curAppName] ~= nil then
if mapp[mapp.curAppName].vsync ~= nil then
emuObj.AddVsyncHook(mapp[mapp.curAppName].vsync)
end
if mapp[mapp.curAppName].hooks ~= nil then
local hooks = mapp[mapp.curAppName].hooks
-- print(string.format("hooks: %d", #hooks))
for k,v in pairs(hooks) do
v.id = axObj.AddHook(v.addr, v.v, v.f)
end
end
end
end
if mapp[mapp.curAppName] ~= nil then
if mapp[mapp.curAppName].boot ~= nil then
mapp[mapp.curAppName].boot()
end
end
end)
 
return mapp


<pre>; PS4 configuration file for PSPHD
; Game Image
--image="data/USER_L0.IMG"
; Redirect host0: to a specific directory (uncomment to enable).
; By default it's mapped to either "/hostapp/" if available, or "/app0/" if "/hostapp/" is not available.
;--host="/hostapp/"
; To dump the original video in PMF format, uncomment the --dumpvideos line
; For example, with the current setting, it will save them in a "videos" directory inside the File Serving Directory
;--dumpvideos="host0:videos"
; To dump the original audio in Atrac3 format, uncomment the --dumpaudio line
; For example, with the current setting, it will save them in a "audio" directory inside the File Serving Directory
;--dumpaudio="host0:audio"
; To replace atrac3 audio samples, use this.
--samplereplace="host0:samplereplace"
; To save the in-game textures as the game runs, uncomment the --texsave line
; For example, with the current setting, it will save them in a "texdump" directory inside the File Serving Directory
;--texsave="host0:texdump"
;--texmissingsave="host0:texdump"
; To replace specific textures as the game runs, uncomment the --texreplace line
; For example, with the current setting, it will load them from the "texreplace" directory inside the File Serving Directory
--texreplace="host0:texreplace"
; This forces alpha blending to on for replaced textures. (uncomment to enable)
; With this we can freely make use of a normal alpha channel on replacement textures
--replacementalpha=true
; Antialiasing mode. SSAA4x looks best, MSAA4x only smooths edges.
; Choices: off, SSAA4x, MSAA4x
--antialias=SSAA4x
; Enable switching between original and replacement textures at runtime using the L3 button on a DS4 or the 'T' key on Windows
;--texswitch=true
; Turns on the auto-resampler. Assumes textures in texreplace are at 8x resolution and resamples them at load
--autoresampler=true
; Parappa Alpha Hack
--parappaalphahack=true
</pre>
</pre>
==NIDs in HLE==
<pre>
|HLEInterruptManager|


'''pad.lua'''
sceKernelRegisterSubIntrHandler
<pre>
sceKernelReleaseSubIntrHandler
-- Recommended method to import this module:
sceKernelEnableSubIntr
--  local pad = require("pad")
--
-- Buttons marked PS4 are not used by the emulator, but can be read from Lua
--
-- Read the Pad state with getEmuObject().PadRead()
-- ie:
-- local padstate = getEmuObject().PadRead()
--


pad = {}
|HLEStdioForUser|


pad.L3        = 0x00000002 -- L3 (PS4)
sceIoOpen
pad.R3        = 0x00000004 -- R3 (PS4)
sceIoClose
pad.OPTIONS  = 0x00000008 -- Options (PS4)
sceIoRead
pad.UP        = 0x00000010 -- Up
sceIoWrite
pad.RIGHT    = 0x00000020 -- Right
sceIoLseek
pad.DOWN      = 0x00000040 -- Down
sceIoLseek32
pad.LEFT      = 0x00000080 -- Left
sceIoDopen
pad.L2        = 0x00000100 -- L2 (PS4)
sceIoDread
pad.R2        = 0x00000200 -- R2 (PS4)
sceIoDclose
pad.L1        = 0x00000400 -- L1
sceIoChdir
pad.R1        = 0x00000800 -- R1
sceIoGetstat
pad.TRIANGLE  = 0x00001000 -- Triangle
sceIoDevctl
pad.CIRCLE    = 0x00002000 -- Circle
sceIoRename
pad.CROSS    = 0x00004000 -- Cross
sceIoMkDir
pad.SQUARE    = 0x00008000 -- Square
sceIoChstat
pad.SELECT    = 0x00010000 -- Select
sceIoRemove
pad.START    = 0x00020000 -- Start
sceIoRmdir
 
sceIoOpenAsync
-- Automap SELECT or START to the Options Button, leaving the full touchar for the opposite, with getEmuObject().PadSetButtonsMode(mode)
sceIoReadAsync
-- ie:
sceIoIoctlAsync
-- getEmuObject().PadSetButtonsMode(pad.BUTTONS_MODE_OPTION_IS_SELECT)
sceIoWaitAsync
sceIoWaitAsyncCB
sceIoCloseAsync
sceIoSetAsyncCallback
sceIoPollAsync
sceIoLseekAsync
sceIoGetAsyncStat
asyncWaitTimerCallback
asyncCallbackTimerCallback
sceKernelStdin
sceKernelStdout
sceKernelStderr


pad.BUTTONS_MODE_NORMAL = 0 -- Touch bar is split in two for Start/Select. Option is unmapped (default behaviour)
|HLELoadExecForUser|
pad.BUTTONS_MODE_OPTION_IS_SELECT = 1 -- Touch bar is Start. Option is Select
pad.BUTTONS_MODE_OPTION_IS_START = 2 -- Touch bar is Select. Option is Start


return pad
sceKernelCpuSuspendIntr
 
sceKernelCpuResumeIntr
</pre>
sceKernelIsCpuIntrEnable
 
sceKernelExitGame
=Information=
sceKernelRegisterExitCallback
Note: Missing entries
sceKernelLoadModule
==Folder/File layout==
sceKernelUnloadModule
<pre>
sceKernelStartModule
├── assets
sceKernelStopModule
│  ├── common
sceKernelStopUnloadSelfModule
│  └── PSPHD
sceKernelGetModuleIdByAddress
├── app
sceKernelStopUnloadSelfModuleWithStatus
│  └── USER_L0.IMG
sceKernelGetModuleId
├── lua_include
 
│  ├── ax-gpr-alias.lua
|HLEsceAtrac3plus|
│  ├── multiapp.lua
 
│  ├── sce-locale.lua
sceAtracReinit
│  ├── uv-clamping.lua
sceAtracDecodeData
│  ├── disc-selection.lua
sceAtracGetNextDecodePosition
│  └── pad.lua
sceAtracSetHalfwayBufferAndGetID
├── scripts
sceAtracGetSoundSample
│  ├──XXXXYYYYY_patches.lua
sceAtracGetStreamDataInfo
│  ├──XXXXYYYYY_features.lua
sceAtracGetRemainFrame
│  ├──XXXXYYYYY_tooling.lua
sceAtracSetLoopNum
│  └──XXXXYYYYY_trophies.lua
sceAtracResetPlayPosition
├── sce_module
sceAtracReleaseAtracID
├── sce_sys
sceAtracGetAtracID
├── vms
sceAtracGetNextSample
├── trophy_data
sceAtracSetData
├── usermodule
sceAtracAddStreamData
│  └──libfont.lib
 
├── sce_discmap.plt
|HLEsceAudio|
├── eboot.bin
├── revision.conf
├── package-ps4.conf
└── config-title.txt
</pre>


==Other==
sceAudioChReserve
<pre>
sceAudioChRelease
XXXXYYYYY_config.txt
sceAudioOutputBlocking
videos/
sceAudioChangeChannelConfig
.mp4
sceAudioGetChannelRestLength
videos/%08x.mp4
sceAudioChangeChannelVolume
audio/%08x.ogg
sceAudioSetChannelDataLen
sceAudioOutputPanned
sceAudioOutputPannedBlocking
sceAudioGetChannelRestLen
sceAudioOutput2Reserve
sceAudioOutput2OutputBlocking
sceAudioOutput2Release
outputCallback


Paths:
|HLEsceCtrl|


/app0/
sceCtrlSetSamplingCycle
/download0/
sceCtrlSetSamplingMode
/savedata
sceCtrlReadBufferPositive
/host/
sceCtrlReadBufferNegative
/hostapp/
sceCtrlPeekBufferPositive
/data/
sceCtrlPeekBufferNegative
</pre>
sceCtrlGetIdleCancelThreshold
sceCtrlSetIdleCancelThreshold
sceCtrlReadLatch
sceCtrlPeekLatch
sampleControllerCallback
vibrationControllerCallback


==Sample==
|HLEsceDisplay|


<pre>; PS4 configuration file for PSPHD
sceDisplaySetMode
sceDisplaySetFramebuf
; Game Image
sceDisplayGetFramebuf
--image="data/USER_L0.IMG"
sceDisplayGetVcount
sceDisplayWaitVblankStart
; Redirect host0: to a specific directory (uncomment to enable).
sceDisplayWaitVblankStartCB
; By default it's mapped to either "/hostapp/" if available, or "/app0/" if "/hostapp/" is not available.
sceDisplayGetCurrentHcount
;--host="/hostapp/"
sceDisplayGetAccumulatedHcount
sceDisplayGetFramePerSec
; To dump the original video in PMF format, uncomment the --dumpvideos line
sceDisplayWaitVblank
; For example, with the current setting, it will save them in a "videos" directory inside the File Serving Directory
sceDisplayWaitVblankCB
;--dumpvideos="host0:videos"
sceDisplayIsVblank
sceDisplaySetHoldMode
; To dump the original audio in Atrac3 format, uncomment the --dumpaudio line
vblankStart
; For example, with the current setting, it will save them in a "audio" directory inside the File Serving Directory
vblankEnd
;--dumpaudio="host0:audio"
 
|HLEsceGe_user|
; To replace atrac3 audio samples, use this.
 
--samplereplace="host0:samplereplace"
sceGeEdramGetAddr
sceGeEdramGetSize
; To save the in-game textures as the game runs, uncomment the --texsave line
sceGeGetCmd
; For example, with the current setting, it will save them in a "texdump" directory inside the File Serving Directory
sceGeGetMtx
;--texsave="host0:texdump"
sceGeListEnQueue
;--texmissingsave="host0:texdump"
sceGeListEnQueueHead
sceGeListDeQueue
; To replace specific textures as the game runs, uncomment the --texreplace line
sceGeListSync
; For example, with the current setting, it will load them from the "texreplace" directory inside the File Serving Directory
sceGeListUpdateStallAddr
--texreplace="host0:texreplace"
sceGeDrawSync
sceGeSetCallback
; This forces alpha blending to on for replaced textures. (uncomment to enable)
sceGeUnsetCallback
; With this we can freely make use of a normal alpha channel on replacement textures
sceGeBreak
--replacementalpha=true
sceGeContinue
interruptCallback
; Antialiasing mode. SSAA4x looks best, MSAA4x only smooths edges.
 
; Choices: off, SSAA4x, MSAA4x
|HLEsceImpose|
--antialias=SSAA4x
 
sceImposeGetLanguageMode
; Enable switching between original and replacement textures at runtime using the L3 button on a DS4 or the 'T' key on Windows
sceImposeSetLanguageMode
;--texswitch=true
sceImposeSetUMDPopup
; Turns on the auto-resampler. Assumes textures in texreplace are at 8x resolution and resamples them at load
--autoresampler=true
; Parappa Alpha Hack
--parappaalphahack=true
</pre>
==NIDs in HLE==
<pre>
|HLEInterruptManager|


sceKernelRegisterSubIntrHandler
|HLEsceMpeg|
sceKernelReleaseSubIntrHandler
sceKernelEnableSubIntr


|HLEStdioForUser|
sceMpegInit
 
sceMpegFinish
sceIoOpen
sceMpegCreate
sceIoClose
sceMpegDelete
sceIoRead
sceMpegQueryMemSize
sceIoWrite
sceMpegMallocAvcEsBuf
sceIoLseek
sceMpegFreeAvcEsBuf
sceIoLseek32
sceMpegInitAu
sceIoDopen
sceMpegGetAvcAu
sceIoDread
sceMpegGetAtracAu
sceIoDclose
sceMpegQueryAtracEsSize
sceIoChdir
sceMpegAtracDecode
sceIoGetstat
sceMpegRingbufferQueryMemSize
sceIoDevctl
sceMpegRingbufferConstruct
sceIoRename
sceMpegRingbufferDestruct
sceIoMkDir
sceMpegRingbufferPut
sceIoChstat
sceMpegRingbufferAvailableSize
sceIoRemove
sceMpegAvcCsc
sceIoRmdir
sceMpegAvcDecodeMode
sceIoOpenAsync
sceMpegAvcDecodeDetail
sceIoReadAsync
sceMpegAvcDecodeFlush
sceIoIoctlAsync
sceMpegAvcQueryYCbCrSize
sceIoWaitAsync
sceMpegAvcInitYCbCr
sceIoWaitAsyncCB
sceMpegAvcDecodeYCbCr
sceIoCloseAsync
sceMpegAvcDecodeStopYCbCr
sceIoSetAsyncCallback
sceMpegRegistStream
sceIoPollAsync
sceMpegUnRegistStream
sceIoLseekAsync
sceMpegQueryStreamSize
sceIoGetAsyncStat
sceMpegQueryStreamOffset
asyncWaitTimerCallback
sceMpegFlushAllStream
asyncCallbackTimerCallback
sceKernelStdin
sceKernelStdout
sceKernelStderr


|HLELoadExecForUser|
|HLEsceNet|


sceKernelCpuSuspendIntr
sceNetInit
sceKernelCpuResumeIntr
sceNetInetGetsockopt
sceKernelIsCpuIntrEnable
sceNetInetSetsockopt
sceKernelExitGame
sceNetInetGetErrno
sceKernelRegisterExitCallback
 
sceKernelLoadModule
|HLEscePower|
sceKernelUnloadModule
 
sceKernelStartModule
scePowerRegisterCallback
sceKernelStopModule
scePowerUnregisterCallback
sceKernelStopUnloadSelfModule
scePowerSetClockFrequency
sceKernelGetModuleIdByAddress
scePowerSetCpuClockFrequency
sceKernelStopUnloadSelfModuleWithStatus
scePowerSetBusClockFrequency
sceKernelGetModuleId


|HLEsceAtrac3plus|
|HLEscePsmf|


sceAtracReinit
scePsmfVerifyPsmf
sceAtracDecodeData
scePsmfSetPsmf
sceAtracGetNextDecodePosition
scePsmfSpecifyStreamWithStreamTypeNumber
sceAtracSetHalfwayBufferAndGetID
scePsmfCheckEPmap
sceAtracGetSoundSample
scePsmfGetVideoInfo
sceAtracGetStreamDataInfo
scePsmfGetNumberOfStreams
sceAtracGetRemainFrame
scePsmfGetNumberOfEPentries
sceAtracSetLoopNum
scePsmfGetEPWithId
sceAtracResetPlayPosition
scePsmfGetPsmfVersion
sceAtracReleaseAtracID
scePsmfGetNumberOfSpecificStreams
sceAtracGetAtracID
scePsmfSpecifyStream
sceAtracGetNextSample
scePsmfGetCurrentStreamType
sceAtracSetData
sceAtracAddStreamData


|HLEsceAudio|
|HLEscePsmfPlayer|


sceAudioChReserve
scePsmfPlayerCreate
sceAudioChRelease
scePsmfPlayerDelete
sceAudioOutputBlocking
scePsmfPlayerSetPsmf
sceAudioChangeChannelConfig
scePsmfPlayerReleasePsmf
sceAudioGetChannelRestLength
scePsmfPlayerStart
sceAudioChangeChannelVolume
scePsmfPlayerGetAudioOutSize
sceAudioSetChannelDataLen
scePsmfPlayerStop
sceAudioOutputPanned
scePsmfPlayerUpdate
sceAudioOutputPannedBlocking
scePsmfPlayerGetVideoData
sceAudioGetChannelRestLen
scePsmfPlayerGetAudioData
sceAudioOutput2Reserve
scePsmfPlayerGetCurrentStatus
sceAudioOutput2OutputBlocking
scePsmfPlayerGetPsmfInfo
sceAudioOutput2Release
scePsmfPlayerConfigPlayer
outputCallback
scePsmfPlayerBreak
scePsmfPlayerChangePlayMode


|HLEsceCtrl|
|HLEsceRtc|


sceCtrlSetSamplingCycle
sceRtcGetCurrentTick
sceCtrlSetSamplingMode
sceRtcGetAccumulativeTime
sceCtrlReadBufferPositive
sceRtcGetCurrentClockLocalTime
sceCtrlReadBufferNegative
sceCtrlPeekBufferPositive
sceCtrlPeekBufferNegative
sceCtrlGetIdleCancelThreshold
sceCtrlSetIdleCancelThreshold
sceCtrlReadLatch
sceCtrlPeekLatch
sampleControllerCallback
vibrationControllerCallback


|HLEsceDisplay|
|HLEsceSasCore|


sceDisplaySetMode
sceSasInit
sceDisplaySetFramebuf
sceSasCore
sceDisplayGetFramebuf
sceSasCoreWithMix
sceDisplayGetVcount
sceSasGetEndFlag
sceDisplayWaitVblankStart
sceSasGetPauseFlag
sceDisplayWaitVblankStartCB
sceSasGetEnvelopeHeight
sceDisplayGetCurrentHcount
sceSasGetAllEnvelopeHeights
sceDisplayGetAccumulatedHcount
sceSasGetOutputMode
sceDisplayGetFramePerSec
sceSasSetOutputMode
sceDisplayWaitVblank
sceSasGetGrain
sceDisplayWaitVblankCB
sceSasSetGrain
sceDisplayIsVblank
sceSasSetVoice
sceDisplaySetHoldMode
sceSasSetNoise
vblankStart
sceSasSetPitch
vblankEnd
sceSasSetVolume
sceSasSetSimpleADSR
sceSasSetKeyOn
sceSasSetKeyOff
sceSasSetPause
sceSasSetSL
sceSasSetADSR
sceSasSetADSRMode
sceSasRevEVOL
sceSasRevType
sceSasRevParam
sceSasRevVON


|HLEsceGe_user|
|HLEsceSuspendForUser|


sceGeEdramGetAddr
sceKernelPowerTick
sceGeEdramGetSize
sceKernelPowerLock
sceGeGetCmd
sceKernelPowerUnlock
sceGeGetMtx
sceKernelVolatileMemTryLock
sceGeListEnQueue
sceKernelVolatileMemUnlock
sceGeListEnQueueHead
sceKernelVolatileMemLock
sceGeListDeQueue
sceGeListSync
sceGeListUpdateStallAddr
sceGeDrawSync
sceGeSetCallback
sceGeUnsetCallback
sceGeBreak
sceGeContinue
interruptCallback


|HLEsceImpose|
|HLEsceUmdUser|


sceImposeGetLanguageMode
sceUmdActivate
sceImposeSetLanguageMode
sceUmdGetDriveStat
sceImposeSetUMDPopup
sceUmdCheckMedium
 
sceUmdRegisterUMDCallback
|HLEsceMpeg|
sceUmdUnRegisterUMDCallBack
sceUmdWaitDriveStat
sceUmdWaitDriveStatWithTimer
sceUmdWaitDriveStatCB
sceUmdCancelWaitDriveStat
_UmdWaitDriveTimeout
 
|HLEsceUtility|


sceMpegInit
sceUtilityLoadModule
sceMpegFinish
sceUtilityUnloadModule
sceMpegCreate
sceUtilityLoadNetModule
sceMpegDelete
sceUtilityUnloadNetModule
sceMpegQueryMemSize
sceUtilityLoadAvModule
sceMpegMallocAvcEsBuf
sceUtilityUnloadAvModule
sceMpegFreeAvcEsBuf
sceUtilityGetSystemParamInt
sceMpegInitAu
sceUtilityGetSystemParamString
sceMpegGetAvcAu
sceUtilitySavedataGetStatus
sceMpegGetAtracAu
sceUtilitySavedataShutdownStart
sceMpegQueryAtracEsSize
sceUtilitySavedataInitStart
sceMpegAtracDecode
sceUtilitySavedataUpdate
sceMpegRingbufferQueryMemSize
sceUtilityMsgDialogGetStatus
sceMpegRingbufferConstruct
sceUtilityMsgDialogShutdownStart
sceMpegRingbufferDestruct
sceUtilityMsgDialogInitStart
sceMpegRingbufferPut
sceUtilityMsgDialogUpdate
sceMpegRingbufferAvailableSize
sceUtilityMsgDialogAbort
sceMpegAvcCsc
sceUtilityOskGetStatus
sceMpegAvcDecodeMode
sceUtilityOskShutdownStart
sceMpegAvcDecodeDetail
sceUtilityOskInitStart
sceMpegAvcDecodeFlush
sceUtilityOskUpdate
sceMpegAvcQueryYCbCrSize
saveDataUpdateCallback
sceMpegAvcInitYCbCr
oskUpdateCallback
sceMpegAvcDecodeYCbCr
 
sceMpegAvcDecodeStopYCbCr
|HLEsceWlanDrv|
sceMpegRegistStream
sceMpegUnRegistStream
sceMpegQueryStreamSize
sceMpegQueryStreamOffset
sceMpegFlushAllStream


|HLEsceNet|
sceWlanGetSwitchState
sceWlanGetEtherAddr


sceNetInit
|HLESysMemUserForUser|
sceNetInetGetsockopt
sceNetInetSetsockopt
sceNetInetGetErrno


|HLEscePower|
sceKernelMaxFreeMemSize
 
sceKernelTotalFreeMemSize
scePowerRegisterCallback
sceKernelQueryMemoryInfo
scePowerUnregisterCallback
sceKernelDevkitVersion
scePowerSetClockFrequency
sceKernelPrintf
scePowerSetCpuClockFrequency
sceKernelGetPTRIG
scePowerSetBusClockFrequency
sceKernelSetPTRIG
 
sceKernelAllocPartitionMemory
|HLEscePsmf|
sceKernelFreePartitionMemory
sceKernelGetBlockHeadAddr
sceKernelGetMemoryBlockAddr
sceKernelAllocMemoryBlock
sceKernelFreeMemoryBlock
sceKernelSetCompilerVersion
sceKernelGetCompiledSdkVersion
sceKernelSetCompiledSdkVersion
sceKernelSetCompiledSdkVersion370
sceKernelSetCompiledSdkVersion380_390
sceKernelSetCompiledSdkVersion395
sceKernelSetCompiledSdkVersion401_402
sceKernelSetCompiledSdkVersion500_505
sceKernelSetCompiledSdkVersion507
sceKernelSetCompiledSdkVersion600_602
sceKernelSetCompiledSdkVersion603_605
sceKernelSetCompiledSdkVersion606
sceKernelSetUsersystemLibWork
sceKernelSysMemUserForUser_ACBD88CA
sceKernelSysMemUserForUser_D8DE5C1E
sceKernelSysMemUserForUser_945E45DA
 
|HLEThreadManForUser|


scePsmfVerifyPsmf
sceKernelDelayThread
scePsmfSetPsmf
sceKernelDelayThreadCB
scePsmfSpecifyStreamWithStreamTypeNumber
sceKernelCreateCallback
scePsmfCheckEPmap
sceKernelDeleteCallback
scePsmfGetVideoInfo
sceKernelSleepThread
scePsmfGetNumberOfStreams
sceKernelSleepThreadCB
scePsmfGetNumberOfEPentries
sceKernelWakeupThread
scePsmfGetEPWithId
sceKernelCreateMsgPipe
scePsmfGetPsmfVersion
sceKernelDeleteMsgPipe
scePsmfGetNumberOfSpecificStreams
sceKernelSendMsgPipe
scePsmfSpecifyStream
sceKernelTrySendMsgPipe
scePsmfGetCurrentStreamType
sceKernelReceiveMsgPipe
 
sceKernelTryReceiveMsgPipe
|HLEscePsmfPlayer|
sceKernelReferMsgPipeStatus
 
sceKernelCreateThread
scePsmfPlayerCreate
sceKernelStartThread
scePsmfPlayerDelete
sceKernelExitThread
scePsmfPlayerSetPsmf
sceKernelDeleteThread
scePsmfPlayerReleasePsmf
sceKernelExitDeleteThread
scePsmfPlayerStart
sceKernelGetThreadExitStatus
scePsmfPlayerGetAudioOutSize
sceKernelTerminateThread
scePsmfPlayerStop
sceKernelTerminateDeleteThread
scePsmfPlayerUpdate
sceKernelWaitThreadEnd
scePsmfPlayerGetVideoData
sceKernelWaitThreadEndCB
scePsmfPlayerGetAudioData
sceKernelRotateThreadReadyQueue
scePsmfPlayerGetCurrentStatus
sceKernelReferThreadStatus
scePsmfPlayerGetPsmfInfo
sceKernelSuspendDispatchThread
scePsmfPlayerConfigPlayer
sceKernelResumeDispatchThread
scePsmfPlayerBreak
sceKernelSuspendThread
scePsmfPlayerChangePlayMode
sceKernelResumeThread
 
sceKernelCancelWakeupThread
|HLEsceRtc|
sceKernelGetThreadStackFreeSize
 
sceKernelGetSystemTimeLow
sceRtcGetCurrentTick
sceKernelGetSystemTime
sceRtcGetAccumulativeTime
sceKernelGetSystemTimeWide
sceRtcGetCurrentClockLocalTime
sceKernelGetThreadCurrentPriority
 
sceKernelChangeCurrentThreadAttr
|HLEsceSasCore|
sceKernelGetThreadId
 
sceKernelChangeThreadPriority
sceSasInit
sceKernelReferThreadProfiler
sceSasCore
sceKernelCheckCallback
sceSasCoreWithMix
sceKernelCancelSema
sceSasGetEndFlag
sceKernelCreateSema
sceSasGetPauseFlag
sceKernelDeleteSema
sceSasGetEnvelopeHeight
sceKernelPollSema
sceSasGetAllEnvelopeHeights
sceKernelSignalSema
sceSasGetOutputMode
sceKernelReferSemaStatus
sceSasSetOutputMode
sceKernelWaitSema
sceSasGetGrain
sceKernelWaitSemaCB
sceSasSetGrain
sceKernelCreateFpl
sceSasSetVoice
sceKernelDeleteFpl
sceSasSetNoise
sceKernelAllocateFpl
sceSasSetPitch
sceKernelAllocateFplCB
sceSasSetVolume
sceKernelTryAllocateFpl
sceSasSetSimpleADSR
sceKernelFreeFpl
sceSasSetKeyOn
sceKernelCancelFpl
sceSasSetKeyOff
sceKernelReferFplStatus
sceSasSetPause
sceKernelCreateVpl
sceSasSetSL
sceKernelDeleteVpl
sceSasSetADSR
sceKernelAllocateVpl
sceSasSetADSRMode
sceKernelAllocateVplCB
sceSasRevEVOL
sceKernelTryAllocateVpl
sceSasRevType
sceKernelFreeVpl
sceSasRevParam
sceKernelCancelVpl
sceSasRevVON
sceKernelReferVplStatus
 
sceKernelCreateEventFlag
|HLEsceSuspendForUser|
sceKernelSetEventFlag
 
sceKernelDeleteEventFlag
sceKernelPowerTick
sceKernelClearEventFlag
sceKernelPowerLock
sceKernelWaitEventFlag
sceKernelPowerUnlock
sceKernelWaitEventFlagCB
sceKernelVolatileMemTryLock
sceKernelPollEventFlag
sceKernelVolatileMemUnlock
sceKernelCancelEventFlag
sceKernelVolatileMemLock
sceKernelReferEventFlagStatus
sceKernelCreateMbx
sceKernelDeleteMbx
sceKernelSendMbx
sceKernelReceiveMbx
sceKernelReceiveMbxCB
sceKernelPollMbx
sceKernelCancelReceiveMbx
sceKernelReferMbxStatus
sceKernelCreateMutex
sceKernelDeleteMutex
sceKernelLockMutex
sceKernelLockMutexCB
sceKernelTryLockMutex
sceKernelUnlockMutex
sceKernelCancelMutex
sceKernelReferMutexStatus
_sceKernelDelayThreadCallback
_sceKernelWaitThreadEndTimeout
_sceKernelAllocateFplTimeout
_sceKernelAllocateVplTimeout
_sceKernelWaitEventFlagTimeout
_sceKernelMsgPipeTimeout
_sceKernelLockMutexTimeout
 
|HLEUtilsForKernel|
 
sceKernelIcacheInvalidateRange


|HLEsceUmdUser|
|HLEUtilsForUser|


sceUmdActivate
sceKernelIcacheInvalidateRange
sceUmdGetDriveStat
sceKernelDcacheInvalidateRange
sceUmdCheckMedium
sceKernelDcacheWritebackInvalidateRange
sceUmdRegisterUMDCallback
sceKernelDcacheWritebackAll
sceUmdUnRegisterUMDCallBack
sceKernelDcacheWritebackRange
sceUmdWaitDriveStat
sceKernelDcacheWritebackInvalidateAll
sceUmdWaitDriveStatWithTimer
sceKernelSetGPO
sceUmdWaitDriveStatCB
sceKernelGetGPI
sceUmdCancelWaitDriveStat
sceKernelLibcClock
_UmdWaitDriveTimeout
sceKernelLibcTime
sceKernelLibcGettimeofday 0x71EC4271
</pre>


|HLEsceUtility|
==Unimplemented functions==
 
<pre>
sceUtilityLoadModule
sceIoChdir() unimplemented, ignoring
sceUtilityUnloadModule
sceIoChstat unimplemented, ignoring
sceUtilityLoadNetModule
sceKernelExitGame() unimplemented
sceUtilityUnloadNetModule
sceKernelStopUnloadSelfModule() unimplemented
sceUtilityLoadAvModule
sceKernelStopUnloadSelfModuleWithStatus() unimplemented
sceUtilityUnloadAvModule
sceGeGetMtx() unimplemented
sceUtilityGetSystemParamInt
sceGeListDeQueue() unimplemented
sceUtilityGetSystemParamString
sceGeBreak unimplemented
sceUtilitySavedataGetStatus
sceGeContinue unimplemented
sceUtilitySavedataShutdownStart
sceNetInetGetsockopt() unimplemented
sceUtilitySavedataInitStart
sceNetInetSetsockopt() unimplemented
sceUtilitySavedataUpdate
sceNetInetGetErrno() unimplemented
sceUtilityMsgDialogGetStatus
sceWlanGetEtherAddr unimplemented
sceUtilityMsgDialogShutdownStart
sceKernelQueryMemoryInfo() unimplemented
sceUtilityMsgDialogInitStart
sceKernelGetPTRIG() unimplemented
sceUtilityMsgDialogUpdate
sceKernelSetPTRIG() unimplemented
sceUtilityMsgDialogAbort
sceKernelSetCompiledSdkVersion401_402() unimplemented
sceUtilityOskGetStatus
sceKernelSetCompiledSdkVersion507() unimplemented
sceUtilityOskShutdownStart
sceKernelSetCompiledSdkVersion600_602() unimplemented
sceUtilityOskInitStart
sceKernelSetCompiledSdkVersion603_605() unimplemented
sceUtilityOskUpdate
sceKernelSetUsersystemLibWork() unimplemented
saveDataUpdateCallback
sceKernelSysMemUserForUser_ACBD88CA() unimplemented
oskUpdateCallback
sceKernelSysMemUserForUser_D8DE5C1E() unimplemented -- sceKernelSafetyCheck0
sceKernelSysMemUserForUser_945E45DA() unimplemented
sceKernelTerminateDeleteThread() unimplemented
sceKernelCancelSema unimplemented
sceKernelCancelFpl unimplemented
sceKernelReferFplStatus unimplemented
sceKernelCancelVpl unimplemented
sceKernelCreateMbx unimplemented
sceKernelDeleteMbx unimplemented
sceKernelSendMbx unimplemented
sceKernelReceiveMbx unimplemented
sceKernelReceiveMbxCB unimplemented
sceKernelPollMbx unimplemented
sceKernelCancelReceiveMbx unimplemented
sceKernelReferMbxStatus unimplemented
</pre>


|HLEsceWlanDrv|
===Partially Supported===
<pre>
|sceIoIoctl|
 
supported:
0x1010005 (UMD file seek set)
0x1020006 (Get UMD file start sector)


sceWlanGetSwitchState
|sceIoDevctl|
sceWlanGetEtherAddr


|HLESysMemUserForUser|
supported:
0x1F100A4 (Prepare UMD data into cache)
0x2415821 (MScmRegisterMSInsertEjectCallback)
0x2415822 (MScmUnregisterMSInsertEjectCallback)
0x2025806 (Check if the device is inserted (mscmhc0))
0x2425823 (Check if FAT enabled)
0x2415823 (Set FAT as enabled), supported
</pre>


sceKernelMaxFreeMemSize
==Restricted==
sceKernelTotalFreeMemSize
<pre>
sceKernelQueryMemoryInfo
scePowerRegisterCallback - ignoring
sceKernelDevkitVersion
scePowerUnregisterCallback - ignoring
sceKernelPrintf
scePowerSetClockFrequency - ignoring
sceKernelGetPTRIG
scePowerSetCpuClockFrequency(%d) - ignoring
sceKernelSetPTRIG
scePowerSetBusClockFrequency(%d) - ignoring
sceKernelAllocPartitionMemory
sceUtilityMsgDialogInitStart ignored
sceKernelFreePartitionMemory
sceKernelGetBlockHeadAddr
sceKernelGetMemoryBlockAddr
sceKernelAllocMemoryBlock
sceKernelFreeMemoryBlock
sceKernelSetCompilerVersion
sceKernelGetCompiledSdkVersion
sceKernelSetCompiledSdkVersion
sceKernelSetCompiledSdkVersion370
sceKernelSetCompiledSdkVersion380_390
sceKernelSetCompiledSdkVersion395
sceKernelSetCompiledSdkVersion401_402
sceKernelSetCompiledSdkVersion500_505
sceKernelSetCompiledSdkVersion507
sceKernelSetCompiledSdkVersion600_602
sceKernelSetCompiledSdkVersion603_605
sceKernelSetCompiledSdkVersion606
sceKernelSetUsersystemLibWork
sceKernelSysMemUserForUser_ACBD88CA
sceKernelSysMemUserForUser_D8DE5C1E
sceKernelSysMemUserForUser_945E45DA
 
|HLEThreadManForUser|
 
sceKernelDelayThread
sceKernelDelayThreadCB
sceKernelCreateCallback
sceKernelDeleteCallback
sceKernelSleepThread
sceKernelSleepThreadCB
sceKernelWakeupThread
sceKernelCreateMsgPipe
sceKernelDeleteMsgPipe
sceKernelSendMsgPipe
sceKernelTrySendMsgPipe
sceKernelReceiveMsgPipe
sceKernelTryReceiveMsgPipe
sceKernelReferMsgPipeStatus
sceKernelCreateThread
sceKernelStartThread
sceKernelExitThread
sceKernelDeleteThread
sceKernelExitDeleteThread
sceKernelGetThreadExitStatus
sceKernelTerminateThread
sceKernelTerminateDeleteThread
sceKernelWaitThreadEnd
sceKernelWaitThreadEndCB
sceKernelRotateThreadReadyQueue
sceKernelReferThreadStatus
sceKernelSuspendDispatchThread
sceKernelResumeDispatchThread
sceKernelSuspendThread
sceKernelResumeThread
sceKernelCancelWakeupThread
sceKernelGetThreadStackFreeSize
sceKernelGetSystemTimeLow
sceKernelGetSystemTime
sceKernelGetSystemTimeWide
sceKernelGetThreadCurrentPriority
sceKernelChangeCurrentThreadAttr
sceKernelGetThreadId
sceKernelChangeThreadPriority
sceKernelReferThreadProfiler
sceKernelCheckCallback
sceKernelCancelSema
sceKernelCreateSema
sceKernelDeleteSema
sceKernelPollSema
sceKernelSignalSema
sceKernelReferSemaStatus
sceKernelWaitSema
sceKernelWaitSemaCB
sceKernelCreateFpl
sceKernelDeleteFpl
sceKernelAllocateFpl
sceKernelAllocateFplCB
sceKernelTryAllocateFpl
sceKernelFreeFpl
sceKernelCancelFpl
sceKernelReferFplStatus
sceKernelCreateVpl
sceKernelDeleteVpl
sceKernelAllocateVpl
sceKernelAllocateVplCB
sceKernelTryAllocateVpl
sceKernelFreeVpl
sceKernelCancelVpl
sceKernelReferVplStatus
sceKernelCreateEventFlag
sceKernelSetEventFlag
sceKernelDeleteEventFlag
sceKernelClearEventFlag
sceKernelWaitEventFlag
sceKernelWaitEventFlagCB
sceKernelPollEventFlag
sceKernelCancelEventFlag
sceKernelReferEventFlagStatus
sceKernelCreateMbx
sceKernelDeleteMbx
sceKernelSendMbx
sceKernelReceiveMbx
sceKernelReceiveMbxCB
sceKernelPollMbx
sceKernelCancelReceiveMbx
sceKernelReferMbxStatus
sceKernelCreateMutex
sceKernelDeleteMutex
sceKernelLockMutex
sceKernelLockMutexCB
sceKernelTryLockMutex
sceKernelUnlockMutex
sceKernelCancelMutex
sceKernelReferMutexStatus
_sceKernelDelayThreadCallback
_sceKernelWaitThreadEndTimeout
_sceKernelAllocateFplTimeout
_sceKernelAllocateVplTimeout
_sceKernelWaitEventFlagTimeout
_sceKernelMsgPipeTimeout
_sceKernelLockMutexTimeout
 
|HLEUtilsForKernel|
 
sceKernelIcacheInvalidateRange
 
|HLEUtilsForUser|
 
sceKernelIcacheInvalidateRange
sceKernelDcacheInvalidateRange
sceKernelDcacheWritebackInvalidateRange
sceKernelDcacheWritebackAll
sceKernelDcacheWritebackRange
sceKernelDcacheWritebackInvalidateAll
sceKernelSetGPO
sceKernelGetGPI
sceKernelLibcClock
sceKernelLibcTime
sceKernelLibcGettimeofday 0x71EC4271
</pre>
 
==Unimplemented functions==
<pre>
sceIoChdir() unimplemented, ignoring
sceIoChstat unimplemented, ignoring
sceKernelExitGame() unimplemented
sceKernelStopUnloadSelfModule() unimplemented
sceKernelStopUnloadSelfModuleWithStatus() unimplemented
sceGeGetMtx() unimplemented
sceGeListDeQueue() unimplemented
sceGeBreak unimplemented
sceGeContinue unimplemented
sceNetInetGetsockopt() unimplemented
sceNetInetSetsockopt() unimplemented
sceNetInetGetErrno() unimplemented
sceWlanGetEtherAddr unimplemented
sceKernelQueryMemoryInfo() unimplemented
sceKernelGetPTRIG() unimplemented
sceKernelSetPTRIG() unimplemented
sceKernelSetCompiledSdkVersion401_402() unimplemented
sceKernelSetCompiledSdkVersion507() unimplemented
sceKernelSetCompiledSdkVersion600_602() unimplemented
sceKernelSetCompiledSdkVersion603_605() unimplemented
sceKernelSetUsersystemLibWork() unimplemented
sceKernelSysMemUserForUser_ACBD88CA() unimplemented
sceKernelSysMemUserForUser_D8DE5C1E() unimplemented -- sceKernelSafetyCheck0
sceKernelSysMemUserForUser_945E45DA() unimplemented
sceKernelTerminateDeleteThread() unimplemented
sceKernelCancelSema unimplemented
sceKernelCancelFpl unimplemented
sceKernelReferFplStatus unimplemented
sceKernelCancelVpl unimplemented
sceKernelCreateMbx unimplemented
sceKernelDeleteMbx unimplemented
sceKernelSendMbx unimplemented
sceKernelReceiveMbx unimplemented
sceKernelReceiveMbxCB unimplemented
sceKernelPollMbx unimplemented
sceKernelCancelReceiveMbx unimplemented
sceKernelReferMbxStatus unimplemented
</pre>
</pre>


===Partially Supported===
===Links===
<pre>
* https://forums.ppsspp.org/showthread.php?tid=1473
|sceIoIoctl|
* https://forums.ppsspp.org/showthread.php?tid=11961
* https://github.com/LunaMoo/PPSSPP_workarounds/blob/master/cheat.db


supported:
===More Information:===
0x1010005 (UMD file seek set)
** https://pastebin.com/CXRpVLdd (by [[User:DarkElement]])
0x1020006 (Get UMD file start sector)
 
|sceIoDevctl|
 
supported:
0x1F100A4 (Prepare UMD data into cache)
0x2415821 (MScmRegisterMSInsertEjectCallback)
0x2415822 (MScmUnregisterMSInsertEjectCallback)
0x2025806 (Check if the device is inserted (mscmhc0))
0x2425823 (Check if FAT enabled)
0x2415823 (Set FAT as enabled), supported
</pre>
 
==Restricted==
<pre>
scePowerRegisterCallback - ignoring
scePowerUnregisterCallback - ignoring
scePowerSetClockFrequency - ignoring
scePowerSetCpuClockFrequency(%d) - ignoring
scePowerSetBusClockFrequency(%d) - ignoring
sceUtilityMsgDialogInitStart ignored
</pre>
 
===Links===
* https://forums.ppsspp.org/showthread.php?tid=1473
* https://forums.ppsspp.org/showthread.php?tid=11961
* https://github.com/LunaMoo/PPSSPP_workarounds/blob/master/cheat.db
* https://www.psdevwiki.com/ps4/Talk:PSP_Emulator_Compatibility_List#Official_PSPemu_Configuration_Files
* https://www.psdevwiki.com/ps4/Talk:PSP_Emulator_Compatibility_List#Official_PSPemu_Configuration_Files
* https://www.psdevwiki.com/ps4/PSP_Emulator_Compatibility_List
===More Information:===
** https://pastebin.com/CXRpVLdd (by [[User:DarkElement]])
* https://gbatemp.net/threads/wip-psp-injection.503103/
* https://gbatemp.net/threads/wip-psp-injection.503103/
* https://twitter.com/zordon605/status/993758941627772929
* https://twitter.com/zordon605/status/993758941627772929
Please note that all contributions to PS4 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS4 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)