mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2026-03-27 13:50:22 -06:00
core: Fix application jump parameters (#1845)
This commit is contained in:
parent
abc1980418
commit
7d5da9eaeb
@ -1456,6 +1456,8 @@ Result AppletManager::PrepareToStartApplication(u64 title_id, FS::MediaType medi
|
||||
|
||||
capture_buffer_info.reset();
|
||||
|
||||
app_jump_parameters.Invalidate();
|
||||
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
||||
@ -185,12 +185,21 @@ private:
|
||||
using SysMenuArg = std::array<u8, SysMenuArgSize>;
|
||||
|
||||
struct ApplicationJumpParameters {
|
||||
u64 next_title_id;
|
||||
FS::MediaType next_media_type;
|
||||
ApplicationJumpFlags flags;
|
||||
u64 next_title_id = ~0ULL;
|
||||
FS::MediaType next_media_type{};
|
||||
ApplicationJumpFlags flags{};
|
||||
|
||||
u64 current_title_id;
|
||||
FS::MediaType current_media_type;
|
||||
u64 current_title_id = ~0ULL;
|
||||
FS::MediaType current_media_type{};
|
||||
|
||||
bool Valid() const {
|
||||
return next_title_id != ~0ULL && current_title_id != ~0ULL;
|
||||
}
|
||||
|
||||
void Invalidate() {
|
||||
next_title_id = ~0ULL;
|
||||
current_title_id = ~0ULL;
|
||||
}
|
||||
|
||||
private:
|
||||
template <class Archive>
|
||||
|
||||
@ -1251,23 +1251,26 @@ void Module::APTInterface::GetStartupArgument(Kernel::HLERequestContext& ctx) {
|
||||
bool exists = false;
|
||||
|
||||
if (auto arg = apt->applet_manager->ReceiveDeliverArg()) {
|
||||
param = std::move(arg->param);
|
||||
|
||||
// TODO: This is a complete guess based on observations. It is unknown how the OtherMedia
|
||||
// type is handled and how it interacts with the OtherApp type, and it is unknown if
|
||||
// this (checking the jump parameters) is indeed the way the 3DS checks the types.
|
||||
const auto& jump_parameters = apt->applet_manager->GetApplicationJumpParameters();
|
||||
switch (startup_argument_type) {
|
||||
case StartupArgumentType::OtherApp:
|
||||
exists = jump_parameters.current_title_id != jump_parameters.next_title_id &&
|
||||
jump_parameters.current_media_type == jump_parameters.next_media_type;
|
||||
break;
|
||||
case StartupArgumentType::Restart:
|
||||
exists = jump_parameters.current_title_id == jump_parameters.next_title_id;
|
||||
break;
|
||||
case StartupArgumentType::OtherMedia:
|
||||
exists = jump_parameters.current_media_type != jump_parameters.next_media_type;
|
||||
break;
|
||||
|
||||
if (jump_parameters.Valid()) {
|
||||
param = std::move(arg->param);
|
||||
|
||||
switch (startup_argument_type) {
|
||||
case StartupArgumentType::OtherApp:
|
||||
exists = jump_parameters.current_title_id != jump_parameters.next_title_id &&
|
||||
jump_parameters.current_media_type == jump_parameters.next_media_type;
|
||||
break;
|
||||
case StartupArgumentType::Restart:
|
||||
exists = jump_parameters.current_title_id == jump_parameters.next_title_id;
|
||||
break;
|
||||
case StartupArgumentType::OtherMedia:
|
||||
exists = jump_parameters.current_media_type != jump_parameters.next_media_type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user