CGDoom/cgdoom/os.h

39 lines
1.1 KiB
C

#include "platform.h"
#define SYSTEM_STACK_SAFE (64*1024)
#define USER_STACK_SAFE (32*1024)
// SaveVRAMBuffer 165888 bytes
#define SAVE_VRAM_SIZE (WIDTH*HEIGHT*2-3)
extern unsigned char *SaveVRAMBuffer;
// system stack (512 kB).
#define SYSTEM_STACK_SIZE (512*1024-SYSTEM_STACK_SAFE)
extern unsigned char *SystemStack;
extern unsigned short *VRAM;
void * CGDMalloc(int iSize);
void * CGDCalloc(int iSize);
void * CGDRealloc (void *p, int iSize);
void D_DoomMain();
void CGDAppendNum09(const char *pszText,int iNum,char *pszBuf);
void CGDAppendNum0_999(const char *pszText,int iNum,int iMinDigits,char *pszBuf);
void CGDAppendHex32(const char *pszText,int iNum, int iDigits,char *pszBuf);
int abs(int x);
int strnicmp (const char*s1,const char*s2,int iLen);
void I_Error (const char *error, ...);
//return ptr to flash
int FindInFlash(const void **buf, int size, int readpos);
//direct read from flash
int Flash_ReadFile(void *buf, int size, int readpos);
#define min(x,y) ({ \
__auto_type __x = (x); \
__auto_type __y = (y); \
__x < __y ? __x : __y; \
})