src/mame/drivers/ddenlovr.c
| r2512 | r2513 | |
| 1577 | 1577 | AM_RANGE(0x300270, 0x300271) AM_READ(unk16_r ) // ? must be 78 on startup (not necessary in ddlover) |
| 1578 | 1578 | AM_RANGE(0x300286, 0x300287) AM_READ(ddenlovr_gfxrom_r ) // Video Chip |
| 1579 | 1579 | AM_RANGE(0x3002c0, 0x3002c1) AM_READ(OKIM6295_status_0_lsb_r ) // Sound |
| 1580 | | AM_RANGE(0x300340, 0x30035f) AM_READ(msm6242_lsb_r ) // 6242RTC |
| 1580 | AM_RANGE(0x300340, 0x30035f) AM_DEVREAD8(MSM6242, "rtc", msm6242_r, 0x00ff) // 6242RTC |
| 1581 | 1581 | AM_RANGE(0x300384, 0x300385) AM_READ(AY8910_read_port_0_lsb_r ) |
| 1582 | 1582 | AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM ) // RAM |
| 1583 | 1583 | ADDRESS_MAP_END |
| r2512 | r2513 | |
| 1599 | 1599 | AM_RANGE(0x300280, 0x300283) AM_WRITE(ddenlovr_blitter_w ) |
| 1600 | 1600 | AM_RANGE(0x300300, 0x300301) AM_WRITE(YM2413_register_port_0_lsb_w ) |
| 1601 | 1601 | AM_RANGE(0x300302, 0x300303) AM_WRITE(YM2413_data_port_0_lsb_w ) |
| 1602 | | AM_RANGE(0x300340, 0x30035f) AM_WRITE(msm6242_lsb_w ) // 6242RTC |
| 1602 | AM_RANGE(0x300340, 0x30035f) AM_DEVWRITE8(MSM6242, "rtc", msm6242_w, 0x00ff) // 6242RTC |
| 1603 | 1603 | AM_RANGE(0x3003ca, 0x3003cb) AM_WRITE(ddenlovr_blitter_irq_ack_w ) // Blitter irq acknowledge |
| 1604 | 1604 | AM_RANGE(0x300380, 0x300381) AM_WRITE(AY8910_control_port_0_lsb_w ) |
| 1605 | 1605 | AM_RANGE(0x300382, 0x300383) AM_WRITE(AY8910_write_port_0_lsb_w ) |
| r2512 | r2513 | |
| 1640 | 1640 | AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM ) // ROM |
| 1641 | 1641 | AM_RANGE(0x300070, 0x300071) AM_READ(unk16_r ) // ? must be 78 on startup (not necessary in ddlover) |
| 1642 | 1642 | AM_RANGE(0x300086, 0x300087) AM_READ(ddenlovr_gfxrom_r ) // Video Chip |
| 1643 | | AM_RANGE(0x300100, 0x30011f) AM_READ(msm6242_lsb_r ) // 6242RTC |
| 1643 | AM_RANGE(0x300100, 0x30011f) AM_DEVREAD8(MSM6242, "rtc", msm6242_r, 0x00ff) // 6242RTC |
| 1644 | 1644 | AM_RANGE(0x300180, 0x300181) AM_READ(input_port_0_word_r ) // P1 |
| 1645 | 1645 | AM_RANGE(0x300182, 0x300183) AM_READ(input_port_1_word_r ) // P2 |
| 1646 | 1646 | AM_RANGE(0x300184, 0x300185) AM_READ(ddenlvrj_blitter_r ) // Coins + ? |
| r2512 | r2513 | |
| 1663 | 1663 | AM_RANGE(0x300080, 0x300083) AM_WRITE(ddenlovr_blitter_w ) |
| 1664 | 1664 | AM_RANGE(0x3000c0, 0x3000c1) AM_WRITE(YM2413_register_port_0_lsb_w ) |
| 1665 | 1665 | AM_RANGE(0x3000c2, 0x3000c3) AM_WRITE(YM2413_data_port_0_lsb_w ) |
| 1666 | | AM_RANGE(0x300100, 0x30011f) AM_WRITE(msm6242_lsb_w ) // 6242RTC |
| 1666 | AM_RANGE(0x300100, 0x30011f) AM_DEVWRITE8(MSM6242, "rtc", msm6242_w, 0x00ff) // 6242RTC |
| 1667 | 1667 | AM_RANGE(0x300140, 0x300141) AM_WRITE(AY8910_control_port_0_lsb_w ) |
| 1668 | 1668 | AM_RANGE(0x300142, 0x300143) AM_WRITE(AY8910_write_port_0_lsb_w ) |
| 1669 | 1669 | AM_RANGE(0x300188, 0x300189) AM_WRITE(ddenlvrj_coincounter_w ) // Coin Counters |
| r2512 | r2513 | |
| 1683 | 1683 | AM_RANGE(0xe00102, 0xe00103) AM_READ(input_port_1_word_r ) // P2? |
| 1684 | 1684 | AM_RANGE(0xe00104, 0xe00105) AM_READ(ddenlovr_special_r ) // Coins + ? |
| 1685 | 1685 | AM_RANGE(0xe00200, 0xe00201) AM_READ(input_port_3_word_r ) // DSW |
| 1686 | | AM_RANGE(0xe00500, 0xe0051f) AM_READ(msm6242_lsb_r ) // 6242RTC |
| 1686 | AM_RANGE(0xe00500, 0xe0051f) AM_DEVREAD8(MSM6242, "rtc", msm6242_r, 0x00ff) // 6242RTC |
| 1687 | 1687 | AM_RANGE(0xe00604, 0xe00605) AM_READ(AY8910_read_port_0_lsb_r ) |
| 1688 | 1688 | AM_RANGE(0xe00700, 0xe00701) AM_READ(OKIM6295_status_0_lsb_r ) // Sound |
| 1689 | 1689 | AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM ) // RAM |
| r2512 | r2513 | |
| 1707 | 1707 | AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w ) // |
| 1708 | 1708 | AM_RANGE(0xe00400, 0xe00401) AM_WRITE(YM2413_register_port_0_lsb_w ) |
| 1709 | 1709 | AM_RANGE(0xe00402, 0xe00403) AM_WRITE(YM2413_data_port_0_lsb_w ) |
| 1710 | | AM_RANGE(0xe00500, 0xe0051f) AM_WRITE(msm6242_lsb_w ) // 6242RTC |
| 1710 | AM_RANGE(0xe00500, 0xe0051f) AM_DEVWRITE8(MSM6242, "rtc", msm6242_w, 0x00ff) // 6242RTC |
| 1711 | 1711 | // AM_RANGE(0xe00302, 0xe00303) AM_WRITE(SMH_NOP ) // ? |
| 1712 | 1712 | AM_RANGE(0xe00600, 0xe00601) AM_WRITE(AY8910_control_port_0_lsb_w ) |
| 1713 | 1713 | AM_RANGE(0xe00602, 0xe00603) AM_WRITE(AY8910_write_port_0_lsb_w ) |
| r2512 | r2513 | |
| 1768 | 1768 | AM_RANGE(0x200c02, 0x200c03) AM_READ(nettoqc_protection_r ) // |
| 1769 | 1769 | AM_RANGE(0x300070, 0x300071) AM_READ(unk16_r ) // ? must be 78 on startup (not necessary in ddlover) |
| 1770 | 1770 | AM_RANGE(0x300086, 0x300087) AM_READ(ddenlovr_gfxrom_r ) // Video Chip |
| 1771 | | AM_RANGE(0x300100, 0x30011f) AM_READ(msm6242_lsb_r ) // 6242RTC |
| 1771 | AM_RANGE(0x300100, 0x30011f) AM_DEVREAD8(MSM6242, "rtc", msm6242_r, 0x00ff) // 6242RTC |
| 1772 | 1772 | AM_RANGE(0x300180, 0x300181) AM_READ(input_port_0_word_r ) // |
| 1773 | 1773 | AM_RANGE(0x300182, 0x300183) AM_READ(input_port_1_word_r ) // |
| 1774 | 1774 | AM_RANGE(0x300184, 0x300185) AM_READ(nettoqc_special_r ) // Coins + ? |
| r2512 | r2513 | |
| 1792 | 1792 | AM_RANGE(0x300080, 0x300083) AM_WRITE(ddenlovr_blitter_w ) |
| 1793 | 1793 | AM_RANGE(0x3000c0, 0x3000c1) AM_WRITE(YM2413_register_port_0_lsb_w ) |
| 1794 | 1794 | AM_RANGE(0x3000c2, 0x3000c3) AM_WRITE(YM2413_data_port_0_lsb_w ) |
| 1795 | | AM_RANGE(0x300100, 0x30011f) AM_WRITE(msm6242_lsb_w ) // 6242RTC |
| 1795 | AM_RANGE(0x300100, 0x30011f) AM_DEVWRITE8(MSM6242, "rtc", msm6242_w, 0x00ff) // 6242RTC |
| 1796 | 1796 | AM_RANGE(0x300140, 0x300141) AM_WRITE(AY8910_control_port_0_lsb_w ) |
| 1797 | 1797 | AM_RANGE(0x300142, 0x300143) AM_WRITE(AY8910_write_port_0_lsb_w ) |
| 1798 | 1798 | AM_RANGE(0x300188, 0x300189) AM_WRITE(nettoqc_coincounter_w ) // Coin Counters |
| r2512 | r2513 | |
| 1853 | 1853 | AM_RANGE(0x22, 0x23) AM_READ(rongrong_input2_r ) |
| 1854 | 1854 | AM_RANGE(0x40, 0x40) AM_READ(OKIM6295_status_0_r ) |
| 1855 | 1855 | AM_RANGE(0x98, 0x98) AM_READ(unk_r ) // ? must be 78 on startup |
| 1856 | | AM_RANGE(0xa0, 0xaf) AM_READ(msm6242_r ) // 6242RTC |
| 1856 | AM_RANGE(0xa0, 0xaf) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC |
| 1857 | 1857 | ADDRESS_MAP_END |
| 1858 | 1858 | |
| 1859 | 1859 | static ADDRESS_MAP_START( quizchq_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) |
| r2512 | r2513 | |
| 1871 | 1871 | AM_RANGE(0x94, 0x94) AM_WRITE(ddenlovr_bgcolor_w ) |
| 1872 | 1872 | AM_RANGE(0x95, 0x95) AM_WRITE(ddenlovr_priority_w ) |
| 1873 | 1873 | AM_RANGE(0x96, 0x96) AM_WRITE(ddenlovr_layer_enable_w ) |
| 1874 | | AM_RANGE(0xa0, 0xaf) AM_WRITE(msm6242_w ) // 6242RTC |
| 1874 | AM_RANGE(0xa0, 0xaf) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC |
| 1875 | 1875 | AM_RANGE(0xc0, 0xc0) AM_WRITE(quizchq_oki_bank_w ) |
| 1876 | 1876 | AM_RANGE(0xc2, 0xc2) AM_WRITE(SMH_NOP ) // enables palette RAM at 8000 |
| 1877 | 1877 | ADDRESS_MAP_END |
| r2512 | r2513 | |
| 1895 | 1895 | AM_RANGE(0x03, 0x03) AM_READ(rongrong_gfxrom_r ) |
| 1896 | 1896 | AM_RANGE(0x1b, 0x1b) AM_READ(rongrong_blitter_busy_r ) |
| 1897 | 1897 | AM_RANGE(0x1c, 0x1c) AM_READ(rongrong_input_r ) |
| 1898 | | AM_RANGE(0x20, 0x2f) AM_READ(msm6242_r ) // 6242RTC |
| 1898 | AM_RANGE(0x20, 0x2f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC |
| 1899 | 1899 | AM_RANGE(0x40, 0x40) AM_READ(OKIM6295_status_0_r ) |
| 1900 | 1900 | AM_RANGE(0x98, 0x98) AM_READ(unk_r ) // ? must be 78 on startup |
| 1901 | 1901 | AM_RANGE(0xa2, 0xa3) AM_READ(rongrong_input2_r ) |
| r2512 | r2513 | |
| 1905 | 1905 | AM_RANGE(0x00, 0x01) AM_WRITE(rongrong_blitter_w ) |
| 1906 | 1906 | AM_RANGE(0x1b, 0x1b) AM_WRITE(rongrong_blitter_busy_w ) |
| 1907 | 1907 | AM_RANGE(0x1e, 0x1e) AM_WRITE(rongrong_select_w ) |
| 1908 | | AM_RANGE(0x20, 0x2f) AM_WRITE(msm6242_w ) // 6242RTC |
| 1908 | AM_RANGE(0x20, 0x2f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC |
| 1909 | 1909 | AM_RANGE(0x40, 0x40) AM_WRITE(OKIM6295_data_0_w ) |
| 1910 | 1910 | AM_RANGE(0x60, 0x60) AM_WRITE(YM2413_register_port_0_w ) |
| 1911 | 1911 | AM_RANGE(0x61, 0x61) AM_WRITE(YM2413_data_port_0_w ) |
| r2512 | r2513 | |
| 2009 | 2009 | AM_RANGE(0x8000, 0x81ff) AM_WRITE(rongrong_palette_w ) |
| 2010 | 2010 | ADDRESS_MAP_END |
| 2011 | 2011 | |
| 2012 | | static ADDRESS_MAP_START( mmpanic_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 2013 | | AM_RANGE(0x00, 0x0f) AM_READ(msm6242_r ) // 6242RTC |
| 2012 | static ADDRESS_MAP_START( mmpanic_readport, ADDRESS_SPACE_IO, 8 ) |
| 2013 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 2014 | AM_RANGE(0x00, 0x0f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC |
| 2014 | 2015 | AM_RANGE(0x38, 0x38) AM_READ(unk_r ) // ? must be 78 on startup |
| 2015 | 2016 | AM_RANGE(0x58, 0x58) AM_READ(unk_r ) // ? must be 78 on startup |
| 2016 | 2017 | AM_RANGE(0x63, 0x63) AM_READ(rongrong_gfxrom_r ) // Video Chip |
| r2512 | r2513 | |
| 2023 | 2024 | AM_RANGE(0x9c, 0x9c) AM_READ(input_port_4_r ) // DSW 1&2 high bits |
| 2024 | 2025 | ADDRESS_MAP_END |
| 2025 | 2026 | |
| 2026 | | static ADDRESS_MAP_START( mmpanic_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 2027 | | AM_RANGE(0x00, 0x0f) AM_WRITE(msm6242_w ) // 6242RTC |
| 2027 | static ADDRESS_MAP_START( mmpanic_writeport, ADDRESS_SPACE_IO, 8 ) |
| 2028 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 2029 | AM_RANGE(0x00, 0x0f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC |
| 2028 | 2030 | // Layers 0-3: |
| 2029 | 2031 | AM_RANGE(0x20, 0x23) AM_WRITE(ddenlovr_palette_base_w ) |
| 2030 | 2032 | AM_RANGE(0x24, 0x27) AM_WRITE(ddenlovr_palette_mask_w ) |
| r2512 | r2513 | |
| 2186 | 2188 | AM_RANGE(0x04, 0x04) AM_READ( funkyfig_busy_r ) |
| 2187 | 2189 | AM_RANGE(0x1c, 0x1c) AM_READ( funkyfig_dsw_r ) |
| 2188 | 2190 | AM_RANGE(0x23, 0x23) AM_READ( rongrong_gfxrom_r ) // Video Chip |
| 2189 | | AM_RANGE(0x40, 0x4f) AM_READ( msm6242_r ) // 6242RTC |
| 2191 | AM_RANGE(0x40, 0x4f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC |
| 2190 | 2192 | AM_RANGE(0x78, 0x78) AM_READ( unk_r ) // ? must be 78 on startup |
| 2191 | 2193 | AM_RANGE(0x82, 0x82) AM_READ( funkyfig_coin_r ) |
| 2192 | 2194 | AM_RANGE(0x83, 0x83) AM_READ( funkyfig_key_r ) |
| r2512 | r2513 | |
| 2199 | 2201 | AM_RANGE(0x02, 0x02) AM_WRITE( mmpanic_soundlatch_w ) // |
| 2200 | 2202 | AM_RANGE(0x1e, 0x1e) AM_WRITE( funkyfig_rombank_w ) |
| 2201 | 2203 | AM_RANGE(0x20, 0x21) AM_WRITE( funkyfig_blitter_w ) |
| 2202 | | AM_RANGE(0x40, 0x4f) AM_WRITE( msm6242_w ) // 6242RTC |
| 2204 | AM_RANGE(0x40, 0x4f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC |
| 2203 | 2205 | |
| 2204 | 2206 | // Layers 0-3: |
| 2205 | 2207 | AM_RANGE(0x60, 0x63) AM_WRITE( ddenlovr_palette_base_w ) |
| r2512 | r2513 | |
| 2376 | 2378 | AM_RANGE(0x91, 0x92) AM_READ( hanakanz_keyb_r ) |
| 2377 | 2379 | AM_RANGE(0x96, 0x96) AM_READ( hanakanz_rand_r ) |
| 2378 | 2380 | AM_RANGE(0xc0, 0xc0) AM_READ( OKIM6295_status_0_r ) |
| 2379 | | AM_RANGE(0xe0, 0xef) AM_READ( msm6242_r ) // 6242RTC |
| 2381 | AM_RANGE(0xe0, 0xef) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC |
| 2380 | 2382 | ADDRESS_MAP_END |
| 2381 | 2383 | |
| 2382 | 2384 | static ADDRESS_MAP_START( hanakanz_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) |
| r2512 | r2513 | |
| 2391 | 2393 | AM_RANGE(0xa0, 0xa0) AM_WRITE( YM2413_register_port_0_w ) |
| 2392 | 2394 | AM_RANGE(0xa1, 0xa1) AM_WRITE( YM2413_data_port_0_w ) |
| 2393 | 2395 | AM_RANGE(0xc0, 0xc0) AM_WRITE( OKIM6295_data_0_w ) |
| 2394 | | AM_RANGE(0xe0, 0xef) AM_WRITE( msm6242_w ) // 6242RTC |
| 2396 | AM_RANGE(0xe0, 0xef) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC |
| 2395 | 2397 | ADDRESS_MAP_END |
| 2396 | 2398 | |
| 2397 | 2399 | |
| r2512 | r2513 | |
| 2403 | 2405 | AM_RANGE(0xb1, 0xb2) AM_READ( hanakanz_keyb_r ) |
| 2404 | 2406 | AM_RANGE(0xb6, 0xb6) AM_READ( hanakanz_rand_r ) |
| 2405 | 2407 | AM_RANGE(0xc0, 0xc0) AM_READ( OKIM6295_status_0_r ) |
| 2406 | | AM_RANGE(0xe0, 0xef) AM_READ( msm6242_r ) // 6242RTC |
| 2408 | AM_RANGE(0xe0, 0xef) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC |
| 2407 | 2409 | ADDRESS_MAP_END |
| 2408 | 2410 | |
| 2409 | 2411 | static ADDRESS_MAP_START( hkagerou_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) |
| r2512 | r2513 | |
| 2418 | 2420 | AM_RANGE(0xb3, 0xb3) AM_WRITE( hanakanz_coincounter_w ) |
| 2419 | 2421 | AM_RANGE(0xb4, 0xb4) AM_WRITE( hanakanz_keyb_w ) |
| 2420 | 2422 | AM_RANGE(0xc0, 0xc0) AM_WRITE( OKIM6295_data_0_w ) |
| 2421 | | AM_RANGE(0xe0, 0xef) AM_WRITE( msm6242_w ) // 6242RTC |
| 2423 | AM_RANGE(0xe0, 0xef) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC |
| 2422 | 2424 | ADDRESS_MAP_END |
| 2423 | 2425 | |
| 2424 | 2426 | |
| r2512 | r2513 | |
| 2443 | 2445 | AM_RANGE(0x94, 0x94) AM_READ( input_port_0_r ) |
| 2444 | 2446 | AM_RANGE(0x95, 0x96) AM_READ( hanakanz_keyb_r ) |
| 2445 | 2447 | AM_RANGE(0xc0, 0xc0) AM_READ( OKIM6295_status_0_r ) |
| 2446 | | AM_RANGE(0xe0, 0xef) AM_READ( msm6242_r ) // 6242RTC |
| 2448 | AM_RANGE(0xe0, 0xef) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC |
| 2447 | 2449 | ADDRESS_MAP_END |
| 2448 | 2450 | |
| 2449 | 2451 | static ADDRESS_MAP_START( mjreach1_writeport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) |
| r2512 | r2513 | |
| 2459 | 2461 | AM_RANGE(0xa0, 0xa0) AM_WRITE( YM2413_register_port_0_w ) |
| 2460 | 2462 | AM_RANGE(0xa1, 0xa1) AM_WRITE( YM2413_data_port_0_w ) |
| 2461 | 2463 | AM_RANGE(0xc0, 0xc0) AM_WRITE( OKIM6295_data_0_w ) |
| 2462 | | AM_RANGE(0xe0, 0xef) AM_WRITE( msm6242_w ) // 6242RTC |
| 2464 | AM_RANGE(0xe0, 0xef) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC |
| 2463 | 2465 | ADDRESS_MAP_END |
| 2464 | 2466 | |
| 2465 | 2467 | |
| r2512 | r2513 | |
| 2578 | 2580 | AM_RANGE(0x63, 0x63) AM_MIRROR(0xff00) AM_READ( input_port_14_r ) // DSW 4 |
| 2579 | 2581 | AM_RANGE(0x64, 0x64) AM_MIRROR(0xff00) AM_READ( input_port_15_r ) // DSW 1-4 high bits |
| 2580 | 2582 | AM_RANGE(0x80, 0x80) AM_MIRROR(0xff00) AM_READ( OKIM6295_status_0_r ) |
| 2581 | | AM_RANGE(0xc0, 0xcf) AM_MIRROR(0xff00) AM_READ( msm6242_r ) // 6242RTC |
| 2583 | AM_RANGE(0xc0, 0xcf) AM_MIRROR(0xff00) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC |
| 2582 | 2584 | ADDRESS_MAP_END |
| 2583 | 2585 | |
| 2584 | 2586 | static ADDRESS_MAP_START( mjchuuka_writeport, ADDRESS_SPACE_IO, 8 ) // 16 bit I/O |
| r2512 | r2513 | |
| 2588 | 2590 | AM_RANGE(0x40, 0x40) AM_MIRROR(0xff00) AM_WRITE( mjchuuka_coincounter_w ) |
| 2589 | 2591 | AM_RANGE(0x41, 0x41) AM_MIRROR(0xff00) AM_WRITE( hanakanz_keyb_w ) |
| 2590 | 2592 | AM_RANGE(0x80, 0x80) AM_MIRROR(0xff00) AM_WRITE( OKIM6295_data_0_w ) |
| 2591 | | AM_RANGE(0xc0, 0xcf) AM_MIRROR(0xff00) AM_WRITE( msm6242_w ) // 6242RTC |
| 2593 | AM_RANGE(0xc0, 0xcf) AM_MIRROR(0xff00) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC |
| 2592 | 2594 | AM_RANGE(0xa0, 0xa0) AM_MIRROR(0xff00) AM_WRITE( YM2413_register_port_0_w ) |
| 2593 | 2595 | AM_RANGE(0xa1, 0xa1) AM_MIRROR(0xff00) AM_WRITE( YM2413_data_port_0_w ) |
| 2594 | 2596 | AM_RANGE(0xe0, 0xe0) AM_MIRROR(0xff00) AM_WRITE( AY8910_control_port_0_w ) |
| r2512 | r2513 | |
| 2700 | 2702 | AM_RANGE(0x23, 0x23) AM_READ( mjmyster_keyb_r ) |
| 2701 | 2703 | AM_RANGE(0x40, 0x40) AM_READ( OKIM6295_status_0_r ) |
| 2702 | 2704 | AM_RANGE(0x44, 0x44) AM_READ( AY8910_read_port_0_r ) |
| 2703 | | AM_RANGE(0x60, 0x6f) AM_READ( msm6242_r ) // 6242RTC |
| 2705 | AM_RANGE(0x60, 0x6f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC |
| 2704 | 2706 | AM_RANGE(0x98, 0x98) AM_READ( unk_r ) // ? must be 78 on startup |
| 2705 | 2707 | AM_RANGE(0xc2, 0xc2) AM_READ( hanakanz_rand_r ) |
| 2706 | 2708 | AM_RANGE(0xc3, 0xc3) AM_READ( mjmyster_dsw_r ) |
| r2512 | r2513 | |
| 2717 | 2719 | AM_RANGE(0x43, 0x43) AM_WRITE( YM2413_data_port_0_w ) |
| 2718 | 2720 | AM_RANGE(0x46, 0x46) AM_WRITE( AY8910_write_port_0_w ) |
| 2719 | 2721 | AM_RANGE(0x48, 0x48) AM_WRITE( AY8910_control_port_0_w ) |
| 2720 | | AM_RANGE(0x60, 0x6f) AM_WRITE( msm6242_w ) // 6242RTC |
| 2722 | AM_RANGE(0x60, 0x6f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC |
| 2721 | 2723 | AM_RANGE(0x80, 0x83) AM_WRITE( ddenlovr_palette_base_w ) |
| 2722 | 2724 | AM_RANGE(0x84, 0x87) AM_WRITE( ddenlovr_palette_mask_w ) |
| 2723 | 2725 | AM_RANGE(0x88, 0x8b) AM_WRITE( ddenlovr_transparency_pen_w ) |
| r2512 | r2513 | |
| 2876 | 2878 | AM_RANGE(0x03, 0x03) AM_READ( rongrong_gfxrom_r ) |
| 2877 | 2879 | AM_RANGE(0x1c, 0x1c) AM_READ( SMH_NOP ) |
| 2878 | 2880 | AM_RANGE(0x24, 0x24) AM_READ( AY8910_read_port_0_r ) |
| 2879 | | AM_RANGE(0x60, 0x6f) AM_READ( msm6242_r ) // 6242RTC |
| 2881 | AM_RANGE(0x60, 0x6f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC |
| 2880 | 2882 | AM_RANGE(0x42, 0x42) AM_READ( hginga_coins_r ) |
| 2881 | 2883 | AM_RANGE(0x43, 0x43) AM_READ( hginga_input_r ) |
| 2882 | 2884 | AM_RANGE(0xb8, 0xb8) AM_READ( unk_r ) // ? must be 78 on startup |
| r2512 | r2513 | |
| 2892 | 2894 | AM_RANGE(0x28, 0x28) AM_WRITE( AY8910_control_port_0_w ) |
| 2893 | 2895 | AM_RANGE(0x40, 0x40) AM_WRITE( hginga_input_w ) |
| 2894 | 2896 | AM_RANGE(0x41, 0x41) AM_WRITE( hginga_coins_w ) |
| 2895 | | AM_RANGE(0x60, 0x6f) AM_WRITE( msm6242_w ) // 6242RTC |
| 2897 | AM_RANGE(0x60, 0x6f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC |
| 2896 | 2898 | AM_RANGE(0x80, 0x80) AM_WRITE( hginga_80_w ) |
| 2897 | 2899 | AM_RANGE(0xa0, 0xa3) AM_WRITE( ddenlovr_palette_base_w ) |
| 2898 | 2900 | AM_RANGE(0xa4, 0xa7) AM_WRITE( ddenlovr_palette_mask_w ) |
| r2512 | r2513 | |
| 2988 | 2990 | static ADDRESS_MAP_START( hgokou_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 2989 | 2991 | AM_RANGE(0x03, 0x03) AM_READ(rongrong_gfxrom_r ) |
| 2990 | 2992 | AM_RANGE(0x1c, 0x1c) AM_READ(SMH_NOP ) // ? ack on RTC int |
| 2991 | | AM_RANGE(0x20, 0x2f) AM_READ(msm6242_r ) // 6242RTC |
| 2993 | AM_RANGE(0x20, 0x2f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC |
| 2992 | 2994 | AM_RANGE(0x58, 0x58) AM_READ(unk_r ) // ? must be 78 on startup |
| 2993 | 2995 | AM_RANGE(0x62, 0x62) AM_READ(hgokou_input_r ) |
| 2994 | 2996 | AM_RANGE(0x80, 0x80) AM_READ(OKIM6295_status_0_r ) |
| r2512 | r2513 | |
| 2999 | 3001 | AM_RANGE(0x00, 0x01) AM_WRITE(hginga_blitter_w ) |
| 3000 | 3002 | AM_RANGE(0x1c, 0x1c) AM_WRITE(mjmyster_rambank_w ) |
| 3001 | 3003 | AM_RANGE(0x1e, 0x1e) AM_WRITE(hginga_rombank_w ) |
| 3002 | | AM_RANGE(0x20, 0x2f) AM_WRITE(msm6242_w ) // 6242RTC |
| 3004 | AM_RANGE(0x20, 0x2f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC |
| 3003 | 3005 | AM_RANGE(0x40, 0x43) AM_WRITE(ddenlovr_palette_base_w ) |
| 3004 | 3006 | AM_RANGE(0x44, 0x47) AM_WRITE(ddenlovr_palette_mask_w ) |
| 3005 | 3007 | AM_RANGE(0x48, 0x4b) AM_WRITE(ddenlovr_transparency_pen_w ) |
| r2512 | r2513 | |
| 3135 | 3137 | AM_RANGE(0x23, 0x23) AM_READ( mjmyster_keyb_r ) |
| 3136 | 3138 | AM_RANGE(0x40, 0x40) AM_READ( OKIM6295_status_0_r ) |
| 3137 | 3139 | AM_RANGE(0x44, 0x44) AM_READ( AY8910_read_port_0_r ) |
| 3138 | | AM_RANGE(0x60, 0x6f) AM_READ( msm6242_r ) // 6242RTC |
| 3140 | AM_RANGE(0x60, 0x6f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC |
| 3139 | 3141 | AM_RANGE(0x98, 0x98) AM_READ( unk_r ) // ? must be 78 on startup |
| 3140 | 3142 | AM_RANGE(0xc0, 0xc0) AM_READ( hanakanz_rand_r ) |
| 3141 | 3143 | AM_RANGE(0xe0, 0xe0) AM_READ( mjmyster_dsw_r ) |
| r2512 | r2513 | |
| 3152 | 3154 | AM_RANGE(0x43, 0x43) AM_WRITE( YM2413_data_port_0_w ) |
| 3153 | 3155 | AM_RANGE(0x46, 0x46) AM_WRITE( AY8910_write_port_0_w ) |
| 3154 | 3156 | AM_RANGE(0x48, 0x48) AM_WRITE( AY8910_control_port_0_w ) |
| 3155 | | AM_RANGE(0x60, 0x6f) AM_WRITE( msm6242_w ) // 6242RTC |
| 3157 | AM_RANGE(0x60, 0x6f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC |
| 3156 | 3158 | AM_RANGE(0x80, 0x83) AM_WRITE( ddenlovr_palette_base_w ) |
| 3157 | 3159 | AM_RANGE(0x84, 0x87) AM_WRITE( ddenlovr_palette_mask_w ) |
| 3158 | 3160 | AM_RANGE(0x88, 0x8b) AM_WRITE( ddenlovr_transparency_pen_w ) |
| r2512 | r2513 | |
| 3221 | 3223 | AM_RANGE(0xe0010c, 0xe0010d) AM_READ(akamaru_e0010d_r ) |
| 3222 | 3224 | AM_RANGE(0xe00200, 0xe00201) AM_READ(akamaru_dsw_r ) // DSW |
| 3223 | 3225 | AM_RANGE(0xe00204, 0xe00205) AM_READ(akamaru_blitter_r ) // Blitter Busy & IRQ |
| 3224 | | AM_RANGE(0xe00500, 0xe0051f) AM_READ(msm6242_lsb_r ) // 6242RTC |
| 3226 | AM_RANGE(0xe00500, 0xe0051f) AM_DEVREAD8(MSM6242, "rtc", msm6242_r, 0x00ff) // 6242RTC |
| 3225 | 3227 | AM_RANGE(0xe00604, 0xe00605) AM_READ(AY8910_read_port_0_lsb_r ) |
| 3226 | 3228 | AM_RANGE(0xe00700, 0xe00701) AM_READ(OKIM6295_status_0_lsb_r ) // Sound |
| 3227 | 3229 | AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM ) // RAM |
| r2512 | r2513 | |
| 3247 | 3249 | AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w ) // |
| 3248 | 3250 | AM_RANGE(0xe00400, 0xe00401) AM_WRITE(YM2413_register_port_0_lsb_w ) |
| 3249 | 3251 | AM_RANGE(0xe00402, 0xe00403) AM_WRITE(YM2413_data_port_0_lsb_w ) |
| 3250 | | AM_RANGE(0xe00500, 0xe0051f) AM_WRITE(msm6242_lsb_w ) // 6242RTC |
| 3252 | AM_RANGE(0xe00500, 0xe0051f) AM_DEVWRITE8(MSM6242, "rtc", msm6242_w, 0x00ff) // 6242RTC |
| 3251 | 3253 | AM_RANGE(0xe00600, 0xe00601) AM_WRITE(AY8910_control_port_0_lsb_w ) |
| 3252 | 3254 | AM_RANGE(0xe00602, 0xe00603) AM_WRITE(AY8910_write_port_0_lsb_w ) |
| 3253 | 3255 | AM_RANGE(0xe00700, 0xe00701) AM_WRITE(OKIM6295_data_0_lsb_w ) |
| r2512 | r2513 | |
| 3325 | 3327 | AM_RANGE(0x0082, 0x0082) AM_READ( mjflove_blitter_r ) |
| 3326 | 3328 | AM_RANGE(0x00da, 0x00da) AM_READ( mjflove_protection_r ) AM_MIRROR(0xff00) |
| 3327 | 3329 | AM_RANGE(0x0100, 0x0100) AM_READ( input_port_11_r ) |
| 3328 | | AM_RANGE(0x0280, 0x028f) AM_READ( msm6242_r ) // 6242RTC |
| 3330 | AM_RANGE(0x0280, 0x028f) AM_DEVREAD(MSM6242, "rtc", msm6242_r) // 6242RTC |
| 3329 | 3331 | AM_RANGE(0x0380, 0x0380) AM_READ( OKIM6295_status_0_r ) |
| 3330 | 3332 | ADDRESS_MAP_END |
| 3331 | 3333 | |
| r2512 | r2513 | |
| 3346 | 3348 | AM_RANGE(0x0184, 0x0184) AM_WRITE( mjflove_coincounter_w ) |
| 3347 | 3349 | AM_RANGE(0x0200, 0x0200) AM_WRITE( YM2413_register_port_0_w ) |
| 3348 | 3350 | AM_RANGE(0x0201, 0x0201) AM_WRITE( YM2413_data_port_0_w ) |
| 3349 | | AM_RANGE(0x0280, 0x028f) AM_WRITE( msm6242_w ) // 6242RTC |
| 3351 | AM_RANGE(0x0280, 0x028f) AM_DEVWRITE(MSM6242, "rtc", msm6242_w) // 6242RTC |
| 3350 | 3352 | AM_RANGE(0x0300, 0x0300) AM_WRITE( AY8910_control_port_0_w ) |
| 3351 | 3353 | AM_RANGE(0x0301, 0x0301) AM_WRITE( AY8910_write_port_0_w ) |
| 3352 | 3354 | AM_RANGE(0x0380, 0x0380) AM_WRITE( OKIM6295_data_0_w ) |
| r2512 | r2513 | |
| 6534 | 6536 | MDRV_SOUND_ADD(OKIM6295, 1022720) |
| 6535 | 6537 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified |
| 6536 | 6538 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 6539 | |
| 6540 | /* devices */ |
| 6541 | MDRV_DEVICE_ADD("rtc", MSM6242) |
| 6537 | 6542 | MACHINE_DRIVER_END |
| 6538 | 6543 | |
| 6539 | 6544 | static MACHINE_DRIVER_START( ddenlvrj ) |
| r2512 | r2513 | |
| 6648 | 6653 | MDRV_SOUND_ADD(OKIM6295, 1022720) |
| 6649 | 6654 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified |
| 6650 | 6655 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 6656 | |
| 6657 | /* devices */ |
| 6658 | MDRV_DEVICE_ADD("rtc", MSM6242) |
| 6651 | 6659 | MACHINE_DRIVER_END |
| 6652 | 6660 | |
| 6653 | 6661 | static MACHINE_DRIVER_START( rongrong ) |
| r2512 | r2513 | |
| 6726 | 6734 | MDRV_SOUND_ADD(OKIM6295, 1022720) |
| 6727 | 6735 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified |
| 6728 | 6736 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 6737 | |
| 6738 | /* devices */ |
| 6739 | MDRV_DEVICE_ADD("rtc", MSM6242) |
| 6729 | 6740 | MACHINE_DRIVER_END |
| 6730 | 6741 | |
| 6731 | 6742 | |
| r2512 | r2513 | |
| 6787 | 6798 | MDRV_SOUND_ADD(OKIM6295, 1022720) |
| 6788 | 6799 | MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified |
| 6789 | 6800 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 6801 | |
| 6802 | /* devices */ |
| 6803 | MDRV_DEVICE_ADD("rtc", MSM6242) |
| 6790 | 6804 | MACHINE_DRIVER_END |
| 6791 | 6805 | |
| 6792 | 6806 | static MACHINE_DRIVER_START( hkagerou ) |
src/emu/machine/msm6242.c
| r2512 | r2513 | |
| 7 | 7 | #include "driver.h" |
| 8 | 8 | #include "machine/msm6242.h" |
| 9 | 9 | |
| 10 | | static UINT8 msm6264_reg[3] = { 0, 0, 0 }; |
| 11 | | static mame_system_time msm6264_hold_time = { 0 }; |
| 12 | 10 | |
| 13 | 11 | enum |
| 14 | 12 | { |
| 15 | | MSM6264_REG_S1 = 0, |
| 16 | | MSM6264_REG_S10, |
| 17 | | MSM6264_REG_MI1, |
| 18 | | MSM6264_REG_MI10, |
| 19 | | MSM6264_REG_H1, |
| 20 | | MSM6264_REG_H10, |
| 21 | | MSM6264_REG_D1, |
| 22 | | MSM6264_REG_D10, |
| 23 | | MSM6264_REG_MO1, |
| 24 | | MSM6264_REG_MO10, |
| 25 | | MSM6264_REG_Y1, |
| 26 | | MSM6264_REG_Y10, |
| 27 | | MSM6264_REG_W, |
| 28 | | MSM6264_REG_CD, |
| 29 | | MSM6264_REG_CE, |
| 30 | | MSM6264_REG_CF |
| 13 | MSM6242_REG_S1 = 0, |
| 14 | MSM6242_REG_S10, |
| 15 | MSM6242_REG_MI1, |
| 16 | MSM6242_REG_MI10, |
| 17 | MSM6242_REG_H1, |
| 18 | MSM6242_REG_H10, |
| 19 | MSM6242_REG_D1, |
| 20 | MSM6242_REG_D10, |
| 21 | MSM6242_REG_MO1, |
| 22 | MSM6242_REG_MO10, |
| 23 | MSM6242_REG_Y1, |
| 24 | MSM6242_REG_Y10, |
| 25 | MSM6242_REG_W, |
| 26 | MSM6242_REG_CD, |
| 27 | MSM6242_REG_CE, |
| 28 | MSM6242_REG_CF |
| 31 | 29 | }; |
| 32 | 30 | |
| 33 | | READ8_HANDLER( msm6242_r ) |
| 31 | |
| 32 | typedef struct _msm6242_t msm6242_t; |
| 33 | struct _msm6242_t |
| 34 | 34 | { |
| 35 | UINT8 reg[3]; |
| 36 | mame_system_time hold_time; |
| 37 | }; |
| 38 | |
| 39 | |
| 40 | /* makes sure that the passed in device is the right type */ |
| 41 | INLINE msm6242_t *get_safe_token(const device_config *device) |
| 42 | { |
| 43 | assert(device != NULL); |
| 44 | assert(device->token != NULL); |
| 45 | assert(device->type == DEVICE_GET_INFO_NAME(msm6242)); |
| 46 | |
| 47 | return (msm6242_t *)device->token; |
| 48 | } |
| 49 | |
| 50 | |
| 51 | READ8_DEVICE_HANDLER( msm6242_r ) |
| 52 | { |
| 35 | 53 | mame_system_time curtime, *systime = &curtime; |
| 54 | msm6242_t *msm6242 = get_safe_token(device); |
| 36 | 55 | |
| 37 | | if ( msm6264_reg[0] & 1 ) /* if HOLD is set, use the hold time */ |
| 56 | if (msm6242->reg[0] & 1) /* if HOLD is set, use the hold time */ |
| 38 | 57 | { |
| 39 | | systime = &msm6264_hold_time; |
| 58 | systime = &msm6242->hold_time; |
| 40 | 59 | } |
| 41 | 60 | else /* otherwise, use the current time */ |
| 42 | 61 | { |
| 43 | | mame_get_current_datetime(machine, &curtime); |
| 62 | mame_get_current_datetime(device->machine, &curtime); |
| 44 | 63 | } |
| 45 | 64 | |
| 46 | 65 | switch(offset) |
| 47 | 66 | { |
| 48 | | case MSM6264_REG_S1: return systime->local_time.second % 10; |
| 49 | | case MSM6264_REG_S10: return systime->local_time.second / 10; |
| 50 | | case MSM6264_REG_MI1: return systime->local_time.minute % 10; |
| 51 | | case MSM6264_REG_MI10: return systime->local_time.minute / 10; |
| 52 | | case MSM6264_REG_H1: |
| 53 | | case MSM6264_REG_H10: |
| 67 | case MSM6242_REG_S1: return systime->local_time.second % 10; |
| 68 | case MSM6242_REG_S10: return systime->local_time.second / 10; |
| 69 | case MSM6242_REG_MI1: return systime->local_time.minute % 10; |
| 70 | case MSM6242_REG_MI10: return systime->local_time.minute / 10; |
| 71 | case MSM6242_REG_H1: |
| 72 | case MSM6242_REG_H10: |
| 54 | 73 | { |
| 55 | 74 | int hour = systime->local_time.hour; |
| 56 | 75 | |
| 57 | 76 | /* check for 12/24 hour mode */ |
| 58 | | if ( (msm6264_reg[2] & 0x04) == 0 ) /* 12 hour mode? */ |
| 77 | if ((msm6242->reg[2] & 0x04) == 0) /* 12 hour mode? */ |
| 59 | 78 | { |
| 60 | 79 | hour %= 12; |
| 61 | 80 | |
| r2512 | r2513 | |
| 63 | 82 | hour = 12; |
| 64 | 83 | } |
| 65 | 84 | |
| 66 | | if ( offset == MSM6264_REG_H1 ) |
| 85 | if ( offset == MSM6242_REG_H1 ) |
| 67 | 86 | return hour % 10; |
| 68 | 87 | |
| 69 | 88 | return hour / 10; |
| 70 | 89 | } |
| 71 | 90 | |
| 72 | | case MSM6264_REG_D1: return systime->local_time.mday % 10; |
| 73 | | case MSM6264_REG_D10: return systime->local_time.mday / 10; |
| 74 | | case MSM6264_REG_MO1: return (systime->local_time.month+1) % 10; |
| 75 | | case MSM6264_REG_MO10: return (systime->local_time.month+1) / 10; |
| 76 | | case MSM6264_REG_Y1: return systime->local_time.year % 10; |
| 77 | | case MSM6264_REG_Y10: return (systime->local_time.year % 100) / 10; |
| 78 | | case MSM6264_REG_W: return systime->local_time.weekday; |
| 79 | | case MSM6264_REG_CD: return msm6264_reg[0]; |
| 80 | | case MSM6264_REG_CE: return msm6264_reg[1]; |
| 81 | | case MSM6264_REG_CF: return msm6264_reg[2]; |
| 91 | case MSM6242_REG_D1: return systime->local_time.mday % 10; |
| 92 | case MSM6242_REG_D10: return systime->local_time.mday / 10; |
| 93 | case MSM6242_REG_MO1: return (systime->local_time.month+1) % 10; |
| 94 | case MSM6242_REG_MO10: return (systime->local_time.month+1) / 10; |
| 95 | case MSM6242_REG_Y1: return systime->local_time.year % 10; |
| 96 | case MSM6242_REG_Y10: return (systime->local_time.year % 100) / 10; |
| 97 | case MSM6242_REG_W: return systime->local_time.weekday; |
| 98 | case MSM6242_REG_CD: return msm6242->reg[0]; |
| 99 | case MSM6242_REG_CE: return msm6242->reg[1]; |
| 100 | case MSM6242_REG_CF: return msm6242->reg[2]; |
| 82 | 101 | } |
| 83 | 102 | |
| 84 | | logerror("%04x: MSM6242 unmapped offset %02X read\n",activecpu_get_pc(),offset); |
| 103 | logerror("%04x: MSM6242 unmapped offset %02x read\n", activecpu_get_pc(), offset); |
| 85 | 104 | return 0; |
| 86 | 105 | } |
| 87 | 106 | |
| 88 | | WRITE8_HANDLER( msm6242_w ) |
| 107 | |
| 108 | WRITE8_DEVICE_HANDLER( msm6242_w ) |
| 89 | 109 | { |
| 110 | msm6242_t *msm6242 = get_safe_token(device); |
| 111 | |
| 90 | 112 | switch(offset) |
| 91 | 113 | { |
| 92 | | case MSM6264_REG_CD: |
| 114 | case MSM6242_REG_CD: |
| 93 | 115 | { |
| 94 | | msm6264_reg[0] = data; |
| 116 | msm6242->reg[0] = data; |
| 95 | 117 | |
| 96 | | if ( data & 1 ) /* was Hold set? */ |
| 97 | | { |
| 98 | | mame_get_current_datetime(machine, &msm6264_hold_time); |
| 99 | | } |
| 118 | if (data & 1) /* was Hold set? */ |
| 119 | { |
| 120 | mame_get_current_datetime(device->machine, &msm6242->hold_time); |
| 121 | } |
| 100 | 122 | |
| 101 | | return; |
| 123 | return; |
| 102 | 124 | } |
| 103 | 125 | |
| 104 | | case MSM6264_REG_CE: msm6264_reg[1] = data; return; |
| 126 | case MSM6242_REG_CE: msm6242->reg[1] = data; return; |
| 105 | 127 | |
| 106 | | case MSM6264_REG_CF: |
| 128 | case MSM6242_REG_CF: |
| 107 | 129 | { |
| 108 | 130 | /* the 12/24 mode bit can only be changed while REST is 1 */ |
| 109 | | if ( (data ^ msm6264_reg[2]) & 0x04 ) |
| 131 | if ((data ^ msm6242->reg[2]) & 0x04) |
| 110 | 132 | { |
| 111 | | if ( msm6264_reg[2] & 1 ) |
| 112 | | msm6264_reg[2] = data; |
| 133 | if (msm6242->reg[2] & 1) |
| 134 | msm6242->reg[2] = data; |
| 113 | 135 | } |
| 114 | 136 | else |
| 115 | 137 | { |
| 116 | | msm6264_reg[2] = data; |
| 138 | msm6242->reg[2] = data; |
| 117 | 139 | } |
| 118 | 140 | return; |
| 119 | 141 | } |
| 120 | 142 | } |
| 121 | 143 | |
| 122 | | logerror("%04x: MSM6242 unmapped offset %02X written with %02X\n",activecpu_get_pc(),offset,data); |
| 144 | logerror("%04x: MSM6242 unmapped offset %02x written with %02x\n", activecpu_get_pc(), offset, data); |
| 123 | 145 | } |
| 124 | 146 | |
| 125 | 147 | |
| 148 | static DEVICE_START( msm6242 ) |
| 149 | { |
| 150 | msm6242_t *msm6242 = get_safe_token(device); |
| 151 | |
| 152 | msm6242->reg[0] = 0; |
| 153 | msm6242->reg[1] = 0; |
| 154 | msm6242->reg[2] = 0; |
| 155 | memset(&msm6242->hold_time, 0, sizeof(mame_system_time)); |
| 156 | } |
| 157 | |
| 158 | |
| 159 | static DEVICE_SET_INFO( msm6242 ) |
| 160 | { |
| 161 | switch (state) |
| 162 | { |
| 163 | /* no parameters to set */ |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | |
| 168 | DEVICE_GET_INFO( msm6242 ) |
| 169 | { |
| 170 | switch (state) |
| 171 | { |
| 172 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 173 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(msm6242_t); break; |
| 174 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 175 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_TIMER; break; |
| 176 | |
| 177 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 178 | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(msm6242); break; |
| 179 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(msm6242); break; |
| 180 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 181 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 182 | |
| 183 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 184 | case DEVINFO_STR_NAME: info->s = "OKI MSM6242"; break; |
| 185 | case DEVINFO_STR_FAMILY: info->s = "MSM6242 RTC"; break; |
| 186 | case DEVINFO_STR_VERSION: info->s = "1.00"; break; |
| 187 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; |
| 188 | case DEVINFO_STR_CREDITS: info->s = "Copyright Nicola Salmoria and the MAME Team"; break; |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | |
| 193 | |
| 194 | |
| 195 | |
| 196 | #if 0 |
| 126 | 197 | READ16_HANDLER( msm6242_lsb_r ) |
| 127 | 198 | { |
| 128 | 199 | return msm6242_r(machine, offset); |
| r2512 | r2513 | |
| 133 | 204 | if (ACCESSING_BITS_0_7) |
| 134 | 205 | msm6242_w(machine, offset, data); |
| 135 | 206 | } |
| 207 | #endif |