Previous 15994 Revisions Next

r5089 Friday 26th June, 2009 at 17:11:17 UTC by Curt Coder
[KB3600] Implemented any key down output.
[src/mess/machine]kb3600.c kb3600.h

src/mess/machine/kb3600.c
r5088r5089
1212   TODO:
1313
1414   - more accurate emulation of real chip
15   - any key down
1615
1716*/
1817
r5088r5089
2625typedef struct _ay3600_t ay3600_t;
2726struct _ay3600_t
2827{
29   devcb_resolved_write_line   out_data_ready_func;
30
3128   devcb_resolved_read_line   in_shift_func;
3229   devcb_resolved_read_line   in_control_func;
3330
31   devcb_resolved_write_line   out_data_ready_func;
32   devcb_resolved_write_line   out_ako_func;
33
3434   int b;                  /* output buffer */
35   int ako;               /* any key down */
3536
3637   /* timers */
3738   emu_timer *scan_timer;      /* keyboard scan timer */
r5088r5089
7172   const ay3600_interface *intf = get_interface(device);
7273
7374   int x, y;
74   int akd = 0;
75   int ako = 0;
7576
7677   for (x = 0; x < 9; x++)
7778   {
r5088r5089
8384         {
8485            int b = (x * 10) + y;
8586
86            akd = 1;
87            ako = 1;
8788
8889            if (b > 63)
8990            {
r5088r5089
105106      }
106107   }
107108   
108   if (!akd)
109   if (!ako)
109110   {
110111      ay3600->b = -1;
111112   }
113
114   if (ako != ay3600->ako)
115   {
116      devcb_call_write_line(&ay3600->out_ako_func, ako);
117      ay3600->ako = ako;
118   }
112119}
113120
114121/*-------------------------------------------------
r5088r5089
136143   const ay3600_interface *intf = get_interface(device);
137144
138145   /* resolve callbacks */
139   devcb_resolve_write_line(&ay3600->out_data_ready_func, &intf->out_data_ready_func, device);
140146   devcb_resolve_read_line(&ay3600->in_shift_func, &intf->in_shift_func, device);
141147   devcb_resolve_read_line(&ay3600->in_control_func, &intf->in_control_func, device);
148   devcb_resolve_write_line(&ay3600->out_data_ready_func, &intf->out_data_ready_func, device);
149   devcb_resolve_write_line(&ay3600->out_ako_func, &intf->out_ako_func, device);
142150
143151   /* create the timers */
144152   ay3600->scan_timer = timer_alloc(device->machine, ay3600_scan_tick, (void *)device);
r5088r5089
146154
147155   /* register for state saving */
148156   state_save_register_device_item(device, 0, ay3600->b);
157   state_save_register_device_item(device, 0, ay3600->ako);
149158}
150159
151160/*-------------------------------------------------
src/mess/machine/kb3600.h
r5088r5089
4141                B2   10 |  AY-5-3600    | 31  X4
4242                B1   11 |   PRO 002    | 30  X3
4343               X8   12 |          | 29  X2
44               AKD   13 |          | 28  X1
44               AKO   13 |          | 28  X1
4545              CTRL   14 |          | 27  X0
4646             SHIFT   15 |          | 26  Y9
4747         DATA READY   16 |          | 25  Y8
r5088r5089
8888   /* this gets called for every change of the DATA READY pin */
8989   devcb_write_line   out_data_ready_func;
9090
91   /* this gets called for every change of the AKD pin */
92   devcb_write_line   out_akd_func;
91   /* this gets called for every change of the AKO pin */
92   devcb_write_line   out_ako_func;
9393};
9494
9595/***************************************************************************

Previous 15994 Revisions Next


© 1998-2018 The MESS Team