trunk/src/mess/drivers/alphasma.c
r241443 | r241444 | |
28 | 28 | m_lcdc1(*this, "ks0066_1"), |
29 | 29 | m_nvram(*this, "nvram"), |
30 | 30 | m_rambank(*this, "rambank"), |
31 | | m_io_col0(*this, "COL0"), |
32 | | m_io_col1(*this, "COL1"), |
33 | | m_io_col2(*this, "COL2"), |
34 | | m_io_col3(*this, "COL3"), |
35 | | m_io_col4(*this, "COL4"), |
36 | | m_io_col5(*this, "COL5"), |
37 | | m_io_col6(*this, "COL6"), |
38 | | m_io_col7(*this, "COL7"), |
39 | | m_io_col8(*this, "COL8"), |
40 | | m_io_col9(*this, "COL9"), |
41 | | m_io_cola(*this, "COLA"), |
42 | | m_io_colb(*this, "COLB"), |
43 | | m_io_colc(*this, "COLC"), |
44 | | m_io_cold(*this, "COLD"), |
45 | | m_io_cole(*this, "COLE"), |
46 | | m_io_colf(*this, "COLF"), |
| 31 | m_keyboard(*this, "COL"), |
47 | 32 | m_battery_status(*this, "BATTERY") |
48 | 33 | { } |
49 | 34 | |
r241443 | r241444 | |
52 | 37 | required_device<hd44780_device> m_lcdc1; |
53 | 38 | required_device<nvram_device> m_nvram; |
54 | 39 | required_memory_bank m_rambank; |
55 | | required_ioport m_io_col0; |
56 | | required_ioport m_io_col1; |
57 | | required_ioport m_io_col2; |
58 | | required_ioport m_io_col3; |
59 | | required_ioport m_io_col4; |
60 | | required_ioport m_io_col5; |
61 | | required_ioport m_io_col6; |
62 | | required_ioport m_io_col7; |
63 | | required_ioport m_io_col8; |
64 | | required_ioport m_io_col9; |
65 | | required_ioport m_io_cola; |
66 | | required_ioport m_io_colb; |
67 | | required_ioport m_io_colc; |
68 | | required_ioport m_io_cold; |
69 | | required_ioport m_io_cole; |
70 | | required_ioport m_io_colf; |
| 40 | required_ioport_array<16> m_keyboard; |
71 | 41 | required_ioport m_battery_status; |
72 | 42 | |
73 | 43 | virtual void machine_start(); |
r241443 | r241444 | |
80 | 50 | DECLARE_WRITE8_MEMBER(kb_matrixl_w); |
81 | 51 | DECLARE_WRITE8_MEMBER(kb_matrixh_w); |
82 | 52 | DECLARE_READ8_MEMBER(port_a_r); |
83 | | DECLARE_WRITE8_MEMBER(port_a_w); |
| 53 | virtual DECLARE_WRITE8_MEMBER(port_a_w); |
84 | 54 | DECLARE_READ8_MEMBER(port_d_r); |
85 | 55 | DECLARE_WRITE8_MEMBER(port_d_w); |
| 56 | void update_lcdc(address_space &space, bool lcdc0, bool lcdc1); |
86 | 57 | |
87 | | private: |
| 58 | protected: |
88 | 59 | UINT8 m_matrix[2]; |
89 | 60 | UINT8 m_port_a; |
90 | 61 | UINT8 m_port_d; |
91 | 62 | bitmap_ind16 * m_tmp_bitmap; |
92 | 63 | }; |
93 | 64 | |
| 65 | class asma2k_state : public alphasmart_state |
| 66 | { |
| 67 | public: |
| 68 | asma2k_state(const machine_config &mconfig, device_type type, const char *tag) |
| 69 | : alphasmart_state(mconfig, type, tag), |
| 70 | m_intram(*this, "internal_ram") |
| 71 | { } |
| 72 | |
| 73 | required_shared_ptr<UINT8> m_intram; |
| 74 | |
| 75 | DECLARE_READ8_MEMBER(io_r); |
| 76 | DECLARE_WRITE8_MEMBER(io_w); |
| 77 | DECLARE_WRITE8_MEMBER(port_a_w); |
| 78 | |
| 79 | private: |
| 80 | UINT8 m_lcd_ctrl; |
| 81 | }; |
| 82 | |
94 | 83 | INPUT_CHANGED_MEMBER(alphasmart_state::kb_irq) |
95 | 84 | { |
96 | 85 | m_maincpu->set_input_line(MC68HC11_IRQ_LINE, HOLD_LINE); |
r241443 | r241444 | |
98 | 87 | |
99 | 88 | READ8_MEMBER(alphasmart_state::kb_r) |
100 | 89 | { |
101 | | ioport_port* portnames[] = |
102 | | { |
103 | | m_io_col0, m_io_col1, m_io_col2, m_io_col3, m_io_col4, m_io_col5, m_io_col6, m_io_col7, |
104 | | m_io_col8, m_io_col9, m_io_cola, m_io_colb, m_io_colc, m_io_cold, m_io_cole, m_io_colf |
105 | | }; |
106 | | |
107 | 90 | UINT16 matrix = (m_matrix[1]<<8) | m_matrix[0]; |
108 | 91 | UINT8 data = 0xff; |
109 | 92 | |
110 | 93 | for(int i=0; i<16; i++) |
111 | 94 | if (!(matrix & (1<<i))) |
112 | | data &= portnames[i]->read(); |
| 95 | data &= m_keyboard[i]->read(); |
113 | 96 | |
114 | 97 | return data; |
115 | 98 | } |
r241443 | r241444 | |
129 | 112 | return (m_port_a & 0xfd) | (m_battery_status->read() << 1); |
130 | 113 | } |
131 | 114 | |
132 | | WRITE8_MEMBER(alphasmart_state::port_a_w) |
| 115 | void alphasmart_state::update_lcdc(address_space &space, bool lcdc0, bool lcdc1) |
133 | 116 | { |
134 | | if ((m_matrix[1] & 0x04)) |
| 117 | if (m_matrix[1] & 0x04) |
135 | 118 | { |
136 | 119 | UINT8 lcdc_data = 0; |
137 | 120 | |
138 | | if ((m_port_a ^ data) & 0x80) |
| 121 | if (lcdc0) |
139 | 122 | lcdc_data |= m_lcdc0->read(space, BIT(m_matrix[1], 1)); |
140 | 123 | |
141 | | if ((m_port_a ^ data) & 0x20) |
| 124 | if (lcdc1) |
142 | 125 | lcdc_data |= m_lcdc1->read(space, BIT(m_matrix[1], 1)); |
143 | 126 | |
144 | 127 | m_port_d = (m_port_d & 0xc3) | (lcdc_data>>2); |
r241443 | r241444 | |
147 | 130 | { |
148 | 131 | UINT8 lcdc_data = (m_port_d<<2) & 0xf0; |
149 | 132 | |
150 | | if ((m_port_a ^ data) & data & 0x80) |
| 133 | if (lcdc0) |
151 | 134 | m_lcdc0->write(space, BIT(m_matrix[1], 1), lcdc_data); |
152 | 135 | |
153 | | if ((m_port_a ^ data) & data & 0x20) |
| 136 | if (lcdc1) |
154 | 137 | m_lcdc1->write(space, BIT(m_matrix[1], 1), lcdc_data); |
155 | 138 | } |
| 139 | } |
156 | 140 | |
| 141 | WRITE8_MEMBER(alphasmart_state::port_a_w) |
| 142 | { |
| 143 | UINT8 changed = (m_port_a ^ data) & data; |
| 144 | update_lcdc(space, changed & 0x80, changed & 0x20); |
157 | 145 | m_rambank->set_entry(((data>>3) & 0x01) | ((data>>4) & 0x02)); |
158 | 146 | m_port_a = data; |
159 | 147 | } |
r241443 | r241444 | |
184 | 172 | AM_RANGE( MC68HC11_IO_PORTD, MC68HC11_IO_PORTD ) AM_READWRITE(port_d_r, port_d_w) |
185 | 173 | ADDRESS_MAP_END |
186 | 174 | |
187 | | static ADDRESS_MAP_START(asma2k_mem, AS_PROGRAM, 8, alphasmart_state) |
| 175 | READ8_MEMBER(asma2k_state::io_r) |
| 176 | { |
| 177 | if (offset == 0x2000) |
| 178 | return kb_r(space, offset); |
| 179 | |
| 180 | //else printf("unknown r: %x\n", offset); |
| 181 | |
| 182 | return 0; |
| 183 | } |
| 184 | |
| 185 | WRITE8_MEMBER(asma2k_state::io_w) |
| 186 | { |
| 187 | if (offset == 0x2000) |
| 188 | kb_matrixh_w(space, offset, data); |
| 189 | else if (offset == 0x4000) |
| 190 | { |
| 191 | UINT8 changed = (m_lcd_ctrl ^ data) & data; |
| 192 | update_lcdc(space, changed & 0x01, changed & 0x02); |
| 193 | m_lcd_ctrl = data; |
| 194 | } |
| 195 | |
| 196 | //else printf("unknown w: %x %x\n", offset, data); |
| 197 | } |
| 198 | |
| 199 | WRITE8_MEMBER(asma2k_state::port_a_w) |
| 200 | { |
| 201 | if ((m_port_a ^ data) & 0x40) |
| 202 | { |
| 203 | address_space &space = m_maincpu->space(AS_PROGRAM); |
| 204 | |
| 205 | if (data & 0x40) |
| 206 | space.install_readwrite_bank(0x0000, 0x7fff, "rambank"); |
| 207 | else |
| 208 | space.install_readwrite_handler(0x0000, 0x7fff, read8_delegate(FUNC(asma2k_state::io_r), this), write8_delegate(FUNC(asma2k_state::io_w), this)); |
| 209 | |
| 210 | // internal registers / RAM |
| 211 | space.nop_readwrite(0x00, 0x3f); |
| 212 | space.install_ram(0x40, 0xff, m_intram.target()); |
| 213 | } |
| 214 | |
| 215 | m_rambank->set_entry(((data>>4) & 0x03)); |
| 216 | m_port_a = data; |
| 217 | } |
| 218 | |
| 219 | |
| 220 | static ADDRESS_MAP_START(asma2k_mem, AS_PROGRAM, 8, asma2k_state) |
188 | 221 | ADDRESS_MAP_UNMAP_HIGH |
189 | 222 | AM_RANGE( 0x0000, 0x003f ) AM_NOP // internal registers |
190 | | AM_RANGE( 0x0040, 0x00ff ) AM_RAM // internal RAM |
| 223 | AM_RANGE( 0x0040, 0x00ff ) AM_RAM AM_SHARE("internal_ram") // internal RAM |
191 | 224 | AM_RANGE( 0x0000, 0x7fff ) AM_RAMBANK("rambank") |
| 225 | AM_RANGE( 0x9000, 0x9000 ) AM_WRITE(kb_matrixl_w) |
192 | 226 | AM_RANGE( 0x8000, 0xffff ) AM_ROM AM_REGION("maincpu", 0) |
193 | 227 | ADDRESS_MAP_END |
194 | 228 | |
195 | 229 | /* Input ports */ |
196 | 230 | static INPUT_PORTS_START( alphasmart ) |
197 | | PORT_START("COL0") |
| 231 | PORT_START("COL.0") |
198 | 232 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
199 | 233 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
200 | 234 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
r241443 | r241444 | |
203 | 237 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
204 | 238 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
205 | 239 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
206 | | PORT_START("COL1") |
| 240 | PORT_START("COL.1") |
207 | 241 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
208 | 242 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
209 | 243 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
r241443 | r241444 | |
212 | 246 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
213 | 247 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
214 | 248 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
215 | | PORT_START("COL2") |
| 249 | PORT_START("COL.2") |
216 | 250 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
217 | 251 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
218 | 252 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
r241443 | r241444 | |
221 | 255 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
222 | 256 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
223 | 257 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
224 | | PORT_START("COL3") |
| 258 | PORT_START("COL.3") |
225 | 259 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
226 | 260 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('\"') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
227 | 261 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
r241443 | r241444 | |
230 | 264 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
231 | 265 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
232 | 266 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
233 | | PORT_START("COL4") |
| 267 | PORT_START("COL.4") |
234 | 268 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
235 | 269 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
236 | 270 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
r241443 | r241444 | |
239 | 273 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
240 | 274 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
241 | 275 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
242 | | PORT_START("COL5") |
| 276 | PORT_START("COL.5") |
243 | 277 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
244 | 278 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
245 | 279 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
r241443 | r241444 | |
248 | 282 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
249 | 283 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
250 | 284 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
251 | | PORT_START("COL6") |
| 285 | PORT_START("COL.6") |
252 | 286 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
253 | 287 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LWIN) PORT_CODE(KEYCODE_PGUP) PORT_NAME("Left Command") PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
254 | 288 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
r241443 | r241444 | |
257 | 291 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL) PORT_NAME("Clear File") PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
258 | 292 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
259 | 293 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
260 | | PORT_START("COL7") |
| 294 | PORT_START("COL.7") |
261 | 295 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F12) PORT_NAME("Send") PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
262 | 296 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
263 | 297 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
r241443 | r241444 | |
266 | 300 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
267 | 301 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
268 | 302 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
269 | | PORT_START("COL8") |
| 303 | PORT_START("COL.8") |
270 | 304 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
271 | 305 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
272 | 306 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
r241443 | r241444 | |
275 | 309 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
276 | 310 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
277 | 311 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
278 | | PORT_START("COL9") |
| 312 | PORT_START("COL.9") |
279 | 313 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LALT) PORT_NAME("Left Alt/Option") PORT_CHAR(UCHAR_MAMEKEY(LALT)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
280 | 314 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
281 | 315 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
r241443 | r241444 | |
284 | 318 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
285 | 319 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
286 | 320 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RALT) PORT_NAME("Right Alt/Option") PORT_CHAR(UCHAR_MAMEKEY(LALT)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
287 | | PORT_START("COLA") |
| 321 | PORT_START("COL.10") |
288 | 322 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
289 | 323 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
290 | 324 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
r241443 | r241444 | |
293 | 327 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
294 | 328 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
295 | 329 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
296 | | PORT_START("COLB") |
| 330 | PORT_START("COL.11") |
297 | 331 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F9) PORT_NAME("Pause") PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
298 | 332 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
299 | 333 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Backspace") PORT_CHAR(UCHAR_MAMEKEY(BACKSPACE)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
r241443 | r241444 | |
302 | 336 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F10) PORT_NAME("ScrLk") PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
303 | 337 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
304 | 338 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_NAME("Return") PORT_CHAR(13) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
305 | | PORT_START("COLC") |
| 339 | PORT_START("COL.12") |
306 | 340 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
307 | 341 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
308 | 342 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
r241443 | r241444 | |
311 | 345 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
312 | 346 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
313 | 347 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
314 | | PORT_START("COLD") |
| 348 | PORT_START("COL.13") |
315 | 349 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
316 | 350 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
317 | 351 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
r241443 | r241444 | |
320 | 354 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
321 | 355 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
322 | 356 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
323 | | PORT_START("COLE") |
| 357 | PORT_START("COL.14") |
324 | 358 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
325 | 359 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
326 | 360 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
r241443 | r241444 | |
329 | 363 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
330 | 364 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
331 | 365 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
332 | | PORT_START("COLF") |
| 366 | PORT_START("COL.15") |
333 | 367 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
334 | 368 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
335 | 369 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) PORT_CHANGED_MEMBER(DEVICE_SELF, alphasmart_state, kb_irq, NULL) |
r241443 | r241444 | |
406 | 440 | MCFG_NVRAM_ADD_0FILL("nvram") |
407 | 441 | MACHINE_CONFIG_END |
408 | 442 | |
409 | | static MACHINE_CONFIG_DERIVED( asma2k, alphasmart ) |
| 443 | static MACHINE_CONFIG_DERIVED_CLASS( asma2k, alphasmart, asma2k_state ) |
410 | 444 | MCFG_CPU_MODIFY("maincpu") |
411 | 445 | MCFG_CPU_PROGRAM_MAP(asma2k_mem) |
412 | 446 | MACHINE_CONFIG_END |