diff options
author | Aaron Giles <aaron@aarongiles.com> | 2008-05-01 13:48:49 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2008-05-01 13:48:49 +0000 |
commit | c967dcb1023ee7e64a81de95f50428ca98f3500c (patch) | |
tree | 4a9c917dcb8b06e678affca0ba33249cc6fb23ad | |
parent | 355fa5294d8c24915f73392d52d0f09fdb87a3fc (diff) |
From: Duke [mailto:startaq@gmail.com]
Subject: MSM6242 device
Hello,
the attached patch changes the MSM6242 RTC into a proper device.
--Dirk
-rw-r--r-- | src/emu/machine/msm6242.c | 184 | ||||
-rw-r--r-- | src/emu/machine/msm6242.h | 30 | ||||
-rw-r--r-- | src/mame/drivers/ddenlovr.c | 90 | ||||
-rw-r--r-- | src/mame/drivers/dynax.c | 18 | ||||
-rw-r--r-- | src/mame/drivers/royalmah.c | 15 | ||||
-rw-r--r-- | src/mame/drivers/seta.c | 5 |
6 files changed, 232 insertions, 110 deletions
diff --git a/src/emu/machine/msm6242.c b/src/emu/machine/msm6242.c index 5ae525d50eb..93d076ee5a9 100644 --- a/src/emu/machine/msm6242.c +++ b/src/emu/machine/msm6242.c @@ -7,55 +7,74 @@ #include "driver.h" #include "machine/msm6242.h" -static UINT8 msm6264_reg[3] = { 0, 0, 0 }; -static mame_system_time msm6264_hold_time = { 0 }; enum { - MSM6264_REG_S1 = 0, - MSM6264_REG_S10, - MSM6264_REG_MI1, - MSM6264_REG_MI10, - MSM6264_REG_H1, - MSM6264_REG_H10, - MSM6264_REG_D1, - MSM6264_REG_D10, - MSM6264_REG_MO1, - MSM6264_REG_MO10, - MSM6264_REG_Y1, - MSM6264_REG_Y10, - MSM6264_REG_W, - MSM6264_REG_CD, - MSM6264_REG_CE, - MSM6264_REG_CF + MSM6242_REG_S1 = 0, + MSM6242_REG_S10, + MSM6242_REG_MI1, + MSM6242_REG_MI10, + MSM6242_REG_H1, + MSM6242_REG_H10, + MSM6242_REG_D1, + MSM6242_REG_D10, + MSM6242_REG_MO1, + MSM6242_REG_MO10, + MSM6242_REG_Y1, + MSM6242_REG_Y10, + MSM6242_REG_W, + MSM6242_REG_CD, + MSM6242_REG_CE, + MSM6242_REG_CF }; -READ8_HANDLER( msm6242_r ) + +typedef struct _msm6242_t msm6242_t; +struct _msm6242_t +{ + UINT8 reg[3]; + mame_system_time hold_time; +}; + + +/* makes sure that the passed in device is the right type */ +INLINE msm6242_t *get_safe_token(const device_config *device) +{ + assert(device != NULL); + assert(device->token != NULL); + assert(device->type == DEVICE_GET_INFO_NAME(msm6242)); + + return (msm6242_t *)device->token; +} + + +READ8_DEVICE_HANDLER( msm6242_r ) { mame_system_time curtime, *systime = &curtime; + msm6242_t *msm6242 = get_safe_token(device); - if ( msm6264_reg[0] & 1 ) /* if HOLD is set, use the hold time */ + if (msm6242->reg[0] & 1) /* if HOLD is set, use the hold time */ { - systime = &msm6264_hold_time; + systime = &msm6242->hold_time; } else /* otherwise, use the current time */ { - mame_get_current_datetime(machine, &curtime); + mame_get_current_datetime(device->machine, &curtime); } switch(offset) { - case MSM6264_REG_S1: return systime->local_time.second % 10; - case MSM6264_REG_S10: return systime->local_time.second / 10; - case MSM6264_REG_MI1: return systime->local_time.minute % 10; - case MSM6264_REG_MI10: return systime->local_time.minute / 10; - case MSM6264_REG_H1: - case MSM6264_REG_H10: + case MSM6242_REG_S1: return systime->local_time.second % 10; + case MSM6242_REG_S10: return systime->local_time.second / 10; + case MSM6242_REG_MI1: return systime->local_time.minute % 10; + case MSM6242_REG_MI10: return systime->local_time.minute / 10; + case MSM6242_REG_H1: + case MSM6242_REG_H10: { int hour = systime->local_time.hour; /* check for 12/24 hour mode */ - if ( (msm6264_reg[2] & 0x04) == 0 ) /* 12 hour mode? */ + if ((msm6242->reg[2] & 0x04) == 0) /* 12 hour mode? */ { hour %= 12; @@ -63,66 +82,118 @@ READ8_HANDLER( msm6242_r ) hour = 12; } - if ( offset == MSM6264_REG_H1 ) + if ( offset == MSM6242_REG_H1 ) return hour % 10; return hour / 10; } - case MSM6264_REG_D1: return systime->local_time.mday % 10; - case MSM6264_REG_D10: return systime->local_time.mday / 10; - case MSM6264_REG_MO1: return (systime->local_time.month+1) % 10; - case MSM6264_REG_MO10: return (systime->local_time.month+1) / 10; - case MSM6264_REG_Y1: return systime->local_time.year % 10; - case MSM6264_REG_Y10: return (systime->local_time.year % 100) / 10; - case MSM6264_REG_W: return systime->local_time.weekday; - case MSM6264_REG_CD: return msm6264_reg[0]; - case MSM6264_REG_CE: return msm6264_reg[1]; - case MSM6264_REG_CF: return msm6264_reg[2]; + case MSM6242_REG_D1: return systime->local_time.mday % 10; + case MSM6242_REG_D10: return systime->local_time.mday / 10; + case MSM6242_REG_MO1: return (systime->local_time.month+1) % 10; + case MSM6242_REG_MO10: return (systime->local_time.month+1) / 10; + case MSM6242_REG_Y1: return systime->local_time.year % 10; + case MSM6242_REG_Y10: return (systime->local_time.year % 100) / 10; + case MSM6242_REG_W: return systime->local_time.weekday; + case MSM6242_REG_CD: return msm6242->reg[0]; + case MSM6242_REG_CE: return msm6242->reg[1]; + case MSM6242_REG_CF: return msm6242->reg[2]; } - logerror("%04x: MSM6242 unmapped offset %02X read\n",activecpu_get_pc(),offset); + logerror("%04x: MSM6242 unmapped offset %02x read\n", activecpu_get_pc(), offset); return 0; } -WRITE8_HANDLER( msm6242_w ) + +WRITE8_DEVICE_HANDLER( msm6242_w ) { + msm6242_t *msm6242 = get_safe_token(device); + switch(offset) { - case MSM6264_REG_CD: + case MSM6242_REG_CD: { - msm6264_reg[0] = data; + msm6242->reg[0] = data; - if ( data & 1 ) /* was Hold set? */ - { - mame_get_current_datetime(machine, &msm6264_hold_time); - } + if (data & 1) /* was Hold set? */ + { + mame_get_current_datetime(device->machine, &msm6242->hold_time); + } - return; + return; } - case MSM6264_REG_CE: msm6264_reg[1] = data; return; + case MSM6242_REG_CE: msm6242->reg[1] = data; return; - case MSM6264_REG_CF: + case MSM6242_REG_CF: { /* the 12/24 mode bit can only be changed while REST is 1 */ - if ( (data ^ msm6264_reg[2]) & 0x04 ) + if ((data ^ msm6242->reg[2]) & 0x04) { - if ( msm6264_reg[2] & 1 ) - msm6264_reg[2] = data; + if (msm6242->reg[2] & 1) + msm6242->reg[2] = data; } else { - msm6264_reg[2] = data; + msm6242->reg[2] = data; } return; } } - logerror("%04x: MSM6242 unmapped offset %02X written with %02X\n",activecpu_get_pc(),offset,data); + logerror("%04x: MSM6242 unmapped offset %02x written with %02x\n", activecpu_get_pc(), offset, data); } +static DEVICE_START( msm6242 ) +{ + msm6242_t *msm6242 = get_safe_token(device); + + msm6242->reg[0] = 0; + msm6242->reg[1] = 0; + msm6242->reg[2] = 0; + memset(&msm6242->hold_time, 0, sizeof(mame_system_time)); +} + + +static DEVICE_SET_INFO( msm6242 ) +{ + switch (state) + { + /* no parameters to set */ + } +} + + +DEVICE_GET_INFO( msm6242 ) +{ + switch (state) + { + /* --- the following bits of info are returned as 64-bit signed integers --- */ + case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(msm6242_t); break; + case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; + case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_TIMER; 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(msm6242); break; + case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(msm6242); break; + case DEVINFO_FCT_STOP: /* Nothing */ break; + case DEVINFO_FCT_RESET: /* Nothing */ break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case DEVINFO_STR_NAME: info->s = "OKI MSM6242"; break; + case DEVINFO_STR_FAMILY: info->s = "MSM6242 RTC"; break; + case DEVINFO_STR_VERSION: info->s = "1.00"; break; + case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; + case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; + } +} + + + + + +#if 0 READ16_HANDLER( msm6242_lsb_r ) { return msm6242_r(machine, offset); @@ -133,3 +204,4 @@ WRITE16_HANDLER( msm6242_lsb_w ) if (ACCESSING_BITS_0_7) msm6242_w(machine, offset, data); } +#endif diff --git a/src/emu/machine/msm6242.h b/src/emu/machine/msm6242.h index c0b817f5d73..d62692a199f 100644 --- a/src/emu/machine/msm6242.h +++ b/src/emu/machine/msm6242.h @@ -1,10 +1,26 @@ -#ifndef MSM6242_INCLUDE -#define MSM6242_INCLUDE +/*************************************************************************** -READ8_HANDLER( msm6242_r ); -WRITE8_HANDLER( msm6242_w ); + MSM6242 Real Time Clock -READ16_HANDLER( msm6242_lsb_r ); -WRITE16_HANDLER( msm6242_lsb_w ); + Copyright Nicola Salmoria and the MAME Team. + Visit http://mamedev.org for licensing and usage restrictions. -#endif +***************************************************************************/ + +#pragma once + +#ifndef __MSM6242_H__ +#define __MSM6242_H__ + + +#define MSM6242 DEVICE_GET_INFO_NAME(msm6242) + + +/* device interface */ +DEVICE_GET_INFO( msm6242 ); + +READ8_DEVICE_HANDLER( msm6242_r ); +WRITE8_DEVICE_HANDLER( msm6242_w ); + + +#endif /* __MSM6242_H__ */ diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c index e1679eda70d..c8f5e1a7143 100644 --- a/src/mame/drivers/ddenlovr.c +++ b/src/mame/drivers/ddenlovr.c @@ -1577,7 +1577,7 @@ static ADDRESS_MAP_START( quiz365_readmem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x300270, 0x300271) AM_READ(unk16_r ) // ? must be 78 on startup (not necessary in ddlover) AM_RANGE(0x300286, 0x300287) AM_READ(ddenlovr_gfxrom_r ) // Video Chip AM_RANGE(0x3002c0, 0x3002c1) AM_READ(OKIM6295_status_0_lsb_r ) // Sound - AM_RANGE(0x300340, 0x30035f) AM_READ(msm6242_lsb_r ) // 6242RTC + AM_RANGE(0x300340, 0x30035f) AM_DEVREAD8(MSM6242, "rtc", msm6242_r, 0x00ff) // 6242RTC AM_RANGE(0x300384, 0x300385) AM_READ(AY8910_read_port_0_lsb_r ) AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM ) // RAM ADDRESS_MAP_END @@ -1599,7 +1599,7 @@ static ADDRESS_MAP_START( quiz365_writemem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x300280, 0x300283) AM_WRITE(ddenlovr_blitter_w ) AM_RANGE(0x300300, 0x300301) AM_WRITE(YM2413_register_port_0_lsb_w ) AM_RANGE(0x300302, 0x300303) AM_WRITE(YM2413_data_port_0_lsb_w ) - AM_RANGE(0x300340, 0x30035f) AM_WRITE(msm6242_lsb_w ) // 6242RTC + AM_RANGE(0x300340, 0x30035f) AM_DEVWRITE8(MSM6242, "rtc", msm6242_w, 0x00ff) // 6242RTC AM_RANGE(0x3003ca, 0x3003cb) AM_WRITE(ddenlovr_blitter_irq_ack_w ) // Blitter irq acknowledge AM_RANGE(0x300380, 0x300381) AM_WRITE(AY8910_control_port_0_lsb_w ) AM_RANGE(0x300382, 0x300383) AM_WRITE(AY8910_write_port_0_lsb_w ) @@ -1640,7 +1640,7 @@ static ADDRESS_MAP_START( ddenlvrj_readmem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM ) // ROM AM_RANGE(0x300070, 0x300071) AM_READ(unk16_r ) // ? must be 78 on startup (not necessary in ddlover) AM_RANGE(0x300086, 0x300087) AM_READ(ddenlovr_gfxrom_r ) // Video Chip - AM_RANGE(0x300100, 0x30011f) AM_READ(msm6242_lsb_r ) // 6242RTC + AM_RANGE(0x300100, 0x30011f) AM_DEVREAD8(MSM6242, "rtc", msm6242_r, 0x00ff) // 6242RTC AM_RANGE(0x300180, 0x300181) AM_READ(input_port_0_word_r ) // P1 AM_RANGE(0x300182, 0x300183) AM_READ(input_port_1_word_r ) // P2 AM_RANGE(0x300184, 0x300185) AM_READ(ddenlvrj_blitter_r ) // Coins + ? @@ -1663,7 +1663,7 @@ static ADDRESS_MAP_START( ddenlvrj_writemem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x300080, 0x300083) AM_WRITE(ddenlovr_blitter_w ) AM_RANGE(0x3000c0, 0x3000c1) AM_WRITE(YM2413_register_port_0_lsb_w ) AM_RANGE(0x3000c2, 0x3000c3) AM_WRITE(YM2413_data_port_0_lsb_w ) - AM_RANGE(0x300100, 0x30011f) AM_WRITE(msm6242_lsb_w ) // 6242RTC + AM_RANGE(0x300100, 0x30011f) AM_DEVWRITE8(MSM6242, "rtc", msm6242_w, 0x00ff) // 6242RTC AM_RANGE(0x300140, 0x300141) AM_WRITE(AY8910_control_port_0_lsb_w ) AM_RANGE(0x300142, 0x300143) AM_WRITE(AY8910_write_port_0_lsb_w ) AM_RANGE(0x300188, 0x300189) AM_WRITE(ddenlvrj_coincounter_w ) // Coin Counters @@ -1683,7 +1683,7 @@ static ADDRESS_MAP_START( ddenlovr_readmem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0xe00102, 0xe00103) AM_READ(input_port_1_word_r ) // P2? AM_RANGE(0xe00104, 0xe00105) AM_READ(ddenlovr_special_r ) // Coins + ? AM_RANGE(0xe00200, 0xe00201) AM_READ(input_port_3_word_r ) // DSW - AM_RANGE(0xe00500, 0xe0051f) AM_READ(msm6242_lsb_r ) // 6242RTC + AM_RANGE(0xe00500, 0xe0051f) AM_DEVREAD8(MSM6242, "rtc", msm6242_r, 0x00ff) // 6242RTC AM_RANGE(0xe00604, 0xe00605) AM_READ(AY8910_read_port_0_lsb_r ) AM_RANGE(0xe00700, 0xe00701) AM_READ(OKIM6295_status_0_lsb_r ) // Sound AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM ) // RAM @@ -1707,7 +1707,7 @@ static ADDRESS_MAP_START( ddenlovr_writemem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w ) // AM_RANGE(0xe00400, 0xe00401) AM_WRITE(YM2413_register_port_0_lsb_w ) AM_RANGE(0xe00402, 0xe00403) AM_WRITE(YM2413_data_port_0_lsb_w ) - AM_RANGE(0xe00500, 0xe0051f) AM_WRITE(msm6242_lsb_w ) // 6242RTC + AM_RANGE(0xe00500, 0xe0051f) AM_DEVWRITE8(MSM6242, "rtc", msm6242_w, 0x00ff) // 6242RTC // AM_RANGE(0xe00302, 0xe00303) AM_WRITE(SMH_NOP ) // ? AM_RANGE(0xe00600, 0xe00601) AM_WRITE(AY8910_control_port_0_lsb_w ) AM_RANGE(0xe00602, 0xe00603) AM_WRITE(AY8910_write_port_0_lsb_w ) @@ -1768,7 +1768,7 @@ static ADDRESS_MAP_START( nettoqc_readmem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x200c02, 0x200c03) AM_READ(nettoqc_protection_r ) // AM_RANGE(0x300070, 0x300071) AM_READ(unk16_r ) // ? must be 78 on startup (not necessary in ddlover) AM_RANGE(0x300086, 0x300087) AM_READ(ddenlovr_gfxrom_r ) // Video Chip - AM_RANGE(0x300100, 0x30011f) AM_READ(msm6242_lsb_r ) // 6242RTC + AM_RANGE(0x300100, 0x30011f) AM_DEVREAD8(MSM6242, "rtc", msm6242_r, 0x00ff) // 6242RTC AM_RANGE(0x300180, 0x300181) AM_READ(input_port_0_word_r ) // AM_RANGE(0x300182, 0x300183) AM_READ(input_port_1_word_r ) // AM_RANGE(0x300184, 0x300185) AM_READ(nettoqc_special_r ) // Coins + ? @@ -1792,7 +1792,7 @@ static ADDRESS_MAP_START( nettoqc_writemem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x300080, 0x300083) AM_WRITE(ddenlovr_blitter_w ) AM_RANGE(0x3000c0, 0x3000c1) AM_WRITE(YM2413_register_port_0_lsb_w ) AM_RANGE(0x3000c2, 0x3000c3) AM_WRITE(YM2413_data_port_0_lsb_w ) - AM_RANGE(0x300100, 0x30011f) AM_WRITE(msm6242_lsb_w ) // 6242RTC + AM_RANGE(0x300100, 0x30011f) AM_DEVWRITE8(MSM6242, "rtc", msm6242_w, 0x00ff) // 6242RTC AM_RANGE(0x300140, 0x300141) AM_WRITE(AY8910_control_port_0_lsb_w ) AM_RANGE(0x300142, 0x300143) AM_WRITE(AY8910_write_port_0_lsb_w ) AM_RANGE(0x300188, 0x300189) AM_WRITE(nettoqc_coincounter_w ) // Coin Counters @@ -1853,7 +1853,7 @@ static ADDRESS_MAP_START( quizchq_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GL AM_RANGE(0x22, 0x23) AM_READ(rongrong_input2_r ) AM_RANGE(0x40, 0x40) AM_READ(OKIM6295_status_0_r ) AM_RANGE(0x98, 0x98) AM_READ(unk_r ) // ? must be 78 on startup - AM_RANGE(0xa0, 0xaf) AM_READ(msm6242_r ) // 6242RTC + AM_RANGE(0xa0, 0xaf) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC ADDRESS_MAP_END static ADDRESS_MAP_START( quizchq_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) @@ -1871,7 +1871,7 @@ static ADDRESS_MAP_START( quizchq_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_G AM_RANGE(0x94, 0x94) AM_WRITE(ddenlovr_bgcolor_w ) AM_RANGE(0x95, 0x95) AM_WRITE(ddenlovr_priority_w ) AM_RANGE(0x96, 0x96) AM_WRITE(ddenlovr_layer_enable_w ) - AM_RANGE(0xa0, 0xaf) AM_WRITE(msm6242_w ) // 6242RTC + AM_RANGE(0xa0, 0xaf) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC AM_RANGE(0xc0, 0xc0) AM_WRITE(quizchq_oki_bank_w ) AM_RANGE(0xc2, 0xc2) AM_WRITE(SMH_NOP ) // enables palette RAM at 8000 ADDRESS_MAP_END @@ -1895,7 +1895,7 @@ static ADDRESS_MAP_START( rongrong_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_G AM_RANGE(0x03, 0x03) AM_READ(rongrong_gfxrom_r ) AM_RANGE(0x1b, 0x1b) AM_READ(rongrong_blitter_busy_r ) AM_RANGE(0x1c, 0x1c) AM_READ(rongrong_input_r ) - AM_RANGE(0x20, 0x2f) AM_READ(msm6242_r ) // 6242RTC + AM_RANGE(0x20, 0x2f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC AM_RANGE(0x40, 0x40) AM_READ(OKIM6295_status_0_r ) AM_RANGE(0x98, 0x98) AM_READ(unk_r ) // ? must be 78 on startup AM_RANGE(0xa2, 0xa3) AM_READ(rongrong_input2_r ) @@ -1905,7 +1905,7 @@ static ADDRESS_MAP_START( rongrong_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_ AM_RANGE(0x00, 0x01) AM_WRITE(rongrong_blitter_w ) AM_RANGE(0x1b, 0x1b) AM_WRITE(rongrong_blitter_busy_w ) AM_RANGE(0x1e, 0x1e) AM_WRITE(rongrong_select_w ) - AM_RANGE(0x20, 0x2f) AM_WRITE(msm6242_w ) // 6242RTC + AM_RANGE(0x20, 0x2f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC AM_RANGE(0x40, 0x40) AM_WRITE(OKIM6295_data_0_w ) AM_RANGE(0x60, 0x60) AM_WRITE(YM2413_register_port_0_w ) AM_RANGE(0x61, 0x61) AM_WRITE(YM2413_data_port_0_w ) @@ -2009,8 +2009,9 @@ static ADDRESS_MAP_START( mmpanic_writemem, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x8000, 0x81ff) AM_WRITE(rongrong_palette_w ) ADDRESS_MAP_END -static ADDRESS_MAP_START( mmpanic_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x0f) AM_READ(msm6242_r ) // 6242RTC +static ADDRESS_MAP_START( mmpanic_readport, ADDRESS_SPACE_IO, 8 ) + ADDRESS_MAP_GLOBAL_MASK(0xff) + AM_RANGE(0x00, 0x0f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC AM_RANGE(0x38, 0x38) AM_READ(unk_r ) // ? must be 78 on startup AM_RANGE(0x58, 0x58) AM_READ(unk_r ) // ? must be 78 on startup AM_RANGE(0x63, 0x63) AM_READ(rongrong_gfxrom_r ) // Video Chip @@ -2023,8 +2024,9 @@ static ADDRESS_MAP_START( mmpanic_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GL AM_RANGE(0x9c, 0x9c) AM_READ(input_port_4_r ) // DSW 1&2 high bits ADDRESS_MAP_END -static ADDRESS_MAP_START( mmpanic_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x0f) AM_WRITE(msm6242_w ) // 6242RTC +static ADDRESS_MAP_START( mmpanic_writeport, ADDRESS_SPACE_IO, 8 ) + ADDRESS_MAP_GLOBAL_MASK(0xff) + AM_RANGE(0x00, 0x0f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC // Layers 0-3: AM_RANGE(0x20, 0x23) AM_WRITE(ddenlovr_palette_base_w ) AM_RANGE(0x24, 0x27) AM_WRITE(ddenlovr_palette_mask_w ) @@ -2186,7 +2188,7 @@ static ADDRESS_MAP_START( funkyfig_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_G AM_RANGE(0x04, 0x04) AM_READ( funkyfig_busy_r ) AM_RANGE(0x1c, 0x1c) AM_READ( funkyfig_dsw_r ) AM_RANGE(0x23, 0x23) AM_READ( rongrong_gfxrom_r ) // Video Chip - AM_RANGE(0x40, 0x4f) AM_READ( msm6242_r ) // 6242RTC + AM_RANGE(0x40, 0x4f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC AM_RANGE(0x78, 0x78) AM_READ( unk_r ) // ? must be 78 on startup AM_RANGE(0x82, 0x82) AM_READ( funkyfig_coin_r ) AM_RANGE(0x83, 0x83) AM_READ( funkyfig_key_r ) @@ -2199,7 +2201,7 @@ static ADDRESS_MAP_START( funkyfig_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_ AM_RANGE(0x02, 0x02) AM_WRITE( mmpanic_soundlatch_w ) // AM_RANGE(0x1e, 0x1e) AM_WRITE( funkyfig_rombank_w ) AM_RANGE(0x20, 0x21) AM_WRITE( funkyfig_blitter_w ) - AM_RANGE(0x40, 0x4f) AM_WRITE( msm6242_w ) // 6242RTC + AM_RANGE(0x40, 0x4f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC // Layers 0-3: AM_RANGE(0x60, 0x63) AM_WRITE( ddenlovr_palette_base_w ) @@ -2376,7 +2378,7 @@ static ADDRESS_MAP_START( hanakanz_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_G AM_RANGE(0x91, 0x92) AM_READ( hanakanz_keyb_r ) AM_RANGE(0x96, 0x96) AM_READ( hanakanz_rand_r ) AM_RANGE(0xc0, 0xc0) AM_READ( OKIM6295_status_0_r ) - AM_RANGE(0xe0, 0xef) AM_READ( msm6242_r ) // 6242RTC + AM_RANGE(0xe0, 0xef) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC ADDRESS_MAP_END static ADDRESS_MAP_START( hanakanz_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) @@ -2391,7 +2393,7 @@ static ADDRESS_MAP_START( hanakanz_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_ AM_RANGE(0xa0, 0xa0) AM_WRITE( YM2413_register_port_0_w ) AM_RANGE(0xa1, 0xa1) AM_WRITE( YM2413_data_port_0_w ) AM_RANGE(0xc0, 0xc0) AM_WRITE( OKIM6295_data_0_w ) - AM_RANGE(0xe0, 0xef) AM_WRITE( msm6242_w ) // 6242RTC + AM_RANGE(0xe0, 0xef) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC ADDRESS_MAP_END @@ -2403,7 +2405,7 @@ static ADDRESS_MAP_START( hkagerou_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_G AM_RANGE(0xb1, 0xb2) AM_READ( hanakanz_keyb_r ) AM_RANGE(0xb6, 0xb6) AM_READ( hanakanz_rand_r ) AM_RANGE(0xc0, 0xc0) AM_READ( OKIM6295_status_0_r ) - AM_RANGE(0xe0, 0xef) AM_READ( msm6242_r ) // 6242RTC + AM_RANGE(0xe0, 0xef) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC ADDRESS_MAP_END static ADDRESS_MAP_START( hkagerou_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) @@ -2418,7 +2420,7 @@ static ADDRESS_MAP_START( hkagerou_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_ AM_RANGE(0xb3, 0xb3) AM_WRITE( hanakanz_coincounter_w ) AM_RANGE(0xb4, 0xb4) AM_WRITE( hanakanz_keyb_w ) AM_RANGE(0xc0, 0xc0) AM_WRITE( OKIM6295_data_0_w ) - AM_RANGE(0xe0, 0xef) AM_WRITE( msm6242_w ) // 6242RTC + AM_RANGE(0xe0, 0xef) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC ADDRESS_MAP_END @@ -2443,7 +2445,7 @@ static ADDRESS_MAP_START( mjreach1_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_G AM_RANGE(0x94, 0x94) AM_READ( input_port_0_r ) AM_RANGE(0x95, 0x96) AM_READ( hanakanz_keyb_r ) AM_RANGE(0xc0, 0xc0) AM_READ( OKIM6295_status_0_r ) - AM_RANGE(0xe0, 0xef) AM_READ( msm6242_r ) // 6242RTC + AM_RANGE(0xe0, 0xef) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC ADDRESS_MAP_END static ADDRESS_MAP_START( mjreach1_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) @@ -2459,7 +2461,7 @@ static ADDRESS_MAP_START( mjreach1_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_ AM_RANGE(0xa0, 0xa0) AM_WRITE( YM2413_register_port_0_w ) AM_RANGE(0xa1, 0xa1) AM_WRITE( YM2413_data_port_0_w ) AM_RANGE(0xc0, 0xc0) AM_WRITE( OKIM6295_data_0_w ) - AM_RANGE(0xe0, 0xef) AM_WRITE( msm6242_w ) // 6242RTC + AM_RANGE(0xe0, 0xef) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC ADDRESS_MAP_END @@ -2578,7 +2580,7 @@ static ADDRESS_MAP_START( mjchuuka_readport, ADDRESS_SPACE_IO, 8 ) // 16 bit I/O AM_RANGE(0x63, 0x63) AM_MIRROR(0xff00) AM_READ( input_port_14_r ) // DSW 4 AM_RANGE(0x64, 0x64) AM_MIRROR(0xff00) AM_READ( input_port_15_r ) // DSW 1-4 high bits AM_RANGE(0x80, 0x80) AM_MIRROR(0xff00) AM_READ( OKIM6295_status_0_r ) - AM_RANGE(0xc0, 0xcf) AM_MIRROR(0xff00) AM_READ( msm6242_r ) // 6242RTC + AM_RANGE(0xc0, 0xcf) AM_MIRROR(0xff00) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC ADDRESS_MAP_END static ADDRESS_MAP_START( mjchuuka_writeport, ADDRESS_SPACE_IO, 8 ) // 16 bit I/O @@ -2588,7 +2590,7 @@ static ADDRESS_MAP_START( mjchuuka_writeport, ADDRESS_SPACE_IO, 8 ) // 16 bit I/ AM_RANGE(0x40, 0x40) AM_MIRROR(0xff00) AM_WRITE( mjchuuka_coincounter_w ) AM_RANGE(0x41, 0x41) AM_MIRROR(0xff00) AM_WRITE( hanakanz_keyb_w ) AM_RANGE(0x80, 0x80) AM_MIRROR(0xff00) AM_WRITE( OKIM6295_data_0_w ) - AM_RANGE(0xc0, 0xcf) AM_MIRROR(0xff00) AM_WRITE( msm6242_w ) // 6242RTC + AM_RANGE(0xc0, 0xcf) AM_MIRROR(0xff00) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC AM_RANGE(0xa0, 0xa0) AM_MIRROR(0xff00) AM_WRITE( YM2413_register_port_0_w ) AM_RANGE(0xa1, 0xa1) AM_MIRROR(0xff00) AM_WRITE( YM2413_data_port_0_w ) AM_RANGE(0xe0, 0xe0) AM_MIRROR(0xff00) AM_WRITE( AY8910_control_port_0_w ) @@ -2700,7 +2702,7 @@ static ADDRESS_MAP_START( mjmyster_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_G AM_RANGE(0x23, 0x23) AM_READ( mjmyster_keyb_r ) AM_RANGE(0x40, 0x40) AM_READ( OKIM6295_status_0_r ) AM_RANGE(0x44, 0x44) AM_READ( AY8910_read_port_0_r ) - AM_RANGE(0x60, 0x6f) AM_READ( msm6242_r ) // 6242RTC + AM_RANGE(0x60, 0x6f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC AM_RANGE(0x98, 0x98) AM_READ( unk_r ) // ? must be 78 on startup AM_RANGE(0xc2, 0xc2) AM_READ( hanakanz_rand_r ) AM_RANGE(0xc3, 0xc3) AM_READ( mjmyster_dsw_r ) @@ -2717,7 +2719,7 @@ static ADDRESS_MAP_START( mjmyster_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_ AM_RANGE(0x43, 0x43) AM_WRITE( YM2413_data_port_0_w ) AM_RANGE(0x46, 0x46) AM_WRITE( AY8910_write_port_0_w ) AM_RANGE(0x48, 0x48) AM_WRITE( AY8910_control_port_0_w ) - AM_RANGE(0x60, 0x6f) AM_WRITE( msm6242_w ) // 6242RTC + AM_RANGE(0x60, 0x6f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC AM_RANGE(0x80, 0x83) AM_WRITE( ddenlovr_palette_base_w ) AM_RANGE(0x84, 0x87) AM_WRITE( ddenlovr_palette_mask_w ) AM_RANGE(0x88, 0x8b) AM_WRITE( ddenlovr_transparency_pen_w ) @@ -2876,7 +2878,7 @@ static ADDRESS_MAP_START( hginga_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLO AM_RANGE(0x03, 0x03) AM_READ( rongrong_gfxrom_r ) AM_RANGE(0x1c, 0x1c) AM_READ( SMH_NOP ) AM_RANGE(0x24, 0x24) AM_READ( AY8910_read_port_0_r ) - AM_RANGE(0x60, 0x6f) AM_READ( msm6242_r ) // 6242RTC + AM_RANGE(0x60, 0x6f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC AM_RANGE(0x42, 0x42) AM_READ( hginga_coins_r ) AM_RANGE(0x43, 0x43) AM_READ( hginga_input_r ) AM_RANGE(0xb8, 0xb8) AM_READ( unk_r ) // ? must be 78 on startup @@ -2892,7 +2894,7 @@ static ADDRESS_MAP_START( hginga_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GL AM_RANGE(0x28, 0x28) AM_WRITE( AY8910_control_port_0_w ) AM_RANGE(0x40, 0x40) AM_WRITE( hginga_input_w ) AM_RANGE(0x41, 0x41) AM_WRITE( hginga_coins_w ) - AM_RANGE(0x60, 0x6f) AM_WRITE( msm6242_w ) // 6242RTC + AM_RANGE(0x60, 0x6f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC AM_RANGE(0x80, 0x80) AM_WRITE( hginga_80_w ) AM_RANGE(0xa0, 0xa3) AM_WRITE( ddenlovr_palette_base_w ) AM_RANGE(0xa4, 0xa7) AM_WRITE( ddenlovr_palette_mask_w ) @@ -2988,7 +2990,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( hgokou_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x03, 0x03) AM_READ(rongrong_gfxrom_r ) AM_RANGE(0x1c, 0x1c) AM_READ(SMH_NOP ) // ? ack on RTC int - AM_RANGE(0x20, 0x2f) AM_READ(msm6242_r ) // 6242RTC + AM_RANGE(0x20, 0x2f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC AM_RANGE(0x58, 0x58) AM_READ(unk_r ) // ? must be 78 on startup AM_RANGE(0x62, 0x62) AM_READ(hgokou_input_r ) AM_RANGE(0x80, 0x80) AM_READ(OKIM6295_status_0_r ) @@ -2999,7 +3001,7 @@ static ADDRESS_MAP_START( hgokou_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GL AM_RANGE(0x00, 0x01) AM_WRITE(hginga_blitter_w ) AM_RANGE(0x1c, 0x1c) AM_WRITE(mjmyster_rambank_w ) AM_RANGE(0x1e, 0x1e) AM_WRITE(hginga_rombank_w ) - AM_RANGE(0x20, 0x2f) AM_WRITE(msm6242_w ) // 6242RTC + AM_RANGE(0x20, 0x2f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC AM_RANGE(0x40, 0x43) AM_WRITE(ddenlovr_palette_base_w ) AM_RANGE(0x44, 0x47) AM_WRITE(ddenlovr_palette_mask_w ) AM_RANGE(0x48, 0x4b) AM_WRITE(ddenlovr_transparency_pen_w ) @@ -3135,7 +3137,7 @@ static ADDRESS_MAP_START( mjmywrld_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_G AM_RANGE(0x23, 0x23) AM_READ( mjmyster_keyb_r ) AM_RANGE(0x40, 0x40) AM_READ( OKIM6295_status_0_r ) AM_RANGE(0x44, 0x44) AM_READ( AY8910_read_port_0_r ) - AM_RANGE(0x60, 0x6f) AM_READ( msm6242_r ) // 6242RTC + AM_RANGE(0x60, 0x6f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC AM_RANGE(0x98, 0x98) AM_READ( unk_r ) // ? must be 78 on startup AM_RANGE(0xc0, 0xc0) AM_READ( hanakanz_rand_r ) AM_RANGE(0xe0, 0xe0) AM_READ( mjmyster_dsw_r ) @@ -3152,7 +3154,7 @@ static ADDRESS_MAP_START( mjmywrld_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_ AM_RANGE(0x43, 0x43) AM_WRITE( YM2413_data_port_0_w ) AM_RANGE(0x46, 0x46) AM_WRITE( AY8910_write_port_0_w ) AM_RANGE(0x48, 0x48) AM_WRITE( AY8910_control_port_0_w ) - AM_RANGE(0x60, 0x6f) AM_WRITE( msm6242_w ) // 6242RTC + AM_RANGE(0x60, 0x6f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC AM_RANGE(0x80, 0x83) AM_WRITE( ddenlovr_palette_base_w ) AM_RANGE(0x84, 0x87) AM_WRITE( ddenlovr_palette_mask_w ) AM_RANGE(0x88, 0x8b) AM_WRITE( ddenlovr_transparency_pen_w ) @@ -3221,7 +3223,7 @@ static ADDRESS_MAP_START( akamaru_readmem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0xe0010c, 0xe0010d) AM_READ(akamaru_e0010d_r ) AM_RANGE(0xe00200, 0xe00201) AM_READ(akamaru_dsw_r ) // DSW AM_RANGE(0xe00204, 0xe00205) AM_READ(akamaru_blitter_r ) // Blitter Busy & IRQ - AM_RANGE(0xe00500, 0xe0051f) AM_READ(msm6242_lsb_r ) // 6242RTC + AM_RANGE(0xe00500, 0xe0051f) AM_DEVREAD8(MSM6242, "rtc", msm6242_r, 0x00ff) // 6242RTC AM_RANGE(0xe00604, 0xe00605) AM_READ(AY8910_read_port_0_lsb_r ) AM_RANGE(0xe00700, 0xe00701) AM_READ(OKIM6295_status_0_lsb_r ) // Sound AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM ) // RAM @@ -3247,7 +3249,7 @@ static ADDRESS_MAP_START( akamaru_writemem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w ) // AM_RANGE(0xe00400, 0xe00401) AM_WRITE(YM2413_register_port_0_lsb_w ) AM_RANGE(0xe00402, 0xe00403) AM_WRITE(YM2413_data_port_0_lsb_w ) - AM_RANGE(0xe00500, 0xe0051f) AM_WRITE(msm6242_lsb_w ) // 6242RTC + AM_RANGE(0xe00500, 0xe0051f) AM_DEVWRITE8(MSM6242, "rtc", msm6242_w, 0x00ff) // 6242RTC AM_RANGE(0xe00600, 0xe00601) AM_WRITE(AY8910_control_port_0_lsb_w ) AM_RANGE(0xe00602, 0xe00603) AM_WRITE(AY8910_write_port_0_lsb_w ) AM_RANGE(0xe00700, 0xe00701) AM_WRITE(OKIM6295_data_0_lsb_w ) @@ -3325,7 +3327,7 @@ static ADDRESS_MAP_START( mjflove_readport, ADDRESS_SPACE_IO, 8 ) // 16 bit I/O AM_RANGE(0x0082, 0x0082) AM_READ( mjflove_blitter_r ) AM_RANGE(0x00da, 0x00da) AM_READ( mjflove_protection_r ) AM_MIRROR(0xff00) AM_RANGE(0x0100, 0x0100) AM_READ( input_port_11_r ) - AM_RANGE(0x0280, 0x028f) AM_READ( msm6242_r ) // 6242RTC + AM_RANGE(0x0280, 0x028f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC AM_RANGE(0x0380, 0x0380) AM_READ( OKIM6295_status_0_r ) ADDRESS_MAP_END @@ -3346,7 +3348,7 @@ static ADDRESS_MAP_START( mjflove_writeport, ADDRESS_SPACE_IO, 8 ) // 16 bit I/O AM_RANGE(0x0184, 0x0184) AM_WRITE( mjflove_coincounter_w ) AM_RANGE(0x0200, 0x0200) AM_WRITE( YM2413_register_port_0_w ) AM_RANGE(0x0201, 0x0201) AM_WRITE( YM2413_data_port_0_w ) - AM_RANGE(0x0280, 0x028f) AM_WRITE( msm6242_w ) // 6242RTC + AM_RANGE(0x0280, 0x028f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC AM_RANGE(0x0300, 0x0300) AM_WRITE( AY8910_control_port_0_w ) AM_RANGE(0x0301, 0x0301) AM_WRITE( AY8910_write_port_0_w ) AM_RANGE(0x0380, 0x0380) AM_WRITE( OKIM6295_data_0_w ) @@ -6534,6 +6536,9 @@ static MACHINE_DRIVER_START( ddenlovr ) MDRV_SOUND_ADD(OKIM6295, 1022720) MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + + /* devices */ + MDRV_DEVICE_ADD("rtc", MSM6242) MACHINE_DRIVER_END static MACHINE_DRIVER_START( ddenlvrj ) @@ -6648,6 +6653,9 @@ static MACHINE_DRIVER_START( quizchq ) MDRV_SOUND_ADD(OKIM6295, 1022720) MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + + /* devices */ + MDRV_DEVICE_ADD("rtc", MSM6242) MACHINE_DRIVER_END static MACHINE_DRIVER_START( rongrong ) @@ -6726,6 +6734,9 @@ static MACHINE_DRIVER_START( mmpanic ) MDRV_SOUND_ADD(OKIM6295, 1022720) MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + + /* devices */ + MDRV_DEVICE_ADD("rtc", MSM6242) MACHINE_DRIVER_END @@ -6787,6 +6798,9 @@ static MACHINE_DRIVER_START( hanakanz ) MDRV_SOUND_ADD(OKIM6295, 1022720) MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + + /* devices */ + MDRV_DEVICE_ADD("rtc", MSM6242) MACHINE_DRIVER_END static MACHINE_DRIVER_START( hkagerou ) diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c index 20035ebe984..5f2b5048ecf 100644 --- a/src/mame/drivers/dynax.c +++ b/src/mame/drivers/dynax.c @@ -345,8 +345,11 @@ static WRITE8_HANDLER( yarunara_palette_w ) break; case 0x1c: // RTC - msm6242_w(machine,offset,data); - return; + { + const device_config *rtc = device_list_find_by_tag(machine->config->devicelist, MSM6242, "rtc"); + msm6242_w(rtc, offset, data); + } + return; default: popmessage("palette_w with bank = %02x",hnoridur_bank); @@ -1121,7 +1124,7 @@ static ADDRESS_MAP_START( htengoku_io_map, ADDRESS_SPACE_IO, 8 ) AM_RANGE( 0x44, 0x44 ) AM_WRITE ( AY8910_write_port_0_w ) // AM_RANGE( 0x46, 0x46 ) AM_WRITE ( YM2413_register_port_0_w ) // YM2413 AM_RANGE( 0x47, 0x47 ) AM_WRITE ( YM2413_data_port_0_w ) // - AM_RANGE( 0x80, 0x8f ) AM_READWRITE( msm6242_r, msm6242_w ) // 6242RTC + AM_RANGE( 0x80, 0x8f ) AM_DEVREADWRITE(MSM6242, "rtc", msm6242_r, msm6242_w) // 6242RTC AM_RANGE( 0xa0, 0xa3 ) AM_WRITE ( ddenlovr_palette_base_w ) // ddenlovr mixer chip AM_RANGE( 0xa4, 0xa7 ) AM_WRITE ( ddenlovr_palette_mask_w ) AM_RANGE( 0xa8, 0xab ) AM_WRITE ( ddenlovr_transparency_pen_w ) @@ -1327,7 +1330,8 @@ static READ8_HANDLER( tenkai_8000_r ) } else if ( (rombank == 0x10) && (offset < 0x10) ) { - return msm6242_r(machine,offset); + const device_config *rtc = device_list_find_by_tag(machine->config->devicelist, MSM6242, "rtc"); + return msm6242_r(rtc, offset); } else if (rombank == 0x12) { @@ -1342,7 +1346,8 @@ static WRITE8_HANDLER( tenkai_8000_w ) { if ( (rombank == 0x10) && (offset < 0x10) ) { - msm6242_w(machine,offset,data); + const device_config *rtc = device_list_find_by_tag(machine->config->devicelist, MSM6242, "rtc"); + msm6242_w(rtc, offset, data); return; } else if (rombank == 0x12) @@ -4094,6 +4099,9 @@ static MACHINE_DRIVER_START( htengoku ) MDRV_SOUND_ADD(YM2413, 3579545) MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + + /* devices */ + MDRV_DEVICE_ADD("rtc", MSM6242) MACHINE_DRIVER_END diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c index 38d9ed965fa..bf0934046b2 100644 --- a/src/mame/drivers/royalmah.c +++ b/src/mame/drivers/royalmah.c @@ -541,7 +541,7 @@ static ADDRESS_MAP_START( janptr96_iomap, ADDRESS_SPACE_IO, 8 ) AM_RANGE( 0x1c, 0x1c ) AM_READ( janptr96_dsw_r ) AM_RANGE( 0x20, 0x20 ) AM_READWRITE( janptr96_unknown_r, janptr96_rambank_w ) AM_RANGE( 0x50, 0x50 ) AM_WRITE( mjderngr_palbank_w ) - AM_RANGE( 0x60, 0x6f ) AM_READWRITE( msm6242_r, msm6242_w ) + AM_RANGE( 0x60, 0x6f ) AM_DEVREADWRITE(MSM6242, "rtc", msm6242_r, msm6242_w) AM_RANGE( 0x81, 0x81 ) AM_READ( AY8910_read_port_0_r ) AM_RANGE( 0x82, 0x82 ) AM_WRITE( AY8910_write_port_0_w ) AM_RANGE( 0x83, 0x83 ) AM_WRITE( AY8910_control_port_0_w ) @@ -753,7 +753,7 @@ static ADDRESS_MAP_START( mjtensin_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE( 0x6fc3, 0x6fc3 ) AM_WRITE( AY8910_control_port_0_w ) AM_RANGE( 0x6fd0, 0x6fd0 ) AM_WRITE( janptr96_coin_counter_w ) AM_RANGE( 0x6fd1, 0x6fd1 ) AM_READWRITE( input_port_10_r, input_port_select_w ) - AM_RANGE( 0x6fe0, 0x6fef ) AM_READWRITE( msm6242_r, msm6242_w ) + AM_RANGE( 0x6fe0, 0x6fef ) AM_DEVREADWRITE(MSM6242, "rtc", msm6242_r, msm6242_w) AM_RANGE( 0x6ff0, 0x6ff0 ) AM_READWRITE( janptr96_dsw_r, janptr96_dswsel_w ) AM_RANGE( 0x6ff1, 0x6ff1 ) AM_WRITE( mjderngr_palbank_w ) AM_RANGE( 0x6ff3, 0x6ff3 ) AM_WRITE( mjtensin_6ff3_w ) @@ -828,7 +828,7 @@ static ADDRESS_MAP_START( cafetime_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE( 0x7fe2, 0x7fe2 ) AM_WRITE( mjderngr_palbank_w ) AM_RANGE( 0x7fe3, 0x7fe3 ) AM_WRITE( cafetime_7fe3_w ) AM_RANGE( 0x7fe4, 0x7fe4 ) AM_READ( cafetime_7fe4_r ) - AM_RANGE( 0x7ff0, 0x7fff ) AM_READWRITE( msm6242_r, msm6242_w ) + AM_RANGE( 0x7ff0, 0x7fff ) AM_DEVREADWRITE(MSM6242, "rtc", msm6242_r, msm6242_w) AM_RANGE( 0x8000, 0xffff ) AM_READ( SMH_BANK1 ) AM_RANGE( 0x8000, 0xffff ) AM_WRITE( SMH_RAM ) AM_BASE(&videoram) ADDRESS_MAP_END @@ -3421,6 +3421,9 @@ static MACHINE_DRIVER_START( janptr96 ) MDRV_SCREEN_MODIFY("main") MDRV_SCREEN_VISIBLE_AREA(0, 255, 9, 255-8) + + /* devices */ + MDRV_DEVICE_ADD("rtc", MSM6242) MACHINE_DRIVER_END @@ -3466,6 +3469,9 @@ static MACHINE_DRIVER_START( mjtensin ) MDRV_SCREEN_MODIFY("main") MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8) + + /* devices */ + MDRV_DEVICE_ADD("rtc", MSM6242) MACHINE_DRIVER_END static MACHINE_DRIVER_START( cafetime ) @@ -3477,6 +3483,9 @@ static MACHINE_DRIVER_START( cafetime ) MDRV_SCREEN_MODIFY("main") MDRV_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8) + + /* devices */ + MDRV_DEVICE_ADD("rtc", MSM6242) MACHINE_DRIVER_END /*************************************************************************** diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c index 47903117692..66a09aa0f29 100644 --- a/src/mame/drivers/seta.c +++ b/src/mame/drivers/seta.c @@ -3146,7 +3146,7 @@ static ADDRESS_MAP_START( inttoote_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x700000, 0x700101) AM_READWRITE(inttoote_700000_r,SMH_RAM) AM_BASE(&inttoote_700000) - AM_RANGE(0x800000, 0x80001f) AM_READWRITE(msm6242_lsb_r,msm6242_lsb_w) // 6242RTC + AM_RANGE(0x800000, 0x80001f) AM_DEVREADWRITE8(MSM6242, "rtc", msm6242_r, msm6242_w, 0x00ff) // 6242RTC AM_RANGE(0x900000, 0x903fff) AM_READWRITE( seta_sound_word_r, seta_sound_word_w ) // Sound @@ -8156,6 +8156,9 @@ static MACHINE_DRIVER_START( inttoote ) MDRV_SOUND_CONFIG(seta_sound_intf) MDRV_SOUND_ROUTE(0, "left", 1.0) MDRV_SOUND_ROUTE(1, "right", 1.0) + + /* devices */ + MDRV_DEVICE_ADD("rtc", MSM6242) MACHINE_DRIVER_END |