PavelBARABANOV
3266c20e3f
[ips_layer] read magic from IPS file and fix EOF check ( #4469 )
...
- [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 >
2026-09-23 00:36:47 +02:00
lizzie
14235dc0d0
[ips] fix .pchtxt with >256 bytes on a single line ( #4445 )
...
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 >
2026-09-17 08:15:58 +02:00
lizzie
ed57836903
[ips_layer] remove trailing whitespace to fix hex parsing on TLTD mods ( #4336 )
...
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 >
2026-09-09 13:01:40 +02:00
crueter
7fda6dde73
[common] Switch to boost::unordered_flat containers ( #4326 )
...
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 >
2026-08-31 02:58:09 +02:00
lizzie
106a61c943
[core/file_sys] fix IPS not applying due to wrong NSObuild-id ( #4323 )
...
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 >
2026-08-30 20:08:40 +02:00
lizzie
672bcbae01
[file_sys] robust-er IPSwitch compiler ( #3911 )
...
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 >
2026-08-30 08:10:51 +02:00
lizzie
58dee53305
[fmt] use {#:x} instead of 0x{:#x} ( #4170 )
...
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 >
2026-07-25 21:47:07 +02:00
crueter
b9a88297cb
[fs] fix crash on '#' comments in pchtxt patches ( #4124 )
...
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 >
2026-07-25 21:20:04 +02:00
lizzie
395613b01f
[common/logging] Simplify logging logic and fix issues when logging before 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 >
2026-03-12 18:29:15 +01:00
notenergydrinks
c1d9cbca64
[cheats] Check for comments in patch line loop ( #156 )
...
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 >
2025-07-31 16:55:14 +02:00
FearlessTobi
24f979a4b8
vfs: Move vfs files to their own directory
2024-01-25 16:40:42 -05:00
Liam
c51aa8d29f
ips_layer: prevent out of bounds access with offset exceeding module size
2023-12-28 01:16:51 -05:00
lat9nq
41a08286c8
ips_layer: Remove uncaught usage of stoul/ll
2023-09-13 13:36:25 -04:00
arades79
60a68839ee
remove static from pointer sized or smaller types for aesthetics, change constexpr static to static constexpr for consistency
...
Signed-off-by: arades79 <scravers@protonmail.com >
2023-02-14 12:35:39 -05:00
arades79
adcef452e0
add static lifetime to constexpr values to force compile time evaluation where possible
...
Signed-off-by: arades79 <scravers@protonmail.com >
2023-02-14 12:33:11 -05:00
Liam
0676dbfea1
core/file_sys: fix alignment of BuildId
2022-08-21 12:28:36 -04:00
Liam
0812bb34ea
core/file_sys: fix BuildId padding
2022-08-19 17:16:33 -04:00
Morph
8064454628
ips_layer: Delimit parsed hex value string
...
Delimits the hex value string on spaces, slashes, carriage returns or newlines, allowing for comments to be added in-line.
2022-08-12 10:19:44 -04:00
Morph
2b87305d31
general: Convert source file copyright comments over to SPDX
...
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.
2022-04-23 05:55:32 -04:00
bunnei
deb3536936
Revert "core: Fix clang build"
2020-10-20 19:07:39 -07:00
Lioncash
18636013c9
core: Fix clang build
...
Recent changes to the build system that made more warnings be flagged as
errors caused building via clang to break.
Fixes #4795
2020-10-17 19:50:39 -04:00
Lioncash
16de0a6a96
core/CMakeLists: Make some warnings errors
...
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.
2020-10-13 13:16:49 -04:00
Lioncash
485eec243d
ips_layer: Eliminate a redundant copy in Parse()
...
Prevents unnecessary copying of the line being parsed.
2020-09-22 16:38:45 -04:00
Zach Hilman
aca05af798
Merge pull request #2581 from lioncash/hex
...
common/hex_util: Combine HexVectorToString() and HexArrayToString()
2019-06-15 16:47:13 -04:00
Lioncash
af914546f2
file_sys/ips_layer: Remove unnecessary reserve() call
...
Given 'replace' is assigned to on the following line, this isn't
necessary, given the underlying data is going to be overwritten
entirely.
2019-06-12 18:12:45 -04:00
Lioncash
59d55c8137
common/hex_util: Combine HexVectorToString() and HexArrayToString()
...
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.
2019-06-12 17:54:05 -04:00
Frederic L
c76f4b6aec
global: Use std::optional instead of boost::optional ( #1578 )
...
* 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
2018-10-30 00:03:25 -04:00
Zach Hilman
0bb4dbc74b
ips_layer: Use rle_size instead of data_size in RLE patch application
...
Prevents a potential bug when using RLE records in an IPS patch.
2018-10-25 14:23:56 -04:00
bunnei
571523de38
Merge pull request #1461 from lioncash/warn
...
ips_layer: Silence truncation and conversion warnings
2018-10-09 22:30:01 -04:00
Lioncash
5c9c637200
ips_layer: Avoid constructing std::vector instances where not necessary
...
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.
2018-10-09 14:10:22 -04:00
Lioncash
d4ffc70268
ips_layer: Remove unnecessary explicit std::pair constructor in std::array
...
Makes the layout of the array consistent, by making all elements match,
instead of special-casing the first one.
2018-10-09 14:10:22 -04:00
Lioncash
890093255c
ips_layer: Add missing includes
...
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.
2018-10-09 14:10:13 -04:00
Lioncash
f269987f32
ips_layer: std::move data within PatchIPS() and Apply()
...
We don't need to make a copy of the read data, so we can std::move it
into the make_shared call here.
2018-10-09 14:06:44 -04:00
Lioncash
3454b33238
ips_layer: Silence truncation and conversion warnings
...
Makes type conversions explicit to avoid compiler warnings.
2018-10-09 13:18:23 -04:00
Zach Hilman
794fdbd680
ips_layer: Fix inaccuracies with comments and flags
...
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.
2018-10-04 12:23:27 -04:00
Zach Hilman
c60739016d
ips_layer: Deduplicate resource usage
2018-10-04 11:34:36 -04:00
Zach Hilman
8593274f69
ips_layer: Add support for escape sequences and midline comments
...
More accurately follows IPSwitch specification.
2018-10-04 11:34:30 -04:00
Zach Hilman
a2602dddbe
ips_layer: Add IPSwitchCompiler to process IPSwitch format
2018-10-04 11:32:10 -04:00
Zach Hilman
11b272edff
file_sys: Implement function to apply IPS patches
2018-10-01 16:01:46 -04:00