Previous 199869 Revisions Next

r29430 Tuesday 8th April, 2014 at 04:20:29 UTC by Tafoid
(MESS) Added preliminary keyboard hook-up in AAKART device, adding bare-bones keyboard inputs to Acorn Archimedes.  [Angelo Salese]
[src/emu/machine]aakart.c aakart.h
[src/mame/machine]archimds.c
[src/mess/drivers]a310.c

trunk/src/mame/machine/archimds.c
r29429r29430
416416static const char *const ioc_regnames[] =
417417{
418418   "(rw) Control",                 // 0
419   "(read) Keyboard receive (write) keyboard send",    // 1
419   "(read) Keyboard receive (write) keyboard send",    // 4
420420   "?",
421421   "?",
422   "(read) IRQ status A",              // 4
423   "(read) IRQ request A (write) IRQ clear",   // 5
424   "(rw) IRQ mask A",              // 6
422   "(read) IRQ status A",              // 10
423   "(read) IRQ request A (write) IRQ clear",   // 14
424   "(rw) IRQ mask A",              // 18
425425   "?",
426   "(read) IRQ status B",      // 8
427   "(read) IRQ request B",     // 9
428   "(rw) IRQ mask B",      // 10
426   "(read) IRQ status B",      // 20
427   "(read) IRQ request B",     // 24
428   "(rw) IRQ mask B",      // 28
429429   "?",
430   "(read) FIQ status",        // 12
431   "(read) FIQ request",       // 13
432   "(rw) FIQ mask",        // 14
430   "(read) FIQ status",        // 30
431   "(read) FIQ request",       // 34
432   "(rw) FIQ mask",        // 38
433433   "?",
434   "(read) Timer 0 count low (write) Timer 0 latch low",       // 16
435   "(read) Timer 0 count high (write) Timer 0 latch high",     // 17
436   "(write) Timer 0 go command",                   // 18
437   "(write) Timer 0 latch command",                // 19
438   "(read) Timer 1 count low (write) Timer 1 latch low",       // 20
439   "(read) Timer 1 count high (write) Timer 1 latch high",     // 21
440   "(write) Timer 1 go command",                   // 22
441   "(write) Timer 1 latch command",                // 23
442   "(read) Timer 2 count low (write) Timer 2 latch low",       // 24
443   "(read) Timer 2 count high (write) Timer 2 latch high",     // 25
444   "(write) Timer 2 go command",                   // 26
445   "(write) Timer 2 latch command",                // 27
446   "(read) Timer 3 count low (write) Timer 3 latch low",       // 28
447   "(read) Timer 3 count high (write) Timer 3 latch high",     // 29
448   "(write) Timer 3 go command",                   // 30
449   "(write) Timer 3 latch command"                 // 31
434   "(read) Timer 0 count low (write) Timer 0 latch low",       // 40
435   "(read) Timer 0 count high (write) Timer 0 latch high",     // 44
436   "(write) Timer 0 go command",                   // 48
437   "(write) Timer 0 latch command",                // 4c
438   "(read) Timer 1 count low (write) Timer 1 latch low",       // 50
439   "(read) Timer 1 count high (write) Timer 1 latch high",     // 54
440   "(write) Timer 1 go command",                   // 58
441   "(write) Timer 1 latch command",                // 5c
442   "(read) Timer 2 count low (write) Timer 2 latch low",       // 60
443   "(read) Timer 2 count high (write) Timer 2 latch high",     // 64
444   "(write) Timer 2 go command",                   // 68
445   "(write) Timer 2 latch command",                // 6c
446   "(read) Timer 3 count low (write) Timer 3 latch low",       // 70
447   "(read) Timer 3 count high (write) Timer 3 latch high",     // 74
448   "(write) Timer 3 go command",                   // 78
449   "(write) Timer 3 latch command"                 // 7c
450450};
451451
452452void archimedes_state::latch_timer_cnt(int tmr)
trunk/src/emu/machine/aakart.c
r29429r29430
6464   m_rxtimer = timer_alloc(RX_TIMER);
6565   m_rxtimer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock()));
6666   m_txtimer = timer_alloc(TX_TIMER);
67   m_txtimer->adjust(attotime::from_hz(clock()*3), 0, attotime::from_hz(clock()*3));
67   m_txtimer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock()));
6868   m_mousetimer = timer_alloc(MOUSE_TIMER);
6969   m_mousetimer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock()));
7070   m_keybtimer = timer_alloc(KEYB_TIMER);
r29429r29430
9898
9999void aakart_device::device_reset()
100100{
101   m_status = STATUS_NORMAL;
101   m_status = STATUS_HRST;
102102   m_new_command = 0;
103103   m_rx = -1;
104104   m_mouse_enable = 0;
r29429r29430
108108//  device_timer - handler timer events
109109//-------------------------------------------------
110110
111#if 0
112
113111void aakart_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
114112{
115   #if 0
116   if(id == KEYB_TIMER && m_keyb_enable && m_status == STATUS_NORMAL)
117   {
118      m_new_command |= 2;
119      m_rx_latch = 0xd0 | 0; // keyb scancode (0xd0=up 0xc0=down, bits 3-0 row)
120      m_status = STATUS_KEYUP;
121      //m_ff ^= 1;
122      return;
123   }
124   #endif
113    if(id == TX_TIMER && m_new_command & 1)
114    {
115        switch(m_tx_latch)
116        {
117            case 0x00:
118            case 0x03:
119            case 0x07:
120                // ---- -xxx led enables;
121                break;
122            case 0x20:
123                m_rx = 0x81;
124                m_out_tx_func(ASSERT_LINE);
125                break;
126            case 0x30:
127            case 0x31:
128            case 0x32:
129            case 0x33:
130                m_keyb_enable = m_tx_latch & 1;
131                m_mouse_enable = (m_tx_latch & 2) >> 1;
132                if(m_keyb_enable & 1 && m_keyb_state & 1)
133                {
134                    //printf("Got row\n");
135                    m_rx = m_keyb_row;
136                    m_out_tx_func(ASSERT_LINE);
137                }
138                break;
139            case 0x3f:
140                if(m_keyb_enable & 1 && m_keyb_state & 1)
141                {
142                    //printf("Got col\n");
143                    m_rx = m_keyb_col;
144                    m_out_tx_func(ASSERT_LINE);
145                    m_keyb_state = 0;
146                }
147                break;
148            case 0xfd:
149                m_rx = 0xfd;
150                m_out_tx_func(ASSERT_LINE);
151                break;
152            case 0xfe:
153                m_rx = 0xfe;
154                m_out_tx_func(ASSERT_LINE);
155                break;
156            case 0xff:
157                m_rx = 0xff;
158                m_out_tx_func(ASSERT_LINE);
159                break;
160            default:
161                printf("%02x %02x %02x\n",m_tx_latch,m_rx_latch,m_keyb_enable);
162                break;
163        }
125164
126   if(id == MOUSE_TIMER && m_mouse_enable && m_status == STATUS_NORMAL)
127   {
128      m_new_command |= 2;
129      m_rx_latch = 0; // mouse X position
130      m_status = STATUS_MOUSE;
131      //m_ff ^= 1;
132      return;
133   }
165        //m_new_command &= ~1;
166        m_out_rx_func(ASSERT_LINE);
167    }
134168
135   if(m_new_command == 0)
136      return;
137
138   if(id == RX_TIMER && m_new_command & 2)
139   {
140      m_out_rx_func(ASSERT_LINE);
141      m_new_command &= ~2;
142      m_rx = m_rx_latch;
143      return;
144   }
145
146   if(id == TX_TIMER && m_new_command & 1)
147   {
148      switch(m_status)
149      {
150         case STATUS_NORMAL:
151         {
152            switch(m_tx_latch)
153            {
154               case 0x00: // set leds
155                  break;
156               case RQID:
157                  m_rx_latch = 0x81; //keyboard ID
158                  break;
159               case SMAK:
160               case MACK:
161               case SACK:
162               case NACK:
163                  if(m_tx_latch & 2) { m_mouse_enable = 1; }
164                  if(m_tx_latch & 1) { m_keyb_enable = 1; }
165                  break;
166               case HRST:
167                  m_rx_latch = HRST;
168                  m_status = STATUS_HRST;
169                  break;
170               default:
171                  //printf("%02x\n",m_tx_latch);
172                  break;
173            }
174            break;
175         }
176         case STATUS_KEYDOWN:
177         {
178            switch(m_tx_latch)
179            {
180               case BACK:
181                  m_rx_latch = 0xc0 | 0; // keyb scancode (0xd0=up 0xc0=down, bits 3-0 col)
182                  m_status = STATUS_NORMAL;
183                  break;
184               case HRST:
185                  m_rx_latch = HRST;
186                  m_status = STATUS_HRST;
187                  break;
188            }
189            break;
190         }
191         case STATUS_KEYUP:
192         {
193            switch(m_tx_latch)
194            {
195               case BACK:
196                  m_rx_latch = 0xd0 | 0; // keyb scancode (0xd0=up 0xc0=down, bits 3-0 col)
197                  m_status = STATUS_NORMAL;
198                  break;
199               case HRST:
200                  m_rx_latch = HRST;
201                  m_status = STATUS_HRST;
202                  break;
203            }
204            break;
205         }
206         case STATUS_MOUSE:
207         {
208            switch(m_tx_latch)
209            {
210               case BACK:
211                  m_rx_latch = 0; // mouse Y
212                  m_status = STATUS_NORMAL;
213                  break;
214               default:
215               case HRST:
216                  m_rx_latch = HRST;
217                  m_status = STATUS_HRST;
218                  break;
219            }
220            break;
221         }
222         case STATUS_HRST:
223         {
224            switch(m_tx_latch)
225            {
226               case HRST:  { m_rx_latch = HRST; m_keyb_enable = m_mouse_enable = 0; break; }
227               case RAK1:  { m_rx_latch = RAK1; m_keyb_enable = m_mouse_enable = 0; break; }
228               case RAK2:  { m_rx_latch = RAK2; m_status = STATUS_NORMAL; break; }
229            }
230            break;
231         }
232      }
233      m_out_tx_func(ASSERT_LINE);
234      m_new_command &= ~1;
235      m_new_command |= 2;
236   }
237169}
238#else
239170
240void aakart_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
241{
242   if(id == RX_TIMER && m_new_command & 2)
243   {
244      m_out_rx_func(ASSERT_LINE);
245      m_out_tx_func(CLEAR_LINE);
246      m_rx = m_rx_latch;
247      return;
248   }
249
250   if(id == TX_TIMER && m_new_command & 1)
251   {
252      m_out_tx_func(ASSERT_LINE);
253      m_new_command &= ~1;
254      m_new_command |= 2;
255      return;
256   }
257}
258#endif
259
260171//**************************************************************************
261172//  READ/WRITE HANDLERS
262173//**************************************************************************
263174
175#include "debugger.h"
176
264177READ8_MEMBER( aakart_device::read )
265178{
266   m_out_rx_func(CLEAR_LINE);
179    m_out_tx_func(CLEAR_LINE);
180    //debugger_break(machine());
267181   return m_rx;
268182}
269183
r29429r29430
272186   // if(m_new_command) printf("skip cmd %02x\n",data);
273187
274188   m_tx_latch = data;
275   switch(m_status)
276   {
277      case STATUS_NORMAL:
278      {
279         switch(m_tx_latch)
280         {
281            case 0x00: //set leds
282               break;
283            case RQID:
284               m_rx_latch = 0x81; //keyboard ID
285               break;
286            case HRST:
287               m_rx_latch = HRST;
288               m_status = STATUS_HRST;
289               break;
290            case SMAK:
291            case MACK:
292            case SACK:
293            case NACK:
294               if(m_tx_latch & 2) { m_mouse_enable = 1; }
295               if(m_tx_latch & 1) { m_keyb_enable = 1; }
296               m_rx_latch = 0;
297               break;
298            case BACK:
299               m_rx_latch = machine().rand(); // ???
300               break;
301            default:
302               //printf("%02x\n",data);
303               break;
304         }
305         break;
306      }
307      case STATUS_KEYDOWN:
308      {
309         m_rx_latch = machine().rand();
189    m_out_rx_func(CLEAR_LINE);
190    m_new_command |= 1;
191}
310192
311         switch(m_tx_latch)
312         {
313            case HRST:
314            m_rx_latch = HRST;
315            m_status = STATUS_HRST;
316            break;
317            default:
318            //m_rx_latch = 0xc0 | 0x04;
319            printf("%02x\n",data);
320            break;
321         }
322         break;
323      }
324      case STATUS_HRST:
325      {
326         switch(m_tx_latch)
327         {
328            case HRST:  { m_rx_latch = HRST; m_keyb_enable = m_mouse_enable = 0; break; }
329            case RAK1:  { m_rx_latch = RAK1; m_keyb_enable = m_mouse_enable = 0; break; }
330            case RAK2:  { m_rx_latch = RAK2; m_status = STATUS_NORMAL; break; }
331         }
332         break;
333      }
334   }
335   m_new_command |= 1;
336
337   //m_tx_latch = data;
338   //m_new_command |= 1;
193void aakart_device::send_keycode_down(UINT8 row, UINT8 col)
194{
195    //printf("keycode down\n");
196    m_keyb_row = row | 0xc0;
197    m_keyb_col = col | 0xc0;
198    m_keyb_state = 1;
339199}
340200
341#if 0
342void aakart_device::write_kbd_buf()
201void aakart_device::send_keycode_up(UINT8 row, UINT8 col)
343202{
344   //printf("%08x\n",data);
345   m_out_tx_func(ASSERT_LINE);
346   //debugger_break(machine());
347   m_status = STATUS_KEYDOWN;
203    //printf("keycode up\n");
204    m_keyb_row = row | 0xd0;
205    m_keyb_col = col | 0xd0;
206    m_keyb_state = 1;
348207}
349#endif
trunk/src/emu/machine/aakart.h
r29429r29430
5252   // I/O operations
5353   DECLARE_WRITE8_MEMBER( write );
5454   DECLARE_READ8_MEMBER( read );
55
55    void send_keycode_down(UINT8 row, UINT8 col);
56    void send_keycode_up(UINT8 row, UINT8 col);
5657protected:
5758   // device-level overrides
5859   virtual void device_validity_check(validity_checker &valid) const;
r29429r29430
7374
7475   devcb_resolved_write_line   m_out_tx_func;
7576   devcb_resolved_write_line   m_out_rx_func;
76   int m_tx_latch, m_rx_latch;
77   int m_rx;
78   int m_new_command;
79   int m_status;
80   int m_mouse_enable;
81   int m_keyb_enable;
77   UINT8 m_tx_latch, m_rx_latch;
78   UINT8 m_rx;
79   UINT8 m_new_command;
80   UINT8 m_status;
81   UINT8 m_mouse_enable;
82   UINT8 m_keyb_enable;
83    UINT8 m_keyb_row;
84    UINT8 m_keyb_col;
85    UINT8 m_keyb_state;
86
8287};
8388
8489
trunk/src/mess/drivers/a310.c
r29429r29430
8686   DECLARE_DRIVER_INIT(a310);
8787   virtual void machine_start();
8888   virtual void machine_reset();
89    DECLARE_INPUT_CHANGED_MEMBER(key_stroke);
8990
91
9092protected:
9193   required_device<ram_device> m_ram;
9294};
r29429r29430
151153ADDRESS_MAP_END
152154
153155
156INPUT_CHANGED_MEMBER(a310_state::key_stroke)
157{
158    UINT8 row_val = (UINT8)(FPTR)(param) >> 4;
159    UINT8 col_val = (UINT8)(FPTR)(param) & 0xf;
160
161   if(newval && !oldval)
162      m_kart->send_keycode_down(row_val,col_val);
163   
164   if(oldval && !newval)
165      m_kart->send_keycode_up(row_val,col_val);
166}
167
168// TODO:
169// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x0c) PORT_IMPULSE(1) <- led enabled & 4
170// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x1d) PORT_IMPULSE(1) <- English Pound symbol
171// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x21) PORT_IMPULSE(1) <- unknown but used (changes cursor to full)
172// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x22) PORT_IMPULSE(1) <- led enabled & 1
173// 0x37 - 0x39 another 7 - 9 (keypad?)
174// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x3a) PORT_IMPULSE(1) <- another minus (keypad?)
175// 0x48 - 0x4a another 4 - 6 (keypad?)
176// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x4b) PORT_IMPULSE(1) <- +
177// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x4c) PORT_IMPULSE(1) <- another English Pound
178// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x57) PORT_IMPULSE(1) <- another /
179// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x5d) PORT_IMPULSE(1) <- led enabled & 2
180
154181static INPUT_PORTS_START( a310 )
155182   PORT_START("dip") /* DIP switches */
156183   PORT_BIT(0xfd, 0xfd, IPT_UNUSED)
157184
158185   PORT_START("key0") /* KEY ROW 0 */
159   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC)
160   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("1  !") PORT_CODE(KEYCODE_1)
161   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("2  \"") PORT_CODE(KEYCODE_2)
162   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("3  #") PORT_CODE(KEYCODE_3)
163   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("4  $") PORT_CODE(KEYCODE_4)
164   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("5  %") PORT_CODE(KEYCODE_5)
165   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("6  &") PORT_CODE(KEYCODE_6)
166   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("7  '") PORT_CODE(KEYCODE_7)
186   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x00) PORT_IMPULSE(1)
187   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("1  !") PORT_CODE(KEYCODE_1) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x11) PORT_IMPULSE(1)
188   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("2  \"") PORT_CODE(KEYCODE_2) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x12) PORT_IMPULSE(1)
189   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("3  #") PORT_CODE(KEYCODE_3) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x13) PORT_IMPULSE(1)
190   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("4  $") PORT_CODE(KEYCODE_4) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x14) PORT_IMPULSE(1)
191   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("5  %") PORT_CODE(KEYCODE_5) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x15) PORT_IMPULSE(1)
192   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("6  &") PORT_CODE(KEYCODE_6) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x16) PORT_IMPULSE(1)
193   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("7  '") PORT_CODE(KEYCODE_7) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x17) PORT_IMPULSE(1)
167194
168195   PORT_START("key1") /* KEY ROW 1 */
169   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("8  *") PORT_CODE(KEYCODE_8)
170   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("9  (") PORT_CODE(KEYCODE_9)
171   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("0  )") PORT_CODE(KEYCODE_0)
172   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("-  _") PORT_CODE(KEYCODE_MINUS)
173   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("=  +") PORT_CODE(KEYCODE_EQUALS)
174   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("`  ~") PORT_CODE(KEYCODE_TILDE)
175   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("BACK SPACE") PORT_CODE(KEYCODE_BACKSPACE)
196   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("8  *") PORT_CODE(KEYCODE_8) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x18) PORT_IMPULSE(1)
197   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("9  (") PORT_CODE(KEYCODE_9) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x19) PORT_IMPULSE(1)
198   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("0  )") PORT_CODE(KEYCODE_0) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x1a) PORT_IMPULSE(1)
199   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("-  _") PORT_CODE(KEYCODE_MINUS) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x1b) PORT_IMPULSE(1)
200   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("=  +") PORT_CODE(KEYCODE_EQUALS) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x1c) PORT_IMPULSE(1)
201   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("`  ~") PORT_CODE(KEYCODE_TILDE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x10) PORT_IMPULSE(1)
202   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("BACK SPACE") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x1e) PORT_IMPULSE(1)
176203   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB)
177204
178205   PORT_START("key2") /* KEY ROW 2 */
179   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("q  Q") PORT_CODE(KEYCODE_Q)
180   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("w  W") PORT_CODE(KEYCODE_W)
181   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("e  E") PORT_CODE(KEYCODE_E)
182   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("r  R") PORT_CODE(KEYCODE_R)
183   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("t  T") PORT_CODE(KEYCODE_T)
184   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("y  Y") PORT_CODE(KEYCODE_Y)
185   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("u  U") PORT_CODE(KEYCODE_U)
186   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("i  I") PORT_CODE(KEYCODE_I)
206    PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("q  Q") PORT_CODE(KEYCODE_Q) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x27) PORT_IMPULSE(1)
207   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("w  W") PORT_CODE(KEYCODE_W) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x28) PORT_IMPULSE(1)
208   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("e  E") PORT_CODE(KEYCODE_E) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x29) PORT_IMPULSE(1)
209   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("r  R") PORT_CODE(KEYCODE_R) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x2a) PORT_IMPULSE(1)
210   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("t  T") PORT_CODE(KEYCODE_T) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x2b) PORT_IMPULSE(1)
211   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("y  Y") PORT_CODE(KEYCODE_Y) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x2c) PORT_IMPULSE(1)
212   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("u  U") PORT_CODE(KEYCODE_U) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x2d) PORT_IMPULSE(1)
213   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("i  I") PORT_CODE(KEYCODE_I) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x2e) PORT_IMPULSE(1)
187214
188215   PORT_START("key3") /* KEY ROW 3 */
189   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("o  O") PORT_CODE(KEYCODE_O)
190   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("p  P") PORT_CODE(KEYCODE_P)
191   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("[  {") PORT_CODE(KEYCODE_OPENBRACE)
192   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("]  }") PORT_CODE(KEYCODE_CLOSEBRACE)
193   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER)
216   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("o  O") PORT_CODE(KEYCODE_O) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x2f) PORT_IMPULSE(1)
217   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("p  P") PORT_CODE(KEYCODE_P) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x30) PORT_IMPULSE(1)
218   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("[  {") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x31) PORT_IMPULSE(1)
219   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("]  }") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x32) PORT_IMPULSE(1)
220   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x47) PORT_IMPULSE(1)
194221   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL)
195222   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL)
196223   PORT_BIT(0x80, 0x80, IPT_KEYBOARD) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE
197224
198225   PORT_START("key4") /* KEY ROW 4 */
199   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("a  A") PORT_CODE(KEYCODE_A)
200   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("s  S") PORT_CODE(KEYCODE_S)
201   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("d  D") PORT_CODE(KEYCODE_D)
202   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("f  F") PORT_CODE(KEYCODE_F)
203   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("g  G") PORT_CODE(KEYCODE_G)
204   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("h  H") PORT_CODE(KEYCODE_H)
205   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("j  J") PORT_CODE(KEYCODE_J)
206   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("k  K") PORT_CODE(KEYCODE_K)
226   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("a  A") PORT_CODE(KEYCODE_A) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x3c) PORT_IMPULSE(1)
227   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("s  S") PORT_CODE(KEYCODE_S) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x3d) PORT_IMPULSE(1)
228   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("d  D") PORT_CODE(KEYCODE_D) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x3e) PORT_IMPULSE(1)
229   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("f  F") PORT_CODE(KEYCODE_F) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x3f) PORT_IMPULSE(1)
230   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("g  G") PORT_CODE(KEYCODE_G) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x40) PORT_IMPULSE(1)
231   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("h  H") PORT_CODE(KEYCODE_H) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x41) PORT_IMPULSE(1)
232   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("j  J") PORT_CODE(KEYCODE_J) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x42) PORT_IMPULSE(1)
233   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("k  K") PORT_CODE(KEYCODE_K) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x43) PORT_IMPULSE(1)
207234
208235   PORT_START("key5") /* KEY ROW 5 */
209   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("l  L") PORT_CODE(KEYCODE_L)
210   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME(";  :") PORT_CODE(KEYCODE_COLON)
211   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("'  \"") PORT_CODE(KEYCODE_QUOTE)
212   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("\\  |") PORT_CODE(KEYCODE_ASTERISK)
236   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("l  L") PORT_CODE(KEYCODE_L) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x44) PORT_IMPULSE(1)
237   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME(";  :") PORT_CODE(KEYCODE_COLON) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x45) PORT_IMPULSE(1)
238   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("'  \"") PORT_CODE(KEYCODE_QUOTE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x46) PORT_IMPULSE(1)
239   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("\\  |") PORT_CODE(KEYCODE_ASTERISK) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x33) PORT_IMPULSE(1)
213240   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("SHIFT (L)") PORT_CODE(KEYCODE_LSHIFT)
214   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("z  Z") PORT_CODE(KEYCODE_Z)
215   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("x  X") PORT_CODE(KEYCODE_X)
216   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("c  C") PORT_CODE(KEYCODE_C)
241   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("z  Z") PORT_CODE(KEYCODE_Z) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x4e) PORT_IMPULSE(1)
242   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("x  X") PORT_CODE(KEYCODE_X) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x4f) PORT_IMPULSE(1)
243   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("c  C") PORT_CODE(KEYCODE_C) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x50) PORT_IMPULSE(1)
217244
218245   PORT_START("key6") /* KEY ROW 6 */
219   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("v  V") PORT_CODE(KEYCODE_V)
220   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("b  B") PORT_CODE(KEYCODE_B)
221   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("n  N") PORT_CODE(KEYCODE_N)
222   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("m  M") PORT_CODE(KEYCODE_M)
223   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME(",  <") PORT_CODE(KEYCODE_COMMA)
224   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME(".  >") PORT_CODE(KEYCODE_STOP)
225   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("/  ?") PORT_CODE(KEYCODE_SLASH)
246   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("v  V") PORT_CODE(KEYCODE_V) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x51) PORT_IMPULSE(1)
247   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("b  B") PORT_CODE(KEYCODE_B) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x52) PORT_IMPULSE(1)
248   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("n  N") PORT_CODE(KEYCODE_N) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x53) PORT_IMPULSE(1)
249   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("m  M") PORT_CODE(KEYCODE_M) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x54) PORT_IMPULSE(1)
250   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME(",  <") PORT_CODE(KEYCODE_COMMA) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x55) PORT_IMPULSE(1)
251   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME(".  >") PORT_CODE(KEYCODE_STOP) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x56) PORT_IMPULSE(1)
252   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("/  ?") PORT_CODE(KEYCODE_SLASH) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x23) PORT_IMPULSE(1)
226253   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("SHIFT (R)") PORT_CODE(KEYCODE_RSHIFT)
227254
228255   PORT_START("key7") /* KEY ROW 7 */
229256   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("LINE FEED")
230   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE)
231   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("- (KP)") PORT_CODE(KEYCODE_MINUS_PAD)
232   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME(", (KP)") PORT_CODE(KEYCODE_PLUS_PAD)
257   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x26) PORT_IMPULSE(1)
258    PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("- (KP)") PORT_CODE(KEYCODE_MINUS_PAD)
259    PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME(", (KP)") PORT_CODE(KEYCODE_PLUS_PAD)
233260   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("ENTER (KP)") PORT_CODE(KEYCODE_ENTER_PAD)
234261   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME(". (KP)") PORT_CODE(KEYCODE_DEL_PAD)
235262   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("0 (KP)") PORT_CODE(KEYCODE_0_PAD)
236263   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("1 (KP)") PORT_CODE(KEYCODE_1_PAD)
237264
238265   PORT_START("key8") /* KEY ROW 8 */
239   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("2 (KP)") PORT_CODE(KEYCODE_2_PAD)
240   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("3 (KP)") PORT_CODE(KEYCODE_3_PAD)
241   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("4 (KP)") PORT_CODE(KEYCODE_4_PAD)
242   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("5 (KP)") PORT_CODE(KEYCODE_5_PAD)
243   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("6 (KP)") PORT_CODE(KEYCODE_6_PAD)
244   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("7 (KP)") PORT_CODE(KEYCODE_7_PAD)
245   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("8 (KP)") PORT_CODE(KEYCODE_8_PAD)
246   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("9 (KP)") PORT_CODE(KEYCODE_9_PAD)
266    PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("2 (KP)") PORT_CODE(KEYCODE_2_PAD)
267    PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("3 (KP)") PORT_CODE(KEYCODE_3_PAD)
268    PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("4 (KP)") PORT_CODE(KEYCODE_4_PAD)
269    PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("5 (KP)") PORT_CODE(KEYCODE_5_PAD)
270    PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("6 (KP)") PORT_CODE(KEYCODE_6_PAD)
271    PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("7 (KP)") PORT_CODE(KEYCODE_7_PAD)
272    PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("8 (KP)") PORT_CODE(KEYCODE_8_PAD)
273    PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("9 (KP)") PORT_CODE(KEYCODE_9_PAD)
247274
275    PORT_START("key9")
276    PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("HOME") PORT_CODE(KEYCODE_HOME) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x20) PORT_IMPULSE(1)
277    PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("*") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x24) PORT_IMPULSE(1) // (KP?)
278    PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("#") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x25) PORT_IMPULSE(1) // (KP?)
279
280
248281   PORT_START("via1a") /* VIA #1 PORT A */
249282   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START) PORT_PLAYER(1)
250283   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START) PORT_PLAYER(2)
251   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1                   )
252   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2                   )
284   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1)
285   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2)
253286   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_4WAY
254287   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_4WAY
255288   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_4WAY
r29429r29430
297330   MCFG_CPU_ADD("maincpu", ARM, 8000000)        /* 8 MHz */
298331   MCFG_CPU_PROGRAM_MAP(a310_mem)
299332
300   MCFG_AAKART_ADD("kart", 8000000/128, kart_interface) // TODO: frequency
333   MCFG_AAKART_ADD("kart", 8000000/256, kart_interface) // TODO: frequency
334
301335   MCFG_I2CMEM_ADD("i2cmem")
302336   MCFG_I2CMEM_DATA_SIZE(0x100)
303337

Previous 199869 Revisions Next


© 1997-2024 The MAME Team