Skip to content

Dance around early support - #897

Merged
bicarus-dev merged 5 commits into
spice2x:mainfrom
Avimitin:dance-around-early-support
Sep 12, 2026
Merged

bicarus-dev merged 5 commits into
spice2x:mainfrom
Avimitin:dance-around-early-support

Conversation

@Avimitin

@Avimitin Avimitin commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Link to GitHub Issue or related Pull Request, if one exists

N/A

Description of change

This PR add initial supports for running Dance aRound in window mode, with keyboard, cardio supports.

Testing

cut-under-10mb.mp4
  • Tested full game play, user profile saving with Asphyxia

Assisted by AI.

@Avimitin

Avimitin commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

This PR is not ready because I haven't tested the official RealSense D435 camera yet. However, I bought two D430s (they lack the RGB channel but are much cheaper than the D435, and I checked the IDA dump—the game doesn't need RGB frames), and they are currently on the way. I would like to test if the D430 works to help verify the support matrix of the RealSense series.

Also, the current code is mostly AIGC. I want to do a local review first to avoid wasting your time on nitpicks, so I opened this as a draft PR.

Comment thread src/spice2x/games/udn/udn.cpp Outdated
}

void UDNGame::pre_attach() {
// The title has no MIDI controls. In the cabinet compatibility profile the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's a cabinet compatibility profile?

Comment thread src/spice2x/hooks/graphics/graphics.cpp Outdated
position->cy = outer_height;

static ULONGLONG last_log = 0;
const ULONGLONG now = GetTickCount64();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_system_milliseconds or get_performance_milliseconds

Comment thread src/spice2x/hooks/graphics/graphics.cpp Outdated
static bool UDN_INTERACTIVE_WINDOW_RESIZE = false;

UINT graphics_udn_enforce_message() {
static const UINT message = RegisterWindowMessageW(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest moving all of the new UDN-specific graphics code to graphics_udn.cpp

#include "cfg/api.h"

namespace games::udn {
namespace Buttons {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spicesdk_io.h also needs update unfortunately

@Avimitin

Copy link
Copy Markdown
Contributor Author

Sad, D430 arrived but it is tricky to hack the RGB frame. The vision model Dance aRound used indeed needs RGB frames for human skeleton detection. Data with only depth information is not enough for the vision model to generate skeleton and feeds the game. So now it is hard to verify a native boot with minimal hack (D435 is too expensive). Some webcam using mediapipe works with the game, I will try to test more webcam and SteamVR to make sure code changes are stable.

@bicarus-dev

Copy link
Copy Markdown
Member

If it boots and the menu buttons are functional, that's good enough for me.

@Avimitin
Avimitin force-pushed the dance-around-early-support branch 2 times, most recently from e2c3300 to d5cfe13 Compare September 5, 2026 16:49
@Avimitin
Avimitin marked this pull request as ready for review September 5, 2026 17:11
@Avimitin

Avimitin commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Tested full gameplay with Asphyxia and confirmed that cardio, keypad password input, and the online e-pass service are working. Score saving and user profile storage are also working. During local testing without Asphyxia, I found that the -ea option works until the user enters the score screen during their first playthrough, so I appended some new changes after the last review.

@Avimitin
Avimitin force-pushed the dance-around-early-support branch from d5cfe13 to 4cbe28a Compare September 5, 2026 17:57
@Avimitin

Avimitin commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

To support alternative capture devices in DANCE aROUND, plugins need to redirect requests for VisionPoseWrapper.dll to their own body tracking implementation. Exposing this capability through the SDK keeps Spice independent of any specific plugin.

Comment thread src/spice2x/launcher/options.cpp Outdated
.category = "Advanced Game Options",
},
{
// UDNEnableMIDI

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of this option if the game will fail to work?

}

std::string games::udn::get_buttons_help() {
return

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably worth mentioning here that MIDI is disabled

Comment thread src/spice2x/games/udn/udn.cpp Outdated
// Use half of the game's 1920x3252 single-window render surface by default.
if (GRAPHICS_WINDOWED) {
if (!GRAPHICS_WINDOW_SIZE.has_value()) {
GRAPHICS_WINDOW_SIZE = std::make_pair(960u, 1626u);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GRAPHICS_WINDOW_SIZE is a user setting and this will overwrite them on disk. If the goal is to launch the game with sensible defaults, you need to use different globals.

Comment thread src/spice2x/util/execexe.cpp Outdated
port_name = portName;
acio = acioHandle;
detour::trampoline_try("execexe.dll", MAKEINTRESOURCE(7),
detour::trampoline_try(execexe_CloseHandle,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested other Unity games to ensure they are not regressed?

Comment thread src/spice2x/easrv/easrv.cpp Outdated
"\xd5\x80\x5e\x3b\xda\xd5\xb3\xae\xec\xe8\x99\x66\x0b\xb7\x55\xe9\xd5\x39\x03\x3d\xd3\x6d\x89\x2f"
"\x30\x2e\x0f\x3a\x35\x31\x98\x55\x65\x03\x9c\xfc\xad\xbe\x79\x21\x19\x01\x01\x18\x03\x20\x35\x2b"
"\x58\xe3\xaf\xd9\x89\x7b\x78\xc9\x2a\x19\xbe\x3b\xb5\x09\xf9\xd6\xb9\x68\x8b\x36\xa3\xc7\x39\xd7"
"\x30\x2e\x0f\x3a\x35\x31\x98\x55\x65\x03\x9c\xfc\xad\xbe\x79\x21\x19\x01\x01\x18\x03\xf2\x20\xcc"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was it before? Changes like this make me nervous because we have no idea if some crusty old game relied on the old string...

return desc.OutputWindow == main;
}

void pace_forced_present(UINT frame_rate) {

@bicarus-dev bicarus-dev Sep 5, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest: moving UDN specific graphics hook into d3d11_swapchain_udn.cpp (having clear file boundaries help us understand which ones are game-specific hacks)

@Avimitin
Avimitin force-pushed the dance-around-early-support branch from 937a3ae to 47e1ab1 Compare September 6, 2026 17:27
@Avimitin

Avimitin commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Haven't test other Unity game yet, I will try to run CCJ and Polaris later.

Avimitin and others added 5 commits September 12, 2026 23:23
Resolve UDN short ordinal jump stubs before creating trampolines and
prefer the kamunity ordinal import for deferred initialization when
nearby trampoline allocation is unavailable. Supply the targets
expected by the existing detour helper.

Keep non-UDN DLL-name/ordinal hook paths and shared MinHook helpers
unchanged.

Co-authored-by: Codex <codex@openai.com>
Register UDN in the launcher, configuration, e-amusement detection,
build and SDK I/O tables. Emulate BI2X buttons, lights and firmware
state, and bridge ICCA card/keypad input to existing Spice services.
Preserve native handlers for unrelated AIO nodes and reuse native
error and firmware-completion predicates.

Add argument and I/O overrides. Disable MIDI enumeration before UDN
input initialization to avoid the WinMM startup failure, and explain
the restriction in button help.

Co-authored-by: Codex <codex@openai.com>
Attach existing graphics hooks on the Unity window owner thread
using a one-time message hook. Keep UDN D3D11 policy in its own
file and use the existing window settings and message callbacks
when Unity reapplies cabinet geometry.

Scope display-query, fullscreen and output-mode overrides to -w.
Reuse PreciseSleepTimer for 60 FPS windowed pacing. Preserve all
presentation flags and leave fullscreen intervals and display
queries unchanged. Do not introduce automatic window defaults.

Co-authored-by: Codex <codex@openai.com>
DANCE aROUND reads the facility name through Unity ANSI marshaling
when entering the score screen after a song. Use SPICE2 LOCAL for
UDN to avoid the result-page error with -ea. Preserve the packet
layout, length, encoding marker, terminator and other fields.

Other games retain the original upstream response bytes.

Co-authored-by: Codex <codex@openai.com>
Expose the existing library alias facility through a v0.5 SDK
callback appended after the v0.4 fields, preserving released field
offsets and size negotiation. Protect alias registration and lookup
with one shared mutex, releasing it before OS loader calls.

This lets external capture replacements receive Unity DLL loads
without placing device-specific implementations in Spice.

Co-authored-by: Codex <codex@openai.com>
@Avimitin
Avimitin force-pushed the dance-around-early-support branch from 47e1ab1 to 2e1e2ac Compare September 12, 2026 15:40
@Avimitin

Copy link
Copy Markdown
Contributor Author

Tested Polaris, it start successfully into the eco mode. Also tested windowed and full screen mode Polaris and they are all worked.

@bicarus-dev
bicarus-dev merged commit 2b6e767 into spice2x:main Sep 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants