This commit is contained in:
2026-03-24 13:40:24 +00:00
parent 92df0ae074
commit 97c6ccb6f2
40 changed files with 113 additions and 146 deletions
+2 -1
View File
@@ -1,9 +1,10 @@
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};
use prometeu_core::hardware::{AudioCommand, Channel, LoopMode, MAX_CHANNELS, OUTPUT_SAMPLE_RATE};
use prometeu_hardware::{AudioCommand, Channel, MAX_CHANNELS, OUTPUT_SAMPLE_RATE};
use ringbuf::traits::{Consumer, Producer, Split};
use ringbuf::HeapRb;
use std::sync::Arc;
use std::time::Duration;
use prometeu_hardware_contract::LoopMode;
pub struct HostAudio {
pub producer: Option<ringbuf::wrap::CachingProd<Arc<HeapRb<AudioCommand>>>>,
+1 -1
View File
@@ -1,4 +1,4 @@
use prometeu_core::telemetry::CertificationConfig;
use prometeu_abi::telemetry::CertificationConfig;
pub fn load_cap_config(path: &str) -> Option<CertificationConfig> {
let content = std::fs::read_to_string(path).ok()?;
@@ -1,9 +1,9 @@
use prometeu_core::debugger_protocol::*;
use prometeu_abi::debugger_protocol::*;
use prometeu_firmware::{BootTarget, Firmware};
use prometeu_core::abi::model::CartridgeLoader;
use prometeu_core::Hardware;
use prometeu_abi::model::CartridgeLoader;
use std::io::{Read, Write};
use std::net::{TcpListener, TcpStream};
use prometeu_hardware::hardware::Hardware;
/// Host-side implementation of the PROMETEU DevTools Protocol.
///
@@ -1,6 +1,6 @@
use prometeu_core::fs::{FsBackend, FsEntry, FsError};
use std::fs;
use std::path::PathBuf;
use prometeu_kernel::fs::{FsBackend, FsEntry, FsError};
pub struct HostDirBackend {
root: PathBuf,
+2 -2
View File
@@ -1,8 +1,8 @@
use prometeu_core::hardware::InputSignals;
use prometeu_core::Hardware;
use winit::event::{ElementState, MouseButton, WindowEvent};
use winit::keyboard::{KeyCode, PhysicalKey};
use winit::window::Window;
use prometeu_hardware::hardware::Hardware;
use prometeu_hardware_contract::InputSignals;
pub struct HostInputHandler {
pub signals: InputSignals,
@@ -1,4 +1,4 @@
use prometeu_core::log::{LogEvent, LogLevel, LogSource};
use prometeu_abi::log::{LogEvent, LogLevel, LogSource};
pub struct HostConsoleSink {
last_seq: Option<u64>,
+11 -10
View File
@@ -8,7 +8,6 @@ use crate::utilities::draw_rgb565_to_rgba8;
use pixels::wgpu::PresentMode;
use pixels::{Pixels, PixelsBuilder, SurfaceTexture};
use prometeu_firmware::{BootTarget, Firmware};
use prometeu_core::Hardware;
use std::time::{Duration, Instant};
use winit::application::ApplicationHandler;
use winit::dpi::LogicalSize;
@@ -16,8 +15,10 @@ use winit::event::{ElementState, WindowEvent};
use winit::event_loop::{ActiveEventLoop, ControlFlow};
use winit::keyboard::{KeyCode, PhysicalKey};
use winit::window::{Window, WindowAttributes, WindowId};
use prometeu_core::telemetry::CertificationConfig;
use prometeu_abi::model::Color;
use prometeu_abi::telemetry::CertificationConfig;
use prometeu_hardware::hardware::Hardware;
use prometeu_hardware::AudioCommand;
/// The Desktop implementation of the PROMETEU Runtime.
///
@@ -124,9 +125,9 @@ impl HostRunner {
fn display_dbg_overlay(&mut self) {
let tel = &self.firmware.os.telemetry_last;
let color_text = prometeu_core::model::Color::WHITE;
let color_bg = prometeu_core::model::Color::INDIGO; // Dark blue to stand out
let color_warn = prometeu_core::model::Color::RED;
let color_text = Color::WHITE;
let color_bg = Color::INDIGO; // Dark blue to stand out
let color_warn = Color::RED;
self.hardware.gfx.fill_rect(5, 5, 175, 100, color_bg);
self.hardware.gfx.draw_text(10, 10, &format!("FPS: {:.1}", self.stats.current_fps), color_text);
@@ -259,7 +260,7 @@ impl ApplicationHandler for HostRunner {
// 2. Maintain filesystem connection if it was lost (e.g., directory removed).
if let Some(root) = &self.fs_root {
use prometeu_core::fs::FsState;
use prometeu_kernel::fs::FsState;
if matches!(self.firmware.os.fs_state, FsState::Unmounted | FsState::Error(_)) {
if std::path::Path::new(root).exists() {
let backend = HostDirBackend::new(root);
@@ -298,9 +299,9 @@ impl ApplicationHandler for HostRunner {
if is_paused != self.last_paused_state {
self.last_paused_state = is_paused;
let cmd = if is_paused {
prometeu_core::hardware::AudioCommand::MasterPause
AudioCommand::MasterPause
} else {
prometeu_core::hardware::AudioCommand::MasterResume
AudioCommand::MasterResume
};
self.hardware.audio.commands.push(cmd);
}
@@ -343,10 +344,10 @@ impl ApplicationHandler for HostRunner {
#[cfg(test)]
mod tests {
use super::*;
use prometeu_core::debugger_protocol::DEVTOOLS_PROTOCOL_VERSION;
use prometeu_firmware::BootTarget;
use std::io::{Read, Write};
use std::net::TcpStream;
use prometeu_abi::debugger_protocol::DEVTOOLS_PROTOCOL_VERSION;
#[test]
fn test_debug_port_opens() {
+1 -1
View File
@@ -1,7 +1,7 @@
use prometeu_firmware::Firmware;
use prometeu_core::Hardware;
use std::time::{Duration, Instant};
use winit::window::Window;
use prometeu_hardware::hardware::Hardware;
pub struct HostStats {
pub last_stats_update: Instant,