mirror of
https://git.suyu.dev/suyu/suyu
synced 2025-08-26 22:16:28 -05:00
Full rebrand
This commit is contained in:
@@ -89,7 +89,7 @@ endif()
|
||||
create_target_directory_groups(input_common)
|
||||
target_link_libraries(input_common PUBLIC hid_core PRIVATE common Boost::headers)
|
||||
|
||||
if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||
if (SUYU_USE_PRECOMPILED_HEADERS)
|
||||
target_precompile_headers(input_common PRIVATE precompiled_headers.h)
|
||||
endif()
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project & 2024 suyu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include <set>
|
||||
@@ -28,8 +28,8 @@ void Android::RegisterController(jobject j_input_device) {
|
||||
auto env = Common::Android::GetEnvForThread();
|
||||
const std::string guid = Common::Android::GetJString(
|
||||
env, static_cast<jstring>(
|
||||
env->CallObjectMethod(j_input_device, Common::Android::GetYuzuDeviceGetGUID())));
|
||||
const s32 port = env->CallIntMethod(j_input_device, Common::Android::GetYuzuDeviceGetPort());
|
||||
env->CallObjectMethod(j_input_device, Common::Android::GetSuyuDeviceGetGUID())));
|
||||
const s32 port = env->CallIntMethod(j_input_device, Common::Android::GetSuyuDeviceGetPort());
|
||||
const auto identifier = GetIdentifier(guid, static_cast<size_t>(port));
|
||||
PreSetController(identifier);
|
||||
|
||||
@@ -81,7 +81,7 @@ bool Android::IsVibrationEnabled([[maybe_unused]] const PadIdentifier& identifie
|
||||
if (device != input_devices.end()) {
|
||||
return Common::Android::RunJNIOnFiber<bool>([&](JNIEnv* env) {
|
||||
return static_cast<bool>(env->CallBooleanMethod(
|
||||
device->second, Common::Android::GetYuzuDeviceGetSupportsVibration()));
|
||||
device->second, Common::Android::GetSuyuDeviceGetSupportsVibration()));
|
||||
});
|
||||
}
|
||||
return false;
|
||||
@@ -92,7 +92,7 @@ std::vector<Common::ParamPackage> Android::GetInputDevices() const {
|
||||
auto env = Common::Android::GetEnvForThread();
|
||||
for (const auto& [key, value] : input_devices) {
|
||||
auto name_object = static_cast<jstring>(
|
||||
env->CallObjectMethod(value, Common::Android::GetYuzuDeviceGetName()));
|
||||
env->CallObjectMethod(value, Common::Android::GetSuyuDeviceGetName()));
|
||||
const std::string name =
|
||||
fmt::format("{} {}", Common::Android::GetJString(env, name_object), key.port);
|
||||
devices.emplace_back(Common::ParamPackage{
|
||||
@@ -107,7 +107,7 @@ std::vector<Common::ParamPackage> Android::GetInputDevices() const {
|
||||
|
||||
std::set<s32> Android::GetDeviceAxes(JNIEnv* env, jobject& j_device) const {
|
||||
auto j_axes = static_cast<jobjectArray>(
|
||||
env->CallObjectMethod(j_device, Common::Android::GetYuzuDeviceGetAxes()));
|
||||
env->CallObjectMethod(j_device, Common::Android::GetSuyuDeviceGetAxes()));
|
||||
std::set<s32> axes;
|
||||
for (int i = 0; i < env->GetArrayLength(j_axes); ++i) {
|
||||
jobject axis = env->GetObjectArrayElement(j_axes, i);
|
||||
@@ -215,7 +215,7 @@ ButtonMapping Android::GetButtonMappingForDevice(const Common::ParamPackage& par
|
||||
jintArray j_keys = env->NewIntArray(static_cast<int>(keycode_ids.size()));
|
||||
env->SetIntArrayRegion(j_keys, 0, static_cast<int>(keycode_ids.size()), keycode_ids.data());
|
||||
auto j_has_keys_object = static_cast<jbooleanArray>(
|
||||
env->CallObjectMethod(j_device, Common::Android::GetYuzuDeviceHasKeys(), j_keys));
|
||||
env->CallObjectMethod(j_device, Common::Android::GetSuyuDeviceHasKeys(), j_keys));
|
||||
jboolean isCopy = false;
|
||||
jboolean* j_has_keys = env->GetBooleanArrayElements(j_has_keys_object, &isCopy);
|
||||
|
||||
@@ -359,7 +359,7 @@ void Android::SendVibrations(JNIEnv* env, std::stop_token token) {
|
||||
if (device != input_devices.end()) {
|
||||
float average_intensity = static_cast<float>(
|
||||
(request.vibration.high_amplitude + request.vibration.low_amplitude) / 2.0);
|
||||
env->CallVoidMethod(device->second, Common::Android::GetYuzuDeviceVibrate(),
|
||||
env->CallVoidMethod(device->second, Common::Android::GetSuyuDeviceVibrate(),
|
||||
average_intensity);
|
||||
}
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ public:
|
||||
|
||||
/**
|
||||
* Registers controller number to accept new inputs.
|
||||
* @param j_input_device YuzuInputDevice object from the Android frontend to register.
|
||||
* @param j_input_device SuyuInputDevice object from the Android frontend to register.
|
||||
*/
|
||||
void RegisterController(jobject j_input_device);
|
||||
|
||||
@@ -62,9 +62,9 @@ public:
|
||||
std::vector<Common::ParamPackage> GetInputDevices() const override;
|
||||
|
||||
/**
|
||||
* Gets the axes reported by the YuzuInputDevice.
|
||||
* Gets the axes reported by the SuyuInputDevice.
|
||||
* @param env JNI environment pointer.
|
||||
* @param j_device YuzuInputDevice from the Android frontend.
|
||||
* @param j_device SuyuInputDevice from the Android frontend.
|
||||
* @return Set of the axes reported by the underlying Android InputDevice
|
||||
*/
|
||||
std::set<s32> GetDeviceAxes(JNIEnv* env, jobject& j_device) const;
|
||||
|
@@ -489,7 +489,7 @@ void SDLDriver::CloseJoysticks() {
|
||||
SDLDriver::SDLDriver(std::string input_engine_) : InputEngine(std::move(input_engine_)) {
|
||||
// Set our application name. Currently passed to DBus by SDL and visible to the user through
|
||||
// their desktop environment.
|
||||
SDL_SetHint(SDL_HINT_APP_NAME, "yuzu");
|
||||
SDL_SetHint(SDL_HINT_APP_NAME, "suyu");
|
||||
|
||||
if (!Settings::values.enable_raw_input) {
|
||||
// Disable raw input. When enabled this setting causes SDL to die when a web applet opens
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#include "input_common/input_engine.h"
|
||||
|
||||
/*
|
||||
To play back TAS scripts on Yuzu, select the folder with scripts in the configuration menu below
|
||||
To play back TAS scripts on Suyu, select the folder with scripts in the configuration menu below
|
||||
Tools -> Configure TAS. The file itself has normal text format and has to be called script0-1.txt
|
||||
for controller 1, script0-2.txt for controller 2 and so forth (with max. 8 players).
|
||||
|
||||
@@ -26,7 +26,7 @@ A script file has the same format as TAS-nx uses, so final files will look like
|
||||
46 KEY_A 32767;0 0;0
|
||||
47 KEY_A 32767;0 0;0
|
||||
|
||||
After placing the file at the correct location, it can be read into Yuzu with the (default) hotkey
|
||||
After placing the file at the correct location, it can be read into Suyu with the (default) hotkey
|
||||
CTRL+F6 (refresh). In the bottom left corner, it will display the amount of frames the script file
|
||||
has. Playback can be started or stopped using CTRL+F5.
|
||||
|
||||
|
@@ -42,7 +42,7 @@ Common::Input::DriverResult JoyconDriver::RequestDeviceAccess(SDL_hid_device_inf
|
||||
SDL_hid_open(device_info->vendor_id, device_info->product_id, device_info->serial_number);
|
||||
std::memcpy(&handle_serial_number, device_info->serial_number, 15);
|
||||
if (!hidapi_handle->handle) {
|
||||
LOG_ERROR(Input, "Yuzu can't gain access to this device: ID {:04X}:{:04X}.",
|
||||
LOG_ERROR(Input, "Suyu can't gain access to this device: ID {:04X}:{:04X}.",
|
||||
device_info->vendor_id, device_info->product_id);
|
||||
return Common::Input::DriverResult::HandleInUse;
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ Common::Input::DriverResult JoyconCommonProtocol::CheckDeviceAccess(
|
||||
SDL_hid_open(device_info->vendor_id, device_info->product_id, device_info->serial_number);
|
||||
|
||||
if (!hidapi_handle->handle) {
|
||||
LOG_ERROR(Input, "Yuzu can't gain access to this device: ID {:04X}:{:04X}.",
|
||||
LOG_ERROR(Input, "Suyu can't gain access to this device: ID {:04X}:{:04X}.",
|
||||
device_info->vendor_id, device_info->product_id);
|
||||
return Common::Input::DriverResult::HandleInUse;
|
||||
}
|
||||
|
@@ -84,7 +84,7 @@ enum RegisterFlags : u8 {
|
||||
struct Version {};
|
||||
/**
|
||||
* Requests the server to send information about what controllers are plugged into the ports
|
||||
* In yuzu's case, we only have one controller, so for simplicity's sake, we can just send a
|
||||
* In suyu's case, we only have one controller, so for simplicity's sake, we can just send a
|
||||
* request explicitly for the first controller port and leave it at that. In the future it would be
|
||||
* nice to make this configurable
|
||||
*/
|
||||
|
@@ -184,7 +184,7 @@ public:
|
||||
.raw_value = input_engine->GetAxis(identifier, axis_y),
|
||||
.properties = properties_y,
|
||||
};
|
||||
// This is a workaround to keep compatibility with old yuzu versions. Vertical axis is
|
||||
// This is a workaround to keep compatibility with old suyu versions. Vertical axis is
|
||||
// inverted on SDL compared to Nintendo
|
||||
if (invert_axis_y) {
|
||||
status.y.raw_value = -status.y.raw_value;
|
||||
|
Reference in New Issue
Block a user