papermario/include/map.h
HailSanta 1ce49b1ba9
audio odyssey (#744)
* first pass

* seq cmd args retyping

* some SEF commands

* etc

* couple more SND commands

* more functions

* checkpoint

* five more

* another one

* more funcs + cleanup

* reverted unnecessary unions

* all SEF commands done

* a bunch more

* more!

* morrrrrrre

* almost done for now

* 99%

* 100

* few names and types

* reorg

* minor chnages

* miscmiscmisc

* yet more

* another day another func

* eth wip func_8004EC68

* some sym names

* retyping sound mgr fields

* minor renames

* D_80078400

* bigger func

* retypings

* enhanced drum info

* the evil is defeated

* merged

* prelim ambient sound func names

* audio frame

* checkpoint

* renames

* learnin bout sounds

* latest

* fix snd_load_BK_to_bank

* func_80056FA4

* warnings

* cosmetics

* func_800522A8

* struct reorg

* figured some stuff out

* much more info

* fx params

* cleanin up

* revert accidental changes to jp

* more accidental jp changes reverted

* misc names

* small stuff

* migrated all audio data

* checkpoint

* header reorg begins

* audio public/private headers

* fixed headers

* fixin warnins

* oops

* 51 fixed

* formatted binary data in 30450

* workwork

* cleanup

* misc

* flip macro arg order

* more names

* audio event triggers

* various

* sfx player cleanup

* start bgm player cleanup

* names names names

* priorities

* merlow

* misc enum vals

* rocking chair

* kmr_00 funcs

* enough

* restore delete jp file

* func_80055EB4

* fix func name

* addressed comments

* demoted a couple variables from global

* couple hidden panel things

* credits mostly

* credits dedupe in progress

* jump table repair

* 'finished' end dedupe

Co-authored-by: HailSanta <Hail2Santa@gmail.com>
Co-authored-by: Ethan Roseman <ethteck@gmail.com>
2022-08-06 21:14:04 +09:00

69 lines
1.9 KiB
C

#ifndef _MAP_H_
#define _MAP_H_
#include "common_structs.h"
#include "enums.h"
#include "script_api/map.h"
#include "npc.h"
// TODO: consider moving Npc here
#define ENTRY_COUNT(entryList) (sizeof(entryList) / sizeof(Vec4f))
typedef Vec4f EntryList[];
/// Fields other than main, entryList, entryCount, background, and tattle are initialised when the map loads.
typedef struct MapConfig {
/* 0x00 */ struct ModelNode* modelTreeRoot;
/* 0x04 */ s32 hitAssetCollisionOffset;
/* 0x08 */ s32 hitAssetZoneOffset;
/* 0x0C */ char unk_0C[4];
/* 0x10 */ EvtScript* main;
/* 0x14 */ EntryList* entryList;
/* 0x18 */ s32 entryCount;
/* 0x1C */ char unk_1C[12];
/* 0x28 */ char** modelNameList;
/* 0x2C */ char** colliderNameList;
/* 0x30 */ char** zoneNameList;
/* 0x34 */ char unk_34[4];
/* 0x38 */ BackgroundHeader* background;
/* 0x3C */ union {
s32 msgID;
s32 (*get)(void);
} tattle;
} MapConfig; // size = 0x40
typedef s32(*MapInit)(void);
#define MAP_ID_MAX_LEN 7 ///< "xxx_yyy" excluding null terminator.
typedef struct Map {
/* 0x00 */ char* id; ///< @see MAP_ID_MAX_LEN
/* 0x04 */ MapConfig* config;
/* 0x08 */ void* dmaStart;
/* 0x0C */ void* dmaEnd;
/* 0x10 */ void* dmaDest;
/* 0x14 */ char* bgName;
/* 0x18 */ MapInit init; ///< Return TRUE to skip normal asset (shape/hit/bg/tex) loading.
/* 0x1C */ union {
u32 word;
struct {
char unk_1C[0x2];
s8 songVariation; ///< 0 or 1. @see bgm_get_map_default_variation
s8 flags;
} bytes;
} unk_1C;
} Map; // size = 0x20
typedef struct Area {
/* 0x00 */ s32 mapCount;
/* 0x04 */ Map* maps;
/* 0x08 */ char* id; ///< "area_xxx"
/* 0x0C */ char* name; ///< JP debug name.
} Area; // size = 0x10
MapConfig* get_current_map_header(void);
/// Zero-terminated.
extern Area gAreas[29];
#endif