Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
map.h
Go to the documentation of this file.
1#ifndef _MAP_H_
2#define _MAP_H_
3
4#include "common_structs.h"
5#include "enums.h"
6#include "world/entrances.h"
7#include "script_api/map.h"
8#include "npc.h"
9
10// temporary: some standard script names
11#define EVS_MakeEntities EVS_MakeEntities
12#define EVS_SetupMusic EVS_SetupMusic
13#define EVS_SetupRooms EVS_SetupRooms
14#define EVS_SetupFoliage EVS_SetupFoliage
15#define EVS_BindExitTriggers EVS_BindExitTriggers
16#define EVS_EnterMap EVS_EnterMap
17
18#define CLONED_MODEL(idx) (10000+(idx))
19
20// TODO: consider moving Npc here
21
22#define ENTRY_COUNT(entryList) (sizeof(entryList) / sizeof(Vec4f))
23typedef Vec4f EntryList[];
24
26typedef struct MapSettings {
27 /* 0x00 */ struct ModelNode* modelTreeRoot;
28 /* 0x04 */ s32 hitAssetCollisionOffset;
29 /* 0x08 */ s32 hitAssetZoneOffset;
30 /* 0x0C */ char unk_0C[4];
31 /* 0x10 */ EvtScript* main;
32 /* 0x14 */ EntryList* entryList;
33 /* 0x18 */ s32 entryCount;
34 /* 0x1C */ char unk_1C[12];
35 /* 0x28 */ char** modelNameList;
36 /* 0x2C */ char** colliderNameList;
37 /* 0x30 */ char** zoneNameList;
38 /* 0x34 */ char unk_34[4];
39 /* 0x38 */ BackgroundHeader* background;
40 /* 0x3C */ union {
41 s32 msgID;
42 s32 (*get)(void);
43 } tattle;
44} MapSettings; // size = 0x40
45
46typedef s32(*MapInit)(void);
47
48#define MAP_ID_MAX_LEN 7
49typedef struct MapConfig {
50 /* 0x00 */ char* id;
51 /* 0x04 */ MapSettings* settings;
52 /* 0x08 */ void* dmaStart;
53 /* 0x0C */ void* dmaEnd;
54 /* 0x10 */ void* dmaDest;
55 /* 0x14 */ char* bgName;
56 /* 0x18 */ MapInit init;
57 /* 0x1C */ char unk_1C[0x2];
58 /* 0x1E */ s8 songVariation;
59 /* 0x1F */ s8 sfxReverb;
60} MapConfig; // size = 0x20
61
62typedef struct AreaConfig {
63 /* 0x00 */ s32 mapCount;
64 /* 0x04 */ MapConfig* maps;
65 /* 0x08 */ char* id;
66 /* 0x0C */ char* name;
67} AreaConfig; // size = 0x10
68
70
71extern char wMapTexName[];
72extern char wMapHitName[];
73extern char wMapShapeName[];
74extern char wMapBgName[];
75
77extern AreaConfig gAreas[29];
78
81
82#endif
Bytecode EvtScript[]
char * id
Definition map.h:50
Vec4f EntryList[]
Definition map.h:23
s8 sfxReverb
Definition map.h:59
s32 entryCount
Definition map.h:33
char ** modelNameList
Definition map.h:35
union MapSettings::@48 tattle
char * id
"area_xxx"
Definition map.h:65
MapSettings * get_current_map_settings(void)
Definition world.c:224
s32 mapCount
Definition map.h:63
char ** colliderNameList
Definition map.h:36
s8 songVariation
0 or 1.
Definition map.h:58
char wMapShapeName[]
Definition world.c:27
MapInit init
Return TRUE to skip normal asset (shape/hit/bg/tex) loading.
Definition map.h:56
EvtScript * main
Definition map.h:31
char unk_34[4]
Definition map.h:38
char wMapHitName[]
Definition world.c:26
AreaConfig gAreas[29]
Zero-terminated.
Definition world.c:868
char ** zoneNameList
Definition map.h:37
EvtScript EVS_800936C0
Definition 38F00.c:7
MapSettings * settings
Definition map.h:51
s32 hitAssetZoneOffset
Definition map.h:29
char * bgName
Definition map.h:55
char unk_1C[0x2]
Definition map.h:57
s32(* MapInit)(void)
Definition map.h:46
char * name
JP debug name.
Definition map.h:66
char unk_1C[12]
Definition map.h:34
MapConfig * maps
Definition map.h:64
char wMapTexName[]
Definition world.c:28
s32 hitAssetCollisionOffset
Definition map.h:28
EntryList * entryList
Definition map.h:32
char unk_0C[4]
Definition map.h:30
void * dmaEnd
Definition map.h:53
EvtScript EVS_NpcHitRecoil
Definition 38F00.c:13
void * dmaDest
Definition map.h:54
BackgroundHeader * background
Definition map.h:39
char wMapBgName[]
Definition world.c:29
void * dmaStart
Definition map.h:52
struct ModelNode * modelTreeRoot
Definition map.h:27
Fields other than main, entryList, entryCount, background, and tattle are initialised when the map lo...
Definition map.h:26