Previous 199869 Revisions Next

r19107 Thursday 22nd November, 2012 at 17:48:26 UTC by Angelo Salese
(MESS) Fixed upd765 SIS status when fid = 4, this makes NEC PC-88VA to attempt to DMA from floppy. [Angelo Salese]
[src/mess/drivers]apc.c pc88va.c
[src/mess/machine]upd765.c

trunk/src/mess/machine/upd765.c
r19106r19107
12031203      if(fid == 4) {
12041204         st0 = ST0_UNK;
12051205         result[0] = st0;
1206         result[1] = 0x00;
1207         result_pos = 2;
1208         logerror("%s: command sense interrupt status (%02x %02x)\n", tag(), result[0], result[1]);
1206         result_pos = 1;
1207         logerror("%s: command sense interrupt status (%02x)\n", tag(), result[0]);
12091208         break;
12101209      }
12111210      floppy_info &fi = flopi[fid];
r19106r19107
13641363   fi.main_state = READ_DATA;
13651364   fi.sub_state = HEAD_LOAD_DONE;
13661365   mfm = command[0] & 0x40;
1366
13671367   logerror("%s: command read%s data%s%s%s%s cmd=%02x sel=%x chrn=(%d, %d, %d, %d) eot=%02x gpl=%02x dtl=%02x rate=%d\n",
13681368          tag(),
13691369          command[0] & 0x08 ? " deleted" : "",
trunk/src/mess/drivers/pc88va.c
r19106r19107
1515    - What is exactly supposed to be a "bus slot"?
1616    - fdc "intelligent mode" has 0x7f as irq vector ... 0x7f is ld a,a and it IS NOT correctly
1717      hooked up by the current z80 core
18    - PC-88VA has two bogus opcodes. One is at 0xf0b15, another at 0xf0b31. Making a patch
19      for the latter makes the system to jump into a "DIP-Switch" display.
18    - PC-88VA stock version has two bogus opcodes. One is at 0xf0b15, another at 0xf0b31.
19      Making a patch for the latter makes the system to jump into a "DIP-Switch" display.
20   - unemulated upd71071 demand mode.
2021
2122********************************************************************************************/
2223
r19106r19107
5960public:
6061   pc88va_state(const machine_config &mconfig, device_type type, const char *tag)
6162      : driver_device(mconfig, type, tag) ,
63      m_fdc(*this, "upd765"),
6264      m_dmac(*this, "dmac"),
6365      m_palram(*this, "palram"){ }
6466
67   required_device<upd765a_device> m_fdc;
6568   required_device<upd71071_device> m_dmac;
6669   required_shared_ptr<UINT16> m_palram;
6770   UINT16 m_bank_reg;
r19106r19107
132135   DECLARE_WRITE_LINE_MEMBER(pc88va_pic_irq);
133136   DECLARE_READ8_MEMBER(get_slave_ack);
134137   DECLARE_WRITE_LINE_MEMBER(pc88va_pit_out0_changed);
135   DECLARE_WRITE_LINE_MEMBER(pc88va_upd765_interrupt);
138//   DECLARE_WRITE_LINE_MEMBER(pc88va_upd765_interrupt);
136139   UINT8 m_fdc_ctrl_2;
137140   TIMER_CALLBACK_MEMBER(pc88va_fdc_timer);
141//   UINT16 m_fdc_dma_r(running_machine &machine);
142//   void m_fdc_dma_w(running_machine &machine, UINT16 data);
138143
139   void upd765_interrupt(bool state);
144   void fdc_irq(bool state);
145   void fdc_drq(bool state);
140146};
141147
142148
r19106r19107
10241030        ---- --xx RV1/RV0: Drive 1/0 mode selection (0) 2D and 2DD mode (1) 2HD mode
10251031        */
10261032      case 0x02: // FDC control port 0
1033         machine().device<floppy_connector>("upd765:0")->get_device()->set_rpm(data & 0x01 ? 360 : 300);
1034         machine().device<floppy_connector>("upd765:1")->get_device()->set_rpm(data & 0x02 ? 360 : 300);
1035
1036         machine().device<upd765a_device>("upd765")->set_rate(data & 0x20 ? 500000 : 250000);
10271037         break;
10281038      /*
10291039        ---- x--- PCM: ?
r19106r19107
10391049        */
10401050      case 0x06:
10411051         //printf("%02x\n",data);
1042         m_fdc_ctrl_2 = data;
1043
10441052         if(data & 1)
10451053            machine().scheduler().timer_set(attotime::from_msec(100), timer_expired_delegate(FUNC(pc88va_state::pc88va_fdc_timer),this));
10461054
1055         if((m_fdc_ctrl_2 & 0x10) != (data & 0x10))
1056            upd71071_dmarq(m_dmac,1,2);
1057
10471058         if(data & 0x80) // correct?
10481059            machine().device<upd765a_device>("upd765")->reset();
10491060
1061         m_fdc_ctrl_2 = data;
1062
10501063         break; // FDC control port 2
10511064   }
10521065}
r19106r19107
15841597
15851598   m_t3_mouse_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pc88va_state::t3_mouse_callback),this));
15861599   m_t3_mouse_timer->adjust(attotime::never);
1587   machine().device<upd765a_device>("upd765")->setup_intrq_cb(upd765a_device::line_cb(FUNC(pc88va_state::upd765_interrupt), this));
1600   m_fdc->setup_drq_cb(upd765a_device::line_cb(FUNC(pc88va_state::fdc_drq), this));
1601   m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(pc88va_state::fdc_irq), this));
15881602
15891603   machine().device<floppy_connector>("upd765:0")->get_device()->set_rpm(300);
15901604   machine().device<floppy_connector>("upd765:1")->get_device()->set_rpm(300);
r19106r19107
16591673};
16601674
16611675
1662void pc88va_state::upd765_interrupt(bool state)
1676void pc88va_state::fdc_drq(bool state)
16631677{
1678   printf("%02x DRQ\n",state);
1679   upd71071_dmarq(m_dmac,state,2);
1680}
1681
1682void pc88va_state::fdc_irq(bool state)
1683{
16641684   if(m_fdc_mode && state)
16651685   {
16661686      //printf("%d\n",state);
r19106r19107
16871707   DEVCB_NULL
16881708};
16891709
1710static UINT16 m_fdc_dma_r(running_machine &machine)
1711{
1712   pc88va_state *state = machine.driver_data<pc88va_state>();
1713   printf("R DMA\n");
1714   return state->m_fdc->dma_r();
1715}
1716
1717static void m_fdc_dma_w(running_machine &machine, UINT16 data)
1718{
1719   pc88va_state *state = machine.driver_data<pc88va_state>();
1720   printf("W DMA %08x\n",data);
1721   state->m_fdc->dma_w(data);
1722}
1723
1724
16901725/* ch2 is FDC, ch0/3 are "user". ch1 is unused */
16911726static const upd71071_intf pc88va_dma_config =
16921727{
16931728   "maincpu",
16941729   8000000,
1695   { 0, 0, 0, 0 },
1696   { 0, 0, 0, 0 }
1730   { 0, 0, m_fdc_dma_r, 0 },
1731   { 0, 0, m_fdc_dma_w, 0 }
16971732};
16981733
16991734static const floppy_format_type pc88va_floppy_formats[] = {
trunk/src/mess/drivers/apc.c
r19106r19107
735735void apc_state::fdc_drq(bool state)
736736{
737737//  printf("%02x DRQ\n",state);
738//  i8237_dreq0_w(m_dma, state);
739738   m_dmac->dreq1_w(state);
740
741739}
742740
743741void apc_state::fdc_irq(bool state)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team