Format and basic background impl

This commit is contained in:
2025-12-21 14:03:01 -06:00
parent 5c3d537cfd
commit c8d441297e
2 changed files with 372 additions and 104 deletions

View File

@@ -21,8 +21,8 @@ use nes_emu::{
use tokio::runtime::Runtime;
use tracing_subscriber::EnvFilter;
const ROM_FILE: &str = concat!(env!("ROM_DIR"), "/", "even_odd.nes");
// const ROM_FILE: &str = "./Super Mario Bros. (World).nes";
// const ROM_FILE: &str = concat!(env!("ROM_DIR"), "/", "even_odd.nes");
const ROM_FILE: &str = "./Super Mario Bros. (World).nes";
extern crate nes_emu;
@@ -174,15 +174,10 @@ impl Emulator {
if let Some(WindowType::Main) = self.windows.get(&id) {
self.main_win_size = size;
}
println!("New size for {:?}, {:?}", id, size);
// return iced::window::set_min_size(id, size.into())
// .then(move |_: ()| iced::window::resize(id, size));
return Task::future(async {
tokio::time::sleep(Duration::from_millis(50)).await;
})
.then(move |_| {
iced::window::resize(id, size)
});
.then(move |_| iced::window::resize(id, size));
}
}
// self.image.0.clone_from(self.nes.image());
@@ -249,27 +244,6 @@ impl Emulator {
}
}
// fn cpu_state(&self) -> Element<'_, Message> {
// row![column![
// // text!("Registers").font(Font::MONOSPACE),
// text!("{:?}", self.nes).font(Font::MONOSPACE),
// ],]
// .width(Fill)
// .into()
// }
// fn controls(&self) -> Element<'_, Message> {
// row![
// button("Clock tick").on_press(Message::Tick(1)),
// button("CPU tick").on_press(Message::CPU),
// button("Next Frame").on_press(Message::Frame),
// button("Next DMA").on_press(Message::DMA),
// button("Next DBG").on_press(Message::DebugInt),
// ]
// .width(Fill)
// .into()
// }
fn dropdowns(&self) -> Element<'_, Message> {
row![
header_menu(