|
|
|
@ -12,6 +12,7 @@ |
|
|
|
#include <fmt/ostream.h>
|
|
|
|
|
|
|
|
#include "common/logging.h"
|
|
|
|
#include "common/param_package.h"
|
|
|
|
#include "common/scm_rev.h"
|
|
|
|
#include "common/settings.h"
|
|
|
|
#include "common/settings_enums.h"
|
|
|
|
@ -27,6 +28,8 @@ |
|
|
|
#include "core/hle/service/filesystem/filesystem.h"
|
|
|
|
#include "core/loader/loader.h"
|
|
|
|
#include "frontend_common/config.h"
|
|
|
|
#include "hid_core/frontend/emulated_controller.h"
|
|
|
|
#include "hid_core/hid_core.h"
|
|
|
|
#include "input_common/main.h"
|
|
|
|
#include "network/network.h"
|
|
|
|
#include "sdl_config.h"
|
|
|
|
@ -57,6 +60,7 @@ |
|
|
|
#include <orbis/libkernel.h>
|
|
|
|
#include <orbis/SystemService.h>
|
|
|
|
#include <orbis/AudioOut.h>
|
|
|
|
#include <orbis/Pad.h>
|
|
|
|
#include <orbis/UserService.h>
|
|
|
|
#elif defined(_WIN32)
|
|
|
|
extern "C" { |
|
|
|
@ -372,7 +376,7 @@ int main(int argc, char** argv) { |
|
|
|
// Apply the command line arguments
|
|
|
|
system.ApplySettings(); |
|
|
|
Settings::values.renderer_backend.SetValue(Settings::RendererBackend::Null); |
|
|
|
Common::Log::SetGlobalFilter(Common::Log::Filter(Common::Log::Level::Trace)); |
|
|
|
Common::Log::SetGlobalFilter(Common::Log::Filter(Common::Log::Level::Info)); |
|
|
|
|
|
|
|
std::unique_ptr<EmuWindow_SDL3> emu_window; |
|
|
|
switch (Settings::values.renderer_backend.GetValue()) { |
|
|
|
@ -453,6 +457,41 @@ int main(int argc, char** argv) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
auto emulated_controller = system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1); |
|
|
|
auto const input_devices = input_subsystem.GetInputDevices(); |
|
|
|
for (const auto& e : input_devices) { |
|
|
|
LOG_INFO(Input, "FOUND=Device -> {} {}", e.Get("display", "Unknown"), e.Serialize()); |
|
|
|
} |
|
|
|
auto const& device = input_devices[3]; |
|
|
|
LOG_INFO(Input, "selected? {}", device.Serialize()); |
|
|
|
auto const button_mappings = input_subsystem.GetButtonMappingForDevice(device); |
|
|
|
auto const analog_mappings = input_subsystem.GetAnalogMappingForDevice(device); |
|
|
|
auto const motion_mappings = input_subsystem.GetMotionMappingForDevice(device); |
|
|
|
for (const auto& pair : button_mappings) |
|
|
|
emulated_controller->SetButtonParam(pair.first, pair.second); |
|
|
|
for (const auto& pair : analog_mappings) |
|
|
|
emulated_controller->SetStickParam(pair.first, pair.second); |
|
|
|
for (const auto& pair : motion_mappings) |
|
|
|
emulated_controller->SetMotionParam(pair.first, pair.second); |
|
|
|
|
|
|
|
for (const auto& pair : button_mappings) |
|
|
|
LOG_INFO(Input, "btn:{}:{}", pair.first, pair.second.Serialize()); |
|
|
|
for (const auto& pair : analog_mappings) |
|
|
|
LOG_INFO(Input, "ang:{}:{}", pair.first, pair.second.Serialize()); |
|
|
|
for (const auto& pair : motion_mappings) |
|
|
|
LOG_INFO(Input, "mot:{}:{}", pair.first, pair.second.Serialize()); |
|
|
|
|
|
|
|
emulated_controller->SaveCurrentConfig(); |
|
|
|
emulated_controller->ReloadFromSettings(); |
|
|
|
|
|
|
|
auto const mapped_devices = emulated_controller->GetMappedDevices(); |
|
|
|
LOG_INFO(Input, "AND SO, WHAT MAPPED DEVICES WE GOT?"); |
|
|
|
for (const auto& e : mapped_devices) { |
|
|
|
LOG_INFO(Input, "Mapped=Device? -> {}", e.Get("display", "Unknown")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Core is loaded, start the GPU (makes the GPU contexts current to this thread)
|
|
|
|
system.GPU().Start(); |
|
|
|
system.GetCpuManager().OnGpuReady(); |
|
|
|
|