mirror of
https://github.com/pret/pmd-red.git
synced 2026-03-21 17:46:39 -05:00
extern cleanup of ground_map
This commit is contained in:
parent
4e7f0283ed
commit
930ca358de
|
|
@ -6,12 +6,20 @@
|
|||
|
||||
void GroundBg_Init(GroundBg *groundBg, const SubStruct_52C *a1);
|
||||
void GroundBg_FreeAll(GroundBg *groundBg);
|
||||
void sub_80A2D68(GroundBg *groundBg);
|
||||
void sub_80A2D88(GroundBg *groundBg);
|
||||
void sub_80A2FBC(GroundBg *groundBg, s32 mapFileId_);
|
||||
void sub_80A3440(GroundBg *groundBg, s32 mapFileId_, const DungeonLocation *dungLoc, s32 a3);
|
||||
void sub_80A3B80(GroundBg *groundBg, u8 a1, u8 a2);
|
||||
void sub_80A3BB0(GroundBg *groundBg, s32 a0_);
|
||||
void sub_80A4558(GroundBg *groundBg, s32 id, PixelPos *dstPos);
|
||||
void sub_80A456C(GroundBg *groundBg, s32 id, const PixelPos *srcPos);
|
||||
void sub_80A4580(GroundBg *groundBg, s32 id, PixelPos *pixPos);
|
||||
void sub_80A4608(GroundBg *groundBg, PixelPos *dstPos);
|
||||
u16 sub_80A4720(GroundBg *groundBg, s32 id, PixelPos *pixPos);
|
||||
void sub_80A4740(GroundBg *groundBg, s32 id, PixelPos *pixPos, u32 dstVal);
|
||||
void sub_80A4764(GroundBg *groundBg);
|
||||
void sub_80A49E8(GroundBg *groundBg);
|
||||
void GetDungeonBounds(GroundBg *groundBg, PixelPos *dstPos1, PixelPos *dstPos2);
|
||||
|
||||
#endif // GUARD_GROUND_BG_H
|
||||
|
|
|
|||
|
|
@ -1,12 +1,22 @@
|
|||
#ifndef GUARD_GROUND_MAP_H
|
||||
#define GUARD_GROUND_MAP_H
|
||||
|
||||
#include "structs/str_position.h"
|
||||
|
||||
void GroundMap_Reset(void);
|
||||
void AllocGroundMapAction(void);
|
||||
void FreeGroundMapAction(void);
|
||||
void sub_80A4B38(void);
|
||||
void sub_80A4B54(void);
|
||||
void sub_80A56C0(PixelPos *pos);
|
||||
s16 GetAdjustedGroundMap(s32 mapId);
|
||||
s16 GetGroundMapID(void);
|
||||
|
||||
void GroundMap_ExecuteEnter(s16);
|
||||
void GroundMap_ExecuteEvent(s16 scriptIndex, u32);
|
||||
void GroundMap_ExecuteStation(s32 _map, s32 _group, s32 _sector, bool32 _setScriptState);
|
||||
bool8 GroundMapNotifyAll(s16);
|
||||
bool8 sub_80A4D48(s16 index);
|
||||
void GroundMap_Action(void);
|
||||
|
||||
#endif // GUARD_GROUND_MAP_H
|
||||
|
|
|
|||
|
|
@ -1,11 +1,31 @@
|
|||
#ifndef GUARD_GROUND_MAP_1_H
|
||||
#define GUARD_GROUND_MAP_1_H
|
||||
|
||||
void GroundMap_ExecuteEnter(s16);
|
||||
void GroundMap_ExecuteEvent(s16 scriptIndex, u32);
|
||||
void GroundMap_ExecuteStation(s32 _map, s32 _group, s32 _sector, bool32 _setScriptState);
|
||||
// size: 0x24
|
||||
#include "structs/str_position.h"
|
||||
|
||||
bool8 GroundMapNotifyAll(s16);
|
||||
bool8 sub_80A4D48(s16 index);
|
||||
typedef struct unkStruct_3001B74
|
||||
{
|
||||
s16 unk0;
|
||||
u8 unk2;
|
||||
s32 unk4;
|
||||
s32 unk8;
|
||||
PixelPos unkC;
|
||||
u32 unk14;
|
||||
u32 unk18;
|
||||
u32 unk1C;
|
||||
u32 unk20;
|
||||
} unkStruct_3001B74;
|
||||
|
||||
void GroundWeather_Select(s16);
|
||||
void nullsub_121(void);
|
||||
void nullsub_122(void);
|
||||
void nullsub_123(void);
|
||||
|
||||
void sub_80A5E70(void);
|
||||
void sub_80A5E8C(u8);
|
||||
void sub_80A5EBC(void);
|
||||
void sub_80A5EDC(u8);
|
||||
void sub_80A60D8(void);
|
||||
|
||||
#endif // GUARD_GROUND_MAP_1_H
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
#ifndef GUARD_GROUND_MAP_2_H
|
||||
#define GUARD_GROUND_MAP_2_H
|
||||
|
||||
// size: 0x24
|
||||
typedef struct unkStruct_3001B74
|
||||
{
|
||||
s16 unk0;
|
||||
u8 unk2;
|
||||
s32 unk4;
|
||||
s32 unk8;
|
||||
s32 unkC;
|
||||
s32 unk10;
|
||||
u32 unk14;
|
||||
u32 unk18;
|
||||
u32 unk1C;
|
||||
u32 unk20;
|
||||
} unkStruct_3001B74;
|
||||
|
||||
void GroundWeather_Select(s16);
|
||||
void nullsub_121(void);
|
||||
void nullsub_122(void);
|
||||
void nullsub_123(void);
|
||||
|
||||
void sub_80A5E70(void);
|
||||
void sub_80A5E8C(u8);
|
||||
void sub_80A5EBC(void);
|
||||
void sub_80A5EDC(u8);
|
||||
void sub_80A60D8(void);
|
||||
|
||||
#endif // GUARD_GROUND_MAP_2_H
|
||||
9
include/ground_script_file.h
Normal file
9
include/ground_script_file.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef INCLUDE_GROUND_SCRIPT_FILE_H
|
||||
#define INCLUDE_GROUND_SCRIPT_FILE_H
|
||||
|
||||
void sub_80A7744(void);
|
||||
void sub_80A7754(void);
|
||||
bool8 ChangeScriptFile(s16 a0);
|
||||
const struct GroundScriptHeader *GetGroundScript(s16 mapId, const DebugLocation *unused);
|
||||
|
||||
#endif /* INCLUDE_GROUND_SCRIPT_FILE_H */
|
||||
|
|
@ -346,7 +346,7 @@ SECTIONS {
|
|||
src/ground_place.o(.text);
|
||||
src/ground_bg.o(.text);
|
||||
src/ground_map.o(.text);
|
||||
src/ground_map_2.o(.text);
|
||||
src/ground_map_1.o(.text);
|
||||
src/ground_sprite.o(.text);
|
||||
src/ground_sprite_data.o(.text);
|
||||
src/ground_sprite_monster.o(.text);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "text_2.h"
|
||||
#include "text_3.h"
|
||||
#include "ground_map.h"
|
||||
#include "ground_map_2.h"
|
||||
#include "ground_map_1.h"
|
||||
#include "palette_util.h"
|
||||
#include "string_format.h"
|
||||
#include "sprite.h"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
extern const FileArchive gGroundFileArchive;
|
||||
|
||||
void sub_80A456C(GroundBg *groundBg, s32 id, const PixelPos *srcPos);
|
||||
static void CloseOpenedFiles(GroundBg *groundBg);
|
||||
static void sub_80A3EB0(SubStruct_488 *map488);
|
||||
static const u8 *sub_80A3908(u16 **dstArray, const void *src_, SubStruct_52C *a2, SubStruct_448 *a3);
|
||||
|
|
|
|||
|
|
@ -13,12 +13,14 @@
|
|||
#include "debug.h"
|
||||
#include "event_flag.h"
|
||||
#include "ground_main.h"
|
||||
#include "ground_map_2.h"
|
||||
#include "ground_map.h"
|
||||
#include "ground_map_1.h"
|
||||
#include "play_time.h"
|
||||
#include "pokemon.h"
|
||||
#include "text_util.h"
|
||||
#include "ground_map_conversion_table.h"
|
||||
#include "ground_lives_helper.h"
|
||||
#include "ground_script_file.h"
|
||||
#include "script_item.h"
|
||||
#include "unk_ds_only_feature.h"
|
||||
#include "textbox.h"
|
||||
|
|
@ -68,24 +70,20 @@ extern bool8 sub_809AFAC(void);
|
|||
extern bool8 sub_80048BC(void);
|
||||
extern u8 sub_80023E4(u32);
|
||||
extern bool8 sub_8099B94(void);
|
||||
extern void FreeGroundMapAction(void);
|
||||
extern void FreeGroundLives(void);
|
||||
extern void FreeGroundObjects(void);
|
||||
extern void FreeGroundEffects(void);
|
||||
extern void FreeGroundEvents(void);
|
||||
extern void sub_80A658C(void);
|
||||
extern void sub_809D508(void);
|
||||
extern void sub_80A7754(void);
|
||||
extern void nullsub_119(void);
|
||||
extern void sub_8099768(void);
|
||||
extern void nullsub_103(void);
|
||||
extern void sub_8099648(void);
|
||||
extern void sub_809975C(void);
|
||||
extern void sub_809D0AC(void);
|
||||
extern void sub_80A7744(void);
|
||||
extern void sub_809D490(void);
|
||||
extern void sub_80A62F0(void);
|
||||
extern void AllocGroundMapAction(void);
|
||||
extern void AllocGroundEvents(void);
|
||||
extern void AllocGroundLives(void);
|
||||
extern void AllocGroundObjects(void);
|
||||
|
|
@ -109,7 +107,6 @@ extern void sub_80A5E70(void);
|
|||
extern void sub_809B638(void);
|
||||
extern void sub_80A73EC(void);
|
||||
extern void sub_8099750(void);
|
||||
extern void GroundMap_Reset(void);
|
||||
extern void sub_809D0BC(void);
|
||||
extern void DeleteGroundEvents(void);
|
||||
extern void DeleteGroundLives(void);
|
||||
|
|
@ -121,9 +118,7 @@ extern void xxx_call_update_bg_sound_input(void);
|
|||
extern void sub_80A6E68(void);
|
||||
extern void sub_80060EC(void);
|
||||
extern void sub_809977C(void);
|
||||
extern void GroundMap_ExecuteEvent(s32, u32);
|
||||
extern void UpdateFadeInTile(s32);
|
||||
extern void GroundMap_Action(void);
|
||||
extern void sub_8098C58(void);
|
||||
extern void sub_8001D88(void);
|
||||
extern u32 GroundMainGameCancelRequest(u32 r0);
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@
|
|||
#include "ground_bg.h"
|
||||
#include "ground_main.h"
|
||||
#include "ground_map.h"
|
||||
#include "ground_map_2.h"
|
||||
#include "ground_map_1.h"
|
||||
#include "ground_script.h"
|
||||
#include "ground_script_file.h"
|
||||
#include "memory.h"
|
||||
#include "ground_map_conversion_table.h"
|
||||
#include "code_800558C.h"
|
||||
|
|
@ -17,6 +18,16 @@ IWRAM_INIT GroundBg *gGroundMapDungeon_3001B70 = {NULL};
|
|||
extern const SubStruct_52C gUnknown_8117324;
|
||||
extern const SubStruct_52C gUnknown_811733C;
|
||||
extern const SubStruct_52C gUnknown_8117354;
|
||||
|
||||
struct MapToDungeonStruct
|
||||
{
|
||||
s16 id;
|
||||
DungeonLocation loc;
|
||||
u32 unk8;
|
||||
};
|
||||
|
||||
extern const struct MapToDungeonStruct gUnknown_81173C0[];
|
||||
|
||||
extern const DebugLocation gUnknown_8117538[];
|
||||
extern const DebugLocation gUnknown_8117560;
|
||||
extern const u8 gUnknown_811756C[];
|
||||
|
|
@ -27,27 +38,31 @@ extern const DebugLocation gUnknown_8117644;
|
|||
extern const u8 gUnknown_8117650[];
|
||||
extern const DebugLocation gUnknown_8117698;
|
||||
extern const u8 gUnknown_81176A4[];
|
||||
extern const DebugLocation gUnknown_81176D0;
|
||||
extern const u8 gUnknown_81176DC[];
|
||||
extern const PixelPos gUnknown_81176F8;
|
||||
extern const u8 gUnknown_8117700[];
|
||||
extern const DebugLocation gUnknown_8117734;
|
||||
extern const u8 gUnknown_8117740[];
|
||||
extern const PixelPos gUnknown_8117754;
|
||||
extern const DebugLocation gUnknown_8117770;
|
||||
|
||||
|
||||
bool8 ChangeScriptFile(s32 a0);
|
||||
const struct GroundScriptHeader *GetGroundScript(s32 a0, const DebugLocation *);
|
||||
|
||||
|
||||
extern u8 sub_809D678(void *);
|
||||
extern bool8 GroundScriptNotify(void *, s32);
|
||||
|
||||
extern const CallbackData gGroundScriptNullCallbacks;
|
||||
|
||||
extern void sub_80A2D68(GroundBg *);
|
||||
extern void sub_80A2D88(GroundBg *);
|
||||
extern s16 HandleAction(Action *action, const DebugLocation *debug);
|
||||
extern void sub_80A4740(void *, s32, s32 *, u32);
|
||||
extern u32 sub_80A4720(void *, s32, s32 *);
|
||||
extern u8 sub_809D248(PixelPos *r0);
|
||||
|
||||
extern bool8 sub_809D678(Action *);
|
||||
extern bool8 GroundScriptNotify(Action*, s32);
|
||||
|
||||
extern u8 sub_80A46C0(GroundBg *, u32, s32, s32);
|
||||
extern u8 sub_80A4660(GroundBg *, u32, s32, s32);
|
||||
|
||||
extern s16 HandleAction(Action *action, const DebugLocation *debug);
|
||||
|
||||
void GroundMap_SelectDungeon(s32 mapId, const DungeonLocation *loc, u32 param_2);
|
||||
void sub_80A56D8(const PixelPos*);
|
||||
|
||||
void AllocGroundMapAction(void)
|
||||
{
|
||||
gGroundMapAction = MemoryAlloc(sizeof(GroundMapAction), 6);
|
||||
|
|
@ -175,7 +190,7 @@ void GroundMap_ExecuteEnter(s16 param_1)
|
|||
GroundScript_ExecutePP(&gGroundMapAction->action, 0, &script, &gUnknown_8117698);
|
||||
}
|
||||
|
||||
UNUSED static u8 sub_80A4D14(void)
|
||||
UNUSED static bool8 sub_80A4D14(void)
|
||||
{
|
||||
return sub_809D678(&gGroundMapAction->action);
|
||||
}
|
||||
|
|
@ -213,24 +228,6 @@ s16 GetAdjustedGroundMap(s32 mapId)
|
|||
return retMapId;
|
||||
}
|
||||
|
||||
struct MapToDungeonStruct
|
||||
{
|
||||
s16 id;
|
||||
DungeonLocation loc;
|
||||
u32 unk8;
|
||||
};
|
||||
|
||||
extern const struct MapToDungeonStruct gUnknown_81173C0[];
|
||||
extern const u8 gUnknown_81176DC[];
|
||||
extern const u8 gUnknown_8117740[];
|
||||
extern const DebugLocation gUnknown_81176D0;
|
||||
extern const DebugLocation gUnknown_8117734;
|
||||
extern const PixelPos gUnknown_81176F8;
|
||||
extern const PixelPos gUnknown_8117754;
|
||||
|
||||
void GroundMap_SelectDungeon(s32 mapId, const DungeonLocation *loc, u32 param_2);
|
||||
void sub_80A56D8(const PixelPos*);
|
||||
|
||||
void GroundMap_Select(s32 mapId_)
|
||||
{
|
||||
const GroundConversionStruct *ptr;
|
||||
|
|
@ -1063,8 +1060,6 @@ void sub_80A56C0(PixelPos *pos)
|
|||
sub_80A4558(gGroundMapDungeon_3001B70, 0, pos);
|
||||
}
|
||||
|
||||
void sub_80A456C(GroundBg *groundBg, s32 id, const PixelPos *srcPos);
|
||||
|
||||
void sub_80A56D8(const PixelPos *pos)
|
||||
{
|
||||
sub_80A456C(gGroundMapDungeon_3001B70, 0, pos);
|
||||
|
|
@ -1092,7 +1087,7 @@ UNUSED static const GroundConversionStruct *GetGroundConversionStruct(void)
|
|||
return &gGroundMapConversionTable[gGroundMapAction->groundMapId];
|
||||
}
|
||||
|
||||
bool8 sub_80A5758(PixelPos *pos)
|
||||
UNUSED static bool8 sub_80A5758(PixelPos *pos)
|
||||
{
|
||||
if(gGroundMapDungeon_3001B70 != NULL)
|
||||
{
|
||||
|
|
@ -1214,12 +1209,12 @@ u8 sub_80A595C(s32 param_1, s32 param_2, s32 param_3)
|
|||
return sub_80A46C0(gGroundMapDungeon_3001B70, param_1_u32, param_2, param_3);
|
||||
}
|
||||
|
||||
u16 sub_80A5984(s32 param_1, s32 *param_2)
|
||||
u16 sub_80A5984(s32 param_1, PixelPos *param_2)
|
||||
{
|
||||
return sub_80A4720(gGroundMapDungeon_3001B70, param_1, param_2);
|
||||
}
|
||||
|
||||
void sub_80A59A0(s32 param_1, s32 *param_2, u32 param_3)
|
||||
void sub_80A59A0(s32 param_1, PixelPos *param_2, u32 param_3)
|
||||
{
|
||||
u32 param_3_u32 = (u16)param_3;
|
||||
sub_80A4740(gGroundMapDungeon_3001B70, param_1, param_2, param_3_u32);
|
||||
|
|
@ -1231,10 +1226,6 @@ void GroundMap_Action(void)
|
|||
HandleAction((Action *)gGroundMapAction, &gUnknown_8117770);
|
||||
}
|
||||
|
||||
extern u8 sub_809D248(PixelPos *r0);
|
||||
extern void sub_80A4580(GroundBg *, u32, PixelPos *);
|
||||
extern void sub_80A4764(GroundBg *);
|
||||
|
||||
void sub_80A59DC(void)
|
||||
{
|
||||
if (gGroundMapDungeon_3001B70 != NULL) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,223 @@
|
|||
#include "global.h"
|
||||
#include "code_800558C.h"
|
||||
#include "debug.h"
|
||||
#include "event_flag.h"
|
||||
#include "ground_bg.h"
|
||||
#include "ground_map.h"
|
||||
#include "ground_map_2.h"
|
||||
#include "ground_script.h"
|
||||
#include "ground_map_1.h"
|
||||
#include "memory.h"
|
||||
|
||||
IWRAM_INIT unkStruct_3001B74 *gUnknown_3001B74 = {NULL};
|
||||
IWRAM_INIT GroundBg *gUnknown_3001B78 = {NULL};
|
||||
|
||||
extern const SubStruct_52C gUnknown_8117784;
|
||||
extern const s16 gUnknown_811E5F4[][2];
|
||||
extern const u8 gGroundWeatherSelect[];
|
||||
extern const PixelPos gUnknown_81177BC;
|
||||
|
||||
static void sub_80A62D0(void);
|
||||
|
||||
void sub_80A5E70(void)
|
||||
{
|
||||
if (gGroundMapDungeon_3001B70 != NULL)
|
||||
sub_80A49E8(gGroundMapDungeon_3001B70);
|
||||
|
||||
sub_80A62D0();
|
||||
}
|
||||
|
||||
void sub_80A5E8C(u8 param_1)
|
||||
{
|
||||
gUnknown_3001B74 = MemoryAlloc(sizeof(unkStruct_3001B74), 6);
|
||||
gUnknown_3001B74->unk0 = -1;
|
||||
gUnknown_3001B74->unk2 = 0;
|
||||
sub_80A5EDC(param_1);
|
||||
}
|
||||
|
||||
void sub_80A5EBC(void)
|
||||
{
|
||||
sub_80A5EDC(0);
|
||||
MemoryFree(gUnknown_3001B74);
|
||||
gUnknown_3001B74 = NULL;
|
||||
}
|
||||
|
||||
void sub_80A5EDC(u8 param_1)
|
||||
{
|
||||
SetScriptVarValue(NULL, WEATHER_KIND, -1);
|
||||
gUnknown_3001B74->unk0 = -1;
|
||||
gUnknown_3001B74->unk2 = param_1;
|
||||
|
||||
if (gUnknown_3001B78 != NULL) {
|
||||
GroundBg_FreeAll(gUnknown_3001B78);
|
||||
MemoryFree(gUnknown_3001B78);
|
||||
gUnknown_3001B78 = NULL;
|
||||
}
|
||||
|
||||
if (param_1) {
|
||||
gUnknown_3001B78 = MemoryAlloc(sizeof(GroundBg), 6);
|
||||
GroundBg_Init(gUnknown_3001B78, &gUnknown_8117784);
|
||||
sub_80A2FBC(gUnknown_3001B78, -1);
|
||||
}
|
||||
}
|
||||
|
||||
void nullsub_121(void)
|
||||
{}
|
||||
|
||||
void nullsub_122(void)
|
||||
{}
|
||||
|
||||
void GroundWeather_Select(s16 param_1)
|
||||
{
|
||||
s32 iVar2;
|
||||
s32 iVar3;
|
||||
const s16 *pVar1;
|
||||
|
||||
iVar2 = param_1;
|
||||
iVar3 = iVar2;
|
||||
Log(0, gGroundWeatherSelect, iVar2, gUnknown_3001B74->unk2);
|
||||
SetScriptVarValue(NULL, WEATHER_KIND, iVar2);
|
||||
gUnknown_3001B74->unk0 = iVar2;
|
||||
|
||||
if (gUnknown_3001B74->unk2 == 0)
|
||||
return;
|
||||
|
||||
if (iVar2 == -1) {
|
||||
sub_80A2FBC(gUnknown_3001B78, -1);
|
||||
return;
|
||||
}
|
||||
|
||||
pVar1 = gUnknown_811E5F4[iVar3];
|
||||
sub_80A2FBC(gUnknown_3001B78, pVar1[1]);
|
||||
|
||||
gUnknown_3001B74->unk4 = 0;
|
||||
gUnknown_3001B74->unk8 = 0;
|
||||
gUnknown_3001B74->unkC.x = 0;
|
||||
gUnknown_3001B74->unkC.y = 0;
|
||||
gUnknown_3001B74->unk20 = 0;
|
||||
gUnknown_3001B74->unk1C = 0;
|
||||
gUnknown_3001B74->unk18 = 0;
|
||||
gUnknown_3001B74->unk14 = 0;
|
||||
|
||||
switch (gUnknown_3001B74->unk0) {
|
||||
case 9:
|
||||
sub_80A3BB0(gUnknown_3001B78, 1);
|
||||
gUnknown_2026E4E = 0x40c;
|
||||
break;
|
||||
case 7:
|
||||
gUnknown_2026E4E = 0x808;
|
||||
break;
|
||||
case 14:
|
||||
sub_80A3BB0(gUnknown_3001B78, 1);
|
||||
gUnknown_2026E4E = 0x1010;
|
||||
break;
|
||||
case 15:
|
||||
sub_80A3BB0(gUnknown_3001B78, 1);
|
||||
gUnknown_2026E4E = 0x40c;
|
||||
break;
|
||||
case 0:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 8:
|
||||
gUnknown_2026E4E = 0x1010;
|
||||
break;
|
||||
default:
|
||||
if (pVar1[0] == 1)
|
||||
sub_80A3BB0(gUnknown_3001B78, 1);
|
||||
|
||||
gUnknown_2026E4E = 0x1000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
UNUSED static s16 sub_80A60C4(void)
|
||||
{
|
||||
return gUnknown_3001B74->unk0;
|
||||
}
|
||||
|
||||
void nullsub_123(void)
|
||||
{}
|
||||
|
||||
void sub_80A60D8(void)
|
||||
{
|
||||
if (gUnknown_3001B74->unk2 == 0)
|
||||
return;
|
||||
|
||||
switch ((s16)(gUnknown_3001B74->unk0 + 1)) {
|
||||
case 10: {
|
||||
PixelPos localArray;
|
||||
|
||||
gUnknown_3001B74->unk4 += 2;
|
||||
gUnknown_3001B74->unk8 += 1;
|
||||
gUnknown_3001B74->unkC.x += gUnknown_3001B74->unk4 / 4;
|
||||
gUnknown_3001B74->unkC.y += gUnknown_3001B74->unk8 / 4;
|
||||
sub_80A4580(gUnknown_3001B78, 0, &gUnknown_3001B74->unkC);
|
||||
gUnknown_3001B74->unk4 &= 3;
|
||||
gUnknown_3001B74->unk8 &= 3;
|
||||
sub_80A56C0(&localArray);
|
||||
localArray.x -= gUnknown_3001B74->unkC.x;
|
||||
localArray.y += gUnknown_3001B74->unkC.y;
|
||||
sub_80A4580(gUnknown_3001B78, 0, &localArray);
|
||||
sub_80A456C(gUnknown_3001B78, 0, &localArray);
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14: {
|
||||
PixelPos localArray;
|
||||
|
||||
sub_80A56C0(&localArray);
|
||||
sub_80A456C(gUnknown_3001B78,0,&localArray);
|
||||
break;
|
||||
}
|
||||
case 15: {
|
||||
PixelPos localArray;
|
||||
|
||||
gUnknown_3001B74->unk4++;
|
||||
gUnknown_3001B74->unkC.x += gUnknown_3001B74->unk4 / 4;
|
||||
sub_80A4580(gUnknown_3001B78, 0, &gUnknown_3001B74->unkC);
|
||||
gUnknown_3001B74->unk4 &= 3;
|
||||
sub_80A56C0(&localArray);
|
||||
localArray.x -= gUnknown_3001B74->unkC.x;
|
||||
localArray.y = 0;
|
||||
sub_80A4580(gUnknown_3001B78, 0, &localArray);
|
||||
sub_80A456C(gUnknown_3001B78, 0, &localArray);
|
||||
break;
|
||||
}
|
||||
case 16: {
|
||||
PixelPos localArray;
|
||||
|
||||
gUnknown_3001B74->unk4 += 2;
|
||||
gUnknown_3001B74->unkC.x += gUnknown_3001B74->unk4 / 4;
|
||||
sub_80A4580(gUnknown_3001B78, 0, &gUnknown_3001B74->unkC);
|
||||
gUnknown_3001B74->unk4 &= 3;
|
||||
sub_80A56C0(&localArray);
|
||||
localArray.x -= gUnknown_3001B74->unkC.x;
|
||||
localArray.y = 0;
|
||||
sub_80A4580(gUnknown_3001B78, 0, &localArray);
|
||||
sub_80A456C(gUnknown_3001B78, 0, &localArray);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
PixelPos localArray;
|
||||
const s16 *puVar1 = gUnknown_811E5F4[gUnknown_3001B74->unk0];
|
||||
if (puVar1[0] == 0) {
|
||||
sub_80A56C0(&localArray);
|
||||
sub_80A456C(gUnknown_3001B78,0,&localArray);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// NOTE: Fallthrough needed here.
|
||||
case 0:
|
||||
sub_80A456C(gUnknown_3001B78, 0, &gUnknown_81177BC);
|
||||
break;
|
||||
}
|
||||
|
||||
sub_80A4764(gUnknown_3001B78);
|
||||
}
|
||||
|
||||
static void sub_80A62D0(void)
|
||||
{
|
||||
if (gUnknown_3001B74->unk2 != 0)
|
||||
sub_80A49E8(gUnknown_3001B78);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,229 +0,0 @@
|
|||
#include "global.h"
|
||||
#include "code_800558C.h"
|
||||
#include "debug.h"
|
||||
#include "event_flag.h"
|
||||
#include "ground_bg.h"
|
||||
#include "ground_map.h"
|
||||
#include "ground_map_2.h"
|
||||
#include "memory.h"
|
||||
|
||||
IWRAM_INIT unkStruct_3001B74 *gUnknown_3001B74 = {NULL};
|
||||
IWRAM_INIT GroundBg *gUnknown_3001B78 = {NULL};
|
||||
|
||||
extern const SubStruct_52C gUnknown_8117784;
|
||||
extern const s16 gUnknown_811E5F4[][2];
|
||||
extern const u8 gGroundWeatherSelect[];
|
||||
extern const s32 gUnknown_81177BC[];
|
||||
|
||||
extern void sub_80A49E8(GroundBg *);
|
||||
extern void sub_80A456C(GroundBg *, u32, const s32 *);
|
||||
extern void sub_80A4580(GroundBg *, u32, s32 *);
|
||||
extern void sub_80A56C0(s32 *);
|
||||
extern void sub_80A4764(GroundBg *);
|
||||
|
||||
static void sub_80A62D0(void);
|
||||
|
||||
void sub_80A5E70(void)
|
||||
{
|
||||
if (gGroundMapDungeon_3001B70 != NULL)
|
||||
sub_80A49E8(gGroundMapDungeon_3001B70);
|
||||
|
||||
sub_80A62D0();
|
||||
}
|
||||
|
||||
void sub_80A5E8C(u8 param_1)
|
||||
{
|
||||
gUnknown_3001B74 = MemoryAlloc(sizeof(unkStruct_3001B74), 6);
|
||||
gUnknown_3001B74->unk0 = -1;
|
||||
gUnknown_3001B74->unk2 = 0;
|
||||
sub_80A5EDC(param_1);
|
||||
}
|
||||
|
||||
void sub_80A5EBC(void)
|
||||
{
|
||||
sub_80A5EDC(0);
|
||||
MemoryFree(gUnknown_3001B74);
|
||||
gUnknown_3001B74 = NULL;
|
||||
}
|
||||
|
||||
void sub_80A5EDC(u8 param_1)
|
||||
{
|
||||
SetScriptVarValue(NULL, WEATHER_KIND, -1);
|
||||
gUnknown_3001B74->unk0 = -1;
|
||||
gUnknown_3001B74->unk2 = param_1;
|
||||
|
||||
if (gUnknown_3001B78 != NULL) {
|
||||
GroundBg_FreeAll(gUnknown_3001B78);
|
||||
MemoryFree(gUnknown_3001B78);
|
||||
gUnknown_3001B78 = NULL;
|
||||
}
|
||||
|
||||
if (param_1) {
|
||||
gUnknown_3001B78 = MemoryAlloc(sizeof(GroundBg), 6);
|
||||
GroundBg_Init(gUnknown_3001B78, &gUnknown_8117784);
|
||||
sub_80A2FBC(gUnknown_3001B78, -1);
|
||||
}
|
||||
}
|
||||
|
||||
void nullsub_121(void)
|
||||
{}
|
||||
|
||||
void nullsub_122(void)
|
||||
{}
|
||||
|
||||
void GroundWeather_Select(s16 param_1)
|
||||
{
|
||||
s32 iVar2;
|
||||
s32 iVar3;
|
||||
const s16 *pVar1;
|
||||
|
||||
iVar2 = param_1;
|
||||
iVar3 = iVar2;
|
||||
Log(0, gGroundWeatherSelect, iVar2, gUnknown_3001B74->unk2);
|
||||
SetScriptVarValue(NULL, WEATHER_KIND, iVar2);
|
||||
gUnknown_3001B74->unk0 = iVar2;
|
||||
|
||||
if (gUnknown_3001B74->unk2 == 0)
|
||||
return;
|
||||
|
||||
if (iVar2 == -1) {
|
||||
sub_80A2FBC(gUnknown_3001B78, -1);
|
||||
return;
|
||||
}
|
||||
|
||||
pVar1 = gUnknown_811E5F4[iVar3];
|
||||
sub_80A2FBC(gUnknown_3001B78, pVar1[1]);
|
||||
|
||||
gUnknown_3001B74->unk4 = 0;
|
||||
gUnknown_3001B74->unk8 = 0;
|
||||
gUnknown_3001B74->unkC = 0;
|
||||
gUnknown_3001B74->unk10 = 0;
|
||||
gUnknown_3001B74->unk20 = 0;
|
||||
gUnknown_3001B74->unk1C = 0;
|
||||
gUnknown_3001B74->unk18 = 0;
|
||||
gUnknown_3001B74->unk14 = 0;
|
||||
|
||||
switch (gUnknown_3001B74->unk0) {
|
||||
case 9:
|
||||
sub_80A3BB0(gUnknown_3001B78, 1);
|
||||
gUnknown_2026E4E = 0x40c;
|
||||
break;
|
||||
case 7:
|
||||
gUnknown_2026E4E = 0x808;
|
||||
break;
|
||||
case 14:
|
||||
sub_80A3BB0(gUnknown_3001B78, 1);
|
||||
gUnknown_2026E4E = 0x1010;
|
||||
break;
|
||||
case 15:
|
||||
sub_80A3BB0(gUnknown_3001B78, 1);
|
||||
gUnknown_2026E4E = 0x40c;
|
||||
break;
|
||||
case 0:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 8:
|
||||
gUnknown_2026E4E = 0x1010;
|
||||
break;
|
||||
default:
|
||||
if (pVar1[0] == 1)
|
||||
sub_80A3BB0(gUnknown_3001B78, 1);
|
||||
|
||||
gUnknown_2026E4E = 0x1000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
UNUSED static s16 sub_80A60C4(void)
|
||||
{
|
||||
return gUnknown_3001B74->unk0;
|
||||
}
|
||||
|
||||
void nullsub_123(void)
|
||||
{}
|
||||
|
||||
void sub_80A60D8(void)
|
||||
{
|
||||
if (gUnknown_3001B74->unk2 == 0)
|
||||
return;
|
||||
|
||||
switch ((s16)(gUnknown_3001B74->unk0 + 1)) {
|
||||
case 10: {
|
||||
s32 localArray[2];
|
||||
|
||||
gUnknown_3001B74->unk4 += 2;
|
||||
gUnknown_3001B74->unk8 += 1;
|
||||
gUnknown_3001B74->unkC += gUnknown_3001B74->unk4 / 4;
|
||||
gUnknown_3001B74->unk10 += gUnknown_3001B74->unk8 / 4;
|
||||
sub_80A4580(gUnknown_3001B78, 0, &gUnknown_3001B74->unkC);
|
||||
gUnknown_3001B74->unk4 &= 3;
|
||||
gUnknown_3001B74->unk8 &= 3;
|
||||
sub_80A56C0(localArray);
|
||||
localArray[0] -= gUnknown_3001B74->unkC;
|
||||
localArray[1] += gUnknown_3001B74->unk10;
|
||||
sub_80A4580(gUnknown_3001B78, 0, localArray);
|
||||
sub_80A456C(gUnknown_3001B78, 0, localArray);
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14: {
|
||||
s32 localArray[2];
|
||||
|
||||
sub_80A56C0(localArray);
|
||||
sub_80A456C(gUnknown_3001B78,0,localArray);
|
||||
break;
|
||||
}
|
||||
case 15: {
|
||||
s32 localArray[2];
|
||||
|
||||
gUnknown_3001B74->unk4++;
|
||||
gUnknown_3001B74->unkC += gUnknown_3001B74->unk4 / 4;
|
||||
sub_80A4580(gUnknown_3001B78, 0, &gUnknown_3001B74->unkC);
|
||||
gUnknown_3001B74->unk4 &= 3;
|
||||
sub_80A56C0(localArray);
|
||||
localArray[0] -= gUnknown_3001B74->unkC;
|
||||
localArray[1] = 0;
|
||||
sub_80A4580(gUnknown_3001B78, 0, localArray);
|
||||
sub_80A456C(gUnknown_3001B78, 0, localArray);
|
||||
break;
|
||||
}
|
||||
case 16: {
|
||||
s32 localArray[2];
|
||||
|
||||
gUnknown_3001B74->unk4 += 2;
|
||||
gUnknown_3001B74->unkC += gUnknown_3001B74->unk4 / 4;
|
||||
sub_80A4580(gUnknown_3001B78, 0, &gUnknown_3001B74->unkC);
|
||||
gUnknown_3001B74->unk4 &= 3;
|
||||
sub_80A56C0(localArray);
|
||||
localArray[0] -= gUnknown_3001B74->unkC;
|
||||
localArray[1] = 0;
|
||||
sub_80A4580(gUnknown_3001B78, 0, localArray);
|
||||
sub_80A456C(gUnknown_3001B78, 0, localArray);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
s32 localArray[2];
|
||||
const s16 *puVar1 = gUnknown_811E5F4[gUnknown_3001B74->unk0];
|
||||
if (puVar1[0] == 0) {
|
||||
sub_80A56C0(localArray);
|
||||
sub_80A456C(gUnknown_3001B78,0,localArray);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// NOTE: Fallthrough needed here.
|
||||
case 0:
|
||||
sub_80A456C(gUnknown_3001B78, 0, gUnknown_81177BC);
|
||||
break;
|
||||
}
|
||||
|
||||
sub_80A4764(gUnknown_3001B78);
|
||||
}
|
||||
|
||||
static void sub_80A62D0(void)
|
||||
{
|
||||
if (gUnknown_3001B74->unk2 != 0)
|
||||
sub_80A49E8(gUnknown_3001B78);
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
#include "global.h"
|
||||
#include "globaldata.h"
|
||||
#include "debug.h"
|
||||
#include "map_script_table.h"
|
||||
|
||||
static EWRAM_DATA s16 sScriptFileId = {0};
|
||||
|
|
@ -50,7 +51,7 @@ bool8 ChangeScriptFile(s16 a0)
|
|||
|
||||
static const struct GroundScriptHeader sNullGroundScript = {0};
|
||||
|
||||
const struct GroundScriptHeader *GetGroundScript(s16 mapId)
|
||||
const struct GroundScriptHeader *GetGroundScript(s16 mapId, const DebugLocation *unused)
|
||||
{
|
||||
if (mapId != -1)
|
||||
return gMapScriptTable[mapId];
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "debug.h"
|
||||
#include "def_filearchives.h"
|
||||
#include "file_system.h"
|
||||
#include "ground_map_1.h"
|
||||
#include "ground_map.h"
|
||||
#include "ground_sprite.h"
|
||||
#include "ground_sprite_data.h"
|
||||
#include "memory.h"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
.include "src/textbox.o"
|
||||
.include "src/unk_ds_only_feature.o"
|
||||
.include "src/ground_map.o"
|
||||
.include "src/ground_map_2.o"
|
||||
.include "src/ground_map_1.o"
|
||||
.include "src/ground_sprite.o"
|
||||
.include "src/ground_lives.o"
|
||||
.include "src/ground_object.o"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user