This commit is contained in:
tildearrow 2022-01-31 16:40:47 -05:00
parent 9492edcdab
commit 23ff23f7e7
2 changed files with 10 additions and 5 deletions

View file

@ -1263,11 +1263,16 @@ void ay8910_device::device_start()
} }
void ay8910_device::ay8910_reset_ym() void ay8910_device::ay8910_reset_ym(bool ay8930)
{ {
m_active = false; m_active = false;
m_register_latch = 0; m_register_latch = 0;
if (ay8930) {
printf("8930 reset\n");
m_rng = 0x1ffff;
} else {
m_rng = 1; m_rng = 1;
}
m_mode = 0; // ay-3-8910 compatible mode m_mode = 0; // ay-3-8910 compatible mode
m_noise_and = 0xff; m_noise_and = 0xff;
m_noise_or = 0; m_noise_or = 0;
@ -1376,7 +1381,7 @@ unsigned char ay8910_device::ay8910_read_ym()
void ay8910_device::device_reset() void ay8910_device::device_reset()
{ {
ay8910_reset_ym(); ay8910_reset_ym(chip_type == AY8930);
} }
/************************************* /*************************************

View file

@ -97,7 +97,7 @@ public:
void data_w(unsigned char data); void data_w(unsigned char data);
// /RES // /RES
void reset_w(unsigned char data = 0) { ay8910_reset_ym(); } void reset_w(unsigned char data = 0) { ay8910_reset_ym(chip_type == AY8930); }
// use this when BC1 == A0; here, BC1=0 selects 'data' and BC1=1 selects 'latch address' // use this when BC1 == A0; here, BC1=0 selects 'data' and BC1=1 selects 'latch address'
void data_address_w(int offset, unsigned char data) { ay8910_write_ym(~offset & 1, data); } // note that directly connecting BC1 to A0 puts data on 0 and address on 1 void data_address_w(int offset, unsigned char data) { ay8910_write_ym(~offset & 1, data); } // note that directly connecting BC1 to A0 puts data on 0 and address on 1
@ -138,7 +138,7 @@ public:
void ay8910_write_ym(int addr, unsigned char data); void ay8910_write_ym(int addr, unsigned char data);
unsigned char ay8910_read_ym(); unsigned char ay8910_read_ym();
void ay8910_reset_ym(); void ay8910_reset_ym(bool ay8930);
private: private:
static constexpr int NUM_CHANNELS = 3; static constexpr int NUM_CHANNELS = 3;