-- Disney Princess - Enchanted Journey (U)(SLUS-21660)
-- Widescreen Hack by Arapapa & PeterDelta
-- emu used=RedFaction (fixes in-game crashes)
local gpr = require("ee-gpr-alias")
apiRequest(1.0)
local eeObj = getEEObject()
local emuObj = getEmuObject()
local gsObj = getGsObject()
local patcher = function()
--Widescreen hack 16:9 Selector
local pad_bits = emuObj.GetPad()
local L1 = pad_bits & 0x0400
local L2 = pad_bits & 0x0100
local L3 = pad_bits & 0x0002
local R1 = pad_bits & 0x0800
local R2 = pad_bits & 0x0200
local R3 = pad_bits & 0x0004
local Select = pad_bits & 0x0001
local Start = pad_bits & 0x0008
if (R3 ~= 0 and L3 ~= 0) then
--Renders the game in 16x9 aspect ratio
eeObj.WriteMem32(0x002652D0, 0x3C01C4AB)--3C01C480
eeObj.WriteMem32(0x002651F0, 0x3C013FA4)--3C013F80 zoom
eeObj.WriteMem32(0x003f2490, 0x40000000)--3eaaaaab Render fix
eeObj.WriteMem32(0x00188978, 0x00000000)--44810000 Black Bar fix
--local code_check = eeObj.ReadMem16(0x9413CC)--fix for accessories closet character position(Not working on PS4 for some reason?)
--if code_check == 0x007b then
--eeObj.WriteMem32(0x002652D0, 0x3C01C480)
--eeObj.WriteMem32(0x002651F0, 0x3C013F80)
--end
emuObj.SetDisplayAspectWide()
end
if (R2 ~= 0 and L2 ~= 0) then
--Switch to 4x3 aspect ratio (Necessary for temp fix of fireplace and gold glitter post-processing effects)
eeObj.WriteMem32(0x002652D0, 0x3C01C480)--3C01C480
eeObj.WriteMem32(0x002651F0, 0x3C013F80)--3C013F80 zoom
eeObj.WriteMem32(0x003f2490, 0x3eaaaaab)--3eaaaaab Render fix
eeObj.WriteMem32(0x00188978, 0x44810000)--44810000 Black Bar fix
emuObj.SetDisplayAspectNormal()
end
emuObj.ThrottleMax()
end
emuObj.AddVsyncHook(patcher)
-- Thin vertical lines in cutscenes Fix
emuObj.SetGsTitleFix( "forceSimpleFetch", "reserved", {psm=0} )
emuObj.SetGsTitleFix( "fetchFromCurrBuff", "reserved", {psm=0} )