static void adpcm_int(device_t *device) { sothello_state *state = device->machine().driver_data<sothello_state>(); /* only 4 bits are used */ msm5205_data_w( device, state->m_msm_data & 0x0f ); cputag_set_input_line(device->machine(), "soundcpu", 0, ASSERT_LINE ); }
static WRITE8_DEVICE_HANDLER( hyprolyb_msm_data_w ) { hyprolyb_adpcm_state *state = get_safe_token(device); msm5205_data_w(state->m_msm, data); state->m_adpcm_busy = ~data & 0x80; }
PORT_BIT( 0x3f, 0x00, IPT_POSITIONAL ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(30) PORT_KEYDELTA(4) PORT_CENTERDELTA(0xff) PORT_COCKTAIL INPUT_PORTS_END #if USE_MSM static void pf_adpcm_int(device_t *device) { pachifev_state *state = device->machine().driver_data<pachifev_state>(); if (state->m_adpcm_pos >= 0x4000 || state->m_adpcm_idle) { state->m_adpcm_idle = 1; msm5205_reset_w(device,1); state->m_trigger = 0; } else { UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base(); state->m_adpcm_data = ((state->m_trigger ? (ROM[state->m_adpcm_pos] & 0x0f) : (ROM[state->m_adpcm_pos] & 0xf0)>>4) ); msm5205_data_w(device,state->m_adpcm_data & 0xf); state->m_trigger^=1; if(state->m_trigger == 0) { state->m_adpcm_pos++; if((ROM[state->m_adpcm_pos] & 0xff) == 0xff) state->m_adpcm_idle = 1; } } }
/* Similar to Jantotsu, apparently the HW has three ports that controls what kind of sample should be played. Every sample size is 0x1000. */ static void rougien_adpcm_int( device_t *device ) { mermaid_state *state = device->machine->driver_data<mermaid_state>(); // popmessage("%08x",state->adpcm_pos); if (state->adpcm_pos >= state->adpcm_end || state->adpcm_idle) { //state->adpcm_idle = 1; msm5205_reset_w(device, 1); state->adpcm_trigger = 0; } else { UINT8 *ROM = device->machine->region("adpcm")->base(); state->adpcm_data = ((state->adpcm_trigger ? (ROM[state->adpcm_pos] & 0x0f) : (ROM[state->adpcm_pos] & 0xf0) >> 4)); msm5205_data_w(device, state->adpcm_data & 0xf); state->adpcm_trigger ^= 1; if (state->adpcm_trigger == 0) { state->adpcm_pos++; //if ((ROM[state->adpcm_pos] & 0xff) == 0x70) // state->adpcm_idle = 1; } } }
static void mastboy_adpcm_int(running_device *device) { msm5205_data_w(device, mastboy_m5205_next); mastboy_m5205_next >>= 4; mastboy_m5205_part ^= 1; if(!mastboy_m5205_part) cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); }
static void goal92_adpcm_int( device_t *device ) { goal92_state *state = device->machine().driver_data<goal92_state>(); msm5205_data_w(device, state->m_msm5205next); state->m_msm5205next >>= 4; state->m_adpcm_toggle^= 1; if (state->m_adpcm_toggle) device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); }
static void goal92_adpcm_int( running_device *device ) { goal92_state *state = (goal92_state *)device->machine->driver_data; msm5205_data_w(device, state->msm5205next); state->msm5205next >>= 4; state->adpcm_toggle^= 1; if (state->adpcm_toggle) cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); }
static void mastboy_adpcm_int(device_t *device) { mastboy_state *state = device->machine().driver_data<mastboy_state>(); msm5205_data_w(device, state->m_m5205_next); state->m_m5205_next >>= 4; state->m_m5205_part ^= 1; if(!state->m_m5205_part) cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE); }
static void toki_adpcm_int (device_t *device) { toki_state *state = device->machine().driver_data<toki_state>(); msm5205_data_w (device, state->m_msm5205next); state->m_msm5205next >>= 4; state->m_toggle ^= 1; if (state->m_toggle) cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE); }
static void toki_adpcm_int (device_t *device) { static int toggle = 0; msm5205_data_w (device, msm5205next); msm5205next >>= 4; toggle ^= 1; if (toggle) cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); }
static void rastan_msm5205_vck(const device_config *device) { if (adpcm_data != -1) { msm5205_data_w(device, adpcm_data & 0x0f); adpcm_data = -1; } else { adpcm_data = memory_region(device->machine, "adpcm")[adpcm_pos]; adpcm_pos = (adpcm_pos + 1) & 0xffff; msm5205_data_w(device, adpcm_data >> 4); } }
static void topspeed_msm5205_vck( device_t *device ) { topspeed_state *state = device->machine->driver_data<topspeed_state>(); if (state->adpcm_data != -1) { msm5205_data_w(device, state->adpcm_data & 0x0f); state->adpcm_data = -1; } else { state->adpcm_data = device->machine->region("adpcm")->base()[state->adpcm_pos]; state->adpcm_pos = (state->adpcm_pos + 1) & 0x1ffff; msm5205_data_w(device, state->adpcm_data >> 4); } }
static void rastan_msm5205_vck( running_device *device ) { rastan_state *state = device->machine->driver_data<rastan_state>(); if (state->adpcm_data != -1) { msm5205_data_w(device, state->adpcm_data & 0x0f); state->adpcm_data = -1; } else { state->adpcm_data = memory_region(device->machine, "adpcm")[state->adpcm_pos]; state->adpcm_pos = (state->adpcm_pos + 1) & 0xffff; msm5205_data_w(device, state->adpcm_data >> 4); } }
static void rastan_msm5205_vck( device_t *device ) { rastan_state *state = device->machine().driver_data<rastan_state>(); if (state->m_adpcm_data != -1) { msm5205_data_w(device, state->m_adpcm_data & 0x0f); state->m_adpcm_data = -1; } else { state->m_adpcm_data = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos]; state->m_adpcm_pos = (state->m_adpcm_pos + 1) & 0xffff; msm5205_data_w(device, state->m_adpcm_data >> 4); } }
static void opwolf_msm5205_vck(const device_config *device) { int chip = (strcmp(device->tag, "msm1") == 0) ? 0 : 1; if (adpcm_data[chip] != -1) { msm5205_data_w(device, adpcm_data[chip] & 0x0f); adpcm_data[chip] = -1; if (adpcm_pos[chip] == adpcm_end[chip]) msm5205_reset_w(device, 1); } else { adpcm_data[chip] = memory_region(device->machine, "adpcm")[adpcm_pos[chip]]; adpcm_pos[chip] = (adpcm_pos[chip] + 1) & 0x7ffff; msm5205_data_w(device, adpcm_data[chip] >> 4); } }
static void opwolf_msm5205_vck( device_t *device ) { opwolf_state *state = device->machine().driver_data<opwolf_state>(); int chip = (strcmp(device->tag(), ":msm1") == 0) ? 0 : 1; if (state->m_adpcm_data[chip] != -1) { msm5205_data_w(device, state->m_adpcm_data[chip] & 0x0f); state->m_adpcm_data[chip] = -1; if (state->m_adpcm_pos[chip] == state->m_adpcm_end[chip]) msm5205_reset_w(device, 1); } else { state->m_adpcm_data[chip] = device->machine().root_device().memregion("adpcm")->base()[state->m_adpcm_pos[chip]]; state->m_adpcm_pos[chip] = (state->m_adpcm_pos[chip] + 1) & 0x7ffff; msm5205_data_w(device, state->m_adpcm_data[chip] >> 4); } }
static void tbowl_adpcm_int(device_t *device) { int num = (strcmp(device->tag(), "msm1") == 0) ? 0 : 1; if (adpcm_pos[num] >= adpcm_end[num] || adpcm_pos[num] >= device->machine->region("adpcm")->bytes()/2) msm5205_reset_w(device,1); else if (adpcm_data[num] != -1) { msm5205_data_w(device,adpcm_data[num] & 0x0f); adpcm_data[num] = -1; } else { UINT8 *ROM = device->machine->region("adpcm")->base() + 0x10000 * num; adpcm_data[num] = ROM[adpcm_pos[num]++]; msm5205_data_w(device,adpcm_data[num] >> 4); } }
static void tbowl_adpcm_int(device_t *device) { tbowl_state *state = device->machine().driver_data<tbowl_state>(); int num = (strcmp(device->tag(), "msm1") == 0) ? 0 : 1; if (state->m_adpcm_pos[num] >= state->m_adpcm_end[num] || state->m_adpcm_pos[num] >= device->machine().region("adpcm")->bytes()/2) msm5205_reset_w(device,1); else if (state->m_adpcm_data[num] != -1) { msm5205_data_w(device,state->m_adpcm_data[num] & 0x0f); state->m_adpcm_data[num] = -1; } else { UINT8 *ROM = device->machine().region("adpcm")->base() + 0x10000 * num; state->m_adpcm_data[num] = ROM[state->m_adpcm_pos[num]++]; msm5205_data_w(device,state->m_adpcm_data[num] >> 4); } }
/* Read/Write Handlers */ static void idsoccer_adpcm_int( device_t *device ) { docastle_state *state = device->machine->driver_data<docastle_state>(); if (state->adpcm_pos >= device->machine->region("adpcm")->bytes()) { state->adpcm_idle = 1; msm5205_reset_w(device, 1); } else if (state->adpcm_data != -1) { msm5205_data_w(device, state->adpcm_data & 0x0f); state->adpcm_data = -1; } else { state->adpcm_data = device->machine->region("adpcm")->base()[state->adpcm_pos++]; msm5205_data_w(device, state->adpcm_data >> 4); } }
static void spd_adpcm_int(device_t *device) { spdodgeb_state *state = device->machine().driver_data<spdodgeb_state>(); int chip = (strcmp(device->tag(), ":msm1") == 0) ? 0 : 1; if (state->m_adpcm_pos[chip] >= state->m_adpcm_end[chip] || state->m_adpcm_pos[chip] >= 0x10000) { state->m_adpcm_idle[chip] = 1; msm5205_reset_w(device,1); } else if (state->m_adpcm_data[chip] != -1) { msm5205_data_w(device,state->m_adpcm_data[chip] & 0x0f); state->m_adpcm_data[chip] = -1; } else { UINT8 *ROM = device->machine().root_device().memregion("adpcm")->base() + 0x10000 * chip; state->m_adpcm_data[chip] = ROM[state->m_adpcm_pos[chip]++]; msm5205_data_w(device,state->m_adpcm_data[chip] >> 4); } }
static void kfr_adpcm2_int(device_t *device) { kungfur_state *state = device->machine().driver_data<kungfur_state>(); if (state->m_adpcm_pos[1] >= 0x10000 || state->m_adpcm_idle[1]) { msm5205_reset_w(device->machine().device("adpcm2"),1); state->m_trigger2 = 0; } else { UINT8 *ROM = device->machine().region("adpcm2")->base(); state->m_adpcm_data2 = ((state->m_trigger2 ? (ROM[state->m_adpcm_pos[1]] & 0x0f) : (ROM[state->m_adpcm_pos[1]] & 0xf0)>>4) ); msm5205_data_w(device->machine().device("adpcm2"), state->m_adpcm_data2 & 0xf); state->m_trigger2 ^= 1; if(state->m_trigger2 == 0) { state->m_adpcm_pos[1]++; if((ROM[state->m_adpcm_pos[1]] & 0xff) == 0xff) state->m_adpcm_idle[1] = 1; } } }
static WRITE8_DEVICE_HANDLER( adpcm_data_w ) { msm5205_data_w(device, data); }
static void kurukuru_msm5205_vck(device_t *device) { kurukuru_state *state = device->machine().driver_data<kurukuru_state>(); state->update_sound_irq(state->m_sound_irq_cause | 2); msm5205_data_w(device, state->m_adpcm_data); }