src/mess/machine/compis.c
| r5483 | r5484 | |
| 283 | 283 | nec765_reset(fdc, 0); |
| 284 | 284 | |
| 285 | 285 | /* set FDC at reset */ |
| 286 | | nec765_set_reset_state(fdc, 1); |
| 286 | nec765_reset_w(fdc, 1); |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | static void compis_fdc_tc(running_machine *machine, int state) |
| r5483 | r5484 | |
| 292 | 292 | /* Terminal count if iSBX-218A has DMA enabled */ |
| 293 | 293 | if (input_port_read(machine, "DSW1")) |
| 294 | 294 | { |
| 295 | | nec765_set_tc_state(fdc, state); |
| 295 | nec765_tc_w(fdc, state); |
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | | static NEC765_INTERRUPT( compis_fdc_int ) |
| 299 | static WRITE_LINE_DEVICE_HANDLER( compis_fdc_int ) |
| 300 | 300 | { |
| 301 | 301 | /* No interrupt requests if iSBX-218A has DMA enabled */ |
| 302 | 302 | if (!input_port_read(device->machine, "DSW1") && state) |
| r5483 | r5484 | |
| 316 | 316 | |
| 317 | 317 | const nec765_interface compis_fdc_interface = |
| 318 | 318 | { |
| 319 | | compis_fdc_int, |
| 319 | DEVCB_LINE(compis_fdc_int), |
| 320 | 320 | compis_fdc_dma_drq, |
| 321 | 321 | NULL, |
| 322 | 322 | NEC765_RDY_PIN_CONNECTED |
src/mess/machine/nec765.c
| r5483 | r5484 | |
| 78 | 78 | typedef struct _nec765_t nec765_t; |
| 79 | 79 | struct _nec765_t |
| 80 | 80 | { |
| 81 | devcb_resolved_write_line out_int_func; |
| 82 | |
| 81 | 83 | unsigned long sector_counter; |
| 82 | 84 | /* version of fdc to emulate */ |
| 83 | 85 | NEC765_VERSION version; |
| r5483 | r5484 | |
| 650 | 652 | fdc->nec765_flags = new_flags; |
| 651 | 653 | |
| 652 | 654 | /* if interrupt changed, call the handler */ |
| 653 | | if ((changed_flags & NEC765_INT) && fdc->intf->interrupt) |
| 654 | | fdc->intf->interrupt(device,(fdc->nec765_flags & NEC765_INT) ? 1 : 0); |
| 655 | if (changed_flags & NEC765_INT) |
| 656 | devcb_call_write_line(&fdc->out_int_func, (fdc->nec765_flags & NEC765_INT) ? 1 : 0); |
| 655 | 657 | |
| 656 | 658 | /* if DRQ changed, call the handler */ |
| 657 | 659 | if ((changed_flags & NEC765_DMA_DRQ) && fdc->intf->dma_drq) |
| r5483 | r5484 | |
| 726 | 728 | |
| 727 | 729 | |
| 728 | 730 | /* terminal count input */ |
| 729 | | void nec765_set_tc_state(const device_config *device, int state) |
| 731 | WRITE_LINE_DEVICE_HANDLER( nec765_tc_w ) |
| 730 | 732 | { |
| 731 | 733 | int old_state; |
| 732 | 734 | nec765_t *fdc = get_safe_token(device); |
| r5483 | r5484 | |
| 2217 | 2219 | } |
| 2218 | 2220 | } |
| 2219 | 2221 | |
| 2220 | | void nec765_set_reset_state(const device_config *device, int state) |
| 2222 | WRITE_LINE_DEVICE_HANDLER( nec765_reset_w ) |
| 2221 | 2223 | { |
| 2222 | 2224 | nec765_t *fdc = get_safe_token(device); |
| 2223 | 2225 | |
| r5483 | r5484 | |
| 2253 | 2255 | } |
| 2254 | 2256 | |
| 2255 | 2257 | |
| 2256 | | void nec765_set_ready_state(const device_config *device, int state) |
| 2258 | WRITE_LINE_DEVICE_HANDLER( nec765_ready_w ) |
| 2257 | 2259 | { |
| 2258 | 2260 | nec765_t *fdc = get_safe_token(device); |
| 2259 | 2261 | |
| r5483 | r5484 | |
| 2288 | 2290 | fdc->nec765_flags &= NEC765_FDD_READY; |
| 2289 | 2291 | fdc->data_buffer = auto_alloc_array(device->machine, char, 32*1024); |
| 2290 | 2292 | |
| 2293 | devcb_resolve_write_line(&fdc->out_int_func, &fdc->intf->out_int_func, device); |
| 2291 | 2294 | |
| 2292 | 2295 | // register for state saving |
| 2293 | 2296 | //state_save_register_item(device->machine, "nec765", device->tag, 0, nec765->number); |
src/mess/machine/nec765.h
| r5483 | r5484 | |
| 9 | 9 | #ifndef NEC765_H |
| 10 | 10 | #define NEC765_H |
| 11 | 11 | |
| 12 | #include "devcb.h" |
| 12 | 13 | #include "devices/flopdrv.h" |
| 13 | 14 | |
| 14 | 15 | /*************************************************************************** |
| r5483 | r5484 | |
| 34 | 35 | #define NEC765_DAM_DELETED_DATA 0x0f8 |
| 35 | 36 | #define NEC765_DAM_DATA 0x0fb |
| 36 | 37 | |
| 37 | | typedef void (*nec765_interrupt_func)(const device_config *device, int state); |
| 38 | | #define NEC765_INTERRUPT(name) void name(const device_config *device, int state ) |
| 39 | | |
| 40 | 38 | typedef void (*nec765_dma_drq_func)(const device_config *device, int state,int read_write); |
| 41 | 39 | #define NEC765_DMA_REQUEST(name) void name(const device_config *device, int state,int read_write ) |
| 42 | 40 | |
| r5483 | r5484 | |
| 47 | 45 | typedef struct nec765_interface |
| 48 | 46 | { |
| 49 | 47 | /* interrupt issued */ |
| 50 | | nec765_interrupt_func interrupt; |
| 48 | devcb_write_line out_int_func; |
| 51 | 49 | |
| 52 | 50 | /* dma data request */ |
| 53 | 51 | nec765_dma_drq_func dma_drq; |
| r5483 | r5484 | |
| 85 | 83 | void nec765_reset(const device_config *device, int); |
| 86 | 84 | |
| 87 | 85 | /* reset pin of nec765 */ |
| 88 | | void nec765_set_reset_state(const device_config *device, int); |
| 86 | WRITE_LINE_DEVICE_HANDLER(nec765_reset_w); |
| 89 | 87 | |
| 90 | 88 | /* set nec765 terminal count input state */ |
| 91 | | void nec765_set_tc_state(const device_config *device, int); |
| 89 | WRITE_LINE_DEVICE_HANDLER(nec765_tc_w); |
| 90 | |
| 92 | 91 | /* set nec765 ready input*/ |
| 93 | | void nec765_set_ready_state(const device_config *device,int); |
| 92 | WRITE_LINE_DEVICE_HANDLER(nec765_ready_w); |
| 94 | 93 | |
| 95 | 94 | void nec765_idle(const device_config *device); |
| 96 | 95 | |
src/mess/machine/pc8801.c
| r5483 | r5484 | |
| 797 | 797 | READ8_HANDLER(pc8801fd_nec765_tc) |
| 798 | 798 | { |
| 799 | 799 | const device_config *fdc = devtag_get_device(space->machine, "nec765"); |
| 800 | | nec765_set_tc_state(fdc, 1); |
| 801 | | nec765_set_tc_state(fdc, 0); |
| 800 | nec765_tc_w(fdc, 1); |
| 801 | nec765_tc_w(fdc, 0); |
| 802 | 802 | return 0; |
| 803 | 803 | } |
| 804 | 804 | |
| 805 | 805 | /* callback for /INT output from FDC */ |
| 806 | | static NEC765_INTERRUPT( pc8801_fdc_interrupt ) |
| 806 | static WRITE_LINE_DEVICE_HANDLER( pc8801_fdc_interrupt ) |
| 807 | 807 | { |
| 808 | 808 | cputag_set_input_line(device->machine, "sub", 0, state ? HOLD_LINE : CLEAR_LINE); |
| 809 | 809 | } |
| r5483 | r5484 | |
| 815 | 815 | |
| 816 | 816 | const nec765_interface pc8801_fdc_interface= |
| 817 | 817 | { |
| 818 | | pc8801_fdc_interrupt, |
| 818 | DEVCB_LINE(pc8801_fdc_interrupt), |
| 819 | 819 | pc8801_fdc_dma_drq, |
| 820 | 820 | NULL, |
| 821 | 821 | NEC765_RDY_PIN_CONNECTED |
src/mess/machine/pc_fdc.c
| r5483 | r5484 | |
| 56 | 56 | |
| 57 | 57 | static TIMER_CALLBACK( watchdog_timeout ); |
| 58 | 58 | |
| 59 | | static NEC765_INTERRUPT( pc_fdc_hw_interrupt ); |
| 59 | static WRITE_LINE_DEVICE_HANDLER( pc_fdc_hw_interrupt ); |
| 60 | 60 | static NEC765_DMA_REQUEST(pc_fdc_hw_dma_drq); |
| 61 | 61 | static NEC765_GET_IMAGE ( pc_fdc_get_image); |
| 62 | 62 | |
| 63 | 63 | const nec765_interface pc_fdc_nec765_connected_interface = |
| 64 | 64 | { |
| 65 | | pc_fdc_hw_interrupt, |
| 65 | DEVCB_LINE(pc_fdc_hw_interrupt), |
| 66 | 66 | pc_fdc_hw_dma_drq, |
| 67 | 67 | pc_fdc_get_image, |
| 68 | 68 | NEC765_RDY_PIN_CONNECTED |
| r5483 | r5484 | |
| 70 | 70 | |
| 71 | 71 | const nec765_interface pc_fdc_nec765_not_connected_interface = |
| 72 | 72 | { |
| 73 | | pc_fdc_hw_interrupt, |
| 73 | DEVCB_LINE(pc_fdc_hw_interrupt), |
| 74 | 74 | pc_fdc_hw_dma_drq, |
| 75 | 75 | pc_fdc_get_image, |
| 76 | 76 | NEC765_RDY_PIN_NOT_CONNECTED |
| r5483 | r5484 | |
| 93 | 93 | nec765_reset(pc_get_device(machine),0); |
| 94 | 94 | |
| 95 | 95 | /* set FDC at reset */ |
| 96 | | nec765_set_reset_state(pc_get_device(machine), 1); |
| 96 | nec765_reset_w(pc_get_device(machine), 1); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
| r5483 | r5484 | |
| 152 | 152 | /* if dma is not enabled, tc's are not acknowledged */ |
| 153 | 153 | if ((fdc->digital_output_register & PC_FDC_FLAGS_DOR_DMA_ENABLED)!=0) |
| 154 | 154 | { |
| 155 | | nec765_set_tc_state(pc_get_device(machine), state); |
| 155 | nec765_tc_w(pc_get_device(machine), state); |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | |
| 161 | | static NEC765_INTERRUPT( pc_fdc_hw_interrupt ) |
| 161 | static WRITE_LINE_DEVICE_HANDLER( pc_fdc_hw_interrupt ) |
| 162 | 162 | { |
| 163 | 163 | fdc->int_state = state; |
| 164 | 164 | |
| r5483 | r5484 | |
| 223 | 223 | if ((data & 0x080)!=0) |
| 224 | 224 | { |
| 225 | 225 | /* set ready state */ |
| 226 | | nec765_set_ready_state(pc_get_device(machine),1); |
| 226 | nec765_ready_w(pc_get_device(machine),1); |
| 227 | 227 | |
| 228 | 228 | /* toggle reset state */ |
| 229 | | nec765_set_reset_state(pc_get_device(machine), 1); |
| 230 | | nec765_set_reset_state(pc_get_device(machine), 0); |
| 229 | nec765_reset_w(pc_get_device(machine), 1); |
| 230 | nec765_reset_w(pc_get_device(machine), 0); |
| 231 | 231 | |
| 232 | 232 | /* bit is self-clearing */ |
| 233 | 233 | data &= ~0x080; |
| r5483 | r5484 | |
| 316 | 316 | what is not yet clear is if this is a result of the drives ready state |
| 317 | 317 | changing... |
| 318 | 318 | */ |
| 319 | | nec765_set_ready_state(pc_get_device(machine),1); |
| 319 | nec765_ready_w(pc_get_device(machine),1); |
| 320 | 320 | |
| 321 | 321 | /* set FDC at reset */ |
| 322 | | nec765_set_reset_state(pc_get_device(machine), 1); |
| 322 | nec765_reset_w(pc_get_device(machine), 1); |
| 323 | 323 | } |
| 324 | 324 | else |
| 325 | 325 | { |
| 326 | 326 | pc_fdc_set_tc_state(machine, 0); |
| 327 | 327 | |
| 328 | 328 | /* release reset on fdc */ |
| 329 | | nec765_set_reset_state(pc_get_device(machine), 0); |
| 329 | nec765_reset_w(pc_get_device(machine), 0); |
| 330 | 330 | } |
| 331 | 331 | } |
| 332 | 332 | |
| r5483 | r5484 | |
| 412 | 412 | what is not yet clear is if this is a result of the drives ready state |
| 413 | 413 | changing... |
| 414 | 414 | */ |
| 415 | | nec765_set_ready_state(pc_get_device(machine),1); |
| 415 | nec765_ready_w(pc_get_device(machine),1); |
| 416 | 416 | |
| 417 | 417 | /* set FDC at reset */ |
| 418 | | nec765_set_reset_state(pc_get_device(machine), 1); |
| 418 | nec765_reset_w(pc_get_device(machine), 1); |
| 419 | 419 | } |
| 420 | 420 | else |
| 421 | 421 | { |
| 422 | 422 | pc_fdc_set_tc_state(machine, 0); |
| 423 | 423 | |
| 424 | 424 | /* release reset on fdc */ |
| 425 | | nec765_set_reset_state(pc_get_device(machine), 0); |
| 425 | nec765_reset_w(pc_get_device(machine), 0); |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | logerror("pcjr_fdc_dor_w: changing dor from %02x to %02x\n", fdc->digital_output_register, data); |
src/mess/machine/kc.c
| r5483 | r5484 | |
| 205 | 205 | { |
| 206 | 206 | const device_config *fdc = devtag_get_device(space->machine, "nec765"); |
| 207 | 207 | logerror("kc85 disc hw tc w: %02x\n",data); |
| 208 | | nec765_set_tc_state(fdc, data & 0x01); |
| 208 | nec765_tc_w(fdc, data & 0x01); |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | |
| 212 | 212 | /* callback for /INT output from FDC */ |
| 213 | | static NEC765_INTERRUPT( kc85_fdc_interrupt ) |
| 213 | static WRITE_LINE_DEVICE_HANDLER( kc85_fdc_interrupt ) |
| 214 | 214 | { |
| 215 | 215 | kc85_disc_hw_input_gate &=~(1<<6); |
| 216 | 216 | if (state) |
| r5483 | r5484 | |
| 227 | 227 | |
| 228 | 228 | const nec765_interface kc_fdc_interface= |
| 229 | 229 | { |
| 230 | | kc85_fdc_interrupt, |
| 230 | DEVCB_LINE(kc85_fdc_interrupt), |
| 231 | 231 | kc85_fdc_dma_drq, |
| 232 | 232 | NULL, |
| 233 | 233 | NEC765_RDY_PIN_CONNECTED |
src/mess/drivers/mikromik.c
| r5483 | r5484 | |
| 281 | 281 | mm1_state *driver_state = device->machine->driver_data; |
| 282 | 282 | |
| 283 | 283 | /* floppy terminal count */ |
| 284 | | nec765_set_tc_state(driver_state->upd765, !state); |
| 284 | nec765_tc_w(driver_state->upd765, !state); |
| 285 | 285 | |
| 286 | 286 | cputag_set_input_line(device->machine, I8085A_TAG, I8085_RST75_LINE, state ? CLEAR_LINE : ASSERT_LINE); |
| 287 | 287 | } |
| r5483 | r5484 | |
| 299 | 299 | |
| 300 | 300 | /* µPD765 Interface */ |
| 301 | 301 | |
| 302 | | static NEC765_INTERRUPT( fdc_irq ) |
| 303 | | { |
| 304 | | cputag_set_input_line(device->machine, I8085A_TAG, I8085_RST55_LINE, state ? ASSERT_LINE : CLEAR_LINE); |
| 305 | | } |
| 306 | | |
| 307 | 302 | static NEC765_DMA_REQUEST( fdc_drq ) |
| 308 | 303 | { |
| 309 | 304 | mm1_state *driver_state = device->machine->driver_data; |
| r5483 | r5484 | |
| 313 | 308 | |
| 314 | 309 | static const nec765_interface mm1_nec765_intf = |
| 315 | 310 | { |
| 316 | | fdc_irq, |
| 311 | DEVCB_CPU_INPUT_LINE(I8085A_TAG, I8085_RST55_LINE), |
| 317 | 312 | fdc_drq, |
| 318 | 313 | NULL, |
| 319 | 314 | NEC765_RDY_PIN_CONNECTED // ??? |
src/mess/drivers/pcw.c
| r5483 | r5484 | |
| 105 | 105 | #define VERBOSE 1 |
| 106 | 106 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) |
| 107 | 107 | |
| 108 | | static NEC765_INTERRUPT( pcw_fdc_interrupt ); |
| 108 | static WRITE_LINE_DEVICE_HANDLER( pcw_fdc_interrupt ); |
| 109 | 109 | |
| 110 | 110 | // pointer to pcw ram |
| 111 | 111 | unsigned int roller_ram_addr; |
| r5483 | r5484 | |
| 140 | 140 | /NMI depending on choice (see system control below) */ |
| 141 | 141 | static const nec765_interface pcw_nec765_interface = |
| 142 | 142 | { |
| 143 | | pcw_fdc_interrupt, |
| 143 | DEVCB_LINE(pcw_fdc_interrupt), |
| 144 | 144 | NULL, |
| 145 | 145 | NULL, |
| 146 | 146 | NEC765_RDY_PIN_CONNECTED |
| r5483 | r5484 | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /* fdc interrupt callback. set/clear fdc int */ |
| 191 | | static NEC765_INTERRUPT( pcw_fdc_interrupt ) |
| 191 | static WRITE_LINE_DEVICE_HANDLER( pcw_fdc_interrupt ) |
| 192 | 192 | { |
| 193 | 193 | if (state == CLEAR_LINE) |
| 194 | 194 | pcw_system_status &= ~(1<<5); |
| r5483 | r5484 | |
| 500 | 500 | /* set fdc terminal count */ |
| 501 | 501 | case 5: |
| 502 | 502 | { |
| 503 | | nec765_set_tc_state(fdc, 1); |
| 503 | nec765_tc_w(fdc, 1); |
| 504 | 504 | } |
| 505 | 505 | break; |
| 506 | 506 | |
| 507 | 507 | /* clear fdc terminal count */ |
| 508 | 508 | case 6: |
| 509 | 509 | { |
| 510 | | nec765_set_tc_state(fdc, 0); |
| 510 | nec765_tc_w(fdc, 0); |
| 511 | 511 | } |
| 512 | 512 | break; |
| 513 | 513 | |
src/mess/drivers/newbrain.c
| r5483 | r5484 | |
| 658 | 658 | floppy_drive_set_motor_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), BIT(data, 0)); |
| 659 | 659 | floppy_drive_set_ready_state(image_from_devtype_and_index(space->machine, IO_FLOPPY, 0), 1, 0); |
| 660 | 660 | |
| 661 | | nec765_set_reset_state(state->nec765, BIT(data, 1)); |
| 661 | nec765_reset_w(state->nec765, BIT(data, 1)); |
| 662 | 662 | |
| 663 | | nec765_set_tc_state(state->nec765, BIT(data, 2)); |
| 663 | nec765_tc_w(state->nec765, BIT(data, 2)); |
| 664 | 664 | } |
| 665 | 665 | |
| 666 | 666 | static READ8_HANDLER( fdc_control_r ) |
| r5483 | r5484 | |
| 1288 | 1288 | DEVCB_LINE(acia_interrupt) |
| 1289 | 1289 | }; |
| 1290 | 1290 | |
| 1291 | | static NEC765_INTERRUPT( newbrain_fdc_interrupt ) |
| 1291 | static WRITE_LINE_DEVICE_HANDLER( newbrain_fdc_interrupt ) |
| 1292 | 1292 | { |
| 1293 | 1293 | newbrain_state *driver_state = device->machine->driver_data; |
| 1294 | 1294 | |
| r5483 | r5484 | |
| 1297 | 1297 | |
| 1298 | 1298 | static const nec765_interface newbrain_nec765_interface = |
| 1299 | 1299 | { |
| 1300 | | newbrain_fdc_interrupt, |
| 1300 | DEVCB_LINE(newbrain_fdc_interrupt), |
| 1301 | 1301 | NULL, |
| 1302 | 1302 | NULL, |
| 1303 | 1303 | NEC765_RDY_PIN_NOT_CONNECTED |
src/mess/drivers/nc.c
| r5483 | r5484 | |
| 1291 | 1291 | }; |
| 1292 | 1292 | |
| 1293 | 1293 | |
| 1294 | | static NEC765_INTERRUPT( nc200_fdc_interrupt ) |
| 1294 | static WRITE_LINE_DEVICE_HANDLER( nc200_fdc_interrupt ) |
| 1295 | 1295 | { |
| 1296 | 1296 | #if 0 |
| 1297 | 1297 | nc_irq_latch &=~(1<<5); |
| r5483 | r5484 | |
| 1313 | 1313 | |
| 1314 | 1314 | static const nec765_interface nc200_nec765_interface= |
| 1315 | 1315 | { |
| 1316 | | nc200_fdc_interrupt, |
| 1316 | DEVCB_LINE(nc200_fdc_interrupt), |
| 1317 | 1317 | NULL, |
| 1318 | 1318 | NULL, |
| 1319 | 1319 | NEC765_RDY_PIN_CONNECTED |
| r5483 | r5484 | |
| 1477 | 1477 | floppy_drive_set_motor_state(0, 1); |
| 1478 | 1478 | floppy_drive_set_ready_state(0, 1, 1); |
| 1479 | 1479 | #endif |
| 1480 | | nec765_set_tc_state(fdc, (data & 0x01)); |
| 1480 | nec765_tc_w(fdc, (data & 0x01)); |
| 1481 | 1481 | } |
| 1482 | 1482 | |
| 1483 | 1483 | /* bit 2: backlight: 1=off, 0=on */ |
src/mess/drivers/sord.c
| r5483 | r5484 | |
| 139 | 139 | static WRITE8_HANDLER(fd5_tc_w) |
| 140 | 140 | { |
| 141 | 141 | const device_config *fdc = devtag_get_device(space->machine, "nec765"); |
| 142 | | nec765_set_tc_state(fdc, 1); |
| 143 | | nec765_set_tc_state(fdc, 0); |
| 142 | nec765_tc_w(fdc, 1); |
| 143 | nec765_tc_w(fdc, 0); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /* 0x020 fd5 writes to this port to communicate with m5 */ |
| r5483 | r5484 | |
| 159 | 159 | ADDRESS_MAP_END |
| 160 | 160 | |
| 161 | 161 | /* nec765 data request is connected to interrupt of z80 inside fd5 interface */ |
| 162 | | static NEC765_INTERRUPT( sord_fd5_fdc_interrupt ) |
| 162 | static WRITE_LINE_DEVICE_HANDLER( sord_fd5_fdc_interrupt ) |
| 163 | 163 | { |
| 164 | 164 | cputag_set_input_line(device->machine, "floppy", 0, state? HOLD_LINE : CLEAR_LINE); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | static const struct nec765_interface sord_fd5_nec765_interface= |
| 168 | 168 | { |
| 169 | | sord_fd5_fdc_interrupt, |
| 169 | DEVCB_LINE(sord_fd5_fdc_interrupt), |
| 170 | 170 | NULL, |
| 171 | 171 | NULL, |
| 172 | 172 | NEC765_RDY_PIN_CONNECTED |
src/mess/drivers/bw12.c
| r5483 | r5484 | |
| 168 | 168 | break; |
| 169 | 169 | |
| 170 | 170 | case 7: /* FDC TC */ |
| 171 | | nec765_set_tc_state(state->nec765, data); |
| 171 | nec765_tc_w(state->nec765, data); |
| 172 | 172 | break; |
| 173 | 173 | } |
| 174 | 174 | } |
| r5483 | r5484 | |
| 423 | 423 | |
| 424 | 424 | /* NEC765 Interface */ |
| 425 | 425 | |
| 426 | | static NEC765_INTERRUPT( bw12_nec765_interrupt ) |
| 426 | static WRITE_LINE_DEVICE_HANDLER( bw12_nec765_interrupt ) |
| 427 | 427 | { |
| 428 | 428 | bw12_state *driver_state = device->machine->driver_data; |
| 429 | 429 | |
| r5483 | r5484 | |
| 447 | 447 | |
| 448 | 448 | static const struct nec765_interface bw12_nec765_interface = |
| 449 | 449 | { |
| 450 | | bw12_nec765_interrupt, /* interrupt */ |
| 450 | DEVCB_LINE(bw12_nec765_interrupt), /* interrupt */ |
| 451 | 451 | NULL, /* DMA request */ |
| 452 | 452 | bw12_nec765_get_image, /* image lookup */ |
| 453 | 453 | NEC765_RDY_PIN_CONNECTED /* ready pin */ |
src/mess/drivers/x68k.c
| r5483 | r5484 | |
| 1068 | 1068 | } |
| 1069 | 1069 | } |
| 1070 | 1070 | |
| 1071 | | static NEC765_INTERRUPT( fdc_irq ) |
| 1071 | static WRITE_LINE_DEVICE_HANDLER( fdc_irq ) |
| 1072 | 1072 | { |
| 1073 | 1073 | if((x68k_sys.ioc.irqstatus & 0x04) && state == ASSERT_LINE) |
| 1074 | 1074 | { |
| r5483 | r5484 | |
| 1129 | 1129 | // CT1 and CT2 bits from YM2151 port 0x1b |
| 1130 | 1130 | // CT1 - ADPCM clock - 0 = 8MHz, 1 = 4MHz |
| 1131 | 1131 | // CT2 - 1 = Set ready state of FDC |
| 1132 | | nec765_set_ready_state(fdc,data & 0x01); |
| 1132 | nec765_ready_w(fdc,data & 0x01); |
| 1133 | 1133 | x68k_sys.adpcm.clock = data & 0x02; |
| 1134 | 1134 | x68k_set_adpcm(device->machine); |
| 1135 | 1135 | okim6258_set_clock(okim, data & 0x02 ? 4000000 : 8000000); |
| r5483 | r5484 | |
| 1896 | 1896 | |
| 1897 | 1897 | static const nec765_interface fdc_interface = |
| 1898 | 1898 | { |
| 1899 | | fdc_irq, |
| 1899 | DEVCB_LINE(fdc_irq), |
| 1900 | 1900 | fdc_drq, |
| 1901 | 1901 | NULL, |
| 1902 | 1902 | NEC765_RDY_PIN_CONNECTED |