diff --git a/src/emu/cpu/dsp16/dsp16.c b/src/emu/cpu/dsp16/dsp16.c index b4e221b0791..1617aaae933 100644 --- a/src/emu/cpu/dsp16/dsp16.c +++ b/src/emu/cpu/dsp16/dsp16.c @@ -322,6 +322,11 @@ void dsp16_device::execute_set_input(int inputnum, int state) void dsp16_device::execute_run() { + // HACK TO MAKE CPU DO NOTHING. + // REMOVE IF DEVELOPING CPU CORE. + m_icount = 0; + return; + do { // debugging diff --git a/src/emu/sound/qsound.c b/src/emu/sound/qsound.c index ad224cade2c..34a62ad5c2f 100644 --- a/src/emu/sound/qsound.c +++ b/src/emu/sound/qsound.c @@ -44,6 +44,39 @@ const device_type QSOUND = &device_creator; +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +// program map for the DSP (points to internal 4096 words of internal ROM) +static ADDRESS_MAP_START( dsp16_program_map, AS_PROGRAM, 16, qsound_device ) + AM_RANGE(0x0000, 0x0fff) AM_ROM +ADDRESS_MAP_END + + +// data map for the DSP (the dsp16 appears to use 2048 words of internal RAM) +static ADDRESS_MAP_START( dsp16_data_map, AS_DATA, 16, qsound_device ) + ADDRESS_MAP_UNMAP_HIGH + AM_RANGE(0x0000, 0x07ff) AM_RAM +ADDRESS_MAP_END + + +// machine fragment +static MACHINE_CONFIG_FRAGMENT( qsound ) + MCFG_CPU_ADD("qsound", DSP16, QSOUND_CLOCK) + MCFG_CPU_PROGRAM_MAP(dsp16_program_map) + MCFG_CPU_DATA_MAP(dsp16_data_map) +MACHINE_CONFIG_END + + +// ROM definition for the Qsound program ROM +// NOTE: ROM is marked as bad since a handful of questionable bits haven't been fully examined. +ROM_START( qsound ) + ROM_REGION( 0x2000, "qsound", 0 ) + ROM_LOAD16_WORD( "qsound.bin", 0x0000, 0x2000, BAD_DUMP CRC(059c847d) SHA1(229cead1be2f86733dd80573d4983ba482355ece) ) +ROM_END + + //************************************************************************** // LIVE DEVICE //************************************************************************** @@ -53,19 +86,42 @@ const device_type QSOUND = &device_creator; //------------------------------------------------- qsound_device::qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, QSOUND, "Q-Sound", tag, owner, clock), - device_sound_interface(mconfig, *this), - m_data(0), - m_stream(NULL), - m_sample_rom_length(0), - m_sample_rom(NULL), - m_frq_ratio(0.0f), - m_fpRawDataL(NULL), - m_fpRawDataR(NULL) + : device_t(mconfig, QSOUND, "Q-Sound", tag, owner, clock, "qsound"), + device_sound_interface(mconfig, *this), + m_data(0), + m_stream(NULL), + m_sample_rom_length(0), + m_sample_rom(NULL), + m_cpu(NULL), + m_frq_ratio(0.0f), + m_fpRawDataL(NULL), + m_fpRawDataR(NULL) { } +//------------------------------------------------- +// rom_region - return a pointer to the device's +// internal ROM region +//------------------------------------------------- + +const rom_entry *qsound_device::device_rom_region() const +{ + return ROM_NAME( qsound ); +} + + +//------------------------------------------------- +// machine_config_additions - return a pointer to +// the device's machine fragment +//------------------------------------------------- + +machine_config_constructor qsound_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( qsound ); +} + + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -74,6 +130,9 @@ void qsound_device::device_start() { int i; + // find our CPU + m_cpu = subdevice("qsound"); + m_sample_rom = (QSOUND_SRC_SAMPLE *)*region(); m_sample_rom_length = region()->bytes(); diff --git a/src/emu/sound/qsound.h b/src/emu/sound/qsound.h index 7c4676d3424..396c4a16b85 100644 --- a/src/emu/sound/qsound.h +++ b/src/emu/sound/qsound.h @@ -9,6 +9,8 @@ #ifndef __QSOUND_H__ #define __QSOUND_H__ +#include "cpu/dsp16/dsp16.h" + #define QSOUND_CLOCK 4000000 /* default 4MHz clock */ #define QSOUND_CLOCKDIV 166 /* Clock divider */ @@ -55,7 +57,7 @@ struct QSOUND_CHANNEL // ======================> qsound_device class qsound_device : public device_t, - public device_sound_interface + public device_sound_interface { public: qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -63,6 +65,8 @@ public: protected: // device-level overrides + const rom_entry *device_rom_region() const; + machine_config_constructor device_mconfig_additions() const; virtual void device_start(); virtual void device_stop(); @@ -82,6 +86,7 @@ private: QSOUND_CHANNEL m_channel[QSOUND_CHANNELS]; UINT32 m_sample_rom_length; QSOUND_SRC_SAMPLE *m_sample_rom; // Q sound sample ROM + dsp16_device *m_cpu; int m_pan_table[33]; // Pan volume table float m_frq_ratio; // Frequency ratio diff --git a/src/emu/sound/sound.mak b/src/emu/sound/sound.mak index 9eec4f491c8..f162cac0444 100644 --- a/src/emu/sound/sound.mak +++ b/src/emu/sound/sound.mak @@ -444,7 +444,7 @@ SOUNDOBJS += $(SOUNDOBJ)/qs1000.o #------------------------------------------------- ifneq ($(filter QSOUND,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/qsound.o +SOUNDOBJS += $(SOUNDOBJ)/qsound.o $(CPUOBJ)/dsp16/dsp16.o $(CPUOBJ)/dsp16/dsp16dis.o endif