PVSnesLib  3.4.0
Macros | Functions | Variables
map.h File Reference

contains the functions to manage / scroll large background MAP on SNES. More...

#include <snes/snestypes.h>

Go to the source code of this file.

Macros

#define ACT_BURN   0x0020
 Action type BURN for object.
 
#define ACT_CLIMB   0x0008
 Action type CLIMB for object.
 
#define ACT_DIE   0x0010
 Action type DIE for object.
 
#define ACT_FALL   0x0004
 Action type FALL for object.
 
#define ACT_JUMP   0x0002
 Action type JUMP for object.
 
#define ACT_STAND   0x0000
 Action type STAND for object.
 
#define ACT_WALK   0x0001
 Action type WALK for object.
 
#define T_EMPTY   0x0000
 Type Empty (action will be fall) for tile.
 
#define T_FIRES   0x0002
 Type Fire (action will be burn) for tile.
 
#define T_LADDE   0x0001
 Type Land (action will be climb) for tile.
 
#define T_SOLID   0xFF00
 Type Solid (action is walk only) for tile.
 
#define T_SPIKE   0x0004
 Type Spyke (action will be die) for tile.
 

Functions

u16 mapGetMetaTile (u16 xpos, u16 ypos)
 Get metatile property from current map. More...
 
void mapLoad (u8 *layer1map, u8 *layertiles, u8 *tilesprop)
 Load map definition into memory. More...
 
void mapUpdate (void)
 Update map regarding current camera position (must be done once per frame)
 
void mapUpdateCamera (u16 xpos, u16 ypos)
 Update map camera (must be done once per frame) More...
 
void mapVblank (void)
 Display map regarding current buffer (must be done once per frame, near Vblank)
 

Variables

u16 y_pos
 Current value of camera in x & y coordinates.
 

Detailed Description

contains the functions to manage / scroll large background MAP on SNES.

this can only be use for mode 1 the engine scrolls layer1 in x and y coordinates layer address is : 6800 for Layer 1

Function Documentation

◆ mapGetMetaTile()

mapGetMetaTile ( u16  xpos,
u16  ypos 
)

Get metatile property from current map.

Parameters
xposx coordinate of metatile
yposx coordinate of metatile
Returns
tile properties
Examples:
maps/mapscroll/mapscroll.c.

◆ mapLoad()

mapLoad ( u8 *  layer1map,
u8 *  layertiles,
u8 *  tilesprop 
)

Load map definition into memory.

Parameters
layer1mapaddress of map with tiles
layertilesaddress of tiles definition
tilespropaddress of tiles property definition (blocker, spikes, and so on)
Examples:
maps/mapscroll/mapscroll.c.

◆ mapUpdateCamera()

mapUpdateCamera ( u16  xpos,
u16  ypos 
)

Update map camera (must be done once per frame)

Parameters
xposx coordinate of object where we want to focus on
yposx coordinate of object where we want to focus on
Examples:
maps/mapscroll/mapscroll.c.