diff --git a/src/mame/audio/taito_en.c b/src/mame/audio/taito_en.c index e40a96be858..19981be5280 100644 --- a/src/mame/audio/taito_en.c +++ b/src/mame/audio/taito_en.c @@ -1,8 +1,26 @@ +/*************************************************************************** + + Taito Ensoniq ES5505-based sound hardware + + TODO: + + * Implement ES5510 ESP + +****************************************************************************/ + #include "emu.h" +#include "machine/68681.h" +#include "machine/mb87078.h" #include "sound/es5506.h" #include "taito_en.h" -static int counter,vector_reg,imr_status; + +/************************************* + * + * Statics + * + *************************************/ + static UINT16 es5510_dsp_ram[0x200]; static UINT32 es5510_gpr[0xc0]; static UINT32 es5510_dram[1<<24]; @@ -11,45 +29,42 @@ static UINT32 es5510_dil_latch; static UINT32 es5510_dadr_latch; static UINT32 es5510_gpr_latch; static UINT8 es5510_ram_sel; -static int timer_mode,m68681_imr; -static UINT32 *f3_shared_ram; - -//static int es_tmp=1; - -#define M68000_CLOCK 16000000 -#define M68681_CLOCK 2000000 /* Actually X1, not the main clock */ - -enum { TIMER_SINGLESHOT, TIMER_PULSE }; +static UINT32 *snd_shared_ram; - -static READ16_HANDLER(f3_68000_share_r) +/************************************* + * + * Handlers + * + *************************************/ + +static READ16_HANDLER( en_68000_share_r ) { switch (offset & 3) { - case 0: return (f3_shared_ram[offset/4]&0xff000000)>>16; - case 1: return (f3_shared_ram[offset/4]&0x00ff0000)>>8; - case 2: return (f3_shared_ram[offset/4]&0x0000ff00)>>0; - case 3: return (f3_shared_ram[offset/4]&0x000000ff)<<8; + case 0: return (snd_shared_ram[offset/4]&0xff000000)>>16; + case 1: return (snd_shared_ram[offset/4]&0x00ff0000)>>8; + case 2: return (snd_shared_ram[offset/4]&0x0000ff00)>>0; + case 3: return (snd_shared_ram[offset/4]&0x000000ff)<<8; } return 0; } -static WRITE16_HANDLER(f3_68000_share_w) +static WRITE16_HANDLER( en_68000_share_w ) { switch (offset & 3) { - case 0: f3_shared_ram[offset/4] = (f3_shared_ram[offset/4]&0x00ffffff)|((data&0xff00)<<16); - case 1: f3_shared_ram[offset/4] = (f3_shared_ram[offset/4]&0xff00ffff)|((data&0xff00)<<8); - case 2: f3_shared_ram[offset/4] = (f3_shared_ram[offset/4]&0xffff00ff)|((data&0xff00)<<0); - case 3: f3_shared_ram[offset/4] = (f3_shared_ram[offset/4]&0xffffff00)|((data&0xff00)>>8); + case 0: snd_shared_ram[offset/4] = (snd_shared_ram[offset/4]&0x00ffffff)|((data&0xff00)<<16); + case 1: snd_shared_ram[offset/4] = (snd_shared_ram[offset/4]&0xff00ffff)|((data&0xff00)<<8); + case 2: snd_shared_ram[offset/4] = (snd_shared_ram[offset/4]&0xffff00ff)|((data&0xff00)<<0); + case 3: snd_shared_ram[offset/4] = (snd_shared_ram[offset/4]&0xffffff00)|((data&0xff00)>>8); } } -static WRITE16_HANDLER( f3_es5505_bank_w ) +static WRITE16_HANDLER( en_es5505_bank_w ) { - UINT32 max_banks_this_game=(space->machine().root_device().memregion("ensoniq.0")->bytes()/0x200000)-1; + UINT32 max_banks_this_game = (space->machine().root_device().memregion("ensoniq.0")->bytes()/0x200000)-1; #if 0 { @@ -64,132 +79,20 @@ static WRITE16_HANDLER( f3_es5505_bank_w ) es5505_voice_bank_w(space->machine().device("ensoniq"),offset,data<<20); } -static WRITE8_HANDLER( f3_volume_w ) +static WRITE16_HANDLER( en_volume_w ) { - static UINT8 latch,ch[8]; - - if(offset == 0) - latch = data & 0x7; - else - { - ch[latch] = data; - if((latch & 6) == 6) - { - double ch_vol; - - ch_vol = (double)(ch[latch] & 0x3f); - ch_vol/= 63.0; - ch_vol*= 100.0; - /* Left/Right panning trusted with Arabian Magic Sound Test menu. */ - es5505_set_channel_volume(space->machine().device("ensoniq"),(latch & 1) ^ 1,ch_vol); - } - } - - //popmessage("%02x %02x %02x %02x %02x %02x %02x %02x",ch[0],ch[1],ch[2],ch[3],ch[4],ch[5],ch[6],ch[7]); - - /* Channel 5 - Left Aux? Always set to volume, but never used for panning */ - /* Channel 4 - Right Aux? Always set to volume, but never used for panning */ - /* Channels 0, 1, 2, 3 - Unused */ - + if (ACCESSING_BITS_8_15) + mb87078_data_w(space->machine().device("mb87078"), data >> 8, offset ^ 1); } -static TIMER_DEVICE_CALLBACK( taito_en_timer_callback ) -{ - /* Only cause IRQ if the mask is set to allow it */ - if (m68681_imr & 0x08) - { - device_set_input_line_vector(timer.machine().device("audiocpu"), 6, vector_reg); - cputag_set_input_line(timer.machine(), "audiocpu", 6, ASSERT_LINE); - imr_status |= 0x08; - } -} -static READ16_HANDLER(f3_68681_r) -{ - if (offset == 0x05) - { - int ret = imr_status; - imr_status = 0; - return ret; - } +/************************************* + * + * ES5510 + * + *************************************/ - if (offset == 0x0e) - return 1; - - /* IRQ ack */ - if (offset == 0x0f) - { - cputag_set_input_line(space->machine(), "audiocpu", 6, CLEAR_LINE); - return 0; - } - - return 0xff; -} - -static WRITE16_HANDLER(f3_68681_w) -{ - timer_device *timer; - switch (offset) { - case 0x04: /* ACR */ - switch ((data>>4)&7) { - case 0: - logerror("Counter: Unimplemented external IP2\n"); - break; - case 1: - logerror("Counter: Unimplemented TxCA - 1X clock of channel A\n"); - break; - case 2: - logerror("Counter: Unimplemented TxCB - 1X clock of channel B\n"); - break; - case 3: - logerror("Counter: X1/Clk - divided by 16, counter is %04x, so interrupt every %d cycles\n",counter,(M68000_CLOCK/M68681_CLOCK)*counter*16); - timer_mode=TIMER_SINGLESHOT; - timer = space->machine().device("timer_68681"); - timer->adjust(downcast(&space->device())->cycles_to_attotime((M68000_CLOCK/M68681_CLOCK)*counter*16)); - break; - case 4: - logerror("Timer: Unimplemented external IP2\n"); - break; - case 5: - logerror("Timer: Unimplemented external IP2/16\n"); - break; - case 6: - logerror("Timer: X1/Clk, counter is %04x, so interrupt every %d cycles\n",counter,(M68000_CLOCK/M68681_CLOCK)*counter); - timer_mode=TIMER_PULSE; - timer = space->machine().device("timer_68681"); - timer->adjust(downcast(&space->device())->cycles_to_attotime((M68000_CLOCK/M68681_CLOCK)*counter), 0, downcast(&space->device())->cycles_to_attotime((M68000_CLOCK/M68681_CLOCK)*counter)); - break; - case 7: - logerror("Timer: Unimplemented X1/Clk - divided by 16\n"); - break; - } - break; - - case 0x05: /* IMR */ - logerror("68681: %02x %02x\n",offset,data&0xff); - m68681_imr=data&0xff; - break; - - case 0x06: /* CTUR */ - counter=((data&0xff)<<8)|(counter&0xff); - break; - case 0x07: /* CTLR */ - counter=(counter&0xff00)|(data&0xff); - break; - case 0x08: break; /* MR1B (Mode register B) */ - case 0x09: break; /* CSRB (Clock select register B) */ - case 0x0a: break; /* CRB (Command register B) */ - case 0x0b: break; /* TBB (Transmit buffer B) */ - case 0x0c: /* IVR (Interrupt vector) */ - vector_reg=data&0xff; - break; - default: - logerror("68681: %02x %02x\n",offset,data&0xff); - break; - } -} - -static READ16_HANDLER(es5510_dsp_r) +static READ16_HANDLER( es5510_dsp_r ) { // logerror("%06x: DSP read offset %04x (data is %04x)\n",cpu_get_pc(&space->device()),offset,es5510_dsp_ram[offset]); // if (es_tmp) return es5510_dsp_ram[offset]; @@ -220,7 +123,7 @@ static READ16_HANDLER(es5510_dsp_r) return es5510_dsp_ram[offset]; } -static WRITE16_HANDLER(es5510_dsp_w) +static WRITE16_HANDLER( es5510_dsp_w ) { UINT8 *snd_mem = (UINT8 *)space->machine().root_device().memregion("ensoniq.0")->base(); @@ -287,21 +190,35 @@ static WRITE16_HANDLER(es5510_dsp_w) } } -static ADDRESS_MAP_START( f3_sound_map, AS_PROGRAM, 16, driver_device ) + +/************************************* + * + * 68000 memory map + * + *************************************/ + +static ADDRESS_MAP_START( en_sound_map, AS_PROGRAM, 16, driver_device ) AM_RANGE(0x000000, 0x00ffff) AM_RAM AM_MIRROR(0x30000) AM_SHARE("share1") - AM_RANGE(0x140000, 0x140fff) AM_READWRITE_LEGACY(f3_68000_share_r, f3_68000_share_w) + AM_RANGE(0x140000, 0x140fff) AM_READWRITE_LEGACY(en_68000_share_r, en_68000_share_w) AM_RANGE(0x200000, 0x20001f) AM_DEVREADWRITE_LEGACY("ensoniq", es5505_r, es5505_w) AM_RANGE(0x260000, 0x2601ff) AM_READWRITE_LEGACY(es5510_dsp_r, es5510_dsp_w) - AM_RANGE(0x280000, 0x28001f) AM_READWRITE_LEGACY(f3_68681_r, f3_68681_w) - AM_RANGE(0x300000, 0x30003f) AM_WRITE_LEGACY(f3_es5505_bank_w) - AM_RANGE(0x340000, 0x340003) AM_WRITE8_LEGACY(f3_volume_w,0xff00) /* 8 channel volume control */ + AM_RANGE(0x280000, 0x28001f) AM_DEVREADWRITE8_LEGACY("duart68681", duart68681_r, duart68681_w, 0x00ff) + AM_RANGE(0x300000, 0x30003f) AM_WRITE_LEGACY(en_es5505_bank_w) + AM_RANGE(0x340000, 0x340003) AM_WRITE_LEGACY(en_volume_w) AM_RANGE(0xc00000, 0xc1ffff) AM_ROMBANK("bank1") AM_RANGE(0xc20000, 0xc3ffff) AM_ROMBANK("bank2") AM_RANGE(0xc40000, 0xc7ffff) AM_ROMBANK("bank3") AM_RANGE(0xff0000, 0xffffff) AM_RAM AM_SHARE("share1") // mirror ADDRESS_MAP_END -SOUND_RESET( taito_f3_soundsystem_reset ) + +/************************************* + * + * Reset + * + *************************************/ + +SOUND_RESET( taito_en_soundsystem_reset ) { /* Sound cpu program loads to 0xc00000 so we use a bank */ UINT16 *ROM = (UINT16 *)machine.root_device().memregion("audiocpu")->base(); @@ -319,27 +236,92 @@ SOUND_RESET( taito_f3_soundsystem_reset ) machine.device("audiocpu")->reset(); //cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); - f3_shared_ram = (UINT32 *)machine.root_device().memshare("f3_shared")->ptr(); + snd_shared_ram = (UINT32 *)machine.root_device().memshare("snd_shared")->ptr(); } -static const es5505_interface es5505_taito_f3_config = + +/************************************* + * + * MB87078 callback + * + *************************************/ + +static void mb87078_gain_changed( running_machine &machine, int channel, int percent ) +{ + if (channel < 2) + { + es5505_device *es5505 = machine.device("ensoniq"); + + es5505->set_output_gain(channel, percent / 100.0); + } +} + + +/************************************* + * + * M68681 callback + * + *************************************/ + +static void taito_en_duart_irq_handler(device_t *device, int state, UINT8 vector) +{ + if (state == ASSERT_LINE) + { + device_set_input_line_vector(device->machine().device("audiocpu"), M68K_IRQ_6, vector); + device_set_input_line(device->machine().device("audiocpu"), M68K_IRQ_6, ASSERT_LINE); + } + else + { + device_set_input_line(device->machine().device("audiocpu"), M68K_IRQ_6, CLEAR_LINE); + } +} + + +/************************************* + * + * Device interfaces + * + *************************************/ + +static const duart68681_config taito_en_duart68681_config = +{ + taito_en_duart_irq_handler, + NULL, + NULL, + NULL +}; + +static const mb87078_interface taito_en_mb87078_intf = +{ + mb87078_gain_changed +}; + +static const es5505_interface es5505_taito_en_config = { "ensoniq.0", /* Bank 0: Unused by F3 games? */ "ensoniq.0", /* Bank 1: All games seem to use this */ - NULL /* irq */ + NULL /* IRQ */ }; -MACHINE_CONFIG_FRAGMENT( taito_f3_sound ) - MCFG_TIMER_ADD("timer_68681", taito_en_timer_callback) - MCFG_SOUND_RESET( taito_f3_soundsystem_reset ) +/************************************* + * + * Machine driver + * + *************************************/ + +MACHINE_CONFIG_FRAGMENT( taito_en_sound ) + MCFG_CPU_ADD("audiocpu", M68000, XTAL_16MHz) + MCFG_CPU_PROGRAM_MAP(en_sound_map) - MCFG_CPU_ADD("audiocpu", M68000, 16000000) - MCFG_CPU_PROGRAM_MAP(f3_sound_map) + MCFG_DUART68681_ADD("duart68681", XTAL_16MHz / 4, taito_en_duart68681_config) + MCFG_MB87078_ADD("mb87078", taito_en_mb87078_intf) + + MCFG_SOUND_RESET(taito_en_soundsystem_reset) MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_SOUND_ADD("ensoniq", ES5505, 30476100/2) - MCFG_SOUND_CONFIG(es5505_taito_f3_config) + MCFG_SOUND_ADD("ensoniq", ES5505, XTAL_30_4761MHz / 2) + MCFG_SOUND_CONFIG(es5505_taito_en_config) MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) MACHINE_CONFIG_END diff --git a/src/mame/audio/taito_en.h b/src/mame/audio/taito_en.h index 0c6088744e6..b600713fe73 100644 --- a/src/mame/audio/taito_en.h +++ b/src/mame/audio/taito_en.h @@ -1,6 +1,6 @@ #include "cpu/m68000/m68000.h" #include "sound/es5506.h" -SOUND_RESET( taito_f3_soundsystem_reset ); +SOUND_RESET( taito_en_soundsystem_reset ); -MACHINE_CONFIG_EXTERN( taito_f3_sound ); +MACHINE_CONFIG_EXTERN( taito_en_sound ); diff --git a/src/mame/drivers/galastrm.c b/src/mame/drivers/galastrm.c index c8ddd82a29a..9b967520ab1 100644 --- a/src/mame/drivers/galastrm.c +++ b/src/mame/drivers/galastrm.c @@ -175,7 +175,7 @@ static ADDRESS_MAP_START( galastrm_map, AS_PROGRAM, 32, galastrm_state ) AM_RANGE(0x400000, 0x400007) AM_WRITE(galastrm_input_w) /* eerom etc. */ AM_RANGE(0x40fff0, 0x40fff3) AM_WRITENOP AM_RANGE(0x500000, 0x500007) AM_READWRITE(galastrm_adstick_ctrl_r, galastrm_adstick_ctrl_w) - AM_RANGE(0x600000, 0x6007ff) AM_RAM AM_SHARE("f3_shared") /* Sound shared ram */ + AM_RANGE(0x600000, 0x6007ff) AM_RAM AM_SHARE("snd_shared") /* Sound shared ram */ AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_long_r, tc0480scp_long_w) /* tilemaps */ AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_long_r, tc0480scp_ctrl_long_w) AM_RANGE(0x900000, 0x900003) AM_WRITE(galastrm_palette_w) /* TC0110PCR */ @@ -331,7 +331,7 @@ static MACHINE_CONFIG_START( galastrm, galastrm_state ) MCFG_TC0480SCP_ADD("tc0480scp", galastrm_tc0480scp_intf) /* sound hardware */ - MCFG_FRAGMENT_ADD(taito_f3_sound) + MCFG_FRAGMENT_ADD(taito_en_sound) MACHINE_CONFIG_END /***************************************************************************/ diff --git a/src/mame/drivers/groundfx.c b/src/mame/drivers/groundfx.c index 00100d6053f..a52a628998f 100644 --- a/src/mame/drivers/groundfx.c +++ b/src/mame/drivers/groundfx.c @@ -220,7 +220,7 @@ static ADDRESS_MAP_START( groundfx_map, AS_PROGRAM, 32, groundfx_state ) AM_RANGE(0x500004, 0x500007) AM_READ_PORT("SYSTEM") AM_RANGE(0x500000, 0x500007) AM_WRITE(groundfx_input_w) /* eeprom etc. */ AM_RANGE(0x600000, 0x600003) AM_READWRITE(groundfx_adc_r,groundfx_adc_w) - AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_SHARE("f3_shared") + AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_SHARE("snd_shared") AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_long_r, tc0480scp_long_w) /* tilemaps */ AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_long_r, tc0480scp_ctrl_long_w) // debugging AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_long_r, tc0100scn_long_w) /* piv tilemaps */ @@ -387,7 +387,7 @@ static MACHINE_CONFIG_START( groundfx, groundfx_state ) MCFG_TC0480SCP_ADD("tc0480scp", groundfx_tc0480scp_intf) /* sound hardware */ - MCFG_FRAGMENT_ADD(taito_f3_sound) + MCFG_FRAGMENT_ADD(taito_en_sound) MACHINE_CONFIG_END /*************************************************************************** diff --git a/src/mame/drivers/gunbustr.c b/src/mame/drivers/gunbustr.c index 79eecfc1114..ceb154dfda2 100644 --- a/src/mame/drivers/gunbustr.c +++ b/src/mame/drivers/gunbustr.c @@ -156,7 +156,7 @@ static ADDRESS_MAP_START( gunbustr_map, AS_PROGRAM, 32, gunbustr_state ) AM_RANGE(0x200000, 0x21ffff) AM_RAM AM_SHARE("ram") /* main CPUA ram */ AM_RANGE(0x300000, 0x301fff) AM_RAM AM_SHARE("spriteram") /* Sprite ram */ AM_RANGE(0x380000, 0x380003) AM_WRITE(motor_control_w) /* motor, lamps etc. */ - AM_RANGE(0x390000, 0x3907ff) AM_RAM AM_SHARE("f3_shared") /* Sound shared ram */ + AM_RANGE(0x390000, 0x3907ff) AM_RAM AM_SHARE("snd_shared") /* Sound shared ram */ AM_RANGE(0x400000, 0x400003) AM_READ_PORT("P1_P2") AM_RANGE(0x400004, 0x400007) AM_READ_PORT("SYSTEM") AM_RANGE(0x400000, 0x400007) AM_WRITE(gunbustr_input_w) /* eerom etc. */ @@ -325,7 +325,7 @@ static MACHINE_CONFIG_START( gunbustr, gunbustr_state ) MCFG_TC0480SCP_ADD("tc0480scp", gunbustr_tc0480scp_intf) /* sound hardware */ - MCFG_FRAGMENT_ADD(taito_f3_sound) + MCFG_FRAGMENT_ADD(taito_en_sound) MACHINE_CONFIG_END /***************************************************************************/ diff --git a/src/mame/drivers/superchs.c b/src/mame/drivers/superchs.c index f57c60f7c92..c477acbe57b 100644 --- a/src/mame/drivers/superchs.c +++ b/src/mame/drivers/superchs.c @@ -230,7 +230,7 @@ static ADDRESS_MAP_START( superchs_map, AS_PROGRAM, 32, superchs_state ) AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_SHARE("shared_ram") AM_RANGE(0x240000, 0x240003) AM_WRITE(cpua_ctrl_w) AM_RANGE(0x280000, 0x287fff) AM_RAM_WRITE(superchs_palette_w) AM_SHARE("paletteram") - AM_RANGE(0x2c0000, 0x2c07ff) AM_RAM AM_SHARE("f3_shared") + AM_RANGE(0x2c0000, 0x2c07ff) AM_RAM AM_SHARE("snd_shared") AM_RANGE(0x300000, 0x300007) AM_READWRITE(superchs_input_r, superchs_input_w) /* eerom etc. */ AM_RANGE(0x340000, 0x340003) AM_READWRITE(superchs_stick_r, superchs_stick_w) /* stick int request */ ADDRESS_MAP_END @@ -393,7 +393,7 @@ static MACHINE_CONFIG_START( superchs, superchs_state ) MCFG_TC0480SCP_ADD("tc0480scp", superchs_tc0480scp_intf) /* sound hardware */ - MCFG_FRAGMENT_ADD(taito_f3_sound) + MCFG_FRAGMENT_ADD(taito_en_sound) MACHINE_CONFIG_END /***************************************************************************/ diff --git a/src/mame/drivers/taito_f3.c b/src/mame/drivers/taito_f3.c index ac1ca7f14fb..ff901f6718c 100644 --- a/src/mame/drivers/taito_f3.c +++ b/src/mame/drivers/taito_f3.c @@ -201,7 +201,7 @@ static ADDRESS_MAP_START( f3_map, AS_PROGRAM, 32, taito_f3_state ) AM_RANGE(0x630000, 0x63ffff) AM_READWRITE16(f3_pivot_r,f3_pivot_w,0xffffffff) //AM_SHARE("f3_pivot_ram") AM_RANGE(0x660000, 0x66000f) AM_WRITE16(f3_control_0_w,0xffffffff) AM_RANGE(0x660010, 0x66001f) AM_WRITE16(f3_control_1_w,0xffffffff) - AM_RANGE(0xc00000, 0xc007ff) AM_RAM AM_SHARE("f3_shared") + AM_RANGE(0xc00000, 0xc007ff) AM_RAM AM_SHARE("snd_shared") AM_RANGE(0xc80000, 0xc80003) AM_WRITE(f3_sound_reset_0_w) AM_RANGE(0xc80100, 0xc80103) AM_WRITE(f3_sound_reset_1_w) ADDRESS_MAP_END @@ -403,7 +403,7 @@ static INTERRUPT_GEN( f3_interrupt2 ) static SOUND_RESET( f3 ) { - SOUND_RESET_CALL( taito_f3_soundsystem_reset ); + SOUND_RESET_CALL( taito_en_soundsystem_reset ); cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); } @@ -451,7 +451,7 @@ static MACHINE_CONFIG_START( f3, taito_f3_state ) MCFG_VIDEO_START(f3) /* sound hardware */ - MCFG_FRAGMENT_ADD(taito_f3_sound) + MCFG_FRAGMENT_ADD(taito_en_sound) MCFG_SOUND_RESET(f3) MACHINE_CONFIG_END diff --git a/src/mame/drivers/taitojc.c b/src/mame/drivers/taitojc.c index dbcff4f6117..282444330f3 100644 --- a/src/mame/drivers/taitojc.c +++ b/src/mame/drivers/taitojc.c @@ -790,29 +790,29 @@ WRITE32_MEMBER(taitojc_state::dsp_shared_w) } } -READ32_MEMBER(taitojc_state::f3_share_r) +READ32_MEMBER(taitojc_state::snd_share_r) { switch (offset & 3) { - case 0: return (m_f3_shared_ram[(offset/4)] << 0) & 0xff000000; - case 1: return (m_f3_shared_ram[(offset/4)] << 8) & 0xff000000; - case 2: return (m_f3_shared_ram[(offset/4)] << 16) & 0xff000000; - case 3: return (m_f3_shared_ram[(offset/4)] << 24) & 0xff000000; + case 0: return (m_snd_shared_ram[(offset/4)] << 0) & 0xff000000; + case 1: return (m_snd_shared_ram[(offset/4)] << 8) & 0xff000000; + case 2: return (m_snd_shared_ram[(offset/4)] << 16) & 0xff000000; + case 3: return (m_snd_shared_ram[(offset/4)] << 24) & 0xff000000; } return 0; } -WRITE32_MEMBER(taitojc_state::f3_share_w) +WRITE32_MEMBER(taitojc_state::snd_share_w) { UINT32 d = (data >> 24) & 0xff; switch (offset & 3) { - case 0: m_f3_shared_ram[(offset/4)] &= ~0xff000000; m_f3_shared_ram[(offset/4)] |= d << 24; break; - case 1: m_f3_shared_ram[(offset/4)] &= ~0x00ff0000; m_f3_shared_ram[(offset/4)] |= d << 16; break; - case 2: m_f3_shared_ram[(offset/4)] &= ~0x0000ff00; m_f3_shared_ram[(offset/4)] |= d << 8; break; - case 3: m_f3_shared_ram[(offset/4)] &= ~0x000000ff; m_f3_shared_ram[(offset/4)] |= d << 0; break; + case 0: m_snd_shared_ram[(offset/4)] &= ~0xff000000; m_snd_shared_ram[(offset/4)] |= d << 24; break; + case 1: m_snd_shared_ram[(offset/4)] &= ~0x00ff0000; m_snd_shared_ram[(offset/4)] |= d << 16; break; + case 2: m_snd_shared_ram[(offset/4)] &= ~0x0000ff00; m_snd_shared_ram[(offset/4)] |= d << 8; break; + case 3: m_snd_shared_ram[(offset/4)] &= ~0x000000ff; m_snd_shared_ram[(offset/4)] |= d << 0; break; } } @@ -854,7 +854,7 @@ static ADDRESS_MAP_START( taitojc_map, AS_PROGRAM, 32, taitojc_state ) AM_RANGE(0x06600010, 0x06600013) AM_WRITE(jc_coin_counters_w) AM_RANGE(0x06600040, 0x0660004f) AM_WRITE(jc_control_w) //AM_RANGE(0x06800000, 0x06801fff) AM_NOP // unknown - AM_RANGE(0x06a00000, 0x06a01fff) AM_READWRITE(f3_share_r, f3_share_w) AM_SHARE("f3_shared") + AM_RANGE(0x06a00000, 0x06a01fff) AM_READWRITE(snd_share_r, snd_share_w) AM_SHARE("snd_shared") AM_RANGE(0x06c00000, 0x06c0001f) AM_READ(jc_lan_r) AM_WRITENOP // Dangerous Curves AM_RANGE(0x06e00000, 0x06e00007) AM_WRITE(jc_meters_w) AM_RANGE(0x08000000, 0x080fffff) AM_RAM AM_SHARE("main_ram") @@ -1395,7 +1395,7 @@ static MACHINE_CONFIG_START( taitojc, taitojc_state ) MCFG_VIDEO_START(taitojc) /* sound hardware */ - MCFG_FRAGMENT_ADD(taito_f3_sound) + MCFG_FRAGMENT_ADD(taito_en_sound) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( dendego, taitojc ) diff --git a/src/mame/drivers/undrfire.c b/src/mame/drivers/undrfire.c index 2f688da0137..025020395ac 100644 --- a/src/mame/drivers/undrfire.c +++ b/src/mame/drivers/undrfire.c @@ -480,7 +480,7 @@ static ADDRESS_MAP_START( undrfire_map, AS_PROGRAM, 32, undrfire_state ) AM_RANGE(0x400000, 0x400003) AM_WRITE(motor_control_w) /* gun vibration */ AM_RANGE(0x500000, 0x500007) AM_READWRITE(undrfire_input_r, undrfire_input_w) /* eerom etc. */ AM_RANGE(0x600000, 0x600007) AM_READWRITE(unknown_hardware_r, unknown_int_req_w) /* int request for unknown hardware */ - AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_SHARE("f3_shared") + AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_SHARE("snd_shared") AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_long_r, tc0480scp_long_w) /* tilemaps */ AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_long_r, tc0480scp_ctrl_long_w) AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_long_r, tc0100scn_long_w) /* piv tilemaps */ @@ -499,7 +499,7 @@ static ADDRESS_MAP_START( cbombers_cpua_map, AS_PROGRAM, 32, undrfire_state ) AM_RANGE(0x400000, 0x400003) AM_WRITE(cbombers_cpua_ctrl_w) AM_RANGE(0x500000, 0x500007) AM_READWRITE(undrfire_input_r, undrfire_input_w) AM_RANGE(0x600000, 0x600007) AM_READWRITE(cbombers_adc_r, cbombers_adc_w) - AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_SHARE("f3_shared") + AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_SHARE("snd_shared") AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_long_r, tc0480scp_long_w) /* tilemaps */ AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_long_r, tc0480scp_ctrl_long_w) AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_long_r, tc0100scn_long_w) /* piv tilemaps */ @@ -750,7 +750,7 @@ static MACHINE_CONFIG_START( undrfire, undrfire_state ) MCFG_TC0480SCP_ADD("tc0480scp", undrfire_tc0480scp_intf) /* sound hardware */ - MCFG_FRAGMENT_ADD(taito_f3_sound) + MCFG_FRAGMENT_ADD(taito_en_sound) MACHINE_CONFIG_END @@ -786,7 +786,7 @@ static MACHINE_CONFIG_START( cbombers, undrfire_state ) MCFG_TC0480SCP_ADD("tc0480scp", undrfire_tc0480scp_intf) /* sound hardware */ - MCFG_FRAGMENT_ADD(taito_f3_sound) + MCFG_FRAGMENT_ADD(taito_en_sound) MACHINE_CONFIG_END diff --git a/src/mame/includes/taitojc.h b/src/mame/includes/taitojc.h index 0cb744508c0..789a36c880e 100644 --- a/src/mame/includes/taitojc.h +++ b/src/mame/includes/taitojc.h @@ -9,7 +9,7 @@ public: m_dsp(*this,"dsp"), m_vram(*this, "vram"), m_objlist(*this, "objlist"), - m_f3_shared_ram(*this, "f3_shared"), + m_snd_shared_ram(*this, "snd_shared"), m_main_ram(*this, "main_ram"), m_dsp_shared_ram(*this, "dsp_shared"), m_palette_ram(*this, "palette_ram") @@ -50,7 +50,7 @@ public: required_device m_dsp; required_shared_ptr m_vram; required_shared_ptr m_objlist; - optional_shared_ptr m_f3_shared_ram; + optional_shared_ptr m_snd_shared_ram; required_shared_ptr m_main_ram; required_shared_ptr m_dsp_shared_ram; required_shared_ptr m_palette_ram; @@ -81,8 +81,8 @@ public: DECLARE_READ8_MEMBER(jc_pcbid_r); DECLARE_READ32_MEMBER(dsp_shared_r); DECLARE_WRITE32_MEMBER(dsp_shared_w); - DECLARE_READ32_MEMBER(f3_share_r); - DECLARE_WRITE32_MEMBER(f3_share_w); + DECLARE_READ32_MEMBER(snd_share_r); + DECLARE_WRITE32_MEMBER(snd_share_w); DECLARE_WRITE32_MEMBER(jc_meters_w); DECLARE_READ32_MEMBER(jc_lan_r); DECLARE_READ8_MEMBER(hc11_comm_r);