Editing PS1 Emulation
Jump to navigation
Jump to search
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 10: | Line 10: | ||
== Configuration Files == | == Configuration Files == | ||
=== config- | === config-emu-ps4.txt === | ||
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;" | {| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;" | ||
! style="width:10%" | Command !! style="width:15%" | Values !! Notes !! style="width:20%" | Usage | ! style="width:10%" | Command !! style="width:15%" | Values !! Notes !! style="width:20%" | Usage | ||
Line 16: | Line 16: | ||
| --wait|| || || | | --wait|| || || | ||
|- | |- | ||
| --bios|| path || Need to match region of game, relative to sandbox root || --bios= | | --bios|| path || Need to match region of game, relative to sandbox root || --bios="BIOS/SCPH5502.bin" | ||
|- | |- | ||
| --configpath|| || || | | --configpath|| || || | ||
Line 52: | Line 52: | ||
| --texrecent|| true , false || Optimize texture hashes Leading To better Performance || --texrecent=true | | --texrecent|| true , false || Optimize texture hashes Leading To better Performance || --texrecent=true | ||
|- | |- | ||
| | |} | ||
=== patches.lua === | |||
Lua patches are split between 2 categories R3K (r3000 mips), and EM (emulator). Called by getXXXObject. Only exception from that is apiRequest. | |||
====Apirequest==== | |||
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;" | |||
! Command !! Usage !! Notes | |||
|- | |- | ||
| | | apiRequest || apiRequest(<api version>) || example: apiRequest(0.1) | ||
Different emu versions support different highest api. Medievil emu support api up to 1.0 | |||
Calling api is mandatory. | |||
|| | |||
|- | |- | ||
|} | |} | ||
====R3000 Commands==== | |||
====R3000 | |||
{| 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 !! Usage | ! Command !! Usage !! Notes | ||
|- | |- | ||
|GetPC || R3K_GetPC() | |GetPC || R3K_GetPC() || Return current Program counter. | ||
|- | |- | ||
|SetPC || R3K_SetPC(address) | |SetPC || R3K_SetPC(address) || Set current Program counter to address. | ||
|- | |- | ||
|GetHi || R3K_GetHi | |GetHi || R3K_GetHi || Return Hi register value. | ||
|- | |- | ||
|SetHi || R3K_SetHi(value) | |SetHi || R3K_SetHi(value) || Set Hi register value. | ||
|- | |- | ||
|GetLo || R3K_GetLo | |GetLo || R3K_GetLo || Return Lo register value. | ||
|- | |- | ||
|SetLo || R3K_SetLo(value) | |SetLo || R3K_SetLo(value) || Set Lo register value. | ||
|- | |- | ||
|GetGpr || R3K_GetGpr(reg) | |GetGpr || R3K_GetGpr(reg) || Return register value, require formatting like here: r3k.GetGpr(gpr.a0). | ||
|- | |- | ||
|SetGpr || R3K_SetGpr(reg, value) | |SetGpr || R3K_SetGpr(reg, value) || Set register value, require formatting like here: r3k.GetGpr(gpr.a0, value). | ||
|- | |- | ||
|ReadMem8 || R3K_ReadMem8(address) | |ReadMem8 || R3K_ReadMem8(address) || Read/return byte from address. | ||
|- | |- | ||
|ReadMem16 || R3K_ReadMem16(address) | |ReadMem16 || R3K_ReadMem16(address) || Read/return half from address. | ||
|- | |- | ||
|ReadMem32 || R3K_ReadMem32(address) | |ReadMem32 || R3K_ReadMem32(address) || Read/return word from address. | ||
|- | |- | ||
|ReadMemFloat || R3K_ReadMemFloat(address) | |ReadMemFloat || R3K_ReadMemFloat(address) || Read/return float from address. | ||
|- | |- | ||
|ReadMemStr || R3K_ReadMemStr(address) | |ReadMemStr || R3K_ReadMemStr(address) || Read/return string from address. | ||
|- | |- | ||
|WriteMem8 || R3K_WriteMem8(address, value) | |WriteMem8 || R3K_WriteMem8(address, value) || Write/set selected memory as byte to value. | ||
|- | |- | ||
|WriteMem16 || R3K_WriteMem16(address, value) | |WriteMem16 || R3K_WriteMem16(address, value) || Write/set selected memory as half to value. | ||
|- | |- | ||
|WriteMem32 || R3K_WriteMem32(address, value | |WriteMem32 || R3K_WriteMem32(address, value) || Write/set selected memory as word to value. | ||
|- | |- | ||
|WriteMemFloat || R3K_WriteMemFloat(address, value) | |WriteMemFloat || R3K_WriteMemFloat(address, value) || Write/set selected memory as float to value. | ||
|- | |- | ||
|WriteMemStr || R3K_WriteMemStr(address, value) | |WriteMemStr || R3K_WriteMemStr(address, value) || Write/set selected memory as string to value. | ||
|- | |- | ||
|WriteMemStrZ || R3K_WriteMemStrZ(address, value) | |WriteMemStrZ || R3K_WriteMemStrZ(address, value) || | ||
|- | |- | ||
|AddHook || R3K_AddHook(address, original opcode, function/hook) | |AddHook || R3K_AddHook(address, original opcode, function/hook) || Add hook into mips code. | ||
|- | |- | ||
|RemoveHook|| R3K_RemoveHook(?) | |RemoveHook|| R3K_RemoveHook(?) || Remove hook from mips code. | ||
|- | |- | ||
|InsnReplace || R3K_InsnReplace(address, original opcode, replace opcode) | |InsnReplace || R3K_InsnReplace(address, original opcode, replace opcode) || similar to pcsx2 pnach, but additionally use original opcode as a check. | ||
|- | |- | ||
|FuncReplace || R3K_FuncReplace(address, original opcode, function name) | |FuncReplace || R3K_FuncReplace(address, original opcode, function name) || Hook/replace function in mips code with predefinied one. | ||
|- | |- | ||
|BurnCycles || R3K_BurnCycles() | |BurnCycles || R3K_BurnCycles()|| | ||
|- | |- | ||
|FlushCache || R3K_FlushCache() | |FlushCache || R3K_FlushCache() || Flush mips instruction cache. | ||
|- | |- | ||
|} | |} | ||
====Emulator | ====Emulator Commands==== | ||
{| 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 !! Usage | ! Command !! Usage !! Notes | ||
|- | |- | ||
|PadRead || EM_PadRead() | |PadRead || EM_PadRead() || Return pad state (pushed buttons). | ||
|- | |- | ||
|PadReadLeftStick || EM_PadReadLeftStick() | |PadReadLeftStick || EM_PadReadLeftStick() || Return pad left stick state. | ||
|- | |- | ||
|PadReadRightStick || EM_PadReadRightStick() | |PadReadRightStick || EM_PadReadRightStick() || Return pad right stick state. | ||
|- | |- | ||
|PadSetButtonsMode || EM_PadSetButtonMode(value) | |PadSetButtonsMode || EM_PadSetButtonMode(value) || Set some pad mode, in one of official configs described as "switch Select/Start -> Touchpad/Options mode" with used value 2. | ||
|- | |- | ||
|AddVsyncHook || EM_AddVsyncHook(anything) | |AddVsyncHook || EM_AddVsyncHook(anything) || Add hook that trigger on every vsync, param usually will be previously prepared function. | ||
|- | |- | ||
|RemoveVsyncHook|| EM_RemoveVsyncHook() | |RemoveVsyncHook|| EM_RemoveVsyncHook()|| Remove hook that trigger on every vsync. | ||
|- | |- | ||
|ThrottleMax || EM_ThrottleMax() | |ThrottleMax || EM_ThrottleMax() || Remove framelimiter, used frequently for loadings. | ||
|- | |- | ||
|ThrottleNormal || EM_ThrottleNormal() | |ThrottleNormal || EM_ThrottleNormal() || Set framelimiter to default game value. | ||
|- | |- | ||
|Log || EM_Log(value) | |Log || EM_Log(value) || Print debug messages to usermode console, ex. emu.Log(string.format("Overlay: %02x", overlay)). | ||
|- | |- | ||
|GetNativeLanguage|| EM_GetNativeLanguage() | |GetNativeLanguage|| EM_GetNativeLanguage() || Return used PS4 language. | ||
|- | |- | ||
|LoadConfig||EM_LoadConfig() | |LoadConfig||EM_LoadConfig() || | ||
|- | |- | ||
|SaveConfig||EM_SaveConfig() | |SaveConfig||EM_SaveConfig() || | ||
|- | |- | ||
|LoadState|| EM_LoadState() | |LoadState|| EM_LoadState()|| Load savestate, seems to be disabled in Medievil emu. | ||
|- | |- | ||
|SaveState||EM_SaveState() | |SaveState||EM_SaveState() || Save savestate, seems to be disabled in Medievil emu. | ||
|- | |- | ||
|PostEffect|| EM_PostEffect() | |PostEffect|| EM_PostEffect() || | ||
|- | |- | ||
|PostEffectParams|| EM_PostEffectParams() | |PostEffectParams|| EM_PostEffectParams()|| | ||
|- | |- | ||
|NeoMode|| EM_NeoMode() | |NeoMode|| EM_NeoMode() || Return 1 if PS4 PRO, 0 otherwise. | ||
|- | |- | ||
|CRC32 | |CRC32 || || | ||
|- | |- | ||
|AddFBMapping|| EM_AddFBMapping( , , , ) | |AddFBMapping|| EM_AddFBMapping( , , , ) || Add framebffer mapping, in Medievil used with EM_AddFBMapping(768, 256, 180, 256) values. | ||
|- | |- | ||
|RemoveFBMapping|| EM_RemoveFBMapping( , ) | |RemoveFBMapping|| EM_RemoveFBMapping( , ) || Remove framebffer mapping, in Medievil used with EM_RemoveFBMapping(768, 256) values. | ||
|- | |- | ||
|Launch || EM_Launch("path") | |Launch || EM_Launch("path") || Emulator is able to launch selfs in own sandbox, require full path (for example "/app0/folder/my_self.bin"), can be used for multidisc games. | ||
|- | |- | ||
|} | |} | ||
Line 301: | Line 298: | ||
* Vagrant Story (Europe) , (France) , (Germany) | * Vagrant Story (Europe) , (France) , (Germany) | ||
* Walt Disney World Quest - Magical Racing Tour (Europe) (En,Fr,De,Es,It,Nl,Sv,No,Da) | * Walt Disney World Quest - Magical Racing Tour (Europe) (En,Fr,De,Es,It,Nl,Sv,No,Da) | ||
* Wip3out (Europe) (En,Fr,De,Es,It) | * Wip3out (Europe) (En,Fr,De,Es,It) | ||
Line 350: | Line 346: | ||
|Vagrant Story (PAL) || | |Vagrant Story (PAL) || | ||
Will hang on the "now loading"-screen, after choosing "new game" on the main menu. | Will hang on the "now loading"-screen, after choosing "new game" on the main menu. | ||
|- | |- | ||
|Wip3out (PAL) || | |Wip3out (PAL) || | ||
Line 385: | Line 378: | ||
* Start the new FPKG created and it should recognize your Save File and load the Game from the beginning of Disc 2 | * Start the new FPKG created and it should recognize your Save File and load the Game from the beginning of Disc 2 | ||
* Do the same process for every other additional Disc. | * Do the same process for every other additional Disc. | ||
==Memory mapping== | ==Memory mapping== | ||
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;" | {| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;" | ||
Line 416: | Line 405: | ||
2. Remove the first 2 numbers from the offset | 2. Remove the first 2 numbers from the offset | ||
3. Increase the offset by 0x2000EB2A0 using a hex calculator and use it in ps4 cheater | 3. Increase the offset by 0x2000EB2A0 using a hex calculator and use it in ps4 cheater 0x20014B2A0 | ||
</pre> | </pre> | ||
Line 475: | Line 450: | ||
<pre> | <pre> | ||
├──bios | |||
│ | │ ├── scph5500.bin | ||
│ ├── scph5501.bin | |||
│ └── scph5502.bin | |||
├──config-emu-ps4.txt | |||
│ | |||
│ | |||
├──data | ├──data | ||
│ └── image.bin | │ └── image.bin | ||
├──eboot.bin | |||
├──sce_module | ├──sce_module | ||
│ ├── libc.prx | │ ├── libc.prx | ||
│ ├── libSceAudioLatencyEstimation.prx | |||
│ ├── libSceFace.prx | |||
│ ├── libSceFaceTracker.prx | |||
│ ├── libSceFios2.prx | │ ├── libSceFios2.prx | ||
│ └── | │ ├── libSceHand.prx | ||
│ ├── libSceHandTracker.prx | |||
│ ├── libSceHeadTracker.prx | |||
│ ├── libSceJobManager.prx | |||
│ ├── libSceNpToolkit2.prx | |||
│ └── libSceS3DConversion.prx | |||
├──sce_sys | ├──sce_sys | ||
│ └── param.sfo | │ └── param.sfo | ||
├──scripts | ├──scripts | ||
│ | │ └── patches.lua | ||
</pre> | </pre> | ||
== Links == | == Links == | ||
* https://www.psdevwiki.com/ps4/Talk:PS1_Classics_Emulator_Compatibility_List | * https://www.psdevwiki.com/ps4/Talk:PS1_Classics_Emulator_Compatibility_List | ||
Line 634: | Line 482: | ||
* https://www.youtube.com/watch?v=04EY7huZq9M | * https://www.youtube.com/watch?v=04EY7huZq9M | ||
* For getting cheats: https://gamehacking.org/system/psx | * For getting cheats: https://gamehacking.org/system/psx | ||
{{Reverse Engineering}} | {{Reverse Engineering}} | ||
<noinclude> | <noinclude>[[Category:Main]]</noinclude> | ||
[[Category:Main]] | |||
</noinclude> |