src/mess/drivers/mmd1.c
| r5003 | r5004 | |
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | MMD-1 |
| 3 | MMD-1 driver by Miodrag Milanovic |
| 4 | |
| 5 | 12/05/2009 Initial version |
| 4 | 6 | |
| 5 | | 12/05/2009 Skeleton driver. |
| 6 | | |
| 7 | 7 | ****************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "cpu/i8085/i8085.h" |
| 11 | #include "mmd1.lh" |
| 11 | 12 | |
| 13 | WRITE8_HANDLER (mmd1_port0_w) |
| 14 | { |
| 15 | output_set_value("p0_7", BIT(data,7) ? 0 : 1); |
| 16 | output_set_value("p0_6", BIT(data,6) ? 0 : 1); |
| 17 | output_set_value("p0_5", BIT(data,5) ? 0 : 1); |
| 18 | output_set_value("p0_4", BIT(data,4) ? 0 : 1); |
| 19 | output_set_value("p0_3", BIT(data,3) ? 0 : 1); |
| 20 | output_set_value("p0_2", BIT(data,2) ? 0 : 1); |
| 21 | output_set_value("p0_1", BIT(data,1) ? 0 : 1); |
| 22 | output_set_value("p0_0", BIT(data,0) ? 0 : 1); |
| 23 | } |
| 24 | |
| 25 | WRITE8_HANDLER (mmd1_port1_w) |
| 26 | { |
| 27 | output_set_value("p1_7", BIT(data,7) ? 0 : 1); |
| 28 | output_set_value("p1_6", BIT(data,6) ? 0 : 1); |
| 29 | output_set_value("p1_5", BIT(data,5) ? 0 : 1); |
| 30 | output_set_value("p1_4", BIT(data,4) ? 0 : 1); |
| 31 | output_set_value("p1_3", BIT(data,3) ? 0 : 1); |
| 32 | output_set_value("p1_2", BIT(data,2) ? 0 : 1); |
| 33 | output_set_value("p1_1", BIT(data,1) ? 0 : 1); |
| 34 | output_set_value("p1_0", BIT(data,0) ? 0 : 1); |
| 35 | } |
| 36 | |
| 37 | WRITE8_HANDLER (mmd1_port2_w) |
| 38 | { |
| 39 | output_set_value("p2_7", BIT(data,7) ? 0 : 1); |
| 40 | output_set_value("p2_6", BIT(data,6) ? 0 : 1); |
| 41 | output_set_value("p2_5", BIT(data,5) ? 0 : 1); |
| 42 | output_set_value("p2_4", BIT(data,4) ? 0 : 1); |
| 43 | output_set_value("p2_3", BIT(data,3) ? 0 : 1); |
| 44 | output_set_value("p2_2", BIT(data,2) ? 0 : 1); |
| 45 | output_set_value("p2_1", BIT(data,1) ? 0 : 1); |
| 46 | output_set_value("p2_0", BIT(data,0) ? 0 : 1); |
| 47 | } |
| 48 | |
| 49 | READ8_HANDLER (mmd1_keyboard_r) |
| 50 | { |
| 51 | UINT8 line1 = input_port_read(space->machine,"LINE1"); |
| 52 | UINT8 line2 = input_port_read(space->machine,"LINE2"); |
| 53 | if (BIT(line1,0)==0) return 0; |
| 54 | if (BIT(line1,1)==0) return 1; |
| 55 | if (BIT(line1,2)==0) return 2; |
| 56 | if (BIT(line1,3)==0) return 3; |
| 57 | if (BIT(line1,4)==0) return 4; |
| 58 | if (BIT(line1,5)==0) return 5; |
| 59 | if (BIT(line1,6)==0) return 6; |
| 60 | if (BIT(line1,7)==0) return 7; |
| 61 | |
| 62 | if (BIT(line2,0)==0) return 8; |
| 63 | if (BIT(line2,2)==0) return 10; |
| 64 | if (BIT(line2,3)==0) return 11; |
| 65 | if (BIT(line2,4)==0) return 12; |
| 66 | if (BIT(line2,5)==0) return 13; |
| 67 | if (BIT(line2,6)==0) return 14; |
| 68 | if (BIT(line2,7)==0) return 15; |
| 69 | |
| 70 | return 0xff; |
| 71 | } |
| 72 | |
| 12 | 73 | static ADDRESS_MAP_START(mmd1_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 13 | 74 | ADDRESS_MAP_UNMAP_HIGH |
| 14 | 75 | AM_RANGE( 0x0000, 0x00ff ) AM_ROM // Main ROM |
| r5003 | r5004 | |
| 20 | 81 | static ADDRESS_MAP_START( mmd1_io , ADDRESS_SPACE_IO, 8) |
| 21 | 82 | ADDRESS_MAP_UNMAP_HIGH |
| 22 | 83 | ADDRESS_MAP_GLOBAL_MASK(0x07) |
| 84 | AM_RANGE( 0x00, 0x00 ) AM_READWRITE(mmd1_keyboard_r, mmd1_port0_w) |
| 85 | AM_RANGE( 0x01, 0x01 ) AM_WRITE(mmd1_port1_w) |
| 86 | AM_RANGE( 0x02, 0x02 ) AM_WRITE(mmd1_port2_w) |
| 23 | 87 | ADDRESS_MAP_END |
| 24 | 88 | |
| 25 | 89 | /* Input ports */ |
| 26 | 90 | INPUT_PORTS_START( mmd1 ) |
| 91 | PORT_START("LINE1") |
| 92 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) |
| 93 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) |
| 94 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) |
| 95 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) |
| 96 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) |
| 97 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) |
| 98 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) |
| 99 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) |
| 100 | PORT_START("LINE2") |
| 101 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) |
| 102 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
| 103 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) |
| 104 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) |
| 105 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) |
| 106 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) |
| 107 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) |
| 108 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) |
| 109 | PORT_START("LINE3") |
| 110 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) |
| 27 | 111 | INPUT_PORTS_END |
| 28 | 112 | |
| 29 | 113 | |
| r5003 | r5004 | |
| 31 | 115 | { |
| 32 | 116 | } |
| 33 | 117 | |
| 34 | | static VIDEO_START( mmd1 ) |
| 35 | | { |
| 36 | | } |
| 37 | | |
| 38 | | static VIDEO_UPDATE( mmd1 ) |
| 39 | | { |
| 40 | | return 0; |
| 41 | | } |
| 42 | | |
| 43 | 118 | static MACHINE_DRIVER_START( mmd1 ) |
| 44 | 119 | /* basic machine hardware */ |
| 45 | 120 | MDRV_CPU_ADD("maincpu",8080, 6750000 / 9) |
| r5003 | r5004 | |
| 48 | 123 | |
| 49 | 124 | MDRV_MACHINE_RESET(mmd1) |
| 50 | 125 | |
| 51 | | /* video hardware */ |
| 52 | | MDRV_SCREEN_ADD("screen", RASTER) |
| 53 | | MDRV_SCREEN_REFRESH_RATE(50) |
| 54 | | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 55 | | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 56 | | MDRV_SCREEN_SIZE(640, 480) |
| 57 | | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 58 | | MDRV_PALETTE_LENGTH(2) |
| 59 | | MDRV_PALETTE_INIT(black_and_white) |
| 60 | | |
| 61 | | MDRV_VIDEO_START(mmd1) |
| 62 | | MDRV_VIDEO_UPDATE(mmd1) |
| 126 | /* video hardware */ |
| 127 | MDRV_DEFAULT_LAYOUT(layout_mmd1) |
| 63 | 128 | MACHINE_DRIVER_END |
| 64 | 129 | |
| 65 | 130 | static SYSTEM_CONFIG_START(mmd1) |
| r5003 | r5004 | |
| 74 | 139 | /* Driver */ |
| 75 | 140 | |
| 76 | 141 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 77 | | COMP( 1976, mmd1, 0, 0, mmd1, mmd1, 0, mmd1, "E&L Instruments, Inc.", "MMD-1", GAME_NOT_WORKING) |
| 142 | COMP( 1976, mmd1, 0, 0, mmd1, mmd1, 0, mmd1, "E&L Instruments, Inc.", "MMD-1", 0) |
| 78 | 143 | |