PS4 [Research]PS2 emulator configuration on PS4

I discovered this while tinkering with virtua fighter 2. No difference I could see in that game.

--vu-xgkick-delay=0.58 fixes Def Jam Vendetta's missing character models, and stage assets.

edit* 0.58 appears to stop the random crashing. Still testing, but everything is all good for now

 
Last edited:
"--vif1-instant-xfer" accepts values up to 60000+ in my testing
This is just 0, or non 0. There should be no difference between 1, or 60000.
--vu-xgkick-delay=0.58 fixes Def Jam Vendetta's missing character models, and stage assets.
And that i don't know why even work. You are using float for command that expect integrer. You can't delay something by 0.58 cycle. So it is rounded to 1, or... 0. is ignored, and value 58 is used. In second case using 8 probably will be enough.
 
This is just 0, or non 0. There should be no difference between 1, or 60000.

And that i don't know why even work. You are using float for command that expect integrer. You can't delay something by 0.58 cycle. So it is rounded to 1, or... 0. is ignored, and value 58 is used. In second case using 8 probably will be enough.

In my testing
0.50 broke Def Jam vedetta
0.54 all graphics started working but randomly crash
0.76 goes back to no models, graphics, etc
1,2,-->16 no change. no models, textures, etc
17 crash emu
 
Can you try just 58 then?
Edit: I just want to know that we really can use float value. Because that will be stupid on emu side. :P
 
--vif1-ignore-cmd-ints= accepts decimals too. 0.9 doesn't boot onimusha blade warriors, 1.0 does, 1.1 back to black screen
I'm sure it doesn't accept floats, that way just create undefinied behavior. This work similar to --vif1-instant-xfer
But in --vif1-instant-xfer case default value is enabled, so check in code is 0 or not. In --vif1-ignore-cmd-ints= default value is 0 so compiler made check more complicated, and compare value to 1. Still not sure why it even accept 1.0 as correct value tho.
 
58 boots past PS2 logo. No change in graphics, still broken and crashed the emu the moment I would have taken control in the fight.
0_0 That make no sense. Emulator just can't delay something by 0.58 cycle, cycle counting accurate like that will make it slow af. No idea what's going on, but i'm sure it use 0.58 value as something different.
I will try to dig in emu code later to see how parser read that value. Because this just can't be possible from coding pov.

Edit: It even say in emu code:
--vu-xgkick-delay',0
'vu_cycles/integer`

Integer can't store values that are not whole numbers
 
Last edited:
Fix for Eternal Poison NTSC

cli
Code:
--vu1=jit-sync
--vif1-instant-xfer=0

lua
Code:
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(0)

local patcher = function()

--Widescreen hack 16:9

--X-Fov
--000080bf d7a370bf (1st)
eeObj.WriteMem32(0x00487114,0xbf400000) --bf800000

--Text Box Fix
--00009c43 0000803f 000040c2 00000c43 (1st)
eeObj.WriteMem32(0x00557404,0x43c00000) --439c0000

--0000b042 0080cf43 (1st)
eeObj.WriteMem32(0x005573e0,0x42c00000) --42b00000
eeObj.WriteMem32(0x005573e4,0x00000000) --43cf8000

--Message Indicator Position (Up)
--0000d143 0000803f 00000000
eeObj.WriteMem32(0x0055736c,0x43c80000) --43d10000

--Font fix (Conversation)
--0000803f 0000803f 0000803e 0000803f cccccc3d
eeObj.WriteMem32(0x00557378,0x3f400000) --3f800000) --3f400000 is too narrow in case of Japaness


--********  2D FIX PARTS  ********

--2D Characters (Town & Battle Field)
--43000f3c d80115e6 20008046
eeObj.WriteMem32(0x00132e20,0x0810b346) --3c0f0043

eeObj.WriteMem32(0x0042cd18,0x3c0f0043)
eeObj.WriteMem32(0x0042cd1c,0x3c013faa)
eeObj.WriteMem32(0x0042cd20,0x3421aaab)
eeObj.WriteMem32(0x0042cd24,0x4481f000)
eeObj.WriteMem32(0x0042cd28,0xe61e01d8)
eeObj.WriteMem32(0x0042cd2c,0x0804cb8a)


--Traviata House
--900014e6 940014e6 1400e58d
eeObj.WriteMem32(0x002d9360,0x0810b334) -- 900014e6

eeObj.WriteMem32(0x0042ccd0,0x3c013f40) -- 00000000
eeObj.WriteMem32(0x0042ccd4,0x4481f800) -- 00000000
eeObj.WriteMem32(0x0042ccd8,0xe61f0090) -- 00000000
eeObj.WriteMem32(0x0042ccdc,0x080b64d9) -- 00000000


--The Uzaporium Shop
--900015e6 940015e6 1800a524 (2nd)
eeObj.WriteMem32(0x002ac0ac,0x0810b338) -- 900015e6

eeObj.WriteMem32(0x0042cce0,0x3c013f40) -- 00000000
eeObj.WriteMem32(0x0042cce4,0x4481f800) -- 00000000
eeObj.WriteMem32(0x0042cce8,0xe61f0090) -- 00000000
eeObj.WriteMem32(0x0042ccec,0x080ab02c) -- 00000000


--Twilight's Rest (Potraits)
--940015e6 800000a2 0800b6e5 (1st)
eeObj.WriteMem32(0x00286be0,0x0810b33c) -- 940015e6

eeObj.WriteMem32(0x0042ccf0,0x3c013f40) -- 00000000
eeObj.WriteMem32(0x0042ccf4,0x4481f000) -- 00000000
eeObj.WriteMem32(0x0042ccf8,0xe61e0094) -- 00000000
eeObj.WriteMem32(0x0042ccfc,0x080a1af9) -- 00000000


--2D Characters (Conversation and Twilight's Rest)
--c0ffbd27 1000b0ff 2000b2ff 2800b3ff 2d80a000
eeObj.WriteMem32(0x0023cdd8,0x0810b341) -- c4400008

eeObj.WriteMem32(0x0042cd04,0xc4400008) -- 00000000
eeObj.WriteMem32(0x0042cd08,0x3c013f40) -- 00000000
eeObj.WriteMem32(0x0042cd0c,0x4481f000) -- 00000000
eeObj.WriteMem32(0x0042cd10,0x461e0002) -- 00000000
eeObj.WriteMem32(0x0042cd14,0x0808f377) -- 00000000


--------------------------------------------------------
--Left Characters
--080000c6 080041c4 02000146
--eeObj.WriteMem32(0x002224f4,0x0810b340) -- 080000c6

--eeObj.WriteMem32(0x0042cd00,0xc6000008) -- 00000000
--eeObj.WriteMem32(0x0042cd04,0x3c013f40) -- 00000000
--eeObj.WriteMem32(0x0042cd08,0x4481f000) -- 00000000
--eeObj.WriteMem32(0x0042cd0c,0x461e0002) -- 00000000
--eeObj.WriteMem32(0x0042cd10,0x0808893e) -- 00000000

end
emuObj.AddVsyncHook(patcher)

 
Last edited:
You are genious !

--vu1=jit-sync
--vif1-instant-xfer=0


Fix for SecondSight (SLES-52670) should work with NTSC too.

The game is beautiful ! Thanks a lot.
A large number of commands for text repair are basically universal as long as the code is not involved. This is the experience in repairing PS4 emulation PS2;)
 
this also boot "Speed Kings" PAL & NTSC
But crash when launch a race.
You can try add this as LUA, game is known to require VIF fifo. Original patch by prafull.
SLUS-20584 only.

Code:
apiRequest(1.0)

local emuObj      = getEmuObject()
local eeObj       = getEEObject()
local patcher = function()
eeObj.WriteMem32(0x22b4a4,0x0)
end
emuObj.AddVsyncHook(patcher)

Edit: Txt config you used is still required.
 
Here is some fun for people that like 2D games, but not only. :)
Scanlines enabler config :) Yup you read it right. For now you need to create pkg manually.
Properly named lua config goes as usual to patches folder. shader_SL480_p.sb file need to be in feature_data folder in root of game file structure. You can also put there lua if you prefer that way. Just name it XXXX-YYYYY_features.lua (your game id of course).

q.jpg


Remember to unzip it first. And that's all, we got working scanlines filter ;) Scanlines can be edited like you can see in config. Count/Height/Strength etc.
Big thx to @Stayhye for testing, and his contributions to ps2onps4. :)

Code:
apiRequest(1.6)    -- request version 1.6 API. Calling apiRequest() is mandatory.

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

local goatman = 0
local sprite0 = getSpriteObject(0)
local sprite1 = getSpriteObject(1)

Global_InitGpuResources = function()
    -- # Fragment Shader 0 is fixed as the default no-thrills as-is renderer.
    emuObj.LoadFsShader(2, "./shader_SL480_p.sb")        -- (2) = 480P ScanLine Sim
end

local scanlineParams = {
    240.0,        -- float scanlineCount
    0.7,        -- float scanlineHeight;
    1.5,        -- float scanlineBrightScale;
    0.5,        -- float scanlineAlpha;
    0.5         -- float vignetteStrength;
}

local scanlines_moder = function()
    if goatman == 0 then
        sprite0.BindTexture(0)
        sprite0.SetPosXY((1920-1440)/2,0)
        sprite0.SetSizeXY(1440,1080)
        sprite0.BindFragmentShader(2)
        sprite0.SetShaderParams(scanlineParams)
        sprite0.Enable()
        sprite1.Disable()
        goatman = 1
    end
end

emuObj.AddVsyncHook(scanlines_moder)

Keep in mind that if you want to combine this config with for example wide screen patch, you need to add new lines, not embed it into that one. For example combined config for
Hunter: The Reckoning Wayward [NTSC-U] (SLUS_205.11) will look like this.

Code:
-- Hunter: The Reckoning Wayward [NTSC-U] (SLUS_205.11)
-- Widescreen Hack by El_Patas
apiRequest(1.6)    -- request version 1.6 API. Calling apiRequest() is mandatory.
local eeObj       = getEEObject()
local emuObj    = getEmuObject()
local goatman = 0
local sprite0 = getSpriteObject(0)
local sprite1 = getSpriteObject(1)
Global_InitGpuResources = function()
    -- # Fragment Shader 0 is fixed as the default no-thrills as-is renderer.
    emuObj.LoadFsShader(2, "./shader_SL480_p.sb")        -- (2) = 480P ScanLine Sim
end
local scanlineParams = {
    240.0,        -- float scanlineCount
    0.7,        -- float scanlineHeight;
    1.5,        -- float scanlineBrightScale;
    0.5,        -- float scanlineAlpha;
    0.5         -- float vignetteStrength;
}
local scanlines_moder = function()
    if goatman == 0 then
        sprite0.BindTexture(0)
        sprite0.SetPosXY((1920-1440)/2,0)
        sprite0.SetSizeXY(1440,1080)
        sprite0.BindFragmentShader(2)
        sprite0.SetShaderParams(scanlineParams)
        sprite0.Enable()
        sprite1.Disable()
        goatman = 1
    end
end
emuObj.AddVsyncHook(scanlines_moder)

local widescreen = function()

--Widescreen hack 16:9

eeObj.WriteMem32(0x0023B1F4,0x3C023F23) --X-Fov A
eeObj.WriteMem32(0x0023B1F4,0x3C023F00) --X-Fov B
eeObj.WriteMem32(0x0023B66C,0x3C03BFAB) -- Y-Fov A
eeObj.WriteMem32(0x0023B66C,0x3C03BF80) -- Y-Fov B
end

emuObj.AddVsyncHook(widescreen)
emuObj.PadSetLightBar(0,56,230,201)
emuObj.SetDisplayAspectWide()
 

Attachments

Last edited:
Building off of @kozarovv original script, this one also allows the use of custom bezels/overlays

Code:
apiRequest(1.6)   -- request version 1.6 API. Calling apiRequest() is mandatory.

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

local goatman = 0
local sprite0 = getSpriteObject(0)
local sprite1 = getSpriteObject(1)
local texture1 = getTextureObject(1)
local texture2 = getTextureObject(2)

Global_InitGpuResources = function()
   -- # Fragment Shader 0 is fixed as the default no-thrills as-is renderer.
   emuObj.LoadFsShader(2, "./shader_SL480_p.sb")     -- (2) = 480P ScanLine Sim
 
   texture1.Load("./mksm2-1920.png")
   texture2.Load("./mksm3-1920.png")
end

local scanlineParams = {
   240.0,     -- float scanlineCount
     0.7,     -- float scanlineHeight;
   1.5,  -- float scanlineBrightScale;
   0.5,  -- float scanlineAlpha;
   0.5  -- float vignetteStrength;
}

local scanlines_moder = function()
   if goatman == 0 then
     sprite0.BindTexture(0)
     sprite0.SetPosXY((1920-1440)/2,0)
     sprite0.SetSizeXY(1440,1080)
     sprite0.BindFragmentShader(2)
     sprite0.SetShaderParams(scanlineParams)
     sprite0.Enable()
   
     sprite1.BindTexture(1)
     sprite1.SetPosXY(0,0)
     sprite1.SetSizeXY(1920,1080)
     sprite1.SetPosUV(0,0)
     sprite1.SetSizeUV(1920,1080)
     sprite1.Enable()
     goatman = 1
   end
end

emuObj.AddVsyncHook(scanlines_moder)

just replace
texture1.Load("./mksm2-1920.png")
with your own. Big Thx to @kozarovv for script to build on.

 
Last edited:

Similar threads

Back
Top