Previous 199869 Revisions Next

r26199 Saturday 16th November, 2013 at 17:12:29 UTC by Jürgen Buchmüller
Fill in MMIO memory map with regusage.txt descriptions. No logging on debugger access.
[/branches/alto2/src/emu/cpu/alto2]a2hw.c a2kbd.c a2mem.c alto2.c alto2.h

branches/alto2/src/emu/cpu/alto2/alto2.c
r26198r26199
3232
3333DEVICE_ADDRESS_MAP_START( iomem_map, 16, alto2_cpu_device )
3434   AM_RANGE(0,                          ALTO2_IO_PAGE_BASE - 1)            AM_READWRITE( ioram_r, ioram_w )
35   AM_RANGE(ALTO2_IO_PAGE_BASE,         0177777)                           AM_NOP
36   AM_RANGE(0177016,                    0177016)                           AM_READWRITE( utilout_r, utilout_w )
37   AM_RANGE(0177020,                    0177023)                           AM_READWRITE( xbus_r,  xbus_w )
38   AM_RANGE(0177024,                    0177024)                           AM_READ     ( mear_r )
39   AM_RANGE(0177025,                    0177025)                           AM_READWRITE( mesr_r,  mesr_w  )
40   AM_RANGE(0177026,                    0177026)                           AM_READWRITE( mecr_r,  mecr_w  )
41   AM_RANGE(0177030,                    0177033)                           AM_READ     ( utilin_r )
42   AM_RANGE(0177034,                    0177037)                           AM_READ     ( kbd_ad_r )
43   AM_RANGE(0177040,                    0177057)                           AM_READWRITE( bank_reg_r, bank_reg_w )
35   // page 0376
36   AM_RANGE(0177000,                    0177015)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
37   AM_RANGE(0177016,                    0177016)                           AM_READWRITE( utilout_r, utilout_w )    // UTILOUT register
38   AM_RANGE(0177017,                    0177017)                           AM_READWRITE( noop_r, noop_w )          // unused range
39   AM_RANGE(0177020,                    0177023)                           AM_READWRITE( xbus_r,  xbus_w )         // XBUS[0-3] registers
40   AM_RANGE(0177024,                    0177024)                           AM_READ     ( mear_r )                  // MEAR (memory error address register)
41   AM_RANGE(0177025,                    0177025)                           AM_READWRITE( mesr_r,  mesr_w  )        // MESR (memory error status register)
42   AM_RANGE(0177026,                    0177026)                           AM_READWRITE( mecr_r,  mecr_w  )        // MECR (memory error control register)
43   AM_RANGE(0177027,                    0177027)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
44   AM_RANGE(0177030,                    0177033)                           AM_READ     ( utilin_r )                // UTILIN register
45   AM_RANGE(0177034,                    0177037)                           AM_READ     ( kbd_ad_r )                // KBD_AD[0-3] matrix
46   AM_RANGE(0177040,                    0177057)                           AM_READWRITE( bank_reg_r, bank_reg_w )  // BANK[0-17] registers (4 bit)
47   AM_RANGE(0177060,                    0177077)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
48   AM_RANGE(0177100,                    0177101)                           AM_READWRITE( noop_r, noop_w )          // { Summagraphics tablet X, Y }
49   AM_RANGE(0177102,                    0177137)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
50   AM_RANGE(0177140,                    0177157)                           AM_READWRITE( noop_r, noop_w )          // { Organ keyboard }
51   AM_RANGE(0177160,                    0177177)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
52   AM_RANGE(0177200,                    0177204)                           AM_READWRITE( noop_r, noop_w )          // { PROM programmer }
53   AM_RANGE(0177205,                    0177233)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
54   AM_RANGE(0177234,                    0177237)                           AM_READWRITE( noop_r, noop_w )          // { Experimental cursor control }
55   AM_RANGE(0177240,                    0177257)                           AM_READWRITE( noop_r, noop_w )          // { Alto-II debugger }
56//  AM_RANGE(0177244,                    0177247)                           AM_READWRITE( noop_r, noop_w )          // { Graphics keyboard }
57   AM_RANGE(0177260,                    0177377)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
58   // page 0377
59//   AM_RANGE(0177400,                    0177405)                           AM_READWRITE( noop_r, noop_w )          // { Maxc2 maintenance interface }
60   AM_RANGE(0177400,                    0177400)                           AM_READWRITE( noop_r, noop_w )          // { Alto DLS input }
61   AM_RANGE(0177401,                    0177417)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
62   AM_RANGE(0177420,                    0177420)                           AM_READWRITE( noop_r, noop_w )          // { "" }
63   AM_RANGE(0177421,                    0177437)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
64   AM_RANGE(0177440,                    0177440)                           AM_READWRITE( noop_r, noop_w )          // { "" }
65   AM_RANGE(0177441,                    0177457)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
66   AM_RANGE(0177460,                    0177460)                           AM_READWRITE( noop_r, noop_w )          // { "" }
67   AM_RANGE(0177461,                    0177577)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
68   AM_RANGE(0177600,                    0177677)                           AM_READWRITE( noop_r, noop_w )          // { Alto DLS output }
69   AM_RANGE(0177700,                    0177700)                           AM_READWRITE( noop_r, noop_w )          // { EIA interface output bit }
70   AM_RANGE(0177701,                    0177701)                           AM_READWRITE( noop_r, noop_w )          // { EIA interface input bit }
71   AM_RANGE(0177702,                    0177717)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
72   AM_RANGE(0177720,                    0177737)                           AM_READWRITE( noop_r, noop_w )          // { TV camera interface }
73   AM_RANGE(0177740,                    0177763)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
74   AM_RANGE(0177764,                    0177773)                           AM_READWRITE( noop_r, noop_w )          // { Redactron tape drive }
75   AM_RANGE(0177774,                    0177775)                           AM_READWRITE( noop_r, noop_w )          // UNUSED RANGE
76   AM_RANGE(0177776,                    0177776)                           AM_READWRITE( noop_r, noop_w )          // { Digital-Analog Converter, Joystick }
77   AM_RANGE(0177777,                    0177777)                           AM_READWRITE( noop_r, noop_w )          // { Digital-Analog Converter, Joystick }
78
4479   AM_RANGE(0200000,                    0377777)                           AM_READWRITE( ioram_r, ioram_w )
4580ADDRESS_MAP_END
4681
r26198r26199
14991534        task_name(m_task), m_mpc, f2_name(MIR_F2(m_mir)));
15001535}
15011536
1537#if   ALTO2_DEBUG
1538typedef struct {
1539   UINT16 first, last;
1540   const char* name;
1541}   memory_range_name_t;
1542
1543memory_range_name_t memory_range_name_table[] = {
1544   {0177016, 0177017,   "UTILOUT    Printer output (Std. Hardware)"},
1545   {0177020, 0177023,   "XBUS       Utility input bus (Alto II Std. Hardware)"},
1546   {0177024, 0177024,   "MEAR       Memory Error Address Register (Alto II Std. Hardware)"},
1547   {0177025, 0177025,   "MESR       Memory error status register (Alto II Std. Hardware)"},
1548   {0177026, 0177026,  "MECR       Memory error control register (Alto II Std. Hardware)"},
1549   {0177030, 0177033,   "UTILIN     Printer status, mouse, keyset (all 4 locations return same thing)"},
1550   {0177034, 0177037,   "KBDAD      Undecoded keyboard (Std. Hardware)"},
1551   {0177740, 0177757,   "BANKREGS   Extended memory option bank registers"},
1552   {0177100, 0177100,   "-          Sumagraphics tablet X"},
1553   {0177101, 0177101,   "-          Sumagraphics tablet Y"},
1554   {0177140, 0177157,   "-          Organ keyboard"},
1555   {0177200, 0177204,   "-          PROM programmer"},
1556   {0177234, 0177237,   "-          Experimental ursor control"},
1557   {0177240, 0177257,   "-          Alto II debugger"},
1558   {0177244, 0177247,   "-          Graphics keyboard"},
1559   {0177400, 0177405,   "-          Maxc2 maintenance interface"},
1560   {0177400, 0177400,   "-          Alto DLS input (0)"},
1561   {0177420, 0177420,   "-          Alto DLS input (1)"},
1562   {0177440, 0177440,   "-          Alto DLS input (2)"},
1563   {0177460, 0177460,   "-          Alto DLS input (3)"},
1564   {0177600, 0177677,   "-          Alto DLS output"},
1565   {0177700, 0177700,   "-          EIA interface output bit"},
1566   {0177701, 0177701,   "EIALOC     EIA interface input bit"},
1567   {0177720, 0177737,   "-          TV Camera Interface"},
1568   {0177764, 0177773,   "-          Redactron tape drive"},
1569   {0177776, 0177776,   "-          Digital-Analog Converter, Joystick"},
1570   {0177777, 0177777,   "-          Digital-Analog Converter, Joystick"}
1571};
1572
1573static const char* memory_range_name(offs_t offset)
1574{
1575   int _min = 0;
1576   int _max = sizeof(memory_range_name_table) / sizeof(memory_range_name_table[0]) - 1;
1577   int _mid;
1578
1579   offset %= ALTO2_IO_PAGE_SIZE;
1580   offset += ALTO2_IO_PAGE_BASE;
1581
1582   /* binary search in table of unicode ranges */
1583   while (_max >= _min)
1584   {
1585      _mid = (_min + _max) / 2;
1586      if (memory_range_name_table[_mid].last < offset)
1587         _min = _mid + 1;
1588      else if (memory_range_name_table[_mid].first > offset)
1589         _max = _mid - 1;
1590      else if (memory_range_name_table[_mid].first <= offset &&
1591             memory_range_name_table[_mid].last >= offset)
1592         return memory_range_name_table[_mid].name;
1593   }
1594   return "-          UNUSED";
1595}
1596
1597#endif
1598
15021599/**
1600 * @brief read the open bus for unused MMIO range
1601 */
1602READ16_MEMBER( alto2_cpu_device::noop_r )
1603{
1604   LOG((LOG_CPU,0,"   MMIO rd %s\n", memory_range_name(offset)));
1605   return 0177777;
1606}
1607
1608/**
1609 * @brief write nowhere for unused MMIO range
1610 */
1611WRITE16_MEMBER( alto2_cpu_device::noop_w )
1612{
1613   LOG((LOG_CPU,0,"   MMIO wr %s\n", memory_range_name(offset)));
1614}
1615
1616/**
15031617 * @brief read bank register in memory mapped I/O range
15041618 *
15051619 * The bank registers are stored in a 16x4-bit RAM 74S189.
branches/alto2/src/emu/cpu/alto2/a2kbd.c
r26198r26199
3333      break;
3434   }
3535   m_kbd.matrix[offset & 03] = data;
36   LOG((LOG_KBD,2,"   read KBDAD+%o (%#o)\n", offset & 3, data));
36   if (!space.debugger_access()) {
37      LOG((LOG_KBD,2,"   read KBDAD+%o (%#o)\n", offset & 3, data));
38   }
3739   if (0 == (offset & 3) && (m_kbd.bootkey != 0177777)) {
38      LOG((0,2,"   boot keys (%#o & %#o)\n", data, m_kbd.bootkey));
40      if (!space.debugger_access()) {
41         LOG((0,2,"   boot keys (%#o & %#o)\n", data, m_kbd.bootkey));
42      }
3943      data &= m_kbd.bootkey;
4044      m_kbd.bootkey = 0177777;
4145   }
branches/alto2/src/emu/cpu/alto2/alto2.h
r26198r26199
10801080   void fn_f2_bad_0();                        //! f2 dummy early function
10811081   void fn_f2_bad_1();                        //! f2 dummy late function
10821082
1083   DECLARE_READ16_MEMBER( noop_r );            //!< read open bus (0177777)
1084   DECLARE_WRITE16_MEMBER( noop_w );            //!< write open bus
1085
10831086   DECLARE_READ16_MEMBER( bank_reg_r );         //!< read bank register in memory mapped I/O range
10841087   DECLARE_WRITE16_MEMBER( bank_reg_w );         //!< write bank register in memory mapped I/O range
10851088
branches/alto2/src/emu/cpu/alto2/a2hw.c
r26198r26199
2323
2424   data = m_hw.utilin;
2525
26   LOG((LOG_HW,2,"   read UTILIN %#o (%#o)\n", offset, data));
26   if (!space.debugger_access()) {
27      LOG((LOG_HW,2,"   UTILIN rd %#o (%#o)\n", offset, data));
28   }
2729   return data;
2830}
2931
r26198r26199
3739{
3840   UINT16 data = m_hw.xbus[offset & 3];
3941
40   LOG((LOG_HW,2,"   read XBUS[%d] %#o (%#o)\n", offset & 3, offset, data));
42   if (!space.debugger_access()) {
43      LOG((LOG_HW,2,"   XBUS[%d] rd %#o (%#o)\n", offset & 3, offset, data));
44   }
4145   return data;
4246}
4347
r26198r26199
5155 */
5256WRITE16_MEMBER( alto2_cpu_device::xbus_w )
5357{
54   LOG((LOG_HW,2,"   write XBUS[%d] %#o (%#o)\n", offset & 3, offset, data));
58   if (!space.debugger_access()) {
59      LOG((LOG_HW,2,"   XBUS[%d] wr %#o (%#o)\n", offset & 3, offset, data));
60   }
5561   m_hw.xbus[offset&3] = data;
5662}
5763
r26198r26199
6470READ16_MEMBER( alto2_cpu_device::utilout_r )
6571{
6672   UINT16 data = m_hw.utilout ^ 0177777;
67   LOG((0,2,"   read UTILOUT %#o (%#o)\n", offset, data));
73   if (!space.debugger_access()) {
74      LOG((0,2,"   UTILOUT rd %#o (%#o)\n", offset, data));
75   }
6876   return data;
6977}
7078
r26198r26199
7886 */
7987WRITE16_MEMBER( alto2_cpu_device::utilout_w )
8088{
81   LOG((LOG_HW,2,"   write UTILOUT %#o (%#o)\n", offset, data));
89   if (!space.debugger_access()) {
90      LOG((LOG_HW,2,"   UTILOUT wr %#o (%#o)\n", offset, data));
91   }
8292   m_hw.utilout = data ^ 0177777;
8393
8494   // FIXME: write printer data
branches/alto2/src/emu/cpu/alto2/a2mem.c
r26198r26199
494494READ16_MEMBER( alto2_cpu_device::mear_r )
495495{
496496   int data = m_mem.error ? m_mem.mear : m_mem.mar;
497   LOG((LOG_MEM,2,"   MEAR read %07o\n", data));
497   if (!space.debugger_access()) {
498      LOG((LOG_MEM,2,"   MEAR read %07o\n", data));
499   }
498500   return data;
499501}
500502
r26198r26199
517519READ16_MEMBER( alto2_cpu_device::mesr_r )
518520{
519521   UINT16 data = m_mem.mesr ^ 0177777;
520   LOG((LOG_MEM,2,"   MESR read %07o\n", data));
521   LOG((LOG_MEM,6,"      Hamming code read    : %#o\n", GET_MESR_HAMMING(data)));
522   LOG((LOG_MEM,6,"      Parity error         : %o\n", GET_MESR_PERR(data)));
523   LOG((LOG_MEM,6,"      Memory parity bit    : %o\n", GET_MESR_PARITY(data)));
522   if (!space.debugger_access()) {
523      LOG((LOG_MEM,2,"   MESR read %07o\n", data));
524      LOG((LOG_MEM,6,"      Hamming code read    : %#o\n", GET_MESR_HAMMING(data)));
525      LOG((LOG_MEM,6,"      Parity error         : %o\n", GET_MESR_PERR(data)));
526      LOG((LOG_MEM,6,"      Memory parity bit    : %o\n", GET_MESR_PARITY(data)));
524527#if   ALTO2_HAMMING_CHECK
525   LOG((LOG_MEM,6,"      Hamming syndrome     : %#o (bit #%d)\n", GET_MESR_SYNDROME(data), hamming_lut[GET_MESR_SYNDROME(data)]));
528      LOG((LOG_MEM,6,"      Hamming syndrome     : %#o (bit #%d)\n", GET_MESR_SYNDROME(data), hamming_lut[GET_MESR_SYNDROME(data)]));
526529#else
527   LOG((LOG_MEM,6,"      Hamming syndrome     : %#o\n", GET_MESR_SYNDROME(data)));
530      LOG((LOG_MEM,6,"      Hamming syndrome     : %#o\n", GET_MESR_SYNDROME(data)));
528531#endif
529   LOG((LOG_MEM,6,"      Memory bank          : %#o\n", GET_MESR_BANK(data)));
532      LOG((LOG_MEM,6,"      Memory bank          : %#o\n", GET_MESR_BANK(data)));
533   }
530534   return data;
531535}
532536
533537WRITE16_MEMBER( alto2_cpu_device::mesr_w )
534538{
535   LOG((LOG_MEM,2,"   MESR write %07o (clear MESR; was %07o)\n", data, m_mem.mesr));
539   if (!space.debugger_access()) {
540      LOG((LOG_MEM,2,"   MESR write %07o (clear MESR; was %07o)\n", data, m_mem.mesr));
541   }
536542   m_mem.mesr = 0;      // set all bits to 0
537543   m_mem.error = 0;   // reset the error flag
538544   m_task_wakeup &= ~(1 << task_part);   // clear the task wakeup for the parity error task
r26198r26199
564570   m_mem.mecr = data ^ 0177777;
565571   A2_PUT16(m_mem.mecr,16, 0, 3,0);
566572   A2_PUT16(m_mem.mecr,16,15,15,0);
567   LOG((LOG_MEM,2,"   MECR write %07o\n", data));
568   LOG((LOG_MEM,6,"      Test Hamming code    : %#o\n", GET_MECR_TEST_CODE(m_mem.mecr)));
569   LOG((LOG_MEM,6,"      Test mode            : %s\n", GET_MECR_TEST_MODE(m_mem.mecr) ? "on" : "off"));
570   LOG((LOG_MEM,6,"      INT on single-bit err: %s\n", GET_MECR_INT_SBERR(m_mem.mecr) ? "on" : "off"));
571   LOG((LOG_MEM,6,"      INT on double-bit err: %s\n", GET_MECR_INT_DBERR(m_mem.mecr) ? "on" : "off"));
572   LOG((LOG_MEM,6,"      Error correction     : %s\n", GET_MECR_ERRCORR(m_mem.mecr) ? "off" : "on"));
573   if (!space.debugger_access()) {
574      LOG((LOG_MEM,2,"   MECR write %07o\n", data));
575      LOG((LOG_MEM,6,"      Test Hamming code    : %#o\n", GET_MECR_TEST_CODE(m_mem.mecr)));
576      LOG((LOG_MEM,6,"      Test mode            : %s\n", GET_MECR_TEST_MODE(m_mem.mecr) ? "on" : "off"));
577      LOG((LOG_MEM,6,"      INT on single-bit err: %s\n", GET_MECR_INT_SBERR(m_mem.mecr) ? "on" : "off"));
578      LOG((LOG_MEM,6,"      INT on double-bit err: %s\n", GET_MECR_INT_DBERR(m_mem.mecr) ? "on" : "off"));
579      LOG((LOG_MEM,6,"      Error correction     : %s\n", GET_MECR_ERRCORR(m_mem.mecr) ? "off" : "on"));
580   }
573581}
574582
575583/**
r26198r26199
579587{
580588   UINT16 data = m_mem.mecr ^ 0177777;
581589   /* set all spare bits */
582   LOG((LOG_MEM,2,"   MECR read %07o\n", data));
583   LOG((LOG_MEM,6,"      Test Hamming code    : %#o\n", GET_MECR_TEST_CODE(data)));
584   LOG((LOG_MEM,6,"      Test mode            : %s\n", GET_MECR_TEST_MODE(data) ? "on" : "off"));
585   LOG((LOG_MEM,6,"      INT on single-bit err: %s\n", GET_MECR_INT_SBERR(data) ? "on" : "off"));
586   LOG((LOG_MEM,6,"      INT on double-bit err: %s\n", GET_MECR_INT_DBERR(data) ? "on" : "off"));
587   LOG((LOG_MEM,6,"      Error correction     : %s\n", GET_MECR_ERRCORR(data) ? "off" : "on"));
590   if (!space.debugger_access()) {
591      LOG((LOG_MEM,2,"   MECR read %07o\n", data));
592      LOG((LOG_MEM,6,"      Test Hamming code    : %#o\n", GET_MECR_TEST_CODE(data)));
593      LOG((LOG_MEM,6,"      Test mode            : %s\n", GET_MECR_TEST_MODE(data) ? "on" : "off"));
594      LOG((LOG_MEM,6,"      INT on single-bit err: %s\n", GET_MECR_INT_SBERR(data) ? "on" : "off"));
595      LOG((LOG_MEM,6,"      INT on double-bit err: %s\n", GET_MECR_INT_DBERR(data) ? "on" : "off"));
596      LOG((LOG_MEM,6,"      Error correction     : %s\n", GET_MECR_ERRCORR(data) ? "off" : "on"));
597   }
588598   return data;
589599}
590600

Previous 199869 Revisions Next


© 1997-2024 The MAME Team