Previous 15994 Revisions Next

r7028 Wednesday 13th January, 2010 at 11:30:31 UTC by Curt Coder
[ETI660] Added PIA read, and STEP/RESET keys.
[src/mess/drivers]eti660.c
[src/mess/includes]eti660.h

src/mess/includes/eti660.h
r7027r7028
33
44#include "cpu/cdp1802/cdp1802.h"
55
6#define SCREEN_TAG   "screen"
7#define CDP1802_TAG "ic3"
8#define CDP1864_TAG "ic4"
9#define MC6821_TAG   "ic5"
6#define SCREEN_TAG      "screen"
7#define CDP1802_TAG      "ic3"
8#define CDP1864_TAG      "ic4"
9#define MC6821_TAG      "ic5"
1010#define CASSETTE_TAG   "cassette"
1111
1212enum
src/mess/drivers/eti660.c
r7027r7028
22
33   TODO:
44
5   - does not boot!
56   - allocate color ram
67   - quickload
7   - keyboard
88   - color on
99
1010*/
r7027r7028
1818#include "machine/rescap.h"
1919#include "sound/cdp1864.h"
2020
21#define RX(_machine) \
22   cpu_get_reg(_machine->firstcpu, CDP1802_R0 + cpu_get_reg(_machine->firstcpu, CDP1802_X))
23
2124/* Read/Write Handlers */
2225
26static READ8_DEVICE_HANDLER( pia_r )
27{
28   int pia_offset = RX(device->machine) & 0x03;
29
30   return pia6821_r(device, pia_offset);
31}
32
2333static WRITE8_DEVICE_HANDLER( pia_w )
2434{
25   int pia_offset = cpu_get_reg(device->machine->firstcpu, CDP1802_R0 + cpu_get_reg(device->machine->firstcpu, CDP1802_X)) & 0x03;
35   int pia_offset = RX(device->machine) & 0x03;
2636
2737   pia6821_w(device, pia_offset, data);
2838}
r7027r7028
3040static WRITE8_HANDLER( eti660_colorram_w )
3141{
3242   eti660_state *state = space->machine->driver_data;
33   int colorram_offset = cpu_get_reg(space->machine->firstcpu, CDP1802_R0 + cpu_get_reg(space->machine->firstcpu, CDP1802_X)) & 0xff;
43   int colorram_offset = RX(space->machine) & 0xff;
3444
3545   colorram_offset = ((colorram_offset & 0xf8) >> 1) || (colorram_offset & 0x03);
3646
r7027r7028
4656
4757static ADDRESS_MAP_START( eti660_io_map, ADDRESS_SPACE_IO, 8 )
4858   AM_RANGE(0x01, 0x01) AM_DEVREADWRITE(CDP1864_TAG, cdp1864_dispon_r, cdp1864_step_bgcolor_w)
49   AM_RANGE(0x02, 0x02) AM_DEVWRITE(MC6821_TAG, pia_w)
59   AM_RANGE(0x02, 0x02) AM_DEVREADWRITE(MC6821_TAG, pia_r, pia_w)
5060   AM_RANGE(0x03, 0x03) AM_WRITE(eti660_colorram_w)
5161   AM_RANGE(0x04, 0x04) AM_DEVREADWRITE(CDP1864_TAG, cdp1864_dispoff_r, cdp1864_tone_latch_w)
5262ADDRESS_MAP_END
5363
5464/* Input Ports */
5565
66static INPUT_CHANGED( trigger_reset )
67{
68   eti660_state *state = field->port->machine->driver_data;
69
70   state->cdp1802_mode = newval ? CDP1802_MODE_RUN : CDP1802_MODE_RESET;
71}
72
5673static INPUT_PORTS_START( eti660 )
5774   PORT_START("PA0")
5875   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3')
r7027r7028
7794   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8')
7895   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C')
7996   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4')
97
98   PORT_START("SPECIAL")
99   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RESET") PORT_CODE(KEYCODE_R) PORT_CHANGED(trigger_reset, 0)
100   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("STEP") PORT_CODE(KEYCODE_S)
80101INPUT_PORTS_END
81102
82103/* Video */
r7027r7028
156177   /* tape input */
157178   if (cassette_input(state->cassette) < 0) ef -= EF2;
158179
180   /* STEP key */
181   if (!BIT(input_port_read(device->machine, "SPECIAL"), 1)) ef -= EF4;
182
159183   return ef;
160184}
161185
r7027r7028
290314
291315   /* reset CPU */
292316   state->cdp1802_mode = CDP1802_MODE_RESET;
293   timer_set(machine, ATTOTIME_IN_MSEC(200), NULL, 0, set_cpu_mode);
317   timer_set(machine, ATTOTIME_IN_MSEC(0), NULL, 0, set_cpu_mode);
294318
295319   /* reset CDP1864 */
296320   device_reset(state->cdp1864);
r7027r7028
330354
331355   /* devices */
332356   MDRV_PIA6821_ADD(MC6821_TAG, eti660_mc6821_intf)
333   MDRV_CASSETTE_ADD("cassette", eti660_cassette_config)
357   MDRV_CASSETTE_ADD(CASSETTE_TAG, eti660_cassette_config)
334358   
335359   /* internal ram */
336360   MDRV_RAM_ADD("messram")
337   MDRV_RAM_DEFAULT_SIZE("1K")
338   MDRV_RAM_EXTRA_OPTIONS("3K")
361   MDRV_RAM_DEFAULT_SIZE("3K")
339362MACHINE_DRIVER_END
340363
341364/* ROMs */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team