aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/ips_layer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ips_layer] read magic from IPS file and fix EOF check (#4469)PavelBARABANOV2026-09-231-4/+7
| | | | | | | | | | | | | | | | | - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- PatchIPS was reading the magic bytes from the target file instead of the IPS patch, and IsEOF used a strict > comparison that never matched for 3-byte IPS EOF markers. This caused IPS patches to be silently skipped, breaking the Russian localization mod for Persona 5. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4469 Reviewed-by: lizzie <lizzie@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [ips] fix .pchtxt with >256 bytes on a single line (#4445)lizzie2026-09-171-18/+18
| | | | | | | | | | | | | | | | It wasn't correct to assume pchtxt would've been less than 256 bytes per line. Signed-off-by: lizzie <lizzie@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4445 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [ips_layer] remove trailing whitespace to fix hex parsing on TLTD mods (#4336)lizzie2026-09-091-5/+12
| | | | | | | | | | | | | | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- ...another edge case, this time with `00297f24 34008052 // 60FPS` would get parsed as `34008052 ` which isn't quite correct Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4336 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Maufeat <sahyno1996@gmail.com>
* [common] Switch to boost::unordered_flat containers (#4326)crueter2026-08-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces all instances of ankerl's unordered map/set with boost's `unordered_flat_*` classes. This uses std::hash since boost::hash is actually a lot slower. Also adds an abstraction layer in `Common` so future changes are quicker and easier. Other implementation details: - ankerl provided hash specializations for tuple and pair, so those were ported here - std::erase_if doesn't work on boost, so just used the ADL'd erase_if This should be about equal or superior performance as unordered_dense for everything except iteration. Signed-off-by: crueter <crueter@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4326 Reviewed-by: Lizzie and Samuel <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [core/file_sys] fix IPS not applying due to wrong NSObuild-id (#4323)lizzie2026-08-301-31/+57
| | | | | | | | | | | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- NSO build id was being read wrongly... oops also fixed some minor issues as well Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4323 Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [file_sys] robust-er IPSwitch compiler (#3911)lizzie2026-08-301-231/+158
| | | | | | | | | | | | | | | | | | | | | | | | this PR reworks IPS parser to be less stupid what do i mean by this? well generally give it a bit of love so it doesn't do a lot of unsound allocations also simplify the logic greatly (and use memcmp() string idiom instead of trusting the compiler so blindly...) no this doesn't mean to uber optimize IPS to handle 999 gb/s it's more so it doesn't outright crash with edge cases as the previous codebase was quite spaghetty also the major overhead is obviously the vector shenanigans and the I/O -- but thats out of scope Test that IPSwitch mods still properly work WITH ANY GAME IF THERE IS ANY REGRESSION IN SOME GAME/MOD THEN TELL ME Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3911 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [fmt] use {#:x} instead of 0x{:#x} (#4170)lizzie2026-07-251-1/+1
| | | | | | | | | | continuation of #309 but applying to even more files than before :) also makes them lowercase because `0xfafafa` is better as `0XFAFAFA` Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4170 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Maufeat <sahyno1996@gmail.com>
* [fs] fix crash on '#' comments in pchtxt patches (#4124)crueter2026-07-251-1/+1
| | | | | | | | | | | | | Adds `#` as a valid pchtxt comment, and fixes a crash that could occur when using odd-length values This patch was sent by Adam Kittelson <adam@apathydrive.com> Signed-off-by: crueter <crueter@eden-emu.dev> Co-authored-by: Cole Avenue <cole@melisand.re> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4124 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Lizzie <lizzie@eden-emu.dev>
* [common/logging] Simplify logging logic and fix issues when logging before ↵lizzie2026-03-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | system is created (#3688) - our logging code was bigger than spdlog itself, why???? just keep it simple - fix issues when logging before logging system is even started - removes the "initialized logging twice" issue - removes uneeded indirection in file logging - uses direct formatting instead of jumping hoopla-around the fmt::format() ressult - code duplication and dead code removal as usual I did explore dup2() but I think it's not worth the hassle I did try `fwopen()` but it's better if things are just kept as-is. there is a lot of noise because I removed a bunch of redundant files on logging and just put everything in one file now normally this wouldn't be a good idea, however consider: the complexity of logging; it's less than 500 lines... does it really need a whole subsystem?!?!?! ITS JUST LOGGING Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3688 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <chimera@dravee.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [cheats] Check for comments in patch line loop (#156)notenergydrinks2025-07-311-2/+7
| | | | | | | | My test case is this file, after line 27 is not marked as patch because it's after `@` tag but rest is patch lines including comments. <https://github.com/RAMDRAGONS/BlitzPatches/blob/2ac3ff239f261a99398007402e4308e41bd8ad9e/1.0.0.pchtxt#L31> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/156 Co-authored-by: notenergydrinks <notenergydrinks@eden-emu.dev> Co-committed-by: notenergydrinks <notenergydrinks@eden-emu.dev>
* vfs: Move vfs files to their own directoryFearlessTobi2024-01-251-1/+1
|
* ips_layer: prevent out of bounds access with offset exceeding module sizeLiam2023-12-281-0/+7
|
* ips_layer: Remove uncaught usage of stoul/lllat9nq2023-09-131-2/+2
|
* remove static from pointer sized or smaller types for aesthetics, change ↵arades792023-02-141-4/+4
| | | | | | constexpr static to static constexpr for consistency Signed-off-by: arades79 <scravers@protonmail.com>
* add static lifetime to constexpr values to force compile time evaluation ↵arades792023-02-141-4/+4
| | | | | | where possible Signed-off-by: arades79 <scravers@protonmail.com>
* core/file_sys: fix alignment of BuildIdLiam2022-08-211-1/+1
|
* core/file_sys: fix BuildId paddingLiam2022-08-191-3/+1
|
* ips_layer: Delimit parsed hex value stringMorph2022-08-121-1/+2
| | | | Delimits the hex value string on spaces, slashes, carriage returns or newlines, allowing for comments to be added in-line.
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* Revert "core: Fix clang build"bunnei2020-10-201-27/+14
|
* core: Fix clang buildLioncash2020-10-171-14/+27
| | | | | | | Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
* core/CMakeLists: Make some warnings errorsLioncash2020-10-131-1/+1
| | | | | | | | | Makes our error coverage a little more consistent across the board by applying it to Linux side of things as well. This also makes it more consistent with the warning settings in other libraries in the project. This also updates httplib to 0.7.9, as there are several warning cleanups made that allow us to enable several warnings as errors.
* ips_layer: Eliminate a redundant copy in Parse()Lioncash2020-09-221-2/+4
| | | | Prevents unnecessary copying of the line being parsed.
* Merge pull request #2581 from lioncash/hexZach Hilman2019-06-151-1/+1
|\ | | | | common/hex_util: Combine HexVectorToString() and HexArrayToString()
| * common/hex_util: Combine HexVectorToString() and HexArrayToString()Lioncash2019-06-121-1/+1
| | | | | | | | | | | | These can be generified together by using a concept type to designate them. This also has the benefit of not making copies of potentially very large arrays.
* | file_sys/ips_layer: Remove unnecessary reserve() callLioncash2019-06-121-1/+0
|/ | | | | | Given 'replace' is assigned to on the following line, this isn't necessary, given the underlying data is going to be overwritten entirely.
* global: Use std::optional instead of boost::optional (#1578)Frederic L2018-10-301-2/+2
| | | | | | | | | | | | | | | | * get rid of boost::optional * Remove optional references * Use std::reference_wrapper for optional references * Fix clang format * Fix clang format part 2 * Adressed feedback * Fix clang format and MacOS build
* ips_layer: Use rle_size instead of data_size in RLE patch applicationZach Hilman2018-10-251-1/+1
| | | | Prevents a potential bug when using RLE records in an IPS patch.
* Merge pull request #1461 from lioncash/warnbunnei2018-10-091-3/+3
|\ | | | | ips_layer: Silence truncation and conversion warnings
| * ips_layer: Silence truncation and conversion warningsLioncash2018-10-091-3/+3
| | | | | | | | Makes type conversions explicit to avoid compiler warnings.
* | ips_layer: Avoid constructing std::vector instances where not necessaryLioncash2018-10-091-6/+25
| | | | | | | | | | | | We can just compare the existing std::vector instance with a constexpr std::array containing the desired match. This is lighter resource-wise, as we don't need to allocate on the heap.
* | ips_layer: Remove unnecessary explicit std::pair constructor in std::arrayLioncash2018-10-091-5/+13
| | | | | | | | | | Makes the layout of the array consistent, by making all elements match, instead of special-casing the first one.
* | ips_layer: Add missing includesLioncash2018-10-091-1/+12
| | | | | | | | | | | | Adds missing includes to prevent potential compilation issues in the future. Also moves the definition of a struct into the cpp file, so that some includes don't need to be introduced within the header.
* | ips_layer: std::move data within PatchIPS() and Apply()Lioncash2018-10-091-2/+5
|/ | | | | We don't need to make a copy of the read data, so we can std::move it into the make_shared call here.
* ips_layer: Fix inaccuracies with comments and flagsZach Hilman2018-10-041-15/+49
| | | Specifically bugs/crashes that arise when putting them in positions that are legal but not typical, such as midline, between patch data, or between patch records.
* ips_layer: Deduplicate resource usageZach Hilman2018-10-041-23/+25
|
* ips_layer: Add support for escape sequences and midline commentsZach Hilman2018-10-041-7/+38
| | | | More accurately follows IPSwitch specification.
* ips_layer: Add IPSwitchCompiler to process IPSwitch formatZach Hilman2018-10-041-0/+142
|
* file_sys: Implement function to apply IPS patchesZach Hilman2018-10-011-0/+88