#[non_exhaustive]pub struct BoardDescription {
pub mapper_id: u16,
pub submapper: u8,
pub mirroring: Mirroring,
pub console_type: ConsoleType,
pub vs_dual_system: bool,
pub prg_ram_size: u32,
pub chr_ram_size: u32,
pub has_battery: bool,
pub has_trainer: bool,
pub prg_rom_len: u32,
pub chr_rom_len: u32,
pub nametable_wiring_bits: u8,
}Expand description
What the cartridge header told the core to build, after any load-time correction: the facts that change emulation and that a host cannot apply.
Region is not here: a movie has always recorded it in its fixed header,
and netplay folds it into config_digest beside this.
#[non_exhaustive] since v3.0.0 (T-API-EXTENSIBLE): build one with
BoardDescription::capture. v2.9.9 added three fields to it, each a
break; a later field no longer is.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.mapper_id: u16iNES / NES 2.0 mapper number.
submapper: u8NES 2.0 submapper (0 for iNES 1.0).
mirroring: MirroringHeader mirroring.
console_type: ConsoleTypeConsole type (NES / Vs. System / PlayChoice-10 / extended).
vs_dual_system: boolWhether the header marks a Vs. DualSystem board.
prg_ram_size: u32PRG-RAM bytes (volatile + battery).
chr_ram_size: u32CHR-RAM bytes.
has_battery: boolBattery-backed save RAM present.
has_trainer: bool512-byte trainer present.
prg_rom_len: u32PRG-ROM bytes. The ROM identity hashes the body after the header, so the same body split differently between PRG and CHR (2 x 16 KiB + 4 x 8 KiB against 1 x 16 KiB + 6 x 8 KiB) shared an identity and a description until v2.9.9 (core re-audit NC-10).
chr_rom_len: u32CHR-ROM bytes (0 for CHR-RAM boards); see prg_rom_len.
nametable_wiring_bits: u8The raw header nametable bits mappers 30 and 218 wire from
(rustynes_mappers::Cartridge::nametable_wiring_bits); v2.9.9.
Implementations§
Source§impl BoardDescription
impl BoardDescription
Sourcepub fn first_difference(&self, other: &Self) -> Option<&'static str>
pub fn first_difference(&self, other: &Self) -> Option<&'static str>
The first field that differs between self (recorded) and other
(the host’s), or None when the boards agree.
Sourcepub fn write_to(&self, w: &mut BinWriter)
pub fn write_to(&self, w: &mut BinWriter)
Append the canonical encoding to w (u16 mapper, submapper,
mirroring, console type, DualSystem, u32 PRG-RAM, u32 CHR-RAM,
battery, trainer, and from v2.9.9 u32 PRG-ROM, u32 CHR-ROM and the
wiring byte).
Sourcepub fn read_from(r: &mut BinReader<'_>) -> Result<Self, OptionsDecodeError>
pub fn read_from(r: &mut BinReader<'_>) -> Result<Self, OptionsDecodeError>
Decode what Self::write_to wrote. Strict, as
HardwareOptions::read_from.
§Errors
A fixed description of the first malformed field, or "truncated".
Trait Implementations§
Source§impl Clone for BoardDescription
impl Clone for BoardDescription
Source§fn clone(&self) -> BoardDescription
fn clone(&self) -> BoardDescription
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more