src/mess/drivers/d6800.c
| r9590 | r9591 | |
| 67 | 67 | |
| 68 | 68 | static INPUT_PORTS_START( d6800 ) |
| 69 | 69 | PORT_START("LINE0") |
| 70 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 71 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 72 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 73 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 70 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 71 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 72 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 73 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 74 | 74 | |
| 75 | 75 | PORT_START("LINE1") |
| 76 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 77 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 78 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 79 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 76 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 77 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 78 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 79 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 80 | 80 | |
| 81 | 81 | PORT_START("LINE2") |
| 82 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 83 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 84 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 85 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 82 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 83 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 84 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 85 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 86 | 86 | |
| 87 | 87 | PORT_START("LINE3") |
| 88 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 89 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 90 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 91 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 88 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 89 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 90 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 91 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 92 | 92 | |
| 93 | 93 | PORT_START("SPECIAL") |
| 94 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("FN") PORT_CODE(KEYCODE_LSHIFT) |
| 94 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("FN") PORT_CODE(KEYCODE_LSHIFT) |
| 95 | 95 | INPUT_PORTS_END |
| 96 | 96 | |
| 97 | 97 | /* Video */ |
src/mess/drivers/mekd2.c
| r9590 | r9591 | |
| 14 | 14 | 6000-63ff PROM optional PROM |
| 15 | 15 | or |
| 16 | 16 | 6000-67ff ROM optional ROM |
| 17 | | 8004-8007 PIA |
| 18 | | 8008 ACIA cassette interface |
| 17 | 8004-8007 PIA expansion port |
| 18 | 8008-8009 ACIA cassette interface |
| 19 | 19 | 8020-8023 PIA keyboard interface |
| 20 | 20 | a000-a07f RAM 128 bytes RAM (JBUG scratch) |
| 21 | 21 | c000-c3ff PROM optional PROM |
| 22 | 22 | or |
| 23 | 23 | c000-c7ff ROM optional ROM |
| 24 | 24 | e000-e3ff ROM JBUG monitor program |
| 25 | | e400-ffff -/- not used |
| 25 | e400-ffff -/- mirrors of monitor rom |
| 26 | 26 | |
| 27 | |
| 28 | TODO |
| 29 | - Cassette (it is extremely complex) |
| 30 | - Keyboard (it should work but doesn't) |
| 31 | - Replace graphical displays with modern artwork |
| 32 | |
| 27 | 33 | ******************************************************************************/ |
| 28 | 34 | |
| 29 | 35 | #include "emu.h" |
| 30 | 36 | #include "cpu/m6800/m6800.h" |
| 31 | 37 | #include "sound/dac.h" |
| 38 | #include "machine/6821pia.h" |
| 39 | #include "machine/6850acia.h" |
| 32 | 40 | #include "devices/cartslot.h" |
| 33 | 41 | #include "includes/mekd2.h" |
| 34 | 42 | |
| 35 | | #ifdef UNUSED_FUNCTION |
| 36 | | static READ8_HANDLER(mekd2_pia_r) { return 0xff; } |
| 37 | | static READ8_HANDLER(mekd2_cas_r) { return 0xff; } |
| 38 | | static READ8_HANDLER(mekd2_kbd_r) { return 0xff; } |
| 39 | | #endif |
| 43 | #define XTAL_MEKD2 1228800 |
| 40 | 44 | |
| 41 | | static UINT8 pia[8]; |
| 45 | static UINT8 mekd2_segment; |
| 46 | static UINT8 mekd2_digit; |
| 47 | static UINT8 mekd2_keydata; |
| 42 | 48 | |
| 43 | | #ifdef UNUSED_FUNCTION |
| 44 | | static WRITE8_HANDLER(mekd2_pia_w) { } |
| 45 | | static WRITE8_HANDLER(mekd2_cas_w) { } |
| 46 | | #endif |
| 49 | /*********************************************************** |
| 47 | 50 | |
| 48 | | static WRITE8_HANDLER(mekd2_kbd_w) |
| 51 | Trace hardware (what happens when N is pressed) |
| 52 | |
| 53 | ************************************************************/ |
| 54 | |
| 55 | static TIMER_CALLBACK( mekd2_trace ) |
| 49 | 56 | { |
| 50 | | mekd2_state *state = space->machine->driver_data<mekd2_state>(); |
| 51 | | UINT8 *videoram = state->videoram; |
| 52 | | pia[offset] = data; |
| 53 | | switch( offset ) |
| 54 | | { |
| 55 | | case 2: |
| 56 | | if( data & 0x20 ) |
| 57 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE); |
| 58 | } |
| 59 | |
| 60 | static WRITE_LINE_DEVICE_HANDLER( mekd2_nmi_w ) |
| 61 | { |
| 62 | if (state) |
| 63 | cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE); |
| 64 | else |
| 65 | timer_set(device->machine, ATTOTIME_IN_USEC(18), NULL, 0, mekd2_trace); |
| 66 | } |
| 67 | |
| 68 | /*********************************************************** |
| 69 | |
| 70 | Keyboard |
| 71 | |
| 72 | ************************************************************/ |
| 73 | |
| 74 | static READ_LINE_DEVICE_HANDLER( mekd2_key40_r ) |
| 75 | { |
| 76 | return (mekd2_keydata & 0x40) ? 1 : 0; |
| 77 | } |
| 78 | |
| 79 | static READ8_DEVICE_HANDLER( mekd2_key_r ) |
| 80 | { |
| 81 | char kbdrow[4]; |
| 82 | UINT8 i; |
| 83 | mekd2_keydata = 0xff; |
| 84 | |
| 85 | for (i = 0; i < 6; i++) |
| 86 | if (BIT(mekd2_digit, i)) |
| 57 | 87 | { |
| 58 | | videoram[0*2+0] = ~pia[0]; |
| 59 | | videoram[0*2+1] = 14; |
| 88 | sprintf(kbdrow,"X%d",i); |
| 89 | mekd2_keydata &= input_port_read(device->machine, kbdrow); |
| 60 | 90 | } |
| 61 | | if( data & 0x10 ) |
| 91 | |
| 92 | if (mekd2_digit < 0x40) |
| 93 | i = (mekd2_keydata & 1) ? 0x80 : 0; |
| 94 | else |
| 95 | if (mekd2_digit < 0x80) |
| 96 | i = (mekd2_keydata & 2) ? 0x80 : 0; |
| 97 | else |
| 98 | if (mekd2_digit < 0xc0) |
| 99 | i = (mekd2_keydata & 4) ? 0x80 : 0; |
| 100 | else |
| 101 | i = (mekd2_keydata & 8) ? 0x80 : 0; |
| 102 | |
| 103 | return i; |
| 104 | } |
| 105 | |
| 106 | /*********************************************************** |
| 107 | |
| 108 | LED display |
| 109 | |
| 110 | ************************************************************/ |
| 111 | |
| 112 | static WRITE8_DEVICE_HANDLER( mekd2_segment_w ) |
| 113 | { |
| 114 | mekd2_segment = ~data; |
| 115 | } |
| 116 | |
| 117 | static WRITE8_DEVICE_HANDLER( mekd2_digit_w ) |
| 118 | { |
| 119 | UINT8 i; |
| 120 | mekd2_state *state = device->machine->driver_data<mekd2_state>(); |
| 121 | UINT8 *videoram = state->videoram; |
| 122 | |
| 123 | for (i = 0; i < 6; i++) |
| 124 | if (BIT(data, i)) |
| 62 | 125 | { |
| 63 | | videoram[1*2+0] = ~pia[0]; |
| 64 | | videoram[1*2+1] = 14; |
| 126 | videoram[10 - i * 2] = mekd2_segment; |
| 127 | videoram[11 - i * 2] = 14; |
| 65 | 128 | } |
| 66 | | if( data & 0x08 ) |
| 67 | | { |
| 68 | | videoram[2*2+0] = ~pia[0]; |
| 69 | | videoram[2*2+1] = 14; |
| 70 | | } |
| 71 | | if( data & 0x04 ) |
| 72 | | { |
| 73 | | videoram[3*2+0] = ~pia[0]; |
| 74 | | videoram[3*2+1] = 14; |
| 75 | | } |
| 76 | | if( data & 0x02 ) |
| 77 | | { |
| 78 | | videoram[4*2+0] = ~pia[0]; |
| 79 | | videoram[4*2+1] = 14; |
| 80 | | } |
| 81 | | if( data & 0x01 ) |
| 82 | | { |
| 83 | | videoram[5*2+0] = ~pia[0]; |
| 84 | | videoram[5*2+1] = 14; |
| 85 | | } |
| 86 | | break; |
| 87 | | } |
| 129 | |
| 130 | mekd2_digit = data; |
| 88 | 131 | } |
| 89 | 132 | |
| 133 | /*********************************************************** |
| 90 | 134 | |
| 135 | Address Map |
| 136 | |
| 137 | ************************************************************/ |
| 138 | |
| 91 | 139 | static ADDRESS_MAP_START( mekd2_mem , ADDRESS_SPACE_PROGRAM, 8) |
| 92 | | AM_RANGE(0x0000, 0x00ff) AM_RAM |
| 93 | | // AM_RANGE(0x0100, 0x01ff) AM_RAM /* optional, set up in mekd2_init_machine */ |
| 94 | | // AM_RANGE(0x6000, 0x67ff) AM_ROM /* -"- */ |
| 95 | | // AM_RANGE(0x8004, 0x8007) AM_READWRITE(mekd2_pia_r, mekd2_pia_w) |
| 96 | | // AM_RANGE(0x8008, 0x8008) AM_READWRITE(mekd2_cas_r, mekd2_cas_w) |
| 97 | | AM_RANGE(0x8020, 0x8023) AM_WRITE(mekd2_kbd_w) /* mekd2_kbd_r */ |
| 98 | | AM_RANGE(0xa000, 0xa07f) AM_RAM |
| 99 | | // AM_RANGE(0xc000, 0xc7ff) AM_RAM /* optional, set up in mekd2_init_machine */ |
| 140 | AM_RANGE(0x0000, 0x00ff) AM_RAM // user ram |
| 141 | AM_RANGE(0x8004, 0x8007) AM_DEVREADWRITE("pia_u", pia6821_r, pia6821_w) |
| 142 | AM_RANGE(0x8008, 0x8008) AM_DEVREADWRITE("acia", acia6850_stat_r, acia6850_ctrl_w) |
| 143 | AM_RANGE(0x8009, 0x8009) AM_DEVREADWRITE("acia", acia6850_data_r, acia6850_data_w) |
| 144 | AM_RANGE(0x8020, 0x8023) AM_DEVREADWRITE("pia_s", pia6821_r, pia6821_w) |
| 145 | AM_RANGE(0xa000, 0xa07f) AM_RAM // system ram |
| 100 | 146 | AM_RANGE(0xe000, 0xe3ff) AM_ROM AM_MIRROR(0x1c00) /* JBUG ROM */ |
| 101 | 147 | ADDRESS_MAP_END |
| 102 | 148 | |
| 103 | | /* 2008-05 FP: Among the 8 Unknown inputs there are 4 command keys, the other inputs being unused: |
| 149 | /*********************************************************** |
| 150 | |
| 151 | Keys |
| 152 | |
| 153 | ************************************************************/ |
| 154 | |
| 155 | /* |
| 156 | |
| 157 | Enter the 4 digit address then the command key: |
| 158 | |
| 159 | - M : Examine and Change Memory |
| 160 | - E : Escape (abort) operation (H key in our emulation) |
| 161 | - R : Examine Registers |
| 162 | - G : Begin execution at specified address |
| 104 | 163 | - P : Punch data from memory to magnetic tape |
| 105 | 164 | - L : Load memory from magnetic tape |
| 106 | 165 | - N : Trace one instruction |
| r9590 | r9591 | |
| 117 | 176 | |
| 118 | 177 | */ |
| 119 | 178 | static INPUT_PORTS_START( mekd2 ) |
| 120 | | PORT_START("KEY0") |
| 121 | | PORT_BIT(0x80, 0x80, IPT_UNUSED) |
| 122 | | PORT_BIT(0x40, 0x40, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) |
| 123 | | PORT_BIT(0x20, 0x20, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) |
| 124 | | PORT_BIT(0x10, 0x10, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) |
| 125 | | PORT_BIT(0x08, 0x08, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) |
| 126 | | PORT_BIT(0x04, 0x04, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) |
| 127 | | PORT_BIT(0x02, 0x02, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) |
| 128 | | PORT_BIT(0x01, 0x01, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) |
| 179 | PORT_START("X0") |
| 180 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) |
| 181 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) |
| 182 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E (hex)") PORT_CODE(KEYCODE_E) |
| 183 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) |
| 129 | 184 | |
| 130 | | PORT_START("KEY1") |
| 131 | | PORT_BIT(0x80, 0x80, IPT_UNUSED) |
| 132 | | PORT_BIT(0x40, 0x40, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) |
| 133 | | PORT_BIT(0x20, 0x20, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) |
| 134 | | PORT_BIT(0x10, 0x10, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) |
| 135 | | PORT_BIT(0x08, 0x08, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) |
| 136 | | PORT_BIT(0x04, 0x04, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) |
| 137 | | PORT_BIT(0x02, 0x02, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) |
| 138 | | PORT_BIT(0x01, 0x01, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) |
| 185 | PORT_START("X1") |
| 186 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) |
| 187 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) |
| 188 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) |
| 189 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) |
| 139 | 190 | |
| 140 | | PORT_START("KEY2") |
| 141 | | PORT_BIT(0x80, 0x80, IPT_UNUSED) |
| 142 | | PORT_BIT(0x40, 0x40, IPT_KEYBOARD) PORT_NAME("E (hex)") PORT_CODE(KEYCODE_E) |
| 143 | | PORT_BIT(0x20, 0x20, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) |
| 144 | | PORT_BIT(0x10, 0x10, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) |
| 145 | | PORT_BIT(0x08, 0x08, IPT_KEYBOARD) PORT_NAME("E (escape)") PORT_CODE(KEYCODE_H) |
| 146 | | PORT_BIT(0x04, 0x04, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) |
| 147 | | PORT_BIT(0x02, 0x02, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) |
| 148 | | PORT_BIT(0x01, 0x01, IPT_KEYBOARD) PORT_NAME("Unknown 1") |
| 191 | PORT_START("X2") |
| 192 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) |
| 193 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) |
| 194 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) |
| 195 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) |
| 149 | 196 | |
| 150 | | PORT_START("KEY3") |
| 151 | | PORT_BIT(0x80, 0x80, IPT_UNUSED) |
| 152 | | PORT_BIT(0x40, 0x40, IPT_KEYBOARD) PORT_NAME("Unknown 2") |
| 153 | | PORT_BIT(0x20, 0x20, IPT_KEYBOARD) PORT_NAME("Unknown 3") // this one corresponds to the 'square' key in the current code |
| 154 | | PORT_BIT(0x10, 0x10, IPT_KEYBOARD) PORT_NAME("Unknown 4") |
| 155 | | PORT_BIT(0x08, 0x08, IPT_KEYBOARD) PORT_NAME("Unknown 5") |
| 156 | | PORT_BIT(0x04, 0x04, IPT_KEYBOARD) PORT_NAME("Unknown 6") |
| 157 | | PORT_BIT(0x02, 0x02, IPT_KEYBOARD) PORT_NAME("Unknown 7") |
| 158 | | PORT_BIT(0x01, 0x01, IPT_KEYBOARD) PORT_NAME("Unknown 8") |
| 197 | PORT_START("X3") |
| 198 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) |
| 199 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) |
| 200 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) |
| 201 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) |
| 202 | |
| 203 | PORT_START("X4") |
| 204 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) |
| 205 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) |
| 206 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) |
| 207 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) |
| 208 | |
| 209 | PORT_START("X5") |
| 210 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) |
| 211 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E (escape)") PORT_CODE(KEYCODE_H) |
| 212 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) |
| 213 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) |
| 159 | 214 | INPUT_PORTS_END |
| 160 | 215 | |
| 216 | /*********************************************************** |
| 217 | |
| 218 | GFX |
| 219 | |
| 220 | ************************************************************/ |
| 221 | |
| 161 | 222 | static const gfx_layout led_layout = |
| 162 | 223 | { |
| 163 | 224 | 18, 24, /* 16 x 24 LED 7segment displays */ |
| r9590 | r9591 | |
| 198 | 259 | GFXDECODE_ENTRY( "gfx2", 0, key_layout, 16*2, 2 ) |
| 199 | 260 | GFXDECODE_END |
| 200 | 261 | |
| 262 | /*********************************************************** |
| 263 | |
| 264 | Interfaces |
| 265 | |
| 266 | ************************************************************/ |
| 267 | |
| 268 | static const pia6821_interface mekd2_s_mc6821_intf = |
| 269 | { |
| 270 | DEVCB_HANDLER(mekd2_key_r), /* port A input */ |
| 271 | DEVCB_NULL, /* port B input */ |
| 272 | DEVCB_NULL, /* CA1 input */ |
| 273 | DEVCB_LINE(mekd2_key40_r), /* CB1 input */ |
| 274 | DEVCB_NULL, /* CA2 input */ |
| 275 | DEVCB_NULL, /* CB2 input */ |
| 276 | DEVCB_HANDLER(mekd2_segment_w), /* port A output */ |
| 277 | DEVCB_HANDLER(mekd2_digit_w), /* port B output */ |
| 278 | DEVCB_LINE(mekd2_nmi_w), /* CA2 output */ |
| 279 | DEVCB_NULL, /* CB2 output */ |
| 280 | DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_NMI), /* IRQA output */ |
| 281 | DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_NMI) /* IRQB output */ |
| 282 | }; |
| 283 | |
| 284 | static const pia6821_interface mekd2_u_mc6821_intf = |
| 285 | { |
| 286 | DEVCB_NULL, /* port A input */ |
| 287 | DEVCB_NULL, /* port B input */ |
| 288 | DEVCB_NULL, /* CA1 input */ |
| 289 | DEVCB_NULL, /* CB1 input */ |
| 290 | DEVCB_NULL, /* CA2 input */ |
| 291 | DEVCB_NULL, /* CB2 input */ |
| 292 | DEVCB_NULL, /* port A output */ |
| 293 | DEVCB_NULL, /* port B output */ |
| 294 | DEVCB_NULL, /* CA2 output */ |
| 295 | DEVCB_NULL, /* CB2 output */ |
| 296 | DEVCB_CPU_INPUT_LINE("maincpu", M6800_IRQ_LINE), /* IRQA output */ |
| 297 | DEVCB_CPU_INPUT_LINE("maincpu", M6800_IRQ_LINE) /* IRQB output */ |
| 298 | }; |
| 299 | |
| 300 | static ACIA6850_INTERFACE( mekd2_acia_intf ) |
| 301 | { |
| 302 | XTAL_MEKD2 / 256, //connected to cassette circuit /* tx clock 4800Hz */ |
| 303 | XTAL_MEKD2 / 256, //connected to cassette circuit /* rx clock varies, controlled by cassette circuit */ |
| 304 | DEVCB_NULL,//LINE(cass),//connected to cassette circuit /* in rxd func */ |
| 305 | DEVCB_NULL,//LINE(cass),//connected to cassette circuit /* out txd func */ |
| 306 | DEVCB_NULL, /* in cts func */ |
| 307 | DEVCB_NULL, //connected to cassette circuit /* out rts func */ |
| 308 | DEVCB_NULL, /* in dcd func */ |
| 309 | DEVCB_NULL /* out irq func */ |
| 310 | }; |
| 311 | |
| 312 | /*********************************************************** |
| 313 | |
| 314 | Machine |
| 315 | |
| 316 | ************************************************************/ |
| 317 | |
| 201 | 318 | static MACHINE_CONFIG_START( mekd2, mekd2_state ) |
| 202 | 319 | /* basic machine hardware */ |
| 203 | | MDRV_CPU_ADD("maincpu", M6800, 614400) /* 614.4 kHz */ |
| 320 | MDRV_CPU_ADD("maincpu", M6800, XTAL_MEKD2 / 2) /* 614.4 kHz */ |
| 204 | 321 | MDRV_CPU_PROGRAM_MAP(mekd2_mem) |
| 205 | 322 | MDRV_QUANTUM_TIME(HZ(60)) |
| 206 | 323 | |
| 207 | | /* video hardware */ |
| 324 | /* video hardware */ |
| 208 | 325 | MDRV_SCREEN_ADD("screen", RASTER) |
| 209 | 326 | MDRV_SCREEN_REFRESH_RATE(60) |
| 210 | 327 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| r9590 | r9591 | |
| 228 | 345 | MDRV_CARTSLOT_EXTENSION_LIST("d2") |
| 229 | 346 | MDRV_CARTSLOT_NOT_MANDATORY |
| 230 | 347 | MDRV_CARTSLOT_LOAD(mekd2_cart) |
| 348 | |
| 349 | /* Devices */ |
| 350 | MDRV_PIA6821_ADD("pia_s", mekd2_s_mc6821_intf) |
| 351 | MDRV_PIA6821_ADD("pia_u", mekd2_u_mc6821_intf) |
| 352 | MDRV_ACIA6850_ADD("acia", mekd2_acia_intf) |
| 231 | 353 | MACHINE_CONFIG_END |
| 232 | 354 | |
| 355 | /*********************************************************** |
| 233 | 356 | |
| 357 | ROMS |
| 358 | |
| 359 | ************************************************************/ |
| 360 | |
| 234 | 361 | ROM_START(mekd2) |
| 235 | 362 | ROM_REGION(0x10000,"maincpu",0) |
| 236 | 363 | ROM_LOAD("jbug.rom", 0xe000, 0x0400, CRC(5ed08792) SHA1(b06e74652a4c4e67c4a12ddc191ffb8c07f3332e) ) |