Editing Official Configuration Files

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:
These are configuration files extracted from official PS2 game packages. Most of them require emulator/recompiler files from their extracted pkgs to function optimally.
Here are configuration files extracted from official packages to improve PS2 emulator compatibility on PS4. Most of them also require emulator/recompiler files from extracted pkg to work correctly.


{{ambox
{{ambox
Line 17: Line 17:
--force-frame-blend=1
--force-frame-blend=1
</pre>
</pre>
====Ape Escape 2====
<br>SCES-50885
<br>CLI
<pre>
--gs-use-mipmap=1
--gs-kernel-cl="mipmap"
--gs-kernel-cl-up="mipmap2x2"
--gs-scanout-offsetx=27
--vu1-injection=1
--gs-packed15-fmv-opt=1
--gs-skip-dirty-flush-on-mipmap=1
--cop2-accurate-addsub-range=0x3151e8,0x315414
</pre>
<br>SCES-50885
<br>LUA
<pre>
local gpr = require("ee-gpr-alias")
require( "ee-hwaddr" )
apiRequest(0.1) -- request version 0.1 API. Calling apiRequest() is mandatory.
local eeObj = getEEObject()
-- -- never gonna die
-- eeInsnReplace(  0x2bd0a0, 0x27bdfff0, 0x03e00008) --  addiu sp,sp,-16
-- eeInsnReplace(  0x2bd0a4, 0x3c02003e, 0x00000000) --  lui v0,0x3e
-- performance fix bug #9789
local emuObj = getEmuObject()
emuObj.SetGsTitleFix( "ignoreAreaUpdate", 0, { } )
emuObj.SetGsTitleFix( "includeAreaUpdate", "reserved" , {alpha = 0x80000048 } )
emuObj.SetGsTitleFix( "ignoreUpRender", 50 , { } )
</pre>


====Arc the Lad: Twilight of the Spirits™====
====Arc the Lad: Twilight of the Spirits™====
Line 1,421: Line 1,382:
</pre>
</pre>


====Jak X====
====Kinetica====
'''CLI'''
'''CLI'''
<br>SCUS-97429
<br>SCUS-97132
<pre>
<pre>
--ee-jit-pagefault-threshold=30
--vu1-clamp-range=0x386,0x386
--gs-frontend-opt-mode=1
--vu1-clamp-range=0x5e0,0x5f0 # another gritches
--gs-use-mipmap=1
--gs-kernel-cl-up="up2x2skipinterp"
--gs-kernel-cl="mipmap"
--vu1-injection=1
--gs-kernel-cl-up="mipmap2x2"
--vu1-jr-cache-policy=sameprog
--cop2-no-clamping=1
--vu1-mpg-cycles=250
</pre>
 
'''LUA'''
<br>SCUS-97429
<pre>
-- Jak X Combat Racing  [US]
 
apiRequest(2.2)
 
local gpr = require("ee-gpr-alias")
local eeObj = getEEObject()
local emuObj = getEmuObject()
local gsObj = getGsObject()
local eeOverlay = eeObj.getOverlayObject()
 
 
-- Bug 10697
emuObj.SetGsTitleFix( "ignoreSubBuffCov", "reserved", { texMode=2 , tw=6 , th=5} )
 
-- Fix shadow
emuObj.SetGsTitleFix( "forceSimpleFetch", "reserved", { texMode=1  } )
 
-- Reduce flush count
emuObj.SetGsTitleFix( "SetSelfRender", "reserved", { fbmask= 0x00FFFFFF , renderSelf=1 , zmsk=1 , alpha=0 , texMode=1  } )
 
-- ------------------------- OVERLAY MANAGER --------------------------
g_OnOverlayRegistered = function(filename, start, size)
-- global function provided for adding per-overlay callback handlers.
-- See code for bug#10141 below, as example of this usage.
end
 
-- -- this hooks at the moment of loading the relocatable code and patch it only on the target segment.
eeObj.AddHook(0x0026ff90, 0x03207825, function()
local s1 = eeObj.GetGpr    (gpr.s1)
local filename = eeObj.ReadMemStr(s1 + 17)
local segment = eeObj.ReadMem32 (s1 + 8)
local main = eeObj.ReadMem32 (segment + 4)
local mainSize = eeObj.ReadMem32 (segment + 8)
local top = eeObj.ReadMem32 (segment + 36)
local topSize = eeObj.ReadMem32 (segment + 40)
 
if emuObj.IsToolingVerbose() then
print(string.format("LOAD SEGMENT \"%s\" MAIN %08x size %x TOP %08x size %x",
filename, main, mainSize, top, topSize))
end
eeOverlay.Register(filename .. ".main", main, mainSize, false)
eeOverlay.Register(filename .. ".top",  top,  topSize,  true )
 
if (g_OnOverlayRegistered ~= nil) then
-- Make sure to execute any previously registered OnOverlay handler
g_OnOverlayRegistered(filename .. ".main", main, mainSize)
g_OnOverlayRegistered(filename .. ".top",  top,  topSize )
end
end)
 
 
-- ---------------------------------------------------------------------------------
-- This code serves as both a working patch for Jak X and as a sample for implementing
-- overlay-relative code patches in trophy or feature lua scripts.  The process described:
--
-- 1. store local copy of current global variable instance.  if g_OnOverlayRegistered is
--    nil then we have a problem.  The universal overlay hook is missing for some reason.
--
-- 2. Bind our own function to g_OnOverlayRegistered.  Since it's a global, the hook code
--    in config.lua will execute our handler when the hook is invoked.
 
assert(g_OnOverlayRegistered ~= nil)
local prev_OnOverlayRegistered = g_OnOverlayRegistered
 
g_OnOverlayRegistered = function(filename, start, size)
if (prev_OnOverlayRegistered ~= nil) then
-- Make sure to execute any previously registered OnOverlay handler
prev_OnOverlayRegistered(filename, start, size)
end
 
-- bug#10141  workaround
-- the problem is actually on a block 0x013090bc - 0x01309188.
-- the block is expected to loop 8 times (s4 is the loop counter),
-- the game falls into freezing state once it reaches at 0x01309170.
-- it seems it's OK just to avoid to go into this 'freeze' state, eliminated the branch.
 
-- this doesn't take into account relocatable code.
-- eeInsnReplace(0x01309174, 0x1000012f, 0) -- beq    $zero,$zero,0x01309634   
 
-- 01309c64 : (1000012f) beq    $zero,$zero,0x0130a124    => nop
if filename == "lobby-menu-manager.main" then
local adr    = start + 0x1224
assert (eeObj.ReadMem32(adr) == 0x1000012f)
eeObj.WriteMem32(adr, 0)
end
-- bug#10720 - title has a bugged RNG which does an SQRT of the current seed and xor the
-- result back into the seed.  This breaks the prime factorial pattern of the RNG and causes
-- it to fall into a repeating loop with disturbing regularity.  NOP'ing out the sqrt/xor
-- hack seems to fix the title. --jstine
if filename == "math.main" then
assert(eeObj.ReadMem32(start + 0x0005e4) == 0x4be1043d) -- vrget.wxyz  vf01,r
assert(eeObj.ReadMem32(start + 0x0005e8) == 0x4a0103bd) -- vsqrt        q,vf01x
assert(eeObj.ReadMem32(start + 0x0005ec) == 0x4b0000a0) -- vaddq.x      vf02,vf00,q
assert(eeObj.ReadMem32(start + 0x0005f0) == 0x4a00143f) -- vrxor        r,vf02x
eeObj.WriteMem32(start + 0x0005e4, 0x00000000)
eeObj.WriteMem32(start + 0x0005e8, 0x00000000)
eeObj.WriteMem32(start + 0x0005ec, 0x00000000)
eeObj.WriteMem32(start + 0x0005f0, 0x00000000)
end
-- this RNG-sqrt instance is removed more for performance than for RNG corruption.  the particle
-- launcher iterates over the sqrt quite often.  In any case, not corrupting the RNG seed with
-- bad sqrt math is always a good thing in my book --jstine
 
if filename == "sparticle-launcher.main" then
assert(eeObj.ReadMem32(start + 0x00630c) == 0x4be1043d) -- vrget.wxyz  vf01,r
assert(eeObj.ReadMem32(start + 0x006310) == 0x4a0103bd) -- vsqrt        q,vf01x
assert(eeObj.ReadMem32(start + 0x006318) == 0x4b0000a0) -- vaddq.x      vf02,vf00,q
assert(eeObj.ReadMem32(start + 0x006370) == 0x4a00143f) -- vrxor        r,vf02x
assert(eeObj.ReadMem32(start + 0x0063fc) == 0x4a00143f) -- vrxor        r,vf02x
assert(eeObj.ReadMem32(start + 0x006484) == 0x4a00143f) -- vrxor        r,vf02x
assert(eeObj.ReadMem32(start + 0x00651c) == 0x4a00143f) -- vrxor        r,vf02x
 
eeObj.WriteMem32(start + 0x00630c, 0x00000000)
eeObj.WriteMem32(start + 0x006310, 0x00000000)
eeObj.WriteMem32(start + 0x006318, 0x00000000)
eeObj.WriteMem32(start + 0x006370, 0x00000000)
eeObj.WriteMem32(start + 0x0063fc, 0x00000000)
eeObj.WriteMem32(start + 0x006484, 0x00000000)
eeObj.WriteMem32(start + 0x00651c, 0x00000000)
end
end
-- ---------------------------------------------------------------------------------
 
</pre>
 
====Kinetica====
'''CLI'''
<br>SCUS-97132
<pre>
--vu1-clamp-range=0x386,0x386
--vu1-clamp-range=0x5e0,0x5f0 # another gritches
--gs-kernel-cl-up="up2x2skipinterp"
--vu1-injection=1
--vu1-jr-cache-policy=sameprog
--vu1-jalr-cache-policy=sameprog
--vu1-jalr-cache-policy=sameprog
--vu1-mpg-cycles=900
--vu1-mpg-cycles=900
Line 2,768: Line 2,584:
--gs-h2l-accurate-hash=1
--gs-h2l-accurate-hash=1
#fix for substantial slowdown during combat.</pre>
#fix for substantial slowdown during combat.</pre>
====Star Ocean 3====
<br>SLES-82028
<br>CLI
<pre>
--vu-hack-triace=1
--assert-path1-ad=0
--gs-kernel-cl-up="OptRightTri"
--ee-cycle-scalar=1.0
--ee-sif0-cycle-scalar=0.1
--ee-sif1-cycle-scalar=2.0
--iop-sif0-cycle-scalar=0.1
--iop-sif1-cycle-scalar=2.0
--ee-hook=0x0011DF00,FastForwardClock,0x8C82000C
--vu1-injection=1
--vu1-mpg-cycles=1
--ee-injection-title=1
--ee-hook=0x109bc4,SO3_AudioRequest,0x3c011001
--ee-hook=0x109c04,SO3_AudioRequest,0x3c011001
--ee-hook=0x1097a0,SO3_AudioWriteBack,0x27bdffe0
--host-audio-latency=0.060
--cop2-accurate-mul-range=0x004cce00,0x004ccf00
</pre>
<br>SLES-82028
<br>LUA
<pre>
-- star_ocean sles82028
local gpr = require("ee-gpr-alias")
apiRequest(0.1) -- request version 0.1 API. Calling apiRequest() is mandatory.
local emuObj = getEmuObject()
local eeObj = getEEObject()
-- Ignore up-render shift for triangles when writing mask = write alpha only . Will fix shadows (bug# 6724).
emuObj.SetGsTitleFix( "ignoreUpShiftTri", "reserved" , { fbmask = 0x00FFFFFF  } )
--  Performance  fix ( bug# 9474 )
if 0 then -- emuObj.IsNeoMode() then -- neo mode check disabled, due to bug #10442
emuObj.SetGsTitleFix( "globalSet",  "reserved", { workLoadThreshold = 125000} )
else
emuObj.SetGsTitleFix( "globalSet",  "reserved", { workLoadThreshold = 100000} )
end
local reduceShadowsToOne = function()
    eeObj.SetGPR(gpr.a3 ,1)
end
if 1 then  -- not emuObj.IsNeoMode() then -- neo mode check disabled, due to bug #10443
-- enable this hook only in base mode.
-- NEO mode hardware has enough horsepower to render extra shadows. (correction: it doesn't, bug 10443)
eeObj.AddHook(0x0042d1e0, 0x24c60001, reduceShadowsToOne)
end
-- NOP out some meaningless (M) bits.
-- SO3 uses these as a performance optimization to allow writing next data set regs in parallel
-- to mpg calculating results of current set.  In our emu it's sync always, so just interlock is ok.
vuInsnReplace(0, 0x004, (0x21f809bc<<32) | 0x8000033c, (0x01f809bc<<32) | 0x8000033c) -- MULAbc.xyzw Acc, vf01, vf24.x (M)
vuInsnReplace(0, 0x016, (0x21f859bc<<32) | 0x8000033c, (0x01f859bc<<32) | 0x8000033c) -- MULAbc.xyzw Acc, vf11, vf24.x (M)
vuInsnReplace(0, 0x034, (0x21f880bd<<32) | 0x8000033c, (0x01f880bd<<32) | 0x8000033c) -- MADDAbc.xyzw Acc, Acc, vf16, vf24.y (M)
vuInsnReplace(0, 0x05b, (0x21f81e4a<<32) | 0x8000033c, (0x01f81e4a<<32) | 0x8000033c) -- MADDbc.xyzw vf25, Acc, vf03, vf24.z (M)
vuInsnReplace(0, 0x06c, (0x210001c3<<32) | 0x8000033c, (0x010001c3<<32) | 0x8000033c) -- ADDbc.x vf07, vf00, vf00.w (M)
vuInsnReplace(0, 0x15d, (0x21e141bc<<32) | 0x8000033c, (0x01e141bc<<32) | 0x8000033c) -- MULAbc.xyzw Acc, vf08, vf01.x
-- remove DMA Ch1 kick for audio-vu1.
-- using Native EE processing code.
-- See. SLES82028_cli.conf and eJitExec_NativeHooks.cpp.
eeInsnReplace(0x00109bd4, 0xac239000, 0) -- sw      $v1,-0x7000 (0xffff9000)($at)
eeInsnReplace(0x00109c08, 0xac239000, 0) -- sw      $v1,-0x7000 (0xffff9000)($at)
--Title must always run 50 hz (PAL) even when PRogressive Mode has been enabled.
-- (progressive mode is made possible via ISD LUA patch, it was originally removed from the PAL region
--  release of SO3)
emuObj.ForceRefreshRate(50)
</pre>


====Star Wars Bounty Hunter====
====Star Wars Bounty Hunter====
Line 3,345: Line 3,085:




{{Reverse Engineering}}<noinclude>
{{Reverse Engineering}}<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)