mirror of
https://github.com/patchzyy/wiicompiled
synced 2026-09-11 01:23:15 -04:00
Merge branch 'main' into main
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "settings_overlay.h"
|
||||
#include "wup028_adapter.h"
|
||||
#include "audio_backend.h"
|
||||
#include "controller_mapping_wizard.h"
|
||||
#include "game_graphics_options.h"
|
||||
#include "music_attenuation.h"
|
||||
#include "runtime_config.h"
|
||||
@@ -321,30 +322,7 @@ void DrawControllerSettings() {
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
if (ImGui::BeginMenu("GameCube controller adapter")) {
|
||||
const auto adapter = Wup028Adapter::GetInfo();
|
||||
const char* state = adapter.state == Wup028Adapter::ConnectionState::Connected
|
||||
? "Connected"
|
||||
: adapter.state == Wup028Adapter::ConnectionState::DriverError ? "Driver error"
|
||||
: "Searching";
|
||||
ImGui::Text("Status: %s", state);
|
||||
if (!adapter.deviceName.empty()) ImGui::Text("Device: %s", adapter.deviceName.c_str());
|
||||
ImGui::TextWrapped("%s", adapter.detail.c_str());
|
||||
if (adapter.state == Wup028Adapter::ConnectionState::Connected) {
|
||||
ImGui::Text("Poll rate: %.1f reports/s", adapter.pollRateHz);
|
||||
ImGui::Text("Endpoints: IN 0x%02X, OUT 0x%02X", adapter.inputEndpoint, adapter.outputEndpoint);
|
||||
for (size_t port = 0; port < adapter.ports.size(); ++port) {
|
||||
const uint8_t type = adapter.portStatus[port] & 0x30;
|
||||
const char* typeName = type == 0x10 ? "wired" : type == 0x20 ? "wireless" : "none";
|
||||
ImGui::Text("Adapter port %u: %s (type %s, raw 0x%02X)",
|
||||
static_cast<unsigned>(port + 1),
|
||||
adapter.ports[port] ? "Controller connected" : "Empty", typeName,
|
||||
adapter.portStatus[port]);
|
||||
}
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
ImGui::Separator();
|
||||
controller_mapping_wizard::DrawSetupList();
|
||||
const uint32_t controllerCount = PADCount();
|
||||
if (controllerCount == 0) {
|
||||
ImGui::TextDisabled("No controller connected");
|
||||
@@ -865,6 +843,7 @@ void PersistDisplayModeIfChanged() {
|
||||
} // namespace
|
||||
|
||||
void InitializeRuntimeSettings() noexcept {
|
||||
controller_mapping_wizard::LoadPersistedMappings();
|
||||
ApplyConfiguredMappings();
|
||||
AudioBackend::Instance().SetMasterVolume(static_cast<float>(g_audioVolumePercent) / 100.0f);
|
||||
AudioBackend::Instance().SetMuted(g_audioMuted);
|
||||
@@ -897,6 +876,7 @@ void HandleEvents(const AuroraEvent* events) noexcept {
|
||||
if (ev->type != AURORA_SDL_EVENT) {
|
||||
continue;
|
||||
}
|
||||
controller_mapping_wizard::HandleSdlEvent(ev->sdl);
|
||||
if (IsToggleKey(ev->sdl, SDL_SCANCODE_F10)) {
|
||||
SetTopBarVisible(!g_topBarVisible);
|
||||
}
|
||||
@@ -918,6 +898,10 @@ void Draw() noexcept {
|
||||
}
|
||||
DrawFpsOverlay();
|
||||
DrawTopBar();
|
||||
controller_mapping_wizard::Draw();
|
||||
// The wizard captures raw presses; keep them out of the game even when the
|
||||
// top bar is hidden mid-setup.
|
||||
PADBlockInput(g_topBarVisible || controller_mapping_wizard::IsActive());
|
||||
DrawStartupScreen();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user