mirror of
https://github.com/pret/pmd-red.git
synced 2026-08-28 19:55:09 -05:00
decomp two more funcs
This commit is contained in:
@@ -597,63 +597,4 @@ _0809080E:
|
||||
bx r1
|
||||
thumb_func_end sub_809034C
|
||||
|
||||
thumb_func_start sub_8090820
|
||||
sub_8090820:
|
||||
push {r4-r7,lr}
|
||||
lsls r0, 16
|
||||
lsrs r6, r0, 16
|
||||
movs r4, 0
|
||||
ldr r0, _08090868
|
||||
ldr r0, [r0]
|
||||
mov r12, r0
|
||||
movs r7, 0x1
|
||||
_08090830:
|
||||
movs r0, 0x58
|
||||
muls r0, r4
|
||||
mov r2, r12
|
||||
adds r1, r2, r0
|
||||
ldrh r2, [r1]
|
||||
adds r0, r7, 0
|
||||
ands r0, r2
|
||||
cmp r0, 0
|
||||
beq _08090874
|
||||
lsrs r0, r2, 1
|
||||
ands r0, r7
|
||||
cmp r0, 0
|
||||
beq _08090874
|
||||
movs r3, 0
|
||||
movs r5, 0x1
|
||||
adds r2, r1, 0
|
||||
adds r2, 0x2C
|
||||
_08090852:
|
||||
ldrb r1, [r2]
|
||||
adds r0, r5, 0
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _0809086C
|
||||
ldrh r0, [r2, 0x2]
|
||||
cmp r0, r6
|
||||
bne _0809086C
|
||||
movs r0, 0x1
|
||||
b _08090880
|
||||
.align 2, 0
|
||||
_08090868: .4byte gRecruitedPokemonRef
|
||||
_0809086C:
|
||||
adds r2, 0x8
|
||||
adds r3, 0x1
|
||||
cmp r3, 0x3
|
||||
ble _08090852
|
||||
_08090874:
|
||||
adds r4, 0x1
|
||||
movs r0, 0xCE
|
||||
lsls r0, 1
|
||||
cmp r4, r0
|
||||
ble _08090830
|
||||
movs r0, 0
|
||||
_08090880:
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8090820
|
||||
|
||||
.align 2,0
|
||||
.align 2,0
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#include "asm/constants/gba_constants.inc"
|
||||
#include "asm/macros.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_80840A4
|
||||
sub_80840A4:
|
||||
ldr r3, _080840C8
|
||||
ldr r0, [r3]
|
||||
ldr r2, _080840CC
|
||||
adds r1, r0, 0
|
||||
muls r1, r2
|
||||
adds r1, 0x1
|
||||
lsrs r0, r1, 16
|
||||
muls r1, r2
|
||||
adds r1, 0x1
|
||||
str r1, [r3]
|
||||
ldr r2, _080840D0
|
||||
ands r1, r2
|
||||
orrs r0, r1
|
||||
ldr r1, _080840D4
|
||||
ands r0, r1
|
||||
movs r1, 0x1
|
||||
orrs r0, r1
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_080840C8: .4byte gUnknown_203B458
|
||||
_080840CC: .4byte 0x5d588b65
|
||||
_080840D0: .4byte 0xffff0000
|
||||
_080840D4: .4byte 0x00ffffff
|
||||
thumb_func_end sub_80840A4
|
||||
|
||||
.align 2,0
|
||||
@@ -1,6 +1,9 @@
|
||||
#ifndef GUARD_DUNGEON_RANDOM_H
|
||||
#define GUARD_DUNGEON_RANDOM_H
|
||||
|
||||
void sub_808408C(u32 param_1);
|
||||
u32 sub_80840A4(void);
|
||||
void InitDungeonRNG(u32 value);
|
||||
s32 DungeonRand16Bit(void);
|
||||
s32 DungeonRandInt(s32 cap);
|
||||
s32 DungeonRandRange(s32 low, s32 high);
|
||||
|
||||
@@ -242,7 +242,6 @@ SECTIONS {
|
||||
src/dungeon_leader.o(.text);
|
||||
asm/code_8083654.o(.text);
|
||||
src/dungeon_music.o(.text);
|
||||
asm/dungeon_music.o(.text);
|
||||
src/dungeon_random.o(.text);
|
||||
src/code_808417C.o(.text);
|
||||
asm/code_808417C.o(.text);
|
||||
|
||||
@@ -13,6 +13,34 @@ extern u8 *gUnknown_8108084[];
|
||||
s32 sub_8091E94(s32 a1, s32 a2, s32 a3); // items.c
|
||||
|
||||
|
||||
bool8 sub_8090820(u16 moveID)
|
||||
{
|
||||
struct PokemonStruct *pokeStruct;
|
||||
struct Move *move;
|
||||
s32 moveIndex;
|
||||
s32 index;
|
||||
s32 one;
|
||||
|
||||
for(index = 0; index < 0x19d; index++)
|
||||
{
|
||||
pokeStruct = &gRecruitedPokemonRef->pokemon[index];
|
||||
one = 1;
|
||||
if (pokeStruct->unk0 & 1)
|
||||
{
|
||||
if(pokeStruct->unk0 >> 1 & one){
|
||||
for(moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++)
|
||||
{
|
||||
move = &pokeStruct->moves[moveIndex];
|
||||
if ((move->moveFlags & MOVE_FLAG_EXISTS) && (move->id == moveID)) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_8090888(u8 *param_1, u8 *param_2)
|
||||
{
|
||||
s32 iVar3;
|
||||
|
||||
@@ -17,8 +17,6 @@ struct unkStruct_202EE10
|
||||
|
||||
extern struct unkStruct_202EE10 gUnknown_202EE10;
|
||||
|
||||
EWRAM_DATA_2 u32 gUnknown_203B458 = {0};
|
||||
|
||||
extern u8 *gUnknown_80FE6F4[];
|
||||
extern u8 gUnknown_810AC60; // 0xC
|
||||
extern u8 gUnknown_810AC62; // 0xC
|
||||
@@ -355,9 +353,3 @@ void UpdateDungeonMusic(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void sub_808408C(u32 param_1)
|
||||
{
|
||||
gUnknown_203B458 = (1 | param_1) & 0xffffff;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,30 @@
|
||||
#include "dungeon_random.h"
|
||||
|
||||
EWRAM_DATA_2 u32 gDungeonRngState = {0};
|
||||
EWRAM_DATA_2 u32 gUnknown_203B458 = {0};
|
||||
|
||||
void sub_808408C(u32 param_1)
|
||||
{
|
||||
gUnknown_203B458 = (1 | param_1) & 0xffffff;
|
||||
}
|
||||
|
||||
u32 sub_80840A4(void)
|
||||
{
|
||||
u32 r0;
|
||||
u32 r1;
|
||||
|
||||
r1 = gUnknown_203B458 * 0x5d588b65;
|
||||
r1++;
|
||||
r0 = r1 >> 16;
|
||||
r1 *= 0x5d588b65;
|
||||
r1++;
|
||||
gUnknown_203B458 = r1;
|
||||
r1 &= 0xffff0000;
|
||||
r0 |= r1;
|
||||
r0 &= 0x0ffffff;
|
||||
r0 |= 1;
|
||||
return r0;
|
||||
}
|
||||
|
||||
void InitDungeonRNG(u32 value)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user