Compare commits
33 Commits
__refs_pul
...
__refs_pul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f2ac928f2 | ||
|
|
99a1d7440d | ||
|
|
0d8fcab136 | ||
|
|
703663d761 | ||
|
|
d2ad279a32 | ||
|
|
49e198b20d | ||
|
|
ff2c1b0a94 | ||
|
|
98af269415 | ||
|
|
ca84b530a3 | ||
|
|
f5efac3442 | ||
|
|
bba63b33a1 | ||
|
|
da07faebfe | ||
|
|
0a2b219a31 | ||
|
|
3575c076cb | ||
|
|
fd020ad52a | ||
|
|
3a2581cc7d | ||
|
|
369f6e58aa | ||
|
|
1ced7bbea5 | ||
|
|
a2304fad16 | ||
|
|
b79362b9da | ||
|
|
86491da0d6 | ||
|
|
7da8f15461 | ||
|
|
268eeeb406 | ||
|
|
f08c0520a4 | ||
|
|
9d6aa7bff7 | ||
|
|
444a01afa6 | ||
|
|
e373027a73 | ||
|
|
bf9c62bc76 | ||
|
|
8191273a3d | ||
|
|
e119e17d18 | ||
|
|
2482aca7c3 | ||
|
|
420f8fb29e | ||
|
|
6e5f83ee24 |
@@ -7,6 +7,7 @@
|
||||
#include "audio_core/sink_details.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/settings.h"
|
||||
|
||||
namespace AudioCore {
|
||||
|
||||
@@ -29,8 +30,8 @@ static Stream::Format ChannelsToStreamFormat(u32 num_channels) {
|
||||
StreamPtr AudioOut::OpenStream(u32 sample_rate, u32 num_channels,
|
||||
Stream::ReleaseCallback&& release_callback) {
|
||||
if (!sink) {
|
||||
const SinkDetails& sink_details = GetSinkDetails("auto");
|
||||
sink = sink_details.factory("");
|
||||
const SinkDetails& sink_details = GetSinkDetails(Settings::values.sink_id);
|
||||
sink = sink_details.factory(Settings::values.audio_device_id);
|
||||
}
|
||||
|
||||
return std::make_shared<Stream>(sample_rate, ChannelsToStreamFormat(num_channels),
|
||||
|
||||
@@ -2,14 +2,17 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/core_timing_util.h"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
#include "audio_core/sink.h"
|
||||
#include "audio_core/sink_details.h"
|
||||
#include "audio_core/stream.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/core_timing_util.h"
|
||||
#include "core/settings.h"
|
||||
|
||||
namespace AudioCore {
|
||||
|
||||
@@ -56,6 +59,24 @@ s64 Stream::GetBufferReleaseCycles(const Buffer& buffer) const {
|
||||
return CoreTiming::usToCycles((static_cast<u64>(num_samples) * 1000000) / sample_rate);
|
||||
}
|
||||
|
||||
static std::vector<s16> GetVolumeAdjustedSamples(const std::vector<u8>& data) {
|
||||
std::vector<s16> samples(data.size() / sizeof(s16));
|
||||
std::memcpy(samples.data(), data.data(), data.size());
|
||||
const float volume{std::clamp(Settings::values.volume, 0.0f, 1.0f)};
|
||||
|
||||
if (volume == 1.0f) {
|
||||
return samples;
|
||||
}
|
||||
|
||||
// Implementation of a volume slider with a dynamic range of 60 dB
|
||||
const float volume_scale_factor{std::exp(6.90775f * volume) * 0.001f};
|
||||
for (auto& sample : samples) {
|
||||
sample = static_cast<s16>(sample * volume_scale_factor);
|
||||
}
|
||||
|
||||
return samples;
|
||||
}
|
||||
|
||||
void Stream::PlayNextBuffer() {
|
||||
if (!IsPlaying()) {
|
||||
// Ensure we are in playing state before playing the next buffer
|
||||
@@ -75,9 +96,9 @@ void Stream::PlayNextBuffer() {
|
||||
active_buffer = queued_buffers.front();
|
||||
queued_buffers.pop();
|
||||
|
||||
sink_stream.EnqueueSamples(GetNumChannels(),
|
||||
reinterpret_cast<const s16*>(active_buffer->GetData().data()),
|
||||
active_buffer->GetData().size() / GetSampleSize());
|
||||
const size_t sample_count{active_buffer->GetData().size() / GetSampleSize()};
|
||||
sink_stream.EnqueueSamples(
|
||||
GetNumChannels(), GetVolumeAdjustedSamples(active_buffer->GetData()).data(), sample_count);
|
||||
|
||||
CoreTiming::ScheduleEventThreadsafe(GetBufferReleaseCycles(*active_buffer), release_event, {});
|
||||
}
|
||||
|
||||
@@ -171,6 +171,7 @@ void FileBackend::Write(const Entry& entry) {
|
||||
SUB(Service, BCAT) \
|
||||
SUB(Service, BTM) \
|
||||
SUB(Service, Fatal) \
|
||||
SUB(Service, FGM) \
|
||||
SUB(Service, Friend) \
|
||||
SUB(Service, FS) \
|
||||
SUB(Service, HID) \
|
||||
@@ -185,6 +186,7 @@ void FileBackend::Write(const Entry& entry) {
|
||||
SUB(Service, NIFM) \
|
||||
SUB(Service, NS) \
|
||||
SUB(Service, NVDRV) \
|
||||
SUB(Service, PCIE) \
|
||||
SUB(Service, PCTL) \
|
||||
SUB(Service, PREPO) \
|
||||
SUB(Service, SET) \
|
||||
|
||||
@@ -58,6 +58,7 @@ enum class Class : ClassType {
|
||||
Service_BCAT, ///< The BCAT service
|
||||
Service_BTM, ///< The BTM service
|
||||
Service_Fatal, ///< The Fatal service
|
||||
Service_FGM, ///< The FGM service
|
||||
Service_Friend, ///< The friend service
|
||||
Service_FS, ///< The FS (Filesystem) service
|
||||
Service_HID, ///< The HID (Human interface device) service
|
||||
@@ -72,6 +73,7 @@ enum class Class : ClassType {
|
||||
Service_NIFM, ///< The NIFM (Network interface) service
|
||||
Service_NS, ///< The NS services
|
||||
Service_NVDRV, ///< The NVDRV (Nvidia driver) service
|
||||
Service_PCIE, ///< The PCIe service
|
||||
Service_PCTL, ///< The PCTL (Parental control) service
|
||||
Service_PREPO, ///< The PREPO (Play report) service
|
||||
Service_SET, ///< The SET (Settings) service
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
|
||||
namespace Log {
|
||||
|
||||
|
||||
@@ -33,9 +33,11 @@ public:
|
||||
bool Empty() const {
|
||||
return !read_ptr->next.load();
|
||||
}
|
||||
|
||||
T& Front() const {
|
||||
return read_ptr->current;
|
||||
}
|
||||
|
||||
template <typename Arg>
|
||||
void Push(Arg&& t) {
|
||||
// create the element, add it to the queue
|
||||
@@ -108,15 +110,41 @@ private:
|
||||
// single reader, multiple writer queue
|
||||
|
||||
template <typename T, bool NeedSize = true>
|
||||
class MPSCQueue : public SPSCQueue<T, NeedSize> {
|
||||
class MPSCQueue {
|
||||
public:
|
||||
u32 Size() const {
|
||||
return spsc_queue.Size();
|
||||
}
|
||||
|
||||
bool Empty() const {
|
||||
return spsc_queue.Empty();
|
||||
}
|
||||
|
||||
T& Front() const {
|
||||
return spsc_queue.Front();
|
||||
}
|
||||
|
||||
template <typename Arg>
|
||||
void Push(Arg&& t) {
|
||||
std::lock_guard<std::mutex> lock(write_lock);
|
||||
SPSCQueue<T, NeedSize>::Push(t);
|
||||
spsc_queue.Push(t);
|
||||
}
|
||||
|
||||
void Pop() {
|
||||
return spsc_queue.Pop();
|
||||
}
|
||||
|
||||
bool Pop(T& t) {
|
||||
return spsc_queue.Pop(t);
|
||||
}
|
||||
|
||||
// not thread-safe
|
||||
void Clear() {
|
||||
spsc_queue.Clear();
|
||||
}
|
||||
|
||||
private:
|
||||
SPSCQueue<T, NeedSize> spsc_queue;
|
||||
std::mutex write_lock;
|
||||
};
|
||||
} // namespace Common
|
||||
|
||||
@@ -67,8 +67,6 @@ add_library(core STATIC
|
||||
hle/kernel/memory.h
|
||||
hle/kernel/mutex.cpp
|
||||
hle/kernel/mutex.h
|
||||
hle/kernel/object_address_table.cpp
|
||||
hle/kernel/object_address_table.h
|
||||
hle/kernel/process.cpp
|
||||
hle/kernel/process.h
|
||||
hle/kernel/resource_limit.cpp
|
||||
@@ -114,23 +112,39 @@ add_library(core STATIC
|
||||
hle/service/am/applet_ae.h
|
||||
hle/service/am/applet_oe.cpp
|
||||
hle/service/am/applet_oe.h
|
||||
hle/service/am/idle.cpp
|
||||
hle/service/am/idle.h
|
||||
hle/service/am/omm.cpp
|
||||
hle/service/am/omm.h
|
||||
hle/service/am/spsm.cpp
|
||||
hle/service/am/spsm.h
|
||||
hle/service/aoc/aoc_u.cpp
|
||||
hle/service/aoc/aoc_u.h
|
||||
hle/service/apm/apm.cpp
|
||||
hle/service/apm/apm.h
|
||||
hle/service/apm/interface.cpp
|
||||
hle/service/apm/interface.h
|
||||
hle/service/audio/audctl.cpp
|
||||
hle/service/audio/audctl.h
|
||||
hle/service/audio/auddbg.cpp
|
||||
hle/service/audio/auddbg.h
|
||||
hle/service/audio/audin_a.cpp
|
||||
hle/service/audio/audin_a.h
|
||||
hle/service/audio/audin_u.cpp
|
||||
hle/service/audio/audin_u.h
|
||||
hle/service/audio/audio.cpp
|
||||
hle/service/audio/audio.h
|
||||
hle/service/audio/audout_a.cpp
|
||||
hle/service/audio/audout_a.h
|
||||
hle/service/audio/audout_u.cpp
|
||||
hle/service/audio/audout_u.h
|
||||
hle/service/audio/audrec_a.cpp
|
||||
hle/service/audio/audrec_a.h
|
||||
hle/service/audio/audrec_u.cpp
|
||||
hle/service/audio/audrec_u.h
|
||||
hle/service/audio/audren_a.cpp
|
||||
hle/service/audio/audren_a.h
|
||||
hle/service/audio/audren_u.cpp
|
||||
hle/service/audio/audren_u.cpp
|
||||
hle/service/audio/audren_u.h
|
||||
hle/service/audio/audren_u.h
|
||||
hle/service/audio/codecctl.cpp
|
||||
hle/service/audio/codecctl.h
|
||||
@@ -160,6 +174,8 @@ add_library(core STATIC
|
||||
hle/service/filesystem/filesystem.h
|
||||
hle/service/filesystem/fsp_srv.cpp
|
||||
hle/service/filesystem/fsp_srv.h
|
||||
hle/service/fgm/fgm.cpp
|
||||
hle/service/fgm/fgm.h
|
||||
hle/service/friend/friend.cpp
|
||||
hle/service/friend/friend.h
|
||||
hle/service/friend/interface.cpp
|
||||
@@ -225,6 +241,8 @@ add_library(core STATIC
|
||||
hle/service/nvflinger/buffer_queue.h
|
||||
hle/service/nvflinger/nvflinger.cpp
|
||||
hle/service/nvflinger/nvflinger.h
|
||||
hle/service/pcie/pcie.cpp
|
||||
hle/service/pcie/pcie.h
|
||||
hle/service/pctl/module.cpp
|
||||
hle/service/pctl/module.h
|
||||
hle/service/pctl/pctl.cpp
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "core/arm/dynarmic/arm_dynarmic.h"
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/hle/kernel/memory.h"
|
||||
#include "core/hle/kernel/process.h"
|
||||
#include "core/hle/kernel/svc.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
@@ -139,14 +139,12 @@ void ARM_Dynarmic::Step() {
|
||||
}
|
||||
|
||||
ARM_Dynarmic::ARM_Dynarmic(std::shared_ptr<ExclusiveMonitor> exclusive_monitor, size_t core_index)
|
||||
: cb(std::make_unique<ARM_Dynarmic_Callbacks>(*this)),
|
||||
jit(MakeJit()), exclusive_monitor{std::dynamic_pointer_cast<DynarmicExclusiveMonitor>(
|
||||
exclusive_monitor)},
|
||||
core_index{core_index} {
|
||||
ARM_Interface::ThreadContext ctx;
|
||||
: cb(std::make_unique<ARM_Dynarmic_Callbacks>(*this)), core_index{core_index},
|
||||
exclusive_monitor{std::dynamic_pointer_cast<DynarmicExclusiveMonitor>(exclusive_monitor)} {
|
||||
ThreadContext ctx;
|
||||
inner_unicorn.SaveContext(ctx);
|
||||
LoadContext(ctx);
|
||||
PageTableChanged();
|
||||
LoadContext(ctx);
|
||||
}
|
||||
|
||||
ARM_Dynarmic::~ARM_Dynarmic() = default;
|
||||
@@ -205,7 +203,7 @@ u64 ARM_Dynarmic::GetTlsAddress() const {
|
||||
return cb->tpidrro_el0;
|
||||
}
|
||||
|
||||
void ARM_Dynarmic::SetTlsAddress(u64 address) {
|
||||
void ARM_Dynarmic::SetTlsAddress(VAddr address) {
|
||||
cb->tpidrro_el0 = address;
|
||||
}
|
||||
|
||||
@@ -217,7 +215,7 @@ void ARM_Dynarmic::SetTPIDR_EL0(u64 value) {
|
||||
cb->tpidr_el0 = value;
|
||||
}
|
||||
|
||||
void ARM_Dynarmic::SaveContext(ARM_Interface::ThreadContext& ctx) {
|
||||
void ARM_Dynarmic::SaveContext(ThreadContext& ctx) {
|
||||
ctx.cpu_registers = jit->GetRegisters();
|
||||
ctx.sp = jit->GetSP();
|
||||
ctx.pc = jit->GetPC();
|
||||
@@ -226,7 +224,7 @@ void ARM_Dynarmic::SaveContext(ARM_Interface::ThreadContext& ctx) {
|
||||
ctx.fpscr = jit->GetFpcr();
|
||||
}
|
||||
|
||||
void ARM_Dynarmic::LoadContext(const ARM_Interface::ThreadContext& ctx) {
|
||||
void ARM_Dynarmic::LoadContext(const ThreadContext& ctx) {
|
||||
jit->SetRegisters(ctx.cpu_registers);
|
||||
jit->SetSP(ctx.sp);
|
||||
jit->SetPC(ctx.pc);
|
||||
|
||||
@@ -86,7 +86,7 @@ System::ResultStatus System::SingleStep() {
|
||||
return RunLoop(false);
|
||||
}
|
||||
|
||||
System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& filepath) {
|
||||
System::ResultStatus System::Load(EmuWindow& emu_window, const std::string& filepath) {
|
||||
app_loader = Loader::GetLoader(std::make_shared<FileSys::RealVfsFile>(filepath));
|
||||
|
||||
if (!app_loader) {
|
||||
@@ -163,7 +163,7 @@ Cpu& System::CpuCore(size_t core_index) {
|
||||
return *cpu_cores[core_index];
|
||||
}
|
||||
|
||||
System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
|
||||
System::ResultStatus System::Init(EmuWindow& emu_window, u32 system_mode) {
|
||||
LOG_DEBUG(HW_Memory, "initialized OK");
|
||||
|
||||
CoreTiming::Init();
|
||||
|
||||
@@ -81,11 +81,12 @@ public:
|
||||
|
||||
/**
|
||||
* Load an executable application.
|
||||
* @param emu_window Pointer to the host-system window used for video output and keyboard input.
|
||||
* @param emu_window Reference to the host-system window used for video output and keyboard
|
||||
* input.
|
||||
* @param filepath String path to the executable application to load on the host file system.
|
||||
* @returns ResultStatus code, indicating if the operation succeeded.
|
||||
*/
|
||||
ResultStatus Load(EmuWindow* emu_window, const std::string& filepath);
|
||||
ResultStatus Load(EmuWindow& emu_window, const std::string& filepath);
|
||||
|
||||
/**
|
||||
* Indicates if the emulated system is powered on (all subsystems initialized and able to run an
|
||||
@@ -186,11 +187,12 @@ private:
|
||||
|
||||
/**
|
||||
* Initialize the emulated system.
|
||||
* @param emu_window Pointer to the host-system window used for video output and keyboard input.
|
||||
* @param emu_window Reference to the host-system window used for video output and keyboard
|
||||
* input.
|
||||
* @param system_mode The system mode.
|
||||
* @return ResultStatus code, indicating if the operation succeeded.
|
||||
*/
|
||||
ResultStatus Init(EmuWindow* emu_window, u32 system_mode);
|
||||
ResultStatus Init(EmuWindow& emu_window, u32 system_mode);
|
||||
|
||||
/// AppLoader used to load the current executing application
|
||||
std::unique_ptr<Loader::AppLoader> app_loader;
|
||||
|
||||
@@ -2,15 +2,17 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/errors.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/process.h"
|
||||
#include "core/hle/kernel/thread.h"
|
||||
#include "core/hle/lock.h"
|
||||
#include "core/hle/result.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/result.h"
|
||||
#include "common/common_types.h"
|
||||
|
||||
union ResultCode;
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/assert.h"
|
||||
#include <tuple>
|
||||
|
||||
#include "core/hle/kernel/client_port.h"
|
||||
#include "core/hle/kernel/client_session.h"
|
||||
#include "core/hle/kernel/errors.h"
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/assert.h"
|
||||
|
||||
#include "core/hle/kernel/client_session.h"
|
||||
#include "core/hle/kernel/errors.h"
|
||||
#include "core/hle/kernel/hle_ipc.h"
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include "common/assert.h"
|
||||
#include "core/hle/kernel/event.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
||||
#include <boost/range/algorithm_ext/erase.hpp>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "core/hle/kernel/handle_table.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/memory.h"
|
||||
#include "core/hle/kernel/object_address_table.h"
|
||||
#include "core/hle/kernel/process.h"
|
||||
#include "core/hle/kernel/resource_limit.h"
|
||||
#include "core/hle/kernel/thread.h"
|
||||
@@ -33,7 +32,6 @@ void Init(u32 system_mode) {
|
||||
void Shutdown() {
|
||||
// Free all kernel objects
|
||||
g_handle_table.Clear();
|
||||
g_object_address_table.Clear();
|
||||
|
||||
Kernel::ThreadingShutdown();
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cinttypes>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@@ -12,10 +11,9 @@
|
||||
#include "common/common_types.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/kernel/memory.h"
|
||||
#include "core/hle/kernel/process.h"
|
||||
#include "core/hle/kernel/vm_manager.h"
|
||||
#include "core/hle/result.h"
|
||||
#include "core/memory.h"
|
||||
#include "core/memory_setup.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -5,12 +5,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/process.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
class VMManager;
|
||||
enum class MemoryRegion : u16;
|
||||
struct AddressMapping;
|
||||
|
||||
struct MemoryRegionInfo {
|
||||
u64 base; // Not an address, but offset from start of FCRAM
|
||||
|
||||
@@ -3,16 +3,19 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/range/algorithm_ext/erase.hpp>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/errors.h"
|
||||
#include "core/hle/kernel/handle_table.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/mutex.h"
|
||||
#include "core/hle/kernel/object_address_table.h"
|
||||
#include "core/hle/kernel/thread.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
||||
@@ -4,12 +4,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "common/common_types.h"
|
||||
#include "common/swap.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/wait_object.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
union ResultCode;
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "core/hle/kernel/object_address_table.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
ObjectAddressTable g_object_address_table;
|
||||
|
||||
void ObjectAddressTable::Insert(VAddr addr, SharedPtr<Object> obj) {
|
||||
ASSERT_MSG(objects.find(addr) == objects.end(), "Object already exists with addr=0x{:X}", addr);
|
||||
objects[addr] = std::move(obj);
|
||||
}
|
||||
|
||||
void ObjectAddressTable::Close(VAddr addr) {
|
||||
ASSERT_MSG(objects.find(addr) != objects.end(), "Object does not exist with addr=0x{:X}", addr);
|
||||
objects.erase(addr);
|
||||
}
|
||||
|
||||
SharedPtr<Object> ObjectAddressTable::GetGeneric(VAddr addr) const {
|
||||
auto iter = objects.find(addr);
|
||||
if (iter != objects.end()) {
|
||||
return iter->second;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
void ObjectAddressTable::Clear() {
|
||||
objects.clear();
|
||||
}
|
||||
|
||||
} // namespace Kernel
|
||||
@@ -1,62 +0,0 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
/**
|
||||
* This class is used to keep a table of Kernel objects and their respective addresses in emulated
|
||||
* memory. For certain Switch SVCs, Kernel objects are referenced by an address to an object the
|
||||
* guest application manages, so we use this table to look these kernel objects up. This is similiar
|
||||
* to the HandleTable class.
|
||||
*/
|
||||
class ObjectAddressTable final : NonCopyable {
|
||||
public:
|
||||
ObjectAddressTable() = default;
|
||||
|
||||
/**
|
||||
* Inserts an object and address pair into the table.
|
||||
*/
|
||||
void Insert(VAddr addr, SharedPtr<Object> obj);
|
||||
|
||||
/**
|
||||
* Closes an object by its address, removing it from the table and decreasing the object's
|
||||
* ref-count.
|
||||
* @return `RESULT_SUCCESS` or one of the following errors:
|
||||
* - `ERR_INVALID_HANDLE`: an invalid handle was passed in.
|
||||
*/
|
||||
void Close(VAddr addr);
|
||||
|
||||
/**
|
||||
* Looks up an object by its address.
|
||||
* @return Pointer to the looked-up object, or `nullptr` if the handle is not valid.
|
||||
*/
|
||||
SharedPtr<Object> GetGeneric(VAddr addr) const;
|
||||
|
||||
/**
|
||||
* Looks up an object by its address while verifying its type.
|
||||
* @return Pointer to the looked-up object, or `nullptr` if the handle is not valid or its
|
||||
* type differs from the requested one.
|
||||
*/
|
||||
template <class T>
|
||||
SharedPtr<T> Get(VAddr addr) const {
|
||||
return DynamicObjectCast<T>(GetGeneric(addr));
|
||||
}
|
||||
|
||||
/// Closes all addresses held in this table.
|
||||
void Clear();
|
||||
|
||||
private:
|
||||
/// Stores the Object referenced by the address
|
||||
std::map<VAddr, SharedPtr<Object>> objects;
|
||||
};
|
||||
|
||||
extern ObjectAddressTable g_object_address_table;
|
||||
|
||||
} // namespace Kernel
|
||||
@@ -2,8 +2,12 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/arm/arm_interface.h"
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/hle/kernel/process.h"
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
#include <vector>
|
||||
#include "common/common_types.h"
|
||||
#include "common/thread_queue_list.h"
|
||||
#include "core/arm/arm_interface.h"
|
||||
#include "core/hle/kernel/thread.h"
|
||||
|
||||
class ARM_Interface;
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
class Scheduler final {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/wait_object.h"
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/client_port.h"
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "common/assert.h"
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/wait_object.h"
|
||||
#include "core/hle/result.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/errors.h"
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/process.h"
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
#include <algorithm>
|
||||
#include <cinttypes>
|
||||
#include <iterator>
|
||||
#include <mutex>
|
||||
#include <vector>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/microprofile.h"
|
||||
#include "common/string_util.h"
|
||||
@@ -17,7 +20,6 @@
|
||||
#include "core/hle/kernel/event.h"
|
||||
#include "core/hle/kernel/handle_table.h"
|
||||
#include "core/hle/kernel/mutex.h"
|
||||
#include "core/hle/kernel/object_address_table.h"
|
||||
#include "core/hle/kernel/process.h"
|
||||
#include "core/hle/kernel/resource_limit.h"
|
||||
#include "core/hle/kernel/shared_memory.h"
|
||||
|
||||
@@ -4,8 +4,11 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cinttypes>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/range/algorithm_ext/erase.hpp>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/common_types.h"
|
||||
#include "common/logging/log.h"
|
||||
@@ -19,7 +22,6 @@
|
||||
#include "core/hle/kernel/handle_table.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/memory.h"
|
||||
#include "core/hle/kernel/mutex.h"
|
||||
#include "core/hle/kernel/process.h"
|
||||
#include "core/hle/kernel/thread.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <boost/container/flat_map.hpp>
|
||||
#include <boost/container/flat_set.hpp>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "core/arm/arm_interface.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
@@ -288,12 +287,6 @@ Thread* GetCurrentThread();
|
||||
*/
|
||||
void WaitCurrentThread_Sleep();
|
||||
|
||||
/**
|
||||
* Waits the current thread from an ArbitrateAddress call
|
||||
* @param wait_address Arbitration address used to resume from wait
|
||||
*/
|
||||
void WaitCurrentThread_ArbitrateAddress(VAddr wait_address);
|
||||
|
||||
/**
|
||||
* Stops the current thread and removes it from the thread_list
|
||||
*/
|
||||
|
||||
@@ -5,11 +5,9 @@
|
||||
#include <algorithm>
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/kernel/errors.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/memory.h"
|
||||
#include "core/hle/kernel/process.h"
|
||||
#include "core/hle/kernel/resource_limit.h"
|
||||
#include "core/hle/kernel/thread.h"
|
||||
#include "core/hle/kernel/timer.h"
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
#include "core/hle/service/am/am.h"
|
||||
#include "core/hle/service/am/applet_ae.h"
|
||||
#include "core/hle/service/am/applet_oe.h"
|
||||
#include "core/hle/service/am/idle.h"
|
||||
#include "core/hle/service/am/omm.h"
|
||||
#include "core/hle/service/am/spsm.h"
|
||||
#include "core/hle/service/apm/apm.h"
|
||||
#include "core/hle/service/filesystem/filesystem.h"
|
||||
#include "core/hle/service/nvflinger/nvflinger.h"
|
||||
@@ -689,6 +692,9 @@ void InstallInterfaces(SM::ServiceManager& service_manager,
|
||||
std::shared_ptr<NVFlinger::NVFlinger> nvflinger) {
|
||||
std::make_shared<AppletAE>(nvflinger)->InstallAsService(service_manager);
|
||||
std::make_shared<AppletOE>(nvflinger)->InstallAsService(service_manager);
|
||||
std::make_shared<IdleSys>()->InstallAsService(service_manager);
|
||||
std::make_shared<OMM>()->InstallAsService(service_manager);
|
||||
std::make_shared<SPSM>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
IHomeMenuFunctions::IHomeMenuFunctions() : ServiceFramework("IHomeMenuFunctions") {
|
||||
|
||||
24
src/core/hle/service/am/idle.cpp
Normal file
24
src/core/hle/service/am/idle.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/hle/service/am/idle.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
IdleSys::IdleSys() : ServiceFramework{"idle:sys"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetAutoPowerDownEvent"},
|
||||
{1, nullptr, "Unknown1"},
|
||||
{2, nullptr, "Unknown2"},
|
||||
{3, nullptr, "Unknown3"},
|
||||
{4, nullptr, "Unknown4"},
|
||||
{5, nullptr, "Unknown5"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
} // namespace Service::AM
|
||||
16
src/core/hle/service/am/idle.h
Normal file
16
src/core/hle/service/am/idle.h
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
class IdleSys final : public ServiceFramework<IdleSys> {
|
||||
public:
|
||||
explicit IdleSys();
|
||||
};
|
||||
|
||||
} // namespace Service::AM
|
||||
42
src/core/hle/service/am/omm.cpp
Normal file
42
src/core/hle/service/am/omm.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/hle/service/am/omm.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
OMM::OMM() : ServiceFramework{"omm"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetOperationMode"},
|
||||
{1, nullptr, "GetOperationModeChangeEvent"},
|
||||
{2, nullptr, "EnableAudioVisual"},
|
||||
{3, nullptr, "DisableAudioVisual"},
|
||||
{4, nullptr, "EnterSleepAndWait"},
|
||||
{5, nullptr, "GetCradleStatus"},
|
||||
{6, nullptr, "FadeInDisplay"},
|
||||
{7, nullptr, "FadeOutDisplay"},
|
||||
{8, nullptr, "Unknown1"},
|
||||
{9, nullptr, "Unknown2"},
|
||||
{10, nullptr, "Unknown3"},
|
||||
{11, nullptr, "Unknown4"},
|
||||
{12, nullptr, "Unknown5"},
|
||||
{13, nullptr, "Unknown6"},
|
||||
{14, nullptr, "Unknown7"},
|
||||
{15, nullptr, "Unknown8"},
|
||||
{16, nullptr, "Unknown9"},
|
||||
{17, nullptr, "Unknown10"},
|
||||
{18, nullptr, "Unknown11"},
|
||||
{19, nullptr, "Unknown12"},
|
||||
{20, nullptr, "Unknown13"},
|
||||
{21, nullptr, "Unknown14"},
|
||||
{22, nullptr, "Unknown15"},
|
||||
{23, nullptr, "Unknown16"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
} // namespace Service::AM
|
||||
16
src/core/hle/service/am/omm.h
Normal file
16
src/core/hle/service/am/omm.h
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
class OMM final : public ServiceFramework<OMM> {
|
||||
public:
|
||||
explicit OMM();
|
||||
};
|
||||
|
||||
} // namespace Service::AM
|
||||
30
src/core/hle/service/am/spsm.cpp
Normal file
30
src/core/hle/service/am/spsm.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/hle/service/am/spsm.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
SPSM::SPSM() : ServiceFramework{"spsm"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetState"},
|
||||
{1, nullptr, "SleepSystemAndWaitAwake"},
|
||||
{2, nullptr, "Unknown1"},
|
||||
{3, nullptr, "Unknown2"},
|
||||
{4, nullptr, "GetNotificationMessageEventHandle"},
|
||||
{5, nullptr, "Unknown3"},
|
||||
{6, nullptr, "Unknown4"},
|
||||
{7, nullptr, "Unknown5"},
|
||||
{8, nullptr, "AnalyzePerformanceLogForLastSleepWakeSequence"},
|
||||
{9, nullptr, "ChangeHomeButtonLongPressingTime"},
|
||||
{10, nullptr, "Unknown6"},
|
||||
{11, nullptr, "Unknown7"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
} // namespace Service::AM
|
||||
16
src/core/hle/service/am/spsm.h
Normal file
16
src/core/hle/service/am/spsm.h
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
class SPSM final : public ServiceFramework<SPSM> {
|
||||
public:
|
||||
explicit SPSM();
|
||||
};
|
||||
|
||||
} // namespace Service::AM
|
||||
45
src/core/hle/service/audio/audctl.cpp
Normal file
45
src/core/hle/service/audio/audctl.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/hle/service/audio/audctl.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
AudCtl::AudCtl() : ServiceFramework{"audctl"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetTargetVolume"},
|
||||
{1, nullptr, "SetTargetVolume"},
|
||||
{2, nullptr, "GetTargetVolumeMin"},
|
||||
{3, nullptr, "GetTargetVolumeMax"},
|
||||
{4, nullptr, "IsTargetMute"},
|
||||
{5, nullptr, "SetTargetMute"},
|
||||
{6, nullptr, "IsTargetConnected"},
|
||||
{7, nullptr, "SetDefaultTarget"},
|
||||
{8, nullptr, "GetDefaultTarget"},
|
||||
{9, nullptr, "GetAudioOutputMode"},
|
||||
{10, nullptr, "SetAudioOutputMode"},
|
||||
{11, nullptr, "SetForceMutePolicy"},
|
||||
{12, nullptr, "GetForceMutePolicy"},
|
||||
{13, nullptr, "GetOutputModeSetting"},
|
||||
{14, nullptr, "SetOutputModeSetting"},
|
||||
{15, nullptr, "SetOutputTarget"},
|
||||
{16, nullptr, "SetInputTargetForceEnabled"},
|
||||
{17, nullptr, "SetHeadphoneOutputLevelMode"},
|
||||
{18, nullptr, "GetHeadphoneOutputLevelMode"},
|
||||
{19, nullptr, "AcquireAudioVolumeUpdateEventForPlayReport"},
|
||||
{20, nullptr, "AcquireAudioOutputDeviceUpdateEventForPlayReport"},
|
||||
{21, nullptr, "GetAudioOutputTargetForPlayReport"},
|
||||
{22, nullptr, "NotifyHeadphoneVolumeWarningDisplayedEvent"},
|
||||
{23, nullptr, "SetSystemOutputMasterVolume"},
|
||||
{24, nullptr, "GetSystemOutputMasterVolume"},
|
||||
{25, nullptr, "GetAudioVolumeDataForPlayReport"},
|
||||
{26, nullptr, "UpdateHeadphoneSettings"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
} // namespace Service::Audio
|
||||
16
src/core/hle/service/audio/audctl.h
Normal file
16
src/core/hle/service/audio/audctl.h
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
class AudCtl final : public ServiceFramework<AudCtl> {
|
||||
public:
|
||||
explicit AudCtl();
|
||||
};
|
||||
|
||||
} // namespace Service::Audio
|
||||
20
src/core/hle/service/audio/auddbg.cpp
Normal file
20
src/core/hle/service/audio/auddbg.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/hle/service/audio/auddbg.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
AudDbg::AudDbg(const char* name) : ServiceFramework{name} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "RequestSuspendForDebug"},
|
||||
{1, nullptr, "RequestResumeForDebug"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
} // namespace Service::Audio
|
||||
16
src/core/hle/service/audio/auddbg.h
Normal file
16
src/core/hle/service/audio/auddbg.h
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
class AudDbg final : public ServiceFramework<AudDbg> {
|
||||
public:
|
||||
explicit AudDbg(const char* name);
|
||||
};
|
||||
|
||||
} // namespace Service::Audio
|
||||
24
src/core/hle/service/audio/audin_a.cpp
Normal file
24
src/core/hle/service/audio/audin_a.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/audio/audin_a.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
AudInA::AudInA() : ServiceFramework{"audin:a"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "RequestSuspendAudioIns"},
|
||||
{1, nullptr, "RequestResumeAudioIns"},
|
||||
{2, nullptr, "GetAudioInsProcessMasterVolume"},
|
||||
{3, nullptr, "SetAudioInsProcessMasterVolume"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
} // namespace Service::Audio
|
||||
16
src/core/hle/service/audio/audin_a.h
Normal file
16
src/core/hle/service/audio/audin_a.h
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
class AudInA final : public ServiceFramework<AudInA> {
|
||||
public:
|
||||
explicit AudInA();
|
||||
};
|
||||
|
||||
} // namespace Service::Audio
|
||||
@@ -2,10 +2,16 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/hle/service/audio/audctl.h"
|
||||
#include "core/hle/service/audio/auddbg.h"
|
||||
#include "core/hle/service/audio/audin_a.h"
|
||||
#include "core/hle/service/audio/audin_u.h"
|
||||
#include "core/hle/service/audio/audio.h"
|
||||
#include "core/hle/service/audio/audout_a.h"
|
||||
#include "core/hle/service/audio/audout_u.h"
|
||||
#include "core/hle/service/audio/audrec_a.h"
|
||||
#include "core/hle/service/audio/audrec_u.h"
|
||||
#include "core/hle/service/audio/audren_a.h"
|
||||
#include "core/hle/service/audio/audren_u.h"
|
||||
#include "core/hle/service/audio/codecctl.h"
|
||||
#include "core/hle/service/audio/hwopus.h"
|
||||
@@ -13,12 +19,22 @@
|
||||
namespace Service::Audio {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
std::make_shared<AudCtl>()->InstallAsService(service_manager);
|
||||
std::make_shared<AudOutA>()->InstallAsService(service_manager);
|
||||
std::make_shared<AudOutU>()->InstallAsService(service_manager);
|
||||
std::make_shared<AudInA>()->InstallAsService(service_manager);
|
||||
std::make_shared<AudInU>()->InstallAsService(service_manager);
|
||||
std::make_shared<AudRecA>()->InstallAsService(service_manager);
|
||||
std::make_shared<AudRecU>()->InstallAsService(service_manager);
|
||||
std::make_shared<AudRenA>()->InstallAsService(service_manager);
|
||||
std::make_shared<AudRenU>()->InstallAsService(service_manager);
|
||||
std::make_shared<CodecCtl>()->InstallAsService(service_manager);
|
||||
std::make_shared<HwOpus>()->InstallAsService(service_manager);
|
||||
|
||||
std::make_shared<AudDbg>("audin:d")->InstallAsService(service_manager);
|
||||
std::make_shared<AudDbg>("audout:d")->InstallAsService(service_manager);
|
||||
std::make_shared<AudDbg>("audrec:d")->InstallAsService(service_manager);
|
||||
std::make_shared<AudDbg>("audren:d")->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
} // namespace Service::Audio
|
||||
|
||||
26
src/core/hle/service/audio/audout_a.cpp
Normal file
26
src/core/hle/service/audio/audout_a.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/audio/audout_a.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
AudOutA::AudOutA() : ServiceFramework{"audout:a"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "RequestSuspendAudioOuts"},
|
||||
{1, nullptr, "RequestResumeAudioOuts"},
|
||||
{2, nullptr, "GetAudioOutsProcessMasterVolume"},
|
||||
{3, nullptr, "SetAudioOutsProcessMasterVolume"},
|
||||
{4, nullptr, "GetAudioOutsProcessRecordVolume"},
|
||||
{5, nullptr, "SetAudioOutsProcessRecordVolume"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
} // namespace Service::Audio
|
||||
16
src/core/hle/service/audio/audout_a.h
Normal file
16
src/core/hle/service/audio/audout_a.h
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
class AudOutA final : public ServiceFramework<AudOutA> {
|
||||
public:
|
||||
explicit AudOutA();
|
||||
};
|
||||
|
||||
} // namespace Service::Audio
|
||||
@@ -194,7 +194,7 @@ void AudOutU::OpenAudioOutImpl(Kernel::HLERequestContext& ctx) {
|
||||
// TODO(bunnei): Support more than one IAudioOut interface. When we add this, ListAudioOutsImpl
|
||||
// will likely need to be updated as well.
|
||||
ASSERT_MSG(!audio_out_interface, "Unimplemented");
|
||||
audio_out_interface = std::make_shared<IAudioOut>(std::move(params), *audio_core);
|
||||
audio_out_interface = std::make_shared<IAudioOut>(params, *audio_core);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 6, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
|
||||
22
src/core/hle/service/audio/audrec_a.cpp
Normal file
22
src/core/hle/service/audio/audrec_a.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/audio/audrec_a.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
AudRecA::AudRecA() : ServiceFramework{"audrec:a"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "RequestSuspendFinalOutputRecorders"},
|
||||
{1, nullptr, "RequestResumeFinalOutputRecorders"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
} // namespace Service::Audio
|
||||
16
src/core/hle/service/audio/audrec_a.h
Normal file
16
src/core/hle/service/audio/audrec_a.h
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
class AudRecA final : public ServiceFramework<AudRecA> {
|
||||
public:
|
||||
explicit AudRecA();
|
||||
};
|
||||
|
||||
} // namespace Service::Audio
|
||||
28
src/core/hle/service/audio/audren_a.cpp
Normal file
28
src/core/hle/service/audio/audren_a.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/audio/audren_a.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
AudRenA::AudRenA() : ServiceFramework{"audren:a"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "RequestSuspendAudioRenderers"},
|
||||
{1, nullptr, "RequestResumeAudioRenderers"},
|
||||
{2, nullptr, "GetAudioRenderersProcessMasterVolume"},
|
||||
{3, nullptr, "SetAudioRenderersProcessMasterVolume"},
|
||||
{4, nullptr, "RegisterAppletResourceUserId"},
|
||||
{5, nullptr, "UnregisterAppletResourceUserId"},
|
||||
{6, nullptr, "GetAudioRenderersProcessRecordVolume"},
|
||||
{7, nullptr, "SetAudioRenderersProcessRecordVolume"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
} // namespace Service::Audio
|
||||
16
src/core/hle/service/audio/audren_a.h
Normal file
16
src/core/hle/service/audio/audren_a.h
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
class AudRenA final : public ServiceFramework<AudRenA> {
|
||||
public:
|
||||
explicit AudRenA();
|
||||
};
|
||||
|
||||
} // namespace Service::Audio
|
||||
75
src/core/hle/service/fgm/fgm.cpp
Normal file
75
src/core/hle/service/fgm/fgm.cpp
Normal file
@@ -0,0 +1,75 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/hle_ipc.h"
|
||||
#include "core/hle/service/fgm/fgm.h"
|
||||
#include "core/hle/service/service.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
|
||||
namespace Service::FGM {
|
||||
|
||||
class IRequest final : public ServiceFramework<IRequest> {
|
||||
public:
|
||||
explicit IRequest() : ServiceFramework{"IRequest"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "Initialize"},
|
||||
{1, nullptr, "Set"},
|
||||
{2, nullptr, "Get"},
|
||||
{3, nullptr, "Cancel"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
};
|
||||
|
||||
class FGM final : public ServiceFramework<FGM> {
|
||||
public:
|
||||
explicit FGM(const char* name) : ServiceFramework{name} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &FGM::Initialize, "Initialize"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
private:
|
||||
void Initialize(Kernel::HLERequestContext& ctx) {
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IRequest>();
|
||||
|
||||
LOG_DEBUG(Service_FGM, "called");
|
||||
}
|
||||
};
|
||||
|
||||
class FGM_DBG final : public ServiceFramework<FGM_DBG> {
|
||||
public:
|
||||
explicit FGM_DBG() : ServiceFramework{"fgm:dbg"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "Initialize"},
|
||||
{1, nullptr, "Read"},
|
||||
{2, nullptr, "Cancel"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& sm) {
|
||||
std::make_shared<FGM>("fgm")->InstallAsService(sm);
|
||||
std::make_shared<FGM>("fgm:0")->InstallAsService(sm);
|
||||
std::make_shared<FGM>("fgm:9")->InstallAsService(sm);
|
||||
std::make_shared<FGM_DBG>()->InstallAsService(sm);
|
||||
}
|
||||
|
||||
} // namespace Service::FGM
|
||||
15
src/core/hle/service/fgm/fgm.h
Normal file
15
src/core/hle/service/fgm/fgm.h
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Service::SM {
|
||||
class ServiceManager;
|
||||
}
|
||||
|
||||
namespace Service::FGM {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& sm);
|
||||
|
||||
} // namespace Service::FGM
|
||||
@@ -97,7 +97,9 @@ u32 nvhost_ctrl_gpu::GetTPCMasks(const std::vector<u8>& input, std::vector<u8>&
|
||||
u32 nvhost_ctrl_gpu::GetActiveSlotMask(const std::vector<u8>& input, std::vector<u8>& output) {
|
||||
LOG_DEBUG(Service_NVDRV, "called");
|
||||
IoctlActiveSlotMask params{};
|
||||
std::memcpy(¶ms, input.data(), input.size());
|
||||
if (input.size() > 0) {
|
||||
std::memcpy(¶ms, input.data(), input.size());
|
||||
}
|
||||
params.slot = 0x07;
|
||||
params.mask = 0x01;
|
||||
std::memcpy(output.data(), ¶ms, output.size());
|
||||
@@ -107,7 +109,9 @@ u32 nvhost_ctrl_gpu::GetActiveSlotMask(const std::vector<u8>& input, std::vector
|
||||
u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u8>& output) {
|
||||
LOG_DEBUG(Service_NVDRV, "called");
|
||||
IoctlZcullGetCtxSize params{};
|
||||
std::memcpy(¶ms, input.data(), input.size());
|
||||
if (input.size() > 0) {
|
||||
std::memcpy(¶ms, input.data(), input.size());
|
||||
}
|
||||
params.size = 0x1;
|
||||
std::memcpy(output.data(), ¶ms, output.size());
|
||||
return 0;
|
||||
@@ -116,7 +120,11 @@ u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u
|
||||
u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output) {
|
||||
LOG_DEBUG(Service_NVDRV, "called");
|
||||
IoctlNvgpuGpuZcullGetInfoArgs params{};
|
||||
std::memcpy(¶ms, input.data(), input.size());
|
||||
|
||||
if (input.size() > 0) {
|
||||
std::memcpy(¶ms, input.data(), input.size());
|
||||
}
|
||||
|
||||
params.width_align_pixels = 0x20;
|
||||
params.height_align_pixels = 0x20;
|
||||
params.pixel_squares_by_aliquots = 0x400;
|
||||
|
||||
@@ -132,9 +132,12 @@ u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& outp
|
||||
LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}",
|
||||
params.address, params.num_entries, params.flags);
|
||||
|
||||
auto entries = std::vector<IoctlGpfifoEntry>();
|
||||
entries.resize(params.num_entries);
|
||||
std::memcpy(&entries[0], &input.data()[sizeof(IoctlSubmitGpfifo)],
|
||||
ASSERT_MSG(input.size() ==
|
||||
sizeof(IoctlSubmitGpfifo) + params.num_entries * sizeof(IoctlGpfifoEntry),
|
||||
"Incorrect input size");
|
||||
|
||||
std::vector<IoctlGpfifoEntry> entries(params.num_entries);
|
||||
std::memcpy(entries.data(), &input[sizeof(IoctlSubmitGpfifo)],
|
||||
params.num_entries * sizeof(IoctlGpfifoEntry));
|
||||
for (auto entry : entries) {
|
||||
Tegra::GPUVAddr va_addr = entry.Address();
|
||||
|
||||
64
src/core/hle/service/pcie/pcie.cpp
Normal file
64
src/core/hle/service/pcie/pcie.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "core/hle/service/pcie/pcie.h"
|
||||
#include "core/hle/service/service.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
|
||||
namespace Service::PCIe {
|
||||
|
||||
class ISession final : public ServiceFramework<ISession> {
|
||||
public:
|
||||
explicit ISession() : ServiceFramework{"ISession"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "QueryFunctions"},
|
||||
{1, nullptr, "AcquireFunction"},
|
||||
{2, nullptr, "ReleaseFunction"},
|
||||
{3, nullptr, "GetFunctionState"},
|
||||
{4, nullptr, "GetBarProfile"},
|
||||
{5, nullptr, "ReadConfig"},
|
||||
{6, nullptr, "WriteConfig"},
|
||||
{7, nullptr, "ReadBarRegion"},
|
||||
{8, nullptr, "WriteBarRegion"},
|
||||
{9, nullptr, "FindCapability"},
|
||||
{10, nullptr, "FindExtendedCapability"},
|
||||
{11, nullptr, "MapDma"},
|
||||
{12, nullptr, "UnmapDma"},
|
||||
{13, nullptr, "UnmapDmaBusAddress"},
|
||||
{14, nullptr, "GetDmaBusAddress"},
|
||||
{15, nullptr, "GetDmaBusAddressRange"},
|
||||
{16, nullptr, "SetDmaEnable"},
|
||||
{17, nullptr, "AcquireIrq"},
|
||||
{18, nullptr, "ReleaseIrq"},
|
||||
{19, nullptr, "SetIrqEnable"},
|
||||
{20, nullptr, "SetAspmEnable"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
};
|
||||
|
||||
class PCIe final : public ServiceFramework<PCIe> {
|
||||
public:
|
||||
explicit PCIe() : ServiceFramework{"pcie"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "RegisterClassDriver"},
|
||||
{1, nullptr, "QueryFunctionsUnregistered"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& sm) {
|
||||
std::make_shared<PCIe>()->InstallAsService(sm);
|
||||
}
|
||||
|
||||
} // namespace Service::PCIe
|
||||
15
src/core/hle/service/pcie/pcie.h
Normal file
15
src/core/hle/service/pcie/pcie.h
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Service::SM {
|
||||
class ServiceManager;
|
||||
}
|
||||
|
||||
namespace Service::PCIe {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& sm);
|
||||
|
||||
} // namespace Service::PCIe
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "core/hle/service/es/es.h"
|
||||
#include "core/hle/service/eupld/eupld.h"
|
||||
#include "core/hle/service/fatal/fatal.h"
|
||||
#include "core/hle/service/fgm/fgm.h"
|
||||
#include "core/hle/service/filesystem/filesystem.h"
|
||||
#include "core/hle/service/friend/friend.h"
|
||||
#include "core/hle/service/grc/grc.h"
|
||||
@@ -44,6 +45,7 @@
|
||||
#include "core/hle/service/nim/nim.h"
|
||||
#include "core/hle/service/ns/ns.h"
|
||||
#include "core/hle/service/nvdrv/nvdrv.h"
|
||||
#include "core/hle/service/pcie/pcie.h"
|
||||
#include "core/hle/service/pctl/pctl.h"
|
||||
#include "core/hle/service/pm/pm.h"
|
||||
#include "core/hle/service/prepo/prepo.h"
|
||||
@@ -208,6 +210,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
|
||||
ES::InstallInterfaces(*sm);
|
||||
EUPLD::InstallInterfaces(*sm);
|
||||
Fatal::InstallInterfaces(*sm);
|
||||
FGM::InstallInterfaces(*sm);
|
||||
FileSystem::InstallInterfaces(*sm);
|
||||
Friend::InstallInterfaces(*sm);
|
||||
GRC::InstallInterfaces(*sm);
|
||||
@@ -225,6 +228,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
|
||||
NIM::InstallInterfaces(*sm);
|
||||
NS::InstallInterfaces(*sm);
|
||||
Nvidia::InstallInterfaces(*sm);
|
||||
PCIe::InstallInterfaces(*sm);
|
||||
PCTL::InstallInterfaces(*sm);
|
||||
PlayReport::InstallInterfaces(*sm);
|
||||
PM::InstallInterfaces(*sm);
|
||||
|
||||
@@ -5,10 +5,9 @@
|
||||
#include "core/gdbstub/gdbstub.h"
|
||||
#include "core/hle/service/hid/hid.h"
|
||||
#include "core/settings.h"
|
||||
#include "video_core/renderer_base.h"
|
||||
#include "video_core/video_core.h"
|
||||
|
||||
#include "core/frontend/emu_window.h"
|
||||
|
||||
namespace Settings {
|
||||
|
||||
Values values = {};
|
||||
@@ -20,9 +19,8 @@ void Apply() {
|
||||
|
||||
VideoCore::g_toggle_framelimit_enabled = values.toggle_framelimit;
|
||||
|
||||
if (VideoCore::g_emu_window) {
|
||||
auto layout = VideoCore::g_emu_window->GetFramebufferLayout();
|
||||
VideoCore::g_emu_window->UpdateCurrentFramebufferLayout(layout.width, layout.height);
|
||||
if (VideoCore::g_renderer) {
|
||||
VideoCore::g_renderer->UpdateCurrentFramebufferLayout();
|
||||
}
|
||||
|
||||
Service::HID::ReloadInputDevices();
|
||||
|
||||
@@ -137,6 +137,11 @@ struct Values {
|
||||
|
||||
std::string log_filter;
|
||||
|
||||
// Audio
|
||||
std::string sink_id;
|
||||
std::string audio_device_id;
|
||||
float volume;
|
||||
|
||||
// Debugging
|
||||
bool use_gdbstub;
|
||||
u16 gdbstub_port;
|
||||
|
||||
@@ -40,6 +40,7 @@ u32 RenderTargetBytesPerPixel(RenderTargetFormat format) {
|
||||
case RenderTargetFormat::RGBA8_UNORM:
|
||||
case RenderTargetFormat::RGB10_A2_UNORM:
|
||||
case RenderTargetFormat::BGRA8_UNORM:
|
||||
case RenderTargetFormat::R32_FLOAT:
|
||||
return 4;
|
||||
default:
|
||||
UNIMPLEMENTED_MSG("Unimplemented render target format {}", static_cast<u32>(format));
|
||||
|
||||
@@ -29,6 +29,7 @@ enum class RenderTargetFormat : u32 {
|
||||
RG16_UINT = 0xDD,
|
||||
RG16_FLOAT = 0xDE,
|
||||
R11G11B10_FLOAT = 0xE0,
|
||||
R32_FLOAT = 0xE5,
|
||||
R16_FLOAT = 0xF2,
|
||||
R8_UNORM = 0xF3,
|
||||
};
|
||||
|
||||
@@ -102,11 +102,11 @@ bool MacroInterpreter::Step(const std::vector<u32>& code, bool is_delay_slot) {
|
||||
if (taken) {
|
||||
// Ignore the delay slot if the branch has the annul bit.
|
||||
if (opcode.branch_annul) {
|
||||
pc = base_address + (opcode.immediate << 2);
|
||||
pc = base_address + opcode.GetBranchTarget();
|
||||
return true;
|
||||
}
|
||||
|
||||
delayed_pc = base_address + (opcode.immediate << 2);
|
||||
delayed_pc = base_address + opcode.GetBranchTarget();
|
||||
// Execute one more instruction due to the delay slot.
|
||||
return Step(code, true);
|
||||
}
|
||||
|
||||
@@ -91,6 +91,10 @@ private:
|
||||
u32 GetBitfieldMask() const {
|
||||
return (1 << bf_size) - 1;
|
||||
}
|
||||
|
||||
s32 GetBranchTarget() const {
|
||||
return static_cast<s32>(immediate * sizeof(u32));
|
||||
}
|
||||
};
|
||||
|
||||
union MethodAddress {
|
||||
|
||||
@@ -2,14 +2,22 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include "core/frontend/emu_window.h"
|
||||
#include "video_core/renderer_base.h"
|
||||
#include "video_core/renderer_opengl/gl_rasterizer.h"
|
||||
#include "video_core/video_core.h"
|
||||
|
||||
RendererBase::RendererBase(EmuWindow& window) : render_window{window} {}
|
||||
RendererBase::~RendererBase() = default;
|
||||
|
||||
void RendererBase::UpdateCurrentFramebufferLayout() {
|
||||
const Layout::FramebufferLayout& layout = render_window.GetFramebufferLayout();
|
||||
|
||||
render_window.UpdateCurrentFramebufferLayout(layout.width, layout.height);
|
||||
}
|
||||
|
||||
void RendererBase::RefreshRasterizerSetting() {
|
||||
if (rasterizer == nullptr) {
|
||||
rasterizer = std::make_unique<RasterizerOpenGL>();
|
||||
rasterizer = std::make_unique<RasterizerOpenGL>(render_window);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,23 +18,21 @@ public:
|
||||
/// Used to reference a framebuffer
|
||||
enum kFramebuffer { kFramebuffer_VirtualXFB = 0, kFramebuffer_EFB, kFramebuffer_Texture };
|
||||
|
||||
virtual ~RendererBase() {}
|
||||
explicit RendererBase(EmuWindow& window);
|
||||
virtual ~RendererBase();
|
||||
|
||||
/// Swap buffers (render frame)
|
||||
virtual void SwapBuffers(boost::optional<const Tegra::FramebufferConfig&> framebuffer) = 0;
|
||||
|
||||
/**
|
||||
* Set the emulator window to use for renderer
|
||||
* @param window EmuWindow handle to emulator window to use for rendering
|
||||
*/
|
||||
virtual void SetWindow(EmuWindow* window) = 0;
|
||||
|
||||
/// Initialize the renderer
|
||||
virtual bool Init() = 0;
|
||||
|
||||
/// Shutdown the renderer
|
||||
virtual void ShutDown() = 0;
|
||||
|
||||
/// Updates the framebuffer layout of the contained render window handle.
|
||||
void UpdateCurrentFramebufferLayout();
|
||||
|
||||
// Getter/setter functions:
|
||||
// ------------------------
|
||||
|
||||
@@ -53,9 +51,8 @@ public:
|
||||
void RefreshRasterizerSetting();
|
||||
|
||||
protected:
|
||||
EmuWindow& render_window; ///< Reference to the render window handle.
|
||||
std::unique_ptr<VideoCore::RasterizerInterface> rasterizer;
|
||||
f32 m_current_fps = 0.0f; ///< Current framerate, should be set by the renderer
|
||||
int m_current_frame = 0; ///< Current frame, should be set by the renderer
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "common/logging/log.h"
|
||||
#include "common/math_util.h"
|
||||
#include "common/microprofile.h"
|
||||
#include "common/scope_exit.h"
|
||||
#include "core/core.h"
|
||||
#include "core/frontend/emu_window.h"
|
||||
#include "core/hle/kernel/process.h"
|
||||
@@ -37,7 +36,7 @@ MICROPROFILE_DEFINE(OpenGL_Drawing, "OpenGL", "Drawing", MP_RGB(128, 128, 192));
|
||||
MICROPROFILE_DEFINE(OpenGL_Blits, "OpenGL", "Blits", MP_RGB(100, 100, 255));
|
||||
MICROPROFILE_DEFINE(OpenGL_CacheManagement, "OpenGL", "Cache Mgmt", MP_RGB(100, 255, 100));
|
||||
|
||||
RasterizerOpenGL::RasterizerOpenGL() {
|
||||
RasterizerOpenGL::RasterizerOpenGL(EmuWindow& window) : emu_window{window} {
|
||||
// Create sampler objects
|
||||
for (size_t i = 0; i < texture_samplers.size(); ++i) {
|
||||
texture_samplers[i].Create();
|
||||
@@ -395,7 +394,7 @@ void RasterizerOpenGL::Clear() {
|
||||
if (clear_mask == 0)
|
||||
return;
|
||||
|
||||
ScopeAcquireGLContext acquire_context;
|
||||
ScopeAcquireGLContext acquire_context{emu_window};
|
||||
|
||||
auto [dirty_color_surface, dirty_depth_surface] =
|
||||
ConfigureFramebuffers(use_color_fb, use_depth_fb);
|
||||
@@ -425,7 +424,7 @@ void RasterizerOpenGL::DrawArrays() {
|
||||
MICROPROFILE_SCOPE(OpenGL_Drawing);
|
||||
const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
|
||||
|
||||
ScopeAcquireGLContext acquire_context;
|
||||
ScopeAcquireGLContext acquire_context{emu_window};
|
||||
|
||||
auto [dirty_color_surface, dirty_depth_surface] =
|
||||
ConfigureFramebuffers(true, regs.zeta.Address() != 0 && regs.zeta_enable != 0);
|
||||
|
||||
@@ -21,11 +21,12 @@
|
||||
#include "video_core/renderer_opengl/gl_state.h"
|
||||
#include "video_core/renderer_opengl/gl_stream_buffer.h"
|
||||
|
||||
class EmuWindow;
|
||||
struct ScreenInfo;
|
||||
|
||||
class RasterizerOpenGL : public VideoCore::RasterizerInterface {
|
||||
public:
|
||||
RasterizerOpenGL();
|
||||
explicit RasterizerOpenGL(EmuWindow& renderer);
|
||||
~RasterizerOpenGL() override;
|
||||
|
||||
void DrawArrays() override;
|
||||
@@ -144,6 +145,8 @@ private:
|
||||
|
||||
RasterizerCacheOpenGL res_cache;
|
||||
|
||||
EmuWindow& emu_window;
|
||||
|
||||
std::unique_ptr<GLShader::ProgramManager> shader_program_manager;
|
||||
OGLVertexArray sw_vao;
|
||||
OGLVertexArray hw_vao;
|
||||
|
||||
@@ -232,6 +232,8 @@ struct SurfaceParams {
|
||||
return PixelFormat::RG16S;
|
||||
case Tegra::RenderTargetFormat::R16_FLOAT:
|
||||
return PixelFormat::R16F;
|
||||
case Tegra::RenderTargetFormat::R32_FLOAT:
|
||||
return PixelFormat::R32F;
|
||||
default:
|
||||
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
||||
UNREACHABLE();
|
||||
@@ -439,6 +441,7 @@ struct SurfaceParams {
|
||||
case Tegra::RenderTargetFormat::RG32_FLOAT:
|
||||
case Tegra::RenderTargetFormat::RG16_FLOAT:
|
||||
case Tegra::RenderTargetFormat::R16_FLOAT:
|
||||
case Tegra::RenderTargetFormat::R32_FLOAT:
|
||||
return ComponentType::Float;
|
||||
case Tegra::RenderTargetFormat::RGBA32_UINT:
|
||||
case Tegra::RenderTargetFormat::RG16_UINT:
|
||||
|
||||
@@ -92,23 +92,23 @@ static std::array<GLfloat, 3 * 2> MakeOrthographicMatrix(const float width, cons
|
||||
return matrix;
|
||||
}
|
||||
|
||||
ScopeAcquireGLContext::ScopeAcquireGLContext() {
|
||||
ScopeAcquireGLContext::ScopeAcquireGLContext(EmuWindow& emu_window_) : emu_window{emu_window_} {
|
||||
if (Settings::values.use_multi_core) {
|
||||
VideoCore::g_emu_window->MakeCurrent();
|
||||
emu_window.MakeCurrent();
|
||||
}
|
||||
}
|
||||
ScopeAcquireGLContext::~ScopeAcquireGLContext() {
|
||||
if (Settings::values.use_multi_core) {
|
||||
VideoCore::g_emu_window->DoneCurrent();
|
||||
emu_window.DoneCurrent();
|
||||
}
|
||||
}
|
||||
|
||||
RendererOpenGL::RendererOpenGL() = default;
|
||||
RendererOpenGL::RendererOpenGL(EmuWindow& window) : RendererBase{window} {}
|
||||
RendererOpenGL::~RendererOpenGL() = default;
|
||||
|
||||
/// Swap buffers (render frame)
|
||||
void RendererOpenGL::SwapBuffers(boost::optional<const Tegra::FramebufferConfig&> framebuffer) {
|
||||
ScopeAcquireGLContext acquire_context;
|
||||
ScopeAcquireGLContext acquire_context{render_window};
|
||||
|
||||
Core::System::GetInstance().perf_stats.EndSystemFrame();
|
||||
|
||||
@@ -130,10 +130,10 @@ void RendererOpenGL::SwapBuffers(boost::optional<const Tegra::FramebufferConfig&
|
||||
// Load the framebuffer from memory, draw it to the screen, and swap buffers
|
||||
LoadFBToScreenInfo(*framebuffer, screen_info);
|
||||
DrawScreen();
|
||||
render_window->SwapBuffers();
|
||||
render_window.SwapBuffers();
|
||||
}
|
||||
|
||||
render_window->PollEvents();
|
||||
render_window.PollEvents();
|
||||
|
||||
Core::System::GetInstance().frame_limiter.DoFrameLimiting(CoreTiming::GetGlobalTimeUs());
|
||||
Core::System::GetInstance().perf_stats.BeginSystemFrame();
|
||||
@@ -356,7 +356,7 @@ void RendererOpenGL::DrawScreenTriangles(const ScreenInfo& screen_info, float x,
|
||||
* Draws the emulated screens to the emulator window.
|
||||
*/
|
||||
void RendererOpenGL::DrawScreen() {
|
||||
const auto& layout = render_window->GetFramebufferLayout();
|
||||
const auto& layout = render_window.GetFramebufferLayout();
|
||||
const auto& screen = layout.screen;
|
||||
|
||||
glViewport(0, 0, layout.width, layout.height);
|
||||
@@ -380,14 +380,6 @@ void RendererOpenGL::DrawScreen() {
|
||||
/// Updates the framerate
|
||||
void RendererOpenGL::UpdateFramerate() {}
|
||||
|
||||
/**
|
||||
* Set the emulator window to use for renderer
|
||||
* @param window EmuWindow handle to emulator window to use for rendering
|
||||
*/
|
||||
void RendererOpenGL::SetWindow(EmuWindow* window) {
|
||||
render_window = window;
|
||||
}
|
||||
|
||||
static const char* GetSource(GLenum source) {
|
||||
#define RET(s) \
|
||||
case GL_DEBUG_SOURCE_##s: \
|
||||
@@ -445,7 +437,7 @@ static void APIENTRY DebugHandler(GLenum source, GLenum type, GLuint id, GLenum
|
||||
|
||||
/// Initialize the renderer
|
||||
bool RendererOpenGL::Init() {
|
||||
ScopeAcquireGLContext acquire_context;
|
||||
ScopeAcquireGLContext acquire_context{render_window};
|
||||
|
||||
if (GLAD_GL_KHR_debug) {
|
||||
glEnable(GL_DEBUG_OUTPUT);
|
||||
|
||||
@@ -34,24 +34,21 @@ struct ScreenInfo {
|
||||
/// Helper class to acquire/release OpenGL context within a given scope
|
||||
class ScopeAcquireGLContext : NonCopyable {
|
||||
public:
|
||||
ScopeAcquireGLContext();
|
||||
explicit ScopeAcquireGLContext(EmuWindow& window);
|
||||
~ScopeAcquireGLContext();
|
||||
|
||||
private:
|
||||
EmuWindow& emu_window;
|
||||
};
|
||||
|
||||
class RendererOpenGL : public RendererBase {
|
||||
public:
|
||||
RendererOpenGL();
|
||||
explicit RendererOpenGL(EmuWindow& window);
|
||||
~RendererOpenGL() override;
|
||||
|
||||
/// Swap buffers (render frame)
|
||||
void SwapBuffers(boost::optional<const Tegra::FramebufferConfig&> framebuffer) override;
|
||||
|
||||
/**
|
||||
* Set the emulator window to use for renderer
|
||||
* @param window EmuWindow handle to emulator window to use for rendering
|
||||
*/
|
||||
void SetWindow(EmuWindow* window) override;
|
||||
|
||||
/// Initialize the renderer
|
||||
bool Init() override;
|
||||
|
||||
@@ -72,8 +69,6 @@ private:
|
||||
void LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, u8 color_a,
|
||||
const TextureInfo& texture);
|
||||
|
||||
EmuWindow* render_window; ///< Handle to render window
|
||||
|
||||
OpenGLState state;
|
||||
|
||||
// OpenGL object IDs
|
||||
|
||||
@@ -13,16 +13,13 @@
|
||||
|
||||
namespace VideoCore {
|
||||
|
||||
EmuWindow* g_emu_window = nullptr; ///< Frontend emulator window
|
||||
std::unique_ptr<RendererBase> g_renderer; ///< Renderer plugin
|
||||
|
||||
std::atomic<bool> g_toggle_framelimit_enabled;
|
||||
|
||||
/// Initialize the video core
|
||||
bool Init(EmuWindow* emu_window) {
|
||||
g_emu_window = emu_window;
|
||||
g_renderer = std::make_unique<RendererOpenGL>();
|
||||
g_renderer->SetWindow(g_emu_window);
|
||||
bool Init(EmuWindow& emu_window) {
|
||||
g_renderer = std::make_unique<RendererOpenGL>(emu_window);
|
||||
if (g_renderer->Init()) {
|
||||
LOG_DEBUG(Render, "initialized OK");
|
||||
} else {
|
||||
|
||||
@@ -18,7 +18,6 @@ namespace VideoCore {
|
||||
enum class Renderer { Software, OpenGL };
|
||||
|
||||
extern std::unique_ptr<RendererBase> g_renderer; ///< Renderer plugin
|
||||
extern EmuWindow* g_emu_window; ///< Emu window
|
||||
|
||||
// TODO: Wrap these in a user settings struct along with any other graphics settings (often set from
|
||||
// qt ui)
|
||||
@@ -28,7 +27,7 @@ extern std::atomic<bool> g_toggle_framelimit_enabled;
|
||||
void Start();
|
||||
|
||||
/// Initialize the video core
|
||||
bool Init(EmuWindow* emu_window);
|
||||
bool Init(EmuWindow& emu_window);
|
||||
|
||||
/// Shutdown the video core
|
||||
void Shutdown();
|
||||
|
||||
@@ -11,6 +11,8 @@ add_executable(yuzu
|
||||
bootmanager.h
|
||||
configuration/config.cpp
|
||||
configuration/config.h
|
||||
configuration/configure_audio.cpp
|
||||
configuration/configure_audio.h
|
||||
configuration/configure_debug.cpp
|
||||
configuration/configure_debug.h
|
||||
configuration/configure_dialog.cpp
|
||||
@@ -55,6 +57,7 @@ add_executable(yuzu
|
||||
set(UIS
|
||||
aboutdialog.ui
|
||||
configuration/configure.ui
|
||||
configuration/configure_audio.ui
|
||||
configuration/configure_debug.ui
|
||||
configuration/configure_general.ui
|
||||
configuration/configure_graphics.ui
|
||||
|
||||
@@ -92,6 +92,13 @@ void Config::ReadValues() {
|
||||
Settings::values.bg_blue = qt_config->value("bg_blue", 0.0).toFloat();
|
||||
qt_config->endGroup();
|
||||
|
||||
qt_config->beginGroup("Audio");
|
||||
Settings::values.sink_id = qt_config->value("output_engine", "auto").toString().toStdString();
|
||||
Settings::values.audio_device_id =
|
||||
qt_config->value("output_device", "auto").toString().toStdString();
|
||||
Settings::values.volume = qt_config->value("volume", 1).toFloat();
|
||||
qt_config->endGroup();
|
||||
|
||||
qt_config->beginGroup("Data Storage");
|
||||
Settings::values.use_virtual_sd = qt_config->value("use_virtual_sd", true).toBool();
|
||||
qt_config->endGroup();
|
||||
@@ -195,6 +202,12 @@ void Config::SaveValues() {
|
||||
qt_config->setValue("bg_blue", (double)Settings::values.bg_blue);
|
||||
qt_config->endGroup();
|
||||
|
||||
qt_config->beginGroup("Audio");
|
||||
qt_config->setValue("output_engine", QString::fromStdString(Settings::values.sink_id));
|
||||
qt_config->setValue("output_device", QString::fromStdString(Settings::values.audio_device_id));
|
||||
qt_config->setValue("volume", Settings::values.volume);
|
||||
qt_config->endGroup();
|
||||
|
||||
qt_config->beginGroup("Data Storage");
|
||||
qt_config->setValue("use_virtual_sd", Settings::values.use_virtual_sd);
|
||||
qt_config->endGroup();
|
||||
|
||||
@@ -34,11 +34,16 @@
|
||||
<string>Input</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureGraphics" name="graphicsTab">
|
||||
<attribute name="title">
|
||||
<string>Graphics</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureGraphics" name="graphicsTab">
|
||||
<attribute name="title">
|
||||
<string>Graphics</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureAudio" name="audioTab">
|
||||
<attribute name="title">
|
||||
<string>Audio</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureDebug" name="debugTab">
|
||||
<attribute name="title">
|
||||
<string>Debug</string>
|
||||
@@ -68,6 +73,12 @@
|
||||
<header>configuration/configure_system.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureAudio</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_audio.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureDebug</class>
|
||||
<extends>QWidget</extends>
|
||||
|
||||
90
src/yuzu/configuration/configure_audio.cpp
Normal file
90
src/yuzu/configuration/configure_audio.cpp
Normal file
@@ -0,0 +1,90 @@
|
||||
// Copyright 2018 yuzu Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "audio_core/sink.h"
|
||||
#include "audio_core/sink_details.h"
|
||||
#include "core/core.h"
|
||||
#include "core/settings.h"
|
||||
#include "ui_configure_audio.h"
|
||||
#include "yuzu/configuration/configure_audio.h"
|
||||
|
||||
ConfigureAudio::ConfigureAudio(QWidget* parent)
|
||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureAudio>()) {
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->output_sink_combo_box->clear();
|
||||
ui->output_sink_combo_box->addItem("auto");
|
||||
for (const auto& sink_detail : AudioCore::g_sink_details) {
|
||||
ui->output_sink_combo_box->addItem(sink_detail.id);
|
||||
}
|
||||
|
||||
connect(ui->volume_slider, &QSlider::valueChanged, [this] {
|
||||
ui->volume_indicator->setText(tr("%1 %").arg(ui->volume_slider->sliderPosition()));
|
||||
});
|
||||
|
||||
this->setConfiguration();
|
||||
connect(ui->output_sink_combo_box,
|
||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||
&ConfigureAudio::updateAudioDevices);
|
||||
|
||||
ui->output_sink_combo_box->setEnabled(!Core::System::GetInstance().IsPoweredOn());
|
||||
ui->audio_device_combo_box->setEnabled(!Core::System::GetInstance().IsPoweredOn());
|
||||
}
|
||||
|
||||
ConfigureAudio::~ConfigureAudio() = default;
|
||||
|
||||
void ConfigureAudio::setConfiguration() {
|
||||
int new_sink_index = 0;
|
||||
for (int index = 0; index < ui->output_sink_combo_box->count(); index++) {
|
||||
if (ui->output_sink_combo_box->itemText(index).toStdString() == Settings::values.sink_id) {
|
||||
new_sink_index = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ui->output_sink_combo_box->setCurrentIndex(new_sink_index);
|
||||
|
||||
// The device list cannot be pre-populated (nor listed) until the output sink is known.
|
||||
updateAudioDevices(new_sink_index);
|
||||
|
||||
int new_device_index = -1;
|
||||
for (int index = 0; index < ui->audio_device_combo_box->count(); index++) {
|
||||
if (ui->audio_device_combo_box->itemText(index).toStdString() ==
|
||||
Settings::values.audio_device_id) {
|
||||
new_device_index = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ui->audio_device_combo_box->setCurrentIndex(new_device_index);
|
||||
|
||||
ui->volume_slider->setValue(Settings::values.volume * ui->volume_slider->maximum());
|
||||
ui->volume_indicator->setText(tr("%1 %").arg(ui->volume_slider->sliderPosition()));
|
||||
}
|
||||
|
||||
void ConfigureAudio::applyConfiguration() {
|
||||
Settings::values.sink_id =
|
||||
ui->output_sink_combo_box->itemText(ui->output_sink_combo_box->currentIndex())
|
||||
.toStdString();
|
||||
Settings::values.audio_device_id =
|
||||
ui->audio_device_combo_box->itemText(ui->audio_device_combo_box->currentIndex())
|
||||
.toStdString();
|
||||
Settings::values.volume =
|
||||
static_cast<float>(ui->volume_slider->sliderPosition()) / ui->volume_slider->maximum();
|
||||
}
|
||||
|
||||
void ConfigureAudio::updateAudioDevices(int sink_index) {
|
||||
ui->audio_device_combo_box->clear();
|
||||
ui->audio_device_combo_box->addItem(AudioCore::auto_device_name);
|
||||
|
||||
std::string sink_id = ui->output_sink_combo_box->itemText(sink_index).toStdString();
|
||||
std::vector<std::string> device_list = AudioCore::GetSinkDetails(sink_id).list_devices();
|
||||
for (const auto& device : device_list) {
|
||||
ui->audio_device_combo_box->addItem(device.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigureAudio::retranslateUi() {
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
31
src/yuzu/configuration/configure_audio.h
Normal file
31
src/yuzu/configuration/configure_audio.h
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright 2018 yuzu Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureAudio;
|
||||
}
|
||||
|
||||
class ConfigureAudio : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureAudio(QWidget* parent = nullptr);
|
||||
~ConfigureAudio();
|
||||
|
||||
void applyConfiguration();
|
||||
void retranslateUi();
|
||||
|
||||
public slots:
|
||||
void updateAudioDevices(int sink_index);
|
||||
|
||||
private:
|
||||
void setConfiguration();
|
||||
|
||||
std::unique_ptr<Ui::ConfigureAudio> ui;
|
||||
};
|
||||
130
src/yuzu/configuration/configure_audio.ui
Normal file
130
src/yuzu/configuration/configure_audio.ui
Normal file
@@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ConfigureAudio</class>
|
||||
<widget class="QWidget" name="ConfigureAudio">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>188</width>
|
||||
<height>246</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Audio</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Output Engine:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="output_sink_combo_box"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Audio Device:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="audio_device_combo_box"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Volume:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="volume_slider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="volume_indicator">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0 %</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>167</width>
|
||||
<height>55</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -21,6 +21,7 @@ void ConfigureDialog::applyConfiguration() {
|
||||
ui->systemTab->applyConfiguration();
|
||||
ui->inputTab->applyConfiguration();
|
||||
ui->graphicsTab->applyConfiguration();
|
||||
ui->audioTab->applyConfiguration();
|
||||
ui->debugTab->applyConfiguration();
|
||||
Settings::Apply();
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ bool GMainWindow::LoadROM(const QString& filename) {
|
||||
|
||||
system.SetGPUDebugContext(debug_context);
|
||||
|
||||
const Core::System::ResultStatus result{system.Load(render_window, filename.toStdString())};
|
||||
const Core::System::ResultStatus result{system.Load(*render_window, filename.toStdString())};
|
||||
|
||||
render_window->DoneCurrent();
|
||||
|
||||
|
||||
@@ -105,6 +105,11 @@ void Config::ReadValues() {
|
||||
Settings::values.bg_green = (float)sdl2_config->GetReal("Renderer", "bg_green", 0.0);
|
||||
Settings::values.bg_blue = (float)sdl2_config->GetReal("Renderer", "bg_blue", 0.0);
|
||||
|
||||
// Audio
|
||||
Settings::values.sink_id = sdl2_config->Get("Audio", "output_engine", "auto");
|
||||
Settings::values.audio_device_id = sdl2_config->Get("Audio", "output_device", "auto");
|
||||
Settings::values.volume = sdl2_config->GetReal("Audio", "volume", 1);
|
||||
|
||||
// Data Storage
|
||||
Settings::values.use_virtual_sd =
|
||||
sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true);
|
||||
|
||||
@@ -143,19 +143,17 @@ swap_screen =
|
||||
|
||||
[Audio]
|
||||
# Which audio output engine to use.
|
||||
# auto (default): Auto-select, null: No audio output, sdl2: SDL2 (if available)
|
||||
# auto (default): Auto-select, null: No audio output, cubeb: Cubeb audio engine (if available)
|
||||
output_engine =
|
||||
|
||||
# Whether or not to enable the audio-stretching post-processing effect.
|
||||
# This effect adjusts audio speed to match emulation speed and helps prevent audio stutter,
|
||||
# at the cost of increasing audio latency.
|
||||
# 0: No, 1 (default): Yes
|
||||
enable_audio_stretching =
|
||||
|
||||
# Which audio device to use.
|
||||
# auto (default): Auto-select
|
||||
output_device =
|
||||
|
||||
# Output volume.
|
||||
# 1.0 (default): 100%, 0.0; mute
|
||||
volume =
|
||||
|
||||
[Data Storage]
|
||||
# Whether to create a virtual SD card.
|
||||
# 1 (default): Yes, 0: No
|
||||
|
||||
@@ -162,7 +162,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
SCOPE_EXIT({ system.Shutdown(); });
|
||||
|
||||
const Core::System::ResultStatus load_result{system.Load(emu_window.get(), filepath)};
|
||||
const Core::System::ResultStatus load_result{system.Load(*emu_window, filepath)};
|
||||
|
||||
switch (load_result) {
|
||||
case Core::System::ResultStatus::ErrorGetLoader:
|
||||
|
||||
Reference in New Issue
Block a user