Prepare XA-Audio interleaving

This commit is contained in:
Jaby
2024-05-22 20:22:07 +02:00
parent 28416fc624
commit 4b56c5c5d4
9 changed files with 100 additions and 41 deletions

View File

@@ -39,6 +39,15 @@ pub fn force_convert_ascii_to_str(bytes: &[u8]) -> &str {
}
}
pub const fn xa_audio_interleave_count(files: usize) -> usize {
match files {
0..=4 => 4,
5..=8 => 8,
9..=16 => 16,
_ => 32
}
}
pub const fn sector_count_audio(audio_samples: usize) -> usize {
multiple_of_round_up(audio_samples, sector::Audio::SAMPLE_SIZE)
}