Initialize memory allocator with 422 kB system stack

Instead of ProgrammerNerd's in-user-stack 256 kB stack which works both
quickly hits its size limit when playing.
This commit is contained in:
Lephenixnoir 2021-07-17 10:50:20 +02:00
parent 7db1f33862
commit 29b0bffc21
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
3 changed files with 5 additions and 5 deletions

View File

@ -48,8 +48,6 @@ void * CGDRealloc (void *p, int iSize)
#ifdef CG_EMULATOR
unsigned char aSaveVRAMBuffer[SAVE_VRAM_SIZE]; //for screens[2] (2x64KB) + WAD file mapping
unsigned char aSystemStack[SYSTEM_STACK_SIZE]; //for RAM_I_Zone
#else
unsigned char __attribute__ ((aligned (4))) aSystemStack[SYSTEM_STACK_SIZE]; //for RAM_I_Zone
#endif
unsigned short *VRAM;
unsigned char *SaveVRAMBuffer; //for screens[2]
@ -583,11 +581,13 @@ void main(void){
InitFlashSimu(wadfile); //load wad file to flash simulation on simulator, do nothing on real HW
#ifdef CG_EMULATOR
SaveVRAMBuffer = aSaveVRAMBuffer;
SystemStack = aSystemStack;
#else
unsigned tmp=((unsigned)getSecondaryVramAddress()+3)&(~3);
SaveVRAMBuffer = (unsigned char*)tmp;
/* Graph 90+E: RAM starts at 0x0c000000 in physical memory */
SystemStack = (void *)0xac0f0000;
#endif
SystemStack = aSystemStack;
VRAM = (unsigned short*)GetVRAMAddress();
EnableColor(1);
memset(VRAM,0,WIDTH*HEIGHT*2);

View File

@ -2,7 +2,7 @@
//CGDOOM
#define SYSTEM_STACK_SAFE (256*1024)
#define SYSTEM_STACK_SAFE (90*1024)
#define USER_STACK_SAFE (40*1024)
//memory mapping:

View File

@ -234,7 +234,7 @@ void* Z_Malloc( int size, int tag, void* user )
if (rover == start)
{
// scanned all the way around the list
I_Error ("Z_Malloc: failed on allocation of %i bytes", size);
I_ErrorI ("Z_Malloc failure", size, 0, 0, 0);
}
if (rover->user)