From c63f9e23a765f7694acb32f3e65f91cd855e4b61 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 19 Nov 2022 23:40:14 +0100 Subject: [PATCH] ATAPI CD-ROM normal model now identifies as a SONY CDU-76 when the machine is a Sony, the Sony Vaio recovery disk should now work. --- src/include/86box/machine.h | 1 + src/machine/machine_table.c | 6 ++++++ src/scsi/scsi_cdrom.c | 12 ++++++++++++ 3 files changed, 19 insertions(+) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 207cbde62..596972ded 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -340,6 +340,7 @@ extern int machine_get_ram_granularity(int m); extern int machine_get_type(int m); extern void machine_close(void); extern int machine_has_mouse(void); +extern int machine_is_sony(void); extern uint8_t machine_get_p1(void); extern void machine_load_p1(int m); diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 06b00dbef..0b846e784 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -12139,3 +12139,9 @@ machine_has_mouse(void) { return (machines[machine].flags & MACHINE_MOUSE); } + +int +machine_is_sony(void) +{ + return (!strcmp(machines[machine].internal_name, "pcv90")); +} diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index f6924864d..80ff4184a 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -30,6 +30,7 @@ #include <86box/device.h> #include <86box/scsi.h> #include <86box/scsi_device.h> +#include <86box/machine.h> #include <86box/nvr.h> #include <86box/hdc.h> #include <86box/hdc_ide.h> @@ -2373,6 +2374,8 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) } else { if (dev->early) ide_padstr8(dev->buffer + idx, 8, "NEC"); /* Vendor */ + else if (machine_is_sony()) + ide_padstr8(dev->buffer + idx, 8, "SONY"); /* Vendor */ else ide_padstr8(dev->buffer + idx, 8, "HITACHI"); /* Vendor */ } @@ -2389,6 +2392,8 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) } else { if (dev->early) ide_padstr8(dev->buffer + idx, 40, "CD-ROM DRIVE:260"); /* Product */ + else if (machine_is_sony()) + ide_padstr8(dev->buffer + idx, 40, "CD-ROM CDU76"); /* Product */ else ide_padstr8(dev->buffer + idx, 40, "CDR-8130"); /* Product */ } @@ -2446,6 +2451,10 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb) ide_padstr8(dev->buffer + 8, 8, "NEC"); /* Vendor */ ide_padstr8(dev->buffer + 16, 16, "CD-ROM DRIVE:260"); /* Product */ ide_padstr8(dev->buffer + 32, 4, "1.01"); /* Revision */ + } else if (machine_is_sony()) { + ide_padstr8(dev->buffer + 8, 8, "SONY"); /* Vendor */ + ide_padstr8(dev->buffer + 16, 16, "CD-ROM CDU76"); /* Product */ + ide_padstr8(dev->buffer + 32, 4, "1.0i"); /* Revision */ } else { ide_padstr8(dev->buffer + 8, 8, "HITACHI"); /* Vendor */ ide_padstr8(dev->buffer + 16, 16, "CDR-8130"); /* Product */ @@ -2749,6 +2758,9 @@ scsi_cdrom_identify(ide_t *ide, int ide_has_dma) ide_padstr((char *) (ide->buffer + 23), ".110 ", 8); /* Firmware */ ide_padstr((char *) (ide->buffer + 27), "EN C DCR-MOD IREV2:06 ", 40); /* Model */ # endif + } else if (machine_is_sony()) { + ide_padstr((char *) (ide->buffer + 23), "1.0i ", 8); /* Firmware */ + ide_padstr((char *) (ide->buffer + 27), "CD-ROM CDU76 ", 40); /* Model */ } else { ide_padstr((char *) (ide->buffer + 23), "0020 ", 8); /* Firmware */ ide_padstr((char *) (ide->buffer + 27), "HITACHI CDR-8130 ", 40); /* Model */