Hi Eero and Andreas,
Just let me try to summarize what I would suggest to change in a first step:
1. If you want to retain SCSI-1 compatibility, which is not the standard most
Atari software and hardware is using: For REQUEST SENSE nly return 4 bytes
if the allocation length is *exactly* 0, i.e. do not say "<= 4" but "== 0".
2. In any other case return as much sense data as you have, but never more
than the amount of bytes requested in the allocation length field.
3. For any other command there is no special rule for length 0.
If too many bytes are returned the initiator may crash because of a buffer
overflow, or other strange things may happen.