Previous 199869 Revisions Next

r26241 Sunday 17th November, 2013 at 22:47:57 UTC by Jürgen Buchmüller
You can't have bit #16 set in an UINT16 :) Now the microcode loads pages from the DIABLO31. Display is next.
[/branches/alto2/src/emu/cpu/alto2]a2disk.c alto2.c alto2.h
[/branches/alto2/src/emu/machine]diablo_hd.c

branches/alto2/src/emu/machine/diablo_hd.c
r26240r26241
11391139
11401140   if (m_rdgate_0) {
11411141      LOG_DRIVE((0,"[DHD%u]   rdgate not asserted\n", m_unit));
1142      return 1;   // read gate is not asserted (active 0)
1142      return 0;   // read gate is not asserted (active 0)
11431143   }
11441144
11451145   if (index < 0 || index >= bits_per_sector()) {
r26240r26241
11821182
11831183   if (index < 0 || index >= bits_per_sector()) {
11841184      LOG_DRIVE((0,"[DHD%u]   index out of range (%d)\n", m_unit, index));
1185      return 0;   // don't read before or beyond the sector
1185      return 1;   // don't read before or beyond the sector
11861186   }
11871187
11881188   if (0 == m_sector_mark_0) {
11891189      LOG_DRIVE((0,"[DHD%u]   read while sector mark is asserted\n", m_unit));
1190      return 0;   // no clock while sector mark is low (?)
1190      return 1;   // no clock while sector mark is low (?)
11911191   }
11921192
11931193   if (-1 == m_page) {
11941194      LOG_DRIVE((0,"[DHD%u]   invalid page\n", m_unit));
1195      return 0;   // invalid page
1195      return 1;   // invalid page
11961196   }
11971197
11981198   UINT32 *bits = expand_sector();
r26240r26241
12981298   // reset the disk drive's address
12991299   m_cylinder = 0;
13001300   m_head = 0;
1301   m_sector = 10;
1302   m_page = 10;
1301   m_sector = 0;
1302   m_page = 0;
13031303
13041304   // disable the erase, write and read gates
13051305   m_egate_0 = 1;
branches/alto2/src/emu/cpu/alto2/a2disk.c
r26240r26241
1010#include "alto2.h"
1111
1212
13#define   JKFF_FUNCTION   0   //!< define 1 to debug the JK flip-flops, 0 to use a lookup table
13#define   JKFF_FUNCTION   1   //!< define 1 to debug the JK flip-flops, 0 to use a lookup table
1414
1515#define   GET_KADDR_SECTOR(kaddr)         A2_GET16(kaddr,16, 0, 3)         //!< get sector number from address register
1616#define   PUT_KADDR_SECTOR(kaddr,val)      A2_PUT16(kaddr,16, 0, 3,val)      //!< put sector number into address register
r26240r26241
915915 *  TW_SECLATE   (46*ALTO2_UCYCLE)
916916 *  TW_SECLATE   8596
917917 */
918#define TW_SECLATE  (50*ALTO2_UCYCLE)
918#define TW_SECLATE  8596
919919
920920/** @brief monoflop 52b pulse duration
921921 * Rt = 20k, Cext = 0.01µF (=10000pF) => 57960ns (~58us)
r26240r26241
10471047   int i;
10481048   UINT8 s0, s1;
10491049
1050   LOG((LOG_DISK,9,"   *** KWD timing bitclk:%d datin:%d block:%d\n", bitclk, datin, block));
1050   LOG((LOG_DISK,8,"   *** KWD timing bitclk:%d datin:%d block:%d\n", bitclk, datin, block));
10511051   if (0 == m_dsk.seclate) {
10521052      // if SECLATE is 0, WDDONE' never goes low (counter's clear has precedence).
10531053      if (m_dsk.bitcount || m_dsk.carry) {
r26240r26241
11381138    */
11391139   DEBUG_NAME("\t\t43b KWD   ");
11401140   s0 = m_dsk.ff_43b;
1141   s1 = wddone ? JKFF_CLK : 0;
1141   s1 = wddone ? JKFF_CLK : JKFF_0;
11421142   s1 |= JKFF_J;
11431143   s1 |= JKFF_K;
11441144   if (m_dsk.ok_to_run)
r26240r26241
13471347    * If Q (53a) and Q (43a) are both 1, the WAKEKWDT'
13481348    * output is 0 and the disk word task wakeup signal is asserted.
13491349    */
1350   if (m_dsk.ff_53a & m_dsk.ff_43a & JKFF_Q) {
1350   if ((m_dsk.ff_53a & JKFF_Q) && (m_dsk.ff_43a & JKFF_Q)) {
13511351      if (m_dsk.wdtskena == 1) {
13521352         LOG((LOG_DISK,2,"   WDTSKENA':0 and WAKEKWDT':0 wake KWD\n"));
13531353         m_dsk.wdtskena = 0;
r26240r26241
15151515   (void)ptr;
15161516   LOG((LOG_DISK,2,"   OK TO RUN -> %d\n", arg));
15171517   m_dsk.ok_to_run = arg;
1518   m_dsk.ok_to_run_timer->reset();
1518   m_dsk.ok_to_run_timer->enable(false);
15191519}
15201520
15211521/**
r26240r26241
15411541void alto2_cpu_device::disk_strobon(void* ptr, INT32 arg)
15421542{
15431543   (void)ptr;
1544   UINT8 unit = static_cast<UINT8>(arg & 1);
1545   UINT8 restore = static_cast<UINT8>((arg >> 1) & 1);
1546   INT32 cylinder = arg >> 2;
1544   UINT8 unit = arg % 2;
1545   UINT8 restore = (arg / 2) % 2;
1546   INT32 cylinder = arg / 4;
15471547   int seekok;
15481548   int lai;
15491549   int strobe;
15501550
15511551   diablo_hd_device* dhd = m_drive[unit];
1552   if (!dhd) {
1553      // FIXME: set all signals for a not connected drive
1554      return;
1555   }
1556   LOG((LOG_DISK,2,"   STROBE #%d restore:%d cylinder:%d\n", unit, restore, cylinder));
1552   LOG((LOG_DISK,2,"   STROBE #%d restore:%d cylinder:%d dhd:%p\n", unit, restore, cylinder, dhd));
15571553
15581554   /* This is really monoflop 52a generating a very short 0 pulse */
15591555   for (strobe = 0; strobe < 2; strobe++) {
r26240r26241
15951591   } else {
15961592      /* clear the monoflop 52b, i.e. no timer restart */
15971593      LOG((LOG_DISK,2,"      STROBON:%d\n", m_dsk.strobe));
1598
15991594      /* update the seekok status: SKINC' && LAI' && Q' of FF 44a */
16001595      seekok = dhd->get_seek_incomplete_0();
16011596      if (seekok != m_dsk.seekok) {
r26240r26241
16491644 */
16501645void alto2_cpu_device::bs_read_kstat_0()
16511646{
1647   diablo_hd_device* dhd = m_drive[m_dsk.drive];
16521648   UINT16 r;
1653   int unit = m_dsk.drive;
1654   diablo_hd_device* dhd = m_drive[unit];
16551649
16561650   /* KSTAT[4-7] bus is open */
16571651   PUT_KSTAT_DONE(m_dsk.kstat, 017);
r26240r26241
19721966   /* start monoflop 31a, which resets ready_mf31a */
19731967   m_dsk.ready_timer->adjust(attotime::from_nsec(TW_READY), 1);
19741968
1975   LOG((LOG_DISK,1,"   CLRSTAT (44a_Q:%d 44b_Q:%d 45a_Q:%d 45b_Q:%d 31a_Q:%d)\n",
1969   LOG((LOG_DISK,1,"   CLRSTAT (44a:%d 44b:%d 45a:%d 45b:%d 31a:%d)\n",
19761970       m_dsk.ff_44a & JKFF_Q ? 1 : 0, m_dsk.ff_44b & JKFF_Q ? 1 : 0,
19771971       m_dsk.ff_45a & JKFF_Q ? 1 : 0, m_dsk.ff_45b & JKFF_Q ? 1 : 0,
19781972       m_dsk.ready_mf31a));
r26240r26241
22642258      kwd_timing(clk, bit, 0);
22652259   }
22662260
2261#if   USE_BITCLK_TIMER
22672262   /* more bits to clock? */
22682263   if (++arg < dhd->bits_per_sector()) {
2269#if   USE_BITCLK_TIMER
22702264      m_dsk.bitclk_timer->adjust(dhd->bit_time(), arg);
2265   } else {
2266      m_dsk.bitclk_timer->reset();
2267   }
22712268#else
2269   if (++arg < dhd->bits_per_sector()) {
22722270      if (!m_dsk.bitclk_time)
22732271         m_dsk.bitclk_time = static_cast<int>(dhd->bit_time().as_double() * ATTOSECONDS_PER_NANOSECOND);
22742272      m_bitclk_time += m_dsk.bitclk_time;
22752273      m_bitclk_index = arg;
2276#endif
22772274   } else {
22782275      // stop the bitclock timer
22792276      m_bitclk_time = -1;
22802277   }
2278#endif
22812279}
22822280
22832281/**
r26240r26241
22902288   diablo_hd_device* dhd = m_drive[unit];
22912289   LOG((LOG_DISK,0,"%s dhd=%p\n", __FUNCTION__, dhd));
22922290#if   USE_BITCLK_TIMER
2293   if (m_dsk.bitclk_timer) {
2294      LOG((LOG_DISK,0,"   unit #%d stop bitclk\n", unit));
2295      m_dsk.bitclk_timer->reset();
2296   }
2291   LOG((LOG_DISK,0,"   unit #%d stop bitclk\n", unit));
2292   m_dsk.bitclk_timer->enable(false);
22972293#else
22982294   if (m_bitclk_time >= 0) {
22992295      LOG((LOG_DISK,0,"   unit #%d stop bitclk\n", unit));
r26240r26241
23802376   m_dsk.strobon_timer->reset();
23812377
23822378   m_dsk.seclate_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(alto2_cpu_device::disk_seclate),this));
2383   // m_dsk.seclate_timer->adjust(attotime::from_nsec(TW_SECLATE), 1);
2379//   m_dsk.seclate_timer->adjust(attotime::from_nsec(TW_SECLATE), 1);
23842380   m_dsk.seclate_timer->reset();
23852381
23862382   m_dsk.ok_to_run_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(alto2_cpu_device::disk_ok_to_run),this));
branches/alto2/src/emu/cpu/alto2/alto2.c
r26240r26241
8686alto2_cpu_device::alto2_cpu_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) :
8787   cpu_device(mconfig, ALTO2, "Xerox Alto-II", tag, owner, clock, "alto2", __FILE__),
8888#if   ALTO2_DEBUG
89   m_log_types(LOG_ALL),
89   m_log_types(LOG_DISK|LOG_KSEC|LOG_KWD),
9090   m_log_level(8),
9191   m_log_newline(true),
9292#endif
branches/alto2/src/emu/cpu/alto2/alto2.h
r26240r26241
2626#define   USE_PRIO_F9318         0   //!< define to 1 to use the F9318 priority encoder code
2727#define   USE_ALU_74181         0   //!< define to 1 to use the SN74181 ALU code
2828#define   DEBUG_DISPLAY_TIMING   0   //!< define to 1 to debug the display timing
29#define   USE_BITCLK_TIMER      1   //!< define to 1 to use a very high rate timer for the disk bit clock
29#define   USE_BITCLK_TIMER      0   //!< define to 1 to use a very high rate timer for the disk bit clock
3030#define   ALTO2_HAMMING_CHECK      0   //!< define to 1 to incorporate the Hamming code and Parity check
3131
3232#define   ALTO2_TASKS      16         //!< 16 task slots
r26240r26241
14091409      UINT8 egate;               //!< current erase gate signal to the DIABLO hd
14101410      UINT8 wrgate;               //!< current write gate signal to the DIABLO hd
14111411      UINT8 rdgate;               //!< current read gate signal to the DIABLO hd
1412      UINT16 shiftin;               //!< input shift register
1413      UINT16 shiftout;            //!< output shift register
1414      UINT16 datain;               //!< disk data in latch
1415      UINT16 dataout;               //!< disk data out latch
1412      UINT32 shiftin;               //!< input shift register
1413      UINT32 shiftout;            //!< output shift register
1414      UINT32 datain;               //!< disk data in latch
1415      UINT32 dataout;               //!< disk data out latch
14161416      UINT8 krwc;                  //!< read/write/check for current record
14171417      UINT8 kfer;                  //!< disk fatal error signal state
14181418      UINT8 wdtskena;               //!< disk word task enable (active low)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team