summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2022-05-25 23:51:48 +1000
committer Robbbert <Robbbert@users.noreply.github.com>2022-05-25 23:51:48 +1000
commit362201a23b566e8ebef5b500f182b18a46e50a95 (patch)
tree14d1e63d5b6ba863369438c2ce78c24c8a3ccbf4 /src
parentf28212d5246de16a0b81baa0c150b190e45eb0e1 (diff)
gts1: improved the sound
Diffstat (limited to 'src')
-rw-r--r--src/mame/drivers/gts1.cpp40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/mame/drivers/gts1.cpp b/src/mame/drivers/gts1.cpp
index be4663fdc88..51deef86372 100644
--- a/src/mame/drivers/gts1.cpp
+++ b/src/mame/drivers/gts1.cpp
@@ -161,7 +161,6 @@ private:
u16 m_6351_addr = 0U; //!< ROM MM6351 address (12 bits)
u8 m_z30_out = 0U; //!< 4-to-16 decoder outputs
u8 m_lamp_data = 0U;
- u8 m_snd_save = 0U;
};
void gts1_state::gts1_map(address_map &map)
@@ -402,7 +401,6 @@ void gts1_state::machine_start()
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()
@@ -415,7 +413,6 @@ void gts1_state::machine_reset()
m_6351_addr = 0x3ff;
m_z30_out = 0U;
m_lamp_data = 0U;
- m_snd_save = 0U;
}
u8 gts1_state::gts1_solenoid_r(offs_t offset) // does nothing
@@ -425,7 +422,7 @@ u8 gts1_state::gts1_solenoid_r(offs_t offset) // does nothing
return data;
}
-void gts1_state::gts1_solenoid_w(offs_t offset, u8 data) // WORKS
+void gts1_state::gts1_solenoid_w(offs_t offset, u8 data)
{
//LOG("%s: solenoid #[%02X] gets data=%X\n", __FUNCTION__, offset, data);
switch (offset)
@@ -439,36 +436,42 @@ 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_p1_sound)
{
m_p1_sound->set_clock(593);
m_p1_sound->set_state(data);
}
else
- if (!m_p2_sound && data)
+ if (m_p2_sound)
+ m_p2_sound->write(data ? 11 : 15);
+ else
+ if (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_p1_sound)
{
m_p1_sound->set_clock(265);
m_p1_sound->set_state(data);
}
else
- if (!m_p2_sound && data)
+ if (m_p2_sound)
+ m_p2_sound->write(data ? 13 : 15);
+ else
+ if (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_p1_sound)
{
m_p1_sound->set_clock(153);
m_p1_sound->set_state(data);
}
else
- if (!m_p2_sound && data)
+ if (m_p2_sound)
+ m_p2_sound->write(data ? 14 : 15);
+ else
+ if (data)
m_samples->start(1, 1);
break;
case 5: // optional per machine
@@ -492,8 +495,6 @@ void gts1_state::gts1_solenoid_w(offs_t offset, u8 data) // WORKS
case 15: // spare
break;
}
- if (m_p2_sound)
- m_p2_sound->write(m_snd_save);
if (offset < 8)
m_io_outputs[offset] = data;
@@ -685,6 +686,7 @@ u8 gts1_state::gts1_lamp_apm_r(offs_t offset) // Think this works - dips seem to
*/
void gts1_state::gts1_lamp_apm_w(offs_t offset, u8 data)
{
+ u8 sndcmd = 0;
switch (offset) {
case 0: // LD1-LD4 on jumper J5
m_lamp_data = data & 15;
@@ -696,9 +698,11 @@ void gts1_state::gts1_lamp_apm_w(offs_t offset, u8 data)
if (m_p2_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_p2_sound->write(m_snd_save);
+ if (BIT(m_lamp_data, 0))
+ sndcmd |= 0x40;
+ if (BIT(m_lamp_data, 1))
+ sndcmd |= 0x08;
+ m_p2_sound->write(sndcmd);
}
}
if ((m_z30_out >= 1) && (m_z30_out <= 9))
@@ -1065,11 +1069,11 @@ GAME(1977, cleoptra, gts1, p0, gts1, gts1_state, empty_init, ROT0, "Gott
GAME(1978, sinbad, gts1, p0, gts1, gts1_state, empty_init, ROT0, "Gottlieb", "Sinbad", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )
GAME(1978, sinbadn, sinbad, p0, gts1, gts1_state, empty_init, ROT0, "Gottlieb", "Sinbad (Norway)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )
GAME(1978, jokrpokr, gts1, p0, jokrpokr, gts1_state, empty_init, ROT0, "Gottlieb", "Joker Poker", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )
-GAME(1978, dragon, gts1, p0, gts1, gts1_state, empty_init, ROT0, "Gottlieb", "Dragon", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )
-GAME(1979, solaride, gts1, p0, gts1, gts1_state, empty_init, ROT0, "Gottlieb", "Solar Ride", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )
-GAME(1979, countdwn, gts1, p0, gts1, gts1_state, empty_init, ROT0, "Gottlieb", "Count-Down", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )
// NE555 beeper
+GAME(1978, dragon, gts1, p1, gts1, gts1_state, empty_init, ROT0, "Gottlieb", "Dragon", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )
+GAME(1979, solaride, gts1, p1, gts1, gts1_state, empty_init, ROT0, "Gottlieb", "Solar Ride", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )
+GAME(1979, countdwn, gts1, p1, gts1, gts1_state, empty_init, ROT0, "Gottlieb", "Count-Down", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )
GAME(1978, closeenc, gts1, p1, gts1, gts1_state, empty_init, ROT0, "Gottlieb", "Close Encounters of the Third Kind", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )
GAME(1978, charlies, gts1, p1, gts1, gts1_state, empty_init, ROT0, "Gottlieb", "Charlie's Angels", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )
GAME(1979, pinpool, gts1, p1, gts1, gts1_state, empty_init, ROT0, "Gottlieb", "Pinball Pool", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )