forked from etc/pineapple-src
early-access version 3453
This commit is contained in:
parent
5e818ba7dd
commit
3114efd039
110 changed files with 270 additions and 306 deletions
|
@ -344,12 +344,12 @@ if(ENABLE_QT)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(QT_DEP_GLU QUIET glu>=9.0.0)
|
pkg_check_modules(QT_DEP_GLU QUIET glu>=9.0.0)
|
||||||
if (NOT QT_DEP_GLU_FOUND)
|
if (NOT QT_DEP_GLU_FOUND)
|
||||||
message(FATAL_ERROR "Qt bundled pacakge dependency `glu` not found. \
|
message(FATAL_ERROR "Qt bundled package dependency `glu` not found. \
|
||||||
Perhaps `libglu1-mesa-dev` needs to be installed?")
|
Perhaps `libglu1-mesa-dev` needs to be installed?")
|
||||||
endif()
|
endif()
|
||||||
pkg_check_modules(QT_DEP_MESA QUIET dri>=20.0.8)
|
pkg_check_modules(QT_DEP_MESA QUIET dri>=20.0.8)
|
||||||
if (NOT QT_DEP_MESA_FOUND)
|
if (NOT QT_DEP_MESA_FOUND)
|
||||||
message(FATAL_ERROR "Qt bundled pacakge dependency `dri` not found. \
|
message(FATAL_ERROR "Qt bundled package dependency `dri` not found. \
|
||||||
Perhaps `mesa-common-dev` needs to be installed?")
|
Perhaps `mesa-common-dev` needs to be installed?")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
# FFmpeg_LIBRARIES: aggregate all the paths to the libraries
|
# FFmpeg_LIBRARIES: aggregate all the paths to the libraries
|
||||||
# FFmpeg_FOUND: True if all components have been found
|
# FFmpeg_FOUND: True if all components have been found
|
||||||
#
|
#
|
||||||
# This module defines the following targets, which are prefered over variables:
|
# This module defines the following targets, which are preferred over variables:
|
||||||
#
|
#
|
||||||
# FFmpeg::<component>: Target to use <component> directly, with include path,
|
# FFmpeg::<component>: Target to use <component> directly, with include path,
|
||||||
# library and dependencies set up. If you are using a static build, you are
|
# library and dependencies set up. If you are using a static build, you are
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
yuzu emulator early access
|
yuzu emulator early access
|
||||||
=============
|
=============
|
||||||
|
|
||||||
This is the source code for early-access 3452.
|
This is the source code for early-access 3453.
|
||||||
|
|
||||||
## Legal Notice
|
## Legal Notice
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ if (MSVC)
|
||||||
)
|
)
|
||||||
|
|
||||||
if (USE_CCACHE OR YUZU_USE_PRECOMPILED_HEADERS)
|
if (USE_CCACHE OR YUZU_USE_PRECOMPILED_HEADERS)
|
||||||
# when caching, we need to use /Z7 to downgrade debug info to use an older but more cachable format
|
# when caching, we need to use /Z7 to downgrade debug info to use an older but more cacheable format
|
||||||
# Precompiled headers are deleted if not using /Z7. See https://github.com/nanoant/CMakePCHCompiler/issues/21
|
# Precompiled headers are deleted if not using /Z7. See https://github.com/nanoant/CMakePCHCompiler/issues/21
|
||||||
add_compile_options(/Z7)
|
add_compile_options(/Z7)
|
||||||
else()
|
else()
|
||||||
|
|
|
@ -58,7 +58,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Get a list of audio out device names.
|
* Get a list of audio out device names.
|
||||||
*
|
*
|
||||||
* @oaram names - Output container to write names to.
|
* @param names - Output container to write names to.
|
||||||
* @return Number of names written.
|
* @return Number of names written.
|
||||||
*/
|
*/
|
||||||
u32 GetAudioOutDeviceNames(
|
u32 GetAudioOutDeviceNames(
|
||||||
|
|
|
@ -16,7 +16,7 @@ struct AudioBuffer {
|
||||||
s64 played_timestamp;
|
s64 played_timestamp;
|
||||||
/// Game memory address for these samples.
|
/// Game memory address for these samples.
|
||||||
VAddr samples;
|
VAddr samples;
|
||||||
/// Unqiue identifier for this buffer.
|
/// Unique identifier for this buffer.
|
||||||
u64 tag;
|
u64 tag;
|
||||||
/// Size of the samples buffer.
|
/// Size of the samples buffer.
|
||||||
u64 size;
|
u64 size;
|
||||||
|
|
|
@ -165,7 +165,7 @@ void AudioRenderer::ThreadFunc() {
|
||||||
// Check this buffer is valid, as it may not be used.
|
// Check this buffer is valid, as it may not be used.
|
||||||
if (command_buffer.buffer != 0) {
|
if (command_buffer.buffer != 0) {
|
||||||
// If there are no remaining commands (from the previous list),
|
// If there are no remaining commands (from the previous list),
|
||||||
// this is a new command list, initalize it.
|
// this is a new command list, initialize it.
|
||||||
if (command_buffer.remaining_command_count == 0) {
|
if (command_buffer.remaining_command_count == 0) {
|
||||||
command_list_processor.Initialize(system, command_buffer.buffer,
|
command_list_processor.Initialize(system, command_buffer.buffer,
|
||||||
command_buffer.size, streams[index]);
|
command_buffer.size, streams[index]);
|
||||||
|
|
|
@ -155,7 +155,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Check if a variadic command buffer is supported.
|
* Check if a variadic command buffer is supported.
|
||||||
* As of Rev 5 with the added optional performance metric logging, the command
|
* As of Rev 5 with the added optional performance metric logging, the command
|
||||||
* buffer can be a variable size, so take that into account for calcualting its size.
|
* buffer can be a variable size, so take that into account for calculating its size.
|
||||||
*
|
*
|
||||||
* @return True if supported, otherwise false.
|
* @return True if supported, otherwise false.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -192,7 +192,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Get this effect's parameter data.
|
* Get this effect's parameter data.
|
||||||
*
|
*
|
||||||
* @return Pointer to the parametter, must be cast to the correct type.
|
* @return Pointer to the parameter, must be cast to the correct type.
|
||||||
*/
|
*/
|
||||||
u8* GetParameter() {
|
u8* GetParameter() {
|
||||||
return parameter.data();
|
return parameter.data();
|
||||||
|
@ -201,7 +201,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Get this effect's parameter data.
|
* Get this effect's parameter data.
|
||||||
*
|
*
|
||||||
* @return Pointer to the parametter, must be cast to the correct type.
|
* @return Pointer to the parameter, must be cast to the correct type.
|
||||||
*/
|
*/
|
||||||
u8* GetStateBuffer() {
|
u8* GetStateBuffer() {
|
||||||
return state.data();
|
return state.data();
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
*/
|
*/
|
||||||
enum class State {
|
enum class State {
|
||||||
Invalid,
|
Invalid,
|
||||||
Aquired,
|
Acquired,
|
||||||
RequestDetach,
|
RequestDetach,
|
||||||
Detached,
|
Detached,
|
||||||
RequestAttach,
|
RequestAttach,
|
||||||
|
|
|
@ -93,7 +93,7 @@ public:
|
||||||
* Splitter sort, traverse the splitter node graph and sort the sorted mixes from results.
|
* Splitter sort, traverse the splitter node graph and sort the sorted mixes from results.
|
||||||
*
|
*
|
||||||
* @param splitter_context - Splitter context for the sort.
|
* @param splitter_context - Splitter context for the sort.
|
||||||
* @return True if the sort was successful, othewise false.
|
* @return True if the sort was successful, otherwise false.
|
||||||
*/
|
*/
|
||||||
bool TSortInfo(const SplitterContext& splitter_context);
|
bool TSortInfo(const SplitterContext& splitter_context);
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ struct PerformanceDetailVersion1 {
|
||||||
/* 0x0D */ PerformanceEntryType entry_type;
|
/* 0x0D */ PerformanceEntryType entry_type;
|
||||||
};
|
};
|
||||||
static_assert(sizeof(PerformanceDetailVersion1) == 0x10,
|
static_assert(sizeof(PerformanceDetailVersion1) == 0x10,
|
||||||
"PerformanceDetailVersion1 has the worng size!");
|
"PerformanceDetailVersion1 has the wrong size!");
|
||||||
|
|
||||||
struct PerformanceDetailVersion2 {
|
struct PerformanceDetailVersion2 {
|
||||||
/* 0x00 */ u32 node_id;
|
/* 0x00 */ u32 node_id;
|
||||||
|
@ -45,6 +45,6 @@ struct PerformanceDetailVersion2 {
|
||||||
/* 0x14 */ char unk14[0x4];
|
/* 0x14 */ char unk14[0x4];
|
||||||
};
|
};
|
||||||
static_assert(sizeof(PerformanceDetailVersion2) == 0x18,
|
static_assert(sizeof(PerformanceDetailVersion2) == 0x18,
|
||||||
"PerformanceDetailVersion2 has the worng size!");
|
"PerformanceDetailVersion2 has the wrong size!");
|
||||||
|
|
||||||
} // namespace AudioCore::AudioRenderer
|
} // namespace AudioCore::AudioRenderer
|
||||||
|
|
|
@ -22,7 +22,7 @@ struct PerformanceEntryVersion1 {
|
||||||
/* 0x0C */ PerformanceEntryType entry_type;
|
/* 0x0C */ PerformanceEntryType entry_type;
|
||||||
};
|
};
|
||||||
static_assert(sizeof(PerformanceEntryVersion1) == 0x10,
|
static_assert(sizeof(PerformanceEntryVersion1) == 0x10,
|
||||||
"PerformanceEntryVersion1 has the worng size!");
|
"PerformanceEntryVersion1 has the wrong size!");
|
||||||
|
|
||||||
struct PerformanceEntryVersion2 {
|
struct PerformanceEntryVersion2 {
|
||||||
/* 0x00 */ u32 node_id;
|
/* 0x00 */ u32 node_id;
|
||||||
|
@ -32,6 +32,6 @@ struct PerformanceEntryVersion2 {
|
||||||
/* 0x0D */ char unk0D[0xB];
|
/* 0x0D */ char unk0D[0xB];
|
||||||
};
|
};
|
||||||
static_assert(sizeof(PerformanceEntryVersion2) == 0x18,
|
static_assert(sizeof(PerformanceEntryVersion2) == 0x18,
|
||||||
"PerformanceEntryVersion2 has the worng size!");
|
"PerformanceEntryVersion2 has the wrong size!");
|
||||||
|
|
||||||
} // namespace AudioCore::AudioRenderer
|
} // namespace AudioCore::AudioRenderer
|
||||||
|
|
|
@ -16,7 +16,7 @@ struct PerformanceFrameHeaderVersion1 {
|
||||||
/* 0x14 */ u32 frame_index;
|
/* 0x14 */ u32 frame_index;
|
||||||
};
|
};
|
||||||
static_assert(sizeof(PerformanceFrameHeaderVersion1) == 0x18,
|
static_assert(sizeof(PerformanceFrameHeaderVersion1) == 0x18,
|
||||||
"PerformanceFrameHeaderVersion1 has the worng size!");
|
"PerformanceFrameHeaderVersion1 has the wrong size!");
|
||||||
|
|
||||||
struct PerformanceFrameHeaderVersion2 {
|
struct PerformanceFrameHeaderVersion2 {
|
||||||
/* 0x00 */ u32 magic; // "PERF"
|
/* 0x00 */ u32 magic; // "PERF"
|
||||||
|
@ -31,6 +31,6 @@ struct PerformanceFrameHeaderVersion2 {
|
||||||
/* 0x25 */ char unk25[0xB];
|
/* 0x25 */ char unk25[0xB];
|
||||||
};
|
};
|
||||||
static_assert(sizeof(PerformanceFrameHeaderVersion2) == 0x30,
|
static_assert(sizeof(PerformanceFrameHeaderVersion2) == 0x30,
|
||||||
"PerformanceFrameHeaderVersion2 has the worng size!");
|
"PerformanceFrameHeaderVersion2 has the wrong size!");
|
||||||
|
|
||||||
} // namespace AudioCore::AudioRenderer
|
} // namespace AudioCore::AudioRenderer
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Get the total number of splitter destinations.
|
* Get the total number of splitter destinations.
|
||||||
*
|
*
|
||||||
* @return Number of destiantions.
|
* @return Number of destinations.
|
||||||
*/
|
*/
|
||||||
u32 GetDataCount() const;
|
u32 GetDataCount() const;
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Update this destination.
|
* Update this destination.
|
||||||
*
|
*
|
||||||
* @param params - Inpout parameters to update the destination.
|
* @param params - Input parameters to update the destination.
|
||||||
*/
|
*/
|
||||||
void Update(const InParameter& params);
|
void Update(const InParameter& params);
|
||||||
|
|
||||||
|
@ -126,9 +126,9 @@ private:
|
||||||
std::array<f32, MaxMixBuffers> prev_mix_volumes{0.0f};
|
std::array<f32, MaxMixBuffers> prev_mix_volumes{0.0f};
|
||||||
/// Next destination in the mix chain
|
/// Next destination in the mix chain
|
||||||
SplitterDestinationData* next{};
|
SplitterDestinationData* next{};
|
||||||
/// Is this destiantion in use?
|
/// Is this destination in use?
|
||||||
bool in_use{};
|
bool in_use{};
|
||||||
/// Does this destiantion need its volumes updated?
|
/// Does this destination need its volumes updated?
|
||||||
bool need_update{};
|
bool need_update{};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -49,14 +49,14 @@ public:
|
||||||
/**
|
/**
|
||||||
* Get the number of destinations in this splitter.
|
* Get the number of destinations in this splitter.
|
||||||
*
|
*
|
||||||
* @return The number of destiantions.
|
* @return The number of destinations.
|
||||||
*/
|
*/
|
||||||
u32 GetDestinationCount() const;
|
u32 GetDestinationCount() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the number of destinations in this splitter.
|
* Set the number of destinations in this splitter.
|
||||||
*
|
*
|
||||||
* @param count - The new number of destiantions.
|
* @param count - The new number of destinations.
|
||||||
*/
|
*/
|
||||||
void SetDestinationCount(u32 count);
|
void SetDestinationCount(u32 count);
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ public:
|
||||||
ExecutionMode GetExecutionMode() const;
|
ExecutionMode GetExecutionMode() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the rendering deivce for this system.
|
* Get the rendering device for this system.
|
||||||
* This is unused.
|
* This is unused.
|
||||||
*
|
*
|
||||||
* @return Rendering device for this system.
|
* @return Rendering device for this system.
|
||||||
|
@ -241,7 +241,7 @@ private:
|
||||||
std::span<u8> command_workbuffer{};
|
std::span<u8> command_workbuffer{};
|
||||||
/// Size of command workbuffer
|
/// Size of command workbuffer
|
||||||
u64 command_workbuffer_size{};
|
u64 command_workbuffer_size{};
|
||||||
/// Numebr of commands in the workbuffer
|
/// Number of commands in the workbuffer
|
||||||
u64 command_buffer_size{};
|
u64 command_buffer_size{};
|
||||||
/// Manager for upsamplers
|
/// Manager for upsamplers
|
||||||
UpsamplerManager* upsampler_manager{};
|
UpsamplerManager* upsampler_manager{};
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Initialize the system manager, called when any system is registered.
|
* Initialize the system manager, called when any system is registered.
|
||||||
*
|
*
|
||||||
* @return True if sucessfully initialized, otherwise false.
|
* @return True if successfully initialized, otherwise false.
|
||||||
*/
|
*/
|
||||||
bool InitializeUnsafe();
|
bool InitializeUnsafe();
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ public:
|
||||||
* The manager does not own the system, so do not free it without calling Remove.
|
* The manager does not own the system, so do not free it without calling Remove.
|
||||||
*
|
*
|
||||||
* @param system - The system to add.
|
* @param system - The system to add.
|
||||||
* @return True if succesfully added, otherwise false.
|
* @return True if successfully added, otherwise false.
|
||||||
*/
|
*/
|
||||||
bool Add(System& system);
|
bool Add(System& system);
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public:
|
||||||
* Remove an audio render system from the manager.
|
* Remove an audio render system from the manager.
|
||||||
*
|
*
|
||||||
* @param system - The system to remove.
|
* @param system - The system to remove.
|
||||||
* @return True if succesfully removed, otherwise false.
|
* @return True if successfully removed, otherwise false.
|
||||||
*/
|
*/
|
||||||
bool Remove(System& system);
|
bool Remove(System& system);
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ public:
|
||||||
void Initialize();
|
void Initialize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does this voice ned an update?
|
* Does this voice need an update?
|
||||||
*
|
*
|
||||||
* @param params - Input parameters to check matching.
|
* @param params - Input parameters to check matching.
|
||||||
*
|
*
|
||||||
|
@ -236,7 +236,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param error_info - Output array of errors.
|
* @param error_info - Output array of errors.
|
||||||
* @param wave_buffer - The wavebuffer to be updated.
|
* @param wave_buffer - The wavebuffer to be updated.
|
||||||
* @param wave_buffer_internal - Input parametters to be used for the update.
|
* @param wave_buffer_internal - Input parameters to be used for the update.
|
||||||
* @param sample_format - Sample format of the wavebuffer.
|
* @param sample_format - Sample format of the wavebuffer.
|
||||||
* @param valid - Is this wavebuffer valid?
|
* @param valid - Is this wavebuffer valid?
|
||||||
* @param pool_mapper - Used to map the wavebuffers.
|
* @param pool_mapper - Used to map the wavebuffers.
|
||||||
|
|
|
@ -66,7 +66,7 @@ public:
|
||||||
* @param description The room description
|
* @param description The room description
|
||||||
* @param port The port of the room
|
* @param port The port of the room
|
||||||
* @param net_version The version of the libNetwork that gets used
|
* @param net_version The version of the libNetwork that gets used
|
||||||
* @param has_password True if the room is passowrd protected
|
* @param has_password True if the room is password protected
|
||||||
* @param preferred_game The preferred game of the room
|
* @param preferred_game The preferred game of the room
|
||||||
* @param preferred_game_id The title id of the preferred game
|
* @param preferred_game_id The title id of the preferred game
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -90,7 +90,7 @@ Fiber::~Fiber() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fiber::Exit() {
|
void Fiber::Exit() {
|
||||||
ASSERT_MSG(impl->is_thread_fiber, "Exitting non main thread fiber");
|
ASSERT_MSG(impl->is_thread_fiber, "Exiting non main thread fiber");
|
||||||
if (!impl->is_thread_fiber) {
|
if (!impl->is_thread_fiber) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ class FixedPoint;
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
// helper templates to make magic with types :)
|
// helper templates to make magic with types :)
|
||||||
// these allow us to determine resonable types from
|
// these allow us to determine reasonable types from
|
||||||
// a desired size, they also let us infer the next largest type
|
// a desired size, they also let us infer the next largest type
|
||||||
// from a type which is nice for the division op
|
// from a type which is nice for the division op
|
||||||
template <size_t T>
|
template <size_t T>
|
||||||
|
|
|
@ -322,7 +322,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return true when a given memory region is a "nieche" and the placeholders don't have to be
|
/// Return true when a given memory region is a "nieche" and the placeholders don't have to be
|
||||||
/// splitted.
|
/// split.
|
||||||
bool IsNiechePlaceholder(size_t virtual_offset, size_t length) const {
|
bool IsNiechePlaceholder(size_t virtual_offset, size_t length) const {
|
||||||
const auto it = placeholders.upper_bound({virtual_offset, virtual_offset + length});
|
const auto it = placeholders.upper_bound({virtual_offset, virtual_offset + length});
|
||||||
if (it != placeholders.end() && it->lower() == virtual_offset + length) {
|
if (it != placeholders.end() && it->lower() == virtual_offset + length) {
|
||||||
|
@ -484,7 +484,7 @@ class HostMemory::Impl {
|
||||||
public:
|
public:
|
||||||
explicit Impl(size_t /*backing_size */, size_t /* virtual_size */) {
|
explicit Impl(size_t /*backing_size */, size_t /* virtual_size */) {
|
||||||
// This is just a place holder.
|
// This is just a place holder.
|
||||||
// Please implement fastmem in a propper way on your platform.
|
// Please implement fastmem in a proper way on your platform.
|
||||||
throw std::bad_alloc{};
|
throw std::bad_alloc{};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
namespace Common::Input {
|
namespace Common::Input {
|
||||||
|
|
||||||
// Type of data that is expected to recieve or send
|
// Type of data that is expected to receive or send
|
||||||
enum class InputType {
|
enum class InputType {
|
||||||
None,
|
None,
|
||||||
Battery,
|
Battery,
|
||||||
|
@ -103,7 +103,7 @@ enum class VibrationAmplificationType {
|
||||||
struct AnalogProperties {
|
struct AnalogProperties {
|
||||||
// Anything below this value will be detected as zero
|
// Anything below this value will be detected as zero
|
||||||
float deadzone{};
|
float deadzone{};
|
||||||
// Anyting above this values will be detected as one
|
// Anything above this values will be detected as one
|
||||||
float range{1.0f};
|
float range{1.0f};
|
||||||
// Minimum value to be detected as active
|
// Minimum value to be detected as active
|
||||||
float threshold{0.5f};
|
float threshold{0.5f};
|
||||||
|
@ -209,7 +209,7 @@ struct LedStatus {
|
||||||
bool led_4{};
|
bool led_4{};
|
||||||
};
|
};
|
||||||
|
|
||||||
// Raw data fom camera
|
// Raw data from camera
|
||||||
struct CameraStatus {
|
struct CameraStatus {
|
||||||
CameraFormat format{CameraFormat::None};
|
CameraFormat format{CameraFormat::None};
|
||||||
std::vector<u8> data{};
|
std::vector<u8> data{};
|
||||||
|
@ -428,7 +428,7 @@ inline void UnregisterOutputFactory(const std::string& name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an input device from given paramters.
|
* Create an input device from given parameters.
|
||||||
* @tparam InputDeviceType the type of input devices to create
|
* @tparam InputDeviceType the type of input devices to create
|
||||||
* @param params a serialized ParamPackage string that contains all parameters for creating the
|
* @param params a serialized ParamPackage string that contains all parameters for creating the
|
||||||
* device
|
* device
|
||||||
|
|
|
@ -229,7 +229,7 @@ public:
|
||||||
value = swap(swap() - 1);
|
value = swap(swap() - 1);
|
||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
// Comparaison
|
// Comparison
|
||||||
// v == i
|
// v == i
|
||||||
bool operator==(const swapped_t& i) const {
|
bool operator==(const swapped_t& i) const {
|
||||||
return swap() == i.swap();
|
return swap() == i.swap();
|
||||||
|
@ -368,7 +368,7 @@ public:
|
||||||
// Member
|
// Member
|
||||||
/** todo **/
|
/** todo **/
|
||||||
|
|
||||||
// Arithmetics
|
// Arithmetic
|
||||||
template <typename S, typename T2, typename F2>
|
template <typename S, typename T2, typename F2>
|
||||||
friend S operator+(const S& p, const swapped_t v);
|
friend S operator+(const S& p, const swapped_t v);
|
||||||
|
|
||||||
|
@ -384,7 +384,7 @@ public:
|
||||||
template <typename S, typename T2, typename F2>
|
template <typename S, typename T2, typename F2>
|
||||||
friend S operator%(const S& p, const swapped_t v);
|
friend S operator%(const S& p, const swapped_t v);
|
||||||
|
|
||||||
// Arithmetics + assignments
|
// Arithmetic + assignments
|
||||||
template <typename S, typename T2, typename F2>
|
template <typename S, typename T2, typename F2>
|
||||||
friend S operator+=(const S& p, const swapped_t v);
|
friend S operator+=(const S& p, const swapped_t v);
|
||||||
|
|
||||||
|
@ -415,7 +415,7 @@ public:
|
||||||
friend bool operator==(const S& p, const swapped_t v);
|
friend bool operator==(const S& p, const swapped_t v);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Arithmetics
|
// Arithmetic
|
||||||
template <typename S, typename T, typename F>
|
template <typename S, typename T, typename F>
|
||||||
S operator+(const S& i, const swap_struct_t<T, F> v) {
|
S operator+(const S& i, const swap_struct_t<T, F> v) {
|
||||||
return i + v.swap();
|
return i + v.swap();
|
||||||
|
@ -441,7 +441,7 @@ S operator%(const S& i, const swap_struct_t<T, F> v) {
|
||||||
return i % v.swap();
|
return i % v.swap();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Arithmetics + assignments
|
// Arithmetic + assignments
|
||||||
template <typename S, typename T, typename F>
|
template <typename S, typename T, typename F>
|
||||||
S& operator+=(S& i, const swap_struct_t<T, F> v) {
|
S& operator+=(S& i, const swap_struct_t<T, F> v) {
|
||||||
i += v.swap();
|
i += v.swap();
|
||||||
|
@ -465,7 +465,7 @@ S operator&(const swap_struct_t<T, F> v, const S& i) {
|
||||||
return static_cast<S>(v.swap() & i);
|
return static_cast<S>(v.swap() & i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comparaison
|
// Comparison
|
||||||
template <typename S, typename T, typename F>
|
template <typename S, typename T, typename F>
|
||||||
bool operator<(const S& p, const swap_struct_t<T, F> v) {
|
bool operator<(const S& p, const swap_struct_t<T, F> v) {
|
||||||
return p < v.swap();
|
return p < v.swap();
|
||||||
|
|
|
@ -358,7 +358,7 @@ struct System::Impl {
|
||||||
void ShutdownMainProcess() {
|
void ShutdownMainProcess() {
|
||||||
SetShuttingDown(true);
|
SetShuttingDown(true);
|
||||||
|
|
||||||
// Log last frame performance stats if game was loded
|
// Log last frame performance stats if game was loaded
|
||||||
if (perf_stats) {
|
if (perf_stats) {
|
||||||
const auto perf_results = GetAndResetPerfStats();
|
const auto perf_results = GetAndResetPerfStats();
|
||||||
constexpr auto performance = Common::Telemetry::FieldType::Performance;
|
constexpr auto performance = Common::Telemetry::FieldType::Performance;
|
||||||
|
|
|
@ -146,7 +146,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the system
|
* Initializes the system
|
||||||
* This function will initialize core functionaility used for system emulation
|
* This function will initialize core functionality used for system emulation
|
||||||
*/
|
*/
|
||||||
void Initialize();
|
void Initialize();
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,7 @@ private:
|
||||||
// The queue is a min-heap using std::make_heap/push_heap/pop_heap.
|
// The queue is a min-heap using std::make_heap/push_heap/pop_heap.
|
||||||
// We don't use std::priority_queue because we need to be able to serialize, unserialize and
|
// We don't use std::priority_queue because we need to be able to serialize, unserialize and
|
||||||
// erase arbitrary events (RemoveEvent()) regardless of the queue order. These aren't
|
// erase arbitrary events (RemoveEvent()) regardless of the queue order. These aren't
|
||||||
// accomodated by the standard adaptor class.
|
// accommodated by the standard adaptor class.
|
||||||
std::vector<Event> event_queue;
|
std::vector<Event> event_queue;
|
||||||
u64 event_fifo_id = 0;
|
u64 event_fifo_id = 0;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
namespace Core::Crypto {
|
namespace Core::Crypto {
|
||||||
|
|
||||||
// Sits on top of a VirtualFile and provides CTR-mode AES decription.
|
// Sits on top of a VirtualFile and provides CTR-mode AES description.
|
||||||
class CTREncryptionLayer : public EncryptionLayer {
|
class CTREncryptionLayer : public EncryptionLayer {
|
||||||
public:
|
public:
|
||||||
using IVData = std::array<u8, 16>;
|
using IVData = std::array<u8, 16>;
|
||||||
|
|
|
@ -249,7 +249,7 @@ public:
|
||||||
|
|
||||||
static bool KeyFileExists(bool title);
|
static bool KeyFileExists(bool title);
|
||||||
|
|
||||||
// Call before using the sd seed to attempt to derive it if it dosen't exist. Needs system
|
// Call before using the sd seed to attempt to derive it if it doesn't exist. Needs system
|
||||||
// save 8*43 and the private file to exist.
|
// save 8*43 and the private file to exist.
|
||||||
void DeriveSDSeedLazy();
|
void DeriveSDSeedLazy();
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
namespace Core::Crypto {
|
namespace Core::Crypto {
|
||||||
|
|
||||||
// Sits on top of a VirtualFile and provides XTS-mode AES decription.
|
// Sits on top of a VirtualFile and provides XTS-mode AES description.
|
||||||
class XTSEncryptionLayer : public EncryptionLayer {
|
class XTSEncryptionLayer : public EncryptionLayer {
|
||||||
public:
|
public:
|
||||||
XTSEncryptionLayer(FileSys::VirtualFile base, Key256 key);
|
XTSEncryptionLayer(FileSys::VirtualFile base, Key256 key);
|
||||||
|
|
|
@ -93,7 +93,7 @@ inline bool IsDirectoryLogoPartition(const VirtualDir& pfs) {
|
||||||
pfs->GetFile("StartupMovie.gif") != nullptr;
|
pfs->GetFile("StartupMovie.gif") != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// An implementation of VfsDirectory that represents a Nintendo Content Archive (NCA) conatiner.
|
// An implementation of VfsDirectory that represents a Nintendo Content Archive (NCA) container.
|
||||||
// After construction, use GetStatus to determine if the file is valid and ready to be used.
|
// After construction, use GetStatus to determine if the file is valid and ready to be used.
|
||||||
class NCA : public ReadOnlyVfsDirectory {
|
class NCA : public ReadOnlyVfsDirectory {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -162,7 +162,7 @@ public:
|
||||||
InstallResult InstallEntry(const NSP& nsp, bool overwrite_if_exists = false,
|
InstallResult InstallEntry(const NSP& nsp, bool overwrite_if_exists = false,
|
||||||
const VfsCopyFunction& copy = &VfsRawCopy);
|
const VfsCopyFunction& copy = &VfsRawCopy);
|
||||||
|
|
||||||
// Due to the fact that we must use Meta-type NCAs to determine the existance of files, this
|
// Due to the fact that we must use Meta-type NCAs to determine the existence of files, this
|
||||||
// poses quite a challenge. Instead of creating a new meta NCA for this file, yuzu will create a
|
// poses quite a challenge. Instead of creating a new meta NCA for this file, yuzu will create a
|
||||||
// dir inside the NAND called 'yuzu_meta' and store the raw CNMT there.
|
// dir inside the NAND called 'yuzu_meta' and store the raw CNMT there.
|
||||||
// TODO(DarkLordZach): Author real meta-type NCAs and install those.
|
// TODO(DarkLordZach): Author real meta-type NCAs and install those.
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
// Return whether or not the user has write permission on this filesystem.
|
// Return whether or not the user has write permission on this filesystem.
|
||||||
virtual bool IsWritable() const;
|
virtual bool IsWritable() const;
|
||||||
|
|
||||||
// Determine if the entry at path is non-existant, a file, or a directory.
|
// Determine if the entry at path is non-existent, a file, or a directory.
|
||||||
virtual VfsEntryType GetEntryType(std::string_view path) const;
|
virtual VfsEntryType GetEntryType(std::string_view path) const;
|
||||||
|
|
||||||
// Opens the file with path relative to root. If it doesn't exist, returns nullptr.
|
// Opens the file with path relative to root. If it doesn't exist, returns nullptr.
|
||||||
|
@ -58,7 +58,7 @@ public:
|
||||||
// Moves the file from old_path to new_path, returning the moved file on success and nullptr on
|
// Moves the file from old_path to new_path, returning the moved file on success and nullptr on
|
||||||
// failure.
|
// failure.
|
||||||
virtual VirtualFile MoveFile(std::string_view old_path, std::string_view new_path);
|
virtual VirtualFile MoveFile(std::string_view old_path, std::string_view new_path);
|
||||||
// Deletes the file with path relative to root, returing true on success.
|
// Deletes the file with path relative to root, returning true on success.
|
||||||
virtual bool DeleteFile(std::string_view path);
|
virtual bool DeleteFile(std::string_view path);
|
||||||
|
|
||||||
// Opens the directory with path relative to root. If it doesn't exist, returns nullptr.
|
// Opens the directory with path relative to root. If it doesn't exist, returns nullptr.
|
||||||
|
@ -71,7 +71,7 @@ public:
|
||||||
// Moves the directory from old_path to new_path, returning the moved directory on success and
|
// Moves the directory from old_path to new_path, returning the moved directory on success and
|
||||||
// nullptr on failure.
|
// nullptr on failure.
|
||||||
virtual VirtualDir MoveDirectory(std::string_view old_path, std::string_view new_path);
|
virtual VirtualDir MoveDirectory(std::string_view old_path, std::string_view new_path);
|
||||||
// Deletes the directory with path relative to root, returing true on success.
|
// Deletes the directory with path relative to root, returning true on success.
|
||||||
virtual bool DeleteDirectory(std::string_view path);
|
virtual bool DeleteDirectory(std::string_view path);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -144,7 +144,7 @@ public:
|
||||||
return Read(reinterpret_cast<u8*>(data), sizeof(T), offset);
|
return Read(reinterpret_cast<u8*>(data), sizeof(T), offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Writes exactly one byte to offset in file and retuns whether or not the byte was written
|
// Writes exactly one byte to offset in file and returns whether or not the byte was written
|
||||||
// successfully.
|
// successfully.
|
||||||
virtual bool WriteByte(u8 data, std::size_t offset = 0);
|
virtual bool WriteByte(u8 data, std::size_t offset = 0);
|
||||||
// Writes a vector of bytes to offset in file and returns the number of bytes successfully
|
// Writes a vector of bytes to offset in file and returns the number of bytes successfully
|
||||||
|
@ -191,13 +191,13 @@ public:
|
||||||
VfsDirectory() = default;
|
VfsDirectory() = default;
|
||||||
virtual ~VfsDirectory();
|
virtual ~VfsDirectory();
|
||||||
|
|
||||||
// Retrives the file located at path as if the current directory was root. Returns nullptr if
|
// Retrieves the file located at path as if the current directory was root. Returns nullptr if
|
||||||
// not found.
|
// not found.
|
||||||
virtual VirtualFile GetFileRelative(std::string_view path) const;
|
virtual VirtualFile GetFileRelative(std::string_view path) const;
|
||||||
// Calls GetFileRelative(path) on the root of the current directory.
|
// Calls GetFileRelative(path) on the root of the current directory.
|
||||||
virtual VirtualFile GetFileAbsolute(std::string_view path) const;
|
virtual VirtualFile GetFileAbsolute(std::string_view path) const;
|
||||||
|
|
||||||
// Retrives the directory located at path as if the current directory was root. Returns nullptr
|
// Retrieves the directory located at path as if the current directory was root. Returns nullptr
|
||||||
// if not found.
|
// if not found.
|
||||||
virtual VirtualDir GetDirectoryRelative(std::string_view path) const;
|
virtual VirtualDir GetDirectoryRelative(std::string_view path) const;
|
||||||
// Calls GetDirectoryRelative(path) on the root of the current directory.
|
// Calls GetDirectoryRelative(path) on the root of the current directory.
|
||||||
|
@ -205,7 +205,7 @@ public:
|
||||||
|
|
||||||
// Returns a vector containing all of the files in this directory.
|
// Returns a vector containing all of the files in this directory.
|
||||||
virtual std::vector<VirtualFile> GetFiles() const = 0;
|
virtual std::vector<VirtualFile> GetFiles() const = 0;
|
||||||
// Returns the file with filename matching name. Returns nullptr if directory dosen't have a
|
// Returns the file with filename matching name. Returns nullptr if directory doesn't have a
|
||||||
// file with name.
|
// file with name.
|
||||||
virtual VirtualFile GetFile(std::string_view name) const;
|
virtual VirtualFile GetFile(std::string_view name) const;
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ public:
|
||||||
|
|
||||||
// Returns a vector containing all of the subdirectories in this directory.
|
// Returns a vector containing all of the subdirectories in this directory.
|
||||||
virtual std::vector<VirtualDir> GetSubdirectories() const = 0;
|
virtual std::vector<VirtualDir> GetSubdirectories() const = 0;
|
||||||
// Returns the directory with name matching name. Returns nullptr if directory dosen't have a
|
// Returns the directory with name matching name. Returns nullptr if directory doesn't have a
|
||||||
// directory with name.
|
// directory with name.
|
||||||
virtual VirtualDir GetSubdirectory(std::string_view name) const;
|
virtual VirtualDir GetSubdirectory(std::string_view name) const;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ private:
|
||||||
boost::container::flat_map<std::string, std::weak_ptr<Common::FS::IOFile>> cache;
|
boost::container::flat_map<std::string, std::weak_ptr<Common::FS::IOFile>> cache;
|
||||||
};
|
};
|
||||||
|
|
||||||
// An implmentation of VfsFile that represents a file on the user's computer.
|
// An implementation of VfsFile that represents a file on the user's computer.
|
||||||
class RealVfsFile : public VfsFile {
|
class RealVfsFile : public VfsFile {
|
||||||
friend class RealVfsDirectory;
|
friend class RealVfsDirectory;
|
||||||
friend class RealVfsFilesystem;
|
friend class RealVfsFilesystem;
|
||||||
|
|
|
@ -205,7 +205,7 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a screen postion into the equivalent touchscreen position.
|
* Converts a screen position into the equivalent touchscreen position.
|
||||||
*/
|
*/
|
||||||
std::pair<f32, f32> MapToTouchScreen(u32 framebuffer_x, u32 framebuffer_y) const;
|
std::pair<f32, f32> MapToTouchScreen(u32 framebuffer_x, u32 framebuffer_y) const;
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ struct ControllerStatus {
|
||||||
RingAnalogValue ring_analog_value{};
|
RingAnalogValue ring_analog_value{};
|
||||||
NfcValues nfc_values{};
|
NfcValues nfc_values{};
|
||||||
|
|
||||||
// Data for HID serices
|
// Data for HID services
|
||||||
HomeButtonState home_button_state{};
|
HomeButtonState home_button_state{};
|
||||||
CaptureButtonState capture_button_state{};
|
CaptureButtonState capture_button_state{};
|
||||||
NpadButtonState npad_button_state{};
|
NpadButtonState npad_button_state{};
|
||||||
|
@ -357,7 +357,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a small vibration to the output device
|
* Sends a small vibration to the output device
|
||||||
* @return true if SetVibration was successfull
|
* @return true if SetVibration was successful
|
||||||
*/
|
*/
|
||||||
bool IsVibrationEnabled(std::size_t device_index);
|
bool IsVibrationEnabled(std::size_t device_index);
|
||||||
|
|
||||||
|
@ -373,7 +373,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Sets the desired camera format to be polled from a controller
|
* Sets the desired camera format to be polled from a controller
|
||||||
* @param camera_format size of each frame
|
* @param camera_format size of each frame
|
||||||
* @return true if SetCameraFormat was successfull
|
* @return true if SetCameraFormat was successful
|
||||||
*/
|
*/
|
||||||
bool SetCameraFormat(Core::IrSensor::ImageTransferProcessorFormat camera_format);
|
bool SetCameraFormat(Core::IrSensor::ImageTransferProcessorFormat camera_format);
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ struct DeviceStatus {
|
||||||
MouseWheelValues mouse_wheel_values{};
|
MouseWheelValues mouse_wheel_values{};
|
||||||
MouseStickValue mouse_stick_value{};
|
MouseStickValue mouse_stick_value{};
|
||||||
|
|
||||||
// Data for HID serices
|
// Data for HID services
|
||||||
KeyboardKey keyboard_state{};
|
KeyboardKey keyboard_state{};
|
||||||
KeyboardModifier keyboard_moddifier_state{};
|
KeyboardModifier keyboard_moddifier_state{};
|
||||||
MouseButton mouse_button_state{};
|
MouseButton mouse_button_state{};
|
||||||
|
@ -75,7 +75,7 @@ struct InterfaceUpdateCallback {
|
||||||
class EmulatedDevices {
|
class EmulatedDevices {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Contains all input data related to external devices that aren't necesarily a controller
|
* Contains all input data related to external devices that aren't necessarily a controller
|
||||||
* This includes devices such as the keyboard or mouse
|
* This includes devices such as the keyboard or mouse
|
||||||
*/
|
*/
|
||||||
explicit EmulatedDevices();
|
explicit EmulatedDevices();
|
||||||
|
|
|
@ -328,7 +328,7 @@ void SanitizeAnalog(Common::Input::AnalogStatus& analog, bool clamp_value) {
|
||||||
// Apply center offset
|
// Apply center offset
|
||||||
raw_value -= properties.offset;
|
raw_value -= properties.offset;
|
||||||
|
|
||||||
// Set initial values to be formated
|
// Set initial values to be formatted
|
||||||
value = raw_value;
|
value = raw_value;
|
||||||
|
|
||||||
// Calculate vector size
|
// Calculate vector size
|
||||||
|
@ -398,7 +398,7 @@ void SanitizeStick(Common::Input::AnalogStatus& analog_x, Common::Input::AnalogS
|
||||||
raw_x = properties_x.inverted ? -raw_x : raw_x;
|
raw_x = properties_x.inverted ? -raw_x : raw_x;
|
||||||
raw_y = properties_y.inverted ? -raw_y : raw_y;
|
raw_y = properties_y.inverted ? -raw_y : raw_y;
|
||||||
|
|
||||||
// Set initial values to be formated
|
// Set initial values to be formatted
|
||||||
x = raw_x;
|
x = raw_x;
|
||||||
y = raw_y;
|
y = raw_y;
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ private:
|
||||||
// Gyroscope vector measurement in radians/s.
|
// Gyroscope vector measurement in radians/s.
|
||||||
Common::Vec3f gyro;
|
Common::Vec3f gyro;
|
||||||
|
|
||||||
// Vector to be substracted from gyro measurements
|
// Vector to be subtracted from gyro measurements
|
||||||
Common::Vec3f gyro_bias;
|
Common::Vec3f gyro_bias;
|
||||||
|
|
||||||
// Minimum gyro amplitude to detect if the device is moving
|
// Minimum gyro amplitude to detect if the device is moving
|
||||||
|
|
|
@ -363,7 +363,7 @@ Result KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std:
|
||||||
code_size + m_system_resource_size);
|
code_size + m_system_resource_size);
|
||||||
R_RETURN(ResultLimitReached);
|
R_RETURN(ResultLimitReached);
|
||||||
}
|
}
|
||||||
// Initialize proces address space
|
// Initialize process address space
|
||||||
if (const Result result{m_page_table.InitializeForProcess(
|
if (const Result result{m_page_table.InitializeForProcess(
|
||||||
metadata.GetAddressSpaceType(), false, false, false, KMemoryManager::Pool::Application,
|
metadata.GetAddressSpaceType(), false, false, false, KMemoryManager::Pool::Application,
|
||||||
0x8000000, code_size, std::addressof(m_kernel.GetAppSystemResource()),
|
0x8000000, code_size, std::addressof(m_kernel.GetAppSystemResource()),
|
||||||
|
|
|
@ -245,7 +245,7 @@ public:
|
||||||
m_total_process_running_time_ticks += ticks;
|
m_total_process_running_time_ticks += ticks;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the process schedule count, used for thread yelding
|
/// Gets the process schedule count, used for thread yielding
|
||||||
s64 GetScheduledCount() const {
|
s64 GetScheduledCount() const {
|
||||||
return m_schedule_count;
|
return m_schedule_count;
|
||||||
}
|
}
|
||||||
|
|
|
@ -789,7 +789,7 @@ Result Module::Interface::InitializeApplicationInfoBase() {
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_WARNING(Service_ACC, "ApplicationInfo init required");
|
LOG_WARNING(Service_ACC, "ApplicationInfo init required");
|
||||||
// TODO(ogniK): Actual initalization here
|
// TODO(ogniK): Actual initialization here
|
||||||
|
|
||||||
return ResultSuccess;
|
return ResultSuccess;
|
||||||
}
|
}
|
||||||
|
|
|
@ -287,7 +287,7 @@ void ProfileManager::StoreOpenedUsers() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the users profile base and the unknown arbitary data.
|
/// Return the users profile base and the unknown arbitrary data.
|
||||||
bool ProfileManager::GetProfileBaseAndData(std::optional<std::size_t> index, ProfileBase& profile,
|
bool ProfileManager::GetProfileBaseAndData(std::optional<std::size_t> index, ProfileBase& profile,
|
||||||
UserData& data) const {
|
UserData& data) const {
|
||||||
if (GetProfileBase(index, profile)) {
|
if (GetProfileBase(index, profile)) {
|
||||||
|
@ -297,13 +297,13 @@ bool ProfileManager::GetProfileBaseAndData(std::optional<std::size_t> index, Pro
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the users profile base and the unknown arbitary data.
|
/// Return the users profile base and the unknown arbitrary data.
|
||||||
bool ProfileManager::GetProfileBaseAndData(UUID uuid, ProfileBase& profile, UserData& data) const {
|
bool ProfileManager::GetProfileBaseAndData(UUID uuid, ProfileBase& profile, UserData& data) const {
|
||||||
const auto idx = GetUserIndex(uuid);
|
const auto idx = GetUserIndex(uuid);
|
||||||
return GetProfileBaseAndData(idx, profile, data);
|
return GetProfileBaseAndData(idx, profile, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the users profile base and the unknown arbitary data.
|
/// Return the users profile base and the unknown arbitrary data.
|
||||||
bool ProfileManager::GetProfileBaseAndData(const ProfileInfo& user, ProfileBase& profile,
|
bool ProfileManager::GetProfileBaseAndData(const ProfileInfo& user, ProfileBase& profile,
|
||||||
UserData& data) const {
|
UserData& data) const {
|
||||||
return GetProfileBaseAndData(user.user_uuid, profile, data);
|
return GetProfileBaseAndData(user.user_uuid, profile, data);
|
||||||
|
|
|
@ -55,7 +55,7 @@ void Controller_Gesture::OnUpdate(const Core::Timing::CoreTiming& core_timing) {
|
||||||
static_cast<f32>(shared_memory->gesture_lifo.timestamp - last_update_timestamp) /
|
static_cast<f32>(shared_memory->gesture_lifo.timestamp - last_update_timestamp) /
|
||||||
(1000 * 1000 * 1000);
|
(1000 * 1000 * 1000);
|
||||||
|
|
||||||
// Only update if necesary
|
// Only update if necessary
|
||||||
if (!ShouldUpdateGesture(gesture, time_difference)) {
|
if (!ShouldUpdateGesture(gesture, time_difference)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -690,7 +690,7 @@ void Hid::ResetSixAxisSensorFusionParameters(HLERequestContext& ctx) {
|
||||||
|
|
||||||
const auto parameters{rp.PopRaw<Parameters>()};
|
const auto parameters{rp.PopRaw<Parameters>()};
|
||||||
|
|
||||||
// Since these parameters are unknow just use what HW outputs
|
// Since these parameters are unknown just use what HW outputs
|
||||||
const Core::HID::SixAxisSensorFusionParameters fusion_parameters{
|
const Core::HID::SixAxisSensorFusionParameters fusion_parameters{
|
||||||
.parameter1 = 0.03f,
|
.parameter1 = 0.03f,
|
||||||
.parameter2 = 0.4f,
|
.parameter2 = 0.4f,
|
||||||
|
|
|
@ -51,7 +51,7 @@ void ImageTransferProcessor::OnControllerUpdate(Core::HID::ControllerTriggerType
|
||||||
|
|
||||||
const auto camera_data = npad_device->GetCamera();
|
const auto camera_data = npad_device->GetCamera();
|
||||||
|
|
||||||
// This indicates how much ambient light is precent
|
// This indicates how much ambient light is present
|
||||||
processor_state.ambient_noise_level = Core::IrSensor::CameraAmbientNoiseLevel::Low;
|
processor_state.ambient_noise_level = Core::IrSensor::CameraAmbientNoiseLevel::Low;
|
||||||
processor_state.sampling_number = camera_data.sample;
|
processor_state.sampling_number = camera_data.sample;
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ EncryptedNTAG215File EncodedDataToNfcData(const NTAG215File& encoded_data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 GetTagPassword(const TagUuid& uuid) {
|
u32 GetTagPassword(const TagUuid& uuid) {
|
||||||
// Verifiy that the generated password is correct
|
// Verify that the generated password is correct
|
||||||
u32 password = 0xAA ^ (uuid.uid[1] ^ uuid.uid[3]);
|
u32 password = 0xAA ^ (uuid.uid[1] ^ uuid.uid[3]);
|
||||||
password &= (0x55 ^ (uuid.uid[2] ^ uuid.uid[4])) << 8;
|
password &= (0x55 ^ (uuid.uid[2] ^ uuid.uid[4])) << 8;
|
||||||
password &= (0xAA ^ (uuid.uid[3] ^ uuid.uid[5])) << 16;
|
password &= (0xAA ^ (uuid.uid[3] ^ uuid.uid[5])) << 16;
|
||||||
|
|
|
@ -94,7 +94,7 @@ bool LoadKeys(InternalKey& locked_secret, InternalKey& unfixed_info);
|
||||||
/// Returns true if key_retail.bin exist
|
/// Returns true if key_retail.bin exist
|
||||||
bool IsKeyAvailable();
|
bool IsKeyAvailable();
|
||||||
|
|
||||||
/// Decodes encripted amiibo data returns true if output is valid
|
/// Decodes encrypted amiibo data returns true if output is valid
|
||||||
bool DecodeAmiibo(const EncryptedNTAG215File& encrypted_tag_data, NTAG215File& tag_data);
|
bool DecodeAmiibo(const EncryptedNTAG215File& encrypted_tag_data, NTAG215File& tag_data);
|
||||||
|
|
||||||
/// Encodes plain amiibo data returns true if output is valid
|
/// Encodes plain amiibo data returns true if output is valid
|
||||||
|
|
|
@ -119,7 +119,7 @@ struct IPlatformServiceManager::Impl {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Derive key withing inverse xor
|
// Derive key within inverse xor
|
||||||
const u32 KEY = GetU32Swapped(input.data() + cur_offset) ^ EXPECTED_MAGIC;
|
const u32 KEY = GetU32Swapped(input.data() + cur_offset) ^ EXPECTED_MAGIC;
|
||||||
const u32 SIZE = GetU32Swapped(input.data() + cur_offset + 4) ^ KEY;
|
const u32 SIZE = GetU32Swapped(input.data() + cur_offset + 4) ^ KEY;
|
||||||
shared_font_regions.push_back(FontRegion{cur_offset + 8, SIZE});
|
shared_font_regions.push_back(FontRegion{cur_offset + 8, SIZE});
|
||||||
|
|
|
@ -59,7 +59,7 @@ public:
|
||||||
std::vector<u8>& output, std::vector<u8>& inline_output) = 0;
|
std::vector<u8>& output, std::vector<u8>& inline_output) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called once a device is openned
|
* Called once a device is opened
|
||||||
* @param fd The device fd
|
* @param fd The device fd
|
||||||
*/
|
*/
|
||||||
virtual void OnOpen(DeviceFD fd) = 0;
|
virtual void OnOpen(DeviceFD fd) = 0;
|
||||||
|
|
|
@ -264,7 +264,7 @@ NvResult nvmap::IocFree(std::span<const u8> input, std::vector<u8>& output) {
|
||||||
params.flags.raw = 0;
|
params.flags.raw = 0;
|
||||||
params.flags.map_uncached.Assign(freeInfo->was_uncached);
|
params.flags.map_uncached.Assign(freeInfo->was_uncached);
|
||||||
} else {
|
} else {
|
||||||
// This is possible when there's internel dups or other duplicates.
|
// This is possible when there's internal dups or other duplicates.
|
||||||
}
|
}
|
||||||
|
|
||||||
std::memcpy(output.data(), ¶ms, sizeof(params));
|
std::memcpy(output.data(), ¶ms, sizeof(params));
|
||||||
|
|
|
@ -572,7 +572,7 @@ std::pair<s32, Errno> Socket::SendTo(u32 flags, std::span<const u8> message,
|
||||||
ASSERT(flags == 0);
|
ASSERT(flags == 0);
|
||||||
|
|
||||||
const sockaddr* to = nullptr;
|
const sockaddr* to = nullptr;
|
||||||
const int tolen = addr ? sizeof(sockaddr) : 0;
|
const int to_len = addr ? sizeof(sockaddr) : 0;
|
||||||
sockaddr host_addr_in;
|
sockaddr host_addr_in;
|
||||||
|
|
||||||
if (addr) {
|
if (addr) {
|
||||||
|
@ -581,7 +581,7 @@ std::pair<s32, Errno> Socket::SendTo(u32 flags, std::span<const u8> message,
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto result = sendto(fd, reinterpret_cast<const char*>(message.data()),
|
const auto result = sendto(fd, reinterpret_cast<const char*>(message.data()),
|
||||||
static_cast<int>(message.size()), 0, to, tolen);
|
static_cast<int>(message.size()), 0, to, to_len);
|
||||||
if (result != SOCKET_ERROR) {
|
if (result != SOCKET_ERROR) {
|
||||||
return {static_cast<s32>(result), Errno::SUCCESS};
|
return {static_cast<s32>(result), Errno::SUCCESS};
|
||||||
}
|
}
|
||||||
|
|
|
@ -344,7 +344,7 @@ bool GCAdapter::IsVibrationEnabled([[maybe_unused]] const PadIdentifier& identif
|
||||||
|
|
||||||
void GCAdapter::UpdateVibrations() {
|
void GCAdapter::UpdateVibrations() {
|
||||||
// Use 8 states to keep the switching between on/off fast enough for
|
// Use 8 states to keep the switching between on/off fast enough for
|
||||||
// a human to feel different vibration strenght
|
// a human to feel different vibration strength
|
||||||
// More states == more rumble strengths == slower update time
|
// More states == more rumble strengths == slower update time
|
||||||
constexpr u8 vibration_states = 8;
|
constexpr u8 vibration_states = 8;
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ private:
|
||||||
/// Registers controllers, clears all data and starts the scan thread
|
/// Registers controllers, clears all data and starts the scan thread
|
||||||
void Setup();
|
void Setup();
|
||||||
|
|
||||||
/// Actively searchs for new devices
|
/// Actively searches for new devices
|
||||||
void ScanThread(std::stop_token stop_token);
|
void ScanThread(std::stop_token stop_token);
|
||||||
|
|
||||||
/// Returns true if device is valid and not registered
|
/// Returns true if device is valid and not registered
|
||||||
|
|
|
@ -24,7 +24,7 @@ constexpr PadIdentifier keyboard_modifier_identifier = {
|
||||||
};
|
};
|
||||||
|
|
||||||
Keyboard::Keyboard(std::string input_engine_) : InputEngine(std::move(input_engine_)) {
|
Keyboard::Keyboard(std::string input_engine_) : InputEngine(std::move(input_engine_)) {
|
||||||
// Keyboard is broken into 3 diferent sets:
|
// Keyboard is broken into 3 different sets:
|
||||||
// key: Unfiltered intended for controllers.
|
// key: Unfiltered intended for controllers.
|
||||||
// keyboard_key: Allows only Settings::NativeKeyboard::Keys intended for keyboard emulation.
|
// keyboard_key: Allows only Settings::NativeKeyboard::Keys intended for keyboard emulation.
|
||||||
// keyboard_modifier: Allows only Settings::NativeKeyboard::Modifiers intended for keyboard
|
// keyboard_modifier: Allows only Settings::NativeKeyboard::Modifiers intended for keyboard
|
||||||
|
|
|
@ -142,7 +142,7 @@ void Mouse::Move(int x, int y, int center_x, int center_y) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make slow movements at least 3 units on lenght
|
// Make slow movements at least 3 units on length
|
||||||
if (move_distance < 3.0f) {
|
if (move_distance < 3.0f) {
|
||||||
// Normalize value
|
// Normalize value
|
||||||
mouse_change /= move_distance;
|
mouse_change /= move_distance;
|
||||||
|
@ -154,7 +154,7 @@ void Mouse::Move(int x, int y, int center_x, int center_y) {
|
||||||
|
|
||||||
const auto last_move_distance = last_mouse_change.Length();
|
const auto last_move_distance = last_mouse_change.Length();
|
||||||
|
|
||||||
// Make fast movements clamp to 8 units on lenght
|
// Make fast movements clamp to 8 units on length
|
||||||
if (last_move_distance > 8.0f) {
|
if (last_move_distance > 8.0f) {
|
||||||
// Normalize value
|
// Normalize value
|
||||||
last_mouse_change /= last_move_distance;
|
last_mouse_change /= last_move_distance;
|
||||||
|
|
|
@ -763,7 +763,7 @@ ButtonMapping SDLDriver::GetButtonMappingForDevice(const Common::ParamPackage& p
|
||||||
|
|
||||||
// This list is missing ZL/ZR since those are not considered buttons in SDL GameController.
|
// This list is missing ZL/ZR since those are not considered buttons in SDL GameController.
|
||||||
// We will add those afterwards
|
// We will add those afterwards
|
||||||
// This list also excludes Screenshot since theres not really a mapping for that
|
// This list also excludes Screenshot since there's not really a mapping for that
|
||||||
ButtonBindings switch_to_sdl_button;
|
ButtonBindings switch_to_sdl_button;
|
||||||
|
|
||||||
if (SDL_GameControllerGetType(controller) == SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO) {
|
if (SDL_GameControllerGetType(controller) == SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO) {
|
||||||
|
@ -1022,7 +1022,7 @@ MotionMapping SDLDriver::GetMotionMappingForDevice(const Common::ParamPackage& p
|
||||||
|
|
||||||
Common::Input::ButtonNames SDLDriver::GetUIName(const Common::ParamPackage& params) const {
|
Common::Input::ButtonNames SDLDriver::GetUIName(const Common::ParamPackage& params) const {
|
||||||
if (params.Has("button")) {
|
if (params.Has("button")) {
|
||||||
// TODO(German77): Find how to substitue the values for real button names
|
// TODO(German77): Find how to substitute the values for real button names
|
||||||
return Common::Input::ButtonNames::Value;
|
return Common::Input::ButtonNames::Value;
|
||||||
}
|
}
|
||||||
if (params.Has("hat")) {
|
if (params.Has("hat")) {
|
||||||
|
|
|
@ -57,7 +57,7 @@ Common::Input::NfcState VirtualAmiibo::WriteNfcData(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nfc_file.Write(data)) {
|
if (!nfc_file.Write(data)) {
|
||||||
LOG_ERROR(Service_NFP, "Error writting to file");
|
LOG_ERROR(Service_NFP, "Error writing to file");
|
||||||
return Common::Input::NfcState::WriteFailed;
|
return Common::Input::NfcState::WriteFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -164,8 +164,8 @@ void JoyconDriver::InputThread(std::stop_token stop_token) {
|
||||||
void JoyconDriver::OnNewData(std::span<u8> buffer) {
|
void JoyconDriver::OnNewData(std::span<u8> buffer) {
|
||||||
const auto report_mode = static_cast<ReportMode>(buffer[0]);
|
const auto report_mode = static_cast<ReportMode>(buffer[0]);
|
||||||
|
|
||||||
// Packages can be a litte bit inconsistent. Average the delta time to provide a smoother motion
|
// Packages can be a little bit inconsistent. Average the delta time to provide a smoother
|
||||||
// experience
|
// motion experience
|
||||||
switch (report_mode) {
|
switch (report_mode) {
|
||||||
case ReportMode::STANDARD_FULL_60HZ:
|
case ReportMode::STANDARD_FULL_60HZ:
|
||||||
case ReportMode::NFC_IR_MODE_60HZ:
|
case ReportMode::NFC_IR_MODE_60HZ:
|
||||||
|
|
|
@ -110,7 +110,7 @@ private:
|
||||||
bool amiibo_detected{};
|
bool amiibo_detected{};
|
||||||
bool is_ring_disabled_by_irs{};
|
bool is_ring_disabled_by_irs{};
|
||||||
|
|
||||||
// Harware configuration
|
// Hardware configuration
|
||||||
u8 leds{};
|
u8 leds{};
|
||||||
ReportMode mode{};
|
ReportMode mode{};
|
||||||
bool passive_enabled{}; // Low power mode, Ideal for multiple controllers at the same time
|
bool passive_enabled{}; // Low power mode, Ideal for multiple controllers at the same time
|
||||||
|
|
|
@ -68,7 +68,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits for incoming data of the joycon device that matchs the subcommand
|
* Waits for incoming data of the joycon device that matches the subcommand
|
||||||
* @param sub_command type of data to be returned
|
* @param sub_command type of data to be returned
|
||||||
* @returns a buffer containing the response
|
* @returns a buffer containing the response
|
||||||
*/
|
*/
|
||||||
|
@ -137,7 +137,7 @@ public:
|
||||||
DriverResult EnableMCU(bool enable);
|
DriverResult EnableMCU(bool enable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures the MCU to the correspoinding mode
|
* Configures the MCU to the corresponding mode
|
||||||
* @param MCUConfig configuration
|
* @param MCUConfig configuration
|
||||||
*/
|
*/
|
||||||
DriverResult ConfigureMCU(const MCUConfig& config);
|
DriverResult ConfigureMCU(const MCUConfig& config);
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace Response {
|
||||||
/**
|
/**
|
||||||
* Returns Type if the packet is valid, else none
|
* Returns Type if the packet is valid, else none
|
||||||
*
|
*
|
||||||
* Note: Modifies the buffer to zero out the crc (since thats the easiest way to check without
|
* Note: Modifies the buffer to zero out the crc (since that's the easiest way to check without
|
||||||
* copying the buffer)
|
* copying the buffer)
|
||||||
*/
|
*/
|
||||||
std::optional<Type> Validate(u8* data, std::size_t size) {
|
std::optional<Type> Validate(u8* data, std::size_t size) {
|
||||||
|
|
|
@ -132,7 +132,7 @@ public:
|
||||||
/// Retrieves the motion mappings for the given device.
|
/// Retrieves the motion mappings for the given device.
|
||||||
[[nodiscard]] MotionMapping GetMotionMappingForDevice(const Common::ParamPackage& device) const;
|
[[nodiscard]] MotionMapping GetMotionMappingForDevice(const Common::ParamPackage& device) const;
|
||||||
|
|
||||||
/// Returns an enum contaning the name to be displayed from the input engine.
|
/// Returns an enum containing the name to be displayed from the input engine.
|
||||||
[[nodiscard]] Common::Input::ButtonNames GetButtonName(
|
[[nodiscard]] Common::Input::ButtonNames GetButtonName(
|
||||||
const Common::ParamPackage& params) const;
|
const Common::ParamPackage& params) const;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
namespace Network {
|
namespace Network {
|
||||||
|
|
||||||
/// A class that serializes data for network transfer. It also handles endianess
|
/// A class that serializes data for network transfer. It also handles endianness
|
||||||
class Packet {
|
class Packet {
|
||||||
public:
|
public:
|
||||||
Packet() = default;
|
Packet() = default;
|
||||||
|
|
|
@ -27,7 +27,7 @@ public:
|
||||||
std::atomic<State> state{State::Closed}; ///< Current state of the room.
|
std::atomic<State> state{State::Closed}; ///< Current state of the room.
|
||||||
RoomInformation room_information; ///< Information about this room.
|
RoomInformation room_information; ///< Information about this room.
|
||||||
|
|
||||||
std::string verify_uid; ///< A GUID which may be used for verfication.
|
std::string verify_uid; ///< A GUID which may be used for verification.
|
||||||
mutable std::mutex verify_uid_mutex; ///< Mutex for verify_uid
|
mutable std::mutex verify_uid_mutex; ///< Mutex for verify_uid
|
||||||
|
|
||||||
std::string password; ///< The password required to connect to this room.
|
std::string password; ///< The password required to connect to this room.
|
||||||
|
|
|
@ -71,7 +71,7 @@ public:
|
||||||
Idle, ///< Default state (i.e. not connected)
|
Idle, ///< Default state (i.e. not connected)
|
||||||
Joining, ///< The client is attempting to join a room.
|
Joining, ///< The client is attempting to join a room.
|
||||||
Joined, ///< The client is connected to the room and is ready to send/receive packets.
|
Joined, ///< The client is connected to the room and is ready to send/receive packets.
|
||||||
Moderator, ///< The client is connnected to the room and is granted mod permissions.
|
Moderator, ///< The client is connected to the room and is granted mod permissions.
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class Error : u8 {
|
enum class Error : u8 {
|
||||||
|
@ -201,7 +201,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds a function to an event that will be triggered every time the State of the member
|
* Binds a function to an event that will be triggered every time the State of the member
|
||||||
* changed. The function wil be called every time the event is triggered. The callback function
|
* changed. The function will be called every time the event is triggered. The callback function
|
||||||
* must not bind or unbind a function. Doing so will cause a deadlock
|
* must not bind or unbind a function. Doing so will cause a deadlock
|
||||||
* @param callback The function to call
|
* @param callback The function to call
|
||||||
* @return A handle used for removing the function from the registered list
|
* @return A handle used for removing the function from the registered list
|
||||||
|
@ -210,8 +210,8 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds a function to an event that will be triggered every time an error happened. The
|
* Binds a function to an event that will be triggered every time an error happened. The
|
||||||
* function wil be called every time the event is triggered. The callback function must not bind
|
* function will be called every time the event is triggered. The callback function must not
|
||||||
* or unbind a function. Doing so will cause a deadlock
|
* bind or unbind a function. Doing so will cause a deadlock
|
||||||
* @param callback The function to call
|
* @param callback The function to call
|
||||||
* @return A handle used for removing the function from the registered list
|
* @return A handle used for removing the function from the registered list
|
||||||
*/
|
*/
|
||||||
|
@ -219,7 +219,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds a function to an event that will be triggered every time a ProxyPacket is received.
|
* Binds a function to an event that will be triggered every time a ProxyPacket is received.
|
||||||
* The function wil be called everytime the event is triggered.
|
* The function will be called every time the event is triggered.
|
||||||
* The callback function must not bind or unbind a function. Doing so will cause a deadlock
|
* The callback function must not bind or unbind a function. Doing so will cause a deadlock
|
||||||
* @param callback The function to call
|
* @param callback The function to call
|
||||||
* @return A handle used for removing the function from the registered list
|
* @return A handle used for removing the function from the registered list
|
||||||
|
@ -229,7 +229,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds a function to an event that will be triggered every time an LDNPacket is received.
|
* Binds a function to an event that will be triggered every time an LDNPacket is received.
|
||||||
* The function wil be called everytime the event is triggered.
|
* The function will be called every time the event is triggered.
|
||||||
* The callback function must not bind or unbind a function. Doing so will cause a deadlock
|
* The callback function must not bind or unbind a function. Doing so will cause a deadlock
|
||||||
* @param callback The function to call
|
* @param callback The function to call
|
||||||
* @return A handle used for removing the function from the registered list
|
* @return A handle used for removing the function from the registered list
|
||||||
|
@ -239,7 +239,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds a function to an event that will be triggered every time the RoomInformation changes.
|
* Binds a function to an event that will be triggered every time the RoomInformation changes.
|
||||||
* The function wil be called every time the event is triggered.
|
* The function will be called every time the event is triggered.
|
||||||
* The callback function must not bind or unbind a function. Doing so will cause a deadlock
|
* The callback function must not bind or unbind a function. Doing so will cause a deadlock
|
||||||
* @param callback The function to call
|
* @param callback The function to call
|
||||||
* @return A handle used for removing the function from the registered list
|
* @return A handle used for removing the function from the registered list
|
||||||
|
@ -249,7 +249,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds a function to an event that will be triggered every time a ChatMessage is received.
|
* Binds a function to an event that will be triggered every time a ChatMessage is received.
|
||||||
* The function wil be called every time the event is triggered.
|
* The function will be called every time the event is triggered.
|
||||||
* The callback function must not bind or unbind a function. Doing so will cause a deadlock
|
* The callback function must not bind or unbind a function. Doing so will cause a deadlock
|
||||||
* @param callback The function to call
|
* @param callback The function to call
|
||||||
* @return A handle used for removing the function from the registered list
|
* @return A handle used for removing the function from the registered list
|
||||||
|
|
|
@ -398,162 +398,162 @@ void EmitStorageAtomicMaxF32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicIAdd32(EmitContext&) {
|
void EmitGlobalAtomicIAdd32(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicSMin32(EmitContext&) {
|
void EmitGlobalAtomicSMin32(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicUMin32(EmitContext&) {
|
void EmitGlobalAtomicUMin32(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicSMax32(EmitContext&) {
|
void EmitGlobalAtomicSMax32(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicUMax32(EmitContext&) {
|
void EmitGlobalAtomicUMax32(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicInc32(EmitContext&) {
|
void EmitGlobalAtomicInc32(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicDec32(EmitContext&) {
|
void EmitGlobalAtomicDec32(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicAnd32(EmitContext&) {
|
void EmitGlobalAtomicAnd32(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicOr32(EmitContext&) {
|
void EmitGlobalAtomicOr32(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicXor32(EmitContext&) {
|
void EmitGlobalAtomicXor32(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicExchange32(EmitContext&) {
|
void EmitGlobalAtomicExchange32(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicIAdd64(EmitContext&) {
|
void EmitGlobalAtomicIAdd64(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicSMin64(EmitContext&) {
|
void EmitGlobalAtomicSMin64(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicUMin64(EmitContext&) {
|
void EmitGlobalAtomicUMin64(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicSMax64(EmitContext&) {
|
void EmitGlobalAtomicSMax64(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicUMax64(EmitContext&) {
|
void EmitGlobalAtomicUMax64(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicInc64(EmitContext&) {
|
void EmitGlobalAtomicInc64(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicDec64(EmitContext&) {
|
void EmitGlobalAtomicDec64(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicAnd64(EmitContext&) {
|
void EmitGlobalAtomicAnd64(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicOr64(EmitContext&) {
|
void EmitGlobalAtomicOr64(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicXor64(EmitContext&) {
|
void EmitGlobalAtomicXor64(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicExchange64(EmitContext&) {
|
void EmitGlobalAtomicExchange64(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicIAdd32x2(EmitContext&) {
|
void EmitGlobalAtomicIAdd32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicSMin32x2(EmitContext&) {
|
void EmitGlobalAtomicSMin32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicUMin32x2(EmitContext&) {
|
void EmitGlobalAtomicUMin32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicSMax32x2(EmitContext&) {
|
void EmitGlobalAtomicSMax32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicUMax32x2(EmitContext&) {
|
void EmitGlobalAtomicUMax32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicInc32x2(EmitContext&) {
|
void EmitGlobalAtomicInc32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicDec32x2(EmitContext&) {
|
void EmitGlobalAtomicDec32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicAnd32x2(EmitContext&) {
|
void EmitGlobalAtomicAnd32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicOr32x2(EmitContext&) {
|
void EmitGlobalAtomicOr32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicXor32x2(EmitContext&) {
|
void EmitGlobalAtomicXor32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicExchange32x2(EmitContext&) {
|
void EmitGlobalAtomicExchange32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicAddF32(EmitContext&) {
|
void EmitGlobalAtomicAddF32(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicAddF16x2(EmitContext&) {
|
void EmitGlobalAtomicAddF16x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicAddF32x2(EmitContext&) {
|
void EmitGlobalAtomicAddF32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicMinF16x2(EmitContext&) {
|
void EmitGlobalAtomicMinF16x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicMinF32x2(EmitContext&) {
|
void EmitGlobalAtomicMinF32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicMaxF16x2(EmitContext&) {
|
void EmitGlobalAtomicMaxF16x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitGlobalAtomicMaxF32x2(EmitContext&) {
|
void EmitGlobalAtomicMaxF32x2(EmitContext&) {
|
||||||
throw NotImplementedException("GLSL Instrucion");
|
throw NotImplementedException("GLSL Instruction");
|
||||||
}
|
}
|
||||||
} // namespace Shader::Backend::GLSL
|
} // namespace Shader::Backend::GLSL
|
||||||
|
|
|
@ -49,7 +49,7 @@ public:
|
||||||
void Add(const char* format_str, IR::Inst& inst, Args&&... args) {
|
void Add(const char* format_str, IR::Inst& inst, Args&&... args) {
|
||||||
const auto var_def{var_alloc.AddDefine(inst, type)};
|
const auto var_def{var_alloc.AddDefine(inst, type)};
|
||||||
if (var_def.empty()) {
|
if (var_def.empty()) {
|
||||||
// skip assigment.
|
// skip assignment.
|
||||||
code += fmt::format(fmt::runtime(format_str + 3), std::forward<Args>(args)...);
|
code += fmt::format(fmt::runtime(format_str + 3), std::forward<Args>(args)...);
|
||||||
} else {
|
} else {
|
||||||
code += fmt::format(fmt::runtime(format_str), var_def, std::forward<Args>(args)...);
|
code += fmt::format(fmt::runtime(format_str), var_def, std::forward<Args>(args)...);
|
||||||
|
|
|
@ -52,7 +52,7 @@ TEST_CASE("RingBuffer: Basic Tests", "[common]") {
|
||||||
|
|
||||||
REQUIRE(buf.Size() == 1U);
|
REQUIRE(buf.Size() == 1U);
|
||||||
|
|
||||||
// Pushing more values than space available should partially suceed.
|
// Pushing more values than space available should partially succeed.
|
||||||
{
|
{
|
||||||
std::vector<char> to_push(6);
|
std::vector<char> to_push(6);
|
||||||
std::iota(to_push.begin(), to_push.end(), 88);
|
std::iota(to_push.begin(), to_push.end(), 88);
|
||||||
|
|
|
@ -191,7 +191,7 @@ TEST_CASE("ScratchBuffer: Span Writes", "[common]") {
|
||||||
|
|
||||||
for (size_t i = 0; i < buf_span.size(); ++i) {
|
for (size_t i = 0; i < buf_span.size(); ++i) {
|
||||||
const auto new_value = static_cast<u8>(i + 1U);
|
const auto new_value = static_cast<u8>(i + 1U);
|
||||||
// Writes to a span of the scratch buffer will propogate to the buffer itself
|
// Writes to a span of the scratch buffer will propagate to the buffer itself
|
||||||
buf_span[i] = new_value;
|
buf_span[i] = new_value;
|
||||||
REQUIRE(buf[i] == new_value);
|
REQUIRE(buf[i] == new_value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
template <class P>
|
template <class P>
|
||||||
class ChannelSetupCaches {
|
class ChannelSetupCaches {
|
||||||
public:
|
public:
|
||||||
/// Operations for seting the channel of execution.
|
/// Operations for setting the channel of execution.
|
||||||
virtual ~ChannelSetupCaches();
|
virtual ~ChannelSetupCaches();
|
||||||
|
|
||||||
/// Create channel state.
|
/// Create channel state.
|
||||||
|
|
|
@ -193,7 +193,7 @@ bool SoftwareBlitEngine::Blit(Fermi2D::Surface& src, Fermi2D::Surface& dst,
|
||||||
output_converter->ConvertFrom(impl->intermediate_dst, impl->dst_buffer);
|
output_converter->ConvertFrom(impl->intermediate_dst, impl->dst_buffer);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Do actuall Blit
|
// Do actual Blit
|
||||||
|
|
||||||
impl->dst_buffer.resize(dst_copy_size);
|
impl->dst_buffer.resize(dst_copy_size);
|
||||||
if (src.linear == Fermi2D::MemoryLayout::BlockLinear) {
|
if (src.linear == Fermi2D::MemoryLayout::BlockLinear) {
|
||||||
|
|
|
@ -125,7 +125,7 @@ uvec4 local_buff;
|
||||||
uvec4 color_endpoint_data;
|
uvec4 color_endpoint_data;
|
||||||
int color_bitsread = 0;
|
int color_bitsread = 0;
|
||||||
|
|
||||||
// Four values, two endpoints, four maximum paritions
|
// Four values, two endpoints, four maximum partitions
|
||||||
uint color_values[32];
|
uint color_values[32];
|
||||||
int colvals_index = 0;
|
int colvals_index = 0;
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@
|
||||||
* half-rate linear filtering on GCN.
|
* half-rate linear filtering on GCN.
|
||||||
*
|
*
|
||||||
* If SMAA is applied to 64-bit color buffers, switching to point filtering
|
* If SMAA is applied to 64-bit color buffers, switching to point filtering
|
||||||
* when accesing them will increase the performance. Search for
|
* when accessing them will increase the performance. Search for
|
||||||
* 'SMAASamplePoint' to see which textures may benefit from point
|
* 'SMAASamplePoint' to see which textures may benefit from point
|
||||||
* filtering, and where (which is basically the color input in the edge
|
* filtering, and where (which is basically the color input in the edge
|
||||||
* detection and resolve passes).
|
* detection and resolve passes).
|
||||||
|
|
|
@ -103,8 +103,8 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a vector with all the subranges of cpu addresses mapped beneath.
|
* Returns a vector with all the subranges of cpu addresses mapped beneath.
|
||||||
* if the region is continous, a single pair will be returned. If it's unmapped, an empty vector
|
* if the region is continuous, a single pair will be returned. If it's unmapped, an empty
|
||||||
* will be returned;
|
* vector will be returned;
|
||||||
*/
|
*/
|
||||||
std::vector<std::pair<GPUVAddr, std::size_t>> GetSubmappedRange(GPUVAddr gpu_addr,
|
std::vector<std::pair<GPUVAddr, std::size_t>> GetSubmappedRange(GPUVAddr gpu_addr,
|
||||||
std::size_t size) const;
|
std::size_t size) const;
|
||||||
|
|
|
@ -341,7 +341,7 @@ public:
|
||||||
|
|
||||||
/// Flushes the query to guest memory.
|
/// Flushes the query to guest memory.
|
||||||
virtual void Flush() {
|
virtual void Flush() {
|
||||||
// When counter is nullptr it means that it's just been reseted. We are supposed to write a
|
// When counter is nullptr it means that it's just been reset. We are supposed to write a
|
||||||
// zero in these cases.
|
// zero in these cases.
|
||||||
const u64 value = counter ? counter->Query() : 0;
|
const u64 value = counter ? counter->Query() : 0;
|
||||||
std::memcpy(host_ptr, &value, sizeof(u64));
|
std::memcpy(host_ptr, &value, sizeof(u64));
|
||||||
|
|
|
@ -576,7 +576,7 @@ bool RasterizerOpenGL::AccelerateConditionalRendering() {
|
||||||
// Reimplement Host conditional rendering.
|
// Reimplement Host conditional rendering.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Medium / Low Hack: stub any checks on queries writen into the buffer cache.
|
// Medium / Low Hack: stub any checks on queries written into the buffer cache.
|
||||||
const GPUVAddr condition_address{maxwell3d->regs.render_enable.Address()};
|
const GPUVAddr condition_address{maxwell3d->regs.render_enable.Address()};
|
||||||
Maxwell::ReportSemaphore::Compare cmp;
|
Maxwell::ReportSemaphore::Compare cmp;
|
||||||
if (gpu_memory->IsMemoryDirty(condition_address, sizeof(cmp),
|
if (gpu_memory->IsMemoryDirty(condition_address, sizeof(cmp),
|
||||||
|
|
|
@ -162,7 +162,7 @@ private:
|
||||||
/// Syncs the cull mode to match the guest state
|
/// Syncs the cull mode to match the guest state
|
||||||
void SyncCullMode();
|
void SyncCullMode();
|
||||||
|
|
||||||
/// Syncs the primitve restart to match the guest state
|
/// Syncs the primitive restart to match the guest state
|
||||||
void SyncPrimitiveRestart();
|
void SyncPrimitiveRestart();
|
||||||
|
|
||||||
/// Syncs the depth test state to match the guest state
|
/// Syncs the depth test state to match the guest state
|
||||||
|
@ -246,7 +246,7 @@ private:
|
||||||
std::array<GLuint, MAX_TEXTURES> texture_handles{};
|
std::array<GLuint, MAX_TEXTURES> texture_handles{};
|
||||||
std::array<GLuint, MAX_IMAGES> image_handles{};
|
std::array<GLuint, MAX_IMAGES> image_handles{};
|
||||||
|
|
||||||
/// Number of commands queued to the OpenGL driver. Resetted on flush.
|
/// Number of commands queued to the OpenGL driver. Reset on flush.
|
||||||
size_t num_queued_commands = 0;
|
size_t num_queued_commands = 0;
|
||||||
bool has_written_global_memory = false;
|
bool has_written_global_memory = false;
|
||||||
|
|
||||||
|
|
|
@ -271,7 +271,7 @@ bool FixedPipelineState::operator==(const FixedPipelineState& rhs) const noexcep
|
||||||
|
|
||||||
u32 FixedPipelineState::PackComparisonOp(Maxwell::ComparisonOp op) noexcept {
|
u32 FixedPipelineState::PackComparisonOp(Maxwell::ComparisonOp op) noexcept {
|
||||||
// OpenGL enums go from 0x200 to 0x207 and the others from 1 to 8
|
// OpenGL enums go from 0x200 to 0x207 and the others from 1 to 8
|
||||||
// If we substract 0x200 to OpenGL enums and 1 to the others we get a 0-7 range.
|
// If we subtract 0x200 to OpenGL enums and 1 to the others we get a 0-7 range.
|
||||||
// Perfect for a hash.
|
// Perfect for a hash.
|
||||||
const u32 value = static_cast<u32>(op);
|
const u32 value = static_cast<u32>(op);
|
||||||
return value - (value >= 0x200 ? 0x200 : 1);
|
return value - (value >= 0x200 ? 0x200 : 1);
|
||||||
|
@ -322,8 +322,8 @@ Maxwell::StencilOp::Op FixedPipelineState::UnpackStencilOp(u32 packed) noexcept
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 FixedPipelineState::PackCullFace(Maxwell::CullFace cull) noexcept {
|
u32 FixedPipelineState::PackCullFace(Maxwell::CullFace cull) noexcept {
|
||||||
// FrontAndBack is 0x408, by substracting 0x406 in it we get 2.
|
// FrontAndBack is 0x408, by subtracting 0x406 in it we get 2.
|
||||||
// Individual cull faces are in 0x404 and 0x405, substracting 0x404 we get 0 and 1.
|
// Individual cull faces are in 0x404 and 0x405, subtracting 0x404 we get 0 and 1.
|
||||||
const u32 value = static_cast<u32>(cull);
|
const u32 value = static_cast<u32>(cull);
|
||||||
return value - (value == 0x408 ? 0x406 : 0x404);
|
return value - (value == 0x408 ? 0x406 : 0x404);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,8 @@ CommandPool::CommandPool(MasterSemaphore& master_semaphore_, const Device& devic
|
||||||
CommandPool::~CommandPool() = default;
|
CommandPool::~CommandPool() = default;
|
||||||
|
|
||||||
void CommandPool::Allocate(size_t begin, size_t end) {
|
void CommandPool::Allocate(size_t begin, size_t end) {
|
||||||
// Command buffers are going to be commited, recorded, executed every single usage cycle.
|
// Command buffers are going to be committed, recorded, executed every single usage cycle.
|
||||||
// They are also going to be reseted when commited.
|
// They are also going to be reset when committed.
|
||||||
Pool& pool = pools.emplace_back();
|
Pool& pool = pools.emplace_back();
|
||||||
pool.handle = device.GetLogical().CreateCommandPool({
|
pool.handle = device.GetLogical().CreateCommandPool({
|
||||||
.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
|
||||||
|
|
|
@ -671,7 +671,7 @@ bool RasterizerVulkan::AccelerateConditionalRendering() {
|
||||||
// TODO(Blinkhawk): Reimplement Host conditional rendering.
|
// TODO(Blinkhawk): Reimplement Host conditional rendering.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Medium / Low Hack: stub any checks on queries writen into the buffer cache.
|
// Medium / Low Hack: stub any checks on queries written into the buffer cache.
|
||||||
const GPUVAddr condition_address{maxwell3d->regs.render_enable.Address()};
|
const GPUVAddr condition_address{maxwell3d->regs.render_enable.Address()};
|
||||||
Maxwell::ReportSemaphore::Compare cmp;
|
Maxwell::ReportSemaphore::Compare cmp;
|
||||||
if (gpu_memory->IsMemoryDirty(condition_address, sizeof(cmp),
|
if (gpu_memory->IsMemoryDirty(condition_address, sizeof(cmp),
|
||||||
|
|
|
@ -37,7 +37,7 @@ size_t ResourcePool::CommitResource() {
|
||||||
found = free_resource;
|
found = free_resource;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Free iterator is hinted to the resource after the one that's been commited.
|
// Free iterator is hinted to the resource after the one that's been committed.
|
||||||
hint_iterator = (*found + 1) % ticks.size();
|
hint_iterator = (*found + 1) % ticks.size();
|
||||||
return *found;
|
return *found;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ size_t ResourcePool::ManageOverflow() {
|
||||||
const size_t old_capacity = ticks.size();
|
const size_t old_capacity = ticks.size();
|
||||||
Grow();
|
Grow();
|
||||||
|
|
||||||
// The last entry is guaranted to be free, since it's the first element of the freshly
|
// The last entry is guaranteed to be free, since it's the first element of the freshly
|
||||||
// allocated resources.
|
// allocated resources.
|
||||||
return old_capacity;
|
return old_capacity;
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,7 @@ void Swapchain::CreateSwapchain(const VkSurfaceCapabilitiesKHR& capabilities, bo
|
||||||
present_mode = ChooseSwapPresentMode(present_modes);
|
present_mode = ChooseSwapPresentMode(present_modes);
|
||||||
|
|
||||||
u32 requested_image_count{capabilities.minImageCount + 1};
|
u32 requested_image_count{capabilities.minImageCount + 1};
|
||||||
// Ensure Tripple buffering if possible.
|
// Ensure Triple buffering if possible.
|
||||||
if (capabilities.maxImageCount > 0) {
|
if (capabilities.maxImageCount > 0) {
|
||||||
if (requested_image_count > capabilities.maxImageCount) {
|
if (requested_image_count > capabilities.maxImageCount) {
|
||||||
requested_image_count = capabilities.maxImageCount;
|
requested_image_count = capabilities.maxImageCount;
|
||||||
|
|
|
@ -25,7 +25,7 @@ void UpdateDescriptorQueue::TickFrame() {
|
||||||
|
|
||||||
void UpdateDescriptorQueue::Acquire() {
|
void UpdateDescriptorQueue::Acquire() {
|
||||||
// Minimum number of entries required.
|
// Minimum number of entries required.
|
||||||
// This is the maximum number of entries a single draw call migth use.
|
// This is the maximum number of entries a single draw call might use.
|
||||||
static constexpr size_t MIN_ENTRIES = 0x400;
|
static constexpr size_t MIN_ENTRIES = 0x400;
|
||||||
|
|
||||||
if (std::distance(payload.data(), payload_cursor) + MIN_ENTRIES >= payload.max_size()) {
|
if (std::distance(payload.data(), payload_cursor) + MIN_ENTRIES >= payload.max_size()) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ enum class ImageFlagBits : u32 {
|
||||||
Registered = 1 << 6, ///< True when the image is registered
|
Registered = 1 << 6, ///< True when the image is registered
|
||||||
Picked = 1 << 7, ///< Temporary flag to mark the image as picked
|
Picked = 1 << 7, ///< Temporary flag to mark the image as picked
|
||||||
Remapped = 1 << 8, ///< Image has been remapped.
|
Remapped = 1 << 8, ///< Image has been remapped.
|
||||||
Sparse = 1 << 9, ///< Image has non continous submemory.
|
Sparse = 1 << 9, ///< Image has non continuous submemory.
|
||||||
|
|
||||||
// Garbage Collection Flags
|
// Garbage Collection Flags
|
||||||
BadOverlap = 1 << 10, ///< This image overlaps other but doesn't fit, has higher
|
BadOverlap = 1 << 10, ///< This image overlaps other but doesn't fit, has higher
|
||||||
|
|
|
@ -1571,7 +1571,7 @@ static void DecompressBlock(std::span<const u8, 16> inBuf, const u32 blockWidth,
|
||||||
assert(strm.GetBitsRead() + weightParams.GetPackedBitSize() == 128);
|
assert(strm.GetBitsRead() + weightParams.GetPackedBitSize() == 128);
|
||||||
|
|
||||||
// Decode both color data and texel weight data
|
// Decode both color data and texel weight data
|
||||||
u32 colorValues[32]; // Four values, two endpoints, four maximum paritions
|
u32 colorValues[32]; // Four values, two endpoints, four maximum partitions
|
||||||
DecodeColorValues(colorValues, colorEndpointData, colorEndpointMode, nPartitions,
|
DecodeColorValues(colorValues, colorEndpointData, colorEndpointMode, nPartitions,
|
||||||
colorDataBits);
|
colorDataBits);
|
||||||
|
|
||||||
|
|
|
@ -417,7 +417,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
|
||||||
|
|
||||||
sets_per_pool = 64;
|
sets_per_pool = 64;
|
||||||
if (is_amd_driver) {
|
if (is_amd_driver) {
|
||||||
// AMD drivers need a higher amount of Sets per Pool in certain circunstances like in XC2.
|
// AMD drivers need a higher amount of Sets per Pool in certain circumstances like in XC2.
|
||||||
sets_per_pool = 96;
|
sets_per_pool = 96;
|
||||||
// Disable VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT on AMD GCN4 and lower as it is broken.
|
// Disable VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT on AMD GCN4 and lower as it is broken.
|
||||||
if (!features.shader_float16_int8.shaderFloat16) {
|
if (!features.shader_float16_int8.shaderFloat16) {
|
||||||
|
|
|
@ -180,7 +180,7 @@ public:
|
||||||
~Device();
|
~Device();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a format supported by the device for the passed requeriments.
|
* Returns a format supported by the device for the passed requirements.
|
||||||
* @param wanted_format The ideal format to be returned. It may not be the returned format.
|
* @param wanted_format The ideal format to be returned. It may not be the returned format.
|
||||||
* @param wanted_usage The usage that must be fulfilled even if the format is not supported.
|
* @param wanted_usage The usage that must be fulfilled even if the format is not supported.
|
||||||
* @param format_type Format type usage.
|
* @param format_type Format type usage.
|
||||||
|
@ -259,12 +259,12 @@ public:
|
||||||
|
|
||||||
bool ShouldBoostClocks() const;
|
bool ShouldBoostClocks() const;
|
||||||
|
|
||||||
/// Returns uniform buffer alignment requeriment.
|
/// Returns uniform buffer alignment requirement.
|
||||||
VkDeviceSize GetUniformBufferAlignment() const {
|
VkDeviceSize GetUniformBufferAlignment() const {
|
||||||
return properties.properties.limits.minUniformBufferOffsetAlignment;
|
return properties.properties.limits.minUniformBufferOffsetAlignment;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns storage alignment requeriment.
|
/// Returns storage alignment requirement.
|
||||||
VkDeviceSize GetStorageBufferAlignment() const {
|
VkDeviceSize GetStorageBufferAlignment() const {
|
||||||
return properties.properties.limits.minStorageBufferOffsetAlignment;
|
return properties.properties.limits.minStorageBufferOffsetAlignment;
|
||||||
}
|
}
|
||||||
|
@ -656,7 +656,7 @@ private:
|
||||||
bool is_integrated{}; ///< Is GPU an iGPU.
|
bool is_integrated{}; ///< Is GPU an iGPU.
|
||||||
bool is_virtual{}; ///< Is GPU a virtual GPU.
|
bool is_virtual{}; ///< Is GPU a virtual GPU.
|
||||||
bool is_non_gpu{}; ///< Is SoftwareRasterizer, FPGA, non-GPU device.
|
bool is_non_gpu{}; ///< Is SoftwareRasterizer, FPGA, non-GPU device.
|
||||||
bool has_broken_cube_compatibility{}; ///< Has broken cube compatiblity bit
|
bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit
|
||||||
bool has_renderdoc{}; ///< Has RenderDoc attached
|
bool has_renderdoc{}; ///< Has RenderDoc attached
|
||||||
bool has_nsight_graphics{}; ///< Has Nsight Graphics attached
|
bool has_nsight_graphics{}; ///< Has Nsight Graphics attached
|
||||||
bool supports_d24_depth{}; ///< Supports D24 depth buffers.
|
bool supports_d24_depth{}; ///< Supports D24 depth buffers.
|
||||||
|
|
|
@ -68,7 +68,7 @@ public:
|
||||||
constexpr Span(const Range& range) : ptr{std::data(range)}, num{std::size(range)} {}
|
constexpr Span(const Range& range) : ptr{std::data(range)}, num{std::size(range)} {}
|
||||||
|
|
||||||
/// Construct a span from a pointer and a size.
|
/// Construct a span from a pointer and a size.
|
||||||
/// This is inteded for subranges.
|
/// This is intended for subranges.
|
||||||
constexpr Span(const T* ptr_, std::size_t num_) noexcept : ptr{ptr_}, num{num_} {}
|
constexpr Span(const T* ptr_, std::size_t num_) noexcept : ptr{ptr_}, num{num_} {}
|
||||||
|
|
||||||
/// Returns the data pointer by the span.
|
/// Returns the data pointer by the span.
|
||||||
|
@ -390,11 +390,11 @@ public:
|
||||||
Handle(const Handle&) = delete;
|
Handle(const Handle&) = delete;
|
||||||
Handle& operator=(const Handle&) = delete;
|
Handle& operator=(const Handle&) = delete;
|
||||||
|
|
||||||
/// Construct a handle transfering the ownership from another handle.
|
/// Construct a handle transferring the ownership from another handle.
|
||||||
Handle(Handle&& rhs) noexcept
|
Handle(Handle&& rhs) noexcept
|
||||||
: handle{std::exchange(rhs.handle, nullptr)}, owner{rhs.owner}, dld{rhs.dld} {}
|
: handle{std::exchange(rhs.handle, nullptr)}, owner{rhs.owner}, dld{rhs.dld} {}
|
||||||
|
|
||||||
/// Assign the current handle transfering the ownership from another handle.
|
/// Assign the current handle transferring the ownership from another handle.
|
||||||
/// Destroys any previously held object.
|
/// Destroys any previously held object.
|
||||||
Handle& operator=(Handle&& rhs) noexcept {
|
Handle& operator=(Handle&& rhs) noexcept {
|
||||||
Release();
|
Release();
|
||||||
|
@ -463,10 +463,10 @@ public:
|
||||||
Handle(const Handle&) = delete;
|
Handle(const Handle&) = delete;
|
||||||
Handle& operator=(const Handle&) = delete;
|
Handle& operator=(const Handle&) = delete;
|
||||||
|
|
||||||
/// Construct a handle transfering ownership from another handle.
|
/// Construct a handle transferring ownership from another handle.
|
||||||
Handle(Handle&& rhs) noexcept : handle{std::exchange(rhs.handle, nullptr)}, dld{rhs.dld} {}
|
Handle(Handle&& rhs) noexcept : handle{std::exchange(rhs.handle, nullptr)}, dld{rhs.dld} {}
|
||||||
|
|
||||||
/// Assign the current handle transfering the ownership from another handle.
|
/// Assign the current handle transferring the ownership from another handle.
|
||||||
/// Destroys any previously held object.
|
/// Destroys any previously held object.
|
||||||
Handle& operator=(Handle&& rhs) noexcept {
|
Handle& operator=(Handle&& rhs) noexcept {
|
||||||
Release();
|
Release();
|
||||||
|
@ -533,12 +533,12 @@ public:
|
||||||
PoolAllocations(const PoolAllocations&) = delete;
|
PoolAllocations(const PoolAllocations&) = delete;
|
||||||
PoolAllocations& operator=(const PoolAllocations&) = delete;
|
PoolAllocations& operator=(const PoolAllocations&) = delete;
|
||||||
|
|
||||||
/// Construct an allocation transfering ownership from another allocation.
|
/// Construct an allocation transferring ownership from another allocation.
|
||||||
PoolAllocations(PoolAllocations&& rhs) noexcept
|
PoolAllocations(PoolAllocations&& rhs) noexcept
|
||||||
: allocations{std::move(rhs.allocations)}, num{rhs.num}, device{rhs.device}, pool{rhs.pool},
|
: allocations{std::move(rhs.allocations)}, num{rhs.num}, device{rhs.device}, pool{rhs.pool},
|
||||||
dld{rhs.dld} {}
|
dld{rhs.dld} {}
|
||||||
|
|
||||||
/// Assign an allocation transfering ownership from another allocation.
|
/// Assign an allocation transferring ownership from another allocation.
|
||||||
PoolAllocations& operator=(PoolAllocations&& rhs) noexcept {
|
PoolAllocations& operator=(PoolAllocations&& rhs) noexcept {
|
||||||
allocations = std::move(rhs.allocations);
|
allocations = std::move(rhs.allocations);
|
||||||
num = rhs.num;
|
num = rhs.num;
|
||||||
|
|
|
@ -110,7 +110,7 @@ private:
|
||||||
/**
|
/**
|
||||||
* Handles button presses to execute functions assigned in yuzu_key_callbacks.
|
* Handles button presses to execute functions assigned in yuzu_key_callbacks.
|
||||||
* yuzu_key_callbacks contains specialized functions for the buttons in the window footer
|
* yuzu_key_callbacks contains specialized functions for the buttons in the window footer
|
||||||
* that can be overriden by games to achieve desired functionality.
|
* that can be overridden by games to achieve desired functionality.
|
||||||
*
|
*
|
||||||
* @tparam HIDButton The list of buttons contained in yuzu_key_callbacks
|
* @tparam HIDButton The list of buttons contained in yuzu_key_callbacks
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -76,7 +76,7 @@ void CompatDB::Submit() {
|
||||||
compatibility_Graphical->addButton(ui->radioButton_Audio_Minor, 1);
|
compatibility_Graphical->addButton(ui->radioButton_Audio_Minor, 1);
|
||||||
compatibility_Audio->addButton(ui->radioButton_Audio_No, 2);
|
compatibility_Audio->addButton(ui->radioButton_Audio_No, 2);
|
||||||
|
|
||||||
const int compatiblity = static_cast<int>(CalculateCompatibility());
|
const int compatibility = static_cast<int>(CalculateCompatibility());
|
||||||
|
|
||||||
switch ((static_cast<CompatDBPage>(currentId()))) {
|
switch ((static_cast<CompatDBPage>(currentId()))) {
|
||||||
case CompatDBPage::Intro:
|
case CompatDBPage::Intro:
|
||||||
|
@ -113,9 +113,9 @@ void CompatDB::Submit() {
|
||||||
break;
|
break;
|
||||||
case CompatDBPage::Final:
|
case CompatDBPage::Final:
|
||||||
back();
|
back();
|
||||||
LOG_INFO(Frontend, "Compatibility Rating: {}", compatiblity);
|
LOG_INFO(Frontend, "Compatibility Rating: {}", compatibility);
|
||||||
telemetry_session.AddField(Common::Telemetry::FieldType::UserFeedback, "Compatibility",
|
telemetry_session.AddField(Common::Telemetry::FieldType::UserFeedback, "Compatibility",
|
||||||
compatiblity);
|
compatibility);
|
||||||
|
|
||||||
button(NextButton)->setEnabled(false);
|
button(NextButton)->setEnabled(false);
|
||||||
button(NextButton)->setText(tr("Submitting"));
|
button(NextButton)->setText(tr("Submitting"));
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "ui_configure_audio.h"
|
#include "ui_configure_audio.h"
|
||||||
#include "yuzu/configuration/configuration_shared.h"
|
#include "yuzu/configuration/configuration_shared.h"
|
||||||
#include "yuzu/configuration/configure_audio.h"
|
#include "yuzu/configuration/configure_audio.h"
|
||||||
|
#include "yuzu/uisettings.h"
|
||||||
|
|
||||||
ConfigureAudio::ConfigureAudio(const Core::System& system_, QWidget* parent)
|
ConfigureAudio::ConfigureAudio(const Core::System& system_, QWidget* parent)
|
||||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureAudio>()), system{system_} {
|
: QWidget(parent), ui(std::make_unique<Ui::ConfigureAudio>()), system{system_} {
|
||||||
|
@ -47,17 +48,22 @@ void ConfigureAudio::SetConfiguration() {
|
||||||
|
|
||||||
const auto volume_value = static_cast<int>(Settings::values.volume.GetValue());
|
const auto volume_value = static_cast<int>(Settings::values.volume.GetValue());
|
||||||
ui->volume_slider->setValue(volume_value);
|
ui->volume_slider->setValue(volume_value);
|
||||||
|
ui->toggle_background_mute->setChecked(UISettings::values.mute_when_in_background.GetValue());
|
||||||
|
|
||||||
if (!Settings::IsConfiguringGlobal()) {
|
if (!Settings::IsConfiguringGlobal()) {
|
||||||
if (Settings::values.volume.UsingGlobal()) {
|
if (Settings::values.volume.UsingGlobal()) {
|
||||||
ui->volume_combo_box->setCurrentIndex(0);
|
ui->volume_combo_box->setCurrentIndex(0);
|
||||||
ui->volume_slider->setEnabled(false);
|
ui->volume_slider->setEnabled(false);
|
||||||
|
ui->combo_sound->setCurrentIndex(Settings::values.sound_index.GetValue());
|
||||||
} else {
|
} else {
|
||||||
ui->volume_combo_box->setCurrentIndex(1);
|
ui->volume_combo_box->setCurrentIndex(1);
|
||||||
ui->volume_slider->setEnabled(true);
|
ui->volume_slider->setEnabled(true);
|
||||||
|
ConfigurationShared::SetPerGameSetting(ui->combo_sound, &Settings::values.sound_index);
|
||||||
}
|
}
|
||||||
ConfigurationShared::SetHighlight(ui->volume_layout,
|
ConfigurationShared::SetHighlight(ui->volume_layout,
|
||||||
!Settings::values.volume.UsingGlobal());
|
!Settings::values.volume.UsingGlobal());
|
||||||
|
ConfigurationShared::SetHighlight(ui->mode_label,
|
||||||
|
!Settings::values.sound_index.UsingGlobal());
|
||||||
}
|
}
|
||||||
SetVolumeIndicatorText(ui->volume_slider->sliderPosition());
|
SetVolumeIndicatorText(ui->volume_slider->sliderPosition());
|
||||||
}
|
}
|
||||||
|
@ -109,6 +115,8 @@ void ConfigureAudio::SetVolumeIndicatorText(int percentage) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureAudio::ApplyConfiguration() {
|
void ConfigureAudio::ApplyConfiguration() {
|
||||||
|
ConfigurationShared::ApplyPerGameSetting(&Settings::values.sound_index, ui->combo_sound);
|
||||||
|
|
||||||
if (Settings::IsConfiguringGlobal()) {
|
if (Settings::IsConfiguringGlobal()) {
|
||||||
Settings::values.sink_id =
|
Settings::values.sink_id =
|
||||||
ui->sink_combo_box->itemText(ui->sink_combo_box->currentIndex()).toStdString();
|
ui->sink_combo_box->itemText(ui->sink_combo_box->currentIndex()).toStdString();
|
||||||
|
@ -116,6 +124,7 @@ void ConfigureAudio::ApplyConfiguration() {
|
||||||
ui->output_combo_box->itemText(ui->output_combo_box->currentIndex()).toStdString());
|
ui->output_combo_box->itemText(ui->output_combo_box->currentIndex()).toStdString());
|
||||||
Settings::values.audio_input_device_id.SetValue(
|
Settings::values.audio_input_device_id.SetValue(
|
||||||
ui->input_combo_box->itemText(ui->input_combo_box->currentIndex()).toStdString());
|
ui->input_combo_box->itemText(ui->input_combo_box->currentIndex()).toStdString());
|
||||||
|
UISettings::values.mute_when_in_background = ui->toggle_background_mute->isChecked();
|
||||||
|
|
||||||
// Guard if during game and set to game-specific value
|
// Guard if during game and set to game-specific value
|
||||||
if (Settings::values.volume.UsingGlobal()) {
|
if (Settings::values.volume.UsingGlobal()) {
|
||||||
|
@ -174,10 +183,14 @@ void ConfigureAudio::RetranslateUI() {
|
||||||
void ConfigureAudio::SetupPerGameUI() {
|
void ConfigureAudio::SetupPerGameUI() {
|
||||||
if (Settings::IsConfiguringGlobal()) {
|
if (Settings::IsConfiguringGlobal()) {
|
||||||
ui->volume_slider->setEnabled(Settings::values.volume.UsingGlobal());
|
ui->volume_slider->setEnabled(Settings::values.volume.UsingGlobal());
|
||||||
|
// ui->combo_sound->setEnabled(Settings::values.sound_index.UsingGlobal());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ConfigurationShared::SetColoredComboBox(ui->combo_sound, ui->label_sound,
|
||||||
|
// Settings::values.sound_index.GetValue(true));
|
||||||
|
|
||||||
connect(ui->volume_combo_box, qOverload<int>(&QComboBox::activated), this, [this](int index) {
|
connect(ui->volume_combo_box, qOverload<int>(&QComboBox::activated), this, [this](int index) {
|
||||||
ui->volume_slider->setEnabled(index == 1);
|
ui->volume_slider->setEnabled(index == 1);
|
||||||
ConfigurationShared::SetHighlight(ui->volume_layout, index == 1);
|
ConfigurationShared::SetHighlight(ui->volume_layout, index == 1);
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="output_label">
|
<widget class="QLabel" name="output_label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Output Device</string>
|
<string>Output Device:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="input_label">
|
<widget class="QLabel" name="input_label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Input Device</string>
|
<string>Input Device:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -61,6 +61,36 @@
|
||||||
<widget class="QComboBox" name="input_combo_box"/>
|
<widget class="QComboBox" name="input_combo_box"/>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="mode_layout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="mode_label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Sound Ouput Mode:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="combo_sound">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Mono</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Stereo</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Surround</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="volume_layout" native="true">
|
<widget class="QWidget" name="volume_layout" native="true">
|
||||||
|
@ -149,6 +179,17 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="mute_layout">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="toggle_background_mute">
|
||||||
|
<property name="text">
|
||||||
|
<string>Mute audio when in background</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -42,7 +42,6 @@ void ConfigureGeneral::SetConfiguration() {
|
||||||
ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing.GetValue());
|
ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing.GetValue());
|
||||||
ui->toggle_user_on_boot->setChecked(UISettings::values.select_user_on_boot.GetValue());
|
ui->toggle_user_on_boot->setChecked(UISettings::values.select_user_on_boot.GetValue());
|
||||||
ui->toggle_background_pause->setChecked(UISettings::values.pause_when_in_background.GetValue());
|
ui->toggle_background_pause->setChecked(UISettings::values.pause_when_in_background.GetValue());
|
||||||
ui->toggle_background_mute->setChecked(UISettings::values.mute_when_in_background.GetValue());
|
|
||||||
ui->toggle_hide_mouse->setChecked(UISettings::values.hide_mouse.GetValue());
|
ui->toggle_hide_mouse->setChecked(UISettings::values.hide_mouse.GetValue());
|
||||||
|
|
||||||
ui->toggle_speed_limit->setChecked(Settings::values.use_speed_limit.GetValue());
|
ui->toggle_speed_limit->setChecked(Settings::values.use_speed_limit.GetValue());
|
||||||
|
@ -88,7 +87,6 @@ void ConfigureGeneral::ApplyConfiguration() {
|
||||||
UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked();
|
UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked();
|
||||||
UISettings::values.select_user_on_boot = ui->toggle_user_on_boot->isChecked();
|
UISettings::values.select_user_on_boot = ui->toggle_user_on_boot->isChecked();
|
||||||
UISettings::values.pause_when_in_background = ui->toggle_background_pause->isChecked();
|
UISettings::values.pause_when_in_background = ui->toggle_background_pause->isChecked();
|
||||||
UISettings::values.mute_when_in_background = ui->toggle_background_mute->isChecked();
|
|
||||||
UISettings::values.hide_mouse = ui->toggle_hide_mouse->isChecked();
|
UISettings::values.hide_mouse = ui->toggle_hide_mouse->isChecked();
|
||||||
|
|
||||||
// Guard if during game and set to game-specific value
|
// Guard if during game and set to game-specific value
|
||||||
|
|
|
@ -89,13 +89,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="toggle_background_mute">
|
|
||||||
<property name="text">
|
|
||||||
<string>Mute audio when in background</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="toggle_hide_mouse">
|
<widget class="QCheckBox" name="toggle_hide_mouse">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
|
@ -224,7 +224,7 @@ private:
|
||||||
|
|
||||||
/// Bottom row is where console wide settings are held, and its "owned" by the parent
|
/// Bottom row is where console wide settings are held, and its "owned" by the parent
|
||||||
/// ConfigureInput widget. On show, add this widget to the main layout. This will change the
|
/// ConfigureInput widget. On show, add this widget to the main layout. This will change the
|
||||||
/// parent of the widget to this widget (but thats fine).
|
/// parent of the widget to this widget (but that's fine).
|
||||||
QWidget* bottom_row;
|
QWidget* bottom_row;
|
||||||
|
|
||||||
Core::HID::HIDCore& hid_core;
|
Core::HID::HIDCore& hid_core;
|
||||||
|
|
|
@ -43,7 +43,7 @@ public:
|
||||||
// Handles emulated controller events
|
// Handles emulated controller events
|
||||||
void ControllerUpdate(Core::HID::ControllerTriggerType type);
|
void ControllerUpdate(Core::HID::ControllerTriggerType type);
|
||||||
|
|
||||||
// Updates input on sheduled interval
|
// Updates input on scheduled interval
|
||||||
void UpdateInput();
|
void UpdateInput();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -40,8 +40,6 @@ static bool IsValidLocale(u32 region_index, u32 language_index) {
|
||||||
ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent)
|
ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent)
|
||||||
: QWidget(parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_} {
|
: QWidget(parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_} {
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
connect(ui->button_regenerate_console_id, &QPushButton::clicked, this,
|
|
||||||
&ConfigureSystem::RefreshConsoleID);
|
|
||||||
|
|
||||||
connect(ui->rng_seed_checkbox, &QCheckBox::stateChanged, this, [this](int state) {
|
connect(ui->rng_seed_checkbox, &QCheckBox::stateChanged, this, [this](int state) {
|
||||||
ui->rng_seed_edit->setEnabled(state == Qt::Checked);
|
ui->rng_seed_edit->setEnabled(state == Qt::Checked);
|
||||||
|
@ -76,9 +74,6 @@ ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent)
|
||||||
locale_check);
|
locale_check);
|
||||||
connect(ui->combo_region, qOverload<int>(&QComboBox::currentIndexChanged), this, locale_check);
|
connect(ui->combo_region, qOverload<int>(&QComboBox::currentIndexChanged), this, locale_check);
|
||||||
|
|
||||||
ui->label_console_id->setVisible(Settings::IsConfiguringGlobal());
|
|
||||||
ui->button_regenerate_console_id->setVisible(Settings::IsConfiguringGlobal());
|
|
||||||
|
|
||||||
SetupPerGameUI();
|
SetupPerGameUI();
|
||||||
|
|
||||||
SetConfiguration();
|
SetConfiguration();
|
||||||
|
@ -121,14 +116,12 @@ void ConfigureSystem::SetConfiguration() {
|
||||||
ui->combo_language->setCurrentIndex(Settings::values.language_index.GetValue());
|
ui->combo_language->setCurrentIndex(Settings::values.language_index.GetValue());
|
||||||
ui->combo_region->setCurrentIndex(Settings::values.region_index.GetValue());
|
ui->combo_region->setCurrentIndex(Settings::values.region_index.GetValue());
|
||||||
ui->combo_time_zone->setCurrentIndex(Settings::values.time_zone_index.GetValue());
|
ui->combo_time_zone->setCurrentIndex(Settings::values.time_zone_index.GetValue());
|
||||||
ui->combo_sound->setCurrentIndex(Settings::values.sound_index.GetValue());
|
|
||||||
} else {
|
} else {
|
||||||
ConfigurationShared::SetPerGameSetting(ui->combo_language,
|
ConfigurationShared::SetPerGameSetting(ui->combo_language,
|
||||||
&Settings::values.language_index);
|
&Settings::values.language_index);
|
||||||
ConfigurationShared::SetPerGameSetting(ui->combo_region, &Settings::values.region_index);
|
ConfigurationShared::SetPerGameSetting(ui->combo_region, &Settings::values.region_index);
|
||||||
ConfigurationShared::SetPerGameSetting(ui->combo_time_zone,
|
ConfigurationShared::SetPerGameSetting(ui->combo_time_zone,
|
||||||
&Settings::values.time_zone_index);
|
&Settings::values.time_zone_index);
|
||||||
ConfigurationShared::SetPerGameSetting(ui->combo_sound, &Settings::values.sound_index);
|
|
||||||
|
|
||||||
ConfigurationShared::SetHighlight(ui->label_language,
|
ConfigurationShared::SetHighlight(ui->label_language,
|
||||||
!Settings::values.language_index.UsingGlobal());
|
!Settings::values.language_index.UsingGlobal());
|
||||||
|
@ -136,8 +129,6 @@ void ConfigureSystem::SetConfiguration() {
|
||||||
!Settings::values.region_index.UsingGlobal());
|
!Settings::values.region_index.UsingGlobal());
|
||||||
ConfigurationShared::SetHighlight(ui->label_timezone,
|
ConfigurationShared::SetHighlight(ui->label_timezone,
|
||||||
!Settings::values.time_zone_index.UsingGlobal());
|
!Settings::values.time_zone_index.UsingGlobal());
|
||||||
ConfigurationShared::SetHighlight(ui->label_sound,
|
|
||||||
!Settings::values.sound_index.UsingGlobal());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +160,6 @@ void ConfigureSystem::ApplyConfiguration() {
|
||||||
ConfigurationShared::ApplyPerGameSetting(&Settings::values.region_index, ui->combo_region);
|
ConfigurationShared::ApplyPerGameSetting(&Settings::values.region_index, ui->combo_region);
|
||||||
ConfigurationShared::ApplyPerGameSetting(&Settings::values.time_zone_index,
|
ConfigurationShared::ApplyPerGameSetting(&Settings::values.time_zone_index,
|
||||||
ui->combo_time_zone);
|
ui->combo_time_zone);
|
||||||
ConfigurationShared::ApplyPerGameSetting(&Settings::values.sound_index, ui->combo_sound);
|
|
||||||
|
|
||||||
if (Settings::IsConfiguringGlobal()) {
|
if (Settings::IsConfiguringGlobal()) {
|
||||||
// Guard if during game and set to game-specific value
|
// Guard if during game and set to game-specific value
|
||||||
|
@ -202,29 +192,11 @@ void ConfigureSystem::ApplyConfiguration() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureSystem::RefreshConsoleID() {
|
|
||||||
QMessageBox::StandardButton reply;
|
|
||||||
QString warning_text = tr("This will replace your current virtual Switch with a new one. "
|
|
||||||
"Your current virtual Switch will not be recoverable. "
|
|
||||||
"This might have unexpected effects in games. This might fail, "
|
|
||||||
"if you use an outdated config savegame. Continue?");
|
|
||||||
reply = QMessageBox::critical(this, tr("Warning"), warning_text,
|
|
||||||
QMessageBox::No | QMessageBox::Yes);
|
|
||||||
if (reply == QMessageBox::No) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
u64 console_id{};
|
|
||||||
ui->label_console_id->setText(
|
|
||||||
tr("Console ID: 0x%1").arg(QString::number(console_id, 16).toUpper()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConfigureSystem::SetupPerGameUI() {
|
void ConfigureSystem::SetupPerGameUI() {
|
||||||
if (Settings::IsConfiguringGlobal()) {
|
if (Settings::IsConfiguringGlobal()) {
|
||||||
ui->combo_language->setEnabled(Settings::values.language_index.UsingGlobal());
|
ui->combo_language->setEnabled(Settings::values.language_index.UsingGlobal());
|
||||||
ui->combo_region->setEnabled(Settings::values.region_index.UsingGlobal());
|
ui->combo_region->setEnabled(Settings::values.region_index.UsingGlobal());
|
||||||
ui->combo_time_zone->setEnabled(Settings::values.time_zone_index.UsingGlobal());
|
ui->combo_time_zone->setEnabled(Settings::values.time_zone_index.UsingGlobal());
|
||||||
ui->combo_sound->setEnabled(Settings::values.sound_index.UsingGlobal());
|
|
||||||
ui->rng_seed_checkbox->setEnabled(Settings::values.rng_seed.UsingGlobal());
|
ui->rng_seed_checkbox->setEnabled(Settings::values.rng_seed.UsingGlobal());
|
||||||
ui->rng_seed_edit->setEnabled(Settings::values.rng_seed.UsingGlobal());
|
ui->rng_seed_edit->setEnabled(Settings::values.rng_seed.UsingGlobal());
|
||||||
|
|
||||||
|
@ -237,8 +209,6 @@ void ConfigureSystem::SetupPerGameUI() {
|
||||||
Settings::values.region_index.GetValue(true));
|
Settings::values.region_index.GetValue(true));
|
||||||
ConfigurationShared::SetColoredComboBox(ui->combo_time_zone, ui->label_timezone,
|
ConfigurationShared::SetColoredComboBox(ui->combo_time_zone, ui->label_timezone,
|
||||||
Settings::values.time_zone_index.GetValue(true));
|
Settings::values.time_zone_index.GetValue(true));
|
||||||
ConfigurationShared::SetColoredComboBox(ui->combo_sound, ui->label_sound,
|
|
||||||
Settings::values.sound_index.GetValue(true));
|
|
||||||
|
|
||||||
ConfigurationShared::SetColoredTristate(
|
ConfigurationShared::SetColoredTristate(
|
||||||
ui->rng_seed_checkbox, Settings::values.rng_seed.UsingGlobal(),
|
ui->rng_seed_checkbox, Settings::values.rng_seed.UsingGlobal(),
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue