From eaf7fa6e6a4d63730e0bedea50b7eb9611324bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Sun, 31 Mar 2024 14:33:46 +0800 Subject: [PATCH] yuzu Update yuzusuyu.cpp Update yuzusuyu.cpp --- LunaHook/engine64/yuzusuyu.cpp | 54 ++++++++++++++++++++++++ LunaHook/engines/ppsspp/specialgames.hpp | 7 --- 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/LunaHook/engine64/yuzusuyu.cpp b/LunaHook/engine64/yuzusuyu.cpp index 75ca7b9..8178b8f 100644 --- a/LunaHook/engine64/yuzusuyu.cpp +++ b/LunaHook/engine64/yuzusuyu.cpp @@ -387,6 +387,34 @@ bool F0100F7E00DFC8000(void* data, size_t* len, HookParam* hp){ s = std::regex_replace(s, std::wregex(L"#P\\(.*\\)"), L""); return write_string_overwrite(data,len,s); } + + +void T0100982015606000(hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* split, size_t* len){ + auto address=emu_arg(stack)[1]; + *len=(*(DWORD*)(address+0x10))*2; + *data=address+0x14; +} + +bool F0100982015606000(void* data, size_t* len, HookParam* hp){ + auto s=std::wstring((wchar_t*)data,*len/2); + s = std::regex_replace(s, std::wregex(L"\\n+|(\\\\n)+"), L" "); + return write_string_overwrite(data,len,s); +} + + +bool F0100925014864000(void* data, size_t* len, HookParam* hp){ + auto s=std::string((char*)data,*len); + s = std::regex_replace(s, std::regex("(#n)+"), " "); + s = std::regex_replace(s, std::regex("(#[A-Za-z]+\\[(\\d*[.])?\\d+\\])+"), ""); + return write_string_overwrite(data,len,s); +} + +bool F0100936018EB4000(void* data, size_t* len, HookParam* hp){ + auto s=std::wstring((wchar_t*)data,*len/2); + s = std::regex_replace(s, std::wregex(L"<[^>]+>"), L""); + s = std::regex_replace(s, std::wregex(L"\n+"), L" "); + return write_string_overwrite(data,len,s); +} namespace{ auto _=[](){ emfunctionhooks={ @@ -430,6 +458,32 @@ auto _=[](){ {0x80057910 - 0x80004000,{"Cupid Parasite",simpleutf32getter<2>,F0100F7E00DFC8000,L"0100F7E00DFC8000",L"1.0.1"}},// name + text {0x80169df0 - 0x80004000,{"Cupid Parasite",simpleutf32getter<0>,F0100F7E00DFC8000,L"0100F7E00DFC8000",L"1.0.1"}},// choice + + {0x80075190 - 0x80004000,{"Radiant Tale",simpleutf8getter<1>,F0100925014864000,L"0100925014864000",L"1.0.0"}},// prompt + {0x8002fb18 - 0x80004000,{"Radiant Tale",simpleutf8getter<0>,F0100925014864000,L"0100925014864000",L"1.0.0"}},// name + {0x8002fd7c - 0x80004000,{"Radiant Tale",simpleutf8getter<0>,F0100925014864000,L"0100925014864000",L"1.0.0"}},// text + + {0x80462DD4 - 0x80004000,{"MUSICUS",simpleutf8getter<0,1>,F01006590155AC000,L"01000130150FA000",L"1.0.0"}},// name + {0x80462DEC - 0x80004000,{"MUSICUS",simpleutf8getter<0>,F01006590155AC000,L"01000130150FA000",L"1.0.0"}},// dialogue 1 + {0x80480d4c - 0x80004000,{"MUSICUS",simpleutf8getter<0>,F01006590155AC000,L"01000130150FA000",L"1.0.0"}},// dialogue 2 + {0x804798e0 - 0x80004000,{"MUSICUS",simpleutf8getter<0>,F01006590155AC000,L"01000130150FA000",L"1.0.0"}},// choice + + + {0x80046700 - 0x80004000,{"CHAOS;HEAD NOAH",_0100978013276000,0,L"0100957016B90000",L"1.0.0"}}, + {0x8003A2c0 - 0x80004000,{"CHAOS;HEAD NOAH",_0100978013276000,0,L"0100957016B90000",L"1.0.0"}},// choice + {0x8003EAB0 - 0x80004000,{"CHAOS;HEAD NOAH",_0100978013276000,0,L"0100957016B90000",L"1.0.0"}},// TIPS list (menu) + {0x8004C648 - 0x80004000,{"CHAOS;HEAD NOAH",_0100978013276000,0,L"0100957016B90000",L"1.0.0"}},// system message + {0x80050374 - 0x80004000,{"CHAOS;HEAD NOAH",_0100978013276000,0,L"0100957016B90000",L"1.0.0"}},// TIPS (red) + + + {0x80ac4d88 - 0x80004000,{"Story of Seasons a Wonderful Life",simpleutf32getter<0>,F0100936018EB4000,L"0100936018EB4000",L"1.0.3"}},// Main text + {0x808f7e84 - 0x80004000,{"Story of Seasons a Wonderful Life",simpleutf32getter<0>,F0100936018EB4000,L"0100936018EB4000",L"1.0.3"}},// Item name + {0x80bdf804 - 0x80004000,{"Story of Seasons a Wonderful Life",simpleutf32getter<0>,F0100936018EB4000,L"0100936018EB4000",L"1.0.3"}},// Item description + + {0x81e75940 - 0x80004000,{"Hamefura Pirates",T0100982015606000,F0100982015606000,L"0100982015606000",L"1.0.0"}},// Hamekai.TalkPresenter$$AddMessageBacklog + {0x81c9ae60 - 0x80004000,{"Hamefura Pirates",T0100982015606000,F0100982015606000,L"0100982015606000",L"1.0.0"}},// Hamekai.ChoicesText$$SetText + {0x81eb7dc0 - 0x80004000,{"Hamefura Pirates",T0100982015606000,F0100982015606000,L"0100982015606000",L"1.0.0"}},// Hamekai.ShortStoryTextView$$AddText + }; return 1; }(); diff --git a/LunaHook/engines/ppsspp/specialgames.hpp b/LunaHook/engines/ppsspp/specialgames.hpp index 33b8b0c..26ad531 100644 --- a/LunaHook/engines/ppsspp/specialgames.hpp +++ b/LunaHook/engines/ppsspp/specialgames.hpp @@ -308,13 +308,6 @@ void QNPJH50909(hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* sp } namespace ppsspp{ std::unordered_mapemfunctionhooks= { - /* - 0x883b0bc: mainHandler.bind_(null, 2), // a2 - choices (un-formated) - 0x883cf04: mainHandler.bind_(null, 3), // a3 - choices + nameX2 - 0x883bf34: mainHandler.bind_(null, 1), // a1 - choices + dialogue + nameX2 <---- - 0x8836984: mainHandler.bind_(null, 1), // a1 - dialogue - 0x883cecc: mainHandler.bind_(null, 3), // a3 - dialogue - */ {0x883bf34,{"Shinigami to Shoujo",simple932getter<1>,ULJS00403_filter,L"ULJS00403"}}, {0x0886775c,{"Amagami",ULJS00339,0,L"ULJS00339"}},// String.length() {0x8814adc,{"Sekai de Ichiban Dame na Koi",simple932getter<0>,NPJH50909_filter,L"ULJM05878"}},// name + dialouge