/**************************************************************************** * @(#) Ndless - Utils * * Copyright (C) 2010 by ANNEHEIM Geoffrey and ARMAND Olivier * Contact: geoffrey.anneheim@gmail.com / olivier.calc@gmail.com * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. * * RCSID $Id$ ****************************************************************************/ #ifndef _UTILS_H_ #define _UTILS_H_ #define WAIT(n, name) \ asm ( \ "ldmfd sp!, {r0}\n" \ "ldr r0, ="n"\n" \ "_loop_"name":\n" \ "cmp r0, #0\n" \ "sub r0, r0, #1\n" \ "bne _loop_"name"\n" \ "stmfd sp!, {r0}\n" \ ); typedef struct { int x, y, w, h; } t_rect; typedef struct { float x, y; } t_point; typedef enum {false, true} bool; extern inline void clearScreen(); extern inline void refresh(char* buf); extern inline void clearBuf(char* buf); extern void showSimpleDialogBox(const char* title, const char* msg); extern void fade(int n); extern inline void setPixelBuf(char* buf, int x, int y, int color); extern void sprite(char* scrbuf, char* sprite, int x, int y, int w, int h); extern void convsprite(char* sprite, char* result, int w, int h); extern void slowdown(void); int setlevel(int level, int x, int y); int setlevelinfo(int level, int x); int drawlevel(char cl[20][40], char levelinfo[4]); #endif