Integrate psxreadmap
This commit is contained in:
@@ -6,6 +6,12 @@ pub struct MemoryMap {
|
||||
pub sections: Vec<Section>
|
||||
}
|
||||
|
||||
impl MemoryMap {
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.global.is_empty() && self.sections.is_empty()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Section {
|
||||
pub name: String,
|
||||
|
@@ -633,5 +633,13 @@ impl NamedMemoryArea for SectionInfo {
|
||||
}
|
||||
|
||||
pub fn load_memory_map(use_wsl: bool, input: PathBuf) -> Result<MemoryMap, Error> {
|
||||
readmap_helper::generate_memory_map(use_wsl, input)
|
||||
let memory_map = readmap_helper::generate_memory_map(use_wsl, input)?;
|
||||
|
||||
if memory_map.is_empty() {
|
||||
Err(Error::from_str("Failed reading memory map. Is the path correct?"))
|
||||
}
|
||||
|
||||
else {
|
||||
Ok(memory_map)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user