src/mess/drivers/pes.c
| r0 | r10404 | |
| 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Pacific Educational Systems 'PES' Speech box |
| 4 | * Part number VPU-1 V1 |
| 5 | * By Kevin 'kevtris' Horton and Jonathan Gevaryahu AKA Lord Nightmare |
| 6 | * |
| 7 | * RE work done by Kevin 'kevtris' Horton and Jonathan Gevaryahu |
| 8 | * |
| 9 | * DONE: |
| 10 | * compiles correctly |
| 11 | * rom loads correctly |
| 12 | * |
| 13 | * TODO: |
| 14 | * pretty much everything else |
| 15 | * |
| 16 | *********************************************************************** |
| 17 | This is almost as simple as hardware gets from the digital side: |
| 18 | Hardware consists of: |
| 19 | 10.245Mhz xtal |
| 20 | 8031 cpu |
| 21 | 27c64 rom (holds less than 256 bytes of code) |
| 22 | unpopulated 6116? sram, which isn't used |
| 23 | TSP5220C speech chip (aka tms5220c) |
| 24 | mc145406 RS232 driver/reciever (+-24v to 0-5v converter for serial i/o) |
| 25 | 74hc573b1 octal tri-state D-latch (used for latching bus state for speech chip) |
| 26 | 74hc74b1 dual d-flipflop with set/reset, positive edge trigger (for driving /WS and /RS of speech chip) |
| 27 | 74hc02b1 quad 2-input NOR gate (for /WS and /RS logic) |
| 28 | mc14520b dual 4-bit binary up counter (honestly not sure what this is used for, maybe for the analog filter) |
| 29 | Big messy analog section to allow voice output to be filtered extensively by a 4th order filter |
| 30 | |
| 31 | Address map: |
| 32 | 80C31 ADDR: |
| 33 | 0000-1FFF: ROM |
| 34 | 2000-FFFF: open bus |
| 35 | 80C31 IO: |
| 36 | 00 W: d0 and d1 are the /RS and /WS bits |
| 37 | 01 W: ? to tms5220 bus? |
| 38 | 03 W: ? to serial? |
| 39 | 03 R: ? from serial |
| 40 | |
| 41 | */ |
| 42 | |
| 43 | #define ADDRESS_MAP_MODERN |
| 44 | #define CPU_CLOCK XTAL_10_245MHz |
| 45 | |
| 46 | /* Core includes */ |
| 47 | #include "emu.h" |
| 48 | #include "includes/pes.h" |
| 49 | #include "cpu/mcs51/mcs51.h" |
| 50 | #include "sound/tms5220.h" |
| 51 | #include "machine/terminal.h" |
| 52 | |
| 53 | /* Devices */ |
| 54 | static WRITE8_DEVICE_HANDLER( pes_kbd_put ) |
| 55 | { |
| 56 | //duart68681_rx_data(device->machine->device("duart68681"), 1, data); |
| 57 | // nothing, yet |
| 58 | } |
| 59 | |
| 60 | static GENERIC_TERMINAL_INTERFACE( pes_terminal_intf ) |
| 61 | { |
| 62 | DEVCB_HANDLER(pes_kbd_put) |
| 63 | }; |
| 64 | |
| 65 | /* Handlers */ |
| 66 | WRITE8_MEMBER( pes_state::rsws_w ) |
| 67 | { |
| 68 | m_wsstate = data&0x1; |
| 69 | m_rsstate = (data&0x2)>>1; |
| 70 | logerror("RSWS states updated: RS: %d, WS: %d\n", m_rsstate, m_wsstate); |
| 71 | // poke tms5220 |
| 72 | } |
| 73 | |
| 74 | /* Reset */ |
| 75 | void pes_state::machine_reset() |
| 76 | { |
| 77 | const device_t *devconf = machine->device("tms5220"); |
| 78 | m_tmslatch = 0; |
| 79 | m_wsstate = 1; |
| 80 | m_rsstate = 1; |
| 81 | m_serial_cts = 1; |
| 82 | DEVICE_RESET(devconf); |
| 83 | devconf = devconf; // hack to make gcc shut up about unused variables |
| 84 | } |
| 85 | |
| 86 | /****************************************************************************** |
| 87 | Address Maps |
| 88 | ******************************************************************************/ |
| 89 | |
| 90 | static ADDRESS_MAP_START(i80c31_mem, ADDRESS_SPACE_PROGRAM, 8, pes_state) |
| 91 | ADDRESS_MAP_UNMAP_HIGH |
| 92 | AM_RANGE(0x0000, 0x1fff) AM_ROM /* 27C64 ROM */ |
| 93 | // AM_RANGE(0x2000, 0x7ff) AM_RAM /* 6116? SRAM, not populated */ |
| 94 | ADDRESS_MAP_END |
| 95 | |
| 96 | static ADDRESS_MAP_START(i80c31_io, ADDRESS_SPACE_IO, 8, pes_state) |
| 97 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 98 | /* 00 W: d0 and d1 are the /RS and /WS bits |
| 99 | 01 W: ? to tms5220 bus? |
| 100 | 03 W: ? to serial? |
| 101 | 03 R: ? from serial*/ |
| 102 | AM_RANGE(0x0, 0x0) AM_WRITE(rsws_w) /* /RS and /WS */ |
| 103 | ADDRESS_MAP_END |
| 104 | |
| 105 | /****************************************************************************** |
| 106 | Input Ports |
| 107 | ******************************************************************************/ |
| 108 | static INPUT_PORTS_START( pes ) |
| 109 | PORT_INCLUDE(generic_terminal) |
| 110 | INPUT_PORTS_END |
| 111 | |
| 112 | /****************************************************************************** |
| 113 | Machine Drivers |
| 114 | ******************************************************************************/ |
| 115 | static MACHINE_CONFIG_START( pes, pes_state ) |
| 116 | /* basic machine hardware */ |
| 117 | MCFG_CPU_ADD("maincpu", I80C31, CPU_CLOCK) |
| 118 | MCFG_CPU_PROGRAM_MAP(i80c31_mem) |
| 119 | MCFG_CPU_IO_MAP(i80c31_io) |
| 120 | |
| 121 | /* sound hardware */ |
| 122 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 123 | MCFG_SOUND_ADD("tms5220", TMS5220C, 640000) /* 720Khz clock, 10khz output */ |
| 124 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 125 | |
| 126 | MCFG_FRAGMENT_ADD( generic_terminal ) |
| 127 | MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG,pes_terminal_intf) |
| 128 | MACHINE_CONFIG_END |
| 129 | |
| 130 | /****************************************************************************** |
| 131 | ROM Definitions |
| 132 | ******************************************************************************/ |
| 133 | ROM_START( pes ) |
| 134 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 135 | ROM_DEFAULT_BIOS("kevbios") |
| 136 | ROM_SYSTEM_BIOS( 0, "orig", "PES box with original firmware v2.5") |
| 137 | ROMX_LOAD( "vpu_2-5.bin", 0x0000, 0x2000, CRC(B27CFDF7) SHA1(C52ACF9C080823DE5EF26AC55ABE168AD53A7D38), ROM_BIOS(1)) // original firmware, rather buggy, 4800bps serial, buggy RTS/CTS flow control, no buffer |
| 138 | ROM_SYSTEM_BIOS( 1, "kevbios", "PES box with kevtris' rewritten firmware") |
| 139 | ROMX_LOAD( "pes.bin", 0x0000, 0x2000, CRC(22C1C4EC) SHA1(042E139CD0CF6FFAFCD88904F1636C6FA1B38F25), ROM_BIOS(2)) // rewritten firmware by kevtris, 9600bps serial, RTS/CTS plus XON/XOFF flow control, 64 byte buffer |
| 140 | ROM_END |
| 141 | |
| 142 | /****************************************************************************** |
| 143 | Drivers |
| 144 | ******************************************************************************/ |
| 145 | |
| 146 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 147 | COMP( 1987, pes, 0, 0, pes, pes, 0, "Pacific Educational Systems", "VPU-01 Speech box", GAME_NOT_WORKING ) |