Fixed more CD-ROM bugs.

This commit is contained in:
OBattler
2018-03-17 23:01:06 +01:00
parent f2460dc534
commit d1c3170756
3 changed files with 14 additions and 16 deletions

View File

@@ -9,7 +9,7 @@
* Implementation of the CD-ROM drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage.
*
* Version: @(#)cdrom.c 1.0.37 2018/03/17
* Version: @(#)cdrom.c 1.0.38 2018/03/17
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
@@ -451,8 +451,6 @@ void cdrom_init(int id, int cdb_len_setting)
if (id >= CDROM_NUM)
return;
if (!cdrom[id])
cdrom[id] = (cdrom_t *) malloc(sizeof(cdrom_t));
dev = cdrom[id];
memset(dev, 0, sizeof(cdrom_t));
dev->requested_blocks = 1;
@@ -856,16 +854,16 @@ static void cdrom_command_common(uint8_t id)
switch(dev->current_cdb[0]) {
case 0x0b:
case 0x2b:
/* Seek time is in ms. */
period = cdrom_seek_time(id) * ((double) TIMER_USEC) * 1000.0;
/* Seek time is in us. */
period = cdrom_seek_time(id) * ((double) TIMER_USEC);
dev->callback += ((int64_t) period);
cdrom_set_callback(id);
return;
case 0x08:
case 0x28:
case 0xa8:
/* Seek time is in ms. */
period = cdrom_seek_time(id) * ((double) TIMER_USEC) * 1000.0;
/* Seek time is in us. */
period = cdrom_seek_time(id) * ((double) TIMER_USEC);
dev->callback += ((int64_t) period);
case 0x25:
case 0x42:

View File

@@ -9,7 +9,7 @@
* Implementation of the IDE emulation for hard disks and ATAPI
* CD-ROM devices.
*
* Version: @(#)hdc_ide.c 1.0.38 2018/03/16
* Version: @(#)hdc_ide.c 1.0.39 2018/03/17
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -1515,14 +1515,14 @@ void writeide(int ide_board, uint16_t addr, uint8_t val)
zip[atapi_zip_drives[ide->channel]].packet_status = ZIP_PHASE_IDLE;
zip[atapi_zip_drives[ide->channel]].pos=0;
zip[atapi_zip_drives[ide->channel]].phase = 1;
zip[atapi_zip_drives[ide->channel]].status = READY_STAT | DRQ_STAT | (zip[cur_ide[ide_board]].status & ERR_STAT);
zip[atapi_zip_drives[ide->channel]].status = READY_STAT | DRQ_STAT | (zip[atapi_zip_drives[ide->channel]].status & ERR_STAT);
}
else if (ide_drive_is_cdrom(ide))
{
cdrom[atapi_cdrom_drives[ide->channel]]->packet_status = CDROM_PHASE_IDLE;
cdrom[atapi_cdrom_drives[ide->channel]]->pos=0;
cdrom[atapi_cdrom_drives[ide->channel]]->phase = 1;
cdrom[atapi_cdrom_drives[ide->channel]]->status = READY_STAT | DRQ_STAT | (cdrom[cur_ide[ide_board]]->status & ERR_STAT);
cdrom[atapi_cdrom_drives[ide->channel]]->status = READY_STAT | DRQ_STAT | (cdrom[atapi_cdrom_drives[ide->channel]]->status & ERR_STAT);
}
else
{

View File

@@ -665,13 +665,13 @@ again2:
hdc_init(hdc_name);
cdrom_hard_reset();
zip_hard_reset();
ide_reset_hard();
scsi_card_init();
cdrom_hard_reset();
zip_hard_reset();
pc_full_speed();
shadowbios = 0;
@@ -817,15 +817,15 @@ pc_reset_hard_init(void)
/* Reset the video card. */
video_reset(gfxcard);
cdrom_hard_reset();
zip_hard_reset();
/* Reset the Hard Disk Controller module. */
hdc_reset();
/* Reset and reconfigure the SCSI layer. */
scsi_card_init();
cdrom_hard_reset();
zip_hard_reset();
/* Reset and reconfigure the Network Card layer. */
network_reset();