LUA
— Xenosaga Episode I: Der Wille zur Macht (SLUS-20469)
— Xenosaga Episode II: Jenseits von Gut und Böse (Disc 1)(SLUS-20892)
— Xenosaga Episode II: Jenseits von Gut und Böse (Disc 2)(SLUS-21133)
— Xenosaga Episode III: Also sprach Zarathustra (Disc 1) (SLUS-21389)
— Xenosaga Episode III: Also sprach Zarathustra (Disc 2) (SLUS-21417)
— Widescreen hack by nemesis2000
— shadow fix by mrjaredbeta
— ported as multi-disc pkg to PS4 by Drobovik
— emu used=AOFA
local gpr = require(“ee-gpr-alias”)
apiRequest(1.0)
local eeObj = getEEObject()
local emuObj = getEmuObject()
local gsObj = getGsObject()
emuObj.SetDisplayAspectWide()
local WSpatchXI = function()
— gameplay 16:9 — original value 41445d17
eeObj.WriteMem32(0x204D88CC,0x4182e8ba)
— Disable character shadows to fix graphics errors
eeObj.WriteMem32(0x00244a90,0x03e00008)
— Widescreen FMV 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
local Select = pad_bits & 0x0001
local Start = pad_bits & 0x0008
if (R3 ~= 0 and L3 ~= 0) then
–FMV’s fix vertical- by nemesis2000
eeObj.WriteMem32(0x204A7BF4,0x00006E37)–top 000071f7
eeObj.WriteMem32(0x204A7C14,0x000091B7)–bottom 00008df7
eeObj.WriteMem32(0x204a7bf0,0x00006ff8)
eeObj.WriteMem32(0x204a7c10,0x00008ff8)
end
if (R3 ~= 0 and Select ~= 0) then
–FMV’s fix 4:3 retained- by flameofrecca (causes garbage on sides)
eeObj.WriteMem32(0x204a7bf0,0x000073f8)–left 00006ff8
eeObj.WriteMem32(0x204a7c10,0x00008bf8)–right 00008ff8
eeObj.WriteMem32(0x204A7BF4,0x000071f7)
eeObj.WriteMem32(0x204A7C14,0x00008df7)
end
–Save Point Crash Prevention (author=pandubz, PSI, turtleli) (PCSX2)
–eeObj.WriteMem32(0x00289dac,0x2413001e)
–eeObj.WriteMem32(0x00289db0,0x8f85af40)
–eeObj.WriteMem32(0x00289db4,0x26640000)
–eeObj.WriteMem32(0x00289db8,0x0c093746)
–eeObj.WriteMem32(0x00289dbc,0x00b02821)
–eeObj.WriteMem32(0x00289dc0,0x28421001)
–eeObj.WriteMem32(0x00289dc4,0x1040fffa)
–eeObj.WriteMem32(0x00289dc8,0x2673ffff)
–eeObj.WriteMem32(0x00289dcc,0x00000000)
–Alternative fix Save crash fix (PCSX2)
–Reduces JPEG quality to its minimum for save file thumbnails. This prevents
–the game from calling its own exit function, which was strangely its safety
–mechanism for when a captured thumbnail exceeded 4 KB in size.
–comment=Save Point Crash Prevention
–author=pandubz, PSI, turtleli
–eeObj.WriteMem32(0x20289db0,0x24040000)
emuObj.ThrottleMax()
end
local WSpatchXII = function()
–gameplay widescreen 16:9
eeObj.WriteMem32(0x2069B784,0x4182e8ba) — original value 41445d17
emuObj.ThrottleMax()
end
local WSpatchXIII = function()
–gameplay widescreen 16:9
eeObj.WriteMem32(0x2054FF20,0x3fc1f080) –original value 3f91745d
–cutscenes portrait’s fix
eeObj.WriteMem32(0x00268f40,0x24020078)
eeObj.WriteMem32(0x203e4340,0x00000174)
eeObj.WriteMem32(0x203e4360,0x00000174)
–480p
eeObj.WriteMem32(0x0019adf8,0x24020001)
eeObj.WriteMem32(0x0019adfc,0xa2020081)
–black borders’s fix (optional)
eeObj.WriteMem32(0x00244d90,0x24060000)
eeObj.WriteMem32(0x00244da4,0x24c801c0)
–Disable character shadows to fix graphics errors
eeObj.WriteMem32(0x00290a40,0x8600009c)
eeObj.WriteMem32(0x290a5c,0x8600009c)
— FMV Fix for the first CG lag problem
eeObj.WriteMem32(0x1e7600,0x0)
emuObj.ThrottleMax()
end
local titleid = emuObj.GetDiscTitleId() — returns string as read from iso img SYSTEM.CNF
if titleid == ‘SLUS-20469’ then
if true then
emuObj.AddVsyncHook(WSpatchXI)
end
end
if titleid == ‘SLUS-20892’ or ‘SLUS-21133’ then
if true then
–disable shadows
eeInsnReplace(0x1d82f0,0xae0500c4,0xae0000c4)
emuObj.AddVsyncHook(WSpatchXII)
end
end
if titleid == ‘SLUS-21389’ or ‘SLUS-21417’ then
if true then
–Skip the black and white filter in the animation to fix the CG lag
–eeInsnReplace(0x1e7fc8,0x1220003b,0x1000003b)
emuObj.AddVsyncHook(WSpatchXIII)
end
end