Editing PS2 Classics Configuration Files (Official)
Jump to navigation
Jump to search
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 4: | Line 4: | ||
| type = style | | type = style | ||
| text = To Do: | | text = To Do: | ||
There should be something between 50 and 60 <nowiki>{{official}}</nowiki> <span class="plainlinks">[ | There should be something between 50 and 60 <nowiki>{{official}}</nowiki> <span class="plainlinks">[{{ps3wikiurl}}User_talk:Roxanne#Notebook "PS2 Classics"]</span> {{InvertibleImage|Icon_ps3.png|24px|This Article leads towards PS3 Developer Wiki}} released by Sony.<br>Are there duplicates used for several releases or why we list only 41 here? | ||
Please take a look. Thank you. | Please take a look. Thank you. | ||
}} | }} | ||
Line 10: | Line 10: | ||
====ADK Damashii==== | ====ADK Damashii==== | ||
<br> | '''CLI''' | ||
<br>SLPS-25906 | |||
<pre> | <pre> | ||
--gs-uprender=none | --gs-uprender=none | ||
Line 16: | 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 | <br>LUA | ||
<pre> | <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 | |||
local | -- 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™==== | |||
SCUS 972.31 | |||
<br>Cli | |||
------------ | <pre> | ||
--gs-force-bilinear=1 | |||
--gs-kernel-cl-up="up2x2Simple" | |||
--lopnor-config=1 | |||
</pre> | |||
SCUS 972.31 | |||
<br>lua | |||
<pre> | |||
require("ee-gpr-alias") | |||
apiRequest(0.1) -- request version 0.1 API. Calling apiRequest() is mandatory. | |||
eeObj = getEEObject() | |||
if | -- Bug#8359 (see bugzilla for the detail) | ||
-- Skip FadeSet call if map is 'Scrappe Plateau' and the latest loaded script file is 'evt03B_07_0.moc'. | |||
-- This game seems to have a problem (sensitive) with frame count on the script engine. | |||
-- On our emulator, frame counting is slightly different from the original. | |||
-- therefore it reads out 'overun' script command, which is 'cmd_fade' to fade-in. | |||
-- At here, we will skip FADE-IN command if the situation meets the requirement. | |||
skip_fade_flag = { map_name = false, file_name = false } | |||
-- fade skip Bug#8359. skip FadeSet if skip_fade_flag meets the requirement. | |||
eeObj.AddHook( 0x13c464, 0x8e0500c0, function() | |||
-- print(skip_fade_flag.map_name) | |||
-- print(skip_fade_flag.file_name) | |||
if skip_fade_flag.map_name and skip_fade_flag.file_name then | |||
-- print("SKIP FADE") | |||
eeObj.SetPc(0x13c470) | |||
skip_fade_flag.map_name = false | |||
skip_fade_flag.file_name = false | |||
end | |||
end) | |||
-- | -- cmd_read_file(const char* filename) | ||
eeObj.AddHook(0x13dad0, 0x27bdffc0, function() | |||
local | local filename = eeObj.ReadMemStr(eeObj.GetGpr(gpr.a0)) | ||
-- print(string.format("cmd_read_file %s", filename)) | |||
if "chara/evt_camera/evt03B_07_0.moc" == filename then | |||
-- print("skip_fade!") | |||
skip_fade_flag.file_name = true | |||
else | |||
skip_fade_flag.file_name = false | |||
end | |||
end) | |||
-- | -- cmd_map_name(const char* mapname) | ||
eeObj.AddHook(0x13f138, 0x0080282d, function() | |||
local mapname = eeObj.ReadMemStr(eeObj.GetGpr(gpr.a0)) | |||
local | -- print(string.format("cmd_map_name %s", mapname)) | ||
if "Scrappe Plateau" == mapname then | |||
-- print("skip_fade!") | |||
skip_fade_flag.map_name = true | |||
else | |||
skip_fade_flag.map_name = false | |||
end | |||
end) | |||
</pre> | |||
====Canis Canem Edit (Bully)==== | |||
<br>CLI | |||
<pre>--fpu-accurate-mul-fast=1 | |||
--fpu-muldiv-range=0x3fa5c0,0x3fa5c0 | |||
--gs-flush-ad-xyz=SafeZWrite | |||
--vu1-opt-vf00=2 | |||
--vu1-di-bits=0 | |||
--ee-hook=0x001f3ef4,FastForwardClock | |||
--gs-use-deferred-l2h=0 | |||
--vu1-injection=1 | |||
--vu1-mpg-cycles=2500 | |||
--fpu-rsqrt-fast-estimate=0 | |||
--safe-area-min=1.0</pre> | |||
SLES 535.61 | |||
local | <br>LUA | ||
local | <pre>apiRequest(0.1) | ||
-- EA sports cricket 07 bug 9392 | |||
-- Performance fix | |||
local emuObj = getEmuObject() | |||
local thresholdArea = 600 | |||
emuObj.SetGsTitleFix( "ignoreUpRender", thresholdArea , {alpha=0x80000044 , zmsk=1 , tw=4, th=4 } )</pre> | |||
-- | SLUS-21269 | ||
<br>SLUS-21269_features.lua | |||
<pre>This is a substantial file. Over 150 lines with an extensive performance fix. I'm sharing the file itself as a download link. | |||
https://drive.google.com/file/d/12gt2fONqMP1rmEB9UMw3rIpEYbz1dQq8/view | |||
#Official widescreen support.</pre> | |||
====Destroy All Humans==== | |||
SLUS_209.45 | |||
<br>CLI | |||
<pre>--gs-use-mipmap=1 | |||
--gs-kernel-cl="mipmap" | |||
--gs-kernel-cl-up="mipmap2x2" | |||
--gs-ignore-dirty-page-border=1 | |||
--fpu-accurate-addsub-range=0x28bf00,0x28c100 | |||
#Fix for graphical glitches.</pre> | |||
SLUS_209.45 | |||
<br>SLUS-20945_features.lua | |||
<pre>-- Lua 5.3 | |||
-- Title: Destroy All Humans! PS2 - SLUS-20945 (USA) | |||
-- Author: Ernesto Corvi, Adam McInnis | |||
-- Changelog: | |||
apiRequest(0.1) -- request version 0.1 API. Calling apiRequest() is mandatory. | |||
local eeObj = getEEObject() | |||
local emuObj = getEmuObject() | |||
local gpr = require( "ee-gpr-alias" ) -- you can access EE GPR by alias (gpr.a0 / gpr["a0"]) | |||
-- Widescreen | |||
eeObj.AddHook(0x308270, 0x3c0336c5, function() -- Graphics::Script::SetScreenRatio | |||
local | local mode = eeObj.GetGpr(gpr.v0) | ||
-- print(string.format("mode: %08x", mode)) | |||
if mode == 0x36c59d2b then -- widescreen | |||
emuObj.SetDisplayAspectWide() | |||
elseif mode == 0x855a87ef then -- standard | |||
emuObj.SetDisplayAspectNormal() | |||
-- print(string.format(" | |||
if | |||
end | end | ||
end) | |||
eeObj.AddHook(0x3078F4, 0xae0000f4, function() -- Graphics::Renderer::Renderer | |||
local renderer = eeObj.GetGpr(gpr.s0) | |||
eeObj.WriteMemFloat(renderer+0x200, 1.3333333) | |||
eeObj.WriteMemFloat(renderer+0x204, 1.7777777) | |||
eeObj.WriteMem32(renderer+0x208, 2) | |||
end) | |||
emuObj.SetDisplayAspectWide() | |||
-- CRC "settings.display.widescreen" = 0xbcf14d81 | |||
-- $s2 = SaveType (1 = new save) | |||
local overlay = InsnOverlay({ | |||
0x27bdffe0, -- addiu $sp, -0x20 | |||
0xffbf0010, -- sd $ra, 0x10($sp) | |||
0x0c0d49d8, -- jal Core::Memset(void *,int,uint) | |||
0x00000000, -- nop | |||
0x24030001, -- li $v1, 1 | |||
0x1472000b, -- bne $s2, $v1, +11 | |||
0x00000000, -- nop | |||
0x0c09dacc, -- jal UFO::Progress::Get(void) | |||
0x00000000, -- nop | |||
0x3c01bcf1, -- lui $at, 0xbcf1 | |||
0x34214d81, -- ori $at, $at, 0x4d81 | |||
0xafa10000, -- sw $at, 0($sp) | |||
0x24030001, -- li $v1, 1 | |||
0xa3a30004, -- sb $v1, 4($sp) | |||
0x03a0282d, -- move $a1, $sp | |||
0x0c09dd4c, -- jal UFO::Progress::Record::AddKey(UFO::Progress::Content const&) | |||
0x0040202d, -- move $a0, $v0 | |||
0xdfbf0010, -- ld $ra, 0x10($sp) | |||
0x03e00008, -- jr $ra | |||
0x27bd0020 -- addiu $sp, 0x20 | |||
}) | |||
local call_overlay = 0x0c000000 | (overlay >> 2) | |||
eeInsnReplace(0x2789F8, 0x0c0d49d8, call_overlay) -- UFO::Progress::Storage::PrepareWrite | |||
#Official widescreen support.</pre> | |||
====Destroy All Humans 2==== | |||
SLUS_214.39 | |||
<br>CLI | |||
<pre>--gs-use-mipmap=1 | |||
--gs-kernel-cl="mipmap" | |||
--gs-kernel-cl-up="mipmap2x2" | |||
#Fix for graphical glitches.</pre> | |||
SLUS_214.39 | |||
<br>SLUS-21439_features.lua | |||
<pre>-- Lua 5.3 | |||
-- Title: Destroy All Humans! 2 PS2 - SLUS-21439 (USA) | |||
-- Author: Ernesto Corvi, Adam McInnis | |||
-- Changelog: | |||
-- | apiRequest(0.7) -- request version 0.1 API. Calling apiRequest() is mandatory. | ||
local eeObj = getEEObject() | |||
local emuObj = getEmuObject() | |||
local gpr = require( "ee-gpr-alias" ) -- you can access EE GPR by alias (gpr.a0 / gpr["a0"]) | |||
-- print(string.format(" | -- Widescreen | ||
eeObj.AddHook(0x33ca98, 0x3c0436c5, function() -- Graphics::Script::SetScreenRatio | |||
if | local mode = eeObj.GetGpr(gpr.v0) | ||
-- print(string.format("mode: %08x", mode)) | |||
if mode == 0x36c59d2b then -- widescreen | |||
emuObj.SetDisplayAspectWide() | |||
elseif mode == 0x855a87ef then -- standard | |||
emuObj.SetDisplayAspectNormal() | |||
end | end | ||
end) | |||
eeObj.AddHook(0x33afac, 0x0000282d, function() -- Graphics::Renderer::Renderer | |||
eeObj.SetGpr(gpr.a1, 2) | |||
end) | |||
emuObj.SetDisplayAspectWide() | |||
-- | -- CRC "settings.display.anamorphic" = 0x8b36afe9 | ||
-- | -- $s2 = SaveType (1 = new save) | ||
local | local overlay = InsnOverlay({ | ||
0x27bdffe0, -- addiu $sp, -0x20 | |||
0xffbf0010, -- sd $ra, 0x10($sp) | |||
1 | 0x0c059d02, -- memset | ||
0 | 0x00000000, -- nop | ||
0x24030001, -- li $v1, 1 | |||
} | 0x1472000b, -- bne $s2, $v1, +11 | ||
0x00000000, -- nop | |||
0x0c09b400, -- jal UFO::Progress::Get(void) | |||
0x00000000, -- nop | |||
0x3c01bcf1, -- lui $at, 0x8b36 | |||
0x34214d81, -- ori $at, $at, 0xafe9 | |||
0xafa10000, -- sw $at, 0($sp) | |||
0x24030001, -- li $v1, 1 | |||
0xa3a30004, -- sb $v1, 4($sp) | |||
0x03a0282d, -- move $a1, $sp | |||
0x0c09dd4c, -- jal UFO::Progress::Record::AddKey(UFO::Progress::Content const&) | |||
0x0040202d, -- move $a0, $v0 | |||
0xdfbf0010, -- ld $ra, 0x10($sp) | |||
0x03e00008, -- jr $ra | |||
0x27bd0020 -- addiu $sp, 0x20 | |||
}) | |||
local call_overlay = 0x0c000000 | (overlay >> 2) | |||
eeInsnReplace(0x271AD0, 0x0c059d02, call_overlay) -- UFO::Progress::Storage::PrepareWrite | |||
-- | -- Disable Progressive Scan and Adjust Screen Position | ||
local | local overlay2 = InsnOverlay({ | ||
0x27bdfff0, -- addiu $sp, -0x10 | |||
0xffbf0000, -- sd $ra, 0(sp) | |||
0xffb00008, -- sd $s0, 8(sp) | |||
0x3c05000f, -- lui $a1, 0x000f | |||
0x34a57000, -- ori $a1, 0x7000 | |||
0x0c0db8b6, -- jal Script::State::DoString | |||
0x0080802d, -- move $s0, $a0 | |||
0x24050001, -- li $a1, 1 | |||
0x0c0dba4c, -- jal Script::State::IsNull(int) | |||
0x0200202d, -- move $a0, $s0 | |||
0xdfb00008, -- ld $s0, 8(sp) | |||
0xdfbf0000, -- ld $ra, 0(sp) | |||
0x03e00008, -- jr ra | |||
0x27bd0010 -- addiu $sp, 0x10 | |||
}) | |||
local call_overlay2 = 0x0c000000 | (overlay2 >> 2) | |||
eeInsnReplace(0x2e5a14, 0x0c0dba4c, call_overlay2) -- Sim::Manager::ProcessScript near Sim::Manager::SetPauseFlag | |||
-- | |||
eeObj.AddHook(0x2e5a10, 0x0240202d, function() -- Sim::Manager::ProcessScript near Sim::Manager::SetPauseFlag | |||
local luaString = [[ | |||
-- disable progressive scan and adjust screen | |||
gui.i.SMOptionsDisplay.table.slots[3] = nil | |||
gui.i.SMOptionsDisplay.table.slots[4] = nil | |||
]] | |||
eeObj.WriteMemStrZ(0xf7000, luaString) | |||
end) | |||
#Official widescreen support.</pre> | |||
====Eternal ring==== | |||
'''CLI''' | |||
-- ------------ | <pre> | ||
--pad-analog-to-digital=0 | |||
--gs-use-deferred-l2h=1 | |||
--host-display-mode=16:9 | |||
</pre> | |||
'''LUA''' | |||
<pre> | |||
local gpr = require("ee-gpr-alias") | |||
local PadStick = require("PadStick") | |||
apiRequest(1.5) | |||
local eeObj = getEEObject() | |||
local emuObj = getEmuObject() | |||
local patcher = function() | |||
--X-Fov - ELF hack | |||
--803f013c 00a88144 0045013c | |||
eeObj.WriteMem32(0x00100fcc,0x3c013f40) --3c013f80 | |||
--Memory hack | |||
--eeObj.WriteMem32(0x201FF100,0x43c00000) | |||
end | end | ||
emuObj.AddVsyncHook(patcher) | |||
if 1 then | |||
-- bug#10361 (intro slowdown) & bug#9823 (conveyor belt effect) | |||
-- Use Deferred L2H except for conveyor belt effect. | |||
-- Unsure if other convery or similar effects are present, so use permissive match for bypassing deferral. | |||
L2H_SetNonDeferred({TRXREG=0x0000000900000080}) -- match any TRXPOS or BITBLTBUF | |||
-- Full specification of conveyor belt effect. | |||
-- L2H_SetNonDeferred({BITBLTBUF=0x0000000013023240,TRXPOS=0x0000000000770000,TRXREG=0x0000000900000080}) | |||
end | end | ||
local PadStickRemap_EternalRing_Default = { | |||
LR=PadStick.AxisRX_Pos, | |||
LL=PadStick.AxisRX_Neg, | |||
LU=PadStick.AxisLY_Neg, | |||
LD=PadStick.AxisLY_Pos, | |||
L1=PadStick.AxisLX_Neg, | |||
R1=PadStick.AxisLX_Pos, | |||
L2=PadStick.AxisRY_Neg, | |||
R2=PadStick.AxisRY_Pos, | |||
} | |||
local PadStickRemap_EternalRing_InvertY = { | |||
L2=PadStick.AxisRY_Pos, | |||
R2=PadStick.AxisRY_Neg, | |||
} | |||
emuObj.PadPressureStickRemap(0, PadStickRemap_EternalRing_Default) | |||
-- | -- Supporting Inverted Y Axis requires smoe menu changes, and should be done via features.lua | ||
--emuObj.PadPressureStickRemap(0, PadStickRemap_EternalRing_InvertY) </pre> | |||
====Everybody's Tennis/Hot Shots Tennis==== | |||
SCES_545.35 | |||
<br>CLI | |||
<pre>--gs-use-deferred-l2h=0 | |||
--l2h-2d-params=0x0000000800000010,0x00000000300a1400,256 | |||
--gs-motion-factor=50 | |||
--mtap1=always | |||
--gs-opt-frbuff-switch=1 | |||
--gs-ignore-dirty-page-border=1 | |||
--gs-ignore-rect-correction=1 | |||
--ee-native-function=memcpy,0x11e328 | |||
--ee-native-function=memset,0x11e4e0 | |||
#performance and visual fix(?)</pre> | |||
SCES_545.35 | |||
<br>LUA | |||
<pre>local gpr = require("ee-gpr-alias") | |||
require( "ee-hwaddr" ) | |||
apiRequest(1.4) | |||
local eeObj = getEEObject() | |||
-- function dump(addr) | |||
-- print(string.format("=== dump %x ===", addr)) | |||
-- for i=0,0x1e do | |||
end | -- print(string.format(" %08x : %08x %08x %08x %08x", | ||
-- addr + i*16, | |||
-- eeObj.ReadMem32(addr + i*16 + 0), | |||
-- eeObj.ReadMem32(addr + i*16 + 4), | |||
-- eeObj.ReadMem32(addr + i*16 + 8), | |||
-- eeObj.ReadMem32(addr + i*16 +12))) | |||
-- end | |||
-- end | |||
-- Bug#8285 | |||
-- This patch changes the color of background on : | |||
-- - Language selection | |||
-- - Company logo | |||
-- - Start screen | |||
-- - Some menu | |||
-- which are in menu.bin overlay. Nothing affected in the actual game. | |||
eeObj.DmaAddHook( 1, function() | |||
if eeObj.ReadMem32(vif1_hw.TADR) == 0x1fd1c0 then | |||
-- On language select | |||
if eeObj.ReadMem32(0x4c8ef0) == 0x00ff9090 then | |||
eeObj.WriteMem32(0x4c8ef0, 0) | |||
end | |||
if eeObj.ReadMem32(0x548f30) == 0x00ff9090 then | |||
eeObj.WriteMem32(0x548f30, 0) | |||
end | |||
-- On company logo | |||
if eeObj.ReadMem32(0x4c6d70) == 0x00ff9090 then | |||
eeObj.WriteMem32(0x4c6d70, 0) | |||
end | |||
if eeObj.ReadMem32(0x546db0) == 0x00ff9090 then | |||
eeObj.WriteMem32(0x546db0, 0) | |||
end | |||
end | |||
end) | |||
eeInsnReplace(0x103d58, 0x27bdffc0, 0x03e00008) -- <SyncDCache> | |||
eeInsnReplace(0x103d5c, 0xffb20020, 0x00000000) | |||
eeNativeHook (0x103d58, 0x03e00008,'AdvanceClock',0x600) | |||
eeInsnReplace(0x103dd8, 0x3c02ffff, 0x03e00008) -- <iSyncDCache> | |||
eeInsnReplace(0x103ddc, 0x3442ffc0, 0x00000000) | |||
eeNativeHook (0x103dd8, 0x03e00008,'AdvanceClock',0x600) | |||
eeInsnReplace(0x103e98, 0x27bdffc0, 0x03e00008) -- <InvalidDCache> | |||
eeInsnReplace(0x103e9c, 0xffb20020, 0x00000000) | |||
eeNativeHook (0x103e98, 0x03e00008,'AdvanceClock',0x600) | |||
eeInsnReplace(0x103f18, 0x3c02ffff, 0x03e00008) -- <iInvalidDCache> | |||
eeInsnReplace(0x103f1c, 0x3442ffc0, 0x00000000) | |||
eeNativeHook (0x103f18, 0x03e00008,'AdvanceClock',0x600) | |||
eeInsnReplace(0x106970, 0x3c19ffff, 0x03e00008) -- <sceSifWriteBackDCache> | |||
eeInsnReplace(0x106974, 0x3739ffc0, 0x00000000) | |||
eeNativeHook (0x106970, 0x03e00008,'AdvanceClock',0x1700) | |||
</pre> | </pre> | ||
==== | ====Fahrenheit/Indigo Prophecy==== | ||
SLES_535.39 | |||
<br>CLI | <br>CLI | ||
<pre> | <pre>--ee-hook=0x002097d0,FastForwardClock,0x8c6261fc | ||
-- | --ee-hook=0x1a5570,AdvanceClock,,500000 | ||
--gs-kernel-cl=" | --ee-hook=0x00223c48,AdvanceClock,0x0080382d,8000 | ||
--gs-kernel-cl-up=" | --gs-kernel-cl="h2lpool" | ||
--gs-kernel-cl-up="h2lpool2x2" | |||
#Performance fix.</pre> | |||
SLES_535.39 | |||
</pre> | |||
<br>LUA | <br>LUA | ||
<pre> | <pre>This is a substantial file. Over 20,000 lines with an extensive performance fix. I'm sharing the file itself as a download link. | ||
https://drive.google.com/file/d/1L2YxondID65KIAybKVCBH9KgFegqqOeQ/view | |||
-- | -- Performace fix (bug #9785 ) | ||
-- bug#8571 | |||
-- | -- ignore 'no wait vsync' case. | ||
-- unsyncv causes major slowness on loading screen, because the game pushes LOTS of identical frame data to GS.</pre> | |||
SLES_535.39 | |||
<br>SLES-53539_features.lua | |||
<pre>-- Lua 5.3 | |||
-- Title: Fahrenheit PS2 - SLES-53539 (EUR) | |||
-- Author: Ernesto Corvi, Adam McInnis | |||
-- | -- Changelog: | ||
require( "ee-gpr-alias" ) -- you can access EE GPR by alias (gpr.a0 / gpr["a0"]) | |||
require( "ee-cpr0-alias" ) -- for EE CPR | |||
apiRequest(0.1) -- request version 0.1 API. Calling apiRequest() is mandatory. | |||
local eeObj = getEEObject() | |||
local emuObj = getEmuObject() | |||
local L1 = function() -- QDT::SINT::SCRIPT_LOADING_SCREEN::EM::Run | |||
emuObj.ThrottleMax() | |||
end | |||
local L2 = function() -- QDT::SINT::SCRIPT_LOADING_SCREEN::EM::Stop | |||
emuObj.ThrottleNorm() | |||
end | |||
local load1 = eeObj.AddHook(0x387040, 0x3c02004b, L1) -- QDT::SINT::SCRIPT_LOADING_SCREEN::Run | |||
local load2 = eeObj.AddHook(0x387090, 0x3c02004b, L2) -- QDT::SINT::SCRIPT_LOADING_SCREEN::Stop | |||
-- Widescreen | |||
eeInsnReplace(0x20a7c0, 0x3c013faa, 0x3c013fe3) | |||
eeInsnReplace(0x20a7c4, 0x3421aaab, 0x34218e39) | |||
emuObj.SetDisplayAspectWide() | |||
= | -- Skip video mode options | ||
local videomenuVM = { 0x04, 0x01, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, | |||
0x3B, 0x0D, 0x00, 0x00, 0x3B, 0x0B, 0x00, 0x00, | |||
0x3B, 0x26, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 } | |||
local visualmenuVM = { 0x04, 0x01, 0x00, 0x00, 0xA2, 0x00, 0x00, 0x00, | |||
0x3B, 0x19, 0x00, 0x00, 0x3B, 0x18, 0x00, 0x00 } | |||
-- locates src chunk on (dst,cnt). -1 if not found, offset if found | |||
<br> | local locateChunk = function(src, dst, count) | ||
local offs = -1 | |||
for x = 0, count - #src do | |||
if eeObj.ReadMem8(dst+x) == src[1] then | |||
local found = true | |||
for y = 1, #src do | |||
if eeObj.ReadMem8(dst+x+y-1) ~= src[y] then | |||
found = false | |||
break | |||
end | |||
end | |||
if found == true then | |||
offs = x | |||
break | |||
end | |||
end | |||
end | |||
return offs | |||
end | |||
eeObj.AddHook(0x2812b0, 0x27bdfff0, function() -- QDT::VM::BYTE_CODE::BYTE_CODE | |||
local obj = eeObj.GetGpr(gpr.a1) | |||
local bytecode = eeObj.ReadMem32(obj+0x18) | |||
local count = eeObj.ReadMem32(obj+0x20) | |||
if count > #videomenuVM then | |||
local offs = locateChunk(videomenuVM, bytecode, count) | |||
if offs >= 0 then | |||
print("Skipping video mode menu") | |||
eeObj.WriteMem8(bytecode+offs+4, 8) -- beq 0x44 -> beq 0x8 | |||
end | |||
end | |||
if count > #visualmenuVM then | |||
local offs = locateChunk(visualmenuVM, bytecode, count) | |||
if offs >= 0 then | |||
print("Skipping visual mode video menu") | |||
eeObj.WriteMem8(bytecode+offs+1, 2) -- beq 0xa2 -> bne 0xa2 | |||
end | |||
end | |||
end) | |||
-- Force 60hz | |||
eeInsnReplace(0x207ae0, 0x00a0802d, 0x24100001) -- move $s0, $a1 -> li $s0, 1 | |||
-- Fix for bug 9716, which is a bug in the game. | |||
-- Trying to retrieve a COM handle in the game will cause an infinite | |||
-- loop if the handle has been deallocated and the debug server is not | |||
-- connected. There's apparently a small race condition in the Asylum | |||
-- level that sometimes can trigger the bug. | |||
-- The fix involves getting out of the loop. | |||
-- It causes a small visual glitch but otherwise the game continues to work fine. | |||
eeInsnReplace(0x1c5958, 0x10400005, 0) -- QDT::KCOM::COM_SERVICE::RetrieveComHandle | |||
eeInsnReplace(0x1c5b6c, 0x10400005, 0) -- QDT::KCOM::COM_SERVICE::RetrieveComHandle | |||
eeInsnReplace(0x1c5d24, 0x10400005, 0) -- QDT::KCOM::COM_SERVICE::RetrieveComHandle | |||
#Official widescreen support, forced 60Hz/NTSC, along with a game crash bug fix.</pre> | |||
====Fantavision==== | |||
'''CLI''' | |||
<br>SCES-50002 | |||
<pre> | |||
--gs-kernel-cl-up="fantavision" | |||
--gs-motion-factor=1 | |||
</pre> | |||
'''LUA''' | |||
<br>SCES-50002 | |||
<pre> | <pre> | ||
require("ee-gpr-alias") | require("ee-gpr-alias") | ||
require( "ee-hwaddr" ) | |||
apiRequest(0.1) -- request version 0.1 API. Calling apiRequest() is mandatory. | apiRequest(0.1) -- request version 0.1 API. Calling apiRequest() is mandatory. | ||
eeObj = getEEObject() | eeObj = getEEObject() | ||
-- Bug# | -- | ||
-- | -- Bug#93709 (JP Bugzilla) | ||
-- | -- Same as Parappa the Rapper 2, it's VIF1 vs GIF xfer timing issue. | ||
-- | -- The game expects PATH3 happens before VU1 xgkick, but actually Olympus doesn't do like that. | ||
-- | -- Game kicks : PATH3(Context1) PATH1(Rendering using Context1&2) PATH3(Context2) | ||
-- Game expects: PATH3(Context1) PATH3(Context2) PATH1(Rendering using Context1&2) | |||
-- Hence VIF1 DMA needs to be delayed. | |||
eeObj.AddHook(0x1b1468, 0xae020000, function() | |||
local ee = eeObj | |||
local s0 = ee.GetGpr(gpr.s0) | |||
if s0 == vif1_hw.CHCR then | |||
local chcr = ee.GetGpr(gpr.v0) | |||
if (chcr & 0x05) == 0x05 then | |||
local tadr = ee.ReadMem32(vif1_hw.TADR) | |||
if tadr == 0x8883e0 or tadr == 0x9f6b60 then | |||
ee.SchedulerDelayEvent("vif1.dma", 0x5000) | |||
end | |||
end | |||
end | end | ||
end) | end) | ||
-- Performace fix | |||
local emuObj = getEmuObject() | |||
-- twIsLess=5 - texture width is less or eq. than 32 | |||
emuObj.SetGsTitleFix( "forcePointSampling", "reserved", {alpha = 0x80000048, twIsLess=5, thIsLess=5 } ) | |||
</pre> | </pre> | ||
==== | ====Fatal Fury: Battle Archives volume 2==== | ||
ALL | |||
<br>CLI | <br>CLI | ||
<pre>-- | <pre>--gs-uprender=none | ||
-- | --gs-upscale=point | ||
-- | --host-audio-latency=0.010 | ||
-- | --force-frame-blend=1 | ||
</pre> | |||
<br>LUA | |||
<pre> | |||
-- | -- Lua 5.3 | ||
-- | -- Title: Fatal Fury: Battle Archives Volume 2 - SLUS-21723 (USA) v1.00 | ||
-- | -- Author: Nicola Salmoria | ||
-- | -- Date: February 3, 2017 | ||
apiRequest(1.6) | |||
local gpr = require( "ee-gpr-alias" ) | |||
local kFilterMode, kWrapMode, kBlendMultiplier, kBlendFunc = require("sprite") | |||
local PadConnectType = require("pad-connect-type") | |||
local eeObj = getEEObject() | |||
local emuObj = getEmuObject() | |||
local sprite0 = getSpriteObject(0) | |||
local sprite1 = getSpriteObject(1) | |||
local sprite2 = getSpriteObject(2) | |||
local sprite3 = getSpriteObject(3) | |||
==== | -- Notifications should be assigned to two unused sprite slots. Since we want them to | ||
-- be displayed on top of everything else, they should be the highest sprites in the list. | |||
local spr_p1_notify = getSpriteObject(4) | |||
local spr_p2_notify = getSpriteObject(5) | |||
local spr_p1d_notify = getSpriteObject(6) | |||
local spr_p2d_notify = getSpriteObject(7) | |||
-- note: Texture 0 is fixed as the PS2 scanout. | |||
local texture1 = getTextureObject(1) | |||
local texture2 = getTextureObject(2) | |||
local texture3 = getTextureObject(3) | |||
local texture4 = getTextureObject(4) | |||
local texture5 = getTextureObject(5) | |||
local texture6 = getTextureObject(6) | |||
local texture7 = getTextureObject(7) | |||
-- ------------------------------------------------------------ | |||
local STATE_STOPPED = 0 | |||
local STATE_RUNNING = 1 | |||
-- | |||
-- | |||
local notify_ypos = 24 | |||
local notify_p1_xsize = 0 | |||
local notify_p2_xsize = 0 | |||
local notify_p1d_xsize = 0 | |||
local notify_p2d_xsize = 0 | |||
local notify_ysize = 0 | |||
local notify_frames_p1 = 0 | |||
local notify_frames_p2 = 0 | |||
local notify_animstate_p1 = STATE_STOPPED | |||
local notify_animstate_p2 = STATE_STOPPED | |||
local | local connected_p1 = 47 | ||
local | local connected_p2 = 47 | ||
local | local blink_on_p1 = true | ||
local blink_on_p2 = true | |||
-- | -- --------------------------------------------------- | ||
-- the global function 'Global_InitGpuResources()' is invoked by the emulator after | |||
-- the GS has been initialized. Textures and Shaders must be loaded here. | |||
-- | |||
-- | Global_InitGpuResources = function() | ||
-- # Fragment Shader 0 is fixed as the default no-thrills as-is renderer. | |||
emuObj.LoadFsShader(1, "./shader_SL480_p.sb") -- (1) = 480P ScanLine Sim | |||
texture1.Load("./ART1.png") | |||
texture2.Load("./ART2.png") | |||
texture3.Load("./SNK_LOGO.png") | |||
texture4.Load("./p1.png") | |||
texture5.Load("./p2.png") | |||
texture6.Load("./p1d.png") | |||
texture7.Load("./p2d.png") | |||
local p1_w,p1_h = texture4.GetSize() | |||
local p2_w,p2_h = texture5.GetSize() | |||
local p1d_w,p1d_h = texture6.GetSize() | |||
local p2d_w,p2d_h = texture7.GetSize() | |||
notify_p1_xsize = p1_w | |||
notify_p2_xsize = p2_w | |||
notify_p1d_xsize = p1d_w | |||
notify_p2d_xsize = p2d_w | |||
notify_ysize = p1_h | |||
-- | spr_p1_notify.BindTexture(4) | ||
spr_p1_notify.SetPosXY(-1 - notify_p1_xsize, notify_ypos) -- default position is fully obscured from view | |||
spr_p1_notify.SetSizeXY(p1_w,p1_h) | |||
spr_p1_notify.SetPosUV(0,0) | |||
spr_p1_notify.SetSizeUV(p1_w,p1_h) | |||
spr_p1_notify.SetBlendColorEquation(blendDefaultEquation) | |||
spr_p2_notify.BindTexture(5) | |||
spr_p2_notify.SetPosXY(-1 - notify_p2_xsize, notify_ypos) -- default position is fully obscured from view | |||
spr_p2_notify.SetSizeXY(p2_w,p1_h) | |||
spr_p2_notify.SetPosUV(0,0) | |||
spr_p2_notify.SetSizeUV(p2_w,p1_h) | |||
spr_p2_notify.SetBlendColorEquation(blendDefaultEquation) | |||
spr_p1d_notify.BindTexture(6) | |||
spr_p1d_notify.SetPosXY(-1 - notify_p1d_xsize, notify_ypos) -- default position is fully obscured from view | |||
spr_p1d_notify.SetSizeXY(p1d_w,p1_h) | |||
spr_p1d_notify.SetPosUV(0,0) | |||
spr_p1d_notify.SetSizeUV(p1d_w,p1_h) | |||
spr_p1d_notify.SetBlendColorEquation(blendDefaultEquation) | |||
spr_p2d_notify.BindTexture(7) | |||
spr_p2d_notify.SetPosXY(-1 - notify_p2d_xsize, notify_ypos) -- default position is fully obscured from view | |||
spr_p2d_notify.SetSizeXY(p2d_w,p1_h) | |||
spr_p2d_notify.SetPosUV(0,0) | |||
spr_p2d_notify.SetSizeUV(p2d_w,p1_h) | |||
spr_p2d_notify.SetBlendColorEquation(blendDefaultEquation) | |||
end | |||
local | local update_notifications_p1 = function() | ||
if notify_animstate_p1 == STATE_STOPPED then | |||
spr_p1_notify.Disable() | |||
spr_p1d_notify.Disable() | |||
return | |||
if | |||
end | end | ||
emuObj.ThrottleNorm() | |||
local keyframe = 15 | |||
notify_frames_p1 = notify_frames_p1 + 1 | |||
if math.ceil(notify_frames_p1/keyframe) == notify_frames_p1/keyframe then blink_on_p1 = not blink_on_p1 end | |||
if blink_on_p1 == true then notify_ypos = 24 end | |||
if blink_on_p1 == false then notify_ypos = -84 end | |||
-- | -- print(string.format("rounded %s, floating %s, blink %s ypos %s", math.ceil(notify_frames_p1/keyframe), notify_frames_p1/keyframe, blink_on_p1, notify_ypos)) | ||
-- | -- print(string.format("notify_frames_p1 %s", notify_frames_p1)) | ||
if notify_frames_p1 >= 225 then | |||
notify_animstate_p1 = STATE_STOPPED | |||
notify_frames_p1 = 0 | |||
connected_p1 = 47 | |||
end | |||
if connected_p1 == true then | |||
spr_p1_notify.SetBlendColor(1.0,1.0,1.0,1.0) | |||
spr_p1_notify.SetPosXY(math.floor((1920-notify_p1_xsize)/2), notify_ypos) | |||
spr_p1_notify.Enable() | |||
end | |||
- | if connected_p1 == false then | ||
spr_p1d_notify.SetBlendColor(1.0,1.0,1.0,1.0) | |||
spr_p1d_notify.SetPosXY(math.floor((1920-notify_p1d_xsize)/2), notify_ypos) | |||
spr_p1d_notify.Enable() | |||
end | |||
end | |||
local | local update_notifications_p2 = function() | ||
if notify_animstate_p2 == STATE_STOPPED then | |||
spr_p2_notify.Disable() | |||
spr_p2d_notify.Disable() | |||
return | |||
end | |||
end | |||
emuObj.ThrottleNorm() | |||
local keyframe = 15 | |||
notify_frames_p2 = notify_frames_p2 + 1 | |||
if math.ceil(notify_frames_p2/keyframe) == notify_frames_p2/keyframe then blink_on_p2 = not blink_on_p2 end | |||
if blink_on_p2 == true then notify_ypos = 24 + notify_ysize + 8 end | |||
if blink_on_p2 == false then notify_ypos = -84 - notify_ysize - 8 end | |||
-- | -- print(string.format("rounded %s, floating %s, blink %s ypos %s", math.ceil(notify_frames_p2/keyframe), notify_frames_p2/keyframe, blink_on_p2, notify_ypos)) | ||
if notify_frames_p2 >= 225 then | |||
notify_animstate_p2 = STATE_STOPPED | |||
notify_frames_p2 = 0 | |||
connected_p2 = 47 | |||
end | |||
-- print(string.format("connected_p1 %s, connected_p2 %s", connected_p1, connected_p2)) | |||
if connected_p2 == true then | |||
spr_p2_notify.SetBlendColor(1.0,1.0,1.0,1.0) | |||
spr_p2_notify.SetPosXY(math.floor((1920-notify_p2_xsize)/2), notify_ypos) | |||
spr_p2_notify.Enable() | |||
end | |||
if 1 | if connected_p2 == false then | ||
spr_p2d_notify.SetBlendColor(1.0,1.0,1.0,1.0) | |||
spr_p2d_notify.SetPosXY(math.floor((1920-notify_p2d_xsize)/2), notify_ypos) | |||
spr_p2d_notify.Enable() | |||
end | |||
end | |||
-- slot can range from 0 to 3, for users 1 thru 4. | |||
-- | -- pad_type can be either: DS4, REMOTE_DS4, REMOTE_VITA, or HID | ||
local onHIDPadEvent = function(slot, connected, pad_type) | |||
spr_p1_notify.Disable() | |||
spr_p1d_notify.Disable() | |||
spr_p2_notify.Disable() | |||
spr_p2d_notify.Disable() | |||
-- print(string.format("slot %s, connected %s, pad_type %s", slot, connected, pad_type)) | |||
if pad_type == PadConnectType.HID then | |||
notify_frames_p1 = 0 | |||
notify_frames_p2 = 0 | |||
blink_on_p1 = true | |||
blink_on_p2 = true | |||
if slot == 0 then | |||
connected_p1 = connected | |||
notify_animstate_p1 = STATE_RUNNING | |||
end | |||
if slot == 1 then | |||
connected_p2 = connected | |||
notify_animstate_p2 = STATE_RUNNING | |||
end | |||
end | |||
end | end | ||
local | local scanlineParams = { | ||
240.0, -- float scanlineCount | |||
0.7, -- float scanlineHeight; | |||
1.5, -- float scanlineBrightScale; | |||
0.5, -- float scanlineAlpha; | |||
0.5 -- float vignetteStrength; | |||
} | } | ||
-- --------------------------------------------------- | |||
-- Full Screen (480p) NoFX | |||
-- --------------------------------------------------- | |||
local original = function() | |||
sprite0.BindTexture(0) | |||
sprite0.BindFragmentShader(0) | |||
sprite0.SetPosXY((1920-1440)/2,0) | |||
sprite0.SetSizeXY(1440,1080) | |||
sprite0.SetBlendColor(1.0,1.0,1.0,1.0) | |||
sprite0.Enable() | |||
sprite1.Disable() | |||
end | |||
-- --------------------------------------------------- | |||
-- Full Screen + ScanLines (480p) | |||
-- --------------------------------------------------- | |||
local | local scanlines = function() | ||
sprite0.BindTexture(0) | |||
sprite0.SetPosXY((1920-1440)/2,0) | |||
sprite0.SetSizeXY(1440,1080) | |||
sprite0.BindFragmentShader(1) | |||
sprite0.SetShaderParams(scanlineParams) | |||
sprite0.SetBlendColor(1.0,1.0,1.0,1.0) | |||
sprite0.Enable() | |||
sprite1.Disable() | |||
end | |||
-- | -- --------------------------------------------------- | ||
-- | -- SNK Overlay NoFX | ||
-- | -- --------------------------------------------------- | ||
-- | local bezel = function() | ||
-- | sprite0.BindTexture(0) | ||
-- | sprite0.BindFragmentShader(0) | ||
-- | sprite0.SetPosXY((1920-1280)/2, (1080-896)/2) | ||
sprite0.SetSizeXY(1280,896) | |||
sprite0.SetBlendColor(1.0,1.0,1.0,1.0) | |||
sprite0.Enable() | |||
sprite1.BindTexture(1) | |||
sprite1.SetPosXY(0,0) | |||
sprite1.SetSizeXY(1920,1080) | |||
sprite1.SetPosUV(0,0) | |||
sprite1.SetSizeUV(1920,1080) | |||
sprite1.Enable() | |||
end | |||
-- --------------------------------------------------- | |||
-- SNK Overlay + ScanLines (480p) | |||
-- --------------------------------------------------- | |||
-- | |||
-- | |||
-- | |||
-- | |||
-- | local bezel_scanlines = function() | ||
sprite0.BindTexture(0) | |||
sprite0.SetPosXY((1920-1280)/2, (1080-896)/2) | |||
sprite0.SetSizeXY(1280,896) | |||
sprite0.BindFragmentShader(1) | |||
sprite0.SetShaderParams(scanlineParams) | |||
sprite0.SetBlendColor(1.0,1.0,1.0,1.0) | |||
sprite0.Enable() | |||
sprite1.BindTexture(1) | |||
sprite1.SetPosXY(0,0) | |||
sprite1.SetSizeXY(1920,1080) | |||
sprite1.SetPosUV(0,0) | |||
sprite1.SetSizeUV(1920,1080) | |||
sprite1.Enable() | |||
end | |||
-- | -- --------------------------------------------------- | ||
local | -- Arcade Overlay NoFX | ||
-- --------------------------------------------------- | |||
local bezel2 = function() | |||
-- | sprite0.BindTexture(0) | ||
sprite0.BindFragmentShader(0) | |||
sprite0.SetPosXY((1920-1280)/2, (1080-896)/2) | |||
sprite0.SetSizeXY(1280,896) | |||
sprite0.SetBlendColor(1.0,1.0,1.0,1.0) | |||
sprite0.Enable() | |||
sprite1.BindTexture(2) | |||
sprite1.SetPosXY(0,0) | |||
sprite1.SetSizeXY(1920,1080) | |||
sprite1.SetPosUV(0,0) | |||
sprite1.SetSizeUV(1920,1080) | |||
sprite1.Enable() | |||
end | |||
-- | -- --------------------------------------------------- | ||
-- | -- Arcade Overlay + ScanLines (480p) | ||
-- | -- --------------------------------------------------- | ||
local bezel2_scanlines = function() | |||
sprite0.BindTexture(0) | |||
local | sprite0.SetPosXY((1920-1280)/2, (1080-896)/2) | ||
sprite0.SetSizeXY(1280,896) | |||
sprite0.BindFragmentShader(1) | |||
sprite0.SetShaderParams(scanlineParams) | |||
sprite0.SetBlendColor(1.0,1.0,1.0,1.0) | |||
sprite0.Enable() | |||
sprite1.BindTexture(2) | |||
sprite1.SetPosXY(0,0) | |||
sprite1.SetSizeXY(1920,1080) | |||
sprite1.SetPosUV(0,0) | |||
sprite1.SetSizeUV(1920,1080) | |||
sprite1.Enable() | |||
end | |||
local VIDEOMODE_ORIGINAL = 0*2 + 0 | |||
local VIDEOMODE_SCANLINES = 0*2 + 1 | |||
local VIDEOMODE_ART1 = 1*2 + 0 | |||
local VIDEOMODE_ART1_SCANLINES = 1*2 + 1 | |||
local VIDEOMODE_ART2 = 2*2 + 0 | |||
local VIDEOMODE_ART2_SCANLINES = 2*2 + 1 | |||
local VIDEOMODE_LOGO = 127 | |||
local lastVideoMode = nil | |||
local | local function switchVideoMode(mode) | ||
if lastVideoMode ~= mode then | |||
lastVideoMode = mode | |||
emuObj.ThrottleNorm() | |||
if mode == VIDEOMODE_ORIGINAL then | |||
original() | |||
elseif mode == VIDEOMODE_SCANLINES then | |||
scanlines() | |||
elseif mode == VIDEOMODE_ART1 then | |||
bezel() | |||
elseif mode == VIDEOMODE_ART1_SCANLINES then | |||
bezel_scanlines() | |||
elseif mode == VIDEOMODE_ART2 then | |||
bezel2() | |||
elseif mode == VIDEOMODE_ART2_SCANLINES then | |||
bezel2_scanlines() | |||
end | |||
end | |||
end | end | ||
local logoON = function(fade) | |||
lastVideoMode = VIDEOMODE_LOGO | |||
sprite0.BindTexture(3) | |||
sprite0.SetPosXY(0,0) | |||
sprite0.SetSizeXY(1920,1080) | |||
sprite0.SetPosUV(0,0) | |||
sprite0.SetSizeUV(1920,1080) | |||
sprite0.SetBlendColor(fade,fade,fade,fade) | |||
sprite0.SetBlendColorEquation(blendConstFadeEquation) | |||
sprite0.Enable() | |||
sprite1.Disable() | |||
end | |||
-- convert unsigned int to signed | |||
local function asSigned(n) | |||
local MAXINT = 0x80000000 | |||
return (n >= MAXINT and n - 2*MAXINT) or n | |||
end | |||
= | local TH1 = -- LoadingScreen constructor | ||
function() | |||
emuObj.ThrottleMax() | |||
end | |||
local TH2 = -- LoadingScreen destructor | |||
function() | |||
emuObj.ThrottleNorm() | |||
end | |||
-- | |||
local LH1 = -- update splash screen | |||
function() | |||
local base = eeObj.GetGpr(gpr.s0) | |||
local fade = eeObj.GetGpr(gpr.a1) | |||
local splashNum = eeObj.ReadMem32(base + 12) | |||
if splashNum == 4 then | |||
logoON(fade / 128.0) | |||
elseif splashNum == 5 then | |||
switchVideoMode(VIDEOMODE_ORIGINAL) | |||
end | |||
end | |||
local | local FH1 = -- initialize autosave flag | ||
local | function() | ||
local base = eeObj.GetGpr(gpr.a0) | |||
eeObj.WriteMem8(base + 8, 1) -- ON | |||
end | |||
-- | local FH2A = -- prepare Display Settings menu | ||
function() | |||
local artwork = "ARTWORK" | |||
local scanlines = "SCANLINES" | |||
local | |||
local | |||
eeObj.WriteMemStrZ(0x1b8d07, artwork) | |||
eeObj.WriteMemStrZ(0x1b8d12, scanlines) | |||
end | |||
-- | local FH2B = -- update Position X (now Artwork) description | ||
local | function() | ||
local | local base = eeObj.GetGpr(gpr.s2) | ||
local buffer = eeObj.GetGpr(gpr.a1) | |||
local | local pos = asSigned(eeObj.ReadMem32(base + 256)) | ||
-- limit to valid range | |||
pos = pos % 3 | |||
eeObj.WriteMem32(base + 256, pos) | |||
local | local options = {"NONE", "ART1", "ART2"} | ||
eeObj.WriteMemStrZ(buffer, options[pos + 1]) | |||
end | |||
local | local FH2C = -- update Position Y (now Scanlines) description | ||
function() | |||
local | local base = eeObj.GetGpr(gpr.s2) | ||
local | local buffer = eeObj.GetGpr(gpr.a1) | ||
local pos = asSigned(eeObj.ReadMem32(base + 260)) | |||
-- limit to valid range | |||
pos = pos % 2 | |||
-- | eeObj.WriteMem32(base + 260, pos) | ||
local options = {"OFF", "ON"} | |||
eeObj.WriteMemStrZ(buffer, options[pos + 1]) | |||
end | |||
local FH3 = -- apply display position x/y settings (now Artwork/Scanlines) | |||
function() | |||
local posX = asSigned(eeObj.GetGpr(gpr.a0)) | |||
local posY = asSigned(eeObj.GetGpr(gpr.a1)) | |||
eeObj.SetGpr(gpr.a0, 0) -- force pos X to 0 | |||
eeObj.SetGpr(gpr.a1, 0) -- force pos Y to 0 | |||
-- limit to valid range | |||
posX = posX % 3 | |||
posY = posY % 2 | |||
switchVideoMode(posX * 2 + posY) | |||
end | |||
-- register hooks | |||
local | local elfChkSelect = function(opcode, pc, expectedOpcode) | ||
local checkValue = eeObj.ReadMem32(0x100120) | |||
if | if checkValue == 0x3c030026 then | ||
assert(opcode == expectedOpcode, string.format("Overlay opcode mismatch @ 0x%06x: expected 0x%08x, found %08x", pc, expectedOpcode, opcode)) | |||
return true | |||
return | else | ||
return false | |||
end | end | ||
end | |||
local elfChkBoot = function(opcode, pc, expectedOpcode) | |||
local checkValue = eeObj.ReadMem32(0x100120) | |||
if checkValue == 0xffb00000 then | |||
assert(opcode == expectedOpcode, string.format("Overlay opcode mismatch @ 0x%06x: expected 0x%08x, found %08x", pc, expectedOpcode, opcode)) | |||
return true | |||
else | |||
return false | |||
end | |||
end | |||
local hooks = { | |||
-- Loading screen | |||
eeObj.AddHook(0x105fa8, function(op, pc) return elfChkSelect(op, pc, 0x27bdfff0) end, TH1), -- <LoadingScreen::LoadingScreen(void)>: | |||
eeObj.AddHook(0x106090, function(op, pc) return elfChkSelect(op, pc, 0x27bdffd0) end, TH2), -- <LoadingScreen::~LoadingScreen(void)>: | |||
-- SNK logo | |||
eeObj.AddHook(0x100964, function(op, pc) return elfChkBoot(op, pc, 0x8e050090) end, LH1), -- <_ZN25_GLOBAL__N_logo.cppFOxZrb8LogoPlay4stepEv>: | |||
-- | -- turn on auto save | ||
-- | eeObj.AddHook(0x108778, function(op, pc) return elfChkSelect(op, pc, 0xa0800008) end, FH1), -- <__0o5LMenuContentISaveLoadctv>: | ||
-- patch Position x/y options to show Artwork/Scanlines options | |||
eeObj.AddHook(0x110f50, function(op, pc) return elfChkSelect(op, pc, 0x34050005) end, FH2A), -- <__0o5X__N_8_menu_cpp_761e2d17TMenuDispSettingItemctv>: | |||
eeObj.AddHook(0x110d88, function(op, pc) return elfChkSelect(op, pc, 0x02802825) end, FH2B), -- <__0f5X__N_8_menu_cpp_761e2d17XMenuDispSettingPropertyEstepv>: | |||
eeObj.AddHook(0x110dc4, function(op, pc) return elfChkSelect(op, pc, 0x02802825) end, FH2C), -- <__0f5X__N_8_menu_cpp_761e2d17XMenuDispSettingPropertyEstepv>: | |||
end | |||
-- apply artwork / scanlines settings | |||
eeObj.AddHook(0x1084d4, function(op, pc) return elfChkSelect(op, pc, 0x8e050104) end, FH3), -- <__0FTapplyDisplaySettingv>: | |||
} | |||
-- disallow skipping splash screens | |||
eeInsnReplace(0x1009a0, 0xae000014, 0x00000000) -- nop | |||
-- Fight stick | |||
HIDPad_Enable() | |||
local addedHooks = false | |||
local pad = function() | |||
if addedHooks == false then | |||
addedHooks = true | |||
switchVideoMode(VIDEOMODE_ORIGINAL) | |||
emuObj.AddVsyncHook(update_notifications_p1) | |||
emuObj.AddVsyncHook(update_notifications_p2) | |||
-- test message on boot | |||
-- onHIDPadEvent(0, true, PadConnectType.HID) | |||
-- bug report: | |||
-- please decrease the following title sound volume to the PS4 recommendation. | |||
-- REALBOUT FATAL FURY -11.49LKFS | |||
-- REALBOUT FATAL FURY SPECIAL -10.95LKFS | |||
-- | -- RB2 THE NEWCOMERS -10.04LKFS | ||
-- PS4 recommendation:-24LKFS(±2) | |||
-- | |||
-- that's an average of -10.83 | |||
-- So set main volume to 0.3162 i.e. about 10dB attenuation. | |||
emuObj.SetVolumes(0.3162, 1.0, 1.0) | |||
end | end | ||
end | |||
emuObj.AddPadHook(onHIDPadEvent) | |||
emuObj.AddEntryPointHook(pad) | |||
</pre> | |||
====Fu'un Super Combo!!!==== | |||
SLPS_257.81 | |||
<br>CLI | |||
<pre>--gs-uprender=2x2 | |||
--gs-upscale=point | |||
--host-audio-latency=0.3 | |||
--ee-hook=0x127050,AdvanceClock,0x2403002b,0x4000 | |||
--ee-hook=0x106734,FastForwardClock,0x0c04149c | |||
--ee-native-function=memcpy,0x11fa9c,0x0080402d | |||
--force-frame-blend=1 | |||
--vif1-ignore-cmd-ints=1 | |||
#Graphical and performance fixes.</pre> | |||
SLPS_257.81 | |||
<br>LUA | |||
<pre> | |||
apiRequest(1.4) | |||
eeNativeFunction(0x11fa9c, 0x0080402d, 'memcpy') | |||
eeNativeFunction(0x11fb48, 0x2cc20008, 'memset') | |||
eeInsnReplace(0x1279d0, 0x27bdffc0, 0x03e00008) -- <SyncDCache> | |||
eeInsnReplace(0x1279d4, 0xffb20020, 0x00000000) | |||
eeNativeHook (0x1279d0, 0x03e00008,'AdvanceClock',0xa00) | |||
eeInsnReplace(0x127b00, 0x27bdffc0, 0x03e00008) -- <InvalidDCache> | |||
eeInsnReplace(0x127b04, 0xffb20020, 0x00000000) | |||
eeNativeHook (0x127b00, 0x03e00008,'AdvanceClock',0xa00) | |||
eeInsnReplace(0x12a258, 0x3c19ffff, 0x03e00008) -- <sceSifWriteBackDCache> | |||
eeInsnReplace(0x12a25c, 0x3739ffc0, 0x00000000) | |||
eeNativeHook (0x12a258, 0x03e00008,'AdvanceClock',0x1700) | |||
require("ee-gpr-alias") | |||
local eeObj = getEEObject() | |||
local emuObj = getEmuObject() | |||
-- *** viBufBeginPut (1) | |||
--eeInsnReplace(0x105628, 0x0c049c78, 0) -- jal 1271e0 <WaitSema> | |||
eeInsnReplace(0x1056c8, 0x0c049c70, 0) -- jal 1271c0 <SignalSema> | |||
-- *** viBufEndPut (1) | |||
eeInsnReplace(0x105708, 0x0c049c78, 0) -- jal 1271e0 <WaitSema> | |||
--eeInsnReplace(0x105730, 0x0c049c70, 0) -- jal 1271c0 <SignalSema> | |||
-- *** viBufFlush (1) | |||
--eeInsnReplace(0x105a88, 0x0c049c78, 0) -- jal 1271e0 <WaitSema> | |||
--eeInsnReplace(0x105ab8, 0x0c049c70, 0) -- jal 1271c0 <SignalSema> | |||
-- *** viBufPutTs (1) | |||
eeInsnReplace(0x105c10, 0x0c049c78, 0) -- jal 1271e0 <WaitSema> | |||
eeInsnReplace(0x105cf4, 0x0c049c70, 0) -- jal 1271c0 <SignalSema> | |||
-- it's redundant calling of _waitIpuIdle in libmpeg... not so huge impact tho. | |||
eeInsnReplace(0x118620, 0x0c04672a, 0) -- jal 119ca8 <_waitIpuIdle> | |||
-- | -- bug# 9972 | ||
local emuObj = getEmuObject() | |||
emuObj.SetGsTitleFix( "ignoreSubBuffCov", "reserved", { } ) | |||
#Crash/stall fixes.</pre> | |||
====Grand Theft Auto III==== | |||
SLUS_200.62 | |||
<br>CLI | |||
<pre>--vu1-no-clamping=0 | |||
--gs-check-trans-rejection=1 | |||
--gs-kernel-cl-up="up2x2tc" | |||
--gs-optimize-30fps=1 | |||
--ee-hook=0x27cea8,FastForwardClock | |||
#Performance and graphical fix.</pre> | |||
SLUS_200.62 | |||
<br>LUA | |||
<pre> | |||
apiRequest(0.1) -- request version 0.1 API. Calling apiRequest() is mandatory. | |||
-- | -- Performace fix | ||
local emuObj = getEmuObject() | |||
local thresholdArea = 600 | |||
local | emuObj.SetGsTitleFix( "ignoreUpRender", thresholdArea , {alpha=0x80008068 , zmsk=1 } ) | ||
-- Bug#9133 | |||
-- Bug#9133 | -- workaround ... -16020(gp) value is something wrong. the value comes from CCamera::Process(). | ||
-- workaround ... -16020(gp) value is something wrong. the value comes from CCamera::Process(). | -- unfortunately accurate math or any other flags don't help for this problem, | ||
-- unfortunately accurate math or any other flags don't help for this problem, | -- even though it should be calculation error issue. | ||
-- even though it should be calculation error issue. | -- for here, it's just given 0 radian for CSprite::RenderBufferedOneXLUSprite_Rotate_Dimension() | ||
-- for here, it's just given 0 radian for CSprite::RenderBufferedOneXLUSprite_Rotate_Dimension() | -- actually the cloud is a billboard, so it should have 0 degree in view-space. | ||
-- actually the cloud is a billboard, so it should have 0 degree in view-space. | -- so given 0 degree must be OK.... but could cause some corruption (wrong perspective or something) | ||
-- so given 0 degree must be OK.... but could cause some corruption (wrong perspective or something) | eeInsnReplace(0x318344, 0xc792c16c, 0x44809000) -- lwc1 $f18,-16020(gp) | ||
eeInsnReplace(0x318344, 0xc792c16c, 0x44809000) -- lwc1 $f18,-16020(gp) | #Performance fix.</pre> | ||
</pre> | |||
SLUS_200.62 | SLUS_200.62 | ||
Line 9,040: | Line 1,351: | ||
--vu1-clamp-range=0x04a,0x069 | --vu1-clamp-range=0x04a,0x069 | ||
--gs-use-deferred-l2h=0 | --gs-use-deferred-l2h=0 | ||
</pre> | #Performance optimisation/fix.</pre> | ||
SLUS_209.46 | SLUS_209.46 | ||
Line 9,063: | Line 1,374: | ||
local thresholdArea = 700 | local thresholdArea = 700 | ||
emuObj.SetGsTitleFix( "ignoreUpRender", thresholdArea , {alpha=0x80000044 , zmsk=1 } ) | emuObj.SetGsTitleFix( "ignoreUpRender", thresholdArea , {alpha=0x80000044 , zmsk=1 } ) | ||
</pre> | #Performance and rendering fixes.</pre> | ||
SLUS_209.46 | SLUS_209.46 | ||
Line 9,354: | Line 1,665: | ||
</pre> | </pre> | ||
====Jak 3==== | ====Jak 3==== | ||
'''LUA''' | '''LUA''' | ||
<br>SCUS-97330 | <br>SCUS-97330 | ||
Line 11,976: | Line 4,275: | ||
--ee-hook=0x1d1d60,AdvanceClock,0x27bdffb0,225 | --ee-hook=0x1d1d60,AdvanceClock,0x27bdffb0,225 | ||
--ee-hook=0x1d71e0,AdvanceClock,0x0c09a4d0,100 | --ee-hook=0x1d71e0,AdvanceClock,0x0c09a4d0,100 | ||
</pre> | #Fix crane issue, and probably fixing lightsourcing.</pre> | ||
SLUS_208.27 | SLUS_208.27 | ||
Line 12,013: | Line 4,312: | ||
eeObj.AddHookJT(0x1d71f8, 0x10000036, FixBug9277) | eeObj.AddHookJT(0x1d71f8, 0x10000036, FixBug9277) | ||
#Further bug fixes as well as fixing bloom/overglare from lightsources.</pre> | #Further bug fixes as well as fixing bloom/overglare from lightsources.</pre> | ||
====Max Payne==== | ====Max Payne==== | ||
SLES_503.26 | SLES_503.26 | ||
Line 12,320: | Line 4,618: | ||
emuObj.SetGsTitleFix( "ignoreAreaUpdate", 0, { alpha=0x00000000 } ) | emuObj.SetGsTitleFix( "ignoreAreaUpdate", 0, { alpha=0x00000000 } ) | ||
emuObj.SetGsTitleFix( "ignoreAreaUpdate", 0, { alpha=0x80000048 } ) | emuObj.SetGsTitleFix( "ignoreAreaUpdate", 0, { alpha=0x80000048 } ) | ||
</pre> | </pre> | ||
Line 12,749: | Line 4,972: | ||
local advanceClockForGame = function() advanceClockForAny(5300000, 2700000) end | local advanceClockForGame = function() advanceClockForAny(5300000, 2700000) end | ||
eeObj.AddHookJT(0x207cf8, 0x27bdfff0, advanceClockForGame) -- <GameApp::EndFrame()>: | eeObj.AddHookJT(0x207cf8, 0x27bdfff0, advanceClockForGame) -- <GameApp::EndFrame()>: | ||
</pre> | #Performance and optimisations</pre> | ||
====Red Faction==== | ====Red Faction==== | ||
Line 12,920: | Line 5,143: | ||
<pre>--gs-kernel-cl-up="up2x2skipinterp" | <pre>--gs-kernel-cl-up="up2x2skipinterp" | ||
--gs-optimize-30fps=1 | --gs-optimize-30fps=1 | ||
</pre> | #visual fixes and performance optimisation.</pre> | ||
SCUS_974_90 | SCUS_974_90 | ||
Line 12,930: | Line 5,153: | ||
-- See https://pss.usrd.scea.com/bugzilla/show_bug.cgi?id=8404 | -- See https://pss.usrd.scea.com/bugzilla/show_bug.cgi?id=8404 | ||
eeInsnReplace(0x124898, 0x3442ffff, 0x3442fffe) -- ori v0,v0,0xffff | eeInsnReplace(0x124898, 0x3442ffff, 0x3442fffe) -- ori v0,v0,0xffff | ||
</pre> | #unsure what this fixes.</pre> | ||
====Rise of the Kasai==== | ====Rise of the Kasai==== | ||
Line 13,657: | Line 5,880: | ||
-- Karla Quiros Manager Business Finance & Ops | -- Karla Quiros Manager Business Finance & Ops | ||
-- Special thanks to A-R&D | -- Special thanks to A-R&D | ||
</pre> | </pre> | ||
Line 14,108: | Line 6,326: | ||
-- NOTE: new libarary also loops just 500dec around. 0x1389 is too much. | -- NOTE: new libarary also loops just 500dec around. 0x1389 is too much. | ||
eeInsnReplace(0x0020CF80, 0x28421389, 0x28420200) -- slti v0,v0,0x1389 | eeInsnReplace(0x0020CF80, 0x28421389, 0x28420200) -- slti v0,v0,0x1389 | ||
</pre> | #Performance and stall fixes.</pre> | ||