From 961ae0b8b7a321363f1be4c268ab2f74f367b39c Mon Sep 17 00:00:00 2001 From: Glenn Anderson Date: Tue, 19 Apr 2022 10:14:23 -0700 Subject: [PATCH] Support for images larger than 4GB --- src/BlueSCSI.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/BlueSCSI.cpp b/src/BlueSCSI.cpp index 2ac79b6..32c60cc 100644 --- a/src/BlueSCSI.cpp +++ b/src/BlueSCSI.cpp @@ -966,8 +966,8 @@ void writeDataPhaseSD(uint32_t adds, uint32_t len) SCSI_PHASE_CHANGE(SCSI_PHASE_DATAIN); //Bus settle delay 400ns, file.seek() measured at over 1000ns. - uint32_t pos = adds * m_img->m_blocksize; - m_img->m_file.seek(pos); + uint64_t pos = (uint64_t)adds * m_img->m_blocksize; + m_img->m_file.seekSet(pos); SCSI_DB_OUTPUT() for(uint32_t i = 0; i < len; i++) { @@ -1061,8 +1061,8 @@ void readDataPhaseSD(uint32_t adds, uint32_t len) SCSI_PHASE_CHANGE(SCSI_PHASE_DATAOUT); //Bus settle delay 400ns, file.seek() measured at over 1000ns. - uint32_t pos = adds * m_img->m_blocksize; - m_img->m_file.seek(pos); + uint64_t pos = (uint64_t)adds * m_img->m_blocksize; + m_img->m_file.seekSet(pos); for(uint32_t i = 0; i < len; i++) { m_resetJmp = true; #if WRITE_SPEED_OPTIMIZE @@ -1093,8 +1093,8 @@ void verifyDataPhaseSD(uint32_t adds, uint32_t len) SCSI_PHASE_CHANGE(SCSI_PHASE_DATAOUT); //Bus settle delay 400ns, file.seek() measured at over 1000ns. - uint32_t pos = adds * m_img->m_blocksize; - m_img->m_file.seek(pos); + uint64_t pos = (uint64_t)adds * m_img->m_blocksize; + m_img->m_file.seekSet(pos); for(uint32_t i = 0; i < len; i++) { #if WRITE_SPEED_OPTIMIZE readDataLoop(m_img->m_blocksize, m_buf);