Previous 15994 Revisions Next

r3834 Saturday 13th December, 2008 at 18:50:10 UTC by Miodrag Milanović
TMS9902 converted to device, some fixes on TMS9901
[src/mess/drivers]geneve.c ti99_4p.c ti99_4x.c tm990189.c
[src/mess/machine]994x_ser.c 994x_ser.h geneve.c ti99_4x.c tms9901.h tms9902.c tms9902.h

src/mess/machine/tms9901.h
r3833r3834
1212
1313#define TMS9901         DEVICE_GET_INFO_NAME(tms9901)
1414
15
1615/* Masks for the interrupts levels available on TMS9901 */
1716#define TMS9901_INT1 0x0002
1817#define TMS9901_INT2 0x0004
r3833r3834
3433    TYPE DEFINITIONS
3534***************************************************************************/
3635
37typedef void (*tms9910_int_callback_func)(const device_config *device, int intreq, int ic);
38#define TMS9910_INT_CALLBACK(name)   void name(const device_config *device, int intreq, int ic )
36typedef void (*tms9901_int_callback_func)(const device_config *device, int intreq, int ic);
37#define TMS9901_INT_CALLBACK(name)   void name(const device_config *device, int intreq, int ic )
3938
40/* TMS5501 timer and interrupt controler */
4139typedef struct _tms9901_interface tms9901_interface;
4240struct _tms9901_interface
4341{
4442   int supported_int_mask;   /* a bit for each input pin whose state is always notified to the TMS9901 core */
4543   read8_space_func  read_handlers[4];     /* 4*8 bits */
4644   write8_space_func write_handlers[16]; /* 16 Pn outputs */
47   tms9910_int_callback_func interrupt_callback; /* called when interrupt bus state changes */
45   tms9901_int_callback_func interrupt_callback; /* called when interrupt bus state changes */
4846   double clock_rate;
4947};
5048
49
50/***************************************************************************
51    FUNCTION PROTOTYPES
52***************************************************************************/
53
5154void tms9901_set_single_int(const device_config *device, int pin_number, int state);
5255
5356DEVICE_GET_INFO(tms9901);
5457
55/*********************** Standard 8-bit CPU interfaces *********************/
56
5758READ8_DEVICE_HANDLER ( tms9901_cru_r );
5859WRITE8_DEVICE_HANDLER( tms9901_cru_w );
5960
60
6161/***************************************************************************
6262    DEVICE CONFIGURATION MACROS
6363***************************************************************************/
src/mess/machine/tms9902.c
r3833r3834
99
1010#include "tms9902.h"
1111
12#define MAX_9902 2
13
1412/*
1513   TMS9902 emulation.
1614
r3833r3834
2523
2624*/
2725
28typedef struct tms9902_t
26
27/***************************************************************************
28    TYPE DEFINITIONS
29***************************************************************************/
30
31typedef struct _tms9902_t tms9902_t;
32struct _tms9902_t
2933{
3034   /* driver-specific configuration */
3135   /* tms9902 clock rate (PHI* pin, normally connected to TMS9900 Phi3*) */
r3833r3834
3438   (warning: 3MHz on a tms9900 is equivalent to 12MHz on a tms9995 or tms99000) */
3539   double clock_rate;
3640
37   void (*int_callback)(int which, int INT);   /* called when interrupt pin state changes */
38   void (*rts_callback)(int which, int RTS);   /* called when Request To Send pin state changes */
39   void (*brk_callback)(int which, int BRK);   /* called when BReaK state changes */
40   void (*xmit_callback)(int which, int data);   /* called when a character is transmitted */
41
42
4341   /* CRU interface */
44   int register_select;   /* bits which select which register is being written to */
42   int register_select;   /* bits device select device register is being written to */
4543
4644   /* inputs pins */
4745   unsigned int CTS : 1;
r3833r3834
9391
9492   /* clock registers */
9593   void *timer;         /* MESS timer, used to emulate the decrementer register */
96} tms9902_t;
9794
95   /* Pointer to interface */
96   const tms9902_interface *intf;   
97};
98
9899/* bits in register_select */
99100enum
100101{
r3833r3834
104105   register_select_LDCTRL = 0x8
105106};
106107
107static tms9902_t tms9902[MAX_9902];
108static void initiate_transmit(const device_config *device);
109static void set_brk(const device_config *device, int state);
110static DEVICE_RESET( tms9902 );
108111
112/***************************************************************************
113    INLINE FUNCTIONS
114***************************************************************************/
109115
110/*
111   prototypes
112*/
113
114static void field_interrupts(int which);
115static TIMER_CALLBACK(decrementer_callback);
116static void set_rts(int which, int state);
117static void set_brk(int which, int state);
118static void initiate_transmit(int which);
119
120
121/*
122   utilities
123*/
124
125
126/*
127   initialize the tms9902 core
128*/
129void tms9902_init(running_machine *machine,int which, const tms9902reset_param *param)
116INLINE tms9902_t *get_token(const device_config *device)
130117{
131   tms9902[which].clock_rate = param->clock_rate;
132
133   tms9902[which].int_callback = param->int_callback;
134   tms9902[which].rts_callback = param->rts_callback;
135   tms9902[which].brk_callback = param->brk_callback;
136   tms9902[which].xmit_callback = param->xmit_callback;
137
138   tms9902[which].timer = timer_alloc(machine, decrementer_callback, NULL);
139
140   tms9902_reset(which);
118   assert(device != NULL);
119   assert(device->type == TMS9902);
120   return (tms9902_t *) device->token;
141121}
142122
143123
144void tms9902_cleanup(int which)
145{
146   if (tms9902[which].timer)
147   {
148      timer_reset(tms9902[which].timer, attotime_never);   /* FIXME - timers should only be allocated once */
149      tms9902[which].timer = NULL;
150   }
151}
152
153void tms9902_reset(int which)
154{
155   /*  disable all interrupts */
156   tms9902[which].DSCENB = 0;
157   tms9902[which].TIMENB = 0;
158   tms9902[which].XBIENB = 0;
159   tms9902[which].RIENB = 0;
160   if (tms9902[which].int_callback)
161      (*tms9902[which].int_callback)(which, 0);
162   /* initialize transmitter */
163   tms9902[which].XBRE = 1;
164   tms9902[which].XSRE = 1;
165   /* initialize receiver */
166   tms9902[which].RBRL = 0;
167   /* we probably need to clear receive error conditions, too... */
168   /* clear RTS */
169   tms9902[which].RTSON = 0;
170   tms9902[which].RTS = 0;
171   if (tms9902[which].rts_callback)
172      (*tms9902[which].rts_callback)(which, 0);
173   /* set all resister load flags to 1 */
174   tms9902[which].register_select = 0xf;
175   /* clear break condition */
176   tms9902[which].BRKON = 0;
177   tms9902[which].BRK = 0;
178   if (tms9902[which].brk_callback)
179      (*tms9902[which].brk_callback)(which, 0);
180   field_interrupts(which);
181}
182
183124/*
184125   should be called after any change to int_state or enabled_ints.
185126*/
186static void field_interrupts(int which)
127static void field_interrupts(const device_config *device)
187128{
188   int new_int = (tms9902[which].DSCH && tms9902[which].DSCENB)
189                     || (tms9902[which].RBRL && tms9902[which].RIENB)
190                     || (tms9902[which].XBRE && tms9902[which].XBIENB)
191                     || (tms9902[which].TIMELP && tms9902[which].TIMENB);
129   tms9902_t *tms9902 = get_token(device);
130   int new_int = (tms9902->DSCH && tms9902->DSCENB)
131                     || (tms9902->RBRL && tms9902->RIENB)
132                     || (tms9902->XBRE && tms9902->XBIENB)
133                     || (tms9902->TIMELP && tms9902->TIMENB);
192134
193   if (new_int != tms9902[which].INT)
135   if (new_int != tms9902->INT)
194136   {
195      tms9902[which].INT = new_int;
137      tms9902->INT = new_int;
196138
197      if (tms9902[which].int_callback)
198         (*tms9902[which].int_callback)(which, new_int);
139      if (tms9902->intf->int_callback)
140         (*tms9902->intf->int_callback)(device, new_int);
199141   }
200142}
201143
202144
203145/*
204   function which should be called by the driver when the state of CTS changes
146   function device should be called by the driver when the state of CTS changes
205147
206148   state == 0: CTS* is inactive (high)
207   state != 0: CTS* is active (low)
149   state != 0: CTS* is active (low)
208150*/
209void tms9902_set_cts(int which, int state)
151void tms9902_set_cts(const device_config *device, int state)
210152{
153   tms9902_t *tms9902 = get_token(device);
211154   state = state != 0;
212155
213   if (state != tms9902[which].CTS)
156   if (state != tms9902->CTS)
214157   {
215      tms9902[which].CTS = state;
216      tms9902[which].DSCH = 1;
217      field_interrupts(which);
158      tms9902->CTS = state;
159      tms9902->DSCH = 1;
160      field_interrupts(device);
218161
219      if (state && tms9902[which].RTS && tms9902[which].XSRE)
162      if (state && tms9902->RTS && tms9902->XSRE)
220163      {
221         if ((! tms9902[which].XBRE) && ! tms9902[which].BRK)
222            initiate_transmit(which);
223         else if (tms9902[which].BRKON)
224            set_brk(which, 1);
164         if ((! tms9902->XBRE) && ! tms9902->BRK)
165            initiate_transmit(device);
166         else if (tms9902->BRKON)
167            set_brk(device, 1);
225168      }
226169   }
227170}
228171
229172
230173/*
231   function which should be called by the driver when the state of DSR changes
174   function device should be called by the driver when the state of DSR changes
232175
233176   state == 0: DSR* is inactive (high)
234177   state != 0: DSR* is active (low)
235178*/
236void tms9902_set_dsr(int which, int state)
179void tms9902_set_dsr(const device_config *device, int state)
237180{
181   tms9902_t *tms9902 = get_token(device);
238182   state = state != 0;
239183
240   if (state != tms9902[which].DSR)
184   if (state != tms9902->DSR)
241185   {
242      tms9902[which].DSR = state;
243      tms9902[which].DSCH = 1;
244      field_interrupts(which);
186      tms9902->DSR = state;
187      tms9902->DSCH = 1;
188      field_interrupts(device);
245189   }
246190}
247191
248192
249void tms9902_push_data(int which, int data)
193void tms9902_push_data(const device_config *device, int data)
250194{
251   tms9902[which].RBR = data;
195   tms9902_t *tms9902 = get_token(device);
196   tms9902->RBR = data;
252197
253   if (! tms9902[which].RBRL)
198   if (! tms9902->RBRL)
254199   {
255      tms9902[which].RBRL = 1;
256      field_interrupts(which);
200      tms9902->RBRL = 1;
201      field_interrupts(device);
257202   }
258203   else
259      tms9902[which].ROVER = 1;
204      tms9902->ROVER = 1;
260205}
261206
262207
r3833r3834
266211*/
267212static TIMER_CALLBACK(decrementer_callback)
268213{
269   int which = param;
270   if (tms9902[which].TIMELP)
271      tms9902[which].TIMERR = 1;
214   const device_config *device = (const device_config *) ptr;
215   tms9902_t *tms9902 = get_token(device);
216   
217   if (tms9902->TIMELP)
218      tms9902->TIMERR = 1;
272219   else
273      tms9902[which].TIMELP = 1;
220      tms9902->TIMELP = 1;
274221}
275222
276223/*
277224   load the content of clockinvl into the decrementer
278225*/
279static void reload_interval_timer(int which)
226static void reload_interval_timer(const device_config *device)
280227{
281   if (tms9902[which].TMR)
228   tms9902_t *tms9902 = get_token(device);
229   if (tms9902->TMR)
282230   {   /* reset clock interval */
283      timer_adjust_periodic(tms9902[which].timer,
284                  double_to_attotime((double) tms9902[which].TMR / (tms9902[which].clock_rate / ((tms9902[which].CLK4M) ? 4. : 3.) / 64.)),
285                  which,
286                  double_to_attotime((double) tms9902[which].TMR / (tms9902[which].clock_rate / ((tms9902[which].CLK4M) ? 4. : 3.) / 64.)));
231      timer_adjust_periodic(tms9902->timer,
232                  double_to_attotime((double) tms9902->TMR / (tms9902->clock_rate / ((tms9902->CLK4M) ? 4. : 3.) / 64.)),
233                  0,
234                  double_to_attotime((double) tms9902->TMR / (tms9902->clock_rate / ((tms9902->CLK4M) ? 4. : 3.) / 64.)));
287235   }
288236   else
289237   {   /* clock interval == 0 -> no timer */
290      timer_enable(tms9902[which].timer, 0);
238      timer_enable(tms9902->timer, 0);
291239   }
292240}
293241
294242
295static void set_rts(int which, int state)
243static void set_rts(const device_config *device, int state)
296244{
245   tms9902_t *tms9902 = get_token(device);
297246   /*state = state != 0;*/
298247
299   if (state != tms9902[which].RTS)
248   if (state != tms9902->RTS)
300249   {
301      tms9902[which].RTS = state;
250      tms9902->RTS = state;
302251
303      if (tms9902[which].rts_callback)
304         (*tms9902[which].rts_callback)(which, state);
252      if (tms9902->intf->rts_callback)
253         (*tms9902->intf->rts_callback)(device, state);
305254   }
306255}
307256
308257
309static void set_brk(int which, int state)
258static void set_brk(const device_config *device, int state)
310259{
260   tms9902_t *tms9902 = get_token(device);
311261   /*state = state != 0;*/
312262
313   if (state != tms9902[which].BRK)
263   if (state != tms9902->BRK)
314264   {
315      tms9902[which].BRK = state;
265      tms9902->BRK = state;
316266
317      if (tms9902[which].brk_callback)
318         (*tms9902[which].brk_callback)(which, state);
267      if (tms9902->intf->brk_callback)
268         (*tms9902->intf->brk_callback)(device, state);
319269   }
320270}
321271
322272
323static void initiate_transmit(int which)
273static void initiate_transmit(const device_config *device)
324274{
275   tms9902_t *tms9902 = get_token(device);
276   
325277   /* Load transmit register */
326   tms9902[which].XSR = tms9902[which].XBR;
327   tms9902[which].XSRE = 0;
328   tms9902[which].XBRE = 1;
329   field_interrupts(which);
278   tms9902->XSR = tms9902->XBR;
279   tms9902->XSRE = 0;
280   tms9902->XBRE = 1;
281   field_interrupts(device);
330282
331283   /* Do transmit at once (I will add a timer delay some day, maybe) */
332284
333   if (tms9902[which].xmit_callback)
334      (*tms9902[which].xmit_callback)(which, tms9902[which].XSR & (0xff >> (3-tms9902[which].RCL)));
285   if (tms9902->intf->xmit_callback)
286      (*tms9902->intf->xmit_callback)(device, tms9902->XSR & (0xff >> (3-tms9902->RCL)));
335287
336   tms9902[which].XSRE = 1;
288   tms9902->XSRE = 1;
337289
338   if ((! tms9902[which].XBRE) /*&& tms9902[which].RTS*/ && tms9902[which].CTS /*&& ! tms9902[which].BRK*/)
290   if ((! tms9902->XBRE) /*&& tms9902->RTS*/ && tms9902->CTS /*&& ! tms9902->BRK*/)
339291      /* load next byte */
340      initiate_transmit(which);
341   else if (tms9902[which].BRKON /*&& tms9902[which].RTS*/ && tms9902[which].CTS)
292      initiate_transmit(device);
293   else if (tms9902->BRKON /*&& tms9902->RTS*/ && tms9902->CTS)
342294      /* enter break mode */
343      set_brk(which, 1);
344   else if ((! tms9902[which].RTSON) && ((! tms9902[which].CTS) || (tms9902[which].XBRE && ! tms9902[which].BRK)))
295      set_brk(device, 1);
296   else if ((! tms9902->RTSON) && ((! tms9902->CTS) || (tms9902->XBRE && ! tms9902->BRK)))
345297      /* clear RTS output */
346      set_rts(which, 0);
298      set_rts(device, 0);
347299}
348300
349301
r3833r3834
365317   bit 13-15: not emulated, normally used for diagnostics
366318   bit 16: RBINT (RBRL&RIENB)
367319*/
368int tms9902_cru_r(int which, int offset)
320READ8_DEVICE_HANDLER( tms9902_cru_r )
369321{
370322   int answer = 0;
323   tms9902_t *tms9902 = get_token(device);
371324
372325   offset &= 0x003;
373326
374327   switch (offset)
375328   {
376329   case 0:
377      answer = tms9902[which].RBR;
330      answer = tms9902->RBR;
378331      break;
379332
380333   case 1:
381      answer = (tms9902[which].ROVER << 3)
382               | (tms9902[which].ROVER << 1);
334      answer = (tms9902->ROVER << 3)
335               | (tms9902->ROVER << 1);
383336      break;
384337
385338   case 2:
386      answer = (tms9902[which].XSRE << 7)
387               | (tms9902[which].XBRE << 6)
388               | (tms9902[which].RBRL << 5)
389               | ((tms9902[which].DSCH & tms9902[which].DSCENB) << 4)
390               | ((tms9902[which].TIMELP & tms9902[which].TIMENB) << 3)
391               | ((tms9902[which].XBRE & tms9902[which].XBIENB) << 1)
392               | (tms9902[which].RBRL & tms9902[which].RIENB);
339      answer = (tms9902->XSRE << 7)
340               | (tms9902->XBRE << 6)
341               | (tms9902->RBRL << 5)
342               | ((tms9902->DSCH & tms9902->DSCENB) << 4)
343               | ((tms9902->TIMELP & tms9902->TIMENB) << 3)
344               | ((tms9902->XBRE & tms9902->XBIENB) << 1)
345               | (tms9902->RBRL & tms9902->RIENB);
393346      break;
394347
395348   case 3:
396      answer = (tms9902[which].INT << 7)
397               | ((tms9902[which].register_select != 0) << 6)
398               | (tms9902[which].DSCH << 5)
399               | (tms9902[which].CTS << 4)
400               | (tms9902[which].DSR << 3)
401               | (tms9902[which].RTS << 2)
402               | (tms9902[which].TIMELP << 1)
403               | (tms9902[which].TIMERR);
349      answer = (tms9902->INT << 7)
350               | ((tms9902->register_select != 0) << 6)
351               | (tms9902->DSCH << 5)
352               | (tms9902->CTS << 4)
353               | (tms9902->DSR << 3)
354               | (tms9902->RTS << 2)
355               | (tms9902->TIMELP << 1)
356               | (tms9902->TIMERR);
404357      break;
405358   }
406359
r3833r3834
413366   signification:
414367   ...
415368*/
416void tms9902_cru_w(int which, int offset, int data)
369WRITE8_DEVICE_HANDLER( tms9902_cru_w )
417370{
371   tms9902_t *tms9902 = get_token(device);
372   
418373   data &= 1;   /* clear extra bits */
419374   offset &= 0x01F;
420375
r3833r3834
435390      {
436391         int mask = 1 << offset;
437392
438         if (tms9902[which].register_select & register_select_LDCTRL)
393         if (tms9902->register_select & register_select_LDCTRL)
439394         {   /* Control Register */
440395            if (offset <= 7)
441396            {
r3833r3834
444399               case 0:
445400               case 1:
446401                  if (data)
447                     tms9902[which].RCL |= mask;
402                     tms9902->RCL |= mask;
448403                  else
449                     tms9902[which].RCL &= ~mask;
404                     tms9902->RCL &= ~mask;
450405                  break;
451406
452407               case 3:
453                  tms9902[which].CLK4M = data;
408                  tms9902->CLK4M = data;
454409                  break;
455410
456411               /* ... */
457412               }
458413
459414               if (offset == 7)
460                  tms9902[which].register_select &= ~register_select_LDCTRL;
415                  tms9902->register_select &= ~register_select_LDCTRL;
461416            }
462417         }
463         else if (tms9902[which].register_select & register_select_LDIR)
418         else if (tms9902->register_select & register_select_LDIR)
464419         {   /* Interval Register */
465420            if (offset <= 7)
466421            {
467422               if (data)
468                  tms9902[which].TMR |= mask;
423                  tms9902->TMR |= mask;
469424               else
470                  tms9902[which].TMR &= ~mask;
425                  tms9902->TMR &= ~mask;
471426
472427               if (offset == 7)
473428               {
474                  reload_interval_timer(which);
475                  tms9902[which].register_select &= ~register_select_LDIR;
429                  reload_interval_timer(device);
430                  tms9902->register_select &= ~register_select_LDIR;
476431               }
477432            }
478433         }
479         else if (tms9902[which].register_select & (register_select_LRDR | register_select_LXDR))
434         else if (tms9902->register_select & (register_select_LRDR | register_select_LXDR))
480435         {   /* Receive&Transmit Data Rate Register */
481436            if (offset < 10)
482437            {
483               if (tms9902[which].register_select & register_select_LRDR)
438               if (tms9902->register_select & register_select_LRDR)
484439               {
485440                  if (data)
486                     tms9902[which].RDR |= mask;
441                     tms9902->RDR |= mask;
487442                  else
488                     tms9902[which].RDR &= ~mask;
443                     tms9902->RDR &= ~mask;
489444               }
490               if (tms9902[which].register_select & register_select_LXDR)
445               if (tms9902->register_select & register_select_LXDR)
491446               {
492447                  if (data)
493                     tms9902[which].XDR |= mask;
448                     tms9902->XDR |= mask;
494449                  else
495                     tms9902[which].XDR &= ~mask;
450                     tms9902->XDR &= ~mask;
496451               }
497452            }
498453            else if (offset == 10)
499454            {
500               if (tms9902[which].register_select & register_select_LRDR)
501                  tms9902[which].RDV8 = data;
502               if (tms9902[which].register_select & register_select_LXDR)
503                  tms9902[which].XDV8 = data;
455               if (tms9902->register_select & register_select_LRDR)
456                  tms9902->RDV8 = data;
457               if (tms9902->register_select & register_select_LXDR)
458                  tms9902->XDV8 = data;
504459
505460               /* set data rate */
506461               /* ... */
507462
508               tms9902[which].register_select &= ~ (register_select_LRDR | register_select_LXDR);
463               tms9902->register_select &= ~ (register_select_LRDR | register_select_LXDR);
509464            }
510465         }
511466         else
r3833r3834
513468            if (offset <= 7)
514469            {
515470               if (data)
516                  tms9902[which].XBR |= mask;
471                  tms9902->XBR |= mask;
517472               else
518                  tms9902[which].XBR &= ~mask;
473                  tms9902->XBR &= ~mask;
519474
520475               if (offset == 7)
521476               {   /* transmit */
522                  tms9902[which].XBRE = 0;
523                  if (tms9902[which].XSRE && tms9902[which].RTS && tms9902[which].CTS && ! tms9902[which].BRK)
477                  tms9902->XBRE = 0;
478                  if (tms9902->XSRE && tms9902->RTS && tms9902->CTS && ! tms9902->BRK)
524479                  {
525                     initiate_transmit(which);
480                     initiate_transmit(device);
526481                  }
527482               }
528483            }
r3833r3834
537492      {
538493         int mask = 1 << (offset - 0x0B);
539494
540         if ((offset == 0x0D) && (! data) && (tms9902[which].register_select & register_select_LDIR))
495         if ((offset == 0x0D) && (! data) && (tms9902->register_select & register_select_LDIR))
541496            /* clearing LDIR reloads the interval timer (right???) */
542            reload_interval_timer(which);
497            reload_interval_timer(device);
543498
544499         if (data)
545            tms9902[which].register_select |= mask;
500            tms9902->register_select |= mask;
546501         else
547            tms9902[which].register_select &= ~mask;
502            tms9902->register_select &= ~mask;
548503      }
549504      break;
550505
r3833r3834
553508      break;
554509
555510   case 0x10:   /* RTSON */
556      tms9902[which].RTSON = data;
557      if (data || (tms9902[which].XBRE && tms9902[which].XSRE && ! tms9902[which].BRK))
511      tms9902->RTSON = data;
512      if (data || (tms9902->XBRE && tms9902->XSRE && ! tms9902->BRK))
558513      {
559         set_rts(which, data);
560         if (data && tms9902[which].CTS)
514         set_rts(device, data);
515         if (data && tms9902->CTS)
561516         {
562            if (tms9902[which].XSRE && (! tms9902[which].XBRE) && ! tms9902[which].BRK)
563               initiate_transmit(which);
564            else if (tms9902[which].BRKON)
565               set_brk(which, 1);
517            if (tms9902->XSRE && (! tms9902->XBRE) && ! tms9902->BRK)
518               initiate_transmit(device);
519            else if (tms9902->BRKON)
520               set_brk(device, 1);
566521         }
567522      }
568523      break;
569524
570525   case 0x11:   /* BRKON */
571      tms9902[which].BRKON = data;
572      if (tms9902[which].BRK && ! data)
526      tms9902->BRKON = data;
527      if (tms9902->BRK && ! data)
573528      {
574         tms9902[which].BRK = 0;
575         if ((! tms9902[which].XBRE) && tms9902[which].CTS)
529         tms9902->BRK = 0;
530         if ((! tms9902->XBRE) && tms9902->CTS)
576531            /* transmit next byte */
577            initiate_transmit(which);
578         else if (! tms9902[which].RTSON)
532            initiate_transmit(device);
533         else if (! tms9902->RTSON)
579534            /* clear RTS */
580            set_rts(which, 0);
535            set_rts(device, 0);
581536      }
582      else if (tms9902[which].XBRE && tms9902[which].XSRE && tms9902[which].RTS && tms9902[which].CTS)
537      else if (tms9902->XBRE && tms9902->XSRE && tms9902->RTS && tms9902->CTS)
583538      {
584         set_brk(which, data);
539         set_brk(device, data);
585540      }
586541      break;
587542
588543   case 0x12:   /* RIENB */
589      tms9902[which].RIENB = data;
590      tms9902[which].RBRL = 0;
591      field_interrupts(which);
544      tms9902->RIENB = data;
545      tms9902->RBRL = 0;
546      field_interrupts(device);
592547      break;
593548
594549   case 0x13:   /* XBIENB */
595      tms9902[which].XBIENB = data;
596      field_interrupts(which);
550      tms9902->XBIENB = data;
551      field_interrupts(device);
597552      break;
598553
599554   case 0x14:   /* TIMENB */
600      tms9902[which].TIMENB = data;
601      tms9902[which].TIMELP = 0;
602      tms9902[which].TIMERR = 0;
603      field_interrupts(which);
555      tms9902->TIMENB = data;
556      tms9902->TIMELP = 0;
557      tms9902->TIMERR = 0;
558      field_interrupts(device);
604559      break;
605560
606561   case 0x15:   /* DSCENB */
607      tms9902[which].DSCENB = data;
608      tms9902[which].DSCH = 0;
609      field_interrupts(which);
562      tms9902->DSCENB = data;
563      tms9902->DSCH = 0;
564      field_interrupts(device);
610565      break;
611566
612567   case 0x1F:   /* RESET */
613      tms9902_reset(which);
568      device_reset_tms9902(device);
614569      break;
615570   }
616571}
617572
618573
619 READ8_HANDLER ( tms9902_0_cru_r )
574/*-------------------------------------------------
575    DEVICE_STOP( tms9902 )
576-------------------------------------------------*/
577
578static DEVICE_STOP( tms9902 )
620579{
621   return tms9902_cru_r(0, offset);
580   tms9902_t *tms9902 = get_token(device);
581   
582   if (tms9902->timer)
583   {
584      timer_reset(tms9902->timer, attotime_never);   /* FIXME - timers should only be allocated once */
585      tms9902->timer = NULL;
586   }
622587}
623588
624WRITE8_HANDLER ( tms9902_0_cru_w )
589/*-------------------------------------------------
590    DEVICE_RESET( tms9902 )
591-------------------------------------------------*/
592
593static DEVICE_RESET( tms9902 )
625594{
626   tms9902_cru_w(0, offset, data);
595   tms9902_t *tms9902 = get_token(device);
596
597   /*  disable all interrupts */
598   tms9902->DSCENB = 0;
599   tms9902->TIMENB = 0;
600   tms9902->XBIENB = 0;
601   tms9902->RIENB = 0;
602   if (tms9902->intf->int_callback)
603      (*tms9902->intf->int_callback)(device, 0);
604   /* initialize transmitter */
605   tms9902->XBRE = 1;
606   tms9902->XSRE = 1;
607   /* initialize receiver */
608   tms9902->RBRL = 0;
609   /* we probably need to clear receive error conditions, too... */
610   /* clear RTS */
611   tms9902->RTSON = 0;
612   tms9902->RTS = 0;
613   if (tms9902->intf->rts_callback)
614      (*tms9902->intf->rts_callback)(device, 0);
615   /* set all resister load flags to 1 */
616   tms9902->register_select = 0xf;
617   /* clear break condition */
618   tms9902->BRKON = 0;
619   tms9902->BRK = 0;
620   if (tms9902->intf->brk_callback)
621      (*tms9902->intf->brk_callback)(device, 0);
622   field_interrupts(device);
623
627624}
625
626
627/*-------------------------------------------------
628    DEVICE_START( tms9902 )
629-------------------------------------------------*/
630
631static DEVICE_START( tms9902 )
632{
633   tms9902_t *tms9902 = get_token(device);
634
635   assert(device != NULL);
636   assert(device->tag != NULL);
637   assert(strlen(device->tag) < 20);
638   assert(device->static_config != NULL);
639
640   tms9902->intf = device->static_config;
641
642   tms9902->clock_rate = tms9902->intf->clock_rate;
643
644   tms9902->timer = timer_alloc(device->machine, decrementer_callback, (void *) device);
645
646   return DEVICE_START_OK;
647}
648
649
650
651/*-------------------------------------------------
652    DEVICE_SET_INFO( tms9902 )
653-------------------------------------------------*/
654
655static DEVICE_SET_INFO( tms9902 )
656{
657   switch (state)
658   {
659      /* no parameters to set */
660   }
661}
662
663
664
665/*-------------------------------------------------
666    DEVICE_GET_INFO( tms9902 )
667-------------------------------------------------*/
668
669DEVICE_GET_INFO( tms9902 )
670{
671   switch (state)
672   {
673      /* --- the following bits of info are returned as 64-bit signed integers --- */
674      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(tms9902_t);            break;
675      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
676      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
677
678      /* --- the following bits of info are returned as pointers to data or functions --- */
679      case DEVINFO_FCT_SET_INFO:                  info->set_info = DEVICE_SET_INFO_NAME(tms9902); break;
680      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(tms9902);   break;
681      case DEVINFO_FCT_STOP:                     info->stop  = DEVICE_STOP_NAME (tms9902);   break;
682      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(tms9902);   break;
683
684      /* --- the following bits of info are returned as NULL-terminated strings --- */
685      case DEVINFO_STR_NAME:                     info->s = "TMS9902";               break;
686      case DEVINFO_STR_FAMILY:                  info->s = "TMS9902";               break;
687      case DEVINFO_STR_VERSION:                  info->s = "1.0";                     break;
688      case DEVINFO_STR_SOURCE_FILE:               info->s = __FILE__;                     break;
689      case DEVINFO_STR_CREDITS:                  /* Nothing */                        break;
690   }
691}
src/mess/machine/tms9902.h
r3833r3834
1typedef struct tms9902reset_param
1#ifndef __TMS9902_H__
2#define __TMS9902_H__
3
4/***************************************************************************
5    MACROS
6***************************************************************************/
7
8#define TMS9902         DEVICE_GET_INFO_NAME(tms9902)
9
10/***************************************************************************
11    TYPE DEFINITIONS
12***************************************************************************/
13
14typedef void (*tms9902_int_callback_func)(const device_config *device, int INT);
15#define TMS9902_INT_CALLBACK(name)   void name(const device_config *device, int INT )
16
17typedef void (*tms9902_rst_callback_func)(const device_config *device, int RTS);
18#define TMS9902_RST_CALLBACK(name)   void name(const device_config *device, int RTS )
19
20typedef void (*tms9902_brk_callback_func)(const device_config *device, int RTS);
21#define TMS9902_BRK_CALLBACK(name)   void name(const device_config *device, int BRK )
22
23typedef void (*tms9902_xmit_callback_func)(const device_config *device, int data);
24#define TMS9902_XMIT_CALLBACK(name)   void name(const device_config *device, int data )
25
26
27typedef struct _tms9902_interface tms9902_interface;
28struct _tms9902_interface
229{
330   double clock_rate;                     /* clock rate (2MHz-3.3MHz, with 4MHz overclocking) */
4   void (*int_callback)(int which, int INT);   /* called when interrupt pin state changes */
5   void (*rts_callback)(int which, int RTS);   /* called when Request To Send pin state changes */
6   void (*brk_callback)(int which, int BRK);   /* called when BReaK state changes */
7   void (*xmit_callback)(int which, int data);   /* called when a character is transmitted */
8} tms9902reset_param;
31   tms9902_int_callback_func  int_callback;   /* called when interrupt pin state changes */
32   tms9902_rst_callback_func  rts_callback;   /* called when Request To Send pin state changes */
33   tms9902_brk_callback_func  brk_callback;   /* called when BReaK state changes */
34   tms9902_xmit_callback_func xmit_callback;   /* called when a character is transmitted */
35};
936
1037
11void tms9902_init(running_machine *machine,int which, const tms9902reset_param *param);
12void tms9902_reset(int which);
13void tms9902_cleanup(int which);
38/***************************************************************************
39    FUNCTION PROTOTYPES
40***************************************************************************/
1441
15void tms9902_set_cts(int which, int state);
16void tms9902_set_dsr(int which, int state);
42void tms9902_set_cts(const device_config *device, int state);
43void tms9902_set_dsr(const device_config *device, int state);
1744
18void tms9902_push_data(int which, int data);
45void tms9902_push_data(const device_config *device, int data);
1946
20int tms9902_cru_r(int which, int offset);
21void tms9902_cru_w(int which, int offset, int data);
47DEVICE_GET_INFO(tms9902);
2248
23/*********************** Standard 8-bit CPU interfaces *********************/
49READ8_DEVICE_HANDLER ( tms9902_cru_r );
50WRITE8_DEVICE_HANDLER( tms9902_cru_w );
2451
25 READ8_HANDLER ( tms9902_0_cru_r );
26WRITE8_HANDLER ( tms9902_0_cru_w );
52/***************************************************************************
53    DEVICE CONFIGURATION MACROS
54***************************************************************************/
55
56#define MDRV_TMS9902_ADD(_tag, _intrf) \
57   MDRV_DEVICE_ADD(_tag, TMS9902) \
58   MDRV_DEVICE_CONFIG(_intrf)
59
60#endif /* __TMS9902_H__ */
src/mess/machine/994x_ser.c
r3833r3834
2929#define MAX_RS232_CARDS 1/*2*/
3030
3131/* prototypes */
32static void int_callback(int which, int INT);
33static void xmit_callback(int which, int data);
3432static int rs232_cru_r(running_machine *machine, int offset);
3533static void rs232_cru_w(running_machine *machine, int offset, int data);
3634static READ8_HANDLER(rs232_mem_r);
3735static WRITE8_HANDLER(rs232_mem_w);
38static void ti99_rs232_cleanup(running_machine *machine);
3936
4037/* pointer to the rs232 ROM data */
4138static UINT8 *rs232_DSR;
r3833r3834
6764   rs232_mem_w
6865};
6966
70static const tms9902reset_param tms9902_params =
71{
72   3000000.,            /* clock rate (3MHz) */
73   int_callback,         /* called when interrupt pin state changes */
74   NULL,//rts_callback,         /* called when Request To Send pin state changes */
75   NULL,//brk_callback,         /* called when BReaK state changes */
76   xmit_callback         /* called when a character is transmitted */
77};
78
79
80
8167/*
8268   Initialize pio unit and open image
8369*/
r3833r3834
120106*/
121107DEVICE_IMAGE_LOAD( ti99_4_rs232 )
122108{
109   const device_config *tms9902 = NULL;
110   
123111   int id = image_index_in_device(image);
124112
125113   /*if ((id < 0) || (id >= 2*MAX_RS232_CARDS))
126114      return INIT_FAIL;*/
127115   if (id != 0)
128116      return INIT_FAIL;
129
117   
118   if (id==0) {
119      tms9902 = device_list_find_by_tag(image->machine->config->devicelist, TMS9902, "tms9902_0");
120   }
121   if (id==1) {
122      tms9902 = device_list_find_by_tag(image->machine->config->devicelist, TMS9902, "tms9902_1");
123   }
124   
130125   rs232_fp = image;
131126
132127   if (rs232_fp)
133128   {
134      tms9902_set_cts(id, 1);
135      tms9902_set_dsr(id, 1);
129      tms9902_set_cts(tms9902, 1);
130      tms9902_set_dsr(tms9902, 1);
136131   }
137132   else
138133   {
139      tms9902_set_cts(id, 0);
140      tms9902_set_dsr(id, 0);
134      tms9902_set_cts(tms9902, 0);
135      tms9902_set_dsr(tms9902, 0);
141136   }
142137
143138   return INIT_PASS;
r3833r3834
164159void ti99_rs232_init(running_machine *machine)
165160{
166161   rs232_DSR = memory_region(machine, region_dsr) + offset_rs232_dsr;
167   tms9902_init(machine, 0, &tms9902_params);
168   tms9902_init(machine, 1, &tms9902_params);
169   
170   add_exit_callback(machine, ti99_rs232_cleanup);
171162}
172163
173164/*
r3833r3834
186177   cts1 = 0;
187178   cts2 = 0;
188179   led = 0;
189   tms9902_reset(0);
190   tms9902_reset(1);
191180}
192181
193182/*
194   rs232 card clean-up
183   rs232 interrupt handler
195184*/
196static void ti99_rs232_cleanup(running_machine *machine)
185static TMS9902_INT_CALLBACK( int_callback_0 )
197186{
198   tms9902_cleanup(0);
199   tms9902_cleanup(1);
187   ti99_peb_set_ila_bit(inta_rs232_1_bit, INT);
200188}
201189
202/*
203   rs232 interrupt handler
204*/
205static void int_callback(int which, int INT)
190static TMS9902_INT_CALLBACK( int_callback_1 )
206191{
207   switch (which)
208   {
209   case 0:
210      ti99_peb_set_ila_bit(inta_rs232_1_bit, INT);
211      break;
192   ti99_peb_set_ila_bit(inta_rs232_2_bit, INT);
193}
212194
213   case 1:
214      ti99_peb_set_ila_bit(inta_rs232_2_bit, INT);
215      break;
195static TMS9902_XMIT_CALLBACK( xmit_callback_0 )
196{
197   UINT8 buf = data;
216198
217   case 2:
218      ti99_peb_set_ila_bit(inta_rs232_3_bit, INT);
219      break;
220
221   case 3:
222      ti99_peb_set_ila_bit(inta_rs232_4_bit, INT);
223      break;
224   }
199   if (rs232_fp)
200      image_fwrite(rs232_fp, &buf, 1);
225201}
226202
227static void xmit_callback(int which, int data)
203static TMS9902_XMIT_CALLBACK( xmit_callback_1 )
228204{
229205   UINT8 buf = data;
230206
r3833r3834
232208      image_fwrite(rs232_fp, &buf, 1);
233209}
234210
211
235212/*
236213   Read rs232 card CRU interface
237214
r3833r3834
274251
275252   case 1:
276253      /* first 9902 */
277      reply = tms9902_cru_r(0, offset);
254      reply = tms9902_cru_r(device_list_find_by_tag(machine->config->devicelist, TMS9902, "tms9902_0"), offset);
278255      break;
279256
280257   case 2:
281258      /* second 9902 */
282      reply = tms9902_cru_r(1, offset);
259      reply = tms9902_cru_r(device_list_find_by_tag(machine->config->devicelist, TMS9902, "tms9902_1"), offset);
283260      break;
284261
285262   default:
r3833r3834
375352
376353   case 1:
377354      /* first 9902 */
378      tms9902_cru_w(0, offset, data);
355      tms9902_cru_w(device_list_find_by_tag(machine->config->devicelist, TMS9902, "tms9902_0"), offset, data);
379356      break;
380357
381358   case 2:
382359      /* second 9902 */
383      tms9902_cru_w(1, offset, data);
360      tms9902_cru_w(device_list_find_by_tag(machine->config->devicelist, TMS9902, "tms9902_1"), offset, data);
384361      break;
385362
386363   default:
r3833r3834
426403      /* DSR ROM: do nothing */
427404   }
428405}
406
407const tms9902_interface tms9902_params_0 =
408{
409   3000000.,            /* clock rate (3MHz) */
410   int_callback_0,         /* called when interrupt pin state changes */
411   NULL,//rts_callback,         /* called when Request To Send pin state changes */
412   NULL,//brk_callback,         /* called when BReaK state changes */
413   xmit_callback_0         /* called when a character is transmitted */
414};
415
416const tms9902_interface tms9902_params_1 =
417{
418   3000000.,            /* clock rate (3MHz) */
419   int_callback_1,         /* called when interrupt pin state changes */
420   NULL,//rts_callback,         /* called when Request To Send pin state changes */
421   NULL,//brk_callback,         /* called when BReaK state changes */
422   xmit_callback_1         /* called when a character is transmitted */
423};
src/mess/machine/994x_ser.h
r3833r3834
1#ifndef __994X_SER_H__
2#define __994X_SER_H__
3
4#include "machine/tms9902.h"
5
6extern const tms9902_interface tms9902_params_0;
7extern const tms9902_interface tms9902_params_1;
8
19DEVICE_IMAGE_LOAD( ti99_4_pio );
210DEVICE_IMAGE_UNLOAD( ti99_4_pio );
311
r3833r3834
614
715void ti99_rs232_init(running_machine *machine);
816void ti99_rs232_reset(running_machine *machine);
17
18#endif /* __994X_SER_H__ */
19
src/mess/machine/geneve.c
r3833r3834
12871287/*
12881288   Called by the 9901 core whenever the state of INTREQ and IC0-3 changes
12891289*/
1290static TMS9910_INT_CALLBACK( tms9901_interrupt_callback )
1290static TMS9901_INT_CALLBACK( tms9901_interrupt_callback )
12911291{
12921292   /* INTREQ is connected to INT1 (IC0-3 are not connected) */
12931293   cpu_set_input_line(device->machine->cpu[0], 0, intreq ? ASSERT_LINE : CLEAR_LINE);
src/mess/machine/ti99_4x.c
r3833r3834
21322132/*
21332133   Called by the 9901 core whenever the state of INTREQ and IC0-3 changes
21342134*/
2135static TMS9910_INT_CALLBACK( tms9901_interrupt_callback )
2135static TMS9901_INT_CALLBACK( tms9901_interrupt_callback )
21362136{
21372137   if (intreq)
21382138   {
src/mess/drivers/tm990189.c
r3833r3834
8080
8181static void hold_load(running_machine *machine);
8282
83static void rts_callback(int which, int RTS);
84static void xmit_callback(int which, int data);
8583
86static const tms9902reset_param tms9902_params =
87{
88   2000000.,            /* clock rate (2MHz) */
89   NULL,/*int_callback,*/   /* called when interrupt pin state changes */
90   rts_callback,         /* called when Request To Send pin state changes */
91   NULL,/*brk_callback,*/   /* called when BReaK state changes */
92   xmit_callback         /* called when a character is transmitted */
93};
94
9584static const device_config *rs232_fp;
9685static UINT8 rs232_rts;
9786static emu_timer *rs232_input_timer;
r3833r3834
10190   displayena_timer = timer_alloc(machine, NULL, NULL);
10291
10392   hold_load(machine);
104
105   tms9902_init(machine, 0, &tms9902_params);
10693}
10794
10895static const TMS9928a_interface tms9918_interface =
r3833r3834
128115   joy2y_timer = timer_alloc(machine, NULL, NULL);
129116
130117   hold_load(machine);
131
132   tms9902_init(machine, 0, &tms9902_params);
133
118   
134119   TMS9928A_reset();
135120}
136121
r3833r3834
278263    tms9901 code
279264*/
280265
281static TMS9910_INT_CALLBACK ( usr9901_interrupt_callback )
266static TMS9901_INT_CALLBACK ( usr9901_interrupt_callback )
282267{
283268   ic_state = ic & 7;
284269
r3833r3834
294279      LED_state &= ~(1 << offset);
295280}
296281
297static TMS9910_INT_CALLBACK( sys9901_interrupt_callback )
282static TMS9901_INT_CALLBACK( sys9901_interrupt_callback )
298283{
299284   (void)ic;
300285
r3833r3834
375360   if (/*rs232_rts &&*/ /*(mame_ftell(rs232_fp) < mame_fsize(rs232_fp))*/1)
376361   {
377362      if (image_fread(rs232_fp, &buf, 1) == 1)
378         tms9902_push_data(0, buf);
363         tms9902_push_data(device_list_find_by_tag(machine->config->devicelist, TMS9902, "tms9902"), buf);
379364   }
380365}
381366
r3833r3834
391376
392377   rs232_fp = image;
393378
394   tms9902_set_dsr(id, 1);
379   tms9902_set_dsr(device_list_find_by_tag(image->machine->config->devicelist, TMS9902, "tms9902"), 1);
395380   rs232_input_timer = timer_alloc(image->machine, rs232_input_callback, NULL);
396381   timer_adjust_periodic(rs232_input_timer, attotime_zero, 0, ATTOTIME_IN_MSEC(10));
397382
r3833r3834
410395
411396   rs232_fp = NULL;
412397
413   tms9902_set_dsr(id, 0);
398   tms9902_set_dsr(device_list_find_by_tag(image->machine->config->devicelist, TMS9902, "tms9902"), 0);
414399
415400   timer_reset(rs232_input_timer, attotime_never);   /* FIXME - timers should only be allocated once */
416401}
417402
418static void rts_callback(int which, int RTS)
403static TMS9902_RST_CALLBACK( rts_callback )
419404{
420405   rs232_rts = RTS;
421   tms9902_set_cts(which, RTS);
406   tms9902_set_cts(device, RTS);
422407}
423408
424static void xmit_callback(int which, int data)
409static TMS9902_XMIT_CALLBACK( xmit_callback )
425410{
426411   UINT8 buf = data;
427412
r3833r3834
657642    0x3000-0x3fff: 4kb onboard ROM
658643*/
659644
645static const tms9902_interface tms9902_params =
646{
647   2000000.,            /* clock rate (2MHz) */
648   NULL,/*int_callback,*/   /* called when interrupt pin state changes */
649   rts_callback,         /* called when Request To Send pin state changes */
650   NULL,/*brk_callback,*/   /* called when BReaK state changes */
651   xmit_callback         /* called when a character is transmitted */
652};
653
660654static ADDRESS_MAP_START(tm990_189_memmap, ADDRESS_SPACE_PROGRAM, 8)
661655
662656   AM_RANGE(0x0000, 0x07ff) AM_RAM                           /* RAM */
r3833r3834
737731static ADDRESS_MAP_START(tm990_189_writecru, ADDRESS_SPACE_IO, 8)
738732   AM_RANGE(0x000, 0x1ff) AM_DEVWRITE(TMS9901, "tms9901_0", tms9901_cru_w)   /* user I/O tms9901 */
739733   AM_RANGE(0x200, 0x3ff) AM_DEVWRITE(TMS9901, "tms9901_1", tms9901_cru_w)   /* system I/O tms9901 */
740   AM_RANGE(0x400, 0x5ff) AM_WRITE(tms9902_0_cru_w)   /* optional tms9902 */
734   AM_RANGE(0x400, 0x5ff) AM_DEVWRITE(TMS9902, "tms9902", tms9902_cru_w)   /* optional tms9902 */
741735
742736   AM_RANGE(0x0800,0x1fff)AM_WRITE(ext_instr_decode)   /* external instruction decoding (IDLE, RSET, CKON, CKOF, LREX) */
743737ADDRESS_MAP_END
r3833r3834
745739static ADDRESS_MAP_START(tm990_189_readcru, ADDRESS_SPACE_IO, 8)
746740   AM_RANGE(0x00, 0x3f) AM_DEVREAD(TMS9901, "tms9901_0", tms9901_cru_r)      /* user I/O tms9901 */
747741   AM_RANGE(0x40, 0x6f) AM_DEVREAD(TMS9901, "tms9901_1", tms9901_cru_r)      /* system I/O tms9901 */
748   AM_RANGE(0x80, 0xcf) AM_READ(tms9902_0_cru_r)      /* optional tms9902 */
742   AM_RANGE(0x80, 0xcf) AM_DEVREAD(TMS9902, "tms9902", tms9902_cru_r)      /* optional tms9902 */
749743
750744ADDRESS_MAP_END
751745
r3833r3834
792786
793787   MDRV_CASSETTE_ADD( "cassette", default_cassette_config )
794788   
789   /* tms9901 */
795790   MDRV_TMS9901_ADD("tms9901_0", usr9901reset_param)
796791   MDRV_TMS9901_ADD("tms9901_1", sys9901reset_param)
792   /* tms9902 */
793   MDRV_TMS9902_ADD("tms9902", tms9902_params)
797794MACHINE_DRIVER_END
798795
799796#define LEFT_BORDER      15
r3833r3834
833830
834831   MDRV_CASSETTE_ADD( "cassette", default_cassette_config )
835832
833   /* tms9901 */
836834   MDRV_TMS9901_ADD("tms9901_0", usr9901reset_param)
837   MDRV_TMS9901_ADD("tms9901_1", sys9901reset_param)   
835   MDRV_TMS9901_ADD("tms9901_1", sys9901reset_param)
836   /* tms9902 */
837   MDRV_TMS9902_ADD("tms9902", tms9902_params)
838838MACHINE_DRIVER_END
839839
840840
src/mess/drivers/geneve.c
r3833r3834
203203#include "includes/geneve.h"
204204#include "machine/ti99_4x.h"
205205#include "machine/tms9901.h"
206#include "machine/tms9902.h"
206207#include "audio/spchroms.h"
207208#include "machine/99_peb.h"
208209#include "machine/994x_ser.h"
r3833r3834
510511   
511512   /* tms9901 */
512513   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99)   
514   /* tms9902 */
515   MDRV_TMS9902_ADD("tms9902_0", tms9902_params_0)
516   MDRV_TMS9902_ADD("tms9902_1", tms9902_params_1)
513517MACHINE_DRIVER_END
514518
515519
r3833r3834
652656/*    YEAR  NAME      PARENT    COMPAT  MACHINE      INPUT    INIT      CONFIG  COMPANY     FULLNAME */
653657COMP( 1987,geneve,   0,      0,      geneve_60hz,  geneve,  geneve,   geneve,   "Myarc",   "Geneve 9640" , 0)
654658COMP( 1990,genmod,   geneve,   0,      geneve_60hz,  geneve,  genmod,   geneve,   "Myarc",   "Geneve 9640 (with Genmod modification)" , 0)
659
src/mess/drivers/ti99_4p.c
r3833r3834
3232
3333#include "machine/ti99_4x.h"
3434#include "machine/tms9901.h"
35#include "machine/tms9902.h"
3536#include "audio/spchroms.h"
3637#include "machine/99_peb.h"
3738#include "machine/994x_ser.h"
r3833r3834
287288   
288289   /* tms9901 */
289290   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_4x)   
291   /* tms9902 */
292   MDRV_TMS9902_ADD("tms9902_0", tms9902_params_0)
293   MDRV_TMS9902_ADD("tms9902_1", tms9902_params_1)   
290294MACHINE_DRIVER_END
291295
292296
src/mess/drivers/ti99_4x.c
r3833r3834
2323#include "video/v9938.h"
2424#include "machine/ti99_4x.h"
2525#include "machine/tms9901.h"
26#include "machine/tms9902.h"
2627#include "audio/spchroms.h"
2728#include "machine/99_peb.h"
2829#include "machine/994x_ser.h"
r3833r3834
545546   MDRV_CASSETTE_ADD( "cassette2", default_cassette_config )
546547   
547548   /* rtc */
548   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)   
549   
549   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)     
550550   /* tms9901 */
551   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_4x)
551   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_4x)   
552   /* tms9902 */
553   MDRV_TMS9902_ADD("tms9902_0", tms9902_params_0)
554   MDRV_TMS9902_ADD("tms9902_1", tms9902_params_1)     
552555MACHINE_DRIVER_END
553556
554557static MACHINE_DRIVER_START(ti99_4_50hz)
r3833r3834
592595   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)   
593596   /* tms9901 */
594597   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_4x)   
598   /* tms9902 */
599   MDRV_TMS9902_ADD("tms9902_0", tms9902_params_0)
600   MDRV_TMS9902_ADD("tms9902_1", tms9902_params_1)     
595601MACHINE_DRIVER_END
596602
597603static MACHINE_DRIVER_START(ti99_4a_60hz)
r3833r3834
636642   
637643   /* tms9901 */
638644   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_4x)   
645   /* tms9902 */
646   MDRV_TMS9902_ADD("tms9902_0", tms9902_params_0)
647   MDRV_TMS9902_ADD("tms9902_1", tms9902_params_1)     
639648MACHINE_DRIVER_END
640649
641650
r3833r3834
677686   MDRV_CASSETTE_ADD( "cassette2", default_cassette_config )
678687
679688   /* rtc */
680   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)   
681   
689   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)     
682690   /* tms9901 */
683691   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_4x)   
692   /* tms9902 */
693   MDRV_TMS9902_ADD("tms9902_0", tms9902_params_0)
694   MDRV_TMS9902_ADD("tms9902_1", tms9902_params_1)   
684695MACHINE_DRIVER_END
685696
686697
r3833r3834
733744   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)   
734745   /* tms9901 */
735746   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_4x)
747   /* tms9902 */
748   MDRV_TMS9902_ADD("tms9902_0", tms9902_params_0)
749   MDRV_TMS9902_ADD("tms9902_1", tms9902_params_1)     
736750MACHINE_DRIVER_END
737751
738752

Previous 15994 Revisions Next


© 1998-2018 The MESS Team