NESe (pronounced "Nessie") is a NES emulator based on the e6502 emulator, also written in C with a focus on speed and portability for use on embedded platforms, especially ARM.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
846B

  1. #ifndef NES_AUDIO_H_
  2. #define NES_AUDIO_H_
  3. #include "apu.h"
  4. // System Glue
  5. typedef struct nes_Audio_Stream_t {
  6. int (*init)(struct nes_Audio_Stream_t*, int frequency);
  7. void (*done)(struct nes_Audio_Stream_t*);
  8. int (*push)(struct nes_Audio_Stream_t*, short*, int);
  9. void* data;
  10. } nes_Audio_Stream;
  11. static inline int nes_audio_init(nes_Audio_Stream* stream,
  12. int frequency) {
  13. return stream->init(stream, frequency);
  14. }
  15. static inline void nes_audio_done(nes_Audio_Stream* stream) {
  16. stream->done(stream);
  17. }
  18. static inline int nes_audio_push(nes_Audio_Stream* stream,
  19. short* samples, int n_samples) {
  20. return stream->push(stream, samples, n_samples);
  21. }
  22. // Convenience
  23. int nes_audio_fill(nes_Audio_Stream* stream, nes_apu* apu);
  24. #endif // NES_AUDIO_H_