src/mess/drivers/d6800.c
| r9608 | r9609 | |
| 20 | 20 | Information and programs can be found at http://chip8.com/?page=78 |
| 21 | 21 | |
| 22 | 22 | |
| 23 | To change the large numbers at the bottom, start in debug mode, enter |
| 24 | some data at memory 6 and 7, then G to run. |
| 23 | 25 | |
| 26 | |
| 24 | 27 | TODO: |
| 25 | | - It doesn't boot up |
| 26 | 28 | - Cassette |
| 27 | 29 | - CPU should freeze while screen is being drawn |
| 28 | | - Confirm if screen is being drawn the right way |
| 29 | | - Confirm keyboard configuration |
| 30 | - Keyboard (should work but it doesn't) |
| 30 | 31 | */ |
| 31 | 32 | |
| 32 | 33 | #include "emu.h" |
| r9608 | r9609 | |
| 59 | 60 | |
| 60 | 61 | static ADDRESS_MAP_START( d6800_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 61 | 62 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_REGION("maincpu", 0x0000) |
| 62 | | AM_RANGE(0x8010, 0x8013) AM_MIRROR(0x3cec) AM_DEVREADWRITE("pia", pia6821_r, pia6821_w) |
| 63 | AM_RANGE(0x8010, 0x8013) AM_DEVREADWRITE("pia", pia6821_r, pia6821_w) |
| 63 | 64 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3c00) AM_ROM |
| 64 | 65 | ADDRESS_MAP_END |
| 65 | 66 | |
| r9608 | r9609 | |
| 71 | 72 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 72 | 73 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 73 | 74 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 75 | PORT_BIT( 0xf0, 0xf0, IPT_UNUSED ) |
| 74 | 76 | |
| 75 | 77 | PORT_START("LINE1") |
| 76 | 78 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 77 | 79 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 78 | 80 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 79 | 81 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 82 | PORT_BIT( 0xf0, 0xf0, IPT_UNUSED ) |
| 80 | 83 | |
| 81 | 84 | PORT_START("LINE2") |
| 82 | 85 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 83 | 86 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 84 | 87 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 85 | 88 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 89 | PORT_BIT( 0xf0, 0xf0, IPT_UNUSED ) |
| 86 | 90 | |
| 87 | 91 | PORT_START("LINE3") |
| 88 | 92 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 89 | 93 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 90 | 94 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 91 | 95 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 96 | PORT_BIT( 0xf0, 0xf0, IPT_UNUSED ) |
| 92 | 97 | |
| 93 | 98 | PORT_START("SPECIAL") |
| 94 | 99 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("FN") PORT_CODE(KEYCODE_LSHIFT) |
| r9608 | r9609 | |
| 161 | 166 | knows if the tone is 1200 or 2400 Hz. Input to PIA is bit 7. |
| 162 | 167 | */ |
| 163 | 168 | |
| 164 | | return 0; |
| 169 | return 0xff; |
| 165 | 170 | } |
| 166 | 171 | |
| 167 | 172 | static WRITE8_DEVICE_HANDLER( d6800_cassette_w ) |
| r9608 | r9609 | |
| 177 | 182 | |
| 178 | 183 | static READ8_DEVICE_HANDLER( d6800_keyboard_r ) |
| 179 | 184 | { |
| 180 | | UINT8 data = 0x0f; |
| 185 | UINT8 data = 0xff; |
| 181 | 186 | |
| 182 | 187 | if (!BIT(d6800_keylatch, 4)) data &= input_port_read(device->machine, "LINE0"); |
| 183 | 188 | if (!BIT(d6800_keylatch, 5)) data &= input_port_read(device->machine, "LINE1"); |
| 184 | 189 | if (!BIT(d6800_keylatch, 6)) data &= input_port_read(device->machine, "LINE2"); |
| 185 | 190 | if (!BIT(d6800_keylatch, 7)) data &= input_port_read(device->machine, "LINE3"); |
| 186 | 191 | |
| 187 | | d6800_keydown = (data==0x0f) ? 0 : 1; |
| 192 | d6800_keydown = (data==0xff) ? 0 : 1; |
| 188 | 193 | |
| 189 | | return d6800_keylatch | data; |
| 194 | return data; |
| 190 | 195 | } |
| 191 | 196 | |
| 192 | 197 | static WRITE8_DEVICE_HANDLER( d6800_keyboard_w ) |