Previous 15994 Revisions Next

r14843 Monday 2nd April, 2012 at 15:25:47 UTC by Curt Coder
Static removal. (nw)
[src/mess/drivers]comx35.c newbrain.c prof80.c
[src/mess/includes]comx35.h newbrain.h prof80.h

src/mess/includes/prof80.h
r14842r14843
5151   required_device<device_t> m_floppy1;
5252   required_device<ecbbus_device> m_ecb;
5353
54   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5455   virtual void machine_start();
5556   virtual void machine_reset();
5657   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5758
59   enum
60   {
61      TIMER_ID_MOTOR
62   };
63
5864   DECLARE_WRITE8_MEMBER( flr_w );
5965   DECLARE_READ8_MEMBER( status_r );
6066   DECLARE_READ8_MEMBER( status2_r );
src/mess/includes/newbrain.h
r14842r14843
7070   required_device<cassette_image_device> m_cassette1;
7171   required_device<cassette_image_device> m_cassette2;
7272
73   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
7374   virtual void machine_start();
7475   virtual void machine_reset();
7576
7677   virtual void video_start();
7778   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7879
80   enum
81   {
82      TIMER_ID_RESET,
83      TIMER_ID_PWRUP
84   };
85
7986   DECLARE_WRITE8_MEMBER( enrg1_w );
8087   DECLARE_WRITE8_MEMBER( a_enrg1_w );
8188   DECLARE_READ8_MEMBER( ust_r );
r14842r14843
145152   // user bus state
146153   UINT8 m_user;
147154
148   // timers
149   emu_timer *m_reset_timer;   // power on reset timer
150   emu_timer *m_pwrup_timer;   // power up timer
151
152155   // devices
153156   UINT8 m_copdata;
154157   int m_copstate;
src/mess/includes/comx35.h
r14842r14843
5858   required_device<ram_device> m_ram;
5959   required_device<comx_expansion_slot_device> m_expansion;
6060
61   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
6162   virtual void machine_start();
6263   virtual void machine_reset();
6364
6465   virtual void video_start();
6566   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6667
68   enum
69   {
70      TIMER_ID_RESET
71   };
72
6773   void check_interrupt();
6874
6975   DECLARE_READ8_MEMBER( mem_r );
r14842r14843
94100
95101   // video state
96102   UINT8 *m_charram;         // character memory
97
98   // timers
99   emu_timer *m_reset_timer;   // power on reset timer
100103};
101104
102105// ---------- defined in video/comx35.c ----------
src/mess/drivers/newbrain.c
r14842r14843
12401240   return RES_K(220) * CAP_U(10) * 1000; // t = R128 * C125 = 2.2s
12411241}
12421242
1243static TIMER_CALLBACK( reset_tick )
1244{
1245   newbrain_state *state = machine.driver_data<newbrain_state>();
1246
1247   state->m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
1248   state->m_copcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
1249}
1250
12511243inline int newbrain_state::get_pwrup_t()
12521244{
12531245   return RES_K(560) * CAP_U(10) * 1000; // t = R129 * C127 = 5.6s
12541246}
12551247
1256static TIMER_CALLBACK( pwrup_tick )
1248//-------------------------------------------------
1249//  device_timer - handler timer events
1250//-------------------------------------------------
1251
1252void newbrain_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
12571253{
1258   newbrain_state *state = machine.driver_data<newbrain_state>();
1254   switch (id)
1255   {
1256   case TIMER_ID_RESET:
1257      m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
1258      m_copcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
1259      break;
12591260
1260   state->m_pwrup = 0;
1261   state->bankswitch();
1261   case TIMER_ID_PWRUP:
1262      m_pwrup = 0;
1263      bankswitch();
1264      break;
1265   }
12621266}
12631267
12641268void newbrain_state::machine_start()
12651269{
12661270   m_copregint = 1;
12671271
1268   /* allocate reset timer */
1269   m_reset_timer = machine().scheduler().timer_alloc(FUNC(reset_tick));
1270   m_reset_timer->adjust(attotime::from_usec(get_reset_t()));
1272   /* set power up timer */
1273   timer_set(attotime::from_usec(get_pwrup_t()), TIMER_ID_PWRUP);
12711274
1272   /* allocate power up timer */
1273   m_pwrup_timer = machine().scheduler().timer_alloc(FUNC(pwrup_tick));
1274   m_pwrup_timer->adjust(attotime::from_usec(get_pwrup_t()));
1275
12761275   /* initialize variables */
12771276   m_pwrup = 1;
12781277   m_userint = 1;
r14842r14843
13281327
13291328void newbrain_state::machine_reset()
13301329{
1331   m_reset_timer->adjust(attotime::from_msec(get_reset_t()));
1330   timer_set(attotime::from_usec(get_reset_t()), TIMER_ID_RESET);
13321331}
13331332
13341333static INTERRUPT_GEN( newbrain_interrupt )
src/mess/drivers/comx35.c
r14842r14843
445445//**************************************************************************
446446
447447//-------------------------------------------------
448//  MACHINE_START( comx35 )
448//  device_timer - handler timer events
449449//-------------------------------------------------
450450
451static TIMER_CALLBACK( reset_tick )
451void comx35_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
452452{
453   comx35_state *state = machine.driver_data<comx35_state>();
454
455   state->m_clear = 1;
453   switch (id)
454   {
455   case TIMER_ID_RESET:
456      m_clear = 1;
457      break;
458   }
456459}
457460
461
462//-------------------------------------------------
463//  MACHINE_START( comx35 )
464//-------------------------------------------------
465
458466void comx35_state::machine_start()
459467{
460   // allocate reset timer
461   m_reset_timer = machine().scheduler().timer_alloc(FUNC(reset_tick));
462
463468   // clear the RAM since DOS card will go crazy if RAM is not all zeroes
464469   UINT8 *ram = m_ram->pointer();
465470   memset(ram, 0, 0x8000);
r14842r14843
491496   m_int = CLEAR_LINE;
492497   m_prd = CLEAR_LINE;
493498
494   m_reset_timer->adjust(attotime::from_msec(t));
499   timer_set(attotime::from_msec(t), TIMER_ID_RESET);
495500}
496501
497502
src/mess/drivers/prof80.c
r14842r14843
111111
112112
113113//-------------------------------------------------
114//  TIMER_CALLBACK( floppy_motor_off_tick )
115//-------------------------------------------------
116
117static TIMER_CALLBACK( floppy_motor_off_tick )
118{
119   prof80_state *state = machine.driver_data<prof80_state>();
120
121   state->floppy_motor_off();
122}
123
124
125//-------------------------------------------------
126114//  ls259_w -
127115//-------------------------------------------------
128116
r14842r14843
164152         // trigger floppy motor off NE555 timer
165153         int t = 110 * RES_M(10) * CAP_U(6.8); // t = 1.1 * R8 * C6
166154
167         m_floppy_motor_off_timer->adjust(attotime::from_msec(t));
155         timer_set(attotime::from_msec(t), TIMER_ID_MOTOR);
168156      }
169157      else
170158      {
r14842r14843
177165         m_motor = 1;
178166
179167         // reset floppy motor off NE555 timer
180         m_floppy_motor_off_timer->enable(0);
168         timer_set(attotime::never, TIMER_ID_MOTOR);
181169      }
182170      break;
183171
r14842r14843
204192      if (!fb)
205193      {
206194         // immediately turn off floppy motor
207         m_floppy_motor_off_timer->adjust(attotime::zero);
195         synchronize(TIMER_ID_MOTOR);
208196      }
209197      break;
210198
r14842r14843
570558//**************************************************************************
571559
572560//-------------------------------------------------
561//  device_timer - handler timer events
562//-------------------------------------------------
563
564void prof80_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
565{
566   switch (id)
567   {
568   case TIMER_ID_MOTOR:
569      floppy_motor_off();
570      break;
571   }
572}
573
574
575//-------------------------------------------------
573576//  MACHINE_START( prof80 )
574577//-------------------------------------------------
575578
r14842r14843
579582   m_rtc->cs_w(1);
580583   m_rtc->oe_w(1);
581584
582   // allocate floppy motor off timer
583   m_floppy_motor_off_timer = machine().scheduler().timer_alloc(FUNC(floppy_motor_off_tick));
584
585585   // bank switch
586586   bankswitch();
587587

Previous 15994 Revisions Next


© 1998-2018 The MESS Team