mirror of
https://github.com/pret/pmd-sky.git
synced 2026-03-21 17:25:15 -05:00
Decomped IsUnown, IsShaymin, & IsDeoxys
This commit is contained in:
parent
0f303b4d96
commit
fd51c7ee16
|
|
@ -1,4 +1,56 @@
|
|||
#pragma once
|
||||
.public Debug_Print0
|
||||
.public DecompressAtNormalVeneer
|
||||
.public DexNumbersEqual
|
||||
.public DirectoryFileMngr_OpenDirectoryFile
|
||||
.public DungeonToGroundMoveset
|
||||
.public EnableAllLearnableIqSkills
|
||||
.public FORBIDDEN_FORGOT_MOVE_LIST
|
||||
.public FemaleToMaleForm
|
||||
.public GetBaseHp
|
||||
.public GetDexNumber
|
||||
.public GetInfoGroundMoveset
|
||||
.public GetInfoMoveGround
|
||||
.public GetKeyM2NSwitch
|
||||
.public GetKeyN2MSwitch
|
||||
.public GetLanguage
|
||||
.public GetMonsterGender
|
||||
.public GetMovesetEggPtr
|
||||
.public GetMovesetHmTmPtr
|
||||
.public GetMovesetIdx__02013CAC
|
||||
.public GetMovesetLevelUpPtr
|
||||
.public GetNameRaw
|
||||
.public GetNameString
|
||||
.public GetNbMoves
|
||||
.public GetSpriteSize
|
||||
.public GroundToDungeonMoveset
|
||||
.public HIDDEN_POWER_BASE_POWER_TABLE
|
||||
.public HandleSir0Translation
|
||||
.public IsShaymin
|
||||
.public IsValidTeamMember
|
||||
.public ItemZInit
|
||||
.public LEVEL_UP_DATA_DECOMPRESS_BUFFER
|
||||
.public LEVEL_UP_DATA_MONSTER_ID
|
||||
.public LoadFileFromRom
|
||||
.public LoadMonsterMd
|
||||
.public MONSTER_DATA_TABLE_PTR
|
||||
.public MemAlloc
|
||||
.public MemFree
|
||||
.public PointsToZero
|
||||
.public Rand16Bit
|
||||
.public RandIntSafe
|
||||
.public RemoveActiveMembersFromAllTeams
|
||||
.public RemoveActiveMembersFromRescueTeam
|
||||
.public RemoveActiveMembersFromSpecialEpisodeTeam
|
||||
.public SprintfStatic__02052418
|
||||
.public StrcpyName
|
||||
.public StrncmpSimple
|
||||
.public StrncpyName
|
||||
.public StrncpySimple
|
||||
.public TEAM_MEMBER_TABLE
|
||||
.public TEAM_MEMBER_TABLE_PTR
|
||||
.public UnloadFile
|
||||
.public ZInit8
|
||||
.public _020A1880
|
||||
.public _020A1884
|
||||
.public _020A189C
|
||||
|
|
@ -17,53 +69,6 @@
|
|||
.public _020B12F4_EU
|
||||
.public _020B1308_EU
|
||||
.public _s32_div_f
|
||||
.public Debug_Print0
|
||||
.public DecompressAtNormalVeneer
|
||||
.public DexNumbersEqual
|
||||
.public DirectoryFileMngr_OpenDirectoryFile
|
||||
.public DungeonToGroundMoveset
|
||||
.public EnableAllLearnableIqSkills
|
||||
.public FemaleToMaleForm
|
||||
.public FORBIDDEN_FORGOT_MOVE_LIST
|
||||
.public GetBaseHp
|
||||
.public GetDexNumber
|
||||
.public GetInfoGroundMoveset
|
||||
.public GetInfoMoveGround
|
||||
.public GetKeyM2NSwitch
|
||||
.public GetKeyN2MSwitch
|
||||
.public GetLanguage
|
||||
.public GetMonsterGender
|
||||
.public GetMovesetEggPtr
|
||||
.public GetMovesetHmTmPtr
|
||||
.public GetMovesetIdx__02013CAC
|
||||
.public GetMovesetLevelUpPtr
|
||||
.public GetNameRaw
|
||||
.public GetNameString
|
||||
.public GetNbMoves
|
||||
.public GetSpriteSize
|
||||
.public GroundToDungeonMoveset
|
||||
.public HandleSir0Translation
|
||||
.public HIDDEN_POWER_BASE_POWER_TABLE
|
||||
.public IsValidTeamMember
|
||||
.public ItemZInit
|
||||
.public LEVEL_UP_DATA_DECOMPRESS_BUFFER
|
||||
.public LEVEL_UP_DATA_MONSTER_ID
|
||||
.public LoadFileFromRom
|
||||
.public LoadMonsterMd
|
||||
.public MemAlloc
|
||||
.public MemFree
|
||||
.public MONSTER_DATA_TABLE_PTR
|
||||
.public PointsToZero
|
||||
.public Rand16Bit
|
||||
.public RandIntSafe
|
||||
.public RemoveActiveMembersFromAllTeams
|
||||
.public RemoveActiveMembersFromRescueTeam
|
||||
.public RemoveActiveMembersFromSpecialEpisodeTeam
|
||||
.public SprintfStatic__02052418
|
||||
.public StrcpyName
|
||||
.public StrncmpSimple
|
||||
.public StrncpyName
|
||||
.public StrncpySimple
|
||||
.public sub_01FF8F28
|
||||
.public sub_02015090
|
||||
.public sub_02025304_JP
|
||||
|
|
@ -77,8 +82,4 @@
|
|||
.public sub_020560B8
|
||||
.public sub_020564B0
|
||||
.public sub_02056504
|
||||
.public TEAM_MEMBER_TABLE
|
||||
.public TEAM_MEMBER_TABLE_PTR
|
||||
.public UnloadFile
|
||||
.public vsprintf
|
||||
.public ZInit8
|
||||
|
|
|
|||
1
asm/include/main_02054AD4.inc
Normal file
1
asm/include/main_02054AD4.inc
Normal file
|
|
@ -0,0 +1 @@
|
|||
#pragma once
|
||||
|
|
@ -2625,104 +2625,3 @@ SprintfStatic__02054A60: ; 0x02054A60
|
|||
add sp, sp, #0x10
|
||||
bx lr
|
||||
arm_func_end SprintfStatic__02054A60
|
||||
|
||||
arm_func_start IsUnown
|
||||
IsUnown: ; 0x02054A88
|
||||
cmp r0, #0xc9
|
||||
blt _02054A9C
|
||||
cmp r0, #0xe4
|
||||
movle r0, #1
|
||||
bxle lr
|
||||
_02054A9C:
|
||||
mov r0, #0
|
||||
bx lr
|
||||
arm_func_end IsUnown
|
||||
|
||||
arm_func_start IsShaymin
|
||||
IsShaymin: ; 0x02054AA4
|
||||
ldr r1, _02054AD0 ; =0xFFFFFDEA
|
||||
add r0, r0, r1
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, asr #0x10
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, lsr #0x10
|
||||
cmp r0, #1
|
||||
movls r0, #1
|
||||
movhi r0, #0
|
||||
and r0, r0, #0xff
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02054AD0: .word 0xFFFFFDEA
|
||||
arm_func_end IsShaymin
|
||||
|
||||
arm_func_start IsCastform
|
||||
IsCastform: ; 0x02054AD4
|
||||
ldr r2, _02054B24 ; =0x0000017B
|
||||
cmp r0, r2
|
||||
cmpne r0, #0x17c
|
||||
addne r1, r2, #2
|
||||
cmpne r0, r1
|
||||
addne r1, r2, #3
|
||||
cmpne r0, r1
|
||||
beq _02054B14
|
||||
ldr r1, _02054B28 ; =0xFFFFFC2D
|
||||
add r0, r0, r1
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, asr #0x10
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, lsr #0x10
|
||||
cmp r0, #3
|
||||
bhi _02054B1C
|
||||
_02054B14:
|
||||
mov r0, #1
|
||||
bx lr
|
||||
_02054B1C:
|
||||
mov r0, #0
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02054B24: .word 0x0000017B
|
||||
_02054B28: .word 0xFFFFFC2D
|
||||
arm_func_end IsCastform
|
||||
|
||||
arm_func_start IsCherrim
|
||||
IsCherrim: ; 0x02054B2C
|
||||
cmp r0, #0x1cc
|
||||
ldrne r1, _02054B6C ; =0x000001CD
|
||||
cmpne r0, r1
|
||||
beq _02054B5C
|
||||
ldr r1, _02054B70 ; =0xFFFFFBDC
|
||||
add r0, r0, r1
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, asr #0x10
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, lsr #0x10
|
||||
cmp r0, #1
|
||||
bhi _02054B64
|
||||
_02054B5C:
|
||||
mov r0, #1
|
||||
bx lr
|
||||
_02054B64:
|
||||
mov r0, #0
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02054B6C: .word 0x000001CD
|
||||
_02054B70: .word 0xFFFFFBDC
|
||||
arm_func_end IsCherrim
|
||||
|
||||
; https://decomp.me/scratch/IvDKt
|
||||
arm_func_start IsDeoxys
|
||||
IsDeoxys: ; 0x02054B74
|
||||
ldr r1, _02054BA0 ; =0xFFFFFE5E
|
||||
add r0, r0, r1
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, asr #0x10
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, lsr #0x10
|
||||
cmp r0, #3
|
||||
movls r0, #1
|
||||
movhi r0, #0
|
||||
and r0, r0, #0xff
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02054BA0: .word 0xFFFFFE5E
|
||||
arm_func_end IsDeoxys
|
||||
|
|
|
|||
59
asm/main_02054AD4.s
Normal file
59
asm/main_02054AD4.s
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "main_02054AD4.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start IsCastform
|
||||
IsCastform: ; 0x02054AD4
|
||||
ldr r2, _02054B24 ; =0x0000017B
|
||||
cmp r0, r2
|
||||
cmpne r0, #0x17c
|
||||
addne r1, r2, #2
|
||||
cmpne r0, r1
|
||||
addne r1, r2, #3
|
||||
cmpne r0, r1
|
||||
beq _02054B14
|
||||
ldr r1, _02054B28 ; =0xFFFFFC2D
|
||||
add r0, r0, r1
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, asr #0x10
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, lsr #0x10
|
||||
cmp r0, #3
|
||||
bhi _02054B1C
|
||||
_02054B14:
|
||||
mov r0, #1
|
||||
bx lr
|
||||
_02054B1C:
|
||||
mov r0, #0
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02054B24: .word 0x0000017B
|
||||
_02054B28: .word 0xFFFFFC2D
|
||||
arm_func_end IsCastform
|
||||
|
||||
arm_func_start IsCherrim
|
||||
IsCherrim: ; 0x02054B2C
|
||||
cmp r0, #0x1cc
|
||||
ldrne r1, _02054B6C ; =0x000001CD
|
||||
cmpne r0, r1
|
||||
beq _02054B5C
|
||||
ldr r1, _02054B70 ; =0xFFFFFBDC
|
||||
add r0, r0, r1
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, asr #0x10
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, lsr #0x10
|
||||
cmp r0, #1
|
||||
bhi _02054B64
|
||||
_02054B5C:
|
||||
mov r0, #1
|
||||
bx lr
|
||||
_02054B64:
|
||||
mov r0, #0
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02054B6C: .word 0x000001CD
|
||||
_02054B70: .word 0xFFFFFBDC
|
||||
arm_func_end IsCherrim
|
||||
|
||||
9
include/main_02054AA4.h
Normal file
9
include/main_02054AA4.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef PMDSKY_MAIN_02054AA4_H
|
||||
#define PMDSKY_MAIN_02054AA4_H
|
||||
|
||||
#include "util.h"
|
||||
|
||||
bool8 IsUnown(s16 monster_id);
|
||||
bool8 IsShaymin(s16 monster_id);
|
||||
|
||||
#endif //PMDSKY_MAIN_02054AA4_H
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
#ifndef PMDSKY_MAIN_02054BE0_H
|
||||
#define PMDSKY_MAIN_02054BE0_H
|
||||
|
||||
#include "util.h"
|
||||
|
||||
bool8 IsDeoxys(s16 monster_id);
|
||||
s16 GetSecondFormIfValid(s16 id);
|
||||
// Returns the ID of the first form of the specified monster if the specified ID corresponds to a secondary form with female gender and the first form has male gender. If those conditions don't meet, returns the same ID unchanged.
|
||||
// return: ID of the male form of the monster if the requirements meet, same ID otherwise.
|
||||
|
|
|
|||
2
main.lsf
2
main.lsf
|
|
@ -65,6 +65,8 @@ Static main
|
|||
Object asm/main_02052890.o
|
||||
Object src/main_02052950.o
|
||||
Object asm/main_0205297C.o
|
||||
Object src/main_02054AA4.o
|
||||
Object asm/main_02054AD4.o
|
||||
Object src/main_02054BE0.o
|
||||
Object asm/main_02054C24.o
|
||||
Object src/pokemon.o
|
||||
|
|
|
|||
12
src/main_02054AA4.c
Normal file
12
src/main_02054AA4.c
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include "main_02054AA4.h"
|
||||
#include "enums.h"
|
||||
#include "util.h"
|
||||
|
||||
bool8 IsUnown(s16 monster_id) {
|
||||
if(monster_id >= MONSTER_UNOWN_A && monster_id <= MONSTER_UNOWN_QUESTION) return TRUE;
|
||||
else return FALSE;
|
||||
}
|
||||
|
||||
bool8 IsShaymin(s16 monster_id) {
|
||||
return (u16)(s16)(monster_id - MONSTER_SHAYMIN_LAND) <= 1;
|
||||
}
|
||||
|
|
@ -1,5 +1,11 @@
|
|||
#include "main_02054BE0.h"
|
||||
#include "enums.h"
|
||||
#include "util.h"
|
||||
|
||||
bool8 IsDeoxys(s16 monster_id)
|
||||
{
|
||||
return (u16)(s16)(monster_id - MONSTER_DEOXYS_NORMAL) <= 3;
|
||||
}
|
||||
|
||||
extern s16 GetMonsterGender(s16 monster_id);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user