Commit Graph

546 Commits

Author SHA1 Message Date
Pino Toscano
de1d577492
Various GNU/Hurd fixes (#13792)
* bx: Small platform detection/usage improvements

* Use BX_PLATFORM_POSIX where needed

The semaphone implementation already uses BX_PLATFORM_POSIX to include
<pthread.h> on all the POSIX platforms; do the same also in other places
for consistency. This is done also for <sched.h>, which is a POSIX API,
and sched_yield() from it is already guarded by BX_PLATFORM_POSIX.

* Drop support for GNU libc older than 2.12

glibc 2.12 was released on 2010, and at this point any supported Linux
distro has that version or way greather than that.

From bkaradzic/bx@b59b7debd3

* bx: fix <pthread/pthread.h> include on Hurd

<pthread/pthread.h> does not exist, the standard <pthread.h> does exist
so switch to it.

* osd/modules/file: use dirent::d_type on any GNU libc platform

This BSD extension is provided by GNU libc, so enable its usage with
that C library.

* osd/modules/file: use <pty.h> on any GNU libc platform

openpty() is implemented by GNU libc for all the OSes, so include
<pty.h> when using that C library.

* osd/modules/file: cast dirent::d_name to const char* before using it

According to POSIX [1], the type of dirent::d_name is loosely defined
as "char d_name[]", as array with an undefined size. In particular, few
ways are seen in the wild:
(a) "char d_name[size]", i.e. as proper array with a full size
(b) "char d_name[1]"/"char d_name[0]", i.e. as C flexible arrays
Regardless of its type, dirent::d_name is used as if it was a classic
const char *, i.e. as pointer to a null-terminated string.

util::string_format() uses C++ templates to collect all the arguments,
and thus it will use the actual type of dirent::d_name. In case of (a)
there is no issue, however for (b) the result is that only the first
character is used.

To ensure that dirent::d_name is fully used, explicitly cast it to
const char * before passing it to util::string_format(), so the whole
string is used.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html
2025-06-09 10:35:50 +02:00
Patrick Mackinlay
cb045de3d2 3rdparty: cherry-pick upstream fixes for clangcl 2025-05-13 11:41:23 +07:00
holub
745e040e16
3rdparty/expat: Updated expat to version 2.7.1. (#13643) 2025-05-03 00:18:06 +10:00
Vas Crabb
32c0279c14
Correct syntax for template instantiation 2025-04-21 09:44:21 +10:00
Olivier Galibert
7864c26e17 Try helping the CI 2025-04-21 01:37:51 +02:00
Vas Crabb
6c8fb3d5e6 3rdparty/bgfx: Updated ImGui to 1.91.9b.
This was not straightforward, and we're now ahead of the ImGui version
in upstream bgfx.

Updated the bgfx-specific memory editor widget rather than just
partially removing the code.

Had to add an explicit template instantiation to imgui_widgets.cpp to
avoid a link error in the bgfx-specific range slider widget.

Got the imgconfig.h header a lot closer to the template from upstream
ImGui.
2025-04-21 07:35:00 +10:00
Vas Crabb
d1e35612fa
3rdparty/portmidi: Another undefined macro warning. 2025-04-20 18:46:19 +10:00
Vas Crabb
3f69ebaa82
3rdparty/portmidi: Fixed more discarded const and undefined macro errors. 2025-04-20 17:38:24 +10:00
Vas Crabb
f28dac8e0c 3rdparty/portmidi: Fix the right uninitialised local variable. 2025-04-20 15:29:31 +10:00
Vas Crabb
53cd382d4a 3rdparty/portmidi: Fixed more macOS errors. 2025-04-20 11:02:29 +10:00
Vas Crabb
74085ae6ef 3rdparty/portmidi: More cases of ignoring const in the macOS code. 2025-04-20 10:11:26 +10:00
Vas Crabb
485a93c011 3rdparty/portmidi: Another batch of K&R function declarations that upset clang. 2025-04-20 09:46:56 +10:00
Vas Crabb
9c28c45517 3rdparty/portmidi: Another place that needs const hit by Linux. 2025-04-20 09:41:11 +10:00
Vas Crabb
435f04a4c5 3rdparty/portmidi: Fixes for Linux and clang builds. 2025-04-20 09:12:55 +10:00
Vas Crabb
91cc7c0992 3rdparty/softfloat3: Proper way to detect presence of __int128 on GCC/clang. 2025-04-20 08:38:43 +10:00
Vas Crabb
cfec4a0ec0 3rdparty/portmidi: Try to get PortMidi into a state where it will build with sane compiler settings. 2025-04-20 08:18:21 +10:00
Vas Crabb
844af3a173 3rdparty/portmidi: Updated to PortMidi 2.0.4. 2025-04-20 08:16:03 +10:00
holub
52f1f3ac1c
3rdparty/zlib: Updated to 1.3.1. (#13505) 2025-03-26 21:52:28 -04:00
hap
1b4a43302d softfloat: remove unused global LITTLEENDIAN/BIGENDIAN macros, as well as TRUE/FALSE macros 2025-03-15 19:00:34 +01:00
Vas Crabb
877307dffe 3rdparty/expat: Hopefully fix macOS build properly. 2025-03-12 18:10:26 +11:00
Vas Crabb
ed02d60d9a 3rdparty/expat: Added dummy expat_config.h to hopefully fix macOS buid. 2025-03-12 17:46:44 +11:00
Vas Crabb
288839a395 3rdparty/expat: Updated to expat 2.6.4. 2025-03-12 17:23:33 +11:00
Vas Crabb
d69383bfb6 3rdparty/lua: Updated to Lua 5.4.7. 2025-03-12 17:02:57 +11:00
hap
35e80b8d47 ymfm_opl: no need to check for IsOpl2Plus here 2025-02-01 00:47:03 +01:00
hap
077ac12495 ymfm_opl: actually emulate opl2 waveform enable bit 2025-02-01 00:13:42 +01:00
hap
078322da16 ymfm_opn: OPNA does not have 4 latches 2025-01-31 13:35:57 +01:00
hap
d319a3aec9 Revert "ymfm_opn: writes to 0xa7/0xaf also go to latch"
This reverts commit 659471456a.
2025-01-31 13:19:23 +01:00
hap
659471456a ymfm_opn: writes to 0xa7/0xaf also go to latch 2025-01-31 13:01:50 +01:00
hap
802bce33eb ymfm_opn: apparently there is no internal flag when latch was written 2025-01-30 14:49:27 +01:00
Angelo Salese
5e41c0e195
3rdparty/ymfm: sync to latest (#13263) 2025-01-30 14:23:12 +01:00
987123879113
aa5cd150b3
cpu/drcbearm64.cpp: Added a 64-bit ARMv8 (AArch64) DRC back-end. (#13162)
* cpu/uml.cpp: Removed unused vector type.
* 3rdparty/asmjit: Update asmjit to latest upstream.
* cpu/drcbex64.cpp: Fixed crash with LOG_HASHJMPS enabled (stack needs to be 16-byte aligned before calling debug_log_hashjmp_fail).
2025-01-14 02:44:16 +11:00
hap
b35397e8a9 bgfx: fix compile error after ba6f5853e9 2025-01-10 22:36:42 +01:00
Julian Sikorski
ba6f5853e9
Cherry-pick wayland improvements from upstream bgfx (#13070)
* Properly support Wayland under EGL and Vulkan. (#3358)

* Dynamically load libwayland-egl.so.1 when dealing with Wayland to remove dependencies at program startup. (#3359)

* Cleanup.

* Support both X11 and Wayland in the same build. (#3360)

* Support both X11 and Wayland in the same build.

 - Works for both Vulkan and OpenGL.
 - Remove --with-wayland from genie options.
 - Vulkan loads all three extensions for surface creation instead of only one.
 - Add width and height parameter to GlContext::createSwapChain(), which is needed for EGL to create
   a SwapChain with the given window size.
 - Dirty-fix the example-22-windows to recreate the FrameBuffer by first destroying and then
   recreating to make sure the window is released of its swapchain.
 - Fix dbgText glitch in example-22-windows.
 - Remove old X11-related dependencies for GLFW3.

* Formatting.

* Adapt to latest bgfx wayland code

* Cleanup.

* Fix Vulkan swapchain invalidation issue. (#3379)

* Fix Vulkan swapchain invalidation issue.

* Always clamp render pass to frame buffer size.

* Fix formatting.

* Hopefully fix macOS build

* Hopefully fix macOS build, attempt 2

---------

Co-authored-by: Martijn Courteaux <courteauxmartijn@gmail.com>
Co-authored-by: Бранимир Караџић <branimirkaradzic@gmail.com>
2025-01-02 13:50:37 +01:00
Patrick Mackinlay
e745009c30 genie: disable command line string escaping, fixes #13150 2025-01-02 13:26:11 +07:00
Patrick Mackinlay
383c16ae96 genie: restore MPARAM for non-Windows OS builds 2024-12-09 09:54:41 +07:00
Patrick Mackinlay
ae4e4482c6 fix windows build
* use MPARAM for GENie build architecture
* avoid escaping issue in 3rdparty/expat
2024-11-28 08:49:59 +07:00
Patrick Mackinlay
dc8ba812c1
Updated GENie and changed Visual Studio target to Visual Studio 2022. (#13000)
* Updated to GENie 1181.
* Applied local fix for GENie resource include directory bug, sent upstream as bkaradzic/GENie#572.
* Set MSVC flags to use conformant preprocessor, standards conformance mode, and assume UTF-8 encoding.
2024-11-27 04:39:05 +11:00
Vas Crabb
c75845b1ef 3rdparty/sol2: Fixed build with clang 19.
sol::optional<T&>::emplace was broken, and depended on the compiler not
checking that members exist if the template wasn't instantiated.  See
ThePHD/sol2#1606 and ThePHD/sol2#1648.
2024-11-18 06:19:06 +11:00
kms1212
bae7420375
m68k: add FPU instructions FETOX, FETOXM1, FTWOTOX, FTENTOX (#12903) 2024-10-24 19:53:30 -04:00
arbee
1fc7c61a79 cpu/m68000: FPU now sets the NaN flag for all NaNs, not just signalling. Fixes dendego black screen in attract mode. [R. Belmont] 2024-05-30 23:33:13 -04:00
arbee
6957c46998 cpu/m68000: Updated 680x0 FPU to Softfloat 3 from 2. (MT5411 and MT8793). [R. Belmont]
- Update to Softloat 3 from 2
- FREM and FMOD now generate the quotient bits in FPSR, required by Apple's SANE to do sin/cos/tan properly.
- FMOVE of a float to a Dx integer register generates the exception status bits, fixing square roots in SANE
- Rewrote how FMOVEM instructions are decoded and executed, fixing issues including skipping too few or too many
  opcode bytes and causing serious weird behavior.
- FPU instructions all now have more realistic cycle timings for a 68881.
- All FPU instructions now generate exception bits in FPSR.

3rdparty/softfloat3: Updates [R. Belmont]
- Softfloat3 was always being built for a big-endian host, causing incorrect math on LE x64 and AArch64 machines.
- Fixed up Softfloat3 to build properly as part of MAME and up-ported the Bochs extensions.  In latest Bochs, they
  were only partially up-ported and Softfloat3 had been hacked up to be more like 2; here they're fixed to work
  with stock Softfloat3.
2024-05-27 20:40:42 -04:00
Vas Crabb
b7e0fa72b9 3rdparty/sol2: Work around another place where noexcept depends on class template arguments. 2024-05-08 03:58:36 +10:00
Vas Crabb
4da99a13f5 3rdparty/sol2: Worked around apparent regression in clang 18.
When taking a pointer to a static member function template in a class
template, clang reports a substitution error if the noexcept
specification uses an expression that depends on class template
arguments.

See llvm/llvm-project#91362 on GitHub.
2024-05-08 03:32:05 +10:00
Vas Crabb
3ef9a7db09
3rdparty/asio: Patch config.hpp to hopefully work with strict preprocessor warnings. 2024-04-22 09:19:30 +10:00
Vas Crabb
184292b730 3rdparty/asio: Updated to 1.30.2 2024-04-22 08:04:58 +10:00
Patrick Mackinlay
2c566627a1
3rdparty/asmjit: Updated to upstream version 1.13.0. (#12228)
From revision asmjit/asmjit@e5d7c0bd5d
2024-04-11 03:16:51 +10:00
Justin Kerk
28210363d0 Fix compile error in 3rdparty/bx with newer Emscripten versions (#12098)
From bkaradzic/bx@03fd6f4771
2024-03-13 11:41:25 -07:00
Vas Crabb
05e69b43e9
Added Zstandard support for zip archives and CHDs. (#11827)
* 3rdparty/zstd: Added Zstandard compression library version 1.5.5.
* util/unzip.cpp: Added support for Zstandard compression (method 93).
* util/chdcodec.cpp: Added support for Zstandard compression.
* 3rdparty/flac: Always define NDEBUG to avoid log spam.
2023-12-11 10:48:02 +11:00
Vas Crabb
414c5ce5a5 3rdparty: Renamed libflac to flac - it's a full FLAC distribution, libFLAC is just a small part of it. 2023-12-06 17:12:45 +11:00
Vas Crabb
faf991a563 3rdparty/libflac: Updated to version 1.4.3.
Also removed FLAC documentation - it's a lot of bloat.
2023-12-06 17:12:45 +11:00