add process and task managers
This commit is contained in:
@@ -20,7 +20,7 @@ impl LoadCartridgeStep {
|
||||
}
|
||||
|
||||
pub fn on_enter(&mut self, ctx: &mut PrometeuContext) {
|
||||
ctx.os.log(
|
||||
ctx.os.vm_runtime.log(
|
||||
LogLevel::Info,
|
||||
LogSource::Pos,
|
||||
0,
|
||||
@@ -34,7 +34,7 @@ impl LoadCartridgeStep {
|
||||
self.cartridge.assets.clone(),
|
||||
);
|
||||
|
||||
self.init_error = ctx.os.initialize_vm(ctx.vm, &self.cartridge).err();
|
||||
self.init_error = ctx.os.vm_runtime.initialize_vm(ctx.vm, &self.cartridge).err();
|
||||
}
|
||||
|
||||
pub fn on_update(&mut self, ctx: &mut PrometeuContext) -> Option<FirmwareState> {
|
||||
@@ -42,7 +42,7 @@ impl LoadCartridgeStep {
|
||||
return Some(FirmwareState::AppCrashes(AppCrashesStep { report }));
|
||||
}
|
||||
|
||||
if self.cartridge.app_mode == AppMode::System {
|
||||
if self.cartridge.app_mode == AppMode::Shell {
|
||||
let id = ctx.hub.window_manager.add_window(
|
||||
self.cartridge.title.clone(),
|
||||
Rect { x: 40, y: 20, w: 240, h: 140 },
|
||||
@@ -50,10 +50,14 @@ impl LoadCartridgeStep {
|
||||
);
|
||||
ctx.hub.window_manager.set_focus(id);
|
||||
|
||||
return Some(FirmwareState::SystemRunning(SystemRunningStep));
|
||||
let task_id =
|
||||
ctx.os.create_vm_shell_task(self.cartridge.app_id, self.cartridge.title.clone());
|
||||
return Some(FirmwareState::SystemRunning(SystemRunningStep::new(task_id)));
|
||||
}
|
||||
|
||||
Some(FirmwareState::GameRunning(GameRunningStep))
|
||||
let task_id =
|
||||
ctx.os.create_vm_game_task(self.cartridge.app_id, self.cartridge.title.clone());
|
||||
Some(FirmwareState::GameRunning(GameRunningStep::new(task_id)))
|
||||
}
|
||||
|
||||
pub fn on_exit(&mut self, _ctx: &mut PrometeuContext) {}
|
||||
|
||||
Reference in New Issue
Block a user