mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
Various SCSI devices register state items by their disk ID, which are not unique across device types. This introduces a device-type offset for CD-ROMs so their registrations don't clash with harddisks.
This commit is contained in:
parent
cb87356d5c
commit
2a869f8673
@ -741,8 +741,8 @@ static int scsicd_dispatch(int operation, void *file, INT64 intparm, void *ptrpa
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case SCSIOP_ALLOC_INSTANCE:
|
case SCSIOP_ALLOC_INSTANCE:
|
||||||
SCSIBase( &SCSIClassCDROM, operation, file, intparm, ptrparm );
|
SCSIBase( &SCSIClassCDROM, operation, file, intparm + SCSI_DEVICE_CDROM_STATE_BASE, ptrparm );
|
||||||
scsicd_alloc_instance( *((SCSIInstance **) ptrparm), intparm );
|
scsicd_alloc_instance( *((SCSIInstance **) ptrparm), intparm + SCSI_DEVICE_CDROM_STATE_BASE );
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case SCSIOP_DELETE_INSTANCE:
|
case SCSIOP_DELETE_INSTANCE:
|
||||||
|
@ -13,5 +13,10 @@
|
|||||||
extern const SCSIClass SCSIClassCDROM;
|
extern const SCSIClass SCSIClassCDROM;
|
||||||
#define SCSI_DEVICE_CDROM &SCSIClassCDROM
|
#define SCSI_DEVICE_CDROM &SCSIClassCDROM
|
||||||
|
|
||||||
|
// we pass in the disk ID for each SCSI device, but that's not unique across device types.
|
||||||
|
// to avoid collisions, each non-HDD SCSI device type should have it's own BASE to prevent
|
||||||
|
// this problem.
|
||||||
|
#define SCSI_DEVICE_CDROM_STATE_BASE (32)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user