Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
map.h File Reference

Go to the source code of this file.

Data Structures

struct  MapSettings
 Fields other than main, entryList, entryCount, background, and tattle are initialised when the map loads. More...
 
struct  MapConfig
 
struct  AreaConfig
 
union  MapSettings.tattle
 

Macros

#define EVS_MakeEntities   EVS_MakeEntities
 
#define EVS_SetupMusic   EVS_SetupMusic
 
#define EVS_SetupRooms   EVS_SetupRooms
 
#define EVS_SetupFoliage   EVS_SetupFoliage
 
#define EVS_BindExitTriggers   EVS_BindExitTriggers
 
#define EVS_EnterMap   EVS_EnterMap
 
#define CLONED_MODEL(idx)   (10000+(idx))
 
#define ENTRY_COUNT(entryList)   (sizeof(entryList) / sizeof(Vec4f))
 
#define MAP_ID_MAX_LEN   7
 "xxx_yyy" excluding null terminator.
 

Typedefs

typedef Vec4f EntryList[]
 
typedef s32(* MapInit) (void)
 

Functions

MapSettingsget_current_map_settings (void)
 

Variables

char wMapTexName []
 
char wMapHitName []
 
char wMapShapeName []
 
char wMapBgName []
 
AreaConfig gAreas [29]
 Zero-terminated.
 
EvtScript EVS_NpcHitRecoil
 
EvtScript EVS_800936C0
 
EvtScript EnterWalk
 
EvtScript EnterWalkShort
 
EvtScript EnterSavePoint
 
EvtScript ExitWalk
 
EvtScript ExitSingleDoor
 
EvtScript EnterSingleDoor
 
EvtScript ExitSplitSingleDoor
 
EvtScript EnterSplitSingleDoor
 
EvtScript ExitDoubleDoor
 
EvtScript EnterDoubleDoor
 
EvtScript ExitSplitDoubleDoor
 
EvtScript EnterSplitDoubleDoor
 
EvtScript BaseExitDoor
 
EvtScript BaseEnterDoor
 
EvtScript EnterPostPipe
 
EvtScript EVS_ShopOwnerDialog
 

Data Structure Documentation

◆ MapSettings

struct MapSettings
Data Fields
struct ModelNode * modelTreeRoot
s32 hitAssetCollisionOffset
s32 hitAssetZoneOffset
char unk_0C[4]
EvtScript * main
EntryList * entryList
s32 entryCount
char unk_1C[12]
char ** modelNameList
char ** colliderNameList
char ** zoneNameList
char unk_34[4]
BackgroundHeader * background
union MapSettings.tattle tattle

◆ MapConfig

struct MapConfig
Data Fields
char * id
See also
MAP_ID_MAX_LEN
MapSettings * settings
void * dmaStart
void * dmaEnd
void * dmaDest
char * bgName
MapInit init Return TRUE to skip normal asset (shape/hit/bg/tex) loading.
char unk_1C[0x2]
s8 songVariation 0 or 1.
See also
bgm_get_map_default_variation
s8 sfxReverb

◆ AreaConfig

struct AreaConfig
Data Fields
s32 mapCount
MapConfig * maps
char * id "area_xxx"
char * name JP debug name.

Macro Definition Documentation

◆ EVS_MakeEntities

#define EVS_MakeEntities   EVS_MakeEntities

Definition at line 11 of file map.h.

◆ EVS_SetupMusic

#define EVS_SetupMusic   EVS_SetupMusic

Definition at line 12 of file map.h.

◆ EVS_SetupRooms

#define EVS_SetupRooms   EVS_SetupRooms

Definition at line 13 of file map.h.

◆ EVS_SetupFoliage

#define EVS_SetupFoliage   EVS_SetupFoliage

Definition at line 14 of file map.h.

◆ EVS_BindExitTriggers

#define EVS_BindExitTriggers   EVS_BindExitTriggers

Definition at line 15 of file map.h.

◆ EVS_EnterMap

#define EVS_EnterMap   EVS_EnterMap

Definition at line 16 of file map.h.

◆ CLONED_MODEL

#define CLONED_MODEL ( idx)    (10000+(idx))

Definition at line 18 of file map.h.

◆ ENTRY_COUNT

#define ENTRY_COUNT ( entryList)    (sizeof(entryList) / sizeof(Vec4f))

Definition at line 22 of file map.h.

◆ MAP_ID_MAX_LEN

#define MAP_ID_MAX_LEN   7

"xxx_yyy" excluding null terminator.

Definition at line 48 of file map.h.

Typedef Documentation

◆ EntryList

typedef Vec4f EntryList[]

Definition at line 23 of file map.h.

◆ MapInit

typedef s32(* MapInit) (void)

Definition at line 46 of file map.h.

Function Documentation

◆ get_current_map_settings()

MapSettings * get_current_map_settings ( void )

Variable Documentation

◆ wMapTexName

char wMapTexName[]
extern

Definition at line 28 of file world.c.

Referenced by load_map_by_IDs(), and state_step_end_battle().

◆ wMapHitName

char wMapHitName[]
extern

Definition at line 26 of file world.c.

Referenced by load_map_by_IDs(), and load_map_hit_asset().

◆ wMapShapeName

char wMapShapeName[]
extern

Definition at line 27 of file world.c.

Referenced by load_map_by_IDs(), state_step_end_battle(), and state_step_unpause().

◆ wMapBgName

char wMapBgName[]
extern

Definition at line 29 of file world.c.

Referenced by load_map_by_IDs().

◆ gAreas

AreaConfig gAreas[29]
extern

Zero-terminated.

Definition at line 868 of file world.c.

868 {
869 AREA(kmr, "クリむら"), // kuri mura [kuribou village, Goomba Village]
870 AREA(mac, "まち"), // machi [town, Toad Town]
871 AREA(tik, "まちのちか"), // machi no chika [under the town, Toad Town Tunnels]
872 AREA(kgr, "くじらのなか"), // kujira no naka [inside the whale]
873 AREA(kkj, "きのこ城"), // kinoko shiro [mushroom castle, Princess Peach's Castle]
874 AREA(hos, "星ふる丘"), // hoshi furu oka [star fall hill, Shooting Star Summit]
875 AREA(nok, "ノコノコむら"), // nokonoko mura [nokonoko village, Koopa Village]
876 AREA(trd, "とりで"), // toride [fortress, Koopa Bros. Fortress]
877 AREA(iwa, "岩山"), // iwayama [rock mountain, Mt. Rugged]
878 AREA(dro, "カラカラタウン"), // karakara taun [dried up town, Dry Dry Outpost]
879 AREA(sbk, "カラカラ砂漠"), // karakara sabaku [dried up desert, Dry Dry Desert]
880 AREA(isk, "カラカラいせき"), // karakara iseki [dried up ruins, Dry Dry Ruins]
881 AREA(mim, "迷いの森"), // mayoi no mori [lost forest, Forever Forest]
882 AREA(obk, "テレサハウス"), // teresa hausu [teresa house, Boo's Mansion]
883 AREA(arn, "あれの"), // areno [wasteland, Gusty Gulch]
884 AREA(dgb, "ドガボンの城"), // dogabon no shiro [dogabon's castle, Tubba Blubba's Castle]
885 AREA(omo, "ヘイホーのおもちゃばこ"), // heiho no omochabako [heiho's toy box, Shy Guy's Toy Box]
886 AREA(jan, "ジャングル"), // janguru [jungle, Jade Jungle]
887 AREA(kzn, "火山"), // kazan [volcano, Mt. Lavalava]
888 AREA(flo, "フラワーランド"), // furawaa rando [flower land, Flower Fields]
889 AREA(sam, "さむいさむい村"), // samui samui mura [cold cold village, Shiver City]
890 AREA(pra, "パラレルきゅうでん"), // parareru kyuuden [parallel palace, Crystal Palace]
891 AREA(kpa, "クッパ城"), // kuppa shiro [koopa's castle, Bowser's Castle]
892 AREA(osr, "きのこ城そと"), // kinoko shiro soto [outside mushroom castle, Outside Peach's Castle]
893 AREA(end, "エンディング"), // endingu [Ending]
894 AREA(mgm, "ミニゲーム"), // minige-mu [Minigames]
895 AREA(gv, "ゲームオーバー"), // ge-mu o-ba- [Game Over]
896 AREA(tst, "テストマップ"), // tesuto mappu [Test map]
897 {},
898};
#define AREA(area, jp_name)
Definition world.c:293

Referenced by bgm_get_map_default_variation(), get_map_IDs_by_name(), load_map_by_IDs(), reset_player_status(), state_step_end_battle(), and state_step_unpause().

◆ EVS_NpcHitRecoil

EvtScript EVS_NpcHitRecoil
extern

Definition at line 13 of file 38F00.c.

13 {
17 Add(LVar1, 1)
19 Wait(1)
21 Add(LVar1, 4)
23 Wait(1)
25 Add(LVar1, 16)
27 Wait(1)
29 Add(LVar1, 8)
31 Wait(1)
33 Add(LVar1, 20)
35 Wait(1)
37 Add(LVar1, 8)
39 Wait(1)
41 Add(LVar1, 12)
43 Wait(1)
45 Add(LVar1, 6)
47 Wait(1)
49 Add(LVar1, 0)
51 Wait(1)
52 Return
53 End
54};
@ NPC_SELF
Definition enums.h:2526
ApiStatus GetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus SetNpcAnimation(Evt *script, b32 isInitialCall)
ApiStatus SetNpcPos(Evt *script, b32 isInitialCall)
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define LVar3
Definition macros.h:151
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217

◆ EVS_800936C0

EvtScript EVS_800936C0
extern

Definition at line 7 of file 38F00.c.

7 {
8 Call(func_8005DB00)
10 End
11};

◆ EnterWalk

EvtScript EnterWalk
extern

Definition at line 198 of file enter_exit.c.

198 {
199 Call(ShortenPartnerTetherDistance)
200 Call(CheckUsingRideablePartner)
201 Call(UseEntryHeading, 60, 15)
202 IfEq(LVarA, 0)
203 Call(TeleportPartnerToPlayer)
205 Else
206 Set(LVarF, LVar0)
207 Set(LVar0, 0)
208 Set(LVarC, 1)
209 Set(LVar4, 15)
211 Set(LVar0, LVarF)
212 EndIf
213 Exec(LVar0)
215 Call(ResetPartnerTetherDistance)
216 Return
217 End
218};
ApiStatus func_802D2148(Evt *script, b32 isInitialCall)
ApiStatus UseEntryHeading(Evt *script, b32 isInitialCall)
ApiStatus PlayerMoveTo(Evt *script, b32 isInitialCall)
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#define LVarF
Definition macros.h:163
#define LVarC
Definition macros.h:160
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVarB
Definition macros.h:159
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define LVarA
Definition macros.h:158
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define LVar4
Definition macros.h:152
#define Exec(EVT_SOURCE)
Launches a new thread.
Definition macros.h:455

◆ EnterWalkShort

EvtScript EnterWalkShort
extern

Definition at line 220 of file enter_exit.c.

220 {
221 Call(ShortenPartnerTetherDistance)
222 Call(CheckUsingRideablePartner)
223 Call(UseEntryHeading, 40, 15)
224 IfEq(LVarA, 0)
225 Call(TeleportPartnerToPlayer)
227 Else
228 Set(LVarF, LVar0)
229 Set(LVar0, 0)
230 Set(LVarC, 1)
231 Set(LVar4, 15)
233 Set(LVar0, LVarF)
234 EndIf
235 Exec(LVar0)
237 Call(ResetPartnerTetherDistance)
238 Return
239 End
240};

◆ EnterSavePoint

EvtScript EnterSavePoint
extern

Definition at line 274 of file enter_exit.c.

274 {
275 Call(ShortenPartnerTetherDistance)
276 Call(SetPlayerPositionFromSaveData)
278 Call(ResetPartnerTetherDistance)
279 Return
280 End
281};
@ NPC_PARTNER
Definition enums.h:2528
ApiStatus ClearPartnerMoveHistory(Evt *script, b32 isInitialCall)

◆ ExitWalk

EvtScript ExitWalk
extern

Definition at line 283 of file enter_exit.c.

283 {
285 Call(ShortenPartnerTetherDistance)
286 Call(CheckUsingRideablePartner)
287 IfEq(LVarA, 0)
289 Else
290 Set(LVar0, 0)
291 Set(LVarC, 0)
292 Set(LVar4, 15)
294 EndIf
295 Call(ResetPartnerTetherDistance)
296 Return
297 End
298};
ApiStatus DisablePlayerInput(Evt *script, b32 isInitialCall)
Disables player and partner input, and disables the status menu.

◆ ExitSingleDoor

EvtScript ExitSingleDoor
extern

Definition at line 300 of file enter_exit.c.

300 {
301 Call(SetupSingleDoor)
303 Return
304 End
305};
EvtScript BaseExitDoor
Definition enter_exit.c:356

◆ EnterSingleDoor

EvtScript EnterSingleDoor
extern

Definition at line 307 of file enter_exit.c.

307 {
308 Call(SetupSingleDoor)
310 Return
311 End
312};
EvtScript BaseEnterDoor
Definition enter_exit.c:406

◆ ExitSplitSingleDoor

EvtScript ExitSplitSingleDoor
extern

Definition at line 314 of file enter_exit.c.

314 {
315 Call(SetupSplitSingleDoor)
317 Return
318 End
319};

◆ EnterSplitSingleDoor

EvtScript EnterSplitSingleDoor
extern

Definition at line 321 of file enter_exit.c.

321 {
322 Call(SetupSplitSingleDoor)
324 Return
325 End
326};

◆ ExitDoubleDoor

EvtScript ExitDoubleDoor
extern

Definition at line 328 of file enter_exit.c.

328 {
329 Call(SetupDoubleDoors)
331 Return
332 End
333};

◆ EnterDoubleDoor

EvtScript EnterDoubleDoor
extern

Definition at line 335 of file enter_exit.c.

335 {
336 Call(SetupDoubleDoors)
338 Return
339 End
340};

◆ ExitSplitDoubleDoor

EvtScript ExitSplitDoubleDoor
extern

Definition at line 342 of file enter_exit.c.

342 {
343 Call(SetupSplitDoubleDoors)
345 Return
346 End
347};

◆ EnterSplitDoubleDoor

EvtScript EnterSplitDoubleDoor
extern

Definition at line 349 of file enter_exit.c.

349 {
350 Call(SetupSplitDoubleDoors)
352 Return
353 End
354};

◆ BaseExitDoor

EvtScript BaseExitDoor
extern

Definition at line 356 of file enter_exit.c.

356 {
359 Call(ShortenPartnerTetherDistance)
360 Set(LVar9, LVar0)
361 Call(GetEntryCoords, LVar0, LVarC, LVarD, LVarE, LVarB)
362 Add(LVarB, 180)
366 Call(MakeLerp, 0, 80, 10, EASING_LINEAR)
367 Label(0)
370 Loop(0)
372 IfEq(LVarA, -1)
374 EndIf
375 Call(RotateModel, LVarA, LVar0, 0, 1, 0)
376 EndLoop
378 Loop(0)
380 IfEq(LVarA, -1)
382 EndIf
383 Call(RotateModel, LVarA, LVar0, 0, -1, 0)
384 EndLoop
385 Wait(1)
386 IfNe(LVar1, 0)
387 Goto(0)
388 EndIf
390 Call(CheckUsingRideablePartner)
391 IfEq(LVarA, 0)
393 Else
394 Set(LVar0, 0)
395 Set(LVarC, 0)
396 Set(LVar4, 15)
398 EndIf
399 Call(ResetPartnerTetherDistance)
402 Return
403 End
404};
@ COLLIDER_FLAGS_UPPER_MASK
Definition enums.h:4692
@ EASING_LINEAR
Definition enums.h:510
@ SOUND_DOOR_OPEN
Definition enums.h:1693
@ SOUND_SPACE_DEFAULT
Definition enums.h:1737
ApiStatus RotateModel(Evt *script, b32 isInitialCall)
Rotates the model the given amount on the selected axis.
ApiStatus UpdateLerp(Evt *script, b32 isInitialCall)
ApiStatus UseExitHeading(Evt *script, b32 isInitialCall)
ApiStatus DisablePlayerPhysics(Evt *script, b32 isInitialCall)
Disables player physics if disable is TRUE, enables it if FALSE.
ApiStatus MakeLerp(Evt *script, b32 isInitialCall)
ApiStatus InterpPlayerYaw(Evt *script, b32 isInitialCall)
ApiStatus ModifyColliderFlags(Evt *script, b32 isInitialCall)
Set flags for collider + siblings + children.
ApiStatus PlaySoundAt(Evt *script, b32 isInitialCall)
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#define UseBuf(INT_PTR)
Loads a s32 pointer for use with subsequent EVT_BUF_READ commands.
Definition macros.h:389
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define BufRead1(VAR)
Consumes the next s32 from the buffer and stores it in the given variable.
Definition macros.h:392
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define BreakLoop
Breaks out of the innermost loop.
Definition macros.h:251
#define LVarD
Definition macros.h:161
#define LVar9
Definition macros.h:157
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVarE
Definition macros.h:162

◆ BaseEnterDoor

EvtScript BaseEnterDoor
extern

Definition at line 406 of file enter_exit.c.

406 {
408 Call(ShortenPartnerTetherDistance)
410 Loop(0)
412 IfEq(LVarA, -1)
414 EndIf
415 Call(RotateModel, LVarA, -80, 0, 1, 0)
416 EndLoop
418 Loop(0)
420 IfEq(LVarA, -1)
422 EndIf
423 Call(RotateModel, LVarA, -80, 0, -1, 0)
424 EndLoop
425 Call(GetEntryCoords, LVar0, LVar7, LVar8, LVar9, LVarB)
427 Call(CheckUsingRideablePartner)
428 IfEq(LVarA, 0)
429 Call(TeleportPartnerToPlayer)
430 Call(PlayerMoveToDoor, 10)
431 Else
432 Set(LVar0, 1)
433 Set(LVarC, 1)
434 Set(LVar4, 15)
436 EndIf
437 Thread
438 Wait(8)
441 Call(MakeLerp, -80, 0, 10, EASING_LINEAR)
442 Label(0)
445 Loop(0)
447 IfEq(LVarA, -1)
449 EndIf
450 Call(RotateModel, LVarA, LVar0, 0, 1, 0)
451 EndLoop
453 Loop(0)
455 IfEq(LVarA, -1)
457 EndIf
458 Call(RotateModel, LVarA, LVar0, 0, -1, 0)
459 EndLoop
460 Wait(1)
461 IfNe(LVar1, 0)
462 Goto(0)
463 EndIf
464 Call(ResetPartnerTetherDistance)
466 Return
467 End
468};
@ SOUND_DOOR_CLOSE
Definition enums.h:1694
#define LVar7
Definition macros.h:155
#define Thread
Marks the start of a thread block.
Definition macros.h:544
#define EndThread
Marks the end of a thread block.
Definition macros.h:547
#define LVar8
Definition macros.h:156

◆ EnterPostPipe

EvtScript EnterPostPipe
extern

Definition at line 263 of file enter_exit.c.

263 {
265 Call(ShortenPartnerTetherDistance)
266 Call(CheckUsingRideablePartner)
267 Call(EnterPlayerPostPipe)
268 Call(ResetPartnerTetherDistance)
270 Return
271 End
272};

◆ EVS_ShopOwnerDialog

EvtScript EVS_ShopOwnerDialog
extern

Definition at line 76 of file shops.c.

76 {
77 Call(ShowShopOwnerDialog)
78 Return
79 End
80};