From 1d0482d74ccb44bff34fa254978610b5f73ef631 Mon Sep 17 00:00:00 2001 From: jaby Date: Wed, 19 Oct 2022 20:48:39 +0200 Subject: [PATCH] Improve lba naming --- src/Tools/psxcdgen_ex/src/main.rs | 4 ++-- src/Tools/psxcdgen_ex/src/types/mod.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Tools/psxcdgen_ex/src/main.rs b/src/Tools/psxcdgen_ex/src/main.rs index 159d2aea..2c788980 100644 --- a/src/Tools/psxcdgen_ex/src/main.rs +++ b/src/Tools/psxcdgen_ex/src/main.rs @@ -45,8 +45,8 @@ fn run_main() -> Result<(), Error> { Layout::SystemArea(_) => println!("SystemArea:"), Layout::PVD(_) => println!("PVD:"), Layout::PathTables => println!("PathTables:"), - Layout::Directory(dir) => println!("Dir: {} @{}-{}", dir.borrow().name, dir.borrow().properties.lba, dir.borrow().properties.overwrite_size_bytes.unwrap_or(0)), - Layout::File(file) => println!("File: {} @{}-{}", file.borrow(), file.borrow().properties.lba, file.borrow().properties.overwrite_size_bytes.unwrap_or(0)), + Layout::Directory(dir) => println!("Dir: {} @{}-{}", dir.borrow().name, dir.borrow().properties.track_rel_lba, dir.borrow().properties.overwrite_size_bytes.unwrap_or(0)), + Layout::File(file) => println!("File: {} @{}-{}", file.borrow(), file.borrow().properties.track_rel_lba, file.borrow().properties.overwrite_size_bytes.unwrap_or(0)), } } println!("\n<== Planschbecken ==>"); diff --git a/src/Tools/psxcdgen_ex/src/types/mod.rs b/src/Tools/psxcdgen_ex/src/types/mod.rs index c6d5ff25..e91a5fd3 100644 --- a/src/Tools/psxcdgen_ex/src/types/mod.rs +++ b/src/Tools/psxcdgen_ex/src/types/mod.rs @@ -54,7 +54,7 @@ impl CDDesc { }); size_bytes = round_bytes_mode2_form1(size_bytes)*4; - (Properties{lba: 0, overwrite_size_bytes: None, is_hidden: false}, sector_count_mode2_form1(size_bytes)) + (Properties{track_rel_lba: 0, overwrite_size_bytes: None, is_hidden: false}, sector_count_mode2_form1(size_bytes)) }; let mut cur_lba = 0; @@ -63,7 +63,7 @@ impl CDDesc { // Now layout iterate? for element in self.get_memory_layout() { fn update_lba(properties: &mut Properties, cur_lba: usize, content_sector_size: usize) -> usize { - properties.lba = cur_lba; + properties.track_rel_lba = cur_lba; cur_lba + content_sector_size } @@ -116,7 +116,7 @@ impl SystemArea { const DEFAULT_SIZE:usize = (Self::SECTOR_COUNT*Mode2Form1::DATA_SIZE); pub fn new() -> SystemArea { - SystemArea{properties: Properties{lba: 0, overwrite_size_bytes: Some(Self::DEFAULT_SIZE), is_hidden: false}} + SystemArea{properties: Properties{track_rel_lba: 0, overwrite_size_bytes: Some(Self::DEFAULT_SIZE), is_hidden: false}} } fn get_sector_count() -> usize { @@ -133,7 +133,7 @@ impl PrimaryVolumeDescriptor { const DEFAULT_SIZE:usize = (Self::SECTOR_COUNT*Mode2Form1::DATA_SIZE); pub fn new() -> PrimaryVolumeDescriptor { - PrimaryVolumeDescriptor{properties: Properties{lba: 0, overwrite_size_bytes: Some(Self::DEFAULT_SIZE), is_hidden: false}} + PrimaryVolumeDescriptor{properties: Properties{track_rel_lba: 0, overwrite_size_bytes: Some(Self::DEFAULT_SIZE), is_hidden: false}} } fn get_sector_count() -> usize { @@ -292,7 +292,7 @@ impl std::fmt::Display for FileName { } pub struct Properties { - pub lba: usize, + pub track_rel_lba: usize, pub overwrite_size_bytes: Option, pub is_hidden: bool } @@ -315,7 +315,7 @@ impl Properties { impl Default for Properties { fn default() -> Self { - Properties{lba: 0, overwrite_size_bytes: None, is_hidden: false} + Properties{track_rel_lba: 0, overwrite_size_bytes: None, is_hidden: false} } }