Previous 199869 Revisions Next

r30599 Thursday 22nd May, 2014 at 18:11:04 UTC by hap
give cps3 sound its own headerfile
[src/mame/audio]cps3.c cps3.h*
[src/mame/drivers]cps3.c
[src/mame/includes]cps3.h

trunk/src/mame/audio/cps3.c
r30598r30599
55***************************************************************************/
66
77#include "emu.h"
8#include "includes/cps3.h"
8#include "includes/cps3.h" // ! see m_base
9#include "cps3.h"
910
1011
1112// device type definition
r30598r30599
5556   memset(outputs[0], 0, samples*sizeof(*outputs[0]));
5657   memset(outputs[1], 0, samples*sizeof(*outputs[1]));
5758
58   for (int i = 0; i < CPS3_VOICES; i ++)
59   for (int i = 0; i < 16; i ++)
5960   {
6061      if (m_key & (1 << i))
6162      {
r30598r30599
147148
148149      UINT16 key = data >> 16;
149150
150      for (int i = 0; i < CPS3_VOICES; i++)
151      for (int i = 0; i < 16; i++)
151152      {
152153         // Key off -> Key on
153154         if ((key & (1 << i)) && !(m_key & (1 << i)))
trunk/src/mame/audio/cps3.h
r0r30599
1/***************************************************************************
2
3    Capcom CPS-3 Sound Hardware
4
5****************************************************************************/
6
7//**************************************************************************
8//  TYPE DEFINITIONS
9//**************************************************************************
10
11struct cps3_voice
12{
13   cps3_voice() :
14      pos(0),
15      frac(0)
16   {
17      memset(regs, 0, sizeof(UINT32)*8);
18   }
19
20   UINT32 regs[8];
21   UINT32 pos;
22   UINT32 frac;
23};
24
25// ======================> cps3_sound_device
26
27class cps3_sound_device : public device_t,
28                     public device_sound_interface
29{
30public:
31   cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
32   ~cps3_sound_device() { }
33
34protected:
35   // device-level overrides
36   virtual void device_start();
37
38   // sound stream update overrides
39   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
40
41public:
42   DECLARE_WRITE32_MEMBER( cps3_sound_w );
43   DECLARE_READ32_MEMBER( cps3_sound_r );
44
45private:
46   sound_stream *m_stream;
47   cps3_voice m_voice[16];
48   UINT16     m_key;
49   INT8*      m_base;
50};
51
52extern const device_type CPS3;
Property changes on: trunk/src/mame/audio/cps3.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mame/includes/cps3.h
r30598r30599
1212public:
1313   cps3_state(const machine_config &mconfig, device_type type, const char *tag)
1414      : driver_device(mconfig, type, tag),
15      m_maincpu(*this, "maincpu"),
16      m_gfxdecode(*this, "gfxdecode"),
17      m_palette(*this, "palette"),
1518      m_mainram(*this, "mainram"),
1619      m_spriteram(*this, "spriteram"),
1720      m_colourram(*this, "colourram"),
r30598r30599
2023      m_tilemap40_regs_base(*this, "tmap40_regs"),
2124      m_tilemap50_regs_base(*this, "tmap50_regs"),
2225      m_fullscreenzoom(*this, "fullscreenzoom"),
23      m_0xc0000000_ram(*this, "0xc0000000_ram"),
24      m_maincpu(*this, "maincpu"),
25      m_gfxdecode(*this, "gfxdecode"),
26      m_palette(*this, "palette") { }
26      m_0xc0000000_ram(*this, "0xc0000000_ram")
27   { }
2728
29   required_device<sh2_device> m_maincpu;
30   required_device<gfxdecode_device> m_gfxdecode;
31   required_device<palette_device> m_palette;
32
2833   required_shared_ptr<UINT32> m_mainram;
2934   required_shared_ptr<UINT32> m_spriteram;
3035   required_shared_ptr<UINT32> m_colourram;
r30598r30599
7176   unsigned short m_lastb;
7277   unsigned short m_lastb2;
7378   UINT8* m_user5region;
79
7480   DECLARE_READ32_MEMBER(cps3_ssram_r);
7581   DECLARE_WRITE32_MEMBER(cps3_ssram_w);
7682   DECLARE_WRITE32_MEMBER(cps3_0xc0000000_ram_w);
r30598r30599
130136   void cps3_process_character_dma(UINT32 address);
131137   void copy_from_nvram();
132138   inline void cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangle &clip, gfx_element *gfx,
133                           unsigned int code, unsigned int color, int flipx, int flipy, int sx, int sy,
134                           int transparency, int transparent_color,
135                           int scalex, int scaley, bitmap_ind8 *pri_buffer, UINT32 pri_mask);
136
137   required_device<sh2_device> m_maincpu;
138   required_device<gfxdecode_device> m_gfxdecode;
139   required_device<palette_device> m_palette;
139      unsigned int code, unsigned int color, int flipx, int flipy, int sx, int sy,
140      int transparency, int transparent_color,
141      int scalex, int scaley, bitmap_ind8 *pri_buffer, UINT32 pri_mask);
140142};
141
142
143/*----------- defined in audio/cps3.c -----------*/
144
145#define CPS3_VOICES (16)
146
147//**************************************************************************
148//  TYPE DEFINITIONS
149//**************************************************************************
150
151struct cps3_voice
152{
153   cps3_voice() :
154      pos(0),
155      frac(0)
156   {
157      memset(regs, 0, sizeof(UINT32)*8);
158   }
159
160   UINT32 regs[8];
161   UINT32 pos;
162   UINT32 frac;
163};
164
165// ======================> cps3_sound_device
166
167class cps3_sound_device : public device_t,
168                     public device_sound_interface
169{
170public:
171   cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
172   ~cps3_sound_device() { }
173
174protected:
175   // device-level overrides
176   virtual void device_start();
177
178   // sound stream update overrides
179   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
180
181public:
182   DECLARE_WRITE32_MEMBER( cps3_sound_w );
183   DECLARE_READ32_MEMBER( cps3_sound_r );
184
185private:
186   sound_stream *m_stream;
187   cps3_voice m_voice[CPS3_VOICES];
188   UINT16     m_key;
189   INT8*      m_base;
190};
191
192extern const device_type CPS3;
trunk/src/mame/drivers/cps3.c
r30598r30599
462462#include "machine/intelfsh.h"
463463#include "machine/nvram.h"
464464#include "includes/cps3.h"
465#include "audio/cps3.h"
465466#include "bus/scsi/scsi.h"
466467#include "bus/scsi/scsicd.h"
467468#include "machine/wd33c93.h"

Previous 199869 Revisions Next


© 1997-2024 The MAME Team