From 929e64ad33e29d7951f4836274d0216876bfbc92 Mon Sep 17 00:00:00 2001 From: Sierraffinity Date: Wed, 20 May 2020 20:31:16 -0700 Subject: [PATCH] Fix HblankCb_TourneyTree fakematch --- src/battle_dome.c | 126 ++++++++++++++++++++++++---------------------- 1 file changed, 67 insertions(+), 59 deletions(-) diff --git a/src/battle_dome.c b/src/battle_dome.c index e4947825df..6f3d111ba5 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -5847,66 +5847,74 @@ static void VblankCb_TourneyInfoCard(void) static void HblankCb_TourneyTree(void) { - register u32 vCount asm("r0") = REG_VCOUNT; - register u32 vCount_ asm("r1") = vCount; - if (vCount > 41) - { - if (vCount < 50) - { - REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR - | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR; - SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); - return; - } - else if (vCount > 57) - { - if (vCount < 75) - { - REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR - | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR; - SET_WIN0H_WIN1H(WIN_RANGE(144, 152), WIN_RANGE(88, 96)); - return; - } - else if (vCount < 82) - { - REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR - | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR; - SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); - return; - } - else if (vCount > 94) - { - if (vCount < 103) - { - REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR - | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR; - SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); - return; - } - else if (vCount < 119) - { - REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR - | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR; - SET_WIN0H_WIN1H(WIN_RANGE(144, 152), WIN_RANGE(88, 96)); - return; - } - else if (vCount > 126) - { - if (vCount_ < 135) - { - REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR - | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR; - SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); - return; - } - } - } - } - } + u16 vCount = REG_VCOUNT; - REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ - | WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ; - SET_WIN0H_WIN1H(0, 0); + if (vCount < 42) + { + REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ + | WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ; + SET_WIN0H_WIN1H(0, 0); + } + else if (vCount < 50) + { + REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR + | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR; + SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); + } + else if (vCount < 58) + { + REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ + | WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ; + SET_WIN0H_WIN1H(0, 0); + } + else if (vCount < 75) + { + REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR + | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR; + SET_WIN0H_WIN1H(WIN_RANGE(144, 152), WIN_RANGE(88, 96)); + } + else if (vCount < 82) + { + REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR + | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR; + SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); + } + else if (vCount < 95) + { + REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ + | WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ; + SET_WIN0H_WIN1H(0, 0); + } + else if (vCount < 103) + { + REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR + | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR; + SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); + } + else if (vCount < 119) + { + REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR + | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR; + SET_WIN0H_WIN1H(WIN_RANGE(144, 152), WIN_RANGE(88, 96)); + } + else if (vCount < 127) + { + REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ + | WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ; + SET_WIN0H_WIN1H(0, 0); + } + else if (vCount < 135) + { + REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR + | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR; + SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); + } + else + { + REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ + | WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ; + SET_WIN0H_WIN1H(0, 0); + } } static void VblankCb_TourneyTree(void)