src/mess/drivers/d6800.c
| r9575 | r9576 | |
| 23 | 23 | |
| 24 | 24 | TODO: |
| 25 | 25 | - It doesn't boot up |
| 26 | | - Find correct address of pia |
| 27 | 26 | - Cassette |
| 28 | | - RTC (vertical pulse) |
| 29 | 27 | - CPU should freeze while screen is being drawn |
| 30 | 28 | - Confirm if screen is being drawn the right way |
| 31 | 29 | - Confirm keyboard configuration |
| r9575 | r9576 | |
| 43 | 41 | static UINT8 d6800_keylatch; |
| 44 | 42 | static UINT8 d6800_keydown; |
| 45 | 43 | static UINT8 d6800_screen; |
| 44 | static UINT8 d6800_rtc; |
| 46 | 45 | static running_device *d6800_cassette; |
| 47 | 46 | static running_device *d6800_speaker; |
| 48 | 47 | |
| r9575 | r9576 | |
| 59 | 58 | /* Memory Maps */ |
| 60 | 59 | |
| 61 | 60 | static ADDRESS_MAP_START( d6800_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 62 | | AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x7c00) AM_RAM AM_REGION("maincpu", 0x0000) |
| 61 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_REGION("maincpu", 0x0000) |
| 63 | 62 | AM_RANGE(0x8010, 0x8013) AM_MIRROR(0x3cec) AM_DEVREADWRITE("pia", pia6821_r, pia6821_w) |
| 64 | 63 | AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3c00) AM_ROM |
| 65 | 64 | ADDRESS_MAP_END |
| r9575 | r9576 | |
| 126 | 125 | |
| 127 | 126 | /* PIA6821 Interface */ |
| 128 | 127 | |
| 128 | static INTERRUPT_GEN( d6800_interrupt ) |
| 129 | { |
| 130 | d6800_rtc = 1; |
| 131 | } |
| 132 | |
| 129 | 133 | static READ_LINE_DEVICE_HANDLER( d6800_rtc_pulse ) |
| 130 | 134 | { |
| 131 | | return 0; |
| 135 | UINT8 res = d6800_rtc; |
| 136 | d6800_rtc = 0; |
| 137 | return res; |
| 132 | 138 | } |
| 133 | 139 | |
| 134 | 140 | static READ_LINE_DEVICE_HANDLER( d6800_keydown_r ) |
| r9575 | r9576 | |
| 163 | 169 | /* |
| 164 | 170 | Cassette circuit consists of a 566 and a transistor. The 556 runs at 2400 |
| 165 | 171 | or 1200 Hz depending on the state of the transistor. This is controlled by |
| 166 | | bit 0 of the PIA. Bit 6 controls the speaker. |
| 172 | bit 0 of the PIA. Bit 6 drives the speaker. |
| 167 | 173 | */ |
| 168 | 174 | |
| 169 | 175 | speaker_level_w(d6800_speaker, (data & 0x40) ? 0 : 1); |
| r9575 | r9576 | |
| 248 | 254 | /* basic machine hardware */ |
| 249 | 255 | MDRV_CPU_ADD("maincpu",M6800, XTAL_4MHz/4) |
| 250 | 256 | MDRV_CPU_PROGRAM_MAP(d6800_map) |
| 257 | MDRV_CPU_VBLANK_INT("screen", d6800_interrupt) |
| 251 | 258 | |
| 252 | 259 | MDRV_MACHINE_START(d6800) |
| 253 | 260 | MDRV_MACHINE_RESET(d6800) |