diff options
| author | KEKW555 <152369890+KEKW555@users.noreply.github.com> | 2023-12-04 03:32:58 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-03 14:02:58 -0800 |
| commit | d0a8433e2cede945fccace6f169b48865817f808 (patch) | |
| tree | 20cdcc9e8ce2ce499187ae9b95d0b44d868ac984 /src | |
| parent | 4aa26b0ea51534ce65a6725751be8860c26671e7 (diff) | |
Match sub_08088160 (#637)
* Nuke asm/non_matching/figurineDevice/sub_08088160.inc
* Match sub_08088160
* Remove headers
* Update vars
* Add JP & EU ifdefs
* Revert field names
Diffstat (limited to 'src')
| -rw-r--r-- | src/object/figurineDevice.c | 65 |
1 files changed, 35 insertions, 30 deletions
diff --git a/src/object/figurineDevice.c b/src/object/figurineDevice.c index 4e3e10de..f24170ce 100644 --- a/src/object/figurineDevice.c +++ b/src/object/figurineDevice.c @@ -485,14 +485,12 @@ void sub_080880D8(FigurineDeviceEntity* this) { } } -NONMATCH("asm/non_matching/figurineDevice/sub_08088160.inc", - bool32 sub_08088160(FigurineDeviceEntity* this, s32 param_2)) { - u8 bVar1; - bool32 condition; - u32 uVar3; +bool32 sub_08088160(FigurineDeviceEntity* this, s32 param_2) { bool32 result; const struct_080FC3E4* ptr; - u32 tmp; +#if !defined(JP) && !defined(EU) + u8 kinstoneId; +#endif ptr = &gUnk_080FC3E4[param_2]; result = FALSE; @@ -502,64 +500,71 @@ NONMATCH("asm/non_matching/figurineDevice/sub_08088160.inc", switch (ptr->unk_6) { case 0x8: case 0x40: - if (CheckLocalFlagByBank(ptr->bank, ptr->flag)) { + if (CheckLocalFlagByBank(ptr->bank, ptr->flag)) result = TRUE; - } - return result; break; case 0x10: - if (CheckKinstoneFused(gUnk_080FC3E4[param_2].flag)) { + if (CheckKinstoneFused(ptr->flag)) result = TRUE; - } - return result; break; default: - return result; + break; case 0x20: - switch (gUnk_080FC3E4[param_2].flag) { + switch (ptr->flag) { +#if defined(JP) || defined(EU) case 0: if (CheckKinstoneFused(KINSTONE_20) || CheckKinstoneFused(KINSTONE_10) || - CheckKinstoneFused(KINSTONE_19)) { + CheckKinstoneFused(KINSTONE_19)) result = TRUE; - } break; case 1: - if ((u8)this->unk_7c >= 5 && CheckKinstoneFused(KINSTONE_28)) { + if (this->unk_7c >= 5 && CheckKinstoneFused(KINSTONE_28)) result = TRUE; + break; +#else + case 0: + if (CheckKinstoneFused(KINSTONE_20) || CheckKinstoneFused(KINSTONE_10)) { + result = TRUE; + break; } - + kinstoneId = KINSTONE_19; + backward_tail_merge: + if (CheckKinstoneFused(kinstoneId)) + result = TRUE; break; + case 1: + if (this->unk_7c >= 5) { + kinstoneId = KINSTONE_28; + goto backward_tail_merge; + } + break; +#endif case 2: if (CheckKinstoneFused(KINSTONE_54) || CheckKinstoneFused(KINSTONE_56) || - CheckKinstoneFused(KINSTONE_3D)) { + CheckKinstoneFused(KINSTONE_3D)) result = TRUE; - } break; case 3: if (CheckKinstoneFused(KINSTONE_3B) || CheckKinstoneFused(KINSTONE_4A) || - CheckKinstoneFused(KINSTONE_D)) { + CheckKinstoneFused(KINSTONE_D)) result = TRUE; - } break; case 4: if (CheckKinstoneFused(KINSTONE_49) || CheckKinstoneFused(KINSTONE_55) || - CheckKinstoneFused(KINSTONE_3C)) { + CheckKinstoneFused(KINSTONE_3C)) result = TRUE; - } break; +#if !defined(JP) && !defined(EU) case 5: - if (this->unk_7c >= 2 && CheckGlobalFlag(MACHI_MACHIHOKORI)) { + if (this->unk_7c >= 2 && CheckGlobalFlag(MACHI_MACHIHOKORI)) result = TRUE; - } - default: - return result; + break; +#endif } - break; } } return result; } -END_NONMATCH void sub_0808826C(FigurineDeviceEntity* this) { s32 tmp = 100; |
