summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/mastboy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/mastboy.c')
-rw-r--r--src/mame/drivers/mastboy.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/mame/drivers/mastboy.c b/src/mame/drivers/mastboy.c
index 53c61039137..cf29269459a 100644
--- a/src/mame/drivers/mastboy.c
+++ b/src/mame/drivers/mastboy.c
@@ -609,25 +609,29 @@ static WRITE8_HANDLER( backupram_enable_w )
static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit0_w )
{
+ const device_config *adpcm = devtag_get_device(space->machine, SOUND, "msm");
+
mastboy_m5205_sambit0 = data & 1;
- msm5205_playmode_w(0, (1 << 2) | (mastboy_m5205_sambit1 << 1) | (mastboy_m5205_sambit0) );
+ msm5205_playmode_w(adpcm, (1 << 2) | (mastboy_m5205_sambit1 << 1) | (mastboy_m5205_sambit0) );
logerror("msm5205 samplerate bit 0, set to %02x\n",data);
}
static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit1_w )
{
+ const device_config *adpcm = devtag_get_device(space->machine, SOUND, "msm");
+
mastboy_m5205_sambit1 = data & 1;
- msm5205_playmode_w(0, (1 << 2) | (mastboy_m5205_sambit1 << 1) | (mastboy_m5205_sambit0) );
+ msm5205_playmode_w(adpcm, (1 << 2) | (mastboy_m5205_sambit1 << 1) | (mastboy_m5205_sambit0) );
logerror("msm5205 samplerate bit 0, set to %02x\n",data);
}
-static WRITE8_HANDLER( mastboy_msm5205_reset_w )
+static WRITE8_DEVICE_HANDLER( mastboy_msm5205_reset_w )
{
mastboy_m5205_part = 0;
- msm5205_reset_w(0,data&1);
+ msm5205_reset_w(device,data&1);
}
static WRITE8_HANDLER( mastboy_msm5205_data_w )
@@ -637,7 +641,7 @@ static WRITE8_HANDLER( mastboy_msm5205_data_w )
static void mastboy_adpcm_int(const device_config *device)
{
- msm5205_data_w (0,mastboy_m5205_next);
+ msm5205_data_w (device,mastboy_m5205_next);
mastboy_m5205_next>>=4;
mastboy_m5205_part ^= 1;
@@ -697,13 +701,13 @@ static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0xff000, 0xff7ff) AM_WRITE(mastboy_backupram_w) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
AM_RANGE(0xff820, 0xff827) AM_WRITE(mastboy_bank_w)
- AM_RANGE(0xff828, 0xff828) AM_WRITE(saa1099_write_port_0_w)
- AM_RANGE(0xff829, 0xff829) AM_WRITE(saa1099_control_port_0_w)
+ AM_RANGE(0xff828, 0xff828) AM_DEVWRITE(SOUND, "saa", saa1099_data_w)
+ AM_RANGE(0xff829, 0xff829) AM_DEVWRITE(SOUND, "saa", saa1099_control_w)
AM_RANGE(0xff830, 0xff830) AM_WRITE(mastboy_msm5205_data_w)
AM_RANGE(0xff838, 0xff838) AM_WRITE(mastboy_irq0_ack_w)
AM_RANGE(0xff839, 0xff839) AM_WRITE(msm5205_mastboy_m5205_sambit0_w)
AM_RANGE(0xff83a, 0xff83a) AM_WRITE(msm5205_mastboy_m5205_sambit1_w)
- AM_RANGE(0xff83b, 0xff83b) AM_WRITE(mastboy_msm5205_reset_w)
+ AM_RANGE(0xff83b, 0xff83b) AM_DEVWRITE(SOUND, "msm", mastboy_msm5205_reset_w)
AM_RANGE(0xff83c, 0xff83c) AM_WRITE(backupram_enable_w)
AM_RANGE(0xffc00, 0xfffff) AM_WRITE(SMH_RAM) // Internal RAM
ADDRESS_MAP_END
@@ -852,7 +856,7 @@ static MACHINE_RESET( mastboy )
memset( mastboy_vram, 0x00, 0x10000);
mastboy_m5205_part = 0;
- msm5205_reset_w(0,1);
+ msm5205_reset_w(devtag_get_device(machine, SOUND, "msm"),1);
mastboy_irq0_ack = 0;
}