Skip to main content

NameTable

Struct NameTable 

Source
pub struct NameTable { /* private fields */ }
Expand description

Command names and the other ROM facts the decompiler needs, built from one ROM image.

Implementations§

Source§

impl NameTable

Source

pub fn build(model: Model, rom: &[u8]) -> NameTable

The table of model’s ROM image rom (one nibble per element, as saturnus::Machine::rom_nibbles gives it). A ROM without libraries gives an empty table (every command stays unnamed). Only the 48SX, 48GX (mask ROM, image index = address) and 49G (flash banks of 256 K nibbles) are handled; for the 38G, 39G, 40G and 42S, whose ROM layout this does not know (banked differently, or no RPL libraries at all on the 42S), the table is empty.

Source

pub fn of(machine: &Machine) -> NameTable

The table of machine’s ROM.

Source

pub fn stats(&self) -> NameStats

Counts for reports.

Source

pub fn heap_bytes(&self) -> usize

The heap memory the table holds, in bytes (approximate: vector and string capacities).

Source

pub fn names(&self) -> impl Iterator<Item = (u16, u16, &str)> + '_

Every named command: (library, number, name).

Source

pub fn bank(&self) -> Option<usize>

Nibbles per bank when the image is banked (the 49G).

Source

pub fn find(&self, name: &str) -> Option<(u16, u16)>

The library and command number of the command called name (the first library holding it).

Source

pub fn library_size(&self, library: u16) -> Option<(usize, usize)>

The commands of library library and how many of them have a name (the first copy when the image holds it twice).

Source

pub fn object_index(&self, library: u16, number: u16) -> Option<usize>

The image index of command number of library’s object, when every copy of the library agrees on it.

Source

pub fn unit_markers(&self) -> Option<UnitMarkers>

The unit operator markers, if the ROM’s unit table revealed them.

Source

pub fn xlib(&self, library: u16, number: u16) -> Option<CommandInfo<'_>>

The command XLIB library number (an XLIB name object). When the image holds the library twice, the copies must agree.

Source

pub fn command_at(&self, addr: u32, mem: &dyn Memory) -> Option<CommandInfo<'_>>

The command whose object is at addr in mem (a ROM pointer), as the ROM’s decompiler finds it: the XLIB body in the six nibbles before the object names a library and command whose link table entry is this object. On a banked ROM the table does not know which bank the CPU sees at addr: every copy of the library whose entry lies at that offset of some bank must agree, else the command stays unknown.

Trait Implementations§

Source§

impl Clone for NameTable

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NameTable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NameTable

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.