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
impl NameTable
Sourcepub fn build(model: Model, rom: &[u8]) -> NameTable
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.
Sourcepub fn heap_bytes(&self) -> usize
pub fn heap_bytes(&self) -> usize
The heap memory the table holds, in bytes (approximate: vector and string capacities).
Sourcepub fn names(&self) -> impl Iterator<Item = (u16, u16, &str)> + '_
pub fn names(&self) -> impl Iterator<Item = (u16, u16, &str)> + '_
Every named command: (library, number, name).
Sourcepub fn find(&self, name: &str) -> Option<(u16, u16)>
pub fn find(&self, name: &str) -> Option<(u16, u16)>
The library and command number of the command called name (the
first library holding it).
Sourcepub fn library_size(&self, library: u16) -> Option<(usize, usize)>
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).
Sourcepub fn object_index(&self, library: u16, number: u16) -> Option<usize>
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.
Sourcepub fn unit_markers(&self) -> Option<UnitMarkers>
pub fn unit_markers(&self) -> Option<UnitMarkers>
The unit operator markers, if the ROM’s unit table revealed them.
Sourcepub fn xlib(&self, library: u16, number: u16) -> Option<CommandInfo<'_>>
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.
Sourcepub fn command_at(&self, addr: u32, mem: &dyn Memory) -> Option<CommandInfo<'_>>
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.