summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2020-12-31 14:33:45 -0500
committerGriffinR <griffin.g.richards@gmail.com>2020-12-31 14:33:45 -0500
commited3bb5b080e0f53461d46e05d0b078a44f8c5578 (patch)
tree479bbcbe93a0e40f2bca404d0f75ff4303a22abb
parent752fdc7c420a0b67ef830df5c92335dfcd610402 (diff)
Remove deadnaming, sync BgEvent and 2 function names
-rw-r--r--include/global.fieldmap.h17
-rw-r--r--src/pokemon_storage_system_4.c36
-rw-r--r--tools/gbafix/gbafix.c8
3 files changed, 27 insertions, 34 deletions
diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h
index 1bba31073..036ccfb14 100644
--- a/include/global.fieldmap.h
+++ b/include/global.fieldmap.h
@@ -94,23 +94,16 @@ struct CoordEvent
struct BgEvent
{
- /*0x00*/u16 x;
- /*0x02*/u16 y;
- /*0x04*/u8 elevation;
- /*0x05*/u8 kind;
- /*0x08*/union { // carried over from diego's FR/LG work, seems to be the same struct
- // in gen 3, "kind" (0x3 in BgEvent struct) determines the method to read the union.
+ u16 x, y;
+ u8 elevation;
+ u8 kind; // The "kind" field determines how to access bgUnion union below.
+ union {
u8 *script;
-
- // hidden item type
struct {
u16 item;
- u16 hiddenItemId; // flag offset to determine flag lookup
+ u16 hiddenItemId;
} hiddenItem;
-
- // secret base type
u32 secretBaseId;
-
} bgUnion;
};
diff --git a/src/pokemon_storage_system_4.c b/src/pokemon_storage_system_4.c
index 40e0e850b..42a1a5000 100644
--- a/src/pokemon_storage_system_4.c
+++ b/src/pokemon_storage_system_4.c
@@ -68,9 +68,9 @@ bool8 sub_809B358(void);
void sub_809B384(void);
void sub_809B3E0(void);
void sub_809B44C(u8 a0, u8 a1);
-void diegohint2(u8 a0, u8 a1);
+void SetPlacedMonData(u8 a0, u8 a1);
void sub_809B548(u8 a0, u8 a1);
-void diegohint1(u8 a0, u8 a1);
+void SetShiftedMonData(u8 a0, u8 a1);
bool8 sub_809BF2C(void);
void sub_809BF74(void);
void sub_809C028(void);
@@ -1225,7 +1225,7 @@ bool8 sub_809B24C(void)
if (!sub_809971C())
{
StartSpriteAnim(gPokemonStorageSystemPtr->unk_11c0, 3);
- diegohint1(gPokemonStorageSystemPtr->unk_12a9, sBoxCursorPosition);
+ SetShiftedMonData(gPokemonStorageSystemPtr->unk_12a9, sBoxCursorPosition);
gPokemonStorageSystemPtr->unk_12a8++;
}
break;
@@ -1288,12 +1288,12 @@ void sub_809B3E0(void)
switch (sBoxCursorArea)
{
case 1:
- diegohint2(14, sBoxCursorPosition);
+ SetPlacedMonData(14, sBoxCursorPosition);
sub_809960C(14, sBoxCursorPosition);
break;
case 0:
boxId = get_preferred_box();
- diegohint2(boxId, sBoxCursorPosition);
+ SetPlacedMonData(boxId, sBoxCursorPosition);
sub_809960C(boxId, sBoxCursorPosition);
break;
default:
@@ -1318,16 +1318,16 @@ void sub_809B44C(u8 a0, u8 a1)
gUnknown_020384E8 = a1;
}
-void diegohint2(u8 a0, u8 a1)
+void SetPlacedMonData(u8 boxId, u8 position)
{
- if (a0 == 14)
+ if (boxId == 14)
{
- gPlayerParty[a1] = gPokemonStorageSystemPtr->unk_25b4;
+ gPlayerParty[position] = gPokemonStorageSystemPtr->unk_25b4;
}
else
{
BoxMonRestorePP(&gPokemonStorageSystemPtr->unk_25b4.box);
- gPokemonStorage.boxes[a0][a1] = gPokemonStorageSystemPtr->unk_25b4.box;
+ gPokemonStorage.boxes[boxId][position] = gPokemonStorageSystemPtr->unk_25b4.box;
}
}
@@ -1339,17 +1339,17 @@ void sub_809B548(u8 a0, u8 a1)
ZeroBoxMonData(gPokemonStorage.boxes[a0] + a1);
}
-void diegohint1(u8 a0, u8 a1)
+void SetShiftedMonData(u8 boxId, u8 position)
{
- if (a0 == 14)
- gPokemonStorageSystemPtr->unk_2618 = gPlayerParty[a1];
+ if (boxId == 14)
+ gPokemonStorageSystemPtr->unk_2618 = gPlayerParty[position];
else
- ExpandBoxMon(gPokemonStorage.boxes[a0] + a1, &gPokemonStorageSystemPtr->unk_2618);
- diegohint2(a0, a1);
+ ExpandBoxMon(gPokemonStorage.boxes[boxId] + position, &gPokemonStorageSystemPtr->unk_2618);
+ SetPlacedMonData(boxId, position);
gPokemonStorageSystemPtr->unk_25b4 = gPokemonStorageSystemPtr->unk_2618;
sub_809C04C(&gPokemonStorageSystemPtr->unk_25b4, 0);
- gUnknown_020384E7 = a0;
- gUnknown_020384E8 = a1;
+ gUnknown_020384E7 = boxId;
+ gUnknown_020384E8 = position;
}
bool8 sub_809B62C(u8 boxId)
@@ -1359,14 +1359,14 @@ bool8 sub_809B62C(u8 boxId)
return FALSE;
if (gUnknown_020384E6)
{
- diegohint2(boxId, monIdx);
+ SetPlacedMonData(boxId, monIdx);
sub_8099480();
gUnknown_020384E6 = FALSE;
}
else
{
sub_809B44C(14, sBoxCursorPosition);
- diegohint2(boxId, monIdx);
+ SetPlacedMonData(boxId, monIdx);
sub_8099520(sBoxCursorPosition);
}
if (boxId == get_preferred_box())
diff --git a/tools/gbafix/gbafix.c b/tools/gbafix/gbafix.c
index b4ad15a88..637023bda 100644
--- a/tools/gbafix/gbafix.c
+++ b/tools/gbafix/gbafix.c
@@ -28,13 +28,13 @@
// gbafix.c
//---------------------------------------------------------------------------------
/*
- Gameboy Advance ROM fixer (by Dark Fader / BlackThunder / WinterMute / Diegoisawesome)
+ Gameboy Advance ROM fixer (by Dark Fader / BlackThunder / WinterMute / Sierraffinity)
Validates header of GBA roms.
History
-------
- v1.06 - added output silencing, (Diegoisawesome)
- v1.05 - added debug offset argument, (Diegoisawesome)
+ v1.06 - added output silencing, (Sierraffinity)
+ v1.05 - added debug offset argument, (Sierraffinity)
v1.04 - converted to plain C, (WinterMute)
v1.03 - header.fixed, header.device_type
v1.02 - redefined the options (rgbfix style), checksum=0
@@ -144,7 +144,7 @@ int main(int argc, char *argv[])
// show syntax
if (argc <= 1)
{
- printf("GBA ROM fixer v"VER" by Dark Fader / BlackThunder / WinterMute / Diegoisawesome \n");
+ printf("GBA ROM fixer v"VER" by Dark Fader / BlackThunder / WinterMute / Sierraffinity \n");
printf("Syntax: gbafix <rom.gba> [-p] [-t[title]] [-c<game_code>] [-m<maker_code>] [-r<version>] [-d<debug>] [--silent]\n");
printf("\n");
printf("parameters:\n");