mirror of
https://github.com/holub/mame
synced 2025-07-03 00:56:03 +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
@ -735,14 +735,14 @@ static int scsicd_dispatch(int operation, void *file, INT64 intparm, void *ptrpa
|
||||
case SCSIOP_READ_DATA:
|
||||
scsicd_read_data( file, ptrparm, intparm );
|
||||
return 0;
|
||||
|
||||
|
||||
case SCSIOP_WRITE_DATA:
|
||||
scsicd_write_data( file, ptrparm, intparm );
|
||||
return 0;
|
||||
|
||||
case SCSIOP_ALLOC_INSTANCE:
|
||||
SCSIBase( &SCSIClassCDROM, operation, file, intparm, ptrparm );
|
||||
scsicd_alloc_instance( *((SCSIInstance **) ptrparm), intparm );
|
||||
SCSIBase( &SCSIClassCDROM, operation, file, intparm + SCSI_DEVICE_CDROM_STATE_BASE, ptrparm );
|
||||
scsicd_alloc_instance( *((SCSIInstance **) ptrparm), intparm + SCSI_DEVICE_CDROM_STATE_BASE );
|
||||
return 0;
|
||||
|
||||
case SCSIOP_DELETE_INSTANCE:
|
||||
|
@ -13,5 +13,10 @@
|
||||
extern const SCSIClass 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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user