src/mess/machine/cbmserial.c
| r6625 | r6626 | |
| 281 | 281 | { |
| 282 | 282 | if (daisy->line[line] != state) |
| 283 | 283 | { |
| 284 | | logerror("CBM serial bus device '%s' %s %u\n", calling_device->tag, SIGNAL_NAME[line], state); |
| 284 | if (LOG) logerror("CBM Serial Bus: '%s' %s %u\n", calling_device->tag, SIGNAL_NAME[line], state); |
| 285 | 285 | daisy->line[line] = state; |
| 286 | 286 | } |
| 287 | 287 | break; |
| r6625 | r6626 | |
| 296 | 296 | if (daisy->out_line_func[line]) (daisy->out_line_func[line])(daisy->device, data); |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | | logerror("SRQ %u ATN %u CLK %u DATA %u RESET %u\n", get_signal(serial_bus_device, SRQ),get_signal(serial_bus_device, ATN),get_signal(serial_bus_device, CLK),get_signal(serial_bus_device, DATA),get_signal(serial_bus_device, RESET)); |
| 299 | if (LOG) logerror("CBM Serial Bus: SRQ %u ATN %u CLK %u DATA %u RESET %u\n", get_signal(serial_bus_device, SRQ),get_signal(serial_bus_device, ATN),get_signal(serial_bus_device, CLK),get_signal(serial_bus_device, DATA),get_signal(serial_bus_device, RESET)); |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /*************************************************************************** |
src/mess/machine/c1541.c
| r6625 | r6626 | |
| 140 | 140 | PARAMETERS |
| 141 | 141 | ***************************************************************************/ |
| 142 | 142 | |
| 143 | | #define LOG 1 |
| 143 | #define LOG |
| 144 | 144 | |
| 145 | 145 | #define M6502_TAG "ucd5" |
| 146 | 146 | #define M6522_0_TAG "uab1" |
| r6625 | r6626 | |
| 173 | 173 | UINT8 yb; /* GCR data byte */ |
| 174 | 174 | int byte; /* byte ready */ |
| 175 | 175 | int atna; /* attention acknowledge */ |
| 176 | | int ds; /* data speed */ |
| 177 | | int stp; /* stepper motor phase */ |
| 176 | int ds; /* density select */ |
| 177 | int stp; /* stepping motor */ |
| 178 | 178 | int soe; /* s? output enable */ |
| 179 | 179 | int mode; /* mode (0 = write, 1 = read) */ |
| 180 | int sync; |
| 180 | 181 | |
| 181 | 182 | /* serial bus */ |
| 182 | 183 | int data_out; /* serial bus data output */ |
| r6625 | r6626 | |
| 227 | 228 | |
| 228 | 229 | if (c1541->bit_pos == 0x07) |
| 229 | 230 | { |
| 230 | | c1541->yb = c1541->track_buffer[c1541->buffer_pos]; |
| 231 | UINT8 data = c1541->track_buffer[c1541->buffer_pos]; |
| 232 | |
| 233 | if (data != 0xff) |
| 234 | { |
| 235 | c1541->yb = data; |
| 236 | byte = 1; |
| 237 | } |
| 238 | |
| 239 | c1541->sync = !(c1541->mode && (data == 0xff)); |
| 240 | |
| 231 | 241 | c1541->buffer_pos++; |
| 232 | 242 | |
| 233 | 243 | if (c1541->buffer_pos > c1541->track_len) |
| r6625 | r6626 | |
| 235 | 245 | c1541->buffer_pos = 0; |
| 236 | 246 | } |
| 237 | 247 | |
| 248 | // logerror("YB %02x pos %u\n", c1541->yb, c1541->buffer_pos-1); |
| 249 | |
| 238 | 250 | c1541->bit_pos = 0; |
| 239 | | |
| 240 | | byte = 1; |
| 241 | 251 | } |
| 242 | 252 | else |
| 243 | 253 | { |
| r6625 | r6626 | |
| 437 | 447 | { |
| 438 | 448 | /* |
| 439 | 449 | |
| 440 | | bit description |
| 450 | bit signal description |
| 441 | 451 | |
| 442 | | PB0 STP1 |
| 443 | | PB1 STP0 |
| 444 | | PB2 MTR |
| 445 | | PB3 ACT |
| 446 | | PB4 WPS input write protect sensor |
| 447 | | PB5 DS0 |
| 448 | | PB6 DS1 |
| 449 | | PB7 SYNC input |
| 452 | PB0 STP0 stepping motor bit 0 |
| 453 | PB1 STP1 stepping motor bit 1 |
| 454 | PB2 MTR motor ON/OFF |
| 455 | PB3 ACT drive 0 LED |
| 456 | PB4 WPS write protect sense |
| 457 | PB5 DS0 density select 0 |
| 458 | PB6 DS1 density select 1 |
| 459 | PB7 SYNC SYNC detect line |
| 450 | 460 | |
| 451 | 461 | */ |
| 452 | 462 | |
| 453 | 463 | c1541_t *c1541 = get_safe_token(device->owner); |
| 454 | 464 | UINT8 data = 0; |
| 455 | 465 | |
| 456 | | /* write protect sensor */ |
| 466 | /* write protect sense */ |
| 457 | 467 | data |= (floppy_drive_get_flag_state(c1541->image, FLOPPY_DRIVE_DISK_WRITE_PROTECTED) == FLOPPY_DRIVE_DISK_WRITE_PROTECTED) << 4; |
| 458 | 468 | |
| 459 | | /* SYNC detected */ |
| 460 | | data |= !(c1541->mode && (c1541->yb == 0xff)) << 7; |
| 469 | /* SYNC detect */ |
| 470 | //logerror("SYNC %u\n", !(c1541->mode && (c1541->yb == 0xff))); |
| 471 | data |= c1541->sync << 7; |
| 461 | 472 | |
| 462 | 473 | return data; |
| 463 | 474 | } |
| r6625 | r6626 | |
| 466 | 477 | { |
| 467 | 478 | /* |
| 468 | 479 | |
| 469 | | bit description |
| 480 | bit signal description |
| 470 | 481 | |
| 471 | | PB0 STP1 |
| 472 | | PB1 STP0 |
| 473 | | PB2 MTR |
| 474 | | PB3 ACT |
| 475 | | PB4 WPS input |
| 476 | | PB5 DS0 |
| 477 | | PB6 DS1 |
| 478 | | PB7 SYNC input |
| 482 | PB0 STP0 stepping motor bit 0 |
| 483 | PB1 STP1 stepping motor bit 1 |
| 484 | PB2 MTR motor ON/OFF |
| 485 | PB3 ACT drive 0 LED |
| 486 | PB4 WPS write protect sense |
| 487 | PB5 DS0 density select 0 |
| 488 | PB6 DS1 density select 1 |
| 489 | PB7 SYNC SYNC detect line |
| 479 | 490 | |
| 480 | 491 | */ |
| 481 | 492 | |
| r6625 | r6626 | |
| 517 | 528 | |
| 518 | 529 | /* activity LED */ |
| 519 | 530 | |
| 520 | | /* data speed */ |
| 531 | /* density select */ |
| 521 | 532 | if (c1541->ds != ds) |
| 522 | 533 | { |
| 523 | | timer_adjust_periodic(c1541->bit_timer, attotime_zero, 0, ATTOTIME_IN_HZ(C1541_BITRATE[ds])); |
| 534 | //logerror("DS %u\n", ds); |
| 535 | timer_adjust_periodic(c1541->bit_timer, attotime_zero, 0, ATTOTIME_IN_HZ(C1541_BITRATE[ds]/4)); |
| 524 | 536 | c1541->ds = ds; |
| 525 | 537 | } |
| 526 | 538 | } |