pub struct Bank { /* private fields */ }Expand description
A sequential SPU RAM allocator: uploads cooked .psau samples one after
another and hands back where each landed.
Start it at or above [psx_spu::SILENCE_BLOCK] plus one block. psx-spu
keeps the first usable block of SPU RAM for the silence every finished
one-shot parks on, and [psx_spu::Spu::upload_adpcm] rejects a bank laid over
it rather than letting the collision be silent.
Implementations§
Source§impl Bank
impl Bank
Sourcepub const fn next_addr(&self) -> SpuAddr
pub const fn next_addr(&self) -> SpuAddr
Where the next upload will land, and so the first address free after everything uploaded so far.
Sourcepub fn upload_on(&mut self, spu: &mut Spu, psau: &[u8]) -> Sample
pub fn upload_on(&mut self, spu: &mut Spu, psau: &[u8]) -> Sample
Upload one cooked .psau sample through spu.
§Panics
If psau is not a valid cooked sample, matching the rest of the SDK’s
asset handling: a bad include_bytes! is a build mistake, not a
runtime condition worth threading a Result through a sound effect for.