diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/battle_dome.c | 124 | ||||
-rw-r--r-- | src/unk_text_util_2.c | 12 |
2 files changed, 72 insertions, 64 deletions
diff --git a/src/battle_dome.c b/src/battle_dome.c index e4947825d..6f3d111ba 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) + u16 vCount = REG_VCOUNT; + + if (vCount < 42) { - 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; - } - } - } - } + 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); } - - 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) diff --git a/src/unk_text_util_2.c b/src/unk_text_util_2.c index b1d2264e4..a0b1281a4 100644 --- a/src/unk_text_util_2.c +++ b/src/unk_text_util_2.c @@ -13,13 +13,13 @@ static void DecompressGlyphFont6(u16); u16 Font6Func(struct TextPrinter *textPrinter) { u16 char_; - struct TextPrinterSubStruct *sub; + struct TextPrinterSubStruct *subStruct; + subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields); - sub = &textPrinter->subUnion.sub; switch (textPrinter->state) { case 0: - if (gMain.heldKeys & (A_BUTTON | B_BUTTON) && sub->hasPrintBeenSpedUp) + if (gMain.heldKeys & (A_BUTTON | B_BUTTON) && subStruct->hasPrintBeenSpedUp) { textPrinter->delayCounter = 0; } @@ -28,7 +28,7 @@ u16 Font6Func(struct TextPrinter *textPrinter) textPrinter->delayCounter --; if (gTextFlags.canABSpeedUpPrint && gMain.newKeys & (A_BUTTON | B_BUTTON)) { - sub->hasPrintBeenSpedUp = TRUE; + subStruct->hasPrintBeenSpedUp = TRUE; textPrinter->delayCounter = 0; } return 3; @@ -81,7 +81,7 @@ u16 Font6Func(struct TextPrinter *textPrinter) textPrinter->printerTemplate.currentChar++; return 2; case 6: - sub->glyphId = *textPrinter->printerTemplate.currentChar; + subStruct->glyphId = *textPrinter->printerTemplate.currentChar; textPrinter->printerTemplate.currentChar++; return 2; case 7: @@ -94,7 +94,7 @@ u16 Font6Func(struct TextPrinter *textPrinter) textPrinter->state = 1; if (gTextFlags.autoScroll) { - sub->autoScrollDelay = 0; + subStruct->autoScrollDelay = 0; } return 3; case 10: |