Subversion Repositories pentevo

Rev

Rev 1147 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed | ?url?

  1. // From https://github.com/tslabs/zx-evo/blob/master/pentevo/unreal/Unreal/sound/dev_moonsound.h
  2.  
  3. #pragma once
  4.  
  5. #ifndef _SOUND_DEV_MOONSOUND_H
  6. #define _SOUND_DEV_MOONSOUND_H
  7.  
  8. #include "../sysdefs.h"
  9. #include "ymf262.h"
  10. #include "ymf278.h"
  11.  
  12. struct ZXMMoonSound_priv
  13. {
  14. friend class ZXMMoonSound;
  15.  
  16. public:
  17.         ZXMMoonSound_priv();
  18.         ~ZXMMoonSound_priv();
  19.  
  20. private:
  21.         YMF262 ymf262;
  22.         int opl3latch;
  23.  
  24.         YMF278 ymf278;
  25.         int opl4latch;
  26. };
  27.  
  28. class ZXMMoonSound : public SNDRENDER
  29. {
  30. public:
  31.         ZXMMoonSound();
  32.  
  33.         int load_rom(char *path);
  34.  
  35.         void reset();
  36.         bool wr_opl3( u8 port, u8  val );
  37.         bool wr_opl4( u8 port, u8  val );
  38.         bool rd_opl3( u8 port, u8 &val );
  39.         bool rd_opl4( u8 port, u8 &val );
  40.  
  41.         // set of functions that fills buffer in emulation progress
  42.         void set_timings(unsigned system_clock_rate, unsigned chip_clock_rate, unsigned sample_rate);
  43.         void start_frame() { SNDRENDER::start_frame(); }
  44.         void start_frame(bufptr_t dst);
  45.         unsigned end_frame(unsigned clk_ticks);
  46.         void flush(unsigned chiptick);
  47.  
  48. private:
  49.         ZXMMoonSound_priv d;
  50.  
  51.         unsigned chip_clock_rate;
  52.         unsigned system_clock_rate;
  53.         u64 passed_chip_ticks;
  54.         u64 passed_clk_ticks;
  55.  
  56.         unsigned t;
  57. };
  58.  
  59. extern ZXMMoonSound zxmmoonsound;
  60.  
  61. #endif /* _SOUND_DEV_MOONSOUND_H */
  62.