Previous 199869 Revisions Next

r26172 Friday 15th November, 2013 at 10:47:37 UTC by Jürgen Buchmüller
Trying to track down why the microcode won't issue the KCOM← that initiates a sector read
[/branches/alto2/src/emu/cpu/alto2]a2disk.c alto2.c alto2.h
[/branches/alto2/src/emu/machine]diablo_hd.c

branches/alto2/src/emu/cpu/alto2/a2disk.c
r26171r26172
911911 * @brief monoflop 31a pulse duration
912912 * Rt = 15k, Cext = .47µF (=470000pF) => 2066120ns (~2ms)
913913 */
914#define   TW_READY   attotime::from_nsec(2066120)
914#define   TW_READY   2066120
915915
916916/**
917917 * @brief monoflop 31b pulse duration
r26171r26172
14601460   // check if write and erase gate, or read gate are changed
14611461   if ((m_task_wakeup & (1 << task_ksec)) || GET_KCOM_XFEROFF(m_dsk.kcom) || m_dsk.kfer) {
14621462      // sector task is active OR xferoff is set OR fatal error
1463      dhd->set_egate(1);
1464      dhd->set_wrgate(1);
1465      dhd->set_rdgate(1);
1463      dhd->set_egate(m_dsk.egate = 1);
1464      dhd->set_wrgate(m_dsk.wrgate = 1);
1465      dhd->set_rdgate(m_dsk.rdgate = 1);
14661466   } else {
14671467      // assert either erase and read or write gates depending on current record R/W
14681468      if (m_dsk.krwc & RWC_WRITE) {
14691469         // assert erase and write gates only if OKTORUN is high
14701470         if (m_dsk.ok_to_run) {
1471            dhd->set_egate(0);
1472            dhd->set_wrgate(0);
1471            dhd->set_egate(m_dsk.egate = 0);
1472            dhd->set_wrgate(m_dsk.wrgate = 0);
14731473         }
14741474      } else {
1475         // assert read gate
1476         dhd->set_rdgate(0);
1475         // assert read gate only if OKTORUN is high
1476         if (m_dsk.ok_to_run) {
1477            dhd->set_rdgate(m_dsk.rdgate = 0);
1478         }
14771479      }
14781480   }
14791481
r26171r26172
16531655   PUT_KSTAT_SEEKFAIL(m_dsk.kstat, m_dsk.seekok ? 0 : 1);
16541656
16551657   /* KSTAT[9] latch the drive seek/read/write status */
1656   PUT_KSTAT_SEEK(m_dsk.kstat, dhd ? dhd->get_seek_read_write_0() : 1);
1658   PUT_KSTAT_SEEK(m_dsk.kstat, dhd->get_seek_read_write_0());
16571659
16581660   /* KSTAT[10] latch the latched (FF 45a at CLRSTAT) ready status */
16591661   PUT_KSTAT_NOTRDY(m_dsk.kstat, m_dsk.ff_45a & JKFF_Q ? 1 : 0);
r26171r26172
16691671   LOG((LOG_DISK,1,"   ←KSTAT; BUS &= %#o\n", r));
16701672   LOG((LOG_DISK,2,"      sector     : %#o\n", GET_KSTAT_SECTOR(m_dsk.kstat)));
16711673   LOG((LOG_DISK,2,"      done       : %#o\n", GET_KSTAT_DONE(m_dsk.kstat)));
1672   LOG((LOG_DISK,2,"      seekfail   : %#o\n", GET_KSTAT_SEEKFAIL(m_dsk.kstat)));
1673   LOG((LOG_DISK,2,"      seek       : %#o\n", GET_KSTAT_SEEK(m_dsk.kstat)));
1674   LOG((LOG_DISK,2,"      notrdy     : %#o\n", GET_KSTAT_NOTRDY(m_dsk.kstat)));
1675   LOG((LOG_DISK,2,"      datalate   : %#o\n", GET_KSTAT_DATALATE(m_dsk.kstat)));
1676   LOG((LOG_DISK,2,"      idle       : %#o\n", GET_KSTAT_IDLE(m_dsk.kstat)));
1677   LOG((LOG_DISK,2,"      cksum      : %#o\n", GET_KSTAT_CKSUM(m_dsk.kstat)));
1674   LOG((LOG_DISK,2,"      seekfail   : %d\n", GET_KSTAT_SEEKFAIL(m_dsk.kstat)));
1675   LOG((LOG_DISK,2,"      seek       : %d\n", GET_KSTAT_SEEK(m_dsk.kstat)));
1676   LOG((LOG_DISK,2,"      notrdy     : %d\n", GET_KSTAT_NOTRDY(m_dsk.kstat)));
1677   LOG((LOG_DISK,2,"      datalate   : %d\n", GET_KSTAT_DATALATE(m_dsk.kstat)));
1678   LOG((LOG_DISK,2,"      idle       : %d\n", GET_KSTAT_IDLE(m_dsk.kstat)));
1679   LOG((LOG_DISK,2,"      cksum      : %d\n", GET_KSTAT_CKSUM(m_dsk.kstat)));
16781680   LOG((LOG_DISK,2,"      completion : %#o\n", GET_KSTAT_COMPLETION(m_dsk.kstat)));
16791681
16801682   m_bus &= r;
r26171r26172
19561958   m_dsk.ff_45b = update_jkff(s0, s1);
19571959
19581960   /* set or reset monoflop 31a, depending on drive READY' */
1959   m_dsk.ready_mf31a = dhd ? dhd->get_ready_0() : 1;
1961   m_dsk.ready_mf31a = dhd->get_ready_0();
19601962
19611963   /* start monoflop 31a, which resets ready_mf31a */
1962   m_dsk.ready_timer->adjust(TW_READY, 1);
1964   m_dsk.ready_timer->adjust(attotime::from_nsec(TW_READY), 1);
19631965   m_dsk.ready_timer->enable();
19641966}
19651967
r26171r26172
20152017   PUT_KADR_NOXFER(m_dsk.kadr, GET_KADR_NOXFER(m_bus));
20162018   PUT_KADR_UNUSED(m_dsk.kadr, GET_KADR_UNUSED(m_bus));
20172019
2018   /* get selected drive from DATA[14] output (FF 67a really) */
2019   unit = GET_KADDR_DRIVE(m_dsk.kaddr);
2020   /* latch head from DATA[13] */
2021   head = GET_KADDR_HEAD(m_dsk.dataout);
2022   PUT_KADDR_HEAD(m_dsk.kaddr, head);
2023   /* get the selected head, and select drive unit and head */
2020   unit = GET_KADDR_DRIVE(m_dsk.kaddr);   // get selected drive from DATA[14] output (FF 67a really)
2021   head = GET_KADDR_HEAD(m_dsk.dataout);   // latch head from DATA[13]
2022   PUT_KADDR_HEAD(m_dsk.kaddr, head);      // store in KADDR
2023
2024   /* take the selected head and select drive unit and head in the DIABLO HD */
20242025   diablo_hd_device* dhd = m_drive[unit];
2025   if (dhd)
2026      dhd->select(unit, head);
2026   dhd->select(unit, head);
20272027
2028   /* On KDAR← bit 0 of parts #36 and #37 is reset to 0, i.e. recno = 0 */
2028   /* On KDAR← load bit 0 of parts #36 and #37 is reset to 0, i.e. recno = 0 */
20292029   m_dsk.krecno = 0;
20302030   /* current read/write/check is that for the header */
20312031   m_dsk.krwc = GET_KADR_HEADER(m_dsk.kadr);
r26171r26172
20372037   LOG((LOG_DISK,2,"      data       : %s (%#o)\n",  rwc_name[GET_KADR_DATA(m_dsk.kadr)], GET_KADR_DATA(m_dsk.kadr)));
20382038   LOG((LOG_DISK,2,"      noxfer     : %#o\n",  GET_KADR_NOXFER(m_dsk.kadr)));
20392039   LOG((LOG_DISK,2,"      unused     : %#o (drive?)\n",  GET_KADR_UNUSED(m_dsk.kadr)));
2040
20412040   // TODO: show disk indicator in the GUI?
20422041}
20432042
r26171r26172
23502349   m_sysclkb1[3] = JKFF_CLK;
23512350
23522351   m_dsk.wdtskena = 1;
2352   m_dsk.egate = 1;
2353   m_dsk.wrgate = 1;
2354   m_dsk.rdgate = 1;
23532355
23542356   m_dsk.seclate = 0;
23552357   m_dsk.ok_to_run = 0;
branches/alto2/src/emu/cpu/alto2/alto2.c
r26171r26172
4242alto2_cpu_device::alto2_cpu_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) :
4343   cpu_device(mconfig, ALTO2, "Xerox Alto-II", tag, owner, clock, "alto2", __FILE__),
4444#if   ALTO2_DEBUG
45   m_log_types(LOG_ALL),
46   m_log_level(8),
45   m_log_types(LOG_DISK|LOG_KSEC|LOG_KWD),
46   m_log_level(6),
4747   m_log_newline(true),
4848#endif
4949   m_ucode_config("ucode", ENDIANNESS_BIG, 32, 12, -2 ),
branches/alto2/src/emu/cpu/alto2/alto2.h
r26171r26172
13831383      UINT16 kstat;               //!< S[0-15] disk status
13841384      UINT16 kcom;               //!< disk command (5 bits kcom[1-5])
13851385      UINT8 krecno;               //!< record number (2 bits indexing header, label, data, -/-)
1386      UINT8 egate;               //!< current erase gate signal to the DIABLO hd
1387      UINT8 wrgate;               //!< current write gate signal to the DIABLO hd
1388      UINT8 rdgate;               //!< current read gate signal to the DIABLO hd
13861389      UINT32 shiftin;               //!< input shift register
13871390      UINT32 shiftout;            //!< output shift register
13881391      UINT32 datain;               //!< disk data in latch
branches/alto2/src/emu/machine/diablo_hd.c
r26171r26172
10881088 */
10891089void diablo_hd_device::wr_data(int index, int wrdata)
10901090{
1091   if (m_wrgate_0)
1091   if (m_wrgate_0) {
1092      LOG_DRIVE((0,"[DHD]   %s: unit #%d wrgate not asserted\n", __FUNCTION__, m_unit));
10921093      return;   // write gate is not asserted (active 0)
1094   }
10931095
1094   if (index < 0 || index >= bits_per_sector())
1096   if (index < 0 || index >= bits_per_sector()) {
1097      LOG_DRIVE((0,"[DHD]   %s: unit #%d index out of range (%d)\n", __FUNCTION__, m_unit, index));
10951098      return;   // don't write before or beyond the sector
1099   }
10961100
1097   if (-1 == m_page)
1101   if (-1 == m_page) {
1102      LOG_DRIVE((0,"[DHD]   %s: unit #%d invalid page\n", __FUNCTION__, m_unit));
10981103      return;   // invalid page
1104   }
10991105
11001106   UINT32 *bits = expand_sector();
11011107   if (-1 == m_wrfirst)
11021108      m_wrfirst = index;
11031109
1104   LOG_DRIVE((7,"[DHD]   %s: write #%d %d/%d/%d bit #%d bit:%d\n", __FUNCTION__, m_unit, m_cylinder, m_head, m_sector, index, wrdata));
1110   LOG_DRIVE((7,"[DHD]   %s: unit #%d %d/%d/%d bit #%d bit:%d\n", __FUNCTION__, m_unit, m_cylinder, m_head, m_sector, index, wrdata));
11051111
11061112   if (index < GUARD_ZONE_BITS) {
11071113      /* don't write in the guard zone (?) */
r26171r26172
11241130{
11251131   int bit = 0;
11261132
1127   if (m_rdgate_0)
1128      return 0;   // read gate is not asserted (active 0)
1133   if (m_rdgate_0) {
1134      LOG_DRIVE((9,"[DHD]   %s: unit #%d rdgate not asserted\n", __FUNCTION__, m_unit));
1135      return 1;   // read gate is not asserted (active 0)
1136   }
11291137
1130   if (index < 0 || index >= bits_per_sector())
1138   if (index < 0 || index >= bits_per_sector()) {
1139      LOG_DRIVE((0,"[DHD]   %s: unit #%d index out of range (%d)\n", __FUNCTION__, m_unit, index));
11311140      return 1;   // don't read before or beyond the sector
1141   }
11321142
1133   if (0 == m_sector_mark_0)
1134      return 1;   // no data while sector mark is low (?)
1143   if (0 == m_sector_mark_0) {
1144      LOG_DRIVE((0,"[DHD]   %s: unit #%d read while sector mark is asserted\n", __FUNCTION__, m_unit));
1145      return 1;   // no data while sector mark is asserted
1146   }
11351147
1136   if (-1 == m_page)
1148   if (-1 == m_page) {
1149      LOG_DRIVE((0,"[DHD]   %s: unit #%d invalid page\n", __FUNCTION__, m_unit));
11371150      return 1;   // invalid page
1151   }
11381152
11391153   UINT32 *bits = expand_sector();
11401154   if (-1 == m_rdfirst)
r26171r26172
11591173{
11601174   int clk = 0;
11611175
1162   if (index < 0 || index >= bits_per_sector())
1176   if (index < 0 || index >= bits_per_sector()) {
1177      LOG_DRIVE((0,"[DHD]   %s: unit #%d index out of range (%d)\n", __FUNCTION__, m_unit, index));
11631178      return 1;   // don't read before or beyond the sector
1179   }
11641180
1165   if (0 == m_sector_mark_0)
1181   if (0 == m_sector_mark_0) {
1182      LOG_DRIVE((0,"[DHD]   %s: unit #%d read while sector mark is asserted\n", __FUNCTION__, m_unit));
11661183      return 1;   // no clock while sector mark is low (?)
1184   }
11671185
1168   if (-1 == m_page)
1186   if (-1 == m_page) {
1187      LOG_DRIVE((0,"[DHD]   %s: unit #%d invalid page\n", __FUNCTION__, m_unit));
11691188      return 1;   // invalid page
1189   }
11701190
11711191   UINT32 *bits = expand_sector();
11721192   if (-1 == m_rdfirst)
r26171r26172
12721292   m_seek_incomplete_0 = 1;      // deassert drive seek incomplete
12731293
12741294   // reset the disk drive's address
1275   m_cylinder = -1;
1276   m_head = -1;
1277   m_sector = -1;
1278   m_page = -1;
1295   m_cylinder = 0;
1296   m_head = 0;
1297   m_sector = 0;
1298   m_page = 0;
12791299
12801300   // disable the erase, write and read gates
12811301   m_egate_0 = 1;
r26171r26172
13061326 */
13071327void diablo_hd_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
13081328{
1309   LOG_DRIVE((6,"[DHD]   %s: id=%d param=%d ptr=%p\n", __FUNCTION__, id, param, ptr));
1329   LOG_DRIVE((6,"[DHD]   %s: id=%d param=%d ptr=%p @%lldns\n", __FUNCTION__, id, param, ptr, (long long int)(timer.elapsed().as_double() * ATTOSECONDS_PER_NANOSECOND)));
13101330
13111331   switch (param) {
13121332   case 0:

Previous 199869 Revisions Next


© 1997-2024 The MAME Team