trunk/src/mame/audio/cps3.h
| r0 | r30599 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Capcom CPS-3 Sound Hardware |
| 4 | |
| 5 | ****************************************************************************/ |
| 6 | |
| 7 | //************************************************************************** |
| 8 | // TYPE DEFINITIONS |
| 9 | //************************************************************************** |
| 10 | |
| 11 | struct 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 | |
| 27 | class cps3_sound_device : public device_t, |
| 28 | public device_sound_interface |
| 29 | { |
| 30 | public: |
| 31 | cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 32 | ~cps3_sound_device() { } |
| 33 | |
| 34 | protected: |
| 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 | |
| 41 | public: |
| 42 | DECLARE_WRITE32_MEMBER( cps3_sound_w ); |
| 43 | DECLARE_READ32_MEMBER( cps3_sound_r ); |
| 44 | |
| 45 | private: |
| 46 | sound_stream *m_stream; |
| 47 | cps3_voice m_voice[16]; |
| 48 | UINT16 m_key; |
| 49 | INT8* m_base; |
| 50 | }; |
| 51 | |
| 52 | extern const device_type CPS3; |
trunk/src/mame/includes/cps3.h
| r30598 | r30599 | |
| 12 | 12 | public: |
| 13 | 13 | cps3_state(const machine_config &mconfig, device_type type, const char *tag) |
| 14 | 14 | : driver_device(mconfig, type, tag), |
| 15 | m_maincpu(*this, "maincpu"), |
| 16 | m_gfxdecode(*this, "gfxdecode"), |
| 17 | m_palette(*this, "palette"), |
| 15 | 18 | m_mainram(*this, "mainram"), |
| 16 | 19 | m_spriteram(*this, "spriteram"), |
| 17 | 20 | m_colourram(*this, "colourram"), |
| r30598 | r30599 | |
| 20 | 23 | m_tilemap40_regs_base(*this, "tmap40_regs"), |
| 21 | 24 | m_tilemap50_regs_base(*this, "tmap50_regs"), |
| 22 | 25 | 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 | { } |
| 27 | 28 | |
| 29 | required_device<sh2_device> m_maincpu; |
| 30 | required_device<gfxdecode_device> m_gfxdecode; |
| 31 | required_device<palette_device> m_palette; |
| 32 | |
| 28 | 33 | required_shared_ptr<UINT32> m_mainram; |
| 29 | 34 | required_shared_ptr<UINT32> m_spriteram; |
| 30 | 35 | required_shared_ptr<UINT32> m_colourram; |
| r30598 | r30599 | |
| 71 | 76 | unsigned short m_lastb; |
| 72 | 77 | unsigned short m_lastb2; |
| 73 | 78 | UINT8* m_user5region; |
| 79 | |
| 74 | 80 | DECLARE_READ32_MEMBER(cps3_ssram_r); |
| 75 | 81 | DECLARE_WRITE32_MEMBER(cps3_ssram_w); |
| 76 | 82 | DECLARE_WRITE32_MEMBER(cps3_0xc0000000_ram_w); |
| r30598 | r30599 | |
| 130 | 136 | void cps3_process_character_dma(UINT32 address); |
| 131 | 137 | void copy_from_nvram(); |
| 132 | 138 | 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); |
| 140 | 142 | }; |
| 141 | | |
| 142 | | |
| 143 | | /*----------- defined in audio/cps3.c -----------*/ |
| 144 | | |
| 145 | | #define CPS3_VOICES (16) |
| 146 | | |
| 147 | | //************************************************************************** |
| 148 | | // TYPE DEFINITIONS |
| 149 | | //************************************************************************** |
| 150 | | |
| 151 | | struct 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 | | |
| 167 | | class cps3_sound_device : public device_t, |
| 168 | | public device_sound_interface |
| 169 | | { |
| 170 | | public: |
| 171 | | cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 172 | | ~cps3_sound_device() { } |
| 173 | | |
| 174 | | protected: |
| 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 | | |
| 181 | | public: |
| 182 | | DECLARE_WRITE32_MEMBER( cps3_sound_w ); |
| 183 | | DECLARE_READ32_MEMBER( cps3_sound_r ); |
| 184 | | |
| 185 | | private: |
| 186 | | sound_stream *m_stream; |
| 187 | | cps3_voice m_voice[CPS3_VOICES]; |
| 188 | | UINT16 m_key; |
| 189 | | INT8* m_base; |
| 190 | | }; |
| 191 | | |
| 192 | | extern const device_type CPS3; |