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#include <array>
11
13
14class YM2413 final : public YM2413Core
15{
16public:
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 [[nodiscard]] uint8_t peekReg(uint8_t reg) const override;
22 void generateChannels(std::span<float*, 9 + 5> out, uint32_t n) override;
23 [[nodiscard]] float getAmplificationFactor() const override;
24 void setSpeed(double speed) override;
25
26 template<typename Archive>
27 void serialize(Archive& ar, unsigned version);
28
29private:
30 opll_t opll;
31 struct Write {
32 uint8_t port = uint8_t(-1);
33 uint8_t value;
34 };
35 std::array<Write, 18> writes;
36
37 // only used for peekReg();
38 std::array<uint8_t, 64> regs;
39 uint8_t latch;
40
41 int allowed_offset = 0;
42 bool speedUpHack = false;
43};
44
45} // namespace openmsx::OriginalNuke
46
47#endif
Abstract interface for the YM2413 core.
Definition YM2413Core.hh:28
void serialize(Archive &ar, unsigned version)
void generateChannels(std::span< float *, 9+5 > out, uint32_t n) override
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 setSpeed(double speed) override
Sets real-time speed factor (aka the openMSX 'speed' setting).
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