summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu
diff options
context:
space:
mode:
author jbu <pullmoll@t-online.de>2016-07-30 09:17:01 +0200
committer jbu <pullmoll@t-online.de>2016-07-30 09:17:54 +0200
commit8821dd2733bb452f81507ef49673d601212df12a (patch)
tree281d3128e68f7827e4c71e5e8f1577d6061a6072 /src/devices/cpu
parentd3d3066357112cb44ca4de6358b854d46ad97e01 (diff)
alto2: add speaker sound
Some games, e.g. pinball-easy, use UTILOUT to generate buzzer sound.
Diffstat (limited to 'src/devices/cpu')
-rw-r--r--src/devices/cpu/alto2/a2hw.cpp1
-rw-r--r--src/devices/cpu/alto2/a2mem.cpp10
-rw-r--r--src/devices/cpu/alto2/alto2cpu.cpp11
-rw-r--r--src/devices/cpu/alto2/alto2cpu.h10
4 files changed, 21 insertions, 11 deletions
diff --git a/src/devices/cpu/alto2/a2hw.cpp b/src/devices/cpu/alto2/a2hw.cpp
index 4ece160d206..9c436433453 100644
--- a/src/devices/cpu/alto2/a2hw.cpp
+++ b/src/devices/cpu/alto2/a2hw.cpp
@@ -311,6 +311,7 @@ WRITE16_MEMBER( alto2_cpu_device::utilout_w )
// FIXME: write printer data
// printer_write();
+ m_speaker->level_w(data ? 1 : 0);
}
/**
diff --git a/src/devices/cpu/alto2/a2mem.cpp b/src/devices/cpu/alto2/a2mem.cpp
index e4fa65184f1..e64dd4a0a28 100644
--- a/src/devices/cpu/alto2/a2mem.cpp
+++ b/src/devices/cpu/alto2/a2mem.cpp
@@ -824,15 +824,7 @@ void alto2_cpu_device::init_memory()
void alto2_cpu_device::exit_memory()
{
- // no need for this since it free on exit by itself
- // if (m_mem.ram) {
- // auto_free(machine(), m_mem.ram);
- // m_mem.ram = 0;
- // }
- // if (m_mem.hpb) {
- // auto_free(machine(), m_mem.hpb);
- // m_mem.hpb = 0;
- // }
+ // nothing to do
}
void alto2_cpu_device::reset_memory()
diff --git a/src/devices/cpu/alto2/alto2cpu.cpp b/src/devices/cpu/alto2/alto2cpu.cpp
index 28db09474ef..49db9fb2297 100644
--- a/src/devices/cpu/alto2/alto2cpu.cpp
+++ b/src/devices/cpu/alto2/alto2cpu.cpp
@@ -207,6 +207,7 @@ alto2_cpu_device::alto2_cpu_device(const machine_config& mconfig, const char* ta
memset(m_sysclka1, 0x00, sizeof(m_sysclka1));
memset(m_sysclkb0, 0x00, sizeof(m_sysclkb0));
memset(m_sysclkb1, 0x00, sizeof(m_sysclkb1));
+ m_speaker = 0;
}
alto2_cpu_device::~alto2_cpu_device()
@@ -241,6 +242,16 @@ void alto2_cpu_device::set_diablo(int unit, diablo_hd_device* ptr)
}
//-------------------------------------------------
+// driver interface to set speaker_sound_device
+//-------------------------------------------------
+
+void alto2_cpu_device::set_speaker(speaker_sound_device* speaker)
+{
+ logerror("%s: speaker_sound_device=%p\n", __FUNCTION__, speaker);
+ m_speaker = speaker;
+}
+
+//-------------------------------------------------
// device_rom_region - device-specific (P)ROMs
//-------------------------------------------------
diff --git a/src/devices/cpu/alto2/alto2cpu.h b/src/devices/cpu/alto2/alto2cpu.h
index 34d959480ab..a0b7af2442a 100644
--- a/src/devices/cpu/alto2/alto2cpu.h
+++ b/src/devices/cpu/alto2/alto2cpu.h
@@ -12,6 +12,7 @@
#include "emu.h"
#include "debugger.h"
+#include "sound/speaker.h"
#include "machine/diablo_hd.h"
/**
@@ -191,6 +192,9 @@ public:
//! driver interface to set diablo_hd_device
void set_diablo(int unit, diablo_hd_device* ptr);
+ //! driver interface to set a speaker sound device
+ void set_speaker(speaker_sound_device* speaker);
+
//! call in for the next sector callback
void next_sector(int unit);
@@ -276,6 +280,8 @@ private:
int m_icount;
+ speaker_sound_device* m_speaker;
+
typedef void (alto2_cpu_device::*a2func)();
//! task numbers
@@ -558,8 +564,8 @@ private:
UINT8 m_d_bs; //!< decoded BS[0-2] bus source
UINT8 m_d_f1; //!< decoded F1[0-3] function
UINT8 m_d_f2; //!< decoded F2[0-3] function
- UINT8 m_d_loadt; //!< decoded LOADT flag
- UINT8 m_d_loadl; //!< decoded LOADL flag
+ UINT8 m_d_loadt; //!< decoded LOADT flag
+ UINT8 m_d_loadl; //!< decoded LOADL flag
UINT16 m_next; //!< current micro instruction's next
UINT16 m_next2; //!< next micro instruction's next
UINT16 m_r[ALTO2_REGS]; //!< R register file