Integrate all the progress into master #6

Merged
jaby merged 595 commits from ToolBox into main 2025-01-01 13:17:44 +00:00
1 changed files with 8 additions and 2 deletions
Showing only changes of commit e6c5ed161f - Show all commits

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,7 +28,13 @@ pub fn calculate_psx_length_for(element: &Layout) -> LengthInfo {
let file = file.borrow();
let fake_size = file.properties.get_padded_size();
return LengthInfo{bytes: Some(fake_size), sectors: sector_count_mode2_form1(fake_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)};
}
}
}
}