implements PLN-0133
This commit is contained in:
@@ -33,6 +33,10 @@ struct Cli {
|
||||
#[arg(long, value_name = "PATH")]
|
||||
fs_root: Option<String>,
|
||||
|
||||
/// Root directory for local game cartridge discovery
|
||||
#[arg(long, value_name = "PATH")]
|
||||
games_root: Option<String>,
|
||||
|
||||
/// Path to the capability configuration file
|
||||
#[arg(long, value_name = "PATH")]
|
||||
cap: Option<String>,
|
||||
@@ -55,6 +59,9 @@ pub fn run() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let event_loop = EventLoop::new()?;
|
||||
|
||||
let mut runner = HostRunner::new(fs_root, cap_config);
|
||||
if let Some(games_root) = cli.games_root {
|
||||
runner.set_games_root(games_root);
|
||||
}
|
||||
runner.set_boot_target(boot_target);
|
||||
|
||||
event_loop.run_app(&mut runner)?;
|
||||
|
||||
@@ -12,7 +12,7 @@ use prometeu_drivers::{AudioCommand, LocalFramebufferRenderBackend, MemoryBanks}
|
||||
use prometeu_firmware::{BootTarget, Firmware, FirmwareState};
|
||||
use prometeu_hal::RuntimePlatform;
|
||||
use prometeu_hal::telemetry::CertificationConfig;
|
||||
use prometeu_system::{LatestRenderFrameStore, RenderWorkerConfig};
|
||||
use prometeu_system::{LatestRenderFrameStore, RenderWorkerConfig, discover_games_root};
|
||||
use std::sync::Arc;
|
||||
use std::time::{Duration, Instant};
|
||||
use winit::application::ApplicationHandler;
|
||||
@@ -151,6 +151,18 @@ impl HostRunner {
|
||||
self.debugger.setup_boot_target(&boot_target, &mut self.firmware);
|
||||
}
|
||||
|
||||
pub(crate) fn set_games_root(&mut self, games_root: String) {
|
||||
let library = discover_games_root(&games_root);
|
||||
for diagnostic in library.diagnostics() {
|
||||
eprintln!(
|
||||
"games-root: omitted candidate {}: {:?}",
|
||||
diagnostic.path.display(),
|
||||
diagnostic.reason
|
||||
);
|
||||
}
|
||||
self.firmware.hub.set_game_library(library);
|
||||
}
|
||||
|
||||
/// Creates a new desktop runner instance.
|
||||
pub(crate) fn new(fs_root: Option<String>, cap_config: Option<CertificationConfig>) -> Self {
|
||||
let target_fps = 60;
|
||||
|
||||
Reference in New Issue
Block a user