Fixed CD-ROM image mounting crashes and, hopefully, Linux compiles.
This commit is contained in:
@@ -22,6 +22,7 @@ endif()
|
|||||||
|
|
||||||
add_executable(86Box
|
add_executable(86Box
|
||||||
86box.c
|
86box.c
|
||||||
|
all_devices.c
|
||||||
config.c
|
config.c
|
||||||
log.c
|
log.c
|
||||||
random.c
|
random.c
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <wchar.h>
|
||||||
#include <86box/86box.h>
|
#include <86box/86box.h>
|
||||||
#include <86box/device.h>
|
#include <86box/device.h>
|
||||||
#include <86box/config.h>
|
#include <86box/config.h>
|
||||||
@@ -1522,14 +1523,14 @@ cdrom_audio_play_toshiba(cdrom_t *dev, const uint32_t pos, const int type)
|
|||||||
case 0x00:
|
case 0x00:
|
||||||
dev->cd_end = pos2;
|
dev->cd_end = pos2;
|
||||||
break;
|
break;
|
||||||
case 0x40:
|
case 0x40: {
|
||||||
const int m = bcd2bin((pos >> 24) & 0xff);
|
const int m = bcd2bin((pos >> 24) & 0xff);
|
||||||
const int s = bcd2bin((pos >> 16) & 0xff);
|
const int s = bcd2bin((pos >> 16) & 0xff);
|
||||||
const int f = bcd2bin((pos >> 8) & 0xff);
|
const int f = bcd2bin((pos >> 8) & 0xff);
|
||||||
pos2 = MSFtoLBA(m, s, f) - 150;
|
pos2 = MSFtoLBA(m, s, f) - 150;
|
||||||
dev->cd_end = pos2;
|
dev->cd_end = pos2;
|
||||||
break;
|
break;
|
||||||
case 0x80:
|
} case 0x80:
|
||||||
dev->cd_end = (pos2 >> 24) & 0xff;
|
dev->cd_end = (pos2 >> 24) & 0xff;
|
||||||
break;
|
break;
|
||||||
case 0xc0:
|
case 0xc0:
|
||||||
@@ -1572,7 +1573,7 @@ cdrom_audio_scan(cdrom_t *dev, const uint32_t pos, const int type)
|
|||||||
}
|
}
|
||||||
dev->seek_pos = pos2;
|
dev->seek_pos = pos2;
|
||||||
break;
|
break;
|
||||||
case 0x40:
|
case 0x40: {
|
||||||
const int m = bcd2bin((pos >> 24) & 0xff);
|
const int m = bcd2bin((pos >> 24) & 0xff);
|
||||||
const int s = bcd2bin((pos >> 16) & 0xff);
|
const int s = bcd2bin((pos >> 16) & 0xff);
|
||||||
const int f = bcd2bin((pos >> 8) & 0xff);
|
const int f = bcd2bin((pos >> 8) & 0xff);
|
||||||
@@ -1584,7 +1585,7 @@ cdrom_audio_scan(cdrom_t *dev, const uint32_t pos, const int type)
|
|||||||
|
|
||||||
dev->seek_pos = pos2;
|
dev->seek_pos = pos2;
|
||||||
break;
|
break;
|
||||||
case 0x80:
|
} case 0x80:
|
||||||
dev->seek_pos = (pos >> 24) & 0xff;
|
dev->seek_pos = (pos >> 24) & 0xff;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -2006,6 +2006,8 @@ image_open(cdrom_t *dev, const char *path)
|
|||||||
int ret;
|
int ret;
|
||||||
const int is_cue = ((ext == 4) && !stricmp(path + strlen(path) - ext + 1, "CUE"));
|
const int is_cue = ((ext == 4) && !stricmp(path + strlen(path) - ext + 1, "CUE"));
|
||||||
|
|
||||||
|
img->dev = dev;
|
||||||
|
|
||||||
if (is_cue) {
|
if (is_cue) {
|
||||||
ret = image_load_cue(img, path);
|
ret = image_load_cue(img, path);
|
||||||
|
|
||||||
@@ -2029,8 +2031,6 @@ image_open(cdrom_t *dev, const char *path)
|
|||||||
sprintf(n, "CD-ROM %i Image", dev->id + 1);
|
sprintf(n, "CD-ROM %i Image", dev->id + 1);
|
||||||
img->log = log_open(n);
|
img->log = log_open(n);
|
||||||
|
|
||||||
img->dev = dev;
|
|
||||||
|
|
||||||
dev->ops = &image_ops;
|
dev->ops = &image_ops;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#include <86box/cdrom.h>
|
#include <86box/cdrom.h>
|
||||||
#include <86box/log.h>
|
#include <86box/log.h>
|
||||||
#include <86box/plat_unused.h>
|
#include <86box/plat_unused.h>
|
||||||
#include <86box/plat_cdrom.h>
|
#include <86box/plat_cdrom_ioctl.h>
|
||||||
|
|
||||||
/* The addresses sent from the guest are absolute, ie. a LBA of 0 corresponds to a MSF of 00:00:00. Otherwise, the counter displayed by the guest is wrong:
|
/* The addresses sent from the guest are absolute, ie. a LBA of 0 corresponds to a MSF of 00:00:00. Otherwise, the counter displayed by the guest is wrong:
|
||||||
there is a seeming 2 seconds in which audio plays but counter does not move, while a data track before audio jumps to 2 seconds before the actual start
|
there is a seeming 2 seconds in which audio plays but counter does not move, while a data track before audio jumps to 2 seconds before the actual start
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#include <86box/cdrom.h>
|
#include <86box/cdrom.h>
|
||||||
#include <86box/log.h>
|
#include <86box/log.h>
|
||||||
#include <86box/plat_unused.h>
|
#include <86box/plat_unused.h>
|
||||||
#include <86box/plat_cdrom.h>
|
#include <86box/plat_cdrom_ioctl.h>
|
||||||
|
|
||||||
/* The addresses sent from the guest are absolute, ie. a LBA of 0 corresponds to a MSF of 00:00:00. Otherwise, the counter displayed by the guest is wrong:
|
/* The addresses sent from the guest are absolute, ie. a LBA of 0 corresponds to a MSF of 00:00:00. Otherwise, the counter displayed by the guest is wrong:
|
||||||
there is a seeming 2 seconds in which audio plays but counter does not move, while a data track before audio jumps to 2 seconds before the actual start
|
there is a seeming 2 seconds in which audio plays but counter does not move, while a data track before audio jumps to 2 seconds before the actual start
|
||||||
|
|||||||
Reference in New Issue
Block a user