Previous 15994 Revisions Next

r14377 Tuesday 7th February, 2012 at 11:34:59 UTC by Miodrag Milanović
ip22 removed redundant machine_start and add two nvram devices (nw)
[src/mess/drivers]ip22.c

src/mess/drivers/ip22.c
r14376r14377
5555#include "imagedev/harddriv.h"
5656#include "imagedev/chd_cd.h"
5757#include "sound/dac.h"
58#include "machine/nvram.h"
5859
59
6060typedef struct
6161{
6262   UINT8 nRegs[0x80];
r14376r14377
147147   }
148148};
149149
150static 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
168150#define RTC_DAY      state->m_RTC.nRAM[0x09]
169151#define RTC_HOUR   state->m_RTC.nRAM[0x08]
170152#define RTC_MINUTE   state->m_RTC.nRAM[0x07]
r14376r14377
12311213   machine.scheduler().timer_set(attotime::from_msec(1), FUNC(ip22_timer));
12321214}
12331215
1234static MACHINE_START( ip225015 )
1235{
1236   sgi_mc_init(machine);
1237}
1238
12391216static MACHINE_RESET( ip225015 )
12401217{
12411218   ip22_state *state = machine.driver_data<ip22_state>();
r14376r14377
15381515   return pit8253_get_output(machine.device("pit8254"), 2 );
15391516}
15401517
1541static MACHINE_START( ip22 )
1518static MACHINE_START( ip225015 )
15421519{
1520   ip22_state *state = machine.driver_data<ip22_state>();
15431521   sgi_mc_init(machine);
15441522
15451523   // SCSI init
15461524   wd33c93_init(machine, &scsi_intf);
15471525   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);   
15481529}
15491530
15501531static DRIVER_INIT( ip225015 )
r14376r14377
16861667
16871668   MCFG_MACHINE_START( ip225015 )
16881669   MCFG_MACHINE_RESET( ip225015 )
1689   MCFG_NVRAM_HANDLER( ip22 )
1670   
1671   MCFG_NVRAM_ADD_0FILL("nvram")
1672   MCFG_NVRAM_ADD_0FILL("nvram_user")
16901673
16911674   MCFG_PIT8254_ADD( "pit8254", ip22_pit8254_config )
16921675
r14376r14377
17001683
17011684   MCFG_PALETTE_LENGTH(65536)
17021685
1703   MCFG_MACHINE_START( ip22 )
1704
17051686   MCFG_VIDEO_START( newport )
17061687
17071688   MCFG_PC_LPT_ADD("lpt_0", ip22_lpt_config)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team