Commit 1b8eb456ebd74aefeca5eb5204e85582b59f581e

Authored by bellard
1 parent d720b93d

avoid error if too many sectors in non LBA mode


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@746 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 1 additions and 1 deletions
hw/ide.c
@@ -517,7 +517,7 @@ static void ide_set_sector(IDEState *s, int64_t sector_num) @@ -517,7 +517,7 @@ static void ide_set_sector(IDEState *s, int64_t sector_num)
517 r = sector_num % (s->heads * s->sectors); 517 r = sector_num % (s->heads * s->sectors);
518 s->hcyl = cyl >> 8; 518 s->hcyl = cyl >> 8;
519 s->lcyl = cyl; 519 s->lcyl = cyl;
520 - s->select = (s->select & 0xf0) | (r / s->sectors); 520 + s->select = (s->select & 0xf0) | ((r / s->sectors) & 0x0f);
521 s->sector = (r % s->sectors) + 1; 521 s->sector = (r % s->sectors) + 1;
522 } 522 }
523 } 523 }