Previous 15994 Revisions Next

r6456 Wednesday 25th November, 2009 at 12:06:02 UTC by Curt Coder
[ABC80x] Removed device type parameter from ABC-bus configuration, added pull interface for ABC77 TxD.
[src/mess/drivers]abc80.c abc80x.c
[src/mess/includes]abc80x.h
[src/mess/machine]abc77.c abc77.h abcbus.c abcbus.h

src/mess/includes/abc80x.h
r6455r6456
4242   /* cpu state */
4343   int fetch_charram;         /* opcode fetched from character RAM region (0x7800-0x7fff) */
4444
45   /* keyboard state */
46   int abc77_txd;            /* ABC-77 transmit data */
47
4845   /* video state */
4946   UINT8 *charram;            /* character RAM */
5047   UINT8 *videoram;         /* HR video RAM */
r6455r6456
7168   /* cpu state */
7269   int lrs;            /* low RAM select */
7370
74   /* keyboard state */
75   int abc77_txd;         /* ABC-77 transmit data */
76
7771   /* video state */
7872   UINT8 *charram;         /* character RAM */
7973   const UINT8 *char_rom;   /* character generator ROM */
r6455r6456
9791typedef struct _abc806_state abc806_state;
9892struct _abc806_state
9993{
100   /* keyboard state */
101   int abc77_txd;         /* ABC-77 transmit data */
102
10394   /* memory state */
10495   int keydtr;            /* keyboard DTR */
10596   int eme;            /* extended memory enable */
src/mess/machine/abcbus.c
r6455r6456
2020   abcbus_daisy_state **tailptr = &head;
2121
2222   /* create a linked list of devices */
23   for ( ; daisy->devtype != NULL; daisy++)
23   for ( ; daisy->tag != NULL; daisy++)
2424   {
2525      *tailptr = auto_alloc(machine, abcbus_daisy_state);
2626      (*tailptr)->next = NULL;
27      (*tailptr)->device = devtag_get_device(machine, device_inherit_tag(tempstring, cputag, daisy->devname));
27      (*tailptr)->device = devtag_get_device(machine, device_inherit_tag(tempstring, cputag, daisy->tag));
2828      if ((*tailptr)->device == NULL)
2929      {
3030         astring_free(tempstring);
31         fatalerror("Unable to locate device '%s'", daisy->devname);
31         fatalerror("Unable to locate device '%s'", daisy->tag);
3232      }
3333      (*tailptr)->card_select = (abcbus_card_select)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_ABCBUS_CARD_SELECT);
3434      tailptr = &(*tailptr)->next;
src/mess/machine/abcbus.h
r6455r6456
108108typedef struct _abcbus_daisy_chain abcbus_daisy_chain;
109109struct _abcbus_daisy_chain
110110{
111   device_type      devtype;   /* type of device */
112   const char      *devname;   /* name of the device */
111   const char      *tag;   /* device tag */
113112};
114113#define ABCBUS_CONFIG(name) const abcbus_daisy_chain (name)[] =
115114
src/mess/machine/abc77.c
r6455r6456
2222
2323   const device_config *cpu;      /* CPU of the 8035 */
2424
25   int txd;                  /* transmit data */
2526   int keylatch;               /* keyboard row latch */
2627   int clock;                  /* transmit clock */
2728   int hys;                  /* hysteresis */
r6455r6456
144145
145146   /* transmit data */
146147   devcb_call_write_line(&abc77->out_txd_func, BIT(data, 5));
148   abc77->txd = BIT(data, 5);
147149
148150   /* key down */
149151   devcb_call_write_line(&abc77->out_keydown_func, BIT(data, 6));
r6455r6456
352354    abc77_rxd_w - keyboard serial data in
353355-------------------------------------------------*/
354356
355void abc77_rxd_w(const device_config *device, int level)
357WRITE_LINE_DEVICE_HANDLER( abc77_rxd_w )
356358{
357359   abc77_t *abc77 = get_safe_token(device);
358360
359   cpu_set_input_line(abc77->cpu, MCS48_INPUT_IRQ, level ? CLEAR_LINE : ASSERT_LINE);
361   cpu_set_input_line(abc77->cpu, MCS48_INPUT_IRQ, state ? CLEAR_LINE : ASSERT_LINE);
360362}
361363
362364/*-------------------------------------------------
365    abc77_txd_r - keyboard serial data out
366-------------------------------------------------*/
367
368READ_LINE_DEVICE_HANDLER( abc77_txd_r )
369{
370   abc77_t *abc77 = get_safe_token(device);
371
372   return abc77->txd;
373}
374
375/*-------------------------------------------------
363376    abc77_reset_w - keyboard reset
364377-------------------------------------------------*/
365378
366void abc77_reset_w(const device_config *device, int level)
379WRITE_LINE_DEVICE_HANDLER( abc77_reset_w )
367380{
368381   abc77_t *abc77 = get_safe_token(device);
369382
370   if (abc77->reset && !level)
383   if (abc77->reset && !state)
371384   {
372385      int t = 1.1 * RES_K(100) * CAP_N(100) * 1000; // t = 1.1 * R1 * C1
373386      int ea = BIT(input_port_read(device->machine, "ABC77_DSW"), 7);
r6455r6456
379392      cpu_set_input_line(abc77->cpu, MCS48_INPUT_EA, ea ? CLEAR_LINE : ASSERT_LINE);
380393   }
381394
382   abc77->reset = level;
395   abc77->reset = state;
383396}
384397
385398/*-------------------------------------------------
r6455r6456
410423   state_save_register_device_item(device, 0, abc77->keylatch);
411424   state_save_register_device_item(device, 0, abc77->clock);
412425   state_save_register_device_item(device, 0, abc77->hys);
426   state_save_register_device_item(device, 0, abc77->txd);
413427   state_save_register_device_item(device, 0, abc77->reset);
414428}
415429
r6455r6456
428442
429443      /* --- the following bits of info are returned as pointers --- */
430444      case DEVINFO_PTR_ROM_REGION:               info->romregion = rom_abc77;            break;
431      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_DRIVER_NAME( abc77 ); break;
445      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_DRIVER_NAME(abc77); break;
432446
433447      /* --- the following bits of info are returned as pointers to data or functions --- */
434448      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(abc77);      break;
src/mess/machine/abc77.h
r6455r6456
6262INPUT_PORTS_EXTERN( abc77 );
6363
6464/* receive data */
65void abc77_rxd_w(const device_config *device, int state);
65WRITE_LINE_DEVICE_HANDLER( abc77_rxd_w );
6666
67/* transmit data */
68READ_LINE_DEVICE_HANDLER( abc77_txd_r );
69
6770/* reset */
68void abc77_reset_w(const device_config *device, int state);
71WRITE_LINE_DEVICE_HANDLER( abc77_reset_w );
6972
7073#endif
src/mess/drivers/abc80.c
r6455r6456
466466
467467static ABCBUS_CONFIG( abcbus_config )
468468{
469   { LUXOR_55_10828, CONKORT_TAG },
469   { CONKORT_TAG },
470470   { NULL }
471471};
472472
src/mess/drivers/abc80x.c
r6455r6456
715715
716716/* ABC 77 */
717717
718static WRITE_LINE_DEVICE_HANDLER( abc800_abc77_txd_w )
719{
720   abc800_state *driver_state = device->machine->driver_data;
721
722   driver_state->abc77_txd = state;
723}
724
725718static ABC77_INTERFACE( abc800_abc77_intf )
726719{
727   DEVCB_LINE(abc800_abc77_txd_w),
720   DEVCB_NULL,
728721   DEVCB_DEVICE_LINE(Z80DART_TAG, z80dart_rxtxcb_w),
729722   DEVCB_DEVICE_LINE(Z80DART_TAG, z80dart_dcdb_w)
730723};
731724
732static WRITE_LINE_DEVICE_HANDLER( abc802_abc77_txd_w )
733{
734   abc802_state *driver_state = device->machine->driver_data;
735
736   driver_state->abc77_txd = state;
737}
738
739static ABC77_INTERFACE( abc802_abc77_intf )
740{
741   DEVCB_LINE(abc802_abc77_txd_w),
742   DEVCB_DEVICE_LINE(Z80DART_TAG, z80dart_rxtxcb_w),
743   DEVCB_DEVICE_LINE(Z80DART_TAG, z80dart_dcdb_w)
744};
745
746static WRITE_LINE_DEVICE_HANDLER( abc806_abc77_txd_w )
747{
748   abc806_state *driver_state = device->machine->driver_data;
749
750   driver_state->abc77_txd = state;
751}
752
753static ABC77_INTERFACE( abc806_abc77_intf )
754{
755   DEVCB_LINE(abc806_abc77_txd_w),
756   DEVCB_DEVICE_LINE(Z80DART_TAG, z80dart_rxtxcb_w),
757   DEVCB_DEVICE_LINE(Z80DART_TAG, z80dart_dcdb_w)
758};
759
760725/* Z80 CTC */
761726
762727static TIMER_DEVICE_CALLBACK( ctc_tick )
r6455r6456
879844
880845/* Z80 DART */
881846
882static READ_LINE_DEVICE_HANDLER( abc800_dart_rxdb_r )
883{
884   abc800_state *state = device->machine->driver_data;
885
886   /* receive bit from keyboard */
887   return state->abc77_txd;
888}
889
890847static Z80DART_INTERFACE( abc800_dart_intf )
891848{
892849   0,
r6455r6456
899856   DEVCB_NULL,
900857   DEVCB_NULL,
901858
902   DEVCB_LINE(abc800_dart_rxdb_r),
859   DEVCB_NULL, /* DEVCB_DEVICE_LINE(ABC77_TAG, abc77_txd_r), */
903860   DEVCB_NULL, /* DEVCB_DEVICE_LINE(ABC77_TAG, abc77_rxd_w), */
904861   DEVCB_NULL,
905862   DEVCB_NULL,
r6455r6456
908865   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0)
909866};
910867
911static READ_LINE_DEVICE_HANDLER( abc802_dart_rxdb_r )
912{
913   abc802_state *state = device->machine->driver_data;
914
915   /* receive bit from keyboard */
916   return state->abc77_txd;
917}
918
919868static WRITE_LINE_DEVICE_HANDLER( abc802_dart_dtrb_r )
920869{
921870   abc802_state *driver_state = device->machine->driver_data;
r6455r6456
946895   DEVCB_NULL,
947896   DEVCB_NULL,
948897
949   DEVCB_LINE(abc802_dart_rxdb_r),
898   DEVCB_NULL, /* DEVCB_DEVICE_LINE(ABC77_TAG, abc77_txd_r), */
950899   DEVCB_NULL, /* DEVCB_DEVICE_LINE(ABC77_TAG, abc77_rxd_w), */
951900   DEVCB_LINE(abc802_dart_dtrb_r),
952901   DEVCB_LINE(abc802_dart_rtsb_r),
r6455r6456
955904   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0)
956905};
957906
958static READ_LINE_DEVICE_HANDLER( abc806_dart_rxdb_r )
959{
960   abc806_state *state = device->machine->driver_data;
961
962   /* receive bit from keyboard */
963   return state->abc77_txd;
964}
965
966907static WRITE_LINE_DEVICE_HANDLER( abc806_dart_dtrb_w )
967908{
968909   abc806_state *driver_state = device->machine->driver_data;
r6455r6456
984925   DEVCB_NULL,
985926   DEVCB_NULL,
986927
987   DEVCB_LINE(abc806_dart_rxdb_r),
928   DEVCB_NULL, /* DEVCB_DEVICE_LINE(ABC77_TAG, abc77_txd_r), */
988929   DEVCB_NULL, /* DEVCB_DEVICE_LINE(ABC77_TAG, abc77_rxd_w), */
989930   DEVCB_LINE(abc806_dart_dtrb_w),
990931   DEVCB_NULL,
r6455r6456
1007948
1008949static ABCBUS_CONFIG( abcbus_config )
1009950{
1010   { LUXOR_55_21046, CONKORT_TAG },
951   { CONKORT_TAG },
1011952   { NULL }
1012953};
1013954
1014955static ABCBUS_CONFIG( abc802_abcbus_config )
1015956{
1016//  { LUXOR_55_21046, CONKORT_TAG }, won't boot with this enabled
957//  { CONKORT_TAG }, won't boot with this enabled
1017958   { NULL }
1018959};
1019960
r6455r6456
1041982
1042983   /* register for state saving */
1043984   state_save_register_global(machine, state->fetch_charram);
1044   state_save_register_global(machine, state->abc77_txd);
1045985   state_save_register_global(machine, state->pling);
1046986}
1047987
r6455r6456
10711011
10721012   /* register for state saving */
10731013   state_save_register_global(machine, state->lrs);
1074   state_save_register_global(machine, state->abc77_txd);
10751014   state_save_register_global(machine, state->pling);
10761015}
10771016
r6455r6456
11271066   }
11281067
11291068   /* register for state saving */
1130   state_save_register_global(machine, state->abc77_txd);
11311069   state_save_register_global(machine, state->keydtr);
11321070   state_save_register_global(machine, state->eme);
11331071   state_save_register_global(machine, state->fetch_charram);
r6455r6456
12881226   MDRV_TIMER_ADD_PERIODIC("ctc", ctc_tick, HZ(ABC800_X01/2/2/2))
12891227   MDRV_Z80SIO_ADD(Z80SIO_TAG, ABC800_X01/2/2, sio_intf)
12901228   MDRV_Z80DART_ADD(Z80DART_TAG, ABC800_X01/2/2, abc802_dart_intf)
1291//  MDRV_ABC77_ADD(abc802_abc77_intf)
1229//  MDRV_ABC77_ADD(abc800_abc77_intf)
12921230   MDRV_LUXOR_55_21046_ADD
12931231   MDRV_PRINTER_ADD("printer")
12941232   MDRV_CASSETTE_ADD( "cassette", default_cassette_config )
r6455r6456
13271265   MDRV_TIMER_ADD_PERIODIC("ctc", ctc_tick, HZ(ABC800_X01/2/2/2))
13281266   MDRV_Z80SIO_ADD(Z80SIO_TAG, ABC800_X01/2/2, sio_intf)
13291267   MDRV_Z80DART_ADD(Z80DART_TAG, ABC800_X01/2/2, abc806_dart_intf)
1330//  MDRV_ABC77_ADD(abc806_abc77_intf)
1268//  MDRV_ABC77_ADD(abc800_abc77_intf)
13311269   MDRV_LUXOR_55_21046_ADD
13321270   MDRV_PRINTER_ADD("printer")
13331271   MDRV_CASSETTE_ADD( "cassette", default_cassette_config )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team