| 1 |
#ifndef SNDINTRF_H |
| 2 |
#define SNDINTRF_H |
| 3 |
|
| 4 |
|
| 5 |
struct MachineSound |
| 6 |
{ |
| 7 |
int sound_type; |
| 8 |
void *sound_interface; |
| 9 |
const char *tag; |
| 10 |
}; |
| 11 |
|
| 12 |
|
| 13 |
#include "sound/mixer.h" |
| 14 |
#include "sound/streams.h" |
| 15 |
|
| 16 |
#if (HAS_SAMPLES) |
| 17 |
#include "sound/samples.h" |
| 18 |
#endif |
| 19 |
#if (HAS_DAC) |
| 20 |
#include "sound/dac.h" |
| 21 |
#endif |
| 22 |
#if (HAS_DISCRETE) |
| 23 |
#include "sound/discrete.h" |
| 24 |
#endif |
| 25 |
#if (HAS_AY8910) |
| 26 |
#include "sound/ay8910.h" |
| 27 |
#endif |
| 28 |
#if (HAS_YM2203) |
| 29 |
#include "sound/2203intf.h" |
| 30 |
#endif |
| 31 |
#if (HAS_YM2608) |
| 32 |
#include "sound/2608intf.h" |
| 33 |
#endif |
| 34 |
#if (HAS_YM2612 || HAS_YM3438) |
| 35 |
#include "sound/2612intf.h" |
| 36 |
#endif |
| 37 |
#if (HAS_YM2151 || HAS_YM2151_ALT) |
| 38 |
#include "sound/2151intf.h" |
| 39 |
#endif |
| 40 |
#if (HAS_YM2608) |
| 41 |
#include "sound/2608intf.h" |
| 42 |
#endif |
| 43 |
#if (HAS_YM2610 || HAS_YM2610B) |
| 44 |
#include "sound/2610intf.h" |
| 45 |
#endif |
| 46 |
#if (HAS_YM3812 || HAS_YM3526 || HAS_Y8950) |
| 47 |
#include "sound/3812intf.h" |
| 48 |
#endif |
| 49 |
#if (HAS_YM2413) |
| 50 |
#include "sound/2413intf.h" |
| 51 |
#endif |
| 52 |
#if (HAS_YMZ280B) |
| 53 |
#include "sound/ymz280b.h" |
| 54 |
#endif |
| 55 |
#if (HAS_SN76477) |
| 56 |
#include "sound/sn76477.h" |
| 57 |
#endif |
| 58 |
#if (HAS_SN76496) |
| 59 |
#include "sound/sn76496.h" |
| 60 |
#endif |
| 61 |
#if (HAS_POKEY) |
| 62 |
#include "sound/pokey.h" |
| 63 |
#endif |
| 64 |
#if (HAS_NES) |
| 65 |
#ifndef MESS |
| 66 |
#include "sound/nes_apu.h" |
| 67 |
#else |
| 68 |
#include "mess/sound/nesintf.h" |
| 69 |
#endif |
| 70 |
#endif |
| 71 |
#if (HAS_ASTROCADE) |
| 72 |
#include "sound/astrocde.h" |
| 73 |
#endif |
| 74 |
#if (HAS_NAMCO) |
| 75 |
#include "sound/namco.h" |
| 76 |
#endif |
| 77 |
#if (HAS_TMS36XX) |
| 78 |
#include "sound/tms36xx.h" |
| 79 |
#endif |
| 80 |
#if (HAS_TMS5110) |
| 81 |
#include "sound/5110intf.h" |
| 82 |
#endif |
| 83 |
#if (HAS_TMS5220) |
| 84 |
#include "sound/5220intf.h" |
| 85 |
#endif |
| 86 |
#if (HAS_VLM5030) |
| 87 |
#include "sound/vlm5030.h" |
| 88 |
#endif |
| 89 |
#if (HAS_ADPCM || HAS_OKIM6295) |
| 90 |
#include "sound/adpcm.h" |
| 91 |
#endif |
| 92 |
#if (HAS_MSM5205) |
| 93 |
#include "sound/msm5205.h" |
| 94 |
#endif |
| 95 |
#if (HAS_MSM5232) |
| 96 |
#include "sound/msm5232.h" |
| 97 |
#endif |
| 98 |
#if (HAS_UPD7759) |
| 99 |
#include "sound/upd7759.h" |
| 100 |
#endif |
| 101 |
#if (HAS_HC55516) |
| 102 |
#include "sound/hc55516.h" |
| 103 |
#endif |
| 104 |
#if (HAS_K005289) |
| 105 |
#include "sound/k005289.h" |
| 106 |
#endif |
| 107 |
#if (HAS_K007232) |
| 108 |
#include "sound/k007232.h" |
| 109 |
#endif |
| 110 |
#if (HAS_K051649) |
| 111 |
#include "sound/k051649.h" |
| 112 |
#endif |
| 113 |
#if (HAS_K053260) |
| 114 |
#include "sound/k053260.h" |
| 115 |
#endif |
| 116 |
#if (HAS_K054539) |
| 117 |
#include "sound/k054539.h" |
| 118 |
#endif |
| 119 |
#if (HAS_SEGAPCM) |
| 120 |
#include "sound/segapcm.h" |
| 121 |
#endif |
| 122 |
#if (HAS_RF5C68) |
| 123 |
#include "sound/rf5c68.h" |
| 124 |
#endif |
| 125 |
#if (HAS_CEM3394) |
| 126 |
#include "sound/cem3394.h" |
| 127 |
#endif |
| 128 |
#if (HAS_C140) |
| 129 |
#include "sound/c140.h" |
| 130 |
#endif |
| 131 |
#if (HAS_QSOUND) |
| 132 |
#include "sound/qsound.h" |
| 133 |
#endif |
| 134 |
#if (HAS_SAA1099) |
| 135 |
#include "sound/saa1099.h" |
| 136 |
#endif |
| 137 |
#if (HAS_IREMGA20) |
| 138 |
#include "sound/iremga20.h" |
| 139 |
#endif |
| 140 |
#if (HAS_ES5505 || HAS_ES5506) |
| 141 |
#include "sound/es5506.h" |
| 142 |
#endif |
| 143 |
#if (HAS_BSMT2000) |
| 144 |
#include "sound/bsmt2000.h" |
| 145 |
#endif |
| 146 |
|
| 147 |
#ifdef MESS |
| 148 |
#if (HAS_BEEP) |
| 149 |
#include "mess/sound/beep.h" |
| 150 |
#endif |
| 151 |
#if (HAS_SPEAKER) |
| 152 |
#include "mess/sound/speaker.h" |
| 153 |
#endif |
| 154 |
#if (HAS_TIA) |
| 155 |
#include "mess/sound/tiaintf.h" |
| 156 |
#endif |
| 157 |
#if (HAS_WAVE) |
| 158 |
#include "mess/sound/wave.h" |
| 159 |
#endif |
| 160 |
#endif |
| 161 |
|
| 162 |
|
| 163 |
#define SOUND_YM2151_ALT SOUND_YM2151 |
| 164 |
|
| 165 |
/* the following list is automatically generated by makelist.pl - don't edit manually! */ |
| 166 |
enum |
| 167 |
{ |
| 168 |
SOUND_DUMMY, |
| 169 |
#if (HAS_CUSTOM) |
| 170 |
SOUND_CUSTOM, |
| 171 |
#endif |
| 172 |
#if (HAS_SAMPLES) |
| 173 |
SOUND_SAMPLES, |
| 174 |
#endif |
| 175 |
#if (HAS_DAC) |
| 176 |
SOUND_DAC, |
| 177 |
#endif |
| 178 |
#if (HAS_DISCRETE) |
| 179 |
SOUND_DISCRETE, |
| 180 |
#endif |
| 181 |
#if (HAS_AY8910) |
| 182 |
SOUND_AY8910, |
| 183 |
#endif |
| 184 |
#if (HAS_YM2203) |
| 185 |
SOUND_YM2203, |
| 186 |
#endif |
| 187 |
#if (HAS_YM2151) |
| 188 |
SOUND_YM2151, |
| 189 |
#endif |
| 190 |
#if (HAS_YM2151_ALT) |
| 191 |
SOUND_YM2151_ALT, |
| 192 |
#endif |
| 193 |
#if (HAS_YM2608) |
| 194 |
SOUND_YM2608, |
| 195 |
#endif |
| 196 |
#if (HAS_YM2610) |
| 197 |
SOUND_YM2610, |
| 198 |
#endif |
| 199 |
#if (HAS_YM2610B) |
| 200 |
SOUND_YM2610B, |
| 201 |
#endif |
| 202 |
#if (HAS_YM2612) |
| 203 |
SOUND_YM2612, |
| 204 |
#endif |
| 205 |
#if (HAS_YM3438) |
| 206 |
SOUND_YM3438, |
| 207 |
#endif |
| 208 |
#if (HAS_YM2413) |
| 209 |
SOUND_YM2413, |
| 210 |
#endif |
| 211 |
#if (HAS_YM3812) |
| 212 |
SOUND_YM3812, |
| 213 |
#endif |
| 214 |
#if (HAS_YM3526) |
| 215 |
SOUND_YM3526, |
| 216 |
#endif |
| 217 |
#if (HAS_YMZ280B) |
| 218 |
SOUND_YMZ280B, |
| 219 |
#endif |
| 220 |
#if (HAS_Y8950) |
| 221 |
SOUND_Y8950, |
| 222 |
#endif |
| 223 |
#if (HAS_SN76477) |
| 224 |
SOUND_SN76477, |
| 225 |
#endif |
| 226 |
#if (HAS_SN76496) |
| 227 |
SOUND_SN76496, |
| 228 |
#endif |
| 229 |
#if (HAS_POKEY) |
| 230 |
SOUND_POKEY, |
| 231 |
#endif |
| 232 |
#if (HAS_NES) |
| 233 |
SOUND_NES, |
| 234 |
#endif |
| 235 |
#if (HAS_ASTROCADE) |
| 236 |
SOUND_ASTROCADE, |
| 237 |
#endif |
| 238 |
#if (HAS_NAMCO) |
| 239 |
SOUND_NAMCO, |
| 240 |
#endif |
| 241 |
#if (HAS_TMS36XX) |
| 242 |
SOUND_TMS36XX, |
| 243 |
#endif |
| 244 |
#if (HAS_TMS5110) |
| 245 |
SOUND_TMS5110, |
| 246 |
#endif |
| 247 |
#if (HAS_TMS5220) |
| 248 |
SOUND_TMS5220, |
| 249 |
#endif |
| 250 |
#if (HAS_VLM5030) |
| 251 |
SOUND_VLM5030, |
| 252 |
#endif |
| 253 |
#if (HAS_ADPCM) |
| 254 |
SOUND_ADPCM, |
| 255 |
#endif |
| 256 |
#if (HAS_OKIM6295) |
| 257 |
SOUND_OKIM6295, |
| 258 |
#endif |
| 259 |
#if (HAS_MSM5205) |
| 260 |
SOUND_MSM5205, |
| 261 |
#endif |
| 262 |
#if (HAS_MSM5232) |
| 263 |
SOUND_MSM5232, |
| 264 |
#endif |
| 265 |
#if (HAS_UPD7759) |
| 266 |
SOUND_UPD7759, |
| 267 |
#endif |
| 268 |
#if (HAS_HC55516) |
| 269 |
SOUND_HC55516, |
| 270 |
#endif |
| 271 |
#if (HAS_K005289) |
| 272 |
SOUND_K005289, |
| 273 |
#endif |
| 274 |
#if (HAS_K007232) |
| 275 |
SOUND_K007232, |
| 276 |
#endif |
| 277 |
#if (HAS_K051649) |
| 278 |
SOUND_K051649, |
| 279 |
#endif |
| 280 |
#if (HAS_K053260) |
| 281 |
SOUND_K053260, |
| 282 |
#endif |
| 283 |
#if (HAS_K054539) |
| 284 |
SOUND_K054539, |
| 285 |
#endif |
| 286 |
#if (HAS_SEGAPCM) |
| 287 |
SOUND_SEGAPCM, |
| 288 |
#endif |
| 289 |
#if (HAS_RF5C68) |
| 290 |
SOUND_RF5C68, |
| 291 |
#endif |
| 292 |
#if (HAS_CEM3394) |
| 293 |
SOUND_CEM3394, |
| 294 |
#endif |
| 295 |
#if (HAS_C140) |
| 296 |
SOUND_C140, |
| 297 |
#endif |
| 298 |
#if (HAS_QSOUND) |
| 299 |
SOUND_QSOUND, |
| 300 |
#endif |
| 301 |
#if (HAS_SAA1099) |
| 302 |
SOUND_SAA1099, |
| 303 |
#endif |
| 304 |
#if (HAS_IREMGA20) |
| 305 |
SOUND_IREMGA20, |
| 306 |
#endif |
| 307 |
#if (HAS_ES5505) |
| 308 |
SOUND_ES5505, |
| 309 |
#endif |
| 310 |
#if (HAS_ES5506) |
| 311 |
SOUND_ES5506, |
| 312 |
#endif |
| 313 |
#if (HAS_BSMT2000) |
| 314 |
SOUND_BSMT2000, |
| 315 |
#endif |
| 316 |
|
| 317 |
#ifdef MESS |
| 318 |
#if (HAS_BEEP) |
| 319 |
SOUND_BEEP, |
| 320 |
#endif |
| 321 |
#if (HAS_SPEAKER) |
| 322 |
SOUND_SPEAKER, |
| 323 |
#endif |
| 324 |
#if (HAS_TIA) |
| 325 |
SOUND_TIA, |
| 326 |
#endif |
| 327 |
#if (HAS_WAVE) |
| 328 |
SOUND_WAVE, |
| 329 |
#endif |
| 330 |
#endif |
| 331 |
SOUND_COUNT |
| 332 |
}; |
| 333 |
|
| 334 |
|
| 335 |
/* structure for SOUND_CUSTOM sound drivers */ |
| 336 |
struct CustomSound_interface |
| 337 |
{ |
| 338 |
int (*sh_start)(const struct MachineSound *msound); |
| 339 |
void (*sh_stop)(void); |
| 340 |
void (*sh_update)(void); |
| 341 |
}; |
| 342 |
|
| 343 |
|
| 344 |
int sound_start(void); |
| 345 |
void sound_stop(void); |
| 346 |
void sound_update(void); |
| 347 |
void sound_reset(void); |
| 348 |
|
| 349 |
/* returns name of the sound system */ |
| 350 |
const char *sound_name(const struct MachineSound *msound); |
| 351 |
/* returns number of chips, or 0 if the sound type doesn't support multiple instances */ |
| 352 |
int sound_num(const struct MachineSound *msound); |
| 353 |
/* returns clock rate, or 0 if the sound type doesn't support a clock frequency */ |
| 354 |
int sound_clock(const struct MachineSound *msound); |
| 355 |
|
| 356 |
int sound_scalebufferpos(int value); |
| 357 |
|
| 358 |
|
| 359 |
READ_HANDLER( soundlatch_r ); |
| 360 |
READ_HANDLER( soundlatch2_r ); |
| 361 |
READ_HANDLER( soundlatch3_r ); |
| 362 |
READ_HANDLER( soundlatch4_r ); |
| 363 |
READ16_HANDLER( soundlatch_word_r ); |
| 364 |
READ16_HANDLER( soundlatch2_word_r ); |
| 365 |
READ16_HANDLER( soundlatch3_word_r ); |
| 366 |
READ16_HANDLER( soundlatch4_word_r ); |
| 367 |
|
| 368 |
WRITE_HANDLER( soundlatch_w ); |
| 369 |
WRITE_HANDLER( soundlatch2_w ); |
| 370 |
WRITE_HANDLER( soundlatch3_w ); |
| 371 |
WRITE_HANDLER( soundlatch4_w ); |
| 372 |
WRITE16_HANDLER( soundlatch_word_w ); |
| 373 |
WRITE16_HANDLER( soundlatch2_word_w ); |
| 374 |
WRITE16_HANDLER( soundlatch3_word_w ); |
| 375 |
WRITE16_HANDLER( soundlatch4_word_w ); |
| 376 |
|
| 377 |
WRITE_HANDLER( soundlatch_clear_w ); |
| 378 |
WRITE_HANDLER( soundlatch2_clear_w ); |
| 379 |
WRITE_HANDLER( soundlatch3_clear_w ); |
| 380 |
WRITE_HANDLER( soundlatch4_clear_w ); |
| 381 |
|
| 382 |
|
| 383 |
/* If you're going to use soundlatchX_clear_w, and the cleared value is |
| 384 |
something other than 0x00, use this function from machine_init. Note |
| 385 |
that this one call effects all 4 latches */ |
| 386 |
void soundlatch_setclearedvalue(int value); |
| 387 |
|
| 388 |
|
| 389 |
#endif |