mirror of
https://github.com/pret/pmd-red.git
synced 2025-02-17 12:01:08 +00:00
Decomp SaveDungeonWeather
This commit is contained in:
parent
16e70a7426
commit
7338e36e18
@ -5,50 +5,6 @@
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start SaveDungeonWeather
|
||||
SaveDungeonWeather:
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
adds r5, r1, 0
|
||||
movs r2, 0x1
|
||||
bl sub_8082FA8
|
||||
adds r1, r5, 0x1
|
||||
adds r0, r6, 0
|
||||
movs r2, 0x1
|
||||
bl sub_8082FA8
|
||||
movs r4, 0
|
||||
_08081BAC:
|
||||
adds r0, r5, 0x3
|
||||
adds r0, r4
|
||||
ldrb r1, [r0]
|
||||
adds r0, r6, 0
|
||||
bl sub_8083060
|
||||
adds r0, r5, 0
|
||||
adds r0, 0xB
|
||||
adds r0, r4
|
||||
ldrb r1, [r0]
|
||||
adds r0, r6, 0
|
||||
bl sub_8083060
|
||||
adds r4, 0x1
|
||||
cmp r4, 0x7
|
||||
ble _08081BAC
|
||||
ldrb r1, [r5, 0x2]
|
||||
adds r0, r6, 0
|
||||
bl sub_8083060
|
||||
ldrb r1, [r5, 0x13]
|
||||
adds r0, r6, 0
|
||||
bl sub_8083060
|
||||
ldrb r1, [r5, 0x14]
|
||||
adds r0, r6, 0
|
||||
bl sub_8083060
|
||||
ldrb r1, [r5, 0x15]
|
||||
adds r0, r6, 0
|
||||
bl sub_80830B4
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end SaveDungeonWeather
|
||||
|
||||
thumb_func_start sub_8081BF4
|
||||
sub_8081BF4:
|
||||
push {lr}
|
||||
|
@ -36,11 +36,11 @@ typedef struct Weather
|
||||
/* 0xE264 */ u8 weather; // Uses the weather constants in weather.h.
|
||||
u8 unkE265; // Uses the weather constants in weather.h
|
||||
/* 0xE266 */ u8 weatherDamageCounter; // Timer for applying sandstorm/hail damage periodically.
|
||||
/* 0xE267 */ u8 unkE267[0xE269 - 0xE267];
|
||||
/* 0xE267 */ u8 unkE267[0xE269 - 0xE267]; // TODO: same size as naturalWeather according to SaveDungeonWeather
|
||||
u8 unkE269;
|
||||
u8 fillE26A;
|
||||
u8 unkE26B;
|
||||
u8 weatherTurns;
|
||||
/* 0xE26C */ u8 weatherTurns;
|
||||
u8 fillE26D[0xE26F - 0xE26D];
|
||||
/* 0xE26F */ u8 naturalWeather[8]; // The weather at the start of the floor. If the weather changes, then expires, revert back to the starting weather.
|
||||
/* 0xE277 */ u8 mudSportTurns;
|
||||
|
17
src/trap_1.c
17
src/trap_1.c
@ -17,7 +17,7 @@ extern void sub_8082FA8(unkStruct_8094924 *, void *, s32);
|
||||
void SaveTile(unkStruct_8094924 *r0, Tile *tile);
|
||||
void sub_80830F8(void * , u32*);
|
||||
void sub_808312C(void *, u32 *);
|
||||
void SaveDungeonWeather(void *, Weather *);
|
||||
void SaveDungeonWeather(unkStruct_8094924 *r0, Weather *weather);
|
||||
void sub_8083078(void *, u32);
|
||||
void sub_80830B4(void *, u8);
|
||||
void sub_8083030(void *, u16);
|
||||
@ -745,4 +745,19 @@ void SaveTile(unkStruct_8094924 *r0, Tile *tile)
|
||||
sub_8082FA8(r0, &tile->unkE, 1);
|
||||
}
|
||||
|
||||
void SaveDungeonWeather(unkStruct_8094924 *r0, Weather *weather)
|
||||
{
|
||||
s32 index;
|
||||
sub_8082FA8(r0, &weather->weather, 1);
|
||||
sub_8082FA8(r0, &weather->unkE265, 1);
|
||||
for(index = 0; index < 8; index++)
|
||||
{
|
||||
sub_8083060(r0, weather->unkE267[index]);
|
||||
sub_8083060(r0, weather->naturalWeather[index]);
|
||||
}
|
||||
sub_8083060(r0, weather->weatherDamageCounter);
|
||||
sub_8083060(r0, weather->mudSportTurns);
|
||||
sub_8083060(r0, weather->waterSportTurns);
|
||||
sub_80830B4(r0, weather->nullifyWeather);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user