ZuluSCSI / ZuluSCSI-firmware

Firmware for the ZuluSCSI advanced SCSI emulator
https://zuluscsi.com
Other
184 stars 20 forks source link

Adjust logic for supported vendor commands #434

Closed morio closed 4 months ago

morio commented 4 months ago

There isn't any functional change in this fix, just a rearrangement with if else statements to address this issue: https://github.com/ZuluSCSI/ZuluSCSI-firmware/issues/432 Also a for loop wasn't initialized in src/ZuluSCSI.cpp, set the counter to 0.

saybur commented 4 months ago

Sorry, I wasn't being very helpful with my link in the issue. If that linked comment's intent is right, then I think the problem is actually here:

https://github.com/ZuluSCSI/ZuluSCSI-firmware/blob/3b81282639c2e9df3eb45a1b6581ba7624287ce3/lib/SCSI2SD/src/firmware/scsi.c#L604

Where the CD-ROM handler is being called and resolves the command before the vendor handler is called:

https://github.com/ZuluSCSI/ZuluSCSI-firmware/blob/3b81282639c2e9df3eb45a1b6581ba7624287ce3/lib/SCSI2SD/src/firmware/scsi.c#L639

morio commented 4 months ago

Ahh yeah, I see the issue. Thanks! I could add a !scsiToolboxEnabled() to the three CD commands. It probably make more sense to move https://github.com/ZuluSCSI/ZuluSCSI-firmware/blob/3b81282639c2e9df3eb45a1b6581ba7624287ce3/lib/SCSI2SD/src/firmware/vendor.c#L174-L177 into the scsi.c above the specific device handling.