Juggle memory so Rescue works on co-op

This commit is contained in:
Ryan Dwyer 2023-05-18 20:43:48 +10:00
parent 47e37e5cc5
commit 1f97533e09
3 changed files with 9 additions and 3 deletions

View File

@ -543,6 +543,8 @@ void lightsReset(void)
func0f004c6c();
}
extern struct rend_vidat *g_ViBackData;
void func0f001c0c(void)
{
s32 i;
@ -576,7 +578,7 @@ void func0f001c0c(void)
table4size = ALIGN16((u32)var8009cae0 * (u32)var8009cae0);
sp68 = ALIGN16(g_Vars.roomcount * 8);
ptr = mblurGetAllocation();
ptr = (void *) g_ViBackData->fb;
var80061434 = (f32 *)ptr;
ptr += table1size;
@ -590,7 +592,7 @@ void func0f001c0c(void)
sp48 = (u8 *)ptr;
ptr += table4size;
s5 = (u8 *)ptr;
s5 = (u8 *) mblurGetAllocation();
var80061420 = mempAlloc(sp68, MEMPOOL_STAGE);

View File

@ -33,7 +33,7 @@ void mblurReset(s32 stagenum)
static void mblurAllocate(void)
{
var800844f0 = mempAlloc(640 * 220 * 2 + 0x40, MEMPOOL_STAGE);
var800844f0 = mempAlloc(320 * 220 * 2 + 0x40, MEMPOOL_STAGE);
var800844f0 = (void *)(((u32) var800844f0 + 0x3f) & ~0x3f);
}

View File

@ -385,6 +385,10 @@ static void mainLoop(void)
g_MainMemaHeapSize = g_StageAllocations8Mb[index].ma * 1024;
if (g_StageNum == STAGE_RESCUE && g_NumPlayers >= 2) {
g_MainMemaHeapSize = 0;
}
memaReset(mempAlloc(g_MainMemaHeapSize, MEMPOOL_STAGE), g_MainMemaHeapSize);
langReset(g_StageNum);
playermgrReset();