This was benign, because libunwind will ignore a frame header it doesn't understand (__eh_frame was still fine). But now there's no spew in the console. And over the next 50 years it will save a combined 0.3 seconds of cpu time
If a particular core instance doesn't use up too much memory, then we don't charge the host OS for that memory.
The strange thing here is that, testing locally on Windows 10, we were already getting the desired semantics even with SEC_COMMIT and not SEC_RESERVE. This commit is still important because:
1) Windows might be providing me an optimization it can't guarantee,
2) Linux might not be able to provide the same optimization
3) In any event, this patch also trims down xor snapshots to match the actual needed size.
mame lua figuring out cpu and address space every time I read a byte was a dumb idea it seems. accessing maincpu program space directly via C API is much wiser. ram search does the thing now.
Add 'nyma' project
The goal is to eventually update all of our Mednafen cores. For now, there is a work in progress import of the Mednafen pce core. Basic gameplay with hucard, turbocd, and supergrafix is supported, but the core is not complete yet.
This actually makes saveram saving and loading somewhat slower on all waterbox cores, but whatever... it's more important to be simple and readable in this code than fast.
A game could wild pointer into a slightly out of range part of the sealed heap during init, and then do so differently on a subsequent init, and we wouldn't detect it
The existing code had a lot of copy paste and things that needed to be done twice to keep both impls in sync. Refactor to use a minimal abstraction layer and keep all other code common
What _was_ this? A new categoryLabel abstraction was added so we'd need fewer hacks, but in order to use it you need to add extra hacks to it per core? Nonsense code, too. Fix it properly. (Maybe; I didn't test it. Why bother? No one else puts any effort into this either.)
The goal here is to provide an unwind implementation that works. We (probably) don't have a working ldso, so reconfigure libunwind to work without that. To do that, it needs __eh_frame_* variables which it can addressof to find the locations of .eh_frame and .eh_frame_hdr. There is no way I could get gold to add these at all, so switch back to ld and add a custom linkscript. The custom linkscript gives us the opportunity to simplify the savestate memory mapping stuff inside ElfLoader, which should knock a bit of time off of state loads -- those VirtualProtect calls are not cheap. This also removes a potential source of nondeterminism with certain clever out of range pointers.
Any waterbox core that I didn't recompile for this commit will assert now until it is recompiled, because .wbxsyscall is in the wrong palace.