Commit Graph

4209 Commits

Author SHA1 Message Date
Flyinghead 536be34853 dcnet: update emu network state when connected 2025-01-21 18:19:39 +01:00
Flyinghead 5b513cac5b gl: use textureProj for palette texture sampling when possible/available
Fixes UV precision issue when doing the Z-divide manually.
Issue #1804
2025-01-21 18:18:05 +01:00
Flyinghead 5efdf58e85 custom texture: skip updating a texture if its hash hasn't changed
Some textures are frequently updated because of their location in vram,
close to a hotspot. This causes the custom texture to never be loaded.
This change will skip the unneeded texture update, allowing the custom
tex to replace it when available.
Issue #1812
2025-01-21 18:12:10 +01:00
Flyinghead a5a338d408 experimental DCNet cloud service 2025-01-09 18:48:29 +01:00
Edward Li 3114344414 [macOS] Fix booting game stuck at "Starting..." when Video Routing is enabled with OpenGL 2025-01-09 13:59:54 +01:00
oltolm 20ba79668f fix compiler warnings 2025-01-09 13:59:21 +01:00
Wunkolo 9344856c7e ggpo: Fix malformed template constructor
This form is not needed for a template-class's constructor.
Fix for C++20 builds
2025-01-05 22:06:37 +01:00
Wunkolo b2c1d134e1 deps: Update luabridge to 2.8
From 2.6 to 2.8. Includes some C++20 fixes.
2025-01-05 22:06:37 +01:00
Flyinghead 3cf4808033 fix perf regression on macOS and iOS. Add Silent Scope (JP) identifier.
Regression introduced in f3a3364
CopyToVRAM wasn't enabled for Silent Scope (JP). Issue #1796
2025-01-05 22:06:37 +01:00
Flyinghead 1bd894f941 rend: reset scissoring before drawing final modvol quad
See d618abc320
Issue #1797
2025-01-05 22:06:37 +01:00
Edward Li 8dc55721d0 Generate Xcode project which can support both iOS and iOS Simulator 2025-01-05 22:06:37 +01:00
scribam c94deaee9d build: drop unsupported architectures 2025-01-05 22:06:37 +01:00
Flyinghead 42752acef5 Fix crash when reading 2448-byte sectors
Fixes MINIDUMP-5J0, MINIDUMP-5M7, MINIDUMP-5M8, MINIDUMP-5MA,
MINIDUMP-5MF
2025-01-05 22:06:37 +01:00
Flyinghead a3902fc278 sdl: disable rumble when rumble power is set to 0
Issue #1766
Issue #1783
2025-01-05 22:06:37 +01:00
Flyinghead 5add29cbed fix perf regression on macOS and iOS. Add Silent Scope (JP) identifier.
Regression introduced in f3a3364
CopyToVRAM wasn't enabled for Silent Scope (JP). Issue #1796
2025-01-05 10:21:54 +01:00
Flyinghead 5a1c3f80f5 msvc32 build fix 2025-01-02 13:55:39 +01:00
Flyinghead a0e8e9a9df libretro: windows build fix 2025-01-02 12:11:45 +01:00
Flyinghead 45f4378184 network: use asio for modem/bba. DirectPlay4 support
DirectPlay4 support: StarLancer, PBA Bowling
miniupnp: remove unused stuff
2025-01-02 11:27:11 +01:00
Flyinghead c7d030c2e6 uwp: enable vmem. fix dynarec crash. windows: dll loading utility
uwp: Fix crash in x64 dynarec when rewriting due to wrong unprotect
range.
uwp: load MapViewOfFileEx dynamically to map regions at a given address.
dll load and function lookup utility.
2025-01-02 11:13:25 +01:00
Flyinghead 2bee6b1ce4 picotcp: fix msvc build. reduce logging 2025-01-02 11:01:58 +01:00
Flyinghead 522505273e miniupnpc: minissdpc.c: fix memory allocation error
backport
9698973600
2025-01-02 10:57:38 +01:00
Flyinghead 0481f5464d misc non-functional changes 2025-01-02 10:54:19 +01:00
Flyinghead 7478476f9c multithreading utilities (periodic, worker thread) 2025-01-02 10:50:46 +01:00
Flyinghead 76c3695f6e log: support udp log server 2025-01-02 10:35:27 +01:00
Flyinghead e18ada7225 rend: reset scissoring before drawing final modvol quad
See d618abc320
Issue #1797
2024-12-31 18:22:07 +01:00
Edward Li f3a33642f8 Generate Xcode project which can support both iOS and iOS Simulator 2024-12-30 12:23:27 +01:00
scribam 2f03c1b147 build: drop unsupported architectures 2024-12-30 12:22:59 +01:00
Flyinghead d01cbde41c Fix crash when reading 2448-byte sectors
Fixes MINIDUMP-5J0, MINIDUMP-5M7, MINIDUMP-5M8, MINIDUMP-5MA,
MINIDUMP-5MF
2024-12-30 12:20:29 +01:00
Flyinghead 11068012fe picotcp: support threads with msvc. Fix msvc pragma push issue
Enable threading support with msvc, similar to posix.
Fix missing pragma pop after picotcp include files
2024-12-30 12:15:36 +01:00
Flyinghead a06791780d Merge remote-tracking branch 'origin/dev' 2024-12-29 10:59:49 +01:00
Flyinghead ee1a7167f6 dreamconn: open pause menu when LT+RT+Start is pressed
Issue #1305
2024-12-28 15:39:11 +01:00
Flyinghead 10aaec1619 dreamconn: send data with socket to avoid fragmentation. Build fix
Issue #1305
2024-12-28 12:21:26 +01:00
Flyinghead 553f77c675 dreamconn: send buzzer messages. Rename controller. Use asio iostream
Issue #1305
2024-12-27 18:47:12 +01:00
Flyinghead 9402981b43 net: add asio. use it for the gdb agent 2024-12-27 18:39:13 +01:00
Flyinghead 9038ef6d8a sdl: disable rumble when rumble power is set to 0
Issue #1766
Issue #1783
2024-12-26 16:31:23 +01:00
Flyinghead 1d290560e0 picotcp: accept PSH flag in SYN+ACK packets
Windows CE adds the PSH flag to SYN+ACK packets, which isn't normally
valid, so just ignore the flag. See dcgamespy filter in dreampi.
2024-12-26 13:04:07 +01:00
Flyinghead 59e844db15 picotcp: Integer Overflow in pico icmp4
upstream
cc923d2a12
2024-12-26 12:38:26 +01:00
Flyinghead 6853238c8b picotcp: Discard incoming TCP segments with zero-len options
upstream
7aa288510a
2024-12-26 12:12:48 +01:00
Flyinghead f0aa1abf89 picotcp: Fixed bug in tcpopt_len_check (rolling back index).
upstream
f569ed8fb6
2024-12-26 12:03:09 +01:00
Flyinghead cfd3677746 picotcp: add socket event before socket is deleted
Socket callback is called with PICO_SOCK_EV_DEL just before the socket
is deleted. After returning from the callback, the socket pointer is no
longer valid.
2024-12-26 11:45:58 +01:00
Flyinghead 50a10598e4 picotcp: Resolved memory leak
upstream
83527c69d3
2024-12-26 11:33:26 +01:00
Flyinghead b9fdd5070b dreamconn: detect dreamconn+ with VID/PID. Send maple data as text.
Create DreamConn gamepad when detected.
Send/receive maple data in ascii dump form.
Simplify maple device creation.

Issue #1305
2024-12-20 20:02:58 +01:00
Flyinghead 6c3d77b012 more windows build fix 2024-12-16 18:14:21 +01:00
Flyinghead 7fee0d2d29 cheat to work around fur fighters hanging
Root issue seems to be TCNT0 returning the same value twice, which
breaks the game calculation of the game speed/frame rate.
Issue #145
2024-12-16 17:54:02 +01:00
Flyinghead dfd4dbebc4 fix windows build 2024-12-16 17:34:38 +01:00
Flyinghead 34a5e7f47d input: dreamconn+ support prototype
Issue #1305
2024-12-16 17:17:45 +01:00
Flyinghead 3f8d645c42 rend: last frame was sometimes presented after the game is stopped
When the clearLastFrame flag is set, renderers should return false from
Present() and RenderLastFrame() until a new frame is rendered.
2024-12-15 15:55:28 +01:00
Flyinghead ecd0305a60 fix build without dynarec 2024-12-14 19:43:32 +01:00
Flyinghead 667e3906d8 sh4: work around previous SCIF issues when loading a state
Force SCIF_SCBRR2 to 8 bits when loading a state.
See e03e11b8a9 and
6115a918b2.
2024-12-14 19:13:05 +01:00
Flyinghead e5b1d56a7c rend: split texture conversion routines into their own file 2024-12-14 19:07:18 +01:00
Flyinghead d789b57412 rend: get rid of globals for fog/palette updates & tex cache flush
Add state vars to Renderer
Use events to detect loading a state and terminating the game.
Don't present last rendered frame after game terminated.
2024-12-14 17:00:51 +01:00
Flyinghead 825778445a ui: show boxart cover when starting a game 2024-12-14 16:54:18 +01:00
Flyinghead 20517cf0da vgamepad: enable touch mouse when lightgun used
Use unique touch mouse class for iOS and Android.
Enable touch mouse for arcade lightgun games or when maple device A is a
lg. Disable it otherwise.
android: only display controllers that actually send events, including
system mouse and keyboard. Use separate Touch Mouse and System Mouse.
iOS: fix missing button input for touch mouse. Don't bubble up touch
events that hit vgampad buttons or controls.
2024-12-14 16:18:35 +01:00
Flyinghead 421245aeba lightgun xhair: centralize logic in crosshairNeeded() 2024-12-13 17:21:32 +01:00
Flyinghead 686f08e7dd vgamepad: hide btn0 and map reload to btn1 for lightgun games 2024-12-13 16:49:57 +01:00
Flyinghead 4af1d096de audio: reset buffer on loadstate/term. Fix null audio driver on windows
Eliminate audio clicks when loading a state or starting the next game.
Fix overflow in null audio driver on windows. Detect fast forward and
reset time counter.
2024-12-13 15:58:32 +01:00
Flyinghead 27a0497dd5 win32: fix opening CD drive on command line. libretro build fix 2024-12-12 15:52:07 +01:00
Flyinghead 9ea0563a7a gdrom: stop cdda playback when reaching session lead out
Issue #1654
2024-12-12 14:27:23 +01:00
Flyinghead a46677e64e ui: add cancel button when inserting a disk
Issue #1566
2024-12-12 10:17:45 +01:00
Flyinghead a7f2008763 rend: support planar VQ textures
Fixes gens4all emu in teenage mutant ninja turtle collection.
Issue #868
2024-12-12 10:14:30 +01:00
Flyinghead 34961daaec gdrom: add support for hardware CD-ROM devices
Use libcdio to read CD/DVD/BD drives (linux, windows, bsd)
Get rid of old ioctl win32 driver.
Add detected CDROM devices to game list.
Issue #1654
2024-12-11 11:25:50 +01:00
Flyinghead f5389bcd0b battle cable: notify user when data first received from peer
Document SCIF register bits.
2024-12-11 11:04:44 +01:00
Flyinghead 67eee05c14 lightgun: wiggle the reported lightgun position in a 2x2 square
Fixes claychal not registering shots in menus.
2024-12-11 10:41:53 +01:00
Flyinghead bb1b1059d4 sh4: SCIF DR bit can't be reset if rx fifo isn't empty
Fixes manic panic periodic touchscreen errors.
2024-12-11 10:37:48 +01:00
Flyinghead 94f35ca54f arcade: add input descriptors for most games 2024-12-09 16:09:45 +01:00
Flyinghead 1507097bcd naomi: set offscreen sensor when reloading. fix wldkicks PCB inputs
Most games using analog inputs for lightguns also have an offscreen
sensor (lupinsho, mok, hotd2, confmiss). Activate it when reloading or
shooting offscreen.
Fix World Kicks PCB inputs.
2024-12-09 16:02:30 +01:00
Flyinghead e4599e36ed Merge remote-tracking branch 'origin/master' into dev 2024-12-08 10:47:31 +01:00
Flyinghead 15617c1816 ssa: fix regression
due to fff03f64a3
Issue #1773
2024-12-08 10:40:44 +01:00
scribam 5656370388 deps: update sdl to version 2.30.10 2024-12-07 21:03:49 +01:00
Flyinghead 354d649ebd Merge remote-tracking branch 'origin/master' into dev 2024-12-07 20:38:55 +01:00
Johan Mattsson fff03f64a3
ssa: Fix wrong opcode comparison (#1769)
* ssa: Fix wrong opcode comparison

* ssa: handle 32 bits shift case first (shld, shad)

---------

Co-authored-by: flyinghead <flyinghead@users.noreply.github.com>
2024-12-07 18:59:14 +01:00
Flyinghead a99aa5217b sdl: don't run null haptic effects. Stop effects instead
Tentative fix for Issue #1766
2024-12-07 18:57:40 +01:00
Flyinghead 89abb7925b Pro Pinball needs copy to vram. remove Nightmare Creatures widescreen
Issue #1763
2024-12-07 10:04:36 +01:00
Flyinghead 92c5892d4c android: fix scaling when editing vgamepad. vgamepad code clean up 2024-12-04 18:17:11 +01:00
Flyinghead 21f9e9fbc2 android,ios: arcade vgamepad layout. android vgamepad rewrite
Refactor common virtual gamepad code.
Distinct layouts for console and arcade.
Add arcade buttons 5 and 6, insert card button, service mode toggle.
System SP support
2024-12-03 21:04:51 +01:00
Flyinghead 78fa3ee09e vulkan: delay updating imgui texture when driver has just been reset
Fixes crash when selecting a custom gamepad layout .png (android)
2024-12-03 20:42:54 +01:00
Flyinghead de1584d97c systemsp: input remapping. Input desc for mushiking, dinoking, lovebery
Allow input remapping for SystemSP.
Add input descriptors for barcode games: mushiking, dinoking and
love&berry
2024-12-03 20:16:56 +01:00
Flyinghead a40c51e682 gdrom: fix deserialization crash
regression due to c860807fef
Issue #1755
2024-12-03 18:33:58 +01:00
Flyinghead c860807fef gdrom: reduce dma buffer size. reios: schedule dma reads by chunks
Reduce gdrom dma buffer size to 16 sectors from 32.
Limit serialization of dma and pio buffers to actual content.
reios: schedule transfer of dma data in chunks.
Fixes Soul Calibuf audio drop outs at boot with HLE BIOS (RA).
Issue #1755
2024-11-30 16:37:55 +01:00
Flyinghead b91f82c7e5 win32: create screenshots path if needed. Fall back to Pictures folder
Ask Windows to create the Screenshots folder if it doesn't exist.
Fall back to Pictures folder if the Screenshots folder can't be
determined.
Issue #1761
2024-11-30 13:06:53 +01:00
Flyinghead 5f55a9fd3f naomi: fix issue when creating eeprom. Ignore audio disable.
Byte at offset 2 was incorrect.
Ignore disable attract mode audio in BootID.
Remove ikaruga default eeprom.

Issue #1760
2024-11-29 17:11:36 +01:00
Flyinghead a085fd2f6d ui: never disable Up and Down buttons on iOS. rename source files 2024-11-28 17:45:40 +01:00
Flyinghead 36c2f5137c ios, android: load custom vgamepad image. disable unused controls
User can choose a custom vgamepad image or reset to default.
Unused controls are disabled and hidden based on the game (arcade) or
maple device (console).
2024-11-28 17:09:09 +01:00
Flyinghead 59c2343cad android: add mime-type argument to addStorage() 2024-11-28 16:46:17 +01:00
Flyinghead b42387e929 naomi: vf4 and mazan input descriptors 2024-11-28 16:41:30 +01:00
Flyinghead 6bf38e5085 input: fix potential race condition with analog ramp up/down
Fix a potential race condition on android causing missed inputs with
analog axes bound to buttons.
2024-11-26 19:29:40 +01:00
Flyinghead 792aa38d34 input: implement ramp up/down for analog axes mapped to buttons
Full analog axes now have a ramp up/down of 100 ms when the mapped
button is pressed/released. Works also for keyboards.
Issue #1017
2024-11-26 16:06:13 +01:00
Flyinghead 516982c66c ios: allow virtual gamepad layout customization
Use same display code as android.
Support custom buttons.png.
Allow layout customization as in android.
Save layout in emu.cfg.
Allow transparency setting.
Issue #990
2024-11-26 10:46:02 +01:00
Flyinghead a9fa33c17a gl: test glBlitFramebuffer compliance and disable its use if failing 2024-11-26 10:03:33 +01:00
Flyinghead d0584b8652 vk: defer deleting framebuffers in ScreenDrawer and lr context
Defer deleting framebuffers and attachments in ScreenDrawer and lr
context when resizing.
Fixes crash when starting 240pSuite on the lr core.
2024-11-23 13:47:19 +01:00
Flyinghead b4dcc64ef6 android: draw onscreen gamepad with imgui
Get rid of Renderer::DrawOSD.
gl: make a GlQuadDrawer class.
Draw on-screen gamepad using imgui.
Clean up vgamepad interface.
2024-11-22 14:42:51 +01:00
Stefan Schlosser 7531f5df20 oss: cleanup and unification
Audio and record initializations are unified by providing helper functions for
opening the audio device and for setting the device parameters. The ioctl calls
are properly checked for errors and log an appropriate error message. The init
fails if the requested parameters are not supported by the device, i.e. 44.1kHz
16bit stereo for playback. This provides consistent behavior with all the other
audio backends.
2024-11-22 13:06:18 +01:00
Flyinghead 6612e3fef8 gdrom: update settings and more when swapping disks
Set forced and per game settings.
Update game id and save state file name.
Reset cheats and custom textures.
Update game title and window title.
Issue #1748

hle bios: reboot the game when "exit to bios" vector is called
2024-11-20 11:46:34 +01:00
Flyinghead fbd52a72d4 naomi: load and decrypt gd-rom on demand
Shorten load times and avoid ANR on android with libretro when loading a
GD-ROM game. Load and decrypt data by 16 KB chunk when needed.
Issue #1457
Issue #1738
2024-11-17 20:39:30 +01:00
Flyinghead d618abc320 rend: modifier volumes must be clipped
Modifier volumes should also be clipped when needed.
Implement outside clipping for non-OIT renderers.
OIT renderers are less affected since the shadowed polys themselves are
usually also clipped after shadow is applied.
Fixes overflowing shadows in baserunner cams in WSB 2K1.
2024-11-17 12:09:40 +01:00
Flyinghead bdd2d5af7f naomi: emulate dimm registers for gd cart
Emulate 1.02 dimm board without network so that the bios detects it and
shows the expected GD-ROM SYSTEM boot screen.
Fix rom board serial id issue (error 04) with ikaruga, tetkiwam,
puyofev[j] and sprtjam.
Issue #1735

Add naomigd and naomidev bios definitions (unused).
Use netdimm for mj1 and wccf* series (still not working).
2024-11-14 13:05:48 +01:00
Flyinghead 76638df001 sh4: split xffr array. Fix FPCB_PAD on windows
Split xffr[32] into xf[16] and fr[16].
Set FPCB_PAD size to 64_KB. Issue #1736
Get rid of shil_param::reg_aofs
2024-11-13 10:31:45 +01:00
Flyinghead 3efb87ba6d vk: fix crash when enabling/disabling EmulateFramebuffer
Make sure to end the current render pass with the previous setting.
Fix initial layout of color attachments in OIT.
Fix missing initial transition after Term/Init in !OIT.
Issue #1734
2024-11-11 22:15:57 +01:00
Flyinghead 129673a84b dynarec: use sh4 ctx to get register pointers. prefer offset
Move restoreHostRoundingMode() into Sh4Context
2024-11-09 18:44:51 +01:00
Flyinghead 7c1c5817d3 sh4: move sqWrite func into sh4 context. Simplify usage
Allow passing sh4 context to dynarec canonical implementations
Reduce FPCB padding to PAGE_SIZE except on arm32
2024-11-09 16:54:47 +01:00
Flyinghead e394840344 sh4: pass sh4 context to dynarecs, sh4cycles and caches
Reorder RuntimeBlockInfo members to save space
2024-11-09 13:25:55 +01:00
Flyinghead fc33002284 network: add Golf Shiyouyo 2 ports 2024-11-09 11:44:58 +01:00
Flyinghead dff967f60a ui: notify user when loading a state fails and why 2024-11-09 11:43:10 +01:00
Flyinghead 1cadeb276e sh4: test fix 2024-11-08 22:01:48 +01:00
Flyinghead 2b28e819e5 sh4: build fix. rounding mode refactoring 2024-11-08 21:34:24 +01:00
Flyinghead db846ca933 sh4: pass context to interpreter funcs. get rid of sh4 regs #define 2024-11-08 18:36:08 +01:00
Flyinghead 9cb7d9e5d5 rec-arm64: fix Store Queue write handlers 2024-11-08 18:27:52 +01:00
Flyinghead 93ae9d0375 sh4: refactor interpreter and recompiler with Sh4Executor interface 2024-11-07 18:14:18 +01:00
Flyinghead e03e11b8a9 arm64: mask value operand when calling a write mem handler
AppleClang doesn't mask the operand in the callee. This must be done in
the dynarec.
See 6115a918b2
Tentative fix for barcode reader not working on macOS/arm
2024-11-07 14:10:02 +01:00
Flyinghead 52df0133f0 sh4: pass sh4 context to sq write handlers 2024-11-06 23:27:20 +01:00
Flyinghead d5aeb482d9 sh4: move sq_buffer into sh4 context 2024-11-06 22:11:27 +01:00
Flyinghead 7eec648690 sh4: move Sh4RegType & GetRegPtr into sh4/dyna
rec-arm: use getRegOffset/reg_nofs instead of GetRegPtr
2024-11-06 20:46:32 +01:00
Flyinghead 897e06b887 sh4: refactor GetDR/SetDR and access to fp registers 2024-11-06 19:26:04 +01:00
Flyinghead aa38771cd0 refactor sh4_sr_GetFull/sh4_sr_SetFull 2024-11-06 18:01:01 +01:00
Flyinghead c77ddba109 get rid of settings.dynarec.disable_nvmem 2024-11-06 17:03:01 +01:00
Flyinghead cd8a88366d get rid of TARGET_NO_EXCEPTIONS 2024-11-06 16:59:16 +01:00
Flyinghead 9d4d486524 naomi: add crc32 to GDROM and AW roms 2024-11-06 16:45:42 +01:00
Flyinghead fc6142b332 maple: do a full save of the vmu after loading a state
A partial save might corrupt the vmu file system.
2024-11-04 19:19:31 +01:00
Flyinghead 5fc84acdfb maple: base vmu file name on game ID for multidisk games
Build vmu file name with game ID so that all disks of multidisk games
share the same vmu (A1 only, or all with libretro when enabled).
Rename existing vmu file to new format if none exists.
Issue #1556
2024-11-03 17:14:31 +01:00
Flyinghead 037dc3b4b9 atomiswave: set dma speed to 7 MB/s for all aw games and conversions
AW dma transfer rate seems to be lower than naomi.
Fixes Force Five freeze when starting a game.
Fixes opening sequence animation being truncated in kofxi.
Issue #1724
2024-11-03 16:55:15 +01:00
Flyinghead 96aac66133 naomi: improve performance of M1 and M4 carts dma
Limit buffer size to 1 or 2 KB instead of 32 KB.
Only decrypt right before dma transfer.
Fixes frame drops and audio underruns in vf4evoct attract mode.
Issue #1717
2024-11-02 18:46:49 +01:00
Flyinghead 4d5ced1ce6 maple: add Full Controller with 2 analog sticks and all buttons
add AllStatusReq string for purupuru device.

Issue #1171
2024-11-02 18:13:38 +01:00
scribam da3cfd9d58 deps: update sdl to version 2.30.9 2024-11-02 11:05:35 +01:00
Flyinghead 65aadb9dcb pvr: avoid infinite loop if tile array is invalid
Fixes 240pSuite freeze at boot with the libretro core.
2024-11-02 11:04:56 +01:00
Flyinghead 2e5309bfa3 aica: don't batch samples
Batching 32 samples and arm runs causes audio glitches with some wince
games. So run aica 44100 times/sec instead.
Issue #1240
Issue #1605
2024-11-01 14:31:59 +01:00
Flyinghead 742090bb1f rcheevos: disable achievements in naomi slaves 2024-10-29 17:38:52 +01:00
Flyinghead f3a64e5891 android: clean exit when using the exit hotkey
Finish the activity in dc_exit.
Issue #1713
2024-10-29 17:35:25 +01:00
Alexandre Bouvier 32d11dd89c fix missing include 2024-10-26 19:28:20 +02:00
Flyinghead e221f6fed2 deadlock when pausing/resuming quickly (android)
Race condition when pausing/resuming is done from a separate thread (android): the renderer gets a result ready status for the previous emu thread, but waits on the newly created one forever.
2024-10-25 08:10:41 +02:00
Flyinghead 8108e63907 rcheevos: race condition in event handlers and async tasks
The data passed to event handlers (achievements in particular) must be
copied if used by an async task. It might be deleted before the async
task runs.
Fixes MINIDUMP-3ZR MINIDUMP-4XJ MINIDUMP-4TB MINIDUMP-4CA MINIDUMP-38H
2024-10-21 16:13:00 +02:00
Flyinghead b0403ed103 imgui: ignore invalid fonts when merging
Avoid crashing in release mode if a merged font is invalid or FontNo
can't be found. The font is simply ignored and the glyph range isn't
loaded.
Fixes MINIDUMP-4TD
2024-10-21 16:03:28 +02:00
Flyinghead c86ed291cf picotcp: use dns.flyca.st as default dns
Use dns.flyca.st as default dns.
Resolve name when pico network starts.
2024-10-19 17:59:24 +02:00
Flyinghead 54e8589f63 android: disable import/export home when SAF is disabled. Code clean up
Disable import/export home folder buttons when not using SAF file
picker.
Get rid of unused home migration feature when onboarding.
Android TV screenshots and banner.
2024-10-18 19:23:03 +02:00
Flyinghead 4750ddb646 android: new option to use legacy file picker instead of new SAF one
Android 9 and earlier can use the legacy file browser. This fixes issues
with broken SAF file picker on Android TV 9.
Catch exception when no file picker is installed on the device (Android
TV 12) and instruct the user to install one.
Issue #1657
2024-10-17 16:21:06 +02:00
Flyinghead 894ac54b80 imgui: fix dpad navigation issue on shield tv
Pressing dpad up or down moves the selection 2 lines up or down resp.
Regression due to ca613db70d.
Happens on 1920x1080 screen with 213 dpi.
Relax vertically touching items test.
2024-10-17 16:04:27 +02:00
Flyinghead d4a223656f enable RTT Copy to VRAM for Silent Scope
Fixes VMU display
Issue #1703
2024-10-17 16:00:46 +02:00
Flyinghead b698cc3d10 dx11: reset device context state to fix libretro shaders
Reset device context before each render. Rebind palette and fog textures
every frame.
Fixes corruption with libretro shaders.
Issue #1612
2024-10-15 17:28:54 +02:00
Flyinghead 75af269bb8 rend: ignore inside clipping if rect is default value
Fixes invisible race start countdown in f355 (arcade).
Issue #1698
2024-10-15 15:55:34 +02:00
Flyinghead fd475bdd8e vk: some pipelines don't need the provoking vertex extension
ModVol and OIT Final and Clear pipelines don't need it.
2024-10-14 17:19:41 +02:00
Flyinghead f71dd6d4d8 cdi: better detection of invalid CDI media 2024-10-14 16:45:22 +02:00
Flyinghead 5aec6d05b0 vk: (lr) use one vk::DeviceQueueCreateInfo when possible
Using 2 with the same queue index causes a validation error and crash.
2024-10-14 16:39:33 +02:00
Flyinghead b4937ef271 f355: pass full BIOS path to slaves
if the bios file is located relative to the rom location, slaves won't
be able to find it. Pass the full bios path to avoid the issue.
2024-10-14 16:31:23 +02:00
Flyinghead a50164a91b vk: missing some changes to use VK_FORMAT_R8G8B8A8_UNORM
Fixes Naomi 2 games and android on-screen gamepad.
2024-10-13 14:22:50 +02:00
Wunkolo 595842f606 vk: Remove naomi2 vertex attributes when not needed
Disables the naomi2 vertex input attribute when emitting non-naomi2 pipelines.
This addresses some validation messages involving unused vertex inputs and optimizes the bandwidth of the input assembler a little bit for non-naomi2 games.
2024-10-13 13:26:42 +02:00
Wunkolo 8f74f7883a vk: Use `VK_FORMAT_R8G8B8A8_UNORM` for vertex colors
Rather than using `VK_FORMAT_R8G8B8A8_UINT` for these vertex attributes and then dividing by `255.0` in each of the shaders, the `VK_FORMAT_R8G8B8A8_UNORM` format will automatically remap byte components into the `0.0-1.0` range and removes the need to do the extra divisions or castings within the shader.
2024-10-13 13:25:40 +02:00
Wunkolo ea1cd9d31b vk: Fix undefined push-constant data
The full push-constant region is 24 bytes(6 floats), but some of these push-constant writes only wrote 20 bytes of data(5 floats).
Causing 4 bytes at the end to be left undefined.
Resolved by pushing an extra zero.
2024-10-13 13:24:27 +02:00
Flyinghead bb7ad07701 extra depth scale for sturmwind
Issue #1691
2024-10-12 17:35:59 +02:00
Flyinghead 9793e54646 avoid deadlock when sh4 cpu is restarted while emu is being stopped
The sh4 cpu is stopped/restarted during a soft reset, and dynarec code
reset (arm64, arm, x86). If the emulator is stopped concurrently, the
call may hang. Use a mutex-protected method to restart the cpu only if
the emu is still running.
2024-10-12 17:31:58 +02:00
Flyinghead b2c6159b10 Merge remote-tracking branch 'origin/dev' 2024-10-11 15:28:19 +02:00
Wunk 4d73cc8e13
vk: Add `VK_EXT_provoking_vertex` optimization (#1681)
* vk: Add `VK_EXT_provoking_vertex` optimization

The dreamcast uses the last vertex as the provoking vertex, while vulkan uses the first vertex.
This requires an additional call to `setFirstProvokingVertex` to reorder the vertices for all incoming geometry.
With `VK_EXT_provoking_vertex`, the pipeline can designate that the provoking vertex is to be the last vertex, which removes the need to re-order incoming geometry on the CPU.

* vk: Propagate physical device API version to VMA

Allows VMA to make assumptions such as using the `*KHR` or non-`KHR` versions of certain function names.

* vk: Refactor libretro device initialization for `VK_EXT_provoking_vertex`

* vk: Top out at vulkan API version to VMA to 1.1

Despite the physical device possibly being 1.2 or 1.3, we only want up to 1.1. Otherwise we will be responsible for other API functions being resolved and loaded when passing to VMA.

* vk: Enable `VK_EXT_provoking_vertex` usage for ModVol and Final(OIT) pipeline

* vk: Enable `VK_EXT_provoking_vertex` for ModVol(OIT) pipeline

Pretty much anything handling dreamcast-geometry should use this extension when available

* vk: Additional `VK_EXT_provoking_vertex` pipeline fixes
2024-10-11 10:23:48 +02:00
Wunkolo 5b343562b9 vk: Add `CommandBufferDebugScope` utility-type
Adds a new RAII-based utility type for adding diagnostic information to command buffers.
Enabled only when `VK_DEBUG` is set to `1`.
2024-10-09 19:47:14 +02:00
Wunk b20db6a8bb
vk: Disable LOD clamping in samplers (#1674)
This addresses the `BestPractices-Arm-vkCreateSampler-lod-clamping` message from ARM:
65b79bac61/layers/best_practices/bp_descriptor.cpp (L103-L110)

Rather than clamping the LOD in the samplers, instead rely on the Image-View's `vk::ImageSubresourceRange` to limit the number of sampled LODs.

Currently, only game-textures actually have MipMaps, so this does not introduce any additional mip-map sampling or filtering anywhere. If any code want's to actually limit the number of LODs sampled, then they would allocate an additional ImageView for the range of MipMaps to be sampled.

Co-authored-by: flyinghead <flyinghead@users.noreply.github.com>
2024-10-09 19:46:36 +02:00
Wunkolo a8bc1c12f4 vk: Optimize redundant `QuadBuffer` uploads
Hashes the contents of the `QuadBuffer` vertex-data such that data is only uploaded when the vertices actually change rather than every frame.
2024-10-09 19:40:59 +02:00
Wunkolo b94acb70a6 vk: Use matching u/v/w sampler address-mode when possible
This addresses the `BestPractices-Arm-vkCreateSampler-different-wrapping-modes` message from ARM:
65b79bac61/layers/best_practices/bp_descriptor.cpp (L95-L100)

The `W`-axis for these samplers is always unused, it's never the case that these samplers are going to be used for 3D textures.
ARM suggests trying to keep all of the wrapping-modes the same if possible for performance.

`wRepeat` will be set to the same value as `vRepeat` to try and encourage all three wrapping-modes to be the same.
2024-10-09 19:40:20 +02:00
Wunkolo 0c3f5c7a76 vk: Refactor device/instance extension enablement
* Uses a utility-lambda for repeated extension-adding logic
* Uses an `std::set` for the list of available extensions for quick queries
* `VK_EXT_DEBUG_REPORT` and `VK_EXT_DEBUG_UTILS` aren't device extensions and don't need to be here. They are instance extensions
* Each extension that is tested to be added has a corresponding log message for if it was enabled or if it was unavailable

```
00:00:162 rend\vulkan\vulkan_context.cpp:427 N[RENDERER]: Device extension enabled: VK_KHR_swapchain
00:00:162 rend\vulkan\vulkan_context.cpp:427 N[RENDERER]: Device extension enabled: VK_KHR_get_memory_requirements2
00:00:162 rend\vulkan\vulkan_context.cpp:427 N[RENDERER]: Device extension enabled: VK_KHR_dedicated_allocation
00:00:162 rend\vulkan\vulkan_context.cpp:430 N[RENDERER]: Device extension unavailable: VK_KHR_portability_subset
00:00:162 rend\vulkan\vulkan_context.cpp:430 N[RENDERER]: Device extension unavailable: VK_EXT_debug_marker
```
2024-10-09 19:39:49 +02:00
Flyinghead 01e5cd882c pvr: fix default clipping rectangle
Set default clipping rectangle to max (1280x480).
Fixes Irides: Master of blocks bogus clipping to tile 0,0.
2024-10-09 19:37:42 +02:00
Wunk 556e2ead56
vk: Refactor physical device selection (#1671)
Rather than electing the first physical device it finds, and falling back on the first-listed GPU: a series of stable-partitions are done so that the "least compromising" GPU is selected based on a series of criteria.

It will now maximally try to find a GPU that(in order of priority):
* Is a discrete GPU
* Supports `fragmentStoresAndAtomics`
* Supports `R5G5B5`/`R5G6B5A1`/`R4G4B4A4`

In the case that a system has two dGPUs and one of them supports optimal-formats, the optimal-format one is selected

In the case that a system has an iGPU and the dGPU and they both support optimal formats, the dGPU is selected.

In the case that a system has an iGPU and the dGPU and the dGPU doesn't support optimal formats, the dGPU is still selected.
2024-10-08 17:07:09 +02:00
Wunkolo ff6a3119b0 vk: Determine object type enum when setting object name
Uses compile-time type-information provided by vulkan-hpp to automatically determine a vulkan-object's `objectType` when calling `setObjectName`.
2024-10-08 17:05:32 +02:00
Wunkolo 86657c0c12 Fix `{Push,Pop}StyleVar` assert
When entering an error or contentpath warning popup, there are two `ImguiStyleVar` on the stack.
Within the pop-up frame, an additional `ImguiStyleVar` is added.
When the popup ends, there is technically one more ImguiStyleVar on the internal stack than when we entered the popup, causing an assert to hit:

```
Program: G:\flycast\out\build\x64-Debug\flycast.exe
File: G:\flycast\core\deps\imgui\imgui.cpp
Line: 10104

Expression: SizeOfStyleVarStack >= g.StyleVarStack.Size && "PushStyleVar/PopStyleVar Mismatch!"
```

These nested imgui RAII objects need to be scoped such that the stack is preserved both upon entry and exit of these popups to avoid these asserts.
2024-10-08 17:05:03 +02:00
Flyinghead d7c168f406 naomi: copy cart dma data in chunks
Copy cart dma data in 1K chunks to avoid transferring all in one shot.
Fixes Soul Surfer and Beach Spiker audio glitches when playing a sample
before it's completely transferred.
Issue #1513
2024-10-08 17:03:00 +02:00
Flyinghead f37e43b26f vk: don't set scissoring in final OIT subpass
If scissoring is enabled, previous framebuffer background isn't drawn
outside of scissor region.
Fixes blinking in Soul Calibur battle loading screen.
Issue #1668
2024-10-08 11:49:34 +02:00
Wunkolo 56fe3b9c9d Fix `arm64_unwind.h` include-order
`sh4_core.h` has defines for symbols like `r` and `pr` which conflict with the variable names in `arm64_unwind.h` and cause even deeper errors over in `wingdi.h(4954)` and `wincrypt.h(4741)`.

Swapping the include order avoids this collision.
2024-10-07 18:48:26 +02:00
Flyinghead 30bb864b37 vulkan: check image usage flags if image already exists during RTT
Recreate image if usage flags are incorrect.
Fixes vk validation error in Virtua Tennis player list selection screen.
Issue #1664
2024-10-07 18:47:52 +02:00
nbFlyinghead d689c50e21 naomi: increase dma xfer rate except for force five
Revert 54ac9c6361 but make an exception
for force five. Issue #141
Fixes loud music in beach spikers and soul surfers. Issue #1513
Fixes some menu textures not being loaded in F355.
2024-10-05 13:30:36 +02:00
Flyinghead efd71b3a44 Storage::getParentPath can throw 2024-10-04 16:51:08 +02:00
Flyinghead 5450646b5c android: add virtual gamepad transparency setting
Issue #384
2024-10-04 16:45:28 +02:00
Flyinghead 55e0211a57 android: use ASS to select custom adreno driver 2024-10-04 16:36:56 +02:00
Flyinghead 5d719e0b49 rend: unexpected conversion to unsigned for VO_STARTX/Y with msvc
MSVC converts VO_STARTX and VO_STARTY bit-field values to unsigned int,
leading to an overflow when the result is negative.
Issue #1606
2024-10-03 18:03:55 +02:00
Flyinghead e10a9929da Set OIT max layers for more games
Issue #1610
2024-10-03 17:56:30 +02:00
scribam 3d41e4ea3e deps: update sdl to version 2.30.8 2024-10-02 19:50:37 +02:00
Flyinghead 2dd4cbe33d vk oit: draw transparent polys in the first frame after (re)init
Fixes missing background in progress window in Fighting Force 2
Issue #1652
2024-09-29 16:42:38 +02:00
Flyinghead 2653c5ed73 naomi2: fix modifier volumes clipping
Don't clip modifier volumes but tesselate triangles intersecting the
near plane. Then project clipped vertices onto it in the vertex shader.
Issue #1651
2024-09-29 16:42:38 +02:00
flyinghead 7907100b9c dx11: wrong texture returned to libretro in some cases
If a render to texture happens before presenting the current frame,
another texture will be bound to shader slot #0 and will be returned to
the libretro frontend.
Issue #1616 and #1619
2024-09-25 21:57:15 +02:00
Flyinghead f179c00bdd gl: fix Delay Frame Swapping pacing issue on android
Partial revert of c83b0e325f.
Fix root issue in OpenGLRenderer::DrawOSD.
2024-09-24 14:50:41 +02:00
Flyinghead c83b0e325f android: fix Delay Frame Swapping sync issue. ANR in single-threaded
Framebuffer swap should only be called when a new frame has been
rendered.
ANR when stopping the emulator in single-threaded mode: race condition
causes stopRequested to not be handled, and Pause event is never sent.
2024-09-24 11:54:15 +02:00
Flyinghead 4baf529ff7 race condition when stopping emu thread right after start
In threaded rendering, CpuRunning is set after the emu thread is
started. If calling Emulator::stop() before it is set, the call will
hang.
2024-09-23 17:43:23 +02:00
Flyinghead abe71409b5 android: race condition with render thread. ANR with auto save state
Race condition when starting then stopping the render thread:
mainui_enabled isn't set until after the thread has started. If stopped
during that time, it will hang.
Auto save state in a background thread to avoid ANR.
2024-09-23 17:17:46 +02:00
Flyinghead f8c12d2835 android: fix getFileInfo for document uri. cheats: limit file size
android: Fix AndroidStorage.getFileInfo for document uri (cheat file)
cheats: limit cheat file size to 1MB to avoid parsing garbage forever. Save file path only if valid.
2024-09-23 17:08:57 +02:00
Flyinghead 915532f946 vk: don't depend on current clamping values when compiling shader
Fog clamping values may change so the shader shouldn't depend on the
current value when compiling.
Fixes Red Dog Superior Firepower glitch.
Issue #1642
2024-09-18 11:34:35 +02:00
Flyinghead 079180faab Force PAL for Snow Surfer. Increase Max Layers for some games.
Force PAL broadcast for Snow Surfer.
Issue #1643
Increase max layers for Soldier of Fortune, BANG! Gunship Elite and MDK
2.
Issue #1610
2024-09-18 11:30:46 +02:00
Flyinghead 38de2868a0 sgdrvsim: axis 0 is master audio volume, not wheel
Use (unused) axis 4 instead. Wheel position is read with the ffb drive
board, not JVS.
Map clutch to left trigger 2.
Issue #1636
2024-09-16 18:26:13 +02:00
Flyinghead 64d7199107 Merge remote-tracking branch 'origin/master' into dev 2024-09-16 11:16:04 +02:00
scribam 0077b8ecec deps: update sdl to version 2.30.7 2024-09-08 16:24:37 +02:00
Flyinghead 5393235c40 aica: skip remaining step functions when channel is disabled
CA is reset to 0 when channel is disabled due to AEG and this value must
not be changed.
Issue #472 and #1180
2024-09-07 14:55:45 +02:00
Flyinghead a81a02f14b maple: save rfid card after decrementing counter
Issue #1626
2024-09-07 14:50:29 +02:00
Flyinghead 7174ef1194 naomi: full rfid chip emulation for mushiking series
Fixes hang after playing 3 games.
Issue #1626
2024-09-04 09:48:34 +02:00
Flyinghead f039a809da naomi: limit max analog values to avoid overflow
Fixes overflow in wild riders when going full right or full accel/brake.
Follow up to Issue #1627
2024-09-02 17:04:17 +02:00
Flyinghead 1223154665 jvs: fix analog axes values encoding
The least significant byte of analog axis values seems to be handled as
signed.
Fixes crazy taxi going right when turning full left.
Issue #1627
2024-09-01 18:41:37 +02:00
Flyinghead 8cb847940b vk oit: attachment 0 must be loaded too
Issue #1614
2024-09-01 18:41:37 +02:00
Flyinghead c575eac89b naomi: add mushik4t rom 2024-08-30 17:49:07 +02:00
Flyinghead b468c9bdae aica: reset CA to 0 when disabling channel due to AEG
CA was reset to 0 for non-looping sound when ending, but not for looping
ones when they reach full attenuation. This confuses some games.
Disable the channel when it reaches full attenuation and reset CA to 0.
Revert a7702c622a
Issue #1602
Better fix for
Issues #472, #483, #1180, #1249, #1030 (partial)
2024-08-29 13:09:39 +02:00
Flyinghead 368bd17ae0 vk: use swap_chain_size + 1 semaphores
Fixes validation error VUID-vkAcquireNextImageKHR-semaphore-01779
introduced in vulkan sdk 1.3.275
Issue #1620
2024-08-29 13:01:11 +02:00
Flyinghead 757732d0f8 vk oit: load correct attachment. Only reset pipelines when needed
Fixes partial renders: ECCO initial sequence.
Issue #1614
Don't reset pipelines when resizing framebuffer.
2024-08-29 12:57:10 +02:00
Flyinghead a93bd9e64e Merge remote-tracking branch 'origin/playstore' into dev 2024-08-24 18:08:59 +02:00
Flyinghead 308d9fc1ac Increase max transparent layers for some games
Issue #1604
Add 96 layers option to libretro core.
Issue #1610
2024-08-24 16:49:16 +02:00
Flyinghead 7a27a43ba4 vulkan: Fix multipass RTT in OIT mode
Use correct temp attachment depending on pass count. Keep attachment
index to bind the correct one before final subpass.
Use correct initial layout for OP+PT attachment 1 (was eUndefined) when
creating the RTT render pass.
Fixes Alone in the Dark cutscenes.
Issue #1609

Recreate RTT attachments if switching CopyToVRAM on/off.
2024-08-24 16:37:52 +02:00
Flyinghead 244bb724c9 naomi: add FFB support for Tokyo Bus Guide
Only rumble seems to be used.
Issue #1601

Add info about awave BIOS
2024-08-24 16:29:29 +02:00
Flyinghead b99b3450c8 sh4: compute fsrra as 1/sqrt(x) instead of sqrt(1/x)
Fixes invisible chaos emerald in Sonic Adventure cutscene after Emerald
Coast.
Partial revert of ec3ad9b.
Issue #1600
2024-08-20 21:12:05 +02:00
Flyinghead 6061d402bd build fix 2024-08-17 18:08:53 +02:00
Flyinghead 4d06743d9a gdrom: don't crash on unsupported sector size
Fixes MINIDUMP-284
2024-08-17 17:56:35 +02:00