mirror of
https://github.com/86Box/86Box.git
synced 2026-02-24 10:28:19 -07:00
Apply the dynamic SCSI buffer window sizing fix to MO, removable disk, and CD-ROM as well.
This commit is contained in:
@@ -857,11 +857,18 @@ scsi_cdrom_unit_attention(scsi_cdrom_t *dev)
|
||||
static void
|
||||
scsi_cdrom_buf_alloc(scsi_cdrom_t *dev, const uint32_t len)
|
||||
{
|
||||
if (dev->buffer == NULL)
|
||||
dev->buffer = (uint8_t *) malloc(len);
|
||||
scsi_cdrom_log(dev->log, "Allocated buffer length: %i\n", len);
|
||||
|
||||
scsi_cdrom_log(dev->log, "Allocated buffer length: %i, buffer = %p\n",
|
||||
len, dev->buffer);
|
||||
if (dev->buffer == NULL) {
|
||||
dev->buffer = (uint8_t *) malloc(len);
|
||||
dev->buffer_sz = len;
|
||||
}
|
||||
|
||||
if (len > dev->buffer_sz) {
|
||||
uint8_t *buf = (uint8_t *) realloc(dev->buffer, len);
|
||||
dev->buffer = buf;
|
||||
dev->buffer_sz = len;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -623,10 +623,12 @@ static void
|
||||
scsi_disk_buf_alloc(scsi_disk_t *dev, uint32_t len)
|
||||
{
|
||||
scsi_disk_log(dev->log, "Allocated buffer length: %i\n", len);
|
||||
|
||||
if (dev->temp_buffer == NULL) {
|
||||
dev->temp_buffer = (uint8_t *) malloc(len);
|
||||
dev->temp_buffer_sz = len;
|
||||
}
|
||||
|
||||
if (len > dev->temp_buffer_sz) {
|
||||
uint8_t *buf = (uint8_t *) realloc(dev->temp_buffer, len);
|
||||
dev->temp_buffer = buf;
|
||||
|
||||
Reference in New Issue
Block a user