Le nouveau Super Mario Bros pour la gamme des fx9860g https://www.planet-casio.com/Fr/forums/topic15994-1-[addin]-SuperCasioBros-v0.1.html
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.
 
 
 
supercasiobros/src/base.c

50 lines
806 B

#include <base.h>
#include <gint/std/stdlib.h>
#include <liblog.h>
int max(const int x, const int y)
{
return (x<y?y:x);
}
int min(const int x, const int y)
{
return (x>y?y:x);
}
int sgn(const int x)
{
if (x>0) return 1;
else if (x<0) return -1;
else return 0;
}
int abs(const int x)
{
if (x>0) return x;
else return -x;
}
static int ram_used=0;
void* mallocProf(int const size)
{
void* p=malloc(size);
if (p)
{
ll_sendp(LEVEL_INFO, "\n[std] malloc %d OK", size);
ram_used++;
ll_sendp(LEVEL_INFO, "\n[std] number of zones %d", ram_used);
}
else ll_sendp(LEVEL_CRITICAL, "\n[std] malloc %d FAILED", size);
return p;
}
void freeProf(void * p)
{
free(p);
ll_sendp(LEVEL_INFO, "\n[std] free called");
ram_used--;
ll_sendp(LEVEL_INFO, "\n[std] number of zones %d", ram_used);
}