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 
11 namespace openmsx {
12 namespace YM2413OriginalNukeYKT {
13 
14 class YM2413 : public YM2413Core
15 {
16 public:
17  YM2413();
18  void reset() override;
19  void writePort(bool port, uint8_t value, int cycle_offset) override;
20  void pokeReg(uint8_t reg, uint8_t value) override;
21  uint8_t peekReg(uint8_t reg) const override;
22  void generateChannels(float* out[9 + 5], uint32_t n) override;
23  float getAmplificationFactor() const override;
24 
25  template<typename Archive>
26  void serialize(Archive& ar, unsigned version);
27 
28 private:
29  opll_t opll;
30  struct Write {
31  uint8_t port = uint8_t(-1);
32  uint8_t value;
33  } writes[18];
34 
35  // only used for peekReg();
36  uint8_t regs[64];
37  uint8_t latch;
38 
39  int allowed_offset = 0;
40 };
41 
42 } // namespace OriginalNuke
43 } // namespace openmsx
44 
45 #endif
openmsx::YM2413OriginalNukeYKT::YM2413::serialize
void serialize(Archive &ar, unsigned version)
Definition: YM2413OriginalNukeYKT.cc:103
opll.hh
openmsx::YM2413OriginalNukeYKT::YM2413::writePort
void writePort(bool port, uint8_t value, int cycle_offset) override
Write to the YM2413 register/data port.
Definition: YM2413OriginalNukeYKT.cc:64
openmsx::YM2413OriginalNukeYKT::YM2413::pokeReg
void pokeReg(uint8_t reg, uint8_t value) override
Write to a YM2413 register (for debug).
Definition: YM2413OriginalNukeYKT.cc:87
openmsx::YM2413OriginalNukeYKT::YM2413::YM2413
YM2413()
Definition: YM2413OriginalNukeYKT.cc:8
openmsx::YM2413OriginalNukeYKT::YM2413::getAmplificationFactor
float getAmplificationFactor() const override
Returns normalization factor.
Definition: YM2413OriginalNukeYKT.cc:97
openmsx::YM2413OriginalNukeYKT::YM2413::peekReg
uint8_t peekReg(uint8_t reg) const override
Read from a YM2413 register (for debug).
Definition: YM2413OriginalNukeYKT.cc:92
openmsx::YM2413OriginalNukeYKT::YM2413::generateChannels
void generateChannels(float *out[9+5], uint32_t n) override
Definition: YM2413OriginalNukeYKT.cc:21
openmsx::YM2413OriginalNukeYKT::YM2413
Definition: YM2413OriginalNukeYKT.hh:15
openmsx::YM2413Core
Abstract interface for the YM2413 core.
Definition: YM2413Core.hh:27
opll_t
Definition: opll.hh:80
YM2413Core.hh
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::YM2413OriginalNukeYKT::YM2413::reset
void reset() override
Reset this YM2413 core.
Definition: YM2413OriginalNukeYKT.cc:13