implements PLN-0053

This commit is contained in:
2026-05-14 18:31:58 +01:00
parent ab825d3274
commit d1f4547e44
19 changed files with 295 additions and 163 deletions
@@ -15,12 +15,7 @@ impl AppCrashesStep {
}
pub fn on_enter(&mut self, ctx: &mut PrometeuContext) {
ctx.os.vm_runtime.log(
LogLevel::Error,
LogSource::Pos,
self.report.log_tag(),
self.log_message(),
);
ctx.os.log(LogLevel::Error, LogSource::Pos, self.report.log_tag(), self.log_message());
}
pub fn on_update(&mut self, ctx: &mut PrometeuContext) -> Option<FirmwareState> {
@@ -15,12 +15,7 @@ impl GameRunningStep {
}
pub fn on_enter(&mut self, ctx: &mut PrometeuContext) {
ctx.os.vm_runtime.log(
LogLevel::Info,
LogSource::Pos,
0,
"Entering GameRunning".to_string(),
);
ctx.os.log(LogLevel::Info, LogSource::Pos, 0, "Entering GameRunning".to_string());
}
pub fn on_update(&mut self, ctx: &mut PrometeuContext) -> Option<FirmwareState> {
@@ -40,7 +35,7 @@ impl GameRunningStep {
return Some(FirmwareState::AppCrashes(AppCrashesStep { report }));
}
let result = ctx.os.vm_runtime.tick(ctx.vm, ctx.signals, ctx.hw);
let result = ctx.os.tick_vm(ctx.vm, ctx.signals, ctx.hw);
if !ctx.os.vm_runtime.logical_frame_active {
ctx.hw.gfx_mut().present();
@@ -7,7 +7,7 @@ pub struct HubHomeStep;
impl HubHomeStep {
pub fn on_enter(&mut self, ctx: &mut PrometeuContext) {
ctx.os.vm_runtime.log(LogLevel::Info, LogSource::Hub, 0, "Entering HubHome".to_string());
ctx.os.log(LogLevel::Info, LogSource::Hub, 0, "Entering HubHome".to_string());
}
pub fn on_update(&mut self, ctx: &mut PrometeuContext) -> Option<FirmwareState> {
@@ -9,7 +9,7 @@ pub struct LaunchHubStep;
impl LaunchHubStep {
pub fn on_enter(&mut self, ctx: &mut PrometeuContext) {
ctx.os.vm_runtime.log(LogLevel::Info, LogSource::Pos, 0, "Launching Hub".to_string());
ctx.os.log(LogLevel::Info, LogSource::Pos, 0, "Launching Hub".to_string());
ctx.hub.init();
}
@@ -22,7 +22,7 @@ impl LaunchHubStep {
return Some(FirmwareState::LoadCartridge(LoadCartridgeStep::new(cartridge)));
}
Err(e) => {
ctx.os.vm_runtime.log(
ctx.os.log(
LogLevel::Error,
LogSource::Pos,
0,
@@ -20,7 +20,7 @@ impl LoadCartridgeStep {
}
pub fn on_enter(&mut self, ctx: &mut PrometeuContext) {
ctx.os.vm_runtime.log(
ctx.os.log(
LogLevel::Info,
LogSource::Pos,
0,
@@ -34,7 +34,7 @@ impl LoadCartridgeStep {
self.cartridge.assets.clone(),
);
self.init_error = ctx.os.vm_runtime.initialize_vm(ctx.vm, &self.cartridge).err();
self.init_error = ctx.os.initialize_vm(ctx.vm, &self.cartridge).err();
}
pub fn on_update(&mut self, ctx: &mut PrometeuContext) -> Option<FirmwareState> {
@@ -8,7 +8,7 @@ pub struct ResetStep;
impl ResetStep {
pub fn on_enter(&mut self, ctx: &mut PrometeuContext) {
ctx.os.vm_runtime.log(LogLevel::Info, LogSource::Pos, 0, "Firmware Reset".to_string());
ctx.os.log(LogLevel::Info, LogSource::Pos, 0, "Firmware Reset".to_string());
ctx.os.vm_runtime.reset(ctx.vm);
}
@@ -10,12 +10,7 @@ pub struct SplashScreenStep {
impl SplashScreenStep {
pub fn on_enter(&mut self, ctx: &mut PrometeuContext) {
ctx.os.vm_runtime.log(
LogLevel::Info,
LogSource::Pos,
0,
"Showing SplashScreen".to_string(),
);
ctx.os.log(LogLevel::Info, LogSource::Pos, 0, "Showing SplashScreen".to_string());
// Play sound on enter
// ctx.hw.audio_mut().play(0, 0, 0, 255, 127, 1.0, 0, LoopMode::Off);
}
@@ -14,12 +14,7 @@ impl SystemRunningStep {
}
pub fn on_enter(&mut self, ctx: &mut PrometeuContext) {
ctx.os.vm_runtime.log(
LogLevel::Info,
LogSource::Hub,
0,
"Entering SystemRunning".to_string(),
);
ctx.os.log(LogLevel::Info, LogSource::Hub, 0, "Entering SystemRunning".to_string());
}
pub fn on_update(&mut self, ctx: &mut PrometeuContext) -> Option<FirmwareState> {