summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Fabio Priuli <etabeta78@users.noreply.github.com>2009-05-05 22:14:45 +0000
committer Fabio Priuli <etabeta78@users.noreply.github.com>2009-05-05 22:14:45 +0000
commit6be9cb9992c6bdf3d8d9073054400107b6b14e53 (patch)
tree644d9e1a9fad939f466ad2eb4e8f3ec11baddf55 /src
parent08ed5c16e61f2037529eecd4889a3b98c9cdf770 (diff)
A few number-to-tag changes in megadrive/sms based drivers.
Also changed some tags (needed until all drivers are updated from using genesis.c to megadriv.c) and made explicit a few header includes.
Diffstat (limited to 'src')
-rw-r--r--src/mame/drivers/genesis.c22
-rw-r--r--src/mame/drivers/hshavoc.c3
-rw-r--r--src/mame/drivers/megaplay.c2
-rw-r--r--src/mame/drivers/megatech.c6
-rw-r--r--src/mame/drivers/puckpkmn.c4
-rw-r--r--src/mame/drivers/segac2.c3
-rw-r--r--src/mame/drivers/segae.c62
-rw-r--r--src/mame/drivers/segae.h1
-rw-r--r--src/mame/drivers/topshoot.c5
-rw-r--r--src/mame/includes/genesis.h5
-rw-r--r--src/mame/video/genesis.c2
11 files changed, 64 insertions, 51 deletions
diff --git a/src/mame/drivers/genesis.c b/src/mame/drivers/genesis.c
index 2267820ece7..f312a04dbf8 100644
--- a/src/mame/drivers/genesis.c
+++ b/src/mame/drivers/genesis.c
@@ -15,6 +15,8 @@ segac2.c
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "sound/2612intf.h"
+#include "sound/sn76496.h"
+
#include "genesis.h"
#define MASTER_CLOCK 53693100
@@ -72,9 +74,9 @@ UINT8 *genesis_z80_ram;
/* call this whenever the interrupt state has changed */
static void update_interrupts(running_machine *machine)
{
- cpu_set_input_line(machine->cpu[0], 2, irq2_int ? ASSERT_LINE : CLEAR_LINE);
- cpu_set_input_line(machine->cpu[0], 4, scanline_int ? ASSERT_LINE : CLEAR_LINE);
- cpu_set_input_line(machine->cpu[0], 6, vblank_int ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(machine, "maincpu", 2, irq2_int ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(machine, "maincpu", 4, scanline_int ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(machine, "maincpu", 6, vblank_int ? ASSERT_LINE : CLEAR_LINE);
}
@@ -151,14 +153,14 @@ MACHINE_START( genesis )
MACHINE_RESET( genesis )
{
/* C2 doesn't have a Z80, so we can't just assume */
- if (machine->cpu[1] != NULL && cpu_get_type(machine->cpu[1]) == CPU_Z80)
+ if (cputag_get_cpu(machine, "genesis_snd_z80") != NULL && cpu_get_type(cputag_get_cpu(machine, "genesis_snd_z80")) == CPU_Z80)
{
/* the following ensures that the Z80 begins without running away from 0 */
/* 0x76 is just a forced 'halt' as soon as the CPU is initially run */
genesis_z80_ram[0] = 0x76;
genesis_z80_ram[0x38] = 0x76;
- cpu_set_input_line(machine->cpu[1], INPUT_LINE_HALT, ASSERT_LINE);
+ cputag_set_input_line(machine, "genesis_snd_z80", INPUT_LINE_HALT, ASSERT_LINE);
z80running = 0;
}
@@ -206,7 +208,7 @@ WRITE16_HANDLER(genesis_ctrl_w)
if (data == 0x100)
{
z80running = 0;
- cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_HALT, ASSERT_LINE); /* halt Z80 */
+ cputag_set_input_line(space->machine, "genesis_snd_z80", INPUT_LINE_HALT, ASSERT_LINE); /* halt Z80 */
/* logerror("z80 stopped by 68k BusReq\n"); */
}
else
@@ -214,17 +216,17 @@ WRITE16_HANDLER(genesis_ctrl_w)
z80running = 1;
// memory_set_bankptr(space->machine, 1, &genesis_z80_ram[0]);
- cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine, "genesis_snd_z80", INPUT_LINE_HALT, CLEAR_LINE);
/* logerror("z80 started, BusReq ends\n"); */
}
return;
case 0x100: /* Z80 CPU Reset */
if (data == 0x00)
{
- cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_HALT, ASSERT_LINE);
- cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine, "genesis_snd_z80", INPUT_LINE_HALT, ASSERT_LINE);
+ cputag_set_input_line(space->machine, "genesis_snd_z80", INPUT_LINE_RESET, PULSE_LINE);
- cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_HALT, ASSERT_LINE);
+ cputag_set_input_line(space->machine, "genesis_snd_z80", INPUT_LINE_HALT, ASSERT_LINE);
/* logerror("z80 reset, ram is %p\n", &genesis_z80_ram[0]); */
z80running = 0;
return;
diff --git a/src/mame/drivers/hshavoc.c b/src/mame/drivers/hshavoc.c
index d35fadcde40..2392e64f5ff 100644
--- a/src/mame/drivers/hshavoc.c
+++ b/src/mame/drivers/hshavoc.c
@@ -37,6 +37,9 @@ Unfortunately it's read protected.
#include "driver.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "sound/2612intf.h"
+#include "sound/sn76496.h"
+
#include "genesis.h"
#define MASTER_CLOCK 53693100
diff --git a/src/mame/drivers/megaplay.c b/src/mame/drivers/megaplay.c
index 8a5cbe150ea..701fcdc3e6f 100644
--- a/src/mame/drivers/megaplay.c
+++ b/src/mame/drivers/megaplay.c
@@ -41,6 +41,8 @@ Only a handful of games were released for this system.
#include "driver.h"
#include "cpu/z80/z80.h"
+#include "sound/sn76496.h"
+
#include "deprecat.h"
#include "genesis.h"
#include "megadriv.h"
diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c
index 471fdf3b46c..8f1abf6988f 100644
--- a/src/mame/drivers/megatech.c
+++ b/src/mame/drivers/megatech.c
@@ -79,10 +79,12 @@ Sonic Hedgehog 2 171-6215A 837-6963-62 610-0239-62 MPR-1
*/
#include "driver.h"
#include "cpu/z80/z80.h"
-#include "genesis.h"
+#include "sound/sn76496.h"
#include "rendlay.h"
-#include "megadriv.h"
+
#include "segae.h"
+#include "genesis.h"
+#include "megadriv.h"
/* Megatech BIOS specific */
static UINT32 bios_port_ctrl;
diff --git a/src/mame/drivers/puckpkmn.c b/src/mame/drivers/puckpkmn.c
index 6b045103304..5fe4f500d4f 100644
--- a/src/mame/drivers/puckpkmn.c
+++ b/src/mame/drivers/puckpkmn.c
@@ -44,6 +44,10 @@ Notes:
#include "driver.h"
#include "cpu/m68000/m68000.h"
+#include "sound/okim6295.h"
+#include "sound/sn76496.h"
+#include "sound/2612intf.h"
+
#include "genesis.h"
#define MASTER_CLOCK 53693100
diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c
index 13acbbe5742..72809648135 100644
--- a/src/mame/drivers/segac2.c
+++ b/src/mame/drivers/segac2.c
@@ -68,12 +68,13 @@
#include "driver.h"
#include "cpu/m68000/m68000.h"
-#include "megadriv.h"
#include "sound/okim6295.h"
#include "sound/sn76496.h"
#include "sound/2612intf.h"
#include "sound/upd7759.h"
+#include "megadriv.h"
+
#define XL1_CLOCK 640000
#define XL2_CLOCK 53693175
diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c
index ca288e0c425..03258dcc254 100644
--- a/src/mame/drivers/segae.c
+++ b/src/mame/drivers/segae.c
@@ -565,20 +565,20 @@ static int sms_vdp_null_irq_callback(running_machine *machine, int status)
static int sms_vdp_cpu0_irq_callback(running_machine *machine, int status)
{
- if (status==1)
- cpu_set_input_line(machine->cpu[0],0,HOLD_LINE);
+ if (status == 1)
+ cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
else
- cpu_set_input_line(machine->cpu[0],0,CLEAR_LINE);
+ cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
return 0;
}
static int sms_vdp_cpu1_irq_callback(running_machine *machine, int status)
{
- if (status==1)
- cpu_set_input_line(machine->cpu[1],0,HOLD_LINE);
+ if (status == 1)
+ cputag_set_input_line(machine, "genesis_snd_z80", 0, HOLD_LINE);
else
- cpu_set_input_line(machine->cpu[1],0,CLEAR_LINE);
+ cputag_set_input_line(machine, "genesis_snd_z80", 0, CLEAR_LINE);
return 0;
}
@@ -586,10 +586,10 @@ static int sms_vdp_cpu1_irq_callback(running_machine *machine, int status)
static int sms_vdp_cpu2_irq_callback(running_machine *machine, int status)
{
- if (status==1)
- cpu_set_input_line(machine->cpu[2],0,HOLD_LINE);
+ if (status == 1)
+ cputag_set_input_line(machine, "mtbios", 0, HOLD_LINE);
else
- cpu_set_input_line(machine->cpu[2],0,CLEAR_LINE);
+ cputag_set_input_line(machine, "mtbios", 0, CLEAR_LINE);
return 0;
}
@@ -1438,7 +1438,7 @@ static void end_of_frame(running_machine *machine, struct sms_vdp *chip)
VIDEO_EOF(sms)
{
end_of_frame(machine, vdp1);
- //if (SMS_PAUSE_BUTTON) cpu_set_input_line(machine->cpu[0],INPUT_LINE_NMI,PULSE_LINE); // not on systeme!!!
+ //if (SMS_PAUSE_BUTTON) cputag_set_input_line(machine, , "maincpu", INPUT_LINE_NMI, PULSE_LINE); // not on systeme!!!
}
#endif
@@ -1828,7 +1828,7 @@ INPUT_PORTS_END
ROM_START( hangonjr )
- ROM_REGION( 0x30000, "z80", 0 )
+ ROM_REGION( 0x30000, "maincpu", 0 )
ROM_LOAD( "rom5.ic7", 0x00000, 0x08000, CRC(d63925a7) SHA1(699f222d9712fa42651c753fe75d7b60e016d3ad) ) /* Fixed Code */
/* The following are 8 0x4000 banks that get mapped to reads from 0x8000 - 0xbfff */
@@ -1839,7 +1839,7 @@ ROM_START( hangonjr )
ROM_END
ROM_START( ridleofp )
- ROM_REGION( 0x30000, "z80", 0 )
+ ROM_REGION( 0x30000, "maincpu", 0 )
ROM_LOAD( "epr10426.bin", 0x00000, 0x08000, CRC(4404c7e7) SHA1(555f44786976a009d96a6395c9173929ad6138a7) ) /* Fixed Code */
/* The following are 8 0x4000 banks that get mapped to reads from 0x8000 - 0xbfff */
@@ -1850,7 +1850,7 @@ ROM_START( ridleofp )
ROM_END
ROM_START( transfrm )
- ROM_REGION( 0x30000, "z80", 0 )
+ ROM_REGION( 0x30000, "maincpu", 0 )
ROM_LOAD( "ic7.top", 0x00000, 0x08000, CRC(ccf1d123) SHA1(5ade9b00e2a36d034fafdf1902d47a9a00e96fc4) ) /* Fixed Code */
/* The following are 8 0x4000 banks that get mapped to reads from 0x8000 - 0xbfff */
@@ -1861,7 +1861,7 @@ ROM_START( transfrm )
ROM_END
ROM_START( astrofl )
- ROM_REGION( 0x50000, "z80", 0 )
+ ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD( "epr-7723.ic7", 0x00000, 0x08000, CRC(66061137) SHA1(cb6a2c7864f9f87bbedfd4b1448ad6c2de65d6ca) ) /* encrypted */
/* The following are 8 0x4000 banks that get mapped to reads from 0x8000 - 0xbfff */
@@ -1873,7 +1873,7 @@ ROM_END
ROM_START( tetrisse )
- ROM_REGION( 0x30000, "z80", 0 )
+ ROM_REGION( 0x30000, "maincpu", 0 )
ROM_LOAD( "epr12213.7", 0x00000, 0x08000, CRC(ef3c7a38) SHA1(cbb91aef330ab1a37d3e21ecf1d008143d0dd7ec) ) /* Fixed Code */
/* The following are 8 0x4000 banks that get mapped to reads from 0x8000 - 0xbfff */
@@ -1885,7 +1885,7 @@ ROM_END
ROM_START( fantzn2 )
- ROM_REGION( 0x50000, "z80", 0 )
+ ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD( "epr-11416.ic7", 0x00000, 0x08000, CRC(76db7b7b) SHA1(d60e2961fc893dcb4445aed5f67515cbd25b610f) ) /* encrypted */
ROM_LOAD( "epr-11415.ic5", 0x10000, 0x10000, CRC(57b45681) SHA1(1ae6d0d58352e246a4ec4e1ce02b0417257d5d20) )
@@ -1898,7 +1898,7 @@ ROM_START( fantzn2 )
ROM_END
ROM_START( opaopa )
- ROM_REGION( 0x50000, "z80", 0 )
+ ROM_REGION( 0x50000, "maincpu", 0 )
ROM_LOAD( "epr11224.ic7", 0x00000, 0x08000, CRC(024b1244) SHA1(59a522ac3d98982cc4ddb1c81f9584d3da453649) ) /* encrypted */
/* The following are 8 0x4000 banks that get mapped to reads from 0x8000 - 0xbfff */
@@ -2023,7 +2023,7 @@ static VIDEO_UPDATE(systeme)
static MACHINE_DRIVER_START( systeme )
- MDRV_CPU_ADD("z80", Z80, 10738600/2) /* correct for hangonjr, and astroflash/transformer at least */
+ MDRV_CPU_ADD("maincpu", Z80, 10738600/2) /* correct for hangonjr, and astroflash/transformer at least */
MDRV_CPU_PROGRAM_MAP(systeme_map,0)
MDRV_CPU_IO_MAP(sms_io_map,0)
@@ -2138,7 +2138,7 @@ static void init_ports_systeme(running_machine *machine)
{
/* INIT THE PORTS *********************************************************************************************/
- const address_space *io = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO);
+ const address_space *io = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO);
const device_config *sn1 = devtag_get_device(machine, "sn1");
const device_config *sn2 = devtag_get_device(machine, "sn2");
@@ -2168,24 +2168,24 @@ static void init_systeme_map(running_machine *machine)
/* INIT THE MEMMAP / BANKING *********************************************************************************/
/* catch any addresses that don't get mapped */
-// memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0xffff, 0, 0, z80_unmapped_r, z80_unmapped_w);
+// memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0xffff, 0, 0, z80_unmapped_r, z80_unmapped_w);
/* fixed rom bank area */
// sms_rom = auto_alloc_array(machine, UINT8, 0xc000);
-// memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0xbfff, 0, 0, (read8_space_func)SMH_BANK(1), (write8_space_func)SMH_UNMAP);
+// memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0xbfff, 0, 0, (read8_space_func)SMH_BANK(1), (write8_space_func)SMH_UNMAP);
// memory_set_bankptr(machine, 1, sms_rom );
- memory_configure_bank(machine, 1, 0, 16, memory_region(machine, "z80") + 0x10000, 0x4000);
+ memory_configure_bank(machine, 1, 0, 16, memory_region(machine, "maincpu") + 0x10000, 0x4000);
/* alternate way of accessing video ram */
- memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0xbfff, 0, 0, segasyse_videoram_w);
+ memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xbfff, 0, 0, segasyse_videoram_w);
// memcpy(sms_rom, memory_region(machine, "user1"), 0x8000);
/* main ram area */
sms_mainram = auto_alloc_array(machine, UINT8, 0x4000);
- memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xffff, 0, 0, (read8_space_func)SMH_BANK(2), (write8_space_func)SMH_BANK(2));
+ memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc000, 0xffff, 0, 0, (read8_space_func)SMH_BANK(2), (write8_space_func)SMH_BANK(2));
memory_set_bankptr(machine, 2, sms_mainram );
memset(sms_mainram,0x00,0x4000);
@@ -2310,8 +2310,8 @@ static DRIVER_INIT( ridleofp )
{
DRIVER_INIT_CALL(segasyse);
- memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0xf8, 0xf8, 0, 0, segae_ridleofp_port_f8_r);
- memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0xfa, 0xfa, 0, 0, segae_ridleofp_port_fa_w);
+ memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0xf8, 0xf8, 0, 0, segae_ridleofp_port_f8_r);
+ memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0xfa, 0xfa, 0, 0, segae_ridleofp_port_fa_w);
}
@@ -2319,29 +2319,29 @@ static DRIVER_INIT( hangonjr )
{
DRIVER_INIT_CALL(segasyse);
- memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0xf8, 0xf8, 0, 0, segae_hangonjr_port_f8_r);
- memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0xfa, 0xfa, 0, 0, segae_hangonjr_port_fa_w);
+ memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0xf8, 0xf8, 0, 0, segae_hangonjr_port_f8_r);
+ memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0xfa, 0xfa, 0, 0, segae_hangonjr_port_fa_w);
}
static DRIVER_INIT( opaopa )
{
DRIVER_INIT_CALL(segasyse);
- mc8123_decrypt_rom(machine, "z80", "user1", 1, 8);
+ mc8123_decrypt_rom(machine, "maincpu", "user1", 1, 8);
}
static DRIVER_INIT( fantzn2 )
{
DRIVER_INIT_CALL(segasyse);
- mc8123_decrypt_rom(machine, "z80", "user1", 0, 0);
+ mc8123_decrypt_rom(machine, "maincpu", "user1", 0, 0);
}
static DRIVER_INIT( astrofl )
{
DRIVER_INIT_CALL(segasyse);
- astrofl_decode(machine, "z80");
+ astrofl_decode(machine, "maincpu");
}
GAME( 1985, hangonjr, 0, systeme, hangonjr, hangonjr, ROT0, "Sega", "Hang-On Jr.", 0 )
diff --git a/src/mame/drivers/segae.h b/src/mame/drivers/segae.h
index 755c3fd92d3..86671cc3ebe 100644
--- a/src/mame/drivers/segae.h
+++ b/src/mame/drivers/segae.h
@@ -23,5 +23,4 @@ extern READ8_HANDLER( md_sms_vdp_data_r );
extern WRITE8_HANDLER( md_sms_vdp_data_w );
extern READ8_HANDLER( md_sms_vdp_ctrl_r );
extern WRITE8_HANDLER( md_sms_vdp_ctrl_w );
-extern WRITE8_HANDLER( sms_sn76496_w );
diff --git a/src/mame/drivers/topshoot.c b/src/mame/drivers/topshoot.c
index e6623bf1504..5f40f35a4e0 100644
--- a/src/mame/drivers/topshoot.c
+++ b/src/mame/drivers/topshoot.c
@@ -136,6 +136,9 @@ connector, but of course, I can be wrong.
#include "driver.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "sound/sn76496.h"
+#include "sound/2612intf.h"
+
#include "genesis.h"
@@ -220,7 +223,7 @@ static MACHINE_DRIVER_START( genesis_base )
MDRV_CPU_ADD("maincpu", M68000, MASTER_CLOCK / 7)
MDRV_CPU_VBLANK_INT("screen", genesis_vblank_interrupt)
- MDRV_CPU_ADD("soundcpu", Z80, MASTER_CLOCK / 15)
+ MDRV_CPU_ADD("genesis_snd_z80", Z80, MASTER_CLOCK / 15)
MDRV_CPU_PROGRAM_MAP(genesis_z80_map, 0)
MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) /* from vdp at scanline 0xe0 */
diff --git a/src/mame/includes/genesis.h b/src/mame/includes/genesis.h
index 7f0176b45b4..d5d89dd7d21 100644
--- a/src/mame/includes/genesis.h
+++ b/src/mame/includes/genesis.h
@@ -1,10 +1,5 @@
/* Todo, reorganise, cleanup etc.*/
-#include "sound/okim6295.h"
-#include "sound/sn76496.h"
-#include "sound/2612intf.h"
-#include "sound/upd7759.h"
-
/*----------- defined in drivers/megaplay.c -----------*/
extern UINT16 *ic36_ram;
diff --git a/src/mame/video/genesis.c b/src/mame/video/genesis.c
index c4eb0144b75..d2edd92c145 100644
--- a/src/mame/video/genesis.c
+++ b/src/mame/video/genesis.c
@@ -8,6 +8,8 @@
***********************************************************************************************/
#include "driver.h"
+#include "sound/sn76496.h"
+
#include "genesis.h"
/* in video/segasyse.c */