src/mess/devices/cococart.h
| r4551 | r4552 | |
| 30 | 30 | |
| 31 | 31 | enum |
| 32 | 32 | { |
| 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 | | |
| 39 | 33 | COCOCARTINFO_FCT_FF40_R = DEVINFO_FCT_DEVICE_SPECIFIC, /* read8_device_handler */ |
| 40 | 34 | COCOCARTINFO_FCT_FF40_W, /* write8_device_handler */ |
| 41 | 35 | }; |
| r4551 | r4552 | |
| 44 | 38 | TYPE DEFINITIONS |
| 45 | 39 | ***************************************************************************/ |
| 46 | 40 | |
| 41 | /* output lines on the CoCo cartridge slot */ |
| 42 | enum _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 | }; |
| 49 | typedef enum _cococart_line cococart_line; |
| 50 | |
| 47 | 51 | /* since we have a special value "Q" - we have to use a special enum here */ |
| 48 | 52 | enum _cococart_line_value |
| 49 | 53 | { |
| r4551 | r4552 | |
| 83 | 87 | DEVICE_GET_INFO(coco_cartridge_pcb_rs232); |
| 84 | 88 | DEVICE_GET_INFO(coco_cartridge_pcb_speechsound); |
| 85 | 89 | |
| 90 | /* sets a cartridge line */ |
| 91 | void coco_cartridge_set_line(const device_config *device, cococart_line line, cococart_line_value value); |
| 92 | |
| 86 | 93 | /* hack to support twiddling the Q line */ |
| 87 | 94 | void coco_cartridge_twiddle_q_lines(const device_config *device); |
| 88 | 95 | |
src/mess/devices/coco_fdc.c
| r4551 | r4552 | |
| 301 | 301 | fdc->dskreg &= ~0x80; /* clear halt enable */ |
| 302 | 302 | |
| 303 | 303 | /* set the NMI line */ |
| 304 | | device_set_info_int( |
| 304 | coco_cartridge_set_line( |
| 305 | 305 | fdc->cococart, |
| 306 | | COCOCARTINFO_INT_LINE_NMI, |
| 306 | COCOCART_LINE_NMI, |
| 307 | 307 | ((fdc->intrq != 0) && (fdc->dskreg & 0x20)) ? COCOCART_LINE_VALUE_ASSERT : COCOCART_LINE_VALUE_CLEAR); |
| 308 | 308 | |
| 309 | 309 | /* set the HALT line */ |
| 310 | | device_set_info_int( |
| 310 | coco_cartridge_set_line( |
| 311 | 311 | fdc->cococart, |
| 312 | | COCOCARTINFO_INT_LINE_HALT, |
| 312 | COCOCART_LINE_HALT, |
| 313 | 313 | ((fdc->drq == 0) && (fdc->dskreg & 0x80)) ? COCOCART_LINE_VALUE_ASSERT : COCOCART_LINE_VALUE_CLEAR); |
| 314 | 314 | } |
| 315 | 315 | |
| r4551 | r4552 | |
| 508 | 508 | fdc_t *fdc = get_token(device); |
| 509 | 509 | |
| 510 | 510 | /* set the NMI line */ |
| 511 | | device_set_info_int( |
| 511 | coco_cartridge_set_line( |
| 512 | 512 | fdc->cococart, |
| 513 | | COCOCARTINFO_INT_LINE_NMI, |
| 513 | COCOCART_LINE_NMI, |
| 514 | 514 | ((fdc->intrq != 0) && (fdc->dskreg & 0x20)) ? COCOCART_LINE_VALUE_ASSERT : COCOCART_LINE_VALUE_CLEAR); |
| 515 | 515 | |
| 516 | 516 | /* set the CART line */ |
| 517 | | device_set_info_int( |
| 517 | coco_cartridge_set_line( |
| 518 | 518 | fdc->cococart, |
| 519 | | COCOCARTINFO_INT_LINE_CART, |
| 519 | COCOCART_LINE_CART, |
| 520 | 520 | (fdc->drq != 0) ? COCOCART_LINE_VALUE_ASSERT : COCOCART_LINE_VALUE_CLEAR); |
| 521 | 521 | } |
| 522 | 522 | |
src/mess/devices/cococart.c
| r4551 | r4552 | |
| 291 | 291 | |
| 292 | 292 | |
| 293 | 293 | /*------------------------------------------------- |
| 294 | | DEVICE_SET_INFO(general_cartridge) |
| 294 | coco_cartridge_set_line |
| 295 | 295 | -------------------------------------------------*/ |
| 296 | 296 | |
| 297 | | static DEVICE_SET_INFO(general_cartridge) |
| 297 | void coco_cartridge_set_line(const device_config *device, cococart_line line, cococart_line_value value) |
| 298 | 298 | { |
| 299 | | switch (state) |
| 299 | switch (line) |
| 300 | 300 | { |
| 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); |
| 304 | 303 | break; |
| 305 | 304 | |
| 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); |
| 308 | 307 | break; |
| 309 | 308 | |
| 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); |
| 312 | 311 | break; |
| 312 | |
| 313 | case COCOCART_LINE_SOUND_ENABLE: |
| 314 | /* do nothing for now */ |
| 315 | break; |
| 313 | 316 | } |
| 314 | 317 | } |
| 315 | 318 | |
| r4551 | r4552 | |
| 328 | 331 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 329 | 332 | |
| 330 | 333 | /* --- 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; |
| 332 | 334 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(coco_cartridge); break; |
| 333 | 335 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 334 | 336 | case DEVINFO_FCT_RESET: /* Nothing */ break; |