From 869baf1ba1730a3d7f36f0b6871ab7c4e295af08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <1173718158@qq.com> Date: Sat, 30 Nov 2024 19:30:51 +0800 Subject: [PATCH] . --- .../LunaHook/engines/ppsspp/specialgames.hpp | 87 ++++++++++++++++++- 1 file changed, 85 insertions(+), 2 deletions(-) diff --git a/cpp/LunaHook/LunaHook/engines/ppsspp/specialgames.hpp b/cpp/LunaHook/LunaHook/engines/ppsspp/specialgames.hpp index f947c4e3..2d08e229 100644 --- a/cpp/LunaHook/LunaHook/engines/ppsspp/specialgames.hpp +++ b/cpp/LunaHook/LunaHook/engines/ppsspp/specialgames.hpp @@ -184,6 +184,12 @@ namespace ppsspp s = std::regex_replace(s, std::regex(R"((#[A-Za-z]+\[(\d*[.])?\d+\])+)"), ""); buffer->from(s); } + void ULJM05610(TextBuffer *buffer, HookParam *hp) + { + StringFilter(buffer, "#cr0", 4); + StringFilter(buffer, "#wa1", 4); + StringFilter(buffer, "#wa0", 4); + } void FULJM05603(TextBuffer *buffer, HookParam *) { @@ -439,16 +445,61 @@ namespace ppsspp s = std::regex_replace(s, std::regex(R"(\x81k(.*?)\x81l(.*))"), "$1"); buffer->from(s); } + void ULJM05874(TextBuffer *buffer, HookParam *hp) + { + StringFilter(buffer, "%K", 2); + StringFilter(buffer, "%P", 2); + } void ULJM06040_1(TextBuffer *buffer, HookParam *hp) { - StringFilter(buffer, "%K%P", 4); - StringFilterBetween(buffer, "\x81k", 2, "\x81l", 2); + StringFilter(buffer, "%K", 2); + StringFilter(buffer, "%P", 2); + // StringFilterBetween(buffer, "\x81k", 2, "\x81l", 2);//〔ちなつ?〕〔直樹☆〕,人名,但可能不全,甚至包含剧透。想了一下还是留下吧 + StringFilter(buffer, "\x81\x99", 2); // ☆ + StringReplacer(buffer, "\x84\xa5", 2, "\x81\x5b", 2); StringReplacer(buffer, "\x84\xa7", 2, "\x81\x5b", 2); auto s = buffer->strA(); s = std::regex_replace(s, std::regex(R"(\{(.*?)\}\[(.*?)\])"), "$1"); buffer->from(s); } + void ULJM05282(TextBuffer *buffer, HookParam *hp) + { + static std::wstring last; + auto s = buffer->viewW(); + if (s == last) + return buffer->clear(); + last = s; + } + void ULJM06343(TextBuffer *buffer, HookParam *hp) + { + auto s = buffer->strA(); + static auto katakanaMap = std::map{ + {L"「", L"「"}, {L"」", L"」"}, {L"ァ", L"ぁ"}, {L"ィ", L"ぃ"}, {L"ゥ", L"ぅ"}, {L"ェ", L"ぇ"}, {L"ォ", L"ぉ"}, {L"ャ", L"ゃ"}, {L"ュ", L"ゅ"}, {L"ョ", L"ょ"}, {L"ア", L"あ"}, {L"イ", L"い"}, {L"ウ", L"う"}, {L"エ", L"え"}, {L"オ", L"お"}, {L"カ", L"か"}, {L"キ", L"き"}, {L"ク", L"く"}, {L"ケ", L"け"}, {L"コ", L"こ"}, {L"サ", L"さ"}, {L"シ", L"し"}, {L"ス", L"す"}, {L"セ", L"せ"}, {L"ソ", L"そ"}, {L"タ", L"た"}, {L"チ", L"ち"}, {L"ツ", L"つ"}, {L"テ", L"て"}, {L"ト", L"と"}, {L"ナ", L"な"}, {L"ニ", L"に"}, {L"ヌ", L"ぬ"}, {L"ネ", L"ね"}, {L"ノ", L"の"}, {L"ハ", L"は"}, {L"ヒ", L"ひ"}, {L"フ", L"ふ"}, {L"ヘ", L"へ"}, {L"ホ", L"ほ"}, {L"マ", L"ま"}, {L"ミ", L"み"}, {L"ム", L"む"}, {L"メ", L"め"}, {L"モ", L"も"}, {L"ヤ", L"や"}, {L"ユ", L"ゆ"}, {L"ヨ", L"よ"}, {L"ラ", L"ら"}, {L"リ", L"り"}, {L"ル", L"る"}, {L"レ", L"れ"}, {L"ロ", L"ろ"}, {L"ワ", L"わ"}, {L"ヲ", L"を"}, {L"ン", L"ん"}, {L"ー", L"ー"}, {L"ッ", L"っ"}, {L"、", L"、"}, {L"゚", L"?"}, {L"゙", L"!"}, {L"・", L"…"}, {L"?", L" "}, {L"。", L"。"}, {L"\uF8F0", L""}, {L"\uFFFD", L""} // invalid (shift_jis A0 <=> EF A3 B0) | FF FD - F8 F0) + }; + auto remap = [](std::string &s) + { + std::wstring result; + auto ws = StringToWideString(s, 932).value(); + for (auto _c : ws) + { + std::wstring c; + c.push_back(_c); + if (katakanaMap.find(c) != katakanaMap.end()) + { + result += katakanaMap[c]; + } + else + result += c; + } + result = std::regex_replace(result, std::wregex(LR"(\$\[(.*?)\$/(.*?)\$\])"), L"$1"); + result = std::regex_replace(result, std::wregex(LR"(\$C\[(.*?)\])"), L""); + result = std::regex_replace(result, std::wregex(LR"(\$\w)"), L""); + result = std::regex_replace(result, std::wregex(LR"(@)"), L""); + return WideStringToString(result, 932); + }; + buffer->from(remap(s)); + } void ULJS00169(TextBuffer *buffer, HookParam *hp) { CharFilter(buffer, '\n'); @@ -667,6 +718,38 @@ namespace ppsspp {0x893FF00, {0, 0, 0, 0, NPJH50535, "NPJH50535"}}, // アンチェインブレイズ レクス {0x88FD624, {CODEC_UTF8, 4, 0, 0, ULJM05756, "ULJM05756"}}, + // 密室のサクリファイス ~イトカ:ある閉鎖施設からの脱出~ + {0x8861A08, {0, 1, 0, 0, 0, "NPJH00065"}}, + // ココロコネクト ヨチランダム + {0x8837BB8, {0, 1, 0, 0, 0, "NPJH50682"}}, + // 俺の妹がこんなに可愛いわけがない ポータブル が続くわけがない Disc1 + {0x88608B8, {CODEC_UTF16, 2, 0, 0, 0, "NPJH50568"}}, + // 俺の妹がこんなに可愛いわけがない ポータブル が続くわけがない Disc2 + {0x8860724, {CODEC_UTF16, 2, 0, 0, 0, "NPJH50569"}}, + // AIR + {0x880C774, {CODEC_UTF16, 0, 0, 0, ULJM05282, "ULJM05282"}}, + // 蝶の毒 華の鎖~大正艶恋異聞~ + {0x883451C, {0, 0, 0, 0, ULJM06343, "ULJM06343"}}, + // Black Robinia + {0x8850800, {0, 0, 0, 0, 0, "NPJH50394"}}, + // ワンド オブ フォーチュン ポータブル + {0x88878A0, {0, 0, 0, 0, ULJM05943F, "ULJM05689"}}, + // Remember11 -the age of infinity- + {0x881BECC, {0, 0, 0, 0, 0, "ULJM05444"}}, + // のーふぇいと! ~only the power of will~ + {0x889A888, {0, 0, 0, 0, ULJM05610, "ULJM05610"}}, + // 薄桜鬼 遊戯録弐 祭囃子と隊士達 + {0x883E84C, {0, 1, 0, 0, ULJM05943F, "ULJM06165"}}, + // メモリーズオフ ゆびきりの記憶 ふたりの風流庵 + {0x8863D5C, {0, 3, 0, 0, ULJM05874, "ULJM05874"}}, + // メモリーズオフ ゆびきりの記憶 + {0x88A50B0, {0, 1, 0, 0, ULJM06040_1, "ULJM05875"}}, + // CLANNAD 光見守る坂道で 上巻 + {0x8850950, {0, 0xC, 0, 0, 0, "NPJH50266"}}, + // CLANNAD 光見守る坂道で 下巻 + {0x8853844, {0, 0xC, 0, 0, 0, "NPJH50273"}}, + // CLANNAD + {0x880F240, {CODEC_UTF16, 0, 0, 0, ULJM05282, "ULJM0533[89]"}}, // ULJM05338 & ULJM05339 }; } \ No newline at end of file