mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-22 18:58:21 +00:00
commit
88db140c32
@ -67,7 +67,7 @@ extern char* fake_heap_start;
|
||||
extern char* fake_heap_end;
|
||||
u32 __linear_heap;
|
||||
u32 __heapBase;
|
||||
static u32 __heap_size, __linear_heap_size;
|
||||
static u32 __heap_size_local, __linear_heap_size_local;
|
||||
|
||||
extern void (*__system_retAddr)(void);
|
||||
|
||||
@ -78,18 +78,18 @@ void __libc_fini_array(void);
|
||||
void __system_allocateHeaps() {
|
||||
u32 tmp=0;
|
||||
|
||||
__heap_size = CTR_HEAP_SIZE;
|
||||
__linear_heap_size = CTR_MEMORY_MAX - (CTR_PROG_MEMSIZE + CTR_HEAP_SIZE + CTR_STACK_SIZE);
|
||||
__heap_size_local = CTR_HEAP_SIZE;
|
||||
__linear_heap_size_local = CTR_MEMORY_MAX - (CTR_PROG_MEMSIZE + CTR_HEAP_SIZE + CTR_STACK_SIZE);
|
||||
|
||||
// Allocate the application heap
|
||||
__heapBase = 0x08000000;
|
||||
svcControlMemory(&tmp, __heapBase, 0x0, __heap_size, MEMOP_ALLOC, MEMPERM_READ | MEMPERM_WRITE);
|
||||
svcControlMemory(&tmp, __heapBase, 0x0, __heap_size_local, MEMOP_ALLOC, MEMPERM_READ | MEMPERM_WRITE);
|
||||
|
||||
// Allocate the linear heap
|
||||
svcControlMemory(&__linear_heap, 0x0, 0x0, __linear_heap_size, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
|
||||
svcControlMemory(&__linear_heap, 0x0, 0x0, __linear_heap_size_local, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
|
||||
// Set up newlib heap
|
||||
fake_heap_start = (char*)__heapBase;
|
||||
fake_heap_end = fake_heap_start + __heap_size;
|
||||
fake_heap_end = fake_heap_start + __heap_size_local;
|
||||
|
||||
}
|
||||
|
||||
@ -98,10 +98,10 @@ void __attribute__((noreturn)) __libctru_exit(int rc)
|
||||
u32 tmp=0;
|
||||
|
||||
// Unmap the linear heap
|
||||
svcControlMemory(&tmp, __linear_heap, 0x0, __linear_heap_size, MEMOP_FREE, 0x0);
|
||||
svcControlMemory(&tmp, __linear_heap, 0x0, __linear_heap_size_local, MEMOP_FREE, 0x0);
|
||||
|
||||
// Unmap the application heap
|
||||
svcControlMemory(&tmp, __heapBase, 0x0, __heap_size, MEMOP_FREE, 0x0);
|
||||
svcControlMemory(&tmp, __heapBase, 0x0, __heap_size_local, MEMOP_FREE, 0x0);
|
||||
|
||||
// Close some handles
|
||||
__destroy_handle_list();
|
||||
|
@ -54,7 +54,7 @@ extern Handle gspEvents[GSPEVENT_MAX];
|
||||
extern u32* gpuCmdBuf;
|
||||
extern u32 gpuCmdBufOffset;
|
||||
extern u32 __linear_heap_size;
|
||||
extern u32* __linear_heap;
|
||||
extern u32 __linear_heap;
|
||||
|
||||
__attribute__((always_inline))
|
||||
static INLINE void ctrGuSetTexture(GPU_TEXUNIT unit, u32* data,
|
||||
@ -119,7 +119,7 @@ __attribute__((always_inline))
|
||||
static INLINE void ctrGuFlushAndRun(bool queued)
|
||||
{
|
||||
//take advantage of GX_SetCommandList_First to flush gsp heap
|
||||
ctrGuSetCommandList_First(queued, gpuCmdBuf, gpuCmdBufOffset*4, __linear_heap, __linear_heap_size, NULL, 0);
|
||||
ctrGuSetCommandList_First(queued, gpuCmdBuf, gpuCmdBufOffset*4, (u32*)__linear_heap, __linear_heap_size, NULL, 0);
|
||||
ctrGuSetCommandList_Last(queued, gpuCmdBuf, gpuCmdBufOffset*4, 0x0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user