PSX: match user_io buffer size to chd hunk size

This commit is contained in:
Zakk
2024-03-12 19:53:45 -04:00
parent 3a0d20577e
commit 9d7f739e34
3 changed files with 17 additions and 0 deletions

View File

@@ -3118,6 +3118,13 @@ void user_io_poll()
else if (op & 1)
{
uint32_t buf_n = sizeof(buffer[0]) / blksz;
int psx_blksz = 0;
if (is_psx() && blksz == 2352)
{
//returns 0 if the mounted disk is not a chd, otherwise returns the chd hunksize in bytes
psx_blksz = psx_chd_hunksize();
if (psx_blksz && psx_blksz <= sizeof(buffer[0])) buf_n = psx_blksz / blksz;
}
//printf("SD RD (%llu,%d) on %d, WIDE=%d\n", lba, blksz, disk, fio_size);
int done = 0;