summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2022-07-13 22:40:01 +0300
committerTal Hayon <talhayon1@gmail.com>2022-07-13 22:40:01 +0300
commit738fa0023354458caeb61c9a315c2b2fd3f55ad4 (patch)
treedd7f9c4a6e0a1663bffce8bf46d18b0f0c603349 /src
parent85c903036a0ac90826ec0682c8af86f020259b33 (diff)
Add more nonmatch functions
Diffstat (limited to 'src')
-rw-r--r--src/playerUtils.c29
-rw-r--r--src/ui.c22
2 files changed, 49 insertions, 2 deletions
diff --git a/src/playerUtils.c b/src/playerUtils.c
index d9293851..a45a7a6f 100644
--- a/src/playerUtils.c
+++ b/src/playerUtils.c
@@ -1610,7 +1610,34 @@ void sub_08079BD8(Entity* this) {
this->spritePriority.b0 = gPlayerEntity.spritePriority.b0;
}
-ASM_FUNC("asm/non_matching/playerUtils/sub_08079C30.inc", bool32 sub_08079C30(Entity* a))
+NONMATCH("asm/non_matching/playerUtils/sub_08079C30.inc", bool32 sub_08079C30(Entity* this)) {
+ if ((gPlayerState.field_0x14 == 0) && ((gPlayerState.flags & PL_FLAGS2) == 0)) {
+ if ((gPlayerState.flags & PL_MINISH) != 0) {
+ return TRUE;
+ }
+ switch (gPlayerState.floor_type_last) {
+ case 0xd:
+ case 0x0e:
+ case 0x0f:
+ case 0x10:
+ case 0x14:
+ case 0x17:
+ case 0x2a:
+ return TRUE;
+ }
+
+ if (gPlayerState.floor_type == sub_08007DD6(GetRelativeCollisionTile(this, 0, -1), (u16*)gUnk_08007CAC)) {
+ if (gPlayerState.floor_type == sub_08007DD6(GetRelativeCollisionTile(this, 2, 0), (u16*)gUnk_08007CAC)) {
+ if (gPlayerState.floor_type ==
+ sub_08007DD6(GetRelativeCollisionTile(this, -2, 0), (u16*)gUnk_08007CAC)) {
+ return TRUE;
+ }
+ }
+ }
+ }
+ return FALSE;
+}
+END_NONMATCH
bool32 sub_08079D48(void) {
if (!sub_08079C30(&gPlayerEntity)) {
diff --git a/src/ui.c b/src/ui.c
index 5e2fb718..958c81a7 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -442,7 +442,27 @@ void DrawKeys(void) {
}
}
-ASM_FUNC("asm/non_matching/ui/CreateUIElement.inc", void CreateUIElement(u32 type, u32 type2))
+NONMATCH("asm/non_matching/ui/CreateUIElement.inc", void CreateUIElement(u32 type, u32 type2)) {
+ u8 bVar1;
+ u32 index;
+ UIElement* element;
+ UIElementDefinition* definition;
+
+ for (index = 0; index < MAX_UI_ELEMENTS; index++) {
+ element = &gUnk_0200AF00.elements[index];
+ if (element->used == 0) {
+ definition = &gUIElementDefinitions[type];
+ element->type = (u8)type;
+ element->type2 = type2;
+ element->frameIndex = 0xff;
+ element->used = 1;
+ element->unk_1a = definition->unk_4;
+ element->buttonElementId = definition->buttonElementId;
+ return;
+ }
+ }
+}
+END_NONMATCH
void sub_0801CAB8(UIElement* element, Frame* frame) {
element->framePtr = frame;