Previous 15994 Revisions Next

r6495 Wednesday 2nd December, 2009 at 09:55:42 UTC by Miodrag Milanović
Added generic terminal simulation, and hook up to SGI IP2
[src/mess]mess.mak
[src/mess/drivers]sgi_ip2.c
[src/mess/machine]terminal.c* terminal.h*

src/mess/machine/terminal.c
r0r6495
1#include "driver.h"
2#include "machine/terminal.h"
3
4/***************************************************************************
5    TYPE DEFINITIONS
6***************************************************************************/
7#define TERMINAL_WIDTH 80
8#define TERMINAL_HEIGHT 25
9typedef struct _terminal_state terminal_state;
10struct _terminal_state
11{
12   UINT8 buffer[TERMINAL_WIDTH*TERMINAL_HEIGHT];
13   UINT8 x_pos;
14   UINT8 y_pos;
15   
16   devcb_resolved_write8 terminal_keyboard_func;
17};
18
19/*****************************************************************************
20    INLINE FUNCTIONS
21*****************************************************************************/
22INLINE terminal_state *get_safe_token(const device_config *device)
23{
24   assert(device != NULL);
25   assert(device->token != NULL);
26   assert(device->type == GENERIC_TERMINAL);
27   
28   return (terminal_state *)device->token;
29}
30
31INLINE const terminal_interface *get_interface(const device_config *device)
32{
33   assert(device != NULL);
34   assert(device->type == GENERIC_TERMINAL);
35   return (const terminal_interface *) device->static_config;
36}
37
38/***************************************************************************
39    IMPLEMENTATION
40***************************************************************************/
41
42static const UINT8 terminal_font[256*16] =
43{
44   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
45   0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
46   0x00, 0x92, 0x44, 0x92, 0x44, 0x92, 0x44, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
47   0x00, 0x88, 0x88, 0xf8, 0x88, 0x88, 0x3e, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
48   0x00, 0xf0, 0x80, 0xe0, 0x80, 0x9e, 0x10, 0x1c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
49   0x00, 0x78, 0x80, 0x80, 0x78, 0x3c, 0x22, 0x3c, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
50   0x00, 0x80, 0x80, 0x80, 0xf8, 0x3e, 0x20, 0x3c, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
51   0x00, 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
52   0x00, 0x00, 0x10, 0x10, 0xfe, 0x10, 0x10, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
53   0x00, 0x88, 0xc8, 0xa8, 0x98, 0x88, 0x20, 0x20, 0x20, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
54   0x00, 0x88, 0x88, 0x50, 0x20, 0x3e, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
55   0x10, 0x10, 0x10, 0x10, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
56   0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
57   0x00, 0x00, 0x00, 0x00, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
58   0x10, 0x10, 0x10, 0x10, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
59   0x10, 0x10, 0x10, 0x10, 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
60   0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
61   0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
62   0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
63   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
64   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
65   0x10, 0x10, 0x10, 0x10, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
66   0x10, 0x10, 0x10, 0x10, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
67   0x10, 0x10, 0x10, 0x10, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68   0x00, 0x00, 0x00, 0x00, 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
69   0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70   0x00, 0x02, 0x08, 0x20, 0x80, 0x20, 0x08, 0x02, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
71   0x00, 0x80, 0x20, 0x08, 0x02, 0x08, 0x20, 0x80, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
72   0x00, 0x00, 0x00, 0xfe, 0x24, 0x24, 0x24, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
73   0x00, 0x02, 0x04, 0xfe, 0x10, 0xfe, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
74   0x00, 0x1c, 0x22, 0x20, 0xf8, 0x20, 0x78, 0xa6, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
75   0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
76   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
77   0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
78   0x00, 0x24, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
79   0x00, 0x48, 0x48, 0xfc, 0x48, 0xfc, 0x48, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
80   0x00, 0x10, 0x7c, 0x90, 0x7c, 0x12, 0x7c, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
81   0x00, 0xc2, 0xc4, 0x08, 0x10, 0x20, 0x46, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
82   0x00, 0x70, 0x88, 0x88, 0x70, 0x8a, 0x84, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
83   0x00, 0x18, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
84   0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
85   0x00, 0x20, 0x10, 0x08, 0x08, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
86   0x00, 0x00, 0x44, 0x28, 0xfe, 0x28, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
87   0x00, 0x00, 0x10, 0x10, 0xfe, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
88   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
89   0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
90   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
91   0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
92   0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
93   0x00, 0x10, 0x30, 0x50, 0x10, 0x10, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
94   0x00, 0x78, 0x84, 0x02, 0x1c, 0x60, 0x80, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
95   0x00, 0xfe, 0x04, 0x08, 0x1c, 0x02, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
96   0x00, 0x08, 0x18, 0x28, 0x48, 0xfe, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
97   0x00, 0xfe, 0x80, 0xbc, 0xc2, 0x02, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
98   0x00, 0x3c, 0x42, 0x80, 0xbc, 0xc2, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
99   0x00, 0xfe, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
100   0x00, 0x7c, 0x82, 0x82, 0x7c, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
101   0x00, 0x78, 0x84, 0x86, 0x7a, 0x02, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102   0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
103   0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
104   0x00, 0x02, 0x08, 0x20, 0x80, 0x20, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
105   0x00, 0x00, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
106   0x00, 0x80, 0x20, 0x08, 0x02, 0x08, 0x20, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
107   0x00, 0x7c, 0x82, 0x0c, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
108   0x00, 0x7c, 0x82, 0x8a, 0x92, 0x9c, 0x80, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
109   0x00, 0x10, 0x28, 0x44, 0x82, 0xfe, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
110   0x00, 0xfc, 0x42, 0x42, 0x7c, 0x42, 0x42, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
111   0x00, 0x3c, 0x42, 0x80, 0x80, 0x80, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
112   0x00, 0xf8, 0x44, 0x42, 0x42, 0x42, 0x44, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
113   0x00, 0xfe, 0x80, 0x80, 0xf8, 0x80, 0x80, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
114   0x00, 0xfe, 0x80, 0x80, 0xf8, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
115   0x00, 0x3c, 0x42, 0x80, 0x80, 0x8e, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
116   0x00, 0x82, 0x82, 0x82, 0xfe, 0x82, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
117   0x00, 0x7c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
118   0x00, 0x0e, 0x04, 0x04, 0x04, 0x04, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
119   0x00, 0x82, 0x8c, 0xb0, 0xc0, 0xb0, 0x8c, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
120   0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
121   0x00, 0x82, 0xc6, 0xaa, 0x92, 0x82, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
122   0x00, 0x82, 0xc2, 0xa2, 0x92, 0x8a, 0x86, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
123   0x00, 0x7c, 0x82, 0x82, 0x82, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
124   0x00, 0xfc, 0x82, 0x82, 0xfc, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
125   0x00, 0x7c, 0x82, 0x82, 0x82, 0x8a, 0x84, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
126   0x00, 0xfc, 0x82, 0x82, 0xfc, 0x88, 0x84, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
127   0x00, 0x7c, 0x82, 0x80, 0x7c, 0x02, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
128   0x00, 0xfe, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
129   0x00, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
130   0x00, 0x82, 0x82, 0x44, 0x44, 0x28, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
131   0x00, 0x82, 0x82, 0x82, 0x92, 0x92, 0xaa, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
132   0x00, 0x82, 0x44, 0x28, 0x10, 0x28, 0x44, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
133   0x00, 0x82, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
134   0x00, 0xfe, 0x04, 0x08, 0x10, 0x20, 0x40, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
135   0x00, 0x3c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
136   0x00, 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
137   0x00, 0x78, 0x08, 0x08, 0x08, 0x08, 0x08, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
138   0x00, 0x10, 0x28, 0x44, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
139   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
140   0x00, 0x30, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
141   0x00, 0x00, 0x00, 0x7c, 0x02, 0x7e, 0x82, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
142   0x00, 0x80, 0x80, 0xbc, 0xc2, 0x82, 0xc2, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
143   0x00, 0x00, 0x00, 0x3c, 0x42, 0x80, 0x40, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
144   0x00, 0x02, 0x02, 0x7a, 0x86, 0x82, 0x86, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
145   0x00, 0x00, 0x00, 0x7c, 0x82, 0xfe, 0x80, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
146   0x00, 0x1c, 0x22, 0x20, 0xf8, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
147   0x00, 0x00, 0x02, 0x7a, 0x84, 0x84, 0x7c, 0x04, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
148   0x00, 0x80, 0x80, 0xbc, 0xc2, 0x82, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
149   0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
150   0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x84, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
151   0x00, 0x80, 0x80, 0x88, 0x90, 0xe0, 0x88, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
152   0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
153   0x00, 0x00, 0x00, 0xc4, 0xaa, 0x92, 0x92, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
154   0x00, 0x00, 0x00, 0xbc, 0xc2, 0x82, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
155   0x00, 0x00, 0x00, 0x7c, 0x82, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
156   0x00, 0x00, 0x00, 0xbc, 0xc2, 0xc2, 0xbc, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
157   0x00, 0x00, 0x00, 0x7a, 0x86, 0x86, 0x7a, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
158   0x00, 0x00, 0x00, 0x9c, 0x62, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
159   0x00, 0x00, 0x00, 0x7c, 0x80, 0x7c, 0x02, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
160   0x00, 0x20, 0x20, 0xf8, 0x20, 0x20, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
161   0x00, 0x00, 0x00, 0x84, 0x84, 0x84, 0x84, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
162   0x00, 0x00, 0x00, 0x82, 0x82, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
163   0x00, 0x00, 0x00, 0x82, 0x82, 0x92, 0xaa, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
164   0x00, 0x00, 0x00, 0x84, 0x48, 0x30, 0x48, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
165   0x00, 0x00, 0x00, 0x84, 0x84, 0x8c, 0x74, 0x04, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
166   0x00, 0x00, 0x00, 0xfe, 0x04, 0x18, 0x20, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
167   0x00, 0x0e, 0x10, 0x10, 0x60, 0x10, 0x10, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
168   0x00, 0x10, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
169   0x00, 0xe0, 0x10, 0x10, 0x0c, 0x10, 0x10, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
170   0x00, 0x62, 0x92, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
171   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  };
172
173static void terminal_scroll_line(const device_config *device)
174{
175   terminal_state *term = get_safe_token(device);
176   
177   memcpy(term->buffer,term->buffer+TERMINAL_WIDTH,(TERMINAL_HEIGHT-1)*TERMINAL_WIDTH);
178   memset(term->buffer + TERMINAL_WIDTH*(TERMINAL_HEIGHT-1),0,TERMINAL_WIDTH);
179}
180
181static void terminal_write_char(const device_config *device,UINT8 data) {
182   terminal_state *term = get_safe_token(device);
183   
184   term->buffer[term->y_pos*TERMINAL_WIDTH+term->x_pos] = data;
185   term->x_pos++;
186   if (term->x_pos > TERMINAL_WIDTH) {
187      term->x_pos = 0;
188      term->y_pos++;
189      if (term->y_pos==TERMINAL_HEIGHT) {
190         terminal_scroll_line(device);
191         term->y_pos = (TERMINAL_HEIGHT-1);
192      }
193   }
194}
195
196static void terminal_clear(const device_config *device) {
197   terminal_state *term = get_safe_token(device);
198   
199   memset(term->buffer,0,TERMINAL_WIDTH*TERMINAL_HEIGHT);
200   term->x_pos = 0;
201   term->y_pos = 0;
202}
203
204WRITE8_DEVICE_HANDLER ( terminal_write )
205{
206   terminal_state *term = get_safe_token(device);
207   switch(data) {
208      case 10: term->y_pos++;
209            if (term->y_pos==TERMINAL_HEIGHT) {
210               terminal_scroll_line(device);
211               term->y_pos = (TERMINAL_HEIGHT-1);
212            }; break;
213      case 13: term->x_pos = 0; break;
214      case  9: do {
215               term->x_pos ++;
216             } while ((term->x_pos % 8)!=0);
217             break;
218      case 16: break;
219      default: terminal_write_char(device,data); break;
220   }
221}
222   
223/***************************************************************************
224    VIDEO HARDWARE
225***************************************************************************/
226void generic_terminal_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect)
227{
228   UINT8 code;
229   int y, c, x, b;
230   terminal_state *term = get_safe_token(device);
231
232   for (y = 0; y < TERMINAL_HEIGHT; y++)
233   {
234      for (c = 0; c < 10; c++)
235      {
236         int horpos = 0;
237         for (x = 0; x < TERMINAL_WIDTH; x++)
238         {         
239            code = terminal_font[term->buffer[y*TERMINAL_WIDTH + x] *16 + c];
240            for (b = 7; b >= 0; b--)
241            {
242               *BITMAP_ADDR16(bitmap, y*10 + c, horpos++) =  (code >> b) & 0x01;
243            }
244            *BITMAP_ADDR16(bitmap, y*10 + c, horpos++) =  0;
245            *BITMAP_ADDR16(bitmap, y*10 + c, horpos++) =  0;
246         }
247      }
248   }
249}
250
251// Ugh, god, this is a horrible, HORRIBLE hack!
252static INPUT_CHANGED( terminal_kbd_put )
253{
254   const device_config   *devconf = devtag_get_device(field->port->machine, TERMINAL_TAG);
255   terminal_state *term = get_safe_token(devconf);
256   if(input_port_read(field->port->machine, "KEYS0") ||
257      input_port_read(field->port->machine, "KEYS1") ||
258      input_port_read(field->port->machine, "KEYS2") ||
259      input_port_read(field->port->machine, "KEYS3") ||
260      input_port_read(field->port->machine, "KEYS4"))
261   {     
262      devcb_call_write8(&term->terminal_keyboard_func, 0, (UINT8)(FPTR)param);
263   }
264}
265
266/***************************************************************************
267    VIDEO HARDWARE
268***************************************************************************/
269static VIDEO_START( terminal )
270{
271   
272}
273
274static VIDEO_UPDATE(terminal )
275{
276   const device_config   *devconf = devtag_get_device(screen->machine, TERMINAL_TAG);
277   generic_terminal_update( devconf, bitmap, cliprect);
278   return 0;
279}
280
281MACHINE_DRIVER_START( generic_terminal )
282   MDRV_SCREEN_ADD(TERMINAL_SCREEN_TAG, RASTER)
283    MDRV_SCREEN_REFRESH_RATE(50)
284    MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
285    MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
286   MDRV_SCREEN_SIZE(TERMINAL_WIDTH*10, TERMINAL_HEIGHT*10)
287   MDRV_SCREEN_VISIBLE_AREA(0, TERMINAL_WIDTH*10-1, 0, TERMINAL_HEIGHT*10-1)
288   MDRV_PALETTE_LENGTH(2)
289    MDRV_PALETTE_INIT(black_and_white)
290   
291   MDRV_VIDEO_START(terminal)
292   MDRV_VIDEO_UPDATE(terminal)   
293MACHINE_DRIVER_END
294
295
296/*-------------------------------------------------
297    DEVICE_START( terminal )
298-------------------------------------------------*/
299
300static DEVICE_START( terminal )
301{
302   terminal_state *terminal = get_safe_token(device);
303   const terminal_interface *intf = get_interface(device);
304   
305   devcb_resolve_write8(&terminal->terminal_keyboard_func, &intf->terminal_keyboard_func, device);
306}
307
308/*-------------------------------------------------
309    DEVICE_RESET( terminal )
310-------------------------------------------------*/
311
312static DEVICE_RESET( terminal )
313{
314   terminal_clear(device);
315}
316
317/*-------------------------------------------------
318    DEVICE_GET_INFO( terminal )
319-------------------------------------------------*/
320
321DEVICE_GET_INFO( terminal )
322{
323   switch (state)
324   {
325      /* --- the following bits of info are returned as 64-bit signed integers --- */
326      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                                    break;
327      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(terminal_state);                     break;
328      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;                     break;
329
330      /* --- the following bits of info are returned as pointers to data or functions --- */
331      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(terminal);               break;
332      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
333      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(terminal);               break;
334
335      /* --- the following bits of info are returned as NULL-terminated strings --- */
336      case DEVINFO_STR_NAME:                     strcpy(info->s, "Generic Terminal");                  break;
337      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Terminal");                        break;
338      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                              break;
339      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                           break;
340      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");             break;
341   }
342}
343
344INPUT_PORTS_START( generic_terminal )
345   PORT_START("KEYS0")
346   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A')   PORT_CHANGED(terminal_kbd_put, (void*)'a')
347   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B')   PORT_CHANGED(terminal_kbd_put, (void*)'b')
348   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C')   PORT_CHANGED(terminal_kbd_put, (void*)'c')
349   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D')   PORT_CHANGED(terminal_kbd_put, (void*)'d')
350   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E')   PORT_CHANGED(terminal_kbd_put, (void*)'e')
351   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F')   PORT_CHANGED(terminal_kbd_put, (void*)'f')
352   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G')   PORT_CHANGED(terminal_kbd_put, (void*)'g')
353   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H')   PORT_CHANGED(terminal_kbd_put, (void*)'h')
354
355   PORT_START("KEYS1")
356   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I')   PORT_CHANGED(terminal_kbd_put, (void*)'i')
357   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J')   PORT_CHANGED(terminal_kbd_put, (void*)'j')
358   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K')   PORT_CHANGED(terminal_kbd_put, (void*)'k')
359   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')   PORT_CHANGED(terminal_kbd_put, (void*)'l')
360   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M')   PORT_CHANGED(terminal_kbd_put, (void*)'m')
361   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N')   PORT_CHANGED(terminal_kbd_put, (void*)'n')
362   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')   PORT_CHANGED(terminal_kbd_put, (void*)'o')
363   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')   PORT_CHANGED(terminal_kbd_put, (void*)'p')
364
365   PORT_START("KEYS2")
366   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')   PORT_CHANGED(terminal_kbd_put, (void*)'q')
367   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R')   PORT_CHANGED(terminal_kbd_put, (void*)'r')
368   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S')   PORT_CHANGED(terminal_kbd_put, (void*)'s')
369   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T')   PORT_CHANGED(terminal_kbd_put, (void*)'t')
370   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U')   PORT_CHANGED(terminal_kbd_put, (void*)'u')
371   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V')   PORT_CHANGED(terminal_kbd_put, (void*)'v')
372   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W')   PORT_CHANGED(terminal_kbd_put, (void*)'w')
373   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X')   PORT_CHANGED(terminal_kbd_put, (void*)'x')
374
375   PORT_START("KEYS3")
376   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y')   PORT_CHANGED(terminal_kbd_put, (void*)'y')
377   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z')   PORT_CHANGED(terminal_kbd_put, (void*)'z')
378   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0')            PORT_CHANGED(terminal_kbd_put, (void*)'0')
379   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1')            PORT_CHANGED(terminal_kbd_put, (void*)'1')
380   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2')            PORT_CHANGED(terminal_kbd_put, (void*)'2')
381   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3')            PORT_CHANGED(terminal_kbd_put, (void*)'3')
382   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4')            PORT_CHANGED(terminal_kbd_put, (void*)'4')
383   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5')            PORT_CHANGED(terminal_kbd_put, (void*)'5')
384
385   PORT_START("KEYS4")
386   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6')            PORT_CHANGED(terminal_kbd_put, (void*)'6')
387   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7')            PORT_CHANGED(terminal_kbd_put, (void*)'7')
388   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8')            PORT_CHANGED(terminal_kbd_put, (void*)'8')
389   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9')            PORT_CHANGED(terminal_kbd_put, (void*)'9')
390   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') PORT_CHANGED(terminal_kbd_put, (void*)',')
391   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') PORT_CHANGED(terminal_kbd_put, (void*)'.')
392   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')         PORT_CHANGED(terminal_kbd_put, (void*)' ')
393   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(0x0d)         PORT_CHANGED(terminal_kbd_put, (void*)0x0d)
394INPUT_PORTS_END
src/mess/machine/terminal.h
r0r6495
1#ifndef __TERMINAL_H__
2#define __TERMINAL_H__
3
4#include "devcb.h"
5
6/***************************************************************************
7    TYPE DEFINITIONS
8***************************************************************************/
9
10typedef struct _terminal_interface terminal_interface;
11struct _terminal_interface
12{
13   devcb_write8 terminal_keyboard_func;
14};
15
16#define GENERIC_TERMINAL_INTERFACE(name) const terminal_interface (name) =
17
18/***************************************************************************
19    DEVICE CONFIGURATION MACROS
20***************************************************************************/
21#define TERMINAL_TAG "terminal"
22#define TERMINAL_SCREEN_TAG "terminal_screen"
23 
24#define GENERIC_TERMINAL DEVICE_GET_INFO_NAME( terminal )
25
26#define MDRV_GENERIC_TERMINAL_ADD(_tag, _intrf) \
27   MDRV_DEVICE_ADD(_tag, GENERIC_TERMINAL, 0) \
28   MDRV_DEVICE_CONFIG(_intrf)
29
30#define MDRV_GENERIC_TERMINAL_REMOVE(_tag)      \
31    MDRV_DEVICE_REMOVE(_tag)
32
33   
34/***************************************************************************
35    FUNCTION PROTOTYPES
36***************************************************************************/
37
38WRITE8_DEVICE_HANDLER ( terminal_write );
39
40/* device interface */
41DEVICE_GET_INFO( terminal );
42
43MACHINE_DRIVER_EXTERN( generic_terminal );
44
45INPUT_PORTS_EXTERN(generic_terminal);
46
47#endif /* __TERMINAL_H__ */
src/mess/mess.mak
r6494r6495
465465   $(MESS_MACHINE)/smc92x4.o   \
466466   $(MESS_MACHINE)/sst39vfx.o   \
467467   $(MESS_MACHINE)/tc8521.o   \
468   $(MESS_MACHINE)/terminal.o   \
468469   $(MESS_MACHINE)/upd1990a.o   \
469470   $(MESS_MACHINE)/upd7002.o   \
470471   $(MESS_MACHINE)/upd7201.o   \
src/mess/drivers/sgi_ip2.c
r6494r6495
4646#include "cpu/m68000/m68000.h"
4747#include "machine/mc146818.h" /* TOD clock */
4848#include "machine/68681.h" /* DUART0, DUART1 */
49
49#include "machine/terminal.h"
50   
5051#define VERBOSE_LEVEL ( 0 )
5152
5253#define ENABLE_VERBOSE_LOG (0)
r6494r6495
6970#endif
7071
7172/***************************************************************************
72    VIDEO HARDWARE
73***************************************************************************/
74
75static VIDEO_START( sgi_ip2 )
76{
77}
78
79static VIDEO_UPDATE( sgi_ip2 )
80{
81   return 0;
82}
83
84/***************************************************************************
8573    MACHINE FUNCTIONS
8674***************************************************************************/
8775
r6494r6495
315303   COMBINE_DATA(&sgi_ip2_stklmt);
316304}
317305
318// Ugh, god, this is a horrible, HORRIBLE hack!
319static INPUT_CHANGED( sgi_ip2_serial_kbd_put )
306static WRITE8_DEVICE_HANDLER( sgi_kbd_put )
320307{
321   if(input_port_read(field->port->machine, "KEYS0") ||
322      input_port_read(field->port->machine, "KEYS1") ||
323      input_port_read(field->port->machine, "KEYS2") ||
324      input_port_read(field->port->machine, "KEYS3") ||
325      input_port_read(field->port->machine, "KEYS4"))
326   {
327      duart68681_rx_data(devtag_get_device(field->port->machine, "duart68681a"), 1, (UINT8)(FPTR)param);
328   }
308   duart68681_rx_data(devtag_get_device(device->machine, "duart68681a"), 1, data);
329309}
330310
311static GENERIC_TERMINAL_INTERFACE( sgi_terminal_intf )
312{
313   DEVCB_HANDLER(sgi_kbd_put)
314};
315
316
331317static INTERRUPT_GEN( sgi_ip2_vbl )
332318{
333319}
r6494r6495
393379
394380static void duarta_tx(const device_config *device, int channel, UINT8 data)
395381{
382   const device_config   *devconf = devtag_get_device(device->machine, "terminal");
396383   verboselog(device->machine, 0, "duarta_tx: %02x\n", data);
397   printf( "%c", data );
384   terminal_write(devconf,0,data);
398385}
399386
400387static const duart68681_config sgi_ip2_duart68681a_config =
r6494r6495
439426   /* basic machine hardware */
440427   MDRV_CPU_ADD("maincpu", M68020, 16000000)
441428   MDRV_CPU_PROGRAM_MAP(sgi_ip2_map)
442   MDRV_CPU_VBLANK_INT("screen", sgi_ip2_vbl)
429   MDRV_CPU_VBLANK_INT(TERMINAL_SCREEN_TAG, sgi_ip2_vbl)
443430
444431   MDRV_MACHINE_START(sgi_ip2)
445432   MDRV_MACHINE_RESET(sgi_ip2)
446433
447   MDRV_SCREEN_ADD("screen", RASTER)
448   MDRV_SCREEN_REFRESH_RATE(60)
449   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
450   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
451   MDRV_SCREEN_SIZE(256, 256) // No this is not true, it is all a lie.  Unfortunately, 1024x1024-pixel displays are SLOOOOW.
452   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
453   MDRV_PALETTE_LENGTH(256)
454
455   MDRV_VIDEO_START(sgi_ip2)
456   MDRV_VIDEO_UPDATE(sgi_ip2)
457
434   /* video hardware */   
435   MDRV_IMPORT_FROM( generic_terminal )   
436   MDRV_GENERIC_TERMINAL_ADD(TERMINAL_TAG,sgi_terminal_intf)   
437   
458438    MDRV_DUART68681_ADD( "duart68681a", XTAL_3_6864MHz, sgi_ip2_duart68681a_config ) /* Y3 3.6864MHz Xtal ??? copy-over from dectalk */
459439    MDRV_DUART68681_ADD( "duart68681b", XTAL_3_6864MHz, sgi_ip2_duart68681b_config ) /* Y3 3.6864MHz Xtal ??? copy-over from dectalk */
460440   MDRV_NVRAM_HANDLER(mc146818)
r6494r6495
511491   PORT_DIPSETTING(   0x000e, "DSD Tape Boot (2)" )
512492   PORT_DIPSETTING(   0x000f, "DSD Hard Disk Boot" )
513493
514   PORT_START("KEYS0")
515   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'a')
516   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'b')
517   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'c')
518   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'d')
519   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'e')
520   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'f')
521   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'g')
522   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'h')
523
524   PORT_START("KEYS1")
525   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'i')
526   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'j')
527   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'k')
528   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'l')
529   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'m')
530   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'n')
531   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'o')
532   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'p')
533
534   PORT_START("KEYS2")
535   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'q')
536   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'r')
537   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'s')
538   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'t')
539   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'u')
540   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'v')
541   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'w')
542   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'x')
543
544   PORT_START("KEYS3")
545   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'y')
546   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z')   PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'z')
547   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0')            PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'0')
548   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1')            PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'1')
549   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2')            PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'2')
550   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3')            PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'3')
551   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4')            PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'4')
552   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5')            PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'5')
553
554   PORT_START("KEYS4")
555   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6')            PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'6')
556   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7')            PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'7')
557   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8')            PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'8')
558   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9')            PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'9')
559   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)',')
560   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)'.')
561   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')         PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)' ')
562   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(0x0d)         PORT_CHANGED(sgi_ip2_serial_kbd_put, (void*)0x0d)
494   PORT_INCLUDE(generic_terminal)
563495INPUT_PORTS_END
564496
565497static DRIVER_INIT( sgi_ip2 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team