/
chapterinfo.c
47 lines (36 loc) · 1.05 KB
/
chapterinfo.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "chapterinfo.h"
#include "hardware.h"
#include "msg.h"
#include "save_xmap.h"
#include "gbasram.h"
struct ChapterInfo const * GetChapterInfo(int chapter)
{
if (chapter < 0)
return gExtraMapInfo->chapter_info;
return ChapterInfoTable + chapter;
}
u8 const * GetChapterMap(int chapter)
{
if (chapter >= 0)
return ChapterAssets[GetChapterInfo(chapter)->asset_map];
ReadSramFast(GetExtraMapMapReadAddr(), gBuf, GetExtraMapMapSize());
return gBuf;
}
struct MapChangeInfo const * GetChapterMapChanges(int chapter)
{
if (chapter >= 0)
return ChapterAssets[GetChapterInfo(chapter)->asset_map_changes];
return gExtraMapInfo->map_change_info;
}
struct ChapterEventInfo const * GetChapterEventInfo(int chapter)
{
if (chapter >= 0)
return ChapterAssets[GetChapterInfo(chapter)->asset_event_info];
return gExtraMapInfo->event_info;
}
char const * GetChapterUnk_0802BBD0(int chapter)
{
if (chapter >= 0)
return DecodeMsg(GetChapterInfo(chapter)->msg_38);
return gExtraMapInfo->msg_0C;
}