src/mess/drivers/mmd1.c
| r13845 | r13846 | |
| 4 | 4 | |
| 5 | 5 | 12/05/2009 Initial version |
| 6 | 6 | |
| 7 | MMD-1 |
| 8 | ***** |
| 7 | 9 | |
| 8 | | MMD1 note: - When is keyboard LINE3 scanned? |
| 10 | It appears that you enter an 3 digit octal number and then hit a function key. |
| 11 | H - puts the number in the H register |
| 12 | L - puts the number in the L register |
| 13 | S - puts the number into memory pointed to by HL and then increments HL. |
| 14 | G - Loads the program counter with the contents of HL |
| 9 | 15 | |
| 10 | | MMD2 note: - Has in 3, in 4, out 3, out 4, purpose unknown. |
| 11 | | - PC set to D840 at start, as this seems to make it run |
| 12 | | logically, without it doing silly things. |
| 13 | | - Layout is empty, so nothing is displayed. |
| 16 | 1) There is a 'working byte' which you can enter using the octal digits |
| 17 | (just press them in order), and which is displayed on the port 2 LEDs |
| 18 | when KEX is running. |
| 14 | 19 | |
| 20 | 2) 'R' is a hardware reset |
| 21 | |
| 22 | 3) 'H' and 'L' are used to load the address (high and low parts, and it |
| 23 | really is the HL register of the 8080). So to enter a particular address, |
| 24 | you type in the high half (in octal), press H. Then type in the low half |
| 25 | and press L. The address is displayed on the port 0 and port 1 LEDs when |
| 26 | KEX is running. |
| 27 | |
| 28 | 4) 'S' is 'Step' or 'Store'. It stores the working byte at the current |
| 29 | address (in HL), and then increments the address. It's used to enter |
| 30 | bytes into memory |
| 31 | |
| 32 | 5) 'G' is 'go'. It loads the 8080 PC with the address in HL, and thus |
| 33 | executes a program at that address. |
| 34 | |
| 35 | OK, this is what I would try. |
| 36 | |
| 37 | 1) Press 'R' to reset the 8080 and start KEX running. |
| 38 | |
| 39 | 2) Type 004 H 000 L to load the start address of your program. The bytes |
| 40 | should appear on the rightmost 8 LEDs as you enter them and should then |
| 41 | also appear on the left and middle sets of LEDs when you press H and L. |
| 42 | |
| 43 | 3) Enter the program |
| 44 | |
| 45 | 076 S 123 S 323 S 000 S 166S |
| 46 | |
| 47 | As you type each byte it should appear on the rightmost LEDs. When you |
| 48 | press S, the address on the rest of the LEDs should increment by 1. |
| 49 | |
| 50 | 4) Re-enter the start address |
| 51 | 004 H 000 L |
| 52 | |
| 53 | 5) Press G to run the program. The left most LEDs should change to |
| 54 | .*.*..** (. = off, * = on), I think. The keys will then do nothing (as |
| 55 | the CPU is halted) until you press R again to re-run KEX. |
| 56 | |
| 57 | When is keyboard LINE3 scanned? it isn't - it's a reset button. |
| 58 | |
| 59 | MMD-2 |
| 60 | ***** |
| 61 | |
| 62 | http://www.cs.unc.edu/~yakowenk/classiccmp/mmd2/ |
| 63 | Memory map: |
| 64 | |
| 65 | * 4K RAM addresses $0000..$0FFF |
| 66 | * ROM addresses $D800..$E7FF |
| 67 | * 256 bytes of RAM, ($FC00..$FCFF?) |
| 68 | |
| 69 | DIP switches: |
| 70 | |
| 71 | * WE 0 - Write enable for addresses $0000..$03FF |
| 72 | * WE 1 - Write enable for addresses $0400..$07FF |
| 73 | * WE 2 - Write enable for addresses $0800..$0BFF |
| 74 | * WE 3 - Write enable for addresses $0C00..$0FFF |
| 75 | * SPARE - ??? |
| 76 | * HEX OCT - choose display and entry to be in Hexadecimal or Octal |
| 77 | * PUP RESET - ??? |
| 78 | * EXEC USER - update binary LED's with data entry? Or not? |
| 79 | (in either setting, outputs to ports 0,1,2 still show) |
| 80 | |
| 81 | Operation: |
| 82 | |
| 83 | * Enter bytes on the keypad of hex digits |
| 84 | * Set MSByte of address by entering it on the keypad & pressing "HIGH". |
| 85 | * ... LSByte ... "LOW" |
| 86 | * Change contents of memory at the selected address by entering the new value & pressing "STORE". |
| 87 | * Look at adjacent memory locations with "NEXT" and "PREV". |
| 88 | * Execute the program at the selected address by pressing "GO". |
| 89 | |
| 90 | AUX functions: |
| 91 | |
| 92 | * BRL HI # - OFF disables BRL LO |
| 93 | * BRL LO # |
| 94 | * STEP # |
| 95 | * SRC HI # - source for COPY/DUMP - OFF disables "DUMP" function |
| 96 | * DES HI # - destination for COPY/DUMP |
| 97 | * LEN HI # - length for COPY/DUMP |
| 98 | * CLR TST ON - test if PROM is empty |
| 99 | * POP PRM ON - program a PROM |
| 100 | * DUP TST ON - test if PROM duplicated okay |
| 101 | * PROM 2708/2716 |
| 102 | * MEM MAP RAM/ROM |
| 103 | * BAUD 110/150/300/600/1200 |
| 104 | |
| 105 | The memory map can be rearranged by the system by using IN5, IN6, IN7. |
| 106 | A pair of undumped proms control what goes where on each map. |
| 107 | Each set of ROMs also has its own pair of PROMs. |
| 108 | |
| 109 | |
| 110 | I/O ports: |
| 111 | IN0: user expansion |
| 112 | IN1: 0-TTYIN, 1-CASSIN, 3-SW8(binary/ports), 4-SW7(reset/pup), 5-SW6(hex/oct), 6-(pup signal) |
| 113 | IN3: 8279 status |
| 114 | IN4: 8279 key |
| 115 | IN5: set MAP1 |
| 116 | IN6: set MAP2 |
| 117 | IN7: set MAP3 |
| 118 | IN8: read eprom (in the eprom programmer) |
| 119 | OUT0: PORT0 LEDs |
| 120 | OUT1: PORT1 LEDs |
| 121 | OUT2: PORT2 LEDs |
| 122 | OUT3: 8279 control |
| 123 | OUT4: 8279 7-segment LED data |
| 124 | OUT5: TTYOUT, CASSOUT |
| 125 | OUT9: turn pup signal off |
| 126 | OUTA: programming pulse on/off (eprom programmer) |
| 127 | |
| 128 | Dips: |
| 129 | SW1-4 hardware control of RAM being writable |
| 130 | SW5 not used |
| 131 | SW6 Control if the 7-segment displays show Octal (low) or Hex (high). |
| 132 | SW7 Reset only causes the cpu to perform a warm start. PUP does a cold start (Power-UP). |
| 133 | SW8 Control if the PORT displays echo the 7-segment displays (high), or just act as normal output ports (low). |
| 134 | |
| 135 | - Layout is empty, so nothing is displayed. |
| 136 | - Need to emulate 8279 chip, as almost every feature of it is needed. |
| 137 | |
| 15 | 138 | ****************************************************************************/ |
| 16 | 139 | #define ADDRESS_MAP_MODERN |
| 17 | 140 | |
| r13845 | r13846 | |
| 33 | 156 | DECLARE_READ8_MEMBER(mmd1_keyboard_r); |
| 34 | 157 | DECLARE_READ8_MEMBER(mmd2_03_r); |
| 35 | 158 | DECLARE_WRITE8_MEMBER(mmd2_04_w); |
| 159 | DECLARE_READ8_MEMBER(mmd2_bank_w); |
| 36 | 160 | UINT8 m_return_code; |
| 37 | 161 | }; |
| 38 | 162 | |
| r13845 | r13846 | |
| 105 | 229 | READ8_MEMBER( mmd1_state::mmd2_03_r ) { return 1; } |
| 106 | 230 | WRITE8_MEMBER( mmd1_state::mmd2_04_w ) { } |
| 107 | 231 | |
| 232 | READ8_MEMBER( mmd1_state::mmd2_bank_w ) |
| 233 | { |
| 234 | memory_set_bank(machine(), "bank1", offset); |
| 235 | memory_set_bank(machine(), "bank2", offset); |
| 236 | memory_set_bank(machine(), "bank3", offset); |
| 237 | memory_set_bank(machine(), "bank4", offset); |
| 238 | memory_set_bank(machine(), "bank5", offset); |
| 239 | memory_set_bank(machine(), "bank6", offset); |
| 240 | memory_set_bank(machine(), "bank7", offset); |
| 241 | memory_set_bank(machine(), "bank8", offset); |
| 242 | return 0xff; |
| 243 | } |
| 108 | 244 | |
| 245 | |
| 109 | 246 | static ADDRESS_MAP_START(mmd1_mem, AS_PROGRAM, 8, mmd1_state) |
| 110 | 247 | ADDRESS_MAP_UNMAP_HIGH |
| 111 | 248 | AM_RANGE( 0x0000, 0x00ff ) AM_ROM // Main ROM |
| r13845 | r13846 | |
| 124 | 261 | |
| 125 | 262 | static ADDRESS_MAP_START(mmd2_mem, AS_PROGRAM, 8, mmd1_state) |
| 126 | 263 | ADDRESS_MAP_UNMAP_HIGH |
| 127 | | AM_RANGE( 0x0000, 0x03ff ) AM_RAM // WE0 |
| 128 | | AM_RANGE( 0x0400, 0x07ff ) AM_RAM // WE1 |
| 129 | | AM_RANGE( 0x0800, 0x0bff ) AM_RAM // WE2 |
| 130 | | AM_RANGE( 0x0c00, 0x0fff ) AM_RAM // WE3 |
| 131 | | |
| 132 | | AM_RANGE( 0xd800, 0xdfff ) AM_ROM // ROM label 330 |
| 133 | | AM_RANGE( 0xe000, 0xe7ff ) AM_ROM // ROM label 340 |
| 134 | | AM_RANGE( 0xe800, 0xefff ) AM_ROM // ROM label 350 |
| 135 | | AM_RANGE( 0xf000, 0xf7ff ) AM_ROM // ROM label 360 |
| 136 | | AM_RANGE( 0xfc00, 0xfcff ) AM_RAM // System RAM |
| 264 | AM_RANGE(0x0000, 0x03ff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank2") |
| 265 | AM_RANGE(0x0400, 0x0fff) AM_READ_BANK("bank3") AM_WRITE_BANK("bank4") |
| 266 | AM_RANGE(0xd800, 0xe3ff) AM_READ_BANK("bank5") AM_WRITE_BANK("bank6") |
| 267 | AM_RANGE(0xe400, 0xe7ff) AM_READ_BANK("bank7") AM_WRITE_BANK("bank8") |
| 268 | AM_RANGE(0xfc00, 0xfcff) AM_RAM // Scratchpad |
| 137 | 269 | ADDRESS_MAP_END |
| 138 | 270 | |
| 139 | 271 | static ADDRESS_MAP_START(mmd2_io, AS_IO, 8, mmd1_state) |
| 140 | 272 | ADDRESS_MAP_UNMAP_HIGH |
| 141 | | // assuming that ports 0,1,2 are same as mmd1 |
| 142 | | AM_RANGE( 0x00, 0x00 ) AM_READWRITE(mmd1_keyboard_r, mmd1_port0_w) |
| 273 | AM_RANGE( 0x00, 0x00 ) AM_WRITE(mmd1_port0_w) |
| 143 | 274 | AM_RANGE( 0x01, 0x01 ) AM_WRITE(mmd1_port1_w) |
| 144 | 275 | AM_RANGE( 0x02, 0x02 ) AM_WRITE(mmd1_port2_w) |
| 145 | | AM_RANGE( 0x03, 0x03 ) AM_READ(mmd2_03_r) |
| 146 | | AM_RANGE( 0x04, 0x04 ) AM_WRITE(mmd2_04_w) |
| 276 | AM_RANGE( 0x03, 0x03 ) AM_READ(mmd2_03_r) // 8279 status/control |
| 277 | AM_RANGE( 0x04, 0x04 ) AM_WRITE(mmd2_04_w) // 8279 kbd/display |
| 278 | AM_RANGE( 0x05, 0x07 ) AM_READ(mmd2_bank_w) |
| 147 | 279 | ADDRESS_MAP_END |
| 148 | 280 | |
| 149 | 281 | |
| r13845 | r13846 | |
| 194 | 326 | */ |
| 195 | 327 | INPUT_PORTS_END |
| 196 | 328 | |
| 197 | | static MACHINE_RESET(mmd1) |
| 329 | static MACHINE_RESET( mmd1 ) |
| 198 | 330 | { |
| 199 | 331 | mmd1_state *state = machine.driver_data<mmd1_state>(); |
| 200 | 332 | state->m_return_code = 0xff; |
| 201 | 333 | } |
| 202 | 334 | |
| 203 | | static MACHINE_RESET(mmd2) |
| 335 | static MACHINE_RESET( mmd2 ) |
| 204 | 336 | { |
| 205 | | cpu_set_reg(machine.device("maincpu"), I8085_PC, 0xd840); // fixme |
| 337 | memory_set_bank(machine, "bank1", 0); |
| 338 | memory_set_bank(machine, "bank2", 0); |
| 339 | memory_set_bank(machine, "bank3", 0); |
| 340 | memory_set_bank(machine, "bank4", 0); |
| 341 | memory_set_bank(machine, "bank5", 0); |
| 342 | memory_set_bank(machine, "bank6", 0); |
| 343 | memory_set_bank(machine, "bank7", 0); |
| 344 | memory_set_bank(machine, "bank8", 0); |
| 206 | 345 | } |
| 207 | 346 | |
| 347 | DRIVER_INIT( mmd2 ) |
| 348 | { |
| 349 | /* |
| 350 | We preset all banks here, so that bankswitching will incur no speed penalty. |
| 351 | 0000/0400 indicate ROMs, D800/DC00/E400 indicate RAM, 8000 is a dummy write area for ROM banks. |
| 352 | */ |
| 353 | |
| 354 | UINT8 *p_ram = machine.region("maincpu")->base(); |
| 355 | memory_configure_bank(machine, "bank1", 0, 1, &p_ram[0x0000], 0); |
| 356 | memory_configure_bank(machine, "bank1", 1, 1, &p_ram[0xd800], 0); |
| 357 | memory_configure_bank(machine, "bank1", 2, 1, &p_ram[0x0c00], 0); |
| 358 | memory_configure_bank(machine, "bank2", 0, 1, &p_ram[0x8000], 0); |
| 359 | memory_configure_bank(machine, "bank2", 1, 1, &p_ram[0xd800], 0); |
| 360 | memory_configure_bank(machine, "bank2", 2, 1, &p_ram[0x8000], 0); |
| 361 | memory_configure_bank(machine, "bank3", 0, 1, &p_ram[0x0400], 0); |
| 362 | memory_configure_bank(machine, "bank3", 1, 1, &p_ram[0xdc00], 0); |
| 363 | memory_configure_bank(machine, "bank3", 2, 1, &p_ram[0xdc00], 0); |
| 364 | memory_configure_bank(machine, "bank4", 0, 1, &p_ram[0x8000], 0); |
| 365 | memory_configure_bank(machine, "bank4", 1, 1, &p_ram[0xdc00], 0); |
| 366 | memory_configure_bank(machine, "bank4", 2, 1, &p_ram[0xdc00], 0); |
| 367 | memory_configure_bank(machine, "bank5", 0, 1, &p_ram[0xd800], 0); |
| 368 | memory_configure_bank(machine, "bank5", 1, 1, &p_ram[0x0000], 0); |
| 369 | memory_configure_bank(machine, "bank5", 2, 1, &p_ram[0x0000], 0); |
| 370 | memory_configure_bank(machine, "bank6", 0, 1, &p_ram[0xd800], 0); |
| 371 | memory_configure_bank(machine, "bank6", 1, 1, &p_ram[0x8000], 0); |
| 372 | memory_configure_bank(machine, "bank6", 2, 1, &p_ram[0x8000], 0); |
| 373 | memory_configure_bank(machine, "bank7", 0, 1, &p_ram[0xe400], 0); |
| 374 | memory_configure_bank(machine, "bank7", 1, 1, &p_ram[0x0c00], 0); |
| 375 | memory_configure_bank(machine, "bank7", 2, 1, &p_ram[0xd800], 0); |
| 376 | memory_configure_bank(machine, "bank8", 0, 1, &p_ram[0xe400], 0); |
| 377 | memory_configure_bank(machine, "bank8", 1, 1, &p_ram[0x8000], 0); |
| 378 | memory_configure_bank(machine, "bank8", 2, 1, &p_ram[0xd800], 0); |
| 379 | } |
| 380 | |
| 208 | 381 | static MACHINE_CONFIG_START( mmd1, mmd1_state ) |
| 209 | 382 | /* basic machine hardware */ |
| 210 | 383 | MCFG_CPU_ADD("maincpu",I8080, 6750000 / 9) |
| r13845 | r13846 | |
| 237 | 410 | |
| 238 | 411 | ROM_START( mmd2 ) |
| 239 | 412 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 240 | | ROM_LOAD( "mmd2330.bin", 0xd800, 0x0800, CRC(69a77199) SHA1(6c83093b2c32a558c969f4fe8474b234023cc348)) |
| 241 | | ROM_LOAD( "mmd2340.bin", 0xe000, 0x0800, CRC(70681bd6) SHA1(c37e3cf34a75e8538471030bb49b8aed45d00ec3)) |
| 242 | | ROM_LOAD( "mmd2350.bin", 0xe800, 0x0800, CRC(359f577c) SHA1(9405ca0c1977721e4540a4017907c06dab08d398)) |
| 243 | | ROM_LOAD( "mmd2360.bin", 0xf000, 0x0800, CRC(967e69b8) SHA1(c21ec8bef955806a2c6e1b1c8e9068662fb88038)) |
| 413 | ROM_LOAD( "mmd2330.bin", 0x0000, 0x0800, CRC(69a77199) SHA1(6c83093b2c32a558c969f4fe8474b234023cc348)) |
| 414 | ROM_LOAD( "mmd2340.bin", 0x0800, 0x0800, CRC(70681bd6) SHA1(c37e3cf34a75e8538471030bb49b8aed45d00ec3)) |
| 415 | ROM_LOAD( "mmd2350.bin", 0x1000, 0x0800, CRC(359f577c) SHA1(9405ca0c1977721e4540a4017907c06dab08d398)) |
| 416 | ROM_LOAD( "mmd2360.bin", 0x1800, 0x0800, CRC(967e69b8) SHA1(c21ec8bef955806a2c6e1b1c8e9068662fb88038)) |
| 244 | 417 | ROM_END |
| 245 | 418 | |
| 246 | 419 | /* Driver */ |
| 247 | 420 | |
| 248 | 421 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 249 | | COMP( 1976, mmd1, 0, 0, mmd1, mmd1, 0, "E&L Instruments Inc", "MMD-1", GAME_NO_SOUND) |
| 250 | | COMP( 1976, mmd2, mmd1, 0, mmd2, mmd2, 0, "E&L Instruments Inc", "MMD-2", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 251 | | |
| 422 | COMP( 1976, mmd1, 0, 0, mmd1, mmd1, 0, "E&L Instruments Inc", "MMD-1", GAME_NO_SOUND_HW) |
| 423 | COMP( 1976, mmd2, mmd1, 0, mmd2, mmd2, mmd2, "E&L Instruments Inc", "MMD-2", GAME_NOT_WORKING | GAME_NO_SOUND_HW) |