pub struct Parser {
pub buffer: Rc<Vec<u8>>,
pub nls: Nls,
pub sys_desc_offset: u32,
pub entry_point: u32,
pub non_volatile_global_count: u16,
pub volatile_global_count: u16,
pub custom_syscall_count: u16,
pub game_mode: u8,
pub game_mode_reserved: u8,
pub game_title: String,
pub syscall_count: u16,
pub syscalls: HashMap<usize, Syscall>,
}Fields§
§buffer: Rc<Vec<u8>>§nls: Nls§sys_desc_offset: u32§entry_point: u32Entry point (offset) of the script.
non_volatile_global_count: u16§volatile_global_count: u16§custom_syscall_count: u16Register a script function as syscall (usually unused).
game_mode: u8Game resolution id.
game_mode_reserved: u8§game_title: String§syscall_count: u16§syscalls: HashMap<usize, Syscall>Implementations§
Source§impl Parser
impl Parser
pub fn new(path: impl AsRef<Path>, nls: Nls) -> Result<Self>
pub fn len(&self) -> usize
pub fn read_u8(&self, offset: usize) -> Result<u8>
pub fn read_i8(&self, offset: usize) -> Result<i8>
pub fn read_u16(&self, offset: usize) -> Result<u16>
pub fn read_i16(&self, offset: usize) -> Result<i16>
pub fn read_u32(&self, offset: usize) -> Result<u32>
pub fn read_i32(&self, offset: usize) -> Result<i32>
pub fn read_f32(&self, offset: usize) -> Result<f32>
Sourcepub fn read_cstring(&self, offset: usize, len: usize) -> Result<String>
pub fn read_cstring(&self, offset: usize, len: usize) -> Result<String>
Read a C-style string with a maximum length len (may contain an early NUL).
Then decode it into UTF-8 according to the configured NLS.
fn parse_header(&mut self) -> Result<()>
pub fn is_code_area(&self, addr: u32) -> bool
pub fn get_syscall(&self, id: u16) -> Option<&Syscall>
pub fn get_all_syscalls(&self) -> &HashMap<usize, Syscall>
pub fn export_yaml(&self, path: impl AsRef<Path>) -> Result<()>
Source§impl Parser
impl Parser
pub fn get_title(&self) -> &str
pub fn get_non_volatile_global_count(&self) -> u16
pub fn get_volatile_global_count(&self) -> u16
pub fn get_screen_size(&self) -> (u32, u32)
pub fn get_game_mode(&self) -> u8
pub fn get_game_mode_reserved(&self) -> u8
pub fn get_entry_point(&self) -> u32
pub fn get_custom_syscall_count(&self) -> u16
pub fn get_sys_desc_offset(&self) -> u32
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Parser
impl<'de> Deserialize<'de> for Parser
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl !Send for Parser
impl !Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more