summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorProjectRevoTPP <projectrevotpp@hotmail.com>2017-05-04 02:26:11 +0000
committerYamaArashi <YamaArashi@users.noreply.github.com>2017-05-03 19:26:11 -0700
commit010bbc4b48464e09bb8b30e38cde628520944452 (patch)
treee0ff2b834ef38bd863059c4de8b3640bf64b1e42 /src
parentb55e13179f3aef2ea5ae6a6821ebb15d4f261952 (diff)
pokedex.s and fldeff_80CC incbins and resolve weird code in player_pc.c (#255)
* dump pokedex incbins * dump fldeff_80C5CD4 incbins * try to make sense of the weird code at the end of sub_813AA30 (thanks padz)
Diffstat (limited to 'src')
-rw-r--r--src/player_pc.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/player_pc.c b/src/player_pc.c
index 96cbb6512..d85f90cc4 100644
--- a/src/player_pc.c
+++ b/src/player_pc.c
@@ -677,7 +677,6 @@ void sub_813A9EC(u8 taskId)
gTasks[taskId].func = sub_813A280;
}
-// seems like it was meant to return data[8] - data[1], but doesn't.
void sub_813AA30(u8 taskId, u8 arg)
{
s16 *data = gTasks[taskId].data;
@@ -702,11 +701,17 @@ void sub_813AA30(u8 taskId, u8 arg)
sub_813AD58(gSaveBlock1.pcItems[var].itemId);
}
- // dead code not getting optimized out what the fuck???
- {
- register int data8 asm("r1") = data[8];
- register int data1 asm("r0") = data[1];
- asm(""::"r"(data8 - data1));
+ /*
+ THEORY: This check produces essentially dead code, but it might have been working in an earlier build
+ in which case it allows a programmer to easily duplicate items without the use of a debug menu.
+ With the removal of a lot of the debug menus close to release, a programmer may have added this to
+ help test things with a low key (such as planting a lot of duplicated berries, which requires this lazy "cheat")
+ without bringing the relevent debug menus back. The commented out line is intentionally left in below to show
+ what it may have looked like.
+ */
+ if(data[8] - data[1] > 0) { // this check is arbitrary and used to generate the correct assembly using the subtraction, which is what matters. the 0 check doesn't.
+ //gSaveBlock1.pcItems[data[8]].quantity += 100;
+ gSaveBlock1.pcItems[data[8]].quantity += 0; // do not enforce item cap.
}
}