decomp dungeon data getters

This commit is contained in:
shinny 2020-06-02 14:56:12 -04:00
parent 4f88655a79
commit cef20f5b34
7 changed files with 63344 additions and 63397 deletions

View File

@ -1303,7 +1303,7 @@ _08000D36:
cmp r4, 0x63
beq _08000D70
adds r0, r4, 0
bl sub_80900E4
bl GetSaveBeforeEntering
lsls r0, 24
cmp r0, 0
beq _08000D70
@ -1394,7 +1394,7 @@ _08000E00:
b _08000E1E
_08000E0C:
adds r0, r6, 0
bl sub_80900E4
bl GetSaveBeforeEntering
lsls r0, 24
cmp r0, 0
bne _08000E1E

File diff suppressed because it is too large Load Diff

63219
asm/code_809017C.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1501,7 +1501,7 @@ gUnknown_80DDB60: @ 80DDB60
.incbin "baserom.gba", 0xDDB60, 0x48
.include "data/text/wonder_mail_1.inc"
.global gUnknown_80DED44
gUnknown_80DED44: @ 80DED44
.incbin "baserom.gba", 0xDED44, 0x4
@ -10022,8 +10022,8 @@ gUnknown_8109CE4: @ 8109CE4
gUnknown_8109CF4: @ 8109CF4
.incbin "baserom.gba", 0x109CF4, 0x3C
.global gUnknown_8109D30
gUnknown_8109D30: @ 8109D30
.global gDungeons
gDungeons: @ 8109D30
.incbin "baserom.gba", 0x109D30, 0x620
.global gUnknown_810A350
@ -10294,8 +10294,8 @@ gUnknown_810E02C: @ 810E02C
gUnknown_810E074: @ 810E074
.incbin "baserom.gba", 0x10E074, 0x39B4
.global gUnknown_8111A28
gUnknown_8111A28: @ 8111A28
.global gDungeonNames
gDungeonNames: @ 8111A28
.incbin "baserom.gba", 0x111A28, 0x80C
.global gUnknown_8112234

31
include/dungeon.h Normal file
View File

@ -0,0 +1,31 @@
#ifndef GUARD_DUNGEON_H
#define GUARD_DUNGEON_H
struct DungeonName
{
const u8 *name1;
const u8 *name2;
};
struct Dungeon
{
u8 stairDirection;
u8 unk1;
u8 unk2;
s8 unk3;
u8 maxItemCount;
u8 maxPartySize;
u8 levelCondition;
u8 moneyCondition;
u8 unk8;
u8 unk9;
u8 saveBeforeEntering; //whether to quicksave or not before entering
u8 unkB;
s16 unkC;
s16 unkE;
};
extern struct Dungeon gDungeons[];
extern struct DungeonName gDungeonNames[];
#endif //GUARD_DUNGEON_H

View File

@ -69,6 +69,8 @@ SECTIONS {
asm/save.o(.text);
src/save1.o(.text);
asm/code_8012A18.o(.text);
src/dungeon.o(.text);
asm/code_809017C.o(.text);
asm/m4a_1.o(.text);
src/m4a_2.o(.text);
asm/m4a_3.o(.text);

67
src/dungeon.c Normal file
View File

@ -0,0 +1,67 @@
#include "global.h"
#include "dungeon.h"
const u8 *GetDungeonName1(u8 dungeon)
{
return gDungeonNames[dungeon].name1;
}
const u8 *GetDungeonName2(u8 dungeon)
{
return gDungeonNames[dungeon].name2;
}
u8 GetStairDirection(u8 dungeon)
{
return gDungeons[dungeon].stairDirection;
}
s16 GetUnkC(u8 dungeon)
{
return gDungeons[dungeon].unkC;
}
u8 GetSaveBeforeEntering(u8 dungeon)
{
return gDungeons[dungeon].saveBeforeEntering;
}
u8 GetUnk9(u8 dungeon)
{
return gDungeons[dungeon].unk9;
}
u8 GetLevelCondition(u8 dungeon)
{
return gDungeons[dungeon].levelCondition;
}
u8 GetMaxItemCount(u8 dungeon)
{
return gDungeons[dungeon].maxItemCount;
}
u8 GetMoneyCondition(u8 dungeon)
{
return gDungeons[dungeon].moneyCondition;
}
s8 GetUnk3(u8 dungeon)
{
return gDungeons[dungeon].unk3;
}
u8 sub_8090148(u8 dungeon)
{
return gDungeons[dungeon].unk2;
}
u8 sub_8090158(u8 dungeon)
{
return gDungeons[dungeon].unk8;
}
s16 sub_8090168(u8 dungeon)
{
return gDungeons[dungeon].unkE;
}