implements PLN-0145
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
use crate::firmware::firmware_state::{
|
||||
AppCrashesStep, FirmwareState, GameRunningStep, LoadCartridgeStep, ShellRunningStep,
|
||||
AppCrashesStep, FirmwareState, LoadCartridgeStep, ShellRunningStep,
|
||||
};
|
||||
use crate::firmware::prometeu_context::PrometeuContext;
|
||||
use prometeu_hal::InputSignals;
|
||||
use prometeu_hal::app_mode::AppMode;
|
||||
use prometeu_hal::cartridge_loader::CartridgeLoader;
|
||||
use prometeu_hal::log::{LogLevel, LogSource};
|
||||
@@ -41,39 +40,10 @@ impl HubHomeStep {
|
||||
Some(SystemProfileAction::LaunchGame { path }) => match CartridgeLoader::load(&path) {
|
||||
Ok(cartridge) => {
|
||||
if cartridge.app_mode == AppMode::Game
|
||||
&& let Some(task_id) = ctx.os.lifecycle().resident_game_task()
|
||||
&& ctx.os.lifecycle().resident_game_task().is_some()
|
||||
{
|
||||
if ctx.os.vm().current_app_id() == cartridge.app_id {
|
||||
match ctx.os.lifecycle().resume_task(task_id) {
|
||||
Ok(()) => {
|
||||
ctx.os
|
||||
.vm()
|
||||
.transition_render_owner(AppMode::Game, cartridge.app_id);
|
||||
ctx.platform
|
||||
.input_mut()
|
||||
.pad_mut()
|
||||
.begin_frame(&InputSignals::default());
|
||||
ctx.platform
|
||||
.input_mut()
|
||||
.touch_mut()
|
||||
.begin_frame(&InputSignals::default());
|
||||
return Some(FirmwareState::GameRunning(GameRunningStep::new(
|
||||
task_id,
|
||||
)));
|
||||
}
|
||||
Err(error) => {
|
||||
ctx.os.log(
|
||||
LogLevel::Warn,
|
||||
LogSource::Hub,
|
||||
0,
|
||||
format!(
|
||||
"Failed to resume resident Home game {}: {error:?}",
|
||||
cartridge.title
|
||||
),
|
||||
);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
return Some(FirmwareState::ResumeResidentGame);
|
||||
}
|
||||
|
||||
let resident_app_id = ctx.os.vm().current_app_id();
|
||||
|
||||
Reference in New Issue
Block a user