From 606eff9a41b37e338aac3abf286e3836b87fcdc5 Mon Sep 17 00:00:00 2001 From: csaldiasdev Date: Sun, 5 Jul 2026 20:24:38 -0400 Subject: [PATCH] =?UTF-8?q?rename:=20literal=20151=20=E2=86=92=20NATIONAL?= =?UTF-8?q?=5FDEX=5FCOUNT=20(loop=20bounds=20+=20array=20size)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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`) --- src/20470.c | 3 ++- src/fragments/50/fragment50.c | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/20470.c b/src/20470.c index 98a2e53..72896cf 100644 --- a/src/20470.c +++ b/src/20470.c @@ -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)); } } diff --git a/src/fragments/50/fragment50.c b/src/fragments/50/fragment50.c index 4de1d45..4d20611 100644 --- a/src/fragments/50/fragment50.c +++ b/src/fragments/50/fragment50.c @@ -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); }