forked from melonDS-emu/melonDS
-
Notifications
You must be signed in to change notification settings - Fork 2
Release1.1 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Release1.1 #2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Upgrade to 2025.07.25 * Configure vcpkg settings in vcpkg.json, this avoids needing to duplicate the vcpkg hash used in several places, and also avoids needing to set overlay ports/triplets directories from CMake * Add caching workaround so that builds won't take forever every time * Build on windows-2025
…onDS-emu#2400)" (melonDS-emu#2421) This reverts commit 18bffde.
Call JitEnableWrite() immediately following the allocation of the JIT code memory in the x64 compiler to make certain that it is in RW mode. This call is made following allocation in the A64 compiler already, see 9ad3d42 ("hopefully fix macos"). Switching the memory protection between RW and RX is required on systems that enforce an executable-space protection policy, such as NetBSD and OpenBSD, with PaX MPROTECT and W^X respectively. However, adherence to these policies for these platforms is not implemented yet, so at this moment in time this call should be a no-op on x64.
Call mprotect to switch the code memory protection between RW and RX when needed on NetBSD, which is required due to PaX MPROTECT being enabled on all binaries by default by the operating system. This removes the need to run `paxctl +m melonDS`. This patch was tested on a x64 VM running NetBSD 10.1. I can confirm that this fixes JIT on NetBSD, however fastmem does not work as of yet due to a segfault. Although invoking mprotect does incur a performance penalty, it is still faster than running without JIT. A potentially faster alternative is to back the JIT code memory with an anonymous file descriptor in physical memory, then map this physical memory to two virtual memory addresses: one with RW permissions for code generation, the other with RX permissions for code execution. Instead of using platform-specific methods to create the anonymous file descriptor, such as memfd_create on Linux, we could copy a 'trick' that we use in fastmem already: calling shm_open, a POSIX standard, with a random name, and immediately unlinking it. However, this would add some more complexity and would be a bit harder to implement. For now, this works fine. Perhaps another time...
Call the reset function of the JIT object instead of resetting the block cache directly when disabling the JIT compiler, to ensure that the protection on the code memory is switched to RW as required. It is imperative that calls to ResetBlockCache() directly must be preceeded by JitEnableWrite() to comply with executable-space protection on systems that require it. This fixes a segfault on NetBSD, due its PaX MPROTECT policy, that occured when disabling JIT during runtime.
Set the protection on the code memory to RW when the fault handler rewrites code, and set it back to RX, the protection prior to the interrupt, after doing so. This fixes a segfault that occurred on NetBSD, due to its PaX MPROTECT policy, when trying to run fastmem. This could potentially be the reason as to why fastmem does not work on Apple Silicon Macs, although I am unable to confirm as I do not possess such a device to test with.
* sockaddr_in is a forward declaration on *BSD, explicitly include the correct header * fix building with ENABLE_JIT on OpenBSD targets * add wxallowed linker flag for openbsd targets * OpenBSD armjit sc_exr -> sc_elr * wxallowed -> wxneeded * force mmap for jit on OpenBSD * disable fastmem on OpenBSD * fix typo in disabling fastmem for OpenBSD * add missing space in this if
* fix: GDB stub reading wrong code for vCont packet * Implementation did contain bug, fixup
Adapt the existing OpenBSD workflow to also run on FreeBSD and NetBSD, using the dynamic-uses action and a matrix strategy for each OS.
Cast the data pointer to const u8*, not u8*, to fix a compiler warning.
) * Add high-quality resampling using blip-buf to the core This also gets rid of the need for the frontend to resample the audio, as it can simply ask the core to produce audio at whatever sample rate it desires. * allow setting an audio output skew to alter the timing slightly This makes up for the difference of e.g. the frontend targeting a clean 60FPS instead of the actual 59.8...FPS. * remove hack that was used to have the SPU produce silence
This removes the need to include private headers from QtGui, which should remove the need to install the relevant package and make melonDS easier to build in nonstandard environments.
fixes the Qt dependency on macOS
* support for importing cheats from usrcheat.dat * expand cheat format to add support for the extra info in usrcheat.dat * add said features to the cheat editor * improve cheat editor UI (add support for moving stuff around, etc)
seems to fix crackling on Windows
Fixes audioGetNumSamplesOut sometimes breaking audio completely on start because of using the value uninitialized. Full credit to Arisotura for somehow figuring this one out
* Fix glMemoryBarrier flags * Scale TileSize with internal resolution * Clean up tile size calc * Use a different CoarseTileCountY with size 32 tiles * Better tile scaling calc * Actually good way to get the MS bit * Tie BinCombined's local_size_x to the coarse tiles' area * Work count X is unrelated to the local size here * Adjust ClearCoarseBinMask's local size according to TileSize * Add extra barrier for radeonsi.
fixes potential crash on boot
* Basic support for building with Visual Studio/clang-cl Clang is required, MSVC support needs too many code changes. ARM64 doesn't seem to work at the moment because of a bug in Qt. * Fix close being used instead of closesocket in GdbStub in Windows The GdbStub was closing sockets on windows by using "close" rather than "closesocket" * fix the gdbstub unconditionally including unistd.h on windows and make it default-on again * detect VS toolchain and arm64 with vcpkg, also get rid of some warnings on Windows * fix Qt indexOf ambiguity * stupid math library issues * add _USE_MATH_DEFINES so M_PI exists * work around faad2 uncondtionally linking libm even on Windows where it doesn't exist * Fix JIT linkage code for x86-64 in clang-cl builds * Make it build with non-cl clang as well * fix closesocket change breaking on macOS due to missing unistd include * little build cleanups --------- Co-authored-by: Edoardo Lolletti <[email protected]> Co-authored-by: Gloria Goertz <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See TASEmulators/BizHawk#4562