Fix LBA bug

This commit is contained in:
Jaby 2024-07-11 20:56:57 +02:00
parent 3d2b409ea7
commit e6c5ed161f
1 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,5 @@
use super::{*, SectorWriter, {CDDesc, Error}};
use super::super::types::{helper::{DirectoryRecordMember, PathTableMember}, layout::Layout, *};
use super::super::types::{FileType, helper::{DirectoryRecordMember, PathTableMember}, layout::Layout, *};
use builder::SubModeBuilder;
use cdtypes::types::{cdstring::{AString, DString}, date::*, dir_record::*, helper::{round_bytes_mode2_form1, sector_count_mode2_form1, sector_count_mode2_form2}, lsb_msb::*, path_table::*, pvd as cd_pvd, sector::{AudioSample, Mode2Form1}};
use tool_helper::{BufferedInputFile, format_if_error, open_input_file_buffered, print_warning};
@ -28,9 +28,15 @@ pub fn calculate_psx_length_for(element: &Layout) -> LengthInfo {
let file = file.borrow();
let fake_size = file.properties.get_padded_size();
if matches!(file.content, FileType::XAAudio(_)) {
return LengthInfo{bytes: Some(fake_size), sectors: sector_count_mode2_form2(fake_size)};
}
else {
return LengthInfo{bytes: Some(fake_size), sectors: sector_count_mode2_form1(fake_size)};
}
}
}
}
pub fn calculate_psx_lbas(cd_desc: &mut CDDesc) {