From 826e70c1319cf553adc4b419f92120231c06f141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 28 Oct 2024 10:47:32 +0100 Subject: [PATCH] Increase the hardcoded free space reported by sceIoDevctl to 1.5 GB Should (mostly) take care of #19539 --- Core/HLE/sceIo.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index b04dbdce0205..292a3eba4a30 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -80,6 +80,10 @@ static const int ERROR_ERRNO_IO_ERROR = 0x80010005; static const int ERROR_MEMSTICK_DEVCTL_BAD_PARAMS = 0x80220081; static const int ERROR_MEMSTICK_DEVCTL_TOO_MANY_CALLBACKS = 0x80220082; static const int ERROR_PGD_INVALID_HEADER = 0x80510204; + +// TODO: Should actually report the real free space like we do in the savedata code. +static constexpr int FAKE_FREE_SPACE = (1024 + 512) * 1024 * 1024; + /* TODO: async io is missing features! @@ -1853,7 +1857,8 @@ static u32 sceIoDevctl(const char *name, int cmd, u32 argAddr, int argLen, u32 o u32 sectorSize = 0x200; u32 memStickSectorSize = 32 * 1024; u32 sectorCount = memStickSectorSize / sectorSize; - u64 freeSize = 1 * 1024 * 1024 * 1024; + + u64 freeSize = FAKE_FREE_SPACE; auto deviceSize = PSPPointer::Create(pointer); if (deviceSize.IsValid()) { @@ -1992,7 +1997,7 @@ static u32 sceIoDevctl(const char *name, int cmd, u32 argAddr, int argLen, u32 o u32 sectorSize = 0x200; u32 memStickSectorSize = 32 * 1024; u32 sectorCount = memStickSectorSize / sectorSize; - u64 freeSize = 1 * 1024 * 1024 * 1024; + u64 freeSize = FAKE_FREE_SPACE; auto deviceSize = PSPPointer::Create(pointer); if (deviceSize.IsValid()) {