From 960158bb7c6de4ad95ccf9f50292d1eef4f95a0a Mon Sep 17 00:00:00 2001 From: Nilton Constantino Date: Fri, 16 Jan 2026 06:36:40 +0000 Subject: [PATCH] clean up --- crates/core/src/logical_hardware.rs | 9 ++++++--- crates/host_desktop/src/main.rs | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/crates/core/src/logical_hardware.rs b/crates/core/src/logical_hardware.rs index 3f3ef2c1..09a339a4 100644 --- a/crates/core/src/logical_hardware.rs +++ b/crates/core/src/logical_hardware.rs @@ -10,7 +10,8 @@ pub struct LogicalHardware { pub audio: Audio, pub pad: Pad, pub touch: Touch, - pub frame_index: u64, + pub tick_index: u64, + pub logical_frame_index: u64, pub last_frame_cpu_time_us: u64, pub vm: VirtualMachine, pub cartridge: Option, @@ -35,7 +36,8 @@ impl LogicalHardware { audio: Audio::new(), pad: Pad::default(), touch: Touch::default(), - frame_index: 0, + tick_index: 0, + logical_frame_index: 0, last_frame_cpu_time_us: 0, vm: VirtualMachine::default(), cartridge: None, @@ -116,6 +118,7 @@ impl LogicalHardware { /// O Host controla tempo/event loop; o Core define a sequência do frame. pub fn step_frame(&mut self, signals: &InputSignals) { let start = std::time::Instant::now(); + self.tick_index += 1; // não importa o frame lógico, o tick sempre incrementa // Se um frame logica estiver aberto evita limpar o input if !self.logical_frame_open { @@ -134,7 +137,7 @@ impl LogicalHardware { if run.reason == crate::vm::LogicalFrameEndingReason::FrameSync { self.gfx.render_all(); self.end_frame(); - self.frame_index += 1; // conta frames lógicos apresentados + self.logical_frame_index += 1; // conta frames lógicos apresentados self.logical_frame_open = false; } diff --git a/crates/host_desktop/src/main.rs b/crates/host_desktop/src/main.rs index c5cc585e..31a25926 100644 --- a/crates/host_desktop/src/main.rs +++ b/crates/host_desktop/src/main.rs @@ -147,7 +147,9 @@ impl PrometeuApp { impl ApplicationHandler for PrometeuApp { fn resumed(&mut self, event_loop: &ActiveEventLoop) { let attrs = WindowAttributes::default() - .with_title(format!("PROMETEU | GFX: {:.1} KB | FPS: {:.1} | Load: {}% | Frame: {}", 0.0, 0.0, 0.0, 0)) + .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)) .with_inner_size(LogicalSize::new(960.0, 540.0)) .with_min_inner_size(LogicalSize::new(320.0, 180.0)); @@ -308,8 +310,8 @@ impl ApplicationHandler for PrometeuApp { }; let title = format!( - "PROMETEU | GFX: {:.1} KB | FPS: {:.1} | Load: {:.1}% (C) + {:.1}% (A) | Frame: {}", - kb, fps, cpu_load_core, cpu_load_audio, self.logical_hardware.frame_index + "PROMETEU | GFX: {:.1} KB | FPS: {:.1} | Load: {:.1}% (C) + {:.1}% (A) | Frame: tick {} logical {}", + kb, fps, cpu_load_core, cpu_load_audio, self.logical_hardware.tick_index, self.logical_hardware.logical_frame_index ); window.set_title(&title); }