Previous 15994 Revisions Next

r4552 Friday 24th April, 2009 at 10:57:20 UTC by Nathan Woods
Eliminated last use of DEVINFO_FCT_SET_INFO
[src/mess/devices]coco_fdc.c coco_pak.c cococart.c cococart.h
[src/mess/machine]coco.c

src/mess/machine/coco.c
r4551r4552
13201320      break;
13211321   }
13221322
1323   device_set_info_int(
1323   coco_cartridge_set_line(
13241324      cococart_device(machine),
1325      COCOCARTINFO_INT_LINE_SOUND_ENABLE,
1325      COCOCART_LINE_SOUND_ENABLE,
13261326      (soundmux_status == (SOUNDMUX_STATUS_ENABLE|SOUNDMUX_STATUS_SEL2)
13271327         ? COCOCART_LINE_VALUE_ASSERT : COCOCART_LINE_VALUE_CLEAR));
13281328
src/mess/devices/cococart.h
r4551r4552
3030
3131enum
3232{
33   /* output lines on the CoCo cartridge slot */
34   COCOCARTINFO_INT_LINE_CART   = DEVINFO_INT_DEVICE_SPECIFIC,   /* connects to PIA1 CB1 */
35   COCOCARTINFO_INT_LINE_NMI,                           /* connects to NMI line on CPU */
36   COCOCARTINFO_INT_LINE_HALT,                           /* connects to HALT line on CPU */
37   COCOCARTINFO_INT_LINE_SOUND_ENABLE,                     /* sound enable */
38
3933   COCOCARTINFO_FCT_FF40_R = DEVINFO_FCT_DEVICE_SPECIFIC,      /* read8_device_handler */
4034   COCOCARTINFO_FCT_FF40_W,                           /* write8_device_handler */
4135};
r4551r4552
4438    TYPE DEFINITIONS
4539***************************************************************************/
4640
41/* output lines on the CoCo cartridge slot */
42enum _cococart_line
43{
44   COCOCART_LINE_CART,            /* connects to PIA1 CB1 */
45   COCOCART_LINE_NMI,            /* connects to NMI line on CPU */
46   COCOCART_LINE_HALT,            /* connects to HALT line on CPU */
47   COCOCART_LINE_SOUND_ENABLE      /* sound enable */
48};
49typedef enum _cococart_line cococart_line;
50
4751/* since we have a special value "Q" - we have to use a special enum here */
4852enum _cococart_line_value
4953{
r4551r4552
8387DEVICE_GET_INFO(coco_cartridge_pcb_rs232);
8488DEVICE_GET_INFO(coco_cartridge_pcb_speechsound);
8589
90/* sets a cartridge line */
91void coco_cartridge_set_line(const device_config *device, cococart_line line, cococart_line_value value);
92
8693/* hack to support twiddling the Q line */
8794void coco_cartridge_twiddle_q_lines(const device_config *device);
8895
src/mess/devices/coco_pak.c
r4551r4552
6767      : COCOCART_LINE_VALUE_CLEAR;
6868
6969   /* normal CoCo PAKs tie their CART line to Q - the system clock */
70   device_set_info_int(
70   coco_cartridge_set_line(
7171      pak_pcb->cococart,
72      COCOCARTINFO_INT_LINE_CART,
72      COCOCART_LINE_CART,
7373      cart_line);
7474}
7575
src/mess/devices/coco_fdc.c
r4551r4552
301301      fdc->dskreg &= ~0x80;   /* clear halt enable */
302302
303303   /* set the NMI line */
304   device_set_info_int(
304   coco_cartridge_set_line(
305305      fdc->cococart,
306      COCOCARTINFO_INT_LINE_NMI,
306      COCOCART_LINE_NMI,
307307      ((fdc->intrq != 0) && (fdc->dskreg & 0x20)) ? COCOCART_LINE_VALUE_ASSERT : COCOCART_LINE_VALUE_CLEAR);
308308
309309   /* set the HALT line */
310   device_set_info_int(
310   coco_cartridge_set_line(
311311      fdc->cococart,
312      COCOCARTINFO_INT_LINE_HALT,
312      COCOCART_LINE_HALT,
313313      ((fdc->drq == 0) && (fdc->dskreg & 0x80)) ? COCOCART_LINE_VALUE_ASSERT : COCOCART_LINE_VALUE_CLEAR);
314314}
315315
r4551r4552
508508   fdc_t *fdc = get_token(device);
509509
510510   /* set the NMI line */
511   device_set_info_int(
511   coco_cartridge_set_line(
512512      fdc->cococart,
513      COCOCARTINFO_INT_LINE_NMI,
513      COCOCART_LINE_NMI,
514514      ((fdc->intrq != 0) && (fdc->dskreg & 0x20)) ? COCOCART_LINE_VALUE_ASSERT : COCOCART_LINE_VALUE_CLEAR);
515515
516516   /* set the CART line */
517   device_set_info_int(
517   coco_cartridge_set_line(
518518      fdc->cococart,
519      COCOCARTINFO_INT_LINE_CART,
519      COCOCART_LINE_CART,
520520      (fdc->drq != 0) ? COCOCART_LINE_VALUE_ASSERT : COCOCART_LINE_VALUE_CLEAR);
521521}
522522
src/mess/devices/cococart.c
r4551r4552
291291
292292
293293/*-------------------------------------------------
294    DEVICE_SET_INFO(general_cartridge)
294    coco_cartridge_set_line
295295-------------------------------------------------*/
296296
297static DEVICE_SET_INFO(general_cartridge)
297void coco_cartridge_set_line(const device_config *device, cococart_line line, cococart_line_value value)
298298{
299   switch (state)
299   switch (line)
300300   {
301      /* --- the following bits of info are set as 64-bit signed integers --- */
302      case COCOCARTINFO_INT_LINE_CART:
303         set_line_timer(device, &get_token(device)->cart_line, (cococart_line_value) info->i);
301      case COCOCART_LINE_CART:
302         set_line_timer(device, &get_token(device)->cart_line, value);
304303         break;
305304
306      case COCOCARTINFO_INT_LINE_NMI:
307         set_line_timer(device, &get_token(device)->nmi_line, (cococart_line_value) info->i);
305      case COCOCART_LINE_NMI:
306         set_line_timer(device, &get_token(device)->nmi_line, value);
308307         break;
309308
310      case COCOCARTINFO_INT_LINE_HALT:
311         set_line_timer(device, &get_token(device)->halt_line, (cococart_line_value) info->i);
309      case COCOCART_LINE_HALT:
310         set_line_timer(device, &get_token(device)->halt_line, value);
312311         break;
312
313      case COCOCART_LINE_SOUND_ENABLE:
314         /* do nothing for now */
315         break;
313316   }
314317}
315318
r4551r4552
328331      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
329332
330333      /* --- the following bits of info are returned as pointers to functions --- */
331      case DEVINFO_FCT_SET_INFO:                  info->set_info = DEVICE_SET_INFO_NAME(general_cartridge); break;
332334      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(coco_cartridge);   break;
333335      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
334336      case DEVINFO_FCT_RESET:                     /* Nothing */                        break;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team