PVSnesLib  4.3.0
Documentation to code in C or ASM for the Nintendo SNES
map.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------------
2 
3  map management for mode 1
4 
5  Copyright (C) 2012-2013
6  Alekmaul
7 
8  This software is provided 'as-is', without any express or implied
9  warranty. In no event will the authors be held liable for any
10  damages arising from the use of this software.
11 
12  Permission is granted to anyone to use this software for any
13  purpose, including commercial applications, and to alter it and
14  redistribute it freely, subject to the following restrictions:
15 
16  1. The origin of this software must not be misrepresented; you
17  must not claim that you wrote the original software. If you use
18  this software in a product, an acknowledgment in the product
19  documentation would be appreciated but is not required.
20  2. Altered source versions must be plainly marked as such, and
21  must not be misrepresented as being the original software.
22  3. This notice may not be removed or altered from any source
23  distribution.
24 
25 ---------------------------------------------------------------------------------*/
26 
33 #ifndef SNES_MAPS_INCLUDE
34 #define SNES_MAPS_INCLUDE
35 
36 #include <snes/snestypes.h>
37 
38 #define T_EMPTY 0x0000
39 #define T_SOLID 0xFF00
40 #define T_LADDE 0x0001
41 #define T_FIRES 0x0002
42 #define T_SPIKE 0x0004
43 #define T_PLATE 0x0008
45 #define ACT_STAND 0x0000
46 #define ACT_WALK 0x0001
47 #define ACT_JUMP 0x0002
48 #define ACT_FALL 0x0004
49 #define ACT_CLIMB 0x0008
50 #define ACT_DIE 0x0010
51 #define ACT_BURN 0x0020
53 extern u16 bg_L1[32 * 32];
55 extern u8 mapupdbuf;
57 extern u16 x_pos, y_pos;
66 void mapLoad(u8 *layer1map, u8 *layertiles, u8 *tilesprop);
67 
71 void mapUpdate(void);
72 
76 void mapVblank(void);
77 
83 void mapUpdateCamera(u16 xpos, u16 ypos);
84 
91 u16 mapGetMetaTile(u16 xpos, u16 ypos);
92 
99 u16 mapGetMetaTilesProp(u16 xpos, u16 ypos);
100 
101 
102 #endif
u16 mapGetMetaTile(u16 xpos, u16 ypos)
Get metatile value from current map.
void mapVblank(void)
Display map regarding current buffer (must be done once per frame, near Vblank)
void mapUpdate(void)
Update map regarding current camera position (must be done once per frame)
u16 bg_L1[32 *32]
The buffer to use when updating the whole display on layer 1.
u16 y_pos
Current value of camera in x & y coordinates.
Definition: map.h:57
u16 mapGetMetaTilesProp(u16 xpos, u16 ypos)
Get metatile property from current map (solid, lad, fire, etc...)
void mapLoad(u8 *layer1map, u8 *layertiles, u8 *tilesprop)
Load map definition into memory.
u8 mapupdbuf
State of buffer update (vert / horiz / all)
void mapUpdateCamera(u16 xpos, u16 ypos)
Update map camera (must be done once per frame)
Custom types used by libsnes.