mod dispatch; mod frame_scheduler; mod lifecycle; pub mod render_manager; #[cfg(test)] mod tests; mod tick; use crate::CrashReport; pub use frame_scheduler::FrameScheduler; use prometeu_bytecode::string_materialization_count; use prometeu_hal::app_mode::AppMode; use prometeu_hal::log::LogService; use prometeu_hal::telemetry::{AtomicTelemetry, CertificationConfig, Certifier}; use prometeu_hal::{Gfx2dCommand, GfxUiCommand}; use prometeu_vm::VirtualMachine; pub use render_manager::{RenderManager, RenderRuntimeCapabilities}; use std::collections::HashMap; use std::sync::Arc; use std::sync::atomic::AtomicU32; use std::time::Instant; pub struct VirtualMachineRuntime { pub tick_index: u64, pub logical_frame_index: u64, pub logical_frame_active: bool, pub logical_frame_remaining_cycles: u64, pub last_frame_cpu_time_us: u64, pub current_app_id: u32, pub current_cartridge_title: String, pub current_cartridge_app_version: String, pub current_cartridge_app_mode: AppMode, pub frame_scheduler: FrameScheduler, pub render_capabilities: RenderRuntimeCapabilities, pub render_manager: RenderManager, pub gfx2d_commands: Vec, pub gfxui_commands: Vec, pub logs_written_this_frame: HashMap, pub atomic_telemetry: Arc, pub last_crash_report: Option, pub certifier: Certifier, pub paused: bool, pub debug_step_request: bool, pub inspection_active: bool, pub(crate) frame_start_heap_allocations: u64, pub(crate) frame_start_string_materializations: u64, pub(crate) needs_prepare_entry_call: bool, pub(crate) boot_time: Instant, } impl VirtualMachineRuntime { pub const CYCLES_PER_LOGICAL_FRAME: u64 = 1_500_000; pub const SLICE_PER_TICK: u64 = 1_500_000; pub const MAX_LOG_LEN: usize = 256; pub const MAX_LOGS_PER_FRAME: u32 = 10; pub fn new(cap_config: Option) -> Self { Self::new_with_log_counter(cap_config, Arc::new(AtomicU32::new(0))) } }