maybe_shadow_1 might be a meme

This commit is contained in:
PikalaxALT 2017-09-17 10:01:27 -04:00
parent 3fdb217ba3
commit 3a7f771eab
2 changed files with 23 additions and 196 deletions

View file

@ -5,202 +5,6 @@
.text
thumb_func_start sub_8094230
sub_8094230: @ 8094230
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0
str r0, [sp]
adds r0, r4, 0
movs r2, 0x1
movs r3, 0x2
bl maybe_shadow_1
adds r0, r4, 0
adds r1, r5, 0
bl sub_809425C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094230
thumb_func_start sub_809425C
sub_809425C: @ 809425C
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
bl sub_80941B0
lsls r0, 24
cmp r0, 0
bne _08094270
movs r0, 0
b _08094280
_08094270:
ldrb r0, [r4, 0x2]
movs r1, 0x41
negs r1, r1
ands r1, r0
strb r1, [r4, 0x2]
movs r0, 0x2
strh r0, [r5, 0x32]
movs r0, 0x1
_08094280:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_809425C
thumb_func_start sub_8094288
sub_8094288: @ 8094288
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0
str r0, [sp]
adds r0, r4, 0
movs r2, 0x2
movs r3, 0x2
bl maybe_shadow_1
adds r0, r4, 0
adds r1, r5, 0
bl sub_80942B4
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094288
thumb_func_start sub_80942B4
sub_80942B4: @ 80942B4
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
bl sub_80941B0
lsls r0, 24
cmp r0, 0
bne _080942C8
movs r0, 0
b _080942D8
_080942C8:
ldrb r0, [r4, 0x2]
movs r1, 0x41
negs r1, r1
ands r1, r0
strb r1, [r4, 0x2]
movs r0, 0x2
strh r0, [r5, 0x32]
movs r0, 0x1
_080942D8:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_80942B4
thumb_func_start sub_80942E0
sub_80942E0: @ 80942E0
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0
str r0, [sp]
adds r0, r4, 0
movs r2, 0x3
movs r3, 0x2
bl maybe_shadow_1
adds r0, r4, 0
adds r1, r5, 0
bl sub_809430C
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_80942E0
thumb_func_start sub_809430C
sub_809430C: @ 809430C
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
bl sub_80941B0
lsls r0, 24
cmp r0, 0
bne _08094320
movs r0, 0
b _08094330
_08094320:
ldrb r0, [r4, 0x2]
movs r1, 0x41
negs r1, r1
ands r1, r0
strb r1, [r4, 0x2]
movs r0, 0x2
strh r0, [r5, 0x32]
movs r0, 0x1
_08094330:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_809430C
thumb_func_start sub_8094338
sub_8094338: @ 8094338
push {r4,r5,lr}
sub sp, 0x4
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0
str r0, [sp]
adds r0, r4, 0
movs r2, 0x4
movs r3, 0x2
bl maybe_shadow_1
adds r0, r4, 0
adds r1, r5, 0
bl sub_8094364
lsls r0, 24
lsrs r0, 24
add sp, 0x4
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094338
thumb_func_start sub_8094364
sub_8094364: @ 8094364
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
bl sub_80941B0
lsls r0, 24
cmp r0, 0
bne _08094378
movs r0, 0
b _08094388
_08094378:
ldrb r0, [r4, 0x2]
movs r1, 0x41
negs r1, r1
ands r1, r0
strb r1, [r4, 0x2]
movs r0, 0x2
strh r0, [r5, 0x32]
movs r0, 0x1
_08094388:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8094364
thumb_func_start sub_8094390
sub_8094390: @ 8094390
movs r2, 0x1

View file

@ -4358,3 +4358,26 @@ bool8 sub_80941E0(struct MapObject *mapObject, struct Sprite *sprite)
return FALSE;
}
}
#define maybe_shadow_1_macro(name, fn1, fn2, ...) \
static bool8 name##_2(struct MapObject *, struct Sprite *);\
bool8 name(struct MapObject *mapObject, struct Sprite *sprite)\
{\
fn1(mapObject, sprite, __VA_ARGS__);\
return name##_2(mapObject, sprite);\
}\
static bool8 name##_2(struct MapObject *mapObject, struct Sprite *sprite)\
{\
if (fn2(mapObject, sprite))\
{\
mapObject->mapobj_bit_22 = FALSE;\
sprite->data2 = 2;\
return TRUE;\
}\
return FALSE;\
}
maybe_shadow_1_macro(sub_8094230, maybe_shadow_1, sub_80941B0, 1, 2, 0)
maybe_shadow_1_macro(sub_8094288, maybe_shadow_1, sub_80941B0, 2, 2, 0)
maybe_shadow_1_macro(sub_80942E0, maybe_shadow_1, sub_80941B0, 3, 2, 0)
maybe_shadow_1_macro(sub_8094338, maybe_shadow_1, sub_80941B0, 4, 2, 0)