Basic_Gb_Apu.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Simplified Nintendo Game Boy PAPU sound chip emulator
  2. // Gb_Snd_Emu 0.1.4. Copyright (C) 2003-2005 Shay Green. GNU LGPL license.
  3. #ifndef BASIC_GB_APU_H
  4. #define BASIC_GB_APU_H
  5. #include "gb_apu/Gb_Apu.h"
  6. #include "gb_apu/Multi_Buffer.h"
  7. #include "MemoryManager.h"
  8. class Basic_Gb_Apu {
  9. MM_OPERATORS
  10. public:
  11. Basic_Gb_Apu();
  12. ~Basic_Gb_Apu();
  13. // Set output sample rate
  14. blargg_err_t set_sample_rate( long rate );
  15. // Pass reads and writes in the range 0xff10-0xff3f
  16. void write_register( blip_time_t, int data );
  17. int read_register( blip_time_t );
  18. // End a 1/60 sound frame and add samples to buffer
  19. void end_frame();
  20. // Samples are generated in stereo, left first. Sample counts are always
  21. // a multiple of 2.
  22. // Number of samples in buffer
  23. long samples_avail() const;
  24. // Read at most 'count' samples out of buffer and return number actually read
  25. typedef blip_sample_t sample_t;
  26. long read_samples( sample_t* out, long count );
  27. //added by 589 --->
  28. void reset();
  29. void treble_eq( const blip_eq_t& eq );
  30. void bass_freq( int bf );
  31. //<---
  32. private:
  33. Gb_Apu apu;
  34. Stereo_Buffer buf;
  35. blip_time_t time;
  36. // faked CPU timing
  37. blip_time_t clock() { return time += 4; }
  38. };
  39. #endif