mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-10-04 09:08:30 +00:00
Fix missing includes and disable interrupts for pspSdkTotalFreeUserMemSize
This commit is contained in:
@@ -5,10 +5,14 @@
|
||||
*
|
||||
* memory.c - Code to get accurate reporting of available (video) memory.
|
||||
*
|
||||
* Copyright (c) 2023 Ivy Bowling <motolegacy.git@gmail.com>
|
||||
* Copyright (c) 2023 Ivy Bowling <motolegacy@proton.me>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <pspsdk.h>
|
||||
|
||||
static u32 _pspSdkGetMaxLineareMemorySize(void)
|
||||
{
|
||||
u32 size, blocksize;
|
||||
@@ -45,6 +49,8 @@ SceSize pspSdkTotalFreeUserMemSize(void)
|
||||
ram = NULL;
|
||||
size = count = 0;
|
||||
|
||||
int intc = pspSdkDisableInterrupts();
|
||||
|
||||
while (1)
|
||||
{
|
||||
/* Check entry size */
|
||||
@@ -87,6 +93,8 @@ SceSize pspSdkTotalFreeUserMemSize(void)
|
||||
free(ram);
|
||||
}
|
||||
|
||||
pspSdkEnableInterrupts(intc);
|
||||
|
||||
/* Amount we were able to allocate before running out, in bytes. */
|
||||
return size;
|
||||
}
|
Reference in New Issue
Block a user