Update previous commit

This commit is contained in:
cam900 2022-12-25 16:11:47 +09:00
parent 9a19a89370
commit c754504337
6 changed files with 34 additions and 43 deletions

View file

@ -60,8 +60,8 @@ class es5504_core : public es550x_shared_core
*this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this, *this,
*this, *this, *this, *this, *this, *this, *this} *this, *this, *this, *this, *this, *this, *this}
, m_adc(0) , m_adc(0)
, m_out{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
{ {
m_out.fill(0);
} }
// host interface // host interface
@ -111,7 +111,7 @@ class es5504_core : public es550x_shared_core
private: private:
std::array<voice_t, 25> m_voice; // 25 voices std::array<voice_t, 25> m_voice; // 25 voices
u16 m_adc = 0; // ADC register u16 m_adc = 0; // ADC register
std::array<s32, 16> m_out = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // 16 channel outputs std::array<s32, 16> m_out; // 16 channel outputs
}; };
#endif #endif

View file

@ -106,8 +106,8 @@ class es5505_core : public es550x_shared_core
, m_rvol(0) , m_rvol(0)
, m_ch(output_t()) , m_ch(output_t())
, m_mute(false) , m_mute(false)
, m_output{0, 0}
{ {
m_output.fill(0);
} }
// internal state // internal state
@ -143,7 +143,7 @@ class es5505_core : public es550x_shared_core
u8 m_rvol = 0; // Right volume u8 m_rvol = 0; // Right volume
output_t m_ch; // channel output output_t m_ch; // channel output
bool m_mute = false; // mute flag (for debug purpose) bool m_mute = false; // mute flag (for debug purpose)
std::array<s32, 2> m_output = {0, 0}; // output preview (for debug purpose) std::array<s32, 2> m_output; // output preview (for debug purpose)
}; };
class sermode_t : public vgsound_emu_core class sermode_t : public vgsound_emu_core

View file

@ -147,8 +147,8 @@ class es5506_core : public es550x_shared_core
, m_filtcount(0) , m_filtcount(0)
, m_ch(output_t()) , m_ch(output_t())
, m_mute(false) , m_mute(false)
, m_output{0, 0}
{ {
m_output.fill(0);
} }
// internal state // internal state
@ -211,7 +211,7 @@ class es5506_core : public es550x_shared_core
u8 m_filtcount = 0; // Internal counter for slow mode u8 m_filtcount = 0; // Internal counter for slow mode
output_t m_ch; // channel output output_t m_ch; // channel output
bool m_mute = false; // mute flag (for debug purpose) bool m_mute = false; // mute flag (for debug purpose)
std::array<s32, 2> m_output = {0, 0}; // output preview (for debug purpose) std::array<s32, 2> m_output; // output preview (for debug purpose)
}; };
// 5 bit mode // 5 bit mode

View file

@ -57,8 +57,8 @@ class k053260_core : public vgsound_emu_core
, m_bitpos(4) , m_bitpos(4)
, m_data(0) , m_data(0)
, m_adpcm_buf(0) , m_adpcm_buf(0)
, m_out{0, 0}
{ {
m_out.fill(0);
} }
// internal state // internal state
@ -112,7 +112,7 @@ class k053260_core : public vgsound_emu_core
u8 m_bitpos = 4; // bit position for ADPCM decoding u8 m_bitpos = 4; // bit position for ADPCM decoding
u8 m_data = 0; // current data u8 m_data = 0; // current data
s8 m_adpcm_buf = 0; // ADPCM buffer s8 m_adpcm_buf = 0; // ADPCM buffer
std::array<s32, 2> m_out = {0, 0}; // current output std::array<s32, 2> m_out; // current output
}; };
class ctrl_t class ctrl_t
@ -156,15 +156,15 @@ class k053260_core : public vgsound_emu_core
{ {
public: public:
ym3012_t() ym3012_t()
: m_in{0, 0}
, m_out{0, 0}
{ {
m_in.fill(0);
m_out.fill(0);
} }
void reset() void reset()
{ {
std::fill(m_in.begin(), m_in.end(), 0); m_in.fill(0);
std::fill(m_out.begin(), m_out.end(), 0); m_out.fill(0);
} }
void tick(u8 ch, s32 in) void tick(u8 ch, s32 in)
@ -174,8 +174,8 @@ class k053260_core : public vgsound_emu_core
} }
private: private:
std::array<s32, 2> m_in = {0, 0}; std::array<s32, 2> m_in;
std::array<s32, 2> m_out = {0, 0}; std::array<s32, 2> m_out;
}; };
class dac_t class dac_t
@ -212,17 +212,14 @@ class k053260_core : public vgsound_emu_core
: vgsound_emu_core("k053260") : vgsound_emu_core("k053260")
, m_voice{*this, *this, *this, *this} , m_voice{*this, *this, *this, *this}
, m_intf(intf) , m_intf(intf)
, m_host2snd{0, 0}
, m_snd2host{0, 0}
, m_ctrl(ctrl_t()) , m_ctrl(ctrl_t())
, m_ym3012(ym3012_t()) , m_ym3012(ym3012_t())
, m_dac(dac_t()) , m_dac(dac_t())
, m_reg{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
, m_out{0, 0}
{ {
m_host2snd.fill(0);
m_snd2host.fill(0);
m_reg.fill(0);
m_out.fill(0);
} }
// communications // communications
@ -252,19 +249,16 @@ class k053260_core : public vgsound_emu_core
std::array<voice_t, 4> m_voice; std::array<voice_t, 4> m_voice;
k053260_intf &m_intf; // common memory interface k053260_intf &m_intf; // common memory interface
std::array<u8, 2> m_host2snd = {0, 0}; std::array<u8, 2> m_host2snd;
std::array<u8, 2> m_snd2host = {0, 0}; std::array<u8, 2> m_snd2host;
ctrl_t m_ctrl; // chip control ctrl_t m_ctrl; // chip control
ym3012_t m_ym3012; // YM3012 output ym3012_t m_ym3012; // YM3012 output
dac_t m_dac; // YM3012 interface dac_t m_dac; // YM3012 interface
std::array<u8, 64> m_reg = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, std::array<u8, 64> m_reg; // register pool
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, std::array<s32, 2> m_out; // stereo output
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // register pool
std::array<s32, 2> m_out = {0, 0}; // stereo output
}; };
#endif #endif

View file

@ -61,11 +61,11 @@ class n163_core : public vgsound_emu_core
, m_voice_cycle(0x78) , m_voice_cycle(0x78)
, m_addr_latch(addr_latch_t()) , m_addr_latch(addr_latch_t())
, m_out(0) , m_out(0)
, m_voice_out{0, 0, 0, 0, 0, 0, 0, 0}
, m_multiplex(true) , m_multiplex(true)
, m_acc(0) , m_acc(0)
{ {
m_ram.fill(0); m_ram.fill(0);
m_voice_out.fill(0);
} }
// accessors, getters, setters // accessors, getters, setters
@ -97,12 +97,12 @@ class n163_core : public vgsound_emu_core
private: private:
bool m_disable = false; bool m_disable = false;
std::array<u8, 0x80> m_ram ; // internal 128 byte RAM std::array<u8, 0x80> m_ram; // internal 128 byte RAM
u8 m_voice_cycle = 0x78; // Voice cycle for processing u8 m_voice_cycle = 0x78; // Voice cycle for processing
addr_latch_t m_addr_latch; // address latch addr_latch_t m_addr_latch; // address latch
s16 m_out = 0; // output s16 m_out = 0; // output
std::array<s16, 8> m_voice_out = {0, 0, 0, 0, 0, 0, 0, 0}; // per-voice output, for preview only std::array<s16, 8> m_voice_out; // per-voice output, for preview only
// demultiplex related // demultiplex related
bool m_multiplex = true; // multiplex flag, but less noisy = inaccurate! bool m_multiplex = true; // multiplex flag, but less noisy = inaccurate!
s16 m_acc = 0; // accumulated output s16 m_acc = 0; // accumulated output

View file

@ -29,10 +29,6 @@ class scc_core : public vgsound_emu_core
voice_t(scc_core &host) voice_t(scc_core &host)
: vgsound_emu_core("scc_voice") : vgsound_emu_core("scc_voice")
, m_host(host) , m_host(host)
, m_wave{0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0}
, m_enable(false) , m_enable(false)
, m_pitch(0) , m_pitch(0)
, m_volume(0) , m_volume(0)
@ -40,6 +36,7 @@ class scc_core : public vgsound_emu_core
, m_counter(0) , m_counter(0)
, m_out(0) , m_out(0)
{ {
m_wave.fill(0);
} }
// internal state // internal state
@ -72,10 +69,7 @@ class scc_core : public vgsound_emu_core
private: private:
// registers // registers
scc_core &m_host; scc_core &m_host;
std::array<s8, 32> m_wave = {0, 0, 0, 0, 0, 0, 0, 0, std::array<s8, 32> m_wave; // internal waveform
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0}; // internal waveform
bool m_enable = false; // output enable flag bool m_enable = false; // output enable flag
u16 m_pitch : 12; // pitch u16 m_pitch : 12; // pitch
u16 m_volume : 4; // volume u16 m_volume : 4; // volume
@ -275,9 +269,12 @@ class k052539_core : public k052539_scc_core
public: public:
k052539_mapper_t() k052539_mapper_t()
: vgsound_emu_core("k052539_mapper") : vgsound_emu_core("k052539_mapper")
, m_bank{0, 1, 2, 3}
, m_ram_enable{false}
{ {
m_bank[0] = 0;
m_bank[1] = 1;
m_bank[2] = 2;
m_bank[3] = 3;
m_ram_enable.fill(false);
} }
// internal state // internal state
@ -298,8 +295,8 @@ class k052539_core : public k052539_scc_core
private: private:
// registers // registers
std::array<u8, 4> m_bank = {0, 1, 2, 3}; std::array<u8, 4> m_bank;
std::array<bool, 4> m_ram_enable = {false}; std::array<bool, 4> m_ram_enable;
}; };
public: public: