Previous 199869 Revisions Next

r22618 Tuesday 30th April, 2013 at 16:26:35 UTC by Andrew Gardner
Adds the QSound internal DSP ROM to the device. [Andrew Gardner]
[src/emu/cpu/dsp16]dsp16.c
[src/emu/sound]qsound.c qsound.h sound.mak

trunk/src/emu/cpu/dsp16/dsp16.c
r22617r22618
322322
323323void dsp16_device::execute_run()
324324{
325   // HACK TO MAKE CPU DO NOTHING.
326   // REMOVE IF DEVELOPING CPU CORE.
327   m_icount = 0;
328   return;
329
325330   do
326331   {
327332      // debugging
trunk/src/emu/sound/sound.mak
r22617r22618
444444#-------------------------------------------------
445445
446446ifneq ($(filter QSOUND,$(SOUNDS)),)
447SOUNDOBJS += $(SOUNDOBJ)/qsound.o
447SOUNDOBJS += $(SOUNDOBJ)/qsound.o $(CPUOBJ)/dsp16/dsp16.o $(CPUOBJ)/dsp16/dsp16dis.o
448448endif
449449
450450
trunk/src/emu/sound/qsound.c
r22617r22618
4545
4646
4747//**************************************************************************
48//  GLOBAL VARIABLES
49//**************************************************************************
50
51// program map for the DSP (points to internal 4096 words of internal ROM)
52static ADDRESS_MAP_START( dsp16_program_map, AS_PROGRAM, 16, qsound_device )
53   AM_RANGE(0x0000, 0x0fff) AM_ROM
54ADDRESS_MAP_END
55
56
57// data map for the DSP (the dsp16 appears to use 2048 words of internal RAM)
58static ADDRESS_MAP_START( dsp16_data_map, AS_DATA, 16, qsound_device )
59   ADDRESS_MAP_UNMAP_HIGH
60   AM_RANGE(0x0000, 0x07ff) AM_RAM
61ADDRESS_MAP_END
62
63
64// machine fragment
65static MACHINE_CONFIG_FRAGMENT( qsound )
66   MCFG_CPU_ADD("qsound", DSP16, QSOUND_CLOCK)
67   MCFG_CPU_PROGRAM_MAP(dsp16_program_map)
68   MCFG_CPU_DATA_MAP(dsp16_data_map)
69MACHINE_CONFIG_END
70
71
72// ROM definition for the Qsound program ROM
73// NOTE: ROM is marked as bad since a handful of questionable bits haven't been fully examined.
74ROM_START( qsound )
75   ROM_REGION( 0x2000, "qsound", 0 )
76   ROM_LOAD16_WORD( "qsound.bin", 0x0000, 0x2000, BAD_DUMP CRC(059c847d) SHA1(229cead1be2f86733dd80573d4983ba482355ece) )
77ROM_END
78
79
80//**************************************************************************
4881//  LIVE DEVICE
4982//**************************************************************************
5083
r22617r22618
5386//-------------------------------------------------
5487
5588qsound_device::qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
56   : device_t(mconfig, QSOUND, "Q-Sound", tag, owner, clock),
57      device_sound_interface(mconfig, *this),
58      m_data(0),
59      m_stream(NULL),
60      m_sample_rom_length(0),
61      m_sample_rom(NULL),
62      m_frq_ratio(0.0f),
63      m_fpRawDataL(NULL),
64      m_fpRawDataR(NULL)
89   : device_t(mconfig, QSOUND, "Q-Sound", tag, owner, clock, "qsound"),
90     device_sound_interface(mconfig, *this),
91     m_data(0),
92     m_stream(NULL),
93     m_sample_rom_length(0),
94     m_sample_rom(NULL),
95     m_cpu(NULL),
96     m_frq_ratio(0.0f),
97     m_fpRawDataL(NULL),
98     m_fpRawDataR(NULL)
6599{
66100}
67101
68102
69103//-------------------------------------------------
104//  rom_region - return a pointer to the device's
105//  internal ROM region
106//-------------------------------------------------
107
108const rom_entry *qsound_device::device_rom_region() const
109{
110   return ROM_NAME( qsound );
111}
112
113
114//-------------------------------------------------
115//  machine_config_additions - return a pointer to
116//  the device's machine fragment
117//-------------------------------------------------
118
119machine_config_constructor qsound_device::device_mconfig_additions() const
120{
121   return MACHINE_CONFIG_NAME( qsound );
122}
123
124
125//-------------------------------------------------
70126//  device_start - device-specific startup
71127//-------------------------------------------------
72128
r22617r22618
74130{
75131   int i;
76132
133   // find our CPU
134   m_cpu = subdevice<dsp16_device>("qsound");
135
77136   m_sample_rom = (QSOUND_SRC_SAMPLE *)*region();
78137   m_sample_rom_length = region()->bytes();
79138
trunk/src/emu/sound/qsound.h
r22617r22618
99#ifndef __QSOUND_H__
1010#define __QSOUND_H__
1111
12#include "cpu/dsp16/dsp16.h"
13
1214#define QSOUND_CLOCK 4000000    /* default 4MHz clock */
1315
1416#define QSOUND_CLOCKDIV 166     /* Clock divider */
r22617r22618
5557// ======================> qsound_device
5658
5759class qsound_device : public device_t,
58                  public device_sound_interface
60                 public device_sound_interface
5961{
6062public:
6163   qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
r22617r22618
6365
6466protected:
6567   // device-level overrides
68   const rom_entry *device_rom_region() const;
69   machine_config_constructor device_mconfig_additions() const;
6670   virtual void device_start();
6771   virtual void device_stop();
6872
r22617r22618
8286   QSOUND_CHANNEL m_channel[QSOUND_CHANNELS];
8387   UINT32 m_sample_rom_length;
8488   QSOUND_SRC_SAMPLE *m_sample_rom;    // Q sound sample ROM
89   dsp16_device *m_cpu;
8590
8691   int m_pan_table[33];    // Pan volume table
8792   float m_frq_ratio;      // Frequency ratio

Previous 199869 Revisions Next


© 1997-2024 The MAME Team