subrepo:
  subdir:   "emummc"
  merged:   "c6717b93"
upstream:
  origin:   "https://github.com/m4xw/emummc"
  branch:   "develop"
  commit:   "c6717b93"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
This commit is contained in:
Michael Scire 2021-05-10 07:50:39 -07:00
parent bf8de39e69
commit 3f3aaa01fa
2 changed files with 9 additions and 9 deletions

View file

@ -300,21 +300,21 @@ static uint64_t emummc_read_write_inner(void *buf, unsigned int sector, unsigned
while (remaining > 0) {
const unsigned int cur_sectors = MIN(remaining, f_emu.part_size - sector);
if (f_lseek(fp, sector << 9) != FR_OK)
if (f_lseek(fp, (u64)sector << 9) != FR_OK)
return 0; // Out of bounds.
if (is_write)
{
if (f_write_fast(fp, buf, cur_sectors << 9) != FR_OK)
if (f_write_fast(fp, buf, (u64)cur_sectors << 9) != FR_OK)
return 0;
}
else
{
if (f_read_fast(fp, buf, cur_sectors << 9) != FR_OK)
if (f_read_fast(fp, buf, (u64)cur_sectors << 9) != FR_OK)
return 0;
}
buf = (char *)buf + (cur_sectors << 9);
buf = (char *)buf + ((u64)cur_sectors << 9);
remaining -= cur_sectors;
sector = 0;
++fp;
@ -336,14 +336,14 @@ static uint64_t emummc_read_write_inner(void *buf, unsigned int sector, unsigned
break;
}
if (f_lseek(fp, sector << 9) != FR_OK)
if (f_lseek(fp, (u64)sector << 9) != FR_OK)
return 0; // Out of bounds.
uint64_t res = 0;
if (!is_write)
res = !f_read_fast(fp, buf, num_sectors << 9);
res = !f_read_fast(fp, buf, (u64)num_sectors << 9);
else
res = !f_write_fast(fp, buf, num_sectors << 9);
res = !f_write_fast(fp, buf, (u64)num_sectors << 9);
return res;
}