Skip to content

Commit

Permalink
Fix reported length and set device profile when image present.
Browse files Browse the repository at this point in the history
  • Loading branch information
saybur committed Jun 9, 2023
1 parent 38dfef8 commit 276d19b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/ZuluSCSI_cdrom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,8 @@ void doGetConfiguration(uint8_t rt, uint16_t startFeature, uint16_t allocationLe
if (!img.ejected)
{
// disk in drive, current profile is CD-ROM
scsiDev.data[6] = 0;
scsiDev.data[7] = 0; // TODO
scsiDev.data[6] = 0x00;
scsiDev.data[7] = 0x08;
}
else
{
Expand Down Expand Up @@ -1089,10 +1089,11 @@ void doGetConfiguration(uint8_t rt, uint16_t startFeature, uint16_t allocationLe
#endif

// finally, rewrite data length to match
scsiDev.data[0] = len >> 24;
scsiDev.data[1] = len >> 16;
scsiDev.data[2] = len >> 8;
scsiDev.data[3] = len;
uint32_t dlen = len - 8;
scsiDev.data[0] = dlen >> 24;
scsiDev.data[1] = dlen >> 16;
scsiDev.data[2] = dlen >> 8;
scsiDev.data[3] = dlen;

if (len > allocationLength)
{
Expand Down

0 comments on commit 276d19b

Please sign in to comment.