src/mess/machine/conkort.c
| r7633 | r7634 | |
| 72 | 72 | Slow Controller |
| 73 | 73 | --------------- |
| 74 | 74 | - FD1791 HLD/HLT callbacks |
| 75 | | - copy protection device |
| 75 | - copy protection device (sends sector header bytes to CPU? DDEN is serial clock? code checks for either $b6 or $f7) |
| 76 | |
| 77 | 06F8: ld a,$2F ; SEEK |
| 78 | 06FA: out ($BC),a |
| 79 | 06FC: push af |
| 80 | 06FD: push bc |
| 81 | 06FE: ld bc,$0724 |
| 82 | 0701: push bc |
| 83 | 0702: ld b,$07 |
| 84 | 0704: rr a |
| 85 | 0706: call $073F |
| 86 | 073F: DB 7E in a,($7E) ; PIO PORT B |
| 87 | 0741: EE 08 xor $08 ; DDEN |
| 88 | 0743: D3 7E out ($7E),a |
| 89 | 0745: EE 08 xor $08 |
| 90 | 0747: D3 7E out ($7E),a |
| 91 | 0749: DB 7E in a,($7E) |
| 92 | 074B: 1F rra |
| 93 | 074C: 1F rra |
| 94 | 074D: 1F rra |
| 95 | 074E: CB 11 rl c |
| 96 | 0750: 79 ld a,c |
| 97 | 0751: C9 ret |
| 98 | 0709: djnz $0703 <-- jumps to middle of instruction! |
| 99 | 0703: rlca |
| 100 | 0704: rr a |
| 101 | 0706: call $073F |
| 102 | |
| 76 | 103 | - DS/DD SS/DS jumpers |
| 77 | 104 | - S1-S5 jumpers |
| 78 | 105 | |
| r7633 | r7634 | |
| 263 | 290 | 0 SEL 0 |
| 264 | 291 | 1 SEL 1 |
| 265 | 292 | 2 SEL 2 |
| 266 | | 3 MOT ON |
| 293 | 3 _MOT ON |
| 267 | 294 | 4 SIDE |
| 268 | 295 | 5 _PRECOMP ON |
| 269 | 296 | 6 _WAIT ENABLE |
| r7633 | r7634 | |
| 275 | 302 | |
| 276 | 303 | /* drive selection */ |
| 277 | 304 | if (BIT(data, 0)) wd17xx_set_drive(device, 0); |
| 278 | | if (BIT(data, 1)) wd17xx_set_drive(device, 1); |
| 305 | // if (BIT(data, 1)) wd17xx_set_drive(device, 1); |
| 279 | 306 | // if (BIT(data, 2)) wd17xx_set_drive(device, 2); |
| 280 | 307 | |
| 281 | 308 | /* motor enable */ |
| 282 | | floppy_mon_w(conkort->image0, !BIT(data, 3)); |
| 283 | | floppy_mon_w(conkort->image1, !BIT(data, 3)); |
| 309 | floppy_mon_w(conkort->image0, BIT(data, 3)); |
| 310 | floppy_mon_w(conkort->image1, BIT(data, 3)); |
| 284 | 311 | floppy_drive_set_ready_state(conkort->image0, 1, 1); |
| 285 | 312 | floppy_drive_set_ready_state(conkort->image1, 1, 1); |
| 286 | 313 | |
| 287 | 314 | /* disk side selection */ |
| 288 | | wd17xx_set_side(device, BIT(data, 4)); |
| 315 | // wd17xx_set_side(device, BIT(data, 4)); |
| 289 | 316 | |
| 290 | 317 | /* wait enable */ |
| 291 | 318 | conkort->wait_enable = BIT(data, 6); |
| r7633 | r7634 | |
| 321 | 348 | static READ8_DEVICE_HANDLER( slow_fdc_r ) |
| 322 | 349 | { |
| 323 | 350 | slow_t *conkort = get_safe_token_slow(device->owner); |
| 324 | | UINT8 data = 0; |
| 351 | UINT8 data = 0xff; |
| 325 | 352 | |
| 326 | 353 | switch (offset & 0x03) |
| 327 | 354 | { |
| r7633 | r7634 | |
| 338 | 365 | cpu_set_input_line(conkort->cpu, INPUT_LINE_HALT, ASSERT_LINE); |
| 339 | 366 | } |
| 340 | 367 | |
| 341 | | return data; |
| 368 | return data ^ 0xff; |
| 342 | 369 | } |
| 343 | 370 | |
| 344 | 371 | static WRITE8_DEVICE_HANDLER( slow_fdc_w ) |
| 345 | 372 | { |
| 346 | 373 | slow_t *conkort = get_safe_token_slow(device->owner); |
| 347 | 374 | |
| 375 | data ^= 0xff; |
| 376 | |
| 348 | 377 | switch (offset & 0x03) |
| 349 | 378 | { |
| 350 | 379 | case 0: wd17xx_command_w(device, 0, data); break; |
| r7633 | r7634 | |
| 602 | 631 | |
| 603 | 632 | slow_t *conkort = get_safe_token_slow(device->owner); |
| 604 | 633 | |
| 605 | | UINT8 data = 0; |
| 634 | UINT8 data = 4; |
| 606 | 635 | |
| 607 | 636 | /* single/double sided drive */ |
| 608 | | data |= 0x01; |
| 637 | // data |= 0x01; |
| 609 | 638 | |
| 610 | 639 | /* single/double density drive */ |
| 611 | 640 | data |= 0x02; |
| r7633 | r7634 | |
| 615 | 644 | |
| 616 | 645 | /* head load */ |
| 617 | 646 | // data |= wd17xx_hdld_r(device) << 6; |
| 647 | data |= 0x40; |
| 618 | 648 | |
| 619 | 649 | /* FDC interrupt request */ |
| 620 | 650 | data |= conkort->fdc_irq << 7; |
| r7633 | r7634 | |
| 736 | 766 | slow_t *conkort = get_safe_token_slow(device->owner); |
| 737 | 767 | |
| 738 | 768 | conkort->fdc_irq = state; |
| 769 | z80pio_pb_w(conkort->z80pio, 0, state << 7); |
| 739 | 770 | |
| 740 | 771 | if (state) |
| 741 | 772 | { |
| r7633 | r7634 | |
| 884 | 915 | state_save_register_device_item(device, 0, conkort->fdc_irq); |
| 885 | 916 | state_save_register_device_item(device, 0, conkort->fdc_drq); |
| 886 | 917 | state_save_register_device_item(device, 0, conkort->wait_enable); |
| 918 | |
| 919 | /* patch out protection checks */ |
| 920 | UINT8 *rom = device->subregion("abc830")->base.u8; |
| 921 | rom[0x0718] = 0xff; |
| 922 | rom[0x072c] = 0xff; |
| 923 | rom[0x0336] = 0xff; |
| 924 | rom[0x00fa] = 0xff; |
| 925 | rom[0x0771] = 0xff; |
| 926 | rom[0x0788] = 0xff; |
| 887 | 927 | } |
| 888 | 928 | |
| 889 | 929 | /*------------------------------------------------- |