bochs: catch division by zero in floppy controller
This change fixes another Bochs crash in the floppy controller, triggered by one out of 670 million experiments in my current campaign. Change-Id: I8a2ff78c9d2c8fca12eefb97f508bc213373bbfa
This commit is contained in:
@ -1274,6 +1274,12 @@ void bx_floppy_ctrl_c::dma_write(Bit8u *data_byte)
|
|||||||
if (!(BX_FD_THIS s.main_status_reg & FD_MS_NDMA)) {
|
if (!(BX_FD_THIS s.main_status_reg & FD_MS_NDMA)) {
|
||||||
DEV_dma_set_drq(FLOPPY_DMA_CHAN, 0);
|
DEV_dma_set_drq(FLOPPY_DMA_CHAN, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DanceOS
|
||||||
|
if (BX_FD_THIS s.media[drive].sectors_per_track == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// time to read one sector at 300 rpm
|
// time to read one sector at 300 rpm
|
||||||
sector_time = 200000 / BX_FD_THIS s.media[drive].sectors_per_track;
|
sector_time = 200000 / BX_FD_THIS s.media[drive].sectors_per_track;
|
||||||
bx_pc_system.activate_timer(BX_FD_THIS s.floppy_timer_index,
|
bx_pc_system.activate_timer(BX_FD_THIS s.floppy_timer_index,
|
||||||
|
|||||||
Reference in New Issue
Block a user