From 7f7b182ca4430b488e6f6b502a53697154df6b86 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 27 Feb 2018 08:47:47 -0500 Subject: [PATCH] sub_81D1574 --- asm/pokenav.s | 40 ++-------------------------------------- ld_script.txt | 2 ++ src/match_call.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 38 deletions(-) create mode 100644 src/match_call.c diff --git a/asm/pokenav.s b/asm/pokenav.s index 56bf3d41f6..ae792ae761 100644 --- a/asm/pokenav.s +++ b/asm/pokenav.s @@ -20697,44 +20697,8 @@ _081D156A: .pool thumb_func_end sub_81D1538 - thumb_func_start sub_81D1574 -sub_81D1574: @ 81D1574 - push {lr} - ldrb r0, [r0] - cmp r0, 0x5 - bhi _081D15A4 - lsls r0, 2 - ldr r1, =_081D158C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081D158C: - .4byte _081D15A4 - .4byte _081D15A8 - .4byte _081D15AC - .4byte _081D15B4 - .4byte _081D15B0 - .4byte _081D15A8 -_081D15A4: - movs r0, 0 - b _081D15B6 -_081D15A8: - movs r0, 0x1 - b _081D15B6 -_081D15AC: - movs r0, 0x2 - b _081D15B6 -_081D15B0: - movs r0, 0x3 - b _081D15B6 -_081D15B4: - movs r0, 0x4 -_081D15B6: - pop {r1} - bx r1 - thumb_func_end sub_81D1574 +// MATCH CALL + .section .text.after.match.call thumb_func_start sub_81D15BC sub_81D15BC: @ 81D15BC diff --git a/ld_script.txt b/ld_script.txt index 4c7b40dd9b..bcfd6b0791 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -264,6 +264,8 @@ SECTIONS { src/pokemon_summary_screen.o(.text); asm/pokemon_summary_screen.o(.text); asm/pokenav.o(.text); + src/match_call.o(.text); + asm/pokenav.o(.text.after.match.call); src/rayquaza_scene.o(.text); src/walda_phrase.o(.text); asm/contest_link_81D9DE4.o(.text); diff --git a/src/match_call.c b/src/match_call.c new file mode 100644 index 0000000000..d435ea8a64 --- /dev/null +++ b/src/match_call.c @@ -0,0 +1,32 @@ + +// Includes +#include "global.h" + +// Static type declarations + +// Static RAM declarations + +// Static ROM declarations + +// .rodata + +// .text + +u32 sub_81D1574(u8 *a) +{ + switch (*a) + { + case 0: + default: + return 0; + case 1: + case 5: + return 1; + case 2: + return 2; + case 4: + return 3; + case 3: + return 4; + } +}