src/mess/drivers/ip22.c
| r14376 | r14377 | |
| 55 | 55 | #include "imagedev/harddriv.h" |
| 56 | 56 | #include "imagedev/chd_cd.h" |
| 57 | 57 | #include "sound/dac.h" |
| 58 | #include "machine/nvram.h" |
| 58 | 59 | |
| 59 | | |
| 60 | 60 | typedef struct |
| 61 | 61 | { |
| 62 | 62 | UINT8 nRegs[0x80]; |
| r14376 | r14377 | |
| 147 | 147 | } |
| 148 | 148 | }; |
| 149 | 149 | |
| 150 | | static NVRAM_HANDLER( ip22 ) |
| 151 | | { |
| 152 | | ip22_state *state = machine.driver_data<ip22_state>(); |
| 153 | | if (read_or_write) |
| 154 | | { |
| 155 | | file->write(state->m_RTC.nUserRAM, 0x200); |
| 156 | | file->write(state->m_RTC.nRAM, 0x200); |
| 157 | | } |
| 158 | | else |
| 159 | | { |
| 160 | | if (file) |
| 161 | | { |
| 162 | | file->read(state->m_RTC.nUserRAM, 0x200); |
| 163 | | file->read(state->m_RTC.nRAM, 0x200); |
| 164 | | } |
| 165 | | } |
| 166 | | } |
| 167 | | |
| 168 | 150 | #define RTC_DAY state->m_RTC.nRAM[0x09] |
| 169 | 151 | #define RTC_HOUR state->m_RTC.nRAM[0x08] |
| 170 | 152 | #define RTC_MINUTE state->m_RTC.nRAM[0x07] |
| r14376 | r14377 | |
| 1231 | 1213 | machine.scheduler().timer_set(attotime::from_msec(1), FUNC(ip22_timer)); |
| 1232 | 1214 | } |
| 1233 | 1215 | |
| 1234 | | static MACHINE_START( ip225015 ) |
| 1235 | | { |
| 1236 | | sgi_mc_init(machine); |
| 1237 | | } |
| 1238 | | |
| 1239 | 1216 | static MACHINE_RESET( ip225015 ) |
| 1240 | 1217 | { |
| 1241 | 1218 | ip22_state *state = machine.driver_data<ip22_state>(); |
| r14376 | r14377 | |
| 1538 | 1515 | return pit8253_get_output(machine.device("pit8254"), 2 ); |
| 1539 | 1516 | } |
| 1540 | 1517 | |
| 1541 | | static MACHINE_START( ip22 ) |
| 1518 | static MACHINE_START( ip225015 ) |
| 1542 | 1519 | { |
| 1520 | ip22_state *state = machine.driver_data<ip22_state>(); |
| 1543 | 1521 | sgi_mc_init(machine); |
| 1544 | 1522 | |
| 1545 | 1523 | // SCSI init |
| 1546 | 1524 | wd33c93_init(machine, &scsi_intf); |
| 1547 | 1525 | machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ip225015_exit),&machine)); |
| 1526 | |
| 1527 | machine.device<nvram_device>("nvram_user")->set_base(state->m_RTC.nUserRAM, 0x200); |
| 1528 | machine.device<nvram_device>("nvram")->set_base(state->m_RTC.nRAM, 0x200); |
| 1548 | 1529 | } |
| 1549 | 1530 | |
| 1550 | 1531 | static DRIVER_INIT( ip225015 ) |
| r14376 | r14377 | |
| 1686 | 1667 | |
| 1687 | 1668 | MCFG_MACHINE_START( ip225015 ) |
| 1688 | 1669 | MCFG_MACHINE_RESET( ip225015 ) |
| 1689 | | MCFG_NVRAM_HANDLER( ip22 ) |
| 1670 | |
| 1671 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 1672 | MCFG_NVRAM_ADD_0FILL("nvram_user") |
| 1690 | 1673 | |
| 1691 | 1674 | MCFG_PIT8254_ADD( "pit8254", ip22_pit8254_config ) |
| 1692 | 1675 | |
| r14376 | r14377 | |
| 1700 | 1683 | |
| 1701 | 1684 | MCFG_PALETTE_LENGTH(65536) |
| 1702 | 1685 | |
| 1703 | | MCFG_MACHINE_START( ip22 ) |
| 1704 | | |
| 1705 | 1686 | MCFG_VIDEO_START( newport ) |
| 1706 | 1687 | |
| 1707 | 1688 | MCFG_PC_LPT_ADD("lpt_0", ip22_lpt_config) |