Previous 15994 Revisions Next

r4070 Monday 5th January, 2009 at 15:41:25 UTC by Miodrag Milanović
[TI99] Converted to new cart device
[src/mess/drivers]ti99_4x.c ti99_8.c
[src/mess/machine]ti99_4x.c

src/mess/machine/ti99_4x.c
r4069r4070
375375
376376DEVICE_START( ti99_cart )
377377{
378   int id = image_index_in_device(device);
378   int id = 0;
379   if (strcmp(device->tag,"cart1")==0) {
380      id = 0;
381   }
382   if (strcmp(device->tag,"cart2")==0) {
383      id = 1;
384   }
385   if (strcmp(device->tag,"cart3")==0) {
386      id = 2;
387   }
388   
379389   cartridge_pages[id] = (UINT16 *) (memory_region(device->machine, "main") + offset_cart + (id * 0x2000));
380390   return DEVICE_START_OK;
381391}
r4069r4070
397407   /* Original idea by Norberto Bensa */
398408   const char *name = image_filename(image);
399409   const char *ch, *ch2;
400   int id = image_index_in_device(image);
410   int id = 0;
401411   int i;
402   slot_type_t type = (slot_type_t) id;
412   slot_type_t type;
413   
414   if (strcmp(image->tag,"cart1")==0) {
415      id = 0;
416   }
417   if (strcmp(image->tag,"cart2")==0) {
418      id = 1;
419   }
420   if (strcmp(image->tag,"cart3")==0) {
421      id = 2;
422   }   
423   type = (slot_type_t) id;
403424
404425   /* There is a circuitry in TI99/4(a) that resets the console when a
405426   cartridge is inserted or removed.  We emulate this instead of resetting the
r4069r4070
518539DEVICE_IMAGE_UNLOAD( ti99_cart )
519540{
520541   int i;
521   int id = image_index_in_device(image);
522
542   int id = 0;
543   if (strcmp(image->tag,"cart1")==0) {
544      id = 0;
545   }
546   if (strcmp(image->tag,"cart2")==0) {
547      id = 1;
548   }
549   if (strcmp(image->tag,"cart3")==0) {
550      id = 2;
551   }     
523552   /* There is a circuitry in TI99/4(a) that resets the console when a
524553   cartridge is inserted or removed.  We emulate this instead of resetting the
525554   emulator (which is the default in MESS). */
src/mess/drivers/ti99_8.c
r4069r4070
158158#include "cpu/tms9900/tms9900.h"
159159#include "devices/mflopimg.h"
160160#include "devices/cassette.h"
161#include "devices/cartslot.h"
161162#include "machine/smartmed.h"
162163#include "sound/5220intf.h"
163164#include "devices/harddriv.h"
r4069r4070
397398   1            /* MP9537 mask */
398399};
399400
401MACHINE_DRIVER_START(ti99_8_cartslot)
402    MDRV_CARTSLOT_ADD("cart1")
403   MDRV_CARTSLOT_EXTENSION_LIST("bin,c,d,g,m,crom,drom,grom,mrom")
404   MDRV_CARTSLOT_NOT_MANDATORY
405   MDRV_CARTSLOT_START(ti99_cart)
406   MDRV_CARTSLOT_LOAD(ti99_cart)
407   MDRV_CARTSLOT_UNLOAD(ti99_cart)
408
409    MDRV_CARTSLOT_ADD("cart2")
410   MDRV_CARTSLOT_EXTENSION_LIST("bin,c,d,g,m,crom,drom,grom,mrom")
411   MDRV_CARTSLOT_NOT_MANDATORY
412   MDRV_CARTSLOT_START(ti99_cart)
413   MDRV_CARTSLOT_LOAD(ti99_cart)
414   MDRV_CARTSLOT_UNLOAD(ti99_cart)
415
416    MDRV_CARTSLOT_ADD("cart3")
417   MDRV_CARTSLOT_EXTENSION_LIST("bin,c,d,g,m,crom,drom,grom,mrom")
418   MDRV_CARTSLOT_NOT_MANDATORY
419   MDRV_CARTSLOT_START(ti99_cart)
420   MDRV_CARTSLOT_LOAD(ti99_cart)
421   MDRV_CARTSLOT_UNLOAD(ti99_cart)
422MACHINE_DRIVER_END
423   
400424static MACHINE_DRIVER_START(ti99_8_60hz)
401425   /* basic machine hardware */
402426   /* TMS9995-MP9537 CPU @ 10.7 MHz */
r4069r4070
438462   
439463   /* tms9901 */
440464   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_8)   
465   
466   MDRV_IMPORT_FROM(ti99_8_cartslot)
441467MACHINE_DRIVER_END
442468
443469
r4069r4070
482508
483509   /* tms9901 */
484510   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_8)   
511   
512   MDRV_IMPORT_FROM(ti99_8_cartslot)
485513MACHINE_DRIVER_END
486514
487515/*
r4069r4070
517545
518546#define rom_ti99_8e rom_ti99_8
519547
520static void ti99_8_cartslot_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
521{
522   /* cartslot */
523   switch(state)
524   {
525      /* --- the following bits of info are returned as 64-bit signed integers --- */
526      case MESS_DEVINFO_INT_TYPE:                     info->i = IO_CARTSLOT; break;
527      case MESS_DEVINFO_INT_READABLE:                  info->i = 1; break;
528      case MESS_DEVINFO_INT_WRITEABLE:                  info->i = 0; break;
529      case MESS_DEVINFO_INT_CREATABLE:                  info->i = 0; break;
530      case MESS_DEVINFO_INT_COUNT:                     info->i = 3; break;
531
532      /* --- the following bits of info are returned as pointers to data or functions --- */
533      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(ti99_cart); break;
534      case MESS_DEVINFO_PTR_UNLOAD:                  info->unload = DEVICE_IMAGE_UNLOAD_NAME(ti99_cart); break;
535
536      /* --- the following bits of info are returned as NULL-terminated strings --- */
537      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "bin,c,d,g,m,crom,drom,grom,mrom"); break;
538   }
539}
540
541548static void ti99_8_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
542549{
543550   /* floppy */
r4069r4070
622629   /* one cassette unit port */
623630   /* Hex-bus disk controller: supports up to 4 floppy disk drives */
624631   /* expansion port (similar to 99/4(a) - yet slightly different) */
625
626   CONFIG_DEVICE(ti99_8_cartslot_getinfo)
627#if 1
628632   CONFIG_DEVICE(ti99_8_floppy_getinfo)
629633   CONFIG_DEVICE(ti99_8_parallel_getinfo)
630634   CONFIG_DEVICE(ti99_8_serial_getinfo)
631635   /*CONFIG_DEVICE(ti99_8_quickload_getinfo)*/
632636   CONFIG_DEVICE(ti99_8_memcard_getinfo)
633#endif
634
635637SYSTEM_CONFIG_END
636638
637639/*      YEAR    NAME        PARENT      COMPAT  MACHINE     INPUT   INIT        CONFIG      COMPANY                 FULLNAME */
src/mess/drivers/ti99_4x.c
r4069r4070
3434#include "devices/mflopimg.h"
3535#include "devices/harddriv.h"
3636#include "devices/cassette.h"
37#include "devices/cartslot.h"
3738#include "machine/smartmed.h"
3839#include "sound/5220intf.h"
3940#include "machine/idectrl.h"
r4069r4070
507508   0   /*  first day of week */
508509};
509510
511MACHINE_DRIVER_START(ti99_4_cartslot)
512    MDRV_CARTSLOT_ADD("cart1")
513   MDRV_CARTSLOT_EXTENSION_LIST("bin,c,d,g,m,crom,drom,grom,mrom")
514   MDRV_CARTSLOT_NOT_MANDATORY
515   MDRV_CARTSLOT_START(ti99_cart)
516   MDRV_CARTSLOT_LOAD(ti99_cart)
517   MDRV_CARTSLOT_UNLOAD(ti99_cart)
518
519    MDRV_CARTSLOT_ADD("cart2")
520   MDRV_CARTSLOT_EXTENSION_LIST("bin,c,d,g,m,crom,drom,grom,mrom")
521   MDRV_CARTSLOT_NOT_MANDATORY
522   MDRV_CARTSLOT_START(ti99_cart)
523   MDRV_CARTSLOT_LOAD(ti99_cart)
524   MDRV_CARTSLOT_UNLOAD(ti99_cart)
525
526    MDRV_CARTSLOT_ADD("cart3")
527   MDRV_CARTSLOT_EXTENSION_LIST("bin,c,d,g,m,crom,drom,grom,mrom")
528   MDRV_CARTSLOT_NOT_MANDATORY
529   MDRV_CARTSLOT_START(ti99_cart)
530   MDRV_CARTSLOT_LOAD(ti99_cart)
531   MDRV_CARTSLOT_UNLOAD(ti99_cart)
532MACHINE_DRIVER_END
533
510534static MACHINE_DRIVER_START(ti99_4_60hz)
511535   /* basic machine hardware */
512536   /* TMS9900 CPU @ 3.0 MHz */
r4069r4070
555579   MDRV_TMS9902_ADD("tms9902_1", tms9902_params_1)     
556580   
557581   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )
582   
583   MDRV_IMPORT_FROM(ti99_4_cartslot)
558584MACHINE_DRIVER_END
559585
560586static MACHINE_DRIVER_START(ti99_4_50hz)
r4069r4070
603629   MDRV_TMS9902_ADD("tms9902_1", tms9902_params_1)     
604630   
605631   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )
632   
633   MDRV_IMPORT_FROM(ti99_4_cartslot)
606634MACHINE_DRIVER_END
607635
608636static MACHINE_DRIVER_START(ti99_4a_60hz)
r4069r4070
652680   MDRV_TMS9902_ADD("tms9902_1", tms9902_params_1)     
653681   
654682   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )   
683   
684   MDRV_IMPORT_FROM(ti99_4_cartslot)
655685MACHINE_DRIVER_END
656686
657687
r4069r4070
701731   MDRV_TMS9902_ADD("tms9902_1", tms9902_params_1)   
702732   
703733   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )
734   
735   MDRV_IMPORT_FROM(ti99_4_cartslot)
704736MACHINE_DRIVER_END
705737
706738
r4069r4070
757789   MDRV_TMS9902_ADD("tms9902_0", tms9902_params_0)
758790   MDRV_TMS9902_ADD("tms9902_1", tms9902_params_1)
759791   
760   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )     
792   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )   
793   
794   MDRV_IMPORT_FROM(ti99_4_cartslot)   
761795MACHINE_DRIVER_END
762796
763797
r4069r4070
862896 * and you could plug quite a lot of GROMs in the side port.  Neither of these
863897 * are emulated.
864898 */
865
866static void ti99_4_cartslot_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
867{
868   /* cartslot */
869   switch(state)
870   {
871      /* --- the following bits of info are returned as 64-bit signed integers --- */
872      case MESS_DEVINFO_INT_TYPE:                     info->i = IO_CARTSLOT; break;
873      case MESS_DEVINFO_INT_READABLE:                  info->i = 1; break;
874      case MESS_DEVINFO_INT_WRITEABLE:                  info->i = 0; break;
875      case MESS_DEVINFO_INT_CREATABLE:                  info->i = 0; break;
876      case MESS_DEVINFO_INT_COUNT:                     info->i = 3; break;
877
878      /* --- the following bits of info are returned as pointers to data or functions --- */
879      case MESS_DEVINFO_PTR_START:                     info->start = DEVICE_START_NAME(ti99_cart); break;
880      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(ti99_cart); break;
881      case MESS_DEVINFO_PTR_UNLOAD:                  info->unload = DEVICE_IMAGE_UNLOAD_NAME(ti99_cart); break;
882
883      /* --- the following bits of info are returned as NULL-terminated strings --- */
884      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "bin,c,d,g,m,crom,drom,grom,mrom"); break;
885   }
886}
887
899   
888900static void ti99_4_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
889901{
890902   /* floppy */
r4069r4070
985997      /* --- the following bits of info are returned as NULL-terminated strings --- */
986998      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), ""); break;
987999   }
988}
989
990static SYSTEM_CONFIG_START(ti99_4)
991   CONFIG_DEVICE(ti99_4_cartslot_getinfo)
1000}     
1001   
1002static SYSTEM_CONFIG_START(ti99_4)   
9921003   CONFIG_DEVICE(ti99_4_floppy_getinfo)
9931004   CONFIG_DEVICE(ti99_4_parallel_getinfo)
9941005   CONFIG_DEVICE(ti99_4_serial_getinfo)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team