gts1: added outputs

This commit is contained in:
Robbbert 2022-03-07 09:54:43 +11:00
parent 0f39b1b1b2
commit 0fdcbb8415
2 changed files with 42 additions and 17 deletions

View File

@ -69,8 +69,8 @@ uint8_t gottlieb_sound_r0_device::r6530b_r()
void gottlieb_sound_r0_device::write(uint8_t data)
{
// write the command data to the low 4 bits
uint8_t pb0_3 = data ^ 15; // U7
// write the command data to bits 0-3 (also bit 6 used in system1 pinballs)
uint8_t pb0_3 = ~data & 0x4f; // U7
uint8_t pb4_7 = ioport("SB0")->read() & 0x90;
m_sndcmd = pb0_3 | pb4_7;
m_r6530->write(2, m_sndcmd); // push to portB, but doesn't seem to be needed
@ -98,11 +98,11 @@ void gottlieb_sound_r0_device::gottlieb_sound_r0_map(address_map &map)
INPUT_PORTS_START( gottlieb_sound_r0 )
PORT_START("SB0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Sound Test") PORT_CODE(KEYCODE_7_PAD) PORT_CHANGED_MEMBER(DEVICE_SELF, gottlieb_sound_r0_device, audio_nmi, 0)
PORT_DIPNAME( 0x10, 0x00, "Sound during game" )
PORT_DIPSETTING( 0x10, "Continuous" )
PORT_DIPSETTING( 0x00, "Scoring only" )
PORT_DIPNAME( 0x40, 0x00, "Attract Sound" )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPNAME( 0x80, 0x00, "Sound or Tones" )
PORT_DIPSETTING( 0x80, "Sound" )
PORT_DIPSETTING( 0x00, "Tones" )
PORT_DIPNAME( 0x10, 0x00, "Attract Sound" )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) ) // Makes a sound every 6 minutes
INPUT_PORTS_END
@ -122,16 +122,16 @@ INPUT_CHANGED_MEMBER( gottlieb_sound_r0_device::audio_nmi )
void gottlieb_sound_r0_device::device_add_mconfig(machine_config &config)
{
// audio CPU
M6502(config, m_audiocpu, SOUND1_CLOCK/4); // M6503 - clock is a gate, a resistor and a capacitor. Freq unknown.
M6502(config, m_audiocpu, 800'000); // M6503 - clock is a gate, a resistor and a capacitor. Freq 675-1000kHz.
m_audiocpu->set_addrmap(AS_PROGRAM, &gottlieb_sound_r0_device::gottlieb_sound_r0_map);
// I/O configuration
MOS6530(config, m_r6530, SOUND1_CLOCK/4); // unknown - same as cpu
MOS6530(config, m_r6530, 800'000); // same as cpu
m_r6530->out_pa_callback().set("dac", FUNC(dac_byte_interface::data_w));
m_r6530->in_pb_callback().set(FUNC(gottlieb_sound_r0_device::r6530b_r));
// sound devices
DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, *this, 0.25); // unknown DAC
MC1408(config, "dac", 0).add_route(ALL_OUTPUTS, *this, 0.50); // SSS1408-6P
}

View File

@ -107,6 +107,7 @@ public:
, m_r0_sound(*this, "r0sound")
, m_digit8(*this, "digit8_%u", 0U)
, m_digit7(*this, "digit7_%u", 0U)
, m_io_outputs(*this, "out%d", 0U)
{ }
void gts1(machine_config &config);
@ -142,6 +143,7 @@ private:
optional_device<gottlieb_sound_r0_device> m_r0_sound;
output_finder<32> m_digit8; // digits 0-5,8-13,16-21,24-29
output_finder<32> m_digit7; // digits 6,7,14,15 on repurposed digital clock display
output_finder<44> m_io_outputs; // 8 solenoids + 36 lamps
u8 m_strobe = 0; //!< switches strobe lines (5 lower bits used)
u8 m_nvram_addr = 0xff; //!< NVRAM address
@ -150,6 +152,8 @@ private:
bool m_nvram_wr = 0; //!< NVRWAM write (W/R line)
u16 m_6351_addr = 0; //!< ROM MM6351 address (12 bits)
u8 m_z30_out = 0; //!< 4-to-16 decoder outputs
u8 m_lamp_data = 0U;
u8 m_snd_save = 0U;
};
void gts1_state::gts1_map(address_map &map)
@ -378,10 +382,9 @@ INPUT_PORTS_END
void gts1_state::machine_start()
{
genpin_class::machine_start();
m_digit8.resolve();
m_digit7.resolve();
m_io_outputs.resolve();
save_item(NAME(m_strobe));
save_item(NAME(m_nvram_addr));
@ -390,19 +393,21 @@ void gts1_state::machine_start()
save_item(NAME(m_nvram_wr));
save_item(NAME(m_6351_addr));
save_item(NAME(m_z30_out));
save_item(NAME(m_lamp_data));
save_item(NAME(m_snd_save));
}
void gts1_state::machine_reset()
{
genpin_class::machine_reset();
m_strobe = 0;
m_nvram_addr = 0xff;
m_nvram_data = 0;
m_nvram_e2 = false;
m_nvram_wr = false;
m_6351_addr = 0x3ff;
m_z30_out = 0;
m_z30_out = 0U;
m_lamp_data = 0U;
m_snd_save = 0U;
}
u8 gts1_state::gts1_solenoid_r(offs_t offset) // does nothing
@ -426,14 +431,17 @@ void gts1_state::gts1_solenoid_w(offs_t offset, u8 data) // WORKS
m_samples->start(0, 6);
break;
case 2: // tens chime
m_snd_save = data ? (m_snd_save | 4) : (m_snd_save & 0xfb);
if (!m_r0_sound && data)
m_samples->start(3, 3);
break;
case 3: // hundreds chime
m_snd_save = data ? (m_snd_save | 2) : (m_snd_save & 0xfd);
if (!m_r0_sound && data)
m_samples->start(2, 2);
break;
case 4: // thousands chime
m_snd_save = data ? (m_snd_save | 1) : (m_snd_save & 0xfe);
if (!m_r0_sound && data)
m_samples->start(1, 1);
break;
@ -458,8 +466,11 @@ void gts1_state::gts1_solenoid_w(offs_t offset, u8 data) // WORKS
case 15: // spare
break;
}
if (m_r0_sound && data)
m_r0_sound->write(offset);
if (m_r0_sound)
m_r0_sound->write(m_snd_save);
if (offset < 8)
m_io_outputs[offset] = data;
}
u8 gts1_state::gts1_switches_r(offs_t offset) // only switches with offset 0 are working; can't go in-game to try the others **********
@ -650,9 +661,23 @@ void gts1_state::gts1_lamp_apm_w(offs_t offset, u8 data) // Working for the dips
{
switch (offset) {
case 0: // LD1-LD4 on jumper J5 // lamps - TODO *********
m_lamp_data = data & 15;
break;
case 1: // Z30 1-of-16 decoder // lamps - TODO *********
m_z30_out = ~data & 15;
if (m_z30_out == 1)
{
if (m_r0_sound)
{
// Sound card has inputs from tilt and game over relays
m_snd_save = BIT(m_lamp_data, 0) ? (m_snd_save | 0x40) : (m_snd_save & 0xbf);
m_snd_save = BIT(m_lamp_data, 1) ? (m_snd_save | 0x08) : (m_snd_save & 0xf7);
m_r0_sound->write(m_snd_save);
}
}
if ((m_z30_out >= 1) && (m_z30_out <= 9))
for (u8 i = 0; i < 4; i++)
m_io_outputs[4+m_z30_out*4+i] = BIT(m_lamp_data, i);
break;
case 2: // O9: PGOL PROM A8, O10: PGOL PROM A9
m_6351_addr = (m_6351_addr & 0xff) | ((data & 3) << 8);