A lot of games run audio in the NMI handler, starting songs and playing sound effects in the main thread and updating the audio in the NMI thread. But if the NMI handler interrupts a half-finished pently_start_music or pently_start_sound call and calls pently_update_sound, it might start reading data out of la-la land. It's even worse if a pently_start_sound called by the drum channel interrupts a pently_start_sound called by the game. So we need to at least document what is safe and what is unsafe.
A lot of games run audio in the NMI handler, starting songs and playing sound effects in the main thread and updating the audio in the NMI thread. But if the NMI handler interrupts a half-finished
pently_start_music
orpently_start_sound
call and callspently_update_sound
, it might start reading data out of la-la land. It's even worse if apently_start_sound
called by the drum channel interrupts apently_start_sound
called by the game. So we need to at least document what is safe and what is unsafe.