Prepare for migration to iced

This commit is contained in:
2023-03-29 23:37:12 -05:00
parent b7c3e3113d
commit 9195d439e3
4 changed files with 1920 additions and 28 deletions

26
src/bin/chirp-iced.rs Normal file
View File

@@ -0,0 +1,26 @@
#![allow(unused_imports)]
use chirp::prelude::*;
#[cfg(features = "iced")]
use iced::{
executor, time, window, Alignment, Application, Command, Element, Length, Settings,
Subscription,
};
#[cfg(features = "iced")]
fn main() -> iced::Result {
Ok(())
}
#[cfg(not(features = "iced"))]
fn main() -> Result<()> {
Ok(())
}
/// TODO: `impl Application for Emulator {}`
#[derive(Clone, Debug, Default, PartialEq)]
struct Emulator {
mem: Bus,
cpu: CPU,
fps: f64,
ipf: usize,
}

View File

@@ -91,7 +91,7 @@ impl State {
ch8: Chip8 {
bus: bus! {
// Load the charset into ROM
Charset [0x0050..0x00A0] = include_bytes!("mem/charset.bin"),
Charset [0x0050..0x00A0] = include_bytes!("../mem/charset.bin"),
// Load the ROM file into RAM
Program [0x0200..0x1000] = &read(&options.file)?,
// Create a screen