Prepare for migration to iced
This commit is contained in:
		
							
								
								
									
										26
									
								
								src/bin/chirp-iced.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								src/bin/chirp-iced.rs
									
									
									
									
									
										Normal 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, | ||||
| } | ||||
| @@ -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
 | ||||
		Reference in New Issue
	
	Block a user