## Link to GitHub Issue or related Pull Request, if one exists
#0
## Description of change
Adds `-screenshotsub`. Off by default. When on, screenshots include the
subscreens. All subscreens are captured, even if they are hidden from
view. Works for all four screens of gitadora arena model as well.
This should also fix an issue with API / companion app not capturing
gitadora subscreen correctly.
Note: only done for DX9... DX11 will need another PR to make this work.
Unrelated to this PR, there seems to be a bug with gitadora not
accepting mouse or api touch input.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
#0
## Description of change
Adds the `-screenshotoverlay` option.
By default, file screenshots exclude the Spice overlay. Enabling this
option captures screenshots after the overlay is rendered.
Also updates DX11 backend to allow screenshots even when overlay is
disabled.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
Create a new thread that polls for the following hotkeys:
* super exit (both alt+f4 and bound key)
* coin insert
* screenshot
The goal is to make the capture of these more reliable, because before
this PR it wasn't.
## Testing
> [!NOTE]
> Before submitting code changes...
> * Please do note that this is a GPL v3.0 open source project.
> * Please read the
[CONTRIBUTING](https://github.com/spice2x/spice2x.github.io/blob/main/CONTRIBUTING.md)
guide.
> * Maintainers reserve the right to reject or modify your submission
without reason.
> * No new compiler warnings must be introduced. Check the CI build
results.
>
> Feel free to remove this section after you have read it.
## Link to GitHub Issue or related Pull Request, if one exists
## Description of change
Fix gibberish in dynamic Japanese text in GuitarFreaks/DrumMania XG2
(K32/K33) when Windows uses a non-Japanese system code page.
XG2 converts UTF-8 property strings through WideCharToMultiByte(CP_ACP)
before rendering. On systems where the active code page is not
Shift-JIS, these strings are converted using the system code page and
become corrupted or turn into question marks.
Spice2x already hooks WideCharToMultiByte and redirects these
conversions to CP932 for newer 64-bit Gitadora models. This change makes
the existing hook available to 32-bit builds and enables it specifically
for XG2 models K32 and K33.
The existing 64-bit Gitadora Arena and T44 conditions remain unchanged.
## Testing
Before
<img width="1280" height="745" alt="image"
src="https://github.com/user-attachments/assets/34aa2c93-89e8-4c4f-b267-6cbc236f19de"
/>
<img width="2054" height="1188" alt="image"
src="https://github.com/user-attachments/assets/d88b5770-5545-4402-b9e7-3126fe048fb9"
/>
After
<img width="1280" height="720" alt="image"
src="https://github.com/user-attachments/assets/d43b4e47-b6af-4b97-8898-53849c9a0ca4"
/>
<img width="1280" height="720" alt="image"
src="https://github.com/user-attachments/assets/884301e2-1edd-4ad2-92ac-ece656853fe7"
/>
- Tested GuitarFreaks XG2 on a non-Japanese (English US) Windows.
- Verified that Community Log preset comments render correctly in
Japanese.
- Verified that Cooperation Challenge descriptions, rewards, and
progress text render correctly.
- Confirmed that the previous mojibake and question marks no longer
appear.
- GitHub Actions build completed successfully for both architectures.
## Link to GitHub Issue or related Pull Request, if one exists
Fixes#858
## Description of change
Fix orientation being wrong in windowed mode when API touch is used
Fix mouse no longer working when API client is in use.
This PR only affects windowed mode SDVX.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
Fixes#858
## Description of change
Landscape mode needs another adjustment applied to touch coordinates.
This fixex both native touch and wintouchemu paths.
## Testing
Tested landscape, also with full screen resolution changes.
## Link to GitHub Issue or related Pull Request, if one exists
Fixes#852
## Description of change
Add SDVX valk cab tape LED output over API
## Testing
tested with custom python script over api
## Link to GitHub Issue or related Pull Request, if one exists
#0
## Description of change
Old behavior: Forced redraw presented the subscreen every main frame,
even when the game already presented it, causing duplicate presents and
tearing in popn (was fine in sdvx)
New behavior: Forced redraw acts as a fallback, presenting only when the
game skips or fails a subscreen update.
## Testing
Popn - no more glitching
Nabla - no regression
## Link to GitHub Issue or related Pull Request, if one exists
Fixes#855
## Description of change
Legacy camera hooks are specifically for IIDX 25/26 and they only
perform redirection of device discovery (emulates USB vendor/device ID
and USB port). It has very limited use since most cameras are
practically unusable in IIDX 25/26. Don't enable it, unless explicitly
requested by the user.
New truth table for `-iidxcabcams` :
| Mode | `-iidx` off (cab setup) | `-iidx` on |
|---|---|---|
| `auto` | Native cameras enabled (same as `on`) | Cameras disabled
(same as `off`) |
| `off` | Cameras disabled | Cameras disabled |
| `on` | Native cameras enabled | Native cameras enabled |
| `legacy` | Native cameras enabled | IIDX 25/26 discovery emulation
enabled |
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
Fixes broken Japanese text when Windows `Use Unicode UTF-8 for worldwide
language support` setting is enabled. This setting changes the system
ACP to UTF-8 (65001), causing legacy Shift-JIS lead-byte checks to fail.
Windows 11: requests the legacy process code page through the manifest.
Windows 10: detects ACP 65001 (UTF-8), warns the user via deferred log,
and applies compatibility hook (only for popn pika model for now)
Windows 7 and below - UTF-8 option doesn't exist.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
This allows API touches to be recognized even if the main window is in
focus.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
There is a patch for GITADORA series that fixes frame pacing on modern
Windows. Turn it into a signature patch and embed it into the game.
## Testing
should work for all 64-bit gitadora versions, pre-GWD
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
Un-deprecate SDVX landscape mode. The game calls `GetViewport` to figure
out the camera position, so if we return a sane value the game goes back
to rendering correctly.
## Testing
Tested nabla only
## Link to GitHub Issue or related Pull Request, if one exists
Fixed https://github.com/spice2x/spice2x.github.io/issues/740
## Description of change
- Enable native D3D9 adapter-group dual fullscreen for the GITADORA
Arena model when the two-screen MAIN + SMALL configuration is selected
without windowed mode.
- Present MAIN and SMALL on their respective monitor heads while keeping
the invisible LEFT and RIGHT targets offscreen.
- Scope the new fake-swap-chain query behavior to the hidden GITADORA
two-head targets, preserving existing behavior for other games and
configurations.
The existing borderless-windowed two-screen path could not consistently
keep input and game timing synchronized and also reduced rendering
performance. Native dual fullscreen avoids that windowed composition
path.
## Testing
- Manually tested GITADORA Arena with separate MAIN and SMALL monitors
in fullscreen mode. Windowed mode still works if the user chooses to use
that.
- Confirmed both displays render correctly, touch input works on the
SMALL screen, gameplay input stays synchronized, and gameplay holds a
steady 60 FPS.
- Built `spicetools_spice64` at commit `e4a98e9` with the repository
Docker toolchain.
- Confirmed no new compiler warnings.
- Confirmed the forbidden static DLL import check passes.
- Confirmed the Windows 7 DLL compatibility check reports `All DLLs
OK!`.
---------
Co-authored-by: vgod <428979+vgod@users.noreply.github.com>
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
- Replace unnecessary precision timers with standard sleeps to reduce
wakeups and background CPU usage.
- Reuse buffers in raw input, touchscreen, and HID output paths to
eliminate steady-state allocations.
- Pre-index HID button groups and correctly process batched HID reports.
No functional changes.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
Fixes#840
## Description of change
Currently, for subscreen games, mouse events are still delivered even
when the subscreen overlay window is not visible.
Change this so that the subscreen overlay must be active and under the
mouse cursor for the mouse-to-touch transformation to occur. Applies to
both native and wintouchemu.
## Testing
Needs to test everything again..
iidx:
- [ ] full screen with overlay
- [ ] single window with overlay
- [ ] two window
Test: mouse, poke, api, real touch screen
sdvx:
- [ ] full screen with overlay
- [ ] windowed
popn
- [x] full screen with overlay
- [x] window with overlay
- [x] dedicated window
gitadora
- [x] single window with overlay
- [x] dedicated sub window
nostalgia
- [x] fullscreen
- [x] windowed
test: poke
wintouchemu
- [ ] Do all of the above again with wintouchemu
## Link to GitHub Issue or related Pull Request, if one exists
#201
## Description of change
- Adds MJPEG camera support using Media Foundation decoding.
- Moves camera capture to asynchronous Source Reader callbacks.
- Supports native NV12 and YUY2 capture, preferring target-sized native
formats over MJPEG when possible.
- Improves capture and rendering performance through callback-paced
reads, bulk frame uploads, optimized row-based flips, and lazy
allocation of flip textures.
- Makes runtime media-type changes interrupt pending reads and safely
flush and reconfigure the Source Reader.
- Improves automatic mode selection based on aspect ratio, proximity to
1280x720, frame rate, and capture format.
- Hardens camera shutdown, flush handling, media-type changes, and
repeated capture failures.
## Testing
Tested with two cameras in tdj
## Link to GitHub Issue or related Pull Request, if one exists
Regressed by #657
## Description of change
Workaround for SDVX4 was applied too broadly and caused sdvx 1/2/3 to
not boot, depending on contents of avs-config.xml.
`property_search_safe` throws a fatal error if the node is not present.
What we wanted to do was to check for presence.
## Testing
sanity checked sdvx 1/2/3/4
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
ImGui filebrowser extension crashes due to MinGW quirk about UNC path
handling.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
Fixes#833
## Description of change
Last couple PRs - such as #820#827#828 - made the native touch hook &
touch injection using `InjectTouchInput` the default path, since it
performs much more reliably with both real touch screens and mouse (or
any other synthetic source).
However, user has reported that WINE lacks `InjectTouchInput` which
means this won't work.
As a fix, revive the old wintouchemu code. Native touch is still the
default, but under following circumstances:
1. if `-touchemuforce` is set, or
2. if any of the required Windows touch APIs are unavailable
then we fail over from native touch to wintouchemu code.
For Linux, condition #2 would be hit during init, and gracefully switch
over.
Caveat: the poke code for IIDX and Nost will continue to require native
touch, I do not want to maintain two paths for this. This means that
iidx poke will stop working on Linux, unfortunately.
## Testing
Tested on Windows with `-touchemuforce` set. This is mostly reverting
Linux code path back to where we were last release, so this should just
work with wine.
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
Touch piano mode. Allows piano keys to be played with the touch screen.
Since the touch screen is still needed for menu navigation (including
during songs) a toggle switch is added so that the user can flip between
navigation mode and piano mode.
The touch targets are pixel-perfect. Don't let the game's piano
animations fool you.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
Prevent the game from launching a blank window when launching fullscreen
with sub disabled.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
#814
## Description of change
Make gitadora arena model use native touch instead of wintouchemu. Only
single window mode with overlay is affected.
This removes the last consumer of `INJECT_MOUSE_AS_WM_TOUCH` so all of
that code can be deleted.
## Testing
Tested touch screen and mouse interaction with single window mode.
## Link to GitHub Issue or related Pull Request, if one exists
#814
## Description of change
Switch over Nostalgia from wintouchemu to native touch hook.
Nostalgia has some strict timing requirements (touches must be updated
on every acio poll) so this takes a slightly different path to maintain
mouse holds.
Only a handful of consumers of wintouchemu remain:
1. beatstream - but it's off by default, only enabled as errata for
buggy touchscreens, or if the user forces it on (for Show Cursor)
2. gitadora single-window overlay - this is just for mouse so not a big
deal.
3. MFC HG mode - not a priority to fix.
## Testing
Tested full screen and windowed mode with touch / mouse / poke.
## Link to GitHub Issue or related Pull Request, if one exists
Another bug reported by a sea creature
## Description of change
Fix keyboard navigation in Controllers sub tabs.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
Reported by a certain sea reptile
## Description of change
Fix the + / - buttons for number patches not working. Regressed by one
of the ImGui version updates.
## Testing
seems fine now
## Link to GitHub Issue or related Pull Request, if one exists
Fixes#814
## Description of change
Touches via the API wasn't being delivered to native touch hook;
implement this, which closes the last gap we have vs. wintouchemu.
While we're here, implement popn subscreen support for companion as
well.
## Testing
Tested for iidx/sdvx/popn
## Link to GitHub Issue or related Pull Request, if one exists
Fixes#822
## Description of change
Add hooks for `libxact.dll` which only Nostalgia uses for audio. Detect
cases where the game would fail to launch (wrong number of channels) and
log a warning / deferred log.
## Testing
tested 2024102200
## Link to GitHub Issue or related Pull Request, if one exists
Fixes#814
## Description of change
Remove iidx/sdvx/popon `native touch` options.
Remove dead code in wintouchemu that deals with these games.
Native touch is now at feature-parity with wintouchemu. Native touch
options work better with touch screens, while rawinput-based wintouchemu
has compat issues on some touchscreens. For these subscreen games
deprecate the usage of wintouchemu and make them use native touch stack
by default.
### For future consideration
Gitadora - not sure what to do with this one. We only use wintouchemu
for the single window case. For all other configurations, the game
accepts mouse and touch input without any hooks, so perhaps nothing
needs to be done here.
Nostalgia - consider moving away from wintouchemu and adopt native touch
hook here as well.
## Testing
WIP
## Link to GitHub Issue or related Pull Request, if one exists
User reported
## Description of change
Sometimes the game moved the main window after `CreateWindowExA`
returned but before D3D initialization called
`graphics_capture_initial_window`. During this gap,
`GRAPHICS_HOOKED_WINDOW` was not set, so the placement hooks could not
identify the main window and preserve its monitor override. GITADORA
main, LEFT, and RIGHT windows are now registered immediately after
creation so later placement calls cannot undo their overrides.
This also adds `-gdwsmallsize` and `-gdwsmallpos` for explicitly setting
the SMALL window size and position. Explicit values override the
corresponding monitor-derived geometry, allowing the SMALL window's
10:16 aspect ratio to be preserved instead of stretching it to fill a
monitor.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
Fixes#635
## Description of change
Adds optional **button modifiers**, allowing a binding to require one or
more "modifier" buttons to be held before it activates.
- New "Modifiers" controller page in the overlay config to bind the
Modifier 1–4 source buttons.
- Each binding gains a 4-bit modifier_mask (Modifier 1-4). It is
persisted as an optional modifiers XML attribute on button nodes and
controller-preset entries. The attribute is optional and defaults to 0,
so existing config files and presets load unchanged and the feature is
off unless the user opts in.
- The button Edit properties popup gains a "Modifiers" dropdown to pick
which modifiers a binding requires. Doesn't apply to MIDI though.
- Input evaluation skips a binding whose required modifiers are not
held, falling through to its alternatives; velocity reporting uses the
same gated path.
- Controller-preset templates gain a "Modifiers" group for importing and
exporting.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
Part 1 of many fixes for #814.
## Description of change
For the native touch hook - add code to inject synthetic touches using
Windows API (`InjectTouchInput`).
Note that this is Windows 8+ only, but we can make an assumption that we
are running on Win10+ for these games (TDJ/UFC/High Cheers) since the
cabs assume Win10.
Detect mouse events and allow IIDX poke to call into this to inject
synthetic touches.
Also, update the nativetouchhook to independently calculate window size
and rotation, instead of relying on rawinput layer.
## Testing
Tested to work with native touch option on IIDX, SDVX, POPN, all full
screen / windowed / sub on/off combinations.
Edge cases:
* sdvx main monitor rotated 270 deg
* touch invert option
* windowed mode resize / moved
All seem to work.
## Link to GitHub Issue or related Pull Request, if one exists
Regressed by #790
## Description of change
Avoid enumerating every display mode with `EnumDisplaySettings` during
the first raw touchscreen report, as it can take a couple hundred
milliseconds.
The latency-sensitive path now refreshes only the current display size
using `GetWindowRect(GetDesktopWindow())` and orientation using
`EnumDisplaySettingsEx(..., ENUM_CURRENT_SETTINGS, ..., EDS_RAWMODE)`.
Full `EnumDisplaySettings` enumeration runs only when native resolution
is needed for aspect compensation.
Jubeat and Reflec Beat now enable aspect compensation before
initializing touch input.
## Testing
Sanity checked rb/jb on laptops with non-16:9 ratio
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
In summary: for SDVX VM mode, this PR eliminates the need for `Note FPS
Target 120Hz` / `Game FPS Target 120Hz` patches typically used for AMD
GPU via synthetic responses provided via a fake NVAPI layer.
Before this change, playing on AMD GPU required patches to force the
game to render at 60Hz (See #107 for relevant discussion). Basically, if
NVAPI query fails, the game shows
`I:NvDisplayConfig: GetMainDisplayRefreshRate = 60.000hz (DUMMY)`
the game renders at 120Hz but the notes render at 60Hz, which would look
stuttery.
After this change, even without a real `nvapi64.dll`, spice will provide
a stub implementation, just enough to convince the game that the main
display is 120Hz, which causes notes to render at 120Hz as well.
This can be overridden by `-graphics-force-refresh` option.
Important note: if user has the `Note FPS Target 60Hz` patch but running
the game at 120Hz, before this change the notes would render at 60Hz,
but after this they will be at 120Hz. I don't know why anyone would
intentionally lower the notes framerate, so this is not going to be
fixed. If the user wants to run the game at 60Hz they can do so via
`-graphics-force-refresh`.
Another change - `-nonvapi` will always force down this synthetic nvapi
path, even if the system has the real `nvapi64.dll`. Even on NVDIA GPU
this option can be used to force this.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
Fixes#245
## Description of change
Introduce patch groups. JSON schema now allows for a `"type": "group"`:
```json
{
"type": "group",
"gameCode": "LDJ",
"id": "timer-freeze",
"name": "Timer Freeze Patches",
"description": "Freezes various timers in the game."
},
{
"name": "Standard/Menu Timer Freeze",
"description": "Freezes all non-premium area timers.",
"caution": "",
"gameCode": "LDJ",
"type": "memory",
"group": "timer-freeze",
"patches": [
{
"offset": 9962743,
"dllName": "bm2dx.dll",
"dataDisabled": "0F84",
"dataEnabled": "90E9"
}
]
},
{
"name": "Premium Free Timer Freeze",
"description": "Freezes all premium area timers.",
"caution": "",
"gameCode": "LDJ",
"type": "memory",
"group": "timer-freeze",
"patches": [
{
"offset": 9111965,
"dllName": "bm2dx.dll",
"dataDisabled": "7E",
"dataEnabled": "EB"
}
]
},
```
In the UI, these will show up as tree nodes. The parent is not actually
treated as a patch; e.g., its state is not saved to the patch manager
config file; only the child patches states are managed, the parent's
state only bubble up only in the UI.
In downlevel versions of spice, group parents will show up as a patch of
invalid type. Child patches will still show up as individual patches.
## Testing
*how was the code tested?*
## Link to GitHub Issue or related Pull Request, if one exists
#345
## Description of change
If IIDX/SDVX/POPN "native touch" option is enabled, show an error
message if user toggles subscreen window.
Those options are meant for users with touch screens, and disables mouse
interactions. Users who like to randomly turn on options often latch on
to this option and get confused when clicks don't register.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
Fix a long-standing issue of hotplug not working for keyboards and mice.
The code only registered for HID notifications; we also need to do it
for the keyboard GUID and mouse GUID.
## Testing
Confirmed that keyboards and mice can be hot unplugged and plugged.
## Link to GitHub Issue or related Pull Request, if one exists
Fixes#782
## Description of change
This addresses an issue only seen on Linux + WINE.
Defer retaining WASAPI clients until `Initialize` succeeds.
Before this PR, temporary clients created during DirectShow device
capability probing were retained as active audio clients, causing
Wine/Linux crashes in DDR and popn.
Also covers IAudioClient3, dummy, ASIO, WaveOut, and null-device
initialization paths, for consistency.
## Testing
WIP
## Link to GitHub Issue or related Pull Request, if one exists
Regressed by #793
## Description of change
Due to lock inversion, when binding an analog axis as a button, spice
deadlocks. Fix that.
Also create a separate `unordered_map` that keeps track of device
handles so that `WM_INPUT` handle can look up devices without having to
acquire the larger `devices_mutex` which could be held by (potentially)
lengthy operations like hotplug.
Fix more synchronization issues around hotplug. Latent bug exposed by
MIDI 2.0 issues.
## Testing
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
Refactor patch manager.
This one file had the UI logic, config save/load, parsing patches JSON,
applying memory patches, everything all in one cpp file. Refactor and
separate out the layers.
## Testing
Sanity checked patch workflows.
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
GDI bit blit overlay used exclusively for jubeat & shogikai was running
at 30fps, which caused the Jubeat touch debug UI to not render fast
enough. Run it at 60 fps, and also perform double buffering to avoid
flickering.
This could have been scoped to JB but I made the change for both. XP
builds will keep running at 30fps since those people run on cabs with
ancient hardware.
## Testing
Tested jubeat and shogikai, overlay renders without flickering at 60 fps
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
Fixes held touch contacts briefly dropping under rapid multi-touch (e.g.
holding several jubeat buttons and tapping elsewhere many times would
make the holds briefly release and the hold again).
A HID digitizer reports a fixed number of contact slots per report and
cycles the rest through later reports, so the touch layer keeps an
unreported contact alive for a few reports (a per-contact TTL). The TTL
was only set for contacts in the current report and had no slack, so
when the contact count rose (from the rapid taps) the reporting cycle
got longer and stationary holds were expired before the device cycled
back to them.
Now, the cycle length is recomputed every report and every tracked
contact's TTL is extended to it (never shrunk), so a rising contact
count can't starve a currently held contact. The 50 ms last-report
timeout still removes genuinely lifted contacts.
## Testing
Tested on jb, rb.