Editing PS1 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:
== Official games ==
== Description ==
 
=== PS1 games available on PS4 PS Store ===
 
* Dino Crisis (PS5: UP0102-PPSA07831_00-CLASSICDINO00001 or JP0102-PPSA07866_00-CLASSICDINO00001) 2024-10-15
* 2Xtreme / Street Games '97 UP9000-CUSA41399_00-SCUS945080000000 (PS5: UP9000-PPSA14435_00-SCUS945080000000 or JP9000-PPSA14437_00-SIPS600190000000) 2024-05-21 PS4 11.50
* G-Police (1997) UP9000-CUSA42756_00-SLUS005440000000 (PS5: UP9000-PPSA15806_00-SLUS005440000000 or JP9000-PPSA15808_00-SCPS100650000000) 2024-05-21 PS4 11.50
* Alone in the Dark: The New Nightmare (2001) EP4389-CUSA44781_00-SLES028010000000 or UP4389-CUSA44780_00-SLUS012010000000 (PS5: EP4389-PPSA18071_00-AITDNEWNIGHTMARE or UP4389-PPSA18070_00-AITDNEWNIGHTMARE) 2024-04-16, PS4 11.50
* MediEvil (1998) UP9000-CUSA42759_00-SCUS942270000000 (PS5: UP9000-PPSA15811_00-SCUS942270000000 or JP9000-PPSA15813_00-SCPS100810000000) 2024-04-16 PS4 11.50
* Cool Boarders (2000) UP9000-CUSA45363_00-SCUS943560000000 (PS5: UP9000-PPSA18836_00-SCUS943560000000) 2024-03-19
* Rally Cross (PS5: UP9000-PPSA14448_00-SCUS943080000000 or JP9000-PPSA14450_00-SIPS600220000000) 2024-01-16
* Grandia UP8745-CUSA43159_00-0291383562913011 or JP0184-CUSA43007_00-0451798479123793 2023-11-21
* Jet Moto UP9000-CUSA43452_00-SCUS943090000000 or JP9000-CUSA43453_00-SIPS600200000000 2023-11-21
* Jet Moto 2 / JetMoto’98 UP9000-CUSA44712_00-SCES010450000000 (PS5: UP9000-PPSA17995_00-SCES010450000000 or JP9000-PPSA17996_00-SIPS600290000000) 2024-02-20
* Kurushi™ Final: Mental Blocks / I.Q FINAL UP9000-CUSA32012_00-SCES020090000000 or JP9000-CUSA32014_00-SCPS913110000000 2023-10-17
* R4 RIDGE RACER TYPE 4® PS4 & PS5 (1998) UP0700-CUSA33746_00-SLUS007970000000 or JP0700-CUSA33744_00-SLPS018000000000 2023-03-21 Free PS4/PS5 version for PS3/PSP/PS Vita PSone Classics owners
* TEKKEN2 PS4 & PS5 UP0700-CUSA33750_00-TEKKEN2000000000 or JP0700-CUSA33748_00-TEKKEN2000000000 (PS5: UP0700-PPSA07703_00-SLUS002130000000 or HP0700-PPSA07702_00-SLUS002130000000) 2022-06-13
* Mr. Driller PS4 & PS5 UP0700-CUSA33766_00-MRDRILLER0000000 or JP0700-CUSA33764_00-MRDRILLER0000000 2022-06-13
* Twisted Metal (1995) UP9000-CUSA43359_00-SCUS943040000000 or JP9000-CUSA43360_00-SIPS600070000000 (PS5: UP9000-PPSA16427_00-SCUS943040000000 or JP9000-PPSA16428_00-SIPS600070000000) 2023-07-18
* Twisted Metal 2 / Twisted Metal EX UP9000-CUSA43361_00-SCUS943060000000 or JP9000-CUSA43362_00-SIPS600210000000 (PS5: UP9000-PPSA16429_00-SCUS943060000000 or JP9000-PPSA16430_00-SIPS600210000000) 2023-07-18
* Herc's Adventures UP1082-CUSA41355_00-0759221165223042 or JP1780-CUSA41630_00-0391043783358035 2023-06-20
* Hot Shots Golf UP9000-CUSA32006_00-SCUS941880000000 or JP9000-CUSA32008_00-SCPS100420000000 2022-06-13
* Hot Shots Golf 2 UP9000-CUSA32473_00-SCUS944760000000 or JP9000-CUSA32475_00-SCPS911970000000 2023-01-17
* STAR WARS Rebel Assault II - The Hidden Empire UP1082-CUSA33312_00-SLUS003810000000 or EP1006-CUSA33313_00-SLES006540000000 or JP1780-CUSA33568_00-SLPS006380000000 (PS5: UP1082-PPSA07366_00-5997104624035590 or JP1780-PPSA07526_00-0763020610695754) 2024-04-16 PS4 11.50
* STAR WARS Episode I - The Phantom Menace (PS5: UP1082-PPSA07336_00-6684300313937060 or JP1780-PPSA07524_00-4446476017525841) 2024-01-16
* STAR WARS Demolition UP1082-CUSA33310_00-9257364461708370 2023-01-17
* Ape Escape UP9000-CUSA31964_00-SCUS944230000000 or JP9000-CUSA31966_00-SCPS100910000000 2022-06-13
* Syphon Filter UP9000-CUSA31967_00-SCUS942400000000 or JP9000-CUSA31969_00-SLPS022160000000 2022-06-13 Free PS4/PS5 version for PS3/PSP/PS Vita PSone Classics owners
* Syphon Filter 2 UP9000-CUSA32470_00-SCUS944510000000 2022-09-20 Free PS4/PS5 version for PS3/PSP/PS Vita PSone Classics owners
* Syphon Filter 3 UP9000-CUSA36095_00-SCUS946400000000 2023-01-17 Free PS4/PS5 version for PS3/PSP/PS Vita PSone Classics owners
* Disney•Pixar Buzz Lightyear of Star Command (PS5: UP1082-PPSA14381_00-0570380917000461) 2023-12-19
* Disney•Pixar Toy Story 2: Buzz Lightyear to the Rescue! UP1082-CUSA33334_00-6265507718650825 2022-06-13 Free PS4/PS5 version for PS3/PSP/PS Vita PSone Classics owners
* Resident Evil Director’s Cut (1997) UP0102-CUSA33877_00-CLASSICREDC00001 2022-06-13
* Jumping Flash! UP9000-CUSA32017_00-SCUS941030000000 or JP9000-CUSA32020_00-SCPM850010000000 2022-06-13 Free PS4/PS5 version for PS3/PSP/PS Vita PSone Classics owners
* Wild Arms UP9000-CUSA32009_00-SCUS946080000000 or JP9000-CUSA32011_00-SCPS100280000000 2022-06-13 Free PS4/PS5 version for PS3/PSP/PS Vita PSone Classics owners
* Wild Arms 2 UP9000-CUSA34855_00-SCUS944840000000 or JP9000-CUSA34857_00-SCPS100890000000 2023-02-21 Free PS4/PS5 version for PS3/PSP/PS Vita PSone Classics owners
* Harvest Moon: Back to Nature UP1023-CUSA34071_00-3457003887927414 or JP0507-CUSA34069_00-4859501566917590 2023-02-21
* The Legend of Dragoon (1999) UP9000-CUSA32477_00-SCUS944910000000 or JP9000-CUSA32479_00-SCPS101190000000 2023-02-21 Free PS4/PS5 version for PS3/PSP/PS Vita PSone Classics owners
* Oddworld: Abe's Exoddus (PS1 Emulation) UP4134-CUSA34001_00-9029543245541238 2022-12-20
* Oddworld: Abe's Oddysee (PS1 Emulation) UP4134-CUSA33999_00-3720818447088678 2022-06-13 Free PS4/PS5 version for PS3/PSP/PS Vita PSone Classics owners
* Worms [PS1 Emulation] UP4064-CUSA33244_00-SLUS003360000000 or EP4064-CUSA33243_00-SLES001190000000 2023-06-20
* Worms Pinball [PS1 Emulation] UP4064-CUSA43205_00-SLES004830000000 (PS5: UP4064-PPSA16239_00-0865341241660737) 2024-05-21 PS4 11.50
* Worms World Party [PS1 Emulation] UP4064-CUSA33248_00-SLUS014480000000 or EP4064-CUSA33247_00-SLES038040000000 2022-06-13
* Worms Armageddon [PS1 Emulation] UP4064-CUSA33246_00-SLUS008880000000 or EP4064-CUSA33245_00-SLES022170000000 2022-06-13
* I.Q Intelligent Qube UP9000-CUSA32015_00-SCUS941810000000 or JP9000-CUSA32018_00-SCUS941810000000 2022-06-13
 
=== PS1 games available on PS4 Bluray Disc ===
 
No PS1 Classic game is available on PS4 Bluray Disc, maybe because producers like Limited Run Games thought it would be a waste to store less than 1 GB on a 25 GB Bluray Disc.
 
=== PS1 remaster games available on PS4 PS Store ===
 
* Clock Tower: Rewind 2024-10-29 "Play Original mode to experience Clock Tower as it was when initially released in 1995, or play Rewind mode with extra content and improvements."
* GRANDIA HD Collection (contains Grandia HD Remaster and Grandia 2 HD Remaster) UP8299-CUSA43589_00-0792833251161643 2024-03-26
* MediEvil HD UP9000-CUSA11227_00-MEDIEVILHD000001 or EP9000-CUSA12982_00-MEDIEVILHD000001 PS4 6.72 2019-10-24
* Tomb Raider: Definitive Edition (in Tomb Raider: Definitive Survivor Trilogy) UP0082-CUSA27687_00-4584232154698924 2021-03-18
* Tomb Raider I-III Remastered (PS5: UP1032-PPSA16901_00-TOMBRAIDER123224) 2024-02-14
* Tomb Raider: The Last Revelation (in Tomb Raider IV-VI Remastered PS4 & PS5) (PS5: UP1032-PPSA18154_00-TOMBRAIDER456225) 2025-02-14
* Tomb Raider: Chronicles (in Tomb Raider IV-VI Remastered PS4 & PS5) (PS5: UP1032-PPSA18154_00-TOMBRAIDER456225) 2025-02-14
 
=== PS1 remaster games available on PS5 PS Store ===
 
* Clock Tower: Rewind UP2053-PPSA21337_00-CLOCKTOWERPS5USA 2024-10-29 "Play Original mode to experience Clock Tower as it was when initially released in 1995, or play Rewind mode with extra content and improvements."
* Legend of Mana UP0082-CUSA24495_00-LOMPS4NA00000001 2021-06-24
* Tomba! Special Edition 2024-08-01
 
=== PS1 remaster games available on PS4 Bluray Disc ===
 
* Clock Tower: Rewind PS4 (Limited Run #560) 2024-10-29 "Play Original mode to experience Clock Tower as it was when initially released in 1995, or play Rewind mode with extra content and improvements."
* GRANDIA HD Collection (Limited Run Games #544) (contains Grandia HD Remaster and Grandia 2 HD Remaster) UP8299-CUSA43589_00-0792833251161643 2024-03-26
* MediEvil HD UP9000-CUSA11227_00-MEDIEVILHD000001 or EP9000-CUSA12982_00-MEDIEVILHD000001 PS4 6.72
* Tomb Raider: Definitive Edition (in Tomb Raider: Definitive Survivor Trilogy) UP0082-CUSA27687_00-4584232154698924
 
=== PS1 remaster games available on PS5 Bluray Disc ===
 
* Clock Tower: Rewind PS5 (by Limited Run #105) UP2053-PPSA21337_00-CLOCKTOWERPS5USA 2024-10-29 "Play Original mode to experience Clock Tower as it was when initially released in 1995, or play Rewind mode with extra content and improvements." https://store.playstation.com/en-us/concept/10010305 Notice: PS1 Clock Tower is not the original game.
** The first game in the series was Clock Tower (1995) - first released on the SNES, later ported to PS1, PC and WonderSwan, but only ever released in Japan.
** The PS1 game is the second game, and was called Clock Tower 2 in Japan but just Clock Tower everywhere else, even though it is a sequel and not a port of the original.
** Clock Tower 2 on the PS1 is the third game.
** Clock Tower 3 on the PS2 is the fourth game.
* Gex Trilogy (by Limited Run, includes Gex, Gex: Enter the Gecko & Gex 3: Deep Cover Gecko) — but these aren't isn't just re-runs! This Carbon Engine collection includes extras and quality of life improvements to bring Gex back into prime time!
* Tomba! Special Edition PS5 (by Limited Run #108) UP6893-PPSA21381_00-0240103642659799 2024-08-01
 
=== To be announced ===
 
* Tomba 2 The Evil Swine Return (TBA 2025 by Limited Run Games)
* Fear Effect (TBA 2025 by Limited Run Games)
* Fighting Force and Fighting Force 2 (TBA 2025 by Limited Run Games)
 
"Five PS1 games were recently announced for PS5 and PS4 with trophy support: Gex, Gex Enter the Gecko, Gex 3 Deep Cover Gecko, Clock Tower, and Tomba. All five games were announced to be using Limited Run Games' Carbon Engine, which so far has been primarily used to support older console emulation like the SNES and Sega Genesis, but has now officially revealed support for Sony's original PlayStation as well. These PS1 ports for PS5 and PS4 will use Limited Run Games' "Carbon Engine," which allows these classic titles to implement modern features like trophy support."


=== Cross-gen buy on PS Store ===
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.


* https://www.reddit.com/r/PS3/comments/1cscsb2/all_ps1pspps3_games_that_have_crossbuy_or_free/
* https://www.reddit.com/r/PlayStationPlus/comments/vfg39t/is_there_a_clear_list_of_which_ps1_classic_ps4ps5/
* "I have bought some of them on the PS3/PSP/PS Vita and the ones I could claim on the PS4/PS5 were Tekken 2 (which previously was not redeemable), all Syphon Filter games, all Wild Arms games, Legend of Dragoon, Ridge Racer Type 4 and Jumping Flash. Resident Evil Director's Cut is NOT redeemable. The rule of thumb is: if you can buy it on PS4/PS5 - and not only claim it through plus premium/deluxe sub, like Resident Evil 1 - they are redeemable from a previous purchase on PS3/PSP/PS Vita."
== Description ==
The PlayStation emulator running officially on the PlayStation 4 is called internally ps1hd. Emulation on PS4 is handled differently comparing to PS3, PSP and PS Vita. 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-emu-ps4.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 110: Line 16:
| --wait|| || ||  
| --wait|| || ||  
|-
|-
| --bios|| path || Need to match region of game, relative to sandbox root || --bios=SCPH101.bin
| --bios|| path || Need to match region of game, relative to sandbox root || --bios="BIOS/SCPH5502.bin"
|-
|-
| --configpath|| || ||  
| --configpath|| || ||  
Line 146: 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
|-
|-
| --use-lopnor-spu|| 1, 0 || like this is FiX for sound || --use-lopnor-spu=1
|}
 
=== 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
|-
|-
| --userui-settings-graphics|| 1, 0 ||
| apiRequest || apiRequest(<api version>) || example: apiRequest(0.1)
'''filter'''
Different emu versions support different highest api. Medievil emu support api up to 1.0
>> None,Bicubic,Lanczos,Cubic
Calling api is mandatory.  
'''Anti-Aliasing''' >> FXAA,CMAA
'''Upscale Factor''' >>2x,3x,4x,5x,6x Scale
|| --userui-settings-graphics=1
|-
| --enable-user-color-adjustment || 1, 0 || it can change your brightness,contrast, gamma etc. || --enable-user-color-adjustment=1
|-
|-
|}
|}
 
====R3000 Commands====
=== 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.
 
==== 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 !! Notes
|-
|-
|GetPC   || R3K_GetPC() || ||Return current Program counter.
|r3kObject || local r3kobj = getr3kObject() ||
|-
|-
|SetPC   || R3K_SetPC(address) || ||Set current Program counter to address.  
|GetPC   || r3kobj.GetPC() || Return current Program counter.
|-
|-
|GetHi   || R3K_GetHi || ||Return Hi register value.
|SetPC   || r3kobj.SetPC(address) || Set current Program counter to address.  
|-
|-
|SetHi   || R3K_SetHi(value) || ||Set Hi register value.
|GetHi   || r3kobj.GetHi || Return Hi register value.
|-
|-
|GetLo   || R3K_GetLo || ||Return Lo register value.
|SetHi   || r3kobj.SetHi(value) || Set Hi register value.
|-
|GetLo   || r3kobj.GetLo || Return Lo register value.
|-             
|-             
|SetLo   || R3K_SetLo(value) || ||Set Lo register value.
|SetLo   || r3kobj.SetLo(value) || Set Lo register value.
|-
|-
|GetGpr   || R3K_GetGpr(reg) || ||Return register value, require formatting like here: r3k.GetGpr(gpr.a0).
|GetGpr   || r3kobj.GetGpr(reg) || Return register value, require formatting like here: r3k.GetGpr(gpr.a0).
|-             
|-             
|SetGpr   || R3K_SetGpr(reg, value) || ||Set register value, require formatting like here: r3k.GetGpr(gpr.a0, value).
|SetGpr   || r3kobj.SetGpr(reg, value) || Set register value, require formatting like here: r3k.GetGpr(gpr.a0, value).
|-
|-
|ReadMem8   || R3K_ReadMem8(address) || ||Read/return byte from address.
|ReadMem8   || r3kobj.ReadMem8(address) || Read/return byte from address.
|-
|-
|ReadMem16   || R3K_ReadMem16(address) ||  ||Read/return half from address.
|ReadMem16   || r3kobj.ReadMem16(address) || Read/return half from address.
|-
|-
|ReadMem32   || R3K_ReadMem32(address) || ||Read/return word from address.
|ReadMem32   || r3kobj.ReadMem32(address) || Read/return word from address.
|-
|-
|ReadMemFloat  || R3K_ReadMemFloat(address) || ||Read/return float from address.
|ReadMemFloat  || r3kobj.ReadMemFloat(address) || Read/return float from address.
|-
|-
|ReadMemStr   || R3K_ReadMemStr(address) || ||Read/return string from address.
|ReadMemStr   || r3kobj.ReadMemStr(address) || Read/return string from address.
|-
|-
|WriteMem8   || R3K_WriteMem8(address, value) || ||Write/set selected memory as byte to value.  
|WriteMem8   || r3kobj.WriteMem8(address, value) || Write/set selected memory as byte to value.  
|-
|-
|WriteMem16   || R3K_WriteMem16(address, value) || ||Write/set selected memory as half to value.  
|WriteMem16   || r3kobj.WriteMem16(address, value) || Write/set selected memory as half to value.  
|-
|-
|WriteMem32   || R3K_WriteMem32(address, value) || R3K_WriteMem16(0x0006c71c,0x0900) || Write/set selected memory as word to value.
|WriteMem32   || r3kobj.WriteMem32(address, value) || Write/set selected memory as word to value.
|-
|-
|WriteMemFloat || R3K_WriteMemFloat(address, value) || ||Write/set selected memory as float to value.
|WriteMemFloat || r3kobj.WriteMemFloat(address, value) || Write/set selected memory as float to value.
|-
|-
|WriteMemStr   || R3K_WriteMemStr(address, value) || ||Write/set selected memory as string to value.
|WriteMemStr   || r3kobj.WriteMemStr(address, value) || Write/set selected memory as string to value.
|-
|-
|WriteMemStrZ  || R3K_WriteMemStrZ(address, value) || ||
|WriteMemStrZ  || r3kobj.WriteMemStrZ(address, value) ||  
|-
|-
|AddHook || R3K_AddHook(address, original opcode, function/hook) || ||Add hook into mips code.
|AddHook || r3kobj.AddHook(address, original opcode, function/hook) || Add hook into mips code.
|-
|-
|RemoveHook|| R3K_RemoveHook(?) || || Remove hook from mips code.
|RemoveHook|| r3kobj.RemoveHook(?) || Remove hook from mips code.
|-
|-
|InsnReplace   || R3K_InsnReplace(address, original opcode, replace opcode) || || similar to pcsx2 pnach, but additionally use original opcode as a check.
|InsnReplace   || r3kobj.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) || || Hook/replace function in mips code with predefinied one.  
|FuncReplace   || r3kobj.FuncReplace(address, original opcode, function name) || Hook/replace function in mips code with predefinied one.  
|-
|-
|BurnCycles   || R3K_BurnCycles()||  ||
|BurnCycles   || r3kobj.BurnCycles()||  
|-
|-
|FlushCache   || R3K_FlushCache() || || Flush mips instruction cache.  
|FlushCache   || r3kobj.FlushCache() || Flush mips instruction cache.
|-
|-
|}
|}


==== 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 !! Notes
|-
|-
|PadRead || EM_PadRead() || ||Return pad state (pushed buttons).
| getEmuObject || local emuobj = getEmuObject() ||  
|-
|-
|PadReadLeftStick || EM_PadReadLeftStick() || ||Return pad left stick state.
|PadRead || emuobj.PadRead() || Return pad state (pushed buttons).
|-
|-
|PadReadRightStick || EM_PadReadRightStick() || ||Return pad right stick state.
|PadReadLeftStick || emuobj.PadReadLeftStick() || Return pad left stick state.
|-
|-
|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.
|PadReadRightStick || emuobj.PadReadRightStick() || Return pad right stick state.
|-
|-
|AddVsyncHook || EM_AddVsyncHook(anything) || ||Add hook that trigger on every vsync, param usually will be previously prepared function.  
|PadSetButtonsMode || emuobj.PadSetButtonMode(value) || Set some pad mode, in one of official configs described as "switch Select/Start -> Touchpad/Options mode" with used value 2.
|-
|-
|RemoveVsyncHook|| EM_RemoveVsyncHook()|| ||Remove hook that trigger on every vsync.
|AddVsyncHook || emuobj.AddVsyncHook(anything) || Add hook that trigger on every vsync, param usually will be previously prepared function.  
|-
|-
|ThrottleMax || EM_ThrottleMax() || ||Remove framelimiter, used frequently for loadings.
|RemoveVsyncHook|| emuobj.RemoveVsyncHook()|| Remove hook that trigger on every vsync.
|-
|-
|ThrottleNormal || EM_ThrottleNormal() || ||Set framelimiter to default game value.
|ThrottleMax || emuobj.ThrottleMax() || Remove framelimiter, used frequently for loadings.
|-
|-
|Log || EM_Log(value) || ||Print debug messages to usermode console, ex. emu.Log(string.format("Overlay: %02x", overlay)).
|ThrottleNormal || emuobj.ThrottleNormal() || Set framelimiter to default game value.
|-
|-
|GetNativeLanguage|| EM_GetNativeLanguage() || ||Return used PS4 language.
|Log || emuobj.Log(value) || Print debug messages to usermode console, ex. emu.Log(string.format("Overlay: %02x", overlay)).
|-
|-
|LoadConfig||EM_LoadConfig() || ||
|GetNativeLanguage|| emuobj.GetNativeLanguage() || Return used PS4 language.
|-
|-
|SaveConfig||EM_SaveConfig() || ||
|LoadConfig||emuobj.LoadConfig() ||
|-
|-
|LoadState|| EM_LoadState()|| ||Load savestate, seems to be disabled in MediEvil emu.
|SaveConfig||emuobj.SaveConfig() ||
|-
|-
|SaveState||EM_SaveState() || ||Save savestate, seems to be disabled in MediEvil emu.
|LoadState|| emuobj.LoadState()|| Load savestate, seems to be disabled in Medievil emu.
|-
|-
|PostEffect|| EM_PostEffect() || ||
|SaveState||emuobj.SaveState() || Save savestate, seems to be disabled in Medievil emu.
|-
|-
|PostEffectParams|| EM_PostEffectParams()|| ||
|PostEffect|| emuobj.PostEffect() ||
|-
|-
|NeoMode|| EM_NeoMode() || || Return 1 if PS4 PRO, 0 otherwise.
|PostEffectParams|| emuobj.PostEffectParams()||
|-
|-
|CRC32 || || ||
|NeoMode|| emuobj.NeoMode() || Return 1 if PS4 PRO, 0 otherwise.
|-
|-
|AddFBMapping|| EM_AddFBMapping( , , , ) || || Add framebffer mapping, in MediEvil used with EM_AddFBMapping(768, 256, 180, 256) values.
|CRC32 || ||
|-
|-
|RemoveFBMapping|| EM_RemoveFBMapping( , ) || || Remove framebffer mapping, in MediEvil used with EM_RemoveFBMapping(768, 256) values.
|AddFBMapping|| emuobj.AddFBMapping( , , , ) || Add framebffer mapping, in Medievil used with emuobj.AddFBMapping(768, 256, 180, 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.
|RemoveFBMapping|| emuobj.RemoveFBMapping( , ) || Remove framebffer mapping, in Medievil used with emuobj.RemoveFBMapping(768, 256) values.
|-
|-
|}
|Launch || emuobj.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.
<br>'''''LUA example:'''''
<pre>
local patcher = function()
 
R3K_WriteMem16(0x0006c71c,0x0900)
end
 
EM_AddVsyncHook(patcher)
</pre>
 
== Emulators ==
 
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 PlayStation 4. They have to be unpacked from a container that is downloaded from the PS Store for each specific PS1 game. The following list includes the typical usage of some of the emulators.
 
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
! Emulator !! Usage !! API Version !! Similar emulators (Usage)
|-
| Syphon Filter || Most popular emulator so far and the one with the highest compatibility. It is used in PSXFPKG v0.3 as the default emulator || ? || ?
|-
| MediEvil || An unofficial emulator made by Sony that is very bad 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 403: Line 282:
* 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)
* Wonderworld 2: Arena Of Courage (Europe) (En,Es,Fr,De,It,Da)
* 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 emulator configuration.
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 451: Line 330:
|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.
|-
|Wonderworld 2: Arena Of Courage (PAL) ||
Still hangs on the "Loading, please wait..."-screen, when you start the mission.
|-
|-
|Wip3out (PAL) ||
|Wip3out (PAL) ||
Line 460: Line 336:
|}
|}


* Libcrypt information was mostly taken from: https://github.com/Kippykip/SBITools#libcrypt-failed-check-causes-and-effects
* 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, PS Vita, PS3 ===
=== 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 353:


=== 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 489: Line 362:
* 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.
 
==Converting psx cheats for the ps4==
=== Alternative solution - Disc Merge ===
'''Psx cheats into a shn'''
 
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 ==
 
{| cellspacing="0" cellpadding="2" border="1" class="wikitable" style="text-align: center;"
! Offset From !! Offset To !! Name !! Memory Name (PS4)
|-
| 0x200000000 || 0x208000000  ||  R3000 Memory || HeapDirectMem[0]
|-
|}
 
== Converting PSX cheats for the PS4 ==
 
'''PSX cheats into a shn'''
 
<pre>
<pre>
Only tested in Syphon Filter's emulator
Only tested in Syphon filter's emulator


1. Get an offset [You can get them from Gamehacking.org / Duckstation / Epsxe]
1. Get an offset from Gamehacking.org Example: 0x80060000


2. Remove the first 2 numbers from the offset
2. Remove the first number from the offset 0x0060000


3. Increase the offset by 0xEB2A0 using a hex calculator and add it to your shn
3. Increase the offset by 0xEB2A0 using a hex calculator and add it to your shn 0x14B2A0
</pre>
</pre>


'''For ps4cheater'''
'''For ps4cheater'''
<pre>
<pre>
Only tested in Syphon filter's emulator
Only tested in Syphon filter's emulator


1. Get an offset   [You can get them from Gamehacking.org / Duckstation / Epsxe]
1. Get an offset from Gamehacking.org Example: 0x80060000


2. Remove the first 2 numbers from the offset
2. Remove the first number from the offset 0x0060000


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>
=== PC register script (Syphon Filter) ===
<br>For the usage in PS4cheater.
<br>'''PSX.cht'''
<pre>
1.5|eboot.bin|ID:|VER:|FM:505
simple pointer|pointer|4 bytes|@A3A2B0_2_3A2B0+C4|data|4 bytes|2147848120|0|PC|
</pre>
=== PC register script (Syphon Filter 3) ===
<pre>
1.5|eboot.bin|ID:|VER:01.00|FM:505
simple pointer|pointer|4 bytes|@A51220_2_51220+C4|data|4 bytes|2147752604|0|RA|
simple pointer|pointer|4 bytes|@A51220_2_51220+D4|data|4 bytes|2147825396|0|PC|
</pre>
== TOC file layout ==
For multi bin images, probably requires an emulator from PS Plus.
<br />
Track entry structure:
{| class="wikitable"
|-
! Entry Nº !! Offset !! Length !! Name !! Example !! Notes
|-
| rowspan="10" style="background-color:#DDDDDD;" | 1 || 0x00 || 0x01 (1 byte) || '''TYPE''' || 0x41/0x01 || entry flags
|-
| 0x01 || 0x01 (1 byte) || '''TNO''' || 00 || Track number, usually 00, bcd
|-
| 0x02 || 0x01 (1 byte) || '''POINT''' || 0xA0/0xA1/0xA2/0x01/0x02/0x03/etc || bcd + special case A0-A2.
|-
| 0x03 || 0x01 (1 byte) || '''MIN''' || varies || absolute, bcd
|-
| 0x04 || 0x01 (1 byte) || '''SEC''' || varies || absolute, bcd
|-
| 0x05 || 0x01 (1 byte) || '''FRAME''' || varies || absolute, bcd
|-
| 0x06 || 0x01 (1 byte) || '''ZERO''' || 00  || always zero
|-
| 0x07 || 0x01 (1 byte) || '''PMIN''' || varies || bcd
|-
| 0x08 || 0x01 (1 byte) || '''PSEC''' || varies || bcd
|-
| 0x09 || 0x01 (1 byte) || '''PFRAME''' || varies || bcd
|-
| style="background-color:#DDDDDD;" | Up to 102 || || || || || same structure than the previous entry
|}
POINT indicates successive track numbers, and PMIN, PSEC and PFRAME indicate the starting time of that track.<br>
POINT = A0, PMIN gives the physical track number of the first piece of data (PSEC and PFRAME are zero).<br>
POINT = A1, PMIN indicates the last track on the disc<br>
POINT = A2, the starting point of the lead-out track is given in PMIN, PSEC and PFRAME.<br>
POINT = 01 - 99 Index number within track.<br>
POINT = 00, Pause (2sec?, Also pregap?)


== Folder/File layout ==
== Folder/File layout ==
 
Example: Medievil internal emulator, standalone pkg can differ.  
Example: MediEvil internal emulator. Standalone PKG can differ.  


<pre>
<pre>
├──assets
├──bios
│  ├──common
│  ├── scph5500.bin
│  │  ├──gamespec
  ├── scph5501.bin
│  │  │  └──icon.png
  └── scph5502.bin
│  │  ├──localization
├──config-emu-ps4.txt
│  │  │  ├──ar-AR.json
│  │  │  ├──cs-CZ.json
│  │  │  ├──da-DK.json
│  │  │  ├──de-DE.json
│  │  │  ├──el-GR.json
│  │  │  ├──en-GB.json
│  │  │  ├──en-US.json
│  │  │  ├──es-ES.json
│  │  │  ├──es-MX.json
│  │  │  ├──fi-FI.json
│  │  │  ├──fr-CA.json
│  │  │  ├──fr-FR.json
│  │  │  ├──hu-HU.json
│  │  │  ├──id-ID.json
│  │  │  ├──it-IT.json
│  │  │  ├──ja-JP.json
│  │  │  ├──ko-KR.json
│  │  │  ├──nl-NL.json
│  │  │  ├──no-NO.json
│  │  │  ├──pl-PL.json
│  │  │  ├──pt-BR.json
│  │  │  ├──pt-PT.json
│  │  │  ├──ro-RO.json
│  │  │  ├──ru-RU.json
│  │  │  ├──sv-SE.json
│  │  │  ├──th-TH.json
│  │  │  ├──tr-TR.json
│  │  │  ├──uk-UA.json
│  │  │  ├──vi-VN.json
│  │  │  ├──zh-CHS.json
│  │  │  └──zh-CHT.json
│  │  ├──msdf
│  │  │  └──icon.png
│  │  ├──SFX
│  │  │  ├──Browse.ogg
│  │  │  ├──BROWSE_DOWN.ogg
│  │  │  ├──Browse_UP.ogg
│  │  │  ├──CloseWindow.ogg
│  │  │  ├──CloseWindow2.ogg
│  │  │  ├──OpenWindow.ogg
│  │  │  ├──OpenWindow2.ogg
│  │  │  ├──Slider.ogg
│  │  │  ├──TimelineSlideDown.ogg
│  │  │  └──TimelineSlideUp.ogg
│  │  │
│  │  ├──arrow_left.png
│  │  ├──arrow_right.png
│  │  ├──checkmark.png
│  │  ├──consola.ttf
│  │  ├──DPad-Down.png
│  │  ├──DPad-Left.png
│  │  ├──DPad-Right.png
│  │  ├──DPad-UP.png
│  │  ├──forbidden.png
│  │  ├──fpd.png
│  │  ├──L1.png
│  │  ├──L2.png
│  │  ├──R1.png
│  │  ├──R2.png
│  │  ├──select.png
│  │  ├──start.png
│  │  ├──start_select_controls_embedded_ps4.png
│  │  ├──start_select_controls_embedded_ps5.png
│  │  ├──start_select_controls_ps4.png
│  │  ├──start_select_controls_ps5.png
│  │  ├──Touchpad.png
│  │  ├──Touchpad_left.png
│  │  ├──Touchpad_right.png
│  │  ├──ui_ps_circle.png
│  │  ├──ui_ps_cross.png
│  │  ├──ui_ps_dpad_left.png
│  │  ├──ui_ps_dpad_right.png
│  │  ├──ui_ps_l1.png
│  │  ├──ui_ps_r1.png
│  │  ├──ui_ps_square.png
│  │  ├──ui_ps_touchpad.png
│  │  └──ui_ps_triangle.png
│  │
│  └──PS1HD
│      └──bios
│          ├── SCPH5500.bin
          ├── SCPH5501.bin
          └── SCPH5502.bin
├──conf
│  └── PS1HD
│        ├── dev-pc.conf
│        ├── dev-ps4.conf
│        ├── dev-ps5.conf
│        ├── package-pc.conf
│        ├── package-ps4.conf
│        └── package-ps5.conf
├──data
├──data
│  ├── image.toc
│  └── image.bin
│  └── image.bin
├──global
├──eboot.bin
│  ├──presets
│  │  ├── Default.json
│  │  ├── Modern.json
│  │  ├── RetroClassic.json
│  │  └── RetroModern.json
│  └──scripts
│      └──lua_include
│          ├── disc-selection.lua
│          └── sce-locale.lua
├──sce_module
├──sce_module
│  ├── libc.prx
│  ├── libc.prx
│  ├── libSceAudioLatencyEstimation.prx
│  ├── libSceFace.prx
│  ├── libSceFaceTracker.prx
│  ├── libSceFios2.prx
│  ├── libSceFios2.prx
│  └── libSceNpToolkit2.prx
│  ├── libSceHand.prx
│  ├── libSceHandTracker.prx
│  ├── libSceHeadTracker.prx
│  ├── libSceJobManager.prx
│  ├── libSceNpToolkit2.prx
│  └── libSceS3DConversion.prx
├──sce_sys
├──sce_sys
│  ├── icon0.png
│  ├── pic0.png
│  ├── pic1.png
│  ├── save_data.png
│  └── param.sfo
│  └── param.sfo
├──scripts
├──scripts
│  ├── discswap.lua
│  └── patches.lua
│  ├── speedup.lua
│  ├── trophies.lua
│  ├── patches.lua
│  └── XXXXYYYYY.lua
├──SIEA
│  ├── config-region.txt
│  ├── config-region.json
│  ├── regional_icon.png
│  └── app_boot.lua
├──config-title.txt
├──eboot.bin
├──revision.conf
</pre>
</pre>
 
== Links ==
== Emulator patches ==
 
=== Syphon Filter 3 emu ===
 
Emu build from 2023-Feb-17
 
=== The Legend Of Dragoon emu ===
 
Emu build from 2023-Feb-21
 
==== 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>
''Replaces *and ecx, 7FFh* with *and ecx, 5FFh* to always remove dither enable bit on E1 write.''
 
*Emu memory offset: 0x50EA2
*Elf memory offset: 0x54EA2
 
Original bytes:
81 E1 FF 07 00 00
Replace to:
81 E1 FF 05 00 00
 
== See also ==
 
* 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/
* https://twitter.com/Vitt0x_Lar_YT/status/1284239865027198976
* https://twitter.com/Vitt0x_Lar_YT/status/1284239865027198976
Line 756: Line 420:
* 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
* https://github.com/Goatman13/Cue2toc
* https://forums.pcsx2.net/Thread-PSOne-Dithering-OFF-patches
* https://ps1hd.pages.dev


{{Reverse Engineering}}
{{Reverse Engineering}}
<noinclude>
<noinclude>[[Category:Main]]</noinclude>
[[Category:Main]]
</noinclude>
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)