Taking baby steps. Break out the sound communications part of atarigen

into its own device. Update all callers.
This commit is contained in:
Aaron Giles 2013-07-13 06:44:57 +00:00
parent 903af18204
commit 45505e51b0
25 changed files with 573 additions and 441 deletions

View File

@ -178,7 +178,7 @@ void atarijsa_init(running_machine &machine, const char *testport, int testmask)
void atarijsa_reset(running_machine &machine)
{
/* reset the sound I/O system */
machine.driver_data<atarigen_state>()->sound_io_reset();
machine.driver_data<atarigen_state>()->m_soundcomm->reset();
/* reset the static states */
overall_volume = 100;
@ -213,7 +213,7 @@ static READ8_HANDLER( jsa1_io_r )
break;
case 0x002: /* /RDP */
result = atarigen->m6502_sound_r(space, offset);
result = atarigen->m_soundcomm->sound_command_r(space, offset);
break;
case 0x004: /* /RDIO */
@ -229,8 +229,8 @@ static READ8_HANDLER( jsa1_io_r )
*/
result = space.machine().root_device().ioport("JSAI")->read();
if (!(space.machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x80;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
if (atarigen->m_soundcomm->main_to_sound_ready()) result ^= 0x40;
if (atarigen->m_soundcomm->sound_to_main_ready()) result ^= 0x20;
if ((tms5220 != NULL) && (tms5220->readyq_r() == 0))
result |= 0x10;
else
@ -238,7 +238,7 @@ static READ8_HANDLER( jsa1_io_r )
break;
case 0x006: /* /IRQACK */
atarigen->m6502_irq_ack_r(space, 0);
atarigen->m_soundcomm->sound_irq_ack_r(space, 0);
break;
case 0x200: /* /VOICE */
@ -264,7 +264,7 @@ static WRITE8_HANDLER( jsa1_io_w )
break;
case 0x006: /* /IRQACK */
space.machine().driver_data<atarigen_state>()->m6502_irq_ack_r(space, 0);
space.machine().driver_data<atarigen_state>()->m_soundcomm->sound_irq_ack_r(space, 0);
break;
case 0x200: /* /VOICE */
@ -273,7 +273,7 @@ static WRITE8_HANDLER( jsa1_io_w )
break;
case 0x202: /* /WRP */
space.machine().driver_data<atarigen_state>()->m6502_sound_w(space, offset, data);
space.machine().driver_data<atarigen_state>()->m_soundcomm->sound_response_w(space, offset, data);
break;
case 0x204: /* WRIO */
@ -346,7 +346,7 @@ static READ8_HANDLER( jsa2_io_r )
break;
case 0x002: /* /RDP */
result = atarigen->m6502_sound_r(space, offset);
result = atarigen->m_soundcomm->sound_command_r(space, offset);
break;
case 0x004: /* /RDIO */
@ -362,12 +362,12 @@ static READ8_HANDLER( jsa2_io_r )
*/
result = space.machine().root_device().ioport("JSAII")->read();
if (!(space.machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x80;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
if (atarigen->m_soundcomm->main_to_sound_ready()) result ^= 0x40;
if (atarigen->m_soundcomm->sound_to_main_ready()) result ^= 0x20;
break;
case 0x006: /* /IRQACK */
atarigen->m6502_irq_ack_r(space, 0);
atarigen->m_soundcomm->sound_irq_ack_r(space, 0);
break;
case 0x200: /* /WRV */
@ -393,7 +393,7 @@ static WRITE8_HANDLER( jsa2_io_w )
break;
case 0x006: /* /IRQACK */
space.machine().driver_data<atarigen_state>()->m6502_irq_ack_r(space, 0);
space.machine().driver_data<atarigen_state>()->m_soundcomm->sound_irq_ack_r(space, 0);
break;
case 0x200: /* /WRV */
@ -404,7 +404,7 @@ static WRITE8_HANDLER( jsa2_io_w )
break;
case 0x202: /* /WRP */
space.machine().driver_data<atarigen_state>()->m6502_sound_w(space, offset, data);
space.machine().driver_data<atarigen_state>()->m_soundcomm->sound_response_w(space, offset, data);
break;
case 0x204: /* /WRIO */
@ -469,7 +469,7 @@ static READ8_HANDLER( jsa3_io_r )
break;
case 0x002: /* /RDP */
result = atarigen->m6502_sound_r(space, offset);
result = atarigen->m_soundcomm->sound_command_r(space, offset);
break;
case 0x004: /* /RDIO */
@ -485,12 +485,12 @@ static READ8_HANDLER( jsa3_io_r )
*/
result = space.machine().root_device().ioport("JSAIII")->read();
if (!(space.machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x90;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
if (atarigen->m_soundcomm->main_to_sound_ready()) result ^= 0x40;
if (atarigen->m_soundcomm->sound_to_main_ready()) result ^= 0x20;
break;
case 0x006: /* /IRQACK */
atarigen->m6502_irq_ack_r(space, 0);
atarigen->m_soundcomm->sound_irq_ack_r(space, 0);
break;
case 0x200: /* /WRV */
@ -520,7 +520,7 @@ static WRITE8_HANDLER( jsa3_io_w )
break;
case 0x006: /* /IRQACK */
space.machine().driver_data<atarigen_state>()->m6502_irq_ack_r(space, 0);
space.machine().driver_data<atarigen_state>()->m_soundcomm->sound_irq_ack_r(space, 0);
break;
case 0x200: /* /WRV */
@ -529,7 +529,7 @@ static WRITE8_HANDLER( jsa3_io_w )
break;
case 0x202: /* /WRP */
space.machine().driver_data<atarigen_state>()->m6502_sound_w(space, offset, data);
space.machine().driver_data<atarigen_state>()->m_soundcomm->sound_response_w(space, offset, data);
break;
case 0x204: /* /WRIO */
@ -603,7 +603,7 @@ static READ8_HANDLER( jsa3s_io_r )
break;
case 0x002: /* /RDP */
result = atarigen->m6502_sound_r(space, offset);
result = atarigen->m_soundcomm->sound_command_r(space, offset);
break;
case 0x004: /* /RDIO */
@ -619,12 +619,12 @@ static READ8_HANDLER( jsa3s_io_r )
*/
result = space.machine().root_device().ioport("JSAIII")->read();
if (!(space.machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x90;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
if (atarigen->m_soundcomm->main_to_sound_ready()) result ^= 0x40;
if (atarigen->m_soundcomm->sound_to_main_ready()) result ^= 0x20;
break;
case 0x006: /* /IRQACK */
atarigen->m6502_irq_ack_r(space, 0);
atarigen->m_soundcomm->sound_irq_ack_r(space, 0);
break;
case 0x200: /* /WRV */
@ -654,7 +654,7 @@ static WRITE8_HANDLER( jsa3s_io_w )
break;
case 0x006: /* /IRQACK */
space.machine().driver_data<atarigen_state>()->m6502_irq_ack_r(space, 0);
space.machine().driver_data<atarigen_state>()->m_soundcomm->sound_irq_ack_r(space, 0);
break;
case 0x200: /* /WRV */
@ -663,7 +663,7 @@ static WRITE8_HANDLER( jsa3s_io_w )
break;
case 0x202: /* /WRP */
space.machine().driver_data<atarigen_state>()->m6502_sound_w(space, offset, data);
space.machine().driver_data<atarigen_state>()->m_soundcomm->sound_response_w(space, offset, data);
break;
case 0x204: /* /WRIO */
@ -795,13 +795,14 @@ MACHINE_CONFIG_FRAGMENT( jsa_i_stereo )
/* basic machine hardware */
MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2)
MCFG_CPU_PROGRAM_MAP(atarijsa1_map)
MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
MCFG_DEVICE_PERIODIC_INT_DEVICE("^soundcomm", atari_sound_comm_device, sound_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
/* sound hardware */
MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "jsa", WRITELINE(atarigen_state, sound_int_write_line))
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_YM2151_ADD("ymsnd", JSA_MASTER_CLOCK)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(atarigen_state, ym2151_irq_gen))
MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("soundcomm", atari_sound_comm_device, ym2151_irq_gen))
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(driver_device, member_wrapper8<ym2151_ctl_w>))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.60)
@ -839,13 +840,14 @@ MACHINE_CONFIG_FRAGMENT( jsa_i_mono_speech )
/* basic machine hardware */
MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2)
MCFG_CPU_PROGRAM_MAP(atarijsa1_map)
MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
MCFG_DEVICE_PERIODIC_INT_DEVICE("^soundcomm", atari_sound_comm_device, sound_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
/* sound hardware */
MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "jsa", WRITELINE(atarigen_state, sound_int_write_line))
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_YM2151_ADD("ymsnd", JSA_MASTER_CLOCK)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(atarigen_state, ym2151_irq_gen))
MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("soundcomm", atari_sound_comm_device, ym2151_irq_gen))
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(driver_device, member_wrapper8<ym2151_ctl_w>))
MCFG_SOUND_ROUTE(0, "mono", 0.60)
MCFG_SOUND_ROUTE(1, "mono", 0.60)
@ -861,13 +863,14 @@ MACHINE_CONFIG_FRAGMENT( jsa_ii_mono )
/* basic machine hardware */
MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2)
MCFG_CPU_PROGRAM_MAP(atarijsa2_map)
MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
MCFG_DEVICE_PERIODIC_INT_DEVICE("^soundcomm", atari_sound_comm_device, sound_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
/* sound hardware */
MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "jsa", WRITELINE(atarigen_state, sound_int_write_line))
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_YM2151_ADD("ymsnd", JSA_MASTER_CLOCK)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(atarigen_state, ym2151_irq_gen))
MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("soundcomm", atari_sound_comm_device, ym2151_irq_gen))
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(driver_device, member_wrapper8<ym2151_ctl_w>))
MCFG_SOUND_ROUTE(0, "mono", 0.60)
MCFG_SOUND_ROUTE(1, "mono", 0.60)
@ -905,13 +908,14 @@ MACHINE_CONFIG_FRAGMENT( jsa_iiis_stereo )
/* basic machine hardware */
MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2)
MCFG_CPU_PROGRAM_MAP(atarijsa3s_map)
MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
MCFG_DEVICE_PERIODIC_INT_DEVICE("^soundcomm", atari_sound_comm_device, sound_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
/* sound hardware */
MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "jsa", WRITELINE(atarigen_state, sound_int_write_line))
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_YM2151_ADD("ymsnd", JSA_MASTER_CLOCK)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(atarigen_state, ym2151_irq_gen))
MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("soundcomm", atari_sound_comm_device, ym2151_irq_gen))
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(driver_device, member_wrapper8<ym2151_ctl_w>))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.60)

View File

@ -32,8 +32,8 @@ READ8_MEMBER(cyberbal_state::special_port3_r)
{
int temp = ioport("JSAII")->read();
if (!(ioport("IN0")->read() & 0x8000)) temp ^= 0x80;
if (m_cpu_to_sound_ready) temp ^= 0x40;
if (m_sound_to_cpu_ready) temp ^= 0x20;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x40;
if (m_soundcomm->sound_to_main_ready()) temp ^= 0x20;
return temp;
}

View File

@ -86,7 +86,7 @@ WRITE16_MEMBER(atarig1_state::mo_command_w)
READ16_MEMBER(atarig1_state::special_port0_r)
{
int temp = ioport("IN0")->read();
if (m_cpu_to_sound_ready) temp ^= 0x1000;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x1000;
temp ^= 0x2000; /* A2DOK always high for now */
return temp;
}
@ -204,13 +204,13 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarig1_state )
AM_RANGE(0x078000, 0x07ffff) AM_ROM /* hydra slapstic goes here */
AM_RANGE(0xf80000, 0xf80001) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0xf88000, 0xf8ffff) AM_WRITE(eeprom_enable_w)
AM_RANGE(0xf90000, 0xf90001) AM_WRITE8(sound_w, 0xff00)
AM_RANGE(0xf98000, 0xf98001) AM_WRITE(sound_reset_w)
AM_RANGE(0xf90000, 0xf90001) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0xff00)
AM_RANGE(0xf98000, 0xf98001) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0xfa0000, 0xfa0001) AM_WRITE(mo_control_w)
AM_RANGE(0xfb0000, 0xfb0001) AM_WRITE(video_int_ack_w)
AM_RANGE(0xfc0000, 0xfc0001) AM_READ(special_port0_r)
AM_RANGE(0xfc8000, 0xfc8007) AM_READWRITE(a2d_data_r, a2d_select_w)
AM_RANGE(0xfd0000, 0xfd0001) AM_READ8(sound_r, 0xff00)
AM_RANGE(0xfd0000, 0xfd0001) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0xff00)
AM_RANGE(0xfd8000, 0xfdffff) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
/* AM_RANGE(0xfe0000, 0xfe7fff) AM_READ(from_r)*/
AM_RANGE(0xfe8000, 0xfe89ff) AM_RAM_WRITE(paletteram_666_w) AM_SHARE("paletteram")

View File

@ -67,8 +67,8 @@ MACHINE_RESET_MEMBER(atarig42_state,atarig42)
READ16_MEMBER(atarig42_state::special_port2_r)
{
int temp = ioport("IN2")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0020;
if (m_sound_to_cpu_ready) temp ^= 0x0010;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x0020;
if (m_soundcomm->sound_to_main_ready()) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
return temp;
}
@ -338,8 +338,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarig42_state )
AM_RANGE(0xe00010, 0xe00011) AM_READ(special_port2_r)
AM_RANGE(0xe00012, 0xe00013) AM_READ_PORT("JSAIII")
AM_RANGE(0xe00020, 0xe00027) AM_READWRITE(a2d_data_r, a2d_select_w)
AM_RANGE(0xe00030, 0xe00031) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0xe00040, 0xe00041) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0xe00030, 0xe00031) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0xe00040, 0xe00041) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
AM_RANGE(0xe00050, 0xe00051) AM_WRITE(io_latch_w)
AM_RANGE(0xe00060, 0xe00061) AM_WRITE(eeprom_enable_w)
AM_RANGE(0xe03000, 0xe03001) AM_WRITE(video_int_ack_w)

View File

@ -58,8 +58,8 @@ MACHINE_RESET_MEMBER(atarigx2_state,atarigx2)
READ32_MEMBER(atarigx2_state::special_port2_r)
{
int temp = ioport("SERVICE")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0020;
if (m_sound_to_cpu_ready) temp ^= 0x0010;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x0020;
if (m_soundcomm->sound_to_main_ready()) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
return (temp << 16) | temp;
}
@ -1147,14 +1147,14 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, atarigx2_state )
AM_RANGE(0xd7a200, 0xd7a203) AM_WRITE(mo_command_w) AM_SHARE("mo_command")
AM_RANGE(0xd70000, 0xd7ffff) AM_RAM
AM_RANGE(0xd80000, 0xd9ffff) AM_WRITE16(eeprom_enable_w, 0xffffffff)
AM_RANGE(0xe06000, 0xe06003) AM_WRITE8(sound_w, 0xff000000)
AM_RANGE(0xe06000, 0xe06003) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0xff000000)
AM_RANGE(0xe08000, 0xe08003) AM_WRITE(latch_w)
AM_RANGE(0xe0c000, 0xe0c003) AM_WRITE16(video_int_ack_w, 0xffffffff)
AM_RANGE(0xe0e000, 0xe0e003) AM_WRITENOP//watchdog_reset_w },
AM_RANGE(0xe80000, 0xe80003) AM_READ_PORT("P1_P2")
AM_RANGE(0xe82000, 0xe82003) AM_READ(special_port2_r)
AM_RANGE(0xe82004, 0xe82007) AM_READ(special_port3_r)
AM_RANGE(0xe86000, 0xe86003) AM_READ8(sound_r, 0xff000000)
AM_RANGE(0xe86000, 0xe86003) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0xff000000)
AM_RANGE(0xff8000, 0xffffff) AM_RAM
ADDRESS_MAP_END

View File

@ -346,7 +346,7 @@ READ16_MEMBER(atarisy1_state::trakball_r)
READ16_MEMBER(atarisy1_state::port4_r)
{
int temp = ioport("F60000")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0080;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x0080;
return temp;
}
@ -362,8 +362,8 @@ READ8_MEMBER(atarisy1_state::switch_6502_r)
{
int temp = ioport("1820")->read();
if (m_cpu_to_sound_ready) temp ^= 0x08;
if (m_sound_to_cpu_ready) temp ^= 0x10;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x08;
if (m_soundcomm->sound_to_main_ready()) temp ^= 0x10;
if (!(ioport("F60000")->read() & 0x0040)) temp ^= 0x80;
return temp;
@ -479,9 +479,9 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarisy1_state )
AM_RANGE(0xf20000, 0xf20007) AM_READ(trakball_r)
AM_RANGE(0xf40000, 0xf4001f) AM_READWRITE(joystick_r, joystick_w)
AM_RANGE(0xf60000, 0xf60003) AM_READ(port4_r)
AM_RANGE(0xf80000, 0xf80001) AM_WRITE8(sound_w, 0x00ff) /* used by roadbls2 */
AM_RANGE(0xfc0000, 0xfc0001) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0xfe0000, 0xfe0001) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0xf80000, 0xf80001) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff) /* used by roadbls2 */
AM_RANGE(0xfc0000, 0xfc0001) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0xfe0000, 0xfe0001) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
ADDRESS_MAP_END
@ -496,7 +496,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, atarisy1_state )
AM_RANGE(0x0000, 0x0fff) AM_RAM
AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE("via6522_0", via6522_device, read, write)
AM_RANGE(0x1800, 0x1801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0x1810, 0x1810) AM_READWRITE(m6502_sound_r, m6502_sound_w)
AM_RANGE(0x1810, 0x1810) AM_DEVREADWRITE("soundcomm", atari_sound_comm_device, sound_command_r, sound_response_w)
AM_RANGE(0x1820, 0x1820) AM_READ(switch_6502_r)
AM_RANGE(0x1824, 0x1825) AM_WRITE(led_w)
AM_RANGE(0x1870, 0x187f) AM_DEVREADWRITE("pokey", pokey_device, read, write)
@ -771,10 +771,11 @@ static MACHINE_CONFIG_START( atarisy1, atarisy1_state )
MCFG_VIDEO_START_OVERRIDE(atarisy1_state,atarisy1)
/* sound hardware */
MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(atarigen_state, sound_int_write_line))
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_YM2151_ADD("ymsnd", ATARI_CLOCK_14MHz/4)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(atarigen_state, ym2151_irq_gen))
MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("soundcomm", atari_sound_comm_device, ym2151_irq_gen))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)

View File

@ -337,8 +337,8 @@ READ16_MEMBER(atarisy2_state::switch_r)
{
int result = ioport("1800")->read() | (ioport("1801")->read() << 8);
if (m_cpu_to_sound_ready) result ^= 0x20;
if (m_sound_to_cpu_ready) result ^= 0x10;
if (m_soundcomm->main_to_sound_ready()) result ^= 0x20;
if (m_soundcomm->sound_to_main_ready()) result ^= 0x10;
return result;
}
@ -348,8 +348,8 @@ READ8_MEMBER(atarisy2_state::switch_6502_r)
{
int result = ioport("1840")->read();
if (m_cpu_to_sound_ready) result |= 0x01;
if (m_sound_to_cpu_ready) result |= 0x02;
if (m_soundcomm->main_to_sound_ready()) result |= 0x01;
if (m_soundcomm->sound_to_main_ready()) result |= 0x02;
if ((m_has_tms5220) && (machine().device<tms5220_device>("tms")->readyq_r() == 0))
result &= ~0x04;
if (!(ioport("1801")->read() & 0x80)) result |= 0x10;
@ -682,7 +682,7 @@ WRITE8_MEMBER(atarisy2_state::sound_reset_w)
return;
/* a large number of signals are reset when this happens */
sound_io_reset();
m_soundcomm->reset();
machine().device("ymsnd")->reset();
if (m_has_tms5220)
{
@ -699,7 +699,7 @@ READ16_MEMBER(atarisy2_state::sound_r)
update_interrupts();
/* handle it normally otherwise */
return atarigen_state::sound_r(space,offset) | 0xff00;
return m_soundcomm->main_response_r(space,offset) | 0xff00;
}
@ -710,7 +710,7 @@ WRITE8_MEMBER(atarisy2_state::sound_6502_w)
update_interrupts();
/* handle it normally otherwise */
m6502_sound_w(space, offset, data);
m_soundcomm->sound_response_w(space, offset, data);
}
@ -721,7 +721,7 @@ READ8_MEMBER(atarisy2_state::sound_6502_r)
update_interrupts();
/* handle it normally otherwise */
return m6502_sound_r(space, offset);
return m_soundcomm->sound_command_r(space, offset);
}
@ -779,7 +779,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarisy2_state )
AM_RANGE(0x15c0, 0x15c1) AM_MIRROR(0x001e) AM_WRITE(scanline_int_ack_w)
AM_RANGE(0x15e0, 0x15e1) AM_MIRROR(0x001e) AM_WRITE(video_int_ack_w)
AM_RANGE(0x1600, 0x1601) AM_MIRROR(0x007e) AM_WRITE(int_enable_w)
AM_RANGE(0x1680, 0x1681) AM_MIRROR(0x007e) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0x1680, 0x1681) AM_MIRROR(0x007e) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
AM_RANGE(0x1700, 0x1701) AM_MIRROR(0x007e) AM_WRITE(xscroll_w) AM_SHARE("xscroll")
AM_RANGE(0x1780, 0x1781) AM_MIRROR(0x007e) AM_WRITE(yscroll_w) AM_SHARE("yscroll")
AM_RANGE(0x1800, 0x1801) AM_MIRROR(0x03fe) AM_READ(switch_r) AM_WRITE(watchdog_reset16_w)
@ -813,7 +813,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, atarisy2_state )
AM_RANGE(0x1872, 0x1873) AM_MIRROR(0x2780) AM_WRITE(tms5220_strobe_w)
AM_RANGE(0x1874, 0x1874) AM_MIRROR(0x2781) AM_WRITE(sound_6502_w)
AM_RANGE(0x1876, 0x1876) AM_MIRROR(0x2781) AM_WRITE(coincount_w)
AM_RANGE(0x1878, 0x1878) AM_MIRROR(0x2781) AM_WRITE(m6502_irq_ack_w)
AM_RANGE(0x1878, 0x1878) AM_MIRROR(0x2781) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_irq_ack_w)
AM_RANGE(0x187a, 0x187a) AM_MIRROR(0x2781) AM_WRITE(mixer_w)
AM_RANGE(0x187c, 0x187c) AM_MIRROR(0x2781) AM_WRITE(switch_6502_w)
AM_RANGE(0x187e, 0x187e) AM_MIRROR(0x2781) AM_WRITE(sound_reset_w)
@ -1238,7 +1238,7 @@ static MACHINE_CONFIG_START( atarisy2, atarisy2_state )
MCFG_CPU_ADD("audiocpu", M6502, SOUND_CLOCK/8)
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)MASTER_CLOCK/2/16/16/16/10)
MCFG_DEVICE_PERIODIC_INT_DEVICE("^soundcomm", atari_sound_comm_device, sound_irq_gen, (double)MASTER_CLOCK/2/16/16/16/10)
MCFG_MACHINE_START_OVERRIDE(atarisy2_state,atarisy2)
MCFG_MACHINE_RESET_OVERRIDE(atarisy2_state,atarisy2)
@ -1256,6 +1256,7 @@ static MACHINE_CONFIG_START( atarisy2, atarisy2_state )
MCFG_VIDEO_START_OVERRIDE(atarisy2_state,atarisy2)
/* sound hardware */
MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(atarigen_state, sound_int_write_line))
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK/4)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)

View File

@ -190,9 +190,9 @@ void badlands_state::scanline_update(screen_device &screen, int scanline)
/* sound IRQ is on 32V */
if (scanline & 32)
m6502_irq_ack_r(space, 0);
m_soundcomm->sound_irq_ack_r(space, 0);
else if (!(ioport("FE4000")->read() & 0x40))
m6502_irq_gen(m_audiocpu);
m_soundcomm->sound_irq_gen(m_audiocpu);
}
@ -249,7 +249,7 @@ INTERRUPT_GEN_MEMBER(badlands_state::vblank_int)
READ16_MEMBER(badlands_state::sound_busy_r)
{
int temp = 0xfeff;
if (m_cpu_to_sound_ready) temp ^= 0x0100;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x0100;
return temp;
}
@ -284,7 +284,7 @@ READ8_MEMBER(badlands_state::audio_io_r)
break;
case 0x002: /* /RDP */
result = m6502_sound_r(space, offset);
result = m_soundcomm->sound_command_r(space, offset);
break;
case 0x004: /* /RDIO */
@ -300,13 +300,13 @@ READ8_MEMBER(badlands_state::audio_io_r)
*/
result = ioport("AUDIO")->read();
if (!(ioport("FE4000")->read() & 0x0080)) result ^= 0x90;
if (m_cpu_to_sound_ready) result ^= 0x40;
if (m_sound_to_cpu_ready) result ^= 0x20;
if (m_soundcomm->main_to_sound_ready()) result ^= 0x40;
if (m_soundcomm->sound_to_main_ready()) result ^= 0x20;
result ^= 0x10;
break;
case 0x006: /* /IRQACK */
m6502_irq_ack_r(space, 0);
m_soundcomm->sound_irq_ack_r(space, 0);
break;
case 0x200: /* /VOICE */
@ -332,7 +332,7 @@ WRITE8_MEMBER(badlands_state::audio_io_w)
break;
case 0x006: /* /IRQACK */
m6502_irq_ack_r(space, 0);
m_soundcomm->sound_irq_ack_r(space, 0);
break;
case 0x200: /* n/c */
@ -340,7 +340,7 @@ WRITE8_MEMBER(badlands_state::audio_io_w)
break;
case 0x202: /* /WRP */
m6502_sound_w(space, offset, data);
m_soundcomm->sound_response_w(space, offset, data);
break;
case 0x204: /* WRIO */
@ -370,7 +370,7 @@ WRITE8_MEMBER(badlands_state::audio_io_w)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, badlands_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0xfc0000, 0xfc1fff) AM_READ(sound_busy_r) AM_WRITE(sound_reset_w)
AM_RANGE(0xfc0000, 0xfc1fff) AM_READ(sound_busy_r) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0xfd0000, 0xfd1fff) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0xfe0000, 0xfe1fff) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0xfe2000, 0xfe3fff) AM_WRITE(video_int_ack_w)
@ -379,8 +379,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, badlands_state )
AM_RANGE(0xfe6002, 0xfe6003) AM_READ_PORT("FE6002")
AM_RANGE(0xfe6004, 0xfe6005) AM_READ(pedal_0_r)
AM_RANGE(0xfe6006, 0xfe6007) AM_READ(pedal_1_r)
AM_RANGE(0xfe8000, 0xfe9fff) AM_WRITE8(sound_w, 0xff00)
AM_RANGE(0xfea000, 0xfebfff) AM_READ8(sound_r, 0xff00)
AM_RANGE(0xfe8000, 0xfe9fff) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0xff00)
AM_RANGE(0xfea000, 0xfebfff) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0xff00)
AM_RANGE(0xfec000, 0xfedfff) AM_WRITE(badlands_pf_bank_w)
AM_RANGE(0xfee000, 0xfeffff) AM_WRITE(eeprom_enable_w)
AM_RANGE(0xffc000, 0xffc3ff) AM_RAM_WRITE(expanded_paletteram_666_w) AM_SHARE("paletteram")
@ -518,6 +518,7 @@ static MACHINE_CONFIG_START( badlands, badlands_state )
MCFG_VIDEO_START_OVERRIDE(badlands_state,badlands)
/* sound hardware */
MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(atarigen_state, sound_int_write_line))
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_YM2151_ADD("ymsnd", ATARI_CLOCK_14MHz/4)

View File

@ -85,8 +85,8 @@ WRITE16_MEMBER(batman_state::batman_atarivc_w)
READ16_MEMBER(batman_state::special_port2_r)
{
int result = ioport("260010")->read();
if (m_sound_to_cpu_ready) result ^= 0x0010;
if (m_cpu_to_sound_ready) result ^= 0x0020;
if (m_soundcomm->sound_to_main_ready()) result ^= 0x0010;
if (m_soundcomm->main_to_sound_ready()) result ^= 0x0020;
return result;
}
@ -131,8 +131,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, batman_state )
AM_RANGE(0x260000, 0x260001) AM_MIRROR(0x11ff8c) AM_READ_PORT("260000")
AM_RANGE(0x260002, 0x260003) AM_MIRROR(0x11ff8c) AM_READ_PORT("260002")
AM_RANGE(0x260010, 0x260011) AM_MIRROR(0x11ff8e) AM_READ(special_port2_r)
AM_RANGE(0x260030, 0x260031) AM_MIRROR(0x11ff8e) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0x260040, 0x260041) AM_MIRROR(0x11ff8e) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0x260030, 0x260031) AM_MIRROR(0x11ff8e) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0x260040, 0x260041) AM_MIRROR(0x11ff8e) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
AM_RANGE(0x260050, 0x260051) AM_MIRROR(0x11ff8e) AM_WRITE(latch_w)
AM_RANGE(0x260060, 0x260061) AM_MIRROR(0x11ff8e) AM_WRITE(eeprom_enable_w)
AM_RANGE(0x2a0000, 0x2a0001) AM_MIRROR(0x11fffe) AM_WRITE(watchdog_reset16_w)

View File

@ -279,8 +279,8 @@ WRITE32_MEMBER( beathead_state::eeprom_enable_w )
READ32_MEMBER( beathead_state::input_2_r )
{
int result = ioport("IN2")->read();
if (m_sound_to_cpu_ready) result ^= 0x10;
if (m_cpu_to_sound_ready) result ^= 0x20;
if (m_soundcomm->sound_to_main_ready()) result ^= 0x10;
if (m_soundcomm->main_to_sound_ready()) result ^= 0x20;
return result;
}
@ -323,7 +323,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, beathead_state)
AM_RANGE(0x00000000, 0x0001ffff) AM_RAM AM_SHARE("ram_base")
AM_RANGE(0x01800000, 0x01bfffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("rom_base")
AM_RANGE(0x40000000, 0x400007ff) AM_RAM_WRITE(eeprom_data_w) AM_SHARE("nvram")
AM_RANGE(0x41000000, 0x41000003) AM_READWRITE8(sound_r, sound_w, 0x000000ff)
AM_RANGE(0x41000000, 0x41000003) AM_DEVREADWRITE8("soundcomm", atari_sound_comm_device, main_response_r, main_command_w, 0x000000ff)
AM_RANGE(0x41000100, 0x41000103) AM_READ(interrupt_control_r)
AM_RANGE(0x41000100, 0x4100011f) AM_WRITE(interrupt_control_w)
AM_RANGE(0x41000200, 0x41000203) AM_READ_PORT("IN1")

View File

@ -66,7 +66,7 @@ READ16_MEMBER(blstroid_state::inputs_r)
static const char *const iptnames[] = { "IN0", "IN1" };
int temp = ioport(iptnames[offset & 1])->read();
if (m_cpu_to_sound_ready) temp ^= 0x0040;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x0040;
if (get_hblank(*machine().primary_screen)) temp ^= 0x0010;
return temp;
}
@ -88,10 +88,10 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, blstroid_state )
AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x7f81fe) AM_WRITE(video_int_ack_w)
AM_RANGE(0xff8600, 0xff8601) AM_MIRROR(0x7f81fe) AM_WRITE(eeprom_enable_w)
AM_RANGE(0xff8800, 0xff89ff) AM_MIRROR(0x7f8000) AM_WRITEONLY AM_SHARE("priorityram")
AM_RANGE(0xff8a00, 0xff8a01) AM_MIRROR(0x7f81fe) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0xff8c00, 0xff8c01) AM_MIRROR(0x7f81fe) AM_WRITE(sound_reset_w)
AM_RANGE(0xff8a00, 0xff8a01) AM_MIRROR(0x7f81fe) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
AM_RANGE(0xff8c00, 0xff8c01) AM_MIRROR(0x7f81fe) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0xff8e00, 0xff8e01) AM_MIRROR(0x7f81fe) AM_WRITE(blstroid_halt_until_hblank_0_w)
AM_RANGE(0xff9400, 0xff9401) AM_MIRROR(0x7f83fe) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0xff9400, 0xff9401) AM_MIRROR(0x7f83fe) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x7f83f8) AM_READ_PORT("DIAL0")
AM_RANGE(0xff9804, 0xff9805) AM_MIRROR(0x7f83f8) AM_READ_PORT("DIAL1")
AM_RANGE(0xff9c00, 0xff9c03) AM_MIRROR(0x7f83fc) AM_READ(inputs_r)

View File

@ -91,7 +91,7 @@ MACHINE_RESET_MEMBER(cyberbal_state,cyberbal2p)
READ16_MEMBER(cyberbal_state::special_port0_r)
{
int temp = ioport("IN0")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0080;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x0080;
return temp;
}
@ -99,7 +99,7 @@ READ16_MEMBER(cyberbal_state::special_port0_r)
READ16_MEMBER(cyberbal_state::special_port2_r)
{
int temp = ioport("IN2")->read();
if (m_cpu_to_sound_ready) temp ^= 0x2000;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x2000;
return temp;
}
@ -107,7 +107,7 @@ READ16_MEMBER(cyberbal_state::special_port2_r)
READ16_MEMBER(cyberbal_state::sound_state_r)
{
int temp = 0xffff;
if (m_cpu_to_sound_ready) temp ^= 0xffff;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0xffff;
return temp;
}
@ -135,12 +135,12 @@ WRITE16_MEMBER(cyberbal_state::p2_reset_w)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, cyberbal_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0xfc0000, 0xfc0fff) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0xfc8000, 0xfcffff) AM_READ8(sound_r, 0xff00)
AM_RANGE(0xfc8000, 0xfcffff) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0xff00)
AM_RANGE(0xfd0000, 0xfd1fff) AM_WRITE(eeprom_enable_w)
AM_RANGE(0xfd2000, 0xfd3fff) AM_WRITE(sound_reset_w)
AM_RANGE(0xfd2000, 0xfd3fff) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0xfd4000, 0xfd5fff) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0xfd6000, 0xfd7fff) AM_WRITE(p2_reset_w)
AM_RANGE(0xfd8000, 0xfd9fff) AM_WRITE8(sound_w, 0xff00)
AM_RANGE(0xfd8000, 0xfd9fff) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0xff00)
AM_RANGE(0xfe0000, 0xfe0fff) AM_READ(special_port0_r)
AM_RANGE(0xfe1000, 0xfe1fff) AM_READ_PORT("IN1")
AM_RANGE(0xfe8000, 0xfe8fff) AM_RAM_WRITE(paletteram_1_w) AM_SHARE("paletteram_1")
@ -196,10 +196,10 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cyberbal_state )
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0x2800, 0x2801) AM_WRITE(sound_68k_6502_w)
AM_RANGE(0x2802, 0x2803) AM_READWRITE(m6502_irq_ack_r, m6502_irq_ack_w)
AM_RANGE(0x2804, 0x2805) AM_WRITE(m6502_sound_w)
AM_RANGE(0x2802, 0x2803) AM_DEVREADWRITE("soundcomm", atari_sound_comm_device, sound_irq_ack_r, sound_irq_ack_w)
AM_RANGE(0x2804, 0x2805) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_response_w)
AM_RANGE(0x2806, 0x2807) AM_WRITE(sound_bank_select_w)
AM_RANGE(0x2c00, 0x2c01) AM_READ(m6502_sound_r)
AM_RANGE(0x2c00, 0x2c01) AM_DEVREAD("soundcomm", atari_sound_comm_device, sound_command_r)
AM_RANGE(0x2c02, 0x2c03) AM_READ(special_port3_r)
AM_RANGE(0x2c04, 0x2c05) AM_READ(sound_68k_6502_r)
AM_RANGE(0x2c06, 0x2c07) AM_READ(sound_6502_stat_r)
@ -237,14 +237,14 @@ static ADDRESS_MAP_START( cyberbal2p_map, AS_PROGRAM, 16, cyberbal_state )
AM_RANGE(0xfc0000, 0xfc0003) AM_READ_PORT("IN0")
AM_RANGE(0xfc2000, 0xfc2003) AM_READ_PORT("IN1")
AM_RANGE(0xfc4000, 0xfc4003) AM_READ(special_port2_r)
AM_RANGE(0xfc6000, 0xfc6003) AM_READ8(sound_r, 0xff00)
AM_RANGE(0xfc6000, 0xfc6003) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0xff00)
AM_RANGE(0xfc8000, 0xfc8fff) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0xfca000, 0xfcafff) AM_RAM_WRITE(paletteram_666_w) AM_SHARE("paletteram")
AM_RANGE(0xfd0000, 0xfd0003) AM_WRITE(eeprom_enable_w)
AM_RANGE(0xfd2000, 0xfd2003) AM_WRITE(sound_reset_w)
AM_RANGE(0xfd2000, 0xfd2003) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0xfd4000, 0xfd4003) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0xfd6000, 0xfd6003) AM_WRITE(video_int_ack_w)
AM_RANGE(0xfd8000, 0xfd8003) AM_WRITE8(sound_w, 0xff00)
AM_RANGE(0xfd8000, 0xfd8003) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0xff00)
AM_RANGE(0xfe0000, 0xfe0003) AM_READ(sound_state_r)
AM_RANGE(0xff0000, 0xff1fff) AM_RAM_WRITE(playfield_w) AM_SHARE("playfield")
AM_RANGE(0xff2000, 0xff2fff) AM_RAM_WRITE(alpha_w) AM_SHARE("alpha")
@ -409,7 +409,7 @@ static MACHINE_CONFIG_START( cyberbal, cyberbal_state )
MCFG_CPU_ADD("audiocpu", M6502, ATARI_CLOCK_14MHz/8)
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)ATARI_CLOCK_14MHz/4/4/16/16/14)
MCFG_DEVICE_PERIODIC_INT_DEVICE("^soundcomm", atari_sound_comm_device, sound_irq_gen, (double)ATARI_CLOCK_14MHz/4/4/16/16/14)
MCFG_CPU_ADD("extra", M68000, ATARI_CLOCK_14MHz/2)
MCFG_CPU_PROGRAM_MAP(extra_map)
@ -445,10 +445,11 @@ static MACHINE_CONFIG_START( cyberbal, cyberbal_state )
MCFG_VIDEO_START_OVERRIDE(cyberbal_state,cyberbal)
/* sound hardware */
MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(atarigen_state, sound_int_write_line))
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_YM2151_ADD("ymsnd", ATARI_CLOCK_14MHz/4)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(atarigen_state, ym2151_irq_gen))
MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("soundcomm", atari_sound_comm_device, ym2151_irq_gen))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.60)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.60)

View File

@ -67,8 +67,8 @@ READ16_MEMBER(eprom_state::special_port1_r)
{
int result = ioport("260010")->read();
if (m_sound_to_cpu_ready) result ^= 0x0004;
if (m_cpu_to_sound_ready) result ^= 0x0008;
if (m_soundcomm->sound_to_main_ready()) result ^= 0x0004;
if (m_soundcomm->main_to_sound_ready()) result ^= 0x0008;
result ^= 0x0010;
return result;
@ -152,12 +152,12 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, eprom_state )
AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r)
AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r)
AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0x260030, 0x260031) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x360000, 0x360001) AM_WRITE(video_int_ack_w)
AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w)
AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0x360020, 0x360021) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM AM_SHARE("paletteram")
AM_RANGE(0x3f0000, 0x3f1fff) AM_WRITE(playfield_w) AM_SHARE("playfield")
AM_RANGE(0x3f2000, 0x3f3fff) AM_READWRITE_LEGACY(atarimo_0_spriteram_r, atarimo_0_spriteram_w)
@ -177,12 +177,12 @@ static ADDRESS_MAP_START( guts_map, AS_PROGRAM, 16, eprom_state )
AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r)
AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r)
AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0x260030, 0x260031) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x360000, 0x360001) AM_WRITE(video_int_ack_w)
// AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w)
AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0x360020, 0x360021) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM AM_SHARE("paletteram")
AM_RANGE(0xff0000, 0xff1fff) AM_WRITE(playfield_upper_w) AM_SHARE("playfield_up")
AM_RANGE(0xff8000, 0xff9fff) AM_WRITE(playfield_w) AM_SHARE("playfield")
@ -208,11 +208,11 @@ static ADDRESS_MAP_START( extra_map, AS_PROGRAM, 16, eprom_state )
AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r)
AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r)
AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0x260030, 0x260031) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0x360000, 0x360001) AM_WRITE(video_int_ack_w)
AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w)
AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0x360020, 0x360021) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
ADDRESS_MAP_END

View File

@ -148,9 +148,9 @@ void gauntlet_state::scanline_update(screen_device &screen, int scanline)
/* sound IRQ is on 32V */
if (scanline & 32)
m6502_irq_gen(m_audiocpu);
m_soundcomm->sound_irq_gen(m_audiocpu);
else
m6502_irq_ack_r(space, 0);
m_soundcomm->sound_irq_ack_r(space, 0);
}
@ -180,8 +180,8 @@ MACHINE_RESET_MEMBER(gauntlet_state,gauntlet)
READ16_MEMBER(gauntlet_state::port4_r)
{
int temp = ioport("803008")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0020;
if (m_sound_to_cpu_ready) temp ^= 0x0010;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x0020;
if (m_soundcomm->sound_to_main_ready()) temp ^= 0x0010;
return temp;
}
@ -203,7 +203,7 @@ WRITE16_MEMBER(gauntlet_state::sound_reset_w)
if ((oldword ^ m_sound_reset_val) & 1)
{
m_audiocpu->set_input_line(INPUT_LINE_RESET, (m_sound_reset_val & 1) ? CLEAR_LINE : ASSERT_LINE);
sound_cpu_reset();
m_soundcomm->sound_cpu_reset();
if (m_sound_reset_val & 1)
{
machine().device("ymsnd")->reset();
@ -231,8 +231,8 @@ READ8_MEMBER(gauntlet_state::switch_6502_r)
tms5220_device *tms5220 = machine().device<tms5220_device>("tms");
int temp = 0x30;
if (m_cpu_to_sound_ready) temp ^= 0x80;
if (m_sound_to_cpu_ready) temp ^= 0x40;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x80;
if (m_soundcomm->sound_to_main_ready()) temp ^= 0x40;
if (!tms5220->readyq_r()) temp ^= 0x20;
if (!(ioport("803008")->read() & 0x0008)) temp ^= 0x10;
@ -308,12 +308,12 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, gauntlet_state )
AM_RANGE(0x803004, 0x803005) AM_MIRROR(0x2fcef0) AM_READ_PORT("803004")
AM_RANGE(0x803006, 0x803007) AM_MIRROR(0x2fcef0) AM_READ_PORT("803006")
AM_RANGE(0x803008, 0x803009) AM_MIRROR(0x2fcef0) AM_READ(port4_r)
AM_RANGE(0x80300e, 0x80300f) AM_MIRROR(0x2fcef0) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0x80300e, 0x80300f) AM_MIRROR(0x2fcef0) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0x803100, 0x803101) AM_MIRROR(0x2fce8e) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x803120, 0x803121) AM_MIRROR(0x2fce8e) AM_WRITE(sound_reset_w)
AM_RANGE(0x803120, 0x803121) AM_MIRROR(0x2fce8e) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0x803140, 0x803141) AM_MIRROR(0x2fce8e) AM_WRITE(video_int_ack_w)
AM_RANGE(0x803150, 0x803151) AM_MIRROR(0x2fce8e) AM_WRITE(eeprom_enable_w)
AM_RANGE(0x803170, 0x803171) AM_MIRROR(0x2fce8e) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0x803170, 0x803171) AM_MIRROR(0x2fce8e) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
/* VBUS */
AM_RANGE(0x900000, 0x901fff) AM_MIRROR(0x2c8000) AM_RAM_WRITE(playfield_w) AM_SHARE("playfield")
@ -338,14 +338,14 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, gauntlet_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x0fff) AM_MIRROR(0x2000) AM_RAM
AM_RANGE(0x1000, 0x100f) AM_MIRROR(0x27c0) AM_WRITE(m6502_sound_w)
AM_RANGE(0x1010, 0x101f) AM_MIRROR(0x27c0) AM_READ(m6502_sound_r)
AM_RANGE(0x1000, 0x100f) AM_MIRROR(0x27c0) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_response_w)
AM_RANGE(0x1010, 0x101f) AM_MIRROR(0x27c0) AM_DEVREAD("soundcomm", atari_sound_comm_device, sound_command_r)
AM_RANGE(0x1020, 0x102f) AM_MIRROR(0x27c0) AM_READ_PORT("COIN") AM_WRITE(mixer_w)
AM_RANGE(0x1030, 0x103f) AM_MIRROR(0x27c0) AM_READWRITE(switch_6502_r, sound_ctl_w)
AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x27c0) AM_DEVREADWRITE("pokey", pokey_device, read, write)
AM_RANGE(0x1810, 0x1811) AM_MIRROR(0x27ce) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0x1820, 0x182f) AM_MIRROR(0x27c0) AM_DEVWRITE("tms", tms5220_device, data_w)
AM_RANGE(0x1830, 0x183f) AM_MIRROR(0x27c0) AM_READWRITE(m6502_irq_ack_r, m6502_irq_ack_w)
AM_RANGE(0x1830, 0x183f) AM_MIRROR(0x27c0) AM_DEVREADWRITE("soundcomm", atari_sound_comm_device, sound_irq_ack_r, sound_irq_ack_w)
AM_RANGE(0x4000, 0xffff) AM_ROM
ADDRESS_MAP_END
@ -533,6 +533,7 @@ static MACHINE_CONFIG_START( gauntlet, gauntlet_state )
MCFG_VIDEO_START_OVERRIDE(gauntlet_state,gauntlet)
/* sound hardware */
MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(atarigen_state, sound_int_write_line))
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_YM2151_ADD("ymsnd", ATARI_CLOCK_14MHz/4)

View File

@ -475,7 +475,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( multisync_68k_map, AS_PROGRAM, 16, harddriv_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x600000, 0x603fff) AM_READWRITE8(sound_r, sound_w, 0xff00)
AM_RANGE(0x600000, 0x603fff) AM_DEVREADWRITE8("soundcomm", atari_sound_comm_device, main_response_r, main_command_w, 0xff00)
AM_RANGE(0x604000, 0x607fff) AM_READWRITE_LEGACY(hd68k_sound_reset_r, hd68k_nwr_w)
AM_RANGE(0x608000, 0x60bfff) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x60c000, 0x60ffff) AM_READWRITE_LEGACY(hd68k_port0_r, hd68k_irq_ack_w)

View File

@ -82,7 +82,7 @@ WRITE16_MEMBER(offtwall_state::offtwall_atarivc_w)
READ16_MEMBER(offtwall_state::special_port3_r)
{
int result = ioport("260010")->read();
if (m_cpu_to_sound_ready) result ^= 0x0020;
if (m_soundcomm->main_to_sound_ready()) result ^= 0x0020;
return result;
}
@ -270,8 +270,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, offtwall_state )
AM_RANGE(0x260020, 0x260021) AM_READ_PORT("260020")
AM_RANGE(0x260022, 0x260023) AM_READ_PORT("260022")
AM_RANGE(0x260024, 0x260025) AM_READ_PORT("260024")
AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0x260040, 0x260041) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0x260030, 0x260031) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0x260040, 0x260041) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
AM_RANGE(0x260050, 0x260051) AM_WRITE(io_latch_w)
AM_RANGE(0x260060, 0x260061) AM_WRITE(eeprom_enable_w)
AM_RANGE(0x2a0000, 0x2a0001) AM_WRITE(watchdog_reset16_w)

View File

@ -86,7 +86,7 @@ MACHINE_RESET_MEMBER(relief_state,relief)
READ16_MEMBER(relief_state::special_port2_r)
{
int result = ioport("260010")->read();
if (m_cpu_to_sound_ready) result ^= 0x0020;
if (m_soundcomm->main_to_sound_ready()) result ^= 0x0020;
if (!(result & 0x0080) || get_hblank(*machine().primary_screen)) result ^= 0x0001;
return result;
}

View File

@ -87,7 +87,7 @@ MACHINE_RESET_MEMBER(skullxbo_state,skullxbo)
READ16_MEMBER(skullxbo_state::special_port1_r)
{
int temp = ioport("FF5802")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0040;
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x0040;
if (get_hblank(*machine().primary_screen)) temp ^= 0x0010;
return temp;
}
@ -119,8 +119,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, skullxbo_state )
AM_RANGE(0xff0800, 0xff0bff) AM_WRITE(skullxbo_halt_until_hblank_0_w)
AM_RANGE(0xff0c00, 0xff0fff) AM_WRITE(eeprom_enable_w)
AM_RANGE(0xff1000, 0xff13ff) AM_WRITE(video_int_ack_w)
AM_RANGE(0xff1400, 0xff17ff) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0xff1800, 0xff1bff) AM_WRITE(sound_reset_w)
AM_RANGE(0xff1400, 0xff17ff) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
AM_RANGE(0xff1800, 0xff1bff) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0xff1c00, 0xff1c7f) AM_WRITE(skullxbo_playfieldlatch_w)
AM_RANGE(0xff1c80, 0xff1cff) AM_WRITE(skullxbo_xscroll_w) AM_SHARE("xscroll")
AM_RANGE(0xff1d00, 0xff1d7f) AM_WRITE(scanline_int_ack_w)
@ -133,7 +133,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, skullxbo_state )
AM_RANGE(0xff4000, 0xff47ff) AM_WRITE(skullxbo_yscroll_w) AM_SHARE("yscroll")
AM_RANGE(0xff4800, 0xff4fff) AM_WRITE(skullxbo_mobwr_w)
AM_RANGE(0xff6000, 0xff6fff) AM_WRITE(eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0xff5000, 0xff5001) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0xff5000, 0xff5001) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0xff5800, 0xff5801) AM_READ_PORT("FF5800")
AM_RANGE(0xff5802, 0xff5803) AM_READ(special_port1_r)
AM_RANGE(0xff6000, 0xff6fff) AM_READ(eeprom_r)

View File

@ -66,8 +66,8 @@ READ16_MEMBER(thunderj_state::special_port2_r)
{
int result = ioport("260012")->read();
if (m_sound_to_cpu_ready) result ^= 0x0004;
if (m_cpu_to_sound_ready) result ^= 0x0008;
if (m_soundcomm->sound_to_main_ready()) result ^= 0x0004;
if (m_soundcomm->main_to_sound_ready()) result ^= 0x0008;
result ^= 0x0010;
return result;
@ -150,11 +150,11 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, thunderj_state )
AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010")
AM_RANGE(0x260012, 0x260013) AM_READ(special_port2_r)
AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0x260030, 0x260031) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x360010, 0x360011) AM_WRITE(latch_w)
AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0x360020, 0x360021) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_WRITE(paletteram_666_w) AM_SHARE("paletteram")
AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE(thunderj_atarivc_r, thunderj_atarivc_w) AM_SHARE("atarivc_data")
AM_RANGE(0x3f0000, 0x3f1fff) AM_RAM_WRITE(playfield2_latched_msb_w) AM_SHARE("playfield2")
@ -182,11 +182,11 @@ static ADDRESS_MAP_START( extra_map, AS_PROGRAM, 16, thunderj_state )
AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010")
AM_RANGE(0x260012, 0x260013) AM_READ(special_port2_r)
AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0x260030, 0x260031) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0x360000, 0x360001) AM_WRITE(video_int_ack_w)
AM_RANGE(0x360010, 0x360011) AM_WRITE(latch_w)
AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0x360020, 0x360021) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
ADDRESS_MAP_END

View File

@ -82,7 +82,7 @@ READ16_MEMBER(toobin_state::special_port1_r)
{
int result = ioport("FF9000")->read();
if (get_hblank(*machine().primary_screen)) result ^= 0x8000;
if (m_cpu_to_sound_ready) result ^= 0x2000;
if (m_soundcomm->main_to_sound_ready()) result ^= 0x2000;
return result;
}
@ -104,18 +104,18 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, toobin_state )
AM_RANGE(0xc10000, 0xc107ff) AM_MIRROR(0x047800) AM_RAM_WRITE(toobin_paletteram_w) AM_SHARE("paletteram")
AM_RANGE(0xff6000, 0xff6001) AM_READNOP /* who knows? read at controls time */
AM_RANGE(0xff8000, 0xff8001) AM_MIRROR(0x4500fe) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0xff8100, 0xff8101) AM_MIRROR(0x4500fe) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0xff8100, 0xff8101) AM_MIRROR(0x4500fe) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
AM_RANGE(0xff8300, 0xff8301) AM_MIRROR(0x45003e) AM_WRITE(toobin_intensity_w)
AM_RANGE(0xff8340, 0xff8341) AM_MIRROR(0x45003e) AM_WRITE(interrupt_scan_w) AM_SHARE("interrupt_scan")
AM_RANGE(0xff8380, 0xff8381) AM_MIRROR(0x45003e) AM_READ_LEGACY(atarimo_0_slipram_r) AM_WRITE(toobin_slip_w)
AM_RANGE(0xff83c0, 0xff83c1) AM_MIRROR(0x45003e) AM_WRITE(scanline_int_ack_w)
AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x4500fe) AM_WRITE(sound_reset_w)
AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x4500fe) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0xff8500, 0xff8501) AM_MIRROR(0x4500fe) AM_WRITE(eeprom_enable_w)
AM_RANGE(0xff8600, 0xff8601) AM_MIRROR(0x4500fe) AM_WRITE(toobin_xscroll_w) AM_SHARE("xscroll")
AM_RANGE(0xff8700, 0xff8701) AM_MIRROR(0x4500fe) AM_WRITE(toobin_yscroll_w) AM_SHARE("yscroll")
AM_RANGE(0xff8800, 0xff8801) AM_MIRROR(0x4507fe) AM_READ_PORT("FF8800")
AM_RANGE(0xff9000, 0xff9001) AM_MIRROR(0x4507fe) AM_READ(special_port1_r)
AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x4507fe) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x4507fe) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0xffa000, 0xffafff) AM_MIRROR(0x451000) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0xffc000, 0xffffff) AM_MIRROR(0x450000) AM_RAM
ADDRESS_MAP_END

View File

@ -56,8 +56,8 @@ MACHINE_RESET_MEMBER(vindictr_state,vindictr)
READ16_MEMBER(vindictr_state::port1_r)
{
int result = ioport("260010")->read();
if (m_sound_to_cpu_ready) result ^= 0x0004;
if (m_cpu_to_sound_ready) result ^= 0x0008;
if (m_soundcomm->sound_to_main_ready()) result ^= 0x0004;
if (m_soundcomm->main_to_sound_ready()) result ^= 0x0008;
result ^= 0x0010;
return result;
}
@ -79,12 +79,12 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, vindictr_state )
AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
AM_RANGE(0x260010, 0x26001f) AM_READ(port1_r)
AM_RANGE(0x260020, 0x26002f) AM_READ_PORT("260020")
AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0x260030, 0x260031) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x360000, 0x360001) AM_WRITE(scanline_int_ack_w)
AM_RANGE(0x360010, 0x360011) AM_WRITENOP
AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0x360020, 0x360021) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_WRITE(vindictr_paletteram_w) AM_SHARE("paletteram")
AM_RANGE(0x3f0000, 0x3f1fff) AM_MIRROR(0x8000) AM_RAM_WRITE(playfield_w) AM_SHARE("playfield")
AM_RANGE(0x3f2000, 0x3f3fff) AM_MIRROR(0x8000) AM_READWRITE_LEGACY(atarimo_0_spriteram_r, atarimo_0_spriteram_w)

View File

@ -57,7 +57,7 @@ READ16_MEMBER(xybots_state::special_port1_r)
{
int result = ioport("FFE200")->read();
if (m_cpu_to_sound_ready) result ^= 0x0200;
if (m_soundcomm->main_to_sound_ready()) result ^= 0x0200;
result ^= m_h256 ^= 0x0400;
return result;
}
@ -82,14 +82,14 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, xybots_state )
AM_RANGE(0xffb000, 0xffbfff) AM_MIRROR(0x7f8000) AM_RAM_WRITE(playfield_w) AM_SHARE("playfield")
AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x7f8800) AM_RAM_WRITE(paletteram_IIIIRRRRGGGGBBBB_word_w) AM_SHARE("paletteram")
AM_RANGE(0xffd000, 0xffdfff) AM_MIRROR(0x7f8000) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0xffe000, 0xffe0ff) AM_MIRROR(0x7f8000) AM_READ8(sound_r, 0x00ff)
AM_RANGE(0xffe000, 0xffe0ff) AM_MIRROR(0x7f8000) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0xffe100, 0xffe1ff) AM_MIRROR(0x7f8000) AM_READ_PORT("FFE100")
AM_RANGE(0xffe200, 0xffe2ff) AM_MIRROR(0x7f8000) AM_READ(special_port1_r)
AM_RANGE(0xffe800, 0xffe8ff) AM_MIRROR(0x7f8000) AM_WRITE(eeprom_enable_w)
AM_RANGE(0xffe900, 0xffe9ff) AM_MIRROR(0x7f8000) AM_WRITE8(sound_w, 0x00ff)
AM_RANGE(0xffe900, 0xffe9ff) AM_MIRROR(0x7f8000) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
AM_RANGE(0xffea00, 0xffeaff) AM_MIRROR(0x7f8000) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0xffeb00, 0xffebff) AM_MIRROR(0x7f8000) AM_WRITE(video_int_ack_w)
AM_RANGE(0xffee00, 0xffeeff) AM_MIRROR(0x7f8000) AM_WRITE(sound_reset_w)
AM_RANGE(0xffee00, 0xffeeff) AM_MIRROR(0x7f8000) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
ADDRESS_MAP_END

View File

@ -80,6 +80,300 @@ inline const atarigen_screen_timer *get_screen_timer(screen_device &screen)
/***************************************************************************
OVERALL INIT
***************************************************************************/
// device type definition
const device_type ATARI_SOUND_COMM = &device_creator<atari_sound_comm_device>;
//-------------------------------------------------
// atari_sound_comm_device - constructor
//-------------------------------------------------
atari_sound_comm_device::atari_sound_comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, ATARI_SOUND_COMM, "Atari Sound Communications", tag, owner, clock, "atarscom", __FILE__),
m_sound_cpu_tag(NULL),
m_main_int_cb(*this),
m_sound_cpu(NULL),
m_main_to_sound_ready(false),
m_sound_to_main_ready(false),
m_main_to_sound_data(0),
m_sound_to_main_data(0),
m_timed_int(0),
m_ym2151_int(0)
{
}
//-------------------------------------------------
// static_set_sound_cpu: Set the tag of the
// sound CPU
//-------------------------------------------------
void atari_sound_comm_device::static_set_sound_cpu(device_t &device, const char *cputag)
{
downcast<atari_sound_comm_device &>(device).m_sound_cpu_tag = cputag;
}
//-------------------------------------------------
// device_start: Start up the device
//-------------------------------------------------
void atari_sound_comm_device::device_start()
{
// find the sound CPU
if (m_sound_cpu_tag == NULL)
throw emu_fatalerror("No sound CPU specified!");
m_sound_cpu = siblingdevice<m6502_device>(m_sound_cpu_tag);
if (m_sound_cpu == NULL)
throw emu_fatalerror("Sound CPU '%s' not found!", m_sound_cpu_tag);
// resolve callbacks
m_main_int_cb.resolve_safe();
// register for save states
save_item(NAME(m_main_to_sound_ready));
save_item(NAME(m_sound_to_main_ready));
save_item(NAME(m_main_to_sound_data));
save_item(NAME(m_sound_to_main_data));
save_item(NAME(m_timed_int));
save_item(NAME(m_ym2151_int));
}
//-------------------------------------------------
// device_reset: Handle a device reset by
// clearing the interrupt lines and states
//-------------------------------------------------
void atari_sound_comm_device::device_reset()
{
// reset the internal interrupts states
m_timed_int = m_ym2151_int = 0;
// reset the sound I/O states
m_main_to_sound_data = m_sound_to_main_data = 0;
m_main_to_sound_ready = m_sound_to_main_ready = false;
}
//-------------------------------------------------
// device_timer: Handle device-specific timer
// calbacks
//-------------------------------------------------
void atari_sound_comm_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
switch (id)
{
case TID_SOUND_RESET:
delayed_sound_reset(param);
break;
case TID_SOUND_WRITE:
delayed_sound_write(param);
break;
case TID_6502_WRITE:
delayed_6502_write(param);
break;
}
}
//-------------------------------------------------
// sound_irq_gen: Generates an IRQ signal to the
// 6502 sound processor.
//-------------------------------------------------
INTERRUPT_GEN_MEMBER(atari_sound_comm_device::sound_irq_gen)
{
m_timed_int = 1;
update_sound_irq();
}
//-------------------------------------------------
// sound_irq_ack_r: Resets the IRQ signal to the
// 6502 sound processor. Both reads and writes
// can be used.
//-------------------------------------------------
READ8_MEMBER(atari_sound_comm_device::sound_irq_ack_r)
{
m_timed_int = 0;
update_sound_irq();
return 0;
}
WRITE8_MEMBER(atari_sound_comm_device::sound_irq_ack_w)
{
m_timed_int = 0;
update_sound_irq();
}
//-------------------------------------------------
// atarigen_ym2151_irq_gen: Sets the state of the
// YM2151's IRQ line.
//-------------------------------------------------
WRITE_LINE_MEMBER(atari_sound_comm_device::ym2151_irq_gen)
{
m_ym2151_int = state;
update_sound_irq();
}
//-------------------------------------------------
// sound_reset_w: Write handler which resets the
// sound CPU in response.
//-------------------------------------------------
WRITE16_MEMBER(atari_sound_comm_device::sound_reset_w)
{
synchronize(TID_SOUND_RESET);
}
//-------------------------------------------------
// main_command_w: Handles communication from the main CPU
// to the sound CPU. Two versions are provided, one with the
// data byte in the low 8 bits, and one with the data byte in
// the upper 8 bits.
//-------------------------------------------------
WRITE8_MEMBER(atari_sound_comm_device::main_command_w)
{
synchronize(TID_SOUND_WRITE, data);
}
//-------------------------------------------------
// main_response_r: Handles reading data communicated from the
// sound CPU to the main CPU. Two versions are provided, one
// with the data byte in the low 8 bits, and one with the data
// byte in the upper 8 bits.
//-------------------------------------------------
READ8_MEMBER(atari_sound_comm_device::main_response_r)
{
m_sound_to_main_ready = false;
m_main_int_cb(CLEAR_LINE);
return m_sound_to_main_data;
}
//-------------------------------------------------
// sound_response_w: Handles communication from the
// sound CPU to the main CPU.
//-------------------------------------------------
WRITE8_MEMBER(atari_sound_comm_device::sound_response_w)
{
synchronize(TID_6502_WRITE, data);
}
//-------------------------------------------------
// sound_command_r: Handles reading data
// communicated from the main CPU to the sound
// CPU.
//-------------------------------------------------
READ8_MEMBER(atari_sound_comm_device::sound_command_r)
{
m_main_to_sound_ready = false;
m_sound_cpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
return m_main_to_sound_data;
}
//-------------------------------------------------
// update_sound_irq: Called whenever the IRQ state
// changes. An interrupt is generated if either
// sound_irq_gen() was called, or if the YM2151
// generated an interrupt via the
// ym2151_irq_gen() callback.
//-------------------------------------------------
void atari_sound_comm_device::update_sound_irq()
{
if (m_timed_int || m_ym2151_int)
m_sound_cpu->set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
else
m_sound_cpu->set_input_line(M6502_IRQ_LINE, CLEAR_LINE);
}
//-------------------------------------------------
// delayed_sound_reset: Synchronizes the sound
// reset command between the two CPUs.
//-------------------------------------------------
void atari_sound_comm_device::delayed_sound_reset(int param)
{
// unhalt and reset the sound CPU
if (param == 0)
{
m_sound_cpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
m_sound_cpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
}
// reset the sound write state
m_sound_to_main_ready = false;
m_main_int_cb(CLEAR_LINE);
// allocate a high frequency timer until a response is generated
// the main CPU is *very* sensistive to the timing of the response
machine().scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
}
//-------------------------------------------------
// delayed_sound_write: Synchronizes a data write
// from the main CPU to the sound CPU.
//-------------------------------------------------
void atari_sound_comm_device::delayed_sound_write(int data)
{
// warn if we missed something
if (m_main_to_sound_ready)
logerror("Missed command from 68010\n");
// set up the states and signal an NMI to the sound CPU
m_main_to_sound_data = data;
m_main_to_sound_ready = true;
m_sound_cpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
// allocate a high frequency timer until a response is generated
// the main CPU is *very* sensistive to the timing of the response
machine().scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
}
//-------------------------------------------------
// delayed_6502_write: Synchronizes a data write
// from the sound CPU to the main CPU.
//-------------------------------------------------
void atari_sound_comm_device::delayed_6502_write(int data)
{
// warn if we missed something
if (m_sound_to_main_ready)
logerror("Missed result from 6502\n");
// set up the states and signal the sound interrupt to the main CPU
m_sound_to_main_data = data;
m_sound_to_main_ready = true;
m_main_int_cb(ASSERT_LINE);
}
/***************************************************************************
OVERALL INIT
***************************************************************************/
@ -95,8 +389,6 @@ atarigen_state::atarigen_state(const machine_config &mconfig, device_type type,
m_sound_int_state(0),
m_video_int_state(0),
m_eeprom_default(NULL),
m_cpu_to_sound_ready(0),
m_sound_to_cpu_ready(0),
m_playfield(*this, "playfield"),
m_playfield2(*this, "playfield2"),
m_playfield_upper(*this, "playfield_up"),
@ -120,11 +412,6 @@ atarigen_state::atarigen_state(const machine_config &mconfig, device_type type,
m_slapstic_last_address(0),
m_slapstic_base(0),
m_slapstic_mirror(0),
m_sound_cpu(*this, "audiocpu"),
m_cpu_to_sound(0),
m_sound_to_cpu(0),
m_timed_int(0),
m_ym2151_int(0),
m_scanlines_per_callback(0),
m_actual_vc_latch0(0),
m_actual_vc_latch1(0),
@ -134,19 +421,13 @@ atarigen_state::atarigen_state(const machine_config &mconfig, device_type type,
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_jsacpu(*this, "jsa"),
m_oki(*this, "oki")
m_oki(*this, "oki"),
m_soundcomm(*this, "soundcomm")
{
}
void atarigen_state::machine_start()
{
// find the sound CPU, until JSA is moved to be independent
if (m_sound_cpu == NULL)
{
if (m_jsacpu != NULL)
m_sound_cpu.set_target(m_jsacpu);
}
screen_device *screen;
int i;
@ -165,9 +446,6 @@ void atarigen_state::machine_start()
save_item(NAME(m_sound_int_state));
save_item(NAME(m_video_int_state));
save_item(NAME(m_cpu_to_sound_ready));
save_item(NAME(m_sound_to_cpu_ready));
save_item(NAME(m_atarivc_state.latch1)); // latch #1 value (-1 means disabled)
save_item(NAME(m_atarivc_state.latch2)); // latch #2 value (-1 means disabled)
save_item(NAME(m_atarivc_state.rowscroll_enable)); // true if row-scrolling is enabled
@ -188,11 +466,6 @@ void atarigen_state::machine_start()
save_item(NAME(m_slapstic_last_pc));
save_item(NAME(m_slapstic_last_address));
save_item(NAME(m_cpu_to_sound));
save_item(NAME(m_sound_to_cpu));
save_item(NAME(m_timed_int));
save_item(NAME(m_ym2151_int));
save_item(NAME(m_scanlines_per_callback));
save_item(NAME(m_actual_vc_latch0));
@ -226,9 +499,6 @@ void atarigen_state::machine_reset()
slapstic_reset();
slapstic_update_bank(slapstic_bank());
}
// reset sound I/O
sound_io_reset();
}
@ -252,19 +522,6 @@ void atarigen_state::device_timer(emu_timer &timer, device_timer_id id, int para
atarivc_eof_update(timer, *reinterpret_cast<screen_device *>(ptr));
break;
// sound I/O
case TID_SOUND_RESET:
delayed_sound_reset(param);
break;
case TID_SOUND_WRITE:
delayed_sound_write(param);
break;
case TID_6502_WRITE:
delayed_6502_write(param);
break;
// unhalt the CPU that was passed as a pointer
case TID_UNHALT_CPU:
reinterpret_cast<device_t *>(ptr)->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
@ -317,6 +574,18 @@ WRITE16_MEMBER(atarigen_state::scanline_int_ack_w)
}
//-------------------------------------------------
// sound_int_write_line: Standard write line
// callback for the sound interrupt
//-------------------------------------------------
WRITE_LINE_MEMBER(atarigen_state::sound_int_write_line)
{
m_sound_int_state = state;
update_interrupts();
}
//-------------------------------------------------
// sound_int_gen: Standard interrupt routine which
// sets the sound interrupt state.
@ -542,224 +811,6 @@ READ16_MEMBER(atarigen_state::slapstic_r)
/***************************************************************************
SOUND I/O
***************************************************************************/
//-------------------------------------------------
// sound_io_reset: Resets the state of the sound I/O.
//-------------------------------------------------
void atarigen_state::sound_io_reset()
{
// reset the internal interrupts states
m_timed_int = m_ym2151_int = 0;
// reset the sound I/O states
m_cpu_to_sound = m_sound_to_cpu = 0;
m_cpu_to_sound_ready = m_sound_to_cpu_ready = 0;
}
//-------------------------------------------------
// m6502_irq_gen: Generates an IRQ signal to the
// 6502 sound processor.
//-------------------------------------------------
INTERRUPT_GEN_MEMBER(atarigen_state::m6502_irq_gen)
{
m_timed_int = 1;
update_m6502_irq();
}
//-------------------------------------------------
// m6502_irq_ack_r: Resets the IRQ signal to the 6502
// sound processor. Both reads and writes can be used.
//-------------------------------------------------
READ8_MEMBER(atarigen_state::m6502_irq_ack_r)
{
m_timed_int = 0;
update_m6502_irq();
return 0;
}
WRITE8_MEMBER(atarigen_state::m6502_irq_ack_w)
{
m_timed_int = 0;
update_m6502_irq();
}
//-------------------------------------------------
// atarigen_ym2151_irq_gen: Sets the state of the YM2151's
// IRQ line.
//-------------------------------------------------
WRITE_LINE_MEMBER(atarigen_state::ym2151_irq_gen)
{
m_ym2151_int = state;
update_m6502_irq();
}
//-------------------------------------------------
// sound_reset_w: Write handler which resets the
// sound CPU in response.
//-------------------------------------------------
WRITE16_MEMBER(atarigen_state::sound_reset_w)
{
synchronize(TID_SOUND_RESET);
}
//-------------------------------------------------
// sound_cpu_reset: Resets the state of the sound
// CPU manually.
//-------------------------------------------------
void atarigen_state::sound_cpu_reset()
{
synchronize(TID_SOUND_RESET, 1);
}
//-------------------------------------------------
// atarigen_sound_w: Handles communication from the main CPU
// to the sound CPU. Two versions are provided, one with the
// data byte in the low 8 bits, and one with the data byte in
// the upper 8 bits.
//-------------------------------------------------
WRITE8_MEMBER(atarigen_state::sound_w)
{
synchronize(TID_SOUND_WRITE, data);
}
//-------------------------------------------------
// sound_r: Handles reading data communicated from the
// sound CPU to the main CPU. Two versions are provided, one
// with the data byte in the low 8 bits, and one with the data
// byte in the upper 8 bits.
//-------------------------------------------------
READ8_MEMBER(atarigen_state::sound_r)
{
m_sound_to_cpu_ready = 0;
sound_int_ack_w(space, 0, 0);
return m_sound_to_cpu;
}
//-------------------------------------------------
// m6502_sound_w: Handles communication from the
// sound CPU to the main CPU.
//-------------------------------------------------
WRITE8_MEMBER(atarigen_state::m6502_sound_w)
{
synchronize(TID_6502_WRITE, data);
}
//-------------------------------------------------
// m6502_sound_r: Handles reading data
// communicated from the main CPU to the sound
// CPU.
//-------------------------------------------------
READ8_MEMBER(atarigen_state::m6502_sound_r)
{
m_cpu_to_sound_ready = 0;
m_sound_cpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
return m_cpu_to_sound;
}
//-------------------------------------------------
// update_m6502_irq: Called whenever the IRQ state changes. An
// interrupt is generated if either m6502_irq_gen()
// was called, or if the YM2151 generated an interrupt via
// the atarigen_ym2151_irq_gen() callback.
//-------------------------------------------------
void atarigen_state::update_m6502_irq()
{
if (m_timed_int || m_ym2151_int)
m_sound_cpu->set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
else
m_sound_cpu->set_input_line(M6502_IRQ_LINE, CLEAR_LINE);
}
//-------------------------------------------------
// delayed_sound_reset: Synchronizes the sound reset command
// between the two CPUs.
//-------------------------------------------------
void atarigen_state::delayed_sound_reset(int param)
{
// unhalt and reset the sound CPU
if (param == 0)
{
m_sound_cpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
m_sound_cpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
}
// reset the sound write state
m_sound_to_cpu_ready = 0;
sound_int_ack_w(m_sound_cpu->space(AS_PROGRAM), 0, 0);
// allocate a high frequency timer until a response is generated
// the main CPU is *very* sensistive to the timing of the response
machine().scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
}
//-------------------------------------------------
// delayed_sound_write: Synchronizes a data write
// from the main CPU to the sound CPU.
//-------------------------------------------------
void atarigen_state::delayed_sound_write(int data)
{
// warn if we missed something
if (m_cpu_to_sound_ready)
logerror("Missed command from 68010\n");
// set up the states and signal an NMI to the sound CPU
m_cpu_to_sound = data;
m_cpu_to_sound_ready = 1;
m_sound_cpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
// allocate a high frequency timer until a response is generated
// the main CPU is *very* sensistive to the timing of the response
machine().scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
}
//-------------------------------------------------
// delayed_6502_write: Synchronizes a data write
// from the sound CPU to the main CPU.
//-------------------------------------------------
void atarigen_state::delayed_6502_write(int data)
{
// warn if we missed something
if (m_sound_to_cpu_ready)
logerror("Missed result from 6502\n");
// set up the states and signal the sound interrupt to the main CPU
m_sound_to_cpu = data;
m_sound_to_cpu_ready = 1;
sound_int_gen(*m_maincpu);
}
/***************************************************************************
SOUND HELPERS
***************************************************************************/

View File

@ -40,11 +40,13 @@
#ifndef __MACHINE_ATARIGEN__
#define __MACHINE_ATARIGEN__
#include "devcb2.h"
#include "machine/nvram.h"
#include "machine/er2055.h"
#include "cpu/m6502/m6502.h"
#include "sound/okim6295.h"
/***************************************************************************
CONSTANTS
***************************************************************************/
@ -56,6 +58,99 @@
//**************************************************************************
// DEVICE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_ATARI_SOUND_COMM_ADD(_tag, _soundcpu, _intcb) \
MCFG_DEVICE_ADD(_tag, ATARI_SOUND_COMM, 0) \
atari_sound_comm_device::static_set_sound_cpu(*device, _soundcpu); \
devcb = &atari_sound_comm_device::set_main_int_cb(*device, DEVCB2_##_intcb); \
#define MCFG_ATARI_VIDEO_CONTROLLER_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, ATARI_VIDEO_CONTROLLER, 0) \
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
// ======================> atari_sound_comm_device
class atari_sound_comm_device : public device_t
{
public:
// construction/destruction
atari_sound_comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// static configuration helpers
static void static_set_sound_cpu(device_t &device, const char *cputag);
template<class _Object> static devcb2_base &set_main_int_cb(device_t &device, _Object object) { return downcast<atari_sound_comm_device &>(device).m_main_int_cb.set_callback(object); }
// getters
bool main_to_sound_ready() const { return m_main_to_sound_ready; }
bool sound_to_main_ready() const { return m_sound_to_main_ready; }
// main cpu accessors
DECLARE_WRITE8_MEMBER(main_command_w);
DECLARE_READ8_MEMBER(main_response_r);
DECLARE_WRITE16_MEMBER(sound_reset_w);
// sound cpu accessors
void sound_cpu_reset() { synchronize(TID_SOUND_RESET, 1); }
DECLARE_WRITE8_MEMBER(sound_response_w);
DECLARE_READ8_MEMBER(sound_command_r);
DECLARE_WRITE8_MEMBER(sound_irq_ack_w);
DECLARE_READ8_MEMBER(sound_irq_ack_r);
INTERRUPT_GEN_MEMBER(sound_irq_gen);
// additional helpers
DECLARE_WRITE_LINE_MEMBER(ym2151_irq_gen);
protected:
// sound I/O helpers
void update_sound_irq();
void delayed_sound_reset(int param);
void delayed_sound_write(int data);
void delayed_6502_write(int data);
// device-level overrides
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
private:
// timer IDs
enum
{
TID_SOUND_RESET,
TID_SOUND_WRITE,
TID_6502_WRITE
};
// configuration state
const char * m_sound_cpu_tag;
devcb2_write_line m_main_int_cb;
// internal state
m6502_device * m_sound_cpu;
bool m_main_to_sound_ready;
bool m_sound_to_main_ready;
UINT8 m_main_to_sound_data;
UINT8 m_sound_to_main_data;
UINT8 m_timed_int;
UINT8 m_ym2151_int;
};
// device type definition
extern const device_type ATARI_SOUND_COMM;
/***************************************************************************
TYPES & STRUCTURES
***************************************************************************/
@ -106,6 +201,7 @@ public:
void scanline_int_set(screen_device &screen, int scanline);
INTERRUPT_GEN_MEMBER(scanline_int_gen);
DECLARE_WRITE16_MEMBER(scanline_int_ack_w);
DECLARE_WRITE_LINE_MEMBER(sound_int_write_line);
INTERRUPT_GEN_MEMBER(sound_int_gen);
DECLARE_WRITE16_MEMBER(sound_int_ack_w);
INTERRUPT_GEN_MEMBER(video_int_gen);
@ -125,23 +221,6 @@ public:
DECLARE_WRITE16_MEMBER(slapstic_w);
DECLARE_READ16_MEMBER(slapstic_r);
// sound I/O helpers
void sound_io_reset();
INTERRUPT_GEN_MEMBER(m6502_irq_gen);
DECLARE_READ8_MEMBER(m6502_irq_ack_r);
DECLARE_WRITE8_MEMBER(m6502_irq_ack_w);
DECLARE_WRITE_LINE_MEMBER(ym2151_irq_gen);
DECLARE_WRITE16_MEMBER(sound_reset_w);
void sound_cpu_reset();
DECLARE_WRITE8_MEMBER(sound_w);
DECLARE_READ8_MEMBER(sound_r);
DECLARE_WRITE8_MEMBER(m6502_sound_w);
DECLARE_READ8_MEMBER(m6502_sound_r);
void update_m6502_irq();
void delayed_sound_reset(int param);
void delayed_sound_write(int data);
void delayed_6502_write(int data);
// sound helpers
void set_volume_by_type(int volume, device_type type);
void set_ym2151_volume(int volume);
@ -224,9 +303,6 @@ public:
const UINT16 * m_eeprom_default;
UINT8 m_cpu_to_sound_ready;
UINT8 m_sound_to_cpu_ready;
optional_shared_ptr<UINT16> m_playfield;
optional_shared_ptr<UINT16> m_playfield2;
optional_shared_ptr<UINT16> m_playfield_upper;
@ -259,12 +335,6 @@ public:
offs_t m_slapstic_base;
offs_t m_slapstic_mirror;
optional_device<m6502_device> m_sound_cpu;
UINT8 m_cpu_to_sound;
UINT8 m_sound_to_cpu;
UINT8 m_timed_int;
UINT8 m_ym2151_int;
UINT32 m_scanlines_per_callback;
UINT32 m_actual_vc_latch0;
@ -279,6 +349,8 @@ public:
optional_device<cpu_device> m_audiocpu;
optional_device<m6502_device> m_jsacpu;
optional_device<okim6295_device> m_oki;
optional_device<atari_sound_comm_device> m_soundcomm;
};

View File

@ -209,7 +209,7 @@ WRITE16_MEMBER( atarisy1_state::atarisy1_bankselect_w )
if (diff & 0x0080)
{
m_audiocpu->set_input_line(INPUT_LINE_RESET, (newselect & 0x0080) ? CLEAR_LINE : ASSERT_LINE);
if (!(newselect & 0x0080)) sound_cpu_reset();
if (!(newselect & 0x0080)) m_soundcomm->sound_cpu_reset();
}
/* if MO or playfield banks change, force a partial update */