papermario/include/map.h

74 lines
2.1 KiB
C
Raw Normal View History

#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))
2021-04-03 19:21:49 +02:00
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 */ UNK_PTR collision;
/* 0x08 */ UNK_PTR unk_08;
/* 0x0C */ char unk_0C[4];
/* 0x10 */ EvtSource* 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];
2020-10-20 08:33:40 +02:00
/* 0x38 */ BackgroundHeader* background;
/* 0x3C */ union {
s32 msgID;
s32 (*get)(void);
2020-10-20 08:33:40 +02:00
} tattle;
} MapConfig; // size = 0x40
2021-01-15 23:26:03 +01:00
typedef s32(*MapInit)(void);
2020-10-30 18:43:12 +01:00
#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;
2021-01-12 20:45:50 +01:00
/* 0x18 */ MapInit init; ///< Return TRUE to skip normal asset (shape/hit/bg/tex) loading.
f270, world, and more (#246) * 415D90 decomp * code_415D90 rodata migration * data migration, decomp * . * . * . * 4 funcs * non-matching * audio part 1 * audio work * end of snd * update_symbol_addrs * . * :chicken: * . * sfx func names * bgm * more audio * . * a few audio funcs * update section length * git subrepo pull --force tools/splat subrepo: subdir: "tools/splat" merged: "82ff308caf" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "82ff308caf" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * git subrepo pull --force tools/splat subrepo: subdir: "tools/splat" merged: "4e9d3cdf85" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "4e9d3cdf85" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * misc-decomp power * sound * 4 mo * more changes * . * some f270 * git subrepo pull --force tools/splat subrepo: subdir: "tools/splat" merged: "1c8ff4ec3f" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "1c8ff4ec3f" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * git subrepo pull --force tools/splat subrepo: subdir: "tools/splat" merged: "f0633ecdbc" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "f0633ecdbc" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * fix is_logo image size * . * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "4be92a4786" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "4be92a4786" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * state_step_pause * almost * fixing symbol_addrs and disasm * update symbol_addrs * . * fix Matrix4f usages * . * . * update_symbol_addrs * fixes * I hate bitfields * load_map_by_IDs * cleanup * state_step_logos * more cleanup * . * splat * PR comments
2021-04-01 20:00:29 +02:00
/* 0x1C */ union {
u32 word;
f270, world, and more (#246) * 415D90 decomp * code_415D90 rodata migration * data migration, decomp * . * . * . * 4 funcs * non-matching * audio part 1 * audio work * end of snd * update_symbol_addrs * . * :chicken: * . * sfx func names * bgm * more audio * . * a few audio funcs * update section length * git subrepo pull --force tools/splat subrepo: subdir: "tools/splat" merged: "82ff308caf" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "82ff308caf" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * git subrepo pull --force tools/splat subrepo: subdir: "tools/splat" merged: "4e9d3cdf85" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "4e9d3cdf85" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * misc-decomp power * sound * 4 mo * more changes * . * some f270 * git subrepo pull --force tools/splat subrepo: subdir: "tools/splat" merged: "1c8ff4ec3f" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "1c8ff4ec3f" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * git subrepo pull --force tools/splat subrepo: subdir: "tools/splat" merged: "f0633ecdbc" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "f0633ecdbc" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * fix is_logo image size * . * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "4be92a4786" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "4be92a4786" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * state_step_pause * almost * fixing symbol_addrs and disasm * update symbol_addrs * . * fix Matrix4f usages * . * . * update_symbol_addrs * fixes * I hate bitfields * load_map_by_IDs * cleanup * state_step_logos * more cleanup * . * splat * PR comments
2021-04-01 20:00:29 +02:00
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
2020-11-20 05:08:05 +01:00
2020-11-22 02:31:57 +01:00
MapConfig* get_current_map_header(void);
/// Zero-terminated.
extern Area gAreas[29];
2020-10-30 18:43:12 +01:00
/// Lists the songs that are forced to use the variation determined by `map.songVariation & 1`.
/// @see bgm_get_map_default_variation
extern s32 gSongsUsingVariationFlag[6];
2020-11-27 07:14:28 +01:00
extern s16 D_8014F738;
#endif