Skip to content

Commit

Permalink
vita: Reduce ARAM size to minimum
Browse files Browse the repository at this point in the history
Allows us to take more memory for the heap
  • Loading branch information
bythos14 authored and scribam committed Jul 7, 2024
1 parent fd3a707 commit 38d5057
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/linux-dist/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <vitaGL.h>
#include <kubridge.h>
#include <xxhash.h>
int _newlib_heap_size_user = 246 * 1024 * 1024;
int _newlib_heap_size_user = 250 * 1024 * 1024;
unsigned int sceUserMainThreadStackSize = 1 * 1024 * 1024;
bool is_standalone = false;

Expand Down
4 changes: 2 additions & 2 deletions core/linux/vita_vmem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ static SceUID vmem_block = -1;
bool init(void **vmem_base_addr, void **sh4rcb_addr, size_t ramSize)
{

// Now try to allocate a contiguous piece of memory.
reserved_size = 512 * 1024 * 1024 + ALIGN(sizeof(Sh4RCB), PAGE_SIZE) + ARAM_SIZE_MAX;
// Now try to allocate a contiguous piece of memory. Extra 8MB is for ARAM mapping at 0x20000000
reserved_size = 512 * 1024 * 1024 + ALIGN(sizeof(Sh4RCB), PAGE_SIZE) + 8_MB;
reserved_base = nullptr;
reserved_block = kuKernelMemReserve(&reserved_base, reserved_size, SCE_KERNEL_MEMBLOCK_TYPE_USER_RW);
verify(reserved_block >= 0);
Expand Down
3 changes: 2 additions & 1 deletion core/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,10 @@ constexpr size_t operator""_GB(unsigned long long x)
#ifndef __vita__
constexpr u32 RAM_SIZE_MAX = 32_MB;
constexpr u32 VRAM_SIZE_MAX = 16_MB;
constexpr u32 ARAM_SIZE_MAX = 8_MB;
#else // Vita does not target Atomiswave/Naomi
constexpr u32 RAM_SIZE_MAX = 16_MB;
constexpr u32 VRAM_SIZE_MAX = 8_MB;
constexpr u32 ARAM_SIZE_MAX = 2_MB;
#endif
constexpr u32 ARAM_SIZE_MAX = 8_MB;

0 comments on commit 38d5057

Please sign in to comment.