rename: literal 151 → NATIONAL_DEX_COUNT (loop bounds + array size)

Four sites in src/20470.c and src/fragments/50/fragment50.c where
151 is used as the Gen-1 species count:

- src/20470.c:514 — for loop over D_8006FF00[] (species metadata)
- src/fragments/50/fragment50.c:69 — D_82608568 array size
- src/fragments/50/fragment50.c:1679 — for loop counting owned species
- src/fragments/50/fragment50.c:2613 — for loop loading portrait textures

Introduces #include "pokemon.h" in both files.

Other 151 occurrences in fragments/50/fragment50.c (lines 2574,
2630, 2632) are explicit Mew species IDs, not species counts —
left untouched (would need a separate MEW = 151 constant if
named, but that's out of scope for the count-sentinels pass).

Still matching: md5 ed1378bc… (verified by `make`)
This commit is contained in:
csaldiasdev
2026-07-05 20:24:38 -04:00
parent cef5b58562
commit 606eff9a41
2 changed files with 6 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
#include "20470.h"
#include "include/pokemon.h"
#include "src/1CF30.h"
#include "src/2E110.h"
#include "src/6A40.h"
@@ -511,7 +512,7 @@ void func_80021920(void) {
char** temp_s2 = func_8002D5AC(0x24);
s32 i;
for (i = 0; i < 151; i++) {
for (i = 0; i < NATIONAL_DEX_COUNT; i++) {
HAL_Strcpy(D_8006FF00[i].name, func_8002D7C0(NULL, 0, temp_s2, i));
}
}

View File

@@ -1,4 +1,5 @@
#include "fragment50.h"
#include "include/pokemon.h"
#include "src/12D80.h"
#include "src/19840.h"
#include "src/1AB70.h"
@@ -66,7 +67,7 @@ static s16 D_82608554;
static s16 D_82608556;
static unk_D_86002F34_00C* D_82608558;
static s32 pad_D_82608560[2];
static u16 D_82608568[151][0x640];
static u16 D_82608568[NATIONAL_DEX_COUNT][0x640];
static s16 D_8267E4E8;
static u16 D_8267E4EA;
static u16 D_8267E4EC;
@@ -1676,7 +1677,7 @@ void func_82600020(void) {
if (func_80028118() != 1) {
var_s1 = 0;
for (i = 0; i < 151; i++) {
for (i = 0; i < NATIONAL_DEX_COUNT; i++) {
if (func_826007C8(i + 1) != 0) {
var_s1++;
}
@@ -2610,7 +2611,7 @@ void func_82603924(void) {
func_8001987C();
func_8001B058();
for (i = 0; i < 151; i++) {
for (i = 0; i < NATIONAL_DEX_COUNT; i++) {
func_8001B0DC(D_82608568[i], i + 1, NULL);
}