branches/alto2/src/emu/cpu/alto2/a2disk.c
| r26173 | r26174 | |
| 1036 | 1036 | */ |
| 1037 | 1037 | #define INIT (m_task == task_kwd && m_dsk.wdinit0) |
| 1038 | 1038 | |
| 1039 | | #define WFFO (GET_KCOM_WFFO(m_dsk.kcom)) |
| 1040 | 1039 | #define WDALLOW (!GET_KCOM_WDINHIB(m_dsk.kcom)) |
| 1041 | 1040 | #define WDINIT ((m_dsk.ff_53b & JKFF_Q) ? 1 : 0) |
| 1042 | 1041 | #define RDYLAT ((m_dsk.ff_45a & JKFF_Q) ? 1 : 0) |
| r26173 | r26174 | |
| 1077 | 1076 | } |
| 1078 | 1077 | } |
| 1079 | 1078 | if (0 != m_dsk.seclate && m_dsk.bitclk && !bitclk) { |
| 1080 | | // if SECLATE is 1, the counter will count or load: |
| 1081 | | if ((m_dsk.shiftin & (1 << 16)) && !WFFO) { |
| 1079 | // if SECLATE is 1, the counter will count or be loaded |
| 1080 | if ((m_dsk.shiftin & (1 << 16)) && !GET_KCOM_WFFO(m_dsk.kcom)) { |
| 1082 | 1081 | /* |
| 1083 | 1082 | * If HIORDBIT is 1 at the falling edge of BITCLK, it sets the |
| 1084 | 1083 | * JK-FF 67b, and thus takes away the LOAD' assertion from the |
| r26173 | r26174 | |
| 1094 | 1093 | * with BUS[4] (WFFO) at the last KCOM← load, or as set by a |
| 1095 | 1094 | * 1 bit being read in HIORDBIT. |
| 1096 | 1095 | */ |
| 1097 | | if (WFFO) { |
| 1096 | if (GET_KCOM_WFFO(m_dsk.kcom)) { |
| 1098 | 1097 | /* |
| 1099 | 1098 | * If BUS[4] (WFFO) was 1, both J and K' of the FF (74109) will |
| 1100 | 1099 | * be 1 at the rising edge of LDCOM' (at the end of KCOM←) |
| r26173 | r26174 | |
| 1106 | 1105 | } else { |
| 1107 | 1106 | /* |
| 1108 | 1107 | * If BUS[4] (WFFO) was 0, both J and K' will be 0, and Q |
| 1109 | | * will be 0. LOAD' is asserted: load on clock. |
| 1108 | * will be 0. LOAD' is asserted and will load on rising bitclock (now) |
| 1110 | 1109 | */ |
| 1111 | 1110 | m_dsk.bitcount = 15; |
| 1112 | 1111 | m_dsk.carry = 1; |
| r26173 | r26174 | |
| 1448 | 1447 | s1 |= JKFF_C; |
| 1449 | 1448 | m_dsk.ff_21a = update_jkff(s0, s1); |
| 1450 | 1449 | |
| 1451 | | /* |
| 1452 | | * If the KSEC FF 21a Q goes 1, pulse the SECLATE signal for |
| 1453 | | * some time. |
| 1454 | | */ |
| 1450 | // If the KSEC FF 21a Q goes 1, pulse the SECLATE signal for some time. |
| 1455 | 1451 | if ((m_dsk.ff_21a_old & JKFF_Q0) && (m_dsk.ff_21a & JKFF_Q)) { |
| 1456 | 1452 | m_dsk.seclate_timer->adjust(attotime::from_nsec(TW_SECLATE), 1); |
| 1457 | 1453 | if (m_dsk.seclate) { |
| r26173 | r26174 | |
| 1481 | 1477 | dhd->set_egate(m_dsk.egate = 1); |
| 1482 | 1478 | dhd->set_wrgate(m_dsk.wrgate = 1); |
| 1483 | 1479 | dhd->set_rdgate(m_dsk.rdgate = 1); |
| 1484 | | } else if (m_dsk.ok_to_run) { |
| 1485 | | if (m_dsk.krwc & RWC_WRITE) { |
| 1486 | | // assert erase and write gates |
| 1487 | | dhd->set_egate(m_dsk.egate = 0); |
| 1488 | | dhd->set_wrgate(m_dsk.wrgate = 0); |
| 1480 | } else { |
| 1481 | if (m_dsk.krwc & RWC_WRITE) { |
| 1482 | if (m_dsk.ok_to_run) { |
| 1483 | #if ALTO2_DEBUG |
| 1484 | if (1 == m_dsk.egate || 1 == m_dsk.wrgate) { |
| 1485 | LOG((LOG_DISK,6," assert ")); |
| 1486 | if (m_dsk.egate) { |
| 1487 | LOG((LOG_DISK,6," EGATE")); |
| 1488 | } |
| 1489 | if (m_dsk.wrgate) { |
| 1490 | LOG((LOG_DISK,6," WRGATE")); |
| 1491 | } |
| 1492 | } |
| 1493 | #endif |
| 1494 | // assert erase and write gates |
| 1495 | dhd->set_egate(m_dsk.egate = 0); |
| 1496 | dhd->set_wrgate(m_dsk.wrgate = 0); |
| 1497 | } |
| 1489 | 1498 | } else { |
| 1499 | #if ALTO2_DEBUG |
| 1500 | if (1 == m_dsk.rdgate) { |
| 1501 | LOG((LOG_DISK,6," assert RDGATE")); |
| 1502 | } |
| 1503 | #endif |
| 1490 | 1504 | // assert read gate |
| 1491 | 1505 | dhd->set_rdgate(m_dsk.rdgate = 0); |
| 1492 | 1506 | } |
| r26173 | r26174 | |
| 1514 | 1528 | (void)ptr; |
| 1515 | 1529 | LOG((LOG_DISK,2," OK TO RUN -> %d\n", arg)); |
| 1516 | 1530 | m_dsk.ok_to_run = arg; |
| 1517 | | m_dsk.ok_to_run_timer->enable(false); |
| 1531 | m_dsk.ok_to_run_timer->reset(); |
| 1518 | 1532 | |
| 1519 | 1533 | for (int unit = 0; unit < diablo_hd_device::DIABLO_UNIT_MAX; unit++) { |
| 1520 | 1534 | diablo_hd_device* dhd = m_drive[unit]; |
| r26173 | r26174 | |
| 1985 | 1999 | * KCOM register has the following interpretation: |
| 1986 | 2000 | * (1) XFEROFF = 1 inhibits data transmission to/from the m_dsk. |
| 1987 | 2001 | * (2) WDINHIB = 1 prevents the disk word task from awakening. |
| 1988 | | * (3) BCLKSRC = 0 takes bit clock from disk input or crystal clock, |
| 1989 | | * as appropriate. BCLKSRC = 1 force use of crystal clock. |
| 2002 | * (3) BCLKSRC = 0 takes bit clock from disk input or crystal clock, as appropriate. |
| 2003 | * BCLKSRC = 1 force use of crystal clock. |
| 1990 | 2004 | * (4) WFFO = 0 holds the disk bit counter at -1 until a 1 bit is read. |
| 1991 | 2005 | * WFFO = 1 allows the bit counter to proceed normally. |
| 1992 | | * (5) SENDADR = 1 causes KDATA[4-12] and KDATA[15] to be transmitted |
| 1993 | | * to disk unit as track address. SENDADR = 0 inhibits such |
| 1994 | | * transmission. |
| 2006 | * (5) SENDADR = 1 causes KDATA[4-12] and KDATA[15] to be signalled to disk unit as track address. |
| 2007 | * SENDADR = 0 inhibits such signalling. |
| 1995 | 2008 | * </PRE> |
| 1996 | 2009 | */ |
| 1997 | 2010 | void alto2_cpu_device::f1_load_kcom_1() |