extern char snesfont;
extern char gfxpsrite, gfxpsrite_end;
extern char palsprite, palsprite_end;
u16 numspr, i;
u16 pad0;
s16 xp, yp;
s16 *snesox, *snesoy;
const u16 tabobjects[] =
{
15,
5,
0,
0,
0,
100,
5,
0,
0,
0,
5,
15,
0,
0,
0,
150,
150,
0,
0,
0,
200,
50,
0,
0,
0,
125,
25,
0,
0,
0,
200,
25,
0,
0,
0,
0xFFFF,
};
void testInit(u16 xp, u16 yp, u16 type, u16 minx, u16 maxx)
{
if (
objNew(type, xp, yp) == 0)
return;
numspr++;
}
void testUpdate(u8 idx)
{
snesox = (s16 *)&(snesobj->
xpos + 1);
snesoy = (s16 *)&(snesobj->
ypos + 1);
xp = *snesox;
yp = *snesoy;
switch (pad0)
{
break;
}
if (i < 7)
{
xp++;
if (xp > 255)
xp--;
}
else
{
xp--;
if (xp < 1)
xp++;
}
if (i < 7)
{
yp++;
if (yp > 223)
yp--;
}
else
{
yp--;
if (yp < 1)
yp++;
}
*snesox = xp;
*snesoy = yp;
}
int main(void)
{
numspr = 0;
while (1)
{
}
return 0;
}
void bgSetDisable(u8 bgNumber)
Disable a BG in the actual SNES mode.
u16 rand(void)
return a randomized number
void consoleNocashMessage(char *fmt,...)
Send a message to the no$sns debug window.
void consoleInit(void)
Initialize console.
void WaitForVBlank(void)
Wait for vblank interrupt
u16 y_pos
Current value of camera in x & y coordinates.
Definition: map.h:57
t_objs objbuffers[OB_MAX]
current object buffer with all objects
u16 objNew(u8 objtype, u16 x, u16 y)
Initialize a new object in game, objgetid will has the id of the object.
void objInitFunctions(u8 objtype, void *initfct, void *updfct, void *reffct)
Initialize the object type functions (initialize, update)
u16 objptr
pointer to current object
void objUpdateAll(void)
call update function for all objects currently active (if they are in "virtual screen" coordinates).
void objGetPointer(u16 objhandle)
get the pointer to an object from its handle (need to do -1 to have offset after),...
void objInitEngine(void)
Initialize object engine, need to be called once.
u16 objgetid
id of current object (useful when creating it)
u8 objtokill
put 1 in variable to kill current object
void objLoadObjects(u8 *sourceO)
Load all objects for a specific table in memory.
the master include file for snes applications.
void oamSetEx(u16 id, u8 size, u8 hide)
Put the correct size and hide or show a sprite.
#define OBJ_SIZE32_L64
default OAM size 32x32 (SM) and 64x64 (LG) pix for OBJSEL register
Definition: sprite.h:44
void oamInitGfxSet(u8 *tileSource, u16 tileSize, u8 *tilePalette, u16 paletteSize, u8 tilePaletteNumber, u16 address, u8 oamsize)
Initializes a sprites Gfx and Loads the GFX into VRAM.
void oamSet(u16 id, u16 xspr, u16 yspr, u8 priority, u8 hflip, u8 vflip, u16 gfxoffset, u8 paletteoffset)
sets an oam entry to the supplied values
object definition (64 bytes)
Definition: object.h:49
u8 xpos[3]
Definition: object.h:60
u16 sprnum
Definition: object.h:54
u8 ypos[3]
Definition: object.h:61
void setScreenOn(void)
Put screen On.
void setMode(u8 mode, u8 size)
Set the SNES hardware to operate in new display mode.