Previous 15994 Revisions Next

r833 Friday 17th August, 2007 at 04:55:23 UTC by R. Belmont
[A310] Preliminary WD1772 hookup.
[src/mess/drivers]a310.c

src/mess/drivers/a310.c
r832r833
114114   }
115115}
116116
117static void a310_request_fiq(int mask)
118{
119   a310_iocregs[12] |= mask;
120
121   if (a310_iocregs[14] & mask)
122   {
123      cpunum_set_input_line(0, ARM_FIRQ_LINE, PULSE_LINE);
124   }
125}
126
117127static TIMER_CALLBACK( a310_audio_tick )
118128{
119129   a310_sndcur++;
r832r833
180190
181191static void a310_wd177x_callback(wd17xx_state_t event, void *param)
182192{
193   switch (event)
194   {
195      case WD17XX_IRQ_CLR:
196         a310_iocregs[12] &= ~A310_FIQ_FLOPPY;
197         break;
198
199      case WD17XX_IRQ_SET:
200         a310_request_fiq(A310_FIQ_FLOPPY);
201         break;
202         
203      case WD17XX_DRQ_CLR:
204         a310_iocregs[12] &= ~A310_FIQ_FLOPPY_DRQ;
205         break;
206
207      case WD17XX_DRQ_SET:
208         a310_request_fiq(A310_FIQ_FLOPPY_DRQ);
209         break;
210   }
183211}
184212
185213
186214static MACHINE_START( a310 )
187215{
188216   a310_pagesize = 0;
189   wd17xx_init(WD_TYPE_177X, a310_wd177x_callback, NULL);
217   wd17xx_init(WD_TYPE_1772, a310_wd177x_callback, NULL);
190218
191219   vbl_timer = mame_timer_alloc(a310_vblank);
192220   mame_timer_adjust(vbl_timer, time_never, 0, time_never);
r832r833
382410      logerror("IOC: R %s = %02x (PC=%x)\n", ioc_regnames[offset&0x1f], a310_iocregs[offset&0x1f], activecpu_get_pc());
383411      return a310_iocregs[offset&0x1f];
384412   }
413   else if (offset >= 0xc4000 && offset <= 0xc4010)
414   {
415      logerror("17XX: R @ addr %x mask %08x\n", offset*4, mem_mask);
416      return wd17xx_data_r(offset&0xf);
417   }
385418   else
386419   {
387420      logerror("I/O: R @ %x (mask %08x)\n", (offset*4)+0x3000000, mem_mask);
r832r833
470503            break;
471504      }
472505   }
506   else if (offset >= 0xc4000 && offset <= 0xc4010)
507   {
508      logerror("17XX: %x to addr %x mask %08x\n", data, offset*4, mem_mask);
509      wd17xx_data_w(offset&0xf, data&0xff);
510   }
511   else if (offset == 0xd40006)
512   {
513      // latch A
514      if (data & 1)
515      {
516         wd17xx_set_drive(0);
517      }
518      if (data & 2)
519      {
520         wd17xx_set_drive(1);
521      }
522      if (data & 4)
523      {
524         wd17xx_set_drive(2);
525      }
526      if (data & 8)
527      {
528         wd17xx_set_drive(3);
529      }
530
531      wd17xx_set_side((data & 0x10)>>4);
532
533   }
534   else if (offset == 0xd40010)
535   {
536      // latch B
537      wd17xx_set_density((data & 2) ? DEN_MFM_LO : DEN_MFM_HI);
538   }
473539   else
474540   {
475541      logerror("I/O: W %x @ %x (mask %08x)\n", data, (offset*4)+0x3000000, mem_mask);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team