Previous 199869 Revisions Next

r26288 Tuesday 19th November, 2013 at 22:20:26 UTC by Michael Zapf
(MESS) ti99_8: Using the new speech rom dumps with proper bit order;
also added a method to spchrom. (nw)
[src/emu/machine]spchrom.c spchrom.h
[src/mess/drivers]ti99_8.c
[src/mess/machine/ti99]speech8.c

trunk/src/emu/machine/spchrom.c
r26287r26288
2727   : device_t(mconfig, SPEECHROM, "SPEECHROM", tag, owner, clock, "speechrom", __FILE__),
2828   m_speechROMaddr(0),
2929   m_load_pointer(0),
30   m_ROM_bits_count(0)
30   m_ROM_bits_count(0),
31   m_reverse(false)
3132{
3233}
3334
3435/*
3536    Read 'count' bits serially from speech ROM
37
38    Actually, the ROM is expected to have reversed bit order, but there are
39    many dumps with normal bit order.
40
41    compatibility mode:   01234567 01234567 01234567 ...
42    correct mode:         76543210 76543210 76543210 ...
3643*/
3744int speechrom_device::read(int count)
3845{
3946   int val;
47   int spchbyte;
48   int pos;
4049
4150   if (m_load_pointer)
4251   {   /* first read after load address is ignored */
r26287r26288
4554   }
4655
4756   if (m_speechROMaddr < m_speechROMlen)
48      if (count < m_ROM_bits_count)
49      {
50         m_ROM_bits_count -= count;
51         val = (m_speechrom_data[m_speechROMaddr] >> m_ROM_bits_count) & (0xFF >> (8 - count));
52      }
53      else
54      {
55         val = ((int) m_speechrom_data[m_speechROMaddr]) << 8;
57   {
58      val = 0;
59      pos = 8 - m_ROM_bits_count;
5660
57         m_speechROMaddr = (m_speechROMaddr + 1) & TMS5220_ADDRESS_MASK;
61      spchbyte = (m_reverse? (m_speechrom_data[m_speechROMaddr] >> pos) : (m_speechrom_data[m_speechROMaddr] << pos)) & 0xff;
5862
59         if (m_speechROMaddr < m_speechROMlen)
60            val |= m_speechrom_data[m_speechROMaddr];
61
62         m_ROM_bits_count += 8 - count;
63
64         val = (val >> m_ROM_bits_count) & (0xFF >> (8 - count));
63      while (count > 0)
64      {
65         val = val << 1;
66         if ((spchbyte & (m_reverse? 0x01:0x80))!=0) val |= 1;
67         spchbyte = m_reverse? (spchbyte >> 1) : (spchbyte << 1);
68         count--;
69         if (pos == 7)
70         {
71            pos = 0;
72            m_speechROMaddr = (m_speechROMaddr + 1) & TMS5220_ADDRESS_MASK;
73            if (m_speechROMaddr >= m_speechROMlen)
74               count = 0;
75            else
76               spchbyte = m_speechrom_data[m_speechROMaddr];
77         }
78         else pos++;
6579      }
80      m_ROM_bits_count = 8 - pos;
81   }
6682   else
83   {
6784      val = 0;
85   }
6886
6987   return val;
7088}
trunk/src/emu/machine/spchrom.h
r26287r26288
1818   int read(int count);
1919   void load_address(int data);
2020   void read_and_branch();
21   void set_reverse_bit_order(bool reverse) { m_reverse = reverse; }
2122
2223   // device-level overrides
2324   virtual void device_start();
r26287r26288
2829   unsigned int m_speechROMaddr;      /* 18 bit pointer in ROM */
2930   int m_load_pointer;                /* which 4-bit nibble will be affected by load address */
3031   int m_ROM_bits_count;              /* current bit position in ROM */
32   bool m_reverse;
3133};
3234
3335
trunk/src/mess/drivers/ti99_8.c
r26287r26288
11391139   ROM_REGION(0x8000, ROM1_TAG, 0)
11401140   ROM_LOAD("u25_rom1.bin", 0x0000, 0x8000, CRC(b574461a) SHA1(42c6aed44802cfabdd26b565d6e5ddfcd689f11e))
11411141
1142   // Speech ROMs
1143   ROM_REGION(0x8000, SPEECH_TAG, 0)
1144   ROM_LOAD("cd2325a.vsm", 0x0000, 0x4000, CRC(1f58b571) SHA1(0ef4f178716b575a1c0c970c56af8a8d97561ffe))
1145   ROM_LOAD("cd2326a.vsm", 0x4000, 0x4000, CRC(65d00401) SHA1(a367242c2c96cebf0e2bf21862f3f6734b2b3020))
1146
11471142   // System GROMs. 3 chips @ f830
11481143   // The schematics do not enumerate the circuits but only talk about
11491144   // "circuits on board" (COB) so we name the GROMs as gM_N.bin where M is the
trunk/src/mess/machine/ti99/speech8.c
r26287r26288
118118   const speech8_config *conf = reinterpret_cast<const speech8_config *>(static_config());
119119   m_ready.resolve(conf->ready, *this);
120120   m_vsp = subdevice<tms5220_device>(SPEECHSYN_TAG);
121   speechrom_device* mem = subdevice<speechrom_device>("vsm");
122   mem->set_reverse_bit_order(true);
121123}
122124
123125void ti998_spsyn_device::device_reset()
r26287r26288
142144   as the TI speech synthesizer. */
143145ROM_START( ti998_speech )
144146   ROM_REGION(0x8000, "vsm", 0)
145   // Note: the following line is actually wrong; the speech roms in the ti 99/4a and 99/8 are two VSM roms labeled CD2325A and CD2326A, and contain the same data as the following line rom does, but with the byte bit order reversed. This bit ordering issue needs to be fixed elsewhere in the code here before the original/real roms can be used.
146   ROM_LOAD_OPTIONAL("spchrom.bin", 0x0000, 0x8000, CRC(58b155f7) SHA1(382292295c00dff348d7e17c5ce4da12a1d87763)) /* system speech ROM */
147   // correct lines are:
148   // ROM_LOAD_OPTIONAL("cd2325a.vsm", 0x0000, 0x4000, CRC(1f58b571) SHA1(0ef4f178716b575a1c0c970c56af8a8d97561ffe))
149   // ROM_LOAD_OPTIONAL("cd2326a.vsm", 0x4000, 0x4000, CRC(65d00401) SHA1(a367242c2c96cebf0e2bf21862f3f6734b2b3020))
147   ROM_LOAD("cd2325a.vsm", 0x0000, 0x4000, CRC(1f58b571) SHA1(0ef4f178716b575a1c0c970c56af8a8d97561ffe))
148   ROM_LOAD("cd2326a.vsm", 0x4000, 0x4000, CRC(65d00401) SHA1(a367242c2c96cebf0e2bf21862f3f6734b2b3020))
150149ROM_END
151150
152151machine_config_constructor ti998_spsyn_device::device_mconfig_additions() const

Previous 199869 Revisions Next


© 1997-2024 The MAME Team