PS4 [Research]PS2 emulator configuration on PS4

SLPM_666.28 - OutRun2 SP [Special Tours]
SLUS_212.74 - OutRun 2006 - Coast 2 Coast


Tested the enhanced Japanese version on PS4 Pro (boost mode enabled).
In-Game is near perfect. GO SEGA:ghost:

Wow, very belated thanks for this. I tried the DLPSgame prebuilt version ages ago and wrote off most PS2 emulation on PS4 as terrible, but as it turns out with the Redfaction emu added to PS2-FPKG and those configs, it fixes a lot of issues. Still get the odd hitch or FPS drop - I'm spoilt as I can play it on a CECHA00 PS3 and you can upres it using an OPL build with GSM - but the game is a ton more playable now.
 
hi :)

out of curiosity: how do you people create and debug those lua patches? are they created and tested by running the game in a ps2 emulator on PC since the game is always mapped at the same memory region?

I'd be very grateful for a few hints since i want to tinker around a bit myself
 
hi :)

out of curiosity: how do you people create and debug those lua patches? are they created and tested by running the game in a ps2 emulator on PC since the game is always mapped at the same memory region?

I'd be very grateful for a few hints since i want to tinker around a bit myself
1: The first hex code is the offset, the second is the instruction (4 bytes long). 2: Yes we create and test using PCSX2. Yes the mapping of the instructions is static for 99% of the games.
 
1: The first hex code is the offset, the second is the instruction (4 bytes long). 2: Yes we create and test using PCSX2. Yes the mapping of the instructions is static for 99% of the games.
Thanks! How do people get around the limitation of having no support for write breakpoints in PCSX2? Use static analysis?
 
Fight Night Round 3 (NTSC)

CLI

Code:
--gs-uprender=2x2
--gs-upscale=EdgeSmooth

--host-display-mode=16:9
--cdvd-sector-read-cycles=5000

#emu used=psychonauts v2
LUA
Code:
-- Fight Night Round 3
-- Speed selector by Stayhye
-- emu used=psychonauts v2

local gpr = require("ee-gpr-alias")

apiRequest(0.1)

local eeObj = getEEObject()
local emuObj = getEmuObject()

local patcher = function()

-- speed Selector
local pad_bits    = emuObj.GetPad()

local L1  = pad_bits &  0x0400
local L3  = pad_bits &  0x0002
local R1  = pad_bits &  0x0800
local R3  = pad_bits &  0x0004

if (L1 ~= 0 and R3 ~= 0) then --hyper mode

eeObj.WriteMem32(0x206F3A00,0x41F00000)
end

if (L3 ~= 0 and R1 ~= 0) then --normal mode

eeObj.WriteMem32(0x206F3A00,0x42700000)
end

emuObj.ThrottleMax()
end

emuObj.AddVsyncHook(patcher)

No issues

I can't get the game to boot with Psychonauts v2, it either hangs on the load screen indefinitely or if I remove CLI/LUA options and enable PS2-FPKG speed hacks it just crashes on launch. I'm using SLUS21383.
 
Van Helsing (SLUS20738)

TXT.
Code:
--host-display-mode=16:9
--gs-kernel-cl="h2lpool"
--gs-kernel-cl-up="h2lpool2x2"
--gs-adaptive-frameskip=1
--cdvd-sector-read-cycles=2000

--vu1-mpg-cycles=358
--vu1-di-bits=0
--ee-cycle-scalar=2.8
--iop-cycle-scalar=0.9

--gs-ignore-rect-correction=1

LUA.

Code:
-- Van Helsing (SLUS-20738)
-- Wide screen patch 16:9 by paul_met
-- emu used=jakx v2

apiRequest(2.2)

local gpr            = require("ee-gpr-alias")

local emuObj         = getEmuObject()
local eeObj            = getEEObject()
local gsObj            = getGsObject()
local eeOverlay     = eeObj.getOverlayObject()
local iopObj        = getIOPObject()
    

emuObj.SetDisplayAspectWide()
gsObj.SetDeinterlaceShift(1)

local WS = function()
--16:9
eeObj.WriteMem32(0x002E7FA0,0x3FE38E38)
--Access All Cheats by GameMasterZer0
eeObj.WriteMem32(0x2019FFB0,0x24100001)



emuObj.ThrottleMax()
end

emuObj.AddVsyncHook(WS)

Game still have some stutters in Intro! Very random and rare slowdowns will be noticed, but in general game much playble!

Van Helsing|Crashes FiX|Widescreen|PS2toPS4 Test
 
emumediapatch seems more dificult but has 100% accuracy for patch executable area, add other edits in other area game files etc, here correction for godzilla with undub (japanese audio with multilanguage options) type patch in game code port still i will use clean dumps for keep ok, for people interested can use this code better version that last code (some post back)

Godzilla - Kaijuu Dairantou - Chikyuu Saishuu Kessen (Japan) - (Godzilla saves the earth)

untested, but was debugged with AOFA emu (have some graphoic bugs)

Code:
--gs-uprender=2x2
--gs-upscale=EdgeSmooth
--host-display-mode=16:9
--gs-progressive=1


Code:
--Lua configs by felixthecat1970
--ゴジラ怪獣大乱闘 〜地球最終決戦〜
--Godzilla - Kaijuu Dairantou - Chikyuu Saishuu Kessen (Japan) [SLPM-65805] (Version 1.03) crc=7EB64263
--sha1=5a87459c6770331278c39da09cf5d8793ca3bf99 clean dump hash http://redump.org/disc/47817/
--!!REQUIRED CLEAN DUMP MATCH SHA1 EQUAL OR PATCH WILL NOT WORK!!

apiRequest(2.0)

local emuObj = getEmuObject()

--v2 corrected code structure, code correction, unlock multilanguag, enable native progressive scan, port widescreen video mode 16:9 created by ElHecht \ Arapapa
--Set language change (?) number by desired lang
-- 0 - japanese
-- 1 - english
-- 2 - french
-- 3 - spanish
-- 4 - german
-- 5 - italian
emuObj.SetPs2Lang(1) -- <-edit number to your desired language

--A code block for unlock multilanguage + english audio with multilanguague subtitles
--disable B "emuMediaPatch" 4 lines below with " -- " before use this

--emuMediaPatch(0x,1CD0F9 12 + 0x3E8, { 0xAC850070}, { 0x00000000 })
--emuMediaPatch(0x,1CD28A 12 + 0x2A4, { 0x2C42003B}, { 0x2C42003D })

--B code block for unlock multilanguage + japanese audio (Undub), languages subtitles will not show
--disable A "emuMediaPatch" 2 above lines with " -- " above before use this

emuMediaPatch(0x,1CD289 12 + 0x210, { 0x03E00008}, { 0xAC850080 })
emuMediaPatch(0x,1CD289 12 + 0x218, { 0x00000000}, { 0x03E00008 })
emuMediaPatch(0x,1CD361 12 + 0x15C, { 0x00000000}, { 0x3C1B005E })
emuMediaPatch(0x,1CD361 12 + 0x1E4, { 0x00000000}, { 0x83707350 })

--add native progressive scan mode + widescreen native code ported
emuMediaPatch(0x,1CD260 12 + 0x430, { 0x34038026}, { 0x34030066 })
emuMediaPatch(0x,1CD253 12 + 0x20, { 0x10400005}, { 0x00000000 })
emuMediaPatch(0x,1CD260 12 + 0x568, { 0x24030003}, { 0x24030001 })
emuMediaPatch(0x,1CD260 12 + 0x558, { 0x640D0800}, { 0x00000000 })
emuMediaPatch(0x,1CD25E 12 + 0x424, { 0x24A50001}, { 0x0000282D })
emuMediaPatch(0x,1CD261 12 + 0x68, { 0x24A50023}, { 0x24A50033 })
emuMediaPatch(0x,1CD261 12 + 0x64, { 0x64C900E8}, { 0x64C90140 })
emuMediaPatch(0x,1CD25E 12 + 0x468, { 0x2484FFFF}, { 0x00000000 })
emuMediaPatch(0x,1CD28E 12 + 0x6CC, { 0xE6000124}, { 0x08054684 })
emuMediaPatch(0x,1CD28E 12 + 0x6D0, { 0xE6010128}, { 0x00000000 })
emuMediaPatch(0x,1CD0AA 12 + 0x310, { 0x00000000}, { 0x3C013F40 })
emuMediaPatch(0x,1CD0AA 12 + 0x314, { 0x00000000}, { 0x4481F000 })
emuMediaPatch(0x,1CD0AA 12 + 0x318, { 0x00000000}, { 0x461E0002 })
emuMediaPatch(0x,1CD0AA 12 + 0x31C, { 0x00000000}, { 0xE6000124 })
emuMediaPatch(0x,1CD0AA 12 + 0x320, { 0x00000000}, { 0xE6010128 })
emuMediaPatch(0x,1CD0AA 12 + 0x324, { 0x00000000}, { 0x08090F75 })
 

Attachments

Tested AOFA emu

Ben 10 - Ultimate Alien - Cosmic Destruction (Europe) (En,Fr,De,Es,It) [SLES-55639] (Version 1.01)
Code:
--gs-uprender=2x2
--gs-upscale=EdgeSmooth
--host-display-mode=16:9

Code:
--Lua configs by felixthecat1970
--patch for Ben 10 - Ultimate Alien - Cosmic Destruction (Europe) (En,Fr,De,Es,It) [SLES-55639] (Version 1.01)
--sha1=4300e75fcae16a910a9dcd679b02bb87 -redump verified
--!!REQUIRED CLEAN DUMP MATCH SHA1 EQUAL OR PATCH WILL NOT WORK!!

apiRequest(2.0)

local emuObj = getEmuObject()

--Set language change (*) number by desired lang
-- 1 - english
-- 2 - french
-- 3 - spanish
-- 4 - german
-- 5 - italian
emuObj.SetPs2Lang(1) -- <-Edit number your desired language

--Enable native NTSC60hz mode
--Enable native widescreen video mode 16:9
--Less blur screen for scaling 2x
--ps4 fix for screen test

emuMediaPatch(0x165392, 12 + 0x5D4, { 0x24040001 }, { 0x0000202D })
emuMediaPatch(0x165392, 12 + 0x4D4, { 0x00000000 }, { 0x3C1B43E0 })
emuMediaPatch(0x165392, 12 + 0x4EC, { 0x4600A306 }, { 0x449B6000 })
emuMediaPatch(0x165392, 12 + 0x530, { 0xACC093B8 }, { 0xACC293B8 })
emuMediaPatch(0x1656E2, 12 + 0x2C4, { 0x34078000 }, { 0x0000382D })
emuMediaPatch(0x1656E2, 12 + 0x2FC, { 0x01485025 }, { 0x01405025 })
emuMediaPatch(0x1656E2, 12 + 0x388, { 0xA2040051 }, { 0xA2000051 })
emuMediaPatch(0x1656E2, 12 + 0x5D8, { 0x3404FF80 }, { 0x3404DF80 })
 

Attachments

@felixthecat1970
Thanks for the Ben 10 lua patch. Which part of the code is for 'ps4 fix for screen test'?
Can it be implemented somewhat universally to other games thru memory patching instead of media patch?
 
@felixthecat1970
Thanks for the Ben 10 lua patch. Which part of the code is for 'ps4 fix for screen test'?
Can it be implemented somewhat universally to other games thru memory patching instead of media patch?

this is the line
Code:
emuMediaPatch(0x1656E2, 12 + 0x5D8, { 0x3404FF80 }, { 0x3404DF80 })
in theory you can combine emupatch and memory patches make sure you are using "
local emuObj = getEmuObject()" and sha1 dump match game;.

now using a memory patch type for this kind codes is not 100% secure code will be read (almost codes i do are edited in executable functions need to be readed 1 time in machine code pass) it need to be set before "entry point" execution or will not work; for some reason memory patch in ps4 sometimes are not writed or readed when cpu\machine read instruction = bugs or partial code implementation.

For games screen black bars seems ps4 emus are no parsing corrrectly screen variable type games in ps2 for many (devil may cry 3, dragon ball etc) this games uses a function always match values for PAL but when you use NTSC functions correctly will display ntsc screen values with PAL instructions in PS2, in ps4 will show full vertical extend = black bars, so for this type games need to be adressed NTSC common values individually in functions related to screen size set.
 
Last edited:
@felixthecat1970
I see. Tested the screen fix on PS4 for Ben 10 and seems its not working exactly as intended. Meaning if i just use my tv's scaller custom option without the code the image on the screen gets stretched downward only to fill black bar without affecting other sides like left, right and top, retaining widescreen aspect ratio. But with the PS4 screen fix above it seems the visible image just gets cropped out and then placed on top of the whole screen so the aspect ratio stays skewed. And for some reason previously below black bar "rainbow line" shows at the top instead of bottom now. Still visible basically.
Would it be possible just to stretch the bottom of the visible image down to fill the bar? Are you seeing any aspect ratio issues on your end with the fix and widescreen native on?

PS: I did verify your sha1 checksum against my PAL dump of the game before building the pkg.

Interesting side effect - after starting using native widescreen code the remaining occasional crashes seem to go away on RedFaction emu.:confused3:
 
Last edited:
@felixthecat1970
I see. Tested the screen fix on PS4 for Ben 10 and seems its not working exactly as intended. Meaning if i just use my tv's scaller custom option without the code the image on the screen gets stretched downward only to fill black bar without affecting other sides like left, right and top, retaining widescreen aspect ratio. But with the PS4 screen fix above it seems the visible image just gets cropped out and then placed on top of the whole screen so the aspect ratio stays skewed. And for some reason previously below black bar "rainbow line" shows at the top instead of bottom now. Still visible basically.
Would it be possible just to stretch the bottom of the visible image down to fill the bar? Are you seeing any aspect ratio issues on your end with the fix and widescreen native on?

PS: I did verify your sha1 checksum against my PAL dump of the game before building the pkg.

Interesting side effect - after starting using native widescreen code the remaining occasional crashes seem to go away on RedFaction emu.:confused3:
i test with aofa emu ps4 fix already fill vertical screen max to bottom using full code with widescreen and NTSC, thinking if you uses only pal mode (only code stretch screen) will not work (instructions are not called in PAL only mode) also using
--host-display-mode=16:9 in patches > xxxx.cli or config-emu-ps4.txt,
now if you want to fine tunning vertical stretch edit last 2 bytes value in code "
{ 0x3404 DF80 }) >> DF (FF=max) DF=448 NTSC mips cal match, A,B,C,E - 0-9 in hex
 
Okay I'm using the SLUS-20946 version of San Andreas, v1.03 to try and create a decent PS2toPS4 version of the game with the full soundtrack.

I'm using almost all of the fixes listed here on an informative GBAtemp post, with the exception of the No Motion Blur Alpha speed hack which causes the game to crash when launched, no matter what.

This allows a nice widescreen presentation of the game minus the heat haze effect etc, looks decent but still true to the PS2 original.

The problem I'm having is, getting it to run smoothly even with a patched ISO. If I use the "GTA SA" emu wrapper, just about the only Rockstar game wrapper that'll work as most crash, it'll work and play with no graphical glitches, however there are constant audio dropouts during missions which is really distracting.

I've tried compiling with literally dozens of other emus, but they either freeze/crash on launch including ones for other GTA titles or in the case of some of the Jak builds like "Jak X v2" and others like "MAX PAYNE" the game will boot, however there are some pretty nasty graphical glitches underneath bridges and around grassy areas.

Any suggestions?
 
Okay I'm using the SLUS-20946 version of San Andreas, v1.03 to try and create a decent PS2toPS4 version of the game with the full soundtrack.

I'm using almost all of the fixes listed here on an informative GBAtemp post, with the exception of the No Motion Blur Alpha speed hack which causes the game to crash when launched, no matter what.

This allows a nice widescreen presentation of the game minus the heat haze effect etc, looks decent but still true to the PS2 original.

The problem I'm having is, getting it to run smoothly even with a patched ISO. If I use the "GTA SA" emu wrapper, just about the only Rockstar game wrapper that'll work as most crash, it'll work and play with no graphical glitches, however there are constant audio dropouts during missions which is really distracting.

I've tried compiling with literally dozens of other emus, but they either freeze/crash on launch including ones for other GTA titles or in the case of some of the Jak builds like "Jak X v2" and others like "MAX PAYNE" the game will boot, however there are some pretty nasty graphical glitches underneath bridges and around grassy areas.

Any suggestions?

When i test GTA Anime Mod (Mod for gta sa) i use red faction emu! It was fixed random freeze for sure! You can try it!
 
Capcom vs. SNK 2 JAPAN \ USA versions

Emu tested KOF98 \ JAKV1
CLI file
Code:
--gs-upscale=smooth
--gs-uprender=2x2

JAPAN version
Code:
--Lua configs by felixthecat1970
--Capcom vs. SNK 2 - Millionaire Fighting 2001 (Japan) [SLPM-74246] (Version 1.03). SLPM-65047 crc=B54C0319
--sha1=0a0cc8964c4ad776da092126b3158e0f7bfab9bf  game should mach or will not work

apiRequest(2.0)
local emuObj = getEmuObject()

emuObj.SetGsTitleFix( "forcePoint", "reserved", {mipIsGt=0, mmin=0} )

--Enable full frame mode
--Unlock extra characters

emuMediaPatch(0x19C, 12 + 0x6C4, { 0xAC202990 }, { 0x24020002 })
emuMediaPatch(0x19C, 12 + 0x6C8, { 0x24020004 }, { 0xAC222990 })
emuMediaPatch(0x19C, 12 + 0x6D8, { 0xAC2229AC }, { 0xAC2029AC })
emuMediaPatch(0x71D, 12 + 0x444, { 0x00009FFF }, { 0x0000FFFF })
emuMediaPatch(0x66F, 12 + 0x710, { 0x02010202 }, { 0x02010206 })

USA version
Code:
--Lua configs by felixthecat1970
--Capcom vs. SNK 2 - Mark of the Millennium 2001 (USA) [SLUS-20246] (Version 1.01).
--sha1=13d4df923e9e741f481d72199ca1713efe8a3f60   game should mach or will not work

apiRequest(2.0)
local emuObj = getEmuObject()

emuObj.SetGsTitleFix( "forcePoint", "reserved", {mipIsGt=0, mmin=0} )

--Enable full frame mode
--Unlock extra characters

emuMediaPatch(0x1A0, 12 + 0x634, { 0xAC20EDD0 }, { 0x24020002 })
emuMediaPatch(0x1A0, 12 + 0x638, { 0x24020004 }, { 0xAC22EDD0 })
emuMediaPatch(0x1A0, 12 + 0x648, { 0xAC22EDEC }, { 0xAC20EDEC })
emuMediaPatch(0x71A, 12 + 0x8C, { 0x00009FFF }, { 0x0000FFFF })
emuMediaPatch(0x66B, 12 + 0x630, { 0x02010202 }, { 0x02010206 })
Test video
 
When i test GTA Anime Mod (Mod for gta sa) i use red faction emu! It was fixed random freeze for sure! You can try it!

Thanks for the tip! I mean it does boot with REDFACTION1 emu and work but it's a bit stuttery still. I found out the fur shaded grass actually wasn't disabled on my Jak based builds, so recompiling with it gone actually removed the graphical corruption, as for whatever reason those versions of the PS2emu can't render it properly. Still looks better than the Definitive Edition when the widescreen/HUD/motion blur hacks are used and you get the full original soundtrack and UI (properly aspect ratio corrected) so it's a nice compromise. Jak emu means no stutters I can see during early missions.
 
Thanks for the tip! I mean it does boot with REDFACTION1 emu and work but it's a bit stuttery still. I found out the fur shaded grass actually wasn't disabled on my Jak based builds, so recompiling with it gone actually removed the graphical corruption, as for whatever reason those versions of the PS2emu can't render it properly. Still looks better than the Definitive Edition when the widescreen/HUD/motion blur hacks are used and you get the full original soundtrack and UI (properly aspect ratio corrected) so it's a nice compromise. Jak emu means no stutters I can see during early missions.

GTA San Andreas (Winter Mod). Short GamePlay! (Red Faction emu)
VIDEO

Grand Theft Auto San Andreas. Short GamePlay! (PAL) (gta sa emu)
VIDEO

You didnt try gta sa emu? works good in my tests! Also you mean you test om Jak v.2 emu? You can share config and i can test it too if u want!
 
You didnt try gta sa emu? works good in my tests!

The problem I'm having is, getting it to run smoothly even with a patched ISO. If I use the "GTA SA" emu wrapper, just about the only Rockstar game wrapper that'll work as most crash, it'll work and play with no graphical glitches, however there are constant audio dropouts during missions which is really distracting.

---

Also you mean you test om Jak v.2 emu? You can share config and i can test it too if u want!

Well it'll boot on all the Jak builds but the current one I'm having best results with (fur shading disabled) is Jak X v2.
 
Anyone has a working config for Gran Turismo 4 PAL? (SCES 51719)
To me seems not playable.
I'm using PS2-FPGK with 2x2, edgesmooth and 16:9, siren v2 emu and only this config enabled:
TXT:
Code:
--gs-use-deferred-l2h=1

--vif1-instant-xfer=1

--gs-use-mipmap=0
--gs-use-clut-merge=1
--gs-kernel-cl="clutmerge"
--gs-kernel-cl-up="clutmerge2x2"

#Fix incomplete letters in menu
--vu0-no-clamping=0
--vu0-clamp-operands=1
--vu0-clamp-results=1
--vu1-no-clamping=0
--vu1-clamp-operands=1
--vu1-clamp-results=1

--ee-cycle-scalar=1.50

#Fix video anticipated race license
--fpu-accurate-muldiv-range=0x00579EB8,0x00579EB8
--fpu-accurate-muldiv-range=0x00579EDC,0x00579EDC
--fpu-accurate-muldiv-range=0x0057A008,0x0057A008
--fpu-accurate-muldiv-range=0x0057A030,0x0057A030

--detect-idle-vif=1

LUA:
Code:
--gametitle=Gran Turismo 4 [SCES-51719] (E)
--emu=siren v2

apiRequest(0.1)

local eeObj     = getEEObject()
local emuObj = getEmuObject()
local gsObj     = getGsObject()

local widescreen = function()

-- force progressive scan
eeObj.WriteMem32(0x20A57E70,0x00000001)
eeObj.WriteMem32(0x201074A0,0x24050003) --8E050004
eeObj.WriteMem32(0x2061868C,0x00000001) --00000000
eeObj.WriteMem32(0x20618694,0x00000000) --00000001

-- Autoboot in 480p
eeObj.WriteMem32(0x20436820,0xAE0516B0) --AE0010E8
eeObj.WriteMem16(0x20436910,0x10E8) --

--Field of View

-- Screen Width   (mm)
--eeObj.WriteMem32(0x20A567F0,0x446E0000) -- 952mm in my case

-- Screen Height (mm)
--eeObj.WriteMem32(0x20A567F4,0x4405C000) -- 535mm in my case

-- Eye Distance to Screen (mm)
--eeObj.WriteMem32(0x20A567EC,0x44610000) -- 900mm in my case

-- Zoom Level (-2.0 to 2.0)
--eeObj.WriteMem32(0x20A567E8,0x3f800000) -- 1.0, we already have the right FoV Better don't touch this


--Aspect Ratio

--   Single Screen Aspect Ratios
--    1 x 16:9  3f800000
--    1 x 21:9  3FAAAAAB
--    1 x 32:9  40000000

--   Triple Screen Aspect Ratios
--    3 x 16:9  40400000

eeObj.WriteMem32(0x20A567F8,0x3f800000) -- 16:9 in my case

-- disable colour correction channel shuffle effect
eeObj.WriteMem32(0x0033F8B8,0x1000000B) --5440000B

-- disable rendering of light sources
eeObj.WriteMem32(0x0033F6B0,0x10000031) --10400031

-- Fix shadows
eeObj.WriteMem32(0x001D6598,0x00000000) --0C075A6A

-- Added GT4 First Preview camera mode (far chase camera)
eeObj.WriteMem32(0x2037AFAC,0x84E30000)
eeObj.WriteMem16(0x2037AFB0,0x0002)
eeObj.WriteMem16(0x2037AFC0,0x0004)
eeObj.WriteMem32(0x2037AFD0,0x84E30000)

eeObj.WriteMem16(0x2037AFE0,0x0004)
eeObj.WriteMem8(0x0037AFF8,0x40)
eeObj.WriteMem16(0x2037B00A,0x8442)

eeObj.WriteMem32(0x206211E8,0x00010000)
eeObj.WriteMem32(0x206211EC,0x00060014)

end

emuObj.AddVsyncHook(widescreen)

The game works VERY WELL for the first couple of minutes, after it glitches in game and in menu:

Q07As4S.jpeg


dTu8XUj.jpeg


gJB9KVK.jpeg


4dNqEXf.jpeg



It happens in the majority of the circuit and driver licenses...
I also tried to disable all the graphic options and some txt&lua but it ends always the same
 

Similar threads

Back
Top