Commit Graph
167 Commits
Author SHA1 Message Date
libretroadmin 45ce654f6f win64: remove exception handler and unwind table on content close
dc_init() registers a vectored exception handler (AddVectoredExceptionHandler)
and a dynarec unwind function table (RtlAddFunctionTable, keyed to the code
cache) on every content load, but dc_term() removed neither. After Close
Content, dc_term() frees the code cache and vmem while both registrations still
point at that freed memory, so the next stack unwind or access violation -- even
one raised during teardown -- walks freed state inside the OS exception
machinery. That crashes on close/reload and is effectively undebuggable, since
the fault is in the unwinder itself rather than in steppable code. It only bites
on Win64 (VEH + RtlAddFunctionTable); other targets are unaffected.

Add common_libretro_cleanup(), called at the start of dc_term() before anything
is freed, to RemoveVectoredExceptionHandler() and RtlDeleteFunctionTable(). Keep
the VEH handle so it can be removed, make its install idempotent so reloads
don't stack handlers, and have setup_seh() drop any prior registration before
re-adding (the code cache is re-prepared each load).

Diagnosed by inspection; needs a Win64 runtime check to confirm.
2026-07-03 21:14:57 +02:00
libretroadmin 45c09f53aa libretro: make cross-thread emu flags atomic, stop spin-waits pegging a core
emu_in_thread, performed_serialization and reset_requested are written on one
thread and read on the other (emu thread vs. the libretro thread that drives
serialize/reset/unload). They were plain bools, i.e. a data race / UB. Make
them std::atomic<bool>; the mutex handshakes still provide the ordering that
matters, so relaxed semantics are sufficient for these standalone flags.

wait_until_dc_running() and acquire_mainloop_lock() hot-spun for up to five
seconds, burning a full core. The first has no work to do until the emu thread
reaches dc_run; the second must keep kicking the emu thread out of its render
wait but not at spin speed. Back both off by a millisecond per iteration with
retro_sleep(1); timeout and kick semantics are unchanged.
2026-07-03 20:17:01 +02:00
twinaphex 8d8eab8fd5 - Backport https://github.com/flyinghead/flycast/commit/889fc8256d720ae15484c8517537e1b19152bf6d#diff-fc1d651a6c7be7577e1a14b6e860c10115ef82091c1439ca291e945ba55a4220
- Also backport miniupnpc from another commit, necessary for BBA
  emulation
2021-04-14 19:50:23 +02:00
twinaphex 1493af65f7 Backport https://github.com/flyinghead/flycast/commit/1b04ef4cb11b286e7487683a8283512976579cb5#diff-3d7848c6ecc65ba29b69f95369a18a93d26feb5786259415bcc94f569b5b819c 2021-04-12 00:40:06 +02:00
twinaphex aac5eba64a Backport https://github.com/flyinghead/flycast/commit/75f7b92342b9099703d5a7ac205f23322d8f825b 2021-04-11 22:24:09 +02:00
twinaphex 44e06af888 CLeanups 2021-03-06 06:33:46 +01:00
barbudreadmon b580126710 (NAOMI) Backport https://github.com/flyinghead/flycast/commit/a41a81f5dde460c711e4e2874bd20df16ae1ac01
and some leftovers from https://github.com/flyinghead/flycast/commit/98b2a32eae0b7a98d7652ba6c368986656c6d656
2021-01-08 09:57:09 +01:00
barbudreadmon fa49de2997 (SH4) backport https://github.com/flyinghead/flycast/commit/333df13fce8a0bc577d6397c384abf86ea5daf24
(SH4) backport https://github.com/flyinghead/flycast/commit/a19c73de7b79b6c504798768a32922994f52c57f
sync soft/hard reset calls with upstream
2020-12-24 13:34:48 +01:00
barbudreadmon d41d526764 Backport Fog option
Backport https://github.com/flyinghead/flycast/commit/ec95c95b89178c9090c14b2f78c26a563593bef6

Backport https://github.com/flyinghead/flycast/commit/d524e3381d72b5b8d3c2c36863718e38b8b0ff51

Backport https://github.com/flyinghead/flycast/commit/b82a97853fd87607b51ca3b270b261f7d4c5aac0
2020-11-21 19:42:44 +01:00
barbudreadmon 81b4ede55f Revert "Backport Fogging option"
This reverts commit 73f0ee4e96.
2020-11-18 18:12:52 +01:00
twinaphex 73f0ee4e96 Backport Fogging option 2020-11-15 17:38:11 +01:00
Flyinghead 1bf642e90c maple: create devs after loading the game. aw: better analog mapping
Create maple devices after loading the game so the required arcade
controls are known (AW).
Map ftspeed and maxspeed accel and brake to triggers.

Issue #865
2020-06-22 13:40:41 +02:00
Flyinghead 2d439fa8c4 Fix crash when boot to bios is enabled and loading naomi/aw game
add emulator.h
2020-06-02 16:35:06 +02:00
Flyinghead 1d40e23654 get rid of wchar 2020-06-02 16:31:56 +02:00
Flyinghead a3f4818d87 don't reset frameskip to 0 at init
Issue #889
2020-05-12 10:29:20 +02:00
Flyinghead 07879f7a11 naomi: VMU support (vonot, sf3zu). Fix otrigger inputs. 2020-03-23 19:19:39 +01:00
Flyinghead aeadb7d6cd users now cannot force enable div matching
Issue #817
2020-02-17 18:13:37 +01:00
Flyinghead 9c41f48fb1 disable RGB component for some games
Issue #176
Issue #177
Issue #725
Issue #707
Issue #182
2020-02-03 23:43:38 +01:00
Flyinghead bc5be5e695 force HLE off to boot BIOS. Avoid crash when loading invalid content
Use file extension to select the right disc driver
Better error reporting, less memory leaks and crashes on invalid content
Force HLE off when booting BIOS
Don't crash if missing BIOS file
2020-01-31 12:32:05 +01:00
Flyinghead a53b52dd84 naomi/aw: load failure when mixing / and \ in content path on windows
Use libretro file path library.
Clean up
2019-12-20 10:34:29 +01:00
Flyinghead 605e2128cb Add anisotropic filtering option (vulkan). Remove RTT option. 2019-12-16 15:48:33 +01:00
Flyinghead 4f2abdd93f reios: allow hle savestates to be loaded in non-hle mode
Always initialize reios hooks during startup so hle savestates always work.
2019-09-19 12:09:29 +02:00
Flyinghead a774989cd9 Load roms in naomi and aw mode
Fixes naomi_boot.bin not working and atomiswave flash not being loaded
2019-09-17 11:26:08 +02:00
Flyinghead 5ceffc3ea2 Display lightgun xhair for Naomi and AW games
Only use HLE BIOS for dreamcast games
2019-09-12 18:19:00 +02:00
Flyinghead 13f39bd2e4 Detect game region/vga support and set options accordingly
Better IP.BIN parsing (wince, vga)
Use wince flag and boot filename for wince detection
Switch to TV composite if vga unsupported
Switch to supported BIOS region if current is unsupported or default
Add default ISP information to flashrom
2019-09-04 11:03:16 +02:00
Flyinghead 8e7250fc6c proper hard reset of sh4 mm registers
clean up
2019-09-04 09:49:04 +02:00
Flyinghead 9210dcddd4 New core option to force Windows CE mode 2019-08-30 15:59:59 +02:00
Flyinghead dc94d9a35f New logging framework stolen from dolphin 2019-08-29 20:55:32 +02:00
Flyinghead 707f261502 hle bios improvements 2019-08-13 13:10:14 +02:00
Flyinghead 99adb33992 better termination, clean up 2019-07-11 13:02:44 +02:00
Flyinghead 263419bcdd wince: online support
Use default asyncmap for LCP control packets
Delay reading from picotcp ppp stream when connecting
Accept [PSH,SYN] as valid tcp connect packet

Add PBA Tour Bowling 2001 as wince game
Disable vmem32 for StarLancer and Maximum Pool (req'd for online support)
2019-07-07 21:40:26 +02:00
Flyinghead 4c909bac50 Unify vmem/vmem32 (WIP). Support different RX and RW ptrs 2019-05-31 12:13:24 +02:00
Flyinghead dd6bb9c3d8 wince: disable vmem32 for games that abuse it 2019-05-31 08:36:42 +02:00
Flyinghead 073a6ac421 wince: force aica.NoBatch 2019-05-15 14:37:59 +02:00
flyinghead 46cb41a5b1 win32: disable setjmp/longjmp for mem access
fix build
setup seh after CodeCache is set
2019-05-02 21:11:59 +02:00
Flyinghead 48b28f9cff wince: enable vmem32 and rec x64 rewrite 2019-05-02 14:33:33 +02:00
Flyinghead 66fde81a62 wince: x64 dynarec, temp blocks, fpu disable handling, new blockcheck
vmem32 and ngen_rewrite disabled
2019-05-02 11:48:48 +02:00
Flyinghead 8452fb11a2 wince: basic mmu, interpreter support, fpu disable exceptions 2019-05-01 19:35:26 +02:00
Flyinghead 5a891efa26 missing file from previous commit 2019-03-26 11:40:08 +01:00
Flyinghead fbc2cc3d07 Set DC date/time automatically, DC language core option
Removed Extra Depth Scale core option
2018-12-23 13:40:30 +01:00
Flyinghead 025cdaa719 Support for Restart/retro_reset() 2018-12-21 18:10:22 +01:00
Flyinghead 3a44070a35 Use xxhash for palette hashing. extra depth scale for NHL 2K2
Use xxhash for palette hashing (faster)
Change extra depth scale in rom lut tables and enable it for NHL 2K2
Change 'TV (VBS/Y+S/C)' to 'TV (Composite)'
2018-12-03 14:54:03 +01:00
Flyinghead 9f73098812 Backport Synchronous rendering option from upstream 2018-11-26 14:48:41 +01:00
Flyinghead bf944036d0 Naomi/AW: input descriptors framework
Leverage libretro input descriptors to list and name each game's inputs
Half/full analog axes. Per-player axes count.
AW light gun and rotary encoders fix
Load bios from naomi.zip if present for .bin/.dat games
2018-11-14 13:26:30 +01:00
Flyinghead a82cdac890 AtomisWave roms support 2018-11-08 23:16:32 +01:00
Flyinghead 92f40f2b76 Naomi: Better game identification, more robust lst parsing
Use game name in ROM for game id.
More robust lst parsing and error reporting.
Avoid crash when lst doesn't exist or is invalid.
Game LUT clean-up
2018-10-17 14:31:43 +02:00
Flyinghead ea3137c3a2 Merge OIT and non-OIT renderers 2018-10-05 14:09:35 +02:00
twinaphex 203fc32b5e Add 'auto' option for Extra depth Scaling - this should only
enable extra depth scaling conditionally for Samurai Shodown VI
2018-09-22 16:50:04 +02:00
twinaphex 08ecb3e21e Add DIV matching feature; leave it to disabled by default 2018-09-22 16:14:52 +02:00
Flyinghead f470563c12 extra_depth_scale was reset to 1 during startup and ignored for large z values 2018-09-05 18:20:28 +02:00