Merge pull request #11473 from liamwhite/fix-launch-param

am: Implement UserChannel parameters
This commit is contained in:
liamwhite 2023-09-13 09:39:06 -04:00 committed by GitHub
commit 9a0ea90018
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 70 additions and 35 deletions

View file

@ -1705,7 +1705,8 @@ void GMainWindow::AllowOSSleep() {
#endif
}
bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t program_index) {
bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t program_index,
AmLaunchType launch_type) {
// Shutdown previous session if the emu thread is still active...
if (emu_thread != nullptr) {
ShutdownGame();
@ -1717,6 +1718,10 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p
system->SetFilesystem(vfs);
if (launch_type == AmLaunchType::UserInitiated) {
system->GetUserChannel().clear();
}
system->SetAppletFrontendSet({
std::make_unique<QtAmiiboSettings>(*this), // Amiibo Settings
(UISettings::values.controller_applet_disabled.GetValue() == true)
@ -1856,7 +1861,7 @@ void GMainWindow::ConfigureFilesystemProvider(const std::string& filepath) {
}
void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t program_index,
StartGameType type) {
StartGameType type, AmLaunchType launch_type) {
LOG_INFO(Frontend, "yuzu starting...");
StoreRecentFile(filename); // Put the filename on top of the list
@ -1900,7 +1905,7 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
}
}
if (!LoadROM(filename, program_id, program_index)) {
if (!LoadROM(filename, program_id, program_index, launch_type)) {
return;
}
@ -3369,7 +3374,8 @@ void GMainWindow::OnLoadComplete() {
void GMainWindow::OnExecuteProgram(std::size_t program_index) {
ShutdownGame();
BootGame(last_filename_booted, 0, program_index);
BootGame(last_filename_booted, 0, program_index, StartGameType::Normal,
AmLaunchType::ApplicationInitiated);
}
void GMainWindow::OnExit() {