Quake BSP renderer for PS1
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

25 lines
808 B

#ifndef __MEMORY_H__
#define __MEMORY_H__
extern u_char* const scratchpad; // Starting address of scratchpad memory
/**
* @brief Allocate memory in the fast scratchpad RAM buffer.
*
* @param scratch_offset Pointer to a variable holding the current offset position in scratch memory.
* @param size The number of bytes to allocate. Be aware that the scratchpad memory only has 1024 bytes available.
* @return Pointer to the allocated buffer in scratchpad memory.
*/
void *mem_scratch(char **scratch_offset, unsigned short size);
/**
* @brief Allocate a single primitive in the primitive buffer.
*
* @param size Size of the primitive struct to allocate.
* @return Pointer to the allocated struct in memory.
*/
void *mem_prim(size_t size);
void mem_prim_reset(int db);
#endif // __MEMORY_H__