Files
goldeneye-pc-port/src/memp.h
T
James Dansereau 00fdd94c8d 2-4 player split-screen (#99): D416-D419, D422, D428, D448, D450
Virtual seats, per-seat camera and input routing, aim modes, hot-plugged
controllers reopening via a coalesced rescan (D450, dolent's PR #122,
merged as the original commit). Rule-2
sign-off for D417.

Refs: #99 D416 D417 D418 D419 D422 D428 D448 D450 #122
2026-10-06 18:35:40 -04:00

71 lines
1.5 KiB
C

#ifndef _MEMP_H_
#define _MEMP_H_
#include <ultra64.h>
/*
* Align to 16 bit boundary. Version "b", without preliminary addition.
*/
#define ALIGN16_b(val) (((val) | 0xf) ^ 0xf)
typedef struct MemoryPool {
u8 *start;
u8 *pos;
u8 *end;
u8 *prevpos;
} MemoryPool;
typedef struct s_mempMVALS { //mempSizes
u32 mfIndex;
u32 mf;
u32 mlIndex;
u32 ml;
u32 meIndex;
u32 me;
u32 EndIndex;
u32 EndPool;
} s_mempMVALS;
// Pool Names
enum MEMPOOL
{
MEMPOOL_TOTAL, // the mempool starts at _bssSegmentEnd and ends at _stacksSegmentStart
MEMPOOL_MF,
MEMPOOL_2,
MEMPOOL_ML,
MEMPOOL_STAGE,
MEMPOOL_ME,
MEMPOOL_PERMANENT,
MEMPOOL_COUNT
};
typedef enum MEMP_ADD_ENTRY_RESULT
{
MEMP_ADD_ENTRY_SUCCESS = 1,
MEMP_ADD_ENTRY_NOT_LAST_ALLOCATION = 2
} MEMP_ADD_ENTRY_RESULT;
void mempInit(void);
#ifdef PORT
void mempCheckMemflagTokens(uintptr_t bstart, int bsize);
#else
void mempCheckMemflagTokens(int bstart,int bsize);
#endif
void mempSetBankStarts(s32 banks[8]);
void *mempAllocBytesInBank(u32 bytes,u8 bank);
MEMP_ADD_ENTRY_RESULT mempAddEntryOfSizeToBank(void *allocation, s32 newsize, u8 poolnum);
void nulled_mempLoopAllMemBanks(void);
s32 mempGetBankSizeLeft(u8 bank);
#ifdef PORT
void *mempAllocPackedBytesInBank(u32 param_1);
#else
u32 mempAllocPackedBytesInBank(u32 param_1);
#endif
#ifdef PORT
void mempRedzoneCheck(const char *why); /* D464: GE_MEMPREDZONE */
#endif
void mempResetBank(u8 bank);
void mempNullNextEntryInBank(u8 bank);
#endif