src/mess/drivers/a310.c
| r832 | r833 | |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | static void a310_request_fiq(int mask) |
| 118 | { |
| 119 | a310_iocregs[12] |= mask; |
| 120 | |
| 121 | if (a310_iocregs[14] & mask) |
| 122 | { |
| 123 | cpunum_set_input_line(0, ARM_FIRQ_LINE, PULSE_LINE); |
| 124 | } |
| 125 | } |
| 126 | |
| 117 | 127 | static TIMER_CALLBACK( a310_audio_tick ) |
| 118 | 128 | { |
| 119 | 129 | a310_sndcur++; |
| r832 | r833 | |
| 180 | 190 | |
| 181 | 191 | static void a310_wd177x_callback(wd17xx_state_t event, void *param) |
| 182 | 192 | { |
| 193 | switch (event) |
| 194 | { |
| 195 | case WD17XX_IRQ_CLR: |
| 196 | a310_iocregs[12] &= ~A310_FIQ_FLOPPY; |
| 197 | break; |
| 198 | |
| 199 | case WD17XX_IRQ_SET: |
| 200 | a310_request_fiq(A310_FIQ_FLOPPY); |
| 201 | break; |
| 202 | |
| 203 | case WD17XX_DRQ_CLR: |
| 204 | a310_iocregs[12] &= ~A310_FIQ_FLOPPY_DRQ; |
| 205 | break; |
| 206 | |
| 207 | case WD17XX_DRQ_SET: |
| 208 | a310_request_fiq(A310_FIQ_FLOPPY_DRQ); |
| 209 | break; |
| 210 | } |
| 183 | 211 | } |
| 184 | 212 | |
| 185 | 213 | |
| 186 | 214 | static MACHINE_START( a310 ) |
| 187 | 215 | { |
| 188 | 216 | a310_pagesize = 0; |
| 189 | | wd17xx_init(WD_TYPE_177X, a310_wd177x_callback, NULL); |
| 217 | wd17xx_init(WD_TYPE_1772, a310_wd177x_callback, NULL); |
| 190 | 218 | |
| 191 | 219 | vbl_timer = mame_timer_alloc(a310_vblank); |
| 192 | 220 | mame_timer_adjust(vbl_timer, time_never, 0, time_never); |
| r832 | r833 | |
| 382 | 410 | logerror("IOC: R %s = %02x (PC=%x)\n", ioc_regnames[offset&0x1f], a310_iocregs[offset&0x1f], activecpu_get_pc()); |
| 383 | 411 | return a310_iocregs[offset&0x1f]; |
| 384 | 412 | } |
| 413 | else if (offset >= 0xc4000 && offset <= 0xc4010) |
| 414 | { |
| 415 | logerror("17XX: R @ addr %x mask %08x\n", offset*4, mem_mask); |
| 416 | return wd17xx_data_r(offset&0xf); |
| 417 | } |
| 385 | 418 | else |
| 386 | 419 | { |
| 387 | 420 | logerror("I/O: R @ %x (mask %08x)\n", (offset*4)+0x3000000, mem_mask); |
| r832 | r833 | |
| 470 | 503 | break; |
| 471 | 504 | } |
| 472 | 505 | } |
| 506 | else if (offset >= 0xc4000 && offset <= 0xc4010) |
| 507 | { |
| 508 | logerror("17XX: %x to addr %x mask %08x\n", data, offset*4, mem_mask); |
| 509 | wd17xx_data_w(offset&0xf, data&0xff); |
| 510 | } |
| 511 | else if (offset == 0xd40006) |
| 512 | { |
| 513 | // latch A |
| 514 | if (data & 1) |
| 515 | { |
| 516 | wd17xx_set_drive(0); |
| 517 | } |
| 518 | if (data & 2) |
| 519 | { |
| 520 | wd17xx_set_drive(1); |
| 521 | } |
| 522 | if (data & 4) |
| 523 | { |
| 524 | wd17xx_set_drive(2); |
| 525 | } |
| 526 | if (data & 8) |
| 527 | { |
| 528 | wd17xx_set_drive(3); |
| 529 | } |
| 530 | |
| 531 | wd17xx_set_side((data & 0x10)>>4); |
| 532 | |
| 533 | } |
| 534 | else if (offset == 0xd40010) |
| 535 | { |
| 536 | // latch B |
| 537 | wd17xx_set_density((data & 2) ? DEN_MFM_LO : DEN_MFM_HI); |
| 538 | } |
| 473 | 539 | else |
| 474 | 540 | { |
| 475 | 541 | logerror("I/O: W %x @ %x (mask %08x)\n", data, (offset*4)+0x3000000, mem_mask); |