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 1: | Line 1: | ||
== | == Description == | ||
Playstation 1 emulator called internally ps1hd. Emulation on PS4 is handled differently comparing to PS3. Each PS1 game PS4 package file (.pkg) include emulator itself, so there is no included emulator in PS4 firmware. | |||
Fact that emulator is now included in game pkg, is slightly complicating providing [[PS1_Classics_Emulator_Compatibility_List|compatibility list]], as emulators include some per title patches, and different default settings. | |||
Next difference is that BIOS/ROM in external file is included in .pkg, emu need different region bios for different region titles. This time bios is not any special version, standard SCPH-550X is used. | |||
PS1 Emulator supports LUA scripting by "Lua Bridge", is powerful interface that provide many possibilities to improve compatibility. | |||
Memory card is created at first run of emulator, so you don't need to include one in pkg. | |||
Emulator have some leftovers from PSP emulator (like axinsnreplace), so core of non PS1 specific functions is the same as in PSP emu. Rest of emu seems to be "inspired" by mednafen. | |||
== Configuration Files == | == Configuration Files == | ||
=== config-title.txt === | === config-title.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 159: | Line 65: | ||
|} | |} | ||
=== XXXXYYYYY.LUA === | ===XXXXYYYYY.LUA=== | ||
<br>'''scripts/XXXXYYYYY.LUA''' | <br>'''scripts/XXXXYYYYY.LUA''' | ||
<br>Lua patches are split between 2 categories R3K (r3000 mips), and EM (emulator). Objects do not need to be called in order for their commands to be usable, contrary to the PS2's emulator. | <br>Lua patches are split between 2 categories R3K (r3000 mips), and EM (emulator). Objects do not need to be called in order for their commands to be usable, contrary to the PS2's emulator. | ||
====R3000 commands==== | |||
==== R3000 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 !! Example !! Notes | ! Command !! Usage !! Example !! Notes | ||
Line 221: | Line 124: | ||
|} | |} | ||
==== Emulator commands ==== | ====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 !! Example !! Notes | ! Command !! Usage !! Example !! Notes | ||
Line 250: | Line 152: | ||
|SaveConfig||EM_SaveConfig() || || | |SaveConfig||EM_SaveConfig() || || | ||
|- | |- | ||
|LoadState|| EM_LoadState()|| ||Load savestate, seems to be disabled in | |LoadState|| EM_LoadState()|| ||Load savestate, seems to be disabled in Medievil emu. | ||
|- | |- | ||
|SaveState||EM_SaveState() || ||Save savestate, seems to be disabled in | |SaveState||EM_SaveState() || ||Save savestate, seems to be disabled in Medievil emu. | ||
|- | |- | ||
|PostEffect|| EM_PostEffect() || || | |PostEffect|| EM_PostEffect() || || | ||
Line 262: | Line 164: | ||
|CRC32 || || || | |CRC32 || || || | ||
|- | |- | ||
|AddFBMapping|| EM_AddFBMapping( , , , ) || || Add framebffer mapping, in | |AddFBMapping|| EM_AddFBMapping( , , , ) || || Add framebffer mapping, in Medievil used with EM_AddFBMapping(768, 256, 180, 256) values. | ||
|- | |- | ||
|RemoveFBMapping|| EM_RemoveFBMapping( , ) || || Remove framebffer mapping, in | |RemoveFBMapping|| EM_RemoveFBMapping( , ) || || Remove framebffer mapping, in Medievil used with EM_RemoveFBMapping(768, 256) values. | ||
|- | |- | ||
|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. | |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 280: | Line 182: | ||
== Emulators == | == Emulators == | ||
<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> | |||
Every emulator is programmed in a different way | |||
{| 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 (Usage) | ! Emulator !! Usage !! API Version !! Similar emulators (Usage) | ||
|- | |- | ||
| Syphon | | Syphon filter || Most popular emulator so far and the one with the highest compatibility, It's used in PSXFPKG v0.3 as the default emulator || ? || ? | ||
|- | |- | ||
| | | Medievil || An unofficial emulator made by sony that's very bad emulator in terms of compatibility. || ? || ? | ||
|- | |- | ||
|} | |} | ||
== PAL Libcrypt games == | == PAL Libcrypt games == | ||
Some PAL PSX games include libcrypt protection, those are known to [http://wiki.redump.org/index.php?title=PlayStation_1:_LibCrypt_protection_(Old) cause issues for emulators.] | Some PAL PSX games include libcrypt protection, those are known to [http://wiki.redump.org/index.php?title=PlayStation_1:_LibCrypt_protection_(Old) cause issues for emulators.] | ||
===List=== | |||
=== List === | |||
* Actua Ice Hockey 2 (Europe) | * Actua Ice Hockey 2 (Europe) | ||
Line 406: | Line 304: | ||
* Wip3out (Europe) (En,Fr,De,Es,It) | * Wip3out (Europe) (En,Fr,De,Es,It) | ||
=== Known Issues === | === Known Issues === | ||
The exact effects of libcrypt depend on the game. However, they usually render the game unplayable in some form. | |||
The exact effects of libcrypt depend on the game. However, they usually render the game unplayable in some form. Here is list of libcrypt-caused issues known to the community. Be sure to patch these games before creating a pkg, or try to fix them by using the --libcrypt command in the | Here is list of libcrypt-caused issues known to the community. | ||
Be sure to patch these games before creating a pkg, or try to fix them by using the --libcrypt command in the emu config. | |||
{| 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 460: | Line 359: | ||
|} | |} | ||
* Libcrypt | * Libcrypt info mostly taken from: https://github.com/Kippykip/SBITools#libcrypt-failed-check-causes-and-effects | ||
== Multi-Disc support == | == Multi-Disc support == | ||
This needs more [[User talk:139.47.102.134|testing]] but in theory it should work as follows. | This needs more [[User talk:139.47.102.134|testing]] but in theory it should work as follows. | ||
=== On Real PS1 Hardware, PS2, PSP, | === On Real PS1 Hardware, PS2, PSP, PSV, PS3 === | ||
Example Game: '''Final Fantasy VII''' containing 3 Discs: | Example Game: '''Final Fantasy VII''' containing 3 Discs: | ||
* Before the Game asks you to change Discs, it will ask you if you wish to save the Game. | * Before the Game asks you to change Discs, it will ask you if you wish to save the Game. | ||
Line 479: | Line 376: | ||
=== So how to do this on a PS4? === | === So how to do this on a PS4? === | ||
Since as mentioned [[PS1 Emulation#Description|above]] the problematic we have is that every PKG contains not only the Game as an Image-File, but also the [[PS1 Emulation|Emulator]] and a Save File itself. So a workaround is needed: | Since as mentioned [[PS1 Emulation#Description|above]] the problematic we have is that every PKG contains not only the Game as an Image-File, but also the [[PS1 Emulation|Emulator]] and a Save File itself. So a workaround is needed: | ||
* You create a FPKG containing '''Disc 1''' of Final Fantasy VII '''only''' (Example [[Content ID]] = CUSAFF7'''D1'''). | * You create a FPKG containing '''Disc 1''' of Final Fantasy VII '''only''' (Example [[Content ID]] = CUSAFF7'''D1'''). | ||
Line 491: | Line 387: | ||
=== Alternative solution - Disc Merge === | === Alternative solution - Disc Merge === | ||
Alternatively ps1 discs can be merged into single bin/cue. There could be potential limitations in file size because MM:SS:FF can only go up to 99:99:99 which translates to around 870MB. For sure this will be problem for games with CDDA tracks. For now there is no confirmation that this limit apply to data only games. How hard is disc merging depends highly on game we want to use. Parasite Eve is one of easiest games to do that since second disc check is triggered only if files from disc 2 are not present on current disc, which they are since discs are merged. Game also use the same EXE and PE file on both discs, and do not use lba based tables. So merging discs is literally repacking them into single disc. But different games use different approaches, games like MGS need additional patches to few files to skip shell open checks, and lba adjustments. For now Chinese Parasite Eve fan translation is only confirmed game that works (thx 苏宇 for playing whole game to test it). | Alternatively ps1 discs can be merged into single bin/cue. There could be potential limitations in file size because MM:SS:FF can only go up to 99:99:99 which translates to around 870MB. For sure this will be problem for games with CDDA tracks. For now there is no confirmation that this limit apply to data only games. How hard is disc merging depends highly on game we want to use. Parasite Eve is one of easiest games to do that since second disc check is triggered only if files from disc 2 are not present on current disc, which they are since discs are merged. Game also use the same EXE and PE file on both discs, and do not use lba based tables. So merging discs is literally repacking them into single disc. But different games use different approaches, games like MGS need additional patches to few files to skip shell open checks, and lba adjustments. For now Chinese Parasite Eve fan translation is only confirmed game that works (thx 苏宇 for playing whole game to test it). | ||
== 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;" | ||
! Offset From !! Offset To !! Name !! Memory Name (PS4) | ! Offset From !! Offset To !! Name !! Memory Name (PS4) | ||
Line 502: | Line 396: | ||
|- | |- | ||
|} | |} | ||
==Converting psx cheats for the ps4== | |||
== Converting | '''Psx cheats into a shn''' | ||
''' | |||
<pre> | <pre> | ||
Only tested in Syphon | Only tested in Syphon filter's emulator | ||
1. Get an offset [You can get them from Gamehacking.org / Duckstation / Epsxe] | 1. Get an offset [You can get them from Gamehacking.org / Duckstation / Epsxe] | ||
2. Remove the first 2 numbers from the offset | 2. Remove the first 2 numbers from the offset | ||
Line 518: | Line 409: | ||
'''For ps4cheater''' | '''For ps4cheater''' | ||
<pre> | <pre> | ||
Only tested in Syphon filter's emulator | Only tested in Syphon filter's emulator | ||
Line 528: | Line 418: | ||
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 | ||
</pre> | </pre> | ||
===PC register script (Syphon Filter 1)=== | |||
=== PC register script (Syphon Filter) === | |||
<br>For the usage in PS4cheater. | <br>For the usage in PS4cheater. | ||
<br>'''PSX.cht''' | <br>'''PSX.cht''' | ||
Line 538: | Line 426: | ||
</pre> | </pre> | ||
=== PC register script (Syphon Filter 3) === | ===PC register script (Syphon Filter 3)=== | ||
<pre> | <pre> | ||
1.5|eboot.bin|ID:|VER:01.00|FM:505 | 1.5|eboot.bin|ID:|VER:01.00|FM:505 | ||
Line 546: | Line 433: | ||
</pre> | </pre> | ||
== TOC file layout == | ==TOC file layout== | ||
For multi bin images, probably require emu from ps plus. | |||
For multi bin images, probably | <br> | ||
<br | |||
Track entry structure: | Track entry structure: | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 586: | Line 472: | ||
== Folder/File layout == | == Folder/File layout == | ||
Example: Medievil internal emulator, standalone pkg can differ. | |||
Example: | |||
<pre> | <pre> | ||
Line 639: | Line 524: | ||
│ │ │ ├──TimelineSlideDown.ogg | │ │ │ ├──TimelineSlideDown.ogg | ||
│ │ │ └──TimelineSlideUp.ogg | │ │ │ └──TimelineSlideUp.ogg | ||
│ │ ├──arrow_left.png | │ │ ├──arrow_left.png | ||
│ │ ├──arrow_right.png | │ │ ├──arrow_right.png | ||
Line 723: | Line 607: | ||
├──eboot.bin | ├──eboot.bin | ||
├──revision.conf | ├──revision.conf | ||
</pre> | </pre> | ||
== Emulator patches == | == Emulator patches == | ||
=== Syphon Filter 3 emu === | === Syphon Filter 3 emu === | ||
Emu build from 2023-Feb-17 | Emu build from 2023-Feb-17 | ||
=== The Legend Of Dragoon emu === | === The Legend Of Dragoon emu === | ||
Emu build from 2023-Feb-21 | Emu build from 2023-Feb-21 | ||
==== Remove dithering ==== | ==== Remove dithering ==== | ||
Universal dithering removal patch, works with every single game. PS1 cheats/patches are no longer required to disable dither pattern. To apply unself self file, edit, and sign it again after that. Alternatively you can use cheat engine, offset need to be adjusted to emu base then.<br> | Universal dithering removal patch, works with every single game. PS1 cheats/patches are no longer required to disable dither pattern. To apply unself self file, edit, and sign it again after that. Alternatively you can use cheat engine, offset need to be adjusted to emu base then.<br> | ||
''Replaces *and ecx, 7FFh* with *and ecx, 5FFh* to always remove dither enable bit on E1 write.'' | ''Replaces *and ecx, 7FFh* with *and ecx, 5FFh* to always remove dither enable bit on E1 write.'' | ||
Line 748: | Line 629: | ||
81 E1 FF 05 00 00 | 81 E1 FF 05 00 00 | ||
== | == Links == | ||
* https://www.psdevwiki.com/ps4/Talk:PS1_Classics_Emulator_Compatibility_List | * https://www.psdevwiki.com/ps4/Talk:PS1_Classics_Emulator_Compatibility_List | ||
* https://www.psx-place.com/threads/psx-fpkg-0-2-by-jabu-new-tool-to-convert-ps1-games-for-ps4.30498/ | * https://www.psx-place.com/threads/psx-fpkg-0-2-by-jabu-new-tool-to-convert-ps1-games-for-ps4.30498/ | ||
Line 758: | Line 638: | ||
* https://github.com/Goatman13/Cue2toc | * https://github.com/Goatman13/Cue2toc | ||
* https://forums.pcsx2.net/Thread-PSOne-Dithering-OFF-patches | * https://forums.pcsx2.net/Thread-PSOne-Dithering-OFF-patches | ||
{{Reverse Engineering}} | {{Reverse Engineering}} |