src/mess/drivers/votrtnt.c
| r10601 | r10602 | |
| 5 | 5 | * with loads of help (dumping, code disassembly, schematics, and other |
| 6 | 6 | * documentation) from Kevin 'kevtris' Horton |
| 7 | 7 | * |
| 8 | | * The Votrax TNT was sold from some time in early 1981 until at least 1983 |
| 9 | | |
| 8 | * The Votrax TNT was sold from some time in early 1981 until at least 1983. |
| 9 | * |
| 10 | * 2011-02-27 The TNT communicates with its host via serial (RS-232) by |
| 11 | * using a 6850 ACIA. It will echo whatever is sent, back to the |
| 12 | * host. In order that we can examine it, I have connected the |
| 13 | * 'terminal' so we can enter data, and see what gets sent back. |
| 14 | * I've also connected the 'votrax' device, but it is far from |
| 15 | * complete (the phoneme-to-sample table does not exist), and |
| 16 | * therefore produces no sound. Selected phonemes would show in |
| 17 | * the error log if the status return was working properly. |
| 18 | * |
| 19 | * ACIA status code is set to E2 for no data and E3 for data. |
| 20 | * |
| 21 | * On the CPU, A12 and A15 are not connected. A13 and A14 are used |
| 22 | * to select devices. A0-A9 address RAM. A0-A11 address ROM. |
| 23 | * A0 switches the ACIA between status/command, and data in/out. |
| 24 | * |
| 25 | * Special codes: The Type 'N Talk will take notice of certain codes. They |
| 26 | * are: 08, 0D, 1B, 20. I didn't investigate what the codes do. |
| 27 | * |
| 28 | * ToDo: |
| 29 | * - Fix votrax audio device to produce sound. |
| 30 | * - Fix votrax device to perform a callback on change of status rather than |
| 31 | * having to poll it. |
| 32 | * - Allow votrax frequency to be changed via a callable routine. |
| 33 | * - Reconnect the ACIA when serial coms become viable in MESS. |
| 34 | * |
| 10 | 35 | ******************************************************************************/ |
| 36 | #define ADDRESS_MAP_MODERN |
| 11 | 37 | |
| 12 | 38 | /* Core includes */ |
| 13 | 39 | #include "emu.h" |
| r10601 | r10602 | |
| 18 | 44 | #include "sound/votrax.h" |
| 19 | 45 | #include "machine/6850acia.h" |
| 20 | 46 | |
| 47 | /* For testing */ |
| 48 | #include "machine/terminal.h" |
| 21 | 49 | |
| 50 | |
| 51 | |
| 22 | 52 | class votrtnt_state : public driver_device |
| 23 | 53 | { |
| 24 | 54 | public: |
| 25 | 55 | votrtnt_state(running_machine &machine, const driver_device_config_base &config) |
| 26 | | : driver_device(machine, config) { } |
| 56 | : driver_device(machine, config), |
| 57 | m_maincpu(*this, "maincpu"), |
| 58 | m_terminal(*this, TERMINAL_TAG), |
| 59 | //m_acia(*this, "acia_0"), |
| 60 | m_votrax(*this, "votrax") |
| 61 | { } |
| 27 | 62 | |
| 63 | required_device<cpu_device> m_maincpu; |
| 64 | required_device<device_t> m_terminal; |
| 65 | //required_device<device_t> m_acia; |
| 66 | required_device<device_t> m_votrax; |
| 67 | DECLARE_READ8_MEMBER( votrtnt_acia_status_r ); |
| 68 | DECLARE_READ8_MEMBER( votrtnt_acia_data_r ); |
| 69 | DECLARE_WRITE8_MEMBER( votrtnt_votrax_w ); |
| 70 | DECLARE_WRITE8_MEMBER( votrtnt_kbd_put ); |
| 71 | UINT8 m_term_data; |
| 72 | UINT8 m_term_status; |
| 28 | 73 | }; |
| 29 | 74 | |
| 75 | READ8_MEMBER( votrtnt_state::votrtnt_acia_status_r ) |
| 76 | { |
| 77 | return m_term_status; |
| 78 | } |
| 30 | 79 | |
| 31 | | /* Devices */ |
| 80 | READ8_MEMBER( votrtnt_state::votrtnt_acia_data_r ) |
| 81 | { |
| 82 | m_term_status = 0xe2; |
| 83 | return m_term_data; |
| 84 | } |
| 32 | 85 | |
| 86 | WRITE8_MEMBER( votrtnt_state::votrtnt_votrax_w ) |
| 87 | { |
| 88 | data &= 0x3f; // intonation bits are grounded |
| 89 | //printf("%X ",data); |
| 90 | votrax_w(m_votrax, 0, data); |
| 91 | } |
| 33 | 92 | |
| 93 | |
| 94 | |
| 34 | 95 | /****************************************************************************** |
| 35 | 96 | Address Maps |
| 36 | 97 | ******************************************************************************/ |
| 37 | 98 | |
| 38 | | static ADDRESS_MAP_START(6802_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 39 | | ADDRESS_MAP_UNMAP_HIGH |
| 40 | | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 41 | | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_MIRROR(0x9800)/* RAM, 2114*2 (0x400 bytes) mirrored 4x */ |
| 42 | | AM_RANGE(0x2000, 0x2000) AM_NOP AM_MIRROR(0x9ffe)//AM_DEVREADWRITE("acia_0",aciastat_r,aciactrl_w) AM_MIRROR(0x9ffe)/* 6850 ACIA */ |
| 43 | | AM_RANGE(0x2001, 0x2001) AM_NOP AM_MIRROR(0x9ffe)//AM_DEVREADWRITE("acia_0",aciadata_r,aciadata_w) AM_MIRROR(0x9ffe)/* 6850 ACIA */ |
| 44 | | AM_RANGE(0x4000, 0x4000) AM_NOP AM_MIRROR(0x9fff)/* low 6 bits write to 6 bit input of sc-01-a; high 2 bits are ignored (but by adding a buffer chip could be made to control the inflection bits of the sc-01-a which are normally grouned on the tnt) */ |
| 45 | | AM_RANGE(0x6000, 0x6fff) AM_ROM AM_MIRROR(0x9000)/* ROM in potted block */ |
| 99 | static ADDRESS_MAP_START(6802_mem, ADDRESS_SPACE_PROGRAM, 8, votrtnt_state) |
| 100 | ADDRESS_MAP_UNMAP_HIGH |
| 101 | ADDRESS_MAP_GLOBAL_MASK(0x6fff) |
| 102 | AM_RANGE(0x0000, 0x03ff) AM_RAM AM_MIRROR(0xc00)/* RAM, 2114*2 (0x400 bytes) mirrored 4x */ |
| 103 | //AM_RANGE(0x2000, 0x2000) AM_NOP AM_MIRROR(0xffe)//AM_DEVREADWRITE("acia_0",aciastat_r,aciactrl_w)/* 6850 ACIA */ |
| 104 | //AM_RANGE(0x2001, 0x2001) AM_NOP AM_MIRROR(0xffe)//AM_DEVREADWRITE("acia_0",aciadata_r,aciadata_w)/* 6850 ACIA */ |
| 105 | AM_RANGE(0x2000, 0x2000) AM_MIRROR(0xffe) AM_READ(votrtnt_acia_status_r) AM_WRITENOP// temp testing |
| 106 | AM_RANGE(0x2001, 0x2001) AM_MIRROR(0xffe) AM_READ(votrtnt_acia_data_r) AM_DEVWRITE_LEGACY(TERMINAL_TAG, terminal_write) // temp testing |
| 107 | AM_RANGE(0x4000, 0x5fff) AM_WRITE(votrtnt_votrax_w) /* low 6 bits write to 6 bit input of sc-01-a; high 2 bits are ignored (but by adding a buffer chip could be made to control the inflection bits of the sc-01-a which are normally grounded on the tnt) */ |
| 108 | AM_RANGE(0x6000, 0x6fff) AM_ROM /* ROM in potted block */ |
| 46 | 109 | ADDRESS_MAP_END |
| 47 | 110 | |
| 48 | 111 | |
| r10601 | r10602 | |
| 63 | 126 | PORT_DIPSETTING( 0x80, "9600" ) |
| 64 | 127 | INPUT_PORTS_END |
| 65 | 128 | |
| 129 | static MACHINE_RESET(votrtnt) |
| 130 | { |
| 131 | votrtnt_state *state = machine->driver_data<votrtnt_state>(); |
| 132 | state->m_term_data = 0; |
| 133 | state->m_term_status = 0xe2; |
| 134 | } |
| 66 | 135 | |
| 136 | WRITE8_MEMBER( votrtnt_state::votrtnt_kbd_put ) |
| 137 | { |
| 138 | m_term_data = data; |
| 139 | m_term_status = 0xe3; |
| 140 | } |
| 141 | |
| 142 | static GENERIC_TERMINAL_INTERFACE( votrtnt_terminal_intf ) |
| 143 | { |
| 144 | DEVCB_DRIVER_MEMBER(votrtnt_state, votrtnt_kbd_put) |
| 145 | }; |
| 146 | |
| 147 | static TIMER_DEVICE_CALLBACK( votrtnt_poll_votrax ) |
| 148 | { |
| 149 | votrtnt_state *state = timer.machine->driver_data<votrtnt_state>(); |
| 150 | UINT8 status = votrax_status_r(state->m_votrax); |
| 151 | //printf("%X ",status); |
| 152 | cpu_set_input_line(timer.machine->device("maincpu"), INPUT_LINE_IRQ0, status ? ASSERT_LINE : CLEAR_LINE); |
| 153 | } |
| 154 | |
| 155 | |
| 67 | 156 | /****************************************************************************** |
| 68 | 157 | Machine Drivers |
| 69 | 158 | ******************************************************************************/ |
| 70 | 159 | |
| 71 | 160 | static MACHINE_CONFIG_START( votrtnt, votrtnt_state ) |
| 72 | | /* basic machine hardware */ |
| 73 | | MCFG_CPU_ADD("maincpu", M6802, XTAL_2_4576MHz) /* 2.4576MHz XTAL, verified; divided by 4 inside the m6802*/ |
| 74 | | MCFG_CPU_PROGRAM_MAP(6802_mem) |
| 75 | | MCFG_QUANTUM_TIME(attotime::from_hz(60)) |
| 161 | /* basic machine hardware */ |
| 162 | MCFG_CPU_ADD("maincpu", M6802, XTAL_2_4576MHz) /* 2.4576MHz XTAL, verified; divided by 4 inside the m6802*/ |
| 163 | MCFG_CPU_PROGRAM_MAP(6802_mem) |
| 76 | 164 | |
| 77 | | /* video hardware */ |
| 78 | | MCFG_DEFAULT_LAYOUT(layout_votrtnt) |
| 165 | MCFG_MACHINE_RESET(votrtnt) |
| 166 | /* video hardware */ |
| 167 | //MCFG_DEFAULT_LAYOUT(layout_votrtnt) |
| 79 | 168 | |
| 80 | | /* serial hardware */ |
| 81 | | //MCFG_ACIA6850_ADD("acia_0", acia_intf) |
| 169 | /* serial hardware */ |
| 170 | //MCFG_ACIA6850_ADD("acia_0", acia_intf) |
| 82 | 171 | |
| 83 | | /* sound hardware */ |
| 84 | | //MCFG_SPEAKER_STANDARD_MONO("mono") |
| 85 | | //MCFG_SOUND_ADD("sc-01-a", VOTRAX, 1700000) /* 1.70 MHz? needs verify */ |
| 86 | | //MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 172 | /* sound hardware */ |
| 173 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 174 | MCFG_SOUND_ADD("votrax", VOTRAX, 1700000) /* 1.70 MHz? needs verify */ |
| 175 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 87 | 176 | |
| 88 | | /* printer */ |
| 89 | | //MCFG_PRINTER_ADD("printer") |
| 90 | | |
| 177 | MCFG_FRAGMENT_ADD( generic_terminal ) |
| 178 | MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, votrtnt_terminal_intf) |
| 179 | MCFG_TIMER_ADD_PERIODIC("votrtnt_timer", votrtnt_poll_votrax, attotime::from_hz(70) ) |
| 91 | 180 | MACHINE_CONFIG_END |
| 92 | 181 | |
| 93 | 182 | |
| r10601 | r10602 | |
| 97 | 186 | ******************************************************************************/ |
| 98 | 187 | |
| 99 | 188 | ROM_START(votrtnt) |
| 100 | | ROM_REGION(0x10000, "maincpu", 0) |
| 189 | ROM_REGION(0x10000, "maincpu", 0) |
| 101 | 190 | ROM_LOAD("cn49752n.bin", 0x6000, 0x1000, CRC(a44e1af3) SHA1(af83b9e84f44c126b24ee754a22e34ca992a8d3d)) /* 2332 mask rom inside potted brick */ |
| 102 | | |
| 103 | 191 | ROM_END |
| 104 | 192 | |
| 105 | 193 | |
| r10601 | r10602 | |
| 110 | 198 | /* |
| 111 | 199 | static ACIA6850_INTERFACE( acia_intf ) |
| 112 | 200 | { |
| 113 | | 9600, // rx clock, actually based on dipswitches |
| 114 | | 9600, // tx clock, actually based on dipswitches |
| 115 | | DEVCB_NULL, // rx callback |
| 116 | | DEVCB_NULL, // tx callback |
| 117 | | DEVCB_NULL, |
| 118 | | DEVCB_NULL, |
| 119 | | DEVCB_NULL, |
| 120 | | DEVCB_NULL |
| 201 | 9600, // rx clock, actually based on dipswitches |
| 202 | 9600, // tx clock, actually based on dipswitches |
| 203 | DEVCB_NULL, // rx callback |
| 204 | DEVCB_NULL, // tx callback |
| 205 | DEVCB_NULL, |
| 206 | DEVCB_NULL, |
| 207 | DEVCB_NULL, |
| 208 | DEVCB_NULL |
| 121 | 209 | };*/ |
| 122 | 210 | |
| 123 | 211 | /****************************************************************************** |
| r10601 | r10602 | |
| 125 | 213 | ******************************************************************************/ |
| 126 | 214 | |
| 127 | 215 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 128 | | COMP( 1980, votrtnt, 0, 0, votrtnt, votrtnt, 0, "Votrax", "Type 'N Talk", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 216 | COMP( 1980, votrtnt, 0, 0, votrtnt, votrtnt, 0, "Votrax", "Type 'N Talk", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 129 | 217 | |