Previous 199869 Revisions Next

r23982 Friday 28th June, 2013 at 02:07:12 UTC by R. Belmont
(MESS) apollo: fixed disk and tape DMA, improved logging [Hans Ostermeyer]
[src/emu/machine]am9517a.c
[src/mess/includes]apollo.h
[src/mess/machine]apollo.c

trunk/src/emu/machine/am9517a.c
r23981r23982
336336inline void am9517a_device::end_of_process()
337337{
338338   // terminal count
339   m_status |= 1 << m_current_channel;
340   m_request &= ~(1 << m_current_channel);
339   if (COMMAND_MEM_TO_MEM)
340   {
341      m_status |= 1 << 0;
342      m_status |= 1 << 1;
343      m_request &= ~(1 << 0);
344      m_request &= ~(1 << 1);
345   }
346   else
347   {
348      m_status |= 1 << m_current_channel;
349      m_request &= ~(1 << m_current_channel);
350   }
341351
342352   if (MODE_AUTOINITIALIZE)
343353   {
r23981r23982
519529                  m_state = STATE_S0;
520530                  break;
521531               }
532               else if (COMMAND_MEM_TO_MEM && BIT(m_request, channel) && ((m_channel[channel].m_mode & 0xc0) == MODE_SINGLE))
533               {
534                  m_current_channel = m_last_channel = priority[channel];
535                  m_state = STATE_S0;
536                  break;
537               }
522538            }
523539         }
524540         if(m_state == STATE_SI)
r23981r23982
633649      case STATE_S24:
634650         dma_write();
635651         dma_advance();
652
653         m_current_channel = 0;
654         m_channel[m_current_channel].m_count--;
655         if (MODE_ADDRESS_DECREMENT)
656         {
657            m_channel[m_current_channel].m_address--;
658         }
659         else
660         {
661            m_channel[m_current_channel].m_address++;
662         }
663
636664         break;
637665      }
638666
r23981r23982
767795            if (BIT(data, 2))
768796            {
769797               m_request |= (1 << (channel + 4));
798               if (COMMAND_MEM_TO_MEM)
799               {
800                  m_request |= (1 << channel);
801               }
770802            }
771803            else
772804            {
trunk/src/mess/machine/apollo.c
r23981r23982
375375}
376376
377377READ8_MEMBER(apollo_state::apollo_dma_2_r){
378   // Nasty hack (13-06-15 - ost):
379   // MD self_test will test wrong DMA register and
380   // mem-to-mem DMA in am9517a.c is often starting much too late (for MD self_test)
381   // (8237dma.c was always fast enough to omit these problems)
382   if (offset == 8)
383   {
384      switch (space.device().safe_pcbase())
385      {
386      case 0x00102e22: // DN3000
387      case 0x01002f3c: // DN3500
388      case 0x010029a6: // DN5500
389         offset = 16;
390         break;
391      }
392   }
378393   UINT8 data = get_device_dma8237_2(&space.device())->read(space, offset / 2);
379394   SLOG1(("apollo_dma_2_r: reading DMA Controller 2 at offset %02x = %02x", offset/2, data));
380395   return data;
r23981r23982
495510
496511READ8_MEMBER(apollo_state::apollo_dma8237_ctape_dack_r ) {
497512   UINT8 data = sc499_dack_r(&space.machine());
498//  DLOG2(("dma ctape dack read %02x",data));
513    CLOG2(("dma ctape dack read %02x",data));
499514
500515   // hack for DN3000: select appropriate DMA channel No.
501516   dn3000_dma_channel1 = 1; // 1 = ctape, 2 = floppy dma channel
r23981r23982
504519}
505520
506521WRITE8_MEMBER(apollo_state::apollo_dma8237_ctape_dack_w ) {
507//  DLOG2(("dma ctape dack write %02x", data));
522    CLOG2(("dma ctape dack write %02x", data));
508523   sc499_dack_w(&space.machine(), data);
509524
510525   // hack for DN3000: select appropriate DMA channel No.
r23981r23982
515530READ8_MEMBER(apollo_state::apollo_dma8237_fdc_dack_r ) {
516531   pc_fdc_at_device *fdc = space.machine().device<pc_fdc_at_device>(APOLLO_FDC_TAG);
517532   UINT8 data = fdc->dma_r();
518   //  DLOG2(("dma fdc dack read %02x",data));
533   CLOG2(("dma fdc dack read %02x",data));
519534
520535   // hack for DN3000: select appropriate DMA channel No.
521536   dn3000_dma_channel1 = 2; // 1 = ctape, 2 = floppy dma channel
r23981r23982
525540
526541WRITE8_MEMBER(apollo_state::apollo_dma8237_fdc_dack_w ) {
527542   pc_fdc_at_device *fdc = space.machine().device<pc_fdc_at_device>(APOLLO_FDC_TAG);
528   // DLOG2(("dma fdc dack write %02x", data));
543   CLOG2(("dma fdc dack write %02x", data));
529544   fdc->dma_w(data);
530545
531546   // hack for DN3000: select appropriate DMA channel No.
r23981r23982
535550
536551READ8_MEMBER(apollo_state::apollo_dma8237_wdc_dack_r ) {
537552   UINT8 data = 0xff; // omti8621_dack_r(device->machine);
538   //DLOG1(("dma wdc dack read %02x (not used, not emulated!)",data));
553   CLOG1(("dma wdc dack read %02x (not used, not emulated!)",data));
539554   return data;
540555}
541556
542557WRITE8_MEMBER(apollo_state::apollo_dma8237_wdc_dack_w ) {
543   //DLOG1(("dma wdc dack write %02x (not used, not emulated!)", data));
558   CLOG1(("dma wdc dack write %02x (not used, not emulated!)", data));
544559//  omti8621_dack_w(machine, data);
545560}
546561
547562WRITE_LINE_MEMBER(apollo_state::apollo_dma8237_out_eop ) {
548563   pc_fdc_at_device *fdc = machine().device<pc_fdc_at_device>(APOLLO_FDC_TAG);
549   //DLOG1(("dma out eop state %02x", state));
564   CLOG1(("dma out eop state %02x", state));
550565   fdc->tc_w(!state);
551566   sc499_set_tc_state(&machine(), state);
552567}
553568
554569WRITE_LINE_MEMBER(apollo_state::apollo_dma_1_hrq_changed ) {
555   // DLOG2(("dma 1 hrq changed state %02x", state));
556   m_dma8237_2->dreq0_w(state);
570   CLOG2(("dma 1 hrq changed state %02x", state));
571   m_dma8237_1->dreq0_w(state);
557572
558573   /* Assert HLDA */
559   //m_dma8237_1->hack_w(state);
574   m_dma8237_1->hack_w(state);
560575
561576   // cascade mode?
562577   // i8237_hlda_w(get_device_dma8237_2(device), state);
563578}
564579
565580WRITE_LINE_MEMBER(apollo_state::apollo_dma_2_hrq_changed ) {
566   // DLOG2(("dma 2 hrq changed state %02x", state));
581   CLOG2(("dma 2 hrq changed state %02x", state));
567582   m_maincpu->set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
568583
569584   /* Assert HLDA */
trunk/src/mess/includes/apollo.h
r23981r23982
3434#define LOG(x)  { logerror x; logerror ("\n"); apollo_check_log(); }
3535#define LOG1(x) { if (VERBOSE > 0) LOG(x) }
3636#define LOG2(x) { if (VERBOSE > 1) LOG(x) }
37#define CLOG(x) { logerror ("%s - %s: ", apollo_cpu_context(machine().device(MAINCPU)), tag()); LOG(x) }
38#define CLOG1(x) { if (VERBOSE > 0) CLOG(x) }
39#define CLOG2(x) { if (VERBOSE > 1) CLOG(x) }
3740#define DLOG(x) { logerror ("%s - %s: ", apollo_cpu_context(device->machine().device(MAINCPU)), device->tag()); LOG(x) }
3841#define DLOG1(x) { if (VERBOSE > 0) DLOG(x) }
3942#define DLOG2(x) { if (VERBOSE > 1) DLOG(x) }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team