Previous 15994 Revisions Next

r9609 Thursday 18th November, 2010 at 07:48:44 UTC by Robbbert
[D6800] Small changes.
[src/mess/drivers]d6800.c

src/mess/drivers/d6800.c
r9608r9609
2020   Information and programs can be found at http://chip8.com/?page=78
2121
2222
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.
2325
26
2427    TODO:
25   - It doesn't boot up
2628   - Cassette
2729   - 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)
3031*/
3132
3233#include "emu.h"
r9608r9609
5960
6061static ADDRESS_MAP_START( d6800_map, ADDRESS_SPACE_PROGRAM, 8 )
6162   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)
6364   AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3c00) AM_ROM
6465ADDRESS_MAP_END
6566
r9608r9609
7172   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1')
7273   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2')
7374   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3')
75   PORT_BIT( 0xf0, 0xf0, IPT_UNUSED )
7476
7577   PORT_START("LINE1")
7678   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4')
7779   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5')
7880   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6')
7981   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7')
82   PORT_BIT( 0xf0, 0xf0, IPT_UNUSED )
8083
8184   PORT_START("LINE2")
8285   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8')
8386   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9')
8487   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
8588   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
89   PORT_BIT( 0xf0, 0xf0, IPT_UNUSED )
8690
8791   PORT_START("LINE3")
8892   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C')
8993   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D')
9094   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E')
9195   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
96   PORT_BIT( 0xf0, 0xf0, IPT_UNUSED )
9297
9398   PORT_START("SPECIAL")
9499   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("FN") PORT_CODE(KEYCODE_LSHIFT)
r9608r9609
161166   knows if the tone is 1200 or 2400 Hz. Input to PIA is bit 7.
162167   */
163168
164   return 0;
169   return 0xff;
165170}
166171
167172static WRITE8_DEVICE_HANDLER( d6800_cassette_w )
r9608r9609
177182
178183static READ8_DEVICE_HANDLER( d6800_keyboard_r )
179184{
180   UINT8 data = 0x0f;
185   UINT8 data = 0xff;
181186
182187   if (!BIT(d6800_keylatch, 4)) data &= input_port_read(device->machine, "LINE0");
183188   if (!BIT(d6800_keylatch, 5)) data &= input_port_read(device->machine, "LINE1");
184189   if (!BIT(d6800_keylatch, 6)) data &= input_port_read(device->machine, "LINE2");
185190   if (!BIT(d6800_keylatch, 7)) data &= input_port_read(device->machine, "LINE3");
186191
187   d6800_keydown = (data==0x0f) ? 0 : 1;
192   d6800_keydown = (data==0xff) ? 0 : 1;
188193
189   return d6800_keylatch | data;
194   return data;
190195}
191196
192197static WRITE8_DEVICE_HANDLER( d6800_keyboard_w )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team