summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-04-15 16:49:50 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-04-15 16:49:50 +0000
commitffc326f8be07a3978f13788db98536a37b1edb53 (patch)
tree0059891ed857da529e1f0dc71f879a42f61fe299
parent72805780a70b4d766d94e11564d618a4392cb569 (diff)
Converted the IDE controller to a device. Updated all drivers
accordingly. Added new functions for dynamically installing device memory read/write handlers. Updated install_memory_XXX_handler() functions to take a machine parameter. Updated all drivers accordingly. Merged installation of read and write handlers where appropriate. Simplified memory.c code for dynamic installation so that a single function handles all the work; a NULL read or write handler indicates not to install anything for reads or writes.
-rw-r--r--src/emu/cpu/mips/psx.c17
-rw-r--r--src/emu/machine/idectrl.c634
-rw-r--r--src/emu/machine/idectrl.h81
-rw-r--r--src/emu/memory.c139
-rw-r--r--src/emu/memory.h125
-rw-r--r--src/mame/audio/atarijsa.c5
-rw-r--r--src/mame/audio/cage.c4
-rw-r--r--src/mame/audio/cage.h2
-rw-r--r--src/mame/audio/cinemat.c2
-rw-r--r--src/mame/audio/dcs.c76
-rw-r--r--src/mame/audio/dcs.h2
-rw-r--r--src/mame/audio/jaguar.c6
-rw-r--r--src/mame/audio/leland.c16
-rw-r--r--src/mame/audio/namcoc7x.c5
-rw-r--r--src/mame/drivers/actfancr.c4
-rw-r--r--src/mame/drivers/airbustr.c2
-rw-r--r--src/mame/drivers/aladbl.c4
-rw-r--r--src/mame/drivers/alg.c4
-rw-r--r--src/mame/drivers/alpha68k.c18
-rw-r--r--src/mame/drivers/arabian.c4
-rw-r--r--src/mame/drivers/arcadia.c6
-rw-r--r--src/mame/drivers/arkanoid.c20
-rw-r--r--src/mame/drivers/artmagic.c2
-rw-r--r--src/mame/drivers/asteroid.c6
-rw-r--r--src/mame/drivers/astrocde.c62
-rw-r--r--src/mame/drivers/astrof.c12
-rw-r--r--src/mame/drivers/atarig1.c6
-rw-r--r--src/mame/drivers/atarig42.c6
-rw-r--r--src/mame/drivers/atarigt.c12
-rw-r--r--src/mame/drivers/atarigx2.c2
-rw-r--r--src/mame/drivers/ataxx.c36
-rw-r--r--src/mame/drivers/backfire.c2
-rw-r--r--src/mame/drivers/balsente.c25
-rw-r--r--src/mame/drivers/beathead.c4
-rw-r--r--src/mame/drivers/btime.c2
-rw-r--r--src/mame/drivers/bublbobl.c2
-rw-r--r--src/mame/drivers/bzone.c10
-rw-r--r--src/mame/drivers/cave.c2
-rw-r--r--src/mame/drivers/centiped.c10
-rw-r--r--src/mame/drivers/chqflag.c14
-rw-r--r--src/mame/drivers/cinemat.c16
-rw-r--r--src/mame/drivers/cischeat.c2
-rw-r--r--src/mame/drivers/cninja.c4
-rw-r--r--src/mame/drivers/cojag.c46
-rw-r--r--src/mame/drivers/combatsc.c2
-rw-r--r--src/mame/drivers/coolpool.c2
-rw-r--r--src/mame/drivers/cosmic.c10
-rw-r--r--src/mame/drivers/cps1.c2
-rw-r--r--src/mame/drivers/cps2.c2
-rw-r--r--src/mame/drivers/cps3.c2
-rw-r--r--src/mame/drivers/crgolf.c2
-rw-r--r--src/mame/drivers/crimfght.c4
-rw-r--r--src/mame/drivers/cubocd32.c29
-rw-r--r--src/mame/drivers/dassault.c4
-rw-r--r--src/mame/drivers/ddealer.c4
-rw-r--r--src/mame/drivers/ddenlovr.c2
-rw-r--r--src/mame/drivers/ddragon.c8
-rw-r--r--src/mame/drivers/deadang.c4
-rw-r--r--src/mame/drivers/deco_mlc.c2
-rw-r--r--src/mame/drivers/decocass.c5
-rw-r--r--src/mame/drivers/dgpix.c4
-rw-r--r--src/mame/drivers/djmain.c110
-rw-r--r--src/mame/drivers/dynax.c2
-rw-r--r--src/mame/drivers/eprom.c6
-rw-r--r--src/mame/drivers/equites.c6
-rw-r--r--src/mame/drivers/exidy.c2
-rw-r--r--src/mame/drivers/exidy440.c18
-rw-r--r--src/mame/drivers/exprraid.c4
-rw-r--r--src/mame/drivers/fastfred.c13
-rw-r--r--src/mame/drivers/firebeat.c16
-rw-r--r--src/mame/drivers/fitfight.c4
-rw-r--r--src/mame/drivers/gaiden.c8
-rw-r--r--src/mame/drivers/galaga.c8
-rw-r--r--src/mame/drivers/galaxian.c122
-rw-r--r--src/mame/drivers/galivan.c12
-rw-r--r--src/mame/drivers/gamecstl.c33
-rw-r--r--src/mame/drivers/gladiatr.c2
-rw-r--r--src/mame/drivers/gng.c2
-rw-r--r--src/mame/drivers/gottlieb.c10
-rw-r--r--src/mame/drivers/groundfx.c2
-rw-r--r--src/mame/drivers/gstream.c2
-rw-r--r--src/mame/drivers/gstriker.c2
-rw-r--r--src/mame/drivers/gsword.c4
-rw-r--r--src/mame/drivers/gunbustr.c2
-rw-r--r--src/mame/drivers/gundealr.c2
-rw-r--r--src/mame/drivers/harddriv.c261
-rw-r--r--src/mame/drivers/homedata.c8
-rw-r--r--src/mame/drivers/hshavoc.c2
-rw-r--r--src/mame/drivers/hyprduel.c10
-rw-r--r--src/mame/drivers/iqblock.c4
-rw-r--r--src/mame/drivers/itech32.c41
-rw-r--r--src/mame/drivers/itech8.c28
-rw-r--r--src/mame/drivers/jack.c4
-rw-r--r--src/mame/drivers/jalmah.c38
-rw-r--r--src/mame/drivers/kangaroo.c2
-rw-r--r--src/mame/drivers/kinst.c104
-rw-r--r--src/mame/drivers/konamigv.c34
-rw-r--r--src/mame/drivers/konamigx.c12
-rw-r--r--src/mame/drivers/ksys573.c35
-rw-r--r--src/mame/drivers/kyugo.c8
-rw-r--r--src/mame/drivers/leland.c107
-rw-r--r--src/mame/drivers/lethalj.c6
-rw-r--r--src/mame/drivers/liberate.c2
-rw-r--r--src/mame/drivers/limenko.c8
-rw-r--r--src/mame/drivers/lkage.c6
-rw-r--r--src/mame/drivers/looping.c2
-rw-r--r--src/mame/drivers/m72.c55
-rw-r--r--src/mame/drivers/m92.c5
-rw-r--r--src/mame/drivers/macrossp.c2
-rw-r--r--src/mame/drivers/mainsnk.c2
-rw-r--r--src/mame/drivers/mappy.c4
-rw-r--r--src/mame/drivers/mcr.c3
-rw-r--r--src/mame/drivers/mcr3.c34
-rw-r--r--src/mame/drivers/mcr68.c20
-rw-r--r--src/mame/drivers/mediagx.c92
-rw-r--r--src/mame/drivers/megadriv.c49
-rw-r--r--src/mame/drivers/megadriv.h2
-rw-r--r--src/mame/drivers/megaplay.c9
-rw-r--r--src/mame/drivers/megasys1.c10
-rw-r--r--src/mame/drivers/megatech.c54
-rw-r--r--src/mame/drivers/meritm.c3
-rw-r--r--src/mame/drivers/mhavoc.c6
-rw-r--r--src/mame/drivers/midvunit.c57
-rw-r--r--src/mame/drivers/midzeus.c14
-rw-r--r--src/mame/drivers/model2.c17
-rw-r--r--src/mame/drivers/model3.c146
-rw-r--r--src/mame/drivers/mquake.c4
-rw-r--r--src/mame/drivers/ms32.c6
-rw-r--r--src/mame/drivers/multigam.c8
-rw-r--r--src/mame/drivers/namcos11.c31
-rw-r--r--src/mame/drivers/namcos12.c22
-rw-r--r--src/mame/drivers/namcos22.c51
-rw-r--r--src/mame/drivers/naughtyb.c5
-rw-r--r--src/mame/drivers/neodrvr.c60
-rw-r--r--src/mame/drivers/nmk16.c4
-rw-r--r--src/mame/drivers/offtwall.c12
-rw-r--r--src/mame/drivers/pacman.c12
-rw-r--r--src/mame/drivers/paradise.c4
-rw-r--r--src/mame/drivers/pasha2.c2
-rw-r--r--src/mame/drivers/pbaction.c2
-rw-r--r--src/mame/drivers/pgm.c56
-rw-r--r--src/mame/drivers/phoenix.c2
-rw-r--r--src/mame/drivers/pingpong.c20
-rw-r--r--src/mame/drivers/pipedrm.c7
-rw-r--r--src/mame/drivers/pirates.c2
-rw-r--r--src/mame/drivers/polepos.c8
-rw-r--r--src/mame/drivers/policetr.c8
-rw-r--r--src/mame/drivers/prehisle.c6
-rw-r--r--src/mame/drivers/psikyo.c36
-rw-r--r--src/mame/drivers/psikyo4.c10
-rw-r--r--src/mame/drivers/psikyosh.c18
-rw-r--r--src/mame/drivers/pturn.c4
-rw-r--r--src/mame/drivers/qdrmfgp.c101
-rw-r--r--src/mame/drivers/qix.c3
-rw-r--r--src/mame/drivers/raiden.c10
-rw-r--r--src/mame/drivers/seattle.c84
-rw-r--r--src/mame/drivers/segac2.c26
-rw-r--r--src/mame/drivers/segae.c67
-rw-r--r--src/mame/drivers/segag80r.c53
-rw-r--r--src/mame/drivers/segag80v.c60
-rw-r--r--src/mame/drivers/segaorun.c16
-rw-r--r--src/mame/drivers/segas16b.c22
-rw-r--r--src/mame/drivers/segas18.c12
-rw-r--r--src/mame/drivers/segas32.c43
-rw-r--r--src/mame/drivers/segaxbd.c6
-rw-r--r--src/mame/drivers/seibuspi.c32
-rw-r--r--src/mame/drivers/seta.c26
-rw-r--r--src/mame/drivers/simpl156.c14
-rw-r--r--src/mame/drivers/slapfght.c17
-rw-r--r--src/mame/drivers/snowbros.c8
-rw-r--r--src/mame/drivers/ssf2md.c7
-rw-r--r--src/mame/drivers/starwars.c5
-rw-r--r--src/mame/drivers/strnskil.c8
-rw-r--r--src/mame/drivers/stv.c12
-rw-r--r--src/mame/drivers/stvinit.c131
-rw-r--r--src/mame/drivers/superchs.c4
-rw-r--r--src/mame/drivers/suprnova.c30
-rw-r--r--src/mame/drivers/system1.c8
-rw-r--r--src/mame/drivers/system18.c2
-rw-r--r--src/mame/drivers/taito_f3.c56
-rw-r--r--src/mame/drivers/taito_l.c2
-rw-r--r--src/mame/drivers/taito_x.c2
-rw-r--r--src/mame/drivers/taitosj.c12
-rw-r--r--src/mame/drivers/taitowlf.c33
-rw-r--r--src/mame/drivers/terracre.c2
-rw-r--r--src/mame/drivers/thepit.c2
-rw-r--r--src/mame/drivers/tigeroad.c4
-rw-r--r--src/mame/drivers/toaplan2.c10
-rw-r--r--src/mame/drivers/topshoot.c2
-rw-r--r--src/mame/drivers/trackfld.c2
-rw-r--r--src/mame/drivers/tumbleb.c12
-rw-r--r--src/mame/drivers/undrfire.c2
-rw-r--r--src/mame/drivers/upscope.c4
-rw-r--r--src/mame/drivers/vamphalf.c20
-rw-r--r--src/mame/drivers/vegas.c151
-rw-r--r--src/mame/drivers/vendetta.c16
-rw-r--r--src/mame/drivers/viper.c64
-rw-r--r--src/mame/drivers/wardner.c10
-rw-r--r--src/mame/drivers/williams.c35
-rw-r--r--src/mame/drivers/witch.c2
-rw-r--r--src/mame/drivers/wiz.c4
-rw-r--r--src/mame/drivers/yunsun16.c2
-rw-r--r--src/mame/drivers/zaxxon.c14
-rw-r--r--src/mame/drivers/zn.c174
-rw-r--r--src/mame/includes/exidy440.h2
-rw-r--r--src/mame/includes/jaguar.h4
-rw-r--r--src/mame/includes/neogeo.h28
-rw-r--r--src/mame/includes/williams.h2
-rw-r--r--src/mame/machine/atari.c39
-rw-r--r--src/mame/machine/atarigen.c2
-rw-r--r--src/mame/machine/beezer.c12
-rw-r--r--src/mame/machine/dec0.c8
-rw-r--r--src/mame/machine/drakton.c2
-rw-r--r--src/mame/machine/galaxold.c24
-rw-r--r--src/mame/machine/midtunit.c47
-rw-r--r--src/mame/machine/midwayic.c12
-rw-r--r--src/mame/machine/midwayic.h4
-rw-r--r--src/mame/machine/midwunit.c6
-rw-r--r--src/mame/machine/midyunit.c44
-rw-r--r--src/mame/machine/namcos1.c48
-rw-r--r--src/mame/machine/neoboot.c28
-rw-r--r--src/mame/machine/neoprot.c58
-rw-r--r--src/mame/machine/playch10.c32
-rw-r--r--src/mame/machine/scramble.c45
-rw-r--r--src/mame/machine/segaic16.c31
-rw-r--r--src/mame/machine/segaic16.h6
-rw-r--r--src/mame/machine/simpsons.c6
-rw-r--r--src/mame/machine/strtheat.c6
-rw-r--r--src/mame/machine/stvprot.c18
-rw-r--r--src/mame/machine/stvprot.h6
-rw-r--r--src/mame/machine/tnzs.c12
-rw-r--r--src/mame/machine/vsnes.c77
-rw-r--r--src/mame/machine/williams.c19
-rw-r--r--src/mame/video/combatsc.c10
-rw-r--r--src/mame/video/exidy440.c2
-rw-r--r--src/mame/video/simpsons.c10
236 files changed, 2738 insertions, 3001 deletions
diff --git a/src/emu/cpu/mips/psx.c b/src/emu/cpu/mips/psx.c
index 1480c30429a..9b559be642d 100644
--- a/src/emu/cpu/mips/psx.c
+++ b/src/emu/cpu/mips/psx.c
@@ -1252,24 +1252,21 @@ static WRITE32_HANDLER( psx_berr_w )
mipscpu.berr = 1;
}
-static void mips_update_scratchpad( void )
+static void mips_update_scratchpad( running_machine *machine )
{
int cpu = cpu_getactivecpu();
if( ( mipscpu.biu & BIU_RAM ) == 0 )
{
- memory_install_read32_handler ( cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r );
- memory_install_write32_handler( cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_w );
+ memory_install_readwrite32_handler( machine, cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r, psx_berr_w );
}
else if( ( mipscpu.biu & BIU_DS ) == 0 )
{
- memory_install_read32_handler ( cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r );
- memory_install_write32_handler( cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, SMH_NOP );
+ memory_install_readwrite32_handler( machine, cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r, SMH_NOP );
}
else
{
- memory_install_read32_handler ( cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, SMH_BANK32 );
- memory_install_write32_handler( cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, SMH_BANK32 );
+ memory_install_readwrite32_handler( machine, cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, SMH_BANK32, SMH_BANK32 );
memory_set_bankptr( 32, mipscpu.dcache );
}
@@ -1564,7 +1561,7 @@ static STATE_POSTLOAD( mips_postload )
{
mips_update_memory_handlers();
mips_update_address_masks();
- mips_update_scratchpad();
+ mips_update_scratchpad(machine);
}
static void mips_state_register( const char *type, int index )
@@ -1605,7 +1602,7 @@ static void mips_reset( void )
mips_update_memory_handlers();
mips_update_address_masks();
- mips_update_scratchpad();
+ mips_update_scratchpad(Machine);
mips_set_cp0r( CP0_SR, SR_BEV );
mips_set_cp0r( CP0_CAUSE, 0x00000000 );
@@ -2887,7 +2884,7 @@ static WRITE32_HANDLER( psx_biu_w )
if( ( old & ( BIU_RAM | BIU_DS ) ) != ( mipscpu.biu & ( BIU_RAM | BIU_DS ) ) )
{
- mips_update_scratchpad();
+ mips_update_scratchpad(machine);
}
}
diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c
index dff1ab9b763..21f26eb278f 100644
--- a/src/emu/machine/idectrl.c
+++ b/src/emu/machine/idectrl.c
@@ -10,11 +10,9 @@
#include "deprecat.h"
-/*************************************
- *
- * Debugging
- *
- *************************************/
+/***************************************************************************
+ DEBUGGING
+***************************************************************************/
#define VERBOSE 0
#define PRINTF_IDE_COMMANDS 0
@@ -26,11 +24,9 @@
-/*************************************
- *
- * Constants
- *
- *************************************/
+/***************************************************************************
+ CONSTANTS
+***************************************************************************/
#define IDE_DISK_SECTOR_SIZE 512
@@ -97,140 +93,143 @@
-/*************************************
- *
- * Type definitions
- *
- *************************************/
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
-struct ide_state
+typedef struct _ide_state ide_state;
+struct _ide_state
{
- UINT8 adapter_control;
- UINT8 status;
- UINT8 error;
- UINT8 command;
- UINT8 interrupt_pending;
- UINT8 precomp_offset;
-
- UINT8 buffer[IDE_DISK_SECTOR_SIZE];
- UINT8 features[IDE_DISK_SECTOR_SIZE];
- UINT16 buffer_offset;
- UINT16 sector_count;
-
- UINT16 block_count;
- UINT16 sectors_until_int;
- UINT8 verify_only;
-
- UINT8 dma_active;
- UINT8 dma_cpu;
- UINT8 dma_address_xor;
- UINT8 dma_last_buffer;
- offs_t dma_address;
- offs_t dma_descriptor;
- UINT32 dma_bytes_left;
-
- UINT8 bus_master_command;
- UINT8 bus_master_status;
- UINT32 bus_master_descriptor;
-
- UINT16 cur_cylinder;
- UINT8 cur_sector;
- UINT8 cur_head;
- UINT8 cur_head_reg;
-
- UINT32 cur_lba;
-
- UINT16 num_cylinders;
- UINT8 num_sectors;
- UINT8 num_heads;
-
- UINT8 config_unknown;
- UINT8 config_register[IDE_CONFIG_REGISTERS];
- UINT8 config_register_num;
-
- const struct ide_interface *intf;
- hard_disk_file * disk;
- emu_timer * last_status_timer;
- emu_timer * reset_timer;
-
- UINT8 master_password_enable;
- UINT8 user_password_enable;
+ const device_config *device;
+
+ UINT8 adapter_control;
+ UINT8 status;
+ UINT8 error;
+ UINT8 command;
+ UINT8 interrupt_pending;
+ UINT8 precomp_offset;
+
+ UINT8 buffer[IDE_DISK_SECTOR_SIZE];
+ UINT8 features[IDE_DISK_SECTOR_SIZE];
+ UINT16 buffer_offset;
+ UINT16 sector_count;
+
+ UINT16 block_count;
+ UINT16 sectors_until_int;
+ UINT8 verify_only;
+
+ UINT8 dma_active;
+ UINT8 dma_cpu;
+ UINT8 dma_address_xor;
+ UINT8 dma_last_buffer;
+ offs_t dma_address;
+ offs_t dma_descriptor;
+ UINT32 dma_bytes_left;
+
+ UINT8 bus_master_command;
+ UINT8 bus_master_status;
+ UINT32 bus_master_descriptor;
+
+ UINT16 cur_cylinder;
+ UINT8 cur_sector;
+ UINT8 cur_head;
+ UINT8 cur_head_reg;
+
+ UINT32 cur_lba;
+
+ UINT16 num_cylinders;
+ UINT8 num_sectors;
+ UINT8 num_heads;
+
+ UINT8 config_unknown;
+ UINT8 config_register[IDE_CONFIG_REGISTERS];
+ UINT8 config_register_num;
+
+ hard_disk_file *disk;
+ emu_timer * last_status_timer;
+ emu_timer * reset_timer;
+
+ UINT8 master_password_enable;
+ UINT8 user_password_enable;
const UINT8 * master_password;
const UINT8 * user_password;
};
-/*************************************
- *
- * Local variables
- *
- *************************************/
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
-static struct ide_state idestate[MAX_IDE_CONTROLLERS];
+static TIMER_CALLBACK( reset_callback );
+static void ide_build_features(ide_state *ide);
+static void continue_read(ide_state *ide);
+static void read_sector_done(ide_state *ide);
+static TIMER_CALLBACK( read_sector_done_callback );
+static void read_first_sector(ide_state *ide);
+static void read_next_sector(ide_state *ide);
-/*************************************
- *
- * Prototypes
- *
- *************************************/
+static UINT32 ide_controller_read(const device_config *device, offs_t offset, int size);
+static void ide_controller_write(const device_config *device, offs_t offset, int size, UINT32 data);
-static TIMER_CALLBACK( reset_callback );
-static void ide_build_features(struct ide_state *ide);
-static void continue_read(struct ide_state *ide);
-static void read_sector_done(struct ide_state *ide);
-static TIMER_CALLBACK( read_sector_done_callback );
-static void read_first_sector(struct ide_state *ide);
-static void read_next_sector(struct ide_state *ide);
+/***************************************************************************
+ INLINE FUNCTIONS
+***************************************************************************/
-static UINT32 ide_controller_read(struct ide_state *ide, offs_t offset, int size);
-static void ide_controller_write(struct ide_state *ide, offs_t offset, int size, UINT32 data);
+/*-------------------------------------------------
+ get_safe_token - makes sure that the passed
+ in device is, in fact, an IDE controller
+-------------------------------------------------*/
+INLINE ide_state *get_safe_token(const device_config *device)
+{
+ assert(device != NULL);
+ assert(device->token != NULL);
+ assert(device->type == IDE_CONTROLLER);
+ return (ide_state *)device->token;
+}
-/*************************************
- *
- * Interrupts
- *
- *************************************/
-INLINE void signal_interrupt(struct ide_state *ide)
+INLINE void signal_interrupt(ide_state *ide)
{
+ const ide_config *config = ide->device->inline_config;
+
LOG(("IDE interrupt assert\n"));
/* signal an interrupt */
- if (ide->intf->interrupt)
- (*ide->intf->interrupt)(ASSERT_LINE);
+ if (config->interrupt != NULL)
+ (*config->interrupt)(ide->device, ASSERT_LINE);
ide->interrupt_pending = 1;
ide->bus_master_status |= IDE_BUSMASTER_STATUS_IRQ;
}
-INLINE void clear_interrupt(struct ide_state *ide)
+INLINE void clear_interrupt(ide_state *ide)
{
+ const ide_config *config = ide->device->inline_config;
+
LOG(("IDE interrupt clear\n"));
/* clear an interrupt */
- if (ide->intf->interrupt)
- (*ide->intf->interrupt)(CLEAR_LINE);
+ if (config->interrupt != NULL)
+ (*config->interrupt)(ide->device, CLEAR_LINE);
ide->interrupt_pending = 0;
}
-/*************************************
- *
- * Delayed interrupt handling
- *
- *************************************/
+/***************************************************************************
+ DELAYED INTERRUPT HANDLING
+***************************************************************************/
static TIMER_CALLBACK( delayed_interrupt )
{
- struct ide_state *ide = ptr;
+ ide_state *ide = ptr;
ide->status &= ~IDE_STATUS_BUSY;
signal_interrupt(ide);
}
@@ -238,14 +237,14 @@ static TIMER_CALLBACK( delayed_interrupt )
static TIMER_CALLBACK( delayed_interrupt_buffer_ready )
{
- struct ide_state *ide = ptr;
+ ide_state *ide = ptr;
ide->status &= ~IDE_STATUS_BUSY;
ide->status |= IDE_STATUS_BUFFER_READY;
signal_interrupt(ide);
}
-INLINE void signal_delayed_interrupt(struct ide_state *ide, attotime time, int buffer_ready)
+INLINE void signal_delayed_interrupt(ide_state *ide, attotime time, int buffer_ready)
{
/* clear buffer ready and set the busy flag */
ide->status &= ~IDE_STATUS_BUFFER_READY;
@@ -260,163 +259,29 @@ INLINE void signal_delayed_interrupt(struct ide_state *ide, attotime time, int b
-/*************************************
- *
- * Initialization & reset
- *
- *************************************/
-
-static void ide_controller_exit(running_machine *machine)
-{
- int i;
-
- /* close all open hard disks */
- for (i = 0; i < MAX_IDE_CONTROLLERS; i++)
- if (idestate[i].disk)
- {
- hard_disk_close(idestate[i].disk);
- idestate[i].disk = NULL;
- }
-}
-
-
-int ide_controller_init_custom(int which, const struct ide_interface *intf, chd_file *diskhandle)
-{
- struct ide_state *ide = &idestate[which];
- const hard_disk_info *hdinfo;
-
- /* must be called during init phase */
- assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "ide_controller_init can only be called at init time");
- add_exit_callback(Machine, ide_controller_exit);
-
- /* NULL interface is immediate failure */
- if (!intf)
- return 1;
-
- /* reset the IDE state */
- memset(ide, 0, sizeof(*ide));
- ide->intf = intf;
-
- /* set MAME harddisk handle */
- ide->disk = hard_disk_open(diskhandle);
-
- /* get and copy the geometry */
- if (ide->disk)
- {
- hdinfo = hard_disk_get_info(ide->disk);
- ide->num_cylinders = hdinfo->cylinders;
- ide->num_sectors = hdinfo->sectors;
- ide->num_heads = hdinfo->heads;
- if (hdinfo->sectorbytes != IDE_DISK_SECTOR_SIZE)
- /* wrong sector len */
- return 1;
-#if PRINTF_IDE_COMMANDS
- mame_printf_debug("CHS: %d %d %d\n", ide->num_cylinders, ide->num_heads, ide->num_sectors);
-#endif
- }
-
- /* build the features page */
- ide_build_features(ide);
-
- /* create a timer for timing status */
- ide->last_status_timer = timer_alloc(NULL, NULL);
- ide->reset_timer = timer_alloc(reset_callback, ide);
-
- /* register ide status */
- state_save_register_item("ide", which, ide->adapter_control);
- state_save_register_item("ide", which, ide->status);
- state_save_register_item("ide", which, ide->error);
- state_save_register_item("ide", which, ide->command);
- state_save_register_item("ide", which, ide->interrupt_pending);
- state_save_register_item("ide", which, ide->precomp_offset);
-
- state_save_register_item_array("ide", which, ide->buffer);
- state_save_register_item_array("ide", which, ide->features);
- state_save_register_item("ide", which, ide->buffer_offset);
- state_save_register_item("ide", which, ide->sector_count);
-
- state_save_register_item("ide", which, ide->block_count);
- state_save_register_item("ide", which, ide->sectors_until_int);
-
- state_save_register_item("ide", which, ide->dma_active);
- state_save_register_item("ide", which, ide->dma_cpu);
- state_save_register_item("ide", which, ide->dma_address_xor);
- state_save_register_item("ide", which, ide->dma_last_buffer);
- state_save_register_item("ide", which, ide->dma_address);
- state_save_register_item("ide", which, ide->dma_descriptor);
- state_save_register_item("ide", which, ide->dma_bytes_left);
-
- state_save_register_item("ide", which, ide->bus_master_command);
- state_save_register_item("ide", which, ide->bus_master_status);
- state_save_register_item("ide", which, ide->bus_master_descriptor);
-
- state_save_register_item("ide", which, ide->cur_cylinder);
- state_save_register_item("ide", which, ide->cur_sector);
- state_save_register_item("ide", which, ide->cur_head);
- state_save_register_item("ide", which, ide->cur_head_reg);
-
- state_save_register_item("ide", which, ide->cur_lba);
-
- state_save_register_item("ide", which, ide->num_cylinders);
- state_save_register_item("ide", which, ide->num_sectors);
- state_save_register_item("ide", which, ide->num_heads);
-
- state_save_register_item("ide", which, ide->config_unknown);
- state_save_register_item_array("ide", which, ide->config_register);
- state_save_register_item("ide", which, ide->config_register_num);
-
- state_save_register_item("ide", which, ide->master_password_enable);
- state_save_register_item("ide", which, ide->user_password_enable);
-
- return 0;
-}
-
-int ide_controller_init(int which, const struct ide_interface *intf)
-{
- /* we only support one hard disk right now; get a handle to it */
- return ide_controller_init_custom(which, intf, get_disk_handle(0));
-}
-
-
-static void ide_controller_reset_ptr(struct ide_state *ide)
-{
- LOG(("IDE controller reset performed\n"));
-
- /* reset the drive state */
- ide->status = IDE_STATUS_DRIVE_READY | IDE_STATUS_SEEK_COMPLETE;
- ide->error = IDE_ERROR_DEFAULT;
- ide->buffer_offset = 0;
- ide->master_password_enable = (ide->master_password != NULL);
- ide->user_password_enable = (ide->user_password != NULL);
- clear_interrupt(ide);
-}
-
-
-void ide_controller_reset(int which)
-{
- ide_controller_reset_ptr(&idestate[which]);
-}
-
+/***************************************************************************
+ INITIALIZATION AND RESET
+***************************************************************************/
-UINT8 *ide_get_features(int which)
+UINT8 *ide_get_features(const device_config *device)
{
- struct ide_state *ide = &idestate[which];
+ ide_state *ide = get_safe_token(device);
return ide->features;
}
-void ide_set_master_password(int which, const UINT8 *password)
+void ide_set_master_password(const device_config *device, const UINT8 *password)
{
- struct ide_state *ide = &idestate[which];
+ ide_state *ide = get_safe_token(device);
ide->master_password = password;
ide->master_password_enable = (ide->master_password != NULL);
}
-void ide_set_user_password(int which, const UINT8 *password)
+void ide_set_user_password(const device_config *device, const UINT8 *password)
{
- struct ide_state *ide = &idestate[which];
+ ide_state *ide = get_safe_token(device);
ide->user_password = password;
ide->user_password_enable = (ide->user_password != NULL);
@@ -425,7 +290,7 @@ void ide_set_user_password(int which, const UINT8 *password)
static TIMER_CALLBACK( reset_callback )
{
- ide_controller_reset_ptr(ptr);
+ device_reset(ptr);
}
@@ -488,7 +353,7 @@ INLINE int convert_to_offset_and_size16(offs_t *offset, UINT32 mem_mask)
*
*************************************/
-INLINE UINT32 lba_address(struct ide_state *ide)
+INLINE UINT32 lba_address(ide_state *ide)
{
/* LBA direct? */
if (ide->cur_head_reg & 0x40)
@@ -507,7 +372,7 @@ INLINE UINT32 lba_address(struct ide_state *ide)
*
*************************************/
-INLINE void next_sector(struct ide_state *ide)
+INLINE void next_sector(ide_state *ide)
{
/* LBA direct? */
if (ide->cur_head_reg & 0x40)
@@ -561,7 +426,7 @@ static void swap_strncpy(UINT8 *dst, const char *src, int field_size_in_words)
}
-static void ide_build_features(struct ide_state *ide)
+static void ide_build_features(ide_state *ide)
{
int total_sectors = ide->num_cylinders * ide->num_heads * ide->num_sectors;
int sectors_per_track = ide->num_heads * ide->num_sectors;
@@ -729,14 +594,14 @@ static void ide_build_features(struct ide_state *ide)
static TIMER_CALLBACK( security_error_done )
{
- struct ide_state *ide = ptr;
+ ide_state *ide = ptr;
/* clear error state */
ide->status &= ~IDE_STATUS_ERROR;
ide->status |= IDE_STATUS_DRIVE_READY;
}
-static void security_error(struct ide_state *ide)
+static void security_error(ide_state *ide)
{
/* set error state */
ide->status |= IDE_STATUS_ERROR;
@@ -754,7 +619,7 @@ static void security_error(struct ide_state *ide)
*
*************************************/
-static void continue_read(struct ide_state *ide)
+static void continue_read(ide_state *ide)
{
/* reset the totals */
ide->buffer_offset = 0;
@@ -787,7 +652,7 @@ static void continue_read(struct ide_state *ide)
}
-static void write_buffer_to_dma(struct ide_state *ide)
+static void write_buffer_to_dma(ide_state *ide)
{
int bytesleft = IDE_DISK_SECTOR_SIZE;
UINT8 *data = ide->buffer;
@@ -834,7 +699,7 @@ static void write_buffer_to_dma(struct ide_state *ide)
}
-static void read_sector_done(struct ide_state *ide)
+static void read_sector_done(ide_state *ide)
{
int lba = lba_address(ide), count = 0;
@@ -901,7 +766,7 @@ static TIMER_CALLBACK( read_sector_done_callback )
}
-static void read_first_sector(struct ide_state *ide)
+static void read_first_sector(ide_state *ide)
{
/* mark ourselves busy */
ide->status |= IDE_STATUS_BUSY;
@@ -925,7 +790,7 @@ static void read_first_sector(struct ide_state *ide)
}
-static void read_next_sector(struct ide_state *ide)
+static void read_next_sector(ide_state *ide)
{
/* mark ourselves busy */
ide->status |= IDE_STATUS_BUSY;
@@ -952,10 +817,10 @@ static void read_next_sector(struct ide_state *ide)
*
*************************************/
-static void write_sector_done(struct ide_state *ide);
+static void write_sector_done(ide_state *ide);
static TIMER_CALLBACK( write_sector_done_callback );
-static void continue_write(struct ide_state *ide)
+static void continue_write(ide_state *ide)
{
/* reset the totals */
ide->buffer_offset = 0;
@@ -985,7 +850,7 @@ static void continue_write(struct ide_state *ide)
}
-static void read_buffer_from_dma(struct ide_state *ide)
+static void read_buffer_from_dma(ide_state *ide)
{
int bytesleft = IDE_DISK_SECTOR_SIZE;
UINT8 *data = ide->buffer;
@@ -1032,7 +897,7 @@ static void read_buffer_from_dma(struct ide_state *ide)
}
-static void write_sector_done(struct ide_state *ide)
+static void write_sector_done(ide_state *ide)
{
int lba = lba_address(ide), count = 0;
@@ -1110,7 +975,7 @@ static TIMER_CALLBACK( write_sector_done_callback )
*
*************************************/
-static void handle_command(struct ide_state *ide, UINT8 command)
+static void handle_command(ide_state *ide, UINT8 command)
{
/* implicitly clear interrupts here */
clear_interrupt(ide);
@@ -1309,8 +1174,9 @@ static void handle_command(struct ide_state *ide, UINT8 command)
*
*************************************/
-static UINT32 ide_controller_read(struct ide_state *ide, offs_t offset, int size)
+static UINT32 ide_controller_read(const device_config *device, offs_t offset, int size)
{
+ ide_state *ide = get_safe_token(device);
UINT32 result = 0;
/* logit */
@@ -1420,8 +1286,10 @@ static UINT32 ide_controller_read(struct ide_state *ide, offs_t offset, int size
*
*************************************/
-static void ide_controller_write(struct ide_state *ide, offs_t offset, int size, UINT32 data)
+static void ide_controller_write(const device_config *device, offs_t offset, int size, UINT32 data)
{
+ ide_state *ide = get_safe_token(device);
+
/* logit */
if (offset != IDE_ADDR_DATA)
LOG(("%08X:IDE write to %03X = %08X, size=%d\n", activecpu_get_previouspc(), offset, data, size));
@@ -1568,8 +1436,10 @@ static void ide_controller_write(struct ide_state *ide, offs_t offset, int size,
*
*************************************/
-static UINT32 ide_bus_master_read(struct ide_state *ide, offs_t offset, int size)
+static UINT32 ide_bus_master_read(const device_config *device, offs_t offset, int size)
{
+ ide_state *ide = get_safe_token(device);
+
LOG(("%08X:ide_bus_master_read(%d, %d)\n", activecpu_get_previouspc(), offset, size));
/* command register */
@@ -1595,8 +1465,10 @@ static UINT32 ide_bus_master_read(struct ide_state *ide, offs_t offset, int size
*
*************************************/
-static void ide_bus_master_write(struct ide_state *ide, offs_t offset, int size, UINT32 data)
+static void ide_bus_master_write(const device_config *device, offs_t offset, int size, UINT32 data)
{
+ ide_state *ide = get_safe_token(device);
+
LOG(("%08X:ide_bus_master_write(%d, %d, %08X)\n", activecpu_get_previouspc(), offset, size, data));
/* command register */
@@ -1663,21 +1535,21 @@ static void ide_bus_master_write(struct ide_state *ide, offs_t offset, int size,
*************************************/
/*
- ide_bus_0_r()
+ ide_bus_r()
Read a 16-bit word from the IDE bus directly.
select: 0->CS1Fx active, 1->CS3Fx active
offset: register offset (state of DA2-DA0)
*/
-int ide_bus_0_r(int select, int offset)
+int ide_bus_r(const device_config *device, int select, int offset)
{
offset += select ? 0x3f0 : 0x1f0;
- return ide_controller_read(&idestate[0], offset, (offset == 0x1f0) ? 2 : 1);
+ return ide_controller_read(device, offset, (offset == 0x1f0) ? 2 : 1);
}
/*
- ide_bus_0_w()
+ ide_bus_w()
Write a 16-bit word to the IDE bus directly.
@@ -1685,23 +1557,23 @@ int ide_bus_0_r(int select, int offset)
offset: register offset (state of DA2-DA0)
data: data written (state of D0-D15 or D0-D7)
*/
-void ide_bus_0_w(int select, int offset, int data)
+void ide_bus_w(const device_config *device, int select, int offset, int data)
{
offset += select ? 0x3f0 : 0x1f0;
if (offset == 0x1f0)
- ide_controller_write(&idestate[0], offset, 2, data);
+ ide_controller_write(device, offset, 2, data);
else
- ide_controller_write(&idestate[0], offset, 1, data & 0xff);
+ ide_controller_write(device, offset, 1, data & 0xff);
}
-int ide_controller_0_r(int reg)
+int ide_controller_r(const device_config *device, int reg)
{
- return ide_controller_read(&idestate[0], reg, 1);
+ return ide_controller_read(device, reg, 1);
}
-void ide_controller_0_w(int reg, int data)
+void ide_controller_w(const device_config *device, int reg, int data)
{
- ide_controller_write(&idestate[0], reg, 1, data);
+ ide_controller_write(device, reg, 1, data);
}
@@ -1711,47 +1583,47 @@ void ide_controller_0_w(int reg, int data)
*
*************************************/
-READ32_HANDLER( ide_controller32_0_r )
+READ32_DEVICE_HANDLER( ide_controller32_r )
{
int size;
offset *= 4;
size = convert_to_offset_and_size32(&offset, mem_mask);
- return ide_controller_read(&idestate[0], offset, size) << ((offset & 3) * 8);
+ return ide_controller_read(device, offset, size) << ((offset & 3) * 8);
}
-WRITE32_HANDLER( ide_controller32_0_w )
+WRITE32_DEVICE_HANDLER( ide_controller32_w )
{
int size;
offset *= 4;
size = convert_to_offset_and_size32(&offset, mem_mask);
- ide_controller_write(&idestate[0], offset, size, data >> ((offset & 3) * 8));
+ ide_controller_write(device, offset, size, data >> ((offset & 3) * 8));
}
-READ32_HANDLER( ide_bus_master32_0_r )
+READ32_DEVICE_HANDLER( ide_bus_master32_r )
{
int size;
offset *= 4;
size = convert_to_offset_and_size32(&offset, mem_mask);
- return ide_bus_master_read(&idestate[0], offset, size) << ((offset & 3) * 8);
+ return ide_bus_master_read(device, offset, size) << ((offset & 3) * 8);
}
-WRITE32_HANDLER( ide_bus_master32_0_w )
+WRITE32_DEVICE_HANDLER( ide_bus_master32_w )
{
int size;
offset *= 4;
size = convert_to_offset_and_size32(&offset, mem_mask);
- ide_bus_master_write(&idestate[0], offset, size, data >> ((offset & 3) * 8));
+ ide_bus_master_write(device, offset, size, data >> ((offset & 3) * 8));
}
@@ -1762,23 +1634,203 @@ WRITE32_HANDLER( ide_bus_master32_0_w )
*
*************************************/
-READ16_HANDLER( ide_controller16_0_r )
+READ16_DEVICE_HANDLER( ide_controller16_r )
{
int size;
offset *= 2;
size = convert_to_offset_and_size16(&offset, mem_mask);
- return ide_controller_read(&idestate[0], offset, size) << ((offset & 1) * 8);
+ return ide_controller_read(device, offset, size) << ((offset & 1) * 8);
}
-WRITE16_HANDLER( ide_controller16_0_w )
+WRITE16_DEVICE_HANDLER( ide_controller16_w )
{
int size;
offset *= 2;
size = convert_to_offset_and_size16(&offset, mem_mask);
- ide_controller_write(&idestate[0], offset, size, data >> ((offset & 1) * 8));
+ ide_controller_write(device, offset, size, data >> ((offset & 1) * 8));
+}
+
+
+
+/***************************************************************************
+ DEVICE INTERFACE
+***************************************************************************/
+
+/*-------------------------------------------------
+ device start callback
+-------------------------------------------------*/
+
+static DEVICE_START( ide_controller )
+{
+ ide_state *ide = get_safe_token(device);
+ const hard_disk_info *hdinfo;
+ const ide_config *config;
+ char unique_tag[50];
+
+ /* validate some basic stuff */
+ assert(device != NULL);
+ assert(device->static_config == NULL);
+ assert(device->inline_config != NULL);
+ assert(device->machine != NULL);
+ assert(device->machine->config != NULL);
+
+ /* store a pointer back to the device */
+ ide->device = device;
+
+ /* set MAME harddisk handle */
+ config = device->inline_config;
+ ide->disk = hard_disk_open(get_disk_handle(config->disknum));
+
+ /* get and copy the geometry */
+ if (ide->disk != NULL)
+ {
+ hdinfo = hard_disk_get_info(ide->disk);
+ if (hdinfo->sectorbytes == IDE_DISK_SECTOR_SIZE)
+ {
+ ide->num_cylinders = hdinfo->cylinders;
+ ide->num_sectors = hdinfo->sectors;
+ ide->num_heads = hdinfo->heads;
+#if PRINTF_IDE_COMMANDS
+ mame_printf_debug("CHS: %d %d %d\n", ide->num_cylinders, ide->num_heads, ide->num_sectors);
+#endif
+ }
+ }
+
+ /* build the features page */
+ ide_build_features(ide);
+
+ /* create a timer for timing status */
+ ide->last_status_timer = timer_alloc(NULL, NULL);
+ ide->reset_timer = timer_alloc(reset_callback, (void *)device);
+
+ /* create the name for save states */
+ assert(strlen(device->tag) < 30);
+ state_save_combine_module_and_tag(unique_tag, "ide_controller", device->tag);
+
+ /* register ide states */
+ state_save_register_item(unique_tag, 0, ide->adapter_control);
+ state_save_register_item(unique_tag, 0, ide->status);
+ state_save_register_item(unique_tag, 0, ide->error);
+ state_save_register_item(unique_tag, 0, ide->command);
+ state_save_register_item(unique_tag, 0, ide->interrupt_pending);
+ state_save_register_item(unique_tag, 0, ide->precomp_offset);
+
+ state_save_register_item_array(unique_tag, 0, ide->buffer);
+ state_save_register_item_array(unique_tag, 0, ide->features);
+ state_save_register_item(unique_tag, 0, ide->buffer_offset);
+ state_save_register_item(unique_tag, 0, ide->sector_count);
+
+ state_save_register_item(unique_tag, 0, ide->block_count);
+ state_save_register_item(unique_tag, 0, ide->sectors_until_int);
+
+ state_save_register_item(unique_tag, 0, ide->dma_active);
+ state_save_register_item(unique_tag, 0, ide->dma_cpu);
+ state_save_register_item(unique_tag, 0, ide->dma_address_xor);
+ state_save_register_item(unique_tag, 0, ide->dma_last_buffer);
+ state_save_register_item(unique_tag, 0, ide->dma_address);
+ state_save_register_item(unique_tag, 0, ide->dma_descriptor);
+ state_save_register_item(unique_tag, 0, ide->dma_bytes_left);
+
+ state_save_register_item(unique_tag, 0, ide->bus_master_command);
+ state_save_register_item(unique_tag, 0, ide->bus_master_status);
+ state_save_register_item(unique_tag, 0, ide->bus_master_descriptor);
+
+ state_save_register_item(unique_tag, 0, ide->cur_cylinder);
+ state_save_register_item(unique_tag, 0, ide->cur_sector);
+ state_save_register_item(unique_tag, 0, ide->cur_head);
+ state_save_register_item(unique_tag, 0, ide->cur_head_reg);
+
+ state_save_register_item(unique_tag, 0, ide->cur_lba);
+
+ state_save_register_item(unique_tag, 0, ide->num_cylinders);
+ state_save_register_item(unique_tag, 0, ide->num_sectors);
+ state_save_register_item(unique_tag, 0, ide->num_heads);
+
+ state_save_register_item(unique_tag, 0, ide->config_unknown);
+ state_save_register_item_array(unique_tag, 0, ide->config_register);
+ state_save_register_item(unique_tag, 0, ide->config_register_num);
+
+ state_save_register_item(unique_tag, 0, ide->master_password_enable);
+ state_save_register_item(unique_tag, 0, ide->user_password_enable);
+}
+
+
+/*-------------------------------------------------
+ device exit callback
+-------------------------------------------------*/
+
+static DEVICE_STOP( ide_controller )
+{
+ ide_state *ide = get_safe_token(device);
+
+ /* close the hard disk */
+ if (ide->disk != NULL)
+ hard_disk_close(ide->disk);
+}
+
+
+/*-------------------------------------------------
+ device reset callback
+-------------------------------------------------*/
+
+static DEVICE_RESET( ide_controller )
+{
+ ide_state *ide = get_safe_token(device);
+
+ LOG(("IDE controller reset performed\n"));
+
+ /* reset the drive state */
+ ide->status = IDE_STATUS_DRIVE_READY | IDE_STATUS_SEEK_COMPLETE;
+ ide->error = IDE_ERROR_DEFAULT;
+ ide->buffer_offset = 0;
+ ide->master_password_enable = (ide->master_password != NULL);
+ ide->user_password_enable = (ide->user_password != NULL);
+ clear_interrupt(ide);
+}
+
+
+/*-------------------------------------------------
+ device set info callback
+-------------------------------------------------*/
+
+static DEVICE_SET_INFO( ide_controller )
+{
+ switch (state)
+ {
+ /* no parameters to set */
+ }
+}
+
+
+/*-------------------------------------------------
+ device get info callback
+-------------------------------------------------*/
+
+DEVICE_GET_INFO( ide_controller )
+{
+ switch (state)
+ {
+ /* --- the following bits of info are returned as 64-bit signed integers --- */
+ case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(ide_state); break;
+ case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(ide_config); break;
+ case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break;
+
+ /* --- the following bits of info are returned as pointers to data or functions --- */
+ case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(ide_controller); break;
+ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(ide_controller); break;
+ case DEVINFO_FCT_STOP: info->stop = DEVICE_STOP_NAME(ide_controller); break;
+ case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(ide_controller);break;
+
+ /* --- the following bits of info are returned as NULL-terminated strings --- */
+ case DEVINFO_STR_NAME: info->s = "IDE Controller"; break;
+ case DEVINFO_STR_FAMILY: info->s = "Disk Controller"; break;
+ case DEVINFO_STR_VERSION: info->s = "1.0"; break;
+ case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break;
+ case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
+ }
}
diff --git a/src/emu/machine/idectrl.h b/src/emu/machine/idectrl.h
index a73929bc1f8..9c6c20f2545 100644
--- a/src/emu/machine/idectrl.h
+++ b/src/emu/machine/idectrl.h
@@ -1,37 +1,78 @@
/***************************************************************************
- Generic (PC-style) IDE controller implementation
+ idectrl.h
+
+ Generic (PC-style) IDE controller implementation.
+
+ Copyright Nicola Salmoria and the MAME Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
***************************************************************************/
+#pragma once
+
+#ifndef __IDECTRL_H__
+#define __IDECTRL_H__
+
#include "harddisk.h"
-#define MAX_IDE_CONTROLLERS 1
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
-struct ide_interface
+typedef struct _ide_config ide_config;
+struct _ide_config
{
- void (*interrupt)(int state);
+ UINT32 disknum;
+ void (*interrupt)(const device_config *device, int state);
};
-int ide_controller_init(int which, const struct ide_interface *intf);
-int ide_controller_init_custom(int which, const struct ide_interface *intf, chd_file *diskhandle);
-void ide_controller_reset(int which);
-UINT8 *ide_get_features(int which);
-void ide_set_master_password(int which, const UINT8 *password);
-void ide_set_user_password(int which, const UINT8 *password);
-int ide_bus_0_r(int select, int offset);
-void ide_bus_0_w(int select, int offset, int data);
+/***************************************************************************
+ TIMER DEVICE CONFIGURATION MACROS
+***************************************************************************/
+
+#define MDRV_IDE_CONTROLLER_ADD(_tag, _disknum, _callback) \
+ MDRV_DEVICE_ADD(_tag, IDE_CONTROLLER) \
+ MDRV_DEVICE_CONFIG_DATA32(ide_config, disknum, _disknum) \
+ MDRV_DEVICE_CONFIG_DATAPTR(ide_config, interrupt, _callback)
+
+#define MDRV_IDE_CONTROLLER_REMOVE(_tag) \
+ MDRV_DEVICE_REMOVE(_tag, IDE_CONTROLLER)
+
+
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+UINT8 *ide_get_features(const device_config *device);
+
+void ide_set_master_password(const device_config *device, const UINT8 *password);
+void ide_set_user_password(const device_config *device, const UINT8 *password);
+
+int ide_bus_r(const device_config *config, int select, int offset);
+void ide_bus_w(const device_config *config, int select, int offset, int data);
+
+int ide_controller_r(const device_config *config, int reg);
+void ide_controller_w(const device_config *config, int reg, int data);
+
+READ32_DEVICE_HANDLER( ide_controller32_r );
+WRITE32_DEVICE_HANDLER( ide_controller32_w );
+READ32_DEVICE_HANDLER( ide_bus_master32_r );
+WRITE32_DEVICE_HANDLER( ide_bus_master32_w );
+
+READ16_DEVICE_HANDLER( ide_controller16_r );
+WRITE16_DEVICE_HANDLER( ide_controller16_w );
+
+
+/* ----- timer device interface ----- */
-int ide_controller_0_r(int reg);
-void ide_controller_0_w(int reg, int data);
+/* device get info callback */
+#define IDE_CONTROLLER DEVICE_GET_INFO_NAME(ide_controller)
+DEVICE_GET_INFO( ide_controller );
-READ32_HANDLER( ide_controller32_0_r );
-WRITE32_HANDLER( ide_controller32_0_w );
-READ32_HANDLER( ide_bus_master32_0_r );
-WRITE32_HANDLER( ide_bus_master32_0_w );
-READ16_HANDLER( ide_controller16_0_r );
-WRITE16_HANDLER( ide_controller16_0_w );
+#endif /* __IDECTRL_H__ */
diff --git a/src/emu/memory.c b/src/emu/memory.c
index 48dd1736883..623a7566903 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -1281,149 +1281,128 @@ int memory_get_log_unmap(int spacenum)
/*-------------------------------------------------
- memory_install_readX_handler - install dynamic
- read handler for X-bit case
+ memory_install_handlerX - install
+ dynamic machine read and write handlers for
+ X-bit case
-------------------------------------------------*/
-void *_memory_install_read_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR handler, const char *handler_name)
+void *_memory_install_handler(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name)
{
addrspace_data *space = &cpudata[cpunum].space[spacenum];
- if (handler >= STATIC_COUNT)
- fatalerror("fatal: can only use static banks with memory_install_read_handler()");
- space_map_range(space, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)handler, Machine, handler_name);
- mem_dump();
- return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
-}
-
-UINT8 *_memory_install_read8_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_machine_func handler, const char *handler_name)
-{
- addrspace_data *space = &cpudata[cpunum].space[spacenum];
- space_map_range(space, ROW_READ, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name);
- mem_dump();
- return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
-}
-
-UINT16 *_memory_install_read16_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_machine_func handler, const char *handler_name)
-{
- addrspace_data *space = &cpudata[cpunum].space[spacenum];
- space_map_range(space, ROW_READ, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name);
- mem_dump();
- return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
-}
-
-UINT32 *_memory_install_read32_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_machine_func handler, const char *handler_name)
-{
- addrspace_data *space = &cpudata[cpunum].space[spacenum];
- space_map_range(space, ROW_READ, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name);
- mem_dump();
- return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
-}
-
-UINT64 *_memory_install_read64_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_machine_func handler, const char *handler_name)
-{
- addrspace_data *space = &cpudata[cpunum].space[spacenum];
- space_map_range(space, ROW_READ, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name);
- mem_dump();
- return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
-}
-
-
-/*-------------------------------------------------
- memory_install_writeX_handler - install dynamic
- write handler for X-bit case
--------------------------------------------------*/
-
-void *_memory_install_write_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR handler, const char *handler_name)
-{
- addrspace_data *space = &cpudata[cpunum].space[spacenum];
- if (handler >= STATIC_COUNT)
- fatalerror("fatal: can only use static banks with memory_install_write_handler()");
- space_map_range(space, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name);
+ if (rhandler >= STATIC_COUNT || whandler >= STATIC_COUNT)
+ fatalerror("fatal: can only use static banks with memory_install_handler()");
+ if (rhandler != 0)
+ space_map_range(space, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, machine, rhandler_name);
+ if (whandler != 0)
+ space_map_range(space, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, machine, whandler_name);
mem_dump();
return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
}
-UINT8 *_memory_install_write8_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_machine_func handler, const char *handler_name)
+UINT8 *_memory_install_handler8(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_machine_func rhandler, write8_machine_func whandler, const char *rhandler_name, const char *whandler_name)
{
addrspace_data *space = &cpudata[cpunum].space[spacenum];
- space_map_range(space, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name);
+ if (rhandler != NULL)
+ space_map_range(space, ROW_READ, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name);
+ if (whandler != NULL)
+ space_map_range(space, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name);
mem_dump();
return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
}
-UINT16 *_memory_install_write16_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_machine_func handler, const char *handler_name)
+UINT16 *_memory_install_handler16(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_machine_func rhandler, write16_machine_func whandler, const char *rhandler_name, const char *whandler_name)
{
addrspace_data *space = &cpudata[cpunum].space[spacenum];
- space_map_range(space, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name);
+ if (rhandler != NULL)
+ space_map_range(space, ROW_READ, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name);
+ if (whandler != NULL)
+ space_map_range(space, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name);
mem_dump();
return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
}
-UINT32 *_memory_install_write32_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_machine_func handler, const char *handler_name)
+UINT32 *_memory_install_handler32(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_machine_func rhandler, write32_machine_func whandler, const char *rhandler_name, const char *whandler_name)
{
addrspace_data *space = &cpudata[cpunum].space[spacenum];
- space_map_range(space, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name);
+ if (rhandler != NULL)
+ space_map_range(space, ROW_READ, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name);
+ if (whandler != NULL)
+ space_map_range(space, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name);
mem_dump();
return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
}
-UINT64 *_memory_install_write64_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_machine_func handler, const char *handler_name)
+UINT64 *_memory_install_handler64(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_machine_func rhandler, write64_machine_func whandler, const char *rhandler_name, const char *whandler_name)
{
addrspace_data *space = &cpudata[cpunum].space[spacenum];
- space_map_range(space, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)handler, Machine, handler_name);
+ if (rhandler != NULL)
+ space_map_range(space, ROW_READ, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name);
+ if (whandler != NULL)
+ space_map_range(space, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name);
mem_dump();
return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
}
/*-------------------------------------------------
- memory_install_readwriteX_handler - install
- dynamic read and write handlers for X-bit case
+ memory_install_device_handlerX -
+ install dynamic device read and write handlers
+ for X-bit case
-------------------------------------------------*/
-void *_memory_install_readwrite_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name)
+void *_memory_install_device_handler(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name)
{
addrspace_data *space = &cpudata[cpunum].space[spacenum];
if (rhandler >= STATIC_COUNT || whandler >= STATIC_COUNT)
- fatalerror("fatal: can only use static banks with memory_install_readwrite_handler()");
- space_map_range(space, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, Machine, rhandler_name);
- space_map_range(space, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, Machine, whandler_name);
+ fatalerror("fatal: can only use static banks with memory_install_device_handler()");
+ if (rhandler != 0)
+ space_map_range(space, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, (void *)device, rhandler_name);
+ if (whandler != 0)
+ space_map_range(space, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, (void *)device, whandler_name);
mem_dump();
return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
}
-UINT8 *_memory_install_readwrite8_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_machine_func rhandler, write8_machine_func whandler, const char *rhandler_name, const char *whandler_name)
+UINT8 *_memory_install_device_handler8(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, write8_device_func whandler, const char *rhandler_name, const char *whandler_name)
{
addrspace_data *space = &cpudata[cpunum].space[spacenum];
- space_map_range(space, ROW_READ, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, Machine, rhandler_name);
- space_map_range(space, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, Machine, whandler_name);
+ if (rhandler != NULL)
+ space_map_range(space, ROW_READ, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
+ if (whandler != NULL)
+ space_map_range(space, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
mem_dump();
return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
}
-UINT16 *_memory_install_readwrite16_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_machine_func rhandler, write16_machine_func whandler, const char *rhandler_name, const char *whandler_name)
+UINT16 *_memory_install_device_handler16(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, write16_device_func whandler, const char *rhandler_name, const char *whandler_name)
{
addrspace_data *space = &cpudata[cpunum].space[spacenum];
- space_map_range(space, ROW_READ, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, Machine, rhandler_name);
- space_map_range(space, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, Machine, whandler_name);
+ if (rhandler != NULL)
+ space_map_range(space, ROW_READ, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
+ if (whandler != NULL)
+ space_map_range(space, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
mem_dump();
return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
}
-UINT32 *_memory_install_readwrite32_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_machine_func rhandler, write32_machine_func whandler, const char *rhandler_name, const char *whandler_name)
+UINT32 *_memory_install_device_handler32(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, write32_device_func whandler, const char *rhandler_name, const char *whandler_name)
{
addrspace_data *space = &cpudata[cpunum].space[spacenum];
- space_map_range(space, ROW_READ, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, Machine, rhandler_name);
- space_map_range(space, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, Machine, whandler_name);
+ if (rhandler != NULL)
+ space_map_range(space, ROW_READ, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
+ if (whandler != NULL)
+ space_map_range(space, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
mem_dump();
return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
}
-UINT64 *_memory_install_readwrite64_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_machine_func rhandler, write64_machine_func whandler, const char *rhandler_name, const char *whandler_name)
+UINT64 *_memory_install_device_handler64(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, write64_device_func whandler, const char *rhandler_name, const char *whandler_name)
{
addrspace_data *space = &cpudata[cpunum].space[spacenum];
- space_map_range(space, ROW_READ, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, Machine, rhandler_name);
- space_map_range(space, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, Machine, whandler_name);
+ if (rhandler != NULL)
+ space_map_range(space, ROW_READ, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
+ if (whandler != NULL)
+ space_map_range(space, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
mem_dump();
return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
}
diff --git a/src/emu/memory.h b/src/emu/memory.h
index 59cc9bfd336..dc0284a2fa9 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -23,11 +23,6 @@
CONSTANTS
***************************************************************************/
-/* stub handler shift amounts */
-#define SHIFT_PACKED 1
-
-
-
/* address spaces */
enum
{
@@ -472,42 +467,75 @@ union _addrmap64_token
/* wrappers for dynamic read handler installation */
-#define memory_install_read_handler(cpu, space, start, end, mask, mirror, handler) \
- _memory_install_read_handler(cpu, space, start, end, mask, mirror, handler, #handler)
-#define memory_install_read8_handler(cpu, space, start, end, mask, mirror, handler) \
- _memory_install_read8_handler(cpu, space, start, end, mask, mirror, handler, #handler)
-#define memory_install_read16_handler(cpu, space, start, end, mask, mirror, handler) \
- _memory_install_read16_handler(cpu, space, start, end, mask, mirror, handler, #handler)
-#define memory_install_read32_handler(cpu, space, start, end, mask, mirror, handler) \
- _memory_install_read32_handler(cpu, space, start, end, mask, mirror, handler, #handler)
-#define memory_install_read64_handler(cpu, space, start, end, mask, mirror, handler) \
- _memory_install_read64_handler(cpu, space, start, end, mask, mirror, handler, #handler)
+#define memory_install_read_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \
+ _memory_install_handler(machine, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
+#define memory_install_read8_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \
+ _memory_install_handler8(machine, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
+#define memory_install_read16_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \
+ _memory_install_handler16(machine, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
+#define memory_install_read32_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \
+ _memory_install_handler32(machine, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
+#define memory_install_read64_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \
+ _memory_install_handler64(machine, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
+
+#define memory_install_read_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \
+ _memory_install_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
+#define memory_install_read8_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \
+ _memory_install_device_handler8(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
+#define memory_install_read16_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \
+ _memory_install_device_handler16(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
+#define memory_install_read32_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \
+ _memory_install_device_handler32(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
+#define memory_install_read64_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \
+ _memory_install_device_handler64(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
/* wrappers for dynamic write handler installation */
-#define memory_install_write_handler(cpu, space, start, end, mask, mirror, handler) \
- _memory_install_write_handler(cpu, space, start, end, mask, mirror, handler, #handler)
-#define memory_install_write8_handler(cpu, space, start, end, mask, mirror, handler) \
- _memory_install_write8_handler(cpu, space, start, end, mask, mirror, handler, #handler)
-#define memory_install_write16_handler(cpu, space, start, end, mask, mirror, handler) \
- _memory_install_write16_handler(cpu, space, start, end, mask, mirror, handler, #handler)
-#define memory_install_write32_handler(cpu, space, start, end, mask, mirror, handler) \
- _memory_install_write32_handler(cpu, space, start, end, mask, mirror, handler, #handler)
-#define memory_install_write64_handler(cpu, space, start, end, mask, mirror, handler) \
- _memory_install_write64_handler(cpu, space, start, end, mask, mirror, handler, #handler)
+#define memory_install_write_handler(machine, cpu, space, start, end, mask, mirror, whandler) \
+ _memory_install_handler(machine, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
+#define memory_install_write8_handler(machine, cpu, space, start, end, mask, mirror, whandler) \
+ _memory_install_handler8(machine, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
+#define memory_install_write16_handler(machine, cpu, space, start, end, mask, mirror, whandler) \
+ _memory_install_handler16(machine, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
+#define memory_install_write32_handler(machine, cpu, space, start, end, mask, mirror, whandler) \
+ _memory_install_handler32(machine, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
+#define memory_install_write64_handler(machine, cpu, space, start, end, mask, mirror, whandler) \
+ _memory_install_handler64(machine, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
+
+#define memory_install_write_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \
+ _memory_install_device_handler(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
+#define memory_install_write8_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \
+ _memory_install_device_handler8(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
+#define memory_install_write16_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \
+ _memory_install_device_handler16(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
+#define memory_install_write32_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \
+ _memory_install_device_handler32(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
+#define memory_install_write64_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \
+ _memory_install_device_handler64(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
/* wrappers for dynamic read/write handler installation */
-#define memory_install_readwrite_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \
- _memory_install_readwrite_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
-#define memory_install_readwrite8_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \
- _memory_install_readwrite8_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
-#define memory_install_readwrite16_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \
- _memory_install_readwrite16_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
-#define memory_install_readwrite32_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \
- _memory_install_readwrite32_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
-#define memory_install_readwrite64_handler(cpu, space, start, end, mask, mirror, rhandler, whandler) \
- _memory_install_readwrite64_handler(cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
+#define memory_install_readwrite_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \
+ _memory_install_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
+#define memory_install_readwrite8_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \
+ _memory_install_handler8(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
+#define memory_install_readwrite16_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \
+ _memory_install_handler16(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
+#define memory_install_readwrite32_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \
+ _memory_install_handler32(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
+#define memory_install_readwrite64_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \
+ _memory_install_handler64(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
+
+#define memory_install_readwrite_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \
+ _memory_install_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
+#define memory_install_readwrite8_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \
+ _memory_install_device_handler8(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
+#define memory_install_readwrite16_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \
+ _memory_install_device_handler16(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
+#define memory_install_readwrite32_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \
+ _memory_install_device_handler32(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
+#define memory_install_readwrite64_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \
+ _memory_install_device_handler64(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
/* macros for accessing bytes and words within larger chunks */
@@ -841,21 +869,18 @@ void memory_set_log_unmap(int spacenum, int log);
int memory_get_log_unmap(int spacenum);
/* dynamic address space mapping */
-void * _memory_install_read_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR handler, const char *handler_name);
-UINT8 * _memory_install_read8_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_machine_func handler, const char *handler_name);
-UINT16 * _memory_install_read16_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_machine_func handler, const char *handler_name);
-UINT32 * _memory_install_read32_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_machine_func handler, const char *handler_name);
-UINT64 * _memory_install_read64_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_machine_func handler, const char *handler_name);
-void * _memory_install_write_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR handler, const char *handler_name);
-UINT8 * _memory_install_write8_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write8_machine_func handler, const char *handler_name);
-UINT16 * _memory_install_write16_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write16_machine_func handler, const char *handler_name);
-UINT32 * _memory_install_write32_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write32_machine_func handler, const char *handler_name);
-UINT64 * _memory_install_write64_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, write64_machine_func handler, const char *handler_name);
-void * _memory_install_readwrite_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name);
-UINT8 * _memory_install_readwrite8_handler (int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_machine_func rhandler, write8_machine_func whandler, const char *rhandler_name, const char *whandler_name);
-UINT16 * _memory_install_readwrite16_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_machine_func rhandler, write16_machine_func whandler, const char *rhandler_name, const char *whandler_name);
-UINT32 * _memory_install_readwrite32_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_machine_func rhandler, write32_machine_func whandler, const char *rhandler_name, const char *whandler_name);
-UINT64 * _memory_install_readwrite64_handler(int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_machine_func rhandler, write64_machine_func whandler, const char *rhandler_name, const char *whandler_name);
+void * _memory_install_handler (running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name);
+UINT8 * _memory_install_handler8 (running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_machine_func rhandler, write8_machine_func whandler, const char *rhandler_name, const char *whandler_name);
+UINT16 * _memory_install_handler16(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_machine_func rhandler, write16_machine_func whandler, const char *rhandler_name, const char *whandler_name);
+UINT32 * _memory_install_handler32(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_machine_func rhandler, write32_machine_func whandler, const char *rhandler_name, const char *whandler_name);
+UINT64 * _memory_install_handler64(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_machine_func rhandler, write64_machine_func whandler, const char *rhandler_name, const char *whandler_name);
+
+/* dynamic device address space mapping */
+void * _memory_install_device_handler (const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name);
+UINT8 * _memory_install_device_handler8 (const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, write8_device_func whandler, const char *rhandler_name, const char *whandler_name);
+UINT16 * _memory_install_device_handler16(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, write16_device_func whandler, const char *rhandler_name, const char *whandler_name);
+UINT32 * _memory_install_device_handler32(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, write32_device_func whandler, const char *rhandler_name, const char *whandler_name);
+UINT64 * _memory_install_device_handler64(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, write64_device_func whandler, const char *rhandler_name, const char *whandler_name);
/* memory debugging */
void memory_dump(FILE *file);
diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c
index 34a45616caf..437727de67d 100644
--- a/src/mame/audio/atarijsa.c
+++ b/src/mame/audio/atarijsa.c
@@ -143,10 +143,7 @@ void atarijsa_init(running_machine *machine, int testport, int testmask)
/* install POKEY memory handlers */
if (has_pokey)
- {
- memory_install_read8_handler(cpu_num, ADDRESS_SPACE_PROGRAM, 0x2c00, 0x2c0f, 0, 0, pokey1_r);
- memory_install_write8_handler(cpu_num, ADDRESS_SPACE_PROGRAM, 0x2c00, 0x2c0f, 0, 0, pokey1_w);
- }
+ memory_install_readwrite8_handler(machine, cpu_num, ADDRESS_SPACE_PROGRAM, 0x2c00, 0x2c0f, 0, 0, pokey1_r, pokey1_w);
init_save_state();
atarijsa_reset();
diff --git a/src/mame/audio/cage.c b/src/mame/audio/cage.c
index a529be33149..4417690215f 100644
--- a/src/mame/audio/cage.c
+++ b/src/mame/audio/cage.c
@@ -152,7 +152,7 @@ static WRITE32_HANDLER( speedup_w );
*
*************************************/
-void cage_init(int boot_region, offs_t speedup)
+void cage_init(running_machine *machine, int boot_region, offs_t speedup)
{
attotime cage_cpu_clock_period;
@@ -170,7 +170,7 @@ void cage_init(int boot_region, offs_t speedup)
timer[1] = timer_alloc(cage_timer_callback, NULL);
if (speedup)
- speedup_ram = memory_install_write32_handler(cage_cpu, ADDRESS_SPACE_PROGRAM, speedup, speedup, 0, 0, speedup_w);
+ speedup_ram = memory_install_write32_handler(machine, cage_cpu, ADDRESS_SPACE_PROGRAM, speedup, speedup, 0, 0, speedup_w);
}
diff --git a/src/mame/audio/cage.h b/src/mame/audio/cage.h
index 9952c0b3c48..01f017ea005 100644
--- a/src/mame/audio/cage.h
+++ b/src/mame/audio/cage.h
@@ -10,7 +10,7 @@
MACHINE_DRIVER_EXTERN( cage );
MACHINE_DRIVER_EXTERN( cage_seattle );
-void cage_init(int boot_region, offs_t speedup);
+void cage_init(running_machine *machine, int boot_region, offs_t speedup);
void cage_set_irq_handler(void (*irqhandler)(int));
void cage_reset_w(int state);
diff --git a/src/mame/audio/cinemat.c b/src/mame/audio/cinemat.c
index 7b0686f4b9a..16ec81a094b 100644
--- a/src/mame/audio/cinemat.c
+++ b/src/mame/audio/cinemat.c
@@ -1595,7 +1595,7 @@ static WRITE8_HANDLER( qb3_sound_w )
static MACHINE_RESET( qb3_sound )
{
MACHINE_RESET_CALL(demon_sound);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, qb3_sound_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, qb3_sound_w);
/* this patch prevents the sound ROM from eating itself when command $0A is sent */
/* on a cube rotate */
diff --git a/src/mame/audio/dcs.c b/src/mame/audio/dcs.c
index 017f30f0aa8..3870ea74c55 100644
--- a/src/mame/audio/dcs.c
+++ b/src/mame/audio/dcs.c
@@ -379,7 +379,7 @@ static READ16_HANDLER( dcs_dataram_r );
static WRITE16_HANDLER( dcs_dataram_w );
static WRITE16_HANDLER( dcs_data_bank_select_w );
-static void sdrc_reset(void);
+static void sdrc_reset(running_machine *machine);
static READ16_HANDLER( sdrc_r );
static WRITE16_HANDLER( sdrc_w );
@@ -412,7 +412,7 @@ static void sound_tx_callback(int port, INT32 data);
static READ16_HANDLER( dcs_polling_r );
static TIMER_CALLBACK( transfer_watchdog_callback );
-static int preprocess_write(UINT16 data);
+static int preprocess_write(running_machine *machine, UINT16 data);
@@ -787,7 +787,7 @@ static TIMER_CALLBACK( dcs_reset )
/* rev 2: reset the SDRC ASIC */
case 2:
- sdrc_reset();
+ sdrc_reset(machine);
break;
/* rev 3: reset the DSIO ASIC */
@@ -930,7 +930,7 @@ void dcs_init(void)
}
-void dcs2_init(int dram_in_mb, offs_t polling_offset)
+void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
{
memset(&dcs, 0, sizeof(dcs));
@@ -978,7 +978,7 @@ void dcs2_init(int dram_in_mb, offs_t polling_offset)
/* install the speedup handler */
if (polling_offset)
- dcs_polling_base = memory_install_read16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, polling_offset, polling_offset, 0, 0, dcs_polling_r);
+ dcs_polling_base = memory_install_read16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, polling_offset, polling_offset, 0, 0, dcs_polling_r);
/* allocate a watchdog timer for HLE transfers */
transfer.hle_enabled = (ENABLE_HLE_TRANSFERS && dram_in_mb != 0);
@@ -994,9 +994,9 @@ void dcs2_init(int dram_in_mb, offs_t polling_offset)
#ifdef UNUSED_FUNCTION
-void dsio_init(int dram_in_mb, offs_t polling_offset)
+void dsio_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
{
- dcs2_init(dram_in_mb, polling_offset);
+ dcs2_init(machine, dram_in_mb, polling_offset);
}
#endif
@@ -1072,35 +1072,29 @@ INLINE void sdrc_update_bank_pointers(void)
}
-static void sdrc_remap_memory(void)
+static void sdrc_remap_memory(running_machine *machine)
{
/* if SRAM disabled, clean it out */
if (SDRC_SM_EN == 0)
{
- memory_install_read32_handler (dcs.cpunum, ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_UNMAP);
- memory_install_write32_handler(dcs.cpunum, ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_UNMAP);
- memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x37ff, 0, 0, SMH_UNMAP);
- memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x37ff, 0, 0, SMH_UNMAP);
+ memory_install_readwrite32_handler(machine, dcs.cpunum, ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_UNMAP, SMH_UNMAP);
+ memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x37ff, 0, 0, SMH_UNMAP, SMH_UNMAP);
}
/* otherwise, map the SRAM */
else
{
/* first start with a clean program map */
- memory_install_read32_handler (dcs.cpunum, ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_BANK21);
- memory_install_write32_handler(dcs.cpunum, ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_BANK21);
+ memory_install_readwrite32_handler(machine, dcs.cpunum, ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_BANK21, SMH_BANK21);
memory_set_bankptr(21, dcs_sram + 0x4800);
/* set up the data map based on the SRAM banking */
/* map 0: ram from 0800-37ff */
if (SDRC_SM_BK == 0)
{
- memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_BANK22);
- memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_BANK22);
- memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23);
- memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23);
- memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24);
- memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24);
+ memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_BANK22, SMH_BANK22);
+ memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23, SMH_BANK23);
+ memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24, SMH_BANK24);
memory_set_bankptr(22, dcs_sram + 0x0000);
memory_set_bankptr(23, dcs_sram + 0x1000);
memory_set_bankptr(24, dcs_sram + 0x2000);
@@ -1109,12 +1103,9 @@ static void sdrc_remap_memory(void)
/* map 1: nothing from 0800-17ff, alternate RAM at 1800-27ff, same RAM at 2800-37ff */
else
{
- memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_UNMAP);
- memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_UNMAP);
- memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23);
- memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23);
- memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24);
- memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24);
+ memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_UNMAP, SMH_UNMAP);
+ memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23, SMH_BANK23);
+ memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24, SMH_BANK24);
memory_set_bankptr(23, dcs_sram + 0x3000);
memory_set_bankptr(24, dcs_sram + 0x2000);
}
@@ -1125,15 +1116,14 @@ static void sdrc_remap_memory(void)
{
int baseaddr = (SDRC_ROM_ST == 0) ? 0x0000 : (SDRC_ROM_ST == 1) ? 0x3000 : 0x3400;
int pagesize = (SDRC_ROM_SZ == 0 && SDRC_ROM_ST != 0) ? 4096 : 1024;
- memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, baseaddr, baseaddr + pagesize - 1, 0, 0, SMH_BANK25);
+ memory_install_read16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, baseaddr, baseaddr + pagesize - 1, 0, 0, SMH_BANK25);
}
/* map the DRAM page as bank 26 */
if (SDRC_DM_ST != 0)
{
int baseaddr = (SDRC_DM_ST == 1) ? 0x0000 : (SDRC_DM_ST == 2) ? 0x3000 : 0x3400;
- memory_install_read16_handler (dcs.cpunum, ADDRESS_SPACE_DATA, baseaddr, baseaddr + 0x3ff, 0, 0, SMH_BANK26);
- memory_install_write16_handler(dcs.cpunum, ADDRESS_SPACE_DATA, baseaddr, baseaddr + 0x3ff, 0, 0, SMH_BANK26);
+ memory_install_readwrite16_handler(machine, dcs.cpunum, ADDRESS_SPACE_DATA, baseaddr, baseaddr + 0x3ff, 0, 0, SMH_BANK26, SMH_BANK26);
}
/* update the bank pointers */
@@ -1141,10 +1131,10 @@ static void sdrc_remap_memory(void)
}
-static void sdrc_reset(void)
+static void sdrc_reset(running_machine *machine)
{
memset(sdrc.reg, 0, sizeof(sdrc.reg));
- sdrc_remap_memory();
+ sdrc_remap_memory(machine);
}
@@ -1213,7 +1203,7 @@ static WRITE16_HANDLER( sdrc_w )
case 0:
sdrc.reg[0] = data;
if (diff & 0x1833)
- sdrc_remap_memory();
+ sdrc_remap_memory(machine);
if (diff & 0x0380)
sdrc_update_bank_pointers();
break;
@@ -1223,7 +1213,7 @@ static WRITE16_HANDLER( sdrc_w )
sdrc.reg[1] = data;
// dmadac_enable(0, dcs.channels, SDRC_MUTE);
if (diff & 0x0003)
- sdrc_remap_memory();
+ sdrc_remap_memory(machine);
break;
/* offset 2 controls paging */
@@ -1549,7 +1539,7 @@ static TIMER_CALLBACK( dcs_delayed_data_w_callback )
void dcs_data_w(int data)
{
/* preprocess the write */
- if (preprocess_write(data))
+ if (preprocess_write(Machine, data))
return;
/* if we are DCS1, set a timer to latch the data */
@@ -2054,7 +2044,7 @@ void dcs_fifo_notify(int count, int max)
if (transfer.state != 5 || transfer.fifo_entries == transfer.writes_left || transfer.fifo_entries >= 256)
{
for ( ; transfer.fifo_entries; transfer.fifo_entries--)
- preprocess_write((*dcs.fifo_data_r)());
+ preprocess_write(Machine, (*dcs.fifo_data_r)());
}
}
@@ -2066,7 +2056,7 @@ static TIMER_CALLBACK( transfer_watchdog_callback )
if (transfer.fifo_entries && starting_writes_left == transfer.writes_left)
{
for ( ; transfer.fifo_entries; transfer.fifo_entries--)
- preprocess_write((*dcs.fifo_data_r)());
+ preprocess_write(machine, (*dcs.fifo_data_r)());
}
timer_adjust_oneshot(transfer.watchdog, ATTOTIME_IN_MSEC(1), transfer.writes_left);
}
@@ -2099,7 +2089,7 @@ static TIMER_CALLBACK( s1_ack_callback1 )
}
-static int preprocess_stage_1(UINT16 data)
+static int preprocess_stage_1(running_machine *machine, UINT16 data)
{
switch (transfer.state)
{
@@ -2173,12 +2163,12 @@ static int preprocess_stage_1(UINT16 data)
if (transfer.type == 1 && SDRC_SM_BK == 1)
{
sdrc.reg[0] &= ~0x1000;
- sdrc_remap_memory();
+ sdrc_remap_memory(machine);
}
if (transfer.type == 2 && SDRC_SM_BK == 0)
{
sdrc.reg[0] |= 0x1000;
- sdrc_remap_memory();
+ sdrc_remap_memory(machine);
}
return 1;
}
@@ -2235,7 +2225,7 @@ static TIMER_CALLBACK( s2_ack_callback )
}
-static int preprocess_stage_2(UINT16 data)
+static int preprocess_stage_2(running_machine *machine, UINT16 data)
{
switch (transfer.state)
{
@@ -2335,7 +2325,7 @@ static int preprocess_stage_2(UINT16 data)
}
-static int preprocess_write(UINT16 data)
+static int preprocess_write(running_machine *machine, UINT16 data)
{
int result;
@@ -2345,9 +2335,9 @@ static int preprocess_write(UINT16 data)
/* state 0 - initialization phase */
if (transfer.dcs_state == 0)
- result = preprocess_stage_1(data);
+ result = preprocess_stage_1(machine, data);
else
- result = preprocess_stage_2(data);
+ result = preprocess_stage_2(machine, data);
/* if we did the write, toggle the full/not full state so interrupts are generated */
if (result && dcs.input_empty_cb)
diff --git a/src/mame/audio/dcs.h b/src/mame/audio/dcs.h
index 6c9d10a9b5f..6f005742869 100644
--- a/src/mame/audio/dcs.h
+++ b/src/mame/audio/dcs.h
@@ -13,7 +13,7 @@ MACHINE_DRIVER_EXTERN( dcs2_audio_dsio );
MACHINE_DRIVER_EXTERN( dcs2_audio_denver );
void dcs_init(void);
-void dcs2_init(int dram_in_mb, offs_t polling_offset);
+void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset);
void dcs_set_auto_ack(int state);
void dcs_set_fifo_callbacks(UINT16 (*fifo_data_r)(void), UINT16 (*fifo_status_r)(void));
diff --git a/src/mame/audio/jaguar.c b/src/mame/audio/jaguar.c
index 9ed2c14189b..a8901eefab4 100644
--- a/src/mame/audio/jaguar.c
+++ b/src/mame/audio/jaguar.c
@@ -221,7 +221,7 @@ static void update_gpu_irq(void)
}
-void jaguar_external_int(int state)
+void jaguar_external_int(const device_config *device, int state)
{
if (state != CLEAR_LINE)
gpu_irq_state |= 1;
@@ -238,7 +238,7 @@ void jaguar_external_int(int state)
*
*************************************/
-void cojag_sound_init(void)
+void cojag_sound_init(running_machine *machine)
{
int i;
@@ -271,7 +271,7 @@ void cojag_sound_init(void)
}
#if ENABLE_SPEEDUP_HACKS
- memory_install_write32_handler(2, ADDRESS_SPACE_PROGRAM, 0xf1a100, 0xf1a103, 0, 0, dsp_flags_w);
+ memory_install_write32_handler(machine, 2, ADDRESS_SPACE_PROGRAM, 0xf1a100, 0xf1a103, 0, 0, dsp_flags_w);
#endif
}
diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c
index ba2d7b3ebca..e4165f1733b 100644
--- a/src/mame/audio/leland.c
+++ b/src/mame/audio/leland.c
@@ -1419,15 +1419,11 @@ static WRITE16_HANDLER( i80186_internal_port_w )
temp = (i80186.mem.peripheral & 0xffc0) << 4;
if (i80186.mem.middle_size & 0x0040)
- {
- memory_install_read16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0x2ff, 0, 0, peripheral_r);
- memory_install_write16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0x2ff, 0, 0, peripheral_w);
- }
+ memory_install_readwrite16_handler(machine, 2, ADDRESS_SPACE_PROGRAM, temp, temp + 0x2ff, 0, 0, peripheral_r, peripheral_w);
else
{
temp &= 0xffff;
- memory_install_read16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0x2ff, 0, 0, peripheral_r);
- memory_install_write16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0x2ff, 0, 0, peripheral_w);
+ memory_install_readwrite16_handler(machine, 2, ADDRESS_SPACE_IO, temp, temp + 0x2ff, 0, 0, peripheral_r, peripheral_w);
}
/* we need to do this at a time when the 80186 context is swapped in */
@@ -1492,15 +1488,11 @@ static WRITE16_HANDLER( i80186_internal_port_w )
/* okay to leave us mapped where we were */
temp = (data & 0x0fff) << 8;
if (data & 0x1000)
- {
- memory_install_read16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i80186_internal_port_r);
- memory_install_write16_handler(2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i80186_internal_port_w);
- }
+ memory_install_readwrite16_handler(machine, 2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i80186_internal_port_r, i80186_internal_port_w);
else
{
temp &= 0xffff;
- memory_install_read16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i80186_internal_port_r);
- memory_install_write16_handler(2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i80186_internal_port_w);
+ memory_install_readwrite16_handler(machine, 2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i80186_internal_port_r, i80186_internal_port_w);
}
/* popmessage("Sound CPU reset");*/
break;
diff --git a/src/mame/audio/namcoc7x.c b/src/mame/audio/namcoc7x.c
index 5fd6035c454..d552cf48fe6 100644
--- a/src/mame/audio/namcoc7x.c
+++ b/src/mame/audio/namcoc7x.c
@@ -67,10 +67,7 @@ void namcoc7x_on_driver_init(void)
// install speedup cheat
for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
if (Machine->config->cpu[cpunum].type == CPU_M37702)
- {
- memory_install_read16_handler(cpunum, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, speedup_r);
- memory_install_write16_handler(cpunum, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, speedup_w);
- }
+ memory_install_readwrite16_handler(Machine, cpunum, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, speedup_r, speedup_w);
}
void namcoc7x_set_host_ram(UINT32 *hostram)
diff --git a/src/mame/drivers/actfancr.c b/src/mame/drivers/actfancr.c
index acde6aa3e18..9a9ecc4d9a2 100644
--- a/src/mame/drivers/actfancr.c
+++ b/src/mame/drivers/actfancr.c
@@ -637,12 +637,12 @@ static READ8_HANDLER( cyclej_r )
static DRIVER_INIT( actfancr )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f0026, 0x1f0027, 0, 0, cycle_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f0026, 0x1f0027, 0, 0, cycle_r);
}
static DRIVER_INIT( actfancj )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f0026, 0x1f0027, 0, 0, cyclej_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f0026, 0x1f0027, 0, 0, cyclej_r);
}
diff --git a/src/mame/drivers/airbustr.c b/src/mame/drivers/airbustr.c
index 61fe930d218..d9d58dc01e0 100644
--- a/src/mame/drivers/airbustr.c
+++ b/src/mame/drivers/airbustr.c
@@ -754,7 +754,7 @@ ROM_END
static DRIVER_INIT( airbustr )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, devram_r); // protection device lives here
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, devram_r); // protection device lives here
}
diff --git a/src/mame/drivers/aladbl.c b/src/mame/drivers/aladbl.c
index c3f2a426439..d07a200b97b 100644
--- a/src/mame/drivers/aladbl.c
+++ b/src/mame/drivers/aladbl.c
@@ -156,8 +156,8 @@ static READ16_HANDLER( aladbl_r )
static DRIVER_INIT( aladbl )
{
// 220000 = writes to mcu? 330000 = reads?
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x220000, 0x220001, 0, 0, aladbl_w);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x330000, 0x330001, 0, 0, aladbl_r);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x220000, 0x220001, 0, 0, aladbl_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x330000, 0x330001, 0, 0, aladbl_r);
DRIVER_INIT_CALL(megadrij);
}
diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c
index 5fe9ec1886c..d14232cdd69 100644
--- a/src/mame/drivers/alg.c
+++ b/src/mame/drivers/alg.c
@@ -278,11 +278,11 @@ static void alg_cia_0_porta_w(UINT8 data)
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
/* overlay disabled, map RAM on 0x000000 */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1);
+ memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1);
else
/* overlay enabled, map Amiga system ROM on 0x000000 */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP);
+ memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP);
}
diff --git a/src/mame/drivers/alpha68k.c b/src/mame/drivers/alpha68k.c
index b3444e60f19..dd4498d943e 100644
--- a/src/mame/drivers/alpha68k.c
+++ b/src/mame/drivers/alpha68k.c
@@ -3167,7 +3167,7 @@ static DRIVER_INIT( jongbou )
alpha68k_video_banking = jongbou_video_banking;
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0c0001, 0, 0, jongbou_inputs_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0c0001, 0, 0, jongbou_inputs_r);
}
static DRIVER_INIT( paddlema )
@@ -3178,7 +3178,7 @@ static DRIVER_INIT( paddlema )
static DRIVER_INIT( timesold )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, timesold_cycle_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, timesold_cycle_r);
invert_controls=0;
microcontroller_id=0;
coin_id=0x22|(0x22<<8);
@@ -3186,7 +3186,7 @@ static DRIVER_INIT( timesold )
static DRIVER_INIT( timesol1 )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, timesol1_cycle_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, timesol1_cycle_r);
invert_controls=1;
microcontroller_id=0;
coin_id=0x22|(0x22<<8);
@@ -3194,7 +3194,7 @@ static DRIVER_INIT( timesol1 )
static DRIVER_INIT( btlfield )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, btlfield_cycle_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, btlfield_cycle_r);
invert_controls=1;
microcontroller_id=0;
coin_id=0x22|(0x22<<8);
@@ -3209,7 +3209,7 @@ static DRIVER_INIT( btlfildb )
static DRIVER_INIT( skysoldr )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skysoldr_cycle_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skysoldr_cycle_r);
memory_set_bankptr(8, (memory_region(REGION_USER1))+0x40000);
invert_controls=0;
microcontroller_id=0;
@@ -3233,7 +3233,7 @@ static DRIVER_INIT( goldmeda )
static DRIVER_INIT( skyadvnt )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r);
invert_controls=0;
microcontroller_id=0x8814;
coin_id=0x22|(0x22<<8);
@@ -3241,7 +3241,7 @@ static DRIVER_INIT( skyadvnt )
static DRIVER_INIT( skyadvnu )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r);
invert_controls=0;
microcontroller_id=0x8814;
coin_id=0x23|(0x24<<8);
@@ -3249,7 +3249,7 @@ static DRIVER_INIT( skyadvnu )
static DRIVER_INIT( gangwars )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40206, 0x40207, 0, 0, gangwars_cycle_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40206, 0x40207, 0, 0, gangwars_cycle_r);
memory_set_bankptr(8, memory_region(REGION_USER1));
invert_controls=0;
microcontroller_id=0x8512;
@@ -3258,7 +3258,7 @@ static DRIVER_INIT( gangwars )
static DRIVER_INIT( gangwarb )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x40206, 0x40207, 0, 0, gangwarb_cycle_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40206, 0x40207, 0, 0, gangwarb_cycle_r);
memory_set_bankptr(8, memory_region(REGION_USER1));
invert_controls=0;
microcontroller_id=0x8512;
diff --git a/src/mame/drivers/arabian.c b/src/mame/drivers/arabian.c
index 882d353c0b7..df42701ad4e 100644
--- a/src/mame/drivers/arabian.c
+++ b/src/mame/drivers/arabian.c
@@ -422,8 +422,8 @@ ROM_END
static DRIVER_INIT( arabian )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd34b, 0xd34b, 0, 0, custom_flip_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd400, 0xd401, 0, 0, custom_cocktail_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd34b, 0xd34b, 0, 0, custom_flip_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd400, 0xd401, 0, 0, custom_cocktail_w);
}
diff --git a/src/mame/drivers/arcadia.c b/src/mame/drivers/arcadia.c
index 5d290eb6d4c..642dd2b06bd 100644
--- a/src/mame/drivers/arcadia.c
+++ b/src/mame/drivers/arcadia.c
@@ -72,7 +72,7 @@ static UINT8 coin_counter[2];
static WRITE16_HANDLER( arcadia_multibios_change_game )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x97ffff, 0, 0, (data == 0) ? SMH_BANK2 : SMH_NOP);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x97ffff, 0, 0, (data == 0) ? SMH_BANK2 : SMH_NOP);
}
@@ -105,11 +105,11 @@ static void arcadia_cia_0_porta_w(UINT8 data)
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
/* overlay disabled, map RAM on 0x000000 */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1);
+ memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1);
else
/* overlay enabled, map Amiga system ROM on 0x000000 */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP);
+ memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP);
/* bit 2 = Power Led on Amiga */
set_led_status(0, (data & 2) ? 0 : 1);
diff --git a/src/mame/drivers/arkanoid.c b/src/mame/drivers/arkanoid.c
index e3c885dbb10..ee49b624a45 100644
--- a/src/mame/drivers/arkanoid.c
+++ b/src/mame/drivers/arkanoid.c
@@ -1082,47 +1082,47 @@ ROM_END
/* Driver Initialization */
-static void arkanoid_bootleg_init( void )
+static void arkanoid_bootleg_init( running_machine *machine )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf002, 0xf002, 0, 0, arkanoid_bootleg_f002_r );
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd018, 0xd018, 0, 0, arkanoid_bootleg_d018_w );
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd008, 0xd008, 0, 0, arkanoid_bootleg_d008_r );
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf002, 0xf002, 0, 0, arkanoid_bootleg_f002_r );
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd018, 0xd018, 0, 0, arkanoid_bootleg_d018_w );
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd008, 0xd008, 0, 0, arkanoid_bootleg_d008_r );
}
static DRIVER_INIT( arkangc )
{
arkanoid_bootleg_id = ARKANGC;
- arkanoid_bootleg_init();
+ arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( arkangc2 )
{
arkanoid_bootleg_id = ARKANGC2;
- arkanoid_bootleg_init();
+ arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( arkblock )
{
arkanoid_bootleg_id = ARKBLOCK;
- arkanoid_bootleg_init();
+ arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( arkbloc2 )
{
arkanoid_bootleg_id = ARKBLOC2;
- arkanoid_bootleg_init();
+ arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( arkgcbl )
{
arkanoid_bootleg_id = ARKGCBL;
- arkanoid_bootleg_init();
+ arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( paddle2 )
{
arkanoid_bootleg_id = PADDLE2;
- arkanoid_bootleg_init();
+ arkanoid_bootleg_init(machine);
}
diff --git a/src/mame/drivers/artmagic.c b/src/mame/drivers/artmagic.c
index 433027b0d39..1d07d0f38a4 100644
--- a/src/mame/drivers/artmagic.c
+++ b/src/mame/drivers/artmagic.c
@@ -843,7 +843,7 @@ static DRIVER_INIT( ultennis )
protection_handler = ultennis_protection;
/* additional (protection?) hack */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x300001, 0, 0, ultennis_hack_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x300001, 0, 0, ultennis_hack_r);
}
diff --git a/src/mame/drivers/asteroid.c b/src/mame/drivers/asteroid.c
index 5f9c4652efc..da759620285 100644
--- a/src/mame/drivers/asteroid.c
+++ b/src/mame/drivers/asteroid.c
@@ -869,14 +869,14 @@ ROM_END
static DRIVER_INIT( asteroib )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2000, 0, 0, asteroib_IN0_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2003, 0x2003, 0, 0, input_port_3_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2000, 0, 0, asteroib_IN0_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2003, 0x2003, 0, 0, input_port_3_r);
}
static DRIVER_INIT( asterock )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2007, 0, 0, asterock_IN0_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2007, 0, 0, asterock_IN0_r);
}
diff --git a/src/mame/drivers/astrocde.c b/src/mame/drivers/astrocde.c
index 8fcadf6328f..25187e4db6d 100644
--- a/src/mame/drivers/astrocde.c
+++ b/src/mame/drivers/astrocde.c
@@ -422,12 +422,12 @@ static WRITE8_HANDLER( profpac_banksw_w )
profpac_bank = data;
/* set the main banking */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0xbfff, 0, 0, SMH_BANK1);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0xbfff, 0, 0, SMH_BANK1);
memory_set_bankptr(1, memory_region(REGION_USER1) + 0x8000 * bank);
/* bank 0 reads video RAM in the 4000-7FFF range */
if (bank == 0)
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, profpac_videoram_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, profpac_videoram_r);
/* if we have a 640k EPROM board, map that on top of the 4000-7FFF range if specified */
if ((data & 0x80) && memory_region(REGION_USER2) != NULL)
@@ -438,11 +438,11 @@ static WRITE8_HANDLER( profpac_banksw_w )
/* if the bank is in range, map the appropriate bank */
if (bank < 0x28)
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK2);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK2);
memory_set_bankptr(2, memory_region(REGION_USER2) + 0x4000 * bank);
}
else
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP);
}
}
@@ -1674,56 +1674,56 @@ ROM_END
static DRIVER_INIT( seawolf2 )
{
astrocade_video_config = 0x00;
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x40, 0x40, 0, 0xff18, seawolf2_sound_1_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x41, 0x41, 0, 0xff18, seawolf2_sound_2_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x42, 0x43, 0, 0xff18, seawolf2_lamps_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x40, 0x40, 0, 0xff18, seawolf2_sound_1_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x41, 0x41, 0, 0xff18, seawolf2_sound_2_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x42, 0x43, 0, 0xff18, seawolf2_lamps_w);
}
static DRIVER_INIT( ebases )
{
astrocade_video_config = AC_SOUND_PRESENT;
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x20, 0x20, 0, 0xff07, ebases_coin_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x28, 0x28, 0, 0xff07, ebases_trackball_select_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x20, 0x20, 0, 0xff07, ebases_coin_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x28, 0x28, 0, 0xff07, ebases_trackball_select_w);
}
static DRIVER_INIT( spacezap )
{
astrocade_video_config = AC_SOUND_PRESENT;
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x13, 0x13, 0x03ff, 0xff00, spacezap_io_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x13, 0x13, 0x03ff, 0xff00, spacezap_io_r);
}
static DRIVER_INIT( wow )
{
astrocade_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS;
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, wow_io_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x17, 0x17, 0xffff, 0xff00, wow_speech_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, wow_io_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x17, 0x17, 0xffff, 0xff00, wow_speech_r);
}
static DRIVER_INIT( gorf )
{
astrocade_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS;
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, gorf_io_1_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x16, 0x16, 0x0fff, 0xff00, gorf_io_2_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x17, 0x17, 0xffff, 0xff00, gorf_speech_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, gorf_io_1_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x16, 0x16, 0x0fff, 0xff00, gorf_io_2_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x17, 0x17, 0xffff, 0xff00, gorf_speech_r);
}
static DRIVER_INIT( robby )
{
astrocade_video_config = AC_SOUND_PRESENT;
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, robby_io_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, robby_io_r);
}
static DRIVER_INIT( profpac )
{
astrocade_video_config = AC_SOUND_PRESENT;
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x14, 0x14, 0x0fff, 0xff00, profpac_io_1_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x77ff, 0xff00, profpac_io_2_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x14, 0x14, 0x0fff, 0xff00, profpac_io_1_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x77ff, 0xff00, profpac_io_2_r);
/* reset banking */
profpac_banksw_w(machine, 0, 0);
@@ -1734,10 +1734,10 @@ static DRIVER_INIT( profpac )
static DRIVER_INIT( demndrgn )
{
astrocade_video_config = 0x00;
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x14, 0x14, 0x1fff, 0xff00, demndrgn_io_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x1c, 0x1c, 0x0000, 0xff00, port_tag_to_handler8("FIREX"));
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x1d, 0x1d, 0x0000, 0xff00, port_tag_to_handler8("FIREY"));
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x97, 0x97, 0x0000, 0xff00, demndrgn_sound_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x14, 0x14, 0x1fff, 0xff00, demndrgn_io_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x1c, 0x1c, 0x0000, 0xff00, port_tag_to_handler8("FIREX"));
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x1d, 0x1d, 0x0000, 0xff00, port_tag_to_handler8("FIREY"));
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x97, 0x97, 0x0000, 0xff00, demndrgn_sound_w);
/* reset banking */
profpac_banksw_w(machine, 0, 0);
@@ -1748,15 +1748,15 @@ static DRIVER_INIT( demndrgn )
static DRIVER_INIT( tenpindx )
{
astrocade_video_config = 0x00;
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x60, 0x60, 0x0000, 0xff00, port_tag_to_handler8("P60"));
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x61, 0x61, 0x0000, 0xff00, port_tag_to_handler8("P61"));
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x62, 0x62, 0x0000, 0xff00, port_tag_to_handler8("P62"));
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x63, 0x63, 0x0000, 0xff00, port_tag_to_handler8("P63"));
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x64, 0x64, 0x0000, 0xff00, port_tag_to_handler8("P64"));
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x65, 0x66, 0x0000, 0xff00, tenpindx_lamp_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x67, 0x67, 0x0000, 0xff00, tenpindx_counter_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x68, 0x68, 0x0000, 0xff00, tenpindx_lights_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x97, 0x97, 0x0000, 0xff00, tenpindx_sound_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x60, 0x60, 0x0000, 0xff00, port_tag_to_handler8("P60"));
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x61, 0x61, 0x0000, 0xff00, port_tag_to_handler8("P61"));
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x62, 0x62, 0x0000, 0xff00, port_tag_to_handler8("P62"));
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x63, 0x63, 0x0000, 0xff00, port_tag_to_handler8("P63"));
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x64, 0x64, 0x0000, 0xff00, port_tag_to_handler8("P64"));
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x65, 0x66, 0x0000, 0xff00, tenpindx_lamp_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x67, 0x67, 0x0000, 0xff00, tenpindx_counter_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x68, 0x68, 0x0000, 0xff00, tenpindx_lights_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x97, 0x97, 0x0000, 0xff00, tenpindx_sound_w);
/* reset banking */
profpac_banksw_w(machine, 0, 0);
diff --git a/src/mame/drivers/astrof.c b/src/mame/drivers/astrof.c
index fb0aa157de1..d0fa89d4e59 100644
--- a/src/mame/drivers/astrof.c
+++ b/src/mame/drivers/astrof.c
@@ -1178,8 +1178,8 @@ static DRIVER_INIT( abattle )
rom[i] = prom[rom[i]];
/* set up protection handlers */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, abattle_coin_prot_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, abattle_coin_prot_r);
}
@@ -1192,8 +1192,8 @@ static DRIVER_INIT( afire )
rom[i] = ~rom[i];
/* set up protection handlers */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, afire_coin_prot_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, afire_coin_prot_r);
}
@@ -1206,8 +1206,8 @@ static DRIVER_INIT( sstarbtl )
rom[i] = ~rom[i];
/* set up protection handlers */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, abattle_coin_prot_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, abattle_coin_prot_r);
}
diff --git a/src/mame/drivers/atarig1.c b/src/mame/drivers/atarig1.c
index f50138a555c..c16d59cb8bd 100644
--- a/src/mame/drivers/atarig1.c
+++ b/src/mame/drivers/atarig1.c
@@ -196,10 +196,10 @@ static READ16_HANDLER( pitfighb_cheap_slapstic_r )
}
-static void pitfighb_cheap_slapstic_init(void)
+static void pitfighb_cheap_slapstic_init(running_machine *machine)
{
/* install a read handler */
- bslapstic_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x038000, 0x03ffff, 0, 0, pitfighb_cheap_slapstic_r);
+ bslapstic_base = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x038000, 0x03ffff, 0, 0, pitfighb_cheap_slapstic_r);
/* allocate memory for a copy of bank 0 */
bslapstic_bank0 = auto_malloc(0x2000);
@@ -961,7 +961,7 @@ static void init_g1_common(running_machine *machine, offs_t slapstic_base, int s
atarigen_eeprom_default = NULL;
if (slapstic == -1)
{
- pitfighb_cheap_slapstic_init();
+ pitfighb_cheap_slapstic_init(machine);
state_save_register_global(bslapstic_bank);
state_save_register_global(bslapstic_primed);
state_save_register_postload(machine, pitfighb_state_postload, NULL);
diff --git a/src/mame/drivers/atarig42.c b/src/mame/drivers/atarig42.c
index d08fb86b359..5cd02c379ee 100644
--- a/src/mame/drivers/atarig42.c
+++ b/src/mame/drivers/atarig42.c
@@ -694,8 +694,7 @@ static DRIVER_INIT( roadriot )
atarig42_motion_object_base = 0x200;
atarig42_motion_object_mask = 0x1ff;
- sloop_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, roadriot_sloop_data_r);
- sloop_base = memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, roadriot_sloop_data_w);
+ sloop_base = memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, roadriot_sloop_data_r, roadriot_sloop_data_w);
memory_set_opbase_handler(0, sloop_opbase_handler);
asic65_config(ASIC65_ROMBASED);
@@ -749,8 +748,7 @@ static DRIVER_INIT( guardian )
/* put an RTS there so we don't die */
*(UINT16 *)&memory_region(REGION_CPU1)[0x80000] = 0x4E75;
- sloop_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, guardians_sloop_data_r);
- sloop_base = memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, guardians_sloop_data_w);
+ sloop_base = memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, guardians_sloop_data_r, guardians_sloop_data_w);
memory_set_opbase_handler(0, sloop_opbase_handler);
asic65_config(ASIC65_GUARDIANS);
diff --git a/src/mame/drivers/atarigt.c b/src/mame/drivers/atarigt.c
index 0d584cecf13..7884c705d8d 100644
--- a/src/mame/drivers/atarigt.c
+++ b/src/mame/drivers/atarigt.c
@@ -1095,7 +1095,7 @@ static DRIVER_INIT( tmek )
atarigen_eeprom_default = NULL;
atarigt_is_primrage = 0;
- cage_init(REGION_USER1, 0x4fad);
+ cage_init(machine, REGION_USER1, 0x4fad);
cage_set_irq_handler(cage_irq_callback);
/* setup protection */
@@ -1103,16 +1103,16 @@ static DRIVER_INIT( tmek )
protection_w = tmek_protection_w;
/* temp hack */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd72000, 0xd75fff, 0, 0, tmek_pf_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd72000, 0xd75fff, 0, 0, tmek_pf_w);
}
-static void primrage_init_common(offs_t cage_speedup)
+static void primrage_init_common(running_machine *machine, offs_t cage_speedup)
{
atarigen_eeprom_default = NULL;
atarigt_is_primrage = 1;
- cage_init(REGION_USER1, cage_speedup);
+ cage_init(machine, REGION_USER1, cage_speedup);
cage_set_irq_handler(cage_irq_callback);
/* install protection */
@@ -1120,8 +1120,8 @@ static void primrage_init_common(offs_t cage_speedup)
protection_w = primrage_protection_w;
}
-static DRIVER_INIT( primrage ) { primrage_init_common(0x42f2); }
-static DRIVER_INIT( primraga ) { primrage_init_common(0x48a4); }
+static DRIVER_INIT( primrage ) { primrage_init_common(machine, 0x42f2); }
+static DRIVER_INIT( primraga ) { primrage_init_common(machine, 0x48a4); }
diff --git a/src/mame/drivers/atarigx2.c b/src/mame/drivers/atarigx2.c
index c7549be9f70..9245516e454 100644
--- a/src/mame/drivers/atarigx2.c
+++ b/src/mame/drivers/atarigx2.c
@@ -2096,7 +2096,7 @@ static DRIVER_INIT( rrreveng )
atarigx2_motion_object_base = 0x400;
atarigx2_motion_object_mask = 0x3ff;
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xca0fc0, 0xca0fc3, 0, 0, rrreveng_prot_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xca0fc0, 0xca0fc3, 0, 0, rrreveng_prot_r);
}
diff --git a/src/mame/drivers/ataxx.c b/src/mame/drivers/ataxx.c
index 3f66a8c55fd..d0f9da13cb8 100644
--- a/src/mame/drivers/ataxx.c
+++ b/src/mame/drivers/ataxx.c
@@ -666,7 +666,7 @@ static DRIVER_INIT( ataxx )
leland_rotate_memory(1);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, ataxx_trackball_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, ataxx_trackball_r);
}
@@ -689,7 +689,7 @@ static DRIVER_INIT( ataxxj )
leland_rotate_memory(1);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, ataxx_trackball_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, ataxx_trackball_r);
}
@@ -712,9 +712,9 @@ static DRIVER_INIT( wsf )
leland_rotate_memory(1);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_4_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_5_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_4_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_5_r);
}
@@ -737,14 +737,14 @@ static DRIVER_INIT( indyheat )
leland_rotate_memory(1);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x02, 0, 0, indyheat_wheel_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x08, 0x0b, 0, 0, indyheat_analog_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_9_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_10_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_11_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x02, 0, 0, indyheat_wheel_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x08, 0x0b, 0, 0, indyheat_analog_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_9_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_10_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_11_r);
/* set up additional output ports */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x08, 0x0b, 0, 0, indyheat_analog_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x08, 0x0b, 0, 0, indyheat_analog_w);
}
@@ -767,9 +767,9 @@ static DRIVER_INIT( brutforc )
leland_rotate_memory(1);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_4_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_5_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_4_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_5_r);
}
@@ -792,13 +792,13 @@ static DRIVER_INIT( asylum )
leland_rotate_memory(1);
/* asylum appears to have some extra RAM for the slave CPU */
- memory_install_readwrite8_handler(1, ADDRESS_SPACE_PROGRAM, 0xf000, 0xfffb, 0, 0, SMH_BANK4, SMH_BANK4);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xf000, 0xfffb, 0, 0, SMH_BANK4, SMH_BANK4);
memory_set_bankptr(4, auto_malloc(0x1000));
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_4_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_5_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_3_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_4_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_5_r);
}
diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c
index 600afb8c588..1af1b62e2f4 100644
--- a/src/mame/drivers/backfire.c
+++ b/src/mame/drivers/backfire.c
@@ -689,7 +689,7 @@ static DRIVER_INIT( backfire )
decrypt156();
cpunum_set_clockscale(machine, 0, 4.0f); /* core timings aren't accurate */
descramble_sound();
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0170018, 0x017001b, 0, 0, backfire_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0170018, 0x017001b, 0, 0, backfire_speedup_r );
}
GAME( 1995, backfire, 0, backfire, backfire, backfire, ROT0, "Data East Corporation", "Backfire! (set 1)", 0 )
diff --git a/src/mame/drivers/balsente.c b/src/mame/drivers/balsente.c
index f750fabe658..0fcea90762d 100644
--- a/src/mame/drivers/balsente.c
+++ b/src/mame/drivers/balsente.c
@@ -1942,45 +1942,42 @@ static DRIVER_INIT( minigol2 ) { expand_roms(0x0c); balsente_shooter = 0;
static DRIVER_INIT( toggle ) { expand_roms(EXPAND_ALL); balsente_shooter = 0; /* noanalog */ }
static DRIVER_INIT( nametune )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
expand_roms(EXPAND_NONE | SWAP_HALVES); balsente_shooter = 0; /* noanalog */
}
static DRIVER_INIT( nstocker )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9902, 0x9902, 0, 0, nstocker_port2_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9902, 0x9902, 0, 0, nstocker_port2_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
expand_roms(EXPAND_NONE | SWAP_HALVES); balsente_shooter = 1; balsente_adc_shift = 1;
}
static DRIVER_INIT( sfootbal )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
expand_roms(EXPAND_ALL | SWAP_HALVES); balsente_shooter = 0; balsente_adc_shift = 0;
}
static DRIVER_INIT( spiker )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f80, 0x9f8f, 0, 0, spiker_expand_w);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f80, 0x9f8f, 0, 0, spiker_expand_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f80, 0x9f8f, 0, 0, spiker_expand_r, spiker_expand_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
expand_roms(EXPAND_ALL | SWAP_HALVES); balsente_shooter = 0; balsente_adc_shift = 1;
}
static DRIVER_INIT( stompin )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
expand_roms(0x0c | SWAP_HALVES); balsente_shooter = 0; balsente_adc_shift = 32;
}
static DRIVER_INIT( rescraid ) { expand_roms(EXPAND_NONE); balsente_shooter = 0; /* noanalog */ }
static DRIVER_INIT( grudge )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9400, 0x9400, 0, 0, grudge_steering_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9400, 0x9400, 0, 0, grudge_steering_r);
expand_roms(EXPAND_NONE); balsente_shooter = 0;
}
static DRIVER_INIT( shrike )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9e00, 0x9fff, 0, 0, shrike_shared_6809_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9e00, 0x9fff, 0, 0, shrike_shared_6809_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9e01, 0x9e01, 0, 0, shrike_sprite_select_w );
- memory_install_read16_handler(2, ADDRESS_SPACE_PROGRAM, 0x10000, 0x1001f, 0, 0, shrike_io_68k_r);
- memory_install_write16_handler(2, ADDRESS_SPACE_PROGRAM, 0x10000, 0x1001f, 0, 0, shrike_io_68k_w );
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9e00, 0x9fff, 0, 0, shrike_shared_6809_r, shrike_shared_6809_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9e01, 0x9e01, 0, 0, shrike_sprite_select_w );
+ memory_install_readwrite16_handler(machine, 2, ADDRESS_SPACE_PROGRAM, 0x10000, 0x1001f, 0, 0, shrike_io_68k_r, shrike_io_68k_w);
expand_roms(EXPAND_ALL); balsente_shooter = 0; balsente_adc_shift = 32;
}
diff --git a/src/mame/drivers/beathead.c b/src/mame/drivers/beathead.c
index f7cc0b4a1a1..ef2bc04d5b5 100644
--- a/src/mame/drivers/beathead.c
+++ b/src/mame/drivers/beathead.c
@@ -536,8 +536,8 @@ static DRIVER_INIT( beathead )
atarijsa3_init_adpcm(REGION_SOUND1);
/* prepare the speedups */
- speedup_data = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000ae8, 0x00000aeb, 0, 0, speedup_r);
- movie_speedup_data = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000804, 0x00000807, 0, 0, movie_speedup_r);
+ speedup_data = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000ae8, 0x00000aeb, 0, 0, speedup_r);
+ movie_speedup_data = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000804, 0x00000807, 0, 0, movie_speedup_r);
}
diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c
index 5f8a9777c44..d2b662e2680 100644
--- a/src/mame/drivers/btime.c
+++ b/src/mame/drivers/btime.c
@@ -1753,7 +1753,7 @@ static DRIVER_INIT( cookrace )
static DRIVER_INIT( wtennis )
{
memcpy(&audio_rambase[0x200], memory_region(REGION_CPU2) + 0xf200, 0x200);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc15f, 0xc15f, 0, 0, wtennis_reset_hack_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc15f, 0xc15f, 0, 0, wtennis_reset_hack_r);
decrypt_C10707_cpu(0, REGION_CPU1);
}
diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c
index 74c2a850ce2..b07e26a80c4 100644
--- a/src/mame/drivers/bublbobl.c
+++ b/src/mame/drivers/bublbobl.c
@@ -1336,7 +1336,7 @@ static DRIVER_INIT( tokio )
static DRIVER_INIT( tokiob )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe00, 0xfe00, 0, 0, tokiob_mcu_r );
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe00, 0xfe00, 0, 0, tokiob_mcu_r );
DRIVER_INIT_CALL(tokio);
}
diff --git a/src/mame/drivers/bzone.c b/src/mame/drivers/bzone.c
index ab6a97cf64f..a87c2a8d52b 100644
--- a/src/mame/drivers/bzone.c
+++ b/src/mame/drivers/bzone.c
@@ -813,13 +813,13 @@ static WRITE8_HANDLER( analog_select_w )
static DRIVER_INIT( bradley )
{
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x400, 0x7ff, 0, 0, SMH_BANK1, SMH_BANK1);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400, 0x7ff, 0, 0, SMH_BANK1, SMH_BANK1);
memory_set_bankptr(1, auto_malloc(0x400));
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1808, 0x1808, 0, 0, input_port_4_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1809, 0x1809, 0, 0, input_port_5_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x180a, 0x180a, 0, 0, analog_data_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1848, 0x1850, 0, 0, analog_select_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1808, 0x1808, 0, 0, input_port_4_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1809, 0x1809, 0, 0, input_port_5_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x180a, 0x180a, 0, 0, analog_data_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1848, 0x1850, 0, 0, analog_select_w);
}
diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c
index 4c879a78a7c..103df4b222e 100644
--- a/src/mame/drivers/cave.c
+++ b/src/mame/drivers/cave.c
@@ -4109,7 +4109,7 @@ static DRIVER_INIT( agallet )
unpack_sprites();
// Speed Hack
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb80000, 0xb80001, 0, 0, agallet_irq_cause_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb80000, 0xb80001, 0, 0, agallet_irq_cause_r);
}
static DRIVER_INIT( dfeveron )
diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c
index ebb1198b123..1a49b28e3a4 100644
--- a/src/mame/drivers/centiped.c
+++ b/src/mame/drivers/centiped.c
@@ -1971,17 +1971,15 @@ ROM_END
static DRIVER_INIT( caterplr )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x100f, 0, 0, caterplr_AY8910_w);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x100f, 0, 0, caterplr_AY8910_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1780, 0x1780, 0, 0, caterplr_rand_r);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x100f, 0, 0, caterplr_AY8910_r, caterplr_AY8910_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1780, 0x1780, 0, 0, caterplr_rand_r);
}
static DRIVER_INIT( magworm )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1001, 0x1001, 0, 0, AY8910_control_port_0_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1003, 0x1003, 0, 0, AY8910_write_port_0_w);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1003, 0x1003, 0, 0, AY8910_read_port_0_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1001, 0x1001, 0, 0, AY8910_control_port_0_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1003, 0x1003, 0, 0, AY8910_read_port_0_r, AY8910_write_port_0_w);
}
diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c
index b7af160a21d..a8bcdc1784a 100644
--- a/src/mame/drivers/chqflag.c
+++ b/src/mame/drivers/chqflag.c
@@ -51,18 +51,18 @@ static WRITE8_HANDLER( chqflag_bankswitch_w )
/* bit 5 = memory bank select */
if (data & 0x20)
{
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, SMH_BANK5, paletteram_xBBBBBGGGGGRRRRR_be_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, SMH_BANK5, paletteram_xBBBBBGGGGGRRRRR_be_w);
memory_set_bankptr(5, paletteram);
if (K051316_readroms)
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_rom_0_r, K051316_0_w); /* 051316 #1 (ROM test) */
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_rom_0_r, K051316_0_w); /* 051316 #1 (ROM test) */
else
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_0_r, K051316_0_w); /* 051316 #1 */
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_0_r, K051316_0_w); /* 051316 #1 */
}
else
{
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, SMH_BANK1, SMH_BANK1); /* RAM */
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, SMH_BANK2, SMH_BANK2); /* RAM */
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, SMH_BANK1, SMH_BANK1); /* RAM */
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, SMH_BANK2, SMH_BANK2); /* RAM */
}
/* other bits unknown/unused */
@@ -78,10 +78,10 @@ static WRITE8_HANDLER( chqflag_vreg_w )
/* bit 4 = enable rom reading thru K051316 #1 & #2 */
if ((K051316_readroms = (data & 0x10))){
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2fff, 0, 0, K051316_rom_1_r); /* 051316 (ROM test) */
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2fff, 0, 0, K051316_rom_1_r); /* 051316 (ROM test) */
}
else{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2fff, 0, 0, K051316_1_r); /* 051316 */
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2fff, 0, 0, K051316_1_r); /* 051316 */
}
/* Bits 3-7 probably control palette dimming in a similar way to TMNT2/Saunset Riders, */
diff --git a/src/mame/drivers/cinemat.c b/src/mame/drivers/cinemat.c
index 2434958f60b..3952cdbefb4 100644
--- a/src/mame/drivers/cinemat.c
+++ b/src/mame/drivers/cinemat.c
@@ -1441,34 +1441,34 @@ ROM_END
static DRIVER_INIT( speedfrk )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, speedfrk_wheel_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x04, 0x06, 0, 0, speedfrk_gear_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, speedfrk_wheel_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x06, 0, 0, speedfrk_gear_r);
}
static DRIVER_INIT( sundance )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x0f, 0, 0, sundance_inputs_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x0f, 0, 0, sundance_inputs_r);
}
static DRIVER_INIT( tailg )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, mux_select_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, mux_select_w);
}
static DRIVER_INIT( boxingb )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, boxingb_dial_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, mux_select_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, boxingb_dial_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, mux_select_w);
}
static DRIVER_INIT( qb3 )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, qb3_frame_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0, qb3_ram_bank_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, qb3_frame_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0, qb3_ram_bank_w);
memory_configure_bank(1, 0, 4, rambase, 0x100*2);
}
diff --git a/src/mame/drivers/cischeat.c b/src/mame/drivers/cischeat.c
index 265b5f6c55a..e312b37004c 100644
--- a/src/mame/drivers/cischeat.c
+++ b/src/mame/drivers/cischeat.c
@@ -2690,7 +2690,7 @@ ROM_END
static DRIVER_INIT( wildplt )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x080000, 0x087fff, 0, 0, wildplt_vregs_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x080000, 0x087fff, 0, 0, wildplt_vregs_r );
DRIVER_INIT_CALL(f1gpstar);
}
diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c
index e782eac0495..0a5c92e8995 100644
--- a/src/mame/drivers/cninja.c
+++ b/src/mame/drivers/cninja.c
@@ -1778,13 +1778,13 @@ static void cninja_patch(void)
static DRIVER_INIT( cninja )
{
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1bc0a8, 0x1bc0a9, 0, 0, cninja_sound_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1bc0a8, 0x1bc0a9, 0, 0, cninja_sound_w);
cninja_patch();
}
static DRIVER_INIT( stoneage )
{
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x1bc0a8, 0x1bc0a9, 0, 0, stoneage_sound_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1bc0a8, 0x1bc0a9, 0, 0, stoneage_sound_w);
}
static DRIVER_INIT( mutantf )
diff --git a/src/mame/drivers/cojag.c b/src/mame/drivers/cojag.c
index f0ed93c4985..3531a396c99 100644
--- a/src/mame/drivers/cojag.c
+++ b/src/mame/drivers/cojag.c
@@ -209,11 +209,6 @@ static UINT8 eeprom_enable;
static UINT32 *rom_base;
-static const struct ide_interface ide_intf =
-{
- jaguar_external_int
-};
-
/*************************************
@@ -259,7 +254,7 @@ static MACHINE_RESET( cojag )
cojag_sound_reset();
/* reset the IDE controller */
- ide_controller_reset(0);
+ devtag_reset(machine, IDE_CONTROLLER, "ide");
}
@@ -360,6 +355,8 @@ static READ32_HANDLER( jaguar_wave_rom_r )
return jaguar_wave_rom[offset];
}
+
+
/*************************************
*
* Input ports
@@ -692,7 +689,7 @@ static ADDRESS_MAP_START( r3000_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x04000000, 0x047fffff) AM_RAM AM_BASE(&jaguar_shared_ram) AM_SHARE(1)
AM_RANGE(0x04800000, 0x04bfffff) AM_ROMBANK(1)
AM_RANGE(0x04c00000, 0x04dfffff) AM_ROMBANK(2)
- AM_RANGE(0x04e00000, 0x04e003ff) AM_READWRITE(ide_controller32_0_r, ide_controller32_0_w)
+ AM_RANGE(0x04e00000, 0x04e003ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_controller32_r, ide_controller32_w)
AM_RANGE(0x04f00000, 0x04f003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
AM_RANGE(0x04f00400, 0x04f007ff) AM_RAM AM_BASE(&jaguar_gpu_clut) AM_SHARE(2)
AM_RANGE(0x04f02100, 0x04f021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w)
@@ -726,7 +723,7 @@ static ADDRESS_MAP_START( m68020_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0xa40000, 0xa40003) AM_WRITE(eeprom_enable_w)
AM_RANGE(0xb70000, 0xb70003) AM_READWRITE(misc_control_r, misc_control_w)
AM_RANGE(0xc00000, 0xdfffff) AM_ROMBANK(2)
- AM_RANGE(0xe00000, 0xe003ff) AM_READWRITE(ide_controller32_0_r, ide_controller32_0_w)
+ AM_RANGE(0xe00000, 0xe003ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_controller32_r, ide_controller32_w)
AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_BASE(&jaguar_gpu_clut) AM_SHARE(2)
AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w)
@@ -754,7 +751,7 @@ static ADDRESS_MAP_START( gpu_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x000000, 0x7fffff) AM_RAM AM_SHARE(1)
AM_RANGE(0x800000, 0xbfffff) AM_ROMBANK(8)
AM_RANGE(0xc00000, 0xdfffff) AM_ROMBANK(9)
- AM_RANGE(0xe00000, 0xe003ff) AM_READWRITE(ide_controller32_0_r, ide_controller32_0_w)
+ AM_RANGE(0xe00000, 0xe003ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_controller32_r, ide_controller32_w)
AM_RANGE(0xf00000, 0xf003ff) AM_READWRITE(jaguar_tom_regs32_r, jaguar_tom_regs32_w)
AM_RANGE(0xf00400, 0xf007ff) AM_RAM AM_SHARE(2)
AM_RANGE(0xf02100, 0xf021ff) AM_READWRITE(gpuctrl_r, gpuctrl_w)
@@ -1006,6 +1003,8 @@ static MACHINE_DRIVER_START( cojagr3k )
MDRV_MACHINE_RESET(cojag)
MDRV_NVRAM_HANDLER(generic_1fill)
+
+ MDRV_IDE_CONTROLLER_ADD("ide", 0, jaguar_external_int)
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
@@ -1391,18 +1390,15 @@ static void cojag_common_init(running_machine *machine, UINT16 gpu_jump_offs, UI
/* install synchronization hooks for GPU */
if (cojag_is_r3000)
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x04f0b000 + gpu_jump_offs, 0x04f0b003 + gpu_jump_offs, 0, 0, gpu_jump_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x04f0b000 + gpu_jump_offs, 0x04f0b003 + gpu_jump_offs, 0, 0, gpu_jump_w);
else
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, 0, 0, gpu_jump_w);
- memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, 0, 0, gpu_jump_r);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, 0, 0, gpu_jump_w);
+ memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, 0, 0, gpu_jump_r);
gpu_jump_address = &jaguar_gpu_ram[gpu_jump_offs/4];
gpu_spin_pc = 0xf03000 + spin_pc;
/* init the sound system and install DSP speedups */
- cojag_sound_init();
-
- /* spin up the hard disk */
- ide_controller_init(0, &ide_intf);
+ cojag_sound_init(machine);
}
@@ -1412,7 +1408,7 @@ static DRIVER_INIT( area51a )
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
- main_speedup = memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xa02030, 0xa02033, 0, 0, area51_main_speedup_w);
+ main_speedup = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa02030, 0xa02033, 0, 0, area51_main_speedup_w);
#endif
}
@@ -1424,7 +1420,7 @@ static DRIVER_INIT( area51 )
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
main_speedup_max_cycles = 120;
- main_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x100062e8, 0x100062eb, 0, 0, cojagr3k_main_speedup_r);
+ main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100062e8, 0x100062eb, 0, 0, cojagr3k_main_speedup_r);
#endif
}
@@ -1438,7 +1434,7 @@ static DRIVER_INIT( maxforce )
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
main_speedup_max_cycles = 120;
- main_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000865c, 0x1000865f, 0, 0, cojagr3k_main_speedup_r);
+ main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000865c, 0x1000865f, 0, 0, cojagr3k_main_speedup_r);
#endif
}
@@ -1452,7 +1448,7 @@ static DRIVER_INIT( area51mx )
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
- main_speedup = memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xa19550, 0xa19557, 0, 0, area51mx_main_speedup_w);
+ main_speedup = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa19550, 0xa19557, 0, 0, area51mx_main_speedup_w);
#endif
}
@@ -1467,7 +1463,7 @@ static DRIVER_INIT( a51mxr3k )
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
main_speedup_max_cycles = 120;
- main_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x10006f0c, 0x10006f0f, 0, 0, cojagr3k_main_speedup_r);
+ main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x10006f0c, 0x10006f0f, 0, 0, cojagr3k_main_speedup_r);
#endif
}
@@ -1479,7 +1475,7 @@ static DRIVER_INIT( fishfren )
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
main_speedup_max_cycles = 200;
- main_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x10021b60, 0x10021b63, 0, 0, cojagr3k_main_speedup_r);
+ main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x10021b60, 0x10021b63, 0, 0, cojagr3k_main_speedup_r);
#endif
}
@@ -1492,8 +1488,8 @@ static void init_freeze_common(running_machine *machine, offs_t main_speedup_add
/* install speedup for main CPU */
main_speedup_max_cycles = 200;
if (main_speedup_addr != 0)
- main_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, main_speedup_addr, main_speedup_addr + 3, 0, 0, cojagr3k_main_speedup_r);
- main_gpu_wait = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0400d900, 0x0400d900 + 3, 0, 0, main_gpu_wait_r);
+ main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, main_speedup_addr, main_speedup_addr + 3, 0, 0, cojagr3k_main_speedup_r);
+ main_gpu_wait = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0400d900, 0x0400d900 + 3, 0, 0, main_gpu_wait_r);
#endif
}
@@ -1512,7 +1508,7 @@ static DRIVER_INIT( vcircle )
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
main_speedup_max_cycles = 50;
- main_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x12005b34, 0x12005b37, 0, 0, cojagr3k_main_speedup_r);
+ main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x12005b34, 0x12005b37, 0, 0, cojagr3k_main_speedup_r);
#endif
}
diff --git a/src/mame/drivers/combatsc.c b/src/mame/drivers/combatsc.c
index 2f88d68b471..1f39a8ea2f1 100644
--- a/src/mame/drivers/combatsc.c
+++ b/src/mame/drivers/combatsc.c
@@ -916,7 +916,7 @@ static DRIVER_INIT( combasct )
static DRIVER_INIT( combasc )
{
/* joystick instead of trackball */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0404, 0x0404, 0, 0, input_port_4_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0404, 0x0404, 0, 0, input_port_4_r);
combasc_init_common();
}
diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c
index 9c19d0f89b6..1d7c61cd620 100644
--- a/src/mame/drivers/coolpool.c
+++ b/src/mame/drivers/coolpool.c
@@ -935,7 +935,7 @@ ROM_END
static DRIVER_INIT( coolpool )
{
- memory_install_read16_handler(1, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, coolpool_input_r);
+ memory_install_read16_handler(machine, 1, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, coolpool_input_r);
}
diff --git a/src/mame/drivers/cosmic.c b/src/mame/drivers/cosmic.c
index 2fab682e1db..f6d3c627ac4 100644
--- a/src/mame/drivers/cosmic.c
+++ b/src/mame/drivers/cosmic.c
@@ -1478,16 +1478,16 @@ static DRIVER_INIT( cosmicg )
static DRIVER_INIT( devzone )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4807, 0x4807, 0, 0, cosmic_background_enable_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4807, 0x4807, 0, 0, cosmic_background_enable_w);
}
static DRIVER_INIT( nomnlnd )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5001, 0, 0, nomnlnd_port_0_1_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4800, 0, 0, SMH_NOP);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4807, 0x4807, 0, 0, cosmic_background_enable_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x480a, 0x480a, 0, 0, DAC_0_data_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5001, 0, 0, nomnlnd_port_0_1_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4800, 0, 0, SMH_NOP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4807, 0x4807, 0, 0, cosmic_background_enable_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x480a, 0x480a, 0, 0, DAC_0_data_w);
}
diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c
index 8d95a18f389..03e6f7079fd 100644
--- a/src/mame/drivers/cps1.c
+++ b/src/mame/drivers/cps1.c
@@ -7279,7 +7279,7 @@ static DRIVER_INIT( slammast )
static DRIVER_INIT( pang3 )
{
/* Pang 3 EEPROM interface is at a different address */
- memory_install_readwrite16_handler (0, ADDRESS_SPACE_PROGRAM, 0x80017a, 0x80017b, 0, 0, cps1_eeprom_port_r, cps1_eeprom_port_w);
+ memory_install_readwrite16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x80017a, 0x80017b, 0, 0, cps1_eeprom_port_r, cps1_eeprom_port_w);
DRIVER_INIT_CALL(cps1);
}
diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c
index ebf4416ccdf..cc770330eec 100644
--- a/src/mame/drivers/cps2.c
+++ b/src/mame/drivers/cps2.c
@@ -7155,7 +7155,7 @@ static DRIVER_INIT( ssf2tb )
static DRIVER_INIT ( pzloop2 )
{
DRIVER_INIT_CALL(cps2);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x804000, 0x804001, 0, 0, joy_or_paddle_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x804000, 0x804001, 0, 0, joy_or_paddle_r);
}
diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c
index 91c551083b4..ae044d77633 100644
--- a/src/mame/drivers/cps3.c
+++ b/src/mame/drivers/cps3.c
@@ -3045,7 +3045,7 @@ static DRIVER_INIT( cps3_speedups )
//printf("speedup %08x %08x\n",cps3_speedup_ram_address,cps3_speedup_code_address);
- if (cps3_speedup_code_address!=0) memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, cps3_speedup_ram_address+0x02000000, cps3_speedup_ram_address+0x02000003, 0, 0, cps3_speedup_r );
+ if (cps3_speedup_code_address!=0) memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, cps3_speedup_ram_address+0x02000000, cps3_speedup_ram_address+0x02000003, 0, 0, cps3_speedup_r );
}
diff --git a/src/mame/drivers/crgolf.c b/src/mame/drivers/crgolf.c
index 8be7c9859ca..c85fa4ef061 100644
--- a/src/mame/drivers/crgolf.c
+++ b/src/mame/drivers/crgolf.c
@@ -576,7 +576,7 @@ ROM_END
static DRIVER_INIT( crgolfhi )
{
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa003, 0, 0, crgolfhi_sample_w);
+ memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa003, 0, 0, crgolfhi_sample_w);
}
diff --git a/src/mame/drivers/crimfght.c b/src/mame/drivers/crimfght.c
index 0f47da279e3..8f8ae970da7 100644
--- a/src/mame/drivers/crimfght.c
+++ b/src/mame/drivers/crimfght.c
@@ -495,11 +495,11 @@ static void crimfght_banking( int lines )
/* bit 5 = select work RAM or palette */
if (lines & 0x20)
{
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, SMH_BANK3, paletteram_xBBBBBGGGGGRRRRR_be_w);
+ memory_install_readwrite8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, SMH_BANK3, paletteram_xBBBBBGGGGGRRRRR_be_w);
memory_set_bankptr(3, paletteram);
}
else
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, SMH_BANK1, SMH_BANK1); /* RAM */
+ memory_install_readwrite8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, SMH_BANK1, SMH_BANK1); /* RAM */
/* bit 6 = enable char ROM reading through the video RAM */
K052109_set_RMRD_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE);
diff --git a/src/mame/drivers/cubocd32.c b/src/mame/drivers/cubocd32.c
index 5c4be096eb3..7f28a442d03 100644
--- a/src/mame/drivers/cubocd32.c
+++ b/src/mame/drivers/cubocd32.c
@@ -46,31 +46,10 @@
#include "driver.h"
#include "deprecat.h"
-#include "memconv.h"
#include "sound/custom.h"
#include "includes/amiga.h"
#include "includes/cubocd32.h"
-static READ32_HANDLER( amiga_cia32_r )
-{
- return read32be_with_16be_handler(amiga_cia_r, machine, offset, mem_mask);
-}
-
-static WRITE32_HANDLER( amiga_cia32_w )
-{
- write32be_with_16be_handler(amiga_cia_w, machine, offset, data, mem_mask);
-}
-
-static READ32_HANDLER( amiga_custom32_r )
-{
- return read32be_with_16be_handler(amiga_custom_r, machine, offset, mem_mask);
-}
-
-static WRITE32_HANDLER( amiga_custom32_w )
-{
- write32be_with_16be_handler(amiga_custom_w, machine, offset, data, mem_mask);
-}
-
static WRITE32_HANDLER( aga_overlay_w )
{
if (ACCESSING_BITS_16_23)
@@ -83,10 +62,10 @@ static WRITE32_HANDLER( aga_overlay_w )
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
/* overlay disabled, map RAM on 0x000000 */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, SMH_BANK1);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, SMH_BANK1);
else
/* overlay enabled, map Amiga system ROM on 0x000000 */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, SMH_UNMAP);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, SMH_UNMAP);
}
}
@@ -158,8 +137,8 @@ static ADDRESS_MAP_START( cd32_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x800000, 0x800003) AM_READ( dipswitch_r )
AM_RANGE(0xb80000, 0xb8003f) AM_READWRITE(amiga_akiko32_r, amiga_akiko32_w)
AM_RANGE(0xbfa000, 0xbfa003) AM_WRITE(aga_overlay_w)
- AM_RANGE(0xbfd000, 0xbfefff) AM_READWRITE(amiga_cia32_r, amiga_cia32_w)
- AM_RANGE(0xc00000, 0xdfffff) AM_READWRITE(amiga_custom32_r, amiga_custom32_w) AM_BASE((UINT32**)&amiga_custom_regs)
+ AM_RANGE(0xbfd000, 0xbfefff) AM_READWRITE16(amiga_cia_r, amiga_cia_w, 0xffffffff)
+ AM_RANGE(0xc00000, 0xdfffff) AM_READWRITE16(amiga_custom_r, amiga_custom_w, 0xffffffff) AM_BASE((UINT32**)&amiga_custom_regs)
AM_RANGE(0xe00000, 0xe7ffff) AM_ROM AM_REGION(REGION_USER1, 0x80000) /* CD32 Extended ROM */
AM_RANGE(0xa00000, 0xf7ffff) AM_NOP
AM_RANGE(0xf80000, 0xffffff) AM_ROM AM_REGION(REGION_USER1, 0x0) /* Kickstart */
diff --git a/src/mame/drivers/dassault.c b/src/mame/drivers/dassault.c
index f7a546c416b..923d96cafd9 100644
--- a/src/mame/drivers/dassault.c
+++ b/src/mame/drivers/dassault.c
@@ -846,7 +846,7 @@ static DRIVER_INIT( dassault )
free(tmp);
/* Save time waiting on vblank bit */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3f8000, 0x3f8001, 0, 0, dassault_main_skip);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3f8000, 0x3f8001, 0, 0, dassault_main_skip);
}
static DRIVER_INIT( thndzone )
@@ -866,7 +866,7 @@ static DRIVER_INIT( thndzone )
free(tmp);
/* Save time waiting on vblank bit */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3f8000, 0x3f8001, 0, 0, thndzone_main_skip);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3f8000, 0x3f8001, 0, 0, thndzone_main_skip);
}
/**********************************************************************************/
diff --git a/src/mame/drivers/ddealer.c b/src/mame/drivers/ddealer.c
index 595531a7ff5..4958883f646 100644
--- a/src/mame/drivers/ddealer.c
+++ b/src/mame/drivers/ddealer.c
@@ -250,8 +250,8 @@ static WRITE16_HANDLER( ddealer_mcu_w )
static DRIVER_INIT( ddealer )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe01c, 0xfe01d, 0, 0, ddealer_mcu_r );
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe01e, 0xfe01f, 0, 0, ddealer_mcu_w );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe01c, 0xfe01d, 0, 0, ddealer_mcu_r );
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe01e, 0xfe01f, 0, 0, ddealer_mcu_w );
}
ROM_START( ddealer )
diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c
index 007a9e8ddb8..1c86596f337 100644
--- a/src/mame/drivers/ddenlovr.c
+++ b/src/mame/drivers/ddenlovr.c
@@ -7530,7 +7530,7 @@ static DRIVER_INIT( rongrong )
version of the game might be a bootleg with the protection
patched. (both sets need this)
*/
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x60d4, 0x60d4, 0, 0, SMH_NOP);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60d4, 0x60d4, 0, 0, SMH_NOP);
}
/***************************************************************************
diff --git a/src/mame/drivers/ddragon.c b/src/mame/drivers/ddragon.c
index e6be65f3140..a2b42adb2e3 100644
--- a/src/mame/drivers/ddragon.c
+++ b/src/mame/drivers/ddragon.c
@@ -295,9 +295,9 @@ static WRITE8_HANDLER( darktowr_bankswitch_w )
memory_set_bank(1, newbank);
if (newbank == 4 && oldbank != 4)
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, darktowr_mcu_bank_r, darktowr_mcu_bank_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, darktowr_mcu_bank_r, darktowr_mcu_bank_w);
else if (newbank != 4 && oldbank == 4)
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
}
@@ -1815,7 +1815,7 @@ static DRIVER_INIT( darktowr )
sound_irq = M6809_IRQ_LINE;
ym_irq = M6809_FIRQ_LINE;
technos_video_hw = 0;
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3808, 0x3808, 0, 0, darktowr_bankswitch_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3808, 0x3808, 0, 0, darktowr_bankswitch_w);
}
@@ -1827,7 +1827,7 @@ static DRIVER_INIT( toffy )
sound_irq = M6809_IRQ_LINE;
ym_irq = M6809_FIRQ_LINE;
technos_video_hw = 0;
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3808, 0x3808, 0, 0, toffy_bankswitch_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3808, 0x3808, 0, 0, toffy_bankswitch_w);
/* the program rom has a simple bitswap encryption */
rom = memory_region(REGION_CPU1);
diff --git a/src/mame/drivers/deadang.c b/src/mame/drivers/deadang.c
index cd677b4b393..80b125bf702 100644
--- a/src/mame/drivers/deadang.c
+++ b/src/mame/drivers/deadang.c
@@ -462,8 +462,8 @@ static DRIVER_INIT( ghunter )
seibu_sound_decrypt(REGION_CPU3, 0x2000);
seibu_adpcm_decrypt(REGION_SOUND1);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80000, 0x80001, 0, 0, ghunter_trackball_low_r);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0001, 0, 0, ghunter_trackball_high_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80000, 0x80001, 0, 0, ghunter_trackball_low_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0001, 0, 0, ghunter_trackball_high_r);
}
/* Game Drivers */
diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c
index 0d1fc4d1fde..2b428e6f213 100644
--- a/src/mame/drivers/deco_mlc.c
+++ b/src/mame/drivers/deco_mlc.c
@@ -725,7 +725,7 @@ static READ32_HANDLER( avengrgs_speedup_r )
static DRIVER_INIT( avengrgs )
{
mainCpuIsArm=0;
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01089a0, 0x01089a3, 0, 0, avengrgs_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01089a0, 0x01089a3, 0, 0, avengrgs_speedup_r );
descramble_sound();
}
diff --git a/src/mame/drivers/decocass.c b/src/mame/drivers/decocass.c
index f84e277d50c..854d1e0d584 100644
--- a/src/mame/drivers/decocass.c
+++ b/src/mame/drivers/decocass.c
@@ -1138,8 +1138,7 @@ static DRIVER_INIT( decocrom )
decrypted2[i] = swap_bits_5_6(rom[i]);
/* convert charram to a banked ROM */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0xafff, 0, 0, SMH_BANK1);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0xafff, 0, 0, decocass_de0091_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0xafff, 0, 0, SMH_BANK1, decocass_de0091_w);
memory_configure_bank(1, 0, 1, decocass_charram, 0);
memory_configure_bank(1, 1, 1, memory_region(REGION_USER3), 0);
memory_configure_bank_decrypted(1, 0, 1, &decrypted[0x6000], 0);
@@ -1147,7 +1146,7 @@ static DRIVER_INIT( decocrom )
memory_set_bank(1, 0);
/* install the bank selector */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe900, 0xe900, 0, 0, decocass_e900_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe900, 0xe900, 0, 0, decocass_e900_w);
}
diff --git a/src/mame/drivers/dgpix.c b/src/mame/drivers/dgpix.c
index 04ec40c6b76..5c2ab89d382 100644
--- a/src/mame/drivers/dgpix.c
+++ b/src/mame/drivers/dgpix.c
@@ -559,7 +559,7 @@ static DRIVER_INIT( xfiles )
rom[BYTE4_XOR_BE(0x3aa933)] = 0;
// protection related ?
-// memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0c8b440, 0xf0c8b447, 0, 0, SMH_NOP );
+// memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c8b440, 0xf0c8b447, 0, 0, SMH_NOP );
flash_roms = 2;
}
@@ -579,7 +579,7 @@ static DRIVER_INIT( kdynastg )
rom[BYTE4_XOR_BE(0x3a45c9)] = 0;
// protection related ?
-// memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x12341234, 0x12341243, 0, 0, SMH_NOP );
+// memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x12341234, 0x12341243, 0, 0, SMH_NOP );
flash_roms = 4;
}
diff --git a/src/mame/drivers/djmain.c b/src/mame/drivers/djmain.c
index 8926ec56930..b645a3aec3e 100644
--- a/src/mame/drivers/djmain.c
+++ b/src/mame/drivers/djmain.c
@@ -62,6 +62,9 @@ static UINT8 pending_vb_int;
static UINT16 v_ctrl;
static UINT32 obj_regs[0xa0/4];
+static const UINT8 *ide_user_password;
+static const UINT8 *ide_master_password;
+
#define DISABLE_VB_INT (!(v_ctrl & 0x8000))
@@ -304,35 +307,35 @@ static WRITE32_HANDLER( turntable_select_w )
#define IDE_STD_OFFSET (0x1f0/2)
#define IDE_ALT_OFFSET (0x3f6/2)
-static READ32_HANDLER( ide_std_r )
+static READ32_DEVICE_HANDLER( ide_std_r )
{
if (ACCESSING_BITS_0_7)
- return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset, 0x00ff) >> 8;
+ return ide_controller16_r(device, IDE_STD_OFFSET + offset, 0x00ff) >> 8;
else
- return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset, 0x0000) << 16;
+ return ide_controller16_r(device, IDE_STD_OFFSET + offset, 0x0000) << 16;
}
-static WRITE32_HANDLER( ide_std_w )
+static WRITE32_DEVICE_HANDLER( ide_std_w )
{
if (ACCESSING_BITS_0_7)
- ide_controller16_0_w(machine, IDE_STD_OFFSET + offset, data << 8, 0x00ff);
+ ide_controller16_w(device, IDE_STD_OFFSET + offset, data << 8, 0x00ff);
else
- ide_controller16_0_w(machine, IDE_STD_OFFSET + offset, data >> 16, 0x0000);
+ ide_controller16_w(device, IDE_STD_OFFSET + offset, data >> 16, 0x0000);
}
-static READ32_HANDLER( ide_alt_r )
+static READ32_DEVICE_HANDLER( ide_alt_r )
{
if (offset == 0)
- return ide_controller16_0_r(machine, IDE_ALT_OFFSET, 0xff00) << 24;
+ return ide_controller16_r(device, IDE_ALT_OFFSET, 0xff00) << 24;
return 0;
}
-static WRITE32_HANDLER( ide_alt_w )
+static WRITE32_DEVICE_HANDLER( ide_alt_w )
{
if (offset == 0 && ACCESSING_BITS_16_23)
- ide_controller16_0_w(machine, IDE_ALT_OFFSET, data >> 24, 0xff00);
+ ide_controller16_w(device, IDE_ALT_OFFSET, data >> 24, 0xff00);
}
@@ -435,17 +438,17 @@ static INTERRUPT_GEN( vb_interrupt )
}
-static void ide_interrupt(int state)
+static void ide_interrupt(const device_config *device, int state)
{
if (state != CLEAR_LINE)
{
//logerror("IDE interrupt asserted\n");
- cpunum_set_input_line(Machine, 0, MC68000_IRQ_1, HOLD_LINE);
+ cpunum_set_input_line(device->machine, 0, MC68000_IRQ_1, HOLD_LINE);
}
else
{
//logerror("IDE interrupt cleared\n");
- cpunum_set_input_line(Machine, 0, MC68000_IRQ_1, CLEAR_LINE);
+ cpunum_set_input_line(device->machine, 0, MC68000_IRQ_1, CLEAR_LINE);
}
}
@@ -482,11 +485,11 @@ static ADDRESS_MAP_START( memory_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x803800, 0x803fff) AM_READ(obj_rom_r) // OBJECT ROM readthrough (for POST)
AM_RANGE(0xc00000, 0xc01fff) AM_READWRITE(K056832_ram_long_r, K056832_ram_long_w) // VIDEO RAM (tilemap) (beatmania)
AM_RANGE(0xc02000, 0xc02047) AM_WRITE(unknownc02000_w) // ??
- AM_RANGE(0xd00000, 0xd0000f) AM_READWRITE(ide_std_r, ide_std_w) // IDE control regs (hiphopmania)
- AM_RANGE(0xd4000c, 0xd4000f) AM_READWRITE(ide_alt_r, ide_alt_w) // IDE status control reg (hiphopmania)
+ AM_RANGE(0xd00000, 0xd0000f) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_std_r, ide_std_w) // IDE control regs (hiphopmania)
+ AM_RANGE(0xd4000c, 0xd4000f) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_alt_r, ide_alt_w) // IDE status control reg (hiphopmania)
AM_RANGE(0xe00000, 0xe01fff) AM_READWRITE(K056832_ram_long_r, K056832_ram_long_w) // VIDEO RAM (tilemap) (hiphopmania)
- AM_RANGE(0xf00000, 0xf0000f) AM_READWRITE(ide_std_r, ide_std_w) // IDE control regs (beatmania)
- AM_RANGE(0xf4000c, 0xf4000f) AM_READWRITE(ide_alt_r, ide_alt_w) // IDE status control reg (beatmania)
+ AM_RANGE(0xf00000, 0xf0000f) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_std_r, ide_std_w) // IDE control regs (beatmania)
+ AM_RANGE(0xf4000c, 0xf4000f) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_alt_r, ide_alt_w) // IDE status control reg (beatmania)
ADDRESS_MAP_END
@@ -1153,19 +1156,6 @@ GFXDECODE_END
/*************************************
*
- * IDE interfaces
- *
- *************************************/
-
-static const struct ide_interface ide_intf =
-{
- ide_interrupt,
-};
-
-
-
-/*************************************
- *
* Sound interfaces
*
*************************************/
@@ -1190,8 +1180,14 @@ static STATE_POSTLOAD( djmain_postload )
static MACHINE_START( djmain )
{
+ const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide");
UINT8 *region = memory_region(REGION_SOUND1);
+ if (ide != NULL && ide_master_password != NULL)
+ ide_set_master_password(ide, ide_master_password);
+ if (ide != NULL && ide_user_password != NULL)
+ ide_set_user_password(ide, ide_user_password);
+
state_save_register_global(sndram_bank);
state_save_register_global_pointer(region, 0x80000 * 32);
state_save_register_global(pending_vb_int);
@@ -1209,7 +1205,7 @@ static MACHINE_RESET( djmain )
sndram_set_bank();
/* reset the IDE controller */
- ide_controller_reset(0);
+ devtag_reset(machine, IDE_CONTROLLER, "ide");
/* reset LEDs */
set_led_status(0, 1);
@@ -1236,6 +1232,8 @@ static MACHINE_DRIVER_START( djmain )
MDRV_MACHINE_START(djmain)
MDRV_MACHINE_RESET(djmain)
+
+ MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt)
/* video hardware */
MDRV_SCREEN_ADD("main", RASTER)
@@ -1733,12 +1731,10 @@ ROM_END
static DRIVER_INIT( beatmania )
{
- UINT8 *region;
-
- region = new_memory_region(machine, REGION_SOUND1, 0x80000 * 32, 0);
+ new_memory_region(machine, REGION_SOUND1, 0x80000 * 32, 0);
- /* spin up the hard disk */
- ide_controller_init(0, &ide_intf);
+ ide_master_password = NULL;
+ ide_user_password = NULL;
}
static const UINT8 beatmania_master_password[2 + 32] =
@@ -1763,8 +1759,8 @@ static DRIVER_INIT( hmcompmx )
DRIVER_INIT_CALL(beatmania);
- ide_set_master_password(0, beatmania_master_password);
- ide_set_user_password(0, hmcompmx_user_password);
+ ide_master_password = beatmania_master_password;
+ ide_user_password = hmcompmx_user_password;
}
static DRIVER_INIT( bm4thmix )
@@ -1780,7 +1776,7 @@ static DRIVER_INIT( bm4thmix )
DRIVER_INIT_CALL(beatmania);
- ide_set_user_password(0, bm4thmix_user_password);
+ ide_user_password = bm4thmix_user_password;
}
static DRIVER_INIT( bm5thmix )
@@ -1796,8 +1792,8 @@ static DRIVER_INIT( bm5thmix )
DRIVER_INIT_CALL(beatmania);
- ide_set_master_password(0, beatmania_master_password);
- ide_set_user_password(0, bm5thmix_user_password);
+ ide_master_password = beatmania_master_password;
+ ide_user_password = bm5thmix_user_password;
}
static DRIVER_INIT( bmclubmx )
@@ -1813,8 +1809,8 @@ static DRIVER_INIT( bmclubmx )
DRIVER_INIT_CALL(beatmania);
- ide_set_master_password(0, beatmania_master_password);
- ide_set_user_password(0, bmclubmx_user_password);
+ ide_master_password = beatmania_master_password;
+ ide_user_password = bmclubmx_user_password;
}
@@ -1831,8 +1827,8 @@ static DRIVER_INIT( bmcompm2 )
DRIVER_INIT_CALL(beatmania);
- ide_set_master_password(0, beatmania_master_password);
- ide_set_user_password(0, bmcompm2_user_password);
+ ide_master_password = beatmania_master_password;
+ ide_user_password = bmcompm2_user_password;
}
static DRIVER_INIT( hmcompm2 )
@@ -1848,8 +1844,8 @@ static DRIVER_INIT( hmcompm2 )
DRIVER_INIT_CALL(beatmania);
- ide_set_master_password(0, beatmania_master_password);
- ide_set_user_password(0, hmcompm2_user_password);
+ ide_master_password = beatmania_master_password;
+ ide_user_password = hmcompm2_user_password;
}
static DRIVER_INIT( bmdct )
@@ -1865,8 +1861,8 @@ static DRIVER_INIT( bmdct )
DRIVER_INIT_CALL(beatmania);
- ide_set_master_password(0, beatmania_master_password);
- ide_set_user_password(0, bmdct_user_password);
+ ide_master_password = beatmania_master_password;
+ ide_user_password = bmdct_user_password;
}
static DRIVER_INIT( bmcorerm )
@@ -1882,8 +1878,8 @@ static DRIVER_INIT( bmcorerm )
DRIVER_INIT_CALL(beatmania);
- ide_set_master_password(0, beatmania_master_password);
- ide_set_user_password(0, bmcorerm_user_password);
+ ide_master_password = beatmania_master_password;
+ ide_user_password = bmcorerm_user_password;
}
static DRIVER_INIT( bm6thmix )
@@ -1899,8 +1895,8 @@ static DRIVER_INIT( bm6thmix )
DRIVER_INIT_CALL(beatmania);
- ide_set_master_password(0, beatmania_master_password);
- ide_set_user_password(0, bm6thmix_user_password);
+ ide_master_password = beatmania_master_password;
+ ide_user_password = bm6thmix_user_password;
}
static DRIVER_INIT( bm7thmix )
@@ -1916,8 +1912,8 @@ static DRIVER_INIT( bm7thmix )
DRIVER_INIT_CALL(beatmania);
- ide_set_master_password(0, beatmania_master_password);
- ide_set_user_password(0, bm7thmix_user_password);
+ ide_master_password = beatmania_master_password;
+ ide_user_password = bm7thmix_user_password;
}
#if 0
@@ -1934,8 +1930,8 @@ static DRIVER_INIT( bmfinal )
DRIVER_INIT_CALL(beatmania);
- ide_set_master_password(0, beatmania_master_password);
- ide_set_user_password(0, bmfinal_user_password);
+ ide_master_password = beatmania_master_password;
+ ide_user_password = bmfinal_user_password;
}
#endif
diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c
index b56d4d03c0d..ea32377872e 100644
--- a/src/mame/drivers/dynax.c
+++ b/src/mame/drivers/dynax.c
@@ -5437,7 +5437,7 @@ ROM_END
static DRIVER_INIT( mjreach )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x10060, 0x10060, 0, 0, yarunara_flipscreen_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x10060, 0x10060, 0, 0, yarunara_flipscreen_w);
}
/***************************************************************************
diff --git a/src/mame/drivers/eprom.c b/src/mame/drivers/eprom.c
index 265028f1b05..c90c39df646 100644
--- a/src/mame/drivers/eprom.c
+++ b/src/mame/drivers/eprom.c
@@ -733,10 +733,8 @@ static DRIVER_INIT( eprom )
atarijsa_init(machine, 1, 0x0002);
/* install CPU synchronization handlers */
- sync_data = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x16cc00, 0x16cc01, 0, 0, sync_r);
- sync_data = memory_install_read16_handler(1, ADDRESS_SPACE_PROGRAM, 0x16cc00, 0x16cc01, 0, 0, sync_r);
- sync_data = memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x16cc00, 0x16cc01, 0, 0, sync_w);
- sync_data = memory_install_write16_handler(1, ADDRESS_SPACE_PROGRAM, 0x16cc00, 0x16cc01, 0, 0, sync_w);
+ sync_data = memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x16cc00, 0x16cc01, 0, 0, sync_r, sync_w);
+ sync_data = memory_install_readwrite16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x16cc00, 0x16cc01, 0, 0, sync_r, sync_w);
}
diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c
index 3b1af337123..f8bed00cf38 100644
--- a/src/mame/drivers/equites.c
+++ b/src/mame/drivers/equites.c
@@ -1822,8 +1822,8 @@ static DRIVER_INIT( gekisou )
unpack_region(REGION_GFX3);
// install special handlers for unknown device (protection?)
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x580000, 0x580001, 0, 0, gekisou_unknown_0_w);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x5a0000, 0x5a0001, 0, 0, gekisou_unknown_1_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x580000, 0x580001, 0, 0, gekisou_unknown_0_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5a0000, 0x5a0001, 0, 0, gekisou_unknown_1_w);
}
static DRIVER_INIT( splndrbt )
@@ -1836,7 +1836,7 @@ static DRIVER_INIT( hvoltage )
unpack_region(REGION_GFX3);
#if HVOLTAGE_DEBUG
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000038, 0x000039, 0, 0, hvoltage_debug_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000038, 0x000039, 0, 0, hvoltage_debug_r);
#endif
}
diff --git a/src/mame/drivers/exidy.c b/src/mame/drivers/exidy.c
index 62ee3a6f5e7..b35732c76cd 100644
--- a/src/mame/drivers/exidy.c
+++ b/src/mame/drivers/exidy.c
@@ -1379,7 +1379,7 @@ static DRIVER_INIT( phantoma )
exidy_color_latch[0] = 0x09;
/* the ROM is actually mapped high */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xffff, 0, 0, SMH_BANK1);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xffff, 0, 0, SMH_BANK1);
memory_set_bankptr(1, memory_region(REGION_CPU1) + 0xf800);
}
diff --git a/src/mame/drivers/exidy440.c b/src/mame/drivers/exidy440.c
index 61a91a00031..a6380f99f34 100644
--- a/src/mame/drivers/exidy440.c
+++ b/src/mame/drivers/exidy440.c
@@ -302,15 +302,15 @@ static CUSTOM_INPUT( hitnmiss_button1_r )
*
*************************************/
-void exidy440_bank_select(UINT8 bank)
+void exidy440_bank_select(running_machine *machine, UINT8 bank)
{
/* for the showdown case, bank 0 is a PLD */
if (showdown_bank_data[0] != NULL)
{
if (bank == 0 && exidy440_bank != 0)
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, showdown_bank0_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, showdown_bank0_r);
else if (bank != 0 && exidy440_bank == 0)
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK1);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK1);
}
/* select the bank and update the bank pointer */
@@ -454,7 +454,7 @@ static WRITE8_HANDLER( topsecex_yscroll_w )
static MACHINE_RESET( exidy440 )
{
exidy440_bank = 0xff;
- exidy440_bank_select(0);
+ exidy440_bank_select(machine, 0);
}
@@ -1934,7 +1934,7 @@ static DRIVER_INIT( claypign )
{
DRIVER_INIT_CALL(exidy440);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec0, 0x2ec3, 0, 0, claypign_protection_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2ec0, 0x2ec3, 0, 0, claypign_protection_r);
}
@@ -1943,11 +1943,11 @@ static DRIVER_INIT( topsecex )
DRIVER_INIT_CALL(exidy440);
/* extra input ports and scrolling */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec5, 0x2ec5, 0, 0, topsecex_input_port_5_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec6, 0x2ec6, 0, 0, input_port_4_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec7, 0x2ec7, 0, 0, input_port_6_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2ec5, 0x2ec5, 0, 0, topsecex_input_port_5_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2ec6, 0x2ec6, 0, 0, input_port_4_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2ec7, 0x2ec7, 0, 0, input_port_6_r);
- topsecex_yscroll = memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ec1, 0x2ec1, 0, 0, topsecex_yscroll_w);
+ topsecex_yscroll = memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2ec1, 0x2ec1, 0, 0, topsecex_yscroll_w);
}
diff --git a/src/mame/drivers/exprraid.c b/src/mame/drivers/exprraid.c
index 99d6f3f9103..21cf1da7899 100644
--- a/src/mame/drivers/exprraid.c
+++ b/src/mame/drivers/exprraid.c
@@ -598,13 +598,13 @@ static DRIVER_INIT( exprraid )
static DRIVER_INIT( wexpresb )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3800, 0, 0, vblank_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3800, 0, 0, vblank_r);
exprraid_gfx_expand();
}
static DRIVER_INIT( wexpresc )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xFFC0, 0xFFC0, 0, 0, vblank_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xFFC0, 0xFFC0, 0, 0, vblank_r);
exprraid_gfx_expand();
}
diff --git a/src/mame/drivers/fastfred.c b/src/mame/drivers/fastfred.c
index 6adb06187cf..2dcc4d242fe 100644
--- a/src/mame/drivers/fastfred.c
+++ b/src/mame/drivers/fastfred.c
@@ -861,8 +861,8 @@ extern int fastfred_hardware_type;
static DRIVER_INIT( flyboy )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc085, 0xc099, 0, 0, flyboy_custom1_io_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc8fb, 0xc900, 0, 0, flyboy_custom2_io_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc085, 0xc099, 0, 0, flyboy_custom1_io_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc8fb, 0xc900, 0, 0, flyboy_custom2_io_r);
fastfred_hardware_type = 1;
}
@@ -873,22 +873,19 @@ static DRIVER_INIT( flyboyb )
static DRIVER_INIT( fastfred )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, SMH_NOP );
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, fastfred_custom_io_r);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, fastfred_custom_io_r, SMH_NOP);
fastfred_hardware_type = 1;
}
static DRIVER_INIT( jumpcoas )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, SMH_NOP );
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, jumpcoas_custom_io_r);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, jumpcoas_custom_io_r, SMH_NOP);
fastfred_hardware_type = 0;
}
static DRIVER_INIT( boggy84 )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, SMH_NOP );
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, jumpcoas_custom_io_r);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcfff, 0, 0, jumpcoas_custom_io_r, SMH_NOP);
fastfred_hardware_type = 2;
}
diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c
index 1ba9b143b93..b7c13cf4216 100644
--- a/src/mame/drivers/firebeat.c
+++ b/src/mame/drivers/firebeat.c
@@ -2239,15 +2239,15 @@ static void security_w(UINT8 data)
/*****************************************************************************/
-static void init_lights(write32_machine_func out1, write32_machine_func out2, write32_machine_func out3)
+static void init_lights(running_machine *machine, write32_machine_func out1, write32_machine_func out2, write32_machine_func out3)
{
if(!out1) out1 = lamp_output_w;
if(!out2) out1 = lamp_output2_w;
if(!out3) out1 = lamp_output3_w;
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x7d000804, 0x7d000807, 0, 0, out1);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x7d000320, 0x7d000323, 0, 0, out2);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x7d000324, 0x7d000327, 0, 0, out3);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7d000804, 0x7d000807, 0, 0, out1);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7d000320, 0x7d000323, 0, 0, out2);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7d000324, 0x7d000327, 0, 0, out3);
}
static void init_firebeat(running_machine *machine)
@@ -2273,19 +2273,19 @@ static void init_firebeat(running_machine *machine)
set_ibutton(rom);
- init_lights(NULL, NULL, NULL);
+ init_lights(machine, NULL, NULL, NULL);
}
static DRIVER_INIT(ppp)
{
init_firebeat(machine);
- init_lights(lamp_output_ppp_w, lamp_output2_ppp_w, lamp_output3_ppp_w);
+ init_lights(machine, lamp_output_ppp_w, lamp_output2_ppp_w, lamp_output3_ppp_w);
}
static DRIVER_INIT(ppd)
{
init_firebeat(machine);
- init_lights(lamp_output_ppp_w, lamp_output2_ppp_w, lamp_output3_ppp_w);
+ init_lights(machine, lamp_output_ppp_w, lamp_output2_ppp_w, lamp_output3_ppp_w);
cur_cab_data = ppd_cab_data;
}
@@ -2300,7 +2300,7 @@ static void init_keyboard(void)
static DRIVER_INIT(kbm)
{
init_firebeat(machine);
- init_lights(lamp_output_kbm_w, NULL, NULL);
+ init_lights(machine, lamp_output_kbm_w, NULL, NULL);
init_keyboard();
diff --git a/src/mame/drivers/fitfight.c b/src/mame/drivers/fitfight.c
index b494ee1cf00..e2896e97274 100644
--- a/src/mame/drivers/fitfight.c
+++ b/src/mame/drivers/fitfight.c
@@ -991,7 +991,7 @@ static DRIVER_INIT( fitfight )
{
// UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
// mem16[0x0165B2/2]=0x4e71; // for now so it boots
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x700000, 0x700001, 0, 0, fitfight_700000_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x700000, 0x700001, 0, 0, fitfight_700000_r);
bbprot_kludge = 0;
}
@@ -999,7 +999,7 @@ static DRIVER_INIT( histryma )
{
// UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
// mem16[0x017FDC/2]=0x4e71; // for now so it boots
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x700000, 0x700001, 0, 0, histryma_700000_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x700000, 0x700001, 0, 0, histryma_700000_r);
bbprot_kludge = 0;
}
diff --git a/src/mame/drivers/gaiden.c b/src/mame/drivers/gaiden.c
index 967c0c2b874..39f27dbdef4 100644
--- a/src/mame/drivers/gaiden.c
+++ b/src/mame/drivers/gaiden.c
@@ -1483,8 +1483,8 @@ static DRIVER_INIT( wildfang )
/* sprite size Y = sprite size X */
gaiden_sprite_sizey = 0;
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x07a006, 0x07a007, 0, 0, wildfang_protection_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x07a804, 0x07a805, 0, 0, wildfang_protection_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x07a006, 0x07a007, 0, 0, wildfang_protection_r);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x07a804, 0x07a805, 0, 0, wildfang_protection_w);
}
static DRIVER_INIT( raiga )
@@ -1492,8 +1492,8 @@ static DRIVER_INIT( raiga )
/* sprite size Y independent from sprite size X */
gaiden_sprite_sizey = 2;
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x07a006, 0x07a007, 0, 0, raiga_protection_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x07a804, 0x07a805, 0, 0, raiga_protection_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x07a006, 0x07a007, 0, 0, raiga_protection_r);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x07a804, 0x07a805, 0, 0, raiga_protection_w);
}
static DRIVER_INIT( drgnbowl )
diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c
index 8d21f687aa2..6652f9a01bd 100644
--- a/src/mame/drivers/galaga.c
+++ b/src/mame/drivers/galaga.c
@@ -3068,7 +3068,7 @@ static DRIVER_INIT (gatsbee)
DRIVER_INIT_CALL(galaga);
/* Gatsbee has a larger character ROM, we need a handler for banking */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1000, 0, 0, gatsbee_bank_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1000, 0, 0, gatsbee_bank_w);
}
@@ -3110,10 +3110,8 @@ static DRIVER_INIT( xevios )
static DRIVER_INIT( battles )
{
/* replace the Namco I/O handlers with interface to the 4th CPU */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x700f, 0, 0, battles_customio_data0_r );
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7100, 0x7100, 0, 0, battles_customio0_r );
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x700f, 0, 0, battles_customio_data0_w );
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7100, 0x7100, 0, 0, battles_customio0_w );
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x700f, 0, 0, battles_customio_data0_r, battles_customio_data0_w );
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7100, 0x7100, 0, 0, battles_customio0_r, battles_customio0_w );
DRIVER_INIT_CALL(xevious);
}
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index d1257b830d5..9095b5ec7d1 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -2097,11 +2097,11 @@ static void konami_common_init(
}
-static void unmap_galaxian_sound(offs_t base)
+static void unmap_galaxian_sound(running_machine *machine, offs_t base)
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, base + 0x0004, base + 0x0007, 0, 0x07f8, SMH_UNMAP);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, base + 0x0800, base + 0x0807, 0, 0x07f8, SMH_UNMAP);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, base + 0x1800, base + 0x1800, 0, 0x07ff, SMH_UNMAP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, base + 0x0004, base + 0x0007, 0, 0x07f8, SMH_UNMAP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, base + 0x0800, base + 0x0807, 0, 0x07f8, SMH_UNMAP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, base + 0x1800, base + 0x1800, 0, 0x07ff, SMH_UNMAP);
}
@@ -2124,7 +2124,7 @@ static DRIVER_INIT( nolock )
DRIVER_INIT_CALL(galaxian);
/* ...but coin lockout disabled/disconnected */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
}
@@ -2134,7 +2134,7 @@ static DRIVER_INIT( azurian )
common_init(machine, scramble_draw_bullet, galaxian_draw_background, NULL, NULL);
/* coin lockout disabled */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
}
@@ -2144,7 +2144,7 @@ static DRIVER_INIT( gmgalax )
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, gmgalax_extend_tile_info, gmgalax_extend_sprite_info);
/* ROM is banked */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
memory_configure_bank(1, 0, 2, memory_region(REGION_CPU1) + 0x10000, 0x4000);
/* callback when the game select is toggled */
@@ -2159,7 +2159,7 @@ static DRIVER_INIT( pisces )
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info);
/* coin lockout replaced by graphics bank */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, galaxian_gfxbank_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, galaxian_gfxbank_w);
}
@@ -2169,7 +2169,7 @@ static DRIVER_INIT( batman2 )
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
/* coin lockout replaced by graphics bank */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, galaxian_gfxbank_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, galaxian_gfxbank_w);
}
@@ -2179,7 +2179,7 @@ static DRIVER_INIT( frogg )
common_init(machine, galaxian_draw_bullet, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
/* ...but needs a full 2k of RAM */
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x47ff, 0, 0, SMH_BANK1, SMH_BANK1);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x47ff, 0, 0, SMH_BANK1, SMH_BANK1);
memory_set_bankptr(1, auto_malloc(0x800));
}
@@ -2214,7 +2214,7 @@ static DRIVER_INIT( mooncrgx )
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
/* LEDs and coin lockout replaced by graphics banking */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6002, 0, 0x7f8, galaxian_gfxbank_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6002, 0, 0x7f8, galaxian_gfxbank_w);
}
@@ -2237,7 +2237,7 @@ static DRIVER_INIT( pacmanbl )
DRIVER_INIT_CALL(galaxian);
/* ...but coin lockout disabled/disconnected */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
/* also shift the sprite clip offset */
galaxian_sprite_clip_start = 7;
@@ -2261,23 +2261,23 @@ static DRIVER_INIT( zigzag )
common_init(machine, NULL, galaxian_draw_background, NULL, NULL);
/* make ROMs 2 & 3 swappable */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_BANK1);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK2);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, 0, 0, SMH_BANK1);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, SMH_BANK2);
memory_configure_bank(1, 0, 2, memory_region(REGION_CPU1) + 0x2000, 0x1000);
memory_configure_bank(2, 0, 2, memory_region(REGION_CPU1) + 0x2000, 0x1000);
/* handler for doing the swaps */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7002, 0x7002, 0, 0x07f8, zigzag_bankswap_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7002, 0x7002, 0, 0x07f8, zigzag_bankswap_w);
zigzag_bankswap_w(machine, 0, 0);
/* coin lockout disabled */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
/* remove the galaxian sound hardware */
- unmap_galaxian_sound(0x6000);
+ unmap_galaxian_sound(machine, 0x6000);
/* install our AY-8910 handler */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4fff, 0, 0, zigzag_ay8910_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4fff, 0, 0, zigzag_ay8910_w);
}
@@ -2294,11 +2294,11 @@ static DRIVER_INIT( checkman )
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
/* move the interrupt enable from $b000 to $b001 */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w);
/* attach the sound command handler */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0xffff, checkman_sound_command_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0xffff, checkman_sound_command_w);
/* decrypt program code */
decode_checkman();
@@ -2311,10 +2311,10 @@ static DRIVER_INIT( checkmaj )
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
/* attach the sound command handler */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, checkman_sound_command_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, checkman_sound_command_w);
/* for the title screen */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3800, 0, 0, checkmaj_protection_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3800, 0, 0, checkmaj_protection_r);
}
@@ -2324,10 +2324,10 @@ static DRIVER_INIT( dingo )
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
/* attach the sound command handler */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, checkman_sound_command_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, checkman_sound_command_w);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, dingo_3000_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3035, 0x3035, 0, 0, dingo_3035_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, dingo_3000_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3035, 0x3035, 0, 0, dingo_3035_r);
}
@@ -2337,13 +2337,13 @@ static DRIVER_INIT( dingoe )
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
/* move the interrupt enable from $b000 to $b001 */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w);
/* attach the sound command handler */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0xffff, checkman_sound_command_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0xffff, checkman_sound_command_w);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3001, 0x3001, 0, 0, dingoe_3001_r); /* Protection check */
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3001, 0x3001, 0, 0, dingoe_3001_r); /* Protection check */
/* decrypt program code */
decode_dingoe();
@@ -2356,14 +2356,14 @@ static DRIVER_INIT( skybase )
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info);
/* coin lockout replaced by graphics bank */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa002, 0xa002, 0, 0x7f8, galaxian_gfxbank_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa002, 0xa002, 0, 0x7f8, galaxian_gfxbank_w);
/* needs a full 2k of RAM */
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK1, SMH_BANK1);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK1, SMH_BANK1);
memory_set_bankptr(1, auto_malloc(0x800));
/* extend ROM */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, SMH_BANK2);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x5fff, 0, 0, SMH_BANK2);
memory_set_bankptr(2, memory_region(REGION_CPU1));
}
@@ -2399,10 +2399,10 @@ static DRIVER_INIT( kingball )
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, kingball_sound1_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0x7f8, kingball_sound2_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb003, 0xb003, 0, 0x7f8, kingball_speech_dip_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, kingball_sound1_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb002, 0xb002, 0, 0x7f8, kingball_sound2_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb003, 0xb003, 0, 0x7f8, kingball_speech_dip_w);
state_save_register_global(kingball_speech_dip);
state_save_register_global(kingball_sound);
@@ -2415,19 +2415,19 @@ static DRIVER_INIT( scorpnmc )
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
/* move the interrupt enable from $b000 to $b001 */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb000, 0, 0x7f8, SMH_UNMAP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, irq_enable_w);
/* extra ROM */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x67ff, 0, 0, SMH_BANK1);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x67ff, 0, 0, SMH_BANK1);
memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x5000);
/* install RAM at $4000-$4800 */
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x47ff, 0, 0, SMH_BANK2, SMH_BANK2);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x47ff, 0, 0, SMH_BANK2, SMH_BANK2);
memory_set_bankptr(2, auto_malloc(0x800));
/* doesn't appear to use original RAM */
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_UNMAP, SMH_UNMAP);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_UNMAP, SMH_UNMAP);
}
@@ -2444,7 +2444,7 @@ static DRIVER_INIT( theend )
konami_common_init(machine, theend_draw_bullet, galaxian_draw_background, NULL, NULL);
/* coin counter on the upper bit of port C */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6802, 0x6802, 0, 0x7f8, SMH_UNMAP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6802, 0x6802, 0, 0x7f8, SMH_UNMAP);
ppi8255_set_portCwrite(0, theend_coin_counter_w);
}
@@ -2466,16 +2466,16 @@ static DRIVER_INIT( explorer )
konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
/* watchdog works for writes as well? (or is it just disabled?) */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0x7ff, watchdog_reset_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0x7ff, watchdog_reset_w);
/* I/O appears to be direct, not via PPIs */
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0xffc, input_port_0_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8001, 0x8001, 0, 0xffc, input_port_1_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8002, 0x8002, 0, 0xffc, input_port_2_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8003, 0x8003, 0, 0xffc, input_port_3_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0xfff, soundlatch_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9000, 0, 0xfff, explorer_sound_control_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0xffc, input_port_0_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8001, 0x8001, 0, 0xffc, input_port_1_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8002, 0x8002, 0, 0xffc, input_port_2_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8003, 0x8003, 0, 0xffc, input_port_3_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0xfff, soundlatch_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9000, 0, 0xfff, explorer_sound_control_w);
}
@@ -2489,7 +2489,7 @@ static DRIVER_INIT( sfx )
ppi8255_init(&sfx_ppi8255_intf);
/* sound board has space for extra ROM */
- memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
+ memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
memory_set_bankptr(1, memory_region(REGION_CPU2));
}
@@ -2500,8 +2500,8 @@ static DRIVER_INIT( atlantis )
konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
/* watchdog is at $7800? (or is it just disabled?) */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0x7ff, SMH_UNMAP);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, watchdog_reset_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0x7ff, SMH_UNMAP);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7800, 0, 0x7ff, watchdog_reset_r);
}
@@ -2539,11 +2539,11 @@ static DRIVER_INIT( froggrmc )
/* video extensions */
common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xa800, 0, 0x7ff, soundlatch_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, froggrmc_sound_control_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xa800, 0, 0x7ff, soundlatch_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb001, 0xb001, 0, 0x7f8, froggrmc_sound_control_w);
/* actually needs 2k of RAM */
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK1, SMH_BANK1);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x87ff, 0, 0, SMH_BANK1, SMH_BANK1);
memory_set_bankptr(1, auto_malloc(0x800));
/* decrypt */
@@ -2583,20 +2583,20 @@ static DRIVER_INIT( scorpion )
konami_common_init(machine, scramble_draw_bullet, scramble_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
/* hook up AY8910 */
- memory_install_readwrite8_handler(1, ADDRESS_SPACE_IO, 0x00, 0xff, 0, 0, scorpion_ay8910_r, scorpion_ay8910_w);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_IO, 0x00, 0xff, 0, 0, scorpion_ay8910_r, scorpion_ay8910_w);
/* configure protection */
ppi8255_set_portCwrite(1, scorpion_protection_w);
ppi8255_set_portCread(1, scorpion_protection_r);
/* extra ROM */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, SMH_BANK1);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5800, 0x67ff, 0, 0, SMH_BANK1);
memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x5800);
/* no background related */
-// memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, SMH_NOP);
+// memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6803, 0x6803, 0, 0, SMH_NOP);
- memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, scorpion_sound_status_r);
+ memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, scorpion_sound_status_r);
/*
{
const UINT8 *rom = memory_region(REGION_SOUND1);
diff --git a/src/mame/drivers/galivan.c b/src/mame/drivers/galivan.c
index 36a9d7e8ff4..d450117b3e4 100644
--- a/src/mame/drivers/galivan.c
+++ b/src/mame/drivers/galivan.c
@@ -1038,16 +1038,16 @@ static WRITE8_HANDLER( youmab_84_w )
static DRIVER_INIT( youmab )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x82, 0x82, 0, 0, youmab_extra_bank_w); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK2);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x82, 0x82, 0, 0, youmab_extra_bank_w); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, SMH_BANK2);
memory_set_bankptr( 2, memory_region(REGION_USER2) );
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x81, 0x81, 0, 0, youmab_81_w); // ?? often, alternating values
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x84, 0x84, 0, 0, youmab_84_w); // ?? often, sequence..
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x81, 0x81, 0, 0, youmab_81_w); // ?? often, alternating values
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x84, 0x84, 0, 0, youmab_84_w); // ?? often, sequence..
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd800, 0xd81f, 0, 0, SMH_NOP); // scrolling isn't here..
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd800, 0xd81f, 0, 0, SMH_NOP); // scrolling isn't here..
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x8a, 0x8a, 0, 0, youmab_8a_r); // ???
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x8a, 0x8a, 0, 0, youmab_8a_r); // ???
}
diff --git a/src/mame/drivers/gamecstl.c b/src/mame/drivers/gamecstl.c
index 2d1e516eb33..32026297790 100644
--- a/src/mame/drivers/gamecstl.c
+++ b/src/mame/drivers/gamecstl.c
@@ -53,6 +53,8 @@
#include "machine/idectrl.h"
#include "cpu/i386/i386.h"
+static void ide_interrupt(const device_config *device, int state);
+
static UINT32 *cga_ram;
static UINT32 *bios_ram;
@@ -311,25 +313,25 @@ static WRITE32_HANDLER( pnp_data_w )
-static READ32_HANDLER( ide0_r )
+static READ32_DEVICE_HANDLER( ide_r )
{
- return ide_controller32_0_r(machine, 0x1f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
}
-static WRITE32_HANDLER( ide0_w )
+static WRITE32_DEVICE_HANDLER( ide_w )
{
- ide_controller32_0_w(machine, 0x1f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
}
-static READ32_HANDLER( fdc_r )
+static READ32_DEVICE_HANDLER( fdc_r )
{
- return ide_controller32_0_r(machine, 0x3f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
}
-static WRITE32_HANDLER( fdc_w )
+static WRITE32_DEVICE_HANDLER( fdc_w )
{
//mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
- ide_controller32_0_w(machine, 0x3f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
}
@@ -488,11 +490,11 @@ static ADDRESS_MAP_START(gamecstl_io, ADDRESS_SPACE_IO, 32)
AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE(PIC8259, "pic8259_2", gamecstl_pic8259_32le_r, gamecstl_pic8259_32le_w)
AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE(DMA8237, "dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w)
AM_RANGE(0x00e8, 0x00eb) AM_NOP
- AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide0_r, ide0_w)
+ AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_r, ide_w)
AM_RANGE(0x0300, 0x03af) AM_NOP
AM_RANGE(0x03b0, 0x03df) AM_NOP
AM_RANGE(0x0278, 0x027b) AM_WRITE(pnp_config_w)
- AM_RANGE(0x03f0, 0x03ff) AM_READWRITE(fdc_r, fdc_w)
+ AM_RANGE(0x03f0, 0x03ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", fdc_r, fdc_w)
AM_RANGE(0x0a78, 0x0a7b) AM_WRITE(pnp_data_w)
AM_RANGE(0x0cf8, 0x0cff) AM_READWRITE(pci_32le_r, pci_32le_w)
ADDRESS_MAP_END
@@ -659,6 +661,8 @@ static MACHINE_DRIVER_START(gamecstl)
MDRV_DEVICE_ADD( "pic8259_2", PIC8259 )
MDRV_DEVICE_CONFIG( gamecstl_pic8259_2_config )
+
+ MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt)
MDRV_NVRAM_HANDLER( mc146818 )
@@ -700,7 +704,7 @@ static void keyboard_interrupt(int state)
pic8259_set_irq_line( gamecstl_devices.pic8259_1, 1, state);
}
-static void ide_interrupt(int state)
+static void ide_interrupt(const device_config *device, int state)
{
pic8259_set_irq_line( gamecstl_devices.pic8259_2, 6, state);
}
@@ -714,11 +718,6 @@ static const struct kbdc8042_interface at8042 =
KBDC8042_AT386, set_gate_a20, keyboard_interrupt, gamecstl_get_out2
};
-static const struct ide_interface ide_intf =
-{
- ide_interrupt
-};
-
static void gamecstl_set_keyb_int(int state) {
pic8259_set_irq_line(gamecstl_devices.pic8259_1, 1, state);
}
@@ -737,8 +736,6 @@ static DRIVER_INIT( gamecstl )
pci_add_device(0, 7, &intel82371ab);
kbdc8042_init(&at8042);
-
- ide_controller_init(0, &ide_intf);
}
/*****************************************************************************/
diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c
index a857fc36ad9..23c7003389b 100644
--- a/src/mame/drivers/gladiatr.c
+++ b/src/mame/drivers/gladiatr.c
@@ -1039,7 +1039,7 @@ static DRIVER_INIT(ppking)
}
}
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf6a3,0xf6a3,0,0, f6a3_r );
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf6a3,0xf6a3,0,0, f6a3_r );
}
diff --git a/src/mame/drivers/gng.c b/src/mame/drivers/gng.c
index 8ec3e647697..4e969ea27de 100644
--- a/src/mame/drivers/gng.c
+++ b/src/mame/drivers/gng.c
@@ -666,7 +666,7 @@ static READ8_HANDLER( diamond_hack_r )
static DRIVER_INIT( diamond )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, diamond_hack_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, diamond_hack_r);
}
diff --git a/src/mame/drivers/gottlieb.c b/src/mame/drivers/gottlieb.c
index 8e4cdf58412..c30bcae8828 100644
--- a/src/mame/drivers/gottlieb.c
+++ b/src/mame/drivers/gottlieb.c
@@ -2232,16 +2232,16 @@ static DRIVER_INIT( gottlieb )
static DRIVER_INIT( stooges )
{
gottlieb_sound_init();
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x05804, 0x05804, 0, 0, stooges_IN4_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x05803, 0x05803, 0, 0, stooges_output_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x05804, 0x05804, 0, 0, stooges_IN4_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x05803, 0x05803, 0, 0, stooges_output_w);
}
static DRIVER_INIT( laserdsc )
{
gottlieb_sound_init();
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x05803, 0x05803, 0, 0, usvsthem_video_outputs_w); /* OUT1 */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x05805, 0x05805, 0, 0, gottlieb_laserdisc_command_w); /* command for the player */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x05806, 0x05806, 0, 0, gottlieb_laserdisc_mpx_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x05803, 0x05803, 0, 0, usvsthem_video_outputs_w); /* OUT1 */
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x05805, 0x05805, 0, 0, gottlieb_laserdisc_command_w); /* command for the player */
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x05806, 0x05806, 0, 0, gottlieb_laserdisc_mpx_w);
}
diff --git a/src/mame/drivers/groundfx.c b/src/mame/drivers/groundfx.c
index 52d26b6d0a9..1a46d856165 100644
--- a/src/mame/drivers/groundfx.c
+++ b/src/mame/drivers/groundfx.c
@@ -497,7 +497,7 @@ static DRIVER_INIT( groundfx )
int data;
/* Speedup handlers */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x20b574, 0x20b577, 0, 0, irq_speedup_r_groundfx);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20b574, 0x20b577, 0, 0, irq_speedup_r_groundfx);
/* make piv tile GFX format suitable for gfxdecode */
offset = size/2;
diff --git a/src/mame/drivers/gstream.c b/src/mame/drivers/gstream.c
index b7c7ea2df81..818d2db3e33 100644
--- a/src/mame/drivers/gstream.c
+++ b/src/mame/drivers/gstream.c
@@ -465,7 +465,7 @@ static READ32_HANDLER( gstream_speedup_r )
static DRIVER_INIT( gstream )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd1ee0, 0xd1ee3, 0, 0, gstream_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd1ee0, 0xd1ee3, 0, 0, gstream_speedup_r );
}
GAME( 2002, gstream, 0, gstream, gstream, gstream, ROT270, "Oriental Soft Japan", "G-Stream G2020", GAME_IMPERFECT_SOUND )
diff --git a/src/mame/drivers/gstriker.c b/src/mame/drivers/gstriker.c
index f94b819622f..db10a6d5612 100644
--- a/src/mame/drivers/gstriker.c
+++ b/src/mame/drivers/gstriker.c
@@ -658,7 +658,7 @@ static WRITE16_HANDLER( twrldc94_mcu_w )
static DRIVER_INIT( twrldc94 )
{
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x20008a, 0x20008b, 0, 0, twrldc94_mcu_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20008a, 0x20008b, 0, 0, twrldc94_mcu_w);
}
/*** GAME DRIVERS ************************************************************/
diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c
index 8a50ecfef05..a376f0e9740 100644
--- a/src/mame/drivers/gsword.c
+++ b/src/mame/drivers/gsword.c
@@ -937,7 +937,7 @@ static DRIVER_INIT( gsword )
#endif
#if 1
/* hack for sound protection or time out function */
- memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x4004, 0x4005, 0, 0, gsword_hack_r);
+ memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4004, 0x4005, 0, 0, gsword_hack_r);
#endif
}
@@ -952,7 +952,7 @@ static DRIVER_INIT( gsword2 )
#endif
#if 1
/* hack for sound protection or time out function */
- memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x4004, 0x4005, 0, 0, gsword_hack_r);
+ memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4004, 0x4005, 0, 0, gsword_hack_r);
#endif
}
diff --git a/src/mame/drivers/gunbustr.c b/src/mame/drivers/gunbustr.c
index 4a2f85f275f..cbc722c1263 100644
--- a/src/mame/drivers/gunbustr.c
+++ b/src/mame/drivers/gunbustr.c
@@ -446,7 +446,7 @@ static READ32_HANDLER( main_cycle_r )
static DRIVER_INIT( gunbustr )
{
/* Speedup handler */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x203acc, 0x203acf, 0, 0, main_cycle_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x203acc, 0x203acf, 0, 0, main_cycle_r);
}
GAME( 1992, gunbustr, 0, gunbustr, gunbustr, gunbustr, ORIENTATION_FLIP_X, "Taito Corporation", "Gunbuster (Japan)", 0 )
diff --git a/src/mame/drivers/gundealr.c b/src/mame/drivers/gundealr.c
index b4cb621b3dd..01452d9dee2 100644
--- a/src/mame/drivers/gundealr.c
+++ b/src/mame/drivers/gundealr.c
@@ -567,7 +567,7 @@ static DRIVER_INIT( gundealr )
static DRIVER_INIT( yamyam )
{
input_ports_hack = 1;
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe000, 0, 0, yamyam_protection_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe000, 0, 0, yamyam_protection_w);
}
diff --git a/src/mame/drivers/harddriv.c b/src/mame/drivers/harddriv.c
index 7fda5a49085..8ae9620c497 100644
--- a/src/mame/drivers/harddriv.c
+++ b/src/mame/drivers/harddriv.c
@@ -3372,32 +3372,29 @@ static void init_multisync(running_machine *machine, int compact_inputs)
/* install handlers for the compact driving games' inputs */
if (compact_inputs)
{
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, hdc68k_wheel_r);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x408000, 0x408001, 0, 0, hdc68k_wheel_edge_reset_w);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hdc68k_port1_r);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, hdc68k_wheel_r);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x408000, 0x408001, 0, 0, hdc68k_wheel_edge_reset_w);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hdc68k_port1_r);
}
}
/* COMMON INIT: initialize the ADSP/ADSP2 board */
-static void init_adsp(void)
+static void init_adsp(running_machine *machine)
{
/* install ADSP program RAM */
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x800000, 0x807fff, 0, 0, hd68k_adsp_program_r);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x800000, 0x807fff, 0, 0, hd68k_adsp_program_w);
+ memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x800000, 0x807fff, 0, 0, hd68k_adsp_program_r, hd68k_adsp_program_w);
/* install ADSP data RAM */
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x808000, 0x80bfff, 0, 0, hd68k_adsp_data_r);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x808000, 0x80bfff, 0, 0, hd68k_adsp_data_w);
+ memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x808000, 0x80bfff, 0, 0, hd68k_adsp_data_r, hd68k_adsp_data_w);
/* install ADSP serial buffer RAM */
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x810000, 0x813fff, 0, 0, hd68k_adsp_buffer_r);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x810000, 0x813fff, 0, 0, hd68k_adsp_buffer_w);
+ memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x810000, 0x813fff, 0, 0, hd68k_adsp_buffer_r, hd68k_adsp_buffer_w);
/* install ADSP control locations */
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x818000, 0x81801f, 0, 0, hd68k_adsp_control_w);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x818060, 0x81807f, 0, 0, hd68k_adsp_irq_clear_w);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x838000, 0x83ffff, 0, 0, hd68k_adsp_irq_state_r);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x818000, 0x81801f, 0, 0, hd68k_adsp_control_w);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x818060, 0x81807f, 0, 0, hd68k_adsp_irq_clear_w);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x838000, 0x83ffff, 0, 0, hd68k_adsp_irq_state_r);
}
@@ -3405,24 +3402,21 @@ static void init_adsp(void)
static void init_ds3(running_machine *machine)
{
/* install ADSP program RAM */
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x800000, 0x807fff, 0, 0, hd68k_ds3_program_r);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x800000, 0x807fff, 0, 0, hd68k_ds3_program_w);
+ memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x800000, 0x807fff, 0, 0, hd68k_ds3_program_r, hd68k_ds3_program_w);
/* install ADSP data RAM */
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x808000, 0x80bfff, 0, 0, hd68k_adsp_data_r);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x808000, 0x80bfff, 0, 0, hd68k_adsp_data_w);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x80c000, 0x80dfff, 0, 0, hdds3_special_r);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x80c000, 0x80dfff, 0, 0, hdds3_special_w);
+ memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x808000, 0x80bfff, 0, 0, hd68k_adsp_data_r, hd68k_adsp_data_w);
+ memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x80c000, 0x80dfff, 0, 0, hdds3_special_r, hdds3_special_w);
/* install ADSP control locations */
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x820000, 0x8207ff, 0, 0, hd68k_ds3_gdata_r);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x820800, 0x820fff, 0, 0, hd68k_ds3_girq_state_r);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x820000, 0x8207ff, 0, 0, hd68k_ds3_gdata_w);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x821000, 0x8217ff, 0, 0, hd68k_adsp_irq_clear_w);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x822000, 0x8227ff, 0, 0, hd68k_ds3_sdata_r);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x822800, 0x822fff, 0, 0, hd68k_ds3_sirq_state_r);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x822000, 0x8227ff, 0, 0, hd68k_ds3_sdata_w);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x823800, 0x823fff, 0, 0, hd68k_ds3_control_w);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x820000, 0x8207ff, 0, 0, hd68k_ds3_gdata_r);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x820800, 0x820fff, 0, 0, hd68k_ds3_girq_state_r);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x820000, 0x8207ff, 0, 0, hd68k_ds3_gdata_w);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x821000, 0x8217ff, 0, 0, hd68k_adsp_irq_clear_w);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x822000, 0x8227ff, 0, 0, hd68k_ds3_sdata_r);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x822800, 0x822fff, 0, 0, hd68k_ds3_sirq_state_r);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x822000, 0x8227ff, 0, 0, hd68k_ds3_sdata_w);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x823800, 0x823fff, 0, 0, hd68k_ds3_control_w);
/* if we have a sound DSP, boot it */
if (hdcpu_sound != -1 && machine->config->cpu[hdcpu_sound].type == CPU_ADSP2105)
@@ -3502,32 +3496,29 @@ static void init_ds3(running_machine *machine)
/* COMMON INIT: initialize the DSK add-on board */
-static void init_dsk(void)
+static void init_dsk(running_machine *machine)
{
/* install ASIC61 */
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x85c000, 0x85c7ff, 0, 0, hd68k_dsk_dsp32_w);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x85c000, 0x85c7ff, 0, 0, hd68k_dsk_dsp32_r);
+ memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x85c000, 0x85c7ff, 0, 0, hd68k_dsk_dsp32_r, hd68k_dsk_dsp32_w);
/* install control registers */
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x85c800, 0x85c81f, 0, 0, hd68k_dsk_control_w);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x85c800, 0x85c81f, 0, 0, hd68k_dsk_control_w);
/* install extra RAM */
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x90ffff, 0, 0, hd68k_dsk_ram_r);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x90ffff, 0, 0, hd68k_dsk_ram_w);
+ memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x90ffff, 0, 0, hd68k_dsk_ram_r, hd68k_dsk_ram_w);
hddsk_ram = (UINT16 *)(memory_region(REGION_USER3) + 0x40000);
/* install extra ZRAM */
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x910000, 0x910fff, 0, 0, hd68k_dsk_zram_r);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x910000, 0x910fff, 0, 0, hd68k_dsk_zram_w);
+ memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x910000, 0x910fff, 0, 0, hd68k_dsk_zram_r, hd68k_dsk_zram_w);
hddsk_zram = (UINT16 *)(memory_region(REGION_USER3) + 0x50000);
/* install ASIC65 */
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x914000, 0x917fff, 0, 0, asic65_data_w);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x914000, 0x917fff, 0, 0, asic65_r);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x918000, 0x91bfff, 0, 0, asic65_io_r);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x914000, 0x917fff, 0, 0, asic65_data_w);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x914000, 0x917fff, 0, 0, asic65_r);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x918000, 0x91bfff, 0, 0, asic65_io_r);
/* install extra ROM */
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x940000, 0x9fffff, 0, 0, hd68k_dsk_small_rom_r);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x940000, 0x9fffff, 0, 0, hd68k_dsk_small_rom_r);
hddsk_rom = (UINT16 *)(memory_region(REGION_USER3) + 0x00000);
/* set up the ASIC65 */
@@ -3536,27 +3527,25 @@ static void init_dsk(void)
/* COMMON INIT: initialize the DSK II add-on board */
-static void init_dsk2(void)
+static void init_dsk2(running_machine *machine)
{
/* install ASIC65 */
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x824000, 0x824003, 0, 0, asic65_data_w);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x824000, 0x824003, 0, 0, asic65_r);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x825000, 0x825001, 0, 0, asic65_io_r);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x824000, 0x824003, 0, 0, asic65_data_w);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x824000, 0x824003, 0, 0, asic65_r);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x825000, 0x825001, 0, 0, asic65_io_r);
/* install ASIC61 */
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x827000, 0x8277ff, 0, 0, hd68k_dsk_dsp32_w);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x827000, 0x8277ff, 0, 0, hd68k_dsk_dsp32_r);
+ memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x827000, 0x8277ff, 0, 0, hd68k_dsk_dsp32_r, hd68k_dsk_dsp32_w);
/* install control registers */
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x827800, 0x82781f, 0, 0, hd68k_dsk_control_w);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x827800, 0x82781f, 0, 0, hd68k_dsk_control_w);
/* install extra RAM */
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x880000, 0x8bffff, 0, 0, hd68k_dsk_ram_r);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x880000, 0x8bffff, 0, 0, hd68k_dsk_ram_w);
+ memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x880000, 0x8bffff, 0, 0, hd68k_dsk_ram_r, hd68k_dsk_ram_w);
hddsk_ram = (UINT16 *)(memory_region(REGION_USER3) + 0x100000);
/* install extra ROM */
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x9fffff, 0, 0, hd68k_dsk_rom_r);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x9fffff, 0, 0, hd68k_dsk_rom_r);
hddsk_rom = (UINT16 *)(memory_region(REGION_USER3) + 0x000000);
/* set up the ASIC65 */
@@ -3565,31 +3554,30 @@ static void init_dsk2(void)
/* COMMON INIT: initialize the DSPCOM add-on board */
-static void init_dspcom(void)
+static void init_dspcom(running_machine *machine)
{
/* install ASIC65 */
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x900003, 0, 0, asic65_data_w);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x900003, 0, 0, asic65_r);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x901000, 0x910001, 0, 0, asic65_io_r);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x900003, 0, 0, asic65_data_w);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x900000, 0x900003, 0, 0, asic65_r);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x901000, 0x910001, 0, 0, asic65_io_r);
/* set up the ASIC65 */
asic65_config(ASIC65_STEELTAL);
/* install DSPCOM control */
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x904000, 0x90401f, 0, 0, hddspcom_control_w);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x904000, 0x90401f, 0, 0, hddspcom_control_w);
}
/* COMMON INIT: initialize the original "driver" sound board */
-static void init_driver_sound(void)
+static void init_driver_sound(running_machine *machine)
{
hdsnd_init();
/* install sound handlers */
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x840000, 0x840001, 0, 0, hd68k_snd_data_w);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x840000, 0x840001, 0, 0, hd68k_snd_data_r);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x844000, 0x844001, 0, 0, hd68k_snd_status_r);
- memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x84c000, 0x84c001, 0, 0, hd68k_snd_reset_w);
+ memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x840000, 0x840001, 0, 0, hd68k_snd_data_r, hd68k_snd_data_w);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x844000, 0x844001, 0, 0, hd68k_snd_status_r);
+ memory_install_write16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x84c000, 0x84c001, 0, 0, hd68k_snd_reset_w);
}
@@ -3605,22 +3593,22 @@ static DRIVER_INIT( harddriv )
{
/* initialize the boards */
init_driver(machine);
- init_adsp();
- init_driver_sound();
+ init_adsp(machine);
+ init_driver_sound(machine);
/* set up gsp speedup handler */
- hdgsp_speedup_addr[0] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup1_w);
- hdgsp_speedup_addr[1] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfffcfc00, 0xfffcfc0f, 0, 0, hdgsp_speedup2_w);
- memory_install_read16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup_r);
+ hdgsp_speedup_addr[0] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup1_w);
+ hdgsp_speedup_addr[1] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfffcfc00, 0xfffcfc0f, 0, 0, hdgsp_speedup2_w);
+ memory_install_read16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup_r);
hdgsp_speedup_pc = 0xffc00f10;
/* set up msp speedup handler */
- hdmsp_speedup_addr = memory_install_write16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_w);
- memory_install_read16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_r);
+ hdmsp_speedup_addr = memory_install_write16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_w);
+ memory_install_read16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_r);
hdmsp_speedup_pc = 0x00723b00;
/* set up adsp speedup handlers */
- memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
}
@@ -3628,22 +3616,22 @@ static DRIVER_INIT( harddrvc )
{
/* initialize the boards */
init_multisync(machine, 1);
- init_adsp();
- init_driver_sound();
+ init_adsp(machine);
+ init_driver_sound(machine);
/* set up gsp speedup handler */
- hdgsp_speedup_addr[0] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup1_w);
- hdgsp_speedup_addr[1] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfffcfc00, 0xfffcfc0f, 0, 0, hdgsp_speedup2_w);
- memory_install_read16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup_r);
+ hdgsp_speedup_addr[0] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup1_w);
+ hdgsp_speedup_addr[1] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfffcfc00, 0xfffcfc0f, 0, 0, hdgsp_speedup2_w);
+ memory_install_read16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup_r);
hdgsp_speedup_pc = 0xfff40ff0;
/* set up msp speedup handler */
- hdmsp_speedup_addr = memory_install_write16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_w);
- memory_install_read16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_r);
+ hdmsp_speedup_addr = memory_install_write16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_w);
+ memory_install_read16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x00751b00, 0x00751b0f, 0, 0, hdmsp_speedup_r);
hdmsp_speedup_pc = 0x00723b00;
/* set up adsp speedup handlers */
- memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
}
@@ -3651,17 +3639,17 @@ static DRIVER_INIT( stunrun )
{
/* initialize the boards */
init_multisync(machine, 0);
- init_adsp();
+ init_adsp(machine);
atarijsa_init(machine, 0, 0x0020);
/* set up gsp speedup handler */
- hdgsp_speedup_addr[0] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup1_w);
- hdgsp_speedup_addr[1] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfffcfc00, 0xfffcfc0f, 0, 0, hdgsp_speedup2_w);
- memory_install_read16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup_r);
+ hdgsp_speedup_addr[0] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup1_w);
+ hdgsp_speedup_addr[1] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfffcfc00, 0xfffcfc0f, 0, 0, hdgsp_speedup2_w);
+ memory_install_read16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup_r);
hdgsp_speedup_pc = 0xfff41070;
/* set up adsp speedup handlers */
- memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
}
@@ -3692,24 +3680,23 @@ static DRIVER_INIT( racedriv )
{
/* initialize the boards */
init_driver(machine);
- init_adsp();
- init_dsk();
- init_driver_sound();
+ init_adsp(machine);
+ init_dsk(machine);
+ init_driver_sound(machine);
/* set up the slapstic */
slapstic_init(117);
- hd68k_slapstic_base = memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_r);
- hd68k_slapstic_base = memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_w);
+ hd68k_slapstic_base = memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_r, rd68k_slapstic_w);
/* synchronization */
- rddsp32_sync[0] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613c00, 0x613c03, 0, 0, rddsp32_sync0_w);
- rddsp32_sync[1] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e00, 0x613e03, 0, 0, rddsp32_sync1_w);
+ rddsp32_sync[0] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613c00, 0x613c03, 0, 0, rddsp32_sync0_w);
+ rddsp32_sync[1] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e00, 0x613e03, 0, 0, rddsp32_sync1_w);
/* set up adsp speedup handlers */
- memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
/* set up dsp32 speedup handlers */
- rddsp32_speedup = memory_install_read32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e04, 0x613e07, 0, 0, rddsp32_speedup_r);
+ rddsp32_speedup = memory_install_read32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e04, 0x613e07, 0, 0, rddsp32_speedup_r);
rddsp32_speedup_pc = 0x6054b0;
}
@@ -3718,32 +3705,31 @@ static void racedrvc_init_common(running_machine *machine, offs_t gsp_protection
{
/* initialize the boards */
init_multisync(machine, 1);
- init_adsp();
- init_dsk();
- init_driver_sound();
+ init_adsp(machine);
+ init_dsk(machine);
+ init_driver_sound(machine);
/* set up the slapstic */
slapstic_init(117);
- hd68k_slapstic_base = memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_r);
- hd68k_slapstic_base = memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_w);
+ hd68k_slapstic_base = memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_r, rd68k_slapstic_w);
/* synchronization */
- rddsp32_sync[0] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613c00, 0x613c03, 0, 0, rddsp32_sync0_w);
- rddsp32_sync[1] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e00, 0x613e03, 0, 0, rddsp32_sync1_w);
+ rddsp32_sync[0] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613c00, 0x613c03, 0, 0, rddsp32_sync0_w);
+ rddsp32_sync[1] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e00, 0x613e03, 0, 0, rddsp32_sync1_w);
/* set up protection hacks */
- hdgsp_protection = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, TOBYTE(gsp_protection), TOBYTE(gsp_protection + 0x0f), 0, 0, hdgsp_protection_w);
+ hdgsp_protection = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, TOBYTE(gsp_protection), TOBYTE(gsp_protection + 0x0f), 0, 0, hdgsp_protection_w);
/* set up gsp speedup handler */
- hdgsp_speedup_addr[0] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff76f60, 0xfff76f6f, 0, 0, rdgsp_speedup1_w);
- memory_install_read16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff76f60, 0xfff76f6f, 0, 0, rdgsp_speedup1_r);
+ hdgsp_speedup_addr[0] = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff76f60, 0xfff76f6f, 0, 0, rdgsp_speedup1_w);
+ memory_install_read16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff76f60, 0xfff76f6f, 0, 0, rdgsp_speedup1_r);
hdgsp_speedup_pc = 0xfff43a00;
/* set up adsp speedup handlers */
- memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
/* set up dsp32 speedup handlers */
- rddsp32_speedup = memory_install_read32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e04, 0x613e07, 0, 0, rddsp32_speedup_r);
+ rddsp32_speedup = memory_install_read32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e04, 0x613e07, 0, 0, rddsp32_speedup_r);
rddsp32_speedup_pc = 0x6054b0;
}
@@ -3763,42 +3749,38 @@ static void steeltal_init_common(running_machine *machine, offs_t ds3_transfer_p
/* initialize the boards */
init_multisync(machine, 0);
init_ds3(machine);
- init_dspcom();
+ init_dspcom(machine);
atarijsa3_init_adpcm(REGION_SOUND1);
atarijsa_init(machine, 0, 0x0020);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x908000, 0x908001, 0, 0, steeltal_dummy_r);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x908000, 0x908001, 0, 0, steeltal_dummy_r);
/* set up the SLOOP */
if (!proto_sloop)
{
- hd68k_slapstic_base = memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, st68k_sloop_r);
- hd68k_slapstic_base = memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, st68k_sloop_w);
- st68k_sloop_alt_base = memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x4e000, 0x4ffff, 0, 0, st68k_sloop_alt_r);
+ hd68k_slapstic_base = memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, st68k_sloop_r, st68k_sloop_w);
+ st68k_sloop_alt_base = memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x4e000, 0x4ffff, 0, 0, st68k_sloop_alt_r);
}
else
- {
- hd68k_slapstic_base = memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, st68k_protosloop_r);
- hd68k_slapstic_base = memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, st68k_protosloop_w);
- }
+ hd68k_slapstic_base = memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, st68k_protosloop_r, st68k_protosloop_w);
/* synchronization */
stmsp_sync[0] = &hdmsp_ram[TOWORD(0x80010)];
- memory_install_write16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x80010, 0x8007f, 0, 0, stmsp_sync0_w);
+ memory_install_write16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x80010, 0x8007f, 0, 0, stmsp_sync0_w);
stmsp_sync[1] = &hdmsp_ram[TOWORD(0x99680)];
- memory_install_write16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x99680, 0x9968f, 0, 0, stmsp_sync1_w);
+ memory_install_write16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x99680, 0x9968f, 0, 0, stmsp_sync1_w);
stmsp_sync[2] = &hdmsp_ram[TOWORD(0x99d30)];
- memory_install_write16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x99d30, 0x99d50, 0, 0, stmsp_sync2_w);
+ memory_install_write16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x99d30, 0x99d50, 0, 0, stmsp_sync2_w);
/* set up protection hacks */
- hdgsp_protection = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff965d0, 0xfff965df, 0, 0, hdgsp_protection_w);
+ hdgsp_protection = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff965d0, 0xfff965df, 0, 0, hdgsp_protection_w);
/* set up msp speedup handlers */
- memory_install_read16_handler(hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x80020, 0x8002f, 0, 0, stmsp_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_msp, ADDRESS_SPACE_PROGRAM, 0x80020, 0x8002f, 0, 0, stmsp_speedup_r);
/* set up adsp speedup handlers */
- memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
- memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f99, 0x1f99, 0, 0, hdds3_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f99, 0x1f99, 0, 0, hdds3_speedup_r);
hdds3_speedup_addr = &hdadsp_data_memory[0x1f99];
hdds3_speedup_pc = 0xff;
hdds3_transfer_pc = ds3_transfer_pc;
@@ -3815,25 +3797,24 @@ static DRIVER_INIT( strtdriv )
/* initialize the boards */
init_multisync(machine, 1);
init_ds3(machine);
- init_dsk();
+ init_dsk(machine);
/* set up the slapstic */
slapstic_init(117);
- hd68k_slapstic_base = memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_r);
- hd68k_slapstic_base = memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_w);
+ hd68k_slapstic_base = memory_install_readwrite16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xe0000, 0xfffff, 0, 0, rd68k_slapstic_r, rd68k_slapstic_w);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hda68k_port1_r);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hda68k_port1_r);
/* synchronization */
- rddsp32_sync[0] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613c00, 0x613c03, 0, 0, rddsp32_sync0_w);
- rddsp32_sync[1] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e00, 0x613e03, 0, 0, rddsp32_sync1_w);
+ rddsp32_sync[0] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613c00, 0x613c03, 0, 0, rddsp32_sync0_w);
+ rddsp32_sync[1] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x613e00, 0x613e03, 0, 0, rddsp32_sync1_w);
/* set up protection hacks */
- hdgsp_protection = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff960a0, 0xfff960af, 0, 0, hdgsp_protection_w);
+ hdgsp_protection = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff960a0, 0xfff960af, 0, 0, hdgsp_protection_w);
/* set up adsp speedup handlers */
- memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
- memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f99, 0x1f99, 0, 0, hdds3_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f99, 0x1f99, 0, 0, hdds3_speedup_r);
hdds3_speedup_addr = &hdadsp_data_memory[0x1f99];
hdds3_speedup_pc = 0xff;
hdds3_transfer_pc = 0x43672;
@@ -3845,20 +3826,20 @@ static DRIVER_INIT( hdrivair )
/* initialize the boards */
init_multisync(machine, 1);
init_ds3(machine);
- init_dsk2();
+ init_dsk2(machine);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hda68k_port1_r);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hda68k_port1_r);
/* synchronization */
- rddsp32_sync[0] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21fe00, 0x21fe03, 0, 0, rddsp32_sync0_w);
- rddsp32_sync[1] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21ff00, 0x21ff03, 0, 0, rddsp32_sync1_w);
+ rddsp32_sync[0] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21fe00, 0x21fe03, 0, 0, rddsp32_sync0_w);
+ rddsp32_sync[1] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21ff00, 0x21ff03, 0, 0, rddsp32_sync1_w);
/* set up protection hacks */
- hdgsp_protection = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff943f0, 0xfff943ff, 0, 0, hdgsp_protection_w);
+ hdgsp_protection = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff943f0, 0xfff943ff, 0, 0, hdgsp_protection_w);
/* set up adsp speedup handlers */
- memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
- memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f99, 0x1f99, 0, 0, hdds3_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f99, 0x1f99, 0, 0, hdds3_speedup_r);
hdds3_speedup_addr = &hdadsp_data_memory[0x1f99];
hdds3_speedup_pc = 0x2da;
hdds3_transfer_pc = 0x407b8;
@@ -3870,20 +3851,20 @@ static DRIVER_INIT( hdrivaip )
/* initialize the boards */
init_multisync(machine, 1);
init_ds3(machine);
- init_dsk2();
+ init_dsk2(machine);
- memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hda68k_port1_r);
+ memory_install_read16_handler(machine, hdcpu_main, ADDRESS_SPACE_PROGRAM, 0xa80000, 0xafffff, 0, 0, hda68k_port1_r);
/* synchronization */
- rddsp32_sync[0] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21fe00, 0x21fe03, 0, 0, rddsp32_sync0_w);
- rddsp32_sync[1] = memory_install_write32_handler(hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21ff00, 0x21ff03, 0, 0, rddsp32_sync1_w);
+ rddsp32_sync[0] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21fe00, 0x21fe03, 0, 0, rddsp32_sync0_w);
+ rddsp32_sync[1] = memory_install_write32_handler(machine, hdcpu_dsp32, ADDRESS_SPACE_PROGRAM, 0x21ff00, 0x21ff03, 0, 0, rddsp32_sync1_w);
/* set up protection hacks */
- hdgsp_protection = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff916c0, 0xfff916cf, 0, 0, hdgsp_protection_w);
+ hdgsp_protection = memory_install_write16_handler(machine, hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff916c0, 0xfff916cf, 0, 0, hdgsp_protection_w);
/* set up adsp speedup handlers */
- memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
- memory_install_read16_handler(hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f9a, 0x1f9a, 0, 0, hdds3_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1fff, 0x1fff, 0, 0, hdadsp_speedup_r);
+ memory_install_read16_handler(machine, hdcpu_adsp, ADDRESS_SPACE_DATA, 0x1f9a, 0x1f9a, 0, 0, hdds3_speedup_r);
hdds3_speedup_addr = &hdadsp_data_memory[0x1f9a];
hdds3_speedup_pc = 0x2d9;
hdds3_transfer_pc = 0X407da;
diff --git a/src/mame/drivers/homedata.c b/src/mame/drivers/homedata.c
index d1bc2e557cd..698a9b9f759 100644
--- a/src/mame/drivers/homedata.c
+++ b/src/mame/drivers/homedata.c
@@ -1829,15 +1829,15 @@ static DRIVER_INIT( jogakuen )
/* it seems that Mahjong Jogakuen runs on the same board as the others,
but with just these two addresses swapped. Instead of creating a new
MachineDriver, I just fix them here. */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8007, 0x8007, 0, 0, pteacher_blitter_bank_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8005, 0x8005, 0, 0, pteacher_gfx_bank_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8007, 0x8007, 0, 0, pteacher_blitter_bank_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8005, 0x8005, 0, 0, pteacher_gfx_bank_w);
}
static DRIVER_INIT( mjikaga )
{
/* Mahjong Ikagadesuka is different as well. */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7802, 0x7802, 0, 0, pteacher_snd_r);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0123, 0x0123, 0, 0, pteacher_snd_answer_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7802, 0x7802, 0, 0, pteacher_snd_r);
+ memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0123, 0x0123, 0, 0, pteacher_snd_answer_w);
}
static DRIVER_INIT( reikaids )
diff --git a/src/mame/drivers/hshavoc.c b/src/mame/drivers/hshavoc.c
index e7e0a5fd78c..31d268c4d8f 100644
--- a/src/mame/drivers/hshavoc.c
+++ b/src/mame/drivers/hshavoc.c
@@ -207,7 +207,7 @@ static READ16_HANDLER( vdp_fake_r )
static DRIVER_INIT(genesis)
{
/* hack -- fix vdp emulation instead */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xC00004, 0xC00005, 0, 0, vdp_fake_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC00004, 0xC00005, 0, 0, vdp_fake_r);
memory_set_bankptr(3, memory_region(REGION_CPU1) );
memory_set_bankptr(4, genesis_68k_ram );
diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c
index e90d7ae4168..0f9520ead1a 100644
--- a/src/mame/drivers/hyprduel.c
+++ b/src/mame/drivers/hyprduel.c
@@ -806,12 +806,12 @@ static DRIVER_INIT( hyprduel )
// ROM[(0x174b9*0x20)+0x1f] |= 0x0e; /* I */
// ROM[(0x174e9*0x20)+0x1f] |= 0x0e;
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc07fff, 0, 0, hypr_sharedram1_w);
- memory_install_write16_handler(1, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc07fff, 0, 0, hypr_sharedram1_w);
- memory_install_write16_handler(1, ADDRESS_SPACE_PROGRAM, 0x000000, 0x003fff, 0, 0, hypr_sharedram1_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc07fff, 0, 0, hypr_sharedram1_w);
+ memory_install_write16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc07fff, 0, 0, hypr_sharedram1_w);
+ memory_install_write16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x000000, 0x003fff, 0, 0, hypr_sharedram1_w);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe0000, 0xffffff, 0, 0, hypr_sharedram2_w);
- memory_install_write16_handler(1, ADDRESS_SPACE_PROGRAM, 0xfe0000, 0xffffff, 0, 0, hypr_sharedram2_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe0000, 0xffffff, 0, 0, hypr_sharedram2_w);
+ memory_install_write16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xfe0000, 0xffffff, 0, 0, hypr_sharedram2_w);
requested_int = 0x00;
blitter_bit = 2;
diff --git a/src/mame/drivers/iqblock.c b/src/mame/drivers/iqblock.c
index 0066fdebd6c..d2cc00831f5 100644
--- a/src/mame/drivers/iqblock.c
+++ b/src/mame/drivers/iqblock.c
@@ -523,7 +523,7 @@ static DRIVER_INIT( iqblock )
paletteram_2 = rom + 0x12800;
iqblock_fgvideoram = rom + 0x16800;
iqblock_bgvideoram = rom + 0x17000;
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe26, 0xfe26, 0, 0, iqblock_prot_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe26, 0xfe26, 0, 0, iqblock_prot_w);
iqblock_video_type=1;
}
@@ -545,7 +545,7 @@ static DRIVER_INIT( grndtour )
paletteram_2 = rom + 0x12800;
iqblock_fgvideoram = rom + 0x16800;
iqblock_bgvideoram = rom + 0x17000;
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe39, 0xfe39, 0, 0, grndtour_prot_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe39, 0xfe39, 0, 0, grndtour_prot_w);
iqblock_video_type=0;
}
diff --git a/src/mame/drivers/itech32.c b/src/mame/drivers/itech32.c
index d3be7091252..43d51c15aee 100644
--- a/src/mame/drivers/itech32.c
+++ b/src/mame/drivers/itech32.c
@@ -3721,8 +3721,8 @@ static DRIVER_INIT( drivedge )
itech32_planes = 1;
is_drivedge = 1;
- memory_install_read32_handler(2, ADDRESS_SPACE_PROGRAM, 0x8382, 0x8382, 0, 0, drivedge_tms1_speedup_r);
- memory_install_read32_handler(3, ADDRESS_SPACE_PROGRAM, 0x8382, 0x8382, 0, 0, drivedge_tms2_speedup_r);
+ memory_install_read32_handler(machine, 2, ADDRESS_SPACE_PROGRAM, 0x8382, 0x8382, 0, 0, drivedge_tms1_speedup_r);
+ memory_install_read32_handler(machine, 3, ADDRESS_SPACE_PROGRAM, 0x8382, 0x8382, 0, 0, drivedge_tms2_speedup_r);
}
@@ -3740,11 +3740,10 @@ static DRIVER_INIT( wcbowl )
itech32_vram_height = 1024;
itech32_planes = 1;
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x680000, 0x680001, 0, 0, trackball_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x680000, 0x680001, 0, 0, trackball_r);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x578000, 0x57ffff, 0, 0, SMH_NOP);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x680080, 0x680081, 0, 0, wcbowl_prot_result_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x680080, 0x680081, 0, 0, SMH_NOP);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x578000, 0x57ffff, 0, 0, SMH_NOP);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x680080, 0x680081, 0, 0, wcbowl_prot_result_r, SMH_NOP);
}
@@ -3757,8 +3756,8 @@ static void init_sftm_common(running_machine *machine, int prot_addr)
itech020_prot_address = prot_addr;
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x300003, 0, 0, itech020_color2_w);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x380000, 0x380003, 0, 0, itech020_color1_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x300003, 0, 0, itech020_color2_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x380000, 0x380003, 0, 0, itech020_color1_w);
}
@@ -3788,10 +3787,10 @@ static void init_shuffle_bowl_common(running_machine *machine, int prot_addr)
itech020_prot_address = prot_addr;
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x300003, 0, 0, itech020_color2_w);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x380000, 0x380003, 0, 0, itech020_color1_w);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x180800, 0x180803, 0, 0, trackball32_4bit_r);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x181000, 0x181003, 0, 0, trackball32_4bit_p2_r);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x300003, 0, 0, itech020_color2_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x380000, 0x380003, 0, 0, itech020_color1_w);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x180800, 0x180803, 0, 0, trackball32_4bit_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x181000, 0x181003, 0, 0, trackball32_4bit_p2_r);
}
@@ -3813,8 +3812,7 @@ static DRIVER_INIT( wcbowlt ) /* PIC 16C54 labeled as ITBWL-3 */
init_shuffle_bowl_common(machine, 0x111a);
timekeeper_init( 0, TIMEKEEPER_M48T02, NULL );
- memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_w);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_r, timekeeper_0_32be_w);
}
static void init_gt_common(running_machine *machine)
@@ -3837,7 +3835,7 @@ static DRIVER_INIT( gt3d )
Hacked versions of this PCB have been found with GT97
through GTClassic. This is _NOT_ a factory modification
*/
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200003, 0, 0, trackball32_8bit_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200003, 0, 0, trackball32_8bit_r);
init_gt_common(machine);
}
@@ -3850,8 +3848,8 @@ static DRIVER_INIT( aama )
board share the same sound CPU code and sample ROMs.
This board has all versions of GT for it, GT3D through GTClassic
*/
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x180800, 0x180803, 0, 0, trackball32_4bit_r);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x181000, 0x181003, 0, 0, trackball32_4bit_p2_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x180800, 0x180803, 0, 0, trackball32_4bit_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x181000, 0x181003, 0, 0, trackball32_4bit_p2_r);
init_gt_common(machine);
}
@@ -3863,8 +3861,7 @@ static DRIVER_INIT( aamat )
*/
DRIVER_INIT_CALL(aama);
timekeeper_init( 0, TIMEKEEPER_M48T02, NULL );
- memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_w);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x681000, 0x6817ff, 0, 0, timekeeper_0_32be_r, timekeeper_0_32be_w);
}
@@ -3876,7 +3873,7 @@ static DRIVER_INIT( s_ver )
board: GT97 v1.21S, GT98, GT99, GT2K & GT Classic Versions 1.00S
Trackball info is read through 200202 (actually 200203).
*/
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x200200, 0x200203, 0, 0, trackball32_4bit_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200200, 0x200203, 0, 0, trackball32_4bit_r);
init_gt_common(machine);
}
@@ -3890,7 +3887,7 @@ static DRIVER_INIT( gt3dl )
Player 1 trackball read through 200003
Player 2 trackball read through 200002
*/
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200003, 0, 0, trackball32_4bit_combined_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200003, 0, 0, trackball32_4bit_combined_r);
init_gt_common(machine);
}
@@ -3898,7 +3895,7 @@ static DRIVER_INIT( gt3dl )
static DRIVER_INIT( gtclassp )
{
/* a little extra protection */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x680000, 0x680003, 0, 0, gtclass_prot_result_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x680000, 0x680003, 0, 0, gtclass_prot_result_r);
DRIVER_INIT_CALL(aama);
/* The protection code is:
diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c
index 8426c0074c2..e9dd595966d 100644
--- a/src/mame/drivers/itech8.c
+++ b/src/mame/drivers/itech8.c
@@ -2582,17 +2582,17 @@ ROM_END
static DRIVER_INIT( slikshot )
{
- memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0180, 0x0180, 0, 0, slikshot_z80_r);
- memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x01cf, 0x01cf, 0, 0, slikshot_z80_control_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x01cf, 0x01cf, 0, 0, slikshot_z80_control_w);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0180, 0x0180, 0, 0, slikshot_z80_r);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x01cf, 0x01cf, 0, 0, slikshot_z80_control_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01cf, 0x01cf, 0, 0, slikshot_z80_control_w);
}
static DRIVER_INIT( sstrike )
{
- memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x1180, 0x1180, 0, 0, slikshot_z80_r);
- memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x11cf, 0x11cf, 0, 0, slikshot_z80_control_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x11cf, 0x11cf, 0, 0, slikshot_z80_control_w);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x1180, 0x1180, 0, 0, slikshot_z80_r);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x11cf, 0x11cf, 0, 0, slikshot_z80_control_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x11cf, 0x11cf, 0, 0, slikshot_z80_control_w);
}
@@ -2627,16 +2627,16 @@ static DRIVER_INIT( neckneck )
static DRIVER_INIT( rimrockn )
{
/* additional input ports */
- memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0160, 0x0160, 0, 0, special_port1_r);
- memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0161, 0x0161, 0, 0, input_port_3_r);
- memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0162, 0x0162, 0, 0, input_port_4_r);
- memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0163, 0x0163, 0, 0, input_port_5_r);
- memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0164, 0x0164, 0, 0, input_port_6_r);
- memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0165, 0x0165, 0, 0, input_port_7_r);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0160, 0x0160, 0, 0, special_port1_r);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0161, 0x0161, 0, 0, input_port_3_r);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0162, 0x0162, 0, 0, input_port_4_r);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0163, 0x0163, 0, 0, input_port_5_r);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0164, 0x0164, 0, 0, input_port_6_r);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x0165, 0x0165, 0, 0, input_port_7_r);
/* different banking mechanism (disable the old one) */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x01a0, 0x01a0, 0, 0, rimrockn_bank_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x01c0, 0x01df, 0, 0, itech8_blitter_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01a0, 0x01a0, 0, 0, rimrockn_bank_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01c0, 0x01df, 0, 0, itech8_blitter_w);
}
diff --git a/src/mame/drivers/jack.c b/src/mame/drivers/jack.c
index 6390e202efa..ce4815dedc8 100644
--- a/src/mame/drivers/jack.c
+++ b/src/mame/drivers/jack.c
@@ -1455,10 +1455,10 @@ static DRIVER_INIT( striv )
}
// Set-up the weirdest questions read ever done
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, striv_question_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, striv_question_r);
// Nop out unused sprites writes
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb0ff, 0, 0, SMH_NOP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xb0ff, 0, 0, SMH_NOP);
timer_rate = 128;
}
diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c
index a8be084d62a..238974590b2 100644
--- a/src/mame/drivers/jalmah.c
+++ b/src/mame/drivers/jalmah.c
@@ -1885,60 +1885,60 @@ static READ16_HANDLER( suchipi_mcu_r )
static DRIVER_INIT( urashima )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, urashima_mcu_r );
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, urashima_mcu_w );
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0320, 0xf0321, 0, 0, SMH_BANK1, SMH_BANK1 );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, urashima_mcu_r );
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, urashima_mcu_w );
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0320, 0xf0321, 0, 0, SMH_BANK1, SMH_BANK1 );
memory_set_bankptr(1, auto_malloc(0xf0322 - 0xf0320));
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf03c0, 0xf03c5, 0, 0, SMH_BANK2, SMH_BANK2 );
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf03c0, 0xf03c5, 0, 0, SMH_BANK2, SMH_BANK2 );
memory_set_bankptr(2, auto_malloc(0xf03c6 - 0xf03c0));
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf03c6, 0xf03e5, 0, 0, SMH_BANK3, SMH_BANK3 );
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf03c6, 0xf03e5, 0, 0, SMH_BANK3, SMH_BANK3 );
memory_set_bankptr(3, auto_malloc(0xf03e6 - 0xf03c6));
mcu_prg = 0x12;
}
static DRIVER_INIT( daireika )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, daireika_mcu_r );
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, daireika_mcu_w );
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0140, 0xf0141, 0, 0, SMH_BANK1, SMH_BANK1 );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, daireika_mcu_r );
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, daireika_mcu_w );
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0140, 0xf0141, 0, 0, SMH_BANK1, SMH_BANK1 );
memory_set_bankptr(1, auto_malloc(0xf0142 - 0xf0140));
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf0025, 0, 0, SMH_BANK2, SMH_BANK2 );
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf0025, 0, 0, SMH_BANK2, SMH_BANK2 );
memory_set_bankptr(2, auto_malloc(0xf0026 - 0xf0020));
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00d5, 0, 0, SMH_BANK3, SMH_BANK3 );
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00d5, 0, 0, SMH_BANK3, SMH_BANK3 );
memory_set_bankptr(3, auto_malloc(0xf00d6 - 0xf00c0));
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0100, 0xf0130, 0, 0, SMH_BANK4, SMH_BANK4 );
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0100, 0xf0130, 0, 0, SMH_BANK4, SMH_BANK4 );
memory_set_bankptr(4, auto_malloc(0xf0130 - 0xf0100));
mcu_prg = 0x11;
}
static DRIVER_INIT( mjzoomin )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, mjzoomin_mcu_r );
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, mjzoomin_mcu_w );
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00c5, 0, 0, SMH_BANK1, SMH_BANK1 );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, mjzoomin_mcu_r );
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80012, 0x80013, 0, 0, mjzoomin_mcu_w );
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf00c0, 0xf00c5, 0, 0, SMH_BANK1, SMH_BANK1 );
memory_set_bankptr(1, auto_malloc(0xf00c6 - 0xf00c0));
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00c6, 0xf00d1, 0, 0, SMH_BANK2, SMH_BANK2 );
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf00c6, 0xf00d1, 0, 0, SMH_BANK2, SMH_BANK2 );
memory_set_bankptr(2, auto_malloc(0xf00d2 - 0xf00c6));
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf002f, 0, 0, SMH_BANK3, SMH_BANK3 );
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0020, 0xf002f, 0, 0, SMH_BANK3, SMH_BANK3 );
memory_set_bankptr(3, auto_malloc(0xf0030 - 0xf0020));
mcu_prg = 0x13;
}
static DRIVER_INIT( kakumei )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, kakumei_mcu_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, kakumei_mcu_r );
mcu_prg = 0x21;
}
static DRIVER_INIT( kakumei2 )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, kakumei_mcu_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, kakumei_mcu_r );
mcu_prg = 0x22;
}
static DRIVER_INIT( suchipi )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, suchipi_mcu_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80004, 0x80005, 0, 0, suchipi_mcu_r );
mcu_prg = 0x23;
}
diff --git a/src/mame/drivers/kangaroo.c b/src/mame/drivers/kangaroo.c
index 68b54d23b7f..dfaa5680852 100644
--- a/src/mame/drivers/kangaroo.c
+++ b/src/mame/drivers/kangaroo.c
@@ -116,7 +116,7 @@ static MACHINE_START( kangaroo )
static MACHINE_START( kangaroo_mcu )
{
MACHINE_START_CALL(kangaroo);
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0xef00, 0xefff, 0, 0, mcu_sim_r, mcu_sim_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xef00, 0xefff, 0, 0, mcu_sim_r, mcu_sim_w);
kangaroo_clock = 0;
}
diff --git a/src/mame/drivers/kinst.c b/src/mame/drivers/kinst.c
index ffbed9e5db5..c89c16efe15 100644
--- a/src/mame/drivers/kinst.c
+++ b/src/mame/drivers/kinst.c
@@ -159,6 +159,38 @@ static const UINT8 *control_map;
static MACHINE_START( kinst )
{
+ const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide");
+ UINT8 *features = ide_get_features(ide);
+
+ if (strncmp(machine->gamedrv->name, "kinst2", 6) != 0)
+ {
+ /* kinst: tweak the model number so we pass the check */
+ features[27*2+0] = 0x54;
+ features[27*2+1] = 0x53;
+ features[28*2+0] = 0x31;
+ features[28*2+1] = 0x39;
+ features[29*2+0] = 0x30;
+ features[29*2+1] = 0x35;
+ features[30*2+0] = 0x47;
+ features[30*2+1] = 0x41;
+ features[31*2+0] = 0x20;
+ features[31*2+1] = 0x20;
+ }
+ else
+ {
+ /* kinst2: tweak the model number so we pass the check */
+ features[10*2+0] = 0x30;
+ features[10*2+1] = 0x30;
+ features[11*2+0] = 0x54;
+ features[11*2+1] = 0x53;
+ features[12*2+0] = 0x31;
+ features[12*2+1] = 0x39;
+ features[13*2+0] = 0x30;
+ features[13*2+1] = 0x35;
+ features[14*2+0] = 0x47;
+ features[14*2+1] = 0x41;
+ }
+
/* set the fastest DRC options */
cpunum_set_info_int(0, CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS);
@@ -193,7 +225,7 @@ static MACHINE_START( kinst )
static MACHINE_RESET( kinst )
{
/* reset the IDE controller */
- ide_controller_reset(0);
+ devtag_reset(machine, IDE_CONTROLLER, "ide");
/* set a safe base location for video */
video_base = &rambase[0x30000/4];
@@ -252,18 +284,12 @@ static INTERRUPT_GEN( irq0_start )
}
-static void ide_interrupt(int state)
+static void ide_interrupt(const device_config *device, int state)
{
- cpunum_set_input_line(Machine, 0, 1, state);
+ cpunum_set_input_line(device->machine, 0, 1, state);
}
-static const struct ide_interface ide_intf =
-{
- ide_interrupt
-};
-
-
/*************************************
*
@@ -271,27 +297,27 @@ static const struct ide_interface ide_intf =
*
*************************************/
-static READ32_HANDLER( ide_controller_r )
+static READ32_DEVICE_HANDLER( kinst_ide_r )
{
- return midway_ide_asic_r(machine, offset / 2, mem_mask);
+ return midway_ide_asic_r(device, offset / 2, mem_mask);
}
-static WRITE32_HANDLER( ide_controller_w )
+static WRITE32_DEVICE_HANDLER( kinst_ide_w )
{
- midway_ide_asic_w(machine, offset / 2, data, mem_mask);
+ midway_ide_asic_w(device, offset / 2, data, mem_mask);
}
-static READ32_HANDLER( ide_controller_extra_r )
+static READ32_DEVICE_HANDLER( kinst_ide_extra_r )
{
- return ide_controller32_0_r(machine, 0x3f6/4, 0xff00ffff) >> 16;
+ return ide_controller32_r(device, 0x3f6/4, 0xff00ffff) >> 16;
}
-static WRITE32_HANDLER( ide_controller_extra_w )
+static WRITE32_DEVICE_HANDLER( kinst_ide_extra_w )
{
- ide_controller32_0_w(machine, 0x3f6/4, data << 16, 0xff00ffff);
+ ide_controller32_w(device, 0x3f6/4, data << 16, 0xff00ffff);
}
@@ -412,8 +438,8 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x00000000, 0x0007ffff) AM_RAM AM_BASE(&rambase)
AM_RANGE(0x08000000, 0x087fffff) AM_RAM AM_BASE(&rambase2)
AM_RANGE(0x10000080, 0x100000ff) AM_READWRITE(kinst_control_r, kinst_control_w) AM_BASE(&kinst_control)
- AM_RANGE(0x10000100, 0x1000013f) AM_READWRITE(ide_controller_r, ide_controller_w)
- AM_RANGE(0x10000170, 0x10000173) AM_READWRITE(ide_controller_extra_r, ide_controller_extra_w)
+ AM_RANGE(0x10000100, 0x1000013f) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", kinst_ide_r, kinst_ide_w)
+ AM_RANGE(0x10000170, 0x10000173) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", kinst_ide_extra_r, kinst_ide_extra_w)
AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION(REGION_USER1, 0) AM_BASE(&rombase)
ADDRESS_MAP_END
@@ -659,6 +685,8 @@ static MACHINE_DRIVER_START( kinst )
MDRV_MACHINE_START(kinst)
MDRV_MACHINE_RESET(kinst)
+
+ MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt)
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK )
@@ -868,38 +896,20 @@ ROM_END
static DRIVER_INIT( kinst )
{
static const UINT8 kinst_control_map[8] = { 0,1,2,3,4,5,6,7 };
- UINT8 *features;
dcs_init();
/* set up the control register mapping */
control_map = kinst_control_map;
- /* spin up the hard disk */
- ide_controller_init(0, &ide_intf);
-
- /* tweak the model number so we pass the check */
- features = ide_get_features(0);
- features[27*2+0] = 0x54;
- features[27*2+1] = 0x53;
- features[28*2+0] = 0x31;
- features[28*2+1] = 0x39;
- features[29*2+0] = 0x30;
- features[29*2+1] = 0x35;
- features[30*2+0] = 0x47;
- features[30*2+1] = 0x41;
- features[31*2+0] = 0x20;
- features[31*2+1] = 0x20;
-
/* optimize one of the non-standard loops */
- kinst_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x8808f5bc, 0x8808f5bf, 0, 0, kinst_speedup_r);
+ kinst_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8808f5bc, 0x8808f5bf, 0, 0, kinst_speedup_r);
}
static DRIVER_INIT( kinst2 )
{
static const UINT8 kinst2_control_map[8] = { 2,4,1,0,3,5,6,7 };
- UINT8 *features;
// read: $80 on ki2 = $90 on ki
// read: $88 on ki2 = $a0 on ki
@@ -913,24 +923,8 @@ static DRIVER_INIT( kinst2 )
/* set up the control register mapping */
control_map = kinst2_control_map;
- /* spin up the hard disk */
- ide_controller_init(0, &ide_intf);
-
- /* tweak the model number so we pass the check */
- features = ide_get_features(0);
- features[10*2+0] = 0x30;
- features[10*2+1] = 0x30;
- features[11*2+0] = 0x54;
- features[11*2+1] = 0x53;
- features[12*2+0] = 0x31;
- features[12*2+1] = 0x39;
- features[13*2+0] = 0x30;
- features[13*2+1] = 0x35;
- features[14*2+0] = 0x47;
- features[14*2+1] = 0x41;
-
/* optimize one of the non-standard loops */
- kinst_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x887ff544, 0x887ff547, 0, 0, kinst_speedup_r);
+ kinst_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x887ff544, 0x887ff547, 0, 0, kinst_speedup_r);
}
diff --git a/src/mame/drivers/konamigv.c b/src/mame/drivers/konamigv.c
index 5e5b25b824b..13511d99e70 100644
--- a/src/mame/drivers/konamigv.c
+++ b/src/mame/drivers/konamigv.c
@@ -546,10 +546,9 @@ static DRIVER_INIT( simpbowl )
intelflash_init( 2, FLASH_FUJITSU_29F016A, NULL );
intelflash_init( 3, FLASH_FUJITSU_29F016A, NULL );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f68008f, 0, 0, flash_r );
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f68008f, 0, 0, flash_w );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f6800c0, 0x1f6800c7, 0, 0, trackball_r );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f6800c8, 0x1f6800cb, 0, 0, unknown_r ); /* ?? */
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f68008f, 0, 0, flash_r, flash_w );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800c0, 0x1f6800c7, 0, 0, trackball_r );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800c8, 0x1f6800cb, 0, 0, unknown_r ); /* ?? */
DRIVER_INIT_CALL(konamigv);
}
@@ -634,11 +633,9 @@ static DRIVER_INIT( btchamp )
{
intelflash_init( 0, FLASH_SHARP_LH28F400, NULL );
- memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f68008f, 0, 0, btc_trackball_r );
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f68008f, 0, 0, btc_trackball_w );
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f6800e0, 0x1f6800e3, 0, 0, SMH_NOP );
- memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_r );
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_w );
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f68008f, 0, 0, btc_trackball_r, btc_trackball_w );
+ memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800e0, 0x1f6800e3, 0, 0, SMH_NOP );
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_r, btcflash_w );
DRIVER_INIT_CALL(konamigv);
}
@@ -692,8 +689,8 @@ static WRITE32_HANDLER( tokimeki_serial_w )
static DRIVER_INIT( tokimosh )
{
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f680083, 0, 0, tokimeki_serial_r );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f680090, 0x1f680093, 0, 0, tokimeki_serial_w );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f680083, 0, 0, tokimeki_serial_r );
+ memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f680090, 0x1f680093, 0, 0, tokimeki_serial_w );
DRIVER_INIT_CALL(konamigv);
}
@@ -723,14 +720,13 @@ static DRIVER_INIT( kdeadeye )
{
intelflash_init( 0, FLASH_SHARP_LH28F400, NULL );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f680083, 0, 0, input_port_3_dword_r );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f680090, 0x1f680093, 0, 0, input_port_4_dword_r );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f6800a0, 0x1f6800a3, 0, 0, input_port_5_dword_r );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f6800b0, 0x1f6800b3, 0, 0, input_port_6_dword_r );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f6800c0, 0x1f6800c3, 0, 0, input_port_7_dword_r );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f6800e0, 0x1f6800e3, 0, 0, kdeadeye_0_w );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_r );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_w );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f680080, 0x1f680083, 0, 0, input_port_3_dword_r );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f680090, 0x1f680093, 0, 0, input_port_4_dword_r );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800a0, 0x1f6800a3, 0, 0, input_port_5_dword_r );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800b0, 0x1f6800b3, 0, 0, input_port_6_dword_r );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800c0, 0x1f6800c3, 0, 0, input_port_7_dword_r );
+ memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f6800e0, 0x1f6800e3, 0, 0, kdeadeye_0_w );
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f380000, 0x1f3fffff, 0, 0, btcflash_r, btcflash_w );
DRIVER_INIT_CALL(konamigv);
}
diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c
index 2d77125d953..2fd917968ab 100644
--- a/src/mame/drivers/konamigx.c
+++ b/src/mame/drivers/konamigx.c
@@ -3551,8 +3551,8 @@ static DRIVER_INIT(konamigx)
switch (gameDefs[i].special)
{
case 1: // LE2 guns
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd44000, 0xd44003, 0, 0, le2_gun_H_r );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd44004, 0xd44007, 0, 0, le2_gun_V_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd44000, 0xd44003, 0, 0, le2_gun_H_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd44004, 0xd44007, 0, 0, le2_gun_V_r );
break;
case 2: // tkmmpzdm hack
@@ -3588,7 +3588,7 @@ static DRIVER_INIT(konamigx)
break;
case 7: // install type 4 Xilinx protection for non-type 3/4 games
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xcc0000, 0xcc0007, 0, 0, type4_prot_w );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xcc0000, 0xcc0007, 0, 0, type4_prot_w );
break;
case 8: // tbyahhoo
@@ -3603,14 +3603,14 @@ static DRIVER_INIT(konamigx)
switch (readback)
{
case BPP5:
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd4a000, 0xd4a00f, 0, 0, gx5bppspr_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd4a000, 0xd4a00f, 0, 0, gx5bppspr_r);
break;
case BPP66:
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd00000, 0xd01fff, 0, 0, K056832_6bpp_rom_long_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd00000, 0xd01fff, 0, 0, K056832_6bpp_rom_long_r);
case BPP6:
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xd4a000, 0xd4a00f, 0, 0, gx6bppspr_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd4a000, 0xd4a00f, 0, 0, gx6bppspr_r);
break;
}
diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c
index c3219e3a510..fc4a9a7f593 100644
--- a/src/mame/drivers/ksys573.c
+++ b/src/mame/drivers/ksys573.c
@@ -1678,8 +1678,7 @@ static DRIVER_INIT( ge765pwbba )
uPD4701_init( 0 );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, ge765pwbba_r );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, ge765pwbba_w );
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, ge765pwbba_r, ge765pwbba_w );
}
/*
@@ -1784,14 +1783,13 @@ static WRITE32_HANDLER( gx700pwbf_io_w )
}
}
-static void gx700pwfbf_init( void (*output_callback_func)( int offset, int data ) )
+static void gx700pwfbf_init( running_machine *machine, void (*output_callback_func)( int offset, int data ) )
{
memset( gx700pwbf_output_data, 0, sizeof( gx700pwbf_output_data ) );
gx700pwfbf_output_callback = output_callback_func;
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx700pwbf_io_r );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx700pwbf_io_w );
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx700pwbf_io_r, gx700pwbf_io_w );
state_save_register_global_array( gx700pwbf_output_data );
}
@@ -1976,7 +1974,7 @@ static DRIVER_INIT( ddr )
{
DRIVER_INIT_CALL(konami573);
- gx700pwfbf_init( gn845pwbb_output_callback );
+ gx700pwfbf_init( machine, gn845pwbb_output_callback );
state_save_register_global( stage_mask );
}
@@ -2034,8 +2032,7 @@ static DRIVER_INIT( gtrfrks )
{
DRIVER_INIT_CALL(konami573);
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_r );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_w );
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_r, gtrfrks_io_w );
}
/* GX894 digital i/o */
@@ -2319,14 +2316,13 @@ static WRITE32_HANDLER( gx894pwbba_w )
}
}
-static void gx894pwbba_init( void (*output_callback_func)( int offset, int data ) )
+static void gx894pwbba_init( running_machine *machine, void (*output_callback_func)( int offset, int data ) )
{
int gx894_ram_size = 24 * 1024 * 1024;
gx894pwbba_output_callback = output_callback_func;
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx894pwbba_r );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx894pwbba_w );
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f640000, 0x1f6400ff, 0, 0, gx894pwbba_r, gx894pwbba_w );
gx894_ram_write_offset = 0;
gx894_ram_read_offset = 0;
@@ -2344,7 +2340,7 @@ static DRIVER_INIT( ddrdigital )
{
DRIVER_INIT_CALL(konami573);
- gx894pwbba_init( gn845pwbb_output_callback );
+ gx894pwbba_init( machine, gn845pwbb_output_callback );
}
/* guitar freaks digital */
@@ -2353,10 +2349,9 @@ static DRIVER_INIT( gtrfrkdigital )
{
DRIVER_INIT_CALL(konami573);
- gx894pwbba_init( NULL );
+ gx894pwbba_init( machine, NULL );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_r );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_w );
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, gtrfrks_io_r, gtrfrks_io_w );
}
/* ddr solo */
@@ -2418,7 +2413,7 @@ static DRIVER_INIT( ddrsolo )
{
DRIVER_INIT_CALL(konami573);
- gx894pwbba_init( ddrsolo_output_callback );
+ gx894pwbba_init( machine, ddrsolo_output_callback );
}
/* drummania */
@@ -2491,14 +2486,14 @@ static DRIVER_INIT( drmn )
{
DRIVER_INIT_CALL(konami573);
- gx700pwfbf_init( drmn_output_callback );
+ gx700pwfbf_init( machine, drmn_output_callback );
}
static DRIVER_INIT( drmndigital )
{
DRIVER_INIT_CALL(konami573);
- gx894pwbba_init( drmn_output_callback );
+ gx894pwbba_init( machine, drmn_output_callback );
}
/* dance maniax */
@@ -2647,9 +2642,9 @@ static DRIVER_INIT( dmx )
{
DRIVER_INIT_CALL(konami573);
- gx894pwbba_init( dmx_output_callback );
+ gx894pwbba_init( machine, dmx_output_callback );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, dmx_io_w );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6000ff, 0, 0, dmx_io_w );
}
/* salary man champ */
diff --git a/src/mame/drivers/kyugo.c b/src/mame/drivers/kyugo.c
index 27c7cd4c539..f89b6bfd72f 100644
--- a/src/mame/drivers/kyugo.c
+++ b/src/mame/drivers/kyugo.c
@@ -1236,20 +1236,18 @@ ROM_END
static DRIVER_INIT( gyrodine )
{
/* add watchdog */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe000, 0, 0, watchdog_reset_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe000, 0, 0, watchdog_reset_w);
}
static DRIVER_INIT( srdmissn )
{
/* shared RAM is mapped at 0xe000 as well */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe7ff, 0, 0, SMH_BANK1);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe7ff, 0, 0, SMH_BANK1);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xe7ff, 0, 0, SMH_BANK1, SMH_BANK1);
memory_set_bankptr(1, shared_ram);
/* extra RAM on sub CPU */
- memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8800, 0x8fff, 0, 0, SMH_BANK2);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8800, 0x8fff, 0, 0, SMH_BANK2);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x8800, 0x8fff, 0, 0, SMH_BANK2, SMH_BANK2);
memory_set_bankptr(2, auto_malloc(0x800));
}
diff --git a/src/mame/drivers/leland.c b/src/mame/drivers/leland.c
index 0f75e413512..b034bc93c0c 100644
--- a/src/mame/drivers/leland.c
+++ b/src/mame/drivers/leland.c
@@ -1907,15 +1907,14 @@ static void dasm_chunk(char *tag, UINT8 *base, UINT16 pc, UINT32 length, FILE *o
}
#endif
-static void init_master_ports(UINT8 mvram_base, UINT8 io_base)
+static void init_master_ports(running_machine *machine, UINT8 mvram_base, UINT8 io_base)
{
/* set up the master CPU VRAM I/O */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, mvram_base, mvram_base + 0x1f, 0, 0, leland_mvram_port_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, mvram_base, mvram_base + 0x1f, 0, 0, leland_mvram_port_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, mvram_base, mvram_base + 0x1f, 0, 0, leland_mvram_port_r, leland_mvram_port_w);
/* set up the master CPU I/O ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, io_base, io_base + 0x1f, 0, 0, leland_master_input_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, io_base, io_base + 0x0f, 0, 0, leland_master_output_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, io_base, io_base + 0x1f, 0, 0, leland_master_input_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, io_base, io_base + 0x0f, 0, 0, leland_master_output_w);
}
@@ -1947,11 +1946,11 @@ static DRIVER_INIT( cerberus )
memory_set_bankptr(3, memory_region(REGION_CPU2) + 0x2000);
/* set up the master CPU I/O ports */
- init_master_ports(0x40, 0x80);
+ init_master_ports(machine, 0x40, 0x80);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x80, 0x80, 0, 0, cerberus_dial_1_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x90, 0x90, 0, 0, cerberus_dial_2_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x80, 0x80, 0, 0, cerberus_dial_1_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x90, 0x90, 0, 0, cerberus_dial_2_r);
}
@@ -1992,7 +1991,7 @@ static DRIVER_INIT( mayhem )
leland_update_master_bank = mayhem_bankswitch;
/* set up the master CPU I/O ports */
- init_master_ports(0x00, 0xc0);
+ init_master_ports(machine, 0x00, 0xc0);
}
@@ -2021,7 +2020,7 @@ static DRIVER_INIT( powrplay )
leland_update_master_bank = mayhem_bankswitch;
/* set up the master CPU I/O ports */
- init_master_ports(0x40, 0x80);
+ init_master_ports(machine, 0x40, 0x80);
}
@@ -2042,7 +2041,7 @@ static DRIVER_INIT( wseries )
leland_update_master_bank = mayhem_bankswitch;
/* set up the master CPU I/O ports */
- init_master_ports(0x40, 0x80);
+ init_master_ports(machine, 0x40, 0x80);
}
@@ -2065,12 +2064,12 @@ static DRIVER_INIT( alleymas )
leland_update_master_bank = mayhem_bankswitch;
/* set up the master CPU I/O ports */
- init_master_ports(0x00, 0xc0);
+ init_master_ports(machine, 0x00, 0xc0);
/* kludge warning: the game uses location E0CA to determine if the joysticks are available */
/* it gets cleared by the code, but there is no obvious way for the value to be set to a */
/* non-zero value. If the value is zero, the joystick is never read. */
- alleymas_kludge_mem = memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe0ca, 0xe0ca, 0, 0, alleymas_joystick_kludge);
+ alleymas_kludge_mem = memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe0ca, 0xe0ca, 0, 0, alleymas_joystick_kludge);
}
@@ -2095,7 +2094,7 @@ static DRIVER_INIT( upyoural )
leland_update_master_bank = mayhem_bankswitch;
/* set up the master CPU I/O ports */
- init_master_ports(0x00, 0xc0);
+ init_master_ports(machine, 0x00, 0xc0);
}
@@ -2120,12 +2119,12 @@ static DRIVER_INIT( dangerz )
leland_update_master_bank = dangerz_bankswitch;
/* set up the master CPU I/O ports */
- init_master_ports(0x40, 0x80);
+ init_master_ports(machine, 0x40, 0x80);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf4, 0xf4, 0, 0, dangerz_input_upper_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, dangerz_input_y_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, dangerz_input_x_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf4, 0xf4, 0, 0, dangerz_input_upper_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, dangerz_input_y_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, dangerz_input_x_r);
}
@@ -2146,7 +2145,7 @@ static DRIVER_INIT( basebal2 )
leland_update_master_bank = basebal2_bankswitch;
/* set up the master CPU I/O ports */
- init_master_ports(0x00, 0xc0);
+ init_master_ports(machine, 0x00, 0xc0);
}
@@ -2168,7 +2167,7 @@ static DRIVER_INIT( dblplay )
leland_update_master_bank = basebal2_bankswitch;
/* set up the master CPU I/O ports */
- init_master_ports(0x80, 0x40);
+ init_master_ports(machine, 0x80, 0x40);
}
@@ -2190,7 +2189,7 @@ static DRIVER_INIT( strkzone )
leland_update_master_bank = basebal2_bankswitch;
/* set up the master CPU I/O ports */
- init_master_ports(0x00, 0x40);
+ init_master_ports(machine, 0x00, 0x40);
}
@@ -2213,13 +2212,13 @@ static DRIVER_INIT( redlin2p )
leland_rotate_memory(0);
/* set up the master CPU I/O ports */
- init_master_ports(0x00, 0xc0);
+ init_master_ports(machine, 0x00, 0xc0);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, redline_pedal_1_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xd0, 0xd0, 0, 0, redline_pedal_2_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, redline_wheel_2_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfb, 0xfb, 0, 0, redline_wheel_1_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc0, 0, 0, redline_pedal_1_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xd0, 0xd0, 0, 0, redline_pedal_2_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, redline_wheel_2_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfb, 0xfb, 0, 0, redline_wheel_1_r);
}
@@ -2244,7 +2243,7 @@ static DRIVER_INIT( quarterb )
leland_rotate_memory(0);
/* set up the master CPU I/O ports */
- init_master_ports(0x40, 0x80);
+ init_master_ports(machine, 0x40, 0x80);
}
@@ -2271,12 +2270,12 @@ static DRIVER_INIT( viper )
leland_rotate_memory(1);
/* set up the master CPU I/O ports */
- init_master_ports(0x00, 0xc0);
+ init_master_ports(machine, 0x00, 0xc0);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xa4, 0xa4, 0, 0, dangerz_input_upper_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xb8, 0xb8, 0, 0, dangerz_input_y_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xbc, 0xbc, 0, 0, dangerz_input_x_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xa4, 0xa4, 0, 0, dangerz_input_upper_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb8, 0xb8, 0, 0, dangerz_input_y_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xbc, 0xbc, 0, 0, dangerz_input_x_r);
}
@@ -2302,11 +2301,11 @@ static DRIVER_INIT( teamqb )
leland_rotate_memory(1);
/* set up the master CPU I/O ports */
- init_master_ports(0x40, 0x80);
+ init_master_ports(machine, 0x40, 0x80);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r);
}
@@ -2332,11 +2331,11 @@ static DRIVER_INIT( aafb )
leland_rotate_memory(1);
/* set up the master CPU I/O ports */
- init_master_ports(0x00, 0xc0);
+ init_master_ports(machine, 0x00, 0xc0);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r);
}
@@ -2362,11 +2361,11 @@ static DRIVER_INIT( aafbb )
leland_rotate_memory(1);
/* set up the master CPU I/O ports */
- init_master_ports(0x80, 0x40);
+ init_master_ports(machine, 0x80, 0x40);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r);
}
@@ -2392,11 +2391,11 @@ static DRIVER_INIT( aafbd2p )
leland_rotate_memory(1);
/* set up the master CPU I/O ports */
- init_master_ports(0x00, 0x40);
+ init_master_ports(machine, 0x00, 0x40);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7c, 0x7c, 0, 0, input_port_10_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_11_r);
}
@@ -2427,13 +2426,13 @@ static DRIVER_INIT( offroad )
leland_rotate_memory(1);
/* set up the master CPU I/O ports */
- init_master_ports(0x00, 0xc0);
- init_master_ports(0x40, 0x80); /* yes, this is intentional */
+ init_master_ports(machine, 0x00, 0xc0);
+ init_master_ports(machine, 0x40, 0x80); /* yes, this is intentional */
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, offroad_wheel_3_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf9, 0xf9, 0, 0, offroad_wheel_1_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfb, 0xfb, 0, 0, offroad_wheel_2_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, offroad_wheel_3_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf9, 0xf9, 0, 0, offroad_wheel_1_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfb, 0xfb, 0, 0, offroad_wheel_2_r);
}
@@ -2464,12 +2463,12 @@ static DRIVER_INIT( offroadt )
leland_rotate_memory(1);
/* set up the master CPU I/O ports */
- init_master_ports(0x80, 0x40);
+ init_master_ports(machine, 0x80, 0x40);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, offroad_wheel_3_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf9, 0xf9, 0, 0, offroad_wheel_1_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfb, 0xfb, 0, 0, offroad_wheel_2_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, offroad_wheel_3_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf9, 0xf9, 0, 0, offroad_wheel_1_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfb, 0xfb, 0, 0, offroad_wheel_2_r);
}
@@ -2498,10 +2497,10 @@ static DRIVER_INIT( pigout )
leland_rotate_memory(1);
/* set up the master CPU I/O ports */
- init_master_ports(0x00, 0x40);
+ init_master_ports(machine, 0x00, 0x40);
/* set up additional input ports */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_4_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, input_port_4_r);
}
diff --git a/src/mame/drivers/lethalj.c b/src/mame/drivers/lethalj.c
index 372565310d8..8d7d733f3e3 100644
--- a/src/mame/drivers/lethalj.c
+++ b/src/mame/drivers/lethalj.c
@@ -776,21 +776,21 @@ ROM_END
static DRIVER_INIT( ripribit )
{
ticket_dispenser_init(200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, ripribit_control_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, ripribit_control_w);
}
static DRIVER_INIT( cfarm )
{
ticket_dispenser_init(200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, cfarm_control_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, cfarm_control_w);
}
static DRIVER_INIT( cclownz )
{
ticket_dispenser_init(200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, cclownz_control_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, cclownz_control_w);
}
diff --git a/src/mame/drivers/liberate.c b/src/mame/drivers/liberate.c
index 6ef7fb9d6d9..5f23cf9ebcd 100644
--- a/src/mame/drivers/liberate.c
+++ b/src/mame/drivers/liberate.c
@@ -928,7 +928,7 @@ static DRIVER_INIT( yellowcb )
{
DRIVER_INIT_CALL(prosport);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, input_port_0_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, input_port_0_r);
}
static DRIVER_INIT( liberate )
diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c
index 0c06c400659..272ac9e4ed1 100644
--- a/src/mame/drivers/limenko.c
+++ b/src/mame/drivers/limenko.c
@@ -845,17 +845,17 @@ static READ32_HANDLER( spotty_speedup_r )
static DRIVER_INIT( dynabomb )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xe2784, 0xe2787, 0, 0, dynabomb_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe2784, 0xe2787, 0, 0, dynabomb_speedup_r );
}
static DRIVER_INIT( legendoh )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x32ab0, 0x32ab3, 0, 0, legendoh_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x32ab0, 0x32ab3, 0, 0, legendoh_speedup_r );
}
static DRIVER_INIT( sb2003 )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x135800, 0x135803, 0, 0, sb2003_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x135800, 0x135803, 0, 0, sb2003_speedup_r );
}
static DRIVER_INIT( spotty )
@@ -873,7 +873,7 @@ static DRIVER_INIT( spotty )
dst[x+2] = (src[x+1]&0x0f) >> 0;
}
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6626c, 0x6626f, 0, 0, spotty_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6626c, 0x6626f, 0, 0, spotty_speedup_r );
}
GAME( 2000, dynabomb, 0, limenko, sb2003, dynabomb, ROT0, "Limenko", "Dynamite Bomber (Korea, Rev 1.5)", GAME_NO_SOUND )
diff --git a/src/mame/drivers/lkage.c b/src/mame/drivers/lkage.c
index 753b5a2e783..9983609c012 100644
--- a/src/mame/drivers/lkage.c
+++ b/src/mame/drivers/lkage.c
@@ -559,9 +559,9 @@ static READ8_HANDLER( fake_status_r )
static DRIVER_INIT( lkageb )
{
- memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf062, 0xf062, 0, 0, fake_mcu_r);
- memory_install_read8_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf087, 0xf087, 0, 0, fake_status_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf062, 0xf062, 0, 0, fake_mcu_w );
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf062, 0xf062, 0, 0, fake_mcu_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf087, 0xf087, 0, 0, fake_status_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf062, 0xf062, 0, 0, fake_mcu_w );
}
GAME( 1984, lkage, 0, lkage, lkage, 0, ROT0, "Taito Corporation", "The Legend of Kage", 0 )
diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c
index e4724c5b968..d211e2c38ea 100644
--- a/src/mame/drivers/looping.c
+++ b/src/mame/drivers/looping.c
@@ -781,7 +781,7 @@ static DRIVER_INIT( looping )
rom[i] = BITSWAP8(rom[i], 0,1,2,3,4,5,6,7);
/* install protection handlers */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7007, 0, 0, protection_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7007, 0, 0, protection_r);
}
diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c
index 72dfefc5356..c14b0c9b65c 100644
--- a/src/mame/drivers/m72.c
+++ b/src/mame/drivers/m72.c
@@ -475,57 +475,57 @@ static WRITE16_HANDLER( protection_w )
copy_le(&protection_ram[0x0fe0],protection_crc,CRC_LEN);
}
-static void install_protection_handler(const UINT8 *code,const UINT8 *crc)
+static void install_protection_handler(running_machine *machine, const UINT8 *code,const UINT8 *crc)
{
protection_ram = auto_malloc(0x1000);
protection_code = code;
protection_crc = crc;
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, SMH_BANK1);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0ffa, 0xb0ffb, 0, 0, protection_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, protection_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, SMH_BANK1);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0ffa, 0xb0ffb, 0, 0, protection_r);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, protection_w);
memory_set_bankptr(1, protection_ram);
}
static DRIVER_INIT( bchopper )
{
- install_protection_handler(bchopper_code,bchopper_crc);
+ install_protection_handler(machine, bchopper_code,bchopper_crc);
- memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, bchopper_sample_trigger_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, bchopper_sample_trigger_w);
}
static DRIVER_INIT( mrheli )
{
- install_protection_handler(bchopper_code,mrheli_crc);
+ install_protection_handler(machine, bchopper_code,mrheli_crc);
- memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, bchopper_sample_trigger_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, bchopper_sample_trigger_w);
}
static DRIVER_INIT( nspirit )
{
- install_protection_handler(nspirit_code,nspirit_crc);
+ install_protection_handler(machine, nspirit_code,nspirit_crc);
- memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, nspirit_sample_trigger_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, nspirit_sample_trigger_w);
}
static DRIVER_INIT( nspiritj )
{
- install_protection_handler(nspirit_code,nspiritj_crc);
+ install_protection_handler(machine, nspirit_code,nspiritj_crc);
- memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, nspirit_sample_trigger_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, nspirit_sample_trigger_w);
}
static DRIVER_INIT( imgfight )
{
- install_protection_handler(imgfight_code,imgfight_crc);
+ install_protection_handler(machine, imgfight_code,imgfight_crc);
- memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, imgfight_sample_trigger_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, imgfight_sample_trigger_w);
}
static DRIVER_INIT( loht )
{
- install_protection_handler(loht_code,loht_crc);
+ install_protection_handler(machine, loht_code,loht_crc);
- memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, loht_sample_trigger_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, loht_sample_trigger_w);
/* since we skip the startup tests, clear video RAM to prevent garbage on title screen */
memset(m72_videoram2,0,0x4000);
@@ -546,45 +546,44 @@ static DRIVER_INIT( loht_mcu )
protection_ram = auto_malloc(0x10000);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, m72_main_mcu_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, m72_main_mcu_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0fff, 0, 0, m72_main_mcu_r, m72_main_mcu_w);
- memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, loht_sample_trigger_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, loht_sample_trigger_w);
}
static DRIVER_INIT( xmultipl )
{
- install_protection_handler(xmultipl_code,xmultipl_crc);
+ install_protection_handler(machine, xmultipl_code,xmultipl_crc);
- memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, xmultipl_sample_trigger_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, xmultipl_sample_trigger_w);
}
static DRIVER_INIT( dbreed72 )
{
- install_protection_handler(dbreed72_code,dbreed72_crc);
+ install_protection_handler(machine, dbreed72_code,dbreed72_crc);
- memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, dbreed72_sample_trigger_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, dbreed72_sample_trigger_w);
}
static DRIVER_INIT( airduel )
{
- install_protection_handler(airduel_code,airduel_crc);
+ install_protection_handler(machine, airduel_code,airduel_crc);
- memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, airduel_sample_trigger_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, airduel_sample_trigger_w);
}
static DRIVER_INIT( dkgenm72 )
{
- install_protection_handler(dkgenm72_code,dkgenm72_crc);
+ install_protection_handler(machine, dkgenm72_code,dkgenm72_crc);
- memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, dkgenm72_sample_trigger_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, dkgenm72_sample_trigger_w);
}
static DRIVER_INIT( gallop )
{
- memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, gallop_sample_trigger_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0xc0, 0xc1, 0, 0, gallop_sample_trigger_w);
}
diff --git a/src/mame/drivers/m92.c b/src/mame/drivers/m92.c
index eef3d97c839..21344470af2 100644
--- a/src/mame/drivers/m92.c
+++ b/src/mame/drivers/m92.c
@@ -2060,8 +2060,7 @@ static DRIVER_INIT( majtitl2 )
init_m92(machine, 1);
/* This game has an eprom on the game board */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0000, 0xf3fff, 0, 0, m92_eeprom_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf0000, 0xf3fff, 0, 0, m92_eeprom_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0000, 0xf3fff, 0, 0, m92_eeprom_r, m92_eeprom_w);
m92_game_kludge=2;
}
@@ -2083,7 +2082,7 @@ static DRIVER_INIT( lethalth )
m92_irq_vectorbase=0x20;
/* NOP out the bankswitcher */
- memory_install_write16_handler(0, ADDRESS_SPACE_IO, 0x20, 0x21, 0, 0, SMH_NOP);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x20, 0x21, 0, 0, SMH_NOP);
}
static DRIVER_INIT( nbbatman )
diff --git a/src/mame/drivers/macrossp.c b/src/mame/drivers/macrossp.c
index 97eb6d8fa86..320bad86b9d 100644
--- a/src/mame/drivers/macrossp.c
+++ b/src/mame/drivers/macrossp.c
@@ -683,7 +683,7 @@ PC :00018110 018110: beq 18104
static DRIVER_INIT( macrossp )
{
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xf10158, 0xf1015b, 0, 0, macrossp_speedup_w );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf10158, 0xf1015b, 0, 0, macrossp_speedup_w );
}
static DRIVER_INIT( quizmoon )
diff --git a/src/mame/drivers/mainsnk.c b/src/mame/drivers/mainsnk.c
index 89534f783e9..63c98c5f3b6 100644
--- a/src/mame/drivers/mainsnk.c
+++ b/src/mame/drivers/mainsnk.c
@@ -458,7 +458,7 @@ ROM_END
static DRIVER_INIT ( canvas )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc000, 0, 0, input_port_0_r );
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc000, 0, 0, input_port_0_r );
}
ROM_START( canvas )
diff --git a/src/mame/drivers/mappy.c b/src/mame/drivers/mappy.c
index c7a7d2da568..6650a752dd4 100644
--- a/src/mame/drivers/mappy.c
+++ b/src/mame/drivers/mappy.c
@@ -2128,7 +2128,7 @@ static DRIVER_INIT( grobda )
However, removing the 15XX from the board causes sound to disappear completely, so
the DAC might be built-in after all.
*/
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0002, 0x0002, 0, 0, grobda_DAC_w );
+ memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0002, 0x0002, 0, 0, grobda_DAC_w );
DRIVER_INIT_CALL(58_56);
}
@@ -2136,7 +2136,7 @@ static DRIVER_INIT( grobda )
static DRIVER_INIT( digdug2 )
{
/* appears to not use the watchdog */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0, SMH_NOP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8000, 0, 0, SMH_NOP);
DRIVER_INIT_CALL(58_56);
}
diff --git a/src/mame/drivers/mcr.c b/src/mame/drivers/mcr.c
index e9dd9c50433..14df1dee8ba 100644
--- a/src/mame/drivers/mcr.c
+++ b/src/mame/drivers/mcr.c
@@ -2470,8 +2470,7 @@ static DRIVER_INIT( twotiger )
mcr_init(90010, 91399, 90913);
mcr_sound_init(MCR_SSIO);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0x1000, twotiger_videoram_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0x1000, twotiger_videoram_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe800, 0xefff, 0, 0x1000, twotiger_videoram_r, twotiger_videoram_w);
}
diff --git a/src/mame/drivers/mcr3.c b/src/mame/drivers/mcr3.c
index da37b632bbe..c57ff9039ae 100644
--- a/src/mame/drivers/mcr3.c
+++ b/src/mame/drivers/mcr3.c
@@ -1468,26 +1468,26 @@ static void mcr_common_init(int sound_board)
static DRIVER_INIT( demoderm )
{
mcr_common_init(MCR_TURBO_CHIP_SQUEAK);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x01, 0x01, 0, 0, demoderm_ip1_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, demoderm_ip2_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, demoderm_op6_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x01, 0x01, 0, 0, demoderm_ip1_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, demoderm_ip2_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, demoderm_op6_w);
}
static DRIVER_INIT( sarge )
{
mcr_common_init(MCR_TURBO_CHIP_SQUEAK);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, turbocs_data_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, turbocs_data_w);
}
static DRIVER_INIT( maxrpm )
{
mcr_common_init(MCR_TURBO_CHIP_SQUEAK);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x01, 0x01, 0, 0, maxrpm_ip1_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, maxrpm_ip2_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, maxrpm_op5_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, maxrpm_op6_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x01, 0x01, 0, 0, maxrpm_ip1_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, maxrpm_ip2_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, maxrpm_op5_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, maxrpm_op6_w);
state_save_register_global(maxrpm_adc_control);
state_save_register_global(maxrpm_adc_select);
@@ -1500,26 +1500,26 @@ static DRIVER_INIT( maxrpm )
static DRIVER_INIT( rampage )
{
mcr_common_init(MCR_SOUNDS_GOOD);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, rampage_ip4_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, rampage_op6_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, rampage_ip4_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, rampage_op6_w);
}
static DRIVER_INIT( powerdrv )
{
mcr_common_init(MCR_SOUNDS_GOOD);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, powerdrv_ip2_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, powerdrv_op5_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, powerdrv_op6_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, powerdrv_ip2_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, powerdrv_op5_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, powerdrv_op6_w);
}
static DRIVER_INIT( stargrds )
{
mcr_common_init(MCR_SOUNDS_GOOD);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0, stargrds_ip0_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, stargrds_op5_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, stargrds_op6_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0, stargrds_ip0_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, stargrds_op5_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x06, 0x06, 0, 0, stargrds_op6_w);
}
@@ -1558,7 +1558,7 @@ static DRIVER_INIT( turbotag )
cpunum_suspend(1, SUSPEND_REASON_DISABLE, 1);
/* kludge for bad ROM read */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0b53, 0x0b53, 0, 0, turbotag_kludge_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0b53, 0x0b53, 0, 0, turbotag_kludge_r);
}
diff --git a/src/mame/drivers/mcr68.c b/src/mame/drivers/mcr68.c
index db168b354f5..e54b8d98f24 100644
--- a/src/mame/drivers/mcr68.c
+++ b/src/mame/drivers/mcr68.c
@@ -1397,7 +1397,7 @@ static DRIVER_INIT( xenophob )
mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * (256 + 16));
/* install control port handler */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, xenophobe_control_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, xenophobe_control_w);
}
@@ -1409,9 +1409,9 @@ static DRIVER_INIT( spyhunt2 )
mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * (256 + 16));
/* analog port handling is a bit tricky */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, spyhunt2_control_w);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0d0000, 0x0dffff, 0, 0, spyhunt2_port_0_r);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0e0000, 0x0effff, 0, 0, spyhunt2_port_1_r);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, spyhunt2_control_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0d0000, 0x0dffff, 0, 0, spyhunt2_port_0_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0e0000, 0x0effff, 0, 0, spyhunt2_port_1_r);
}
@@ -1425,11 +1425,10 @@ static DRIVER_INIT( blasted )
mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * (256 + 16));
/* handle control writes */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, blasted_control_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, blasted_control_w);
/* 6840 is mapped to the lower 8 bits */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_w);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_r);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_r, mcr68_6840_lower_w);
}
@@ -1441,14 +1440,13 @@ static DRIVER_INIT( archrivl )
mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * (256 + 16));
/* handle control writes */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, archrivl_control_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, archrivl_control_w);
/* 49-way joystick handling is a bit tricky */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0e0000, 0x0effff, 0, 0, archrivl_port_1_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0e0000, 0x0effff, 0, 0, archrivl_port_1_r);
/* 6840 is mapped to the lower 8 bits */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_w);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_r);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_r, mcr68_6840_lower_w);
}
diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c
index f33f709ec20..4d806fb3fe4 100644
--- a/src/mame/drivers/mediagx.c
+++ b/src/mame/drivers/mediagx.c
@@ -64,9 +64,8 @@
*/
#include "driver.h"
-#include "deprecat.h"
-#include "memconv.h"
#include "devconv.h"
+#include "deprecat.h"
#include "machine/8237dma.h"
#include "machine/pic8259.h"
#include "machine/pit8253.h"
@@ -157,6 +156,7 @@ static struct {
#define DC_CFIFO_DIAG 0x7c/4
+static void ide_interrupt(const device_config *device, int state);
@@ -367,36 +367,25 @@ static WRITE8_DEVICE_HANDLER(at_dma8237_2_w)
dma8237_w(device, offset / 2, data);
}
-static READ32_DEVICE_HANDLER(at32_dma8237_2_r)
-{
- return read32le_with_read8_device_handler(at_dma8237_2_r, device, offset, mem_mask);
-}
-
-static WRITE32_DEVICE_HANDLER(at32_dma8237_2_w)
-{
- write32le_with_write8_device_handler(at_dma8237_2_w, device, offset, data, mem_mask);
-}
-
-
-static READ32_HANDLER( ide0_r )
+static READ32_DEVICE_HANDLER( ide_r )
{
- return ide_controller32_0_r(machine, 0x1f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
}
-static WRITE32_HANDLER( ide0_w )
+static WRITE32_DEVICE_HANDLER( ide_w )
{
- ide_controller32_0_w(machine, 0x1f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
}
-static READ32_HANDLER( fdc_r )
+static READ32_DEVICE_HANDLER( fdc_r )
{
- return ide_controller32_0_r(machine, 0x3f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
}
-static WRITE32_HANDLER( fdc_w )
+static WRITE32_DEVICE_HANDLER( fdc_w )
{
- ide_controller32_0_w(machine, 0x3f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
}
@@ -833,22 +822,6 @@ static const struct dma8237_interface dma8237_2_config =
NULL
};
-static READ32_HANDLER(at_page32_r)
-{
- return read32le_with_read8_handler(at_page8_r, machine, offset, mem_mask);
-}
-
-
-static WRITE32_HANDLER(at_page32_w)
-{
- write32le_with_write8_handler(at_page8_w, machine, offset, data, mem_mask);
-}
-
-
-DEV_READWRITE8TO32LE( mediagx_pit8254_32le, pit8253_r, pit8253_w )
-DEV_READWRITE8TO32LE( mediagx_dma8237_32le, dma8237_r, dma8237_w )
-DEV_READWRITE8TO32LE( mediagx_pic8259_32le, pic8259_r, pic8259_w )
-
/*****************************************************************************/
@@ -866,18 +839,18 @@ static ADDRESS_MAP_START( mediagx_map, ADDRESS_SPACE_PROGRAM, 32 )
ADDRESS_MAP_END
static ADDRESS_MAP_START(mediagx_io, ADDRESS_SPACE_IO, 32)
- AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE(DMA8237, "dma8237_1", mediagx_dma8237_32le_r, mediagx_dma8237_32le_w)
+ AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8(DMA8237, "dma8237_1", dma8237_r, dma8237_w, 0xffffffff)
AM_RANGE(0x0020, 0x0023) AM_READWRITE(io20_r, io20_w)
- AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE(PIT8254, "pit8254", mediagx_pit8254_32le_r, mediagx_pit8254_32le_w)
+ AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8(PIT8254, "pit8254", pit8253_r, pit8253_w, 0xffffffff)
AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_32le_r, kbdc8042_32le_w)
AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r, mc146818_port32le_w)
- AM_RANGE(0x0080, 0x009f) AM_READWRITE(at_page32_r, at_page32_w)
- AM_RANGE(0x00a0, 0x00af) AM_DEVREADWRITE(PIC8259, "pic8259_2", mediagx_pic8259_32le_r, mediagx_pic8259_32le_w)
- AM_RANGE(0x00c0, 0x00cf) AM_DEVREADWRITE(DMA8237, "dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w)
+ AM_RANGE(0x0080, 0x009f) AM_READWRITE8(at_page8_r, at_page8_w, 0xffffffff)
+ AM_RANGE(0x00a0, 0x00af) AM_DEVREADWRITE8(PIC8259, "pic8259_2", pic8259_r, pic8259_w, 0xffffffff)
+ AM_RANGE(0x00c0, 0x00cf) AM_DEVREADWRITE8(DMA8237, "dma8237_2", at_dma8237_2_r, at_dma8237_2_w, 0xffffffff)
AM_RANGE(0x00e8, 0x00eb) AM_NOP // I/O delay port
- AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide0_r, ide0_w)
+ AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_r, ide_w)
AM_RANGE(0x0378, 0x037b) AM_READWRITE(parallel_port_r, parallel_port_w)
- AM_RANGE(0x03f0, 0x03ff) AM_READWRITE(fdc_r, fdc_w)
+ AM_RANGE(0x03f0, 0x03ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", fdc_r, fdc_w)
AM_RANGE(0x0400, 0x04ff) AM_READWRITE(ad1847_r, ad1847_w)
AM_RANGE(0x0cf8, 0x0cff) AM_READWRITE(pci_32le_r, pci_32le_w)
ADDRESS_MAP_END
@@ -973,6 +946,15 @@ static IRQ_CALLBACK(irq_callback)
return r;
}
+static MACHINE_START(mediagx)
+{
+ mediagx_devices.pit8254 = device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" );
+ mediagx_devices.pic8259_1 = device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_1" );
+ mediagx_devices.pic8259_2 = device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_2" );
+ mediagx_devices.dma8237_1 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" );
+ mediagx_devices.dma8237_2 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" );
+}
+
static MACHINE_RESET(mediagx)
{
UINT8 *rom = memory_region(REGION_USER1);
@@ -988,13 +970,7 @@ static MACHINE_RESET(mediagx)
timer_adjust_oneshot(sound_timer, ATTOTIME_IN_MSEC(10), 0);
dmadac_enable(0, 2, 1);
- ide_controller_reset(0);
-
- mediagx_devices.pit8254 = device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" );
- mediagx_devices.pic8259_1 = device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_1" );
- mediagx_devices.pic8259_2 = device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_2" );
- mediagx_devices.dma8237_1 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" );
- mediagx_devices.dma8237_2 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" );
+ devtag_reset(machine, IDE_CONTROLLER, "ide");
}
/*************************************************************
@@ -1062,6 +1038,7 @@ static MACHINE_DRIVER_START(mediagx)
MDRV_CPU_PROGRAM_MAP(mediagx_map, 0)
MDRV_CPU_IO_MAP(mediagx_io, 0)
+ MDRV_MACHINE_START(mediagx)
MDRV_MACHINE_RESET(mediagx)
MDRV_DEVICE_ADD( "pit8254", PIT8254 )
@@ -1078,6 +1055,8 @@ static MACHINE_DRIVER_START(mediagx)
MDRV_DEVICE_ADD( "pic8259_2", PIC8259 )
MDRV_DEVICE_CONFIG( mediagx_pic8259_2_config )
+
+ MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt)
MDRV_NVRAM_HANDLER( mc146818 )
@@ -1114,7 +1093,7 @@ static void keyboard_interrupt(int state)
pic8259_set_irq_line(mediagx_devices.pic8259_1, 1, state);
}
-static void ide_interrupt(int state)
+static void ide_interrupt(const device_config *device, int state)
{
pic8259_set_irq_line(mediagx_devices.pic8259_2, 6, state);
}
@@ -1128,11 +1107,6 @@ static const struct kbdc8042_interface at8042 =
KBDC8042_AT386, set_gate_a20, keyboard_interrupt, mediagx_get_out2
};
-static const struct ide_interface ide_intf =
-{
- ide_interrupt
-};
-
static const struct pci_device_info cx5510 =
{
cx5510_pci_r,
@@ -1152,8 +1126,6 @@ static void init_mediagx(running_machine *machine)
pci_add_device(0, 18, &cx5510);
kbdc8042_init(&at8042);
-
- ide_controller_init(0, &ide_intf);
}
#if SPEEDUP_HACKS
@@ -1219,7 +1191,7 @@ static void install_speedups(running_machine *machine, speedup_entry *entries, i
speedup_count = count;
for (i = 0; i < count; i++)
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, entries[i].offset, entries[i].offset + 3, 0, 0, speedup_handlers[i]);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, entries[i].offset, entries[i].offset + 3, 0, 0, speedup_handlers[i]);
#ifdef MAME_DEBUG
add_exit_callback(machine, report_speedups);
diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c
index 47d0e93acbb..f8bd13c95ea 100644
--- a/src/mame/drivers/megadriv.c
+++ b/src/mame/drivers/megadriv.c
@@ -2916,7 +2916,7 @@ static UINT8 megadrive_io_read_data_port_svp(int portnum)
return megadrive_io_read_data_port_3button(portnum);
}
-static void svp_init(void)
+static void svp_init(running_machine *machine)
{
UINT8 *ROM;
@@ -2924,12 +2924,12 @@ static void svp_init(void)
/* SVP stuff */
svp.dram = auto_malloc(0x20000);
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x31ffff, 0, 0, SMH_BANK2, SMH_BANK2);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x31ffff, 0, 0, SMH_BANK2, SMH_BANK2);
memory_set_bankptr( 2, svp.dram );
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa15000, 0xa150ff, 0, 0, svp_68k_io_r, svp_68k_io_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa15000, 0xa150ff, 0, 0, svp_68k_io_r, svp_68k_io_w);
// "cell arrange" 1 and 2
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x390000, 0x39ffff, 0, 0, svp_68k_cell1_r);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3a0000, 0x3affff, 0, 0, svp_68k_cell2_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x390000, 0x39ffff, 0, 0, svp_68k_cell1_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3a0000, 0x3affff, 0, 0, svp_68k_cell2_r);
svp.iram = auto_malloc(0x800);
memory_set_bankptr( 3, svp.iram );
@@ -5186,7 +5186,7 @@ DRIVER_INIT( megadrie )
DRIVER_INIT( megadsvp )
{
megadriv_init_common(machine);
- svp_init();
+ svp_init(machine);
hazemdchoice_megadrive_region_export = 1;
hazemdchoice_megadrive_region_pal = 0;
hazemdchoice_megadriv_framerate = 60;
@@ -5218,41 +5218,30 @@ static WRITE8_HANDLER( z80_unmapped_w )
/* sets the megadrive z80 to it's normal ports / map */
-void megatech_set_megadrive_z80_as_megadrive_z80(void)
+void megatech_set_megadrive_z80_as_megadrive_z80(running_machine *machine)
{
/* INIT THE PORTS *********************************************************************************************/
- memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_r);
- memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_w);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_r, z80_unmapped_port_w);
/* catch any addresses that don't get mapped */
- memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_w);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r, z80_unmapped_w);
- memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK1);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK1);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK1, SMH_BANK1);
memory_set_bankptr( 1, genz80.z80_prgram );
- memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK6);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK6);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK6, SMH_BANK6);
memory_set_bankptr( 6, genz80.z80_prgram );
// not allowed??
-// memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK1);
-// memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK1);
-
- memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4003, 0, 0, megadriv_z80_YM2612_read);
- memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x6100, 0x7eff, 0, 0, megadriv_z80_unmapped_read);
- memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x7f00, 0x7fff, 0, 0, megadriv_z80_vdp_read);
- memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, z80_read_68k_banked_data);
-
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4003, 0, 0, megadriv_z80_YM2612_write);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x7f00, 0x7fff, 0, 0, megadriv_z80_vdp_write);
-
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, megadriv_z80_z80_bank_w);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x6001, 0x6001, 0, 0, megadriv_z80_z80_bank_w);
-
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, z80_write_68k_banked_data);
+// memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK1, SMH_BANK1);
+
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4003, 0, 0, megadriv_z80_YM2612_read, megadriv_z80_YM2612_write);
+ memory_install_write8_handler (machine, 1, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6000, 0, 0, megadriv_z80_z80_bank_w);
+ memory_install_write8_handler (machine, 1, ADDRESS_SPACE_PROGRAM, 0x6001, 0x6001, 0, 0, megadriv_z80_z80_bank_w);
+ memory_install_read8_handler (machine, 1, ADDRESS_SPACE_PROGRAM, 0x6100, 0x7eff, 0, 0, megadriv_z80_unmapped_read);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x7f00, 0x7fff, 0, 0, megadriv_z80_vdp_read, megadriv_z80_vdp_write);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, z80_read_68k_banked_data, z80_write_68k_banked_data);
}
diff --git a/src/mame/drivers/megadriv.h b/src/mame/drivers/megadriv.h
index f7fa0ae4480..bd50f98541e 100644
--- a/src/mame/drivers/megadriv.h
+++ b/src/mame/drivers/megadriv.h
@@ -20,7 +20,7 @@ extern UINT16* megadrive_ram;
extern UINT8 megatech_bios_port_cc_dc_r(int offset, int ctrl);
extern void megadriv_stop_scanline_timer(void);
-void megatech_set_megadrive_z80_as_megadrive_z80(void);
+void megatech_set_megadrive_z80_as_megadrive_z80(running_machine *machine);
extern READ8_HANDLER (megatech_sms_ioport_dc_r);
extern READ8_HANDLER (megatech_sms_ioport_dd_r);
diff --git a/src/mame/drivers/megaplay.c b/src/mame/drivers/megaplay.c
index 33db226cd54..91819ad0a01 100644
--- a/src/mame/drivers/megaplay.c
+++ b/src/mame/drivers/megaplay.c
@@ -995,17 +995,14 @@ static DRIVER_INIT (megaplay)
megplay_stat();
/* for now ... */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa10000, 0xa1001f, 0, 0, OLD_megaplay_genesis_io_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa10000, 0xa1001f, 0, 0, OLD_megaplay_genesis_io_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa10000, 0xa1001f, 0, 0, OLD_megaplay_genesis_io_r, OLD_megaplay_genesis_io_w);
/* megaplay has ram shared with the bios cpu here */
- memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK7);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK7);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK7, SMH_BANK7);
memory_set_bankptr(7, &ic36_ram[0]);
/* instead of a RAM mirror the 68k sees the extra ram of the 2nd z80 too */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa02000, 0xa03fff, 0, 0, megadriv_68k_read_z80_extra_ram);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa02000, 0xa03fff, 0, 0, megadriv_68k_write_z80_extra_ram);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa02000, 0xa03fff, 0, 0, megadriv_68k_read_z80_extra_ram, megadriv_68k_write_z80_extra_ram);
}
/*
diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c
index e6742b405ae..db0b51aa75f 100644
--- a/src/mame/drivers/megasys1.c
+++ b/src/mame/drivers/megasys1.c
@@ -3881,14 +3881,13 @@ static DRIVER_INIT( jitsupro )
RAM[0x438/2] = 0x4e71; //
/* the sound code writes oki commands to both the lsb and msb */
- memory_install_write16_handler(1, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xa0003, 0, 0, OKIM6295_data_0_both_w);
- memory_install_write16_handler(1, ADDRESS_SPACE_PROGRAM, 0xc0000, 0xc0003, 0, 0, OKIM6295_data_1_both_w);
+ memory_install_write16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xa0003, 0, 0, OKIM6295_data_0_both_w);
+ memory_install_write16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xc0000, 0xc0003, 0, 0, OKIM6295_data_1_both_w);
}
static DRIVER_INIT( peekaboo )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100001, 0, 0, protection_peekaboo_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100001, 0, 0, protection_peekaboo_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100001, 0, 0, protection_peekaboo_r, protection_peekaboo_w);
}
static DRIVER_INIT( phantasm )
@@ -3924,8 +3923,7 @@ static DRIVER_INIT( soldam )
astyanax_rom_decode(0);
/* Sprite RAM is mirrored. Why? */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x8c000, 0x8cfff, 0, 0, soldamj_spriteram16_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x8c000, 0x8cfff, 0, 0, soldamj_spriteram16_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8c000, 0x8cfff, 0, 0, soldamj_spriteram16_r, soldamj_spriteram16_w);
}
static DRIVER_INIT( stdragon )
diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c
index b0b20f0d879..46c72003239 100644
--- a/src/mame/drivers/megatech.c
+++ b/src/mame/drivers/megatech.c
@@ -286,8 +286,7 @@ static WRITE8_HANDLER( mt_sms_standard_rom_bank_w )
{
case 0:
logerror("bank w %02x %02x\n", offset, data);
- memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_BANK5);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_UNMAP);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_BANK5, SMH_UNMAP);
//printf("bank ram??\n");
break;
@@ -318,60 +317,49 @@ READ8_HANDLER( md_sms_ioport_dd_r )
-static void megatech_set_genz80_as_sms_standard_ports(void)
+static void megatech_set_genz80_as_sms_standard_ports(running_machine *machine)
{
/* INIT THE PORTS *********************************************************************************************/
- memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_r);
- memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_w);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_IO, 0x0000, 0xffff, 0, 0, z80_unmapped_port_r, z80_unmapped_port_w);
- memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, md_sms_vdp_vcounter_r);
- memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, sms_sn76496_w);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, md_sms_vdp_vcounter_r, sms_sn76496_w);
+ memory_install_write8_handler (machine, 1, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, sms_sn76496_w);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, md_sms_vdp_data_r, md_sms_vdp_data_w);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, md_sms_vdp_ctrl_r, md_sms_vdp_ctrl_w);
- memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, sms_sn76496_w);
+ memory_install_read8_handler (machine, 1, ADDRESS_SPACE_IO, 0x10, 0x10, 0, 0, megatech_sms_ioport_dd_r); // super tetris
- memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, md_sms_vdp_data_r);
- memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, md_sms_vdp_data_w);
-
- memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, md_sms_vdp_ctrl_r);
- memory_install_write8_handler(1, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, md_sms_vdp_ctrl_w);
-
- memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0x10, 0x10, 0, 0, megatech_sms_ioport_dd_r); // super tetris
-
- memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xdc, 0xdc, 0, 0, megatech_sms_ioport_dc_r);
- memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xdd, 0xdd, 0, 0, megatech_sms_ioport_dd_r);
- memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xde, 0xde, 0, 0, megatech_sms_ioport_dd_r);
- memory_install_read8_handler (1, ADDRESS_SPACE_IO, 0xdf, 0xdf, 0, 0, megatech_sms_ioport_dd_r); // adams family
+ memory_install_read8_handler (machine, 1, ADDRESS_SPACE_IO, 0xdc, 0xdc, 0, 0, megatech_sms_ioport_dc_r);
+ memory_install_read8_handler (machine, 1, ADDRESS_SPACE_IO, 0xdd, 0xdd, 0, 0, megatech_sms_ioport_dd_r);
+ memory_install_read8_handler (machine, 1, ADDRESS_SPACE_IO, 0xde, 0xde, 0, 0, megatech_sms_ioport_dd_r);
+ memory_install_read8_handler (machine, 1, ADDRESS_SPACE_IO, 0xdf, 0xdf, 0, 0, megatech_sms_ioport_dd_r); // adams family
}
-static void megatech_set_genz80_as_sms_standard_map(void)
+static void megatech_set_genz80_as_sms_standard_map(running_machine *machine)
{
/* INIT THE MEMMAP / BANKING *********************************************************************************/
/* catch any addresses that don't get mapped */
- memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_w);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r, z80_unmapped_w);
/* fixed rom bank area */
sms_rom = auto_malloc(0x400000);
- memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_BANK5);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_UNMAP);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_BANK5, SMH_UNMAP);
memory_set_bankptr( 5, sms_rom );
memcpy(sms_rom, memory_region(REGION_CPU1), 0x400000);
/* main ram area */
sms_mainram = auto_malloc(0x2000); // 8kb of main ram
- memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK6);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK6);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK6, SMH_BANK6);
memory_set_bankptr( 6, sms_mainram );
- memory_install_read8_handler (1, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK7);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK7);
+ memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK7, SMH_BANK7);
memory_set_bankptr( 7, sms_mainram );
memset(sms_mainram,0x00,0x2000);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xfffc, 0xffff, 0, 0, mt_sms_standard_rom_bank_w);
+ memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xfffc, 0xffff, 0, 0, mt_sms_standard_rom_bank_w);
- megatech_set_genz80_as_sms_standard_ports();
+ megatech_set_genz80_as_sms_standard_ports(machine);
// smsgg_backupram = NULL;
}
@@ -409,7 +397,7 @@ static void megatech_select_game(running_machine *machine, int gameno)
{
printf("SMS cart!!, CPU not running\n");
current_game_is_sms = 1;
- megatech_set_genz80_as_sms_standard_map();
+ megatech_set_genz80_as_sms_standard_map(machine);
cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
@@ -419,7 +407,7 @@ static void megatech_select_game(running_machine *machine, int gameno)
{
printf("Genesis Cart, CPU0 running\n");
current_game_is_sms = 0;
- megatech_set_megadrive_z80_as_megadrive_z80();
+ megatech_set_megadrive_z80_as_megadrive_z80(machine);
cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, CLEAR_LINE);
cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, CLEAR_LINE);
}
diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c
index 83b17126cd1..ee64d0270c0 100644
--- a/src/mame/drivers/meritm.c
+++ b/src/mame/drivers/meritm.c
@@ -1403,8 +1403,7 @@ static DRIVER_INIT(megat4te)
ds1204_init(0, megat4te_ds1204_nvram);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfff8, 0xffff, 0, 0, meritm_ds1644_w );
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xfff8, 0xffff, 0, 0, meritm_ds1644_r );
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfff8, 0xffff, 0, 0, meritm_ds1644_r, meritm_ds1644_w );
};
diff --git a/src/mame/drivers/mhavoc.c b/src/mame/drivers/mhavoc.c
index 13c0aabdb41..cb5717859e1 100644
--- a/src/mame/drivers/mhavoc.c
+++ b/src/mame/drivers/mhavoc.c
@@ -787,9 +787,9 @@ static DRIVER_INIT( mhavocrv )
{
/* install the speech support that was only optionally stuffed for use */
/* in the Return to Vax hack */
- memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2800, 0, 0, mhavoc_port_1_sp_r);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x5800, 0x5800, 0, 0, speech_data_w);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x5900, 0x5900, 0, 0, speech_strobe_w);
+ memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2800, 0, 0, mhavoc_port_1_sp_r);
+ memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x5800, 0x5800, 0, 0, speech_data_w);
+ memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x5900, 0x5900, 0, 0, speech_strobe_w);
}
diff --git a/src/mame/drivers/midvunit.c b/src/mame/drivers/midvunit.c
index ea137734ad3..17632d11071 100644
--- a/src/mame/drivers/midvunit.c
+++ b/src/mame/drivers/midvunit.c
@@ -91,7 +91,7 @@ static MACHINE_RESET( midvplus )
timer[0] = timer_alloc(NULL, NULL);
timer[1] = timer_alloc(NULL, NULL);
- ide_controller_reset(0);
+ devtag_reset(machine, IDE_CONTROLLER, "ide");
}
@@ -537,7 +537,7 @@ static ADDRESS_MAP_START( midvplus_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x990000, 0x99000f) AM_READWRITE(midway_ioasic_r, midway_ioasic_w)
AM_RANGE(0x994000, 0x994000) AM_WRITE(midvunit_control_w)
AM_RANGE(0x995020, 0x995020) AM_WRITE(midvunit_cmos_protect_w)
- AM_RANGE(0x9a0000, 0x9a0007) AM_READWRITE(midway_ide_asic_r, midway_ide_asic_w)
+ AM_RANGE(0x9a0000, 0x9a0007) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", midway_ide_asic_r, midway_ide_asic_w)
AM_RANGE(0x9c0000, 0x9c7fff) AM_READWRITE(SMH_RAM, midvunit_paletteram_w) AM_BASE(&paletteram32)
AM_RANGE(0x9d0000, 0x9d000f) AM_READWRITE(midvplus_misc_r, midvplus_misc_w) AM_BASE(&midvplus_misc)
AM_RANGE(0xa00000, 0xbfffff) AM_READWRITE(midvunit_textureram_r, midvunit_textureram_w) AM_BASE(&midvunit_textureram)
@@ -1044,6 +1044,8 @@ static MACHINE_DRIVER_START( midvplus )
MDRV_MACHINE_RESET(midvplus)
MDRV_NVRAM_HANDLER(midway_serial_pic2)
+
+ MDRV_IDE_CONTROLLER_ADD("ide", 0, NULL)
/* sound hardware */
MDRV_IMPORT_FROM(dcs2_audio_2115)
@@ -1406,45 +1408,45 @@ static READ32_HANDLER( generic_speedup_r )
}
-static void init_crusnusa_common(offs_t speedup)
+static void init_crusnusa_common(running_machine *machine, offs_t speedup)
{
dcs_init();
adc_shift = 24;
/* speedups */
- generic_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, speedup, speedup + 1, 0, 0, generic_speedup_r);
+ generic_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, speedup, speedup + 1, 0, 0, generic_speedup_r);
}
-static DRIVER_INIT( crusnusa ) { init_crusnusa_common(0xc93e); }
-static DRIVER_INIT( crusnu40 ) { init_crusnusa_common(0xc957); }
-static DRIVER_INIT( crusnu21 ) { init_crusnusa_common(0xc051); }
+static DRIVER_INIT( crusnusa ) { init_crusnusa_common(machine, 0xc93e); }
+static DRIVER_INIT( crusnu40 ) { init_crusnusa_common(machine, 0xc957); }
+static DRIVER_INIT( crusnu21 ) { init_crusnusa_common(machine, 0xc051); }
-static void init_crusnwld_common(offs_t speedup)
+static void init_crusnwld_common(running_machine *machine, offs_t speedup)
{
dcs_init();
adc_shift = 16;
/* control register is different */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x994000, 0x994000, 0, 0, crusnwld_control_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x994000, 0x994000, 0, 0, crusnwld_control_w);
/* valid values are 450 or 460 */
midway_serial_pic_init(450);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x991030, 0x991030, 0, 0, offroadc_serial_status_r);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_w);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x991030, 0x991030, 0, 0, offroadc_serial_status_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_r);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_w);
/* install strange protection device */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x9d0000, 0x9d1fff, 0, 0, bit_data_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x9d0000, 0x9d0000, 0, 0, bit_reset_w);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9d0000, 0x9d1fff, 0, 0, bit_data_r);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9d0000, 0x9d0000, 0, 0, bit_reset_w);
/* speedups */
if (speedup)
- generic_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, speedup, speedup + 1, 0, 0, generic_speedup_r);
+ generic_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, speedup, speedup + 1, 0, 0, generic_speedup_r);
}
-static DRIVER_INIT( crusnwld ) { init_crusnwld_common(0xd4c0); }
+static DRIVER_INIT( crusnwld ) { init_crusnwld_common(machine, 0xd4c0); }
#if 0
-static DRIVER_INIT( crusnw20 ) { init_crusnwld_common(0xd49c); }
-static DRIVER_INIT( crusnw13 ) { init_crusnwld_common(0); }
+static DRIVER_INIT( crusnw20 ) { init_crusnwld_common(machine, 0xd49c); }
+static DRIVER_INIT( crusnw13 ) { init_crusnwld_common(machine, 0); }
#endif
static DRIVER_INIT( offroadc )
@@ -1453,31 +1455,24 @@ static DRIVER_INIT( offroadc )
adc_shift = 16;
/* control register is different */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x994000, 0x994000, 0, 0, crusnwld_control_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x994000, 0x994000, 0, 0, crusnwld_control_w);
/* valid values are 230 or 234 */
midway_serial_pic2_init(230, 94);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x991030, 0x991030, 0, 0, offroadc_serial_status_r);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_w);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x991030, 0x991030, 0, 0, offroadc_serial_status_r);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x996000, 0x996000, 0, 0, offroadc_serial_data_r, offroadc_serial_data_w);
/* speedups */
- generic_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x195aa, 0x195aa, 0, 0, generic_speedup_r);
+ generic_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x195aa, 0x195aa, 0, 0, generic_speedup_r);
}
-static const struct ide_interface ide_intf =
-{
- 0
-};
-
static DRIVER_INIT( wargods )
{
UINT8 default_nvram[256];
/* initialize the subsystems */
- dcs2_init(2, 0x3839);
- ide_controller_init(0, &ide_intf);
+ dcs2_init(machine, 2, 0x3839);
midway_ioasic_init(0, 452/* no alternates */, 94, NULL);
adc_shift = 16;
@@ -1493,7 +1488,7 @@ static DRIVER_INIT( wargods )
midway_serial_pic2_set_default_nvram(default_nvram);
/* speedups */
- generic_speedup = memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x2f4c, 0x2f4c, 0, 0, generic_speedup_r);
+ generic_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2f4c, 0x2f4c, 0, 0, generic_speedup_r);
}
diff --git a/src/mame/drivers/midzeus.c b/src/mame/drivers/midzeus.c
index f07ef3a0f2d..1aec80aa113 100644
--- a/src/mame/drivers/midzeus.c
+++ b/src/mame/drivers/midzeus.c
@@ -1326,7 +1326,7 @@ ROM_END
static DRIVER_INIT( mk4 )
{
- dcs2_init(0, 0);
+ dcs2_init(machine, 0, 0);
midway_ioasic_init(MIDWAY_IOASIC_STANDARD, 461/* or 474 */, 94, NULL);
midway_ioasic_set_shuffle_state(1);
}
@@ -1334,26 +1334,26 @@ static DRIVER_INIT( mk4 )
static DRIVER_INIT( invasn )
{
- dcs2_init(0, 0);
+ dcs2_init(machine, 0, 0);
midway_ioasic_init(MIDWAY_IOASIC_STANDARD, 468/* or 488 */, 94, NULL);
- memory_install_readwrite32_handler(0, ADDRESS_SPACE_PROGRAM, 0x9c0000, 0x9c0000, 0, 0, invasn_gun_r, invasn_gun_w);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9c0000, 0x9c0000, 0, 0, invasn_gun_r, invasn_gun_w);
}
static DRIVER_INIT( crusnexo )
{
- dcs2_init(0, 0);
+ dcs2_init(machine, 0, 0);
midway_ioasic_init(MIDWAY_IOASIC_STANDARD, 472/* or 476,477,478,110 */, 99, NULL);
memory_configure_bank(1, 0, 3, memory_region(REGION_USER2), 0x400000*4);
- memory_install_readwrite32_handler(0, ADDRESS_SPACE_PROGRAM, 0x9b0004, 0x9b0007, 0, 0, crusnexo_leds_r, crusnexo_leds_w);
- memory_install_write32_handler (0, ADDRESS_SPACE_PROGRAM, 0x8d0009, 0x8d000a, 0, 0, keypad_select_w);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9b0004, 0x9b0007, 0, 0, crusnexo_leds_r, crusnexo_leds_w);
+ memory_install_write32_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x8d0009, 0x8d000a, 0, 0, keypad_select_w);
}
static DRIVER_INIT( thegrid )
{
- dcs2_init(0, 0);
+ dcs2_init(machine, 0, 0);
midway_ioasic_init(MIDWAY_IOASIC_STANDARD, 474/* or 491 */, 99, NULL);
memory_configure_bank(1, 0, 3, memory_region(REGION_USER2), 0x400000*4);
}
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index cf798a1ee3a..b9fef900e46 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -3911,8 +3911,7 @@ ROM_END
static DRIVER_INIT( genprot )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_w);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r, model2_prot_w);
protstate = protpos = 0;
}
@@ -3920,8 +3919,7 @@ static DRIVER_INIT( pltkids )
{
UINT32 *ROM = (UINT32 *)memory_region(REGION_CPU1);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_w);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r, model2_prot_w);
protstate = protpos = 0;
// fix bug in program: it destroys the interrupt table and never fixes it
@@ -3932,8 +3930,7 @@ static DRIVER_INIT( zerogun )
{
UINT32 *ROM = (UINT32 *)memory_region(REGION_CPU1);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_w);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r, model2_prot_w);
protstate = protpos = 0;
// fix bug in program: it destroys the interrupt table and never fixes it
@@ -3942,15 +3939,14 @@ static DRIVER_INIT( zerogun )
static DRIVER_INIT( daytonam )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x240000, 0x24ffff, 0, 0, maxx_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x240000, 0x24ffff, 0, 0, maxx_r );
}
static DRIVER_INIT( sgt24h )
{
UINT32 *ROM = (UINT32 *)memory_region(REGION_CPU1);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_w);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r, model2_prot_w);
protstate = protpos = 0;
ROM[0x56578/4] = 0x08000004;
@@ -3961,8 +3957,7 @@ static DRIVER_INIT( doa )
{
UINT32 *ROM = (UINT32 *)memory_region(REGION_CPU1);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_w);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01d80000, 0x01dfffff, 0, 0, model2_prot_r, model2_prot_w);
protstate = protpos = 0;
ROM[0x630/4] = 0x08000004;
diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c
index 07acaea623f..7b5cccf38da 100644
--- a/src/mame/drivers/model3.c
+++ b/src/mame/drivers/model3.c
@@ -4265,46 +4265,35 @@ static DRIVER_INIT( model3_10 )
{
interleave_vroms();
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00000ff, 0, 0, scsi_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00000ff, 0, 0, scsi_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00000ff, 0, 0, scsi_r, scsi_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
+ memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_r, mpc105_addr_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_r, mpc105_data_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_r, mpc105_reg_w );
}
static DRIVER_INIT( model3_15 )
{
interleave_vroms();
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
-
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_w );
+ memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
+
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_r, mpc105_addr_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_r, mpc105_data_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_r, mpc105_reg_w );
}
static DRIVER_INIT( model3_20 )
{
interleave_vroms();
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
+ memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc2000000, 0xc20000ff, 0, 0, real3d_dma_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc2000000, 0xc20000ff, 0, 0, real3d_dma_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc2000000, 0xc20000ff, 0, 0, real3d_dma_r, real3d_dma_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r, mpc106_addr_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r, mpc106_data_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r, mpc106_reg_w );
}
static DRIVER_INIT( lostwsga )
@@ -4313,8 +4302,7 @@ static DRIVER_INIT( lostwsga )
DRIVER_INIT_CALL(model3_15);
/* TODO: there's an M68K device at 0xC0000000 - FF, maybe lightgun controls ? */
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r, scsi_w );
rom[0x7374f0/4] = 0x38840004; /* This seems to be an actual bug in the original code */
}
@@ -4325,8 +4313,7 @@ static DRIVER_INIT( scud )
DRIVER_INIT_CALL(model3_15);
/* TODO: network device at 0xC0000000 - FF */
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r, scsi_w );
rom[(0x71275c^4)/4] = 0x60000000;
rom[(0x71277c^4)/4] = 0x60000000;
@@ -4338,8 +4325,7 @@ static DRIVER_INIT( scudp )
DRIVER_INIT_CALL(model3_15);
/* TODO: network device at 0xC0000000 - FF */
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r, scsi_w );
rom[(0x713724^4)/4] = 0x60000000;
rom[(0x713744^4)/4] = 0x60000000;
@@ -4355,8 +4341,7 @@ static DRIVER_INIT( lemans24 )
UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
DRIVER_INIT_CALL(model3_15);
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc1000000, 0xc10000ff, 0, 0, scsi_r, scsi_w );
rom[(0x73fe38^4)/4] = 0x38840004; /* This seems to be an actual bug in the original code */
@@ -4387,21 +4372,15 @@ static DRIVER_INIT( vs215 )
rom[(0x70e710^4)/4] = 0x60000000;
interleave_vroms();
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
-
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_w );
-
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_w );
+ memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
+
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r, scsi_w );
+
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_r, mpc106_addr_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r, mpc106_addr_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_r, mpc106_data_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r, mpc106_data_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r, mpc106_reg_w );
}
static DRIVER_INIT( vs29815 )
@@ -4412,21 +4391,15 @@ static DRIVER_INIT( vs29815 )
rom[(0x60290c^4)/4] = 0x60000000;
interleave_vroms();
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
-
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_w );
-
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_w );
+ memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
+
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r, scsi_w );
+
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_r, mpc106_addr_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r, mpc106_addr_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_r, mpc106_data_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r, mpc106_data_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r, mpc106_reg_w );
}
static DRIVER_INIT( bass )
@@ -4437,37 +4410,27 @@ static DRIVER_INIT( bass )
rom[(0x7999c8^4)/4] = 0x60000000;
interleave_vroms();
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
-
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_w );
-
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_w );
+ memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
+
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r, scsi_w );
+
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc106_addr_r, mpc106_addr_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfec00000, 0xfedfffff, 0, 0, mpc106_addr_r, mpc106_addr_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc106_data_r, mpc106_data_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfee00000, 0xfeffffff, 0, 0, mpc106_data_r, mpc106_data_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc106_reg_r, mpc106_reg_w );
}
static DRIVER_INIT( getbass )
{
interleave_vroms();
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
+ memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff7fffff, 0, 0, SMH_BANK1 );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf9000000, 0xf90000ff, 0, 0, scsi_r, scsi_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0800cf8, 0xf0800cff, 0, 0, mpc105_addr_r, mpc105_addr_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c00cf8, 0xf0c00cff, 0, 0, mpc105_data_r, mpc105_data_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf8fff000, 0xf8fff0ff, 0, 0, mpc105_reg_r, mpc105_reg_w );
}
static DRIVER_INIT( vs2 )
@@ -4516,8 +4479,7 @@ static DRIVER_INIT( harley )
UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
DRIVER_INIT_CALL(model3_20);
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00fffff, 0, 0, network_r );
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00fffff, 0, 0, network_w );
+ memory_install_readwrite64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc0000000, 0xc00fffff, 0, 0, network_r, network_w );
rom[(0x50e8d4^4)/4] = 0x60000000;
rom[(0x50e8f4^4)/4] = 0x60000000;
@@ -4585,7 +4547,7 @@ static DRIVER_INIT( daytona2 )
UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
DRIVER_INIT_CALL(model3_20);
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc3800000, 0xc3800007, 0, 0, daytona2_rombank_w );
+ memory_install_write64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc3800000, 0xc3800007, 0, 0, daytona2_rombank_w );
//rom[(0x68468c^4)/4] = 0x60000000;
rom[(0x6063c4^4)/4] = 0x60000000;
@@ -4598,7 +4560,7 @@ static DRIVER_INIT( dayto2pe )
UINT32 *rom = (UINT32*)memory_region(REGION_USER1);
DRIVER_INIT_CALL(model3_20);
- memory_install_write64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xc3800000, 0xc3800007, 0, 0, daytona2_rombank_w );
+ memory_install_write64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc3800000, 0xc3800007, 0, 0, daytona2_rombank_w );
rom[(0x606784^4)/4] = 0x60000000;
rom[(0x69a3fc^4)/4] = 0x60000000; // jump to encrypted code
diff --git a/src/mame/drivers/mquake.c b/src/mame/drivers/mquake.c
index 4fbf407bd75..f7349801eaf 100644
--- a/src/mame/drivers/mquake.c
+++ b/src/mame/drivers/mquake.c
@@ -42,11 +42,11 @@ static void mquake_cia_0_porta_w(UINT8 data)
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
/* overlay disabled, map RAM on 0x000000 */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1);
+ memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1);
else
/* overlay enabled, map Amiga system ROM on 0x000000 */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP);
+ memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP);
}
diff --git a/src/mame/drivers/ms32.c b/src/mame/drivers/ms32.c
index 976d2f1b5ad..7bce088e1b6 100644
--- a/src/mame/drivers/ms32.c
+++ b/src/mame/drivers/ms32.c
@@ -2306,7 +2306,7 @@ static DRIVER_INIT (ss92048_01)
static DRIVER_INIT (kirarast)
{
// { 0xfcc00004, 0xfcc00007, ms32_mahjong_read_inputs1 }
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 );
DRIVER_INIT_CALL(ss92047_01);
}
@@ -2314,7 +2314,7 @@ static DRIVER_INIT (kirarast)
static DRIVER_INIT (47pie2)
{
// { 0xfcc00004, 0xfcc00007, ms32_mahjong_read_inputs1 }
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 );
DRIVER_INIT_CALL(ss92048_01);
}
@@ -2331,7 +2331,7 @@ static DRIVER_INIT (f1superb)
static DRIVER_INIT (bnstars)
{
// { 0xfcc00004, 0xfcc00007, ms32_mahjong_read_inputs1 }
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 );
DRIVER_INIT_CALL(ss92046_01);
}
diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c
index 53ab3ff2054..be97aafdf38 100644
--- a/src/mame/drivers/multigam.c
+++ b/src/mame/drivers/multigam.c
@@ -348,7 +348,7 @@ static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w )
}
}
-static void multigam_init_smb3(void)
+static void multigam_init_smb3(running_machine *machine)
{
UINT8* dst = memory_region( REGION_CPU1 );
UINT8* src = memory_region( REGION_USER1 );
@@ -356,7 +356,7 @@ static void multigam_init_smb3(void)
memcpy(&dst[0x8000], &src[0xa0000 + 0x3c000], 0x4000);
memcpy(&dst[0xc000], &src[0xa0000 + 0x3c000], 0x4000);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, multigam3_mmc3_rom_switch_w );
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, multigam3_mmc3_rom_switch_w );
memory_set_bankptr(1, multigmc_mmc3_6000_ram);
@@ -389,12 +389,12 @@ static WRITE8_HANDLER(multigm3_switch_prg_rom)
if ( data == 0xa8 )
{
- multigam_init_smb3();
+ multigam_init_smb3(machine);
return;
}
else
{
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, multigm3_mapper2_w );
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, multigm3_mapper2_w );
memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x6000);
}
diff --git a/src/mame/drivers/namcos11.c b/src/mame/drivers/namcos11.c
index 2e2b90be4c4..283c903c7b8 100644
--- a/src/mame/drivers/namcos11.c
+++ b/src/mame/drivers/namcos11.c
@@ -811,20 +811,20 @@ static DRIVER_INIT( namcos11 )
{
if( namcos11_config_table[ n_game ].keycus_r != NULL )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa20000, 0x1fa2ffff, 0, 0, namcos11_config_table[ n_game ].keycus_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fa20000, 0x1fa2ffff, 0, 0, namcos11_config_table[ n_game ].keycus_r );
}
if( namcos11_config_table[ n_game ].n_daughterboard != 0 )
{
int bank;
- memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f0fffff, 0, 0, SMH_BANK1 );
- memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f100000, 0x1f1fffff, 0, 0, SMH_BANK2 );
- memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f200000, 0x1f2fffff, 0, 0, SMH_BANK3 );
- memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f300000, 0x1f3fffff, 0, 0, SMH_BANK4 );
- memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f400000, 0x1f4fffff, 0, 0, SMH_BANK5 );
- memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f500000, 0x1f5fffff, 0, 0, SMH_BANK6 );
- memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6fffff, 0, 0, SMH_BANK7 );
- memory_install_read32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f700000, 0x1f7fffff, 0, 0, SMH_BANK8 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f0fffff, 0, 0, SMH_BANK1 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f100000, 0x1f1fffff, 0, 0, SMH_BANK2 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f200000, 0x1f2fffff, 0, 0, SMH_BANK3 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f300000, 0x1f3fffff, 0, 0, SMH_BANK4 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f400000, 0x1f4fffff, 0, 0, SMH_BANK5 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f500000, 0x1f5fffff, 0, 0, SMH_BANK6 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f600000, 0x1f6fffff, 0, 0, SMH_BANK7 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f700000, 0x1f7fffff, 0, 0, SMH_BANK8 );
for( bank = 0; bank < 8; bank++ )
{
@@ -834,20 +834,19 @@ static DRIVER_INIT( namcos11 )
if( namcos11_config_table[ n_game ].n_daughterboard == 32 )
{
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, bankswitch_rom32_w );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, bankswitch_rom32_w );
}
if( namcos11_config_table[ n_game ].n_daughterboard == 64 )
{
m_n_bankoffset = 0;
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f080000, 0x1f080003, 0, 0, bankswitch_rom64_upper_w );
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, bankswitch_rom64_w );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, SMH_NOP );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f080000, 0x1f080003, 0, 0, bankswitch_rom64_upper_w );
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, SMH_NOP, bankswitch_rom64_w );
state_save_register_global( m_n_bankoffset );
}
}
else
{
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, SMH_NOP );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fa10020, 0x1fa1002f, 0, 0, SMH_NOP );
}
break;
}
@@ -856,8 +855,8 @@ static DRIVER_INIT( namcos11 )
if( strcmp( machine->gamedrv->name, "ptblnk2a" ) == 0 )
{
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f788000, 0x1f788003, 0, 0, lightgun_w );
- memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1f780000, 0x1f78000f, 0, 0, lightgun_r );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f788000, 0x1f788003, 0, 0, lightgun_w );
+ memory_install_read32_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f780000, 0x1f78000f, 0, 0, lightgun_r );
}
state_save_register_global( m_n_oldcoin );
diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c
index 634f3b5671f..81549369b79 100644
--- a/src/mame/drivers/namcos12.c
+++ b/src/mame/drivers/namcos12.c
@@ -1161,10 +1161,10 @@ static READ32_HANDLER( system11gun_r )
return data;
}
-static void system11gun_install( void )
+static void system11gun_install( running_machine *machine )
{
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f788000, 0x1f788003, 0, 0, system11gun_w );
- memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1f780000, 0x1f78000f, 0, 0, system11gun_r );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f788000, 0x1f788003, 0, 0, system11gun_w );
+ memory_install_read32_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f780000, 0x1f78000f, 0, 0, system11gun_r );
}
static UINT8 kcram[ 12 ];
@@ -1214,10 +1214,8 @@ static MACHINE_RESET( namcos12 )
strcmp( machine->gamedrv->name, "tektagtb" ) == 0 ||
strcmp( machine->gamedrv->name, "tektagtc" ) == 0 )
{
- memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, tektagt_protection_1_r );
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, tektagt_protection_1_w );
- memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, tektagt_protection_2_r );
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, tektagt_protection_2_w );
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, tektagt_protection_1_r, tektagt_protection_1_w );
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, tektagt_protection_2_r, tektagt_protection_2_w );
}
if( strcmp( machine->gamedrv->name, "tektagt" ) == 0 ||
@@ -1239,9 +1237,9 @@ static MACHINE_RESET( namcos12 )
strcmp( machine->gamedrv->name, "ghlpanic" ) == 0 )
{
/* this is based on guesswork, it might not even be keycus. */
- memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x1fc20280, 0x1fc2028b, 0, 0, SMH_BANK2 );
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f008000, 0x1f008003, 0, 0, kcon_w );
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x1f018000, 0x1f018003, 0, 0, kcoff_w );
+ memory_install_read32_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fc20280, 0x1fc2028b, 0, 0, SMH_BANK2 );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f008000, 0x1f008003, 0, 0, kcon_w );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f018000, 0x1f018003, 0, 0, kcoff_w );
memset( kcram, 0, sizeof( kcram ) );
memory_set_bankptr( 2, kcram );
@@ -1461,14 +1459,14 @@ static DRIVER_INIT( ptblank2 )
/* patch out wait for dma 5 to complete */
*( (UINT32 *)( memory_region( REGION_USER1 ) + 0x331c4 ) ) = 0;
- system11gun_install();
+ system11gun_install(machine);
}
static DRIVER_INIT( ghlpanic )
{
DRIVER_INIT_CALL(namcos12);
- system11gun_install();
+ system11gun_install(machine);
}
static MACHINE_DRIVER_START( coh700 )
diff --git a/src/mame/drivers/namcos22.c b/src/mame/drivers/namcos22.c
index db2faf8443a..2f4c3711549 100644
--- a/src/mame/drivers/namcos22.c
+++ b/src/mame/drivers/namcos22.c
@@ -4233,24 +4233,21 @@ static READ16_HANDLER( mcuc74_speedup_r )
return su_82;
}
-static void install_c74_speedup(void)
+static void install_c74_speedup(running_machine *machine)
{
- memory_install_read16_handler(3, ADDRESS_SPACE_PROGRAM, 0x80, 0x81, 0, 0, mcuc74_speedup_r);
- memory_install_write16_handler(3, ADDRESS_SPACE_PROGRAM, 0x80, 0x81, 0, 0, mcu_speedup_w);
+ memory_install_readwrite16_handler(machine, 3, ADDRESS_SPACE_PROGRAM, 0x80, 0x81, 0, 0, mcuc74_speedup_r, mcu_speedup_w);
}
-static void install_130_speedup(void)
+static void install_130_speedup(running_machine *machine)
{
// install speedup cheat for 1.30 MCU BIOS
- memory_install_read16_handler(3, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, mcu130_speedup_r);
- memory_install_write16_handler(3, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, mcu_speedup_w);
+ memory_install_readwrite16_handler(machine, 3, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, mcu130_speedup_r, mcu_speedup_w);
}
-static void install_141_speedup(void)
+static void install_141_speedup(running_machine *machine)
{
// install speedup cheat for 1.41 MCU BIOS
- memory_install_read16_handler(3, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, mcu141_speedup_r);
- memory_install_write16_handler(3, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, mcu_speedup_w);
+ memory_install_readwrite16_handler(machine, 3, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, mcu141_speedup_r, mcu_speedup_w);
}
static void namcos22_init( enum namcos22_gametype game_type )
@@ -4269,34 +4266,34 @@ static DRIVER_INIT( alpiner )
{
namcos22s_init(NAMCOS22_ALPINE_RACER);
- memory_install_read8_handler(3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, alpineracer_mcu_adc_r);
+ memory_install_read8_handler(machine, 3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, alpineracer_mcu_adc_r);
- install_130_speedup();
+ install_130_speedup(machine);
}
static DRIVER_INIT( alpiner2 )
{
namcos22s_init(NAMCOS22_ALPINE_RACER_2);
- memory_install_read8_handler(3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, alpineracer_mcu_adc_r);
+ memory_install_read8_handler(machine, 3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, alpineracer_mcu_adc_r);
- install_130_speedup();
+ install_130_speedup(machine);
}
static DRIVER_INIT( alpinesa )
{
namcos22s_init(NAMCOS22_ALPINE_SURFER);
- memory_install_read8_handler(3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, alpineracer_mcu_adc_r);
+ memory_install_read8_handler(machine, 3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, alpineracer_mcu_adc_r);
- install_141_speedup();
+ install_141_speedup(machine);
}
static DRIVER_INIT( airco22 )
{
namcos22s_init(NAMCOS22_AIR_COMBAT22);
- memory_install_read8_handler(3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, airco22_mcu_adc_r);
+ memory_install_read8_handler(machine, 3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, airco22_mcu_adc_r);
}
static DRIVER_INIT( propcycl )
@@ -4320,16 +4317,16 @@ static DRIVER_INIT( propcycl )
namcos22s_init(NAMCOS22_PROP_CYCLE);
- memory_install_read8_handler(3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, propcycle_mcu_adc_r);
+ memory_install_read8_handler(machine, 3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, propcycle_mcu_adc_r);
- install_141_speedup();
+ install_141_speedup(machine);
}
static DRIVER_INIT( ridgeraj )
{
namcos22_init(NAMCOS22_RIDGE_RACER);
- install_c74_speedup();
+ install_c74_speedup(machine);
old_coin_state = input_port_read_indexed(machine, 1) & 0x1200;
credits1 = credits2 = 0;
@@ -4339,7 +4336,7 @@ static DRIVER_INIT( ridger2j )
{
namcos22_init(NAMCOS22_RIDGE_RACER2);
- install_c74_speedup();
+ install_c74_speedup(machine);
old_coin_state = input_port_read_indexed(machine, 1) & 0x1200;
credits1 = credits2 = 0;
@@ -4349,7 +4346,7 @@ static DRIVER_INIT( acedrvr )
{
namcos22_init(NAMCOS22_ACE_DRIVER);
- install_c74_speedup();
+ install_c74_speedup(machine);
old_coin_state = input_port_read_indexed(machine, 1) & 0x1200;
credits1 = credits2 = 0;
@@ -4359,7 +4356,7 @@ static DRIVER_INIT( victlap )
{
namcos22_init(NAMCOS22_VICTORY_LAP);
- install_c74_speedup();
+ install_c74_speedup(machine);
old_coin_state = input_port_read_indexed(machine, 1) & 0x1200;
credits1 = credits2 = 0;
@@ -4369,7 +4366,7 @@ static DRIVER_INIT( raveracw )
{
namcos22_init(NAMCOS22_RAVE_RACER);
- install_c74_speedup();
+ install_c74_speedup(machine);
old_coin_state = input_port_read_indexed(machine, 1) & 0x1200;
credits1 = credits2 = 0;
@@ -4386,7 +4383,7 @@ static DRIVER_INIT( cybrcomm )
namcos22_init(NAMCOS22_CYBER_COMMANDO);
- install_c74_speedup();
+ install_c74_speedup(machine);
old_coin_state = input_port_read_indexed(machine, 1) & 0x1200;
credits1 = credits2 = 0;
@@ -4401,16 +4398,16 @@ static DRIVER_INIT( cybrcyc )
namcos22s_init(NAMCOS22_CYBER_CYCLES);
- memory_install_read8_handler(3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, cybrcycc_mcu_adc_r);
+ memory_install_read8_handler(machine, 3, ADDRESS_SPACE_IO, M37710_ADC0_L, M37710_ADC7_H, 0, 0, cybrcycc_mcu_adc_r);
- install_130_speedup();
+ install_130_speedup(machine);
}
static DRIVER_INIT( timecris )
{
namcos22s_init(NAMCOS22_TIME_CRISIS);
- install_130_speedup();
+ install_130_speedup(machine);
}
/************************************************************************************/
diff --git a/src/mame/drivers/naughtyb.c b/src/mame/drivers/naughtyb.c
index f1644329d43..5e185050934 100644
--- a/src/mame/drivers/naughtyb.c
+++ b/src/mame/drivers/naughtyb.c
@@ -770,7 +770,7 @@ ROM_END
static DRIVER_INIT( popflame )
{
/* install a handler to catch protection checks */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9000, 0, 0, popflame_protection_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x9000, 0, 0, popflame_protection_r);
}
static int question_offset = 0;
@@ -799,8 +799,7 @@ static WRITE8_HANDLER( trvmstr_questions_w )
static DRIVER_INIT( trvmstr )
{
/* install questions' handlers */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc000, 0, 0, trvmstr_questions_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc002, 0, 0, trvmstr_questions_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc002, 0, 0, trvmstr_questions_r, trvmstr_questions_w);
}
diff --git a/src/mame/drivers/neodrvr.c b/src/mame/drivers/neodrvr.c
index 93520f69ee9..738553778bb 100644
--- a/src/mame/drivers/neodrvr.c
+++ b/src/mame/drivers/neodrvr.c
@@ -6790,7 +6790,7 @@ static DRIVER_INIT( fatfury2 )
{
DRIVER_INIT_CALL(neogeo);
- fatfury2_install_protection();
+ fatfury2_install_protection(machine);
}
static DRIVER_INIT( mslugx )
@@ -6805,7 +6805,7 @@ static DRIVER_INIT( kof99 )
neogeo_fixed_layer_bank_type = 1;
kof99_neogeo_gfx_decrypt(0x00);
DRIVER_INIT_CALL(neogeo);
- kof99_install_protection();
+ kof99_install_protection(machine);
}
static DRIVER_INIT( garou )
@@ -6814,7 +6814,7 @@ static DRIVER_INIT( garou )
neogeo_fixed_layer_bank_type = 1;
kof99_neogeo_gfx_decrypt(0x06);
DRIVER_INIT_CALL(neogeo);
- garou_install_protection();
+ garou_install_protection(machine);
}
static DRIVER_INIT( garouo )
@@ -6823,7 +6823,7 @@ static DRIVER_INIT( garouo )
neogeo_fixed_layer_bank_type = 1;
kof99_neogeo_gfx_decrypt(0x06);
DRIVER_INIT_CALL(neogeo);
- garouo_install_protection();
+ garouo_install_protection(machine);
}
static DRIVER_INIT( garoubl )
@@ -6839,7 +6839,7 @@ static DRIVER_INIT( mslug3 )
neogeo_fixed_layer_bank_type = 1;
kof99_neogeo_gfx_decrypt(0xad);
DRIVER_INIT_CALL(neogeo);
- mslug3_install_protection();
+ mslug3_install_protection(machine);
}
static DRIVER_INIT( kof2000 )
@@ -6848,7 +6848,7 @@ static DRIVER_INIT( kof2000 )
neogeo_fixed_layer_bank_type = 2;
kof2000_neogeo_gfx_decrypt(0x00);
DRIVER_INIT_CALL(neogeo);
- kof2000_install_protection();
+ kof2000_install_protection(machine);
}
static DRIVER_INIT( kof2001 )
@@ -6939,7 +6939,7 @@ static DRIVER_INIT ( kof98 )
{
kof98_decrypt_68k();
DRIVER_INIT_CALL(neogeo);
- install_kof98_protection();
+ install_kof98_protection(machine);
}
static DRIVER_INIT( rotd )
@@ -7009,7 +7009,7 @@ static DRIVER_INIT( mslug5 )
neogeo_fixed_layer_bank_type = 1;
kof2000_neogeo_gfx_decrypt(0x19);
DRIVER_INIT_CALL(neogeo);
- install_pvc_protection();
+ install_pvc_protection(machine);
}
static DRIVER_INIT( ms5pcb )
@@ -7021,7 +7021,7 @@ static DRIVER_INIT( ms5pcb )
svcpcb_s1data_decrypt();
neo_pcm2_swap(2);
DRIVER_INIT_CALL(neogeo);
- install_pvc_protection();
+ install_pvc_protection(machine);
}
static DRIVER_INIT( ms5plus )
@@ -7032,7 +7032,7 @@ static DRIVER_INIT( ms5plus )
neogeo_bootleg_sx_decrypt(1);
neogeo_fixed_layer_bank_type = 1;
DRIVER_INIT_CALL(neogeo);
- install_ms5plus_protection();
+ install_ms5plus_protection(machine);
}
@@ -7055,7 +7055,7 @@ static DRIVER_INIT( svcpcb )
neo_pcm2_swap(3);
neogeo_fixed_layer_bank_type = 2;
DRIVER_INIT_CALL(neogeo);
- install_pvc_protection();
+ install_pvc_protection(machine);
}
static DRIVER_INIT( svc )
@@ -7065,7 +7065,7 @@ static DRIVER_INIT( svc )
neogeo_fixed_layer_bank_type = 2;
kof2000_neogeo_gfx_decrypt(0x57);
DRIVER_INIT_CALL(neogeo);
- install_pvc_protection();
+ install_pvc_protection(machine);
}
static DRIVER_INIT( svcboot )
@@ -7073,7 +7073,7 @@ static DRIVER_INIT( svcboot )
svcboot_px_decrypt();
svcboot_cx_decrypt();
DRIVER_INIT_CALL(neogeo);
- install_pvc_protection();
+ install_pvc_protection(machine);
}
static DRIVER_INIT( svcplus )
@@ -7102,7 +7102,7 @@ static DRIVER_INIT( svcsplus )
svcboot_cx_decrypt();
svcsplus_px_hack();
DRIVER_INIT_CALL(neogeo);
- install_pvc_protection();
+ install_pvc_protection(machine);
}
static DRIVER_INIT( samsho5 )
@@ -7134,8 +7134,8 @@ static DRIVER_INIT( kf2k3pcb )
neo_pcm2_swap(5);
neogeo_fixed_layer_bank_type = 2;
DRIVER_INIT_CALL(neogeo);
- install_pvc_protection();
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc7ffff, 0, 0, SMH_BANK6 ); // 512k bios
+ install_pvc_protection(machine);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc7ffff, 0, 0, SMH_BANK6 ); // 512k bios
}
@@ -7146,7 +7146,7 @@ static DRIVER_INIT( kof2003 )
neogeo_fixed_layer_bank_type = 2;
kof2000_neogeo_gfx_decrypt(0x9d);
DRIVER_INIT_CALL(neogeo);
- install_pvc_protection();
+ install_pvc_protection(machine);
}
static DRIVER_INIT( kof2003b )
@@ -7154,7 +7154,7 @@ static DRIVER_INIT( kof2003b )
// kof2003b_sx_decrypt();
neogeo_bootleg_sx_decrypt(1);
DRIVER_INIT_CALL(neogeo);
- kof2003b_install_protection();
+ kof2003b_install_protection(machine);
}
static DRIVER_INIT( kof2k3pl )
@@ -7163,7 +7163,7 @@ static DRIVER_INIT( kof2k3pl )
//decrypt_ms5plus_s1();
neogeo_bootleg_sx_decrypt(1);
DRIVER_INIT_CALL(neogeo);
- kf2k3pl_install_protection();
+ kf2k3pl_install_protection(machine);
}
@@ -7173,7 +7173,7 @@ static DRIVER_INIT( kof2k3up )
// kof2k3up_sx_decrypt();
neogeo_bootleg_sx_decrypt(2);
DRIVER_INIT_CALL(neogeo);
- kof2k3up_install_protection();
+ kof2k3up_install_protection(machine);
}
@@ -7199,11 +7199,11 @@ static DRIVER_INIT( jockeygp )
extra_ram = auto_malloc(0x2000);
state_save_register_global_pointer(extra_ram, 0x2000 / 2);
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x201fff, 0, 0, SMH_BANK8, SMH_BANK8);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x201fff, 0, 0, SMH_BANK8, SMH_BANK8);
memory_set_bankptr(NEOGEO_BANK_EXTRA_RAM, extra_ram);
-// memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x280000, 0x280001, 0, 0, port_tag_to_handler16("IN5") );
-// memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2c0000, 0x2c0001, 0, 0, port_tag_to_handler16("IN6") );
+// memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x280000, 0x280001, 0, 0, port_tag_to_handler16("IN5") );
+// memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2c0000, 0x2c0001, 0, 0, port_tag_to_handler16("IN6") );
DRIVER_INIT_CALL(neogeo);
}
@@ -7216,11 +7216,11 @@ static DRIVER_INIT( vliner )
extra_ram = auto_malloc(0x2000);
state_save_register_global_pointer(extra_ram, 0x2000 / 2);
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x201fff, 0, 0, SMH_BANK8, SMH_BANK8);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x201fff, 0, 0, SMH_BANK8, SMH_BANK8);
memory_set_bankptr(NEOGEO_BANK_EXTRA_RAM, extra_ram);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x280000, 0x280001, 0, 0, port_tag_to_handler16("IN5") );
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2c0000, 0x2c0001, 0, 0, port_tag_to_handler16("IN6") );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x280000, 0x280001, 0, 0, port_tag_to_handler16("IN5") );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2c0000, 0x2c0001, 0, 0, port_tag_to_handler16("IN6") );
DRIVER_INIT_CALL(neogeo);
}
@@ -7229,7 +7229,7 @@ static DRIVER_INIT( vliner )
static DRIVER_INIT( kog )
{
/* overlay cartridge ROM */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0ffffe, 0x0fffff, 0, 0, port_tag_to_handler16("JUMPER") );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0ffffe, 0x0fffff, 0, 0, port_tag_to_handler16("JUMPER") );
kog_px_decrypt();
neogeo_bootleg_sx_decrypt(1);
@@ -7242,7 +7242,7 @@ static DRIVER_INIT( kof10th )
{
decrypt_kof10th();
DRIVER_INIT_CALL(neogeo);
- install_kof10th_protection();
+ install_kof10th_protection(machine);
}
static DRIVER_INIT( kf10thep )
@@ -7262,14 +7262,14 @@ static DRIVER_INIT( cthd2003 )
{
decrypt_cthd2003();
DRIVER_INIT_CALL(neogeo);
- patch_cthd2003();
+ patch_cthd2003(machine);
}
static DRIVER_INIT ( ct2k3sp )
{
decrypt_ct2k3sp();
DRIVER_INIT_CALL(neogeo);
- patch_cthd2003();
+ patch_cthd2003(machine);
}
static DRIVER_INIT ( ct2k3sa )
diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c
index 168b569d2df..989491c0a14 100644
--- a/src/mame/drivers/nmk16.c
+++ b/src/mame/drivers/nmk16.c
@@ -4791,8 +4791,8 @@ static DRIVER_INIT( bjtwin )
static READ16_HANDLER( vandykeb_r ) { return 0x0000; }
static DRIVER_INIT (vandykeb)
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x08000e, 0x08000f, 0, 0, vandykeb_r );
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x08001e, 0x08001f, 0, 0, SMH_NOP );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x08000e, 0x08000f, 0, 0, vandykeb_r );
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x08001e, 0x08001f, 0, 0, SMH_NOP );
}
diff --git a/src/mame/drivers/offtwall.c b/src/mame/drivers/offtwall.c
index 2d3f9caf25c..bb10fec51d7 100644
--- a/src/mame/drivers/offtwall.c
+++ b/src/mame/drivers/offtwall.c
@@ -506,9 +506,9 @@ static DRIVER_INIT( offtwall )
atarijsa_init(machine, 3, 0x0040);
/* install son-of-slapstic workarounds */
- spritecache_count = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3fde42, 0x3fde43, 0, 0, spritecache_count_r);
- bankswitch_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x037ec2, 0x037f39, 0, 0, bankswitch_r);
- unknown_verify_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3fdf1e, 0x3fdf1f, 0, 0, unknown_verify_r);
+ spritecache_count = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3fde42, 0x3fde43, 0, 0, spritecache_count_r);
+ bankswitch_base = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x037ec2, 0x037f39, 0, 0, bankswitch_r);
+ unknown_verify_base = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3fdf1e, 0x3fdf1f, 0, 0, unknown_verify_r);
}
@@ -518,9 +518,9 @@ static DRIVER_INIT( offtwalc )
atarijsa_init(machine, 3, 0x0040);
/* install son-of-slapstic workarounds */
- spritecache_count = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3fde42, 0x3fde43, 0, 0, spritecache_count_r);
- bankswitch_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x037eca, 0x037f43, 0, 0, bankswitch_r);
- unknown_verify_base = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3fdf24, 0x3fdf25, 0, 0, unknown_verify_r);
+ spritecache_count = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3fde42, 0x3fde43, 0, 0, spritecache_count_r);
+ bankswitch_base = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x037eca, 0x037f43, 0, 0, bankswitch_r);
+ unknown_verify_base = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3fdf24, 0x3fdf25, 0, 0, unknown_verify_r);
}
diff --git a/src/mame/drivers/pacman.c b/src/mame/drivers/pacman.c
index 38c2cd10e52..349845ead70 100644
--- a/src/mame/drivers/pacman.c
+++ b/src/mame/drivers/pacman.c
@@ -5126,8 +5126,8 @@ static void maketrax_rom_decode(void)
static DRIVER_INIT( maketrax )
{
/* set up protection handlers */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5080, 0x50bf, 0, 0, maketrax_special_port2_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x50c0, 0x50ff, 0, 0, maketrax_special_port3_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5080, 0x50bf, 0, 0, maketrax_special_port2_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x50c0, 0x50ff, 0, 0, maketrax_special_port3_r);
maketrax_rom_decode();
}
@@ -5157,8 +5157,8 @@ static void korosuke_rom_decode(void)
static DRIVER_INIT( korosuke )
{
/* set up protection handlers */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5080, 0x5080, 0, 0, korosuke_special_port2_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x50c0, 0x50ff, 0, 0, korosuke_special_port3_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5080, 0x5080, 0, 0, korosuke_special_port2_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x50c0, 0x50ff, 0, 0, korosuke_special_port3_r);
korosuke_rom_decode();
}
@@ -5381,11 +5381,11 @@ static READ8_HANDLER( cannonbp_protection_r )
static DRIVER_INIT( cannonbp )
{
/* extra memory */
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4bff, 0, 0, SMH_BANK5, SMH_BANK5);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4bff, 0, 0, SMH_BANK5, SMH_BANK5);
memory_set_bankptr(5, auto_malloc(0x400));
/* protection? */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, cannonbp_protection_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, 0, 0, cannonbp_protection_r);
}
diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c
index de96bdc36b5..46b751d148e 100644
--- a/src/mame/drivers/paradise.c
+++ b/src/mame/drivers/paradise.c
@@ -916,13 +916,13 @@ static DRIVER_INIT (paradise)
static DRIVER_INIT (tgtball)
{
paradise_sprite_inc = 4;
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x2001, 0x2001, 0, 0, tgtball_flipscreen_w );
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x2001, 0x2001, 0, 0, tgtball_flipscreen_w );
}
static DRIVER_INIT (torus)
{
paradise_sprite_inc = 4;
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x2070, 0x2070, 0, 0, torus_coin_counter_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x2070, 0x2070, 0, 0, torus_coin_counter_w);
}
diff --git a/src/mame/drivers/pasha2.c b/src/mame/drivers/pasha2.c
index 30f7999987b..5acee7a2329 100644
--- a/src/mame/drivers/pasha2.c
+++ b/src/mame/drivers/pasha2.c
@@ -457,7 +457,7 @@ static READ16_HANDLER( pasha2_speedup_r )
static DRIVER_INIT( pasha2 )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x95744, 0x95747, 0, 0, pasha2_speedup_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x95744, 0x95747, 0, 0, pasha2_speedup_r );
memory_set_bankptr(1, memory_region(REGION_USER2));
}
diff --git a/src/mame/drivers/pbaction.c b/src/mame/drivers/pbaction.c
index 3bf8d4b0ed4..09682f26c24 100644
--- a/src/mame/drivers/pbaction.c
+++ b/src/mame/drivers/pbaction.c
@@ -418,7 +418,7 @@ static DRIVER_INIT( pbactio3 )
pbaction_decode();
/* install a protection (?) workaround */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc000, 0, 0, pbactio3_prot_kludge_r );
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc000, 0, 0, pbactio3_prot_kludge_r );
}
diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c
index 60a663c6032..b6c8f60eed6 100644
--- a/src/mame/drivers/pgm.c
+++ b/src/mame/drivers/pgm.c
@@ -1735,12 +1735,11 @@ static DRIVER_INIT( orlegend )
{
pgm_basic_init();
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xC0400e, 0xC0400f, 0, 0, pgm_asic3_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xC04000, 0xC04001, 0, 0, pgm_asic3_reg_w);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xC0400e, 0xC0400f, 0, 0, pgm_asic3_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC0400e, 0xC0400f, 0, 0, pgm_asic3_r, pgm_asic3_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC04000, 0xC04001, 0, 0, pgm_asic3_reg_w);
}
-static void drgwld2_common_init(void)
+static void drgwld2_common_init(running_machine *machine)
{
pgm_basic_init();
pgm_dw2_decrypt();
@@ -1750,13 +1749,13 @@ static void drgwld2_common_init(void)
select and after failing in the 2nd stage (probably there are other checks
out there).
*/
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd80000, 0xd80003, 0, 0, dw2_d80000_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd80000, 0xd80003, 0, 0, dw2_d80000_r);
}
static DRIVER_INIT( drgw2 )
{ /* incomplete? */
UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
- drgwld2_common_init();
+ drgwld2_common_init(machine);
/* These ROM patches are not hacks, the protection device
overlays the normal ROM code, this has been confirmed on a real PCB
although some addresses may be missing */
@@ -1768,7 +1767,7 @@ static DRIVER_INIT( drgw2 )
static DRIVER_INIT( drgw2c )
{
UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
- drgwld2_common_init();
+ drgwld2_common_init(machine);
/* These ROM patches are not hacks, the protection device
overlays the normal ROM code, this has been confirmed on a real PCB
although some addresses may be missing */
@@ -1780,7 +1779,7 @@ static DRIVER_INIT( drgw2c )
static DRIVER_INIT( drgw2j )
{
UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
- drgwld2_common_init();
+ drgwld2_common_init(machine);
/* These ROM patches are not hacks, the protection device
overlays the normal ROM code, this has been confirmed on a real PCB
although some addresses may be missing */
@@ -1793,12 +1792,11 @@ static DRIVER_INIT( kov )
{
pgm_basic_init();
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_w16);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16, ASIC28_w16);
/* 0x4f0000 - ? is actually ram shared with the protection device,
the protection device provides the region code */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r);
pgm_kov_decrypt();
}
@@ -1825,9 +1823,9 @@ static DRIVER_INIT( pstar )
pgm_basic_init();
pgm_pstar_decrypt();
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4f0025, 0, 0, PSTARS_protram_r);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, PSTARS_r16);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500005, 0, 0, PSTARS_w16);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4f0025, 0, 0, PSTARS_protram_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, PSTARS_r16);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500005, 0, 0, PSTARS_w16);
}
@@ -1836,12 +1834,11 @@ static DRIVER_INIT( kovsh )
{
pgm_basic_init();
-// memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16);
-// memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_w16);
+// memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16, ASIC28_w16);
/* 0x4f0000 - ? is actually ram shared with the protection device,
the protection device provides the region code */
-// memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r);
+// memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r);
pgm_kovsh_decrypt();
}
@@ -1850,12 +1847,11 @@ static DRIVER_INIT( djlzz )
{
pgm_basic_init();
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_w16);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16, ASIC28_w16);
/* 0x4f0000 - ? is actually ram shared with the protection device,
the protection device provides the region code */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r);
pgm_djlzz_decrypt();
}
@@ -1864,8 +1860,7 @@ static DRIVER_INIT( dw3 )
{
pgm_basic_init();
-// memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xda0000, 0xdaffff, 0, 0, dw3_prot_r);
-// memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xda0000, 0xdaffff, 0, 0, dw3_prot_w);
+// memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xda0000, 0xdaffff, 0, 0, dw3_prot_r, dw3_prot_w);
pgm_dw3_decrypt();
}
@@ -2113,8 +2108,7 @@ static DRIVER_INIT( killbld )
mem16[0x108a42/2]=0x5202;
mem16[0x108a44/2]=0x0c02;
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd40000, 0xd40003, 0, 0, killbld_prot_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd40000, 0xd40003, 0, 0, killbld_prot_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd40000, 0xd40003, 0, 0, killbld_prot_r, killbld_prot_w);
}
/* ddp2 rubbish */
@@ -2165,11 +2159,9 @@ static DRIVER_INIT( ddp2 )
ddp2_protram = auto_malloc(0x2000);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd10000, 0xd10001, 0, 0, ddp2_asic27_0xd10000_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd10000, 0xd10001, 0, 0, ddp2_asic27_0xd10000_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd10000, 0xd10001, 0, 0, ddp2_asic27_0xd10000_r, ddp2_asic27_0xd10000_w);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd00000, 0xd01fff, 0, 0, ddp2_protram_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xd00000, 0xd01fff, 0, 0, ddp2_protram_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd00000, 0xd01fff, 0, 0, ddp2_protram_r, ddp2_protram_w);
}
static DRIVER_INIT( puzzli2 )
@@ -2182,12 +2174,11 @@ static DRIVER_INIT( puzzli2 )
pgm_basic_init();
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_w16);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500000, 0x500003, 0, 0, ASIC28_r16, ASIC28_w16);
/* 0x4f0000 - ? is actually ram shared with the protection device,
the protection device provides the region code */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4f0000, 0x4fffff, 0, 0, sango_protram_r);
pgm_puzzli2_decrypt();
@@ -2318,8 +2309,7 @@ static DRIVER_INIT( olds )
pgm_basic_init();
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xDCB400, 0xDCB403, 0, 0, olds_r16);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xdcb400, 0xdcb403, 0, 0, olds_w16);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xdcb400, 0xdcb403, 0, 0, olds_r16, olds_w16);
}
diff --git a/src/mame/drivers/phoenix.c b/src/mame/drivers/phoenix.c
index 94debeb4e8b..16ca0f6470b 100644
--- a/src/mame/drivers/phoenix.c
+++ b/src/mame/drivers/phoenix.c
@@ -1018,7 +1018,7 @@ ROM_END
static DRIVER_INIT( condor )
{
/* additional inputs for coinage */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5000, 0, 0, port_tag_to_handler8("DSW1") );
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5000, 0, 0, port_tag_to_handler8("DSW1") );
}
static DRIVER_INIT( survival )
diff --git a/src/mame/drivers/pingpong.c b/src/mame/drivers/pingpong.c
index 2c760c45284..78288d4c499 100644
--- a/src/mame/drivers/pingpong.c
+++ b/src/mame/drivers/pingpong.c
@@ -593,18 +593,18 @@ static DRIVER_INIT( cashquiz )
ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7);
/* questions banking handlers */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000, 0, 0, cashquiz_question_bank_high_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4001, 0x4001, 0, 0, cashquiz_question_bank_low_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4000, 0, 0, cashquiz_question_bank_high_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4001, 0x4001, 0, 0, cashquiz_question_bank_low_w);
// 8 independents banks for questions
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x50ff, 0, 0, SMH_BANK1);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5100, 0x51ff, 0, 0, SMH_BANK2);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5200, 0x52ff, 0, 0, SMH_BANK3);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5300, 0x53ff, 0, 0, SMH_BANK4);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5400, 0x54ff, 0, 0, SMH_BANK5);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5500, 0x55ff, 0, 0, SMH_BANK6);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5600, 0x56ff, 0, 0, SMH_BANK7);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5700, 0x57ff, 0, 0, SMH_BANK8);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x50ff, 0, 0, SMH_BANK1);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5100, 0x51ff, 0, 0, SMH_BANK2);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5200, 0x52ff, 0, 0, SMH_BANK3);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5300, 0x53ff, 0, 0, SMH_BANK4);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5400, 0x54ff, 0, 0, SMH_BANK5);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5500, 0x55ff, 0, 0, SMH_BANK6);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5600, 0x56ff, 0, 0, SMH_BANK7);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5700, 0x57ff, 0, 0, SMH_BANK8);
// setup default banks
for(i = 0; i < 8; i++)
diff --git a/src/mame/drivers/pipedrm.c b/src/mame/drivers/pipedrm.c
index bea2b594fbd..8769651ecce 100644
--- a/src/mame/drivers/pipedrm.c
+++ b/src/mame/drivers/pipedrm.c
@@ -744,16 +744,15 @@ static DRIVER_INIT( pipedrm )
/* sprite RAM lives at the end of palette RAM */
spriteram = &paletteram[0xc00];
spriteram_size = 0x400;
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcfff, 0, 0, SMH_BANK3);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcfff, 0, 0, SMH_BANK3);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcfff, 0, 0, SMH_BANK3, SMH_BANK3);
memory_set_bankptr(3, spriteram);
}
static DRIVER_INIT( hatris )
{
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x20, 0x20, 0, 0, sound_command_nonmi_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x21, 0x21, 0, 0, fromance_gfxreg_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x20, 0x20, 0, 0, sound_command_nonmi_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x21, 0x21, 0, 0, fromance_gfxreg_w);
}
diff --git a/src/mame/drivers/pirates.c b/src/mame/drivers/pirates.c
index 823ef41cf26..180307d5d62 100644
--- a/src/mame/drivers/pirates.c
+++ b/src/mame/drivers/pirates.c
@@ -486,7 +486,7 @@ static DRIVER_INIT( genix )
/* If this value is increased then something has gone wrong and the protection failed */
/* Write-protect it for now */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x109e98, 0x109e9b, 0, 0, genix_prot_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x109e98, 0x109e9b, 0, 0, genix_prot_r );
}
diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c
index 7b11996d8a9..2baa598f01e 100644
--- a/src/mame/drivers/polepos.c
+++ b/src/mame/drivers/polepos.c
@@ -1687,16 +1687,16 @@ static DRIVER_INIT( topracra )
polepos_gear_bit = 0x20;
/* extra direct mapped inputs read */
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, input_port_5_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, input_port_0_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, input_port_1_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, input_port_5_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, input_port_0_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, input_port_1_r);
}
static DRIVER_INIT( polepos2 )
{
/* note that the bootleg version doesn't need this custom IC; it has a hacked ROM in its place */
- memory_install_read16_handler(1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, polepos2_ic25_r);
+ memory_install_read16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, polepos2_ic25_r);
DRIVER_INIT_CALL(polepos);
}
diff --git a/src/mame/drivers/policetr.c b/src/mame/drivers/policetr.c
index 7b4a8ccb1c3..530ced616f7 100644
--- a/src/mame/drivers/policetr.c
+++ b/src/mame/drivers/policetr.c
@@ -695,26 +695,26 @@ ROM_END
static DRIVER_INIT( policetr )
{
- speedup_data = memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000fc8, 0x00000fcb, 0, 0, speedup_w);
+ speedup_data = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000fc8, 0x00000fcb, 0, 0, speedup_w);
speedup_pc = 0x1fc028ac;
}
static DRIVER_INIT( plctr13b )
{
- speedup_data = memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000fc8, 0x00000fcb, 0, 0, speedup_w);
+ speedup_data = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000fc8, 0x00000fcb, 0, 0, speedup_w);
speedup_pc = 0x1fc028bc;
}
static DRIVER_INIT( sshooter )
{
- speedup_data = memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00018fd8, 0x00018fdb, 0, 0, speedup_w);
+ speedup_data = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00018fd8, 0x00018fdb, 0, 0, speedup_w);
speedup_pc = 0x1fc03470;
}
static DRIVER_INIT( sshoot12 )
{
- speedup_data = memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00018fd8, 0x00018fdb, 0, 0, speedup_w);
+ speedup_data = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00018fd8, 0x00018fdb, 0, 0, speedup_w);
speedup_pc = 0x1fc033e0;
}
diff --git a/src/mame/drivers/prehisle.c b/src/mame/drivers/prehisle.c
index 4e4d3ff134c..9eb1e453c52 100644
--- a/src/mame/drivers/prehisle.c
+++ b/src/mame/drivers/prehisle.c
@@ -371,7 +371,7 @@ static READ16_HANDLER( world_cycle_r )
static DRIVER_INIT( prehisle )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, world_cycle_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, world_cycle_r);
}
static READ16_HANDLER( usa_cycle_r )
@@ -388,7 +388,7 @@ static READ16_HANDLER( usa_cycle_r )
static DRIVER_INIT( prehislu )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, usa_cycle_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, usa_cycle_r);
}
static READ16_HANDLER( jap_cycle_r )
@@ -405,7 +405,7 @@ static READ16_HANDLER( jap_cycle_r )
static DRIVER_INIT( gensitou )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, jap_cycle_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70024, 0x70025, 0, 0, jap_cycle_r);
}
/******************************************************************************/
diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c
index 650512232ff..58495ba4870 100644
--- a/src/mame/drivers/psikyo.c
+++ b/src/mame/drivers/psikyo.c
@@ -1812,10 +1812,10 @@ static DRIVER_INIT( sngkace )
}
/* input ports */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, sngkace_input_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, sngkace_input_r);
/* sound latch */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, psikyo_soundlatch_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, psikyo_soundlatch_w);
psikyo_ka302c_banking = 0; // SH201B doesn't have any gfx banking
psikyo_switch_banks(0, 0); // sngkace / samuraia don't use banking
@@ -1984,10 +1984,10 @@ ROM_END
static DRIVER_INIT( gunbird )
{
/* input ports */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, gunbird_input_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, gunbird_input_r);
/* sound latch */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, psikyo_soundlatch_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, psikyo_soundlatch_w);
psikyo_ka302c_banking = 1;
}
@@ -2042,10 +2042,10 @@ ROM_END
static DRIVER_INIT( s1945jn )
{
/* input ports */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, gunbird_input_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, gunbird_input_r);
/* sound latch */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w);
psikyo_ka302c_banking = 1;
}
@@ -2197,13 +2197,13 @@ ROM_END
static DRIVER_INIT( s1945 )
{
/* input ports */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r);
/* sound latch */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w);
/* protection and tile bank switching */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w);
s1945_mcu_init(s1945_table);
psikyo_ka302c_banking = 0; // Banking is controlled by mcu
@@ -2212,13 +2212,13 @@ static DRIVER_INIT( s1945 )
static DRIVER_INIT( s1945a )
{
/* input ports */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r);
/* sound latch */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w);
/* protection and tile bank switching */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w);
s1945_mcu_init(s1945a_table);
psikyo_ka302c_banking = 0; // Banking is controlled by mcu
@@ -2227,13 +2227,13 @@ static DRIVER_INIT( s1945a )
static DRIVER_INIT( s1945j )
{
/* input ports*/
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r);
/* sound latch */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w);
/* protection and tile bank switching */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w);
s1945_mcu_init(s1945j_table);
psikyo_ka302c_banking = 0; // Banking is controlled by mcu
@@ -2294,13 +2294,13 @@ ROM_END
static DRIVER_INIT( tengai )
{
/* input ports */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc0000b, 0, 0, s1945_input_r);
/* sound latch */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00010, 0xc00013, 0, 0, s1945_soundlatch_w);
/* protection */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00004, 0xc0000b, 0, 0, s1945_mcu_w);
s1945_mcu_init(0);
psikyo_ka302c_banking = 0; // Banking is controlled by mcu
diff --git a/src/mame/drivers/psikyo4.c b/src/mame/drivers/psikyo4.c
index e349c601531..4b5dcb45049 100644
--- a/src/mame/drivers/psikyo4.c
+++ b/src/mame/drivers/psikyo4.c
@@ -1084,7 +1084,7 @@ static void install_hotgmck_pcm_bank(running_machine *machine)
set_hotgmck_pcm_bank(0);
set_hotgmck_pcm_bank(1);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x5800008, 0x580000b, 0, 0, hotgmck_pcm_bank_w );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5800008, 0x580000b, 0, 0, hotgmck_pcm_bank_w );
state_save_register_postload(machine, hotgmck_pcm_bank_postload, (void *)0);
state_save_register_postload(machine, hotgmck_pcm_bank_postload, (void *)1);
}
@@ -1093,23 +1093,23 @@ static DRIVER_INIT( hotgmck )
{
UINT8 *RAM = memory_region(REGION_CPU1);
memory_set_bankptr(1,&RAM[0x100000]);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x5800000, 0x5800007, 0, 0, hotgmck_io32_r ); // Different Inputs
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5800000, 0x5800007, 0, 0, hotgmck_io32_r ); // Different Inputs
install_hotgmck_pcm_bank(machine); // Banked PCM ROM
}
static DRIVER_INIT( loderndf )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000020, 0x6000023, 0, 0, loderndf_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000020, 0x6000023, 0, 0, loderndf_speedup_r );
}
static DRIVER_INIT( loderdfa )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000020, 0x6000023, 0, 0, loderdfa_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000020, 0x6000023, 0, 0, loderdfa_speedup_r );
}
static DRIVER_INIT( hotdebut )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600001c, 0x600001f, 0, 0, hotdebut_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600001c, 0x600001f, 0, 0, hotdebut_speedup_r );
}
diff --git a/src/mame/drivers/psikyosh.c b/src/mame/drivers/psikyosh.c
index 8eccfe4856a..69ae8392c3e 100644
--- a/src/mame/drivers/psikyosh.c
+++ b/src/mame/drivers/psikyosh.c
@@ -1230,13 +1230,13 @@ static READ32_HANDLER( mjgtaste_speedup_r )
static DRIVER_INIT( soldivid )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, soldivid_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, soldivid_speedup_r );
use_factory_eeprom=EEPROM_0;
}
static DRIVER_INIT( s1945ii )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, s1945ii_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, s1945ii_speedup_r );
use_factory_eeprom=EEPROM_DEFAULT;
}
@@ -1244,13 +1244,13 @@ static DRIVER_INIT( daraku )
{
UINT8 *RAM = memory_region(REGION_CPU1);
memory_set_bankptr(1,&RAM[0x100000]);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, daraku_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, daraku_speedup_r );
use_factory_eeprom=EEPROM_DARAKU;
}
static DRIVER_INIT( sbomberb )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, sbomberb_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600000c, 0x600000f, 0, 0, sbomberb_speedup_r );
use_factory_eeprom=EEPROM_DEFAULT;
}
@@ -1258,7 +1258,7 @@ static DRIVER_INIT( gunbird2 )
{
UINT8 *RAM = memory_region(REGION_CPU1);
memory_set_bankptr(1,&RAM[0x100000]);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x604000c, 0x604000f, 0, 0, gunbird2_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x604000c, 0x604000f, 0, 0, gunbird2_speedup_r );
use_factory_eeprom=EEPROM_DEFAULT;
}
@@ -1266,25 +1266,25 @@ static DRIVER_INIT( s1945iii )
{
UINT8 *RAM = memory_region(REGION_CPU1);
memory_set_bankptr(1,&RAM[0x100000]);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, s1945iii_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, s1945iii_speedup_r );
use_factory_eeprom=EEPROM_S1945III;
}
static DRIVER_INIT( dragnblz )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, dragnblz_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, dragnblz_speedup_r );
use_factory_eeprom=EEPROM_DRAGNBLZ;
}
static DRIVER_INIT( gnbarich )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, gnbarich_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, gnbarich_speedup_r );
use_factory_eeprom=EEPROM_GNBARICH;
}
static DRIVER_INIT( mjgtaste )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, mjgtaste_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x606000c, 0x606000f, 0, 0, mjgtaste_speedup_r );
use_factory_eeprom=EEPROM_MJGTASTE;
/* needs to install mahjong controls too (can select joystick in test mode tho) */
}
diff --git a/src/mame/drivers/pturn.c b/src/mame/drivers/pturn.c
index 674908856d1..bfc8dbb249c 100644
--- a/src/mame/drivers/pturn.c
+++ b/src/mame/drivers/pturn.c
@@ -521,8 +521,8 @@ ROM_END
static DRIVER_INIT(pturn)
{
/*
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc0dd, 0xc0dd, 0, 0, pturn_protection_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc0db, 0xc0db, 0, 0, pturn_protection2_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc0dd, 0xc0dd, 0, 0, pturn_protection_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc0db, 0xc0db, 0, 0, pturn_protection2_r);
*/
}
diff --git a/src/mame/drivers/qdrmfgp.c b/src/mame/drivers/qdrmfgp.c
index 08c6daf590b..3047db104e7 100644
--- a/src/mame/drivers/qdrmfgp.c
+++ b/src/mame/drivers/qdrmfgp.c
@@ -211,38 +211,38 @@ static WRITE16_HANDLER( k054539_word_w )
#define IDE_STD_OFFSET (0x1f0/2)
#define IDE_ALT_OFFSET (0x3f6/2)
-static READ16_HANDLER( ide_std_r )
+static READ16_DEVICE_HANDLER( ide_std_r )
{
if (offset & 0x01)
- return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset/2, 0x00ff) >> 8;
+ return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0x00ff) >> 8;
else
- return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset/2, 0x0000);
+ return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0x0000);
}
-static WRITE16_HANDLER( ide_std_w )
+static WRITE16_DEVICE_HANDLER( ide_std_w )
{
if (offset & 0x01)
- ide_controller16_0_w(machine, IDE_STD_OFFSET + offset/2, data << 8, 0x00ff);
+ ide_controller16_w(device, IDE_STD_OFFSET + offset/2, data << 8, 0x00ff);
else
- ide_controller16_0_w(machine, IDE_STD_OFFSET + offset/2, data, 0x0000);
+ ide_controller16_w(device, IDE_STD_OFFSET + offset/2, data, 0x0000);
}
-static READ16_HANDLER( ide_alt_r )
+static READ16_DEVICE_HANDLER( ide_alt_r )
{
if (offset == 0)
- return ide_controller16_0_r(machine, IDE_ALT_OFFSET, 0xff00);
+ return ide_controller16_r(device, IDE_ALT_OFFSET, 0xff00);
return 0;
}
-static WRITE16_HANDLER( ide_alt_w )
+static WRITE16_DEVICE_HANDLER( ide_alt_w )
{
if (offset == 0)
- ide_controller16_0_w(machine, IDE_ALT_OFFSET, data, 0xff00);
+ ide_controller16_w(device, IDE_ALT_OFFSET, data, 0xff00);
}
-static READ16_HANDLER( gp2_ide_std_r )
+static READ16_DEVICE_HANDLER( gp2_ide_std_r )
{
if (offset & 0x01)
{
@@ -260,9 +260,9 @@ static READ16_HANDLER( gp2_ide_std_r )
break;
}
}
- return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset/2, 0x00ff) >> 8;
+ return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0x00ff) >> 8;
} else {
- return ide_controller16_0_r(machine, IDE_STD_OFFSET + offset/2, 0x0000);
+ return ide_controller16_r(device, IDE_STD_OFFSET + offset/2, 0x0000);
}
}
@@ -290,14 +290,14 @@ static INTERRUPT_GEN(qdrmfgp_interrupt)
}
}
-static void ide_interrupt(int state)
+static void ide_interrupt(const device_config *device, int state)
{
if (control & 0x0008)
{
if (state != CLEAR_LINE)
- cpunum_set_input_line(Machine, 0, 4, HOLD_LINE);
+ cpunum_set_input_line(device->machine, 0, 4, HOLD_LINE);
else
- cpunum_set_input_line(Machine, 0, 4, CLEAR_LINE);
+ cpunum_set_input_line(device->machine, 0, 4, CLEAR_LINE);
}
}
@@ -316,7 +316,7 @@ static INTERRUPT_GEN(qdrmfgp2_interrupt)
cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
}
-static void gp2_ide_interrupt(int state)
+static void gp2_ide_interrupt(const device_config *device, int state)
{
if (control & 0x0010)
{
@@ -325,9 +325,9 @@ static void gp2_ide_interrupt(int state)
if (gp2_irq_control)
gp2_irq_control = 0;
else
- cpunum_set_input_line(Machine, 0, 5, HOLD_LINE);
+ cpunum_set_input_line(device->machine, 0, 5, HOLD_LINE);
} else {
- cpunum_set_input_line(Machine, 0, 5, CLEAR_LINE);
+ cpunum_set_input_line(device->machine, 0, 5, CLEAR_LINE);
}
}
}
@@ -351,8 +351,8 @@ static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x880000, 0x881fff) AM_READ(K056832_ram_word_r) /* vram */
AM_RANGE(0x882000, 0x883fff) AM_READ(K056832_ram_word_r) /* vram (mirror) */
AM_RANGE(0x900000, 0x901fff) AM_READ(v_rom_r) /* gfxrom through */
- AM_RANGE(0xa00000, 0xa0000f) AM_READ(ide_std_r) /* IDE control regs */
- AM_RANGE(0xa4000c, 0xa4000f) AM_READ(ide_alt_r) /* IDE status control reg */
+ AM_RANGE(0xa00000, 0xa0000f) AM_DEVREAD(IDE_CONTROLLER, "ide", ide_std_r) /* IDE control regs */
+ AM_RANGE(0xa4000c, 0xa4000f) AM_DEVREAD(IDE_CONTROLLER, "ide", ide_alt_r) /* IDE status control reg */
AM_RANGE(0xc00000, 0xcbffff) AM_READ(sndram_r) /* sound ram */
ADDRESS_MAP_END
@@ -370,8 +370,8 @@ static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x800000, 0x80045f) AM_WRITE(k054539_word_w) /* sound regs */
AM_RANGE(0x880000, 0x881fff) AM_WRITE(K056832_ram_word_w) /* vram */
AM_RANGE(0x882000, 0x883fff) AM_WRITE(K056832_ram_word_w) /* vram (mirror) */
- AM_RANGE(0xa00000, 0xa0000f) AM_WRITE(ide_std_w) /* IDE control regs */
- AM_RANGE(0xa4000c, 0xa4000f) AM_WRITE(ide_alt_w) /* IDE status control reg */
+ AM_RANGE(0xa00000, 0xa0000f) AM_DEVWRITE(IDE_CONTROLLER, "ide", ide_std_w) /* IDE control regs */
+ AM_RANGE(0xa4000c, 0xa4000f) AM_DEVWRITE(IDE_CONTROLLER, "ide", ide_alt_w) /* IDE status control reg */
AM_RANGE(0xc00000, 0xcbffff) AM_WRITE(sndram_w) /* sound ram */
ADDRESS_MAP_END
@@ -388,8 +388,8 @@ static ADDRESS_MAP_START( gp2_readmem, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x880000, 0x881fff) AM_READ(gp2_vram_r) /* vram */
AM_RANGE(0x89f000, 0x8a0fff) AM_READ(gp2_vram_mirror_r) /* vram (mirror) */
AM_RANGE(0x900000, 0x901fff) AM_READ(v_rom_r) /* gfxrom through */
- AM_RANGE(0xa00000, 0xa0000f) AM_READ(gp2_ide_std_r) /* IDE control regs */
- AM_RANGE(0xa4000c, 0xa4000f) AM_READ(ide_alt_r) /* IDE status control reg */
+ AM_RANGE(0xa00000, 0xa0000f) AM_DEVREAD(IDE_CONTROLLER, "ide", gp2_ide_std_r) /* IDE control regs */
+ AM_RANGE(0xa4000c, 0xa4000f) AM_DEVREAD(IDE_CONTROLLER, "ide", ide_alt_r) /* IDE status control reg */
AM_RANGE(0xc00000, 0xcbffff) AM_READ(sndram_r) /* sound ram */
ADDRESS_MAP_END
@@ -407,8 +407,8 @@ static ADDRESS_MAP_START( gp2_writemem, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x800000, 0x80045f) AM_WRITE(k054539_word_w) /* sound regs */
AM_RANGE(0x880000, 0x881fff) AM_WRITE(gp2_vram_w) /* vram */
AM_RANGE(0x89f000, 0x8a0fff) AM_WRITE(gp2_vram_mirror_w) /* vram (mirror) */
- AM_RANGE(0xa00000, 0xa0000f) AM_WRITE(ide_std_w) /* IDE control regs */
- AM_RANGE(0xa4000c, 0xa4000f) AM_WRITE(ide_alt_w) /* IDE status control reg */
+ AM_RANGE(0xa00000, 0xa0000f) AM_DEVWRITE(IDE_CONTROLLER, "ide", ide_std_w) /* IDE control regs */
+ AM_RANGE(0xa4000c, 0xa4000f) AM_DEVWRITE(IDE_CONTROLLER, "ide", ide_alt_w) /* IDE status control reg */
AM_RANGE(0xc00000, 0xcbffff) AM_WRITE(sndram_w) /* sound ram */
ADDRESS_MAP_END
@@ -589,23 +589,6 @@ INPUT_PORTS_END
/*************************************
*
- * IDE interfaces
- *
- *************************************/
-
-static const struct ide_interface ide_intf =
-{
- ide_interrupt,
-};
-
-static const struct ide_interface gp2_ide_intf =
-{
- gp2_ide_interrupt,
-};
-
-
-/*************************************
- *
* Sound interfaces
*
*************************************/
@@ -648,7 +631,7 @@ static MACHINE_RESET( qdrmfgp )
/* reset the IDE controller */
gp2_irq_control = 0;
- ide_controller_reset(0);
+ devtag_reset(machine, IDE_CONTROLLER, "ide");
}
static MACHINE_RESET( qdrmfgp2 )
@@ -660,7 +643,7 @@ static MACHINE_RESET( qdrmfgp2 )
/* reset the IDE controller */
gp2_irq_control = 0;
- ide_controller_reset(0);
+ devtag_reset(machine, IDE_CONTROLLER, "ide");
}
@@ -680,6 +663,8 @@ static MACHINE_DRIVER_START( qdrmfgp )
MDRV_MACHINE_START(qdrmfgp)
MDRV_MACHINE_RESET(qdrmfgp)
MDRV_NVRAM_HANDLER(generic_1fill)
+
+ MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt)
/* video hardware */
MDRV_SCREEN_ADD("main", RASTER)
@@ -713,6 +698,8 @@ static MACHINE_DRIVER_START( qdrmfgp2 )
MDRV_MACHINE_START(qdrmfgp)
MDRV_MACHINE_RESET(qdrmfgp2)
MDRV_NVRAM_HANDLER(generic_1fill)
+
+ MDRV_IDE_CONTROLLER_ADD("ide", 0, gp2_ide_interrupt)
/* video hardware */
MDRV_SCREEN_ADD("main", RASTER)
@@ -780,28 +767,10 @@ ROM_END
/*************************************
*
- * Driver-specific init
- *
- *************************************/
-
-static DRIVER_INIT( qdrmfgp )
-{
- /* spin up the hard disk */
- ide_controller_init(0, &ide_intf);
-}
-
-static DRIVER_INIT( qdrmfgp2 )
-{
- /* spin up the hard disk */
- ide_controller_init(0, &gp2_ide_intf);
-}
-
-/*************************************
- *
* Game drivers
*
*************************************/
/* year rom clone machine inputs init */
-GAME( 1994, qdrmfgp, 0, qdrmfgp, qdrmfgp, qdrmfgp, ROT0, "Konami", "Quiz Do Re Mi Fa Grand Prix (Japan)", 0 )
-GAME( 1995, qdrmfgp2, 0, qdrmfgp2, qdrmfgp2, qdrmfgp2, ROT0, "Konami", "Quiz Do Re Mi Fa Grand Prix2 - Shin-Kyoku Nyuukadayo (Japan)", 0 )
+GAME( 1994, qdrmfgp, 0, qdrmfgp, qdrmfgp, 0, ROT0, "Konami", "Quiz Do Re Mi Fa Grand Prix (Japan)", 0 )
+GAME( 1995, qdrmfgp2, 0, qdrmfgp2, qdrmfgp2, 0, ROT0, "Konami", "Quiz Do Re Mi Fa Grand Prix2 - Shin-Kyoku Nyuukadayo (Japan)", 0 )
diff --git a/src/mame/drivers/qix.c b/src/mame/drivers/qix.c
index 18f7e97541a..2acfa8c9fbc 100644
--- a/src/mame/drivers/qix.c
+++ b/src/mame/drivers/qix.c
@@ -1101,8 +1101,7 @@ static DRIVER_INIT( zookeep )
static DRIVER_INIT( slither )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9800, 0x9bff, 0, 0, pia_1_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9800, 0x9bff, 0, 0, pia_1_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9800, 0x9bff, 0, 0, pia_1_r, pia_1_w);
}
diff --git a/src/mame/drivers/raiden.c b/src/mame/drivers/raiden.c
index e5d09e1577d..763667a8d1c 100644
--- a/src/mame/drivers/raiden.c
+++ b/src/mame/drivers/raiden.c
@@ -473,12 +473,12 @@ static READ16_HANDLER( sub_cpu_spina_r )
static DRIVER_INIT( raiden )
{
- memory_install_read16_handler(1, ADDRESS_SPACE_PROGRAM, 0x4008, 0x4009, 0, 0, sub_cpu_spin_r);
+ memory_install_read16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4008, 0x4009, 0, 0, sub_cpu_spin_r);
}
-static void memory_patcha(void)
+static void memory_patcha(running_machine *machine)
{
- memory_install_read16_handler(1, ADDRESS_SPACE_PROGRAM, 0x4008, 0x4009, 0, 0, sub_cpu_spina_r);
+ memory_install_read16_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4008, 0x4009, 0, 0, sub_cpu_spina_r);
}
/* This is based on code by Niclas Karlsson Mate, who figured out the
@@ -512,13 +512,13 @@ static void common_decrypt(void)
static DRIVER_INIT( raidenk )
{
- memory_patcha();
+ memory_patcha(machine);
common_decrypt();
}
static DRIVER_INIT( raidena )
{
- memory_patcha();
+ memory_patcha(machine);
common_decrypt();
seibu_sound_decrypt(REGION_CPU3,0x20000);
}
diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c
index 51fbdb69b8e..7851d19a9dd 100644
--- a/src/mame/drivers/seattle.c
+++ b/src/mame/drivers/seattle.c
@@ -566,7 +566,7 @@ static MACHINE_RESET( seattle )
/* reset the other devices */
galileo_reset();
- ide_controller_reset(0);
+ devtag_reset(machine, IDE_CONTROLLER, "ide");
voodoo_reset(0);
if (board_config == SEATTLE_WIDGET_CONFIG)
widget_reset();
@@ -582,18 +582,12 @@ static MACHINE_RESET( seattle )
*
*************************************/
-static void ide_interrupt(int state)
+static void ide_interrupt(const device_config *device, int state)
{
- cpunum_set_input_line(Machine, 0, IDE_IRQ_NUM, state);
+ cpunum_set_input_line(device->machine, 0, IDE_IRQ_NUM, state);
}
-static const struct ide_interface ide_intf =
-{
- ide_interrupt
-};
-
-
/*************************************
*
@@ -1728,9 +1722,9 @@ static ADDRESS_MAP_START( seattle_map, ADDRESS_SPACE_PROGRAM, 32 )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_BASE(&rambase) // wg3dh only has 4MB; sfrush, blitz99 8MB
AM_RANGE(0x08000000, 0x08ffffff) AM_READWRITE(voodoo_0_r, seattle_voodoo_w)
- AM_RANGE(0x0a000000, 0x0a0003ff) AM_READWRITE(ide_controller32_0_r, ide_controller32_0_w)
+ AM_RANGE(0x0a000000, 0x0a0003ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_controller32_r, ide_controller32_w)
AM_RANGE(0x0a00040c, 0x0a00040f) AM_NOP // IDE-related, but annoying
- AM_RANGE(0x0a000f00, 0x0a000f07) AM_READWRITE(ide_bus_master32_0_r, ide_bus_master32_0_w)
+ AM_RANGE(0x0a000f00, 0x0a000f07) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_bus_master32_r, ide_bus_master32_w)
AM_RANGE(0x0c000000, 0x0c000fff) AM_READWRITE(galileo_r, galileo_w)
AM_RANGE(0x13000000, 0x13000003) AM_WRITE(asic_fifo_w)
AM_RANGE(0x16000000, 0x1600003f) AM_READWRITE(midway_ioasic_r, midway_ioasic_w)
@@ -2464,6 +2458,8 @@ static MACHINE_DRIVER_START( seattle_common )
MDRV_MACHINE_RESET(seattle)
MDRV_NVRAM_HANDLER(generic_1fill)
+
+ MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt)
/* video hardware */
MDRV_SCREEN_ADD("main", RASTER)
@@ -2726,10 +2722,9 @@ ROM_END
*
*************************************/
-static void init_common(int ioasic, int serialnum, int yearoffs, int config)
+static void init_common(running_machine *machine, int ioasic, int serialnum, int yearoffs, int config)
{
/* initialize the subsystems */
- ide_controller_init(0, &ide_intf);
midway_ioasic_init(ioasic, serialnum, yearoffs, ioasic_irq);
/* switch off the configuration */
@@ -2738,25 +2733,21 @@ static void init_common(int ioasic, int serialnum, int yearoffs, int config)
{
case PHOENIX_CONFIG:
/* original Phoenix board only has 4MB of RAM */
- memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x00400000, 0x007fffff, 0, 0, SMH_NOP);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00400000, 0x007fffff, 0, 0, SMH_NOP);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00400000, 0x007fffff, 0, 0, SMH_NOP, SMH_NOP);
break;
case SEATTLE_WIDGET_CONFIG:
/* set up the widget board */
- memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x16c00000, 0x16c0001f, 0, 0, widget_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x16c00000, 0x16c0001f, 0, 0, widget_w);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x16c00000, 0x16c0001f, 0, 0, widget_r, widget_w);
smc91c94_init(&ethernet_intf);
break;
case FLAGSTAFF_CONFIG:
/* set up the analog inputs */
- memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x14000000, 0x14000003, 0, 0, analog_port_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x14000000, 0x14000003, 0, 0, analog_port_w);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x14000000, 0x14000003, 0, 0, analog_port_r, analog_port_w);
/* set up the ethernet controller */
- memory_install_read32_handler (0, ADDRESS_SPACE_PROGRAM, 0x16c00000, 0x16c0003f, 0, 0, ethernet_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x16c00000, 0x16c0003f, 0, 0, ethernet_w);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x16c00000, 0x16c0003f, 0, 0, ethernet_r, ethernet_w);
smc91c94_init(&ethernet_intf);
break;
}
@@ -2776,8 +2767,8 @@ static void add_speedup(offs_t pc, UINT32 op)
static DRIVER_INIT( wg3dh )
{
- dcs2_init(2, 0x3839);
- init_common(MIDWAY_IOASIC_STANDARD, 310/* others? */, 80, PHOENIX_CONFIG);
+ dcs2_init(machine, 2, 0x3839);
+ init_common(machine, MIDWAY_IOASIC_STANDARD, 310/* others? */, 80, PHOENIX_CONFIG);
/* speedups */
add_speedup(0x8004413C, 0x0C0054B4); /* confirmed */
@@ -2788,8 +2779,8 @@ static DRIVER_INIT( wg3dh )
static DRIVER_INIT( mace )
{
- dcs2_init(2, 0x3839);
- init_common(MIDWAY_IOASIC_MACE, 319/* others? */, 80, SEATTLE_CONFIG);
+ dcs2_init(machine, 2, 0x3839);
+ init_common(machine, MIDWAY_IOASIC_MACE, 319/* others? */, 80, SEATTLE_CONFIG);
/* speedups */
add_speedup(0x800108F8, 0x8C420000); /* confirmed */
@@ -2798,8 +2789,8 @@ static DRIVER_INIT( mace )
static DRIVER_INIT( sfrush )
{
- cage_init(REGION_USER2, 0x5236);
- init_common(MIDWAY_IOASIC_STANDARD, 315/* no alternates */, 100, FLAGSTAFF_CONFIG);
+ cage_init(machine, REGION_USER2, 0x5236);
+ init_common(machine, MIDWAY_IOASIC_STANDARD, 315/* no alternates */, 100, FLAGSTAFF_CONFIG);
/* speedups */
add_speedup(0x80059F34, 0x3C028012); /* confirmed */
@@ -2810,8 +2801,8 @@ static DRIVER_INIT( sfrush )
static DRIVER_INIT( sfrushrk )
{
- cage_init(REGION_USER2, 0x5329);
- init_common(MIDWAY_IOASIC_SFRUSHRK, 331/* unknown */, 100, FLAGSTAFF_CONFIG);
+ cage_init(machine, REGION_USER2, 0x5329);
+ init_common(machine, MIDWAY_IOASIC_SFRUSHRK, 331/* unknown */, 100, FLAGSTAFF_CONFIG);
/* speedups */
add_speedup(0x800343E8, 0x3C028012); /* confirmed */
@@ -2823,8 +2814,8 @@ static DRIVER_INIT( sfrushrk )
static DRIVER_INIT( calspeed )
{
- dcs2_init(2, 0x39c0);
- init_common(MIDWAY_IOASIC_CALSPEED, 328/* others? */, 100, SEATTLE_WIDGET_CONFIG);
+ dcs2_init(machine, 2, 0x39c0);
+ init_common(machine, MIDWAY_IOASIC_CALSPEED, 328/* others? */, 100, SEATTLE_WIDGET_CONFIG);
midway_ioasic_set_auto_ack(1);
/* speedups */
@@ -2835,8 +2826,8 @@ static DRIVER_INIT( calspeed )
static DRIVER_INIT( vaportrx )
{
- dcs2_init(2, 0x39c2);
- init_common(MIDWAY_IOASIC_VAPORTRX, 324/* 334? unknown */, 100, SEATTLE_WIDGET_CONFIG);
+ dcs2_init(machine, 2, 0x39c2);
+ init_common(machine, MIDWAY_IOASIC_VAPORTRX, 324/* 334? unknown */, 100, SEATTLE_WIDGET_CONFIG);
/* speedups */
add_speedup(0x80049F14, 0x3C028020); /* confirmed */
@@ -2847,8 +2838,8 @@ static DRIVER_INIT( vaportrx )
static DRIVER_INIT( biofreak )
{
- dcs2_init(2, 0x3835);
- init_common(MIDWAY_IOASIC_STANDARD, 231/* no alternates */, 80, SEATTLE_CONFIG);
+ dcs2_init(machine, 2, 0x3835);
+ init_common(machine, MIDWAY_IOASIC_STANDARD, 231/* no alternates */, 80, SEATTLE_CONFIG);
/* speedups */
}
@@ -2856,8 +2847,8 @@ static DRIVER_INIT( biofreak )
static DRIVER_INIT( blitz )
{
- dcs2_init(2, 0x39c2);
- init_common(MIDWAY_IOASIC_BLITZ99, 444/* or 528 */, 80, SEATTLE_CONFIG);
+ dcs2_init(machine, 2, 0x39c2);
+ init_common(machine, MIDWAY_IOASIC_BLITZ99, 444/* or 528 */, 80, SEATTLE_CONFIG);
/* for some reason, the code in the ROM appears buggy; this is a small patch to fix it */
rombase[0x934/4] += 4;
@@ -2870,8 +2861,8 @@ static DRIVER_INIT( blitz )
static DRIVER_INIT( blitz99 )
{
- dcs2_init(2, 0x0afb);
- init_common(MIDWAY_IOASIC_BLITZ99, 481/* or 484 or 520 */, 80, SEATTLE_CONFIG);
+ dcs2_init(machine, 2, 0x0afb);
+ init_common(machine, MIDWAY_IOASIC_BLITZ99, 481/* or 484 or 520 */, 80, SEATTLE_CONFIG);
/* speedups */
add_speedup(0x8014E41C, 0x3C038025); /* confirmed */
@@ -2881,8 +2872,8 @@ static DRIVER_INIT( blitz99 )
static DRIVER_INIT( blitz2k )
{
- dcs2_init(2, 0x0b5d);
- init_common(MIDWAY_IOASIC_BLITZ99, 494/* or 498 */, 80, SEATTLE_CONFIG);
+ dcs2_init(machine, 2, 0x0b5d);
+ init_common(machine, MIDWAY_IOASIC_BLITZ99, 494/* or 498 */, 80, SEATTLE_CONFIG);
/* speedups */
add_speedup(0x8015773C, 0x3C038025); /* confirmed */
@@ -2892,12 +2883,11 @@ static DRIVER_INIT( blitz2k )
static DRIVER_INIT( carnevil )
{
- dcs2_init(2, 0x0af7);
- init_common(MIDWAY_IOASIC_CARNEVIL, 469/* 469 or 486 or 528 */, 80, SEATTLE_CONFIG);
+ dcs2_init(machine, 2, 0x0af7);
+ init_common(machine, MIDWAY_IOASIC_CARNEVIL, 469/* 469 or 486 or 528 */, 80, SEATTLE_CONFIG);
/* set up the gun */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x16800000, 0x1680001f, 0, 0, carnevil_gun_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x16800000, 0x1680001f, 0, 0, carnevil_gun_w);
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x16800000, 0x1680001f, 0, 0, carnevil_gun_r, carnevil_gun_w);
/* speedups */
add_speedup(0x8015176C, 0x3C03801A); /* confirmed */
@@ -2907,8 +2897,8 @@ static DRIVER_INIT( carnevil )
static DRIVER_INIT( hyprdriv )
{
- dcs2_init(2, 0x0af7);
- init_common(MIDWAY_IOASIC_HYPRDRIV, 469/* unknown */, 80, SEATTLE_WIDGET_CONFIG);
+ dcs2_init(machine, 2, 0x0af7);
+ init_common(machine, MIDWAY_IOASIC_HYPRDRIV, 469/* unknown */, 80, SEATTLE_WIDGET_CONFIG);
/* speedups */
add_speedup(0x801643BC, 0x3C03801B); /* confirmed */
diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c
index 1906970a6a8..49b159eea9b 100644
--- a/src/mame/drivers/segac2.c
+++ b/src/mame/drivers/segac2.c
@@ -2088,7 +2088,7 @@ static DRIVER_INIT( tfrceacb )
{
/* disable the palette bank switching from the protection chip */
segac2_common_init(NULL);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x800001, 0, 0, SMH_NOP);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x800001, 0, 0, SMH_NOP);
}
static DRIVER_INIT( borench )
@@ -2173,36 +2173,36 @@ static DRIVER_INIT( pclub )
{
segac2_common_init(prot_func_pclub);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w);
}
static DRIVER_INIT( pclubjv2 )
{
segac2_common_init(prot_func_pclubjv2);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w);
}
static DRIVER_INIT( pclubjv4 )
{
segac2_common_init(prot_func_pclubjv4);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w);
}
static DRIVER_INIT( pclubjv5 )
{
segac2_common_init(prot_func_pclubjv5);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880120, 0x880121, 0, 0, printer_r );/*Print Club Vol.1*/
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, printer_r );/*Print Club Vol.2*/
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x880124, 0x880125, 0, 0, print_club_camera_w);
}
diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c
index 38f0f39f35d..051e9c246c6 100644
--- a/src/mame/drivers/segae.c
+++ b/src/mame/drivers/segae.c
@@ -2156,73 +2156,58 @@ static WRITE8_HANDLER( sms_sn76496_2_w )
SN76496_1_w(machine, 0, data & 0xff);
}
-static void init_ports_systeme(void)
+static void init_ports_systeme(running_machine *machine)
{
/* INIT THE PORTS *********************************************************************************************/
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, sms_vcounter_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, sms_sn76496_w);
+ memory_install_write8_handler (machine, 0, ADDRESS_SPACE_IO, 0x7b, 0x7b, 0, 0, sms_sn76496_2_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x7e, 0x7e, 0, 0, sms_vcounter_r, sms_sn76496_w);
+ memory_install_write8_handler (machine, 0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, sms_sn76496_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xba, 0xba, 0, 0, sms_vdp_data_r, sms_vdp_data_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xbb, 0xbb, 0, 0, sms_vdp_ctrl_r, sms_vdp_ctrl_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x7b, 0x7b, 0, 0, sms_sn76496_2_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, sms_vdp_2_data_r, sms_vdp_2_data_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, sms_vdp_2_ctrl_r, sms_vdp_2_ctrl_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x7f, 0x7f, 0, 0, sms_sn76496_w);
-
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xba, 0xba, 0, 0, sms_vdp_data_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xba, 0xba, 0, 0, sms_vdp_data_w);
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xbb, 0xbb, 0, 0, sms_vdp_ctrl_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xbb, 0xbb, 0, 0, sms_vdp_ctrl_w);
-
-
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, sms_vdp_2_data_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, sms_vdp_2_data_w);
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, sms_vdp_2_ctrl_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, sms_vdp_2_ctrl_w);
-
-
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xe0, 0xe0, 0, 0, input_port_2_r);
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xe1, 0xe1, 0, 0, input_port_3_r);
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xe2, 0xe2, 0, 0, input_port_4_r);
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xf2, 0xf2, 0, 0, input_port_0_r);
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xf3, 0xf3, 0, 0, input_port_1_r);
-
-
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xf7, 0xf7, 0, 0, systeme_bank_w );
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_IO, 0xe0, 0xe0, 0, 0, input_port_2_r);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_IO, 0xe1, 0xe1, 0, 0, input_port_3_r);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_IO, 0xe2, 0xe2, 0, 0, input_port_4_r);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_IO, 0xf2, 0xf2, 0, 0, input_port_0_r);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_IO, 0xf3, 0xf3, 0, 0, input_port_1_r);
+ memory_install_write8_handler (machine, 0, ADDRESS_SPACE_IO, 0xf7, 0xf7, 0, 0, systeme_bank_w );
}
-static void init_systeme_map(void)
+static void init_systeme_map(running_machine *machine)
{
/* INIT THE MEMMAP / BANKING *********************************************************************************/
/* catch any addresses that don't get mapped */
-// memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r);
-// memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_w);
+// memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0xffff, 0, 0, z80_unmapped_r, z80_unmapped_w);
/* fixed rom bank area */
// sms_rom = auto_malloc(0xc000);
-// memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_BANK1);
-// memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_UNMAP);
+// memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0xbfff, 0, 0, SMH_BANK1, SMH_UNMAP);
// memory_set_bankptr( 1, sms_rom );
memory_configure_bank(1, 0, 16, memory_region(REGION_CPU1) + 0x10000, 0x4000);
/* alternate way of accessing video ram */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, segasyse_videoram_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, segasyse_videoram_w);
// memcpy(sms_rom, memory_region(REGION_USER1), 0x8000);
/* main ram area */
sms_mainram = auto_malloc(0x4000);
- memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK2);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK2);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xffff, 0, 0, SMH_BANK2, SMH_BANK2);
memory_set_bankptr( 2, sms_mainram );
memset(sms_mainram,0x00,0x4000);
- init_ports_systeme();
+ init_ports_systeme(machine);
}
void init_for_megadrive(void)
@@ -2239,7 +2224,7 @@ void init_for_megadrive(void)
DRIVER_INIT( megatech_bios )
{
-// init_systeme_map();
+// init_systeme_map(machine);
vdp1 = start_vdp(machine, SMS2_VDP);
vdp1->set_irq = sms_vdp_cpu2_irq_callback;
@@ -2254,7 +2239,7 @@ DRIVER_INIT( megatech_bios )
static DRIVER_INIT( segasyse )
{
- init_systeme_map();
+ init_systeme_map(machine);
vdp1 = start_vdp(machine, SMS2_VDP);
// vdp1->set_irq = sms_vdp_cpu0_irq_callback;
@@ -2343,8 +2328,8 @@ static DRIVER_INIT( ridleofp )
{
DRIVER_INIT_CALL(segasyse);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, segae_ridleofp_port_f8_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xfa, 0xfa, 0, 0, segae_ridleofp_port_fa_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, segae_ridleofp_port_f8_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfa, 0xfa, 0, 0, segae_ridleofp_port_fa_w);
}
@@ -2352,8 +2337,8 @@ static DRIVER_INIT( hangonjr )
{
DRIVER_INIT_CALL(segasyse);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, segae_hangonjr_port_f8_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xfa, 0xfa, 0, 0, segae_hangonjr_port_fa_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, segae_hangonjr_port_f8_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfa, 0xfa, 0, 0, segae_hangonjr_port_fa_w);
}
static DRIVER_INIT( opaopa )
diff --git a/src/mame/drivers/segag80r.c b/src/mame/drivers/segag80r.c
index 9eb4ef3561a..ca94e4c4eb3 100644
--- a/src/mame/drivers/segag80r.c
+++ b/src/mame/drivers/segag80r.c
@@ -1399,11 +1399,11 @@ static DRIVER_INIT( astrob )
segag80r_background_pcb = G80_BACKGROUND_NONE;
/* install speech board */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w);
/* install Astro Blaster sound board */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3e, 0x3f, 0, 0, astrob_sound_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3e, 0x3f, 0, 0, astrob_sound_w);
}
@@ -1416,8 +1416,7 @@ static DRIVER_INIT( 005 )
segag80r_background_pcb = G80_BACKGROUND_NONE;
/* install the 8255 PPI for the sound board */
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r, ppi8255_0_w);
}
@@ -1430,15 +1429,14 @@ static DRIVER_INIT( spaceod )
segag80r_background_pcb = G80_BACKGROUND_SPACEOD;
/* configure ports for the background board */
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x08, 0x0f, 0, 0, spaceod_back_port_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x08, 0x0f, 0, 0, spaceod_back_port_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x08, 0x0f, 0, 0, spaceod_back_port_r, spaceod_back_port_w);
/* install Space Odyssey sound board */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x0e, 0x0f, 0, 0, spaceod_sound_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0f, 0, 0, spaceod_sound_w);
/* install our wacky mangled ports */
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xf8, 0xfb, 0, 0, spaceod_mangled_ports_r);
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spaceod_port_fc_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xfb, 0, 0, spaceod_mangled_ports_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spaceod_port_fc_r);
}
@@ -1452,12 +1450,11 @@ static DRIVER_INIT( monsterb )
monsterb_expand_gfx(REGION_GFX1);
/* install background board handlers */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, monsterb_back_port_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, monsterb_vidram_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, monsterb_back_port_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, monsterb_vidram_w);
/* install Monster Bash sound board */
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r, ppi8255_0_w);
}
@@ -1472,13 +1469,12 @@ static DRIVER_INIT( monster2 )
monsterb_expand_gfx(REGION_GFX1);
/* install background board handlers */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xb4, 0xb5, 0, 0, pignewt_back_color_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, pignewt_back_port_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, pignewt_vidram_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb4, 0xb5, 0, 0, pignewt_back_color_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, pignewt_back_port_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, pignewt_vidram_w);
/* install Monster Bash sound board */
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, ppi8255_0_r, ppi8255_0_w);
}
@@ -1492,15 +1488,13 @@ static DRIVER_INIT( pignewt )
monsterb_expand_gfx(REGION_GFX1);
/* install background board handlers */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xb4, 0xb5, 0, 0, pignewt_back_color_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, pignewt_back_port_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, pignewt_vidram_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb4, 0xb5, 0, 0, pignewt_back_color_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, pignewt_back_port_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, pignewt_vidram_w);
/* install Universal sound board */
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_status_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_data_w);
- memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, sega_usb_ram_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, usb_ram_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_status_r, sega_usb_data_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, sega_usb_ram_r, usb_ram_w);
}
@@ -1525,12 +1519,11 @@ static DRIVER_INIT( sindbadm )
segag80r_background_pcb = G80_BACKGROUND_SINDBADM;
/* install background board handlers */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x40, 0x41, 0, 0, sindbadm_back_port_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, sindbadm_vidram_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x40, 0x41, 0, 0, sindbadm_back_port_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, sindbadm_vidram_w);
/* install the 8255 PPI for the sound board */
- memory_install_read8_handler (0, ADDRESS_SPACE_IO, 0x80, 0x83, 0, 0, ppi8255_0_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x80, 0x83, 0, 0, ppi8255_0_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x80, 0x83, 0, 0, ppi8255_0_r, ppi8255_0_w);
ppi_intf.portBread[0] = port_tag_to_handler8("FC");
ppi8255_init(&ppi_intf);
}
diff --git a/src/mame/drivers/segag80v.c b/src/mame/drivers/segag80v.c
index ddfd0acd746..1ccfb09a1bd 100644
--- a/src/mame/drivers/segag80v.c
+++ b/src/mame/drivers/segag80v.c
@@ -1315,8 +1315,8 @@ static DRIVER_INIT( elim2 )
/* configure sound */
has_usb = FALSE;
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, elim1_sh_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, elim2_sh_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, elim1_sh_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, elim2_sh_w);
}
@@ -1327,12 +1327,12 @@ static DRIVER_INIT( elim4 )
/* configure sound */
has_usb = FALSE;
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, elim1_sh_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, elim2_sh_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, elim1_sh_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, elim2_sh_w);
/* configure inputs */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, elim4_input_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, elim4_input_r);
}
@@ -1343,10 +1343,10 @@ static DRIVER_INIT( spacfury )
/* configure sound */
has_usb = FALSE;
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, spacfury1_sh_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, spacfury2_sh_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, spacfury1_sh_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, spacfury2_sh_w);
}
@@ -1357,16 +1357,16 @@ static DRIVER_INIT( zektor )
/* configure sound */
has_usb = FALSE;
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3c, 0x3c, 0, 0, AY8910_control_port_0_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3d, 0x3d, 0, 0, AY8910_write_port_0_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, zektor1_sh_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, zektor2_sh_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3c, 0x3c, 0, 0, AY8910_control_port_0_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d, 0x3d, 0, 0, AY8910_write_port_0_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3e, 0x3e, 0, 0, zektor1_sh_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, zektor2_sh_w);
/* configure inputs */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spinner_input_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spinner_input_r);
}
@@ -1377,14 +1377,12 @@ static DRIVER_INIT( tacscan )
/* configure sound */
has_usb = TRUE;
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_status_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_data_w);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, sega_usb_ram_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, usb_ram_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_status_r, sega_usb_data_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, sega_usb_ram_r, usb_ram_w);
/* configure inputs */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spinner_input_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spinner_input_r);
}
@@ -1395,17 +1393,15 @@ static DRIVER_INIT( startrek )
/* configure sound */
has_usb = TRUE;
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x38, 0x38, 0, 0, sega_speech_data_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b, 0x3b, 0, 0, sega_speech_control_w);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_status_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_data_w);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, sega_usb_ram_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, usb_ram_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3f, 0x3f, 0, 0, sega_usb_status_r, sega_usb_data_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, 0, 0, sega_usb_ram_r, usb_ram_w);
/* configure inputs */
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spinner_input_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xf8, 0xf8, 0, 0, spinner_select_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0xfc, 0xfc, 0, 0, spinner_input_r);
}
diff --git a/src/mame/drivers/segaorun.c b/src/mame/drivers/segaorun.c
index d2e6a00d4b4..ddee5688d63 100644
--- a/src/mame/drivers/segaorun.c
+++ b/src/mame/drivers/segaorun.c
@@ -141,7 +141,7 @@ static READ8_HANDLER( sound_data_r )
-static void outrun_generic_init(void)
+static void outrun_generic_init(running_machine *machine)
{
/* allocate memory for regions not automatically assigned */
segaic16_spriteram_0 = auto_malloc(0x01000);
@@ -151,7 +151,7 @@ static void outrun_generic_init(void)
workram = auto_malloc(0x08000);
/* init the memory mapper */
- segaic16_memory_mapper_init(0, outrun_info, sound_data_w, NULL);
+ segaic16_memory_mapper_init(machine, 0, outrun_info, sound_data_w, NULL);
/* init the FD1094 */
fd1094_driver_init(segaic16_memory_mapper_set_decrypted);
@@ -267,9 +267,9 @@ static MACHINE_RESET( outrun )
fd1094_machine_init();
/* reset misc components */
- segaic16_memory_mapper_reset();
+ segaic16_memory_mapper_reset(machine);
if (custom_map)
- segaic16_memory_mapper_config(custom_map);
+ segaic16_memory_mapper_config(machine, custom_map);
segaic16_tilemap_reset(0);
/* hook the RESET line, which resets CPU #1 */
@@ -1677,7 +1677,7 @@ ROM_END
static DRIVER_INIT( outrun )
{
- outrun_generic_init();
+ outrun_generic_init(machine);
custom_io_r = outrun_custom_io_r;
custom_io_w = outrun_custom_io_w;
}
@@ -1690,7 +1690,7 @@ static DRIVER_INIT( outrunb )
UINT8 *byte;
int i, length;
- outrun_generic_init();
+ outrun_generic_init(machine);
custom_map = memory_map;
custom_io_r = outrun_custom_io_r;
custom_io_w = outrun_custom_io_w;
@@ -1728,7 +1728,7 @@ static DRIVER_INIT( outrunb )
static DRIVER_INIT( shangon )
{
- outrun_generic_init();
+ outrun_generic_init(machine);
custom_io_r = shangon_custom_io_r;
custom_io_w = shangon_custom_io_w;
}
@@ -1737,7 +1737,7 @@ static DRIVER_INIT( shangon )
static DRIVER_INIT( shangon3 )
{
extern void fd1089_decrypt_0034(void);
- outrun_generic_init();
+ outrun_generic_init(machine);
fd1089_decrypt_0034();
custom_io_r = shangon_custom_io_r;
custom_io_w = shangon_custom_io_w;
diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c
index 0d5b909941e..2a99e75b94b 100644
--- a/src/mame/drivers/segas16b.c
+++ b/src/mame/drivers/segas16b.c
@@ -1028,7 +1028,7 @@ static void sound_w(UINT8 data)
}
-static void system16b_generic_init(int _rom_board)
+static void system16b_generic_init(running_machine *machine, int _rom_board)
{
/* set the ROM board */
rom_board = _rom_board;
@@ -1041,7 +1041,7 @@ static void system16b_generic_init(int _rom_board)
workram = auto_malloc(0x04000);
/* init the memory mapper */
- segaic16_memory_mapper_init(0, region_info_list[rom_board], sound_w, NULL);
+ segaic16_memory_mapper_init(machine, 0, region_info_list[rom_board], sound_w, NULL);
/* init the FD1094 */
fd1094_driver_init(segaic16_memory_mapper_set_decrypted);
@@ -1077,9 +1077,9 @@ static MACHINE_RESET( system16b )
static const UINT8 alternate_banklist[] = { 0,255,255,255, 255,255,255,3, 255,255,255,2, 255,1,0,255 };
int i;
- segaic16_memory_mapper_reset();
+ segaic16_memory_mapper_reset(machine);
if (i8751_initial_config != NULL)
- segaic16_memory_mapper_config(i8751_initial_config);
+ segaic16_memory_mapper_config(machine, i8751_initial_config);
segaic16_tilemap_reset(0);
fd1094_machine_init();
@@ -6060,31 +6060,31 @@ ROM_END
static DRIVER_INIT( generic_5358_small )
{
- system16b_generic_init(ROM_BOARD_171_5358_SMALL);
+ system16b_generic_init(machine, ROM_BOARD_171_5358_SMALL);
}
static DRIVER_INIT( generic_5358 )
{
- system16b_generic_init(ROM_BOARD_171_5358);
+ system16b_generic_init(machine, ROM_BOARD_171_5358);
}
static DRIVER_INIT( generic_5521 )
{
- system16b_generic_init(ROM_BOARD_171_5521);
+ system16b_generic_init(machine, ROM_BOARD_171_5521);
}
static DRIVER_INIT( generic_5704 )
{
- system16b_generic_init(ROM_BOARD_171_5704);
+ system16b_generic_init(machine, ROM_BOARD_171_5704);
}
static DRIVER_INIT( generic_5797 )
{
- system16b_generic_init(ROM_BOARD_171_5797);
+ system16b_generic_init(machine, ROM_BOARD_171_5797);
}
@@ -6262,7 +6262,7 @@ static DRIVER_INIT( wrestwar_8751 )
static DRIVER_INIT( atomicp )
{
- system16b_generic_init(ROM_BOARD_ATOMICP);
+ system16b_generic_init(machine, ROM_BOARD_ATOMICP);
disable_screen_blanking = 1;
segaic16_display_enable = 1;
atomicp_sound_rate = 10000;
@@ -6271,7 +6271,7 @@ static DRIVER_INIT( atomicp )
static DRIVER_INIT( snapper )
{
- system16b_generic_init(ROM_BOARD_ATOMICP);
+ system16b_generic_init(machine, ROM_BOARD_ATOMICP);
disable_screen_blanking = 1;
segaic16_display_enable = 1;
atomicp_sound_rate = 2500;
diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c
index 4b151ea84cc..b82226364ed 100644
--- a/src/mame/drivers/segas18.c
+++ b/src/mame/drivers/segas18.c
@@ -160,7 +160,7 @@ static UINT8 sound_r(void)
}
-static void system18_generic_init(int _rom_board)
+static void system18_generic_init(running_machine *machine, int _rom_board)
{
/* set the ROM board */
rom_board = _rom_board;
@@ -173,7 +173,7 @@ static void system18_generic_init(int _rom_board)
workram = auto_malloc(0x04000);
/* init the memory mapper */
- segaic16_memory_mapper_init(0, region_info_list[rom_board], sound_w, sound_r);
+ segaic16_memory_mapper_init(machine, 0, region_info_list[rom_board], sound_w, sound_r);
/* init the FD1094 */
fd1094_driver_init(segaic16_memory_mapper_set_decrypted);
@@ -199,7 +199,7 @@ static TIMER_CALLBACK( boost_interleave )
static MACHINE_RESET( system18 )
{
- segaic16_memory_mapper_reset();
+ segaic16_memory_mapper_reset(machine);
segaic16_tilemap_reset(0);
fd1094_machine_init();
@@ -2199,17 +2199,17 @@ ROM_END
static DRIVER_INIT( generic_shad )
{
- system18_generic_init(ROM_BOARD_171_SHADOW);
+ system18_generic_init(machine, ROM_BOARD_171_SHADOW);
}
static DRIVER_INIT( generic_5874 )
{
- system18_generic_init(ROM_BOARD_171_5874);
+ system18_generic_init(machine, ROM_BOARD_171_5874);
}
static DRIVER_INIT( generic_5987 )
{
- system18_generic_init(ROM_BOARD_171_5987);
+ system18_generic_init(machine, ROM_BOARD_171_5987);
}
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index 0003878c9b7..4af02405476 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -3823,16 +3823,14 @@ static READ16_HANDLER( arescue_slavebusy_r )
static DRIVER_INIT( arescue )
{
segas32_common_init(analog_custom_io_r, analog_custom_io_w, NULL);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00006, 0, 0, arescue_dsp_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00006, 0, 0, arescue_dsp_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00006, 0, 0, arescue_dsp_r, arescue_dsp_w);
dual_pcb_comms = auto_malloc(0x1000);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x810000, 0x810fff, 0, 0, dual_pcb_comms_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x810000, 0x810fff, 0, 0, dual_pcb_comms_w);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x818000, 0x818003, 0, 0, dual_pcb_masterslave);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x810000, 0x810fff, 0, 0, dual_pcb_comms_r, dual_pcb_comms_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x818000, 0x818003, 0, 0, dual_pcb_masterslave);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x810001, 0x810001, 0, 0, arescue_handshake_r);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x81000f, 0x81000f, 0, 0, arescue_slavebusy_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x810001, 0x810001, 0, 0, arescue_handshake_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x81000f, 0x81000f, 0, 0, arescue_slavebusy_r);
}
@@ -3842,9 +3840,8 @@ static DRIVER_INIT( arabfgt )
segas32_common_init(extra_custom_io_r, NULL, NULL);
/* install protection handlers */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa000ff, 0, 0, arabfgt_protection_r);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00100, 0xa0011f, 0, 0, arf_wakeup_protection_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, arabfgt_protection_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00100, 0xa0011f, 0, 0, arf_wakeup_protection_r);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, arabfgt_protection_r, arabfgt_protection_w);
}
@@ -3854,8 +3851,8 @@ static DRIVER_INIT( brival )
/* install protection handlers */
system32_protram = auto_malloc (0x1000);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x20ba00, 0x20ba07, 0, 0, brival_protection_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, brival_protection_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20ba00, 0x20ba07, 0, 0, brival_protection_r);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, brival_protection_w);
}
@@ -3864,8 +3861,7 @@ static DRIVER_INIT( darkedge )
segas32_common_init(extra_custom_io_r, NULL, NULL);
/* install protection handlers */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa7ffff, 0, 0, darkedge_protection_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa7ffff, 0, 0, darkedge_protection_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa7ffff, 0, 0, darkedge_protection_r, darkedge_protection_w);
system32_prot_vblank = darkedge_fd1149_vblank;
}
@@ -3874,8 +3870,7 @@ static DRIVER_INIT( dbzvrvs )
segas32_common_init(NULL, NULL, NULL);
/* install protection handlers */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa7ffff, 0, 0, dbzvrvs_protection_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa7ffff, 0, 0, dbzvrvs_protection_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa7ffff, 0, 0, dbzvrvs_protection_r, dbzvrvs_protection_w);
}
static WRITE16_HANDLER( f1en_comms_echo_w )
@@ -3889,11 +3884,10 @@ static DRIVER_INIT( f1en )
segas32_common_init(analog_custom_io_r, analog_custom_io_w, NULL);
dual_pcb_comms = auto_malloc(0x1000);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x810000, 0x810fff, 0, 0, dual_pcb_comms_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x810000, 0x810fff, 0, 0, dual_pcb_comms_w);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x818000, 0x818003, 0, 0, dual_pcb_masterslave);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x810000, 0x810fff, 0, 0, dual_pcb_comms_r, dual_pcb_comms_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x818000, 0x818003, 0, 0, dual_pcb_masterslave);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x810048, 0x810048, 0, 0, f1en_comms_echo_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x810048, 0x810048, 0, 0, f1en_comms_echo_w);
}
@@ -3908,8 +3902,7 @@ static DRIVER_INIT( ga2 )
segas32_common_init(extra_custom_io_r, NULL, NULL);
decrypt_ga2_protrom();
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, ga2_dpram_w);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, ga2_dpram_r);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa00000, 0xa00fff, 0, 0, ga2_dpram_r, ga2_dpram_w);
}
@@ -3984,7 +3977,7 @@ static DRIVER_INIT( radr )
static DRIVER_INIT( scross )
{
segas32_common_init(analog_custom_io_r, analog_custom_io_w, NULL);
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0xb0, 0xbf, 0, 0, scross_bank_w);
+ memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xb0, 0xbf, 0, 0, scross_bank_w);
}
@@ -3999,7 +3992,7 @@ static DRIVER_INIT( sonic )
segas32_common_init(sonic_custom_io_r, sonic_custom_io_w, NULL);
/* install protection handlers */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x20E5C4, 0x20E5C5, 0, 0, sonic_level_load_protection);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20E5C4, 0x20E5C5, 0, 0, sonic_level_load_protection);
}
@@ -4024,7 +4017,7 @@ static DRIVER_INIT( svf )
static DRIVER_INIT( jleague )
{
segas32_common_init(NULL, NULL, NULL);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x20F700, 0x20F705, 0, 0, jleague_protection_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20F700, 0x20F705, 0, 0, jleague_protection_w);
}
diff --git a/src/mame/drivers/segaxbd.c b/src/mame/drivers/segaxbd.c
index c3912d635f8..ed634fe6ebb 100644
--- a/src/mame/drivers/segaxbd.c
+++ b/src/mame/drivers/segaxbd.c
@@ -2427,7 +2427,7 @@ static DRIVER_INIT( aburner2 )
xboard_generic_init();
xboard_set_road_priority(0);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x140006, 0x140007, 0, 0x00fff0, aburner2_iochip_0_D_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x140006, 0x140007, 0, 0x00fff0, aburner2_iochip_0_D_w);
}
@@ -2444,14 +2444,14 @@ static DRIVER_INIT( loffire )
adc_reverse[1] = adc_reverse[3] = 1;
/* install extra synchronization on core shared memory */
- loffire_sync = memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x29c000, 0x29c011, 0, 0, loffire_sync0_w);
+ loffire_sync = memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x29c000, 0x29c011, 0, 0, loffire_sync0_w);
}
static DRIVER_INIT( smgp )
{
xboard_generic_init();
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2f0000, 0x2f3fff, 0, 0, smgp_excs_r, smgp_excs_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2f0000, 0x2f3fff, 0, 0, smgp_excs_r, smgp_excs_w);
}
diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c
index 667a5195eb7..6e967171d32 100644
--- a/src/mame/drivers/seibuspi.c
+++ b/src/mame/drivers/seibuspi.c
@@ -1749,9 +1749,9 @@ static MACHINE_RESET( spi )
cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE );
cpunum_set_irq_callback(0, spi_irq_callback);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000680, 0x00000683, 0, 0, sound_fifo_r);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000688, 0x0000068b, 0, 0, z80_prg_fifo_w);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000068c, 0x0000068f, 0, 0, z80_enable_w);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000680, 0x00000683, 0, 0, sound_fifo_r);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000688, 0x0000068b, 0, 0, z80_prg_fifo_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000068c, 0x0000068f, 0, 0, z80_enable_w);
z80_rom = auto_malloc(0x40000);
memory_set_bankptr(4, z80_rom);
@@ -1823,8 +1823,8 @@ static MACHINE_RESET( sxx2f )
memcpy(z80_rom, rom, 0x40000);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000068c, 0x0000068f, 0, 0, eeprom_w);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00000680, 0x00000683, 0, 0, sb_coin_r);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000068c, 0x0000068f, 0, 0, eeprom_w);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000680, 0x00000683, 0, 0, sb_coin_r);
cpunum_set_irq_callback(0, spi_irq_callback);
sb_coin_latch = 0;
@@ -1995,28 +1995,28 @@ static void init_spi(running_machine *machine)
static DRIVER_INIT( rdft )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00298d0, 0x00298d3, 0, 0, rdft_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00298d0, 0x00298d3, 0, 0, rdft_speedup_r );
init_spi(machine);
}
static DRIVER_INIT( senkyu )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0018cb4, 0x0018cb7, 0, 0, senkyu_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0018cb4, 0x0018cb7, 0, 0, senkyu_speedup_r );
init_spi(machine);
}
static DRIVER_INIT( senkyua )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0018c9c, 0x0018c9f, 0, 0, senkyua_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0018c9c, 0x0018c9f, 0, 0, senkyua_speedup_r );
init_spi(machine);
}
static DRIVER_INIT( batlball )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0018db4, 0x0018db7, 0, 0, batlball_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0018db4, 0x0018db7, 0, 0, batlball_speedup_r );
init_spi(machine);
}
@@ -2024,21 +2024,21 @@ static DRIVER_INIT( batlball )
static DRIVER_INIT( ejanhs )
{
// idle skip doesn't work properly?
-// memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x002d224, 0x002d227, 0, 0, ejanhs_speedup_r );
+// memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x002d224, 0x002d227, 0, 0, ejanhs_speedup_r );
init_spi(machine);
}
static DRIVER_INIT( viprp1 )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x001e2e0, 0x001e2e3, 0, 0, viprp1_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x001e2e0, 0x001e2e3, 0, 0, viprp1_speedup_r );
init_spi(machine);
}
static DRIVER_INIT( viprp1o )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x001d49c, 0x001d49f, 0, 0, viprp1o_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x001d49c, 0x001d49f, 0, 0, viprp1o_speedup_r );
init_spi(machine);
}
@@ -2050,12 +2050,12 @@ static void init_rf2(running_machine *machine)
intelflash_init( 0, FLASH_INTEL_E28F008SA, NULL );
intelflash_init( 1, FLASH_INTEL_E28F008SA, NULL );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0282AC, 0x0282AF, 0, 0, rf2_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0282AC, 0x0282AF, 0, 0, rf2_speedup_r );
seibuspi_rise10_text_decrypt(memory_region(REGION_GFX1));
seibuspi_rise10_bg_decrypt(memory_region(REGION_GFX2), memory_region_length(REGION_GFX2));
seibuspi_rise10_sprite_decrypt(memory_region(REGION_GFX3), 0x600000);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x560, 0x563, 0, 0, sprite_dma_start_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x560, 0x563, 0, 0, sprite_dma_start_w);
}
static DRIVER_INIT( rdft2 )
@@ -2074,12 +2074,12 @@ static DRIVER_INIT( rfjet )
intelflash_init( 0, FLASH_INTEL_E28F008SA, NULL );
intelflash_init( 1, FLASH_INTEL_E28F008SA, NULL );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x002894c, 0x002894f, 0, 0, rfjet_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x002894c, 0x002894f, 0, 0, rfjet_speedup_r );
seibuspi_rise11_text_decrypt(memory_region(REGION_GFX1));
seibuspi_rise11_bg_decrypt(memory_region(REGION_GFX2), memory_region_length(REGION_GFX2));
seibuspi_rise11_sprite_decrypt(memory_region(REGION_GFX3), 0x800000);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x560, 0x563, 0, 0, sprite_dma_start_w);
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x560, 0x563, 0, 0, sprite_dma_start_w);
}
/* SYS386 */
diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c
index e37cd0c09b6..6b9d8d7aa5d 100644
--- a/src/mame/drivers/seta.c
+++ b/src/mame/drivers/seta.c
@@ -9285,11 +9285,10 @@ logerror("%04x: twineagl_200100_w %d = %02x\n",activecpu_get_pc(),offset,data);
static DRIVER_INIT( twineagl )
{
/* debug? */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x8000ff, 0, 0, twineagl_debug_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x8000ff, 0, 0, twineagl_debug_r);
/* This allows 2 simultaneous players and the use of the "Copyright" Dip Switch. */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200100, 0x20010f, 0, 0, twineagl_200100_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200100, 0x20010f, 0, 0, twineagl_200100_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200100, 0x20010f, 0, 0, twineagl_200100_r, twineagl_200100_w);
}
@@ -9319,8 +9318,7 @@ static WRITE16_HANDLER( downtown_protection_w )
static DRIVER_INIT( downtown )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x2001ff, 0, 0, downtown_protection_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x2001ff, 0, 0, downtown_protection_w);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x2001ff, 0, 0, downtown_protection_r, downtown_protection_w);
}
@@ -9340,7 +9338,7 @@ static READ16_HANDLER( arbalest_debug_r )
static DRIVER_INIT( arbalest )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x80000, 0x8000f, 0, 0, arbalest_debug_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80000, 0x8000f, 0, 0, arbalest_debug_r);
}
@@ -9349,8 +9347,7 @@ static DRIVER_INIT( metafox )
UINT16 *RAM = (UINT16 *) memory_region(REGION_CPU1);
/* This game uses the 21c000-21ffff area for protection? */
-// memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x21c000, 0x21ffff, 0, 0, SMH_NOP);
-// memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x21c000, 0x21ffff, 0, 0, SMH_NOP);
+// memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x21c000, 0x21ffff, 0, 0, SMH_NOP, SMH_NOP);
RAM[0x8ab1c/2] = 0x4e71; // patch protection test: "cp error"
RAM[0x8ab1e/2] = 0x4e71;
@@ -9394,14 +9391,14 @@ static DRIVER_INIT ( blandia )
static DRIVER_INIT( eightfrc )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500004, 0x500005, 0, 0, SMH_NOP); // watchdog??
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500004, 0x500005, 0, 0, SMH_NOP); // watchdog??
}
static DRIVER_INIT( zombraid )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00002, 0xf00003, 0, 0, zombraid_gun_r);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xf00000, 0xf00001, 0, 0, zombraid_gun_w);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf00002, 0xf00003, 0, 0, zombraid_gun_r);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf00000, 0xf00001, 0, 0, zombraid_gun_w);
}
@@ -9419,7 +9416,7 @@ static DRIVER_INIT( kiwame )
static DRIVER_INIT( rezon )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x500006, 0x500007, 0, 0, SMH_NOP); // irq ack?
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x500006, 0x500007, 0, 0, SMH_NOP); // irq ack?
}
static DRIVER_INIT(wiggie)
@@ -9451,10 +9448,9 @@ static DRIVER_INIT(wiggie)
}
/* X1_010 is not used. */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x103fff, 0, 0, SMH_NOP);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x103fff, 0, 0, SMH_NOP);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x103fff, 0, 0, SMH_NOP, SMH_NOP);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xB00008, 0xB00009, 0, 0, wiggie_soundlatch_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xB00008, 0xB00009, 0, 0, wiggie_soundlatch_w);
}
diff --git a/src/mame/drivers/simpl156.c b/src/mame/drivers/simpl156.c
index 49bdd9eb4c8..3a36b4c25e9 100644
--- a/src/mame/drivers/simpl156.c
+++ b/src/mame/drivers/simpl156.c
@@ -1163,7 +1163,7 @@ static READ32_HANDLER( joemacr_speedup_r )
static DRIVER_INIT (joemacr)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201018, 0x020101b, 0, 0, joemacr_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201018, 0x020101b, 0, 0, joemacr_speedup_r );
DRIVER_INIT_CALL(simpl156);
}
@@ -1175,7 +1175,7 @@ static READ32_HANDLER( chainrec_speedup_r )
static DRIVER_INIT (chainrec)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201018, 0x020101b, 0, 0, chainrec_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201018, 0x020101b, 0, 0, chainrec_speedup_r );
DRIVER_INIT_CALL(simpl156);
simpl156_default_eeprom = chainrec_eeprom;
}
@@ -1188,14 +1188,14 @@ static READ32_HANDLER( prtytime_speedup_r )
static DRIVER_INIT (prtytime)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r );
DRIVER_INIT_CALL(simpl156);
simpl156_default_eeprom = prtytime_eeprom;
}
static DRIVER_INIT (gangonta)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201ae0, 0x0201ae3, 0, 0, prtytime_speedup_r );
DRIVER_INIT_CALL(simpl156);
simpl156_default_eeprom = gangonta_eeprom;
}
@@ -1209,7 +1209,7 @@ static READ32_HANDLER( charlien_speedup_r )
static DRIVER_INIT (charlien)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, charlien_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, charlien_speedup_r );
DRIVER_INIT_CALL(simpl156);
}
@@ -1221,7 +1221,7 @@ static READ32_HANDLER( osman_speedup_r )
static DRIVER_INIT (osman)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, osman_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, osman_speedup_r );
DRIVER_INIT_CALL(simpl156);
simpl156_default_eeprom = osman_eeprom;
@@ -1229,7 +1229,7 @@ static DRIVER_INIT (osman)
static DRIVER_INIT (candance)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, osman_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0201010, 0x0201013, 0, 0, osman_speedup_r );
DRIVER_INIT_CALL(simpl156);
simpl156_default_eeprom = candance_eeprom;
}
diff --git a/src/mame/drivers/slapfght.c b/src/mame/drivers/slapfght.c
index 6742d48e2d0..260a1e143cd 100644
--- a/src/mame/drivers/slapfght.c
+++ b/src/mame/drivers/slapfght.c
@@ -1595,8 +1595,7 @@ ROM_END
static DRIVER_INIT( tigerh )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, tigerh_mcu_r );
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, tigerh_mcu_w );
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, tigerh_mcu_r, tigerh_mcu_w );
}
@@ -1608,13 +1607,13 @@ static READ8_HANDLER( getstar_mcu_r )
static DRIVER_INIT( getstar )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_mcu_r );
-// memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_mcu_w );
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_mcu_r );
+// memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_mcu_w );
}
static DRIVER_INIT( getstarb )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_e803_r );
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_e803_r );
}
static READ8_HANDLER( gtstarba_port_0_read )
@@ -1642,8 +1641,8 @@ static READ8_HANDLER( gtstarba_dpram_r )
static DRIVER_INIT( gtstarba )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x0, 0x0, 0, 0, gtstarba_port_0_read );
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xc80f, 0, 0, gtstarba_dpram_r );
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0, 0x0, 0, 0, gtstarba_port_0_read );
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xc80f, 0, 0, gtstarba_dpram_r );
}
@@ -1674,8 +1673,8 @@ static READ8_HANDLER( slapfigh_mcu_r )
static DRIVER_INIT( slapfigh )
{
slapfigh_prot_pos = 0;
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, slapfigh_mcu_r );
-// memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_mcu_w );
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, slapfigh_mcu_r );
+// memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe803, 0xe803, 0, 0, getstar_mcu_w );
}
diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c
index 2dc575ce63c..9e101aad2de 100644
--- a/src/mame/drivers/snowbros.c
+++ b/src/mame/drivers/snowbros.c
@@ -2316,7 +2316,7 @@ static DRIVER_INIT( moremorp )
// hyperpac_ram[0xf000/2 + i] = PROTDATA[i];
/* explicit check in the code */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, moremorp_0a_read );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, moremorp_0a_read );
}
@@ -2712,7 +2712,7 @@ static DRIVER_INIT(4in1boot)
memcpy(src,buffer,len);
free(buffer);
}
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, _4in1_02_read );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, _4in1_02_read );
}
static DRIVER_INIT(snowbro3)
@@ -2739,7 +2739,7 @@ static READ16_HANDLER( _3in1_read )
static DRIVER_INIT( 3in1semi )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, _3in1_read );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, _3in1_read );
}
static READ16_HANDLER( cookbib3_read )
@@ -2749,7 +2749,7 @@ static READ16_HANDLER( cookbib3_read )
static DRIVER_INIT( cookbib3 )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, cookbib3_read );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x200000, 0x200001, 0, 0, cookbib3_read );
}
diff --git a/src/mame/drivers/ssf2md.c b/src/mame/drivers/ssf2md.c
index 40c7b5334b2..7ab9c810aee 100644
--- a/src/mame/drivers/ssf2md.c
+++ b/src/mame/drivers/ssf2md.c
@@ -18,13 +18,12 @@ static READ16_HANDLER( ssf2ghw_dsw_r )
static DRIVER_INIT( ssf2ghw )
{
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA130F0, 0xA130FF, 0, 0, SMH_NOP); // custom banking is disabled (!)
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x5fffff, 0, 0, SMH_BANK5);
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x5fffff, 0, 0, SMH_UNMAP);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xA130F0, 0xA130FF, 0, 0, SMH_NOP); // custom banking is disabled (!)
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x5fffff, 0, 0, SMH_BANK5, SMH_UNMAP);
memory_set_bankptr( 5, memory_region( REGION_CPU1 )+0x400000 );
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x770070, 0x770075, 0, 0, ssf2ghw_dsw_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x770070, 0x770075, 0, 0, ssf2ghw_dsw_r );
DRIVER_INIT_CALL(megadrij);
diff --git a/src/mame/drivers/starwars.c b/src/mame/drivers/starwars.c
index a01a45cfc70..c67299c3595 100644
--- a/src/mame/drivers/starwars.c
+++ b/src/mame/drivers/starwars.c
@@ -578,11 +578,10 @@ static DRIVER_INIT( esb )
memory_set_opbase_handler(0, esb_setopbase);
/* install read/write handlers for it */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, esb_slapstic_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, esb_slapstic_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, esb_slapstic_r, esb_slapstic_w);
/* install additional banking */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, SMH_BANK2);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, SMH_BANK2);
/* prepare the matrix processor */
starwars_is_esb = 1;
diff --git a/src/mame/drivers/strnskil.c b/src/mame/drivers/strnskil.c
index 7f8cb88509a..2dd7501a0fa 100644
--- a/src/mame/drivers/strnskil.c
+++ b/src/mame/drivers/strnskil.c
@@ -515,16 +515,16 @@ static DRIVER_INIT( pettanp )
// AM_RANGE(0xd806, 0xd806) AM_READ(protection_r) /* protection data read (pettanp) */
/* Fujitsu MB8841 4-Bit MCU */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd806, 0xd806, 0, 0, pettanp_protection_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd80d, 0xd80d, 0, 0, protection_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd806, 0xd806, 0, 0, pettanp_protection_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd80d, 0xd80d, 0, 0, protection_w);
}
static DRIVER_INIT( banbam )
{
/* Fujitsu MB8841 4-Bit MCU */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd806, 0xd806, 0, 0, banbam_protection_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd80d, 0xd80d, 0, 0, protection_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd806, 0xd806, 0, 0, banbam_protection_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd80d, 0xd80d, 0, 0, protection_w);
}
GAME( 1984, strnskil, 0, strnskil, strnskil, 0, ROT0, "Sun Electronics", "Strength & Skill", 0 )
diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c
index 79df6cdd2c7..78c220a2945 100644
--- a/src/mame/drivers/stv.c
+++ b/src/mame/drivers/stv.c
@@ -203,7 +203,7 @@ extern UINT32* stv_vdp1_vram;
/* stvinit.c */
DRIVER_INIT( ic13 );
NVRAM_HANDLER( stv );
-void install_stvbios_speedups(void);
+void install_stvbios_speedups(running_machine *machine);
DRIVER_INIT(bakubaku);
DRIVER_INIT(mausuke);
DRIVER_INIT(puyosun);
@@ -2505,13 +2505,13 @@ DRIVER_INIT ( stv )
stv_scu = auto_malloc (0x100);
scsp_regs = auto_malloc (0x1000);
- install_stvbios_speedups();
+ install_stvbios_speedups(machine);
/* debug .. watch the command buffer rsgun, cottonbm etc. appear to use to communicate between cpus */
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc44, 0x60ffc47, 0, 0, w60ffc44_write );
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc48, 0x60ffc4b, 0, 0, w60ffc48_write );
- memory_install_write32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60ffc44, 0x60ffc47, 0, 0, w60ffc44_write );
- memory_install_write32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60ffc48, 0x60ffc4b, 0, 0, w60ffc48_write );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc44, 0x60ffc47, 0, 0, w60ffc44_write );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc48, 0x60ffc4b, 0, 0, w60ffc48_write );
+ memory_install_write32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x60ffc44, 0x60ffc47, 0, 0, w60ffc44_write );
+ memory_install_write32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x60ffc48, 0x60ffc4b, 0, 0, w60ffc48_write );
smpc_ram[0x23] = DectoBCD(systime.local_time.year /100);
smpc_ram[0x25] = DectoBCD(systime.local_time.year %100);
diff --git a/src/mame/drivers/stvinit.c b/src/mame/drivers/stvinit.c
index 3bb7a64c91d..070317d6692 100644
--- a/src/mame/drivers/stvinit.c
+++ b/src/mame/drivers/stvinit.c
@@ -196,11 +196,11 @@ static READ32_HANDLER( stv_speedup2_r )
return stv_workram_h[0x0335bc/4];
}
-void install_stvbios_speedups(void)
+void install_stvbios_speedups(running_machine *machine)
{
/* idle skip bios? .. not 100% sure this is safe .. we'll see */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60335d0, 0x60335d3, 0, 0, stv_speedup_r );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60335bc, 0x60335bf, 0, 0, stv_speedup2_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60335d0, 0x60335d3, 0, 0, stv_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60335bc, 0x60335bf, 0, 0, stv_speedup2_r );
}
static READ32_HANDLER( shienryu_slave_speedup_r )
@@ -224,8 +224,8 @@ DRIVER_INIT(shienryu)
stv_default_eeprom = shienryu_default_eeprom;
stv_default_eeprom_length = sizeof(shienryu_default_eeprom);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ae8e0, 0x60ae8e3, 0, 0, shienryu_speedup_r ); // after you enable sound cpu
- memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60ae8e4, 0x60ae8e7, 0, 0, shienryu_slave_speedup_r ); // after you enable sound cpu
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ae8e0, 0x60ae8e3, 0, 0, shienryu_speedup_r ); // after you enable sound cpu
+ memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x60ae8e4, 0x60ae8e7, 0, 0, shienryu_slave_speedup_r ); // after you enable sound cpu
DRIVER_INIT_CALL(stv);
}
@@ -252,7 +252,7 @@ DRIVER_INIT(prikura)
(loops for 263473 instructions)
*/
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60b9228, 0x60b922b, 0, 0, prikura_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60b9228, 0x60b922b, 0, 0, prikura_speedup_r );
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)prikura_slave_speedup );
DRIVER_INIT_CALL(stv);
@@ -297,8 +297,8 @@ DRIVER_INIT(hanagumi)
(loops for 288688 instructions)
*/
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6094188, 0x609418b, 0, 0, hanagumi_speedup_r );
- memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x6015438, 0x601543b, 0, 0, hanagumi_slave_off );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6094188, 0x609418b, 0, 0, hanagumi_speedup_r );
+ memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6015438, 0x601543b, 0, 0, hanagumi_slave_off );
DRIVER_INIT_CALL(stv);
}
@@ -339,7 +339,7 @@ static void puyosun_slave_speedup( UINT32 data )
DRIVER_INIT(puyosun)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, puyosun_speedup_r ); // idle loop of main cpu
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, puyosun_speedup_r ); // idle loop of main cpu
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)puyosun_slave_speedup );
DRIVER_INIT_CALL(ic13);
@@ -367,7 +367,7 @@ static READ32_HANDLER( mausuke_speedup_r )
DRIVER_INIT(mausuke)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, mausuke_speedup_r ); // idle loop of main cpu
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, mausuke_speedup_r ); // idle loop of main cpu
DRIVER_INIT_CALL(ic13);
@@ -404,7 +404,7 @@ static void cottonbm_slave_speedup( UINT32 data )
DRIVER_INIT(cottonbm)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cottonbm_speedup_r ); // idle loop of main cpu
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cottonbm_speedup_r ); // idle loop of main cpu
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)cottonbm_slave_speedup );
DRIVER_INIT_CALL(stv);
@@ -440,7 +440,7 @@ static void cotton2_slave_speedup( UINT32 data )
DRIVER_INIT(cotton2)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cotton2_speedup_r ); // idle loop of main cpu
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cotton2_speedup_r ); // idle loop of main cpu
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)cotton2_slave_speedup );
DRIVER_INIT_CALL(stv);
@@ -491,9 +491,8 @@ DRIVER_INIT(dnmtdeka)
{
dnmtdeka_pending_commands = 0;
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60985a0, 0x60985a3, 0, 0, dnmtdeka_speedup_r ); // idle loop of main cpu
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060e0ad4, 0x060e0bc3, 0, 0, dnmtdeka_cmd_write );
- memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x060e0ad4, 0x060e0bc3, 0, 0, dnmtdeka_cmd_read );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60985a0, 0x60985a3, 0, 0, dnmtdeka_speedup_r ); // idle loop of main cpu
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060e0ad4, 0x060e0bc3, 0, 0, dnmtdeka_cmd_read, dnmtdeka_cmd_write );
DRIVER_INIT_CALL(ic13);
}
@@ -564,12 +563,12 @@ DRIVER_INIT(diehard)
{
diehard_pending_commands = 0;
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060986ac, 0x060986af, 0, 0, diehard_speedup_r );
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060e0bd0, 0x060e0dcf, 0, 0, diehard_cmd_write );
- memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x060e0bd0, 0x060e0dcf, 0, 0, diehard_cmd_read );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_read );
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_write_cpu0 );
- memory_install_write32_handler(1, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_write );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060986ac, 0x060986af, 0, 0, diehard_speedup_r );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060e0bd0, 0x060e0dcf, 0, 0, diehard_cmd_write );
+ memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x060e0bd0, 0x060e0dcf, 0, 0, diehard_cmd_read );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_read );
+ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_write_cpu0 );
+ memory_install_write32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x060e0dd8, 0x060e0dd8, 0, 0, diehard_cmd_ack_write );
DRIVER_INIT_CALL(ic13);
@@ -601,9 +600,9 @@ static READ32_HANDLER( fhboxers_speedup3_r )
DRIVER_INIT(fhboxers)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600420c, 0x600420f, 0, 0, fhboxers_speedup_r ); // idle loop of main cpu
- memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x6090740, 0x6090743, 0, 0, fhboxers_speedup2_r ); // idle loop of second cpu
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06090bb4, 0x06090bb7, 0, 0, fhboxers_speedup3_r ); // idle loop of main cpu
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600420c, 0x600420f, 0, 0, fhboxers_speedup_r ); // idle loop of main cpu
+ memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6090740, 0x6090743, 0, 0, fhboxers_speedup2_r ); // idle loop of second cpu
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06090bb4, 0x06090bb7, 0, 0, fhboxers_speedup3_r ); // idle loop of main cpu
DRIVER_INIT_CALL(ic13);
}
@@ -634,9 +633,9 @@ static READ32_HANDLER( bakubaku_hangskip_r )
DRIVER_INIT(bakubaku)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60833f0, 0x60833f3, 0, 0, bakubaku_speedup_r ); // idle loop of main cpu
- memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60fdfe8, 0x60fdfeb, 0, 0, bakubaku_speedup2_r ); // turn off slave sh2, is it needed after boot ??
- //memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6033660, 0x6033663, 0, 0, bakubaku_hangskip_r ); // it waits for a ram address to change what should change it?
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60833f0, 0x60833f3, 0, 0, bakubaku_speedup_r ); // idle loop of main cpu
+ memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x60fdfe8, 0x60fdfeb, 0, 0, bakubaku_speedup2_r ); // turn off slave sh2, is it needed after boot ??
+ //memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6033660, 0x6033663, 0, 0, bakubaku_hangskip_r ); // it waits for a ram address to change what should change it?
DRIVER_INIT_CALL(ic13);
}
@@ -685,11 +684,11 @@ static void groovef_slave_speedup( UINT32 data )
DRIVER_INIT( groovef )
{
/* prevent game from hanging on startup -- todo: remove these hacks */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ca6cc, 0x60ca6cf, 0, 0, groovef_hack2_r );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60fffcc, 0x60fffcf, 0, 0, groovef_hack1_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ca6cc, 0x60ca6cf, 0, 0, groovef_hack2_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60fffcc, 0x60fffcf, 0, 0, groovef_hack1_r );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60c64ec, 0x60c64ef, 0, 0, groovef_speedup_r );
-// memory_install_read32_handler(1, ADDRESS_SPACE_PROGRAM, 0x60060dc, 0x60060df, 0, 0, groovef_second_cpu_off_r ); // not a good idea, needs it for ai.
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60c64ec, 0x60c64ef, 0, 0, groovef_speedup_r );
+// memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x60060dc, 0x60060df, 0, 0, groovef_second_cpu_off_r ); // not a good idea, needs it for ai.
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)groovef_slave_speedup );
DRIVER_INIT_CALL(stv);
@@ -749,9 +748,9 @@ static void danchih_slave_speedup( UINT32 data )
DRIVER_INIT( danchih )
{
/* prevent game from hanging on title screen -- todo: remove these hacks */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffcbc, 0x60ffcbf, 0, 0, danchih_hack_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffcbc, 0x60ffcbf, 0, 0, danchih_hack_r );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, danchih_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, danchih_speedup_r );
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)danchih_slave_speedup );
DRIVER_INIT_CALL(stv);
@@ -797,11 +796,11 @@ static READ32_HANDLER( astrass_speedup_r )
DRIVER_INIT( astrass )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000770, 0x6000773, 0, 0, astrass_hack_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000770, 0x6000773, 0, 0, astrass_hack_r );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0608e4d8, 0x0608e4db, 0, 0, astrass_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0608e4d8, 0x0608e4db, 0, 0, astrass_speedup_r );
- install_astrass_protection();
+ install_astrass_protection(machine);
DRIVER_INIT_CALL(ic13);
}
@@ -834,7 +833,7 @@ DRIVER_INIT(thunt)
0602A026: TST R0,R0
0602A028: BF $0602A024
*/
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06031424, 0x06031427, 0, 0, thunt_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06031424, 0x06031427, 0, 0, thunt_speedup_r );
/*
06013EE8: MOV.L @($10,PC),R0
@@ -845,7 +844,7 @@ DRIVER_INIT(thunt)
06013EF2: RTS
06013EF4: MOV #$01,R0
*/
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06075958, 0x0607595b, 0, 0, thunt_speedup2_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06075958, 0x0607595b, 0, 0, thunt_speedup2_r );
/*
0602AAF8: MOV.B @R11,R2
@@ -885,8 +884,8 @@ static void sandor_slave_speedup(UINT32 data)
DRIVER_INIT(sandor)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060314f8, 0x060314fb, 0, 0, sandor_speedup_r );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06075a2c, 0x06075a2f, 0, 0, sandor_speedup2_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060314f8, 0x060314fb, 0, 0, sandor_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06075a2c, 0x06075a2f, 0, 0, sandor_speedup2_r );
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)sandor_slave_speedup);
DRIVER_INIT_CALL(ic13);
minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(1);
@@ -931,7 +930,7 @@ DRIVER_INIT(grdforce)
06041E34: CMP/PZ R0
06041E36: BT $06041E2C
*/
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, grdforce_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, grdforce_speedup_r );
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)grdforce_slave_speedup);
@@ -959,7 +958,7 @@ static void batmanfr_slave_speedup( UINT32 data )
DRIVER_INIT(batmanfr)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0602acf0, 0x0602acf3, 0, 0, batmanfr_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0602acf0, 0x0602acf3, 0, 0, batmanfr_speedup_r );
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)batmanfr_slave_speedup );
DRIVER_INIT_CALL(stv);
@@ -1005,7 +1004,7 @@ static void winterht_slave_speedup( UINT32 data )
DRIVER_INIT(winterht)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, winterht_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, winterht_speedup_r );
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)winterht_slave_speedup );
@@ -1030,7 +1029,7 @@ static void seabass_slave_speedup( UINT32 data )
DRIVER_INIT(seabass)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, seabass_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, seabass_speedup_r );
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)seabass_slave_speedup );
@@ -1054,7 +1053,7 @@ static READ32_HANDLER(vfremix_speedup_r)
DRIVER_INIT(vfremix)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06074f98, 0x06074f9b, 0, 0, vfremix_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06074f98, 0x06074f9b, 0, 0, vfremix_speedup_r );
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)vfremix_slave_speedup );
DRIVER_INIT_CALL(ic13);
@@ -1078,8 +1077,8 @@ static void sss_slave_speedup( UINT32 data )
DRIVER_INIT(sss)
{
- install_standard_protection();
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, sss_speedup_r );
+ install_standard_protection(machine);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, sss_speedup_r );
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sss_slave_speedup );
DRIVER_INIT_CALL(ic13);
@@ -1106,7 +1105,7 @@ static void othellos_slave_speedup( UINT32 data )
DRIVER_INIT(othellos)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, othellos_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, othellos_speedup_r );
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)othellos_slave_speedup );
DRIVER_INIT_CALL(stv);
@@ -1139,7 +1138,7 @@ static READ32_HANDLER(gaxeduel_speedup_r)
DRIVER_INIT(gaxeduel)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x002f4068, 0x002f406b, 0, 0, gaxeduel_speedup_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x002f4068, 0x002f406b, 0, 0, gaxeduel_speedup_r);
DRIVER_INIT_CALL(ic13);
}
@@ -1151,7 +1150,7 @@ static READ32_HANDLER(suikoenb_speedup_r)
DRIVER_INIT(suikoenb)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060705d0, 0x060705d3, 0, 0, suikoenb_speedup_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060705d0, 0x060705d3, 0, 0, suikoenb_speedup_r);
DRIVER_INIT_CALL(ic13);
}
@@ -1173,7 +1172,7 @@ static READ32_HANDLER(sokyugrt_speedup_r)
DRIVER_INIT(sokyugrt)
{
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sokyugrt_slave_speedup );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x060788cc, 0x060788cf, 0, 0, sokyugrt_speedup_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060788cc, 0x060788cf, 0, 0, sokyugrt_speedup_r);
DRIVER_INIT_CALL(ic13);
minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(50);
@@ -1206,7 +1205,7 @@ static void znpwfv_slave_speedup( UINT32 data )
DRIVER_INIT(znpwfv)
{
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)znpwfv_slave_speedup );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, znpwfv_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, znpwfv_speedup_r );
DRIVER_INIT_CALL(ic13);
minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_NSEC(500);
@@ -1228,10 +1227,10 @@ static void twcup98_slave_speedup( UINT32 data )
DRIVER_INIT(twcup98)
{
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)twcup98_slave_speedup );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, twcup98_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, twcup98_speedup_r );
DRIVER_INIT_CALL(ic13);
- install_standard_protection();
+ install_standard_protection(machine);
minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(5);
}
@@ -1252,7 +1251,7 @@ static void smleague_slave_speedup( UINT32 data )
DRIVER_INIT(smleague)
{
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)smleague_slave_speedup );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, smleague_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, smleague_speedup_r );
DRIVER_INIT_CALL(ic13);
@@ -1268,7 +1267,7 @@ static READ32_HANDLER( finlarch_speedup_r )
DRIVER_INIT(finlarch)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, finlarch_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, finlarch_speedup_r );
DRIVER_INIT_CALL(ic13);
@@ -1299,7 +1298,7 @@ static void maruchan_slave_speedup( UINT32 data )
DRIVER_INIT(maruchan)
{
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)maruchan_slave_speedup );
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, maruchan_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, maruchan_speedup_r );
DRIVER_INIT_CALL(ic13);
@@ -1316,7 +1315,7 @@ static READ32_HANDLER( pblbeach_speedup_r )
DRIVER_INIT(pblbeach)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x0606c398, 0x0606c39b, 0, 0, pblbeach_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0606c398, 0x0606c39b, 0, 0, pblbeach_speedup_r );
DRIVER_INIT_CALL(ic13);
}
@@ -1330,7 +1329,7 @@ static READ32_HANDLER( shanhigw_speedup_r )
DRIVER_INIT(shanhigw)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x06095cd8, 0x06095cdb, 0, 0, shanhigw_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06095cd8, 0x06095cdb, 0, 0, shanhigw_speedup_r );
DRIVER_INIT_CALL(stv);
}
@@ -1356,8 +1355,8 @@ static void elandore_slave_speedup(UINT32 data)
DRIVER_INIT(elandore)
{
- install_standard_protection();
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, elandore_speedup_r );
+ install_standard_protection(machine);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, elandore_speedup_r );
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)elandore_slave_speedup);
DRIVER_INIT_CALL(stv);
minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(0);
@@ -1384,8 +1383,8 @@ static void rsgun_slave_speedup(UINT32 data)
DRIVER_INIT(rsgun)
{
- install_standard_protection();
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, rsgun_speedup_r );
+ install_standard_protection(machine);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, rsgun_speedup_r );
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)rsgun_slave_speedup);
DRIVER_INIT_CALL(stv);
@@ -1396,13 +1395,13 @@ DRIVER_INIT(rsgun)
DRIVER_INIT(ffreveng)
{
- install_standard_protection();
+ install_standard_protection(machine);
DRIVER_INIT_CALL(stv);
}
DRIVER_INIT(decathlt)
{
- install_decathlt_protection();
+ install_decathlt_protection(machine);
DRIVER_INIT_CALL(ic13);
}
@@ -1421,7 +1420,7 @@ static void nameclv3_slave_speedup( UINT32 data )
DRIVER_INIT(nameclv3)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60452c0, 0x60452c3, 0, 0, nameclv3_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60452c0, 0x60452c3, 0, 0, nameclv3_speedup_r );
cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)nameclv3_slave_speedup );
DRIVER_INIT_CALL(stv);
}
diff --git a/src/mame/drivers/superchs.c b/src/mame/drivers/superchs.c
index c0e9828b3b9..da75806a43e 100644
--- a/src/mame/drivers/superchs.c
+++ b/src/mame/drivers/superchs.c
@@ -505,8 +505,8 @@ static READ16_HANDLER( sub_cycle_r )
static DRIVER_INIT( superchs )
{
/* Speedup handlers */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100003, 0, 0, main_cycle_r);
- memory_install_read16_handler(2, ADDRESS_SPACE_PROGRAM, 0x80000a, 0x80000b, 0, 0, sub_cycle_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100003, 0, 0, main_cycle_r);
+ memory_install_read16_handler(machine, 2, ADDRESS_SPACE_PROGRAM, 0x80000a, 0x80000b, 0, 0, sub_cycle_r);
}
GAME( 1992, superchs, 0, superchs, superchs, superchs, ROT0, "Taito America Corporation", "Super Chase - Criminal Termination (US)", 0 )
diff --git a/src/mame/drivers/suprnova.c b/src/mame/drivers/suprnova.c
index 420337918cd..50d66376fd7 100644
--- a/src/mame/drivers/suprnova.c
+++ b/src/mame/drivers/suprnova.c
@@ -1098,25 +1098,25 @@ static READ32_HANDLER( sengekij_speedup_r ) // 60006ee 600308e
static void init_skns(running_machine *machine)
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000028, 0x600002b, 0, 0, bios_skip_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000028, 0x600002b, 0, 0, bios_skip_r );
}
static DRIVER_INIT( galpani4 ) { skns_sprite_kludge(-5,-1); init_skns(machine); } // Idle Loop caught by sh-2 core
static DRIVER_INIT( galpanis ) { skns_sprite_kludge(-5,-1); init_skns(machine); } // Idle Loop caught by sh-2 core
-static DRIVER_INIT( cyvern ) { skns_sprite_kludge(+0,+2); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x604d3c8, 0x604d3cb, 0, 0, cyvern_speedup_r ); }
-static DRIVER_INIT( galpans2 ) { skns_sprite_kludge(-1,-1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60fb6bc, 0x60fb6bf, 0, 0, galpans2_speedup_r ); }
-static DRIVER_INIT( gutsn ) { skns_sprite_kludge(+0,+0); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x600c780, 0x600c783, 0, 0, gutsn_speedup_r ); }
-static DRIVER_INIT( panicstr ) { skns_sprite_kludge(-1,-1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60f19e4, 0x60f19e7, 0, 0, panicstr_speedup_r ); }
-static DRIVER_INIT( senknow ) { skns_sprite_kludge(+1,+1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60000dc, 0x60000df, 0, 0, senknow_speedup_r ); }
-static DRIVER_INIT( puzzloop ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6081d38, 0x6081d3b, 0, 0, puzzloop_speedup_r ); }
-static DRIVER_INIT( puzloopj ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6086714, 0x6086717, 0, 0, puzloopj_speedup_r ); }
-static DRIVER_INIT( puzloopu ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6085cec, 0x6085cef, 0, 0, puzloopu_speedup_r ); }
-static DRIVER_INIT( jjparads ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000994, 0x6000997, 0, 0, jjparads_speedup_r ); }
-static DRIVER_INIT( jjparad2 ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000984, 0x6000987, 0, 0, jjparad2_speedup_r ); }
-static DRIVER_INIT( ryouran ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000a14, 0x6000a17, 0, 0, ryouran_speedup_r ); }
-static DRIVER_INIT( teljan ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002fb4, 0x6002fb7, 0, 0, teljan_speedup_r ); }
-static DRIVER_INIT( sengekis ) { skns_sprite_kludge(-192,-272); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60b74bc, 0x60b74bf, 0, 0, sengekis_speedup_r ); }
-static DRIVER_INIT( sengekij ) { skns_sprite_kludge(-192,-272); init_skns(machine); memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x60b7380, 0x60b7383, 0, 0, sengekij_speedup_r ); }
+static DRIVER_INIT( cyvern ) { skns_sprite_kludge(+0,+2); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x604d3c8, 0x604d3cb, 0, 0, cyvern_speedup_r ); }
+static DRIVER_INIT( galpans2 ) { skns_sprite_kludge(-1,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60fb6bc, 0x60fb6bf, 0, 0, galpans2_speedup_r ); }
+static DRIVER_INIT( gutsn ) { skns_sprite_kludge(+0,+0); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600c780, 0x600c783, 0, 0, gutsn_speedup_r ); }
+static DRIVER_INIT( panicstr ) { skns_sprite_kludge(-1,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60f19e4, 0x60f19e7, 0, 0, panicstr_speedup_r ); }
+static DRIVER_INIT( senknow ) { skns_sprite_kludge(+1,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60000dc, 0x60000df, 0, 0, senknow_speedup_r ); }
+static DRIVER_INIT( puzzloop ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6081d38, 0x6081d3b, 0, 0, puzzloop_speedup_r ); }
+static DRIVER_INIT( puzloopj ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6086714, 0x6086717, 0, 0, puzloopj_speedup_r ); }
+static DRIVER_INIT( puzloopu ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6085cec, 0x6085cef, 0, 0, puzloopu_speedup_r ); }
+static DRIVER_INIT( jjparads ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000994, 0x6000997, 0, 0, jjparads_speedup_r ); }
+static DRIVER_INIT( jjparad2 ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000984, 0x6000987, 0, 0, jjparad2_speedup_r ); }
+static DRIVER_INIT( ryouran ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000a14, 0x6000a17, 0, 0, ryouran_speedup_r ); }
+static DRIVER_INIT( teljan ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002fb4, 0x6002fb7, 0, 0, teljan_speedup_r ); }
+static DRIVER_INIT( sengekis ) { skns_sprite_kludge(-192,-272); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60b74bc, 0x60b74bf, 0, 0, sengekis_speedup_r ); }
+static DRIVER_INIT( sengekij ) { skns_sprite_kludge(-192,-272); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60b7380, 0x60b7383, 0, 0, sengekij_speedup_r ); }
static DRIVER_INIT( sarukani ) { skns_sprite_kludge(-1,-1); init_skns(machine); } // Speedup is in skns_io_w()
diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c
index 922397c46d1..f3eef865bcc 100644
--- a/src/mame/drivers/system1.c
+++ b/src/mame/drivers/system1.c
@@ -4821,11 +4821,11 @@ static DRIVER_INIT( dakkochn )
{
mc8123_decrypt_rom(0, memory_region(REGION_USER1), 1, 4);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0, dakkochn_port_00_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, dakkochn_port_03_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, dakkochn_port_04_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0, dakkochn_port_00_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, dakkochn_port_03_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, dakkochn_port_04_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x15, 0x15, 0, 0, dakkochn_port_15_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0, 0, dakkochn_port_15_w);
}
diff --git a/src/mame/drivers/system18.c b/src/mame/drivers/system18.c
index 9c8b60d1791..4accd15a53b 100644
--- a/src/mame/drivers/system18.c
+++ b/src/mame/drivers/system18.c
@@ -777,7 +777,7 @@ static DRIVER_INIT( shdancbl )
mem[i] ^= 0xFF;
MACHINE_RESET_CALL(sys16_onetime);
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xffc000, 0xffc001, 0, 0, shdancbl_skip_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xffc000, 0xffc001, 0, 0, shdancbl_skip_r );
sys18_splittab_fg_x=&sys16_textram[0x0f80/2];
sys18_splittab_bg_x=&sys16_textram[0x0fc0/2];
diff --git a/src/mame/drivers/taito_f3.c b/src/mame/drivers/taito_f3.c
index 0cdd841154d..d5c72c641fa 100644
--- a/src/mame/drivers/taito_f3.c
+++ b/src/mame/drivers/taito_f3.c
@@ -3255,7 +3255,7 @@ static DRIVER_INIT( ringrage )
static DRIVER_INIT( arabianm )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408124, 0x408127, 0, 0, irq_speedup_r_arabianm );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408124, 0x408127, 0, 0, irq_speedup_r_arabianm );
f3_game=ARABIANM;
tile_decode(1);
}
@@ -3268,28 +3268,28 @@ static DRIVER_INIT( ridingf )
static DRIVER_INIT( gseeker )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x40ad94, 0x40ad97, 0, 0, irq_speedup_r_gseeker );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40ad94, 0x40ad97, 0, 0, irq_speedup_r_gseeker );
f3_game=GSEEKER;
tile_decode(0);
}
static DRIVER_INIT( gunlock )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400004, 0x400007, 0, 0, irq_speedup_r_gunlock );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400004, 0x400007, 0, 0, irq_speedup_r_gunlock );
f3_game=GUNLOCK;
tile_decode(1);
}
static DRIVER_INIT( elvactr )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x4007a0, 0x4007a3, 0, 0, irq_speedup_r_eaction2 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4007a0, 0x4007a3, 0, 0, irq_speedup_r_eaction2 );
f3_game=EACTION2;
tile_decode(1);
}
static DRIVER_INIT( cupfinal )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_cupfinal );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_cupfinal );
f3_game=SCFINALS;
tile_decode(1);
}
@@ -3310,35 +3310,35 @@ static DRIVER_INIT( scfinals )
/* Rom checksum error */
RAM[0xdd0/4]=0x4e750000;
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_scfinals );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_scfinals );
f3_game=SCFINALS;
tile_decode(1);
}
static DRIVER_INIT( lightbr )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400130, 0x400133, 0, 0, irq_speedup_r_lightbr );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400130, 0x400133, 0, 0, irq_speedup_r_lightbr );
f3_game=LIGHTBR;
tile_decode(1);
}
static DRIVER_INIT( kaiserkn )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408110, 0x408113, 0, 0, irq_speedup_r_kaiserkn );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408110, 0x408113, 0, 0, irq_speedup_r_kaiserkn );
f3_game=KAISERKN;
tile_decode(1);
}
static DRIVER_INIT( dariusg )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x406ba8, 0x406bab, 0, 0, irq_speedup_r_dariusg );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x406ba8, 0x406bab, 0, 0, irq_speedup_r_dariusg );
f3_game=DARIUSG;
tile_decode(0);
}
static DRIVER_INIT( spcinvdj )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400230, 0x400233, 0, 0, irq_speedup_r_spcinvdj );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400230, 0x400233, 0, 0, irq_speedup_r_spcinvdj );
f3_game=SPCINVDX;
tile_decode(0);
}
@@ -3351,56 +3351,56 @@ static DRIVER_INIT( qtheater )
static DRIVER_INIT( spcinv95 )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_spcinv95 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_spcinv95 );
f3_game=SPCINV95;
tile_decode(1);
}
static DRIVER_INIT( gekirido )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x406bb0, 0x406bb3, 0, 0, irq_speedup_r_gekirido );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x406bb0, 0x406bb3, 0, 0, irq_speedup_r_gekirido );
f3_game=GEKIRIDO;
tile_decode(1);
}
static DRIVER_INIT( ktiger2 )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400570, 0x400573, 0, 0, irq_speedup_r_ktiger2 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400570, 0x400573, 0, 0, irq_speedup_r_ktiger2 );
f3_game=KTIGER2;
tile_decode(0);
}
static DRIVER_INIT( bubsymph )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400134, 0x400137, 0, 0, irq_speedup_r_bubsymph );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400134, 0x400137, 0, 0, irq_speedup_r_bubsymph );
f3_game=BUBSYMPH;
tile_decode(1);
}
static DRIVER_INIT( bubblem )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400134, 0x400137, 0, 0, irq_speedup_r_bubblem );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400134, 0x400137, 0, 0, irq_speedup_r_bubblem );
f3_game=BUBBLEM;
tile_decode(1);
}
static DRIVER_INIT( cleopatr )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_cleopatr );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_cleopatr );
f3_game=CLEOPATR;
tile_decode(0);
}
static DRIVER_INIT( popnpop )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x401cf8, 0x401cfb, 0, 0, irq_speedup_r_popnpop );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x401cf8, 0x401cfb, 0, 0, irq_speedup_r_popnpop );
f3_game=POPNPOP;
tile_decode(0);
}
static DRIVER_INIT( landmakr )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400824, 0x400827, 0, 0, irq_speedup_r_landmakr );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400824, 0x400827, 0, 0, irq_speedup_r_landmakr );
f3_game=LANDMAKR;
tile_decode(0);
}
@@ -3416,21 +3416,21 @@ static DRIVER_INIT( landmkrp )
RAM[0x1ffff8/4]=0xffffffff; /* From 0xffffff03 */
RAM[0x1ffffc/4]=0xffff0003; /* From 0xffff00ff */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400824, 0x400827, 0, 0, irq_speedup_r_landmakr );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400824, 0x400827, 0, 0, irq_speedup_r_landmakr );
f3_game=LANDMAKR;
tile_decode(0);
}
static DRIVER_INIT( pbobble3 )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x405af4, 0x405af7, 0, 0, irq_speedup_r_pbobble3 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x405af4, 0x405af7, 0, 0, irq_speedup_r_pbobble3 );
f3_game=PBOBBLE3;
tile_decode(0);
}
static DRIVER_INIT( pbobble4 )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x4058f4, 0x4058f7, 0, 0, irq_speedup_r_pbobble4 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4058f4, 0x4058f7, 0, 0, irq_speedup_r_pbobble4 );
f3_game=PBOBBLE4;
tile_decode(0);
}
@@ -3443,49 +3443,49 @@ static DRIVER_INIT( quizhuhu )
static DRIVER_INIT( pbobble2 )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x404a50, 0x404a53, 0, 0, irq_speedup_r_pbobble2 );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x404a50, 0x404a53, 0, 0, irq_speedup_r_pbobble2 );
f3_game=PBOBBLE2;
tile_decode(0);
}
static DRIVER_INIT( pbobbl2x )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x405c58, 0x405c5b, 0, 0, irq_speedup_r_pbobbl2x );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x405c58, 0x405c5b, 0, 0, irq_speedup_r_pbobbl2x );
f3_game=PBOBBLE2;
tile_decode(0);
}
static DRIVER_INIT( hthero95 )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_pwrgoal );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x408114, 0x408117, 0, 0, irq_speedup_r_pwrgoal );
f3_game=HTHERO95;
tile_decode(0);
}
static DRIVER_INIT( kirameki )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400414, 0x400417, 0, 0, irq_speedup_r_kirameki );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400414, 0x400417, 0, 0, irq_speedup_r_kirameki );
f3_game=KIRAMEKI;
tile_decode(0);
}
static DRIVER_INIT( puchicar )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x4024d8, 0x4024db, 0, 0, irq_speedup_r_puchicar );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4024d8, 0x4024db, 0, 0, irq_speedup_r_puchicar );
f3_game=PUCHICAR;
tile_decode(0);
}
static DRIVER_INIT( twinqix )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x400134, 0x400137, 0, 0, irq_speedup_r_twinqix );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400134, 0x400137, 0, 0, irq_speedup_r_twinqix );
f3_game=TWINQIX;
tile_decode(0);
}
static DRIVER_INIT( arkretrn )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x402154, 0x402157, 0, 0, irq_speedup_r_arkretrn );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x402154, 0x402157, 0, 0, irq_speedup_r_arkretrn );
f3_game=ARKRETRN;
tile_decode(0);
}
diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c
index 262c6d42f56..47e673a01f2 100644
--- a/src/mame/drivers/taito_l.c
+++ b/src/mame/drivers/taito_l.c
@@ -3056,7 +3056,7 @@ static DRIVER_INIT( evilston )
{
UINT8 *ROM = memory_region(REGION_CPU2);
ROM[0x72]=0x45; /* reti -> retn ('dead' loop @ $1104 )*/
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa7fe, 0xa7fe, 0, 0, evilston_snd_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa7fe, 0xa7fe, 0, 0, evilston_snd_w);
}
diff --git a/src/mame/drivers/taito_x.c b/src/mame/drivers/taito_x.c
index 2407285fada..4459440099e 100644
--- a/src/mame/drivers/taito_x.c
+++ b/src/mame/drivers/taito_x.c
@@ -1355,7 +1355,7 @@ ROM_END
static DRIVER_INIT( kyustrkr )
{
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x900000, 0x90000f, 0, 0, kyustrkr_input_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x900000, 0x90000f, 0, 0, kyustrkr_input_w);
}
diff --git a/src/mame/drivers/taitosj.c b/src/mame/drivers/taitosj.c
index dfe1039d27e..174095372d2 100644
--- a/src/mame/drivers/taitosj.c
+++ b/src/mame/drivers/taitosj.c
@@ -2608,27 +2608,27 @@ ROM_END
static DRIVER_INIT( spacecr )
{
/* install protection handler */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd48b, 0xd48b, 0, 0, spacecr_prot_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd48b, 0xd48b, 0, 0, spacecr_prot_r);
}
static DRIVER_INIT( alpine )
{
/* install protection handlers */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd40b, 0xd40b, 0, 0, alpine_port_2_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd50f, 0xd50f, 0, 0, alpine_protection_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd40b, 0xd40b, 0, 0, alpine_port_2_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd50f, 0xd50f, 0, 0, alpine_protection_w);
}
static DRIVER_INIT( alpinea )
{
/* install protection handlers */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd40b, 0xd40b, 0, 0, alpine_port_2_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd50e, 0xd50e, 0, 0, alpinea_bankswitch_w);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd40b, 0xd40b, 0, 0, alpine_port_2_r);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd50e, 0xd50e, 0, 0, alpinea_bankswitch_w);
}
static DRIVER_INIT( junglhbr )
{
/* inverter on bits 0 and 1 */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, junglhbr_characterram_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, junglhbr_characterram_w);
}
static DRIVER_INIT( kikstart )
diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c
index 09f0cef4731..1b7ca5079d4 100644
--- a/src/mame/drivers/taitowlf.c
+++ b/src/mame/drivers/taitowlf.c
@@ -18,6 +18,8 @@
#include "machine/idectrl.h"
#include "cpu/i386/i386.h"
+static void ide_interrupt(const device_config *device, int state);
+
static UINT32 *cga_ram;
static UINT32 *bios_ram;
@@ -277,25 +279,25 @@ static WRITE32_HANDLER( pnp_data_w )
-static READ32_HANDLER( ide0_r )
+static READ32_DEVICE_HANDLER( ide_r )
{
- return ide_controller32_0_r(machine, 0x1f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
}
-static WRITE32_HANDLER( ide0_w )
+static WRITE32_DEVICE_HANDLER( ide_w )
{
- ide_controller32_0_w(machine, 0x1f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
}
-static READ32_HANDLER( fdc_r )
+static READ32_DEVICE_HANDLER( fdc_r )
{
- return ide_controller32_0_r(machine, 0x3f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
}
-static WRITE32_HANDLER( fdc_w )
+static WRITE32_DEVICE_HANDLER( fdc_w )
{
//mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
- ide_controller32_0_w(machine, 0x3f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
}
@@ -454,11 +456,11 @@ static ADDRESS_MAP_START(taitowlf_io, ADDRESS_SPACE_IO, 32)
AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE(PIC8259, "pic8259_2", taitowlf_pic8259_32le_r, taitowlf_pic8259_32le_w)
AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE(DMA8237, "dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w)
AM_RANGE(0x00e8, 0x00eb) AM_NOP
- AM_RANGE(0x01f0, 0x01f7) AM_READWRITE(ide0_r, ide0_w)
+ AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_r, ide_w)
AM_RANGE(0x0300, 0x03af) AM_NOP
AM_RANGE(0x03b0, 0x03df) AM_NOP
AM_RANGE(0x0278, 0x027b) AM_WRITE(pnp_config_w)
- AM_RANGE(0x03f0, 0x03ff) AM_READWRITE(fdc_r, fdc_w)
+ AM_RANGE(0x03f0, 0x03ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", fdc_r, fdc_w)
AM_RANGE(0x0a78, 0x0a7b) AM_WRITE(pnp_data_w)
AM_RANGE(0x0cf8, 0x0cff) AM_READWRITE(pci_32le_r, pci_32le_w)
ADDRESS_MAP_END
@@ -625,6 +627,8 @@ static MACHINE_DRIVER_START(taitowlf)
MDRV_DEVICE_ADD( "pic8259_2", PIC8259 )
MDRV_DEVICE_CONFIG( taitowlf_pic8259_2_config )
+
+ MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt)
MDRV_NVRAM_HANDLER( mc146818 )
@@ -666,7 +670,7 @@ static void keyboard_interrupt(int state)
pic8259_set_irq_line(taitowlf_devices.pic8259_1, 1, state);
}
-static void ide_interrupt(int state)
+static void ide_interrupt(const device_config *device, int state)
{
pic8259_set_irq_line(taitowlf_devices.pic8259_2, 6, state);
}
@@ -680,11 +684,6 @@ static const struct kbdc8042_interface at8042 =
KBDC8042_AT386, set_gate_a20, keyboard_interrupt, taitowlf_get_out2
};
-static const struct ide_interface ide_intf =
-{
- ide_interrupt
-};
-
static void taitowlf_set_keyb_int(int state) {
pic8259_set_irq_line(taitowlf_devices.pic8259_1, 1, state);
}
@@ -703,8 +702,6 @@ static DRIVER_INIT( taitowlf )
pci_add_device(0, 7, &intel82371ab);
kbdc8042_init(&at8042);
-
- ide_controller_init(0, &ide_intf);
}
/*****************************************************************************/
diff --git a/src/mame/drivers/terracre.c b/src/mame/drivers/terracre.c
index 9164d3f18fa..76d351f6b69 100644
--- a/src/mame/drivers/terracre.c
+++ b/src/mame/drivers/terracre.c
@@ -1025,7 +1025,7 @@ static DRIVER_INIT( amatelas )
static DRIVER_INIT( horekid )
{
mpProtData = mHoreKidProtData;
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x44004, 0x44005, 0, 0, horekid_IN2_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x44004, 0x44005, 0, 0, horekid_IN2_r);
}
/* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR, COMPANY, FULLNAME, FLAGS */
diff --git a/src/mame/drivers/thepit.c b/src/mame/drivers/thepit.c
index ec2c823ad6f..b8586151787 100644
--- a/src/mame/drivers/thepit.c
+++ b/src/mame/drivers/thepit.c
@@ -1037,7 +1037,7 @@ static READ8_HANDLER( rtriv_question_r )
static DRIVER_INIT( rtriv )
{
// Set-up the weirdest questions read ever done
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4fff, 0, 0, rtriv_question_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4fff, 0, 0, rtriv_question_r);
}
diff --git a/src/mame/drivers/tigeroad.c b/src/mame/drivers/tigeroad.c
index 6c94c6fd6a5..45abfa66ada 100644
--- a/src/mame/drivers/tigeroad.c
+++ b/src/mame/drivers/tigeroad.c
@@ -793,12 +793,12 @@ ROM_END
static DRIVER_INIT( tigeroad )
{
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe4002, 0xfe4003, 0, 0, tigeroad_soundcmd_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe4002, 0xfe4003, 0, 0, tigeroad_soundcmd_w);
}
static DRIVER_INIT( f1dream )
{
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xfe4002, 0xfe4003, 0, 0, f1dream_control_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe4002, 0xfe4003, 0, 0, f1dream_control_w);
}
diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c
index f3f3b20d8db..0942cde57f7 100644
--- a/src/mame/drivers/toaplan2.c
+++ b/src/mame/drivers/toaplan2.c
@@ -467,7 +467,7 @@ static DRIVER_INIT( fixeight )
#if USE_V25
#else
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28fbff, 0, 0, SMH_BANK2, SMH_BANK2 );
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28fbff, 0, 0, SMH_BANK2, SMH_BANK2 );
memory_set_bankptr(2, fixeight_sec_cpu_mem);
#endif
@@ -989,11 +989,11 @@ static WRITE16_HANDLER( fixeight_sec_cpu_w )
/* game keeping service mode. It writes/reads the settings to/from */
/* these shared RAM locations. The secondary CPU reads/writes them */
/* from/to nvram to store the settings (a 93C45 EEPROM) */
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28fbff, 0, 0, SMH_BANK2, SMH_BANK2);
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28fbff, 0, 0, SMH_BANK2, SMH_BANK2);
memory_set_bankptr(2, fixeight_sec_cpu_mem);
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f004, 0x28f005, 0, 0, input_port_5_word_r, SMH_NOP); /* Dip Switch A - Wrong !!! */
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f006, 0x28f007, 0, 0, input_port_6_word_r, SMH_NOP); /* Dip Switch B - Wrong !!! */
- memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0x28f008, 0x28f009, 0, 0, input_port_7_word_r, SMH_NOP); /* Territory Jumper block - Wrong !!! */
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f004, 0x28f005, 0, 0, input_port_5_word_r, SMH_NOP); /* Dip Switch A - Wrong !!! */
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f006, 0x28f007, 0, 0, input_port_6_word_r, SMH_NOP); /* Dip Switch B - Wrong !!! */
+ memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f008, 0x28f009, 0, 0, input_port_7_word_r, SMH_NOP); /* Territory Jumper block - Wrong !!! */
mcu_data = data;
}
diff --git a/src/mame/drivers/topshoot.c b/src/mame/drivers/topshoot.c
index a73b172d9d4..5b72fb04591 100644
--- a/src/mame/drivers/topshoot.c
+++ b/src/mame/drivers/topshoot.c
@@ -303,7 +303,7 @@ static READ16_HANDLER( vdp_fake_r )
static DRIVER_INIT(topshoot)
{
/* hack -- fix vdp emulation instead */
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xC00004, 0xC00005, 0, 0, vdp_fake_r);
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xC00004, 0xC00005, 0, 0, vdp_fake_r);
memory_set_bankptr(3, memory_region(REGION_CPU1) );
memory_set_bankptr(4, genesis_68k_ram );
diff --git a/src/mame/drivers/trackfld.c b/src/mame/drivers/trackfld.c
index e331fd8e1ed..93e48e63917 100644
--- a/src/mame/drivers/trackfld.c
+++ b/src/mame/drivers/trackfld.c
@@ -1329,7 +1329,7 @@ static DRIVER_INIT( atlantol )
for (A = 0x6000;A < size;A++)
decrypt[A] = konami1_decodebyte(rom[A],A);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1000, 0, 0, SMH_NOP );
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1000, 0, 0, SMH_NOP );
}
static DRIVER_INIT( mastkin )
diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c
index 7602ccf31b7..59e8e089457 100644
--- a/src/mame/drivers/tumbleb.c
+++ b/src/mame/drivers/tumbleb.c
@@ -3329,7 +3329,7 @@ static DRIVER_INIT( tumbleb2 )
tumblepb_patch_code(0x000132);
#endif
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100001, 0, 0, tumbleb2_soundmcu_w );
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100001, 0, 0, tumbleb2_soundmcu_w );
}
@@ -3366,7 +3366,7 @@ static READ16_HANDLER( bcstory_1a0_read )
static DRIVER_INIT ( bcstory )
{
tumblepb_gfx1_rearrange();
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x180008, 0x180009, 0, 0, bcstory_1a0_read ); // io should be here??
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x180008, 0x180009, 0, 0, bcstory_1a0_read ); // io should be here??
}
@@ -3608,7 +3608,7 @@ static DRIVER_INIT( htchctch )
HCROM[0x1e228/2] = 0x4e75;
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x140000, 0x1407ff, 0, 0, SMH_NOP ); // kill palette writes as the interrupt code we don't have controls them
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x140000, 0x1407ff, 0, 0, SMH_NOP ); // kill palette writes as the interrupt code we don't have controls them
{
@@ -3674,10 +3674,10 @@ static DRIVER_INIT( chokchok )
DRIVER_INIT_CALL(htchctch);
/* different palette format, closer to tumblep -- is this controlled by a register? the palette was right with the hatch catch trojan */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x140000, 0x140fff, 0, 0, paletteram16_xxxxBBBBGGGGRRRR_word_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x140000, 0x140fff, 0, 0, paletteram16_xxxxBBBBGGGGRRRR_word_w);
/* slightly different banking */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100002, 0x100003, 0, 0, chokchok_tilebank_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100002, 0x100003, 0, 0, chokchok_tilebank_w);
}
static DRIVER_INIT( wlstar )
@@ -3685,7 +3685,7 @@ static DRIVER_INIT( wlstar )
DRIVER_INIT_CALL(htchctch);
/* slightly different banking */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x100002, 0x100003, 0, 0, wlstar_tilebank_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100002, 0x100003, 0, 0, wlstar_tilebank_w);
}
static DRIVER_INIT ( dquizgo )
diff --git a/src/mame/drivers/undrfire.c b/src/mame/drivers/undrfire.c
index 5209d3cfebc..85c706facec 100644
--- a/src/mame/drivers/undrfire.c
+++ b/src/mame/drivers/undrfire.c
@@ -1015,7 +1015,7 @@ static DRIVER_INIT( undrfire )
int data;
/* Speedup handlers */
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x2004f8, 0x2004fb, 0, 0, main_cycle_r);
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2004f8, 0x2004fb, 0, 0, main_cycle_r);
/* make piv tile GFX format suitable for gfxdecode */
offset = size/2;
diff --git a/src/mame/drivers/upscope.c b/src/mame/drivers/upscope.c
index 961cf5094ae..387ab383ce3 100644
--- a/src/mame/drivers/upscope.c
+++ b/src/mame/drivers/upscope.c
@@ -88,11 +88,11 @@ static void upscope_cia_0_porta_w(UINT8 data)
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
/* overlay disabled, map RAM on 0x000000 */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1);
+ memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1);
else
/* overlay enabled, map Amiga system ROM on 0x000000 */
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP);
+ memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP);
}
diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c
index 346af8af997..a42677da8a6 100644
--- a/src/mame/drivers/vamphalf.c
+++ b/src/mame/drivers/vamphalf.c
@@ -1290,7 +1290,7 @@ static READ16_HANDLER( dquizgo2_speedup_r )
static DRIVER_INIT( vamphalf )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0004a6d0, 0x0004a6d3, 0, 0, vamphalf_speedup_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0004a6d0, 0x0004a6d3, 0, 0, vamphalf_speedup_r );
palshift = 0;
flip_bit = 0x80;
@@ -1298,7 +1298,7 @@ static DRIVER_INIT( vamphalf )
static DRIVER_INIT( misncrft )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x00072eb4, 0x00072eb7, 0, 0, misncrft_speedup_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00072eb4, 0x00072eb7, 0, 0, misncrft_speedup_r );
palshift = 0;
flip_bit = 1;
@@ -1306,7 +1306,7 @@ static DRIVER_INIT( misncrft )
static DRIVER_INIT( coolmini )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000d2e80, 0x000d2e83, 0, 0, coolmini_speedup_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000d2e80, 0x000d2e83, 0, 0, coolmini_speedup_r );
palshift = 0;
flip_bit = 1;
@@ -1314,7 +1314,7 @@ static DRIVER_INIT( coolmini )
static DRIVER_INIT( suplup )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0011605c, 0x0011605f, 0, 0, suplup_speedup_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0011605c, 0x0011605f, 0, 0, suplup_speedup_r );
palshift = 8;
/* no flipscreen */
@@ -1322,7 +1322,7 @@ static DRIVER_INIT( suplup )
static DRIVER_INIT( luplup )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x00115e84, 0x00115e87, 0, 0, luplup_speedup_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00115e84, 0x00115e87, 0, 0, luplup_speedup_r );
palshift = 8;
/* no flipscreen */
@@ -1330,7 +1330,7 @@ static DRIVER_INIT( luplup )
static DRIVER_INIT( luplup29 )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x00113f08, 0x00113f0b, 0, 0, luplup29_speedup_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00113f08, 0x00113f0b, 0, 0, luplup29_speedup_r );
palshift = 8;
/* no flipscreen */
@@ -1338,7 +1338,7 @@ static DRIVER_INIT( luplup29 )
static DRIVER_INIT( puzlbang )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x00113ecc, 0x00113ecf, 0, 0, puzlbang_speedup_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00113ecc, 0x00113ecf, 0, 0, puzlbang_speedup_r );
palshift = 8;
/* no flipscreen */
@@ -1346,7 +1346,7 @@ static DRIVER_INIT( puzlbang )
static DRIVER_INIT( wyvernwg )
{
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x00b56fc, 0x00b56ff, 0, 0, wyvernwg_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00b56fc, 0x00b56ff, 0, 0, wyvernwg_speedup_r );
palshift = 0;
flip_bit = 1;
@@ -1358,7 +1358,7 @@ static DRIVER_INIT( wyvernwg )
static DRIVER_INIT( finalgdr )
{
finalgdr_backupram = auto_malloc(0x80*0x100);
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x005e874, 0x005e877, 0, 0, finalgdr_speedup_r );
+ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x005e874, 0x005e877, 0, 0, finalgdr_speedup_r );
palshift = 0;
flip_bit = 1; //?
@@ -1369,7 +1369,7 @@ static DRIVER_INIT( finalgdr )
static DRIVER_INIT( dquizgo2 )
{
- memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x00cde70, 0x00cde73, 0, 0, dquizgo2_speedup_r );
+ memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00cde70, 0x00cde73, 0, 0, dquizgo2_speedup_r );
palshift = 0;
flip_bit = 1;
diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c
index 345ef07c0bd..00a15c32486 100644
--- a/src/mame/drivers/vegas.c
+++ b/src/mame/drivers/vegas.c
@@ -484,8 +484,11 @@ static struct dynamic_address
{
offs_t start;
offs_t end;
- read32_machine_func read;
- write32_machine_func write;
+ read32_machine_func mread;
+ write32_machine_func mwrite;
+ read32_device_func dread;
+ write32_device_func dwrite;
+ const device_config *device;
const char * rdname;
const char * wrname;
} dynamic[MAX_DYNAMIC_ADDRESSES];
@@ -501,8 +504,8 @@ static struct dynamic_address
static void vblank_assert(int state);
static TIMER_CALLBACK( nile_timer_callback );
-static void ide_interrupt(int state);
-static void remap_dynamic_addresses(void);
+static void ide_interrupt(const device_config *device, int state);
+static void remap_dynamic_addresses(running_machine *machine);
@@ -595,7 +598,7 @@ static MACHINE_RESET( vegas )
}
/* reset subsystems */
- ide_controller_reset(0);
+ devtag_reset(machine, IDE_CONTROLLER, "ide");
voodoo_reset(0);
smc91c94_reset();
@@ -772,22 +775,22 @@ static WRITE32_HANDLER( pci_ide_w )
{
case 0x04: /* address register */
pci_ide_regs[offset] &= 0xfffffff0;
- remap_dynamic_addresses();
+ remap_dynamic_addresses(machine);
break;
case 0x05: /* address register */
pci_ide_regs[offset] &= 0xfffffffc;
- remap_dynamic_addresses();
+ remap_dynamic_addresses(machine);
break;
case 0x08: /* address register */
pci_ide_regs[offset] &= 0xfffffff0;
- remap_dynamic_addresses();
+ remap_dynamic_addresses(machine);
break;
case 0x14: /* interrupt pending */
if (data & 4)
- ide_interrupt(0);
+ ide_interrupt(device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide"), 0);
break;
}
if (LOG_PCI)
@@ -845,14 +848,14 @@ static WRITE32_HANDLER( pci_3dfx_w )
pci_3dfx_regs[offset] &= 0xff000000;
else
pci_3dfx_regs[offset] &= 0xfe000000;
- remap_dynamic_addresses();
+ remap_dynamic_addresses(machine);
break;
case 0x05: /* address register */
if (voodoo_type >= VOODOO_BANSHEE)
{
pci_3dfx_regs[offset] &= 0xfe000000;
- remap_dynamic_addresses();
+ remap_dynamic_addresses(machine);
}
break;
@@ -860,7 +863,7 @@ static WRITE32_HANDLER( pci_3dfx_w )
if (voodoo_type >= VOODOO_BANSHEE)
{
pci_3dfx_regs[offset] &= 0xffffff00;
- remap_dynamic_addresses();
+ remap_dynamic_addresses(machine);
}
break;
@@ -868,7 +871,7 @@ static WRITE32_HANDLER( pci_3dfx_w )
if (voodoo_type >= VOODOO_BANSHEE)
{
pci_3dfx_regs[offset] &= 0xffff0000;
- remap_dynamic_addresses();
+ remap_dynamic_addresses(machine);
}
break;
@@ -1159,7 +1162,7 @@ static WRITE32_HANDLER( nile_w )
case NREG_PCIINIT1+0: /* PCI master */
if (((olddata & 0xe) == 0xa) != ((nile_regs[offset] & 0xe) == 0xa))
- remap_dynamic_addresses();
+ remap_dynamic_addresses(machine);
logit = 0;
break;
@@ -1247,7 +1250,7 @@ static WRITE32_HANDLER( nile_w )
case NREG_DCS8:
case NREG_PCIW0:
case NREG_PCIW1:
- remap_dynamic_addresses();
+ remap_dynamic_addresses(machine);
break;
}
@@ -1263,7 +1266,7 @@ static WRITE32_HANDLER( nile_w )
*
*************************************/
-static void ide_interrupt(int state)
+static void ide_interrupt(const device_config *device, int state)
{
ide_irq_state = state;
if (state)
@@ -1273,11 +1276,6 @@ static void ide_interrupt(int state)
update_nile_irqs();
}
-static const struct ide_interface ide_intf =
-{
- ide_interrupt
-};
-
/*************************************
@@ -1480,27 +1478,27 @@ static WRITE32_HANDLER( asic_fifo_w )
}
-static READ32_HANDLER( ide_main_r )
+static READ32_DEVICE_HANDLER( ide_main_r )
{
- return ide_controller32_0_r(machine, 0x1f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
}
-static WRITE32_HANDLER( ide_main_w )
+static WRITE32_DEVICE_HANDLER( ide_main_w )
{
- ide_controller32_0_w(machine, 0x1f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
}
-static READ32_HANDLER( ide_alt_r )
+static READ32_DEVICE_HANDLER( ide_alt_r )
{
- return ide_controller32_0_r(machine, 0x3f4/4 + offset, mem_mask);
+ return ide_controller32_r(device, 0x3f4/4 + offset, mem_mask);
}
-static WRITE32_HANDLER( ide_alt_w )
+static WRITE32_DEVICE_HANDLER( ide_alt_w )
{
- ide_controller32_0_w(machine, 0x3f4/4 + offset, data, mem_mask);
+ ide_controller32_w(device, 0x3f4/4 + offset, data, mem_mask);
}
@@ -1537,31 +1535,47 @@ static WRITE32_HANDLER( dcs3_fifo_full_w )
*
*************************************/
-#define add_dynamic_address(s,e,r,w) _add_dynamic_address(s,e,r,w,#r,#w)
+#define add_dynamic_address(s,e,r,w) _add_dynamic_address(s,e,r,w,#r,#w)
+#define add_dynamic_device_address(d,s,e,r,w) _add_dynamic_device_address(d,s,e,r,w,#r,#w)
INLINE void _add_dynamic_address(offs_t start, offs_t end, read32_machine_func read, write32_machine_func write, const char *rdname, const char *wrname)
{
dynamic[dynamic_count].start = start;
dynamic[dynamic_count].end = end;
- dynamic[dynamic_count].read = read;
- dynamic[dynamic_count].write = write;
+ dynamic[dynamic_count].mread = read;
+ dynamic[dynamic_count].mwrite = write;
+ dynamic[dynamic_count].dread = NULL;
+ dynamic[dynamic_count].dwrite = NULL;
+ dynamic[dynamic_count].device = NULL;
dynamic[dynamic_count].rdname = rdname;
dynamic[dynamic_count].wrname = wrname;
dynamic_count++;
}
+INLINE void _add_dynamic_device_address(const device_config *device, offs_t start, offs_t end, read32_device_func read, write32_device_func write, const char *rdname, const char *wrname)
+{
+ dynamic[dynamic_count].start = start;
+ dynamic[dynamic_count].end = end;
+ dynamic[dynamic_count].mread = NULL;
+ dynamic[dynamic_count].mwrite = NULL;
+ dynamic[dynamic_count].dread = read;
+ dynamic[dynamic_count].dwrite = write;
+ dynamic[dynamic_count].device = device;
+ dynamic[dynamic_count].rdname = rdname;
+ dynamic[dynamic_count].wrname = wrname;
+ dynamic_count++;
+}
-static void remap_dynamic_addresses(void)
+
+static void remap_dynamic_addresses(running_machine *machine)
{
+ const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide");
offs_t base;
int addr;
/* unmap everything we know about */
for (addr = 0; addr < dynamic_count; addr++)
- {
- memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, SMH_NOP);
- memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, SMH_NOP);
- }
+ memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, SMH_UNMAP, SMH_UNMAP);
/* the build the list of stuff */
dynamic_count = 0;
@@ -1639,15 +1653,15 @@ static void remap_dynamic_addresses(void)
/* IDE controller */
base = pci_ide_regs[0x04] & 0xfffffff0;
if (base >= ramsize && base < 0x20000000)
- add_dynamic_address(base + 0x0000, base + 0x000f, ide_main_r, ide_main_w);
+ add_dynamic_device_address(ide, base + 0x0000, base + 0x000f, ide_main_r, ide_main_w);
base = pci_ide_regs[0x05] & 0xfffffffc;
if (base >= ramsize && base < 0x20000000)
- add_dynamic_address(base + 0x0000, base + 0x0003, ide_alt_r, ide_alt_w);
+ add_dynamic_device_address(ide, base + 0x0000, base + 0x0003, ide_alt_r, ide_alt_w);
base = pci_ide_regs[0x08] & 0xfffffff0;
if (base >= ramsize && base < 0x20000000)
- add_dynamic_address(base + 0x0000, base + 0x0007, ide_bus_master32_0_r, ide_bus_master32_0_w);
+ add_dynamic_device_address(ide, base + 0x0000, base + 0x0007, ide_bus_master32_r, ide_bus_master32_w);
/* 3dfx card */
base = pci_3dfx_regs[0x04] & 0xfffffff0;
@@ -1680,10 +1694,10 @@ static void remap_dynamic_addresses(void)
for (addr = 0; addr < dynamic_count; addr++)
{
if (LOG_DYNAMIC) logerror(" installing: %08X-%08X %s,%s\n", dynamic[addr].start, dynamic[addr].end, dynamic[addr].rdname, dynamic[addr].wrname);
- if (dynamic[addr].read)
- _memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].read, dynamic[addr].wrname);
- if (dynamic[addr].write)
- _memory_install_write32_handler(0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].write, dynamic[addr].wrname);
+ if (dynamic[addr].mread != NULL || dynamic[addr].mwrite != NULL)
+ _memory_install_handler32(machine, 0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].mread, dynamic[addr].mwrite, dynamic[addr].rdname, dynamic[addr].wrname);
+ if (dynamic[addr].dread != NULL || dynamic[addr].dwrite != NULL)
+ _memory_install_device_handler32(dynamic[addr].device, 0, ADDRESS_SPACE_PROGRAM, dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].dread, dynamic[addr].dwrite, dynamic[addr].rdname, dynamic[addr].wrname);
}
if (LOG_DYNAMIC)
@@ -2220,6 +2234,8 @@ static MACHINE_DRIVER_START( vegascore )
MDRV_MACHINE_RESET(vegas)
MDRV_NVRAM_HANDLER(timekeeper_save)
+
+ MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt)
/* video hardware */
MDRV_SCREEN_ADD("main", RASTER)
@@ -2438,7 +2454,7 @@ ROM_END
*
*************************************/
-static void init_common(int ioasic, int serialnum)
+static void init_common(running_machine *machine, int ioasic, int serialnum)
{
static const struct smc91c9x_interface ethernet_intf =
{
@@ -2446,7 +2462,6 @@ static void init_common(int ioasic, int serialnum)
};
/* initialize the subsystems */
- ide_controller_init(0, &ide_intf);
midway_ioasic_init(ioasic, serialnum, 80, ioasic_irq);
midway_ioasic_set_auto_ack(1);
smc91c94_init(&ethernet_intf);
@@ -2470,8 +2485,8 @@ static void add_speedup(offs_t pc, UINT32 op)
static DRIVER_INIT( gauntleg )
{
- dcs2_init(4, 0x0b5d);
- init_common(MIDWAY_IOASIC_CALSPEED, 340/* 340=39", 322=27", others? */);
+ dcs2_init(machine, 4, 0x0b5d);
+ init_common(machine, MIDWAY_IOASIC_CALSPEED, 340/* 340=39", 322=27", others? */);
/* speedups */
add_speedup(0x80015430, 0x8CC38060); /* confirmed */
@@ -2483,8 +2498,8 @@ static DRIVER_INIT( gauntleg )
static DRIVER_INIT( gauntdl )
{
- dcs2_init(4, 0x0b5d);
- init_common(MIDWAY_IOASIC_GAUNTDL, 346/* 347, others? */);
+ dcs2_init(machine, 4, 0x0b5d);
+ init_common(machine, MIDWAY_IOASIC_GAUNTDL, 346/* 347, others? */);
/* speedups */
add_speedup(0x800158B8, 0x8CC3CC40); /* confirmed */
@@ -2496,8 +2511,8 @@ static DRIVER_INIT( gauntdl )
static DRIVER_INIT( warfa )
{
- dcs2_init(4, 0x0b5d);
- init_common(MIDWAY_IOASIC_MACE, 337/* others? */);
+ dcs2_init(machine, 4, 0x0b5d);
+ init_common(machine, MIDWAY_IOASIC_MACE, 337/* others? */);
/* speedups */
add_speedup(0x8009436C, 0x0C031663); /* confirmed */
@@ -2506,8 +2521,8 @@ static DRIVER_INIT( warfa )
static DRIVER_INIT( tenthdeg )
{
- dcs2_init(4, 0x0afb);
- init_common(MIDWAY_IOASIC_GAUNTDL, 330/* others? */);
+ dcs2_init(machine, 4, 0x0afb);
+ init_common(machine, MIDWAY_IOASIC_GAUNTDL, 330/* others? */);
/* speedups */
add_speedup(0x80051CD8, 0x0C023C15); /* confirmed */
@@ -2519,51 +2534,51 @@ static DRIVER_INIT( tenthdeg )
static DRIVER_INIT( roadburn )
{
- dcs2_init(4, 0); /* no place to hook :-( */
- init_common(MIDWAY_IOASIC_STANDARD, 325/* others? */);
+ dcs2_init(machine, 4, 0); /* no place to hook :-( */
+ init_common(machine, MIDWAY_IOASIC_STANDARD, 325/* others? */);
}
static DRIVER_INIT( nbashowt )
{
- dcs2_init(4, 0);
- init_common(MIDWAY_IOASIC_MACE, 528/* or 478 or 487 */);
+ dcs2_init(machine, 4, 0);
+ init_common(machine, MIDWAY_IOASIC_MACE, 528/* or 478 or 487 */);
}
static DRIVER_INIT( nbanfl )
{
- dcs2_init(4, 0);
- init_common(MIDWAY_IOASIC_BLITZ99, 498/* or 478 or 487 */);
+ dcs2_init(machine, 4, 0);
+ init_common(machine, MIDWAY_IOASIC_BLITZ99, 498/* or 478 or 487 */);
/* NOT: MACE */
}
static DRIVER_INIT( sf2049 )
{
- dcs2_init(8, 0);
- init_common(MIDWAY_IOASIC_STANDARD, 336/* others? */);
+ dcs2_init(machine, 8, 0);
+ init_common(machine, MIDWAY_IOASIC_STANDARD, 336/* others? */);
}
static DRIVER_INIT( sf2049se )
{
- dcs2_init(8, 0);
- init_common(MIDWAY_IOASIC_SFRUSHRK, 336/* others? */);
+ dcs2_init(machine, 8, 0);
+ init_common(machine, MIDWAY_IOASIC_SFRUSHRK, 336/* others? */);
}
static DRIVER_INIT( sf2049te )
{
- dcs2_init(8, 0);
- init_common(MIDWAY_IOASIC_SFRUSHRK, 348/* others? */);
+ dcs2_init(machine, 8, 0);
+ init_common(machine, MIDWAY_IOASIC_SFRUSHRK, 348/* others? */);
}
static DRIVER_INIT( cartfury )
{
- dcs2_init(4, 0);
- init_common(MIDWAY_IOASIC_CARNEVIL, 495/* others? */);
+ dcs2_init(machine, 4, 0);
+ init_common(machine, MIDWAY_IOASIC_CARNEVIL, 495/* others? */);
}
diff --git a/src/mame/drivers/vendetta.c b/src/mame/drivers/vendetta.c
index 37cc34c3e1d..8a187a59eba 100644
--- a/src/mame/drivers/vendetta.c
+++ b/src/mame/drivers/vendetta.c
@@ -97,7 +97,7 @@ Notes:
/* prototypes */
static MACHINE_RESET( vendetta );
static void vendetta_banking( int lines );
-static void vendetta_video_banking( int select );
+static void vendetta_video_banking( running_machine *machine, int select );
VIDEO_START( vendetta );
VIDEO_START( esckids );
@@ -183,7 +183,7 @@ static WRITE8_HANDLER( vendetta_eeprom_w )
irq_enabled = ( data >> 6 ) & 1;
- vendetta_video_banking( data & 1 );
+ vendetta_video_banking( machine, data & 1 );
}
/********************************************/
@@ -201,18 +201,18 @@ static WRITE8_HANDLER( vendetta_K052109_w ) {
static offs_t video_banking_base;
-static void vendetta_video_banking( int select )
+static void vendetta_video_banking( running_machine *machine, int select )
{
if ( select & 1 )
{
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, SMH_BANK4, paletteram_xBBBBBGGGGGRRRRR_be_w );
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K053247_r, K053247_w );
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, SMH_BANK4, paletteram_xBBBBBGGGGGRRRRR_be_w );
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K053247_r, K053247_w );
memory_set_bankptr(4, paletteram);
}
else
{
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, vendetta_K052109_r, vendetta_K052109_w );
- memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K052109_r, K052109_w );
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, vendetta_K052109_r, vendetta_K052109_w );
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K052109_r, K052109_w );
}
}
@@ -848,7 +848,7 @@ static MACHINE_RESET( vendetta )
/* init banks */
memory_set_bankptr( 1, &memory_region(REGION_CPU1)[0x10000] );
- vendetta_video_banking( 0 );
+ vendetta_video_banking( machine, 0 );
}
diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c
index 911d84d8788..94367a6a384 100644
--- a/src/mame/drivers/viper.c
+++ b/src/mame/drivers/viper.c
@@ -176,7 +176,7 @@ static const UINT8 cf_card_tuples[] =
0x00, 0x01, 0x00, 0x00, // CCR base (0x00000100)
};
-static READ64_HANDLER(cf_card_data_r)
+static READ64_DEVICE_HANDLER(cf_card_data_r)
{
UINT64 r = 0;
@@ -186,7 +186,7 @@ static READ64_HANDLER(cf_card_data_r)
{
case 0x8: // Duplicate Even RD Data
{
- r |= ide_bus_0_r(0, 0) << 16;
+ r |= ide_bus_r(device, 0, 0) << 16;
break;
}
@@ -199,7 +199,7 @@ static READ64_HANDLER(cf_card_data_r)
return r;
}
-static WRITE64_HANDLER(cf_card_data_w)
+static WRITE64_DEVICE_HANDLER(cf_card_data_w)
{
if (ACCESSING_BITS_16_31)
{
@@ -207,7 +207,7 @@ static WRITE64_HANDLER(cf_card_data_w)
{
case 0x8: // Duplicate Even RD Data
{
- ide_bus_0_w(0, 0, (data >> 16) & 0xffff);
+ ide_bus_w(device, 0, 0, (data >> 16) & 0xffff);
break;
}
@@ -219,7 +219,7 @@ static WRITE64_HANDLER(cf_card_data_w)
}
}
-static READ64_HANDLER(cf_card_r)
+static READ64_DEVICE_HANDLER(cf_card_r)
{
UINT64 r = 0;
@@ -238,7 +238,7 @@ static READ64_HANDLER(cf_card_r)
case 0x6: // Select Card/Head
case 0x7: // Status
{
- r |= ide_bus_0_r(0, offset & 7) << 16;
+ r |= ide_bus_r(device, 0, offset & 7) << 16;
break;
}
@@ -247,13 +247,13 @@ static READ64_HANDLER(cf_card_r)
case 0xd: // Duplicate Error
{
- r |= ide_bus_0_r(0, 1) << 16;
+ r |= ide_bus_r(device, 0, 1) << 16;
break;
}
case 0xe: // Alt Status
case 0xf: // Drive Address
{
- r |= ide_bus_0_r(1, offset & 7) << 16;
+ r |= ide_bus_r(device, 1, offset & 7) << 16;
break;
}
@@ -282,7 +282,7 @@ static READ64_HANDLER(cf_card_r)
return r;
}
-static WRITE64_HANDLER(cf_card_w)
+static WRITE64_DEVICE_HANDLER(cf_card_w)
{
//printf("compact_flash_w: %08X%08X, %08X, %08X%08X at %08X\n", (UINT32)(data>>32), (UINT32)(data), offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask), activecpu_get_pc());
@@ -301,7 +301,7 @@ static WRITE64_HANDLER(cf_card_w)
case 0x6: // Select Card/Head
case 0x7: // Command
{
- ide_bus_0_w(0, offset & 7, (data >> 16) & 0xffff);
+ ide_bus_w(device, 0, offset & 7, (data >> 16) & 0xffff);
break;
}
@@ -310,13 +310,13 @@ static WRITE64_HANDLER(cf_card_w)
case 0xd: // Duplicate Features
{
- ide_bus_0_w(0, 1, (data >> 16) & 0xffff);
+ ide_bus_w(device, 0, 1, (data >> 16) & 0xffff);
break;
}
case 0xe: // Device Ctl
case 0xf: // Reserved
{
- ide_bus_0_w(1, offset & 7, (data >> 16) & 0xffff);
+ ide_bus_w(device, 1, offset & 7, (data >> 16) & 0xffff);
break;
}
@@ -342,7 +342,7 @@ static WRITE64_HANDLER(cf_card_w)
// cylinder low register is set to 0x00
// cylinder high register is set to 0x00
- ide_bus_0_w(1, 6, 0x04);
+ ide_bus_w(device, 1, 6, 0x04);
}
break;
}
@@ -366,7 +366,7 @@ static WRITE64_HANDLER(unk2_w)
-static READ64_HANDLER(ata_r)
+static READ64_DEVICE_HANDLER(ata_r)
{
UINT64 r = 0;
@@ -374,19 +374,19 @@ static READ64_HANDLER(ata_r)
{
int reg = (offset >> 4) & 0x7;
- r |= ide_bus_0_r((offset & 0x80) ? 1 : 0, reg) << 16;
+ r |= ide_bus_r(device, (offset & 0x80) ? 1 : 0, reg) << 16;
}
return r;
}
-static WRITE64_HANDLER(ata_w)
+static WRITE64_DEVICE_HANDLER(ata_w)
{
if (ACCESSING_BITS_16_31)
{
int reg = (offset >> 4) & 0x7;
- ide_bus_0_w((offset & 0x80) ? 1 : 0, reg, (UINT16)(data >> 16));
+ ide_bus_w(device, (offset & 0x80) ? 1 : 0, reg, (UINT16)(data >> 16));
}
}
@@ -597,7 +597,7 @@ static ADDRESS_MAP_START(viper_map, ADDRESS_SPACE_PROGRAM, 64)
AM_RANGE(0xfe800000, 0xfe8000ff) AM_READWRITE(voodoo3_io_r, voodoo3_io_w)
AM_RANGE(0xfec00000, 0xfedfffff) AM_READWRITE(pci_config_addr_r, pci_config_addr_w)
AM_RANGE(0xfee00000, 0xfeefffff) AM_READWRITE(pci_config_data_r, pci_config_data_w)
- AM_RANGE(0xff300000, 0xff300fff) AM_READWRITE(ata_r, ata_w)
+ AM_RANGE(0xff300000, 0xff300fff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ata_r, ata_w)
AM_RANGE(0xffe10000, 0xffe10007) AM_READ(unk1_r)
AM_RANGE(0xffe30000, 0xffe31fff) AM_READWRITE(m48t58_r, m48t58_w)
AM_RANGE(0xffe40000, 0xffe4000f) AM_NOP
@@ -625,9 +625,14 @@ static INTERRUPT_GEN(viper_vblank)
{
}
+
+static void ide_interrupt(const device_config *device, int state)
+{
+}
+
static MACHINE_RESET(viper)
{
- ide_controller_reset(0);
+ devtag_reset(machine, IDE_CONTROLLER, "ide");
}
static MACHINE_DRIVER_START(viper)
@@ -641,6 +646,8 @@ static MACHINE_DRIVER_START(viper)
MDRV_MACHINE_RESET(viper)
MDRV_NVRAM_HANDLER(timekeeper_0)
+
+ MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt)
/* video hardware */
MDRV_SCREEN_ADD("main", RASTER)
@@ -661,10 +668,6 @@ MACHINE_DRIVER_END
/*****************************************************************************/
-static void ide_interrupt(int state)
-{
-}
-
static const struct pci_device_info mpc8240 =
{
mpc8240_pci_r,
@@ -677,11 +680,6 @@ static const struct pci_device_info voodoo3 =
voodoo3_pci_w
};
-static const struct ide_interface ide_intf =
-{
- ide_interrupt
-};
-
static DRIVER_INIT(viper)
{
UINT8 *nvram;
@@ -690,8 +688,6 @@ static DRIVER_INIT(viper)
pci_add_device(0, 0, &mpc8240);
pci_add_device(0, 12, &voodoo3);
- ide_controller_init(0, &ide_intf);
-
timekeeper_init(0, TIMEKEEPER_M48T58, backup_ram);
nvram = memory_region(REGION_USER2);
@@ -700,12 +696,12 @@ static DRIVER_INIT(viper)
static DRIVER_INIT(vipercf)
{
+ const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide");
+
DRIVER_INIT_CALL(viper);
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff000fff, 0, 0, cf_card_data_r );
- memory_install_write64_handler(0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff000fff, 0, 0, cf_card_data_w );
- memory_install_read64_handler( 0, ADDRESS_SPACE_PROGRAM, 0xff200000, 0xff200fff, 0, 0, cf_card_r );
- memory_install_write64_handler(0, ADDRESS_SPACE_PROGRAM, 0xff200000, 0xff200fff, 0, 0, cf_card_w );
+ memory_install_readwrite64_device_handler( ide, 0, ADDRESS_SPACE_PROGRAM, 0xff000000, 0xff000fff, 0, 0, cf_card_data_r, cf_card_data_w );
+ memory_install_readwrite64_device_handler( ide, 0, ADDRESS_SPACE_PROGRAM, 0xff200000, 0xff200fff, 0, 0, cf_card_r, cf_card_w );
}
static DRIVER_INIT(ppp2nd)
diff --git a/src/mame/drivers/wardner.c b/src/mame/drivers/wardner.c
index 123c0169c54..ec977820047 100644
--- a/src/mame/drivers/wardner.c
+++ b/src/mame/drivers/wardner.c
@@ -144,7 +144,7 @@ static WRITE8_HANDLER( wardner_ramrom_bank_sw )
if (data)
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_BANK1);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, SMH_BANK1);
switch (data)
{
case 2: bankaddress = 0x10000; break;
@@ -160,10 +160,10 @@ static WRITE8_HANDLER( wardner_ramrom_bank_sw )
}
else
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, wardner_sprite_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xadff, 0, 0, SMH_BANK4);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xae00, 0xafff, 0, 0, SMH_BANK2);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0, SMH_BANK3);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, wardner_sprite_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xadff, 0, 0, SMH_BANK4);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xae00, 0xafff, 0, 0, SMH_BANK2);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0, SMH_BANK3);
memory_set_bankptr(1, &RAM[0x0000]);
memory_set_bankptr(2, rambase_ae00);
memory_set_bankptr(3, rambase_c000);
diff --git a/src/mame/drivers/williams.c b/src/mame/drivers/williams.c
index 9e2e018d37c..03aaf515714 100644
--- a/src/mame/drivers/williams.c
+++ b/src/mame/drivers/williams.c
@@ -520,16 +520,16 @@ static ADDRESS_MAP_START( defender_map, ADDRESS_SPACE_PROGRAM, 8 )
ADDRESS_MAP_END
-void defender_install_io_space(void)
+void defender_install_io_space(running_machine *machine)
{
/* this routine dynamically installs the memory mapped above from c000-cfff */
- memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc00f, 0, 0x03e0, SMH_BANK4);
- memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc010, 0xc01f, 0, 0x03e0, defender_video_control_w);
- memory_install_write8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc3ff, 0xc3ff, 0, 0, williams_watchdog_reset_w);
- memory_install_readwrite8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc400, 0xc4ff, 0, 0x0300, SMH_BANK3, williams_cmos_w);
- memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcbff, 0, 0x03e0, williams_video_counter_r);
- memory_install_readwrite8_handler (0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcc03, 0, 0x03e0, pia_1_r, pia_1_w);
- memory_install_readwrite8_handler (0, ADDRESS_SPACE_PROGRAM, 0xcc04, 0xcc07, 0, 0x03e0, pia_0_r, pia_0_w);
+ memory_install_write8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc00f, 0, 0x03e0, SMH_BANK4);
+ memory_install_write8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xc010, 0xc01f, 0, 0x03e0, defender_video_control_w);
+ memory_install_write8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xc3ff, 0xc3ff, 0, 0, williams_watchdog_reset_w);
+ memory_install_readwrite8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xc400, 0xc4ff, 0, 0x0300, SMH_BANK3, williams_cmos_w);
+ memory_install_read8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xcbff, 0, 0x03e0, williams_video_counter_r);
+ memory_install_readwrite8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcc03, 0, 0x03e0, pia_1_r, pia_1_w);
+ memory_install_readwrite8_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0xcc04, 0xcc07, 0, 0x03e0, pia_0_r, pia_0_w);
memory_set_bankptr(3, generic_nvram);
memory_set_bankptr(4, paletteram);
}
@@ -2602,7 +2602,7 @@ static DRIVER_INIT( mayday )
CONFIGURE_PIAS(williams_pia_0_intf, williams_pia_1_intf, williams_snd_pia_intf);
/* install a handler to catch protection checks */
- mayday_protection = memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa190, 0xa191, 0, 0, mayday_protection_r);
+ mayday_protection = memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa190, 0xa191, 0, 0, mayday_protection_r);
}
@@ -2640,7 +2640,7 @@ static DRIVER_INIT( bubbles )
CONFIGURE_PIAS(williams_pia_0_intf, williams_pia_1_intf, williams_snd_pia_intf);
/* bubbles has a full 8-bit-wide CMOS */
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcfff, 0, 0, bubbles_cmos_w);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xcc00, 0xcfff, 0, 0, bubbles_cmos_w);
}
@@ -2686,14 +2686,13 @@ static DRIVER_INIT( spdball )
/* add a third PIA */
pia_config(3, &spdball_pia_3_intf);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc808, 0xc80b, 0, 0, pia_3_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc808, 0xc80b, 0, 0, pia_3_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc808, 0xc80b, 0, 0, pia_3_r, pia_3_w);
/* install extra input handlers */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xc800, 0, 0, input_port_5_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc801, 0xc801, 0, 0, input_port_6_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc802, 0xc802, 0, 0, input_port_7_r);
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc803, 0xc803, 0, 0, input_port_8_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc800, 0xc800, 0, 0, input_port_5_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc801, 0xc801, 0, 0, input_port_6_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc802, 0xc802, 0, 0, input_port_7_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc803, 0xc803, 0, 0, input_port_8_r);
}
@@ -2701,7 +2700,7 @@ static DRIVER_INIT( alienar )
{
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000);
CONFIGURE_PIAS(williams_muxed_pia_0_intf, williams_pia_1_intf, williams_snd_pia_intf);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xcbff, 0xcbff, 0, 0, SMH_NOP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xcbff, 0xcbff, 0, 0, SMH_NOP);
}
@@ -2709,7 +2708,7 @@ static DRIVER_INIT( alienaru )
{
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000);
CONFIGURE_PIAS(williams_muxed_pia_0_intf, williams_pia_1_intf, williams_snd_pia_intf);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xcbff, 0xcbff, 0, 0, SMH_NOP);
+ memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xcbff, 0xcbff, 0, 0, SMH_NOP);
}
diff --git a/src/mame/drivers/witch.c b/src/mame/drivers/witch.c
index 55a685ff7f4..110d48a5946 100644
--- a/src/mame/drivers/witch.c
+++ b/src/mame/drivers/witch.c
@@ -853,7 +853,7 @@ static DRIVER_INIT(witch)
UINT8 *ROM = (UINT8 *)memory_region(REGION_CPU1);
memory_set_bankptr(1,&ROM[0x10000+UNBANKED_SIZE]);
- memory_install_read8_handler(1, ADDRESS_SPACE_PROGRAM, 0x7000, 0x700f, 0, 0, prot_read_700x);
+ memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x7000, 0x700f, 0, 0, prot_read_700x);
}
GAME( 1992, witch, 0, witch, witch, witch, ROT0, "Sega / Vic Tokai", "Witch", 0 )
diff --git a/src/mame/drivers/wiz.c b/src/mame/drivers/wiz.c
index ad13e2f91c0..03ba74b35c1 100644
--- a/src/mame/drivers/wiz.c
+++ b/src/mame/drivers/wiz.c
@@ -1046,13 +1046,13 @@ static DRIVER_INIT( stinger )
static DRIVER_INIT( scion )
{
- memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4001, 0, 0, SMH_NOP);
+ memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x4000, 0x4001, 0, 0, SMH_NOP);
}
static DRIVER_INIT( wiz )
{
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xd400, 0xd400, 0, 0, wiz_protection_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd400, 0xd400, 0, 0, wiz_protection_r);
}
diff --git a/src/mame/drivers/yunsun16.c b/src/mame/drivers/yunsun16.c
index e4e1a67df93..cec91cdff53 100644
--- a/src/mame/drivers/yunsun16.c
+++ b/src/mame/drivers/yunsun16.c
@@ -167,7 +167,7 @@ number 0 on each voice. That sample is 00000-00000.
static DRIVER_INIT( magicbub )
{
// remove_mem_write16_handler (0, 0x800180, 0x800181 );
- memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x800188, 0x800189, 0, 0, magicbub_sound_command_w);
+ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800188, 0x800189, 0, 0, magicbub_sound_command_w);
}
/***************************************************************************
diff --git a/src/mame/drivers/zaxxon.c b/src/mame/drivers/zaxxon.c
index 8504888a82c..c54b055e6fc 100644
--- a/src/mame/drivers/zaxxon.c
+++ b/src/mame/drivers/zaxxon.c
@@ -1457,16 +1457,15 @@ static DRIVER_INIT( razmataz )
DRIVER_INIT_CALL(zaxxon);
/* additional input ports are wired */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc004, 0xc004, 0, 0x18f3, port_tag_to_handler8("SW04"));
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc008, 0xc008, 0, 0x18f3, port_tag_to_handler8("SW08"));
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00c, 0xc00c, 0, 0x18f3, port_tag_to_handler8("SW0C"));
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc004, 0xc004, 0, 0x18f3, port_tag_to_handler8("SW04"));
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc008, 0xc008, 0, 0x18f3, port_tag_to_handler8("SW08"));
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc00c, 0xc00c, 0, 0x18f3, port_tag_to_handler8("SW0C"));
/* unknown behavior expected here */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc80a, 0xc80a, 0, 0, razmataz_counter_r);
+ memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc80a, 0xc80a, 0, 0, razmataz_counter_r);
/* connect the universal sound board */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_status_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_data_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_status_r, sega_usb_data_w);
/* additional state saving */
state_save_register_global_array(razmataz_dial_pos);
@@ -1480,8 +1479,7 @@ static DRIVER_INIT( ixion )
DRIVER_INIT_CALL(zaxxon);
/* connect the universal sound board */
- memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_status_r);
- memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_data_w);
+ memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe03c, 0xe03c, 0, 0x1f00, sega_usb_status_r, sega_usb_data_w);
}
diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c
index 2d8e366371e..4a201c32a9a 100644
--- a/src/mame/drivers/zn.c
+++ b/src/mame/drivers/zn.c
@@ -627,13 +627,13 @@ static WRITE32_HANDLER( zn_qsound_w )
static DRIVER_INIT( coh1000c )
{
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f3fffff, 0, 0, SMH_BANK1 ); /* fixed game rom */
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f400000, 0x1f7fffff, 0, 0, SMH_BANK2 ); /* banked game rom */
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, bank_coh1000c_w ); /* bankswitch */
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40010, 0x1fb40013, 0, 0, capcom_kickharness_r );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40020, 0x1fb40023, 0, 0, capcom_kickharness_r );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fbfffff, 0, 0, SMH_BANK3 ); /* country rom */
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb60000, 0x1fb60003, 0, 0, zn_qsound_w );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f3fffff, 0, 0, SMH_BANK1 ); /* fixed game rom */
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f400000, 0x1f7fffff, 0, 0, SMH_BANK2 ); /* banked game rom */
+ memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, bank_coh1000c_w ); /* bankswitch */
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40010, 0x1fb40013, 0, 0, capcom_kickharness_r );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40020, 0x1fb40023, 0, 0, capcom_kickharness_r );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fbfffff, 0, 0, SMH_BANK3 ); /* country rom */
+ memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb60000, 0x1fb60003, 0, 0, zn_qsound_w );
zn_driver_init(machine);
@@ -859,13 +859,13 @@ static WRITE32_HANDLER( bank_coh3002c_w )
static DRIVER_INIT( coh3002c )
{
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f3fffff, 0, 0, SMH_BANK1 ); /* fixed game rom */
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f400000, 0x1f7fffff, 0, 0, SMH_BANK2 ); /* banked game rom */
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40010, 0x1fb40013, 0, 0, capcom_kickharness_r );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40020, 0x1fb40023, 0, 0, capcom_kickharness_r );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, bank_coh3002c_w ); /* bankswitch */
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fbfffff, 0, 0, SMH_BANK3 ); /* country rom */
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb60000, 0x1fb60003, 0, 0, zn_qsound_w );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f3fffff, 0, 0, SMH_BANK1 ); /* fixed game rom */
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f400000, 0x1f7fffff, 0, 0, SMH_BANK2 ); /* banked game rom */
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40010, 0x1fb40013, 0, 0, capcom_kickharness_r );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40020, 0x1fb40023, 0, 0, capcom_kickharness_r );
+ memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00003, 0, 0, bank_coh3002c_w ); /* bankswitch */
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fbfffff, 0, 0, SMH_BANK3 ); /* country rom */
+ memory_install_write32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb60000, 0x1fb60003, 0, 0, zn_qsound_w );
zn_driver_init(machine);
}
@@ -1208,12 +1208,10 @@ static DRIVER_INIT( coh1000ta )
{
taitofx1_eeprom_size1 = 0x200; taitofx1_eeprom1 = auto_malloc( taitofx1_eeprom_size1 );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); /* banked game rom */
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, bank_coh1000t_w ); /* bankswitch */
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, taitofx1a_ymsound_r );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, taitofx1a_ymsound_w );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fbe0000, 0x1fbe0000 + ( taitofx1_eeprom_size1 - 1 ), 0, 0, SMH_BANK2 );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fbe0000, 0x1fbe0000 + ( taitofx1_eeprom_size1 - 1 ), 0, 0, SMH_BANK2 );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); /* banked game rom */
+ memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, bank_coh1000t_w ); /* bankswitch */
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, taitofx1a_ymsound_r, taitofx1a_ymsound_w );
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fbe0000, 0x1fbe0000 + ( taitofx1_eeprom_size1 - 1 ), 0, 0, SMH_BANK2, SMH_BANK2 );
zn_driver_init(machine);
mb3773_init();
@@ -1325,15 +1323,13 @@ static DRIVER_INIT( coh1000tb )
taitofx1_eeprom_size1 = 0x400; taitofx1_eeprom1 = auto_malloc( taitofx1_eeprom_size1 );
taitofx1_eeprom_size2 = 0x200; taitofx1_eeprom2 = auto_malloc( taitofx1_eeprom_size2 );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); /* banked game rom */
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00000 + ( taitofx1_eeprom_size1 - 1 ), 0, 0, SMH_BANK2 );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00000 + ( taitofx1_eeprom_size1 - 1 ), 0, 0, SMH_BANK2 );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, bank_coh1000t_w ); /* bankswitch */
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, taitofx1b_volume_w );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fba0000, 0x1fba0003, 0, 0, taitofx1b_sound_w );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fbc0000, 0x1fbc0003, 0, 0, taitofx1b_sound_r );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fbe0000, 0x1fbe0000 + ( taitofx1_eeprom_size2 - 1 ), 0, 0, SMH_BANK3 );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fbe0000, 0x1fbe0000 + ( taitofx1_eeprom_size2 - 1 ), 0, 0, SMH_BANK3 );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f7fffff, 0, 0, SMH_BANK1 ); /* banked game rom */
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb00000, 0x1fb00000 + ( taitofx1_eeprom_size1 - 1 ), 0, 0, SMH_BANK2, SMH_BANK2 );
+ memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, bank_coh1000t_w ); /* bankswitch */
+ memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb80000, 0x1fb80003, 0, 0, taitofx1b_volume_w );
+ memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fba0000, 0x1fba0003, 0, 0, taitofx1b_sound_w );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fbc0000, 0x1fbc0003, 0, 0, taitofx1b_sound_r );
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fbe0000, 0x1fbe0000 + ( taitofx1_eeprom_size2 - 1 ), 0, 0, SMH_BANK3, SMH_BANK3 );
zn_driver_init(machine);
mb3773_init();
@@ -1522,9 +1518,8 @@ static READ32_HANDLER( coh3002t_unknown_r )
static DRIVER_INIT( coh3002t )
{
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f1fffff, 0, 0, SMH_BANK1 );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, coh3002t_unknown_w );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, coh3002t_unknown_r );
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f1fffff, 0, 0, SMH_BANK1 );
+ memory_install_readwrite32_handler( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1fb40000, 0x1fb40003, 0, 0, coh3002t_unknown_r, coh3002t_unknown_w );
zn_driver_init(machine);
}
@@ -1658,7 +1653,7 @@ Notes:
*2 - Unpopulated DIP28 socket
*/
-static void atpsx_interrupt(int state)
+static void atpsx_interrupt(const device_config *config, int state)
{
if (state)
{
@@ -1666,13 +1661,10 @@ static void atpsx_interrupt(int state)
}
}
-static const struct ide_interface atpsx_intf =
-{
- atpsx_interrupt
-};
-
static void atpsx_dma_read( UINT32 n_address, INT32 n_size )
{
+ const device_config *ide = device_list_find_by_tag(Machine->config->devicelist, IDE_CONTROLLER, "ide");
+
logerror("DMA read: %d bytes (%d words) to %08x\n", n_size<<2, n_size, n_address);
if (n_address < 0xe0000)
@@ -1686,7 +1678,7 @@ static void atpsx_dma_read( UINT32 n_address, INT32 n_size )
n_size <<= 2;
while( n_size > 0 )
{
- psxwritebyte( n_address, ide_controller32_0_r( Machine, 0x1f0 / 4, 0xffffff00 ) );
+ psxwritebyte( n_address, ide_controller32_r( ide, 0x1f0 / 4, 0xffffff00 ) );
n_address++;
n_size--;
}
@@ -1699,17 +1691,13 @@ static void atpsx_dma_write( UINT32 n_address, INT32 n_size )
static DRIVER_INIT( coh1000w )
{
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f1fffff, 0, 0, SMH_BANK1 );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f000003, 0, 0, SMH_NOP );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f7e4000, 0x1f7e4fff, 0, 0, ide_controller32_0_r );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f7e4000, 0x1f7e4fff, 0, 0, ide_controller32_0_w );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f7e8000, 0x1f7e8003, 0, 0, SMH_NOP );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f7e8000, 0x1f7e8003, 0, 0, SMH_NOP );
- memory_install_read32_handler ( 0, ADDRESS_SPACE_PROGRAM, 0x1f7f4000, 0x1f7f4fff, 0, 0, ide_controller32_0_r );
- memory_install_write32_handler( 0, ADDRESS_SPACE_PROGRAM, 0x1f7f4000, 0x1f7f4fff, 0, 0, ide_controller32_0_w );
-
- // init hard disk
- ide_controller_init(0, &atpsx_intf);
+ const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide");
+
+ memory_install_read32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f1fffff, 0, 0, SMH_BANK1 );
+ memory_install_write32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f000000, 0x1f000003, 0, 0, SMH_NOP );
+ memory_install_readwrite32_device_handler( ide, 0, ADDRESS_SPACE_PROGRAM, 0x1f7e4000, 0x1f7e4fff, 0, 0, ide_controller32_r, ide_controller32_w );
+ memory_install_readwrite32_handler ( machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f7e8000, 0x1f7e8003, 0, 0, SMH_NOP, SMH_NOP );
+ memory_install_readwrite32_device_handler( ide, 0, ADDRESS_SPACE_PROGRAM, 0x1f7f4000, 0x1f7f4fff, 0, 0, ide_controller32_r, ide_controller32_w );
zn_driver_init(machine);
}
@@ -1719,7 +1707,7 @@ static MACHINE_RESET( coh1000w )
memory_set_bankptr( 1, memory_region( REGION_USER2 ) ); /* fixed game rom */
zn_machine_init();
- ide_controller_reset(0);