give cps3 sound its own headerfile

This commit is contained in:
Michaël Banaan Ananas 2014-05-22 18:11:04 +00:00
parent e3dc0055c0
commit 9a7303ce8b
5 changed files with 71 additions and 66 deletions

1
.gitattributes vendored
View File

@ -4096,6 +4096,7 @@ src/mame/audio/circus.c svneol=native#text/plain
src/mame/audio/cliffhgr.c svneol=native#text/plain
src/mame/audio/copsnrob.c svneol=native#text/plain
src/mame/audio/cps3.c svneol=native#text/plain
src/mame/audio/cps3.h svneol=native#text/plain
src/mame/audio/crbaloon.c svneol=native#text/plain
src/mame/audio/cyberbal.c svneol=native#text/plain
src/mame/audio/dcs.c svneol=native#text/plain

View File

@ -5,7 +5,8 @@
***************************************************************************/
#include "emu.h"
#include "includes/cps3.h"
#include "includes/cps3.h" // ! see m_base
#include "cps3.h"
// device type definition
@ -55,7 +56,7 @@ void cps3_sound_device::sound_stream_update(sound_stream &stream, stream_sample_
memset(outputs[0], 0, samples*sizeof(*outputs[0]));
memset(outputs[1], 0, samples*sizeof(*outputs[1]));
for (int i = 0; i < CPS3_VOICES; i ++)
for (int i = 0; i < 16; i ++)
{
if (m_key & (1 << i))
{
@ -147,7 +148,7 @@ WRITE32_MEMBER( cps3_sound_device::cps3_sound_w )
UINT16 key = data >> 16;
for (int i = 0; i < CPS3_VOICES; i++)
for (int i = 0; i < 16; i++)
{
// Key off -> Key on
if ((key & (1 << i)) && !(m_key & (1 << i)))

52
src/mame/audio/cps3.h Normal file
View File

@ -0,0 +1,52 @@
/***************************************************************************
Capcom CPS-3 Sound Hardware
****************************************************************************/
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
struct cps3_voice
{
cps3_voice() :
pos(0),
frac(0)
{
memset(regs, 0, sizeof(UINT32)*8);
}
UINT32 regs[8];
UINT32 pos;
UINT32 frac;
};
// ======================> cps3_sound_device
class cps3_sound_device : public device_t,
public device_sound_interface
{
public:
cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~cps3_sound_device() { }
protected:
// device-level overrides
virtual void device_start();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
public:
DECLARE_WRITE32_MEMBER( cps3_sound_w );
DECLARE_READ32_MEMBER( cps3_sound_r );
private:
sound_stream *m_stream;
cps3_voice m_voice[16];
UINT16 m_key;
INT8* m_base;
};
extern const device_type CPS3;

View File

@ -462,6 +462,7 @@ hardware modification to the security cart.....
#include "machine/intelfsh.h"
#include "machine/nvram.h"
#include "includes/cps3.h"
#include "audio/cps3.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsicd.h"
#include "machine/wd33c93.h"

View File

@ -12,6 +12,9 @@ class cps3_state : public driver_device
public:
cps3_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_mainram(*this, "mainram"),
m_spriteram(*this, "spriteram"),
m_colourram(*this, "colourram"),
@ -20,10 +23,12 @@ public:
m_tilemap40_regs_base(*this, "tmap40_regs"),
m_tilemap50_regs_base(*this, "tmap50_regs"),
m_fullscreenzoom(*this, "fullscreenzoom"),
m_0xc0000000_ram(*this, "0xc0000000_ram"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
m_0xc0000000_ram(*this, "0xc0000000_ram")
{ }
required_device<sh2_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_shared_ptr<UINT32> m_mainram;
required_shared_ptr<UINT32> m_spriteram;
@ -71,6 +76,7 @@ public:
unsigned short m_lastb;
unsigned short m_lastb2;
UINT8* m_user5region;
DECLARE_READ32_MEMBER(cps3_ssram_r);
DECLARE_WRITE32_MEMBER(cps3_ssram_w);
DECLARE_WRITE32_MEMBER(cps3_0xc0000000_ram_w);
@ -130,63 +136,7 @@ public:
void cps3_process_character_dma(UINT32 address);
void copy_from_nvram();
inline void cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangle &clip, gfx_element *gfx,
unsigned int code, unsigned int color, int flipx, int flipy, int sx, int sy,
int transparency, int transparent_color,
int scalex, int scaley, bitmap_ind8 *pri_buffer, UINT32 pri_mask);
required_device<sh2_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
unsigned int code, unsigned int color, int flipx, int flipy, int sx, int sy,
int transparency, int transparent_color,
int scalex, int scaley, bitmap_ind8 *pri_buffer, UINT32 pri_mask);
};
/*----------- defined in audio/cps3.c -----------*/
#define CPS3_VOICES (16)
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
struct cps3_voice
{
cps3_voice() :
pos(0),
frac(0)
{
memset(regs, 0, sizeof(UINT32)*8);
}
UINT32 regs[8];
UINT32 pos;
UINT32 frac;
};
// ======================> cps3_sound_device
class cps3_sound_device : public device_t,
public device_sound_interface
{
public:
cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~cps3_sound_device() { }
protected:
// device-level overrides
virtual void device_start();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
public:
DECLARE_WRITE32_MEMBER( cps3_sound_w );
DECLARE_READ32_MEMBER( cps3_sound_r );
private:
sound_stream *m_stream;
cps3_voice m_voice[CPS3_VOICES];
UINT16 m_key;
INT8* m_base;
};
extern const device_type CPS3;