static void micropolis_write_sector(device_t *device) { #if 0 micropolis_state *w = get_safe_token(device); /* at this point, the disc is write enabled, and data * has been transfered into our buffer - now write it to * the disc image or to the real disc */ /* find sector */ w->data_count = w->sector_length; /* write data */ floppy_drive_write_sector_data(w->drive, 0, w->sector, (char *)w->buffer, w->sector_length, w->write_cmd & 0x01); #endif }
/* Perform a write operation for one sector */ static void fd800_do_write(void) { int data_id; if (fd800.drv[fd800.unit].seclen < 64) /* fill with 0s */ memset(fd800.buf+(fd800.drv[fd800.unit].seclen<<1), 0, (64-fd800.drv[fd800.unit].seclen)<<1); if (!fd800_find_sector(fd800.unit, fd800.head, fd800.sector, &data_id)) { fd800.stat_reg |= status_ID_not_found; return; } floppy_drive_write_sector_data(&fd800.drv[fd800.unit].img->device(), fd800.head, data_id, fd800.buf, 128, fd800.ddam); fd800.buf_pos = 0; fd800.buf_mode = bm_write; fd800.stat_reg |= status_XFER_ready; fd800.stat_reg |= status_OP_complete; /* right??? */ }
static void i8271_command_continue(device_t *device) { i8271_t *i8271 = get_safe_token(device); switch (i8271->Command) { case I8271_COMMAND_READ_DATA_MULTI_RECORD: case I8271_COMMAND_READ_DATA_SINGLE_RECORD: { /* completed all sectors? */ i8271->Counter--; /* increment sector id */ i8271->ID_R++; /* end command? */ if (i8271->Counter==0) { i8271_timed_command_complete(device); return; } i8271_do_read(device); } break; case I8271_COMMAND_WRITE_DATA_MULTI_RECORD: case I8271_COMMAND_WRITE_DATA_SINGLE_RECORD: { /* put the buffer to the sector */ floppy_drive_write_sector_data(current_image(device), i8271->side, i8271->data_id, i8271->pExecutionPhaseData, 1<<(i8271->ID_N+7),0); /* completed all sectors? */ i8271->Counter--; /* increment sector id */ i8271->ID_R++; /* end command? */ if (i8271->Counter==0) { i8271_timed_command_complete(device); return; } i8271_do_write(device); } break; case I8271_COMMAND_READ_ID: { i8271->Counter--; if (i8271->Counter==0) { i8271_timed_command_complete(device); return; } i8271_do_read_id(device); } break; default: break; } }