diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7d6daff9c..4e2a2313d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,6 +22,7 @@ endif() add_executable(86Box 86box.c + all_devices.c config.c log.c random.c diff --git a/src/cdrom/cdrom.c b/src/cdrom/cdrom.c index 5ddd788cb..2c439e76a 100644 --- a/src/cdrom/cdrom.c +++ b/src/cdrom/cdrom.c @@ -22,6 +22,7 @@ #include #include #include +#include #include <86box/86box.h> #include <86box/device.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: dev->cd_end = pos2; break; - case 0x40: + case 0x40: { const int m = bcd2bin((pos >> 24) & 0xff); const int s = bcd2bin((pos >> 16) & 0xff); const int f = bcd2bin((pos >> 8) & 0xff); pos2 = MSFtoLBA(m, s, f) - 150; dev->cd_end = pos2; break; - case 0x80: + } case 0x80: dev->cd_end = (pos2 >> 24) & 0xff; break; case 0xc0: @@ -1572,7 +1573,7 @@ cdrom_audio_scan(cdrom_t *dev, const uint32_t pos, const int type) } dev->seek_pos = pos2; break; - case 0x40: + case 0x40: { const int m = bcd2bin((pos >> 24) & 0xff); const int s = bcd2bin((pos >> 16) & 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; break; - case 0x80: + } case 0x80: dev->seek_pos = (pos >> 24) & 0xff; break; default: diff --git a/src/cdrom/cdrom_image.c b/src/cdrom/cdrom_image.c index e4a425c78..ba4f0164a 100644 --- a/src/cdrom/cdrom_image.c +++ b/src/cdrom/cdrom_image.c @@ -2006,6 +2006,8 @@ image_open(cdrom_t *dev, const char *path) int ret; const int is_cue = ((ext == 4) && !stricmp(path + strlen(path) - ext + 1, "CUE")); + img->dev = dev; + if (is_cue) { 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); img->log = log_open(n); - img->dev = dev; - dev->ops = &image_ops; } } diff --git a/src/qt/dummy_cdrom_ioctl.c b/src/qt/dummy_cdrom_ioctl.c index c85628e01..a0f95f213 100644 --- a/src/qt/dummy_cdrom_ioctl.c +++ b/src/qt/dummy_cdrom_ioctl.c @@ -30,7 +30,7 @@ #include <86box/cdrom.h> #include <86box/log.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: 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 diff --git a/src/unix/dummy_cdrom_ioctl.c b/src/unix/dummy_cdrom_ioctl.c index c85628e01..a0f95f213 100644 --- a/src/unix/dummy_cdrom_ioctl.c +++ b/src/unix/dummy_cdrom_ioctl.c @@ -30,7 +30,7 @@ #include <86box/cdrom.h> #include <86box/log.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: 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