diff --git a/crates/console/prometeu-hal/src/telemetry.rs b/crates/console/prometeu-hal/src/telemetry.rs index 884765fd..9540d0a3 100644 --- a/crates/console/prometeu-hal/src/telemetry.rs +++ b/crates/console/prometeu-hal/src/telemetry.rs @@ -8,6 +8,7 @@ pub struct TelemetryFrame { pub cycles_budget: u64, pub syscalls: u32, pub host_cpu_time_us: u64, + pub completed_logical_frames: u32, pub violations: u32, // GFX Banks diff --git a/crates/console/prometeu-system/src/virtual_machine_runtime.rs b/crates/console/prometeu-system/src/virtual_machine_runtime.rs index c6e55752..ed6e1a00 100644 --- a/crates/console/prometeu-system/src/virtual_machine_runtime.rs +++ b/crates/console/prometeu-system/src/virtual_machine_runtime.rs @@ -321,6 +321,7 @@ impl VirtualMachineRuntime { ) as u32; // Latch telemetry for the Host/Debugger to read. + self.telemetry_current.completed_logical_frames += 1; self.telemetry_last = self.telemetry_current; self.logical_frame_index += 1; diff --git a/crates/host/prometeu-host-desktop-winit/src/runner.rs b/crates/host/prometeu-host-desktop-winit/src/runner.rs index 97e69f7f..336dbc79 100644 --- a/crates/host/prometeu-host-desktop-winit/src/runner.rs +++ b/crates/host/prometeu-host-desktop-winit/src/runner.rs @@ -214,8 +214,8 @@ impl ApplicationHandler for HostRunner { fn resumed(&mut self, event_loop: &ActiveEventLoop) { let attrs = WindowAttributes::default() .with_title(format!( - "PROMETEU | GFX: {:.1} KB | FPS: {:.1} | Load: {:.1}% (C) + {:.1}% (A) | Frame: tick {} logical {}", - 0.0, 0.0, 0.0, 0, 0, 0)) + "PROMETEU | GFX: {:.1} KB | FPS: {:.1} | Load: {:.1}% (C) + {:.1}% (A) | Frame: tick {} logical {} done {}", + 0.0, 0.0, 0.0, 0, 0, 0, 0)) .with_inner_size(LogicalSize::new(960.0, 540.0)) .with_min_inner_size(LogicalSize::new(320.0, 180.0)); diff --git a/crates/host/prometeu-host-desktop-winit/src/stats.rs b/crates/host/prometeu-host-desktop-winit/src/stats.rs index e62190bc..5bcb0adf 100644 --- a/crates/host/prometeu-host-desktop-winit/src/stats.rs +++ b/crates/host/prometeu-host-desktop-winit/src/stats.rs @@ -55,13 +55,14 @@ impl HostStats { }; let title = format!( - "PROMETEU | GFX: {:.1} KB | FPS: {:.1} | Load: {:.1}% (C) + {:.1}% (A) | Frame: tick {} logical {}", + "PROMETEU | GFX: {:.1} KB | FPS: {:.1} | Load: {:.1}% (C) + {:.1}% (A) | Frame: tick {} logical {} done {}", 0, self.current_fps, cpu_load_core, cpu_load_audio, firmware.os.tick_index, - firmware.os.logical_frame_index + firmware.os.logical_frame_index, + firmware.os.telemetry_last.completed_logical_frames, ); window.set_title(&title); } diff --git a/crates/tools/pbxgen-stress/src/lib.rs b/crates/tools/pbxgen-stress/src/lib.rs index c0cd326d..cb0c32b7 100644 --- a/crates/tools/pbxgen-stress/src/lib.rs +++ b/crates/tools/pbxgen-stress/src/lib.rs @@ -10,7 +10,7 @@ pub fn generate() -> Result<()> { let mut rom: Vec = Vec::new(); heavy_load(&mut rom); - //light_load(&mut rom); + // light_load(&mut rom); let functions = vec![ FunctionMeta { @@ -88,7 +88,7 @@ fn heavy_load(mut rom: &mut Vec) { // --- draw 500 discs --- rom.extend(asm("PUSH_I32 0\nSET_LOCAL 1")); let disc_loop_start = rom.len() as u32; - rom.extend(asm("GET_LOCAL 1\nPUSH_I32 500\nLT")); + rom.extend(asm("GET_LOCAL 1\nPUSH_I32 500\nLT")); let jif_disc_end_offset = rom.len() + 2; rom.extend(asm("JMP_IF_FALSE 0")); @@ -114,7 +114,7 @@ fn heavy_load(mut rom: &mut Vec) { // --- draw 20 texts --- rom.extend(asm("PUSH_I32 0\nSET_LOCAL 1")); let text_loop_start = rom.len() as u32; - rom.extend(asm("GET_LOCAL 1\nPUSH_I32 20\nLT")); + rom.extend(asm("GET_LOCAL 1\nPUSH_I32 0\nLT")); let jif_text_end_offset = rom.len() + 2; rom.extend(asm("JMP_IF_FALSE 0")); @@ -170,11 +170,11 @@ fn heavy_load(mut rom: &mut Vec) { patch(&mut rom, jif_log_offset, after_log); } -// fn light_load(rom: &mut Vec) { -// // Single function 0: main -// // Only paints Purple: 0x780F once. -// // The runtime handles calling this function repeatedly every tick. -// -// // --- clear screen (Purple 0x780F) --- -// rom.extend(asm("PUSH_I32 30735\nSYSCALL 0x1010\nFRAME_SYNC\nRET")); // 30735 is 0x780F -// } +fn light_load(rom: &mut Vec) { + // Single function 0: main + // Only paints Purple: 0x780F once. + // The runtime handles calling this function repeatedly every tick. + + // --- clear screen (Purple 0x780F) --- + rom.extend(asm("PUSH_I32 30735\nSYSCALL 0x1010\nFRAME_SYNC\nRET")); // 30735 is 0x780F +} diff --git a/test-cartridges/stress-console/program.pbx b/test-cartridges/stress-console/program.pbx index a52551b1..aec099eb 100644 Binary files a/test-cartridges/stress-console/program.pbx and b/test-cartridges/stress-console/program.pbx differ