30 lines
537 B
Rust
30 lines
537 B
Rust
use crate::virtual_machine::Program;
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub enum AppMode {
|
|
Game,
|
|
System,
|
|
}
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub struct AppHeader {
|
|
pub mode: AppMode,
|
|
pub app_id: String,
|
|
pub magic: u32,
|
|
pub version: u16,
|
|
pub title: String,
|
|
pub entrypoint: u32,
|
|
}
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub struct Cartridge {
|
|
pub header: AppHeader,
|
|
pub program: Program,
|
|
}
|
|
|
|
impl Cartridge {
|
|
pub fn new(header: AppHeader, program: Program) -> Self {
|
|
Self { header, program }
|
|
}
|
|
}
|