Previous 15994 Revisions Next

r13829 Tuesday 3rd January, 2012 at 06:50:08 UTC by Curt Coder
[TANDY2K] Moved the keyboard to its own device. (nw)
[src/mess]mess.mak mess_dev.lst
[src/mess/drivers]tandy2k.c
[src/mess/includes]tandy2k.h
[src/mess/machine]tandy2kb.c* tandy2kb.h*

src/mess/machine/tandy2kb.c
r0r13829
1#include "tandy2kb.h"
2 
3 
4 
5//**************************************************************************
6//  MACROS / CONSTANTS
7//**************************************************************************
8 
9#define I8048_TAG      "m1"
10 
11 
12 
13//**************************************************************************
14//  DEVICE DEFINITIONS
15//**************************************************************************
16 
17const device_type TANDY2K_KEYBOARD = &device_creator<tandy2k_keyboard_device>;
18 
19 
20 
21//-------------------------------------------------
22//  ROM( tandy2k_keyboard )
23//-------------------------------------------------
24 
25ROM_START( tandy2k_keyboard )
26   ROM_REGION( 0x400, I8048_TAG, 0 )
27   ROM_LOAD( "keyboard.m1", 0x0000, 0x0400, NO_DUMP )
28ROM_END
29 
30 
31//-------------------------------------------------
32//  rom_region - device-specific ROM region
33//-------------------------------------------------
34 
35const rom_entry *tandy2k_keyboard_device::device_rom_region() const
36{
37   return ROM_NAME( tandy2k_keyboard );
38}
39 
40 
41//-------------------------------------------------
42//  ADDRESS_MAP( kb_io )
43//-------------------------------------------------
44 
45static ADDRESS_MAP_START( tandy2k_keyboard_io, AS_IO, 8, tandy2k_keyboard_device )
46   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(kb_y0_w)
47   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(kb_y8_w)
48   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(kb_x0_r)
49ADDRESS_MAP_END
50 
51 
52//-------------------------------------------------
53//  MACHINE_DRIVER( tandy2k_keyboard )
54//-------------------------------------------------
55 
56static MACHINE_CONFIG_FRAGMENT( tandy2k_keyboard )
57   MCFG_CPU_ADD(I8048_TAG, I8048, 1000000) // ?
58   MCFG_CPU_IO_MAP(tandy2k_keyboard_io)
59   MCFG_DEVICE_DISABLE() // TODO
60MACHINE_CONFIG_END
61 
62 
63//-------------------------------------------------
64//  machine_config_additions - device-specific
65//  machine configurations
66//-------------------------------------------------
67 
68machine_config_constructor tandy2k_keyboard_device::device_mconfig_additions() const
69{
70   return MACHINE_CONFIG_NAME( tandy2k_keyboard );
71}
72 
73 
74//-------------------------------------------------
75//  INPUT_PORTS( tandy2k_keyboard )
76//-------------------------------------------------
77 
78INPUT_PORTS_START( tandy2k_keyboard )
79   PORT_START("Y0")
80   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
81   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
82   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
83   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
84   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
85   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
86   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
87   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
88 
89   PORT_START("Y1")
90   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
91   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
92   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
93   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
94   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
95   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
96   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
97   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
98 
99   PORT_START("Y2")
100   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
101   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
102   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
103   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
104   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
105   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
106   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
107   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
108 
109   PORT_START("Y3")
110   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
111   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
112   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
113   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
114   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
115   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
116   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
117   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
118 
119   PORT_START("Y4")
120   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
121   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
122   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
123   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
124   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
125   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
126   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
127   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
128 
129   PORT_START("Y5")
130   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
131   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
132   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
133   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
134   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
135   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
136   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
137   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
138 
139   PORT_START("Y6")
140   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
141   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
142   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
143   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
144   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
145   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
146   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
147   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
148 
149   PORT_START("Y7")
150   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
151   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
152   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
153   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
154   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
155   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
156   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
157   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
158 
159   PORT_START("Y8")
160   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
161   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
162   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
163   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
164   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
165   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
166   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
167   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
168 
169   PORT_START("Y9")
170   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
171   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
172   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
173   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
174   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
175   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
176   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
177   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
178 
179   PORT_START("Y10")
180   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
181   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
182   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
183   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
184   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
185   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
186   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
187   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
188 
189   PORT_START("Y11")
190   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
191   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
192   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
193   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
194   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
195   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
196   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
197   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
198INPUT_PORTS_END
199 
200 
201//-------------------------------------------------
202//  input_ports - device-specific input ports
203//-------------------------------------------------
204 
205ioport_constructor tandy2k_keyboard_device::device_input_ports() const
206{
207   return INPUT_PORTS_NAME( tandy2k_keyboard );
208}
209 
210 
211 
212//**************************************************************************
213//  LIVE DEVICE
214//**************************************************************************
215 
216//-------------------------------------------------
217//  tandy2k_keyboard_device - constructor
218//-------------------------------------------------
219 
220tandy2k_keyboard_device::tandy2k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
221    : device_t(mconfig, TANDY2K_KEYBOARD, "Tandy 2000 Keyboard", tag, owner, clock),
222     m_maincpu(*this, I8048_TAG),
223     m_keylatch(0xffff)
224{
225}
226 
227 
228//-------------------------------------------------
229//  device_start - device-specific startup
230//-------------------------------------------------
231 
232void tandy2k_keyboard_device::device_start()
233{
234   // state saving
235   save_item(NAME(m_keylatch));
236}
237 
238 
239//-------------------------------------------------
240//  device_reset - device-specific reset
241//-------------------------------------------------
242 
243void tandy2k_keyboard_device::device_reset()
244{
245}
246 
247 
248//-------------------------------------------------
249//  kb_x0_r - 
250//-------------------------------------------------
251 
252READ8_MEMBER( tandy2k_keyboard_device::kb_x0_r )
253{
254  /*
255 
256        bit     description
257 
258        0       X0
259        1       X1
260        2       X2
261        3       X3
262        4       X4
263        5       X5
264        6       X6
265        7       X7
266 
267    */
268 
269   UINT8 data = 0xff;
270 
271   if (!BIT(m_keylatch, 0)) data &= input_port_read(machine(), "Y0");
272   if (!BIT(m_keylatch, 1)) data &= input_port_read(machine(), "Y1");
273   if (!BIT(m_keylatch, 2)) data &= input_port_read(machine(), "Y2");
274   if (!BIT(m_keylatch, 3)) data &= input_port_read(machine(), "Y3");
275   if (!BIT(m_keylatch, 4)) data &= input_port_read(machine(), "Y4");
276   if (!BIT(m_keylatch, 5)) data &= input_port_read(machine(), "Y5");
277   if (!BIT(m_keylatch, 6)) data &= input_port_read(machine(), "Y6");
278   if (!BIT(m_keylatch, 7)) data &= input_port_read(machine(), "Y7");
279   if (!BIT(m_keylatch, 8)) data &= input_port_read(machine(), "Y8");
280   if (!BIT(m_keylatch, 9)) data &= input_port_read(machine(), "Y9");
281   if (!BIT(m_keylatch, 10)) data &= input_port_read(machine(), "Y10");
282   if (!BIT(m_keylatch, 11)) data &= input_port_read(machine(), "Y11");
283 
284   return ~data;
285}
286 
287 
288//-------------------------------------------------
289//  kb_y0_w - 
290//-------------------------------------------------
291 
292WRITE8_MEMBER( tandy2k_keyboard_device::kb_y0_w )
293{
294   /*
295 
296        bit     description
297 
298        0       Y0
299        1       Y1
300        2       Y2
301        3       Y3
302        4       Y4
303        5       Y5
304        6       Y6
305        7       Y7
306 
307    */
308 
309   m_keylatch = (m_keylatch & 0xff00) | data;
310}
311 
312 
313//-------------------------------------------------
314//  kb_y8_w - 
315//-------------------------------------------------
316 
317WRITE8_MEMBER( tandy2k_keyboard_device::kb_y8_w )
318{
319   /*
320 
321        bit     description
322 
323        0       Y8
324        1       Y9
325        2       Y10
326        3       Y11
327        4       LED 2
328        5       LED 1
329        6
330        7
331 
332    */
333 
334   m_keylatch = ((data & 0x0f) << 8) | (m_keylatch & 0xff);
335}
src/mess/machine/tandy2kb.h
r0r13829
1#pragma once
2 
3#ifndef __TANDY2K_KEYBOARD__
4#define __TANDY2K_KEYBOARD__
5 
6#define ADDRESS_MAP_MODERN
7 
8#include "emu.h"
9#include "cpu/mcs48/mcs48.h"
10 
11 
12 
13//**************************************************************************
14//  MACROS / CONSTANTS
15//**************************************************************************
16 
17#define TANDY2K_KEYBOARD_TAG   "tandy2kb"
18 
19 
20 
21//**************************************************************************
22//  INTERFACE CONFIGURATION MACROS
23//**************************************************************************
24 
25#define MCFG_TANDY2K_KEYBOARD_ADD() \
26    MCFG_DEVICE_ADD(TANDY2K_KEYBOARD_TAG, TANDY2K_KEYBOARD, 0)
27 
28 
29 
30//**************************************************************************
31//  TYPE DEFINITIONS
32//**************************************************************************
33 
34// ======================> tandy2k_keyboard_device
35 
36class tandy2k_keyboard_device :  public device_t
37{
38public:
39    // construction/destruction
40    tandy2k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
41 
42   // optional information overrides
43   virtual const rom_entry *device_rom_region() const;
44   virtual machine_config_constructor device_mconfig_additions() const;
45   virtual ioport_constructor device_input_ports() const;
46   
47   // not really public
48   DECLARE_READ8_MEMBER( kb_x0_r );
49   DECLARE_WRITE8_MEMBER( kb_y0_w );
50   DECLARE_WRITE8_MEMBER( kb_y8_w );
51 
52protected:
53    // device-level overrides
54    virtual void device_start();
55   virtual void device_reset();
56   virtual void device_config_complete() { m_shortname = "tandy2kb"; }
57   
58private:
59   required_device<cpu_device> m_maincpu;
60 
61   UINT16 m_keylatch;
62};
63 
64 
65// device type definition
66extern const device_type TANDY2K_KEYBOARD;
67 
68 
69 
70#endif
src/mess/includes/tandy2k.h
r13828r13829
11#ifndef __TANDY2K__
22#define __TANDY2K__
33
4#define ADDRESS_MAP_MODERN
5
6#include "emu.h"
7#include "cpu/i86/i86.h"
8#include "cpu/mcs48/mcs48.h"
9#include "imagedev/flopdrv.h"
10#include "machine/ctronics.h"
11#include "machine/i8255.h"
12#include "machine/i8251.h"
13#include "machine/pit8253.h"
14#include "machine/pic8259.h"
415#include "machine/ram.h"
16#include "machine/tandy2kb.h"
17#include "machine/upd765.h"
18#include "sound/speaker.h"
19#include "video/crt9007.h"
20#include "video/crt9021.h"
21#include "video/crt9212.h"
522
623#define SCREEN_TAG      "screen"
724#define I80186_TAG      "u76"
8#define I8048_TAG      "m1"
925#define I8255A_TAG      "u75"
1026#define I8251A_TAG      "u41"
1127#define I8253_TAG      "u40"
r13828r13829
7187   DECLARE_READ16_MEMBER( vpac_r );
7288   DECLARE_WRITE16_MEMBER( vpac_w );
7389   DECLARE_WRITE8_MEMBER( addr_ctrl_w );
74   DECLARE_READ8_MEMBER( keyboard_x0_r );
75   DECLARE_WRITE8_MEMBER( keyboard_y0_w );
76   DECLARE_WRITE8_MEMBER( keyboard_y8_w );
7790   DECLARE_WRITE_LINE_MEMBER( busdmarq0_w );
7891   DECLARE_WRITE_LINE_MEMBER( rxrdy_w );
7992   DECLARE_WRITE_LINE_MEMBER( txrdy_w );
r13828r13829
91104
92105   /* keyboard state */
93106   int m_kben;
94   UINT16 m_keylatch;
95107
96108   /* serial state */
97109   int m_extclk;
src/mess/mess_dev.lst
r13828r13829
136136APRICOT_KEYBOARD
137137V1050_KEYBOARD
138138VICTOR9K_KEYBOARD
139TANDY2K_KEYBOARD
src/mess/mess.mak
r13828r13829
16551655   $(MESS_DRIVERS)/trs80.o      \
16561656   $(MESS_DRIVERS)/trs80m2.o   \
16571657   $(MESS_DRIVERS)/tandy2k.o   \
1658
1658   $(MESS_MACHINE)/tandy2kb.o   \
1659   
16591660$(MESSOBJ)/unisys.a:         \
16601661   $(MESS_DRIVERS)/univac.o   \
16611662
src/mess/drivers/tandy2k.c
r13828r13829
2424
2525*/
2626
27#define ADDRESS_MAP_MODERN
28
29#include "emu.h"
30#include "cpu/i86/i86.h"
31#include "cpu/mcs48/mcs48.h"
32#include "imagedev/flopdrv.h"
33#include "machine/ram.h"
34#include "machine/ctronics.h"
35#include "machine/i8255.h"
36#include "machine/i8251.h"
37#include "machine/pit8253.h"
38#include "machine/pic8259.h"
39#include "machine/upd765.h"
40#include "sound/speaker.h"
41#include "video/crt9007.h"
42#include "video/crt9021.h"
43#include "video/crt9212.h"
4427#include "includes/tandy2k.h"
4528
4629/* Read/Write Handlers */
r13828r13829
254237   logerror("Address Control %02x\n", data);
255238}
256239
257READ8_MEMBER( tandy2k_state::keyboard_x0_r )
258{
259  /*
260
261        bit     description
262
263        0       X0
264        1       X1
265        2       X2
266        3       X3
267        4       X4
268        5       X5
269        6       X6
270        7       X7
271
272    */
273
274   UINT8 data = 0xff;
275
276   if (!BIT(m_keylatch, 0)) data &= input_port_read(machine(), "Y0");
277   if (!BIT(m_keylatch, 1)) data &= input_port_read(machine(), "Y1");
278   if (!BIT(m_keylatch, 2)) data &= input_port_read(machine(), "Y2");
279   if (!BIT(m_keylatch, 3)) data &= input_port_read(machine(), "Y3");
280   if (!BIT(m_keylatch, 4)) data &= input_port_read(machine(), "Y4");
281   if (!BIT(m_keylatch, 5)) data &= input_port_read(machine(), "Y5");
282   if (!BIT(m_keylatch, 6)) data &= input_port_read(machine(), "Y6");
283   if (!BIT(m_keylatch, 7)) data &= input_port_read(machine(), "Y7");
284   if (!BIT(m_keylatch, 8)) data &= input_port_read(machine(), "Y8");
285   if (!BIT(m_keylatch, 9)) data &= input_port_read(machine(), "Y9");
286   if (!BIT(m_keylatch, 10)) data &= input_port_read(machine(), "Y10");
287   if (!BIT(m_keylatch, 11)) data &= input_port_read(machine(), "Y11");
288
289   return ~data;
290}
291
292WRITE8_MEMBER( tandy2k_state::keyboard_y0_w )
293{
294   /*
295
296        bit     description
297
298        0       Y0
299        1       Y1
300        2       Y2
301        3       Y3
302        4       Y4
303        5       Y5
304        6       Y6
305        7       Y7
306
307    */
308
309   /* keyboard row select */
310   m_keylatch = (m_keylatch & 0xff00) | data;
311}
312
313WRITE8_MEMBER( tandy2k_state::keyboard_y8_w )
314{
315   /*
316
317        bit     description
318
319        0       Y8
320        1       Y9
321        2       Y10
322        3       Y11
323        4       LED 2
324        5       LED 1
325        6
326        7
327
328    */
329
330   /* keyboard row select */
331   m_keylatch = ((data & 0x0f) << 8) | (m_keylatch & 0xff);
332}
333
334240/* Memory Maps */
335241
336242static ADDRESS_MAP_START( tandy2k_mem, AS_PROGRAM, 16, tandy2k_state )
r13828r13829
373279   AM_RANGE(0x0000, 0x3fff) AM_READ(videoram_r)
374280ADDRESS_MAP_END
375281
376static ADDRESS_MAP_START( keyboard_io, AS_IO, 8, tandy2k_state )
377  AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(keyboard_y0_w)
378  AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(keyboard_y8_w)
379  AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(keyboard_x0_r)
380ADDRESS_MAP_END
381
382282/* Input Ports */
383283
384284static INPUT_PORTS_START( tandy2k )
385   PORT_START("ROW0")
386   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
387   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
388   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
389   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
390   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
391   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
392   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
393   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
394
395   PORT_START("ROW1")
396   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
397   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
398   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
399   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
400   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
401   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
402   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
403   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
404
405   PORT_START("ROW2")
406   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
407   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
408   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
409   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
410   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
411   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
412   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
413   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
414
415   PORT_START("ROW3")
416   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
417   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
418   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
419   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
420   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
421   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
422   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
423   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
424
425   PORT_START("ROW4")
426   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
427   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
428   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
429   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
430   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
431   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
432   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
433   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
434
435   PORT_START("ROW5")
436   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
437   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
438   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
439   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
440   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
441   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
442   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
443   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
444
445   PORT_START("ROW6")
446   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
447   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
448   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
449   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
450   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
451   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
452   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
453   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
454
455   PORT_START("ROW7")
456   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
457   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
458   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
459   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
460   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
461   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
462   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
463   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
464
465   PORT_START("ROW8")
466   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
467   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
468   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
469   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
470   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
471   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
472   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
473   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
474
475   PORT_START("ROW9")
476   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
477   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
478   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
479   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
480   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
481   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
482   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
483   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
484
485   PORT_START("ROW10")
486   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
487   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
488   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
489   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
490   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
491   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
492   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
493   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
494
495   PORT_START("ROW11")
496   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
497   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
498   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
499   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
500   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
501   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
502   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
503   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
285   // defined in machine/tandy2kb.c
504286INPUT_PORTS_END
505287
506288/* Video */
r13828r13829
811593   DEVCB_NULL,
812594   FLOPPY_STANDARD_5_25_DSQD,
813595   LEGACY_FLOPPY_OPTIONS_NAME(default),
814   NULL,
596   "floppy_5_25",
815597   NULL
816598};
817599
r13828r13829
860642   /* register for state saving */
861643   save_item(NAME(m_dma_mux));
862644   save_item(NAME(m_kben));
863   save_item(NAME(m_keylatch));
864645   save_item(NAME(m_extclk));
865646   save_item(NAME(m_rxrdy));
866647   save_item(NAME(m_txrdy));
r13828r13829
880661    MCFG_CPU_PROGRAM_MAP(tandy2k_mem)
881662    MCFG_CPU_IO_MAP(tandy2k_io)
882663
883   MCFG_CPU_ADD(I8048_TAG, I8048, 1000000) // ?
884   MCFG_CPU_IO_MAP(keyboard_io)
885   MCFG_DEVICE_DISABLE()
886
887664    /* video hardware */
888665    MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
889666    MCFG_SCREEN_REFRESH_RATE(50)
r13828r13829
914691   MCFG_UPD765A_ADD(I8272A_TAG, i8272_intf)
915692   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(tandy2k_floppy_interface)
916693   MCFG_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics)
694   MCFG_TANDY2K_KEYBOARD_ADD()
917695
918696   /* internal ram */
919697   MCFG_RAM_ADD(RAM_TAG)
r13828r13829
936714   ROM_REGION( 0x2000, I80186_TAG, 0 )
937715   ROM_LOAD16_BYTE( "484a00.u48", 0x0000, 0x1000, CRC(a5ee3e90) SHA1(4b1f404a4337c67065dd272d62ff88dcdee5e34b) )
938716   ROM_LOAD16_BYTE( "474600.u47", 0x0001, 0x1000, CRC(345701c5) SHA1(a775cbfa110b7a88f32834aaa2a9b868cbeed25b) )
939
940   ROM_REGION( 0x400, I8048_TAG, 0 )
941   ROM_LOAD( "keyboard.m1", 0x0000, 0x0400, NO_DUMP )
942717ROM_END
943718
944719#define rom_tandy2khd rom_tandy2k

Previous 15994 Revisions Next


© 1998-2018 The MESS Team