summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/code_8012A18_1.c18
-rw-r--r--src/code_80521D0_1.c20
-rw-r--r--src/code_8057824_1.c66
-rw-r--r--src/code_80958E8.c16
-rw-r--r--src/debug.c94
-rw-r--r--src/debug_menu.c30
-rw-r--r--src/flash.c4
-rw-r--r--src/main.c20
-rw-r--r--src/personality_test.c6
-rw-r--r--src/pokemon_mid.c36
10 files changed, 153 insertions, 157 deletions
diff --git a/src/code_8012A18_1.c b/src/code_8012A18_1.c
index e91d971..15cac81 100644
--- a/src/code_8012A18_1.c
+++ b/src/code_8012A18_1.c
@@ -31,7 +31,7 @@ extern s32 sub_80144A4(s32 *);
extern void sub_80151C0(u32, u8 *);
extern void CreateConfirmNameMenu(void);
extern void sub_80160F4(u32);
-bool8 sub_80162B8(void);
+bool8 IsNameEmpty(void);
extern u32 sub_80154F0(void);
extern void sub_80155F0(void);
extern void sub_80922B4(u8 *, u8 *, s32);
@@ -171,10 +171,10 @@ void sub_8016110(void)
case 1:
CreateConfirmNameMenu();
if (gUnknown_203B200->unk4 == 1) {
- sub_80922B4(gAvailablePokemonNames,gUnknown_203B200->pokeName,10);
+ sub_80922B4(gAvailablePokemonNames,gUnknown_203B200->pokeName, POKEMON_NAME_LENGTH);
}
else {
- sub_80922B4(gAvailablePokemonNames,gUnknown_203B200->pokeName,10);
+ sub_80922B4(gAvailablePokemonNames,gUnknown_203B200->pokeName, POKEMON_NAME_LENGTH);
}
// Is the name #C5$m0#R OK?
sub_8014248(&gUnknown_80DB688,0,3,gUnknown_203B200->menus,0,4,0,0,0x20);
@@ -210,11 +210,11 @@ void sub_80161F8(void)
if (sub_80154F0() == 3) {
sub_80155F0();
- if (sub_80162B8()) {
+ if (IsNameEmpty()) {
sub_80160F4(3);
}
else{
- iVar2 = sub_8015FEC(gUnknown_203B200->pokeName,10);
+ iVar2 = sub_8015FEC(gUnknown_203B200->pokeName, POKEMON_NAME_LENGTH);
maxLength = sub_8016028(); // returns 60
if (iVar2 > maxLength) {
sub_80160F4(2);
@@ -265,19 +265,19 @@ void sub_801629C(void)
}
}
-bool8 sub_80162B8(void)
+bool8 IsNameEmpty(void)
{
u8 character;
s32 index;
s32 max;
- max = 10; // constant needed at top of loop to match
+ max = POKEMON_NAME_LENGTH; // constant needed at top of loop to match
index = 0;
do {
character = gUnknown_203B200->pokeName[index];
if (character == '\0') break;
- if (character != ' ') return 0;
+ if (character != ' ') return FALSE;
index++;
} while (index < max);
- return 1;
+ return TRUE;
}
diff --git a/src/code_80521D0_1.c b/src/code_80521D0_1.c
index bb0d928..2bfe414 100644
--- a/src/code_80521D0_1.c
+++ b/src/code_80521D0_1.c
@@ -294,7 +294,7 @@ void sub_808BDEC(void)
gUnknown_203B418->unk7 = 1;
sub_8085918(uVar3,0);
}
- sub_8085860(iVar2->unk4,iVar2->unk6 - 3);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_LUGIA);
}
@@ -432,7 +432,7 @@ void sub_808C10C(void)
gUnknown_203B418->unk7 = 1;
sub_8085918(uVar2,0);
}
- sub_8085860(iVar1->unk4,iVar1->unk6);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY);
uVar3 = sub_803F994();
iVar2 = sub_803F9B0();
sub_803F878(uVar3,iVar2 + -0x1000);
@@ -550,7 +550,7 @@ void sub_808C3A0(void)
gUnknown_203B418->unk7 = 1;
sub_808563C(sub_808C5A0);
}
- sub_8085860(iVar2->unk4,iVar2->unk6 - 3);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_DEOXYS_NORMAL);
}
@@ -650,7 +650,7 @@ void sub_808C5C0(void)
sub_80854D4();
sub_8085930(4);
sub_8085918(uVar2,0);
- sub_8085860(iVar1->unk4,iVar1->unk6);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY);
uVar3 = sub_803F994();
iVar2 = sub_803F9B0();
sub_803F878(uVar3,iVar2 + 0xfffff000);
@@ -1076,11 +1076,11 @@ void sub_808C8E0(struct unkDungeon_8041D5C *param_1)
PlaySoundEffect(0x1a5);
sub_806CDD4(param_1, 0, 0);
for(iVar1 = 0; iVar1 < 16; iVar1++){
- param_1->unk70->unk174 = iVar1 << 8;
+ param_1->unk70->unk174 = iVar1 * 256;
sub_803E46C(0x46);
}
for(iVar1 = 16; iVar1 < 200; iVar1 += 4){
- param_1->unk70->unk174 = iVar1 << 8;
+ param_1->unk70->unk174 = iVar1 * 256;
sub_803E46C(0x46);
}
sub_8086A3C(param_1);
@@ -1138,7 +1138,7 @@ void sub_808C9C4(void)
sub_8085930(4);
sub_80855E4(sub_8086A3C);
sub_8085918(temp_2, 0);
- sub_8085860(temp->unk4, temp->unk6 - 3);
+ sub_8085860(temp->posWorldX, temp->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_MEDICHAM);
}
@@ -1206,7 +1206,7 @@ void sub_808CB5C(void)
sub_80854D4();
sub_8085930(4);
sub_8068FE0(temp_2, 0x21C, 0);
- sub_8085860(temp->unk4, temp->unk6);
+ sub_8085860(temp->posWorldX, temp->posWorldY);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_MEDICHAM);
}
@@ -1226,7 +1226,7 @@ void sub_808CBB0(void)
sub_8085930(4);
sub_80855E4(sub_8086A3C);
sub_8085918(temp_2, 0);
- sub_8085860(temp->unk4, temp->unk6 - 3);
+ sub_8085860(temp->posWorldX, temp->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_SMEARGLE);
}
@@ -1298,7 +1298,7 @@ void sub_808CD44(void)
sub_8085930(4);
sub_80855E4(sub_8086A3C);
sub_8068FE0(temp_2, 0x21C, 0);
- sub_8085860(temp->unk4, temp->unk6 - 3);
+ sub_8085860(temp->posWorldX, temp->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_SMEARGLE);
}
diff --git a/src/code_8057824_1.c b/src/code_8057824_1.c
index a6af881..7b98ab4 100644
--- a/src/code_8057824_1.c
+++ b/src/code_8057824_1.c
@@ -484,7 +484,7 @@ void sub_80877E8(void)
sub_80855E4(sub_8086A3C);
sub_8085918(uVar2,0);
sub_8086A3C(uVar2);
- sub_8085860(iVar1->unk4 + -3,iVar1->unk6 + -2);
+ sub_8085860(iVar1->posWorldX + -3,iVar1->posWorldY + -2);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_MOLTRES);
}
@@ -510,7 +510,7 @@ void sub_8087848(void)
sub_8085918(uVar3,0);
sub_8086A3C(uVar3);
}
- sub_8085860(iVar2->unk4 - 5, iVar2->unk6);
+ sub_8085860(iVar2->posWorldX - 5, iVar2->posWorldY);
uVar4 = sub_803F994();
iVar3 = sub_803F9B0();
sub_803F878(uVar4,iVar3 + -0x1000);
@@ -689,7 +689,7 @@ void sub_8087D30(struct unkDungeon_8041D5C * param_1)
iVar1 = 200;
for(iVar1 = 200; iVar1 >= 0; iVar1 -= 5)
{
- param_1->unk70->unk174 = iVar1 << 8;
+ param_1->unk70->unk174 = iVar1 * 256;
sub_803E46C(0x46);
}
}
@@ -896,7 +896,7 @@ void sub_8087F54(void)
sub_80855E4(sub_8086A3C);
sub_8085918(uVar3, 0);
sub_8086A3C(uVar3);
- sub_8085860(iVar2->unk4,iVar2->unk6 + -3);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY + -3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_ARTICUNO);
}
@@ -933,7 +933,7 @@ void sub_8087FF8(void)
sub_8085918(uVar3,0);
sub_8086A3C(uVar3);
}
- sub_8085860(iVar2->unk4,iVar2->unk6 + -3);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY + -3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_ARTICUNO);
}
@@ -1155,7 +1155,7 @@ void sub_80885C4(void)
sub_80854D4();
sub_8085930(4);
sub_80855E4(sub_8086A3C);
- sub_8085860(iVar1->unk4,iVar1->unk6 - 3);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY - 3);
}
void sub_8088608(void)
@@ -1191,7 +1191,7 @@ void sub_808862C(void)
sub_80861D4(uVar2,0xd,4);
sub_8085918(uVar3,0);
sub_8086A3C(uVar3);
- sub_8085860(iVar1->unk4,iVar1->unk6 -3);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY -3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_GROUDON);
CopySpeciesNametoBuffer(gUnknown_202E038 + 0x50, SPECIES_ALAKAZAM);
}
@@ -1216,7 +1216,7 @@ void sub_80886C4(void)
sub_8068FE0(uVar2,0x21c,0);
sub_8085918(uVar3,0);
sub_8086A3C(uVar3);
- sub_8085860(iVar1->unk4,iVar1->unk6);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY);
uVar4 = sub_803F994();
iVar2 = sub_803F9B0();
sub_803F878(uVar4,iVar2 + -0x1000);
@@ -1246,7 +1246,7 @@ void sub_808875C(void)
sub_8085918(uVar4,0);
sub_80861D4(uVar4,0xf,0);
}
- sub_8085860(iVar2->unk4,iVar2->unk6 - 3);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_GROUDON);
CopySpeciesNametoBuffer(gUnknown_202E038 + 0x50, SPECIES_ALAKAZAM);
}
@@ -1425,7 +1425,7 @@ void sub_8088C08(struct unkDungeon_8041D5C * param_1)
}
sub_803E46C(0x46);
}
- sub_80856C8(param_1,param_1->unk4,param_1->unk6 + 1);
+ sub_80856C8(param_1,param_1->posWorldX,param_1->posWorldY + 1);
sub_80861D4(param_1,0xf,0);
sub_803E708(10,0x46);
sub_808682C();
@@ -1507,7 +1507,7 @@ void sub_8088DC0(void)
sub_806CDD4(uVar2,0xe,0);
sub_8086A3C(uVar3);
sub_806CDD4(uVar3,0xe,0);
- sub_8085860(iVar1->unk4,iVar1->unk6 - 3);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_GROUDON);
CopySpeciesNametoBuffer(gUnknown_202E038 + 0x50, SPECIES_ALAKAZAM);
}
@@ -1528,7 +1528,7 @@ void sub_8088E5C(void)
sub_80855E4(sub_8086A3C);
sub_8068FE0(uVar2,0x21c,0);
sub_8068FE0(uVar3,0x21c,0);
- sub_8085860(iVar1->unk4,iVar1->unk6 + -3);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY + -3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_GROUDON);
CopySpeciesNametoBuffer(gUnknown_202E038 + 0x50, SPECIES_ALAKAZAM);
}
@@ -1772,7 +1772,7 @@ void sub_80892C8(void)
sub_80855E4(sub_8086A3C);
sub_8085918(uVar2,0);
sub_8086A3C(uVar2);
- sub_8085860(iVar1->unk4,iVar1->unk6 - 3);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038,SPECIES_RAYQUAZA);
}
@@ -1794,7 +1794,7 @@ void sub_8089328(void)
sub_8072008(uVar3,uVar3,gUnknown_80F57CA,0,0);
sub_8086A3C(uVar3);
}
- sub_8085860(iVar2->unk4,iVar2->unk6 - 3);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038,SPECIES_RAYQUAZA);
}
@@ -1957,7 +1957,7 @@ void sub_808970C(void)
sub_8085930(4);
sub_80855E4(sub_8086A3C);
sub_808563C(sub_8089908);
- sub_8085860(iVar1->unk4,iVar1->unk6 + -3);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY + -3);
}
void sub_808974C(void)
@@ -1969,7 +1969,7 @@ void sub_808974C(void)
sub_8085930(4);
sub_80855E4(sub_8086A3C);
sub_808563C(sub_80898F8);
- sub_8085860(iVar1->unk4,iVar1->unk6 + -3);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY + -3);
}
void sub_8089788(struct unkDungeon_8041D5C *param_1, u8 param_2, s32 param_3)
@@ -2081,7 +2081,7 @@ void sub_8089914(void)
sub_80855E4(sub_8086A3C);
sub_8085918(uVar2,0);
sub_8086A3C(uVar2);
- sub_8085860(iVar1->unk4,iVar1->unk6 - 3);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038,SPECIES_MEWTWO);
}
@@ -2105,7 +2105,7 @@ void sub_8089978(void)
sub_8085918(uVar3,0);
sub_8086A3C(uVar3);
}
- sub_8085860(iVar2->unk4,iVar2->unk6 - 3);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038,SPECIES_MEWTWO);
}
@@ -2230,7 +2230,7 @@ void sub_8089C44(void)
sub_80854D4();
sub_8085930(4);
sub_8085918(uVar3, 0);
- sub_8085860(iVar2->unk4,iVar2->unk6);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_ENTEI);
}
@@ -2251,7 +2251,7 @@ void sub_8089C90(void)
else {
sub_8085918(uVar3,0);
}
- sub_8085860(iVar2->unk4,iVar2->unk6);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_ENTEI);
}
@@ -2361,7 +2361,7 @@ void sub_8089EFC(void)
sub_80854D4();
sub_8085930(4);
sub_8085918(uVar3, 0);
- sub_8085860(iVar2->unk4,iVar2->unk6);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_RAIKOU);
}
@@ -2377,7 +2377,7 @@ void sub_8089F44(void)
sub_80854D4();
sub_8085930(4);
sub_8085918(uVar3, 0);
- sub_8085860(iVar2->unk4,iVar2->unk6);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_RAIKOU);
}
@@ -2398,7 +2398,7 @@ void sub_8089F8C(void)
else {
sub_8085918(uVar3,0);
}
- sub_8085860(iVar2->unk4,iVar2->unk6);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_RAIKOU);
}
@@ -2519,7 +2519,7 @@ void sub_808A264(void)
sub_80855E4(sub_8086A3C);
sub_8085918(uVar2,0);
sub_8086A3C(uVar2);
- sub_8085860(iVar1->unk4,iVar1->unk6 - 3);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_SUICUNE);
}
@@ -2534,7 +2534,7 @@ void sub_808A2C0(void)
sub_80854D4();
sub_8085930(4);
sub_8085918(uVar2,0);
- sub_8085860(iVar1->unk4,iVar1->unk6);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_SUICUNE);
}
@@ -2554,7 +2554,7 @@ void sub_808A308(void)
else {
sub_8085918(uVar3,0);
}
- sub_8085860(iVar2->unk4,iVar2->unk6);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_SUICUNE);
}
@@ -2695,7 +2695,7 @@ void sub_808A608(void)
sub_8085930(4);
sub_8085918(uVar2,0);
sub_8086A3C(uVar2);
- sub_8085860(iVar1->unk4,iVar1->unk6 + -6);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY + -6);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_HO_OH);
}
@@ -2718,7 +2718,7 @@ void sub_808A668(void)
sub_8085918(uVar3,0);
sub_8086A3C(uVar3);
}
- sub_8085860(iVar2->unk4,iVar2->unk6 - 6);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY - 6);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_HO_OH);
}
@@ -2872,7 +2872,7 @@ void sub_808A9E4(void)
sub_8085930(4);
sub_80855E4(sub_8086A3C);
sub_8085918(uVar2,4);
- sub_8085860(iVar1->unk4,iVar1->unk6 - 4);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY - 4);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_LATIOS);
}
@@ -2888,7 +2888,7 @@ void sub_808AA3C(void)
sub_8085930(4);
sub_80855E4(sub_8086A3C);
sub_8085918(uVar2,4);
- sub_8085860(iVar1->unk4,iVar1->unk6 - 3);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_LATIOS);
}
@@ -2904,7 +2904,7 @@ void sub_808AA94(void)
sub_8085930(4);
sub_80855E4(sub_8086A3C);
sub_8068FE0(uVar2,0x21c,0);
- sub_8085860(iVar1->unk4,iVar1->unk6 - 3);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_LATIOS);
}
@@ -3399,7 +3399,7 @@ void sub_808B2F4(void)
sub_80855E4(sub_8086A3C);
sub_8085918(uVar2,0);
sub_8086A3C(uVar2);
- sub_8085860(iVar1->unk4,iVar1->unk6 - 3);
+ sub_8085860(iVar1->posWorldX,iVar1->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_JIRACHI);
}
@@ -3424,7 +3424,7 @@ void sub_808B35C(void)
sub_8049ED4();
}
- sub_8085860(iVar2->unk4,iVar2->unk6 - 3);
+ sub_8085860(iVar2->posWorldX,iVar2->posWorldY - 3);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_JIRACHI);
}
diff --git a/src/code_80958E8.c b/src/code_80958E8.c
index cd9fa20..72cc735 100644
--- a/src/code_80958E8.c
+++ b/src/code_80958E8.c
@@ -123,25 +123,25 @@ bool8 ValidateWonderMail(struct WonderMail *data)
if(sub_809017C(&(data->dungeon)))
return FALSE;
- if(data->clientPoke == SPECIES_NONE)
+ if(data->clientSpecies == SPECIES_NONE)
return FALSE;
- if(data->clientPoke > SPECIES_RAYQUAZA_CUTSCENE)
+ if(data->clientSpecies > SPECIES_RAYQUAZA_CUTSCENE)
return FALSE;
- if(data->clientPoke != GetBaseSpecies(data->clientPoke))
+ if(data->clientSpecies != GetBaseSpecies(data->clientSpecies))
return FALSE;
- if(sub_803C0DC(data->clientPoke) == 0)
+ if(sub_803C0DC(data->clientSpecies) == 0)
return FALSE;
- if(data->targetPoke > SPECIES_RAYQUAZA_CUTSCENE)
+ if(data->targetSpecies > SPECIES_RAYQUAZA_CUTSCENE)
return FALSE;
- if(data->targetPoke != GetBaseSpecies(data->targetPoke))
+ if(data->targetSpecies != GetBaseSpecies(data->targetSpecies))
return FALSE;
- if(sub_803C0DC(data->targetPoke) == 0)
+ if(sub_803C0DC(data->targetSpecies) == 0)
return FALSE;
// Item Delivery/Finding
if((u8)(data->missionType - 1) > FIND_POKE)
- if(data->targetPoke != data->clientPoke)
+ if(data->targetSpecies != data->clientSpecies)
return FALSE;
if(sub_8092040(data->targetItem))
diff --git a/src/debug.c b/src/debug.c
index 6b9e8e8..0716330 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -10,49 +10,47 @@ static void FatalErrorHang(void) __attribute__((noreturn));
extern bool32 gNDS_DebugEnabled;
extern u8 gUnknown_203B150;
-extern const char gFuncFileLineString[];
-
-ALIGNED(4) const char gNotEntryText[] = _("--- not entry ---");
-ALIGNED(4) const char gFuncFileLineStringWPrefix[] = _("%sfunc = '%s'\n"
- "file = '%s' line = %5d\n");
-
-ALIGNED(4) const char gFuncFileLineString2[] = _("func = '%s'\n"
- "file = '%s' line = %5d\n");
-
-ALIGNED(4) const char debug_fill14[] = _("pksdir0");
-ALIGNED(4) const char gUnknown_80D421C[] = _(" Print ");
-ALIGNED(4) const char debug_fill13[] = _("pksdir0");
-
-ALIGNED(4) const char Performance_Text[] = _("Performance");
-ALIGNED(4) const char MemoryCard_Text[] = _("Memory Card");
-ALIGNED(4) const char Memory_Text[] = _("Memory");
-ALIGNED(4) const char Flag_Text[] = _("Flag");
-ALIGNED(4) const char Se_Text[] = _("Se");
-ALIGNED(4) const char Bgm_Text[] = _("Bgm");
-ALIGNED(4) const char Sound_Text[] = _("Sound");
-ALIGNED(4) const char Dungeon_Text[] = _("Dungeon");
-ALIGNED(4) const char GroundScript_Text[] = _("GroundScript");
-ALIGNED(4) const char Ground_Text[] = _("Ground");
-
-
-ALIGNED(4) const char gNotMountText[] = _("not mount log system");
-ALIGNED(4) const char debug_fill9[] = _("pksdir0");
-ALIGNED(4) const char debug_fill10[] = _("pksdir0");
-ALIGNED(4) const char debug_fill11[] = _("pksdir0");
-ALIGNED(4) const char debug_fill12[] = _("pksdir0");
-
-ALIGNED(4) const char gFatalText[] = _("!!!!! Fatal !!!!!\n");
-ALIGNED(4) const char gUnknown_80D42D4[] = _("%s\n");
-
-ALIGNED(4) const char debug_fill0[] = _("pksdir0");
-ALIGNED(4) const char debug_fill1[] = _("pksdir0");
-ALIGNED(4) const char debug_fill2[] = _("pksdir0");
-ALIGNED(4) const char debug_fill3[] = _("pksdir0");
-ALIGNED(4) const char debug_fill4[] = _("pksdir0");
-ALIGNED(4) const char debug_fill5[] = _("pksdir0");
-ALIGNED(4) const char debug_fill6[] = _("pksdir0");
-ALIGNED(4) const char debug_fill7[] = _("pksdir0");
-ALIGNED(4) const char debug_fill8[] = _("pksdir0");
+ALIGNED(4) const char gFuncFileLineString[] = "func = '%s'\nfile = '%s' line = %5d";
+
+ALIGNED(4) const char gNotEntryText[] = "--- not entry ---";
+ALIGNED(4) const char gFuncFileLineStringWPrefix[] = "%sfunc = '%s'\nfile = '%s' line = %5d\n";
+
+ALIGNED(4) const char gFuncFileLineString2[] = "func = '%s'\nfile = '%s' line = %5d\n";
+
+ALIGNED(4) const char debug_fill14[] = "pksdir0";
+ALIGNED(4) const char gDebugPrintPrefix[] = " Print ";
+ALIGNED(4) const char debug_fill13[] = "pksdir0";
+
+ALIGNED(4) const char Performance_Text[] = "Performance";
+ALIGNED(4) const char MemoryCard_Text[] = "Memory Card";
+ALIGNED(4) const char Memory_Text[] = "Memory";
+ALIGNED(4) const char Flag_Text[] = "Flag";
+ALIGNED(4) const char Se_Text[] = "Se";
+ALIGNED(4) const char Bgm_Text[] = "Bgm";
+ALIGNED(4) const char Sound_Text[] = "Sound";
+ALIGNED(4) const char Dungeon_Text[] = "Dungeon";
+ALIGNED(4) const char GroundScript_Text[] = "GroundScript";
+ALIGNED(4) const char Ground_Text[] = "Ground";
+
+
+ALIGNED(4) const char gNotMountText[] = "not mount log system";
+ALIGNED(4) const char debug_fill9[] = "pksdir0";
+ALIGNED(4) const char debug_fill10[] = "pksdir0";
+ALIGNED(4) const char debug_fill11[] = "pksdir0";
+ALIGNED(4) const char debug_fill12[] = "pksdir0";
+
+ALIGNED(4) const char gFatalText[] = "!!!!! Fatal !!!!!\n";
+ALIGNED(4) const char gFatalErrorBufferPlaceholder[] = "%s\n";
+
+ALIGNED(4) const char debug_fill0[] = "pksdir0";
+ALIGNED(4) const char debug_fill1[] = "pksdir0";
+ALIGNED(4) const char debug_fill2[] = "pksdir0";
+ALIGNED(4) const char debug_fill3[] = "pksdir0";
+ALIGNED(4) const char debug_fill4[] = "pksdir0";
+ALIGNED(4) const char debug_fill5[] = "pksdir0";
+ALIGNED(4) const char debug_fill6[] = "pksdir0";
+ALIGNED(4) const char debug_fill7[] = "pksdir0";
+ALIGNED(4) const char debug_fill8[] = "pksdir0";
void NDS_DebugInit(void)
{
@@ -143,15 +141,15 @@ void nullsub_137(void)
}
-static void FatalErrorPrintFuncFileLine(const char *r0, struct DebugLocation *debug)
+static void FatalErrorPrintFuncFileLine(const char *prefix, struct DebugLocation *debug)
{
char buf[0x100];
- if(r0 != NULL){
- PrintFuncFileLine(buf, debug, r0);
+ if(prefix != NULL){
+ PrintFuncFileLine(buf, debug, prefix);
}
else
{
- PrintFuncFileLine(buf, debug, gUnknown_80D421C);
+ PrintFuncFileLine(buf, debug, gDebugPrintPrefix);
}
}
@@ -246,6 +244,6 @@ void FatalError(struct DebugLocation *debug, const char *text, ...)
va_start(vArgv, text);
vsprintf(buf, text, vArgv);
va_end(vArgv);
- FatalErrorFormatMessage(gUnknown_80D42D4, buf);
+ FatalErrorFormatMessage(gFatalErrorBufferPlaceholder, buf);
FatalErrorHang();
}
diff --git a/src/debug_menu.c b/src/debug_menu.c
index c0c8b68..da765a1 100644
--- a/src/debug_menu.c
+++ b/src/debug_menu.c
@@ -47,21 +47,21 @@ const struct MenuItem gDebugMenuItems[8] =
{NULL, 10},
};
-ALIGNED(4) const char h_open_string[] = _("h-open");
-ALIGNED(4) const char storage_string[] = _("Storage");
-ALIGNED(4) const char debug_menu_string[] = _("Debug Menu");
-ALIGNED(4) const char field_script_string[] = _("Field Script");
-ALIGNED(4) const char field_map_string[] = _("Field Map");
-ALIGNED(4) const char field_string[] = _("Field");
-ALIGNED(4) const char dungeons_string[] = _("Dungeons");
-
-ALIGNED(4) const char debug_menu_fill0[] = _("pksdir0");
-ALIGNED(4) const char debug_menu_fill1[] = _("pksdir0");
-ALIGNED(4) const char debug_menu_fill2[] = _("pksdir0");
-ALIGNED(4) const char debug_menu_fill3[] = _("pksdir0");
-ALIGNED(4) const char debug_menu_fill4[] = _("pksdir0");
-ALIGNED(4) const char debug_menu_fill5[] = _("pksdir0");
-ALIGNED(4) const char debug_menu_fill6[] = _("pksdir0");
+ALIGNED(4) const char h_open_string[] = "h-open";
+ALIGNED(4) const char storage_string[] = "Storage";
+ALIGNED(4) const char debug_menu_string[] = "Debug Menu";
+ALIGNED(4) const char field_script_string[] = "Field Script";
+ALIGNED(4) const char field_map_string[] = "Field Map";
+ALIGNED(4) const char field_string[] = "Field";
+ALIGNED(4) const char dungeons_string[] = "Dungeons";
+
+ALIGNED(4) const char debug_menu_fill0[] = "pksdir0";
+ALIGNED(4) const char debug_menu_fill1[] = "pksdir0";
+ALIGNED(4) const char debug_menu_fill2[] = "pksdir0";
+ALIGNED(4) const char debug_menu_fill3[] = "pksdir0";
+ALIGNED(4) const char debug_menu_fill4[] = "pksdir0";
+ALIGNED(4) const char debug_menu_fill5[] = "pksdir0";
+ALIGNED(4) const char debug_menu_fill6[] = "pksdir0";
extern void ResetUnusedInputStruct(void);
diff --git a/src/flash.c b/src/flash.c
index c27a45e..934d071 100644
--- a/src/flash.c
+++ b/src/flash.c
@@ -5,13 +5,13 @@
extern u8 gFlashEnabled;
-extern FlashIntrFunc *GetInterruptCallback(s32);
+extern FlashIntrFunc *GetInterruptHandler(s32);
static u8 TryProgramSector(s32, u8 *);
void InitFlash(void)
{
- if (!IdentifyFlash() && !SetFlashTimerIntr(2, GetInterruptCallback(3)))
+ if (!IdentifyFlash() && !SetFlashTimerIntr(2, GetInterruptHandler(3)))
gFlashEnabled = TRUE;
}
diff --git a/src/main.c b/src/main.c
index 7890a1a..120b08e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -9,7 +9,7 @@ extern char ewram_start[];
typedef void (*IntrCallback)(void);
EWRAM_DATA u8 IntrMain_Buffer[0x120];
-EWRAM_DATA u32 gIntrTable[6];
+EWRAM_DATA IntrCallback gIntrTable[6];
EWRAM_DATA IntrCallback gIntrCallbacks[6];
extern u16 gBldCnt;
extern u8 gUnknown_202D7FE;
@@ -31,7 +31,7 @@ extern char unk_code_ram[];
extern char unk_code_ram_end[];
extern u8 gUnknown_80B9BF1[];
-extern u32 gUnknown_80B9C00;
+extern IntrCallback gInitialIntrTable[6];
extern char gUnknown_8270000[];
@@ -58,8 +58,8 @@ extern void sub_800D6AC(void);
extern void sub_800D7D0(void);
bool8 EnableInterrupts(void);
-void InitIntrTable(const u32 *interrupt_table);
-void *SetInterruptCallback(u32 index, void * new_callback);
+void InitIntrTable(const IntrCallback *interrupt_table);
+IntrCallback SetInterruptCallback(u32 index, IntrCallback new_callback);
void AgbMain(void)
@@ -121,7 +121,7 @@ void AgbMain(void)
LoadCharmaps();
sub_80098A0();
InitGraphics();
- SetInterruptCallback(1, VBlank_CB);
+ SetInterruptCallback(1, (IntrCallback)VBlank_CB);
REG_DISPCNT = DISPCNT_WIN1_ON | DISPCNT_WIN0_ON | DISPCNT_OBJ_ON | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_1D_MAP; // 32576
GameLoop();
Hang();
@@ -143,7 +143,7 @@ void sub_800B540(void)
*(u8*)&REG_DISPCNT |= DISPCNT_FORCED_BLANK;
- InitIntrTable(&gUnknown_80B9C00); // set up intrrupt vector/table
+ InitIntrTable(gInitialIntrTable); // set up intrrupt vector/table
REG_TM3CNT = (TIMER_64CLK | TIMER_INTR_ENABLE | TIMER_ENABLE) << 16;
@@ -225,21 +225,21 @@ void AckInterrupt(u16 flag)
REG_IME = 1;
}
-void InitIntrTable(const u32 *interrupt_table)
+void InitIntrTable(const IntrCallback *interrupt_table)
{
CpuCopy32(interrupt_table, gIntrTable, sizeof(gIntrTable)); // 0x18 = 0x6 * 4 (0x4f00 is 32 bits)
CpuCopy32(IntrMain, IntrMain_Buffer, sizeof(IntrMain_Buffer)); // 0x120 = 0x48 * 4 (0x4f00 is 32 bits)
INTR_VECTOR = IntrMain_Buffer;
}
-u32 *GetInterruptCallback(u32 index)
+IntrCallback *GetInterruptHandler(u32 index)
{
return &gIntrTable[index];
}
-void *SetInterruptCallback(u32 index, void * new_callback)
+IntrCallback SetInterruptCallback(u32 index, IntrCallback new_callback)
{
- void *old_callback;
+ IntrCallback old_callback;
u32 interrupt_var;
interrupt_var = DisableInterrupts();
diff --git a/src/personality_test.c b/src/personality_test.c
index 5272c88..70e76cd 100644
--- a/src/personality_test.c
+++ b/src/personality_test.c
@@ -55,7 +55,7 @@ extern struct UnkSaveStruct1 *gUnknown_203B46C;
extern const char gStarterReveal[];
extern const char gGenderText[];
extern u32 gGenderMenu;
-extern const char gUnknown_80F42C0;
+extern const char gPartnerSelectionHeaderText;
extern u8 gNatureQuestionTable[NUM_QUIZ_QUESTIONS];
extern u8 gAvailablePokemonNames[0x50];
@@ -710,7 +710,7 @@ void RedrawPartnerSelectionMenu(void)
sub_800641C(gUnknown_203B404->unk54,1,1);
sub_8008C54(gUnknown_203B404->unk4C);
sub_80073B8(gUnknown_203B404->unk4C);
- xxx_call_draw_string(0xc, 0, &gUnknown_80F42C0, gUnknown_203B404->unk4C, 0);
+ xxx_call_draw_string(0xc, 0, &gPartnerSelectionHeaderText, gUnknown_203B404->unk4C, 0);
monCounter = 0;
while (monCounter < gUnknown_203B404->unk32) {
@@ -778,7 +778,7 @@ void RedrawPartnerSelectionMenu(void)
"\tb _0803CF98\n"
"\t.align 2, 0\n"
"_0803CF60: .4byte gUnknown_203B404\n"
-"_0803CF64: .4byte gUnknown_80F42C0\n"
+"_0803CF64: .4byte gPartnerSelectionHeaderText\n"
"_0803CF68:\n"
"\tldr r0, [r6]\n"
"\tadds r0, 0x18\n"
diff --git a/src/pokemon_mid.c b/src/pokemon_mid.c
index d4a3bee..e774836 100644
--- a/src/pokemon_mid.c
+++ b/src/pokemon_mid.c
@@ -3,6 +3,7 @@
#include "item.h"
#include "file_system.h"
#include "subStruct_203B240.h"
+#include "constants/colors.h"
extern struct gPokemon *gMonsterParameters;
extern const char gUnknown_8107600[];
@@ -25,7 +26,7 @@ extern struct LevelData gLevelCurrentData[];
extern void ExpandPlaceholdersBuffer(u8 *buffer, const char *r2, ...);
-extern s16 GetBaseSpecies(u32);
+extern s16 GetBaseSpecies(s16);
extern void sub_80922B4(u8 *, u8 *, s32);
extern int sprintf(char *, const char *, ...);
extern u32 ReturnIntFromChar(u8 r0);
@@ -250,19 +251,17 @@ void CopyCyanSpeciesNametoBuffer(u8 *buffer, s16 index)
void sub_808D930(u8 *buffer, s16 index)
{
char *unownString;
- s32 newIndex;
s32 unownIndex;
const char *preload;
- newIndex = index;
- if (GetBaseSpecies(newIndex) == SPECIES_UNOWN) {
+ if (GetBaseSpecies(index) == SPECIES_UNOWN) {
preload = gUnknown_8107630; // %s%c
unownString = GetMonSpecies(SPECIES_UNOWN);
- unownIndex = GetUnownIndex(newIndex);
+ unownIndex = GetUnownIndex(index);
ExpandPlaceholdersBuffer(buffer,preload,unownString,gUnownLetters[unownIndex]); // ABCDEFGHIJKLMNOPQRSTUVWXYZ!?
}
else {
- ExpandPlaceholdersBuffer(buffer,gUnknown_8107638, gMonsterParameters[newIndex].species); // %s
+ ExpandPlaceholdersBuffer(buffer,gUnknown_8107638, gMonsterParameters[index].species); // %s
}
}
@@ -273,37 +272,37 @@ char * GetMonSpecies(s16 index)
void sub_808D9AC(u8 *buffer, struct PokemonStruct *pokemon, s32 colorNum)
{
- u8 auStack32 [20];
+ u8 nameBuffer [20];
- sub_80922B4(auStack32, pokemon->name, 10);
+ sub_80922B4(nameBuffer, pokemon->name, POKEMON_NAME_LENGTH);
if (colorNum == 0) {
- colorNum = 5;
+ colorNum = COLOR_CYAN;
}
- ExpandPlaceholdersBuffer(buffer,gUnknown_810763C,colorNum,auStack32); // #c%c%s#r
+ ExpandPlaceholdersBuffer(buffer,gUnknown_810763C,colorNum,nameBuffer); // #c%c%s#r
}
void sub_808D9DC(u8 *buffer, u8 *param_2, s32 colorNum)
{
- u8 auStack32 [20];
+ u8 nameBuffer [20];
- sub_80922B4(auStack32, param_2 + 0x58, 10);
+ sub_80922B4(nameBuffer, param_2 + 0x58, POKEMON_NAME_LENGTH);
if (colorNum == 0) {
- colorNum = 6;
+ colorNum = COLOR_YELLOW;
}
- ExpandPlaceholdersBuffer(buffer,gUnknown_810763C,colorNum,auStack32); // #c%c%s#r
+ ExpandPlaceholdersBuffer(buffer,gUnknown_810763C,colorNum,nameBuffer); // #c%c%s#r
}
void sub_808DA0C(u8 *buffer, u8 *param_2)
{
- u8 auStack32 [20];
+ u8 nameBuffer [20];
- sub_80922B4(auStack32, param_2 + 0x58, 10);
- ExpandPlaceholdersBuffer(buffer,gUnknown_8107638,auStack32); // %s
+ sub_80922B4(nameBuffer, param_2 + 0x58, POKEMON_NAME_LENGTH);
+ ExpandPlaceholdersBuffer(buffer,gUnknown_8107638,nameBuffer); // %s
}
void sub_808DA34(u8 *buffer, struct PokemonStruct *pokemon)
{
- sub_80922B4(buffer, pokemon->name, 10);
+ sub_80922B4(buffer, pokemon->name, POKEMON_NAME_LENGTH);
}
bool8 sub_808DA44(s32 a1_, u32 a2_)
@@ -873,7 +872,6 @@ s32 GetEvolutionSequence(struct PokemonStruct* pokemon, struct EvolveStage* a2)
#endif
}
-
s32 sub_808E400(s32 _species, s16* _a2, s32 _a3, s32 _a4)
{
// this is horrible