From 145077f7779a34c1d9af0c3affc7b1876366784e Mon Sep 17 00:00:00 2001 From: rakisaionji Date: Sun, 10 Mar 2019 07:19:57 -0600 Subject: [PATCH 1/4] Adds volume control and move some fields outside of Update() --- DivaHook/rom/playerdata.ini | 7 ++++- DivaHook/src/Components/PlayerDataManager.cpp | 28 +++++++++++++++---- Prepatch/rom/patch.txt | 9 ++++-- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/DivaHook/rom/playerdata.ini b/DivaHook/rom/playerdata.ini index 2bd16db..08e3d50 100644 --- a/DivaHook/rom/playerdata.ini +++ b/DivaHook/rom/playerdata.ini @@ -18,4 +18,9 @@ module_equip[1] = 0 skin_equip = 0 # IDs defined in rom/gm_btn_se_tbl/gm_btn_se_id.bin -btn_se_equip = -1 \ No newline at end of file +btn_se_equip = -1 + +# Volume for buttons sound (from 0 to 100) +act_toggle = 1 +act_vol = 100 +hp_vol = 100 diff --git a/DivaHook/src/Components/PlayerDataManager.cpp b/DivaHook/src/Components/PlayerDataManager.cpp index 9d8626b..5442e2b 100644 --- a/DivaHook/src/Components/PlayerDataManager.cpp +++ b/DivaHook/src/Components/PlayerDataManager.cpp @@ -44,7 +44,7 @@ namespace DivaHook::Components setIfNotEqual(&playerData->level, customPlayerData->Level, 1); setIfNotEqual(&playerData->level_plate_id, customPlayerData->LevelPlateId, 0); - setIfNotEqual(&playerData->vocaloid_point, customPlayerData->VocaloidPoint, 0); + // setIfNotEqual(&playerData->vocaloid_point, customPlayerData->VocaloidPoint, 0); setIfNotEqual(&playerData->skin_equip, customPlayerData->SkinEquip, 0); setIfNotEqual(&playerData->btn_se_equip, customPlayerData->BtnSeEquip, -1); @@ -63,11 +63,11 @@ namespace DivaHook::Components playerData->level_name = (char*)customPlayerData->LevelName->c_str(); } - if (false && Input::Keyboard::GetInstance()->IsTapped(VK_F12)) - { - printf("PlayerDataManager::Update(): Loading config...\n"); - LoadConfig(); - } + // if (false && Input::Keyboard::GetInstance()->IsTapped(VK_F12)) + // { + // printf("PlayerDataManager::Update(): Loading config...\n"); + // LoadConfig(); + // } } void PlayerDataManager::LoadConfig() @@ -107,5 +107,21 @@ namespace DivaHook::Components customPlayerData->ModuleEquip[1] = parseInt("module_equip[1]"); customPlayerData->SkinEquip = parseInt("skin_equip"); customPlayerData->BtnSeEquip = parseInt("btn_se_equip"); + + // These values should not be overwritten + // And also can be saved and loaded if implemented + playerData->hp_vol = parseInt("hp_vol"); + playerData->act_vol = parseInt("act_vol"); + playerData->act_toggle = parseInt("act_toggle"); + playerData->vocaloid_point = parseInt("vocaloid_point"); + + // More fun can be achieved with these optional values + playerData->use_card = parseInt("use_card"); + playerData->freeplay = parseInt("freeplay"); + playerData->pv_sort_kind = parseInt("pv_sort_kind"); + playerData->use_pv_module_equip = parseInt("use_pv_module_equip"); + playerData->ch_pv_module_equip = parseInt("ch_pv_module_equip"); + playerData->use_pv_skin_equip = parseInt("use_pv_skin_equip"); + playerData->use_pv_btn_se_equip = parseInt("use_pv_btn_se_equip"); } } diff --git a/Prepatch/rom/patch.txt b/Prepatch/rom/patch.txt index 0a96b96..3809eea 100644 --- a/Prepatch/rom/patch.txt +++ b/Prepatch/rom/patch.txt @@ -3,7 +3,7 @@ // 2013-08-30T 14:41:15+09:00 # file: patch.txt # author: samyuu -# version: 4.00.00 +# version: 4.00.01 # date: 2019/03/10 # image_base: 0x00400C00 @@ -76,4 +76,9 @@ 0x0071717D : 0x0001 : 75 : EB // Jump past the VP SelWatch button enabled checks -0x00798108 : 0x0005 : E8 F3 01 E7 FF : EB 2D 90 90 90 \ No newline at end of file +0x00798108 : 0x0005 : E8 F3 01 E7 FF : EB 2D 90 90 90 + +// For debug purposes +// 0x0045AD12 : 0x0001 : 02 : 00 +// 0x0059F150 : 0x0002 : 32 C0 : B0 01 +// 0x0059F160 : 0x0002 : 32 C0 : B0 01 From 97c39f725b51161ffd42932212a9134ce66f9fc0 Mon Sep 17 00:00:00 2001 From: rakisaionji Date: Sun, 10 Mar 2019 07:42:05 -0600 Subject: [PATCH 2/4] Disable jittering Temporal AA thingy (by @lybxlpsv) --- Prepatch/rom/patch.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Prepatch/rom/patch.txt b/Prepatch/rom/patch.txt index 3809eea..3781b6c 100644 --- a/Prepatch/rom/patch.txt +++ b/Prepatch/rom/patch.txt @@ -78,6 +78,9 @@ // Jump past the VP SelWatch button enabled checks 0x00798108 : 0x0005 : E8 F3 01 E7 FF : EB 2D 90 90 90 +// Disable jittering Temporal AA thingy (by @lybxlpsv) +0x002E76D0 : 0x0004 : 8B 44 24 04 : 29 C0 90 90 + // For debug purposes // 0x0045AD12 : 0x0001 : 02 : 00 // 0x0059F150 : 0x0002 : 32 C0 : B0 01 From 5e01edf639a60f359e025a29a090b8fb0ebc27f2 Mon Sep 17 00:00:00 2001 From: rakisaionji Date: Sun, 10 Mar 2019 12:48:22 -0600 Subject: [PATCH 3/4] Adds ability to control default PV sorting in song select --- DivaHook/src/Components/CustomPlayerData.h | 1 + DivaHook/src/Components/PlayerDataManager.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DivaHook/src/Components/CustomPlayerData.h b/DivaHook/src/Components/CustomPlayerData.h index 6413c6d..ecaca6c 100644 --- a/DivaHook/src/Components/CustomPlayerData.h +++ b/DivaHook/src/Components/CustomPlayerData.h @@ -15,6 +15,7 @@ namespace DivaHook::Components int VocaloidPoint; int SkinEquip; int BtnSeEquip; + int PvSortKind; int ModuleEquip[2]; }; } diff --git a/DivaHook/src/Components/PlayerDataManager.cpp b/DivaHook/src/Components/PlayerDataManager.cpp index 5442e2b..fe2e9c1 100644 --- a/DivaHook/src/Components/PlayerDataManager.cpp +++ b/DivaHook/src/Components/PlayerDataManager.cpp @@ -47,6 +47,7 @@ namespace DivaHook::Components // setIfNotEqual(&playerData->vocaloid_point, customPlayerData->VocaloidPoint, 0); setIfNotEqual(&playerData->skin_equip, customPlayerData->SkinEquip, 0); setIfNotEqual(&playerData->btn_se_equip, customPlayerData->BtnSeEquip, -1); + setIfNotEqual(&playerData->pv_sort_kind, customPlayerData->PvSortKind, 2); for (int i = 0; i < sizeof(playerData->module_equip) / sizeof(int); i++) setIfNotEqual(&playerData->module_equip[i], customPlayerData->ModuleEquip[i], 0); @@ -107,6 +108,7 @@ namespace DivaHook::Components customPlayerData->ModuleEquip[1] = parseInt("module_equip[1]"); customPlayerData->SkinEquip = parseInt("skin_equip"); customPlayerData->BtnSeEquip = parseInt("btn_se_equip"); + customPlayerData->PvSortKind = parseInt("pv_sort_kind"); // These values should not be overwritten // And also can be saved and loaded if implemented @@ -118,7 +120,6 @@ namespace DivaHook::Components // More fun can be achieved with these optional values playerData->use_card = parseInt("use_card"); playerData->freeplay = parseInt("freeplay"); - playerData->pv_sort_kind = parseInt("pv_sort_kind"); playerData->use_pv_module_equip = parseInt("use_pv_module_equip"); playerData->ch_pv_module_equip = parseInt("ch_pv_module_equip"); playerData->use_pv_skin_equip = parseInt("use_pv_skin_equip"); From bf666a32b4785eeb13558f62d5b1f7fa02df7826 Mon Sep 17 00:00:00 2001 From: rakisaionji Date: Mon, 11 Mar 2019 04:18:00 -0600 Subject: [PATCH 4/4] Reverted to first commit of SE volume setting feature proposal --- DivaHook/src/Components/CustomPlayerData.h | 1 - DivaHook/src/Components/PlayerDataManager.cpp | 10 ---------- Prepatch/rom/patch.txt | 12 ++---------- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/DivaHook/src/Components/CustomPlayerData.h b/DivaHook/src/Components/CustomPlayerData.h index ecaca6c..6413c6d 100644 --- a/DivaHook/src/Components/CustomPlayerData.h +++ b/DivaHook/src/Components/CustomPlayerData.h @@ -15,7 +15,6 @@ namespace DivaHook::Components int VocaloidPoint; int SkinEquip; int BtnSeEquip; - int PvSortKind; int ModuleEquip[2]; }; } diff --git a/DivaHook/src/Components/PlayerDataManager.cpp b/DivaHook/src/Components/PlayerDataManager.cpp index fe2e9c1..dc5036d 100644 --- a/DivaHook/src/Components/PlayerDataManager.cpp +++ b/DivaHook/src/Components/PlayerDataManager.cpp @@ -47,7 +47,6 @@ namespace DivaHook::Components // setIfNotEqual(&playerData->vocaloid_point, customPlayerData->VocaloidPoint, 0); setIfNotEqual(&playerData->skin_equip, customPlayerData->SkinEquip, 0); setIfNotEqual(&playerData->btn_se_equip, customPlayerData->BtnSeEquip, -1); - setIfNotEqual(&playerData->pv_sort_kind, customPlayerData->PvSortKind, 2); for (int i = 0; i < sizeof(playerData->module_equip) / sizeof(int); i++) setIfNotEqual(&playerData->module_equip[i], customPlayerData->ModuleEquip[i], 0); @@ -108,7 +107,6 @@ namespace DivaHook::Components customPlayerData->ModuleEquip[1] = parseInt("module_equip[1]"); customPlayerData->SkinEquip = parseInt("skin_equip"); customPlayerData->BtnSeEquip = parseInt("btn_se_equip"); - customPlayerData->PvSortKind = parseInt("pv_sort_kind"); // These values should not be overwritten // And also can be saved and loaded if implemented @@ -116,13 +114,5 @@ namespace DivaHook::Components playerData->act_vol = parseInt("act_vol"); playerData->act_toggle = parseInt("act_toggle"); playerData->vocaloid_point = parseInt("vocaloid_point"); - - // More fun can be achieved with these optional values - playerData->use_card = parseInt("use_card"); - playerData->freeplay = parseInt("freeplay"); - playerData->use_pv_module_equip = parseInt("use_pv_module_equip"); - playerData->ch_pv_module_equip = parseInt("ch_pv_module_equip"); - playerData->use_pv_skin_equip = parseInt("use_pv_skin_equip"); - playerData->use_pv_btn_se_equip = parseInt("use_pv_btn_se_equip"); } } diff --git a/Prepatch/rom/patch.txt b/Prepatch/rom/patch.txt index 3781b6c..0a96b96 100644 --- a/Prepatch/rom/patch.txt +++ b/Prepatch/rom/patch.txt @@ -3,7 +3,7 @@ // 2013-08-30T 14:41:15+09:00 # file: patch.txt # author: samyuu -# version: 4.00.01 +# version: 4.00.00 # date: 2019/03/10 # image_base: 0x00400C00 @@ -76,12 +76,4 @@ 0x0071717D : 0x0001 : 75 : EB // Jump past the VP SelWatch button enabled checks -0x00798108 : 0x0005 : E8 F3 01 E7 FF : EB 2D 90 90 90 - -// Disable jittering Temporal AA thingy (by @lybxlpsv) -0x002E76D0 : 0x0004 : 8B 44 24 04 : 29 C0 90 90 - -// For debug purposes -// 0x0045AD12 : 0x0001 : 02 : 00 -// 0x0059F150 : 0x0002 : 32 C0 : B0 01 -// 0x0059F160 : 0x0002 : 32 C0 : B0 01 +0x00798108 : 0x0005 : E8 F3 01 E7 FF : EB 2D 90 90 90 \ No newline at end of file