libmonochrome/include/monochrome/internals.h

35 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* monochrome/internals.h */
/* | Project : libmonochrome */
/* */
/* By: Pierre "PierrotLL" Le Gall <legallpierre89@gmail.com> */
/* Last updated: 2011/11/22 */
/* */
/* ************************************************************************** */
#ifndef MONOCHROME_INTERNALS_H
# define MONOCHROME_INTERNALS_H
# include <stddef.h>
# include <monochrome.h>
# define abs(X) ((X) > 0 ? (X) : -(X))
# define sgn(X) ((X) < 0 ? -1 : 1)
# define rnd(X) ((int)(X) + 0.5)
/*
** STDLIB Prototypes
*/
void *malloc(size_t size);
void free(void *ptr);
/*
** VRAM Utilities
*/
# define ML_vram_xy(X, Y) \
(ML_vram_address() + ((Y) << 4) + ((X) >> 3))
#endif