mirror of
https://github.com/pret/pokestadium.git
synced 2026-09-09 03:45:43 -05:00
rename: 7 type-lookup functions in src/232C0.{c,h}
Phase 3 of rename-plan.md: rename the species type/gender/
growth-rate/egg-group/habitat lookups plus the move-type lookup.
Each function reads from a per-species or per-move table.
func_80022A28 → GetMoveType reads gMoveType[moveId]
func_80022A38 → GetSpeciesType1 reads gSpeciesType1[species]
func_80022A60 → GetSpeciesType2 reads gSpeciesType2[species]
func_80022A88 → GetSpeciesGrowthRate reads gSpeciesGrowthRate[species]
func_80022A98 → GetSpeciesEggGroup reads gSpeciesEggGroup[species]
func_80022AA8 → GetSpeciesGenderRatio reads gSpeciesGenderRatio[species]
func_80022ACC → GetSpeciesHabitat reads gSpeciesHabitat[species]
Touches src/232C0.{c,h} (declarations + definitions), src/22630.c
(stat calc usage), src/fragments/24/* and src/fragments/62/* (callers),
and include/pokemon.h (comment reference to func_80022A60).
Still matching: md5 ed1378bc… (verified by `make`)
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
// The codebase uses 1-indexed species IDs throughout. ID 0 is reserved as
|
||||
// "no species / invalid". The canonical Gen-1 range is 1..NATIONAL_DEX_COUNT.
|
||||
//
|
||||
// Several internal APIs (func_80022A60, the moves/effects tables) accept a
|
||||
// Several internal APIs (GetSpeciesType2, the moves/effects tables) accept a
|
||||
// wider range up to SPECIES_EXTENDED_MAX to accommodate Pokemon Stadium-
|
||||
// specific IDs beyond the national dex (glitch forms, event Pokemon, etc.).
|
||||
// SPECIES_BLANK is the sentinel returned when a lookup fails or the input
|
||||
|
||||
@@ -119,7 +119,7 @@ char* func_80021CE0(s32 arg0, char* arg1) {
|
||||
}
|
||||
|
||||
void func_80021D9C(unk_func_80026268_arg0* arg0, unk_D_800AE4E8_004_1_000_010_000* arg1) {
|
||||
arg0->unk_00.unk_00 = func_80022A60(arg1->unk_00);
|
||||
arg0->unk_00.unk_00 = GetSpeciesType2(arg1->unk_00);
|
||||
arg0->unk_00.unk_01 = arg1->unk_00;
|
||||
arg0->unk_02 = func_80021A30(arg1->unk_01);
|
||||
|
||||
@@ -153,8 +153,8 @@ void func_80021E90(unk_func_80026268_arg0* arg0, unk_D_800AC910_050_9AC_008* arg
|
||||
}
|
||||
|
||||
void func_80021F04(unk_func_80026268_arg0* arg0, unk_D_800AE4E8_004_1_000_010_000* arg1) {
|
||||
if (func_80022A38(arg0->unk_00.unk_00) & 0xFF) {
|
||||
arg1->unk_00 = func_80022A38(arg0->unk_00.unk_00);
|
||||
if (GetSpeciesType1(arg0->unk_00.unk_00) & 0xFF) {
|
||||
arg1->unk_00 = GetSpeciesType1(arg0->unk_00.unk_00);
|
||||
} else {
|
||||
arg1->unk_00 = arg0->unk_00.unk_01;
|
||||
}
|
||||
|
||||
16
src/232C0.c
16
src/232C0.c
@@ -107,13 +107,13 @@ s32 func_80022A04(u16* arg0, unk_D_800AC910_040* arg1) {
|
||||
return !bcmp(arg0, arg1, 0xD);
|
||||
}
|
||||
|
||||
u8 func_80022A28(s32 arg0) {
|
||||
u8 GetMoveType(s32 arg0) {
|
||||
extern u8 gMoveType[];
|
||||
|
||||
return gMoveType[arg0];
|
||||
}
|
||||
|
||||
u8 func_80022A38(s32 arg0) {
|
||||
u8 GetSpeciesType1(s32 arg0) {
|
||||
if ((arg0 <= 0) || (arg0 > NATIONAL_DEX_COUNT)) {
|
||||
return 0;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ u8 func_80022A38(s32 arg0) {
|
||||
return gSpeciesType1[arg0];
|
||||
}
|
||||
|
||||
s32 func_80022A60(s32 arg0) {
|
||||
s32 GetSpeciesType2(s32 arg0) {
|
||||
if ((arg0 <= 0) || (arg0 > SPECIES_EXTENDED_MAX)) {
|
||||
return SPECIES_BLANK;
|
||||
}
|
||||
@@ -129,19 +129,19 @@ s32 func_80022A60(s32 arg0) {
|
||||
return gSpeciesType2[arg0];
|
||||
}
|
||||
|
||||
u8 func_80022A88(s32 arg0) {
|
||||
u8 GetSpeciesGrowthRate(s32 arg0) {
|
||||
extern u8 gSpeciesGrowthRate[];
|
||||
|
||||
return gSpeciesGrowthRate[arg0];
|
||||
}
|
||||
|
||||
u8 func_80022A98(s32 arg0) {
|
||||
u8 GetSpeciesEggGroup(s32 arg0) {
|
||||
extern u8 gSpeciesEggGroup[];
|
||||
|
||||
return gSpeciesEggGroup[arg0];
|
||||
}
|
||||
|
||||
s32 func_80022AA8(s32 arg0) {
|
||||
s32 GetSpeciesGenderRatio(s32 arg0) {
|
||||
extern u8 gSpeciesGenderRatio[];
|
||||
|
||||
if (arg0 == 0) {
|
||||
@@ -150,7 +150,7 @@ s32 func_80022AA8(s32 arg0) {
|
||||
return gSpeciesGenderRatio[arg0] + 1;
|
||||
}
|
||||
|
||||
s32 func_80022ACC(s32 arg0) {
|
||||
s32 GetSpeciesHabitat(s32 arg0) {
|
||||
extern u8 gSpeciesHabitat[];
|
||||
|
||||
if (arg0 == 0) {
|
||||
@@ -1328,7 +1328,7 @@ void func_80025498(char* arg0, s32 arg1, u8* arg2) {
|
||||
s32 h;
|
||||
|
||||
while (arg1-- > 0) {
|
||||
temp_v0 = func_80022A60(*arg2++);
|
||||
temp_v0 = GetSpeciesType2(*arg2++);
|
||||
if (0x98 != temp_v0) {
|
||||
temp_v0++;
|
||||
temp_v0--;
|
||||
|
||||
14
src/232C0.h
14
src/232C0.h
@@ -37,13 +37,13 @@ void func_800228B0(unk_func_80026268_arg0* arg0);
|
||||
s32 func_800228F0(unk_func_800228F0*, u16);
|
||||
void func_80022978(unk_func_80026268_arg0* arg0, s16 arg1, u8 arg2);
|
||||
s32 func_80022A04(u16* arg0, unk_D_800AC910_040* arg1);
|
||||
u8 func_80022A28(s32 arg0);
|
||||
u8 func_80022A38(s32 arg0);
|
||||
s32 func_80022A60(s32 arg0);
|
||||
u8 func_80022A88(s32 arg0);
|
||||
u8 func_80022A98(s32 arg0);
|
||||
s32 func_80022AA8(s32 arg0);
|
||||
s32 func_80022ACC(s32 arg0);
|
||||
u8 GetMoveType(s32 arg0);
|
||||
u8 GetSpeciesType1(s32 arg0);
|
||||
s32 GetSpeciesType2(s32 arg0);
|
||||
u8 GetSpeciesGrowthRate(s32 arg0);
|
||||
u8 GetSpeciesEggGroup(s32 arg0);
|
||||
s32 GetSpeciesGenderRatio(s32 arg0);
|
||||
s32 GetSpeciesHabitat(s32 arg0);
|
||||
void func_80022AF0(unk_func_80022C28_ret* arg0);
|
||||
void func_80022B88(unk_func_80022C28_ret* arg0);
|
||||
unk_func_80022C28_ret* func_80022C28(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
|
||||
|
||||
@@ -1805,7 +1805,7 @@ void func_88305CDC(unk_func_8830867C_02C_0CC_000* arg0, unk_func_8830867C_04C_03
|
||||
var_a0 = arg1->unk_00[0]->unk_00 - 0x92;
|
||||
}
|
||||
|
||||
ptr->unk_09[arg2] = func_80022A28(var_a0);
|
||||
ptr->unk_09[arg2] = GetMoveType(var_a0);
|
||||
ptr->unk_20[arg2] = func_8002ED40(ptr->unk_09[arg2])->pp;
|
||||
|
||||
if (arg1->unk_00[0]->unk_00 >= 0xC9) {
|
||||
|
||||
@@ -3133,7 +3133,7 @@ s32 func_88311D6C(s32 arg0, unk_func_8830867C_02C_0CC_000_008* arg1) {
|
||||
temp_v0 = func_8002ECDC(arg1);
|
||||
var_s4 = 0;
|
||||
for (i = 0; i < temp_v0; i++) {
|
||||
if (func_80022A28(var_s3) == arg1->unk_09[i]) {
|
||||
if (GetMoveType(var_s3) == arg1->unk_09[i]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ void func_843021E8(unk_D_84390010* arg0, u16 arg1, unk_D_84390010_94C* arg2, unk
|
||||
var_a0 = temp_s4->unk_0F[j / 8];
|
||||
}
|
||||
|
||||
if (((var_a0 >> (j % 8)) & 1) && (func_80022A28(j) == temp_s5->unk_1F[i])) {
|
||||
if (((var_a0 >> (j % 8)) & 1) && (GetMoveType(j) == temp_s5->unk_1F[i])) {
|
||||
arg0->unk_654.unk_C1[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user