Revision a136e5a8 hw/ide.c

b/hw/ide.c
550 550
    int ret, n;
551 551

  
552 552
    s->status = READY_STAT | SEEK_STAT;
553
    s->error = 0; /* not needed by IDE spec, but needed by Windows */
553 554
    sector_num = ide_get_sector(s);
554 555
    n = s->nsector;
555 556
    if (n == 0) {
......
694 695
                if (byte_count_limit & 1)
695 696
                    byte_count_limit--;
696 697
                size = byte_count_limit;
697
            } else {
698
                s->lcyl = size;
699
                s->hcyl = size >> 8;
700 698
            }
699
            s->lcyl = size;
700
            s->hcyl = size >> 8;
701 701
            s->elementary_transfer_size = size;
702 702
            /* we cannot transmit more than one sector at a time */
703 703
            if (s->lba != -1) {
......
1106 1106
            break;
1107 1107
        case WIN_SPECIFY:
1108 1108
        case WIN_RECAL:
1109
            s->error = 0;
1109 1110
            s->status = READY_STAT;
1110 1111
            ide_set_irq(s);
1111 1112
            break;
......
1135 1136
            break;
1136 1137
        case WIN_WRITE:
1137 1138
        case WIN_WRITE_ONCE:
1139
            s->error = 0;
1138 1140
            s->status = SEEK_STAT;
1139 1141
            s->req_nb_sectors = 1;
1140 1142
            ide_transfer_start(s, s->io_buffer, 512, ide_sector_write);
......
1148 1150
        case WIN_MULTWRITE:
1149 1151
            if (!s->mult_sectors)
1150 1152
                goto abort_cmd;
1153
            s->error = 0;
1151 1154
            s->status = SEEK_STAT;
1152 1155
            s->req_nb_sectors = s->mult_sectors;
1153 1156
            n = s->nsector;
......
1160 1163
            s->status = READY_STAT;
1161 1164
            ide_set_irq(s);
1162 1165
            break;
1166
        case WIN_CHECKPOWERMODE1:
1167
            s->nsector = 0xff; /* device active or idle */
1168
            s->status = READY_STAT;
1169
            ide_set_irq(s);
1170
            break;
1163 1171

  
1164 1172
            /* ATAPI commands */
1165 1173
        case WIN_PIDENTIFY:

Also available in: Unified diff