yuzu: Allow to launch album applet from firmware
This commit is contained in:
parent
e37ad99f22
commit
2fa53ec1d9
|
@ -1493,6 +1493,9 @@ ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_)
|
|||
case Applets::AppletId::MiiEdit:
|
||||
PushInShowMiiEditData();
|
||||
break;
|
||||
case Applets::AppletId::PhotoViewer:
|
||||
PushInShowAlbum();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1569,6 +1572,23 @@ void ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo(HLERequestContext&
|
|||
rb.PushRaw(applet_info);
|
||||
}
|
||||
|
||||
void ILibraryAppletSelfAccessor::PushInShowAlbum() {
|
||||
const Applets::CommonArguments arguments{
|
||||
.arguments_version = Applets::CommonArgumentVersion::Version3,
|
||||
.size = Applets::CommonArgumentSize::Version3,
|
||||
.library_version = 1,
|
||||
.theme_color = Applets::ThemeColor::BasicBlack,
|
||||
.play_startup_sound = true,
|
||||
.system_tick = system.CoreTiming().GetClockTicks(),
|
||||
};
|
||||
|
||||
std::vector<u8> argument_data(sizeof(arguments));
|
||||
std::vector<u8> settings_data{2};
|
||||
std::memcpy(argument_data.data(), &arguments, sizeof(arguments));
|
||||
queue_data.emplace_back(std::move(argument_data));
|
||||
queue_data.emplace_back(std::move(settings_data));
|
||||
}
|
||||
|
||||
void ILibraryAppletSelfAccessor::PushInShowCabinetData() {
|
||||
const Applets::CommonArguments arguments{
|
||||
.arguments_version = Applets::CommonArgumentVersion::Version3,
|
||||
|
|
|
@ -327,6 +327,7 @@ private:
|
|||
void ExitProcessAndReturn(HLERequestContext& ctx);
|
||||
void GetCallerAppletIdentityInfo(HLERequestContext& ctx);
|
||||
|
||||
void PushInShowAlbum();
|
||||
void PushInShowCabinetData();
|
||||
void PushInShowMiiEditData();
|
||||
|
||||
|
|
|
@ -1553,6 +1553,7 @@ void GMainWindow::ConnectMenuEvents() {
|
|||
// Tools
|
||||
connect_menu(ui->action_Rederive, std::bind(&GMainWindow::OnReinitializeKeys, this,
|
||||
ReinitializeKeyBehavior::Warning));
|
||||
connect_menu(ui->action_Load_Album, &GMainWindow::OnAlbum);
|
||||
connect_menu(ui->action_Load_Cabinet_Nickname_Owner,
|
||||
[this]() { OnCabinet(Service::NFP::CabinetMode::StartNicknameAndOwnerSettings); });
|
||||
connect_menu(ui->action_Load_Cabinet_Eraser,
|
||||
|
@ -1590,6 +1591,7 @@ void GMainWindow::UpdateMenuState() {
|
|||
};
|
||||
|
||||
const std::array applet_actions{
|
||||
ui->action_Load_Album,
|
||||
ui->action_Load_Cabinet_Nickname_Owner,
|
||||
ui->action_Load_Cabinet_Eraser,
|
||||
ui->action_Load_Cabinet_Restorer,
|
||||
|
@ -4157,6 +4159,29 @@ void GMainWindow::OnToggleStatusBar() {
|
|||
statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked());
|
||||
}
|
||||
|
||||
void GMainWindow::OnAlbum() {
|
||||
constexpr u64 AlbumId = 0x010000000000100Dull;
|
||||
auto bis_system = system->GetFileSystemController().GetSystemNANDContents();
|
||||
if (!bis_system) {
|
||||
QMessageBox::warning(this, tr("No firmware available"),
|
||||
tr("Please install the firmware to use the Album applet."));
|
||||
return;
|
||||
}
|
||||
|
||||
auto album_nca = bis_system->GetEntry(AlbumId, FileSys::ContentRecordType::Program);
|
||||
if (!album_nca) {
|
||||
QMessageBox::warning(this, tr("Album Applet"),
|
||||
tr("Album applet is not available. Please reinstall firmware."));
|
||||
return;
|
||||
}
|
||||
|
||||
system->GetAppletManager().SetCurrentAppletId(Service::AM::Applets::AppletId::PhotoViewer);
|
||||
|
||||
const auto filename = QString::fromStdString(album_nca->GetFullPath());
|
||||
UISettings::values.roms_path = QFileInfo(filename).path();
|
||||
BootGame(filename);
|
||||
}
|
||||
|
||||
void GMainWindow::OnCabinet(Service::NFP::CabinetMode mode) {
|
||||
constexpr u64 CabinetId = 0x0100000000001002ull;
|
||||
auto bis_system = system->GetFileSystemController().GetSystemNANDContents();
|
||||
|
|
|
@ -369,6 +369,7 @@ private slots:
|
|||
void ResetWindowSize720();
|
||||
void ResetWindowSize900();
|
||||
void ResetWindowSize1080();
|
||||
void OnAlbum();
|
||||
void OnCabinet(Service::NFP::CabinetMode mode);
|
||||
void OnMiiEdit();
|
||||
void OnCaptureScreenshot();
|
||||
|
|
|
@ -160,6 +160,7 @@
|
|||
<addaction name="action_Verify_installed_contents"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menu_cabinet_applet"/>
|
||||
<addaction name="action_Load_Album"/>
|
||||
<addaction name="action_Load_Mii_Edit"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_Capture_Screenshot"/>
|
||||
|
@ -380,6 +381,11 @@
|
|||
<string>&Capture Screenshot</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Load_Album">
|
||||
<property name="text">
|
||||
<string>Open &Album</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Load_Cabinet_Nickname_Owner">
|
||||
<property name="text">
|
||||
<string>&Set Nickname and Owner</string>
|
||||
|
|
Loading…
Reference in New Issue