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 10: Line 10:


====ADK Damashii====
====ADK Damashii====
<br>CLI
'''CLI'''
<br>SLPS-25906
<pre>
<pre>
--gs-uprender=none
--gs-uprender=none
--gs-upscale=point
--gs-upscale=point
--force-frame-blend=1
--force-frame-blend=1
</pre>
<br>LUA
<pre>
-- ps2isd_hash=5c8433ad15a27ffa : GENERATED BY SCRIPT FOR LOCAL RUNENV USE ONLY (
-- Title:  ADK Tamashii PS2 - SLPS-25906 (JPN)
-- Author:  Ernesto Corvi
-- Changelog:
-- v1.1: Added video mode support
-- v1.4: Adjusted SNK logo timing
-- v1.5: Adjusted Main Volume
-- v2.0: Fixed Bug 10184
apiRequest(1.6) -- request version 1.6 API. Calling apiRequest() is mandatory.
local eeObj = getEEObject()
local emuObj = getEmuObject()
local gpr = require("ee-gpr-alias")
local kFilterMode, kWrapMode, kBlendMultiplier, kBlendFunc = require("sprite")
local PadConnectType = require("pad-connect-type")
HIDPad_Enable()
emuObj.SetVolumes(0.3, 1.0, 1.0);
local snklogo = 0
local scanlogos = 0
local L1 = function()
local flag = eeObj.GetGpr(gpr.a2)
if flag ~= 0 then
emuObj.ThrottleMax()
end
end
local L2 = function()
emuObj.ThrottleNorm()
end
eeObj.AddHook(0x175a40, 0x8c468650, L1)
eeObj.AddHook(0x19af40, 0x27bdfff0, L2)
-----------------------
-- Video Options
-----------------------
local SaveData = emuObj.LoadConfig(0)
if SaveData.vid_mode == nil then
SaveData.vid_mode      = 1
end
if SaveData.vid_scanlines == nil then
SaveData.vid_scanlines  = 1
end
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 texture8 = getTextureObject(8)
-- ------------------------------------------------------------
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 connected_p1 = 47
local connected_p2 = 47
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_scanlines_any_p.sb") -- (1) = Scanlines for SNK logo
emuObj.LoadFsShader(2, "./shader_SL480_p.sb") -- (2) = 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")
texture8.Load("./SNK_LOGO_sl.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 update_notifications_p1 = function()
if notify_animstate_p1 == STATE_STOPPED then
spr_p1_notify.Disable()
spr_p1d_notify.Disable()
return
end
L2()
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 update_notifications_p2 = function()
if notify_animstate_p2 == STATE_STOPPED then
spr_p2_notify.Disable()
spr_p2d_notify.Disable()
return
end
L2()
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 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
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_mode = function()
if snklogo == 1 then
sprite0.BindTexture(3)
sprite0.SetPosXY(0,0)
sprite0.SetSizeXY(1920,1080)
sprite0.SetPosUV(0,0)
sprite0.SetSizeUV(1920,1080)
else
sprite0.BindTexture(0)
sprite0.BindFragmentShader(0)
sprite0.SetPosXY((1920-1440)/2,0)
sprite0.SetSizeXY(1440,1080)
end
sprite0.Enable()
sprite1.Disable()
end
-- ---------------------------------------------------
-- Full Screen + ScanLines (480p)
-- ---------------------------------------------------
local scanlines_mode = function()
if snklogo == 1 then
sprite0.BindTexture(8)
sprite0.SetPosXY(0,0)
sprite0.SetSizeXY(1920,1080)
sprite0.SetPosUV(0,0)
sprite0.SetSizeUV(1920,1080)
sprite0.BindFragmentShader(1)
sprite0.SetShaderParams(scanlineParams)
else
sprite0.BindTexture(0)
sprite0.SetPosXY((1920-1440)/2,0)
sprite0.SetSizeXY(1440,1080)
sprite0.BindFragmentShader(2)
sprite0.SetShaderParams(scanlineParams)
end
sprite0.Enable()
sprite1.Disable()
end
-- ---------------------------------------------------
-- Bezel NoFX
-- ---------------------------------------------------
local bezel_mode = function(bezel)
if snklogo == 1 then
sprite0.BindTexture(3)
sprite0.SetPosXY(0,0)
sprite0.SetSizeXY(1920,1080)
sprite0.SetPosUV(0,0)
sprite0.SetSizeUV(1920,1080)
else
sprite0.BindTexture(0)
sprite0.BindFragmentShader(0)
sprite0.SetPosXY((1920-1280)/2, (1080-896)/2)
sprite0.SetSizeXY(1280,896)
end
sprite0.Enable()
sprite1.BindTexture(bezel)
sprite1.SetPosXY(0,0)
sprite1.SetSizeXY(1920,1080)
sprite1.SetPosUV(0,0)
sprite1.SetSizeUV(1920,1080)
sprite1.Enable()
end
-- ---------------------------------------------------
-- Bezel + ScanLines (480p)
-- ---------------------------------------------------
local bezel_scanlines_mode = function(bezel)
if snklogo == 1 then
sprite0.BindTexture(8)
sprite0.SetPosXY(0,0)
sprite0.SetSizeXY(1920,1080)
sprite0.SetPosUV(0,0)
sprite0.SetSizeUV(1920,1080)
sprite0.BindFragmentShader(1)
sprite0.SetShaderParams(scanlineParams)
else
sprite0.BindTexture(0)
sprite0.SetPosXY((1920-1280)/2, (1080-896)/2)
sprite0.SetSizeXY(1280,896)
sprite0.BindFragmentShader(2)
sprite0.SetShaderParams(scanlineParams)
end
sprite0.Enable()
sprite1.BindTexture(bezel)
sprite1.SetPosXY(0,0)
sprite1.SetSizeXY(1920,1080)
sprite1.SetPosUV(0,0)
sprite1.SetSizeUV(1920,1080)
sprite1.Enable()
end
local updateMode = function(mode, scanlines)
if scanlines == 1 then
if mode == 1 then
original_mode()
else
bezel_mode(mode - 1)
end
else
if mode == 1 then
scanlines_mode()
else
bezel_scanlines_mode(mode - 1)
end
end
local needsSave = (SaveData.vid_mode ~= mode or SaveData.vid_scanlines ~= scanlines)
if needsSave == true then
SaveData.vid_mode = mode
SaveData.vid_scanlines = scanlines
emuObj.SaveConfig(0, SaveData)
end
end
local vid_modeOptions = {"NONE", "ART1", "ART2"}
local vid_scanlineOptions = {"OFF", "ON"}
local vid_mode = SaveData.vid_mode
local vid_scanlines = SaveData.vid_scanlines
local updateVideoMode = function(mode)
if mode > 32 then
vid_mode = vid_mode - 1
elseif mode ~= 0 then
vid_mode = vid_mode + 1
end
if vid_mode < 1 then
vid_mode = #vid_modeOptions
elseif vid_mode > #vid_modeOptions then
vid_mode = 1
end
if mode ~= 0 then
updateMode(vid_mode, vid_scanlines)
end
end
local updateScanlineMode = function(mode)
if mode > 32 then
vid_scanlines = vid_scanlines - 1
elseif mode ~= 0 then
vid_scanlines = vid_scanlines + 1
end
if vid_scanlines < 1 then
vid_scanlines = #vid_scanlineOptions
elseif vid_scanlines > #vid_scanlineOptions then
vid_scanlines = 1
end
if mode ~= 0 then
updateMode(vid_mode, vid_scanlines)
end
end
local V1 = function()
local data = eeObj.GetGpr(gpr.v1)
local menu = eeObj.GetGpr(gpr.a3)
local buf = eeObj.GetGpr(gpr.a2)
if menu == 17 then -- Position X (Artwork)
local mode = eeObj.ReadMem32(data + 0x10)
updateVideoMode(mode)
eeObj.WriteMemStrZ(buf, vid_modeOptions[vid_mode])
eeObj.SetGpr(gpr.a3, 0)
if mode ~= 0 then
eeObj.WriteMem32(data + 0x10, 0)
end
elseif menu == 18 then -- Position Y (Scanlines)
local mode = eeObj.ReadMem32(data + 0x14)
updateScanlineMode(mode)
eeObj.WriteMemStrZ(buf, vid_scanlineOptions[vid_scanlines])
eeObj.SetGpr(gpr.a3, 0)
if mode ~= 0 then
eeObj.WriteMem32(data + 0x14, 0)
end
end
end
eeObj.AddHook(0x16c13c, 0x268300a0, V1)
eeInsnReplace(0x16BB64, 0x8e420010, 0x0040202d) -- move $a0, $v0
eeInsnReplace(0x16BC0C, 0x8e420014, 0x0040202d) -- move $a0, $v0
eeObj.AddHook(0x180f40, 0x26300010, function()
local addr = eeObj.GetGpr(gpr.s0)
local posx = {0x07, 0x00, 0x00, 0x03, 0x01, 0x82, 0x6f, 0x82, 0x6e, 0x82, 0x72, 0x82, 0x68, 0x82, 0x73, 0x82, 0x68, 0x82, 0x6e, 0x82, 0x6d, 0x81, 0x40, 0x82, 0x77}
local posy = {0x07, 0x00, 0x00, 0x03, 0x01, 0x82, 0x6f, 0x82, 0x6e, 0x82, 0x72, 0x82, 0x68, 0x82, 0x73, 0x82, 0x68, 0x82, 0x6e, 0x82, 0x6d, 0x81, 0x40, 0x82, 0x78}
local artw = {0x07, 0x00, 0x00, 0x03, 0x01, 0x81, 0x40, 0x82, 0x60, 0x82, 0x71, 0x82, 0x73, 0x82, 0x76, 0x82, 0x6e, 0x82, 0x71, 0x82, 0x6a, 0x81, 0x40, 0x81, 0x40}
local scan = {0x07, 0x00, 0x00, 0x03, 0x01, 0x82, 0x72, 0x82, 0x62, 0x82, 0x60, 0x82, 0x6d, 0x82, 0x6b, 0x82, 0x68, 0x82, 0x6d, 0x82, 0x64, 0x82, 0x72, 0x81, 0x40}
local found = true
for x = 1, #posx - 1 do
if eeObj.ReadMem8(addr+x-1) ~= posx[x] then
found = false
break
end
end
if found == true then
local repl
if eeObj.ReadMem8(addr+#posx-1) == posx[#posx] then
repl = artw
else
repl = scan
end
for x = 1, #repl do
eeObj.WriteMem8(addr+x-1, repl[x])
end
end
end)
-- Fight stick
local pad = function()
updateMode(SaveData.vid_mode, SaveData.vid_scanlines)
emuObj.AddVsyncHook(update_notifications_p1)
emuObj.AddVsyncHook(update_notifications_p2)
end
emuObj.AddPadHook(onHIDPadEvent)
emuObj.AddEntryPointHook(pad)
-- replace SNK logo
local scanlogos_on = function()
scanlogos = 1
updateMode(SaveData.vid_mode, SaveData.vid_scanlines)
end
local logos_anim = function()
if scanlogos == 1 then
local a0 = eeObj.GetGpr(gpr.a0)
local a1 = eeObj.GetGpr(gpr.a1)
-- print(string.format("anim: %08x, %08x", a0, a1))
if a1 == 2 then
local a040 = eeObj.ReadMem32(a0+0x40)
local a050 = eeObj.ReadMem32(a0+0x50)
-- print(string.format("stage 2: %08x, %08x", a040, a050))
if a050 == 0 and a040 ~= 0 then
local curFrame = eeObj.ReadMem32(a040+0x50)
-- print(string.format("stage 3: %08x", curFrame))
if curFrame == 0x9e then
print("SNK logo on")
snklogo = 1
updateMode(SaveData.vid_mode, SaveData.vid_scanlines)
end
elseif a050 == 2 then
print("SNK logo off")
snklogo = 0
updateMode(SaveData.vid_mode, SaveData.vid_scanlines)
scanlogos = 0
end
end
end
end
eeObj.AddHook(0x10026C, 0x0220202d, scanlogos_on)
eeObj.AddHook(0x16EAF0, 0x27bdff80, logos_anim)
</pre>
</pre>


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)