sys_memory: Lower maximum size for memory block to fake OS size - Report available memory minus another fake block that can be used for the OS

This commit is contained in:
Jake 2017-11-30 21:01:09 -06:00 committed by kd-11
parent c424652b43
commit 17cf24d0ed
2 changed files with 8 additions and 2 deletions

View file

@ -264,7 +264,11 @@ error_code sys_memory_container_get_size(vm::ptr<sys_memory_info_t> mem_info, u3
}
mem_info->total_user_memory = ct->size; // Total container memory
mem_info->available_user_memory = ct->size - ct->used; // Available container memory
// Available container memory, minus a hidden 'buffer'
// This buffer seems to be used by the PS3 OS for c style 'mallocs'
// Todo: Research this more, even though we dont use this buffer, it helps out games when calculating
// expected memory they can use allowing them to boot
mem_info->available_user_memory = ct->size - ct->used - 0x1000000;
return CELL_OK;
}

View file

@ -50,7 +50,9 @@ struct lv2_memory_container
static const u32 id_step = 0x1;
static const u32 id_count = 16;
const u32 size = 0x10000000; // Amount of "physical" memory in this container
// This is purposely set lower to fake the size of the OS
// Todo: This could change with requested sdk
const u32 size = 0xEC00000; // Amount of "physical" memory in this container
atomic_t<u32> used{}; // Amount of "physical" memory currently used