early-access version 2220

This commit is contained in:
pineappleEA 2021-11-19 12:58:50 +01:00
parent 5ba3e92e3f
commit 056fe9650a
15 changed files with 38 additions and 26 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 2218. This is the source code for early-access 2220.
## Legal Notice ## Legal Notice

View file

@ -300,15 +300,16 @@ struct KernelCore::Impl {
// Gets the dummy KThread for the caller, allocating a new one if this is the first time // Gets the dummy KThread for the caller, allocating a new one if this is the first time
KThread* GetHostDummyThread() { KThread* GetHostDummyThread() {
auto make_thread = [this]() { auto make_thread = [this]() {
std::unique_ptr<KThread> thread = std::make_unique<KThread>(system.Kernel()); std::lock_guard lk(dummy_thread_lock);
auto& thread = dummy_threads.emplace_back(std::make_unique<KThread>(system.Kernel()));
KAutoObject::Create(thread.get()); KAutoObject::Create(thread.get());
ASSERT(KThread::InitializeDummyThread(thread.get()).IsSuccess()); ASSERT(KThread::InitializeDummyThread(thread.get()).IsSuccess());
thread->SetName(fmt::format("DummyThread:{}", GetHostThreadId())); thread->SetName(fmt::format("DummyThread:{}", GetHostThreadId()));
return thread; return thread.get();
}; };
thread_local auto thread = make_thread(); thread_local KThread* saved_thread = make_thread();
return thread.get(); return saved_thread;
} }
/// Registers a CPU core thread by allocating a host thread ID for it /// Registers a CPU core thread by allocating a host thread ID for it
@ -695,6 +696,12 @@ struct KernelCore::Impl {
return port; return port;
} }
std::mutex server_ports_lock;
std::mutex server_sessions_lock;
std::mutex registered_objects_lock;
std::mutex registered_in_use_objects_lock;
std::mutex dummy_thread_lock;
std::atomic<u32> next_object_id{0}; std::atomic<u32> next_object_id{0};
std::atomic<u64> next_kernel_process_id{KProcess::InitialKIPIDMin}; std::atomic<u64> next_kernel_process_id{KProcess::InitialKIPIDMin};
std::atomic<u64> next_user_process_id{KProcess::ProcessIDMin}; std::atomic<u64> next_user_process_id{KProcess::ProcessIDMin};
@ -725,10 +732,6 @@ struct KernelCore::Impl {
std::unordered_set<KServerSession*> server_sessions; std::unordered_set<KServerSession*> server_sessions;
std::unordered_set<KAutoObject*> registered_objects; std::unordered_set<KAutoObject*> registered_objects;
std::unordered_set<KAutoObject*> registered_in_use_objects; std::unordered_set<KAutoObject*> registered_in_use_objects;
std::mutex server_ports_lock;
std::mutex server_sessions_lock;
std::mutex registered_objects_lock;
std::mutex registered_in_use_objects_lock;
std::unique_ptr<Core::ExclusiveMonitor> exclusive_monitor; std::unique_ptr<Core::ExclusiveMonitor> exclusive_monitor;
std::vector<Kernel::PhysicalCore> cores; std::vector<Kernel::PhysicalCore> cores;
@ -753,6 +756,9 @@ struct KernelCore::Impl {
std::array<Core::CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES> interrupts{}; std::array<Core::CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES> interrupts{};
std::array<std::unique_ptr<Kernel::KScheduler>, Core::Hardware::NUM_CPU_CORES> schedulers{}; std::array<std::unique_ptr<Kernel::KScheduler>, Core::Hardware::NUM_CPU_CORES> schedulers{};
// Specifically tracked to be automatically destroyed with kernel
std::vector<std::unique_ptr<KThread>> dummy_threads;
bool is_multicore{}; bool is_multicore{};
bool is_phantom_mode_for_singlecore{}; bool is_phantom_mode_for_singlecore{};
u32 single_core_thread_id{}; u32 single_core_thread_id{};

View file

@ -69,7 +69,7 @@ private:
libusb_device_handle* handle{}; libusb_device_handle* handle{};
}; };
GCAdapter::GCAdapter(const std::string input_engine_) : InputEngine(input_engine_) { GCAdapter::GCAdapter(const std::string& input_engine_) : InputEngine(input_engine_) {
if (usb_adapter_handle) { if (usb_adapter_handle) {
return; return;
} }

View file

@ -24,7 +24,7 @@ class LibUSBDeviceHandle;
class GCAdapter : public InputCommon::InputEngine { class GCAdapter : public InputCommon::InputEngine {
public: public:
explicit GCAdapter(const std::string input_engine_); explicit GCAdapter(const std::string& input_engine_);
~GCAdapter(); ~GCAdapter();
Common::Input::VibrationError SetRumble( Common::Input::VibrationError SetRumble(

View file

@ -24,7 +24,7 @@ constexpr PadIdentifier identifier = {
.pad = 0, .pad = 0,
}; };
Mouse::Mouse(const std::string input_engine_) : InputEngine(input_engine_) { Mouse::Mouse(const std::string& input_engine_) : InputEngine(input_engine_) {
PreSetController(identifier); PreSetController(identifier);
PreSetAxis(identifier, mouse_axis_x); PreSetAxis(identifier, mouse_axis_x);
PreSetAxis(identifier, mouse_axis_y); PreSetAxis(identifier, mouse_axis_y);

View file

@ -29,7 +29,7 @@ enum class MouseButton {
*/ */
class Mouse final : public InputCommon::InputEngine { class Mouse final : public InputCommon::InputEngine {
public: public:
explicit Mouse(const std::string input_engine_); explicit Mouse(const std::string& input_engine_);
/** /**
* Signals that mouse has moved. * Signals that mouse has moved.

View file

@ -929,7 +929,7 @@ std::string SDLDriver::GetHatButtonName(u8 direction_value) const {
} }
} }
u8 SDLDriver::GetHatButtonId(const std::string direction_name) const { u8 SDLDriver::GetHatButtonId(const std::string& direction_name) const {
Uint8 direction; Uint8 direction;
if (direction_name == "up") { if (direction_name == "up") {
direction = SDL_HAT_UP; direction = SDL_HAT_UP;

View file

@ -56,7 +56,7 @@ public:
std::string GetUIName(const Common::ParamPackage& params) const override; std::string GetUIName(const Common::ParamPackage& params) const override;
std::string GetHatButtonName(u8 direction_value) const override; std::string GetHatButtonName(u8 direction_value) const override;
u8 GetHatButtonId(const std::string direction_name) const override; u8 GetHatButtonId(const std::string& direction_name) const override;
Common::Input::VibrationError SetRumble( Common::Input::VibrationError SetRumble(
const PadIdentifier& identifier, const Common::Input::VibrationStatus vibration) override; const PadIdentifier& identifier, const Common::Input::VibrationStatus vibration) override;

View file

@ -47,7 +47,7 @@ constexpr std::array<std::pair<std::string_view, TasButton>, 20> text_to_tas_but
{"KEY_ZR", TasButton::TRIGGER_ZR}, {"KEY_ZR", TasButton::TRIGGER_ZR},
}; };
Tas::Tas(const std::string input_engine_) : InputCommon::InputEngine(input_engine_) { Tas::Tas(const std::string& input_engine_) : InputCommon::InputEngine(input_engine_) {
for (size_t player_index = 0; player_index < PLAYER_NUMBER; player_index++) { for (size_t player_index = 0; player_index < PLAYER_NUMBER; player_index++) {
PadIdentifier identifier{ PadIdentifier identifier{
.guid = Common::UUID{}, .guid = Common::UUID{},

View file

@ -83,7 +83,7 @@ enum class TasState {
class Tas final : public InputCommon::InputEngine { class Tas final : public InputCommon::InputEngine {
public: public:
explicit Tas(const std::string input_engine_); explicit Tas(const std::string& input_engine_);
~Tas(); ~Tas();
/** /**

View file

@ -13,7 +13,7 @@ constexpr PadIdentifier identifier = {
.pad = 0, .pad = 0,
}; };
TouchScreen::TouchScreen(const std::string input_engine_) : InputEngine(input_engine_) { TouchScreen::TouchScreen(const std::string& input_engine_) : InputEngine(input_engine_) {
PreSetController(identifier); PreSetController(identifier);
} }

View file

@ -14,7 +14,7 @@ namespace InputCommon {
*/ */
class TouchScreen final : public InputCommon::InputEngine { class TouchScreen final : public InputCommon::InputEngine {
public: public:
explicit TouchScreen(const std::string input_engine_); explicit TouchScreen(const std::string& input_engine_);
/** /**
* Signals that mouse has moved. * Signals that mouse has moved.

View file

@ -300,8 +300,8 @@ void InputEngine::TriggerOnMotionChange(const PadIdentifier& identifier, int mot
if (!configuring || !mapping_callback.on_data) { if (!configuring || !mapping_callback.on_data) {
return; return;
} }
if (std::abs(value.gyro_x) < 1.0f && std::abs(value.gyro_y) < 1.0f && if (std::abs(value.gyro_x) < 0.6f && std::abs(value.gyro_y) < 0.6f &&
std::abs(value.gyro_z) < 1.0f) { std::abs(value.gyro_z) < 0.6f) {
return; return;
} }
mapping_callback.on_data(MappingData{ mapping_callback.on_data(MappingData{

View file

@ -166,7 +166,7 @@ public:
}; };
/// Retrieves the index number of the given hat button direction /// Retrieves the index number of the given hat button direction
virtual u8 GetHatButtonId([[maybe_unused]] const std::string direction_name) const { virtual u8 GetHatButtonId([[maybe_unused]] const std::string& direction_name) const {
return 0; return 0;
}; };

View file

@ -1335,8 +1335,14 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p
std::make_unique<QtWebBrowser>(*this), // Web Browser std::make_unique<QtWebBrowser>(*this), // Web Browser
}); });
const Core::SystemResultStatus result{ Core::SystemResultStatus result{};
system->Load(*render_window, filename.toStdString(), program_id, program_index)}; auto load_thread = std::jthread(
[this, filename, program_id, program_index](Core::SystemResultStatus& result) {
result =
system->Load(*render_window, filename.toStdString(), program_id, program_index);
},
std::ref(result));
load_thread.join();
const auto drd_callout = (UISettings::values.callout_flags.GetValue() & const auto drd_callout = (UISettings::values.callout_flags.GetValue() &
static_cast<u32>(CalloutFlag::DRDDeprecation)) == 0; static_cast<u32>(CalloutFlag::DRDDeprecation)) == 0;
@ -3306,9 +3312,9 @@ void GMainWindow::OnReinitializeKeys(ReinitializeKeyBehavior behavior) {
if (!errors.isEmpty()) { if (!errors.isEmpty()) {
QMessageBox::warning( QMessageBox::warning(
this, tr("Derivation Components Missing"), this, tr("Derivation Components Missing"),
tr("Components are missing that may hinder key derivation from completing. " tr("Encryption keys are missing. "
"<br>Please follow <a href='https://yuzu-emu.org/help/quickstart/'>the yuzu " "<br>Please follow <a href='https://yuzu-emu.org/help/quickstart/'>the yuzu "
"quickstart guide</a> to get all your keys and " "quickstart guide</a> to get all your keys, firmware and "
"games.<br><br><small>(%1)</small>") "games.<br><br><small>(%1)</small>")
.arg(errors)); .arg(errors));
} }