SDL2 provides an allocated buffer with its length to the audio callback function. Therefore, peanut_apu does not require any internal buffer. The buffer and the size of which should be passed to the functions called by audio_update(), where the SDL2 buffer replaces "samples" and the length of the buffer replaces "nsamples".
I hope to remove all memory allocation functions and things like memmove() too.
SDL2 provides an allocated buffer with its length to the audio callback function. Therefore, peanut_apu does not require any internal buffer. The buffer and the size of which should be passed to the functions called by audio_update(), where the SDL2 buffer replaces "samples" and the length of the buffer replaces "nsamples".
I hope to remove all memory allocation functions and things like memmove() too.