pub struct Rom<'a> { /* private fields */ }Expand description
A plain ROM.
Implementations§
Source§impl<'a> Rom<'a>
impl<'a> Rom<'a>
Sourcepub fn load<P: AsRef<Path>>(
config_path: P,
options: RomLoadOptions<'_>,
) -> Result<Self, RomSaveError>
pub fn load<P: AsRef<Path>>( config_path: P, options: RomLoadOptions<'_>, ) -> Result<Self, RomSaveError>
Loads a ROM from a path generated by Self::save.
§Errors
This function will return an error if there’s a file missing or the file has an invalid format.
Sourcepub fn save<P: AsRef<Path>>(
&self,
path: P,
key: Option<&BlowfishKey>,
) -> Result<(), RomSaveError>
pub fn save<P: AsRef<Path>>( &self, path: P, key: Option<&BlowfishKey>, ) -> Result<(), RomSaveError>
Saves this ROM to a path as separate files.
§Errors
This function will return an error if a file could not be created or the a component of the ROM has an invalid format.
Sourcepub fn arm9_build_config(&self) -> Result<Arm9BuildConfig, RomSaveError>
pub fn arm9_build_config(&self) -> Result<Arm9BuildConfig, RomSaveError>
Generates a build config for ARM9, which normally goes into arm9.yaml.
Sourcepub fn extract(rom: &'a Rom<'_>) -> Result<Self, RomExtractError>
pub fn extract(rom: &'a Rom<'_>) -> Result<Self, RomExtractError>
Extracts from a raw ROM.
§Errors
This function will return an error if a component is missing from the raw ROM.
Sourcepub fn build(self, key: Option<&BlowfishKey>) -> Result<Rom<'a>, RomBuildError>
pub fn build(self, key: Option<&BlowfishKey>) -> Result<Rom<'a>, RomBuildError>
Builds a raw ROM.
§Errors
This function will return an error if an I/O operation fails or a component fails to build.
Sourcepub fn header_logo(&self) -> &Logo
pub fn header_logo(&self) -> &Logo
Returns a reference to the header logo of this Rom.
Sourcepub fn header_logo_mut(&mut self) -> &mut Logo
pub fn header_logo_mut(&mut self) -> &mut Logo
Returns a mutable reference to the header logo of this Rom.
Sourcepub fn arm9_mut(&mut self) -> &mut Arm9<'a>
pub fn arm9_mut(&mut self) -> &mut Arm9<'a>
Returns a mutable reference to the ARM9 program of this Rom.
Sourcepub fn arm9_overlay_table(&self) -> &OverlayTable<'a>
pub fn arm9_overlay_table(&self) -> &OverlayTable<'a>
Returns a reference to the ARM9 overlay table of this Rom.
Sourcepub fn arm9_overlay_table_mut(&mut self) -> &mut OverlayTable<'a>
pub fn arm9_overlay_table_mut(&mut self) -> &mut OverlayTable<'a>
Returns a mutable reference to the ARM9 overlay table of this Rom.
Sourcepub fn arm9_overlays(&self) -> &[Overlay<'a>]
pub fn arm9_overlays(&self) -> &[Overlay<'a>]
Returns a reference to the ARM9 overlays of this Rom.
Sourcepub fn arm9_overlays_mut(&mut self) -> &mut [Overlay<'a>]
pub fn arm9_overlays_mut(&mut self) -> &mut [Overlay<'a>]
Returns a mutable reference to the ARM9 overlays of this Rom.
Sourcepub fn arm7_mut(&mut self) -> &mut Arm7<'a>
pub fn arm7_mut(&mut self) -> &mut Arm7<'a>
Returns a mutable reference to the ARM7 program of this Rom.
Sourcepub fn arm7_overlay_table(&self) -> &OverlayTable<'a>
pub fn arm7_overlay_table(&self) -> &OverlayTable<'a>
Returns a reference to the ARM7 overlay table of this Rom.
Sourcepub fn arm7_overlay_table_mut(&mut self) -> &mut OverlayTable<'a>
pub fn arm7_overlay_table_mut(&mut self) -> &mut OverlayTable<'a>
Returns a mutable reference to the ARM7 overlay table of this Rom.
Sourcepub fn arm7_overlays(&self) -> &[Overlay<'a>]
pub fn arm7_overlays(&self) -> &[Overlay<'a>]
Returns a reference to the ARM7 overlays of this Rom.
Sourcepub fn arm7_overlays_mut(&mut self) -> &mut [Overlay<'a>]
pub fn arm7_overlays_mut(&mut self) -> &mut [Overlay<'a>]
Returns a mutable reference to the ARM7 overlays of this Rom.
Sourcepub fn header_mut(&mut self) -> &mut Header
pub fn header_mut(&mut self) -> &mut Header
Returns a mutable reference to the header of this Rom.
Sourcepub fn config(&self) -> &RomConfig
pub fn config(&self) -> &RomConfig
Returns the RomConfig consisting of paths to extracted files.
Sourcepub fn multiboot_signature(&self) -> Option<&MultibootSignature>
pub fn multiboot_signature(&self) -> Option<&MultibootSignature>
Returns the MultibootSignature of this Rom.