trunk/src/emu/machine/spchrom.c
| r26287 | r26288 | |
| 27 | 27 | : device_t(mconfig, SPEECHROM, "SPEECHROM", tag, owner, clock, "speechrom", __FILE__), |
| 28 | 28 | m_speechROMaddr(0), |
| 29 | 29 | m_load_pointer(0), |
| 30 | | m_ROM_bits_count(0) |
| 30 | m_ROM_bits_count(0), |
| 31 | m_reverse(false) |
| 31 | 32 | { |
| 32 | 33 | } |
| 33 | 34 | |
| 34 | 35 | /* |
| 35 | 36 | 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 ... |
| 36 | 43 | */ |
| 37 | 44 | int speechrom_device::read(int count) |
| 38 | 45 | { |
| 39 | 46 | int val; |
| 47 | int spchbyte; |
| 48 | int pos; |
| 40 | 49 | |
| 41 | 50 | if (m_load_pointer) |
| 42 | 51 | { /* first read after load address is ignored */ |
| r26287 | r26288 | |
| 45 | 54 | } |
| 46 | 55 | |
| 47 | 56 | 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; |
| 56 | 60 | |
| 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; |
| 58 | 62 | |
| 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++; |
| 65 | 79 | } |
| 80 | m_ROM_bits_count = 8 - pos; |
| 81 | } |
| 66 | 82 | else |
| 83 | { |
| 67 | 84 | val = 0; |
| 85 | } |
| 68 | 86 | |
| 69 | 87 | return val; |
| 70 | 88 | } |
trunk/src/mess/drivers/ti99_8.c
| r26287 | r26288 | |
| 1139 | 1139 | ROM_REGION(0x8000, ROM1_TAG, 0) |
| 1140 | 1140 | ROM_LOAD("u25_rom1.bin", 0x0000, 0x8000, CRC(b574461a) SHA1(42c6aed44802cfabdd26b565d6e5ddfcd689f11e)) |
| 1141 | 1141 | |
| 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 | | |
| 1147 | 1142 | // System GROMs. 3 chips @ f830 |
| 1148 | 1143 | // The schematics do not enumerate the circuits but only talk about |
| 1149 | 1144 | // "circuits on board" (COB) so we name the GROMs as gM_N.bin where M is the |
trunk/src/mess/machine/ti99/speech8.c
| r26287 | r26288 | |
| 118 | 118 | const speech8_config *conf = reinterpret_cast<const speech8_config *>(static_config()); |
| 119 | 119 | m_ready.resolve(conf->ready, *this); |
| 120 | 120 | m_vsp = subdevice<tms5220_device>(SPEECHSYN_TAG); |
| 121 | speechrom_device* mem = subdevice<speechrom_device>("vsm"); |
| 122 | mem->set_reverse_bit_order(true); |
| 121 | 123 | } |
| 122 | 124 | |
| 123 | 125 | void ti998_spsyn_device::device_reset() |
| r26287 | r26288 | |
| 142 | 144 | as the TI speech synthesizer. */ |
| 143 | 145 | ROM_START( ti998_speech ) |
| 144 | 146 | 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)) |
| 150 | 149 | ROM_END |
| 151 | 150 | |
| 152 | 151 | machine_config_constructor ti998_spsyn_device::device_mconfig_additions() const |