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.
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.
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.
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
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
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
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).
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
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.
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
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
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.
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).
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
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
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
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
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
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.
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
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
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.
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
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.
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.
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.
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.
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.
* 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
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>
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.
* 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
```
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.
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.
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
`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.
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.
Don't clip modifier volumes but tesselate triangles intersecting the
near plane. Then project clipped vertices onto it in the vertex shader.
Issue #1651
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
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.
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.
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.
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
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)
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.
Haptic effects for the virtual gamepad must be done on a background
thread. Not sure about gamepad rumble but it shouldn't hurt.
Reuse haptic duration for haptic power (0-100).
Fix crash when power is zero (createOneShot needs power >= 1)
If checkStatus(wait = true) is called, any other thread will be blocked
even when calling with wait = false since the mutex is locked. This
happens on Android when JNIdc.rendinitNative(null) is called by the app
main thread.
Use a shared_future instead and unlock the mutex before waiting.
Always open joysticks haptic interface if available and create FFB
effects if supported.
Use default joystick rumble except for racing wheels (sine effect)
Revert 4e3d1caf3f
Use "folder" instead of "directory" in UI.
When game list is empty, show button to easily add a new content path.
Improve folder paths display in settings with middle ellipsis.
android: import/export home folder content
storage: add file update date to FileInfo.
Savestates and custom textures can be loaded from content path / ASS.
Cache last savestate update date to improve perf on android.
android: Don't use scoped storage for android < 5. Optimize listContent.
Fix getSubPath
android: instrumented storage test
Migrate home folder to externalFilesDir
(/sdcard/Android/data/com.flycast.emulator/files) if running on android
10+.
Use externalFilesDir for home by default. No more onboarding on first
install.
Use content uri instead of hacking out real path since the latter won't
work on higher target sdk.
Cache last readable savestate path in hostfs::getSavestatePath(). All
content folders are scanned when not found, which is very slow with ASS
dynarec: use double to implement fipr and ftrv except on arm32
interpreter: always use double for fipr and ftrv
fsrra: perform division before square root
fmac: use std::fma or native fma op
get rid of unused dynarec op shop_swap
ssa: dead register pass must assume interpreter fallback modifies all
registers
ssa: replace reg+0 address by reg in constant propagation pass
decoder: replace address offset 0 by null param for indexed mem access
Force palette update when changing directx color order.
Add 10k extra depth scale to Capcom vs SNK 2000 Pro and cvs.zip to fix
winner character portraits not appearing during ending.
Issue #1546
Revert (again) forcing native depth interp for AMD gpus
Disable native depth interpolation for Mortal Kombat
Issue #1145
Force Japanese bios for vonot
Issue #1542
SDL force feedback for racing wheels.
Support for jvs ffb (f355, 18wheeler), atomiswave (maxspeed, ftspeed)
and midi ffb (initd, clubk, kingrt66, sgdrvsim).
Simple haptic rumble for f355 and 18wheeler.
Race condition when promise is deleted before the future is created
(login)
Require username and password before login.
Disallow pause in hardcore mode when needed.
imgui: fix some failing assertions
Issue #761
Fixes MINIDUMP-35Y, MINIDUMP-34A, MINIDUMP-35K, MINIDUMP-34Y
Retrieve last frame rgb data (gl, vk, dx9, dx11).
Specific save screenshot code for android, iOS and UWP.
Add Save Screenshot emu key (F12 by default)
vk: defer deletion of in-flight textures when texture cache is cleared.
vk: fix issue when updating imgui textures after a render pass has begun
(achievements)
vk: palette texture not updated after a state has been loaded.
gl: Move opengl-specific stuff into opengl imgui driver.
savestate: Add non compressed header, following by screenshot png data,
before actual savestate.
Issue #842
Fix boxart list navigation with DPad (regression).
Get rid of several bogus PopStyleVar/PopID.
Better navigation of pause menu buttons.
imgui: tweak NavScoreItem to help pause menu nav.
Allow achievement list navigation with DPad.
Open cheats window fullscreen. Open Add Cheat window as a modal popup.
Add game_scanner.cpp
Fix threading issue when hashing disk for RA. Protect cacheMap with
mutex.
Achievement current challenges displayed as small icons.
Embed FontAwesome symbols.
New pause menu.
Issue #761