diff --git a/source-code/data/patches/custom_freeplay_text_example.p b/source-code/data/patches/custom_freeplay_text_example.p index e3b4681..3780e39 100644 --- a/source-code/data/patches/custom_freeplay_text_example.p +++ b/source-code/data/patches/custom_freeplay_text_example.p @@ -4,7 +4,7 @@ IGNORE @1403BABEA:75 // ...enable it. # Custom FREE PLAY text -1409F61F0:!My text +1409F61F0:!Miku\0 // Syntax: // "#" console comment @@ -12,5 +12,5 @@ IGNORE // "@" omit patch console output // ":" address:bytes (hex) // " " byte byte -// ":!" address:!string +// ":!" address:!string ('\0' terminates the string, '\n' new line; both require PD Loader 2.1+) // "IGNORE" skip patch file \ No newline at end of file diff --git a/source-code/source/plugins/Patches/dllmain.cpp b/source-code/source/plugins/Patches/dllmain.cpp index db016e6..4069406 100644 --- a/source-code/source/plugins/Patches/dllmain.cpp +++ b/source-code/source/plugins/Patches/dllmain.cpp @@ -784,7 +784,7 @@ void ApplyPatches() { for (std::filesystem::path p : std::filesystem::directory_iterator("../patches")) { std::string extension = std::filesystem::path(p).extension().string(); - if ((extension == ".p" + std::to_string(game_version) || extension == ".P" + std::to_string(game_version))||(game_version == 710&&(extension == ".p" || extension == ".P"))) + if (extension == ".p" || extension == ".P" || extension == ".p2" || extension == ".P2") { std::cout << "[Patches] Reading custom patch file: " << std::filesystem::path(p).filename().string() << std::endl; ApplyCustomPatches(std::filesystem::path(p).wstring()); @@ -857,8 +857,22 @@ void ApplyCustomPatches(std::wstring CPATCH_FILE_STRING) std::vector fullColonSplit = SplitString(line, ":"); for (int i = 1; i < fullColonSplit[1].size(); i++) { - if (echo) std::cout << fullColonSplit[1].at(i); unsigned char byte_u = fullColonSplit[1].at(i); + if(byte_u=='\\' && i patch = { byte_u }; InjectCode((void*)address, patch); address++;