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 "mixer.h" /* QUASI88 */ 14 #include "streams.h" /* QUASI88 */ 15 16 #if (HAS_SAMPLES) 17 #include "samples.h" /* QUASI88 */ 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 "2203intf.h" /* QUASI88 */ 30 #endif 31 #if (HAS_YM2608) 32 #include "2608intf.h" /* QUASI88 */ 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 "2608intf.h" /* QUASI88 */ 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 "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_NAMCONA) 78 #include "sound/namcona.h" 79 #endif 80 #if (HAS_TMS36XX) 81 #include "sound/tms36xx.h" 82 #endif 83 #if (HAS_TMS5110) 84 #include "sound/5110intf.h" 85 #endif 86 #if (HAS_TMS5220) 87 #include "sound/5220intf.h" 88 #endif 89 #if (HAS_VLM5030) 90 #include "sound/vlm5030.h" 91 #endif 92 #if (HAS_ADPCM || HAS_OKIM6295) 93 #include "sound/adpcm.h" 94 #endif 95 #if (HAS_MSM5205) 96 #include "sound/msm5205.h" 97 #endif 98 #if (HAS_MSM5232) 99 #include "sound/msm5232.h" 100 #endif 101 #if (HAS_UPD7759) 102 #include "sound/upd7759.h" 103 #endif 104 #if (HAS_HC55516) 105 #include "sound/hc55516.h" 106 #endif 107 #if (HAS_K005289) 108 #include "sound/k005289.h" 109 #endif 110 #if (HAS_K007232) 111 #include "sound/k007232.h" 112 #endif 113 #if (HAS_K051649) 114 #include "sound/k051649.h" 115 #endif 116 #if (HAS_K053260) 117 #include "sound/k053260.h" 118 #endif 119 #if (HAS_K054539) 120 #include "sound/k054539.h" 121 #endif 122 #if (HAS_SEGAPCM) 123 #include "sound/segapcm.h" 124 #endif 125 #if (HAS_RF5C68) 126 #include "sound/rf5c68.h" 127 #endif 128 #if (HAS_CEM3394) 129 #include "sound/cem3394.h" 130 #endif 131 #if (HAS_C140) 132 #include "sound/c140.h" 133 #endif 134 #if (HAS_QSOUND) 135 #include "sound/qsound.h" 136 #endif 137 #if (HAS_SAA1099) 138 #include "sound/saa1099.h" 139 #endif 140 #if (HAS_IREMGA20) 141 #include "sound/iremga20.h" 142 #endif 143 #if (HAS_ES5505 || HAS_ES5506) 144 #include "sound/es5506.h" 145 #endif 146 #if (HAS_BSMT2000) 147 #include "sound/bsmt2000.h" 148 #endif 149 #if (HAS_YMF262) 150 #include "sound/262intf.h" 151 #endif 152 #if (HAS_YMF278B) 153 #include "sound/ymf278b.h" 154 #endif 155 #if (HAS_GAELCO_CG1V || HAS_GAELCO_GAE1) 156 #include "sound/gaelco.h" 157 #endif 158 #if (HAS_X1_010) 159 #include "sound/x1_010.h" 160 #endif 161 #if (HAS_MULTIPCM) 162 #include "sound/multipcm.h" 163 #endif 164 #if (HAS_C6280) 165 #include "sound/c6280.h" 166 #endif 167 #if (HAS_TIA) 168 #include "sound/tiaintf.h" 169 #endif 170 171 #ifdef MESS 172 #if (HAS_BEEP) 173 #include "sound/beep.h" 174 #endif 175 #if (HAS_SPEAKER) 176 #include "sound/speaker.h" 177 #endif 178 #if (HAS_WAVE) 179 #include "sound/wave.h" 180 #endif 181 #endif 182 183 #if 1 /* QUASI88 */ 184 #if (HAS_BEEP88) 185 #include "beep.h" 186 #endif 187 #if (HAS_FMGEN2203) 188 #include "2203fmgen.h" 189 #endif 190 #if (HAS_FMGEN2608) 191 #include "2608fmgen.h" 192 #endif 193 #endif /* QUASI88 */ 194 195 196 #define SOUND_YM2151_ALT SOUND_YM2151 197 198 /* the following list is automatically generated by makelist.pl - don't edit manually! */ 199 enum 200 { 201 SOUND_DUMMY, 202 #if (HAS_CUSTOM) 203 SOUND_CUSTOM, 204 #endif 205 #if (HAS_SAMPLES) 206 SOUND_SAMPLES, 207 #endif 208 #if (HAS_DAC) 209 SOUND_DAC, 210 #endif 211 #if (HAS_DISCRETE) 212 SOUND_DISCRETE, 213 #endif 214 #if (HAS_AY8910) 215 SOUND_AY8910, 216 #endif 217 #if (HAS_YM2203) 218 SOUND_YM2203, 219 #endif 220 #if (HAS_YM2151) 221 SOUND_YM2151, 222 #endif 223 #if (HAS_YM2151_ALT) 224 SOUND_YM2151_ALT, 225 #endif 226 #if (HAS_YM2608) 227 SOUND_YM2608, 228 #endif 229 #if (HAS_YM2610) 230 SOUND_YM2610, 231 #endif 232 #if (HAS_YM2610B) 233 SOUND_YM2610B, 234 #endif 235 #if (HAS_YM2612) 236 SOUND_YM2612, 237 #endif 238 #if (HAS_YM3438) 239 SOUND_YM3438, 240 #endif 241 #if (HAS_YM2413) 242 SOUND_YM2413, 243 #endif 244 #if (HAS_YM3812) 245 SOUND_YM3812, 246 #endif 247 #if (HAS_YM3526) 248 SOUND_YM3526, 249 #endif 250 #if (HAS_YMZ280B) 251 SOUND_YMZ280B, 252 #endif 253 #if (HAS_Y8950) 254 SOUND_Y8950, 255 #endif 256 #if (HAS_SN76477) 257 SOUND_SN76477, 258 #endif 259 #if (HAS_SN76496) 260 SOUND_SN76496, 261 #endif 262 #if (HAS_POKEY) 263 SOUND_POKEY, 264 #endif 265 #if (HAS_NES) 266 SOUND_NES, 267 #endif 268 #if (HAS_ASTROCADE) 269 SOUND_ASTROCADE, 270 #endif 271 #if (HAS_NAMCO) 272 SOUND_NAMCO, 273 #endif 274 #if (HAS_NAMCONA) 275 SOUND_NAMCONA, 276 #endif 277 #if (HAS_TMS36XX) 278 SOUND_TMS36XX, 279 #endif 280 #if (HAS_TMS5110) 281 SOUND_TMS5110, 282 #endif 283 #if (HAS_TMS5220) 284 SOUND_TMS5220, 285 #endif 286 #if (HAS_VLM5030) 287 SOUND_VLM5030, 288 #endif 289 #if (HAS_ADPCM) 290 SOUND_ADPCM, 291 #endif 292 #if (HAS_OKIM6295) 293 SOUND_OKIM6295, 294 #endif 295 #if (HAS_MSM5205) 296 SOUND_MSM5205, 297 #endif 298 #if (HAS_MSM5232) 299 SOUND_MSM5232, 300 #endif 301 #if (HAS_UPD7759) 302 SOUND_UPD7759, 303 #endif 304 #if (HAS_HC55516) 305 SOUND_HC55516, 306 #endif 307 #if (HAS_K005289) 308 SOUND_K005289, 309 #endif 310 #if (HAS_K007232) 311 SOUND_K007232, 312 #endif 313 #if (HAS_K051649) 314 SOUND_K051649, 315 #endif 316 #if (HAS_K053260) 317 SOUND_K053260, 318 #endif 319 #if (HAS_K054539) 320 SOUND_K054539, 321 #endif 322 #if (HAS_SEGAPCM) 323 SOUND_SEGAPCM, 324 #endif 325 #if (HAS_RF5C68) 326 SOUND_RF5C68, 327 #endif 328 #if (HAS_CEM3394) 329 SOUND_CEM3394, 330 #endif 331 #if (HAS_C140) 332 SOUND_C140, 333 #endif 334 #if (HAS_QSOUND) 335 SOUND_QSOUND, 336 #endif 337 #if (HAS_SAA1099) 338 SOUND_SAA1099, 339 #endif 340 #if (HAS_IREMGA20) 341 SOUND_IREMGA20, 342 #endif 343 #if (HAS_ES5505) 344 SOUND_ES5505, 345 #endif 346 #if (HAS_ES5506) 347 SOUND_ES5506, 348 #endif 349 #if (HAS_BSMT2000) 350 SOUND_BSMT2000, 351 #endif 352 #if (HAS_YMF262) 353 SOUND_YMF262, 354 #endif 355 #if (HAS_YMF278B) 356 SOUND_YMF278B, 357 #endif 358 #if (HAS_GAELCO_CG1V) 359 SOUND_GAELCO_CG1V, 360 #endif 361 #if (HAS_GAELCO_GAE1) 362 SOUND_GAELCO_GAE1, 363 #endif 364 #if (HAS_X1_010) 365 SOUND_X1_010, 366 #endif 367 #if (HAS_MULTIPCM) 368 SOUND_MULTIPCM, 369 #endif 370 #if (HAS_C6280) 371 SOUND_C6280, 372 #endif 373 #if (HAS_TIA) 374 SOUND_TIA, 375 #endif 376 377 #ifdef MESS 378 #if (HAS_BEEP) 379 SOUND_BEEP, 380 #endif 381 #if (HAS_SPEAKER) 382 SOUND_SPEAKER, 383 #endif 384 #if (HAS_WAVE) 385 SOUND_WAVE, 386 #endif 387 #endif 388 389 #if 1 /* QUASI88 */ 390 #if (HAS_BEEP88) 391 SOUND_BEEP88, 392 #endif 393 #if (HAS_FMGEN2203) 394 SOUND_FMGEN2203, 395 #endif 396 #if (HAS_FMGEN2608) 397 SOUND_FMGEN2608, 398 #endif 399 #endif /* QUASI88 */ 400 SOUND_COUNT 401 }; 402 403 404 /* structure for SOUND_CUSTOM sound drivers */ 405 struct CustomSound_interface 406 { 407 int (*sh_start)(const struct MachineSound *msound); 408 void (*sh_stop)(void); 409 void (*sh_update)(void); 410 }; 411 412 413 int sound_start(void); 414 void sound_stop(void); 415 void sound_update(void); 416 void sound_reset(void); 417 418 /* returns name of the sound system */ 419 const char *soundtype_name(int soundtype); 420 const char *sound_name(const struct MachineSound *msound); 421 /* returns number of chips, or 0 if the sound type doesn't support multiple instances */ 422 int sound_num(const struct MachineSound *msound); 423 /* returns clock rate, or 0 if the sound type doesn't support a clock frequency */ 424 int sound_clock(const struct MachineSound *msound); 425 426 int sound_scalebufferpos(int value); 427 428 429 READ_HANDLER( soundlatch_r ); 430 READ_HANDLER( soundlatch2_r ); 431 READ_HANDLER( soundlatch3_r ); 432 READ_HANDLER( soundlatch4_r ); 433 READ16_HANDLER( soundlatch_word_r ); 434 READ16_HANDLER( soundlatch2_word_r ); 435 READ16_HANDLER( soundlatch3_word_r ); 436 READ16_HANDLER( soundlatch4_word_r ); 437 438 WRITE_HANDLER( soundlatch_w ); 439 WRITE_HANDLER( soundlatch2_w ); 440 WRITE_HANDLER( soundlatch3_w ); 441 WRITE_HANDLER( soundlatch4_w ); 442 WRITE16_HANDLER( soundlatch_word_w ); 443 WRITE16_HANDLER( soundlatch2_word_w ); 444 WRITE16_HANDLER( soundlatch3_word_w ); 445 WRITE16_HANDLER( soundlatch4_word_w ); 446 447 WRITE_HANDLER( soundlatch_clear_w ); 448 WRITE_HANDLER( soundlatch2_clear_w ); 449 WRITE_HANDLER( soundlatch3_clear_w ); 450 WRITE_HANDLER( soundlatch4_clear_w ); 451 452 453 /* If you're going to use soundlatchX_clear_w, and the cleared value is 454 something other than 0x00, use this function from machine_init. Note 455 that this one call effects all 4 latches */ 456 void soundlatch_setclearedvalue(int value); 457 458 459 #if 1 /* QUASI88 */ 460 int sound_wavfile_open(const char *filename); 461 int sound_wavfile_opened(void); 462 void sound_wavfile_close(void); 463 int sound_wavfile_damaged(void); 464 #endif /* QUASI88 */ 465 466 #endif 467