#define MEM_OAM ((u8*)OAM)

#define TOOL_OAM_OBJ_SET_XPOS(obj_number,xpos)\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)+2) &= 0xFE00;\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)+2) |= xpos;

#define TOOL_OAM_OBJ_SET_YPOS(obj_number,ypos)\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)) &= 0xFF00;\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)) |= ypos;

#define RetourneObjetH_Oui(obj_number)\
                        (MonOAM[obj_number].attr1 |= 0x1000)

#define RetourneObjetH_Non(obj_number)\
                        (MonOAM[obj_number].attr1 &= 0xEFFF)

#define TOOL_OAM_OBJ_SET_VFLIP_ON(obj_number)\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)+2) |= 0x2000;

#define TOOL_OAM_OBJ_SET_VFLIP_OFF(obj_number)\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)+2) &= 0xDFFF;

#define TOOL_OAM_OBJ_SET_MOSAIC_ON(obj_number)\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)) |= 0x1000;

#define TOOL_OAM_OBJ_SET_MOSAIC_OFF(obj_number)\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)) &= 0xEFFF;

#define TOOL_OAM_OBJ_SET_PRIO(obj_number,prio)\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)+4) &= 0xF3FF;\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)+4) |= prio<<10;

#define TOOL_OAM_OBJ_SET_PAL(obj_number,pal_number)\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)+4) &= 0xFFF;\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)+4) |= pal_number<<12;
#define TOOL_OAM_OBJ_SET_ROT(obj_number,rot)\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)) &= 0xFEFF;\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)) |= rot<<8;
#define TOOL_OAM_OBJ_SET_ROTSET(obj_number,rotset)\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)+2) &= 0xC1FF;\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)+2) |= rotset<<9;

#undef TOOL_OAM_OBJ_KILL
#define TOOL_OAM_OBJ_KILL(obj_number)\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)) = 240;\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)+2) = 160;\
                        *(volatile u16 *)(MEM_OAM+(8*obj_number)+4) = 0;


