diff options
author | camthesaxman <cameronghall@cox.net> | 2017-07-13 23:55:40 -0500 |
---|---|---|
committer | camthesaxman <cameronghall@cox.net> | 2017-07-13 23:55:40 -0500 |
commit | 5f5c80818653e135e5cda11ce430bde7cbcd62c1 (patch) | |
tree | 170adf73086cb6a4afec09d8de6cd8941e444c0e /src | |
parent | e7cac5f7b3974d8aa181016fe603fb945fc25405 (diff) |
finish decompiling record_mixing
Diffstat (limited to 'src')
-rw-r--r-- | src/record_mixing.c | 78 | ||||
-rw-r--r-- | src/save.c | 6 |
2 files changed, 80 insertions, 4 deletions
diff --git a/src/record_mixing.c b/src/record_mixing.c index e306669c9..a81b7743a 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -6,12 +6,16 @@ #include "dewford_trend.h" #include "event_data.h" #include "fldeff_80C5CD4.h" +#include "item.h" +#include "items.h" +#include "load_save.h" #include "link.h" #include "mauville_old_man.h" #include "menu.h" #include "mystery_event_script.h" #include "rng.h" #include "rom4.h" +#include "save.h" #include "script.h" #include "secret_base.h" #include "songs.h" @@ -461,7 +465,6 @@ u8 sub_80B9C4C(u8 *a) return r2; } -//extern const u8 gUnknown_083D02B4[]; extern const u8 gUnknown_083D02B4[][2]; #ifdef NONMATCHING @@ -1004,3 +1007,76 @@ _080B9F38: .4byte 0x00003074\n\ .syntax divided\n"); } #endif + +void sub_80B9F3C(u16 *a, u8 b) +{ + if (b != 0 && *a != 0) + { + if (GetPocketByItemId(*a) == 5) + { + if (!CheckBagHasItem(*a, 1) && !CheckPCHasItem(*a, 1) && AddBagItem(*a, 1)) + { + VarSet(VAR_0x4001, *a); + StringCopy(gStringVar1, gLinkPlayers[0].name); + if (*a == ITEM_EON_TICKET) + FlagSet(SYS_HAS_EON_TICKET); + } + else + { + VarSet(VAR_0x4001, ITEM_NONE); + } + } + else + { + if (AddBagItem(*a, 1) == TRUE) + { + VarSet(VAR_0x4001, *a); + StringCopy(gStringVar1, gLinkPlayers[0].name); + } + else + { + VarSet(VAR_0x4001, ITEM_NONE); + } + } + } +} + +void sub_80BA00C(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + task->data[0]++; + break; + case 1: + task->data[0]++; + break; + case 2: + SetSecretBase2Field_9_AndHideBG(); + sub_8125E2C(); + task->data[0]++; + break; + case 3: + if (sub_8125E6C() != 0) + { + ClearSecretBase2Field_9_2(); + task->data[0]++; + task->data[1] = 0; + } + break; + case 4: + task->data[1]++; + if (task->data[1] > 10) + { + sub_800832C(); + task->data[0]++; + } + break; + case 5: + if (!gReceivedRemoteLinkPlayers) + DestroyTask(taskId); + break; + } +} diff --git a/src/save.c b/src/save.c index 570210fb0..46094746a 100644 --- a/src/save.c +++ b/src/save.c @@ -672,9 +672,9 @@ u8 sub_8125E2C(void) return 0; } -u8 sub_8125E6C(void) +bool8 sub_8125E6C(void) { - u8 retVal = 0; + u8 retVal = FALSE; u16 val = ++gUnknown_03005EB4; if (val <= 4) { @@ -684,7 +684,7 @@ u8 sub_8125E6C(void) else { sub_81257F0(val, gSaveSectionLocations); - retVal = 1; + retVal = TRUE; } if (gDamagedSaveSectors) DoSaveFailedScreen(1); |