Previous 15994 Revisions Next

r6730 Thursday 24th December, 2009 at 09:40:53 UTC by Miodrag Milanović
- Converted TM990189 rs232 to MAME device
- Removed commented SYSTEM_CONFIG_START block from thomson driver
[src/mess/drivers]thomson.c tm990189.c

src/mess/drivers/tm990189.c
r6729r6730
4545#include "devices/cassette.h"
4646#include "sound/speaker.h"
4747#include "sound/wave.h"
48#include "machine/serial.h"
4849
49
5050static int load_state;
5151static int ic_state;
5252
r6729r6730
8888
8989static MACHINE_RESET( tm990_189 )
9090{
91   displayena_timer = timer_alloc(machine, NULL, NULL);
92
9391   hold_load(machine);
9492}
9593
94static MACHINE_START( tm990_189 )
95{
96   displayena_timer = timer_alloc(machine, NULL, NULL);
97}
9698static const TMS9928a_interface tms9918_interface =
9799{
98100   TMS99x8,
r6729r6730
104106static MACHINE_START( tm990_189_v )
105107{
106108   TMS9928A_configure(&tms9918_interface);
107}
108
109static MACHINE_RESET( tm990_189_v )
110{
109   
111110   displayena_timer = timer_alloc(machine, NULL, NULL);
112111
113112   joy1x_timer = timer_alloc(machine, NULL, NULL);
114113   joy1y_timer = timer_alloc(machine, NULL, NULL);
115114   joy2x_timer = timer_alloc(machine, NULL, NULL);
116115   joy2y_timer = timer_alloc(machine, NULL, NULL);
116}
117117
118static MACHINE_RESET( tm990_189_v )
119{
118120   hold_load(machine);
119121
120122   TMS9928A_reset();
r6729r6730
361363
362364   if (/*rs232_rts &&*/ /*(mame_ftell(rs232_fp) < mame_fsize(rs232_fp))*/1)
363365   {
364      if (image_fread(rs232_fp, &buf, 1) == 1)
366      if (image_fread(ptr, &buf, 1) == 1)
365367         tms9902_push_data(devtag_get_device(machine, "tms9902"), buf);
366368   }
367369}
r6729r6730
371373*/
372374static DEVICE_IMAGE_LOAD( tm990_189_rs232 )
373375{
374   int id = image_index_in_device(image);
375
376   if (id != 0)
377      return INIT_FAIL;
378
379   rs232_fp = image;
380
381376   tms9902_set_dsr(devtag_get_device(image->machine, "tms9902"), 1);
382   rs232_input_timer = timer_alloc(image->machine, rs232_input_callback, NULL);
377   rs232_input_timer = timer_alloc(image->machine, rs232_input_callback, (void*)image);
383378   timer_adjust_periodic(rs232_input_timer, attotime_zero, 0, ATTOTIME_IN_MSEC(10));
384379
385380   return INIT_PASS;
r6729r6730
390385*/
391386static DEVICE_IMAGE_UNLOAD( tm990_189_rs232 )
392387{
393   int id = image_index_in_device(image);
394
395   if (id != 0)
396      return;
397
398   rs232_fp = NULL;
399
400388   tms9902_set_dsr(devtag_get_device(image->machine, "tms9902"), 0);
401389
402390   timer_reset(rs232_input_timer, attotime_never);   /* FIXME - timers should only be allocated once */
403391}
404392
393static DEVICE_GET_INFO( tm990_189_rs232 )
394{
395   switch ( state )
396   {
397      case DEVINFO_FCT_IMAGE_LOAD:              info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( tm990_189_rs232 );    break;
398      case DEVINFO_FCT_IMAGE_UNLOAD:              info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME( tm990_189_rs232 );    break;
399      case DEVINFO_STR_NAME:                      strcpy(info->s, "TM990/189 RS232 port");                       break;
400      case DEVINFO_STR_IMAGE_FILE_EXTENSIONS:       strcpy(info->s, "");                                         break;
401      case DEVINFO_INT_IMAGE_READABLE:            info->i = 1;                                           break;
402      case DEVINFO_INT_IMAGE_WRITEABLE:         info->i = 1;                                           break;
403      case DEVINFO_INT_IMAGE_CREATABLE:           info->i = 1;                                           break;     
404      default:                            DEVICE_GET_INFO_CALL(serial);   break;
405   }
406}
407
408#define TM990_189_RS232   DEVICE_GET_INFO_NAME(tm990_189_rs232)
409
410#define MDRV_TM990_189_RS232_ADD(_tag) \
411   MDRV_DEVICE_ADD(_tag, TM990_189_RS232, 0)
412   
413
405414static TMS9902_RST_CALLBACK( rts_callback )
406415{
407416   rs232_rts = RTS;
r6729r6730
752761   MDRV_CPU_PROGRAM_MAP(tm990_189_memmap)
753762   MDRV_CPU_IO_MAP(tm990_189_cru_map)
754763
764   MDRV_MACHINE_START( tm990_189 )
755765   MDRV_MACHINE_RESET( tm990_189 )
756766
757767   /* video hardware - we emulate a 8-segment LED display */
r6729r6730
785795   MDRV_TMS9901_ADD("tms9901_1", sys9901reset_param)
786796   /* tms9902 */
787797   MDRV_TMS9902_ADD("tms9902", tms9902_params)
798   
799   MDRV_TM990_189_RS232_ADD("rs232")
788800MACHINE_DRIVER_END
789801
790802#define LEFT_BORDER      15
r6729r6730
829841   MDRV_TMS9901_ADD("tms9901_1", sys9901reset_param)
830842   /* tms9902 */
831843   MDRV_TMS9902_ADD("tms9902", tms9902_params)
844   
845   MDRV_TM990_189_RS232_ADD("rs232")
832846MACHINE_DRIVER_END
833847
834848
r6729r6730
955969   PORT_BIT( 0x3ff, 0x1aa,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0xd2,0x282 ) PORT_PLAYER(2) PORT_REVERSE
956970INPUT_PORTS_END
957971
958static void tm990_189_serial_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
959{
960   /* serial */
961   switch(state)
962   {
963      /* --- the following bits of info are returned as 64-bit signed integers --- */
964      case MESS_DEVINFO_INT_TYPE:                     info->i = IO_SERIAL; break;
965      case MESS_DEVINFO_INT_READABLE:                  info->i = 1; break;
966      case MESS_DEVINFO_INT_WRITEABLE:                  info->i = 1; break;
967      case MESS_DEVINFO_INT_CREATABLE:                  info->i = 1; break;
968      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
969
970      /* --- the following bits of info are returned as pointers to data or functions --- */
971      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(tm990_189_rs232); break;
972      case MESS_DEVINFO_PTR_UNLOAD:                  info->unload = DEVICE_IMAGE_UNLOAD_NAME(tm990_189_rs232); break;
973
974      /* --- the following bits of info are returned as NULL-terminated strings --- */
975      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), ""); break;
976   }
977}
978
979static SYSTEM_CONFIG_START(tm990_189)
980   /* a tape interface and a rs232 interface... */
981   CONFIG_DEVICE(tm990_189_serial_getinfo)
982SYSTEM_CONFIG_END
983
984972/*    YEAR  NAME      PARENT    COMPAT  MACHINE     INPUT       INIT    CONFIG      COMPANY                 FULLNAME */
985COMP( 1978,   990189,     0,      0,      tm990_189,   tm990_189,   0,      tm990_189,   "Texas Instruments",   "TM 990/189 University Board microcomputer with University Basic" , 0)
986COMP( 1980,   990189v,  990189,   0,      tm990_189_v,tm990_189,   0,      tm990_189,   "Texas Instruments",   "TM 990/189 University Board microcomputer with University Basic and Video Board Interface" , 0)
973COMP( 1978,   990189,     0,      0,      tm990_189,   tm990_189,   0,      0,         "Texas Instruments",   "TM 990/189 University Board microcomputer with University Basic" , 0)
974COMP( 1980,   990189v,  990189,   0,      tm990_189_v,tm990_189,   0,      0,         "Texas Instruments",   "TM 990/189 University Board microcomputer with University Basic and Video Board Interface" , 0)
src/mess/drivers/thomson.c
r6729r6730
594594   DO_NOT_KEEP_GEOMETRY
595595};
596596
597/* ------------ config ------------ */
598/*
599static SYSTEM_CONFIG_START ( to )
600     CONFIG_DEVICE ( thom_serial_getinfo )
601SYSTEM_CONFIG_END
602*/
603
604597/* ------------ driver ------------ */
605598
606599static MACHINE_DRIVER_START ( to7 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team