diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2017-09-10 09:35:24 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2017-09-10 09:35:24 -0400 |
commit | ab786df511b47bbe4101b3de3fdb3254da249228 (patch) | |
tree | 532f4de6aa07347e2fbcaae18632829d5bed1ee7 | |
parent | ef751c02b70f1f81adc69775ba76efaa2374b92a (diff) |
sub_8127ED0, sub_8127EFC
-rw-r--r-- | asm/field_effect_helpers.s | 50 | ||||
-rw-r--r-- | src/field_effect_helpers.c | 10 |
2 files changed, 10 insertions, 50 deletions
diff --git a/asm/field_effect_helpers.s b/asm/field_effect_helpers.s index b6b033461..3a26f5928 100644 --- a/asm/field_effect_helpers.s +++ b/asm/field_effect_helpers.s @@ -6,56 +6,6 @@ .text - thumb_func_start sub_8127ED0 -sub_8127ED0: @ 8127ED0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r3, _08127EF8 @ =gSprites - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldrh r0, [r2, 0x2E] - movs r3, 0x10 - negs r3, r3 - ands r3, r0 - movs r0, 0xF0 - lsls r0, 20 - ands r0, r1 - lsrs r0, 24 - orrs r0, r3 - strh r0, [r2, 0x2E] - bx lr - .align 2, 0 -_08127EF8: .4byte gSprites - thumb_func_end sub_8127ED0 - - thumb_func_start sub_8127EFC -sub_8127EFC: @ 8127EFC - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r3, _08127F24 @ =gSprites - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldrh r0, [r2, 0x2E] - movs r3, 0xF1 - negs r3, r3 - ands r3, r0 - movs r0, 0xF0 - lsls r0, 20 - ands r0, r1 - lsrs r0, 20 - orrs r3, r0 - strh r3, [r2, 0x2E] - bx lr - .align 2, 0 -_08127F24: .4byte gSprites - thumb_func_end sub_8127EFC - thumb_func_start sub_8127F28 sub_8127F28: @ 8127F28 push {r4,lr} diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 29d474fb5..47676b0aa 100644 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -981,3 +981,13 @@ u8 FldEff_SurfBlob(void) FieldEffectActiveListRemove(FLDEFF_SURF_BLOB); return spriteId; } + +void sub_8127ED0(u8 spriteId, u8 value) +{ + gSprites[spriteId].data0 = (gSprites[spriteId].data0 & ~0x0F) | (value & 0x0F); +} + +void sub_8127EFC(u8 spriteId, u8 value) +{ + gSprites[spriteId].data0 = (gSprites[spriteId].data0 & ~0xF0) | ((value & 0xF) << 4); +} |