Previous 199869 Revisions Next

r32932 Friday 24th October, 2014 at 17:30:08 UTC by Sandro Ronco
(MESS) asma2k: fixed LCD and RAM bankswitch. (nw)
[src/mess/drivers]alphasma.c

trunk/src/mess/drivers/alphasma.c
r241443r241444
2828         m_lcdc1(*this, "ks0066_1"),
2929         m_nvram(*this, "nvram"),
3030         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"),
4732         m_battery_status(*this, "BATTERY")
4833      { }
4934
r241443r241444
5237   required_device<hd44780_device> m_lcdc1;
5338   required_device<nvram_device> m_nvram;
5439   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;
7141   required_ioport m_battery_status;
7242
7343   virtual void machine_start();
r241443r241444
8050   DECLARE_WRITE8_MEMBER(kb_matrixl_w);
8151   DECLARE_WRITE8_MEMBER(kb_matrixh_w);
8252   DECLARE_READ8_MEMBER(port_a_r);
83   DECLARE_WRITE8_MEMBER(port_a_w);
53   virtual DECLARE_WRITE8_MEMBER(port_a_w);
8454   DECLARE_READ8_MEMBER(port_d_r);
8555   DECLARE_WRITE8_MEMBER(port_d_w);
56   void update_lcdc(address_space &space, bool lcdc0, bool lcdc1);
8657
87private:
58protected:
8859   UINT8           m_matrix[2];
8960   UINT8           m_port_a;
9061   UINT8           m_port_d;
9162   bitmap_ind16 *  m_tmp_bitmap;
9263};
9364
65class asma2k_state : public alphasmart_state
66{
67public:
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
79private:
80   UINT8 m_lcd_ctrl;
81};
82
9483INPUT_CHANGED_MEMBER(alphasmart_state::kb_irq)
9584{
9685   m_maincpu->set_input_line(MC68HC11_IRQ_LINE, HOLD_LINE);
r241443r241444
9887
9988READ8_MEMBER(alphasmart_state::kb_r)
10089{
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
10790   UINT16 matrix = (m_matrix[1]<<8) | m_matrix[0];
10891   UINT8 data = 0xff;
10992
11093   for(int i=0; i<16; i++)
11194      if (!(matrix & (1<<i)))
112         data &= portnames[i]->read();
95         data &= m_keyboard[i]->read();
11396
11497   return data;
11598}
r241443r241444
129112   return (m_port_a & 0xfd) | (m_battery_status->read() << 1);
130113}
131114
132WRITE8_MEMBER(alphasmart_state::port_a_w)
115void alphasmart_state::update_lcdc(address_space &space, bool lcdc0, bool lcdc1)
133116{
134   if ((m_matrix[1] & 0x04))
117   if (m_matrix[1] & 0x04)
135118   {
136119      UINT8 lcdc_data = 0;
137120
138      if ((m_port_a ^ data) & 0x80)
121      if (lcdc0)
139122         lcdc_data |= m_lcdc0->read(space, BIT(m_matrix[1], 1));
140123
141      if ((m_port_a ^ data) & 0x20)
124      if (lcdc1)
142125         lcdc_data |= m_lcdc1->read(space, BIT(m_matrix[1], 1));
143126
144127      m_port_d = (m_port_d & 0xc3) | (lcdc_data>>2);
r241443r241444
147130   {
148131      UINT8 lcdc_data = (m_port_d<<2) & 0xf0;
149132
150      if ((m_port_a ^ data) & data & 0x80)
133      if (lcdc0)
151134         m_lcdc0->write(space, BIT(m_matrix[1], 1), lcdc_data);
152135
153      if ((m_port_a ^ data) & data & 0x20)
136      if (lcdc1)
154137         m_lcdc1->write(space, BIT(m_matrix[1], 1), lcdc_data);
155138   }
139}
156140
141WRITE8_MEMBER(alphasmart_state::port_a_w)
142{
143   UINT8 changed = (m_port_a ^ data) & data;
144   update_lcdc(space, changed & 0x80, changed & 0x20);
157145   m_rambank->set_entry(((data>>3) & 0x01) | ((data>>4) & 0x02));
158146   m_port_a = data;
159147}
r241443r241444
184172   AM_RANGE( MC68HC11_IO_PORTD, MC68HC11_IO_PORTD ) AM_READWRITE(port_d_r, port_d_w)
185173ADDRESS_MAP_END
186174
187static ADDRESS_MAP_START(asma2k_mem, AS_PROGRAM, 8, alphasmart_state)
175READ8_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
185WRITE8_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
199WRITE8_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
220static ADDRESS_MAP_START(asma2k_mem, AS_PROGRAM, 8, asma2k_state)
188221   ADDRESS_MAP_UNMAP_HIGH
189222   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
191224   AM_RANGE( 0x0000, 0x7fff ) AM_RAMBANK("rambank")
225   AM_RANGE( 0x9000, 0x9000 ) AM_WRITE(kb_matrixl_w)
192226   AM_RANGE( 0x8000, 0xffff ) AM_ROM   AM_REGION("maincpu", 0)
193227ADDRESS_MAP_END
194228
195229/* Input ports */
196230static INPUT_PORTS_START( alphasmart )
197   PORT_START("COL0")
231   PORT_START("COL.0")
198232   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)
199233   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
200234   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)
r241443r241444
203237   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)
204238   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)
205239   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")
207241   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)
208242   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)
209243   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)
r241443r241444
212246   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)
213247   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)
214248   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")
216250   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)
217251   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)
218252   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)
r241443r241444
221255   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)
222256   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)
223257   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")
225259   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)
226260   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)
227261   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)
r241443r241444
230264   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)
231265   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)
232266   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED)
233   PORT_START("COL4")
267   PORT_START("COL.4")
234268   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)
235269   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
236270   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED)
r241443r241444
239273   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED)
240274   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
241275   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED)
242   PORT_START("COL5")
276   PORT_START("COL.5")
243277   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED)
244278   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)
245279   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED)
r241443r241444
248282   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED)
249283   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
250284   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")
252286   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED)
253287   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)
254288   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED)
r241443r241444
257291   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)
258292   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)
259293   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED)
260   PORT_START("COL7")
294   PORT_START("COL.7")
261295   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)
262296   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
263297   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED)
r241443r241444
266300   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED)
267301   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
268302   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")
270304   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED)
271305   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
272306   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED)
r241443r241444
275309   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED)
276310   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
277311   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED)
278   PORT_START("COL9")
312   PORT_START("COL.9")
279313   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)
280314   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
281315   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED)
r241443r241444
284318   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED)
285319   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
286320   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")
288322   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)
289323   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)
290324   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)
r241443r241444
293327   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)
294328   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)
295329   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")
297331   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)
298332   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)
299333   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)
r241443r241444
302336   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)
303337   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
304338   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")
306340   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)
307341   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)
308342   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)
r241443r241444
311345   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)
312346   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)
313347   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")
315349   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)
316350   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
317351   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)
r241443r241444
320354   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)
321355   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)
322356   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")
324358   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)
325359   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)
326360   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)
r241443r241444
329363   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)
330364   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)
331365   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")
333367   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED)
334368   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
335369   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)
r241443r241444
406440   MCFG_NVRAM_ADD_0FILL("nvram")
407441MACHINE_CONFIG_END
408442
409static MACHINE_CONFIG_DERIVED( asma2k, alphasmart )
443static MACHINE_CONFIG_DERIVED_CLASS( asma2k, alphasmart, asma2k_state )
410444   MCFG_CPU_MODIFY("maincpu")
411445   MCFG_CPU_PROGRAM_MAP(asma2k_mem)
412446MACHINE_CONFIG_END


Previous 199869 Revisions Next


© 1997-2024 The MAME Team