mirror of
https://github.com/pret/pmd-sky.git
synced 2026-04-24 23:09:54 -05:00
Decomped SetPokemonJoined
Decomped by @Chesyon and @taxicat1
This commit is contained in:
parent
a45e16027e
commit
279364f654
|
|
@ -1,25 +1,9 @@
|
|||
#pragma once
|
||||
.public _0209E3A1
|
||||
.public _0209E3A2
|
||||
.public _0209E3A3
|
||||
.public _0209E6BD
|
||||
.public _020A192C
|
||||
.public _022AB4F8
|
||||
.public _022AB5AC
|
||||
.public _022AB69C
|
||||
.public _022AB924
|
||||
.public ADVENTURE_LOG_ENCOUNTERS_MONSTER_IDS
|
||||
.public ADVENTURE_LOG_PTR
|
||||
.public ARM9_UNKNOWN_DATA__NA_209E6BC
|
||||
.public Copy16BitsFrom
|
||||
.public Copy16BitsTo
|
||||
.public CopyNStringFromId
|
||||
.public DUNGEON_DATA_LIST
|
||||
.public DungeonSwapIdToIdx
|
||||
.public DungeonSwapIdxToId
|
||||
.public GetBaseFormCastformCherrimDeoxys
|
||||
.public GetBodySize
|
||||
.public GetDexNumberVeneer
|
||||
.public GetDungeonMode
|
||||
.public GetDungeonModeSpecial
|
||||
.public GetGameMode
|
||||
|
|
@ -30,29 +14,30 @@
|
|||
.public GetNameString
|
||||
.public GetNbItemsInBag
|
||||
.public GetPartyMembers
|
||||
.public GetRankUpEntry
|
||||
.public GetPlayTimeSeconds
|
||||
.public GetResolvedPerformanceProgressFlag
|
||||
.public GetStringFromFileVeneer
|
||||
.public GuestMonsterToGroundMonster
|
||||
.public IsItemValidVeneer
|
||||
.public IsLevelResetDungeon
|
||||
.public IsMoneyAllowed
|
||||
.public IsRealMove
|
||||
.public IsRecruitingAllowed
|
||||
.public LoadScriptVariableValue
|
||||
.public MemZero
|
||||
.public MISSION_FLOOR_RANKS_PTRS
|
||||
.public NormalizeTreasureBox
|
||||
.public OUTLAW_LEVEL_TABLE
|
||||
.public OUTLAW_MINION_LEVEL_TABLE
|
||||
.public PENDING_DUNGEON_ID
|
||||
.public PLAY_TIME_SECONDS
|
||||
.public PlayTimerTick
|
||||
.public ResetPlayTimer
|
||||
.public SECONDARY_TERRAIN_TYPES
|
||||
.public SetResolvedPerformanceProgressFlag
|
||||
.public StrncpyName
|
||||
.public StrncpySimpleNoPad
|
||||
.public StrncpySimpleNoPadSafe
|
||||
.public sub_0204CEE0
|
||||
.public sub_0205EE40
|
||||
.public TEAM_MEMBER_TABLE_PTR
|
||||
.public TEAM_NAME
|
||||
.public _0209E3A1
|
||||
.public _0209E3A2
|
||||
.public _0209E3A3
|
||||
.public _022AB4F8
|
||||
.public _022AB5AC
|
||||
.public _022AB69C
|
||||
.public sub_0204CEE0
|
||||
.public sub_02050E5C
|
||||
.public sub_02050E8C
|
||||
.public sub_0205EE40
|
||||
|
|
|
|||
27
asm/include/main_0204FE58.inc
Normal file
27
asm/include/main_0204FE58.inc
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
.public ADVENTURE_LOG_ENCOUNTERS_MONSTER_IDS
|
||||
.public ADVENTURE_LOG_PTR
|
||||
.public ARM9_UNKNOWN_DATA__NA_209E6BC
|
||||
.public Copy16BitsFrom
|
||||
.public Copy16BitsTo
|
||||
.public CopyNStringFromId
|
||||
.public GetAdventureLogCompleted
|
||||
.public GetBaseFormCastformCherrimDeoxys
|
||||
.public GetDexNumberVeneer
|
||||
.public GetRankUpEntry
|
||||
.public GetResolvedPerformanceProgressFlag
|
||||
.public GetStringFromFileVeneer
|
||||
.public IsItemValidVeneer
|
||||
.public IsRealMove
|
||||
.public MemZero
|
||||
.public NormalizeTreasureBox
|
||||
.public SetAdventureLogCompleted
|
||||
.public SetResolvedPerformanceProgressFlag
|
||||
.public StrncpyName
|
||||
.public StrncpySimpleNoPad
|
||||
.public StrncpySimpleNoPadSafe
|
||||
.public TEAM_MEMBER_TABLE_PTR
|
||||
.public TEAM_NAME
|
||||
.public _0209E6BD
|
||||
.public _020A192C
|
||||
.public _022AB924
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
.text
|
||||
|
||||
; https://decomp.me/scratch/juWhM
|
||||
arm_func_start IsItemInTimeDarkness
|
||||
IsItemInTimeDarkness: ; 0x0200EB30
|
||||
ldr r1, _0200EB54 ; =ITEM_DATA_TABLE_PTRS
|
||||
|
|
|
|||
1553
asm/main_0204EFE0.s
1553
asm/main_0204EFE0.s
File diff suppressed because it is too large
Load Diff
1529
asm/main_0204FE58.s
Normal file
1529
asm/main_0204FE58.s
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
.text
|
||||
|
||||
; https://decomp.me/scratch/LRAYo
|
||||
arm_func_start sub_0205A4B4
|
||||
sub_0205A4B4: ; 0x0205A4B4
|
||||
stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ _0205B118:
|
|||
ldmia sp!, {r3, pc}
|
||||
arm_func_end sub_0205B0B8
|
||||
|
||||
; https://decomp.me/scratch/gWhya
|
||||
arm_func_start sub_0205B120
|
||||
sub_0205B120: ; 0x0205B120
|
||||
stmdb sp!, {r4, r5, r6, r7, lr}
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ _0233CBC4: .word 0x000004FD
|
|||
#endif
|
||||
arm_func_end ov09_0233CA80
|
||||
|
||||
; https://decomp.me/scratch/Uyfr0
|
||||
arm_func_start ov09_0233CBC8
|
||||
ov09_0233CBC8: ; 0x0233CBC8
|
||||
stmdb sp!, {r3, lr}
|
||||
|
|
|
|||
|
|
@ -1093,6 +1093,7 @@ _023038D0: .word 0x00000F25
|
|||
#endif
|
||||
arm_func_end ov29_023034E0
|
||||
|
||||
; https://decomp.me/scratch/wws4M
|
||||
arm_func_start DungeonTmLearnMove
|
||||
DungeonTmLearnMove: ; 0x023038D4
|
||||
#ifdef JAPAN
|
||||
|
|
|
|||
32
include/adventure_log.h
Normal file
32
include/adventure_log.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#ifndef PMDSKY_ADVENTURE_LOG_H
|
||||
#define PMDSKY_ADVENTURE_LOG_H
|
||||
|
||||
#include "dungeon.h"
|
||||
|
||||
// The adventure log structure.
|
||||
struct adventure_log {
|
||||
u32 completion_flags[4]; // 0x0
|
||||
u32 nb_dungeons_cleared; // 0x10
|
||||
u32 nb_friend_rescues; // 0x14
|
||||
u32 nb_evolutions; // 0x18
|
||||
u32 nb_eggs_hatched; // 0x1C
|
||||
u32 successful_steals; // 0x20: Unused in Sky
|
||||
u32 nb_faints; // 0x24
|
||||
u32 nb_victories_on_one_floor; // 0x28
|
||||
u32 pokemon_joined_counter; // 0x2C
|
||||
u32 pokemon_battled_counter; // 0x30
|
||||
u32 moves_learned_counter; // 0x34
|
||||
u32 nb_big_treasure_wins; // 0x38
|
||||
u32 nb_recycled; // 0x3C
|
||||
u32 nb_gifts_sent; // 0x40
|
||||
u32 pokemon_joined_flags[37]; // 0x44
|
||||
u32 pokemon_battled_flags[37]; // 0xD8
|
||||
u32 moves_learned_flags[17]; // 0x16C
|
||||
u32 items_acquired_flags[44]; // 0x1B0
|
||||
u32 special_challenge_flags; // 0x260
|
||||
u32 sentry_duty_game_points[5]; // 0x264
|
||||
struct dungeon_floor_pair current_floor; // 0x278
|
||||
u16 padding; // 0x27A
|
||||
};
|
||||
|
||||
#endif //PMDSKY_ADVENTURE_LOG_H
|
||||
|
|
@ -1846,4 +1846,10 @@ struct dungeon_restriction {
|
|||
s16 random_movement_chance;
|
||||
};
|
||||
|
||||
// A common structure for pairs of dungeon/floor values
|
||||
struct dungeon_floor_pair {
|
||||
u8 dungeon_id;
|
||||
u8 floor_id;
|
||||
};
|
||||
|
||||
#endif // PMDSKY_DUNGEON_H
|
||||
|
|
|
|||
7
include/main_0204FDFC.h
Normal file
7
include/main_0204FDFC.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#ifndef PMDSKY_MAIN_0204FDFC_H
|
||||
#define PMDSKY_MAIN_0204FDFC_H
|
||||
|
||||
// Marks one Pokémon as joined.
|
||||
void SetPokemonJoined(u32 monster_id);
|
||||
|
||||
#endif //PMDSKY_MAIN_0204FDFC_H
|
||||
2
main.lsf
2
main.lsf
|
|
@ -90,6 +90,8 @@ Static main
|
|||
Object asm/main_0204DE7C.o
|
||||
Object src/dungeon_init.o
|
||||
Object asm/main_0204EFE0.o
|
||||
Object src/main_0204FDFC.o
|
||||
Object asm/main_0204FE58.o
|
||||
Object src/number_util.o
|
||||
Object asm/main_02051098.o
|
||||
Object src/dungeon_recruitment_2.o
|
||||
|
|
|
|||
19
src/main_0204FDFC.c
Normal file
19
src/main_0204FDFC.c
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#include "main_0204FDFC.h"
|
||||
#include "adventure_log.h"
|
||||
|
||||
extern struct adventure_log* ADVENTURE_LOG_PTR;
|
||||
|
||||
extern s32 GetDexNumberVeneer();
|
||||
|
||||
void SetPokemonJoined(u32 monster_id)
|
||||
{
|
||||
s32 dex_num = GetDexNumberVeneer(monster_id);
|
||||
if (dex_num == 0) return;
|
||||
|
||||
ADVENTURE_LOG_PTR->completion_flags[0] |= 1;
|
||||
|
||||
u32 word = dex_num / 32; // dex_num / 32
|
||||
u32 bit = dex_num % 32; // dex_num % 32
|
||||
|
||||
ADVENTURE_LOG_PTR->pokemon_joined_flags[word] |= (1 << bit);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user