Improve lba naming
This commit is contained in:
parent
840ca74e6d
commit
1d0482d74c
|
@ -45,8 +45,8 @@ fn run_main() -> Result<(), Error> {
|
||||||
Layout::SystemArea(_) => println!("SystemArea:"),
|
Layout::SystemArea(_) => println!("SystemArea:"),
|
||||||
Layout::PVD(_) => println!("PVD:"),
|
Layout::PVD(_) => println!("PVD:"),
|
||||||
Layout::PathTables => println!("PathTables:"),
|
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::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.lba, file.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 ==>");
|
println!("\n<== Planschbecken ==>");
|
||||||
|
|
|
@ -54,7 +54,7 @@ impl CDDesc {
|
||||||
});
|
});
|
||||||
|
|
||||||
size_bytes = round_bytes_mode2_form1(size_bytes)*4;
|
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;
|
let mut cur_lba = 0;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ impl CDDesc {
|
||||||
// Now layout iterate?
|
// Now layout iterate?
|
||||||
for element in self.get_memory_layout() {
|
for element in self.get_memory_layout() {
|
||||||
fn update_lba(properties: &mut Properties, cur_lba: usize, content_sector_size: usize) -> usize {
|
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
|
cur_lba + content_sector_size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ impl SystemArea {
|
||||||
const DEFAULT_SIZE:usize = (Self::SECTOR_COUNT*Mode2Form1::DATA_SIZE);
|
const DEFAULT_SIZE:usize = (Self::SECTOR_COUNT*Mode2Form1::DATA_SIZE);
|
||||||
|
|
||||||
pub fn new() -> SystemArea {
|
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 {
|
fn get_sector_count() -> usize {
|
||||||
|
@ -133,7 +133,7 @@ impl PrimaryVolumeDescriptor {
|
||||||
const DEFAULT_SIZE:usize = (Self::SECTOR_COUNT*Mode2Form1::DATA_SIZE);
|
const DEFAULT_SIZE:usize = (Self::SECTOR_COUNT*Mode2Form1::DATA_SIZE);
|
||||||
|
|
||||||
pub fn new() -> PrimaryVolumeDescriptor {
|
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 {
|
fn get_sector_count() -> usize {
|
||||||
|
@ -292,7 +292,7 @@ impl std::fmt::Display for FileName {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Properties {
|
pub struct Properties {
|
||||||
pub lba: usize,
|
pub track_rel_lba: usize,
|
||||||
pub overwrite_size_bytes: Option<usize>,
|
pub overwrite_size_bytes: Option<usize>,
|
||||||
pub is_hidden: bool
|
pub is_hidden: bool
|
||||||
}
|
}
|
||||||
|
@ -315,7 +315,7 @@ impl Properties {
|
||||||
|
|
||||||
impl Default for Properties {
|
impl Default for Properties {
|
||||||
fn default() -> Self {
|
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}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue