mirror of
https://github.com/patchzyy/wiicompiled
synced 2026-09-13 18:06:49 -04:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e6f9b2197e | |||
| 65047bc7b7 | |||
| 989d5e00da | |||
| efc44b0482 | |||
| d3d0de62a6 | |||
| c6ef17378e |
@@ -281,7 +281,7 @@ foreach ($required in @('ToolkitFingerprint','TranslationFingerprint','NativeToo
|
||||
|
||||
$manifest = [ordered]@{
|
||||
SchemaVersion = 2
|
||||
ProductVersion = '0.2.26'
|
||||
ProductVersion = '0.2.27'
|
||||
ExpectedGameId = $pins.GameId
|
||||
ExpectedDolSha256 = $pins.DolSha256
|
||||
ExpectedRelSha256 = $pins.RelSha256
|
||||
|
||||
@@ -88,7 +88,7 @@ assert_file "$ninja_bin" "Portable Ninja"
|
||||
assert_file "$cc" "Portable C compiler"
|
||||
assert_file "$cxx" "Portable C++ compiler"
|
||||
assert_dir "$aurora_source" "aurora-main source tree"
|
||||
clang_binary=$(normalize "$toolchain_dir/bin/clang-22")
|
||||
clang_binary=$(normalize "$toolchain_dir/bin/clang-23")
|
||||
assert_file "$clang_binary" "Portable clang driver binary"
|
||||
|
||||
(( parallel > 0 )) || parallel=$(nproc)
|
||||
|
||||
@@ -121,7 +121,7 @@ internal static class PlatformChecks
|
||||
internal static class ProductInfo
|
||||
{
|
||||
public const string Name = "WiiCompiled";
|
||||
public const string Version = "0.2.26";
|
||||
public const string Version = "0.2.27";
|
||||
|
||||
/// <summary>
|
||||
/// The setup executable is copied into the installation under this name. It is the launcher and
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<AssemblyName>WiiCompiled.Setup</AssemblyName>
|
||||
<RootNamespace>WiiCompiled.Setup.Windows</RootNamespace>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<Version>0.2.26</Version>
|
||||
<Version>0.2.27</Version>
|
||||
<Authors>patchzy</Authors>
|
||||
<Product>WiiCompiled</Product>
|
||||
<Description>Command-line installer and launcher for WiiCompiled</Description>
|
||||
|
||||
@@ -25,7 +25,7 @@ set -euo pipefail
|
||||
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
workspace=$(cd "$script_dir/.." && pwd)
|
||||
|
||||
llvm_version=22.1.8
|
||||
llvm_version=23.1.0
|
||||
cmake_version=4.3.3
|
||||
ninja_version=1.13.2
|
||||
destination="$script_dir/artifacts/portable-tools"
|
||||
@@ -52,13 +52,13 @@ done
|
||||
|
||||
case "$arch" in
|
||||
x86_64) llvm_release_arch=X64; target_triple=x86_64-unknown-linux-gnu
|
||||
llvm_release_sha256=df0e1ecf16caf3489a272a5eea4eec9b0d82878f6477fa309504f918a0006384
|
||||
llvm_release_sha256=18da30f77f475688a18f7704d23f9f155ae007ed9922dbed6850a9419d9fec8c
|
||||
cmake_release_arch=x86_64
|
||||
cmake_sha256=927b2368a946c37269c3a66225ab00544e756459cdd0b5d0da438694fb9ff802
|
||||
ninja_asset=ninja-linux.zip
|
||||
ninja_sha256=5749cbc4e668273514150a80e387a957f933c6ed3f5f11e03fb30955e2bbead6 ;;
|
||||
aarch64) llvm_release_arch=ARM64; target_triple=aarch64-unknown-linux-gnu
|
||||
llvm_release_sha256=805efad2bb91cb4967fa569e0881d10c0f69c04461cf671cccbae19f547acc34
|
||||
llvm_release_sha256=cfb31bfc713ef453248bf5bd026312f838ad6c52c25623e987cb6a340f3050d4
|
||||
cmake_release_arch=aarch64
|
||||
cmake_sha256=9ea38356dbd3e32e51029a3e09a0f2f8e117ef4fbcaad7a21ffb36409bbd5cb4
|
||||
ninja_asset=ninja-linux-aarch64.zip
|
||||
@@ -120,9 +120,9 @@ echo "prepare-portable-tools.sh: pruning to the minimal compile+link toolchain..
|
||||
|
||||
# clang: the real driver executable plus the clang/clang++ symlinks CMake/local-build.sh invoke.
|
||||
# Stripped: debug symbols are dead weight for a bundled compiler nobody will debug.
|
||||
cp -a "$src/bin/clang-22" "$work/bin/"
|
||||
strip "$work/bin/clang-22"
|
||||
ln -s clang-22 "$work/bin/clang"
|
||||
cp -a "$src/bin/clang-23" "$work/bin/"
|
||||
strip "$work/bin/clang-23"
|
||||
ln -s clang-23 "$work/bin/clang"
|
||||
ln -s clang "$work/bin/clang++"
|
||||
|
||||
# lld: linked via -fuse-ld=lld, which clang resolves by looking for ld.lld next to itself first -
|
||||
|
||||
@@ -804,7 +804,7 @@ inline bool SetWiiRemotesEnabled(bool value) {
|
||||
}
|
||||
|
||||
// Whether to keep rescanning Bluetooth while no Wii controller is connected.
|
||||
inline bool WiiContinuousScanEnabled(bool fallback = true) {
|
||||
inline bool WiiContinuousScanEnabled(bool fallback = false) {
|
||||
return Get().wiiContinuousScan.value_or(fallback);
|
||||
}
|
||||
|
||||
|
||||
@@ -102,8 +102,10 @@ void HideRemotesFromPad(PADStatus* statuses, uint32_t count);
|
||||
void Poll();
|
||||
// Forces one re-enumeration right now (settings overlay "Rescan now").
|
||||
void RescanNow();
|
||||
// True while Poll() is actively rescanning (no Wii controller connected).
|
||||
// True while Poll() is looking for a remote (no Wii controller connected).
|
||||
bool IsScanning();
|
||||
// True where looking means periodic rescans; elsewhere Poll() waits for hotplug.
|
||||
bool PeriodicRescanEnabled();
|
||||
// Rescans issued since a Wii controller was last seen.
|
||||
uint32_t ScanCount();
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ void ApplyConfiguredMappings() {
|
||||
}
|
||||
|
||||
bool g_wiiRemotesEnabled = RuntimeConfigFile::WiiRemotesEnabled(true);
|
||||
bool g_wiiContinuousScan = RuntimeConfigFile::WiiContinuousScanEnabled(true);
|
||||
bool g_wiiContinuousScan = RuntimeConfigFile::WiiContinuousScanEnabled(false);
|
||||
|
||||
// Accelerometer readout and zero-point calibration for a bare remote / remote + Nunchuk.
|
||||
void DrawWiiRemoteAccelerometer(uint32_t port) {
|
||||
@@ -393,8 +393,10 @@ void DrawWiiRemoteSettings(uint32_t selectedGamePort) {
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
ImGui::SameLine();
|
||||
if (WiiRemoteInput::IsScanning()) {
|
||||
if (WiiRemoteInput::IsScanning() && WiiRemoteInput::PeriodicRescanEnabled()) {
|
||||
ImGui::TextDisabled("Scanning... (%u so far) - press 1+2 on the remote", WiiRemoteInput::ScanCount());
|
||||
} else if (WiiRemoteInput::IsScanning()) {
|
||||
ImGui::TextDisabled("Waiting for a remote - press 1+2 on the remote");
|
||||
} else {
|
||||
ImGui::TextDisabled("Not scanning");
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
|
||||
namespace WiiRemoteInput {
|
||||
namespace {
|
||||
@@ -346,6 +348,10 @@ bool AnyWiiControllerConnected() {
|
||||
|
||||
// Route SDL's input diagnostics (HIDAPI open failures, the Wii driver's
|
||||
// extension/status messages) into console.log, minus the periodic chatter.
|
||||
// A sub-warning message is written once: SDL repeats the same line on every
|
||||
// enumeration (one "couldn't open /dev/hidraw7: Permission denied" per HID
|
||||
// device per pass), and console.log is unbuffered, so the repeats were a
|
||||
// per-pass burst of writes on the main thread for no new information.
|
||||
void SDLCALL LogSdlMessage(void*, int category, SDL_LogPriority priority, const char* message) {
|
||||
if (message == nullptr) {
|
||||
return;
|
||||
@@ -354,11 +360,42 @@ void SDLCALL LogSdlMessage(void*, int category, SDL_LogPriority priority, const
|
||||
(std::strstr(message, "Motion Plus") != nullptr || std::strstr(message, "Resetting report mode") != nullptr)) {
|
||||
return;
|
||||
}
|
||||
if (category == SDL_LOG_CATEGORY_INPUT || priority >= SDL_LOG_PRIORITY_WARN) {
|
||||
RT_LOG("sdl") << message << std::endl;
|
||||
if (category != SDL_LOG_CATEGORY_INPUT && priority < SDL_LOG_PRIORITY_WARN) {
|
||||
return;
|
||||
}
|
||||
if (priority < SDL_LOG_PRIORITY_WARN) {
|
||||
// Device paths in these messages keep changing (/dev/hidrawN climbs with
|
||||
// hotplug churn), so cap the set instead of holding one string per line
|
||||
// for the whole session.
|
||||
static std::unordered_set<std::string> s_seen;
|
||||
if (s_seen.size() >= 256) {
|
||||
s_seen.clear();
|
||||
}
|
||||
if (!s_seen.insert(message).second) {
|
||||
return;
|
||||
}
|
||||
RT_LOG("sdl") << message << " (further identical messages suppressed)" << std::endl;
|
||||
return;
|
||||
}
|
||||
RT_LOG("sdl") << message << std::endl;
|
||||
}
|
||||
|
||||
// Whether Poll() drives its own periodic re-enumeration. The 1->0->1 hint
|
||||
// flip below makes SDL close and re-open every HIDAPI device on the main
|
||||
// thread, and on Linux that means an open() attempt on every /dev/hidraw node
|
||||
// (each failing with EACCES until a udev rule grants access), which showed up
|
||||
// as a frame hitch every scan interval even on an empty menu. It exists for
|
||||
// Windows Bluetooth stacks, where a remote that drops or is switched on after
|
||||
// launch is not seen again until the driver re-enumerates. Linux and macOS
|
||||
// already get hotplug from udev / IOKit: SDL re-enumerates when a device
|
||||
// appears, so nothing periodic is needed there. The overlay's "Rescan now"
|
||||
// still works everywhere.
|
||||
#if defined(_WIN32)
|
||||
constexpr bool kPeriodicRescan = true;
|
||||
#else
|
||||
constexpr bool kPeriodicRescan = false;
|
||||
#endif
|
||||
|
||||
// Second half of a rescan: re-enables the Wii driver once SDL has seen it off.
|
||||
void FinishRescan(uint64_t now) {
|
||||
if (g_driverOffSinceMs == 0 || now - g_driverOffSinceMs < kRescanDriverOffMs) {
|
||||
@@ -444,18 +481,19 @@ void Poll() {
|
||||
g_lastScanMs = SDL_GetTicks();
|
||||
return;
|
||||
}
|
||||
if (!RuntimeConfigFile::WiiContinuousScanEnabled(true)) {
|
||||
if (!RuntimeConfigFile::WiiContinuousScanEnabled(false)) {
|
||||
g_scanning = false;
|
||||
return;
|
||||
}
|
||||
const uint64_t now = SDL_GetTicks();
|
||||
if (!g_scanning) {
|
||||
RT_LOG(RT_TAG_CONFIG) << "No Wii Remote connected; scanning for one (press 1+2 on the remote)"
|
||||
<< std::endl;
|
||||
RT_LOG(RT_TAG_CONFIG) << "No Wii Remote connected; "
|
||||
<< (kPeriodicRescan ? "scanning for one" : "waiting for one to be paired")
|
||||
<< " (press 1+2 on the remote)" << std::endl;
|
||||
g_scanning = true;
|
||||
g_lostAtMs = now;
|
||||
}
|
||||
if (now - g_lostAtMs < kScanStartDelayMs) {
|
||||
if (!kPeriodicRescan || now - g_lostAtMs < kScanStartDelayMs) {
|
||||
return;
|
||||
}
|
||||
const uint64_t interval = now - g_lostAtMs < kFastScanWindowMs ? kFastScanIntervalMs : kScanIntervalMs;
|
||||
@@ -470,6 +508,11 @@ bool IsScanning() {
|
||||
return g_scanning;
|
||||
}
|
||||
|
||||
// Whether looking for a remote means periodic rescans or waiting for hotplug.
|
||||
bool PeriodicRescanEnabled() {
|
||||
return kPeriodicRescan;
|
||||
}
|
||||
|
||||
// Number of rescans since a Wii controller was last seen.
|
||||
uint32_t ScanCount() {
|
||||
return g_scanCount;
|
||||
|
||||
Reference in New Issue
Block a user