openMSX
YM2413OriginalNukeYKT.hh
Go to the documentation of this file.
1 /* This is a wrapper around the original (unmodified) NukeYKT code. This is
2  * only useful for debugging because our modified/optimized NukeYKT code should
3  * generate identical output.
4  */
5 #ifndef YM2413ORIGINAL_HPP
6 #define YM2413ORIGINAL_HPP
7 
8 #include "YM2413Core.hh"
9 #include "opll.hh"
10 
12 
13 class YM2413 final : public YM2413Core
14 {
15 public:
16  YM2413();
17  void reset() override;
18  void writePort(bool port, uint8_t value, int cycle_offset) override;
19  void pokeReg(uint8_t reg, uint8_t value) override;
20  [[nodiscard]] uint8_t peekReg(uint8_t reg) const override;
21  void generateChannels(float* out[9 + 5], uint32_t n) override;
22  [[nodiscard]] float getAmplificationFactor() const override;
23 
24  template<typename Archive>
25  void serialize(Archive& ar, unsigned version);
26 
27 private:
28  opll_t opll;
29  struct Write {
30  uint8_t port = uint8_t(-1);
31  uint8_t value;
32  } writes[18];
33 
34  // only used for peekReg();
35  uint8_t regs[64];
36  uint8_t latch;
37 
38  int allowed_offset = 0;
39 };
40 
41 } // namespace openmsx::OriginalNuke
42 
43 #endif
Abstract interface for the YM2413 core.
Definition: YM2413Core.hh:27
void serialize(Archive &ar, unsigned version)
void writePort(bool port, uint8_t value, int cycle_offset) override
Write to the YM2413 register/data port.
void pokeReg(uint8_t reg, uint8_t value) override
Write to a YM2413 register (for debug).
float getAmplificationFactor() const override
Returns normalization factor.
void generateChannels(float *out[9+5], uint32_t n) override
uint8_t peekReg(uint8_t reg) const override
Read from a YM2413 register (for debug).
void reset() override
Reset this YM2413 core.
Definition: opll.hh:80