INLINE ym2612_state *get_safe_token(const device_config *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_YM2612 || sound_get_type(device) == SOUND_YM3438); return (ym2612_state *)device->token; }
static void print_game_sampleof(FILE *out, const game_driver *game, const machine_config *config) { #if (HAS_SAMPLES) const device_config *device; for (device = sound_first(config); device != NULL; device = sound_next(device)) if (sound_get_type(device) == SOUND_SAMPLES) { const char *const *samplenames = ((const samples_interface *)device->static_config)->samplenames; if (samplenames != NULL) { int sampnum; /* iterate over sample names */ for (sampnum = 0; samplenames[sampnum] != NULL; sampnum++) { const char *cursampname = samplenames[sampnum]; /* only output sampleof if different from the game name */ if (cursampname[0] == '*' && strcmp(cursampname + 1, game->name) != 0) fprintf(out, " sampleof=\"%s\"", xml_normalize_string(cursampname + 1)); } } } #endif }
INLINE YMF278BChip *get_safe_token(const device_config *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_YMF278B); return (YMF278BChip *)device->token; }
INLINE okim6258_state *get_safe_token(const device_config *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_OKIM6258); return (okim6258_state *)device->token; }
INLINE digitalker *get_safe_token(const device_config *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_DIGITALKER); return (digitalker *)device->token; }
INLINE namco_63701x *get_safe_token(const device_config *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_NAMCO_63701X); return (namco_63701x *)device->token; }
INLINE ym2151_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_YM2151); return (ym2151_state *)device->token; }
INLINE snkwave_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_SNKWAVE); return (snkwave_state *)device->token; }
INLINE ymz280b_state *get_safe_token(const device_config *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_YMZ280B); return (ymz280b_state *)device->token; }
INLINE dmadac_state *get_safe_token(const device_config *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_DMADAC); return (dmadac_state *)device->token; }
INLINE bsmt2000_chip *get_safe_token(const device_config *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_BSMT2000); return (bsmt2000_chip *)device->token; }
INLINE speaker_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_SPEAKER); return (speaker_state *)device->token; }
INLINE ga20_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_IREMGA20); return (ga20_state *)device->token; }
INLINE st0016_state *get_safe_token(const device_config *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_ST0016); return (st0016_state *)device->token; }
INLINE samples_info *get_safe_token(const device_config *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_SAMPLES); return (samples_info *)device->token; }
INLINE dac_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_DAC); return (dac_state *)device->token; }
INLINE tia_state *get_safe_token(const device_config *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_TIA); return (tia_state *)device->token; }
static void print_game_sample(FILE *out, const game_driver *game, const machine_config *config) { #if (HAS_SAMPLES) const device_config *device; /* iterate over sound chips looking for samples */ for (device = sound_first(config); device != NULL; device = sound_next(device)) if (sound_get_type(device) == SOUND_SAMPLES) { const char *const *samplenames = ((const samples_interface *)device->static_config)->samplenames; if (samplenames != NULL) { int sampnum; /* iterate over sample names */ for (sampnum = 0; samplenames[sampnum] != NULL; sampnum++) { const char *cursampname = samplenames[sampnum]; int dupnum; /* ignore the special '*' samplename */ if (sampnum == 0 && cursampname[0] == '*') continue; /* filter out duplicates */ for (dupnum = 0; dupnum < sampnum; dupnum++) if (strcmp(samplenames[dupnum], cursampname) == 0) break; if (dupnum < sampnum) continue; /* output the sample name */ fprintf(out, "\t\t<sample name=\"%s\"/>\n", xml_normalize_string(cursampname)); } } } #endif }