diff --git a/asm/credits.s b/asm/credits.s deleted file mode 100644 index a8a665b06..000000000 --- a/asm/credits.s +++ /dev/null @@ -1,3903 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_81754C8 -sub_81754C8: @ 81754C8 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_81754C8 - - thumb_func_start sub_81754DC -sub_81754DC: @ 81754DC - push {lr} - bl RunTasks - bl AnimateSprites - ldr r0, =gMain - ldrh r1, [r0, 0x2C] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08175522 - ldr r0, =gHasHallOfFameRecords - ldrb r0, [r0] - cmp r0, 0 - beq _08175522 - ldr r2, =gTasks - ldr r0, =gUnknown_0203BCE2 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, [r0] - ldr r0, =sub_8175774 - cmp r1, r0 - bne _08175522 - bl sub_81754C8 - bl RunTasks - bl AnimateSprites - ldr r1, =gUnknown_0203BCE5 - movs r0, 0x1 - strb r0, [r1] -_08175522: - bl BuildOamBuffer - bl UpdatePaletteFade - pop {r0} - bx r0 - .pool - thumb_func_end sub_81754DC - - thumb_func_start sub_8175548 -sub_8175548: @ 8175548 - push {lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085E6F68 - movs r0, 0 - movs r2, 0x1 - bl InitBgsFromTemplates - movs r0, 0x80 - lsls r0, 4 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r0, =gUnknown_085E56F0 - movs r1, 0x80 - movs r2, 0x40 - bl LoadPalette - ldr r0, =gUnknown_085E6F6C - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - bl ShowBg - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175548 - - thumb_func_start sub_81755A4 -sub_81755A4: @ 81755A4 - push {lr} - bl FreeAllWindowBuffers - movs r0, 0 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _081755B8 - bl Free -_081755B8: - pop {r0} - bx r0 - thumb_func_end sub_81755A4 - - thumb_func_start sub_81755BC -sub_81755BC: @ 81755BC - push {r4,r5,lr} - sub sp, 0x18 - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r2, 24 - add r1, sp, 0x14 - movs r0, 0 - strb r0, [r1] - cmp r2, 0x1 - bne _081755DC - movs r0, 0x3 - strb r0, [r1, 0x1] - movs r0, 0x4 - b _081755E4 -_081755DC: - add r1, sp, 0x14 - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x2 -_081755E4: - strb r0, [r1, 0x2] - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xF0 - movs r3, 0x1 - bl GetStringCenterAlignXOffsetWithLetterSpacing - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - add r0, sp, 0x14 - str r0, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - str r4, [sp, 0x10] - movs r0, 0 - movs r1, 0x1 - adds r3, r5, 0 - bl AddTextPrinterParameterized2 - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81755BC - - thumb_func_start sub_8175620 -sub_8175620: @ 8175620 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - bl sub_8175CE4 - movs r0, 0 - bl SetVBlankCallback - ldr r0, =0x02000000 - movs r1, 0xE0 - lsls r1, 9 - bl InitHeap - bl ResetPaletteFade - bl ResetTasks - bl sub_8175548 - ldr r0, =sub_8175744 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x10] - strh r1, [r0, 0x16] - strh r1, [r0, 0x1E] - movs r1, 0x1 - strh r1, [r0, 0x22] -_0817566A: - movs r0, 0 - adds r1, r7, 0 - bl sub_8176AB0 - lsls r0, 24 - cmp r0, 0 - beq _0817566A - ldr r5, =gTasks - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r5 - movs r0, 0xA - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r1, 0 - mov r8, r1 - movs r6, 0 - movs r1, 0x28 - strh r1, [r0, 0x8] - ldr r1, =0x0000fffc - movs r0, 0x12 - bl SetGpuReg - ldr r0, =sub_8175DA0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - strh r7, [r1, 0xA] - strh r0, [r4, 0x26] - movs r0, 0x1 - negs r0, r0 - str r6, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_81754C8 - bl SetVBlankCallback - ldr r0, =0x000001c7 - bl m4aSongNumStart - ldr r0, =sub_81754DC - bl SetMainCallback2 - ldr r0, =gUnknown_0203BCE5 - mov r1, r8 - strb r1, [r0] - ldr r4, =gUnknown_0203BCE8 - movs r0, 0xEB - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - bl sub_8177388 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x8E - strh r6, [r0] - adds r0, 0x2 - strh r6, [r0] - adds r0, 0x2 - strh r6, [r0] - ldr r0, =gUnknown_0203BCE2 - strh r7, [r0] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175620 - - thumb_func_start sub_8175744 -sub_8175744: @ 8175744 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175764 - ldr r0, =gTasks - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8175774 - str r0, [r1] -_08175764: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175744 - - thumb_func_start sub_8175774 -sub_8175774: @ 8175774 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r0, 0x10 - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _081757B0 - movs r3, 0xA - ldrsh r1, [r4, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x1E - strh r1, [r0, 0x8] - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0x20] - ldr r0, =sub_8175A9C - b _081757FA - .pool -_081757B0: - ldr r0, =gUnknown_0203BCE0 - strh r1, [r0] - ldrh r2, [r4, 0x1E] - movs r3, 0x1E - ldrsh r0, [r4, r3] - cmp r0, 0x1 - bne _081757E0 - strh r2, [r4, 0x22] - strh r1, [r4, 0x1E] - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_8175808 - b _081757FA - .pool -_081757E0: - cmp r0, 0x2 - bne _081757FC - strh r2, [r4, 0x22] - strh r1, [r4, 0x1E] - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_81758A4 -_081757FA: - str r0, [r4] -_081757FC: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175774 - - thumb_func_start sub_8175808 -sub_8175808: @ 8175808 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175836 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl sub_8176CA0 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =c2_080C9BFC - str r0, [r1] -_08175836: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175808 - - thumb_func_start c2_080C9BFC -c2_080C9BFC: @ 8175848 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - bl SetVBlankCallback - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r5, r0, r1 - ldrb r0, [r5, 0x16] - adds r1, r4, 0 - bl sub_8176AB0 - lsls r0, 24 - cmp r0, 0 - beq _08175890 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_81754C8 - bl SetVBlankCallback - ldr r0, =sub_8175744 - str r0, [r5] -_08175890: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c2_080C9BFC - - thumb_func_start sub_81758A4 -sub_81758A4: @ 81758A4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081758D2 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl sub_8176CA0 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81758E4 - str r0, [r1] -_081758D2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81758A4 - - thumb_func_start sub_81758E4 -sub_81758E4: @ 81758E4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r1, r0 - mov r8, r1 - ldrb r7, [r1] - cmp r7, 0 - beq _08175906 - cmp r7, 0x1 - beq _081759F0 -_08175906: - bl ResetSpriteData - bl dp13_810BB8C - bl FreeAllSpritePalettes - ldr r1, =gReservedSpritePaletteCount - movs r0, 0x8 - strb r0, [r1] - ldr r0, =gBirchHelpGfx - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gBirchGrassTilemap - ldr r1, =0x06003800 - bl LZ77UnCompVram - ldr r0, =gBirchBagGrassPal + 0x2 - movs r1, 0x1 - movs r2, 0x3E - bl LoadPalette - movs r1, 0 - ldr r4, =0x0201c000 - movs r3, 0x11 - ldr r2, =0x000007ff -_0817593C: - adds r0, r1, r4 - strb r3, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r2 - bls _0817593C - movs r1, 0 - ldr r2, =0x0201d800 - ldr r6, =gUnknown_085E701C - ldr r0, =0xfffff000 - adds r5, r2, r0 - movs r4, 0x22 - ldr r3, =0x000007ff -_08175958: - adds r0, r1, r5 - strb r4, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r3 - bls _08175958 - movs r1, 0 - ldr r5, =0x0201d000 - movs r4, 0x33 - ldr r3, =0x000007ff -_0817596E: - adds r0, r1, r5 - strb r4, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r3 - bls _0817596E - movs r0, 0 - strh r0, [r2] - ldr r1, =0x000053ff - adds r0, r1, 0 - strh r0, [r2, 0x2] - ldr r1, =0x0000529f - adds r0, r1, 0 - strh r0, [r2, 0x4] - ldr r1, =0x00007e94 - adds r0, r1, 0 - strh r0, [r2, 0x6] - adds r0, r6, 0 - bl LoadSpriteSheet - ldr r0, =gUnknown_085E702C - bl LoadSpritePalette - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08175A7A - .pool -_081759F0: - ldr r0, =sub_81760FC - movs r1, 0 - bl CreateTask - ldr r2, =gTasks - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 3 - adds r4, r2 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - mov r9, r1 - movs r5, 0 - strh r0, [r4, 0xE] - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - strh r7, [r0, 0x8] - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - strh r6, [r0, 0xA] - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r4, 0x16] - strh r1, [r0, 0xC] - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0x20 - bl SetGpuReg - ldr r1, =0x00000703 - movs r0, 0xE - bl SetGpuReg - movs r1, 0xCA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - mov r0, r9 - mov r1, r8 - strb r0, [r1] - ldr r0, =gUnknown_0203BD28 - strh r5, [r0] - ldr r0, =sub_8175744 - str r0, [r4] -_08175A7A: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81758E4 - - thumb_func_start sub_8175A9C -sub_8175A9C: @ 8175A9C - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x20] - movs r2, 0x20 - ldrsh r1, [r4, r2] - cmp r1, 0 - beq _08175AC4 - subs r0, 0x1 - strh r0, [r4, 0x20] - b _08175AD8 - .pool -_08175AC4: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0xC - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_8175AE4 - str r0, [r4] -_08175AD8: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175A9C - - thumb_func_start sub_8175AE4 -sub_8175AE4: @ 8175AE4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175B0A - adds r0, r4, 0 - bl sub_8176CA0 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8175B1C - str r0, [r1] -_08175B0A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175AE4 - - thumb_func_start sub_8175B1C -sub_8175B1C: @ 8175B1C - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8175CE4 - bl ResetPaletteFade - movs r1, 0xE0 - lsls r1, 6 - movs r0, 0 - movs r2, 0 - bl sub_8176D1C - bl ResetSpriteData - bl FreeAllSpritePalettes - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x8 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r1, 0xE0 - lsls r1, 3 - movs r0, 0x8 - bl SetGpuReg - movs r0, 0x1 - bl EnableInterrupts - movs r1, 0xA0 - lsls r1, 1 - movs r0, 0 - bl SetGpuReg - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0xEB - strh r1, [r0, 0x8] - ldr r1, =sub_8175B90 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175B1C - - thumb_func_start sub_8175B90 -sub_8175B90: @ 8175B90 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x8] - movs r2, 0x8 - ldrsh r1, [r4, r2] - cmp r1, 0 - beq _08175BB8 - subs r0, 0x1 - strh r0, [r4, 0x8] - b _08175BCC - .pool -_08175BB8: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0x6 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_8175BD8 - str r0, [r4] -_08175BCC: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175B90 - - thumb_func_start sub_8175BD8 -sub_8175BD8: @ 8175BD8 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08175C1E - movs r0, 0xE0 - lsls r0, 6 - movs r1, 0 - bl sub_8176E40 - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xE1 - lsls r1, 5 - strh r1, [r0, 0x8] - ldr r1, =sub_8175C34 - str r1, [r0] -_08175C1E: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175BD8 - - thumb_func_start sub_8175C34 -sub_8175C34: @ 8175C34 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175CB8 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _08175C62 - ldr r0, =gMain - ldrh r0, [r0, 0x2E] - cmp r0, 0 - beq _08175C94 -_08175C62: - movs r0, 0x4 - bl FadeOutBGM - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x8 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_8175CC8 - str r0, [r4] - b _08175CB8 - .pool -_08175C94: - ldr r0, =0x00001be8 - cmp r1, r0 - bne _08175CA0 - movs r0, 0x8 - bl FadeOutBGM -_08175CA0: - movs r0, 0x8 - ldrsh r1, [r4, r0] - ldr r0, =0x00001ab8 - cmp r1, r0 - bne _08175CB2 - movs r0, 0xE4 - lsls r0, 1 - bl m4aSongNumStart -_08175CB2: - ldrh r0, [r4, 0x8] - subs r0, 0x1 - strh r0, [r4, 0x8] -_08175CB8: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175C34 - - thumb_func_start sub_8175CC8 -sub_8175CC8: @ 8175CC8 - push {lr} - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175CDC - movs r0, 0xFF - bl SoftReset -_08175CDC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175CC8 - - thumb_func_start sub_8175CE4 -sub_8175CE4: @ 8175CE4 - push {lr} - sub sp, 0x8 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x040000d4 - mov r0, sp - str r0, [r1] - movs r0, 0xC0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x8100c000 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r2, 0 - str r2, [sp, 0x4] - add r0, sp, 0x4 - str r0, [r1] - movs r0, 0xE0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x85000100 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - mov r0, sp - strh r2, [r0] - str r0, [r1] - ldr r0, =0x05000002 - str r0, [r1, 0x4] - ldr r0, =0x810001ff - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175CE4 - - thumb_func_start sub_8175DA0 -sub_8175DA0: @ 8175DA0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r5, r1, 0 - cmp r0, 0xA - bhi _08175E00 - lsls r0, 2 - ldr r1, =_08175DD4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08175DD4: - .4byte _08175E00 - .4byte _08175E40 - .4byte _08175E60 - .4byte _08175F38 - .4byte _08175F5C - .4byte _08175FC8 - .4byte _08175E00 - .4byte _08175E00 - .4byte _08175E00 - .4byte _08175E00 - .4byte _08175FFC -_08175E00: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08175E12 - b _0817602A -_08175E12: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r5 - movs r1, 0x1 - strh r1, [r0, 0x8] - movs r1, 0x48 - strh r1, [r0, 0xE] - movs r3, 0xA - ldrsh r1, [r0, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r2, [r0, 0x24] - ldr r0, =gUnknown_0203BCE0 - strh r2, [r0] - b _0817602A - .pool -_08175E40: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r5 - ldrh r2, [r1, 0xE] - movs r3, 0xE - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08175E58 - subs r0, r2, 0x1 - strh r0, [r1, 0xE] - b _0817602A -_08175E58: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0817602A -_08175E60: - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r3, r0, r5 - movs r0, 0xA - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r5, r0, r5 - ldr r1, [r5] - ldr r0, =sub_8175774 - mov r9, r2 - cmp r1, r0 - bne _08175F32 - movs r1, 0xC - ldrsh r0, [r3, r1] - cmp r0, 0x38 - bgt _08175F2C - movs r5, 0 - ldr r2, =gUnknown_085E6AF4 - mov r8, r2 - adds r7, r3, 0 - movs r6, 0xA0 - lsls r6, 19 -_08175E92: - movs r3, 0xC - ldrsh r1, [r7, r3] - lsls r0, r1, 2 - adds r0, r1 - adds r0, r5 - lsls r0, 2 - add r0, r8 - ldr r2, [r0] - ldr r0, [r2, 0x4] - lsrs r1, r6, 24 - ldrb r2, [r2, 0x1] - bl sub_81755BC - movs r0, 0x80 - lsls r0, 21 - adds r6, r0 - adds r5, 0x1 - cmp r5, 0x4 - ble _08175E92 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - ldr r3, =gTasks - mov r2, r9 - adds r1, r2, r4 - lsls r1, 3 - adds r1, r3 - ldrh r0, [r1, 0xC] - adds r0, 0x1 - strh r0, [r1, 0xC] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0xA - ldrsh r2, [r1, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r3 - movs r2, 0x1 - strh r2, [r0, 0x24] - movs r2, 0xA - ldrsh r1, [r1, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r3 - movs r3, 0x22 - ldrsh r0, [r0, r3] - cmp r0, 0x1 - bne _08175F14 - movs r0, 0xC0 - lsls r0, 2 - ldr r1, =0x0000328d - b _08175F1A - .pool -_08175F14: - movs r0, 0xC0 - lsls r0, 2 - ldr r1, =0x00001967 -_08175F1A: - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - b _0817602A - .pool -_08175F2C: - movs r0, 0xA - strh r0, [r3, 0x8] - b _0817602A -_08175F32: - movs r0, 0 - strh r0, [r5, 0x24] - b _0817602A -_08175F38: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817602A - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r5 - movs r1, 0x73 - strh r1, [r0, 0xE] - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _0817602A - .pool -_08175F5C: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r5 - ldrh r1, [r4, 0xE] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08175F74 - subs r0, r1, 0x1 - strh r0, [r4, 0xE] - b _0817602A -_08175F74: - ldrb r0, [r4, 0xC] - ldrb r1, [r4, 0xA] - bl sub_817603C - lsls r0, 24 - cmp r0, 0 - beq _08175F8A - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0817602A -_08175F8A: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r3, 0xA - ldrsh r1, [r4, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r1, 0x22 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - bne _08175FB0 - movs r0, 0xC0 - lsls r0, 2 - ldr r1, =0x0000328d - b _08175FB6 - .pool -_08175FB0: - movs r0, 0xC0 - lsls r0, 2 - ldr r1, =0x00001967 -_08175FB6: - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _0817602A - .pool -_08175FC8: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817602A - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x2 - strh r0, [r1, 0x8] - b _0817602A - .pool -_08175FFC: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r5 - movs r2, 0xA - ldrsh r1, [r0, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r5, 0 - movs r1, 0x1 - strh r1, [r0, 0x10] - adds r0, r4, 0 - bl DestroyTask - bl sub_81755A4 - ldr r4, =gUnknown_0203BCE8 - ldr r0, [r4] - bl Free - str r5, [r4] -_0817602A: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175DA0 - - thumb_func_start sub_817603C -sub_817603C: @ 817603C - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r6, r3, 0 - lsls r1, 24 - lsrs r2, r1, 24 - adds r5, r2, 0 - ldr r4, =gTasks - cmp r3, 0x6 - bne _0817605C - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x1E] -_0817605C: - cmp r3, 0xC - bne _0817606E - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x1 - strh r1, [r0, 0x16] - strh r1, [r0, 0x1E] -_0817606E: - cmp r3, 0x12 - bne _0817607E - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x1E] -_0817607E: - cmp r3, 0x18 - bne _08176092 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x1E] -_08176092: - cmp r3, 0x1E - bne _081760A2 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x1E] -_081760A2: - cmp r3, 0x24 - bne _081760B6 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x3 - strh r1, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x1E] -_081760B6: - cmp r3, 0x2A - bne _081760C6 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x1E] -_081760C6: - cmp r6, 0x30 - bne _081760DA - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x4 - strh r1, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x1E] -_081760DA: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r4 - movs r1, 0x1E - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _081760F4 - movs r0, 0 - b _081760F6 - .pool -_081760F4: - movs r0, 0x1 -_081760F6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_817603C - - thumb_func_start sub_81760FC -sub_81760FC: @ 81760FC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r2, r0, r4 - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0x1 - beq _0817612C - cmp r0, 0x1 - bgt _0817611A - b _08176244 -_0817611A: - cmp r0, 0x2 - beq _08176158 - cmp r0, 0x3 - bne _08176124 - b _08176230 -_08176124: - b _08176244 - .pool -_0817612C: - ldr r0, =gUnknown_0203BCE8 - ldr r0, [r0] - adds r0, 0x90 - ldrh r0, [r0] - cmp r0, 0 - bne _0817614E - movs r3, 0xA - ldrsh r0, [r2, r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - movs r3, 0x24 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _0817614E - b _08176244 -_0817614E: - ldrh r0, [r2, 0x8] - adds r0, 0x1 - b _08176242 - .pool -_08176158: - ldr r6, =gUnknown_0203BCE8 - ldr r3, [r6] - adds r0, r3, 0 - adds r0, 0x8E - ldrh r0, [r0] - cmp r0, 0x47 - beq _08176244 - movs r0, 0xA - ldrsh r1, [r2, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - ldr r1, [r0] - ldr r0, =sub_8175774 - cmp r1, r0 - bne _08176244 - adds r0, r3, 0 - adds r0, 0x92 - ldrh r0, [r0] - lsls r0, 1 - adds r0, r3, r0 - ldrh r0, [r0] - ldr r4, =gUnknown_085E6F7C - adds r1, r3, 0 - adds r1, 0x90 - ldrh r3, [r1] - lsls r2, r3, 1 - adds r1, r2, r4 - ldrb r1, [r1] - adds r4, 0x1 - adds r2, r4 - ldrb r2, [r2] - bl sub_8177224 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x92 - ldrh r3, [r1] - adds r0, 0x94 - ldrh r0, [r0] - subs r0, 0x1 - cmp r3, r0 - bge _081761D8 - adds r0, r3, 0x1 - strh r0, [r1] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x32 - b _081761EA - .pool -_081761D8: - movs r0, 0 - strh r0, [r1] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x80 - lsls r1, 2 -_081761EA: - strh r1, [r0, 0x34] - ldr r0, =gUnknown_0203BCE8 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x8E - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x90 - ldrh r0, [r1] - cmp r0, 0x2 - bne _08176210 - movs r0, 0 - b _08176212 - .pool -_08176210: - adds r0, 0x1 -_08176212: - strh r0, [r1] - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0x32 - strh r0, [r1, 0xE] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _08176244 - .pool -_08176230: - ldrh r1, [r2, 0xE] - movs r3, 0xE - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _08176240 - subs r0, r1, 0x1 - strh r0, [r2, 0xE] - b _08176244 -_08176240: - movs r0, 0x1 -_08176242: - strh r0, [r2, 0x8] -_08176244: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81760FC - - thumb_func_start sub_817624C -sub_817624C: @ 817624C - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r6, r1, 0 - cmp r0, 0x32 - bls _08176268 - b _08176514 -_08176268: - lsls r0, 2 - ldr r1, =_0817627C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0817627C: - .4byte _08176348 - .4byte _0817636C - .4byte _081763C0 - .4byte _081763D8 - .4byte _08176414 - .4byte _08176438 - .4byte _08176484 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176490 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _081764B0 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _081764D4 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176508 -_08176348: - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r6 - ldrh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 17 - movs r1, 0x7F - ands r0, r1 - movs r1, 0xC - bl Sin - ldr r1, =gUnknown_0203BD26 - strh r0, [r1] - b _08176390 - .pool -_0817636C: - ldr r7, =gUnknown_0203BD26 - movs r3, 0 - ldrsh r4, [r7, r3] - cmp r4, 0 - beq _0817639C - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r6 - ldrh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 17 - movs r1, 0x7F - ands r0, r1 - movs r1, 0xC - bl Sin - strh r0, [r7] -_08176390: - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - b _08176514 - .pool -_0817639C: - ldr r3, =gSprites - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r6 - movs r0, 0xC - ldrsh r2, [r1, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - movs r2, 0x2 - strh r2, [r0, 0x2E] - strh r4, [r1, 0x12] - b _08176430 - .pool -_081763C0: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r6 - ldrh r2, [r1, 0x12] - movs r3, 0x12 - ldrsh r0, [r1, r3] - cmp r0, 0x3F - bgt _08176430 - adds r0, r2, 0x1 - strh r0, [r1, 0x12] - b _0817644E -_081763D8: - ldr r3, =gSprites - lsls r2, r5, 2 - adds r2, r5 - lsls r2, 3 - adds r2, r6 - movs r0, 0xC - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x3 - strh r1, [r0, 0x2E] - movs r0, 0xE - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x1 - strh r1, [r0, 0x2E] - movs r0, 0x78 - strh r0, [r2, 0x10] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _08176514 - .pool -_08176414: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r6 - ldrh r2, [r1, 0x10] - movs r3, 0x10 - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0817642C - subs r0, r2, 0x1 - strh r0, [r1, 0x10] - b _08176514 -_0817642C: - movs r0, 0x40 - strh r0, [r1, 0x12] -_08176430: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _08176514 -_08176438: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r6 - ldrh r1, [r4, 0x12] - movs r2, 0x12 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _08176464 - subs r0, r1, 0x1 - strh r0, [r4, 0x12] -_0817644E: - movs r1, 0x7F - ands r0, r1 - movs r1, 0x14 - bl Sin - ldr r1, =gUnknown_0203BD26 - strh r0, [r1] - b _08176514 - .pool -_08176464: - ldr r2, =gSprites - movs r3, 0xC - ldrsh r1, [r4, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x2E] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08176514 - .pool -_08176484: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r6 - movs r1, 0x32 - b _08176512 -_08176490: - ldr r3, =gSprites - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r6 - movs r0, 0xE - ldrsh r2, [r1, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - movs r2, 0x2 - b _081764C8 - .pool -_081764B0: - ldr r3, =gSprites - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r6 - movs r0, 0xC - ldrsh r2, [r1, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - movs r2, 0x4 -_081764C8: - strh r2, [r0, 0x2E] - movs r0, 0x32 - strh r0, [r1, 0x8] - b _08176514 - .pool -_081764D4: - ldr r3, =gSprites - lsls r2, r5, 2 - adds r2, r5 - lsls r2, 3 - adds r2, r6 - movs r0, 0xC - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x5 - strh r1, [r0, 0x2E] - movs r0, 0xE - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x3 - strh r1, [r0, 0x2E] - movs r0, 0x32 - strh r0, [r2, 0x8] - b _08176514 - .pool -_08176508: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r6 - movs r1, 0 -_08176512: - strh r1, [r0, 0x8] -_08176514: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_817624C - - thumb_func_start sub_817651C -sub_817651C: @ 817651C - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r3, 0x8 - ldrsh r0, [r0, r3] - adds r4, r1, 0 - cmp r0, 0x4 - bhi _0817655C - lsls r0, 2 - ldr r1, =_08176548 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08176548: - .4byte _0817655C - .4byte _081765A0 - .4byte _081765AC - .4byte _081765F4 - .4byte _08176640 -_0817655C: - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r2, r0, r4 - movs r1, 0xA - ldrsh r0, [r2, r1] - ldr r5, =0x00007fff - cmp r0, r5 - beq _081765A0 - movs r3, 0xC - ldrsh r1, [r2, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r3, r0, r4 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0xC - ldrsh r0, [r0, r1] - cmp r0, 0x2 - bne _081765A0 - movs r1, 0xA - ldrsh r0, [r3, r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - movs r0, 0x14 - strh r0, [r1, 0x8] - strh r5, [r2, 0xA] -_081765A0: - movs r0, 0 - bl sub_817B540 - b _08176646 - .pool -_081765AC: - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r2, r0, r4 - movs r3, 0xA - ldrsh r0, [r2, r3] - ldr r5, =0x00007fff - cmp r0, r5 - beq _08176638 - movs r0, 0xC - ldrsh r1, [r2, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r3, 0xA - ldrsh r1, [r0, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r3, r0, r4 - ldrh r1, [r3, 0x12] - movs r0, 0x80 - negs r0, r0 - ands r0, r1 - movs r1, 0xA0 - lsls r1, 2 - cmp r0, r1 - bne _08176638 - movs r0, 0x1 - strh r0, [r3, 0x8] - strh r5, [r2, 0xA] - b _08176638 - .pool -_081765F4: - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r2, r0, r4 - ldrh r3, [r2, 0xA] - movs r0, 0xA - ldrsh r1, [r2, r0] - ldr r5, =0x00007fff - cmp r1, r5 - beq _08176638 - movs r0, 0x92 - lsls r0, 2 - cmp r1, r0 - bne _08176634 - movs r3, 0xC - ldrsh r1, [r2, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r3, 0xA - ldrsh r1, [r0, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0xA - strh r1, [r0, 0x8] - strh r5, [r2, 0xA] - b _08176638 - .pool -_08176634: - adds r0, r3, 0x1 - strh r0, [r2, 0xA] -_08176638: - movs r0, 0x1 - bl sub_817B540 - b _08176646 -_08176640: - movs r0, 0x2 - bl sub_817B540 -_08176646: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_817651C - - thumb_func_start sub_817664C -sub_817664C: @ 817664C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - cmp r0, 0x4 - bls _08176662 - b _081769E0 -_08176662: - lsls r0, 2 - ldr r1, =_08176670 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08176670: - .4byte _08176684 - .4byte _0817672C - .4byte _081767D8 - .4byte _08176884 - .4byte _08176934 -_08176684: - ldr r5, =gSprites - ldr r0, =gTasks - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r2, 0x88 - lsls r2, 1 - strh r2, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - movs r2, 0x20 - b _081769D4 - .pool -_0817672C: - ldr r5, =gSprites - ldr r0, =gTasks - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r1, 0x78 - strh r1, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x88 - lsls r1, 1 - strh r1, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - movs r2, 0x20 - b _081769D4 - .pool -_081767D8: - ldr r5, =gSprites - ldr r0, =gTasks - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r1, 0x78 - strh r1, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x88 - lsls r1, 1 - strh r1, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x80 - lsls r2, 2 - movs r0, 0x1 - b _081769D4 - .pool -_08176884: - ldr r5, =gSprites - ldr r0, =gTasks - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r1, 0x78 - strh r1, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x80 - lsls r2, 2 - movs r0, 0x1 - b _081769D4 - .pool -_08176934: - ldr r5, =gSprites - ldr r0, =gTasks - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r1, 0x58 - strh r1, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x98 - strh r1, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x80 - lsls r2, 2 - movs r0, 0x2 -_081769D4: - movs r3, 0x8 - bl sub_817B3DC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x8] -_081769E0: - ldr r0, =sub_817651C - movs r1, 0 - bl CreateTask - ldr r6, =gTasks - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r5, r1, r6 - lsls r0, 24 - lsrs r0, 24 - movs r4, 0 - strh r0, [r5, 0xC] - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - mov r1, r8 - strh r1, [r0, 0x8] - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r4, [r0, 0xA] - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r7, [r0, 0xC] - ldr r0, =sub_817624C - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xA] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r4, [r0, 0x8] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r7, [r0, 0xA] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - ldrh r1, [r5, 0x12] - strh r1, [r0, 0xC] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - ldrh r1, [r5, 0x14] - strh r1, [r0, 0xE] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r4, [r0, 0x10] - mov r1, r8 - cmp r1, 0x2 - bne _08176A94 - movs r1, 0xA - ldrsh r0, [r5, r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r6 - movs r0, 0x45 - strh r0, [r1, 0x12] -_08176A94: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817664C - - thumb_func_start sub_8176AB0 -sub_8176AB0: @ 8176AB0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r6, r0, r1 - ldrb r0, [r6] - cmp r0, 0x1 - beq _08176B30 - cmp r0, 0x1 - ble _08176AD6 - cmp r0, 0x2 - beq _08176B54 - cmp r0, 0x3 - bne _08176AD6 - b _08176C80 -_08176AD6: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0x8 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - bl ResetSpriteData - bl FreeAllSpritePalettes - movs r0, 0x1 - strb r0, [r6] - b _08176C96 - .pool -_08176B30: - ldr r1, =gUnknown_0203BD24 - movs r0, 0x22 - strh r0, [r1] - ldr r1, =gUnknown_0203BD26 - movs r0, 0 - strh r0, [r1] - adds r0, r4, 0 - bl sub_817B1C8 - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - b _08176C96 - .pool -_08176B54: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _08176BD8 - ldr r0, =gUnknown_085F5334 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F53BC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F5354 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F5384 - bl LoadSpritePalettes - movs r0, 0x78 - movs r1, 0x2E - bl sub_817B834 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - strh r2, [r4, 0x12] - ldr r6, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r6, 0 - adds r5, 0x1C - adds r2, r0, r5 - ldr r1, =sub_8176EE8 - str r1, [r2] - adds r6, 0x8 - adds r0, r6 - ldr r1, =gUnknown_085E6FD0 - str r1, [r0] - movs r0, 0x88 - lsls r0, 1 - movs r1, 0x2E - bl sub_817B88C - b _08176C2C - .pool -_08176BD8: - ldr r0, =gUnknown_085F5344 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F53AC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F5354 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F5384 - bl LoadSpritePalettes - movs r0, 0x78 - movs r1, 0x2E - bl sub_817B88C - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - strh r2, [r4, 0x12] - ldr r6, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r6, 0 - adds r5, 0x1C - adds r2, r0, r5 - ldr r1, =sub_8176EE8 - str r1, [r2] - adds r6, 0x8 - adds r0, r6 - ldr r1, =gUnknown_085E6FD0 - str r1, [r0] - movs r0, 0x88 - lsls r0, 1 - movs r1, 0x2E - bl sub_817B834 -_08176C2C: - lsls r0, 24 - lsrs r2, r0, 24 - strh r2, [r4, 0x14] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r0, r5 - ldr r1, =sub_8176F90 - str r1, [r5] - adds r0, r6 - ldr r1, =gUnknown_085E7010 - str r1, [r0] - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08176C96 - .pool -_08176C80: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_817664C - adds r0, r4, 0 - bl sub_817B3A8 - movs r0, 0 - strb r0, [r6] - movs r0, 0x1 - b _08176C98 -_08176C96: - movs r0, 0 -_08176C98: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8176AB0 - - thumb_func_start sub_8176CA0 -sub_8176CA0: @ 8176CA0 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r1, [r4, 0x8] - movs r2, 0x8 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08176CC6 - lsls r0, r1, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - strh r0, [r4, 0x8] -_08176CC6: - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08176CDC - lsls r0, r1, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - strh r0, [r4, 0xA] -_08176CDC: - ldrh r1, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08176CF2 - lsls r0, r1, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - strh r0, [r4, 0xC] -_08176CF2: - ldrh r1, [r4, 0xE] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08176D08 - lsls r0, r1, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - strh r0, [r4, 0xE] -_08176D08: - ldr r1, =gUnknown_0203BD28 - movs r0, 0x1 - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8176CA0 - - thumb_func_start sub_8176D1C -sub_8176D1C: @ 8176D1C - push {r4-r7,lr} - adds r3, r0, 0 - adds r4, r2, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r4, 16 - lsrs r5, r4, 16 - ldr r0, =gUnknown_085E5770 - movs r6, 0xC0 - lsls r6, 19 - adds r3, r6 - adds r1, r3, 0 - bl LZ77UnCompVram - ldr r0, =gIntroCopyright_Pal - adds r1, r5, 0 - movs r2, 0x20 - bl LoadPalette - lsrs r4, 20 - lsls r4, 28 - lsrs r4, 16 - movs r1, 0 - adds r4, 0x1 - ldr r2, =0x000003ff -_08176D52: - lsls r0, r1, 1 - adds r0, r7 - adds r0, r6 - strh r4, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r2 - bls _08176D52 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8176D1C - - thumb_func_start sub_8176D78 -sub_8176D78: @ 8176D78 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, r2, 0 - movs r0, 0x3F - ands r0, r2 - adds r1, r0, 0 - adds r1, 0x50 - cmp r2, 0xFF - bne _08176D90 - movs r0, 0x1 - b _08176DB6 -_08176D90: - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _08176DA0 - movs r2, 0x80 - lsls r2, 4 - adds r0, r2, 0 - orrs r1, r0 -_08176DA0: - movs r0, 0x40 - ands r3, r0 - cmp r3, 0 - beq _08176DB4 - movs r2, 0x80 - lsls r2, 3 - adds r0, r2, 0 - orrs r1, r0 - lsls r0, r1, 16 - lsrs r1, r0, 16 -_08176DB4: - adds r0, r1, 0 -_08176DB6: - pop {r1} - bx r1 - thumb_func_end sub_8176D78 - - thumb_func_start sub_8176DBC -sub_8176DBC: @ 8176DBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - str r0, [sp] - ldr r0, [sp, 0x2C] - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x4] - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0x8] - lsls r0, 16 - lsrs r0, 20 - lsls r0, 28 - lsrs r0, 16 - mov r9, r0 - movs r5, 0 -_08176DEA: - movs r4, 0 - lsls r7, r5, 1 - ldr r1, [sp, 0x4] - adds r0, r1, r5 - adds r2, r5, 0x1 - mov r8, r2 - lsls r0, 6 - ldr r1, [sp, 0x8] - adds r6, r0, r1 -_08176DFC: - adds r0, r7, r5 - adds r0, r4 - ldr r2, [sp] - adds r0, r2, r0 - ldrb r0, [r0] - bl sub_8176D78 - mov r2, r10 - adds r1, r2, r4 - lsls r1, 1 - adds r1, r6 - movs r2, 0xC0 - lsls r2, 19 - adds r1, r2 - add r0, r9 - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _08176DFC - mov r1, r8 - lsls r0, r1, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _08176DEA - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8176DBC - - thumb_func_start sub_8176E40 -sub_8176E40: @ 8176E40 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsrs r1, 20 - lsls r1, 28 - lsrs r1, 16 - movs r2, 0 - ldr r7, =gUnknown_085E5BAC - movs r4, 0xC0 - lsls r4, 19 - adds r1, 0x1 - ldr r3, =0x000003ff -_08176E5E: - lsls r0, r2, 1 - adds r0, r5 - adds r0, r4 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r3 - bls _08176E5E - str r6, [sp] - adds r0, r7, 0 - movs r1, 0x3 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - ldr r0, =gUnknown_085E5BBB - str r6, [sp] - movs r1, 0x7 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - ldr r4, =gUnknown_085E5BCA - str r6, [sp] - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - str r6, [sp] - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - ldr r0, =gUnknown_085E5BD9 - str r6, [sp] - movs r1, 0x14 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - ldr r0, =gUnknown_085E5BE8 - str r6, [sp] - movs r1, 0x18 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8176E40 - - thumb_func_start sub_8176EE8 -sub_8176EE8: @ 8176EE8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_0203BD28 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08176F04 - adds r0, r4, 0 - bl DestroySprite - b _08176F88 - .pool -_08176F04: - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0x5 - bhi _08176F88 - lsls r0, 2 - ldr r1, =_08176F1C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08176F1C: - .4byte _08176F34 - .4byte _08176F3E - .4byte _08176F44 - .4byte _08176F4E - .4byte _08176F58 - .4byte _08176F6E -_08176F34: - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnimIfDifferent - b _08176F88 -_08176F3E: - adds r0, r4, 0 - movs r1, 0x1 - b _08176F72 -_08176F44: - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAnimIfDifferent - b _08176F88 -_08176F4E: - adds r0, r4, 0 - movs r1, 0x3 - bl StartSpriteAnimIfDifferent - b _08176F88 -_08176F58: - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnimIfDifferent - ldrh r1, [r4, 0x20] - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0x78 - ble _08176F88 - subs r0, r1, 0x1 - b _08176F86 -_08176F6E: - adds r0, r4, 0 - movs r1, 0 -_08176F72: - bl StartSpriteAnimIfDifferent - ldrh r2, [r4, 0x20] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - ble _08176F88 - subs r0, r2, 0x1 -_08176F86: - strh r0, [r4, 0x20] -_08176F88: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8176EE8 - - thumb_func_start sub_8176F90 -sub_8176F90: @ 8176F90 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_0203BD28 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08176FAC - adds r0, r4, 0 - bl DestroySprite - b _08177048 - .pool -_08176FAC: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08176FD4 - cmp r0, 0x1 - bgt _08176FBE - cmp r0, 0 - beq _08176FC8 - b _08177048 -_08176FBE: - cmp r0, 0x2 - beq _08177010 - cmp r0, 0x3 - beq _0817702E - b _08177048 -_08176FC8: - strh r0, [r4, 0x26] - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnimIfDifferent - b _08177048 -_08176FD4: - movs r1, 0x20 - ldrsh r0, [r4, r1] - cmp r0, 0xC8 - ble _08176FE6 - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAnimIfDifferent - b _08176FEE -_08176FE6: - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAnimIfDifferent -_08176FEE: - ldrh r2, [r4, 0x20] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - ble _08177000 - subs r0, r2, 0x2 - strh r0, [r4, 0x20] -_08177000: - ldr r0, =gUnknown_0203BD26 - ldrh r0, [r0] - negs r0, r0 - strh r0, [r4, 0x26] - b _08177048 - .pool -_08177010: - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnimIfDifferent - ldrh r1, [r4, 0x3C] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08177048 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - b _08177046 -_0817702E: - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnimIfDifferent - ldrh r2, [r4, 0x20] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - ble _08177048 - subs r0, r2, 0x1 -_08177046: - strh r0, [r4, 0x20] -_08177048: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8176F90 - - thumb_func_start sub_8177050 -sub_8177050: @ 8177050 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, =gUnknown_0203BD28 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0817706C - ldrh r0, [r5, 0x3A] - bl sub_818D820 - b _0817721C - .pool -_0817706C: - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0xA - bhi _081770B4 - lsls r0, 2 - ldr r1, =_08177088 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08177088: - .4byte _081770B4 - .4byte _0817710E - .4byte _08177190 - .4byte _081771C6 - .4byte _081770B4 - .4byte _081770B4 - .4byte _081770B4 - .4byte _081770B4 - .4byte _081770B4 - .4byte _081771FE - .4byte _08177206 -_081770B4: - ldrb r1, [r5, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r5, 0x1] - movs r0, 0x30 - ldrsh r1, [r5, r0] - movs r0, 0x1F - ands r1, r0 - lsls r1, 1 - ldrb r2, [r5, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x3] - movs r0, 0x10 - strh r0, [r5, 0x32] - ldrh r4, [r5, 0x30] - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x80 - lsls r0, 9 - movs r1, 0x10 - bl __divsi3 - adds r1, r0, 0 - str r1, [sp] - adds r0, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetOamMatrix - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - movs r0, 0x1 - strh r0, [r5, 0x2E] - b _0817721C -_0817710E: - ldrh r1, [r5, 0x32] - movs r2, 0x32 - ldrsh r0, [r5, r2] - cmp r0, 0xFF - bgt _08177144 - adds r0, r1, 0 - adds r0, 0x8 - strh r0, [r5, 0x32] - ldrh r4, [r5, 0x30] - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x32 - ldrsh r1, [r5, r0] - movs r0, 0x80 - lsls r0, 9 - bl __divsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - adds r0, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetOamMatrix - b _0817714A -_08177144: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] -_0817714A: - movs r2, 0x30 - ldrsh r1, [r5, r2] - cmp r1, 0x2 - beq _0817721C - cmp r1, 0x2 - bgt _0817715C - cmp r1, 0x1 - beq _08177162 - b _0817721C -_0817715C: - cmp r1, 0x3 - beq _0817717A - b _0817721C -_08177162: - ldrh r1, [r5, 0x3C] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08177172 - ldrh r0, [r5, 0x22] - adds r0, 0x1 - strh r0, [r5, 0x22] -_08177172: - ldrh r0, [r5, 0x20] - subs r0, 0x2 - strh r0, [r5, 0x20] - b _0817721C -_0817717A: - ldrh r0, [r5, 0x3C] - ands r1, r0 - cmp r1, 0 - bne _08177188 - ldrh r0, [r5, 0x22] - adds r0, 0x1 - strh r0, [r5, 0x22] -_08177188: - ldrh r0, [r5, 0x20] - adds r0, 0x2 - strh r0, [r5, 0x20] - b _0817721C -_08177190: - ldrh r1, [r5, 0x34] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _081771A0 - subs r0, r1, 0x1 - strh r0, [r5, 0x34] - b _0817721C -_081771A0: - movs r1, 0xF4 - lsls r1, 4 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - ldrb r1, [r5, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5, 0x1] - movs r0, 0x10 - strh r0, [r5, 0x34] - b _081771FE -_081771C6: - ldrh r1, [r5, 0x34] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _081771EC - subs r1, 0x1 - strh r1, [r5, 0x34] - movs r0, 0x34 - ldrsh r2, [r5, r0] - movs r0, 0x10 - subs r0, r2 - lsls r0, 8 - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - b _0817721C -_081771EC: - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x9 - strh r0, [r5, 0x2E] - b _0817721C -_081771FE: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0817721C -_08177206: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - ldrh r0, [r5, 0x3A] - bl sub_818D820 -_0817721C: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8177050 - - thumb_func_start sub_8177224 -sub_8177224: @ 8177224 - push {r4-r7,lr} - adds r5, r3, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - adds r3, r5, 0 - bl sub_80C0E9C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =gSprites - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r2, r1, r6 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - movs r3, 0x4 - orrs r0, r3 - strb r0, [r2, 0x5] - adds r0, r5, 0x1 - strh r0, [r2, 0x30] - movs r0, 0x3E - adds r0, r2 - mov r12, r0 - ldrb r0, [r0] - orrs r0, r3 - mov r3, r12 - strb r0, [r3] - adds r0, r6, 0 - adds r0, 0x1C - adds r1, r0 - ldr r0, =sub_8177050 - str r0, [r1] - strh r4, [r2, 0x3A] - ldr r0, =gUnknown_085E7068 - movs r7, 0x20 - ldrsh r1, [r2, r7] - movs r3, 0x22 - ldrsh r2, [r2, r3] - movs r3, 0x1 - bl CreateSprite - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r4, [r0, 0x2E] - lsls r5, 24 - lsrs r5, 24 - adds r1, r5, 0 - bl StartSpriteAnimIfDifferent - adds r0, r4, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8177224 - - thumb_func_start sub_81772B8 -sub_81772B8: @ 81772B8 - push {r4,lr} - adds r3, r0, 0 - ldr r4, =gSprites - movs r1, 0x2E - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0xA - beq _081772DC - ldr r0, =gUnknown_0203BD28 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - beq _081772EC -_081772DC: - adds r0, r3, 0 - bl DestroySprite - b _08177380 - .pool -_081772EC: - adds r0, r1, 0 - adds r0, 0x3E - ldrb r0, [r0] - movs r1, 0x3E - adds r1, r3 - mov r12, r1 - movs r1, 0x4 - ands r1, r0 - mov r0, r12 - ldrb r2, [r0] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - movs r2, 0x2E - ldrsh r1, [r3, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - movs r0, 0xC - ands r0, r1 - ldrb r2, [r3, 0x1] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x1] - movs r0, 0x2E - ldrsh r2, [r3, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r2, 0x4 - negs r2, r2 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x1] - movs r2, 0x2E - ldrsh r1, [r3, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x3] - movs r1, 0x3E - ands r1, r0 - ldrb r2, [r3, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x3] - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x20] - strh r0, [r3, 0x20] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x22] - strh r0, [r3, 0x22] -_08177380: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81772B8 - - thumb_func_start sub_8177388 -sub_8177388: @ 8177388 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x00004023 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl GetStarterPokemon - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - movs r4, 0x1 - movs r6, 0 - ldr r5, =0x00000181 -_081773B4: - adds r0, r4, 0 - movs r1, 0x1 - bl GetSetPokedexFlag - lsls r0, 24 - cmp r0, 0 - beq _081773D4 - ldr r0, =gUnknown_0203BCE8 - ldr r0, [r0] - lsls r1, r6, 1 - adds r0, 0x96 - adds r0, r1 - strh r4, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_081773D4: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r5 - bls _081773B4 - adds r4, r6, 0 - ldr r0, =0x00000181 - ldr r1, =gUnknown_0203BCE8 - mov r8, r1 - lsls r7, r4, 16 - cmp r4, r0 - bhi _08177406 - mov r5, r8 - movs r3, 0 - adds r2, r0, 0 -_081773F2: - ldr r0, [r5] - lsls r1, r4, 1 - adds r0, 0x96 - adds r0, r1 - strh r3, [r0] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r2 - bls _081773F2 -_08177406: - mov r2, r8 - ldr r1, [r2] - ldr r2, =0x0000039a - adds r0, r1, r2 - strh r6, [r0] - lsrs r0, r7, 16 - cmp r0, 0x46 - bhi _08177430 - adds r0, r1, 0 - adds r0, 0x94 - strh r6, [r0] - b _08177436 - .pool -_08177430: - adds r1, 0x94 - movs r0, 0x47 - strh r0, [r1] -_08177436: - movs r6, 0 - ldr r0, =gUnknown_0203BCE8 - mov r9, r0 - ldr r1, =0x0000039a - mov r8, r1 - movs r7, 0 - b _08177450 - .pool -_0817744C: - cmp r6, 0x46 - bhi _081774AC -_08177450: - bl Random - mov r2, r9 - ldr r4, [r2] - mov r1, r8 - adds r5, r4, r1 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r5] - bl __umodsi3 - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, r6, 1 - adds r1, r4, r1 - lsls r0, r3, 1 - adds r4, 0x96 - adds r2, r4, r0 - ldrh r0, [r2] - strh r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - strh r7, [r2] - ldrh r0, [r5] - subs r0, 0x1 - strh r0, [r5] - lsls r0, 16 - lsrs r0, 16 - cmp r3, r0 - beq _081774A0 - ldrh r0, [r5] - lsls r0, 1 - adds r0, r4, r0 - ldrh r0, [r0] - strh r0, [r2] - ldrh r0, [r5] - lsls r0, 1 - adds r0, r4, r0 - strh r7, [r0] -_081774A0: - mov r2, r9 - ldr r0, [r2] - add r0, r8 - ldrh r0, [r0] - cmp r0, 0 - bne _0817744C -_081774AC: - ldr r1, =gUnknown_0203BCE8 - ldr r2, [r1] - adds r3, r2, 0 - adds r3, 0x94 - ldrh r0, [r3] - mov r8, r1 - cmp r0, 0x46 - bhi _081774F8 - adds r6, r0, 0 - movs r3, 0 - cmp r6, 0x46 - bhi _081774EE - mov r4, r8 -_081774C6: - ldr r2, [r4] - lsls r1, r6, 1 - adds r1, r2, r1 - lsls r0, r3, 1 - adds r0, r2, r0 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r2, 0x94 - ldrh r2, [r2] - cmp r3, r2 - bne _081774E4 - movs r3, 0 -_081774E4: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x46 - bls _081774C6 -_081774EE: - mov r1, r8 - ldr r0, [r1] - b _08177538 - .pool -_081774F8: - movs r4, 0 - ldrh r0, [r2] - cmp r0, r10 - beq _08177516 - adds r1, r2, 0 -_08177502: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - lsls r0, r4, 1 - adds r0, r1, r0 - ldrh r0, [r0] - cmp r0, r10 - beq _08177516 - cmp r4, 0x46 - bls _08177502 -_08177516: - mov r0, r8 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0x94 - ldrh r0, [r0] - subs r0, 0x1 - cmp r4, r0 - bge _08177536 - lsls r0, r4, 1 - adds r0, r2, r0 - adds r2, 0x8C - ldrh r1, [r2] - strh r1, [r0] - mov r1, r10 - strh r1, [r2] - b _0817753E -_08177536: - adds r0, r2, 0 -_08177538: - adds r0, 0x8C - mov r2, r10 - strh r2, [r0] -_0817753E: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x94 - movs r1, 0x47 - strh r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8177388 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/intro.s b/asm/intro.s deleted file mode 100644 index c1754873c..000000000 --- a/asm/intro.s +++ /dev/null @@ -1,6270 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_816CBE8 -sub_816CBE8: @ 816CBE8 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - bl ScanlineEffect_InitHBlankDmaTransfer - pop {r0} - bx r0 - thumb_func_end sub_816CBE8 - - thumb_func_start sub_816CC00 -sub_816CC00: @ 816CC00 - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl UpdatePaletteFade - ldr r0, =gMain - ldrh r0, [r0, 0x2E] - cmp r0, 0 - beq _0816CC3C - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816CC3C - ldr r0, =sub_816CC54 - bl SetMainCallback2 - b _0816CC4C - .pool -_0816CC3C: - ldr r2, =gUnknown_030062A0 - ldr r1, [r2] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0816CC4C - adds r0, r1, 0x1 - str r0, [r2] -_0816CC4C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_816CC00 - - thumb_func_start sub_816CC54 -sub_816CC54: @ 816CC54 - push {lr} - bl UpdatePaletteFade - lsls r0, 24 - cmp r0, 0 - bne _0816CC66 - ldr r0, =CB2_InitTitleScreen - bl SetMainCallback2 -_0816CC66: - pop {r0} - bx r0 - .pool - thumb_func_end sub_816CC54 - - thumb_func_start load_copyright_graphics -@ void load_copyright_graphics(u16 tile_patterns_dest, u16 tilemap_dest, u16 unknown_dest) -load_copyright_graphics: @ 816CC70 - push {r4-r6,lr} - adds r3, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =gIntroCopyright_Gfx - movs r6, 0xC0 - lsls r6, 19 - adds r3, r6 - adds r1, r3, 0 - bl LZ77UnCompVram - ldr r0, =gIntroCopyright_Tilemap - adds r4, r6 - adds r1, r4, 0 - bl LZ77UnCompVram - ldr r0, =gIntroCopyright_Pal - adds r1, r5, 0 - movs r2, 0x20 - bl LoadPalette - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end load_copyright_graphics - - thumb_func_start SerialCb_CopyrightScreen -SerialCb_CopyrightScreen: @ 816CCB8 - push {lr} - ldr r0, =gUnknown_030062B0 - bl GameCubeMultiBoot_HandleSerialInterrupt - pop {r0} - bx r0 - .pool - thumb_func_end SerialCb_CopyrightScreen - - thumb_func_start do_copyright_screen -do_copyright_screen: @ 816CCC8 - push {r4-r6,lr} - sub sp, 0x10 - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r5, r0, r1 - ldrb r4, [r5] - cmp r4, 0x8C - bne _0816CCDC - b _0816CE00 -_0816CCDC: - cmp r4, 0x8C - bgt _0816CCEC - cmp r4, 0 - beq _0816CCF4 - b _0816CDBC - .pool -_0816CCEC: - cmp r4, 0x8D - bne _0816CCF2 - b _0816CE2C -_0816CCF2: - b _0816CDBC -_0816CCF4: - movs r0, 0 - bl SetVBlankCallback - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r1, 0xA0 - lsls r1, 19 - ldr r2, =0x00007fff - adds r0, r2, 0 - strh r0, [r1] - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - str r4, [sp, 0x4] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x4 - bl CpuSet - str r4, [sp, 0x8] - add r0, sp, 0x8 - movs r1, 0xE0 - lsls r1, 19 - ldr r2, =0x05000100 - bl CpuSet - add r0, sp, 0xC - strh r4, [r0] - ldr r1, =0x05000002 - ldr r2, =0x010001ff - bl CpuSet - bl ResetPaletteFade - movs r1, 0xE0 - lsls r1, 6 - movs r0, 0 - movs r2, 0 - bl load_copyright_graphics - bl ScanlineEffect_Stop - bl ResetTasks - bl ResetSpriteData - bl FreeAllSpritePalettes - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r1, 0xE0 - lsls r1, 3 - movs r0, 0x8 - bl SetGpuReg - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_816CBE8 - bl SetVBlankCallback - movs r1, 0x80 - lsls r1, 19 - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =SerialCb_CopyrightScreen - bl SetSerialCallback - ldr r0, =gUnknown_030062B0 - bl GameCubeMultiBoot_Init -_0816CDBC: - bl UpdatePaletteFade - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, =gUnknown_030062B0 - bl GameCubeMultiBoot_Main - b _0816CEA0 - .pool -_0816CE00: - ldr r4, =gUnknown_030062B0 - adds r0, r4, 0 - bl GameCubeMultiBoot_Main - ldrb r0, [r4, 0x2] - cmp r0, 0x1 - beq _0816CEA0 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _0816CEA0 - .pool -_0816CE2C: - bl UpdatePaletteFade - lsls r0, 24 - cmp r0, 0 - bne _0816CEA0 - ldr r0, =task_intro_1 - movs r1, 0 - bl CreateTask - ldr r0, =sub_816CC00 - bl SetMainCallback2 - ldr r5, =gUnknown_030062B0 - ldrb r0, [r5, 0x2] - cmp r0, 0 - beq _0816CE8C - ldrb r0, [r5, 0x2] - cmp r0, 0x2 - bne _0816CE96 - ldr r6, =0x020000ac - ldr r4, [r6] - ldr r0, =0x65366347 - cmp r4, r0 - bne _0816CE6C - ldr r0, =gMultiBootProgram_PokemonColosseum_Start - movs r1, 0x80 - lsls r1, 18 - movs r2, 0xA0 - lsls r2, 9 - bl CpuSet - str r4, [r6] -_0816CE6C: - adds r0, r5, 0 - bl GameCubeMultiBoot_ExecuteProgram - b _0816CE96 - .pool -_0816CE8C: - bl GameCubeMultiBoot_Quit - ldr r0, =SerialCB - bl SetSerialCallback -_0816CE96: - movs r0, 0 - b _0816CEA2 - .pool -_0816CEA0: - movs r0, 0x1 -_0816CEA2: - add sp, 0x10 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end do_copyright_screen - - thumb_func_start c2_copyright_1 -c2_copyright_1: @ 816CEAC - push {lr} - bl do_copyright_screen - lsls r0, 24 - cmp r0, 0 - bne _0816CEFA - bl sub_815355C - lsls r0, 16 - lsrs r0, 16 - bl SetSaveBlocksPointers - bl sub_808447C - bl ResetSaveCounters - movs r0, 0 - bl sub_81534D0 - ldr r0, =gSaveFileStatus - ldrh r0, [r0] - cmp r0, 0 - beq _0816CEDE - cmp r0, 0x2 - bne _0816CEE2 -_0816CEDE: - bl Sav2_ClearSetDefault -_0816CEE2: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x15] - lsls r0, 31 - lsrs r0, 31 - bl SetPokemonCryStereo - ldr r0, =0x02000000 - movs r1, 0xE0 - lsls r1, 9 - bl InitHeap -_0816CEFA: - pop {r0} - bx r0 - .pool - thumb_func_end c2_copyright_1 - - thumb_func_start CB2_InitCopyrightScreenAfterTitleScreen -CB2_InitCopyrightScreenAfterTitleScreen: @ 816CF0C - push {lr} - bl do_copyright_screen - pop {r0} - bx r0 - thumb_func_end CB2_InitCopyrightScreenAfterTitleScreen - - thumb_func_start task_intro_1 -@ void task_intro_1(int task_id) -task_intro_1: @ 816CF18 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - mov r8, r0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0 - bl SetVBlankCallback - ldr r4, =gUnknown_0203BCC8 - bl Random - movs r1, 0x1 - ands r1, r0 - strh r1, [r4] - bl intro_reset_and_hide_bgs - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0x50 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0x18 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0x28 - bl SetGpuReg - ldr r0, =gIntro1BGLeavesGfx - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gIntro1BG0_Tilemap - ldr r1, =0x06008000 - bl LZ77UnCompVram - ldr r1, =0x06008800 - add r0, sp, 0x8 - movs r6, 0 - strh r6, [r0] - ldr r4, =0x040000d4 - str r0, [r4] - str r1, [r4, 0x4] - ldr r5, =0x81000400 - str r5, [r4, 0x8] - ldr r0, [r4, 0x8] - ldr r0, =gIntro1BG1_Tilemap - ldr r1, =0x06009000 - bl LZ77UnCompVram - ldr r1, =0x06009800 - add r0, sp, 0x8 - strh r6, [r0] - str r0, [r4] - str r1, [r4, 0x4] - str r5, [r4, 0x8] - ldr r0, [r4, 0x8] - ldr r0, =gIntro1BG2_Tilemap - ldr r1, =0x0600a000 - bl LZ77UnCompVram - ldr r1, =0x0600a800 - add r0, sp, 0x8 - strh r6, [r0] - str r0, [r4] - str r1, [r4, 0x4] - str r5, [r4, 0x8] - ldr r0, [r4, 0x8] - ldr r0, =gIntro1BG3_Tilemap - ldr r1, =0x0600b000 - bl LZ77UnCompVram - ldr r1, =0x0600b800 - add r0, sp, 0x8 - strh r6, [r0] - str r0, [r4] - str r1, [r4, 0x4] - str r5, [r4, 0x8] - ldr r0, [r4, 0x8] - ldr r0, =gIntro1BGPals - movs r5, 0x80 - lsls r5, 2 - movs r1, 0 - adds r2, r5, 0 - bl LoadPalette - ldr r1, =0x00009603 - movs r0, 0xE - bl SetGpuReg - ldr r1, =0x00009402 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00009201 - movs r0, 0xA - bl SetGpuReg - movs r1, 0x90 - lsls r1, 8 - movs r0, 0x8 - bl SetGpuReg - ldr r0, =gUnknown_085E4FDC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E4FEC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E4FFC - bl LoadSpritePalettes - ldr r0, =gUnknown_085E4A74 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E4A84 - bl LoadSpritePalettes - ldr r4, =gPlttBufferUnfaded + 0x200 - movs r3, 0xF0 - lsls r3, 1 - adds r1, r4, r3 - adds r0, r4, 0 - movs r2, 0x10 - bl CpuSet - movs r0, 0xE1 - lsls r0, 1 - adds r1, r4, r0 - adds r0, r4, 0 - movs r2, 0xF - bl CpuSet - movs r3, 0xD2 - lsls r3, 1 - adds r1, r4, r3 - adds r0, r4, 0 - movs r2, 0xE - bl CpuSet - movs r0, 0xC3 - lsls r0, 1 - adds r1, r4, r0 - adds r0, r4, 0 - movs r2, 0xD - bl CpuSet - movs r3, 0xB4 - lsls r3, 1 - adds r1, r4, r3 - adds r0, r4, 0 - movs r2, 0xC - bl CpuSet - movs r0, 0xA5 - lsls r0, 1 - adds r1, r4, r0 - adds r0, r4, 0 - movs r2, 0xB - bl CpuSet - movs r3, 0x96 - lsls r3, 1 - adds r1, r4, r3 - adds r0, r4, 0 - movs r2, 0xA - bl CpuSet - movs r0, 0x78 - movs r1, 0x50 - movs r2, 0 - bl sub_816FDB8 - movs r1, 0xE - negs r1, r1 - movs r0, 0x78 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - movs r0, 0xEC - adds r2, r5, 0 - movs r3, 0x1 - bl sub_816F7D0 - ldr r2, =gTasks - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x8] - ldr r0, =task_intro_2 - str r0, [r1] - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_1 - - thumb_func_start task_intro_2 -task_intro_2: @ 816D12C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - negs r0, r0 - movs r5, 0 - str r5, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r0, =sub_816CBE8 - bl SetVBlankCallback - movs r1, 0xFA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_3 - str r1, [r0] - ldr r0, =gUnknown_030062A0 - str r5, [r0] - movs r0, 0xCF - lsls r0, 1 - bl m4aSongNumStart - bl ResetSerial - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_2 - - thumb_func_start task_intro_3 -task_intro_3: @ 816D190 - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - ldr r5, =gUnknown_030062A0 - ldr r0, [r5] - cmp r0, 0x4C - bne _0816D1BE - ldr r2, =gSprites - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r3, 0x8 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x2E] -_0816D1BE: - ldr r0, [r5] - cmp r0, 0x80 - bne _0816D1CC - ldr r0, =task_intro_3_1 - movs r1, 0 - bl CreateTask -_0816D1CC: - ldr r0, [r5] - cmp r0, 0xFB - bne _0816D1EE - ldr r2, =gSprites - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r3, 0x8 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x2E] -_0816D1EE: - ldr r1, [r5] - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bne _0816D200 - ldr r0, =task_intro_3_2 - movs r1, 0 - bl CreateTask -_0816D200: - ldr r1, [r5] - movs r0, 0xB8 - lsls r0, 1 - cmp r1, r0 - bne _0816D220 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x70 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x30 - movs r1, 0 - movs r3, 0x5 - bl sub_816F7D0 -_0816D220: - ldr r1, [r5] - movs r0, 0xC0 - lsls r0, 1 - cmp r1, r0 - bne _0816D240 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x80 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0xC8 - movs r1, 0x3C - movs r3, 0x9 - bl sub_816F7D0 -_0816D240: - ldr r0, [r5] - movs r4, 0x8C - lsls r4, 2 - cmp r0, r4 - bne _0816D252 - ldr r0, =task_intro_3_3 - movs r1, 0 - bl CreateTask -_0816D252: - ldr r0, [r5] - cmp r0, r4 - bls _0816D27A - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x50 - strh r1, [r0, 0xA] - strh r2, [r0, 0xC] - movs r1, 0x18 - strh r1, [r0, 0xE] - strh r2, [r0, 0x10] - movs r1, 0x28 - strh r1, [r0, 0x12] - strh r2, [r0, 0x14] - ldr r1, =task_intro_4 - str r1, [r0] -_0816D27A: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_3 - - thumb_func_start task_intro_3_3 -task_intro_3_3: @ 816D2A0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4, 0x4] - adds r0, 0x1 - strh r0, [r4, 0x4] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816D2C4 - ldrh r0, [r4, 0x6] - adds r0, 0x1 - strh r0, [r4, 0x6] -_0816D2C4: - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0816D2D8 - cmp r0, 0x1 - beq _0816D314 - b _0816D324 - .pool -_0816D2D8: - ldr r0, =gUnknown_085E4AB8 - ldr r2, =gUnknown_085E4AD0 - movs r1, 0x8 - ldrsh r3, [r4, r1] - lsls r3, 1 - adds r1, r3, r2 - ldrb r1, [r1] - adds r2, 0x1 - adds r3, r2 - ldrh r2, [r4, 0x6] - ldrb r3, [r3] - adds r2, r3 - lsls r2, 16 - asrs r2, 16 - movs r3, 0 - bl CreateSprite - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r0, 0xC - strh r0, [r4, 0x2] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0816D324 - .pool -_0816D314: - ldrh r0, [r4, 0x2] - subs r0, 0x1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bne _0816D324 - strh r0, [r4] -_0816D324: - movs r1, 0x6 - ldrsh r0, [r4, r1] - cmp r0, 0x3C - ble _0816D332 - adds r0, r5, 0 - bl DestroyTask -_0816D332: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_intro_3_3 - - thumb_func_start sub_816D338 -sub_816D338: @ 816D338 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - bne _0816D350 - adds r0, r1, 0 - bl DestroySprite -_0816D350: - pop {r0} - bx r0 - thumb_func_end sub_816D338 - - thumb_func_start task_intro_4 -task_intro_4: @ 816D354 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r1, r0, 24 - adds r4, r1, 0 - ldr r5, =gUnknown_030062A0 - ldr r2, [r5] - ldr r0, =0x00000387 - cmp r2, r0 - bhi _0816D418 - ldr r0, =gTasks - lsls r4, r1, 2 - adds r4, r1 - lsls r4, 3 - adds r4, r0 - movs r1, 0xA - ldrsh r0, [r4, r1] - lsls r0, 16 - ldrh r1, [r4, 0xC] - adds r1, r0, r1 - ldr r0, =0xffffa000 - adds r1, r0 - asrs r0, r1, 16 - strh r0, [r4, 0xA] - strh r1, [r4, 0xC] - ldrh r1, [r4, 0xA] - movs r0, 0x1A - bl SetGpuReg - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r0, 16 - ldrh r1, [r4, 0x10] - adds r1, r0, r1 - ldr r0, =0xffff8000 - adds r1, r0 - asrs r0, r1, 16 - strh r0, [r4, 0xE] - strh r1, [r4, 0x10] - ldrh r1, [r4, 0xE] - movs r0, 0x16 - bl SetGpuReg - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r0, 16 - ldrh r1, [r4, 0x14] - adds r1, r0, r1 - ldr r0, =0xffff4000 - adds r1, r0 - asrs r0, r1, 16 - strh r0, [r4, 0x12] - strh r1, [r4, 0x14] - ldrh r1, [r4, 0x12] - movs r0, 0x12 - bl SetGpuReg - ldr r1, [r5] - movs r0, 0xD0 - lsls r0, 2 - cmp r1, r0 - bne _0816D43E - ldr r0, =gUnknown_085E4FC4 - movs r1, 0x78 - movs r2, 0xA0 - movs r3, 0xA - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - b _0816D43E - .pool -_0816D418: - ldr r0, =0x000003ef - cmp r2, r0 - bls _0816D43E - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_5 - str r1, [r0] -_0816D43E: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_4 - - thumb_func_start task_intro_5 -task_intro_5: @ 816D458 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_030062A0 - ldr r1, [r0] - ldr r0, =0x00000402 - cmp r1, r0 - bls _0816D476 - ldr r0, =gTasks - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_intro_6 - str r0, [r1] -_0816D476: - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_5 - - thumb_func_start task_intro_6 -task_intro_6: @ 816D48C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl intro_reset_and_hide_bgs - movs r0, 0 - bl SetVBlankCallback - bl ResetSpriteData - bl FreeAllSpritePalettes - ldr r0, =gUnknown_0203BD24 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_0203BD26 - strh r1, [r0] - ldr r0, =gUnknown_0203BCCC - strh r1, [r0] - movs r0, 0x1 - bl load_intro_part2_graphics - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_7 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_6 - - thumb_func_start task_intro_7 -task_intro_7: @ 816D4E4 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0203BCC8 - ldrh r0, [r0] - cmp r0, 0 - bne _0816D504 - ldr r0, =gUnknown_085F52BC - bl LoadCompressedObjectPic - b _0816D50A - .pool -_0816D504: - ldr r0, =gUnknown_085F52CC - bl LoadCompressedObjectPic -_0816D50A: - ldr r0, =gUnknown_085F52DC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F52FC - bl LoadCompressedObjectPic - movs r6, 0 - lsls r7, r4, 2 - ldr r5, =gUnknown_085E4AE8 -_0816D51C: - lsls r0, r6, 3 - adds r0, r5 - bl LoadCompressedObjectPic - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _0816D51C - ldr r0, =gUnknown_085F530C - bl LoadSpritePalettes - ldr r0, =gUnknown_085E4B08 - bl LoadSpritePalettes - ldr r0, =gUnknown_085E4BDC - movs r5, 0x88 - lsls r5, 1 - adds r1, r5, 0 - movs r2, 0x80 - movs r3, 0 - bl CreateSprite - ldr r0, =gUnknown_085E4BA4 - movs r1, 0x90 - lsls r1, 1 - movs r2, 0x6E - movs r3, 0x1 - bl CreateSprite - ldr r0, =gUnknown_0203BCC8 - ldrh r0, [r0] - cmp r0, 0 - bne _0816D590 - adds r0, r5, 0 - movs r1, 0x64 - bl sub_817B834 - b _0816D598 - .pool -_0816D590: - adds r0, r5, 0 - movs r1, 0x64 - bl sub_817B88C -_0816D598: - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =gSprites - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r5, r2, 0 - adds r5, 0x1C - adds r3, r0, r5 - ldr r1, =sub_816F9D4 - str r1, [r3] - adds r2, 0x8 - adds r0, r2 - ldr r1, =gUnknown_085E4DC4 - str r1, [r0] - ldr r0, =gTasks - adds r4, r7, r4 - lsls r4, 3 - adds r4, r0 - strh r6, [r4, 0xA] - ldr r0, =gUnknown_085E4B40 - movs r1, 0x88 - lsls r1, 1 - movs r2, 0x50 - movs r3, 0x4 - bl CreateSprite - movs r0, 0x40 - negs r0, r0 - movs r1, 0x3C - bl sub_817B9C4 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r5 - ldr r1, =sub_816FAB0 - str r1, [r0] - strh r6, [r4, 0xC] - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r0, =sub_816CBE8 - bl SetVBlankCallback - movs r1, 0x80 - lsls r1, 7 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x1 - movs r3, 0x10 - bl sub_817B3DC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x8] - movs r0, 0x1 - bl sub_817B150 - ldr r0, =task_intro_8 - str r0, [r4] - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_7 - - thumb_func_start task_intro_8 -@ void task_intro_8(int task_id) -task_intro_8: @ 816D650 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - ldr r5, =gUnknown_030062A0 - ldr r1, [r5] - movs r0, 0xE8 - lsls r0, 3 - cmp r1, r0 - bne _0816D67C - ldr r1, =gUnknown_0203BD28 - movs r0, 0x2 - strh r0, [r1] - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl DestroyTask -_0816D67C: - ldr r1, [r5] - ldr r0, =0x0000079a - cmp r1, r0 - bls _0816D6A4 - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x8 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_9 - str r1, [r0] -_0816D6A4: - ldr r1, [r5] - ldr r0, =0x00000455 - ldr r3, =gTasks - cmp r1, r0 - bne _0816D6C8 - ldr r2, =gSprites - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r7, 0xA - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x2E] -_0816D6C8: - ldr r1, [r5] - ldr r0, =0x000004be - cmp r1, r0 - bne _0816D6EA - ldr r2, =gSprites - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r7, 0xA - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x2E] -_0816D6EA: - ldr r1, [r5] - ldr r0, =0x00000572 - cmp r1, r0 - bne _0816D70C - ldr r2, =gSprites - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r7, 0xC - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x2E] -_0816D70C: - ldr r1, [r5] - ldr r0, =0x00000576 - cmp r1, r0 - bne _0816D72E - ldr r2, =gSprites - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r7, 0xA - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x2E] -_0816D72E: - ldr r1, [r5] - movs r0, 0xC5 - lsls r0, 3 - cmp r1, r0 - bne _0816D752 - ldr r2, =gSprites - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r7, 0xA - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strh r1, [r0, 0x2E] -_0816D752: - ldr r1, [r5] - ldr r0, =0x000006bf - cmp r1, r0 - bne _0816D774 - ldr r2, =gSprites - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r4, 0xA - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x4 - strh r1, [r0, 0x2E] -_0816D774: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r3 - ldrh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 18 - movs r1, 0x7F - ands r0, r1 - movs r1, 0x30 - bl Sin - ldr r1, =gUnknown_0203BCCC - strh r0, [r1] - ldrh r2, [r4, 0xE] - movs r7, 0xE - ldrsh r1, [r4, r7] - ldr r0, =0x000001ff - cmp r1, r0 - bgt _0816D7A0 - adds r0, r2, 0x1 - strh r0, [r4, 0xE] -_0816D7A0: - movs r0, 0 - bl sub_817B540 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_8 - - thumb_func_start task_intro_9 -task_intro_9: @ 816D7E8 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_030062A0 - ldr r1, [r0] - ldr r0, =0x00000814 - cmp r1, r0 - bls _0816D806 - ldr r0, =gTasks - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_intro_10 - str r0, [r1] -_0816D806: - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_9 - - thumb_func_start sub_816D81C -sub_816D81C: @ 816D81C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - adds r0, 0x4 - strh r0, [r4, 0x34] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x8 - bls _0816D830 - b _0816D9BA -_0816D830: - lsls r0, 2 - ldr r1, =_0816D840 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816D840: - .4byte _0816D864 - .4byte _0816D87A - .4byte _0816D898 - .4byte _0816D8BC - .4byte _0816D8D8 - .4byte _0816D8FA - .4byte _0816D912 - .4byte _0816D96E - .4byte _0816D99C -_0816D864: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB3 - bgt _0816D874 - b _0816D9BA -_0816D874: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0816D87A: - ldrh r0, [r4, 0x20] - subs r0, 0x4 - strh r0, [r4, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - beq _0816D88A - b _0816D9BA -_0816D88A: - movs r0, 0x8 - strh r0, [r4, 0x2E] - movs r0, 0x14 - strh r0, [r4, 0x30] - movs r0, 0x2 - strh r0, [r4, 0x32] - b _0816D9BA -_0816D898: - ldrh r1, [r4, 0x20] - adds r1, 0x8 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x22] - subs r0, 0x2 - strh r0, [r4, 0x22] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7C - beq _0816D8AE - b _0816D9BA -_0816D8AE: - movs r0, 0x8 - strh r0, [r4, 0x2E] - movs r0, 0x14 - strh r0, [r4, 0x30] - movs r0, 0x3 - strh r0, [r4, 0x32] - b _0816D9BA -_0816D8BC: - ldrh r0, [r4, 0x22] - adds r0, 0x4 - strh r0, [r4, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x50 - bne _0816D9BA - movs r0, 0x8 - strh r0, [r4, 0x2E] - movs r0, 0xA - strh r0, [r4, 0x30] - movs r0, 0x4 - strh r0, [r4, 0x32] - b _0816D9BA -_0816D8D8: - ldrh r1, [r4, 0x20] - subs r1, 0x8 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x22] - subs r0, 0x2 - strh r0, [r4, 0x22] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x3C - bne _0816D9BA - movs r0, 0x8 - strh r0, [r4, 0x2E] - movs r0, 0xA - strh r0, [r4, 0x30] - movs r0, 0x5 - strh r0, [r4, 0x32] - b _0816D9BA -_0816D8FA: - ldrh r0, [r4, 0x20] - adds r0, 0x3C - strh r0, [r4, 0x20] - movs r0, 0xC0 - strh r0, [r4, 0x36] - movs r0, 0x80 - strh r0, [r4, 0x38] - movs r0, 0x3 - strh r0, [r4, 0x3A] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0816D912: - ldrh r0, [r4, 0x36] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3C - bl Sin - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x38] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x14 - bl Sin - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x36] - adds r1, 0x2 - strh r1, [r4, 0x36] - ldrh r0, [r4, 0x38] - adds r0, 0x4 - strh r0, [r4, 0x38] - movs r0, 0xFF - ands r1, r0 - cmp r1, 0x40 - bne _0816D9BA - adds r2, r4, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x2 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - ldrh r0, [r4, 0x3A] - subs r0, 0x1 - strh r0, [r4, 0x3A] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _0816D9BA - ldrh r0, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - strh r1, [r4, 0x24] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - b _0816D9B8 -_0816D96E: - ldrh r0, [r4, 0x20] - subs r0, 0x2 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x38] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x14 - bl Sin - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x38] - adds r0, 0x4 - strh r0, [r4, 0x38] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _0816D9BA - adds r0, r4, 0 - bl DestroySprite - b _0816D9BA -_0816D99C: - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl Cos - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - subs r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _0816D9BA - ldrh r0, [r4, 0x32] -_0816D9B8: - strh r0, [r4, 0x2E] -_0816D9BA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816D81C - - thumb_func_start sub_816D9C0 -sub_816D9C0: @ 816D9C0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bls _0816D9CE - b _0816DADA -_0816D9CE: - lsls r0, 2 - ldr r1, =_0816D9DC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816D9DC: - .4byte _0816D9F4 - .4byte _0816DA08 - .4byte _0816DA20 - .4byte _0816DA64 - .4byte _0816DA9A - .4byte _0816DACA -_0816D9F4: - ldr r0, =gUnknown_030062A0 - ldr r1, [r0] - movs r0, 0x99 - lsls r0, 3 - cmp r1, r0 - bne _0816DADA - b _0816DABA - .pool -_0816DA08: - ldr r0, =gUnknown_030062A0 - ldr r1, [r0] - movs r0, 0xC5 - lsls r0, 3 - cmp r1, r0 - bne _0816DA70 - adds r0, r4, 0 - movs r1, 0 - b _0816DABE - .pool -_0816DA20: - ldr r0, =gUnknown_030062A0 - ldr r1, [r0] - ldr r0, =0x000006c7 - cmp r1, r0 - beq _0816DA50 - ldrh r0, [r4, 0x30] - adds r2, r0, 0 - adds r2, 0x20 - strh r2, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0816DADA - ldrh r0, [r4, 0x20] - adds r0, 0x1 - b _0816DA8A - .pool -_0816DA50: - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAnim - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x50 - strh r0, [r4, 0x32] - b _0816DADA -_0816DA64: - ldrh r0, [r4, 0x32] - subs r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - beq _0816DA94 -_0816DA70: - ldrh r0, [r4, 0x30] - adds r2, r0, 0 - adds r2, 0x40 - strh r2, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0816DADA - ldrh r0, [r4, 0x20] - subs r0, 0x1 -_0816DA8A: - strh r0, [r4, 0x20] - movs r0, 0xFF - ands r2, r0 - strh r2, [r4, 0x30] - b _0816DADA -_0816DA94: - adds r0, r4, 0 - movs r1, 0x2 - b _0816DABE -_0816DA9A: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0816DAAE - ldrh r0, [r4, 0x20] - adds r0, 0x4 - strh r0, [r4, 0x20] -_0816DAAE: - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0xA8 - lsls r0, 1 - cmp r1, r0 - ble _0816DADA -_0816DABA: - adds r0, r4, 0 - movs r1, 0x1 -_0816DABE: - bl StartSpriteAnim - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0816DADA -_0816DACA: - ldr r0, =gUnknown_030062A0 - ldr r1, [r0] - ldr r0, =0x0000073f - cmp r1, r0 - bls _0816DADA - ldrh r0, [r4, 0x20] - subs r0, 0x2 - strh r0, [r4, 0x20] -_0816DADA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816D9C0 - - thumb_func_start sub_816DAE8 -sub_816DAE8: @ 816DAE8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816DB1C - cmp r0, 0x1 - bgt _0816DAFE - cmp r0, 0 - beq _0816DB04 - b _0816DBA4 -_0816DAFE: - cmp r0, 0x2 - beq _0816DB42 - b _0816DBA4 -_0816DB04: - ldr r0, =gUnknown_030062A0 - ldr r1, [r0] - movs r0, 0x88 - lsls r0, 3 - cmp r1, r0 - bne _0816DBA4 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0816DBA4 - .pool -_0816DB1C: - ldrh r0, [r4, 0x20] - subs r0, 0x2 - strh r0, [r4, 0x20] - ldr r0, =gUnknown_030062A0 - ldr r1, [r0] - movs r0, 0x92 - lsls r0, 3 - cmp r1, r0 - bne _0816DBA4 - ldrh r0, [r4, 0x22] - subs r0, 0xC - strh r0, [r4, 0x22] - movs r0, 0x80 - strh r0, [r4, 0x30] - movs r0, 0 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0816DB42: - movs r2, 0x20 - ldrsh r0, [r4, r2] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bgt _0816DB60 - adds r0, r4, 0 - bl DestroySprite - b _0816DBA4 - .pool -_0816DB60: - ldrh r0, [r4, 0x30] - movs r1, 0xFF - ands r1, r0 - cmp r1, 0x3F - bgt _0816DB72 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x10 - b _0816DB84 -_0816DB72: - cmp r1, 0x40 - bne _0816DB7C - ldrh r0, [r4, 0x20] - subs r0, 0x30 - strh r0, [r4, 0x20] -_0816DB7C: - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x40 -_0816DB84: - bl Sin - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xC - bl Cos - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_0816DBA4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816DAE8 - - thumb_func_start task_intro_10 -task_intro_10: @ 816DBAC - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - bl intro_reset_and_hide_bgs - ldr r0, =gIntro3Pokeball_Gfx - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gIntro3Pokeball_Tilemap - ldr r1, =0x06004000 - bl LZ77UnCompVram - ldr r0, =gIntro3PokeballPal - movs r2, 0x80 - lsls r2, 2 - movs r1, 0 - bl LoadPalette - ldr r0, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - movs r5, 0 - strh r5, [r4, 0x8] - strh r5, [r4, 0xA] - strh r5, [r4, 0xC] - strh r5, [r4, 0xE] - movs r0, 0x78 - movs r1, 0x50 - movs r2, 0 - movs r3, 0 - bl sub_816F2A8 - bl ResetSpriteData - bl FreeAllSpritePalettes - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r1, =0x00004883 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00001441 - movs r0, 0 - bl SetGpuReg - ldr r0, =task_intro_11 - str r0, [r4] - ldr r0, =gUnknown_030062A0 - str r5, [r0] - movs r0, 0xDD - lsls r0, 1 - bl m4aSongNumStart - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_10 - - thumb_func_start task_intro_11 -task_intro_11: @ 816DC64 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r3, r0, r2 - movs r1, 0x80 - lsls r1, 3 - adds r0, r1, 0 - ldrh r1, [r3, 0x8] - adds r0, r1 - strh r0, [r3, 0x8] - ldrh r4, [r3, 0xA] - movs r0, 0xA - ldrsh r1, [r3, r0] - ldr r0, =0x000006bf - cmp r1, r0 - bgt _0816DCA4 - ldrh r0, [r3, 0xC] - adds r1, r4, r0 - strh r1, [r3, 0xA] - adds r0, 0x2 - strh r0, [r3, 0xC] - b _0816DCA8 - .pool -_0816DCA4: - ldr r0, =task_intro_12 - str r0, [r3] -_0816DCA8: - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r2 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 9 - bl __divsi3 - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - ldrh r3, [r4, 0x8] - movs r0, 0x78 - movs r1, 0x50 - bl sub_816F2A8 - ldr r0, =gUnknown_030062A0 - ldr r0, [r0] - cmp r0, 0x1C - bne _0816DCE6 - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade -_0816DCE6: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_11 - - thumb_func_start task_intro_12 -task_intro_12: @ 816DCFC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_030062A0 - ldr r0, [r0] - cmp r0, 0x2B - bls _0816DD18 - ldr r0, =gTasks - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_intro_13 - str r0, [r1] -_0816DD18: - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_12 - - thumb_func_start task_intro_13 -task_intro_13: @ 816DD28 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816DD94 - bl intro_reset_and_hide_bgs - bl ResetSpriteData - bl FreeAllSpritePalettes - ldr r1, =gReservedSpritePaletteCount - movs r0, 0x8 - strb r0, [r1] - ldr r0, =gIntro3GroudonGfx - movs r1, 0xC0 - lsls r1, 19 - bl LZDecompressVram - ldr r0, =gIntro3GroudonTilemap - ldr r1, =0x0600c000 - bl LZDecompressVram - ldr r0, =gIntro3LegendBgGfx - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gIntro3GroudonBgTilemap - ldr r1, =0x0600e000 - bl LZDecompressVram - ldr r0, =gBattleAnimPicTable + 0x1D0 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gBattleAnimPaletteTable + 0x1D0 - bl LoadCompressedObjectPaletteUsingHeap - ldr r0, =gIntro3BgPal - ldr r1, =gPlttBufferUnfaded - movs r2, 0x80 - lsls r2, 1 - bl CpuSet - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_14 - str r1, [r0] -_0816DD94: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_13 - - thumb_func_start task_intro_14 -task_intro_14: @ 816DDD8 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0xA0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - ldr r1, =0x0000b880 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00001c05 - movs r0, 0xA - bl SetGpuReg - ldr r1, =0x00003641 - movs r0, 0 - bl SetGpuReg - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r0, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =0x0000ffa0 - strh r0, [r4, 0xA] - ldr r1, =0x0000ff51 - strh r1, [r4, 0xC] - movs r2, 0x80 - lsls r2, 1 - strh r2, [r4, 0xE] - movs r3, 0 - bl sub_816F2A8 - ldr r0, =task_intro_15 - str r0, [r4] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_14 - - thumb_func_start task_intro_15 -task_intro_15: @ 816DE7C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r2, [r4, 0x8] - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x20 - beq _0816DEB8 - adds r0, r2, 0x4 - strh r0, [r4, 0x8] - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r1, 8 - adds r0, r2, 0 - subs r0, 0x9C - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - b _0816DEC6 - .pool -_0816DEB8: - movs r1, 0x82 - lsls r1, 6 - movs r0, 0x44 - bl SetGpuReg - ldr r0, =task_intro_16 - str r0, [r4] -_0816DEC6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_15 - - thumb_func_start task_intro_16 -task_intro_16: @ 816DED0 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =task_intro_17 - str r0, [r1] - bx lr - .pool - thumb_func_end task_intro_16 - - thumb_func_start task_intro_17 -task_intro_17: @ 816DEEC - push {lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - strh r2, [r1, 0x8] - ldr r0, =task_intro_18 - str r0, [r1] - movs r0, 0x1 - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - str r2, [sp, 0x8] - movs r0, 0 - movs r1, 0xA0 - movs r2, 0x4 - movs r3, 0x4 - bl ScanlineEffect_InitWave - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_17 - - thumb_func_start task_intro_18 -task_intro_18: @ 816DF2C - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bhi _0816DF62 - ldrh r0, [r4, 0xA] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0816DF62 - ldrh r0, [r4, 0x8] - movs r1, 0x3 - eors r0, r1 - strh r0, [r4, 0x8] -_0816DF62: - ldrh r0, [r4, 0x2] - ldrh r1, [r4, 0x8] - ldrh r2, [r4, 0x4] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - ldrh r2, [r4, 0x6] - movs r3, 0 - bl sub_816F2A8 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x9 - bls _0816DF80 - b _0816E176 -_0816DF80: - lsls r0, 2 - ldr r1, =_0816DF94 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816DF94: - .4byte _0816DFBC - .4byte _0816DFE6 - .4byte _0816E024 - .4byte _0816E038 - .4byte _0816E07C - .4byte _0816E09A - .4byte _0816E0C8 - .4byte _0816E0DE - .4byte _0816E13C - .4byte _0816E156 -_0816DFBC: - ldrh r0, [r4, 0x2] - adds r0, 0x10 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA0 - beq _0816DFCC - b _0816E176 -_0816DFCC: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r0, 0x2 - strh r0, [r4, 0xC] - movs r2, 0xF1 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r4, 0xE] - adds r0, r5, 0 - bl sub_816E190 - b _0816E176 -_0816DFE6: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816DFF4 - b _0816E176 -_0816DFF4: - movs r0, 0x2 - strh r0, [r4, 0xC] - movs r1, 0xE - ldrsh r0, [r4, r1] - ldr r1, =gIntro3BgPal - adds r0, r1 - ldr r1, =gPlttBufferFaded + 0x3E - movs r2, 0x1 - bl CpuSet - ldrh r0, [r4, 0xE] - adds r0, 0x2 - strh r0, [r4, 0xE] - lsls r0, 16 - movs r1, 0xF6 - lsls r1, 17 - cmp r0, r1 - beq _0816E01A - b _0816E176 -_0816E01A: - b _0816E14E - .pool -_0816E024: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E032 - b _0816E176 -_0816E032: - movs r0, 0x2 - strh r0, [r4, 0xC] - b _0816E14E -_0816E038: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E046 - b _0816E176 -_0816E046: - movs r0, 0x2 - strh r0, [r4, 0xC] - movs r2, 0xE - ldrsh r0, [r4, r2] - ldr r1, =gIntro3BgPal - adds r0, r1 - ldr r1, =gPlttBufferFaded + 0x3E - movs r2, 0x1 - bl CpuSet - ldrh r0, [r4, 0xE] - subs r0, 0x2 - strh r0, [r4, 0xE] - lsls r0, 16 - movs r1, 0xF0 - lsls r1, 17 - cmp r0, r1 - beq _0816E06C - b _0816E176 -_0816E06C: - movs r0, 0x8 - strh r0, [r4, 0xC] - b _0816E14E - .pool -_0816E07C: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816E176 - movs r1, 0x60 - negs r1, r1 - adds r0, r1, 0 - strh r0, [r4, 0x2] - movs r0, 0xA9 - strh r0, [r4, 0x4] - movs r0, 0x3 - strh r0, [r4, 0xC] - b _0816E14E -_0816E09A: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _0816E176 - movs r0, 0x50 - strh r0, [r4, 0x2] - movs r0, 0x29 - strh r0, [r4, 0x4] - movs r0, 0x10 - strh r0, [r4, 0xC] - ldr r0, =0x00000195 - str r1, [sp] - movs r1, 0 - movs r2, 0x64 - movs r3, 0xA - bl PlayCryInternal - b _0816E14E - .pool -_0816E0C8: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816E176 - movs r0, 0x50 - strh r0, [r4, 0x2] - movs r0, 0x28 - strh r0, [r4, 0x4] - b _0816E14E -_0816E0DE: - ldrh r0, [r4, 0x2] - adds r0, 0x4 - strh r0, [r4, 0x2] - ldrh r0, [r4, 0x4] - adds r0, 0x4 - strh r0, [r4, 0x4] - ldr r2, =0x00000666 - adds r0, r2, 0 - ldrh r1, [r4, 0xC] - adds r0, r1 - strh r0, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r4, r2] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - lsrs r0, 8 - movs r1, 0x40 - bl Sin - movs r1, 0x80 - lsls r1, 1 - adds r5, r1, 0 - adds r0, r5 - strh r0, [r4, 0x6] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x78 - bne _0816E176 - movs r0, 0x2 - negs r0, r0 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0x3 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - strh r5, [r4, 0x6] - movs r0, 0 - strh r0, [r4, 0x8] - b _0816E14E - .pool -_0816E13C: - ldrh r1, [r4, 0x6] - movs r2, 0x6 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0816E14E - adds r0, r1, 0 - subs r0, 0x8 - strh r0, [r4, 0x6] - b _0816E176 -_0816E14E: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _0816E176 -_0816E156: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816E176 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_19 - str r1, [r0] - ldr r1, =gScanlineEffect - movs r0, 0x3 - strb r0, [r1, 0x15] -_0816E176: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_18 - - thumb_func_start sub_816E190 -sub_816E190: @ 816E190 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - movs r4, 0 - ldr r6, =gSprites - ldr r5, =gUnknown_085E4C64 -_0816E19C: - movs r0, 0 - ldrsh r1, [r5, r0] - lsls r3, r4, 24 - lsrs r3, 24 - ldr r0, =gUnknown_08596C10 - movs r2, 0xA0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r0, r6, 0 - adds r0, 0x1C - adds r0, r2, r0 - ldr r1, =sub_816E1F8 - str r1, [r0] - adds r2, r6 - ldrb r0, [r2, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - strb r0, [r2, 0x5] - strh r4, [r2, 0x30] - strh r7, [r2, 0x36] - ldrb r1, [r5, 0x2] - adds r0, r2, 0 - bl StartSpriteAnim - adds r5, 0x6 - adds r4, 0x1 - cmp r4, 0x5 - ble _0816E19C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816E190 - - thumb_func_start sub_816E1F8 -sub_816E1F8: @ 816E1F8 - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x34] - adds r0, 0x1 - strh r0, [r3, 0x34] - ldrh r0, [r3, 0x34] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0816E214 - ldrh r0, [r3, 0x26] - movs r1, 0x3 - eors r0, r1 - strh r0, [r3, 0x26] -_0816E214: - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _0816E222 - cmp r0, 0x1 - beq _0816E278 - b _0816E29C -_0816E222: - ldr r2, =gUnknown_085E4C64 - movs r0, 0x30 - ldrsh r1, [r3, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - adds r2, 0x4 - adds r0, r2 - ldrh r2, [r0] - ldrh r1, [r3, 0x32] - adds r2, r1 - strh r2, [r3, 0x32] - movs r0, 0x32 - ldrsh r1, [r3, r0] - movs r0, 0xFF - lsls r0, 8 - ands r1, r0 - asrs r1, 8 - ldrh r0, [r3, 0x22] - subs r0, r1 - strh r0, [r3, 0x22] - movs r0, 0xFF - ands r2, r0 - strh r2, [r3, 0x32] - ldr r2, =gTasks - movs r0, 0x36 - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x7 - ble _0816E29C - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - b _0816E29C - .pool -_0816E278: - ldrh r1, [r3, 0x20] - movs r2, 0x20 - ldrsh r0, [r3, r2] - cmp r0, 0x77 - bgt _0816E286 - subs r0, r1, 0x2 - b _0816E288 -_0816E286: - adds r0, r1, 0x2 -_0816E288: - strh r0, [r3, 0x20] - ldrh r1, [r3, 0x22] - movs r2, 0x22 - ldrsh r0, [r3, r2] - cmp r0, 0x4F - bgt _0816E298 - subs r0, r1, 0x2 - b _0816E29A -_0816E298: - adds r0, r1, 0x2 -_0816E29A: - strh r0, [r3, 0x22] -_0816E29C: - pop {r0} - bx r0 - thumb_func_end sub_816E1F8 - - thumb_func_start task_intro_19 -task_intro_19: @ 816E2A0 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl ResetSpriteData - ldr r0, =gIntro3KyogreGfx - movs r1, 0xC0 - lsls r1, 19 - bl LZDecompressVram - ldr r0, =gIntro3KyogreTilemap - ldr r1, =0x0600c000 - bl LZDecompressVram - ldr r0, =gIntro3KyogreBgTilemap - ldr r1, =0x0600e000 - bl LZDecompressVram - ldr r0, =gUnknown_085E4C88 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E4C98 - bl LoadSpritePalette - movs r0, 0x2 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_intro_20 - str r0, [r1] - movs r4, 0 - strh r4, [r1, 0x8] - movs r0, 0xA8 - lsls r0, 1 - strh r0, [r1, 0xA] - movs r2, 0x50 - strh r2, [r1, 0xC] - movs r2, 0x10 - strh r2, [r1, 0x14] - adds r2, 0xF0 - strh r2, [r1, 0xE] - movs r1, 0x50 - movs r3, 0 - bl sub_816F2A8 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0xA0 - movs r2, 0x4 - movs r3, 0x4 - bl ScanlineEffect_InitWave - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_19 - - thumb_func_start task_intro_20 -task_intro_20: @ 816E358 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldrh r0, [r5, 0x2] - ldrh r1, [r5, 0x4] - ldrh r2, [r5, 0x6] - movs r3, 0 - bl sub_816F2A8 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0xD - bls _0816E380 - b _0816E6BC -_0816E380: - lsls r0, 2 - ldr r1, =_0816E394 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816E394: - .4byte _0816E3CC - .4byte _0816E3E0 - .4byte _0816E43C - .4byte _0816E488 - .4byte _0816E4C4 - .4byte _0816E4EC - .4byte _0816E544 - .4byte _0816E560 - .4byte _0816E5A0 - .4byte _0816E5BC - .4byte _0816E5FC - .4byte _0816E61A - .4byte _0816E664 - .4byte _0816E69C -_0816E3CC: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E3DA - b _0816E6BC -_0816E3DA: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_0816E3E0: - ldrh r0, [r5, 0xC] - adds r0, 0x4 - strh r0, [r5, 0xC] - movs r2, 0xC - ldrsh r0, [r5, r2] - movs r1, 0x80 - lsls r1, 1 - bl Sin - ldr r1, =gTasks - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 3 - adds r4, r1 - movs r2, 0xAC - lsls r2, 1 - adds r1, r2, 0 - subs r1, r0 - strh r1, [r4, 0xA] - movs r1, 0xC - ldrsh r0, [r5, r1] - movs r1, 0x40 - bl Cos - movs r1, 0x54 - subs r1, r0 - strh r1, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r5, r2] - cmp r0, 0x40 - beq _0816E420 - b _0816E6BC -_0816E420: - movs r0, 0x19 - strh r0, [r5, 0xC] - movs r0, 0x1 - strh r0, [r5, 0xE] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - movs r0, 0 - bl sub_816E6D4 - b _0816E6BC - .pool -_0816E43C: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E44A - b _0816E6BC -_0816E44A: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - ldrh r2, [r1, 0xA] - adds r0, r2 - strh r0, [r1, 0xA] - ldr r2, =0xfffffefe - adds r0, r2, 0 - ldrh r2, [r1, 0xC] - adds r0, r2 - strh r0, [r1, 0xC] - movs r0, 0x8 - strh r0, [r5, 0xC] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - movs r0, 0 - bl sub_816E6D4 - bl sub_816E74C - b _0816E6BC - .pool -_0816E488: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E496 - b _0816E6BC -_0816E496: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r2, =0xffffff00 - adds r0, r2, 0 - ldrh r2, [r1, 0xA] - adds r0, r2 - strh r0, [r1, 0xA] - movs r2, 0x81 - lsls r2, 1 - adds r0, r2, 0 - ldrh r2, [r1, 0xC] - adds r0, r2 - strh r0, [r1, 0xC] - movs r0, 0x8 - strh r0, [r5, 0xC] - b _0816E690 - .pool -_0816E4C4: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E4D2 - b _0816E6BC -_0816E4D2: - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0xC] - subs r1, 0xFC - strh r1, [r0, 0xC] - movs r0, 0x8 - strh r0, [r5, 0xC] - b _0816E690 - .pool -_0816E4EC: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E4FA - b _0816E6BC -_0816E4FA: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xC] - adds r0, 0xFC - strh r0, [r1, 0xC] - ldrh r2, [r5, 0xE] - movs r0, 0xE - ldrsh r1, [r5, r0] - cmp r1, 0 - beq _0816E528 - movs r0, 0xC - strh r0, [r5, 0xC] - subs r0, r2, 0x1 - strh r0, [r5, 0xE] - movs r0, 0x2 - strh r0, [r5] - b _0816E6BC - .pool -_0816E528: - movs r0, 0x1 - strh r0, [r5, 0xC] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - movs r0, 0xCA - lsls r0, 1 - str r1, [sp] - movs r1, 0 - movs r2, 0x78 - movs r3, 0xA - bl PlayCryInternal - b _0816E6BC -_0816E544: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E552 - b _0816E6BC -_0816E552: - movs r0, 0x4 - strh r0, [r5, 0xC] - movs r1, 0xF5 - lsls r1, 1 - adds r0, r1, 0 - strh r0, [r5, 0xE] - b _0816E690 -_0816E560: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E56E - b _0816E6BC -_0816E56E: - movs r0, 0x4 - strh r0, [r5, 0xC] - movs r2, 0xE - ldrsh r0, [r5, r2] - ldr r1, =gIntro3BgPal - adds r0, r1 - ldr r1, =gPlttBufferFaded + 0x5E - movs r2, 0x1 - bl CpuSet - ldrh r0, [r5, 0xE] - subs r0, 0x2 - strh r0, [r5, 0xE] - lsls r0, 16 - movs r1, 0xF0 - lsls r1, 17 - cmp r0, r1 - beq _0816E594 - b _0816E6BC -_0816E594: - b _0816E690 - .pool -_0816E5A0: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E5AE - b _0816E6BC -_0816E5AE: - movs r0, 0x4 - strh r0, [r5, 0xC] - movs r1, 0xF1 - lsls r1, 1 - adds r0, r1, 0 - strh r0, [r5, 0xE] - b _0816E690 -_0816E5BC: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816E6BC - movs r0, 0x4 - strh r0, [r5, 0xC] - movs r2, 0xE - ldrsh r0, [r5, r2] - ldr r1, =gIntro3BgPal - adds r0, r1 - ldr r1, =gPlttBufferFaded + 0x5E - movs r2, 0x1 - bl CpuSet - ldrh r0, [r5, 0xE] - adds r0, 0x2 - strh r0, [r5, 0xE] - lsls r0, 16 - movs r1, 0xF7 - lsls r1, 17 - cmp r0, r1 - bne _0816E6BC - movs r0, 0x10 - strh r0, [r5, 0xC] - b _0816E690 - .pool -_0816E5FC: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bne _0816E6BC - strh r0, [r5, 0xC] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - adds r0, r6, 0 - bl sub_816E6D4 - b _0816E6BC -_0816E61A: - ldrh r0, [r5, 0xC] - adds r0, 0x4 - strh r0, [r5, 0xC] - ldrh r0, [r5, 0x6] - subs r0, 0x8 - strh r0, [r5, 0x6] - movs r1, 0xC - ldrsh r0, [r5, r1] - movs r1, 0x3C - bl Sin - ldr r2, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r2 - adds r0, 0x58 - strh r0, [r1, 0xA] - movs r2, 0xC - ldrsh r0, [r5, r2] - cmp r0, 0x40 - bne _0816E6BC - movs r0, 0x2 - negs r0, r0 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0x3 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _0816E690 - .pool -_0816E664: - ldrh r0, [r5, 0xC] - adds r0, 0x4 - strh r0, [r5, 0xC] - ldrh r0, [r5, 0x6] - subs r0, 0x8 - strh r0, [r5, 0x6] - movs r1, 0xC - ldrsh r0, [r5, r1] - movs r1, 0x14 - bl Sin - ldr r2, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r2 - adds r0, 0x80 - strh r0, [r1, 0xA] - movs r2, 0xC - ldrsh r0, [r5, r2] - cmp r0, 0x80 - bne _0816E6BC -_0816E690: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _0816E6BC - .pool -_0816E69C: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816E6BC - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_21 - str r1, [r0] - ldr r1, =gScanlineEffect - movs r0, 0x3 - strb r0, [r1, 0x15] -_0816E6BC: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_20 - - thumb_func_start sub_816E6D4 -sub_816E6D4: @ 816E6D4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r7, =gUnknown_085E4CA8 - ldr r0, =gSprites - mov r9, r0 - adds r4, r7, 0 - movs r6, 0 -_0816E6EE: - movs r3, 0 - ldrsh r1, [r4, r3] - adds r0, r7, 0x2 - adds r0, r6, r0 - movs r3, 0 - ldrsh r2, [r0, r3] - lsls r3, r5, 24 - lsrs r3, 24 - ldr r0, =gUnknown_085E4D14 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r9 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] - mov r0, r8 - strh r0, [r2, 0x38] - ldrh r0, [r4, 0x4] - strh r0, [r2, 0x3A] - movs r0, 0x40 - strh r0, [r2, 0x3C] - adds r4, 0x6 - adds r6, 0x6 - adds r5, 0x1 - cmp r5, 0x5 - ble _0816E6EE - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816E6D4 - - thumb_func_start sub_816E74C -sub_816E74C: @ 816E74C - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r5, 0 - ldr r7, =gUnknown_085E4CA8 - adds r4, r7, 0x4 - movs r6, 0x24 - ldr r0, =gSprites - mov r8, r0 -_0816E75E: - movs r3, 0x20 - ldrsh r1, [r4, r3] - adds r0, r7, 0x2 - adds r0, r6, r0 - movs r3, 0 - ldrsh r2, [r0, r3] - lsls r3, r5, 24 - lsrs r3, 24 - ldr r0, =gUnknown_085E4D14 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r8 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] - ldrh r0, [r4] - strh r0, [r2, 0x3A] - movs r0, 0x40 - strh r0, [r2, 0x3C] - adds r4, 0x6 - adds r6, 0x6 - adds r5, 0x1 - cmp r5, 0x5 - ble _0816E75E - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816E74C - - thumb_func_start sub_816E7B4 -sub_816E7B4: @ 816E7B4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0816E7C6 - cmp r0, 0x1 - beq _0816E84C - b _0816E882 -_0816E7C6: - ldrh r1, [r4, 0x3A] - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0816E80A - ldrh r0, [r4, 0x30] - adds r0, 0xB - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x4 - bl Sin - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x30 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 24 - negs r0, r0 - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0816E82A - adds r0, r4, 0 - bl DestroySprite - b _0816E82A -_0816E80A: - subs r0, r1, 0x1 - strh r0, [r4, 0x3A] - lsls r0, 16 - cmp r0, 0 - bne _0816E82A - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnim - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0816E82A: - ldr r2, =gTasks - movs r0, 0x38 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0xB - ble _0816E882 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0816E882 - .pool -_0816E84C: - ldrh r1, [r4, 0x20] - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0x77 - bgt _0816E85A - subs r0, r1, 0x3 - b _0816E85C -_0816E85A: - adds r0, r1, 0x3 -_0816E85C: - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x22] - movs r2, 0x22 - ldrsh r0, [r4, r2] - cmp r0, 0x4F - bgt _0816E86C - subs r0, r1, 0x3 - b _0816E86E -_0816E86C: - adds r0, r1, 0x3 -_0816E86E: - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x22] - subs r0, 0x14 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8C - bls _0816E882 - adds r0, r4, 0 - bl DestroySprite -_0816E882: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816E7B4 - - thumb_func_start task_intro_21 -task_intro_21: @ 816E888 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x50 - movs r1, 0x87 - bl SetGpuReg - ldr r1, =0x00001f1f - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0x1F - bl SetGpuReg - movs r1, 0xB0 - lsls r1, 7 - movs r0, 0x8 - bl SetGpuReg - ldr r1, =0x00005a04 - movs r0, 0xA - bl SetGpuReg - ldr r1, =0x00001c06 - movs r0, 0xC - bl SetGpuReg - movs r1, 0xDD - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0x50 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - ldr r1, =0x0000ffb0 - movs r0, 0x14 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - ldr r4, =gIntro3CloudsGfx - movs r1, 0xC0 - lsls r1, 19 - adds r0, r4, 0 - bl LZDecompressVram - ldr r1, =0x06004000 - adds r0, r4, 0 - bl LZDecompressVram - ldr r0, =gIntro3Clouds3Tilemap - ldr r1, =0x0600e000 - bl LZDecompressVram - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_22 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_21 - - thumb_func_start task_intro_22 -task_intro_22: @ 816E954 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gIntro3Clouds1Tilemap - ldr r1, =0x0600c000 - bl LZDecompressVram - ldr r0, =gIntro3Clouds2Tilemap - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_23 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_22 - - thumb_func_start task_intro_23 -task_intro_23: @ 816E998 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_24 - str r1, [r0] - movs r1, 0 - strh r1, [r0, 0x8] - movs r1, 0x10 - strh r1, [r0, 0x14] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_23 - - thumb_func_start task_intro_24 -task_intro_24: @ 816E9DC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r5, r1, 3 - ldr r6, =gTasks + 0x8 - adds r4, r5, r6 - ldrh r1, [r4, 0xC] - lsls r1, 16 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x10 - bl SetGpuReg - ldrh r1, [r4, 0xC] - lsls r1, 16 - asrs r1, 24 - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x14 - bl SetGpuReg - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0816EA24 - cmp r0, 0x1 - beq _0816EA58 - b _0816EAA6 - .pool -_0816EA24: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816EAA6 - movs r0, 0x2 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r2, 0xA0 - lsls r2, 7 - adds r0, r2, 0 - strh r0, [r4, 0xC] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _0816EAA6 - .pool -_0816EA58: - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r0, 0xA0 - lsls r0, 6 - cmp r1, r0 - bne _0816EA74 - ldr r0, =0x0000fffe - ldr r1, =0x00002949 - str r1, [sp] - movs r1, 0x3 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade -_0816EA74: - ldrh r1, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0816EA90 - adds r0, r1, 0 - subs r0, 0x80 - strh r0, [r4, 0xC] - b _0816EAA6 - .pool -_0816EA90: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816EAA6 - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =task_intro_25 - str r1, [r0] -_0816EAA6: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_24 - - thumb_func_start task_intro_25 -task_intro_25: @ 816EAB8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gIntro3RayquazaTilemap - ldr r1, =0x0600e000 - bl LZDecompressVram - ldr r0, =gIntro3Clouds4Tilemap - ldr r1, =0x0600c000 - bl LZDecompressVram - ldr r0, =gIntro3RayquazaGfx - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gIntro3Clouds2Gfx - movs r1, 0xC0 - lsls r1, 19 - bl LZDecompressVram - movs r1, 0xD5 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_26 - str r1, [r0] - movs r2, 0 - strh r2, [r0, 0x8] - movs r1, 0x1 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - ldr r0, =gUnknown_085E4BF4 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_085E4C04 - bl LoadSpritePalettes - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_25 - - thumb_func_start task_intro_26 -task_intro_26: @ 816EB44 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r2, =gTasks + 0x8 - adds r6, r1, r2 - movs r3, 0 - ldrsh r0, [r6, r3] - cmp r0, 0x1 - beq _0816EBE0 - cmp r0, 0x1 - bgt _0816EB6C - cmp r0, 0 - beq _0816EB72 - b _0816EC62 - .pool -_0816EB6C: - cmp r0, 0x2 - beq _0816EC4C - b _0816EC62 -_0816EB72: - ldrh r0, [r6, 0xC] - subs r0, 0x1 - strh r0, [r6, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816EC62 - ldr r4, =gUnknown_085E4C4C - adds r0, r4, 0 - movs r1, 0xC8 - movs r2, 0x30 - movs r3, 0 - bl CreateSprite - adds r0, r4, 0 - movs r1, 0xC8 - movs r2, 0x50 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - movs r1, 0x1 - bl StartSpriteAnim - adds r0, r4, 0 - movs r1, 0xC8 - movs r2, 0x70 - movs r3, 0x2 - bl CreateSprite - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x2 - bl StartSpriteAnim - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - movs r0, 0x48 - strh r0, [r6, 0xC] - b _0816EC62 - .pool -_0816EBE0: - ldrh r0, [r6, 0xC] - subs r0, 0x1 - strh r0, [r6, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816EC62 - ldr r4, =gUnknown_085E4C4C - adds r0, r4, 0 - movs r1, 0x28 - movs r2, 0x30 - movs r3, 0 - bl CreateSprite - adds r0, r4, 0 - movs r1, 0x28 - movs r2, 0x50 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - movs r1, 0x1 - bl StartSpriteAnim - adds r0, r4, 0 - movs r1, 0x28 - movs r2, 0x70 - movs r3, 0x2 - bl CreateSprite - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x2 - bl StartSpriteAnim - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - movs r0, 0x30 - strh r0, [r6, 0xC] - b _0816EC62 - .pool -_0816EC4C: - ldrh r0, [r6, 0xC] - subs r0, 0x1 - strh r0, [r6, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816EC62 - adds r0, r2, 0 - subs r0, 0x8 - adds r0, r1, r0 - ldr r1, =task_intro_27 - str r1, [r0] -_0816EC62: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_26 - - thumb_func_start sub_816EC6C -sub_816EC6C: @ 816EC6C - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0816EC88 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0816EC88: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816ECAC - cmp r0, 0x1 - bgt _0816EC9A - cmp r0, 0 - beq _0816ECA0 - b _0816ED12 -_0816EC9A: - cmp r0, 0x2 - beq _0816ECDC - b _0816ED12 -_0816ECA0: - movs r0, 0xE1 - lsls r0, 1 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0816ECAC: - movs r1, 0x30 - ldrsh r0, [r4, r1] - ldr r1, =gIntro3BgPal - adds r0, r1 - ldr r1, =gPlttBufferFaded + 0xBA - movs r2, 0x1 - bl CpuSet - ldrh r0, [r4, 0x30] - adds r0, 0x2 - strh r0, [r4, 0x30] - lsls r0, 16 - movs r1, 0xE7 - lsls r1, 17 - cmp r0, r1 - bne _0816ED12 - movs r0, 0xE6 - lsls r0, 1 - strh r0, [r4, 0x30] - movs r0, 0x4 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0816ECDC: - ldrh r0, [r4, 0x32] - subs r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - bne _0816ED12 - movs r0, 0x4 - strh r0, [r4, 0x32] - movs r1, 0x30 - ldrsh r0, [r4, r1] - ldr r1, =gIntro3BgPal - adds r0, r1 - ldr r1, =gPlttBufferFaded + 0xBA - movs r2, 0x1 - bl CpuSet - ldrh r0, [r4, 0x30] - subs r0, 0x2 - strh r0, [r4, 0x30] - lsls r0, 16 - movs r1, 0xE0 - lsls r1, 17 - cmp r0, r1 - bne _0816ED12 - adds r0, r4, 0 - bl DestroySprite -_0816ED12: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816EC6C - - thumb_func_start task_intro_27 -task_intro_27: @ 816ED20 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_085E5048 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E5058 - bl LoadSpritePalettes - movs r1, 0xD5 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - ldr r6, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r6 - ldr r0, =task_intro_28 - str r0, [r4] - ldr r0, =0x0000ffde - ldr r1, =0x00002949 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r0, 0 - strh r0, [r4, 0x8] - movs r0, 0xA8 - strh r0, [r4, 0xA] - ldr r1, =0x0000fff0 - strh r1, [r4, 0xC] - ldr r0, =0x0000ff78 - strh r0, [r4, 0xE] - strh r1, [r4, 0x10] - ldr r0, =sub_816EEA8 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r6 - strh r5, [r1, 0x10] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_27 - - thumb_func_start task_intro_28 -task_intro_28: @ 816EDB4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r4, r1, 3 - ldr r5, =gTasks + 0x8 - adds r2, r4, r5 - ldrh r0, [r2, 0xE] - movs r3, 0x1 - ands r0, r3 - cmp r0, 0 - bne _0816EDD6 - ldrh r0, [r2, 0xC] - movs r1, 0x2 - eors r0, r1 - strh r0, [r2, 0xC] -_0816EDD6: - ldrh r0, [r2, 0xE] - adds r0, 0x1 - strh r0, [r2, 0xE] - movs r6, 0 - ldrsh r1, [r2, r6] - cmp r1, 0x1 - beq _0816EE2E - cmp r1, 0x1 - bgt _0816EDF4 - cmp r1, 0 - beq _0816EDFE - b _0816EE86 - .pool -_0816EDF4: - cmp r1, 0x2 - beq _0816EE3A - cmp r1, 0x3 - beq _0816EE70 - b _0816EE86 -_0816EDFE: - ands r0, r3 - cmp r0, 0 - beq _0816EE1C - ldrh r0, [r2, 0x2] - subs r0, 0x2 - strh r0, [r2, 0x2] - ldrh r0, [r2, 0x4] - adds r0, 0x1 - strh r0, [r2, 0x4] - ldrh r0, [r2, 0x6] - adds r0, 0x2 - strh r0, [r2, 0x6] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] -_0816EE1C: - movs r1, 0x2 - ldrsh r0, [r2, r1] - cmp r0, 0x68 - bne _0816EE86 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - strh r3, [r2, 0xA] - b _0816EE86 -_0816EE2E: - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - movs r0, 0x4 - strh r0, [r2, 0xA] - b _0816EE86 -_0816EE3A: - ldrh r0, [r2, 0x2] - adds r0, 0x4 - strh r0, [r2, 0x2] - ldrh r0, [r2, 0x4] - subs r0, 0x2 - strh r0, [r2, 0x4] - ldrh r0, [r2, 0x6] - subs r0, 0x4 - strh r0, [r2, 0x6] - ldrh r0, [r2, 0x8] - subs r0, 0x2 - strh r0, [r2, 0x8] - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816EE86 - movs r0, 0x8C - strh r0, [r2, 0xA] - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _0816EE86 - .pool -_0816EE70: - ldrh r0, [r2, 0xA] - subs r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - cmp r0, 0 - bne _0816EE86 - adds r0, r5, 0 - subs r0, 0x8 - adds r0, r4, r0 - ldr r1, =task_intro_29 - str r1, [r0] -_0816EE86: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_28 - - thumb_func_start task_intro_29 -task_intro_29: @ 816EE90 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - ldr r0, =sub_816CC54 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_29 - - thumb_func_start sub_816EEA8 -sub_816EEA8: @ 816EEA8 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldrh r0, [r5, 0x4] - adds r0, 0x1 - strh r0, [r5, 0x4] - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x5 - bls _0816EECA - b _0816F0B2 -_0816EECA: - lsls r0, 2 - ldr r1, =_0816EEDC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816EEDC: - .4byte _0816EEF4 - .4byte _0816EF34 - .4byte _0816EF80 - .4byte _0816F00A - .4byte _0816F074 - .4byte _0816F0A0 -_0816EEF4: - ldrh r1, [r5, 0x4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816EF16 - movs r2, 0x2 - ldrsh r0, [r5, r2] - lsls r0, 1 - ldr r1, =gIntro3BgPal + 0x1A2 - adds r0, r1 - ldr r1, =gPlttBufferFaded + 0xBC - movs r2, 0x1 - bl CpuSet - ldrh r0, [r5, 0x2] - adds r0, 0x1 - strh r0, [r5, 0x2] -_0816EF16: - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0x6 - beq _0816EF20 - b _0816F0B2 -_0816EF20: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - movs r0, 0 - strh r0, [r5, 0x2] - b _0816EF70 - .pool -_0816EF34: - ldrh r1, [r5, 0x6] - movs r2, 0x6 - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _0816F004 - ldrh r1, [r5, 0x4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816EF60 - movs r1, 0x2 - ldrsh r0, [r5, r1] - lsls r0, 1 - ldr r1, =gIntro3BgPal + 0x1A2 - adds r0, r1 - ldr r1, =gPlttBufferFaded + 0xB0 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r5, 0x2] - adds r0, 0x1 - strh r0, [r5, 0x2] -_0816EF60: - movs r2, 0x2 - ldrsh r0, [r5, r2] - cmp r0, 0x6 - beq _0816EF6A - b _0816F0B2 -_0816EF6A: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_0816EF70: - movs r0, 0xA - strh r0, [r5, 0x6] - b _0816F0B2 - .pool -_0816EF80: - ldrh r1, [r5, 0x6] - movs r2, 0x6 - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _0816F004 - ldrh r1, [r5, 0x4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816EFAC - movs r1, 0x2 - ldrsh r0, [r5, r1] - lsls r0, 1 - ldr r1, =gIntro3BgPal + 0x182 - adds r0, r1 - ldr r1, =gPlttBufferFaded + 0xB8 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r5, 0x2] - adds r0, 0x1 - strh r0, [r5, 0x2] -_0816EFAC: - movs r2, 0x2 - ldrsh r0, [r5, r2] - cmp r0, 0x6 - beq _0816EFB6 - b _0816F0B2 -_0816EFB6: - ldr r0, =gUnknown_085E5030 - movs r1, 0x78 - movs r2, 0x58 - movs r3, 0xF - bl CreateSprite - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x67 - bl PlaySE - ldr r1, =gSprites - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r3] - ldrh r1, [r5, 0x8] - strh r1, [r0, 0x34] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - movs r0, 0x10 - strh r0, [r5, 0x6] - b _0816F0B2 - .pool -_0816F004: - subs r0, r1, 0x1 - strh r0, [r5, 0x6] - b _0816F0B2 -_0816F00A: - ldrh r1, [r5, 0x4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816F0B2 - ldrh r0, [r5, 0x6] - subs r0, 0x1 - adds r2, r0, 0 - strh r0, [r5, 0x6] - lsls r0, 16 - cmp r0, 0 - beq _0816F068 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =0x00002949 - movs r0, 0x50 - movs r1, 0x10 - bl BlendPalette - ldr r4, =gIntro3BgPal + 0x1AC - ldr r5, =gPlttBufferFaded + 0xBC - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - adds r1, r5, 0 - subs r1, 0xC - adds r0, r4, 0 - movs r2, 0x1 - bl CpuSet - subs r4, 0x20 - subs r5, 0x4 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - b _0816F0B2 - .pool -_0816F068: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - movs r0, 0x35 - strh r0, [r5, 0x6] - b _0816F0B2 -_0816F074: - ldrh r0, [r5, 0x6] - subs r0, 0x1 - strh r0, [r5, 0x6] - lsls r0, 16 - cmp r0, 0 - bne _0816F0B2 - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _0816F0B2 - .pool -_0816F0A0: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816F0B2 - adds r0, r2, 0 - bl DestroyTask -_0816F0B2: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816EEA8 - - thumb_func_start intro_reset_and_hide_bgs -@ void intro_reset_and_hide_bgs() -intro_reset_and_hide_bgs: @ 816F0C0 - push {lr} - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end intro_reset_and_hide_bgs - - thumb_func_start task_intro_3_1 -task_intro_3_1: @ 816F128 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816F170 - cmp r0, 0x1 - ble _0816F148 - cmp r0, 0x2 - beq _0816F1BC -_0816F148: - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =gUnknown_0853FF70 - ldrh r1, [r0, 0x3E] - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - b _0816F1AC - .pool -_0816F170: - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0816F1A0 - subs r0, r1, 0x1 - strh r0, [r4, 0xA] - movs r1, 0xA - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - movs r1, 0xFF - lsls r1, 1 - ldr r2, =gUnknown_0853FF70 - ands r0, r1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x52 - bl SetGpuReg - b _0816F1DA - .pool -_0816F1A0: - ldr r0, =gUnknown_0853FF70 - ldrh r1, [r0] - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x10 -_0816F1AC: - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0816F1DA - .pool -_0816F1BC: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl DestroyTask -_0816F1DA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_intro_3_1 - - thumb_func_start task_intro_3_2 -task_intro_3_2: @ 816F1E0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816F228 - cmp r0, 0x1 - ble _0816F200 - cmp r0, 0x2 - beq _0816F274 -_0816F200: - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =gUnknown_0853FF70 - ldrh r1, [r0] - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - b _0816F264 - .pool -_0816F228: - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0x3D - bgt _0816F258 - adds r0, r1, 0x1 - strh r0, [r4, 0xA] - movs r1, 0xA - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - movs r1, 0xFF - lsls r1, 1 - ldr r2, =gUnknown_0853FF70 - ands r0, r1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x52 - bl SetGpuReg - b _0816F2A2 - .pool -_0816F258: - ldr r0, =gUnknown_0853FF70 - ldrh r1, [r0, 0x3E] - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x10 -_0816F264: - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0816F2A2 - .pool -_0816F274: - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0816F284 - subs r0, r1, 0x1 - strh r0, [r4, 0xA] - b _0816F2A2 -_0816F284: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl DestroyTask -_0816F2A2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_intro_3_2 - - thumb_func_start sub_816F2A8 -sub_816F2A8: @ 816F2A8 - push {r4,lr} - sub sp, 0x24 - lsls r2, 16 - lsrs r2, 16 - movs r4, 0x80 - lsls r4, 8 - str r4, [sp] - str r4, [sp, 0x4] - mov r4, sp - strh r0, [r4, 0x8] - mov r0, sp - strh r1, [r0, 0xA] - strh r2, [r0, 0xC] - strh r2, [r0, 0xE] - strh r3, [r0, 0x10] - add r4, sp, 0x14 - adds r1, r4, 0 - movs r2, 0x1 - bl BgAffineSet - ldrh r1, [r4] - movs r0, 0x20 - bl SetGpuReg - ldrh r1, [r4, 0x2] - movs r0, 0x22 - bl SetGpuReg - ldrh r1, [r4, 0x4] - movs r0, 0x24 - bl SetGpuReg - ldrh r1, [r4, 0x6] - movs r0, 0x26 - bl SetGpuReg - ldrh r1, [r4, 0x8] - movs r0, 0x28 - bl SetGpuReg - ldrh r1, [r4, 0xA] - movs r0, 0x2A - bl SetGpuReg - ldrh r1, [r4, 0xC] - movs r0, 0x2C - bl SetGpuReg - ldrh r1, [r4, 0xE] - movs r0, 0x2E - bl SetGpuReg - add sp, 0x24 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816F2A8 - - thumb_func_start sub_816F318 -sub_816F318: @ 816F318 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0xBF - ble _0816F394 - ldrh r1, [r4, 0x34] - movs r2, 0x34 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0816F336 - subs r0, r1, 0x1 - strh r0, [r4, 0x34] - b _0816F39A -_0816F336: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x32] - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetOamMatrix - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 5 - subs r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4, 0x32] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1, 0 - subs r0, 0xC0 - cmp r0, 0 - bge _0816F378 - adds r0, 0x7F -_0816F378: - asrs r0, 7 - adds r0, 0x9 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xF - bls _0816F386 - movs r0, 0xF -_0816F386: - lsls r2, r0, 4 - ldrb r1, [r4, 0x5] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x5] - b _0816F39A -_0816F394: - adds r0, r4, 0 - bl DestroySprite -_0816F39A: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816F318 - - thumb_func_start sub_816F3A4 -sub_816F3A4: @ 816F3A4 - push {r4,lr} - adds r4, r0, 0 - ldr r2, =gSprites - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r3, 0x3C - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0816F420 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r0, r3 - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0x3 - bl StartSpriteAnim - movs r0, 0x80 - lsls r0, 3 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x30] - movs r0, 0x3 - ands r0, r1 - lsls r0, 3 - strh r0, [r4, 0x34] - ldr r0, =sub_816F318 - str r0, [r4, 0x1C] - ldrb r1, [r4, 0x1] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - movs r1, 0xC0 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x2 - bl CalcCenterToCornerVec - b _0816F44C - .pool -_0816F420: - ldrh r0, [r1, 0x24] - strh r0, [r4, 0x24] - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x26] - strh r0, [r4, 0x26] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x20] - strh r0, [r4, 0x20] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x22] - strh r0, [r4, 0x22] -_0816F44C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816F3A4 - - thumb_func_start sub_816F454 -sub_816F454: @ 816F454 - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _0816F464 - ldr r0, =sub_816F46C - str r0, [r1, 0x1C] -_0816F464: - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F454 - - thumb_func_start sub_816F46C -sub_816F46C: @ 816F46C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r0, 0 - ldrh r4, [r7, 0x20] - movs r1, 0x20 - ldrsh r0, [r7, r1] - cmp r0, 0x74 - bgt _0816F4AC - ldrh r0, [r7, 0x26] - ldrh r1, [r7, 0x22] - adds r0, r1 - movs r1, 0 - strh r0, [r7, 0x22] - strh r1, [r7, 0x26] - adds r0, r4, 0x4 - strh r0, [r7, 0x20] - ldr r0, =0x0000fffc - strh r0, [r7, 0x24] - movs r0, 0x80 - strh r0, [r7, 0x36] - ldr r0, =sub_816F5B4 - str r0, [r7, 0x1C] - b _0816F59E - .pool -_0816F4AC: - ldrh r1, [r7, 0x36] - ldr r5, =gSineTable - lsls r0, r1, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r2, [r0] - adds r0, r1, 0 - adds r0, 0x40 - lsls r0, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r3, [r0] - adds r1, 0x2 - strh r1, [r7, 0x36] - lsls r2, 16 - asrs r0, r2, 16 - cmp r0, 0 - bge _0816F4D2 - adds r0, 0x1F -_0816F4D2: - asrs r0, 5 - strh r0, [r7, 0x26] - subs r0, r4, 0x1 - strh r0, [r7, 0x20] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816F4E8 - ldrh r0, [r7, 0x22] - adds r0, 0x1 - strh r0, [r7, 0x22] -_0816F4E8: - lsls r0, r3, 16 - asrs r0, 16 - negs r0, r0 - cmp r0, 0 - bge _0816F4F4 - adds r0, 0xF -_0816F4F4: - lsls r1, r0, 12 - lsrs r1, 16 - ldrh r4, [r7, 0x32] - ldrh r3, [r7, 0x34] - adds r0, r1, 0 - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r2, [r0] - adds r1, 0x30 - lsls r1, 24 - lsrs r1, 23 - adds r1, r5 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r1, 0 - muls r0, r4 - cmp r0, 0 - bge _0816F51E - adds r0, 0xFF -_0816F51E: - lsls r0, 8 - lsrs r0, 16 - mov r8, r0 - lsls r0, r2, 16 - asrs r2, r0, 16 - negs r0, r2 - muls r0, r3 - cmp r0, 0 - bge _0816F532 - adds r0, 0xFF -_0816F532: - lsls r0, 8 - lsrs r0, 16 - mov r10, r0 - adds r0, r2, 0 - muls r0, r4 - cmp r0, 0 - bge _0816F542 - adds r0, 0xFF -_0816F542: - lsls r0, 8 - lsrs r5, r0, 16 - adds r0, r1, 0 - muls r0, r3 - cmp r0, 0 - bge _0816F550 - adds r0, 0xFF -_0816F550: - lsls r6, r0, 8 - lsrs r6, 16 - ldrh r0, [r7, 0x30] - lsls r0, 24 - lsrs r0, 24 - str r3, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetOamMatrix - ldrh r0, [r7, 0x30] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r5 - mov r1, r10 - lsls r5, r1, 16 - lsrs r3, r5, 16 - lsls r4, r6, 16 - str r6, [sp] - mov r1, r8 - mov r2, r9 - bl SetOamMatrix - ldrh r0, [r7, 0x30] - adds r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - lsls r5, 1 - lsrs r5, 16 - lsls r4, 1 - lsrs r4, 16 - str r4, [sp] - mov r1, r8 - mov r2, r9 - adds r3, r5, 0 - bl SetOamMatrix -_0816F59E: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F46C - - thumb_func_start sub_816F5B4 -sub_816F5B4: @ 816F5B4 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x3A] - adds r1, 0x40 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetOamMatrix - ldrh r0, [r4, 0x30] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x3A] - adds r1, 0x40 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetOamMatrix - ldrh r0, [r4, 0x30] - adds r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x3A] - adds r1, 0x40 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetOamMatrix - ldrh r1, [r4, 0x36] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r0, 0x40 - beq _0816F64C - adds r0, r1, 0 - subs r0, 0x8 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x36] - adds r1, r0, 0 - ldr r2, =gSineTable - adds r0, 0x40 - lsls r0, 24 - lsrs r0, 23 - adds r0, r2 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0 - bge _0816F62E - adds r0, 0x3F -_0816F62E: - asrs r0, 6 - strh r0, [r4, 0x24] - lsls r0, r1, 24 - lsrs r0, 23 - adds r0, r2 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _0816F642 - adds r0, 0x3F -_0816F642: - asrs r0, 6 - strh r0, [r4, 0x26] - b _0816F654 - .pool -_0816F64C: - movs r0, 0 - strh r0, [r4, 0x36] - ldr r0, =sub_816F660 - str r0, [r4, 0x1C] -_0816F654: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F5B4 - - thumb_func_start sub_816F660 -sub_816F660: @ 816F660 - push {r4,lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x2 - beq _0816F6C0 - ldrh r0, [r1, 0x36] - adds r0, 0x8 - strh r0, [r1, 0x36] - ldr r3, =gSineTable - lsls r0, 24 - lsrs r0, 23 - adds r0, r3 - movs r4, 0 - ldrsh r0, [r0, r4] - cmp r0, 0 - bge _0816F684 - adds r0, 0xF -_0816F684: - asrs r0, 4 - adds r0, 0x40 - lsls r0, 16 - lsrs r2, r0, 16 - adds r0, r2, 0 - adds r0, 0x40 - lsls r0, 24 - lsrs r0, 23 - adds r0, r3 - movs r4, 0 - ldrsh r0, [r0, r4] - cmp r0, 0 - bge _0816F6A0 - adds r0, 0x3F -_0816F6A0: - asrs r0, 6 - strh r0, [r1, 0x24] - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r3 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - bge _0816F6B4 - adds r0, 0x3F -_0816F6B4: - asrs r0, 6 - strh r0, [r1, 0x26] - b _0816F6C4 - .pool -_0816F6C0: - ldr r0, =sub_816F6D0 - str r0, [r1, 0x1C] -_0816F6C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F660 - - thumb_func_start sub_816F6D0 -sub_816F6D0: @ 816F6D0 - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x22] - movs r0, 0x22 - ldrsh r1, [r4, r0] - movs r3, 0x38 - ldrsh r0, [r4, r3] - cmp r1, r0 - bge _0816F6E8 - adds r0, r2, 0x4 - strh r0, [r4, 0x22] - b _0816F744 -_0816F6E8: - movs r0, 0x1 - strh r0, [r4, 0x3C] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r0, r3 - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0x3 - bl StartSpriteAnim - movs r0, 0x80 - lsls r0, 3 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x30] - movs r0, 0x3 - ands r0, r1 - lsls r0, 3 - strh r0, [r4, 0x34] - ldr r0, =sub_816F318 - str r0, [r4, 0x1C] - ldrb r1, [r4, 0x1] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - movs r1, 0xC0 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x2 - bl CalcCenterToCornerVec -_0816F744: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F6D0 - - thumb_func_start sub_816F750 -sub_816F750: @ 816F750 - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x22] - movs r0, 0x22 - ldrsh r1, [r4, r0] - movs r3, 0x38 - ldrsh r0, [r4, r3] - cmp r1, r0 - bge _0816F768 - adds r0, r2, 0x4 - strh r0, [r4, 0x22] - b _0816F7C4 -_0816F768: - movs r0, 0x1 - strh r0, [r4, 0x3C] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r0, r3 - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0x3 - bl StartSpriteAnim - movs r0, 0x80 - lsls r0, 3 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x30] - movs r0, 0x3 - ands r0, r1 - lsls r0, 3 - strh r0, [r4, 0x34] - ldr r0, =sub_816F318 - str r0, [r4, 0x1C] - ldrb r1, [r4, 0x1] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - movs r1, 0xC0 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x2 - bl CalcCenterToCornerVec -_0816F7C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F750 - - thumb_func_start sub_816F7D0 -sub_816F7D0: @ 816F7D0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r6, [sp, 0x34] - ldr r0, [sp, 0x38] - mov r8, r0 - lsls r4, 16 - lsls r5, 16 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x8] - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0xC] - lsls r6, 16 - lsrs r6, 16 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - ldr r0, =gUnknown_085E4D64 - lsrs r2, r4, 16 - mov r10, r2 - asrs r4, 16 - lsrs r1, r5, 16 - str r1, [sp, 0x4] - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =gSprites - mov r9, r2 - lsls r0, r7, 4 - adds r0, r7 - lsls r5, r0, 2 - adds r4, r5, r2 - movs r0, 0 - strh r0, [r4, 0x2E] - strh r0, [r4, 0x3C] - mov r0, sp - ldrh r0, [r0, 0xC] - strh r0, [r4, 0x30] - mov r1, sp - ldrh r1, [r1, 0x8] - strh r1, [r4, 0x32] - mov r2, sp - ldrh r2, [r2, 0x8] - strh r2, [r4, 0x34] - strh r6, [r4, 0x38] - mov r0, sp - ldrh r0, [r0, 0x8] - strh r0, [r4, 0x3A] - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x1F - ldr r1, [sp, 0xC] - ands r1, r0 - lsls r1, 1 - ldrb r2, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x2 - bl CalcCenterToCornerVec - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAnim - mov r1, r8 - cmp r1, 0 - bne _0816F898 - mov r0, r9 - adds r0, 0x1C - adds r0, r5, r0 - ldr r1, =sub_816F454 - b _0816F8A0 - .pool -_0816F898: - mov r0, r9 - adds r0, 0x1C - adds r0, r5, r0 - ldr r1, =sub_816F750 -_0816F8A0: - str r1, [r0] - str r7, [sp, 0x10] - mov r2, r10 - lsls r2, 16 - asrs r2, 16 - mov r10, r2 - ldr r0, [sp, 0x4] - lsls r0, 16 - asrs r0, 16 - mov r8, r0 - ldr r0, =gUnknown_085E4D64 - mov r1, r10 - mov r2, r8 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =gSprites - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r0, r4, r5 - mov r1, sp - ldrh r1, [r1, 0x10] - strh r1, [r0, 0x3C] - ldr r2, [sp, 0xC] - adds r2, 0x1 - mov r9, r2 - strh r2, [r0, 0x30] - ldrb r1, [r0, 0x1] - movs r2, 0x3 - orrs r1, r2 - strb r1, [r0, 0x1] - mov r2, r9 - movs r1, 0x1F - ands r2, r1 - lsls r2, 1 - ldrb r3, [r0, 0x3] - movs r6, 0x3F - negs r6, r6 - adds r1, r6, 0 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x3] - movs r1, 0 - movs r2, 0x2 - movs r3, 0x2 - bl CalcCenterToCornerVec - ldr r2, =gSprites + 0x1C - adds r4, r2 - ldr r0, =sub_816F3A4 - str r0, [r4] - ldr r0, =gUnknown_085E4D64 - mov r1, r10 - mov r2, r8 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r5, r4, r5 - mov r1, sp - ldrh r1, [r1, 0x10] - strh r1, [r5, 0x3C] - ldr r2, [sp, 0xC] - adds r2, 0x2 - mov r8, r2 - strh r2, [r5, 0x30] - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAnim - ldrb r0, [r5, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r5, 0x1] - mov r0, r8 - movs r2, 0x1F - ands r0, r2 - lsls r0, 1 - ldrb r1, [r5, 0x3] - ands r6, r1 - orrs r6, r0 - strb r6, [r5, 0x3] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x2 - bl CalcCenterToCornerVec - ldr r0, =gSprites + 0x1C - adds r4, r0 - ldr r1, =sub_816F3A4 - str r1, [r4] - ldr r2, [sp, 0xC] - lsls r0, r2, 24 - lsrs r0, 24 - ldr r5, [sp, 0x8] - adds r5, 0x20 - lsls r4, r5, 16 - lsrs r4, 16 - str r4, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetOamMatrix - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - str r4, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetOamMatrix - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r5, 17 - lsrs r5, 16 - str r5, [sp] - mov r0, r8 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetOamMatrix - ldr r0, [sp, 0x10] - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_816F7D0 - - thumb_func_start sub_816F9D4 -sub_816F9D4: @ 816F9D4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bhi _0816FA62 - lsls r0, 2 - ldr r1, =_0816F9F0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816F9F0: - .4byte _0816FA04 - .4byte _0816FA12 - .4byte _0816FA30 - .4byte _0816FA62 - .4byte _0816FA50 -_0816FA04: - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnimIfDifferent - ldrh r0, [r4, 0x20] - subs r0, 0x1 - b _0816FA60 -_0816FA12: - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnimIfDifferent - ldr r0, =gUnknown_030062A0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0816FAAA - ldrh r0, [r4, 0x20] - adds r0, 0x1 - b _0816FA60 - .pool -_0816FA30: - ldrh r2, [r4, 0x20] - movs r1, 0x20 - ldrsh r0, [r4, r1] - cmp r0, 0x78 - ble _0816FA46 - ldr r0, =gUnknown_030062A0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _0816FA6E -_0816FA46: - adds r0, r2, 0x1 - b _0816FA60 - .pool -_0816FA50: - ldrh r2, [r4, 0x20] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - ble _0816FA62 - subs r0, r2, 0x2 -_0816FA60: - strh r0, [r4, 0x20] -_0816FA62: - ldr r0, =gUnknown_030062A0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0816FAAA -_0816FA6E: - movs r1, 0x26 - ldrsh r5, [r4, r1] - cmp r5, 0 - beq _0816FA80 - movs r0, 0 - strh r0, [r4, 0x26] - b _0816FAAA - .pool -_0816FA80: - bl Random - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x1 - beq _0816FAA8 - cmp r1, 0x1 - bgt _0816FA96 - cmp r1, 0 - beq _0816FA9E - b _0816FAAA -_0816FA96: - cmp r1, 0x3 - bgt _0816FAAA - strh r5, [r4, 0x26] - b _0816FAAA -_0816FA9E: - ldr r0, =0x0000ffff - strh r0, [r4, 0x26] - b _0816FAAA - .pool -_0816FAA8: - strh r1, [r4, 0x26] -_0816FAAA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_816F9D4 - - thumb_func_start sub_816FAB0 -sub_816FAB0: @ 816FAB0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816FACA - cmp r0, 0x1 - ble _0816FB12 - cmp r0, 0x2 - beq _0816FAEA - cmp r0, 0x3 - beq _0816FB04 - b _0816FB12 -_0816FACA: - movs r2, 0x24 - ldrsh r0, [r4, r2] - movs r2, 0x20 - ldrsh r1, [r4, r2] - adds r0, r1 - ldr r1, =0x0000012f - cmp r0, r1 - bgt _0816FAE4 - ldrh r0, [r4, 0x24] - adds r0, 0x8 - b _0816FB10 - .pool -_0816FAE4: - movs r0, 0x2 - strh r0, [r4, 0x2E] - b _0816FB12 -_0816FAEA: - movs r1, 0x24 - ldrsh r0, [r4, r1] - movs r2, 0x20 - ldrsh r1, [r4, r2] - adds r0, r1 - cmp r0, 0x78 - ble _0816FAFE - ldrh r0, [r4, 0x24] - subs r0, 0x1 - b _0816FB10 -_0816FAFE: - movs r0, 0x3 - strh r0, [r4, 0x2E] - b _0816FB12 -_0816FB04: - ldrh r1, [r4, 0x24] - movs r2, 0x24 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _0816FB12 - subs r0, r1, 0x2 -_0816FB10: - strh r0, [r4, 0x24] -_0816FB12: - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x8 - bl Sin - ldr r1, =gUnknown_0203BCCC - ldrh r1, [r1] - subs r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x4 - strh r0, [r4, 0x30] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816FAB0 - - thumb_func_start sub_816FB38 -sub_816FB38: @ 816FB38 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x2E - ldrsh r0, [r6, r1] - cmp r0, 0x5 - bls _0816FB46 - b _0816FD38 -_0816FB46: - lsls r0, 2 - ldr r1, =_0816FB54 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816FB54: - .4byte _0816FB6C - .4byte _0816FB94 - .4byte _0816FBB4 - .4byte _0816FC5C - .4byte _0816FCC4 - .4byte _0816FCF4 -_0816FB6C: - ldrh r1, [r6, 0x30] - movs r2, 0x30 - ldrsh r0, [r6, r2] - cmp r0, 0 - beq _0816FB7C - subs r0, r1, 0x1 - strh r0, [r6, 0x30] - b _0816FD38 -_0816FB7C: - adds r2, r6, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - adds r0, r6, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - b _0816FCE6 -_0816FB94: - ldr r0, =gUnknown_030062A0 - ldr r0, [r0] - cmp r0, 0x90 - beq _0816FB9E - b _0816FD38 -_0816FB9E: - ldrh r0, [r6, 0x2E] - adds r0, 0x1 - strh r0, [r6, 0x2E] - movs r0, 0x9 - strh r0, [r6, 0x30] - movs r0, 0x2 - strh r0, [r6, 0x34] - b _0816FD38 - .pool -_0816FBB4: - ldrh r1, [r6, 0x34] - movs r2, 0x34 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _0816FC66 - movs r0, 0x2 - strh r0, [r6, 0x34] - movs r1, 0x30 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _0816FC14 - lsls r0, 1 - ldr r4, =gIntro1GameFreakTextFadePal - adds r0, r4 - ldr r5, =gPlttBufferFaded + 0x23E - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - movs r1, 0x30 - ldrsh r0, [r6, r1] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x20 - adds r0, r1 - adds r1, r5, 0 - subs r1, 0x16 - movs r2, 0x1 - bl CpuSet - movs r2, 0x30 - ldrsh r0, [r6, r2] - lsls r0, 1 - adds r4, 0x40 - adds r0, r4 - subs r5, 0xA - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r6, 0x30] - subs r0, 0x1 - strh r0, [r6, 0x30] - b _0816FD38 - .pool -_0816FC14: - movs r1, 0x30 - ldrsh r0, [r6, r1] - lsls r0, 1 - ldr r4, =gIntro1GameFreakTextFadePal - adds r0, r4 - ldr r5, =gPlttBufferFaded + 0x23E - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - movs r2, 0x30 - ldrsh r0, [r6, r2] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x20 - adds r0, r1 - adds r1, r5, 0 - subs r1, 0x16 - movs r2, 0x1 - bl CpuSet - movs r1, 0x30 - ldrsh r0, [r6, r1] - lsls r0, 1 - adds r4, 0x40 - adds r0, r4 - subs r5, 0xA - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - b _0816FCE6 - .pool -_0816FC5C: - ldrh r1, [r6, 0x34] - movs r2, 0x34 - ldrsh r0, [r6, r2] - cmp r0, 0 - beq _0816FC6C -_0816FC66: - subs r0, r1, 0x1 - strh r0, [r6, 0x34] - b _0816FD38 -_0816FC6C: - movs r0, 0x2 - strh r0, [r6, 0x34] - movs r1, 0x30 - ldrsh r0, [r6, r1] - cmp r0, 0x9 - bgt _0816FCE6 - lsls r0, 1 - ldr r4, =gIntro1GameFreakTextFadePal - adds r0, r4 - ldr r5, =gPlttBufferFaded + 0x23E - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - movs r1, 0x30 - ldrsh r0, [r6, r1] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x20 - adds r0, r1 - adds r1, r5, 0 - subs r1, 0x16 - movs r2, 0x1 - bl CpuSet - movs r2, 0x30 - ldrsh r0, [r6, r2] - lsls r0, 1 - adds r4, 0x40 - adds r0, r4 - subs r5, 0xA - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r6, 0x30] - adds r0, 0x1 - strh r0, [r6, 0x30] - b _0816FD38 - .pool -_0816FCC4: - ldr r0, =gUnknown_030062A0 - ldr r1, [r0] - movs r0, 0x88 - lsls r0, 1 - cmp r1, r0 - bne _0816FD38 - adds r0, r6, 0 - movs r1, 0x2 - bl StartSpriteAffineAnim - ldrb r1, [r6, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6, 0x1] -_0816FCE6: - ldrh r0, [r6, 0x2E] - adds r0, 0x1 - strh r0, [r6, 0x2E] - b _0816FD38 - .pool -_0816FCF4: - ldr r1, =gUnknown_085E4F48 - movs r2, 0x32 - ldrsh r0, [r6, r2] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - ldrh r1, [r6, 0x34] - adds r0, r1 - strh r0, [r6, 0x34] - movs r2, 0x34 - ldrsh r0, [r6, r2] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - asrs r0, 8 - strh r0, [r6, 0x24] - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0x3 - bgt _0816FD24 - movs r2, 0x24 - ldrsh r0, [r6, r2] - negs r0, r0 - strh r0, [r6, 0x24] -_0816FD24: - adds r0, r6, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0816FD38 - adds r0, r6, 0 - bl DestroySprite -_0816FD38: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816FB38 - - thumb_func_start sub_816FD44 -sub_816FD44: @ 816FD44 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816FD7C - cmp r0, 0x1 - bgt _0816FD5A - cmp r0, 0 - beq _0816FD60 - b _0816FDB0 -_0816FD5A: - cmp r0, 0x2 - beq _0816FD9C - b _0816FDB0 -_0816FD60: - ldr r0, =gUnknown_030062A0 - ldr r0, [r0] - cmp r0, 0x80 - bne _0816FDB0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - b _0816FD90 - .pool -_0816FD7C: - ldr r0, =gUnknown_030062A0 - ldr r1, [r0] - movs r0, 0x88 - lsls r0, 1 - cmp r1, r0 - bne _0816FDB0 - adds r0, r4, 0 - movs r1, 0x3 - bl StartSpriteAffineAnim -_0816FD90: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0816FDB0 - .pool -_0816FD9C: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0816FDB0 - adds r0, r4, 0 - bl DestroySprite -_0816FDB0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816FD44 - - thumb_func_start sub_816FDB8 -sub_816FDB8: @ 816FDB8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x4] - movs r7, 0 -_0816FDD2: - lsls r5, r7, 2 - ldr r0, =gUnknown_085E4E94 - adds r0, 0x2 - adds r0, r5, r0 - ldr r2, [sp] - lsls r1, r2, 16 - asrs r1, 16 - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - asrs r1, 16 - ldr r3, [sp, 0x4] - lsls r2, r3, 16 - asrs r0, r2, 16 - str r0, [sp, 0x8] - ldr r3, =0xfffc0000 - adds r2, r3 - ldr r0, =gUnknown_085E4F5C - asrs r2, 16 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r6, r0, 24 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - ldr r0, =gSprites - adds r4, r0 - movs r1, 0 - strh r1, [r4, 0x2E] - ldr r0, =gUnknown_085E4FA4 - adds r0, r7, r0 - ldrb r0, [r0] - strh r0, [r4, 0x30] - strh r7, [r4, 0x32] - adds r1, r4, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - mov r10, r2 - mov r3, r10 - orrs r0, r3 - strb r0, [r1] - adds r1, r7, 0 - adds r1, 0xC - movs r0, 0x1F - mov r9, r0 - mov r2, r9 - ands r1, r2 - lsls r1, 1 - ldrb r0, [r4, 0x3] - movs r3, 0x3F - negs r3, r3 - mov r8, r3 - mov r2, r8 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - ldr r3, =gUnknown_085E4E94 - adds r5, r3 - ldrb r1, [r5] - adds r0, r4, 0 - bl StartSpriteAnim - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAffineAnim - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x8 - bls _0816FDD2 - ldr r0, =gUnknown_085E4F8C - ldr r2, [sp, 0x8] - subs r2, 0x6 - lsls r2, 16 - asrs r2, 16 - movs r1, 0x78 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r2, 0 - strh r2, [r0, 0x2E] - adds r2, r0, 0 - adds r2, 0x3E - ldrb r1, [r2] - mov r3, r10 - orrs r1, r3 - strb r1, [r2] - adds r2, r7, 0 - adds r2, 0xC - mov r1, r9 - ands r2, r1 - lsls r2, 1 - ldrb r1, [r0, 0x3] - mov r3, r8 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x3] - movs r1, 0x1 - bl StartSpriteAffineAnim - adds r0, r6, 0 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_816FDB8 - - thumb_func_start sub_816FEDC -sub_816FEDC: @ 816FEDC - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0816FF48 - ldr r2, =gSineTable - ldrh r1, [r4, 0x32] - lsls r0, r1, 24 - lsrs r0, 23 - adds r0, r2 - ldrh r3, [r0] - adds r1, 0x40 - lsls r1, 24 - lsrs r1, 23 - adds r1, r2 - movs r2, 0 - ldrsh r0, [r1, r2] - movs r1, 0x30 - ldrsh r2, [r4, r1] - adds r1, r0, 0 - muls r1, r2 - adds r0, r1, 0 - cmp r1, 0 - bge _0816FF18 - adds r0, 0xFF -_0816FF18: - lsls r0, 8 - lsrs r6, r0, 16 - lsls r0, r3, 16 - asrs r3, r0, 16 - negs r0, r3 - muls r0, r2 - cmp r0, 0 - bge _0816FF2A - adds r0, 0xFF -_0816FF2A: - lsls r0, 8 - lsrs r5, r0, 16 - adds r0, r3, 0 - muls r0, r2 - cmp r0, 0 - bge _0816FF38 - adds r0, 0xFF -_0816FF38: - lsls r0, 8 - lsrs r2, r0, 16 - adds r1, r6, 0 - adds r3, r5, 0 - str r1, [sp] - movs r0, 0x1 - bl SetOamMatrix -_0816FF48: - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0x1 - beq _0816FF9C - cmp r0, 0x1 - ble _0816FF58 - cmp r0, 0x2 - beq _0816FFFE -_0816FF58: - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x3 - bl CalcCenterToCornerVec - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - movs r1, 0 - movs r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x80 - strh r0, [r4, 0x30] - strh r1, [r4, 0x32] - strh r1, [r4, 0x34] - b _08170038 - .pool -_0816FF9C: - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x8C - bl Sin - negs r0, r0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x78 - bl Sin - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x7 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x34] - adds r0, 0x3 - strh r0, [r4, 0x34] - movs r1, 0x20 - ldrsh r0, [r4, r1] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bgt _08170038 - ldrb r0, [r4, 0x5] - movs r1, 0xC - orrs r0, r1 - strb r0, [r4, 0x5] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x14 - strh r0, [r4, 0x20] - movs r0, 0x28 - strh r0, [r4, 0x22] - movs r0, 0x80 - lsls r0, 2 - strh r0, [r4, 0x30] - movs r0, 0 - strh r0, [r4, 0x32] - movs r0, 0x10 - b _08170036 -_0816FFFE: - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x22 - bl Sin - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3C - bl Cos - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x2 - strh r0, [r4, 0x30] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x5 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _08170038 - ldrh r0, [r4, 0x34] - adds r0, 0x1 -_08170036: - strh r0, [r4, 0x34] -_08170038: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_816FEDC - - thumb_func_start sub_8170040 -sub_8170040: @ 8170040 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08170056 - adds r4, r5, 0 - adds r4, 0x3E - cmp r0, 0x1 - beq _0817008E -_08170056: - adds r4, r5, 0 - adds r4, 0x3E - ldrb r1, [r4] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldrb r0, [r5, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r5, 0x1] - ldrb r1, [r5, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x24 - orrs r0, r1 - strb r0, [r5, 0x3] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x3 - bl CalcCenterToCornerVec - movs r0, 0 - strh r0, [r5, 0x30] - movs r0, 0x1 - strh r0, [r5, 0x2E] -_0817008E: - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081700A6 - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - b _081700BE -_081700A6: - ldrb r0, [r4] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - ldrh r1, [r5, 0x30] - movs r2, 0x30 - ldrsh r0, [r5, r2] - cmp r0, 0x3F - bgt _081700BE - adds r0, r1, 0x1 - strh r0, [r5, 0x30] -_081700BE: - ldr r1, =gSineTable - ldrh r0, [r5, 0x30] - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r0, 0x12 - movs r2, 0 - movs r3, 0 - bl SetOamMatrix - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170040 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/intro_credits_graphics.s b/asm/intro_credits_graphics.s deleted file mode 100644 index ad249a470..000000000 --- a/asm/intro_credits_graphics.s +++ /dev/null @@ -1,1077 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start load_intro_part2_graphics -load_intro_part2_graphics: @ 817B064 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_085F0740 - ldr r1, =0x06004000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0BC0 - ldr r1, =0x06007800 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F06E0 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - cmp r4, 0 - beq _0817B08C - cmp r4, 0x1 - beq _0817B0EC -_0817B08C: - ldr r0, =gUnknown_085F0DBC - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1398 - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0CFC - movs r1, 0 - movs r2, 0x60 - bl LoadPalette - ldr r0, =gUnknown_085F5064 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F1668 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl LoadPalette - bl sub_817B76C - b _0817B11E - .pool -_0817B0EC: - ldr r0, =gUnknown_085F1824 - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1EAC - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F17E4 - movs r1, 0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_085F50EC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F21B0 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl LoadPalette - bl sub_817B788 -_0817B11E: - ldr r1, =gUnknown_0203BD28 - movs r0, 0 - strh r0, [r1] - ldr r1, =gReservedSpritePaletteCount - movs r0, 0x8 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end load_intro_part2_graphics - - thumb_func_start sub_817B150 -sub_817B150: @ 817B150 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0817B162 - cmp r0, 0x1 - ble _0817B162 - cmp r0, 0x2 - beq _0817B194 -_0817B162: - ldr r1, =0x00000603 - movs r0, 0xE - bl SetGpuReg - ldr r1, =0x00000702 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00000f05 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xF2 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - b _0817B1B6 - .pool -_0817B194: - ldr r1, =0x00000603 - movs r0, 0xE - bl SetGpuReg - ldr r1, =0x00000702 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00000f05 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xF2 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg -_0817B1B6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B150 - - thumb_func_start sub_817B1C8 -sub_817B1C8: @ 817B1C8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_085F0740 - ldr r1, =0x06004000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0BC0 - ldr r1, =0x06007800 - bl LZ77UnCompVram - cmp r4, 0x4 - bhi _0817B214 - lsls r0, r4, 2 - ldr r1, =_0817B200 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0817B200: - .4byte _0817B214 - .4byte _0817B270 - .4byte _0817B2DC - .4byte _0817B2DC - .4byte _0817B334 -_0817B214: - ldr r0, =gUnknown_085F06E0 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_085F0DBC - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1398 - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0CFC - movs r1, 0 - movs r2, 0x60 - bl LoadPalette - ldr r0, =gUnknown_085F5064 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F16A8 - ldr r1, =0x06010000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1668 - b _0817B2A6 - .pool -_0817B270: - ldr r0, =gUnknown_085F0700 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_085F0DBC - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1398 - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0D5C - movs r1, 0 - movs r2, 0x60 - bl LoadPalette - ldr r0, =gUnknown_085F5064 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F16A8 - ldr r1, =0x06010000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1688 -_0817B2A6: - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl LoadPalette - bl sub_817B76C - b _0817B370 - .pool -_0817B2DC: - ldr r0, =gUnknown_085F0700 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_085F1824 - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1EAC - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r4, =gUnknown_085F1804 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_085F50EC - bl LoadCompressedObjectPic - movs r1, 0x80 - lsls r1, 1 - adds r0, r4, 0 - movs r2, 0x20 - bl LoadPalette - bl sub_817B788 - b _0817B370 - .pool -_0817B334: - ldr r0, =gUnknown_085F0720 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_085F235C - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F2568 - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F231C - movs r1, 0 - movs r2, 0x40 - bl LoadPalette - ldr r0, =gUnknown_085F5180 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F2548 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl LoadPalette - bl sub_817B7A4 -_0817B370: - ldr r1, =gReservedSpritePaletteCount - movs r0, 0x8 - strb r0, [r1] - ldr r1, =gUnknown_0203BD28 - movs r0, 0 - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B1C8 - - thumb_func_start sub_817B3A8 -sub_817B3A8: @ 817B3A8 - push {lr} - ldr r1, =0x00000603 - movs r0, 0xE - bl SetGpuReg - ldr r1, =0x00000702 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00000f05 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xFA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B3A8 - - thumb_func_start sub_817B3DC -sub_817B3DC: @ 817B3DC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - mov r8, r2 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 16 - lsrs r6, 16 - mov r0, r8 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r3, 16 - lsrs r3, 16 - ldr r1, =sub_817B458 - mov r9, r1 - mov r0, r9 - movs r1, 0 - str r3, [sp] - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - strh r5, [r0, 0x8] - strh r6, [r0, 0xA] - strh r2, [r0, 0xC] - strh r2, [r0, 0xE] - mov r1, r8 - strh r1, [r0, 0x10] - strh r2, [r0, 0x12] - strh r2, [r0, 0x14] - ldr r3, [sp] - strh r3, [r0, 0x16] - movs r1, 0x8 - strh r1, [r0, 0x18] - strh r2, [r0, 0x1A] - adds r0, r4, 0 - bl _call_via_r9 - adds r0, r4, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B3DC - - thumb_func_start sub_817B458 -sub_817B458: @ 817B458 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0xA] - lsls r2, r0, 16 - cmp r2, 0 - beq _0817B4A0 - movs r1, 0xC - ldrsh r0, [r4, r1] - lsls r0, 16 - ldrh r1, [r4, 0xE] - adds r1, r0, r1 - lsrs r0, r2, 12 - subs r1, r0 - asrs r0, r1, 16 - strh r0, [r4, 0xC] - strh r1, [r4, 0xE] - ldrh r1, [r4, 0xC] - movs r0, 0x14 - bl SetGpuReg - ldr r2, =gUnknown_0203BD24 - ldr r0, =gUnknown_0203BD26 - ldrh r1, [r0] - ldrh r2, [r2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x16 - bl SetGpuReg -_0817B4A0: - ldrh r0, [r4, 0x10] - lsls r2, r0, 16 - cmp r2, 0 - beq _0817B4FA - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r0, 16 - ldrh r1, [r4, 0x14] - adds r1, r0, r1 - lsrs r0, r2, 12 - subs r1, r0 - asrs r0, r1, 16 - strh r0, [r4, 0x12] - strh r1, [r4, 0x14] - ldrh r1, [r4, 0x12] - movs r0, 0x18 - bl SetGpuReg - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0817B4F0 - ldr r2, =gUnknown_0203BD24 - ldr r0, =gUnknown_0203BD26 - ldrh r1, [r0] - ldrh r2, [r2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1A - bl SetGpuReg - b _0817B4FA - .pool -_0817B4F0: - ldr r0, =gUnknown_0203BD24 - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg -_0817B4FA: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r2, r1, r0 - ldrh r0, [r2, 0x16] - lsls r3, r0, 16 - cmp r3, 0 - beq _0817B532 - movs r1, 0x18 - ldrsh r0, [r2, r1] - lsls r0, 16 - ldrh r1, [r2, 0x1A] - adds r1, r0, r1 - lsrs r0, r3, 12 - subs r1, r0 - asrs r0, r1, 16 - strh r0, [r2, 0x18] - strh r1, [r2, 0x1A] - ldrh r1, [r2, 0x18] - movs r0, 0x1C - bl SetGpuReg - ldr r0, =gUnknown_0203BD24 - ldrh r1, [r0] - movs r0, 0x1E - bl SetGpuReg -_0817B532: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B458 - - thumb_func_start sub_817B540 -sub_817B540: @ 817B540 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0817B620 - cmp r0, 0x1 - ble _0817B554 - cmp r0, 0x2 - beq _0817B5B8 -_0817B554: - ldr r0, =gMain - ldr r2, [r0, 0x20] - movs r0, 0x3 - ands r0, r2 - cmp r0, 0 - bne _0817B620 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817B620 - movs r0, 0x4 - ands r2, r0 - cmp r2, 0 - beq _0817B58C - ldr r2, =gPlttBufferUnfaded - ldrh r1, [r2, 0x12] - mov r0, sp - strh r1, [r0] - ldrh r1, [r2, 0x14] - b _0817B596 - .pool -_0817B58C: - ldr r2, =gPlttBufferUnfaded - ldrh r1, [r2, 0x14] - mov r0, sp - strh r1, [r0] - ldrh r1, [r2, 0x12] -_0817B596: - adds r0, 0x2 - strh r1, [r0] - adds r4, r0, 0 - mov r0, sp - movs r1, 0x9 - movs r2, 0x2 - bl LoadPalette - adds r0, r4, 0 - movs r1, 0xA - movs r2, 0x2 - bl LoadPalette - b _0817B620 - .pool -_0817B5B8: - ldr r0, =gMain - ldr r2, [r0, 0x20] - movs r0, 0x3 - ands r0, r2 - cmp r0, 0 - bne _0817B620 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817B620 - movs r0, 0x4 - ands r2, r0 - cmp r2, 0 - beq _0817B5F8 - mov r1, sp - ldr r2, =0x00003d27 - adds r0, r2, 0 - strh r0, [r1] - adds r1, 0x2 - ldr r2, =0x00000295 - b _0817B606 - .pool -_0817B5F8: - mov r1, sp - movs r2, 0xC7 - lsls r2, 2 - adds r0, r2, 0 - strh r0, [r1] - adds r1, 0x2 - ldr r2, =0x00003d27 -_0817B606: - adds r0, r2, 0 - strh r0, [r1] - adds r4, r1, 0 - mov r0, sp - movs r1, 0xC - movs r2, 0x2 - bl LoadPalette - adds r0, r4, 0 - movs r1, 0xD - movs r2, 0x2 - bl LoadPalette -_0817B620: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B540 - - thumb_func_start sub_817B62C -sub_817B62C: @ 817B62C - push {lr} - adds r2, r0, 0 - ldr r0, =gUnknown_0203BD28 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x2 - beq _0817B690 - cmp r0, 0 - beq _0817B64C - adds r0, r2, 0 - bl DestroySprite - b _0817B690 - .pool -_0817B64C: - movs r1, 0x20 - ldrsh r0, [r2, r1] - lsls r0, 16 - ldrh r1, [r2, 0x32] - orrs r0, r1 - ldrh r1, [r2, 0x30] - adds r0, r1 - asrs r1, r0, 16 - strh r1, [r2, 0x20] - strh r0, [r2, 0x32] - cmp r1, 0xFF - ble _0817B668 - ldr r0, =0x0000ffe0 - strh r0, [r2, 0x20] -_0817B668: - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0817B688 - ldr r1, =gUnknown_0203BD24 - ldr r0, =gUnknown_0203BD26 - ldrh r0, [r0] - ldrh r1, [r1] - adds r0, r1 - b _0817B68C - .pool -_0817B688: - ldr r0, =gUnknown_0203BD24 - ldrh r0, [r0] -_0817B68C: - negs r0, r0 - strh r0, [r2, 0x26] -_0817B690: - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B62C - - thumb_func_start sub_817B698 -sub_817B698: @ 817B698 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - str r1, [sp, 0x4] - str r2, [sp, 0x8] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - movs r7, 0 - cmp r7, r8 - bcs _0817B74E - ldr r0, =gSprites - mov r10, r0 - movs r2, 0x3F - mov r9, r2 -_0817B6C2: - lsls r6, r7, 3 - ldr r0, [sp, 0x4] - adds r6, r0 - ldrb r1, [r6, 0x1] - ldrb r2, [r6, 0x2] - ldrb r3, [r6, 0x3] - ldr r0, =gUnknown_085F504C - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - mov r2, r10 - adds r4, r5, r2 - ldrb r2, [r6] - lsls r1, r2, 26 - lsrs r1, 30 - lsrs r2, 6 - adds r0, r4, 0 - movs r3, 0 - bl CalcCenterToCornerVec - ldrb r3, [r4, 0x5] - movs r0, 0xC - orrs r3, r0 - strb r3, [r4, 0x5] - ldrb r1, [r6] - lsls r1, 26 - lsrs r1, 30 - lsls r1, 6 - ldrb r2, [r4, 0x1] - mov r0, r9 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r6] - lsrs r1, 6 - lsls r1, 6 - ldrb r2, [r4, 0x3] - mov r0, r9 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - movs r0, 0xF - ands r3, r0 - strb r3, [r4, 0x5] - ldr r0, =gSprites + 8 - adds r5, r0 - ldr r2, [sp, 0x8] - str r2, [r5] - ldrb r1, [r6] - lsls r1, 28 - lsrs r1, 28 - adds r0, r4, 0 - bl StartSpriteAnim - movs r1, 0 - mov r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x2E] - ldrh r0, [r6, 0x4] - strh r0, [r4, 0x30] - strh r1, [r4, 0x32] - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, r8 - bcc _0817B6C2 -_0817B74E: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B698 - - thumb_func_start sub_817B76C -sub_817B76C: @ 817B76C - push {lr} - ldr r1, =gUnknown_085F50A4 - ldr r2, =gUnknown_085F5094 - movs r0, 0 - movs r3, 0x9 - bl sub_817B698 - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B76C - - thumb_func_start sub_817B788 -sub_817B788: @ 817B788 - push {lr} - ldr r1, =gUnknown_085F5120 - ldr r2, =gUnknown_085F5114 - movs r0, 0x1 - movs r3, 0xC - bl sub_817B698 - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B788 - - thumb_func_start sub_817B7A4 -sub_817B7A4: @ 817B7A4 - push {lr} - ldr r1, =gUnknown_085F519C - ldr r2, =gUnknown_085F5198 - movs r0, 0x1 - movs r3, 0x6 - bl sub_817B698 - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B7A4 - - thumb_func_start nullsub_65 -nullsub_65: @ 817B7C0 - bx lr - thumb_func_end nullsub_65 - - thumb_func_start sub_817B7C4 -sub_817B7C4: @ 817B7C4 - push {r4,lr} - ldr r4, =gSprites - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r1, [r1] - movs r2, 0x3E - adds r2, r0 - mov r12, r2 - movs r2, 0x4 - ands r2, r1 - mov r1, r12 - ldrb r3, [r1] - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x20] - strh r1, [r0, 0x20] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x24] - strh r1, [r0, 0x24] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x26] - strh r1, [r0, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B7C4 - - thumb_func_start sub_817B834 -sub_817B834: @ 817B834 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldr r0, =gUnknown_085F51EC - lsls r5, 16 - asrs r5, 16 - lsls r4, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x2 - bl CreateSprite - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_085F523C - adds r4, 0x8 - lsls r4, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x3 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - strh r6, [r1, 0x2E] - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B834 - - thumb_func_start sub_817B88C -sub_817B88C: @ 817B88C - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldr r0, =gUnknown_085F5204 - lsls r5, 16 - asrs r5, 16 - lsls r4, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x2 - bl CreateSprite - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_085F5254 - adds r4, 0x8 - lsls r4, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x3 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - strh r6, [r1, 0x2E] - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B88C - - thumb_func_start nullsub_66 -nullsub_66: @ 817B8E4 - bx lr - thumb_func_end nullsub_66 - - thumb_func_start sub_817B8E8 -sub_817B8E8: @ 817B8E8 - push {r4,lr} - ldr r4, =gSprites - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r1, [r1] - movs r2, 0x3E - adds r2, r0 - mov r12, r2 - movs r2, 0x4 - ands r2, r1 - mov r1, r12 - ldrb r3, [r1] - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x22] - strh r1, [r0, 0x22] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x24] - strh r1, [r0, 0x24] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x26] - strh r1, [r0, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B8E8 - - thumb_func_start sub_817B948 -sub_817B948: @ 817B948 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r2, r0, 0 - adds r5, r1, 0 - ldr r0, =gUnknown_085F528C - mov r8, r0 - lsls r2, 16 - asrs r4, r2, 16 - ldr r0, =0xffe00000 - adds r2, r0 - asrs r2, 16 - lsls r5, 16 - asrs r5, 16 - mov r0, r8 - adds r1, r2, 0 - adds r2, r5, 0 - movs r3, 0x5 - bl CreateSprite - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - adds r4, 0x20 - lsls r4, 16 - asrs r4, 16 - mov r0, r8 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x6 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gSprites - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r0, r4, r5 - strh r6, [r0, 0x2E] - movs r1, 0x1 - bl StartSpriteAnim - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_817B8E8 - str r0, [r4] - adds r0, r6, 0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B948 - - thumb_func_start sub_817B9C4 -sub_817B9C4: @ 817B9C4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r2, r0, 0 - adds r5, r1, 0 - ldr r0, =gUnknown_085F52A4 - mov r8, r0 - lsls r2, 16 - asrs r4, r2, 16 - ldr r0, =0xffe00000 - adds r2, r0 - asrs r2, 16 - lsls r5, 16 - asrs r5, 16 - mov r0, r8 - adds r1, r2, 0 - adds r2, r5, 0 - movs r3, 0x5 - bl CreateSprite - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - adds r4, 0x20 - lsls r4, 16 - asrs r4, 16 - mov r0, r8 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x6 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gSprites - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r0, r4, r5 - strh r6, [r0, 0x2E] - movs r1, 0x1 - bl StartSpriteAnim - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_817B8E8 - str r0, [r4] - adds r0, r6, 0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B9C4 - - .align 2, 0 @ Don't pad with nop. diff --git a/common_syms/intro.txt b/common_syms/intro.txt new file mode 100644 index 000000000..d069b1014 --- /dev/null +++ b/common_syms/intro.txt @@ -0,0 +1,2 @@ +gIntroFrameCounter +gMultibootProgramStruct diff --git a/data/credits.s b/data/credits.s deleted file mode 100644 index a5c0837d1..000000000 --- a/data/credits.s +++ /dev/null @@ -1,1577 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - .align 2 -gUnknown_085E56F0:: @ 85E56F0 - .incbin "graphics/credits/credits_1.gbapal" - .incbin "graphics/credits/credits_2.gbapal" - .incbin "graphics/credits/credits_3.gbapal" - .incbin "graphics/credits/credits_4.gbapal" - - .align 2 -gUnknown_085E5770:: @ 85E5770 - .incbin "graphics/credits/the_end_copyright.4bpp.lz" - -gUnknown_085E5BAC:: @ 85E5BAC - .byte 0x00, 0x01, 0x00, 0xff, 0x01, 0xff, 0xff, 0x01, 0xff, 0xff, 0x01, 0xff, 0xff, 0x01, 0xff - -gUnknown_085E5BBB:: @ 85E5BBB - .byte 0x01, 0xff, 0x01, 0x01, 0xff, 0x01, 0x01, 0x02, 0x01, 0x01, 0xff, 0x01, 0x01, 0xff, 0x01 - -gUnknown_085E5BCA:: @ 85E5BCA - .byte 0x01, 0x00, 0x00, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x01, 0xff, 0xff, 0x01, 0x80, 0x80 - -gUnknown_085E5BD9:: @ 85E5BD9 - .byte 0x01, 0x03, 0x01, 0x01, 0x04, 0x01, 0x01, 0x05, 0x01, 0x01, 0xc4, 0x01, 0x01, 0xc3, 0x01 - -gUnknown_085E5BE8:: @ 85E5BE8 - .byte 0x01, 0x06, 0x07, 0x01, 0x08, 0x09, 0x01, 0xff, 0x01, 0x01, 0x88, 0x89, 0x01, 0x86, 0x87 - -gCreditsText_EmptyString:: @ 85E5BF7 - .string "$" - -gCreditsText_PkmnEmeraldVersion:: @ 85E5BF8 - .string "POKéMON EMERALD VERSION$" - -gCreditsText_Credits:: @ 85E5C10 - .string "Credits$" - -gCreditsText_ExecutiveDirector:: @ 85E5C18 - .string "Executive Director$" - -gCreditsText_Director:: @ 85E5C2B - .string "Director$" - -gCreditsText_ArtDirector:: @ 85E5C34 - .string "Art Director$" - -gCreditsText_BattleDirector:: @ 85E5C41 - .string "Battle Director$" - -gCreditsText_MainProgrammer:: @ 85E5C51 - .string "Main Programmer$" - -gCreditsText_BattleSystemPgrms:: @ 85E5C61 - .string "Battle System Programmers$" - -gCreditsText_FieldSystemPgrms:: @ 85E5C7B - .string "Field System Programmer$" - -gCreditsText_Programmers:: @ 85E5C93 - .string "Programmers$" - -gCreditsText_MainGraphicDesigner:: @ 85E5C9F - .string "Main Graphic Designer$" - -gCreditsText_GraphicDesigners:: @ 85E5CB5 - .string "Graphic Designers$" - -gCreditsText_PkmnDesigners:: @ 85E5CC7 - .string "POKéMON Designers$" - -gCreditsText_MusicComposition:: @ 85E5CD9 - .string "Music Composition$" - -gCreditsText_SoundEffectsAndPkmnVoices:: @ 85E5CEB - .string "Sound Effects & POKéMON Voices$" - -gCreditsText_GameDesigners:: @ 85E5D0A - .string "Game Designers$" - -gCreditsText_ScenarioPlot:: @ 85E5D19 - .string "Scenario Plot$" - -gCreditsText_Scenario:: @ 85E5D27 - .string "Scenario$" - -gCreditsText_ScriptDesigners:: @ 85E5D30 - .string "Script Designers$" - -gCreditsText_MapDesigners:: @ 85E5D41 - .string "Map Designers$" - -gCreditsText_MapDataDesigners:: @ 85E5D4F - .string "Map Data Designers$" - -gCreditsText_ParametricDesigners:: @ 85E5D62 - .string "Parametric Designers$" - -gCreditsText_PokedexText:: @ 85E5D77 - .string "POKéDEX Text$" - -gCreditsText_EnvAndToolPgrms:: @ 85E5D84 - .string "Environment & Tool Programmers$" - -gCreditsText_NCLProductTesting:: @ 85E5DA3 - .string "NCL Product Testing$" - -gCreditsText_SpecialThanks:: @ 85E5DB7 - .string "Special Thanks$" - -gCreditsText_Coordinators:: @ 85E5DC6 - .string "Coordinators$" - -gCreditsText_Producers:: @ 85E5DD3 - .string "Producers$" - -gCreditsText_ExecProducers:: @ 85E5DDD - .string "Executive Producers$" - -gCreditsText_InfoSupervisors:: @ 85E5DF1 - .string "Information Supervisors$" - -gCreditsText_TaskManagers:: @ 85E5E09 - .string "Task Managers$" - -gCreditsText_BrailleCodeCheck:: @ 85E5E17 - .string "Braille Code Check$" - -gCreditsText_WorldDirector:: @ 85E5E2A - .string "World Director$" - -gCreditsText_BattleFrontierData:: @ 85E5E39 - .string "Battle Frontier Data$" - -gCreditsText_SupportProgrammers:: @ 85E5E4E - .string "Support Programmers$" - -gCreditsText_Artwork:: @ 85E5E62 - .string "Artwork$" - -gCreditsText_LeadProgrammer:: @ 85E5E6A - .string "Lead Programmer$" - -gCreditsText_LeadGraphicArtist:: @ 85E5E7A - .string "Lead Graphic Artist$" - -gCreditsText_SatoshiTajiri:: @ 85E5E8E - .string "Satoshi Tajiri$" - -gCreditsText_JunichiMasuda:: @ 85E5E9D - .string "Junichi Masuda$" - -gCreditsText_KenSugimori:: @ 85E5EAC - .string "Ken Sugimori$" - -gCreditsText_ShigekiMorimoto:: @ 85E5EB9 - .string "Shigeki Morimoto$" - -gCreditsText_TetsuyaWatanabe:: @ 85E5ECA - .string "Tetsuya Watanabe$" - -gCreditsText_HisashiSogabe:: @ 85E5EDB - .string "Hisashi Sogabe$" - -gCreditsText_SosukeTamada:: @ 85E5EEA - .string "Sosuke Tamada$" - -gCreditsText_AkitoMori:: @ 85E5EF8 - .string "Akito Mori$" - -gCreditsText_KeitaKagaya:: @ 85E5F03 - .string "Keita Kagaya$" - -gCreditsText_YoshinoriMatsuda:: @ 85E5F10 - .string "Yoshinori Matsuda$" - -gCreditsText_HiroyukiNakamura:: @ 85E5F22 - .string "Hiroyuki Nakamura$" - -gCreditsText_MasaoTaya:: @ 85E5F34 - .string "Masao Taya$" - -gCreditsText_SatoshiNohara:: @ 85E5F3F - .string "Satoshi Nohara$" - -gCreditsText_TomomichiOhta:: @ 85E5F4E - .string "Tomomichi Ohta$" - -gCreditsText_MiyukiIwasawa:: @ 85E5F5D - .string "Miyuki Iwasawa$" - -gCreditsText_TakenoriOhta:: @ 85E5F6C - .string "Takenori Ohta$" - -gCreditsText_HironobuYoshida:: @ 85E5F7A - .string "Hironobu Yoshida$" - -gCreditsText_MotofumiFujiwara:: @ 85E5F8B - .string "Motofumi Fujiwara$" - -gCreditsText_SatoshiOhta:: @ 85E5F9D - .string "Satoshi Ohta$" - -gCreditsText_AsukaIwashita:: @ 85E5FAA - .string "Asuka Iwashita$" - -gCreditsText_AimiTomita:: @ 85E5FB9 - .string "Aimi Tomita$" - -gCreditsText_TakaoUnno:: @ 85E5FC5 - .string "Takao Unno$" - -gCreditsText_KanakoEo:: @ 85E5FD0 - .string "Kanako Eo$" - -gCreditsText_JunOkutani:: @ 85E5FDA - .string "Jun Okutani$" - -gCreditsText_AtsukoNishida:: @ 85E5FE6 - .string "Atsuko Nishida$" - -gCreditsText_MuneoSaito:: @ 85E5FF5 - .string "Muneo Saito$" - -gCreditsText_RenaYoshikawa:: @ 85E6001 - .string "Rena Yoshikawa$" - -gCreditsText_GoIchinose:: @ 85E6010 - .string "Go Ichinose$" - -gCreditsText_MorikazuAoki:: @ 85E601C - .string "Morikazu Aoki$" - -gCreditsText_KojiNishino:: @ 85E602A - .string "Koji Nishino$" - -gCreditsText_KenjiMatsushima:: @ 85E6037 - .string "Kenji Matsushima$" - -gCreditsText_TetsujiOhta:: @ 85E6048 - .string "Tetsuji Ohta$" - -gCreditsText_HitomiSato:: @ 85E6055 - .string "Hitomi Sato$" - -gCreditsText_TakeshiKawachimaru:: @ 85E6061 - .string "Takeshi Kawachimaru$" - -gCreditsText_TeruyukiShimoyamada:: @ 85E6075 - .string "Teruyuki Shimoyamada$" - -gCreditsText_ShigeruOhmori:: @ 85E608A - .string "Shigeru Ohmori$" - -gCreditsText_TadashiTakahashi:: @ 85E6099 - .string "Tadashi Takahashi$" - -gCreditsText_ToshinobuMatsumiya:: @ 85E60AB - .string "Toshinobu Matsumiya$" - -gCreditsText_AkihitoTomisawa:: @ 85E60BF - .string "Akihito Tomisawa$" - -gCreditsText_HirokiEnomoto:: @ 85E60D0 - .string "Hiroki Enomoto$" - -gCreditsText_KazuyukiTerada:: @ 85E60DF - .string "Kazuyuki Terada$" - -gCreditsText_YuriSakurai:: @ 85E60EF - .string "Yuri Sakurai$" - -gCreditsText_HiromiSagawa:: @ 85E60FC - .string "Hiromi Sagawa$" - -gCreditsText_KenjiTominaga:: @ 85E610A - .string "Kenji Tominaga$" - -gCreditsText_YoshioTajiri:: @ 85E6119 - .string "Yoshio Tajiri$" - -gCreditsText_TeikoSasaki:: @ 85E6127 - .string "Teiko Sasaki$" - -gCreditsText_SachikoHamano:: @ 85E6134 - .string "Sachiko Hamano$" - -gCreditsText_ChieMatsumiya:: @ 85E6143 - .string "Chie Matsumiya$" - -gCreditsText_AkikoShinozaki:: @ 85E6152 - .string "Akiko Shinozaki$" - -gCreditsText_AstukoFujii:: @ 85E6162 - .string "Astuko Fujii$" - -gCreditsText_NozomuSaito:: @ 85E616F - .string "Nozomu Saito$" - -gCreditsText_KenkichiToyama:: @ 85E617C - .string "Kenkichi Toyama$" - -gCreditsText_SuguruNakatsui:: @ 85E618C - .string "Suguru Nakatsui$" - -gCreditsText_YumiFunasaka:: @ 85E619C - .string "Yumi Funasaka$" - -gCreditsText_NaokoYanase:: @ 85E61AA - .string "Naoko Yanase$" - -gCreditsText_NCLSuperMarioClub:: @ 85E61B7 - .string "NCL Super Mario Club$" - -gCreditsText_AtsushiTada:: @ 85E61CC - .string "Atsushi Tada$" - -gCreditsText_TakahiroOhnishi:: @ 85E61D9 - .string "Takahiro Ohnishi$" - -gCreditsText_NorihideOkamura:: @ 85E61EA - .string "Norihide Okamura$" - -gCreditsText_HiroNakamura:: @ 85E61FB - .string "Hiro Nakamura$" - -gCreditsText_HiroyukiUesugi:: @ 85E6209 - .string "Hiroyuki Uesugi$" - -gCreditsText_TerukiMurakawa:: @ 85E6219 - .string "Teruki Murakawa$" - -gCreditsText_AkiraKinashi:: @ 85E6229 - .string "Akira Kinashi$" - -gCreditsText_MichikoTakizawa:: @ 85E6237 - .string "Michiko Takizawa$" - -gCreditsText_MakikoTakada:: @ 85E6248 - .string "Makiko Takada$" - -gCreditsText_TakanaoKondo:: @ 85E6256 - .string "Takanao Kondo$" - -gCreditsText_AiMashima:: @ 85E6264 - .string "Ai Mashima$" - -gCreditsText_GakujiNomoto:: @ 85E626F - .string "Gakuji Nomoto$" - -gCreditsText_TakehiroIzushi:: @ 85E627D - .string "Takehiro Izushi$" - -gCreditsText_HitoshiYamagami:: @ 85E628D - .string "Hitoshi Yamagami$" - -gCreditsText_KyokoWatanabe:: @ 85E629E - .string "Kyoko Watanabe$" - -gCreditsText_TakaoNakano:: @ 85E62AD - .string "Takao Nakano$" - -gCreditsText_HiroyukiJinnai:: @ 85E62BA - .string "Hiroyuki Jinnai$" - -gCreditsText_HiroakiTsuru:: @ 85E62CA - .string "Hiroaki Tsuru$" - -gCreditsText_TsunekazIshihara:: @ 85E62D8 - .string "Tsunekaz Ishihara$" - -gCreditsText_SatoruIwata:: @ 85E62EA - .string "Satoru Iwata$" - -gCreditsText_KazuyaSuyama:: @ 85E62F7 - .string "Kazuya Suyama$" - -gCreditsText_SatoshiMitsuhara:: @ 85E6305 - .string "Satoshi Mitsuhara$" - -gCreditsText_JapanBrailleLibrary:: @ 85E6317 - .string "Japan Braille Library$" - -gCreditsText_TomotakaKomura:: @ 85E632D - .string "Tomotaka Komura$" - -gCreditsText_MikikoOhhashi:: @ 85E633D - .string "Mikiko Ohhashi$" - -gCreditsText_DaisukeHoshino:: @ 85E634C - .string "Daisuke Hoshino$" - -gCreditsText_KenjiroIto:: @ 85E635C - .string "Kenjiro Ito$" - -gCreditsText_RuiKawaguchi:: @ 85E6368 - .string "Rui Kawaguchi$" - -gCreditsText_ShunsukeKohori:: @ 85E6376 - .string "Shunsuke Kohori$" - -gCreditsText_SachikoNakamichi:: @ 85E6386 - .string "Sachiko Nakamichi$" - -gCreditsText_FujikoNomura:: @ 85E6398 - .string "Fujiko Nomura$" - -gCreditsText_KazukiYoshihara:: @ 85E63A6 - .string "Kazuki Yoshihara$" - -gCreditsText_RetsujiNomoto:: @ 85E63B7 - .string "Retsuji Nomoto$" - -gCreditsText_AzusaTajima:: @ 85E63C6 - .string "Azusa Tajima$" - -gCreditsText_ShusakuEgami:: @ 85E63D3 - .string "Shusaku Egami$" - -gCreditsText_PackageAndManual:: @ 85E63E1 - .string "Package & Manual Illustration$" - -gCreditsText_EnglishVersion:: @ 85E63FF - .string "English Version Coordinators$" - -gCreditsText_Translator:: @ 85E641C - .string "Translator$" - -gCreditsText_TextEditor:: @ 85E6427 - .string "Text Editor$" - -gCreditsText_NCLCoordinator:: @ 85E6433 - .string "NCL Coordinator$" - -gCreditsText_GraphicDesigner:: @ 85E6443 - .string "Graphic Designer$" - -gCreditsText_NOAProductTesting:: @ 85E6454 - .string "NOA Product Testing$" - -gCreditsText_HideyukiNakajima:: @ 85E6468 - .string "Hideyuki Nakajima$" - -gCreditsText_HidenoriSaeki:: @ 85E647A - .string "Hidenori Saeki$" - -gCreditsText_YokoWatanabe:: @ 85E6489 - .string "Yoko Watanabe$" - -gCreditsText_SakaeKimura:: @ 85E6497 - .string "Sakae Kimura$" - -gCreditsText_ChiakiShinkai:: @ 85E64A4 - .string "Chiaki Shinkai$" - -gCreditsText_SethMcMahill:: @ 85E64B3 - .string "Seth McMahill$" - -gCreditsText_NobOgasawara:: @ 85E64C1 - .string "Nob Ogasawara$" - -gCreditsText_TeresaLillygren:: @ 85E64CF - .string "Teresa Lillygren$" - -gCreditsText_KimikoNakamichi:: @ 85E64E0 - .string "Kimiko Nakamichi$" - -gCreditsText_SouichiYamamoto:: @ 85E64F1 - .string "Souichi Yamamoto$" - -gCreditsText_YuichiroIto:: @ 85E6502 - .string "Yuichiro Ito$" - -gCreditsText_ThomasHertzog:: @ 85E650F - .string "Thomas Hertzog$" - -gCreditsText_MikaKurosawa:: @ 85E651E - .string "Mika Kurosawa$" - -gCreditsText_NationalFederationBlind:: @ 85E652C - .string "National Federation of the Blind$" - -gCreditsText_PatriciaAMaurer:: @ 85E654D - .string "Patricia A. Maurer$" - -gCreditsText_EuropeanBlindUnion:: @ 85E6560 - .string "European Blind Union$" - -gCreditsText_AustralianBrailleAuthority:: @ 85E6575 - .string "Australian Braille Authority$" - -gCreditsText_RoyalNewZealandFederationBlind:: @ 85E6592 - .string "Royal New Zealand Federation for the Blind$" - -gCreditsText_MotoyasuTojima:: @ 85E65BD - .string "Motoyasu Tojima$" - -gCreditsText_NicolaPrattBarlow:: @ 85E65CD - .string "Nicola Pratt-Barlow$" - -gCreditsText_ShellieDow:: @ 85E65E1 - .string "Shellie Dow$" - -gCreditsText_ErikJohnson:: @ 85E65ED - .string "Erik Johnson$" - - .align 2 -gCreditsEntry_EmptyString:: @ 85E65FC - .4byte 0x00000000, gCreditsText_EmptyString - - .align 2 -gCreditsEntry_PkmnEmeraldVersion:: @ 85E6604 - .4byte 0x00000107, gCreditsText_PkmnEmeraldVersion - - .align 2 -gCreditsEntry_Credits:: @ 85E660C - .4byte 0x0000010b, gCreditsText_Credits - - .align 2 -gCreditsEntry_ExecutiveDirector:: @ 85E6614 - .4byte 0x00000108, gCreditsText_ExecutiveDirector - - .align 2 -gCreditsEntry_Director:: @ 85E661C - .4byte 0x0000010c, gCreditsText_Director - - .align 2 -gCreditsEntry_ArtDirector:: @ 85E6624 - .4byte 0x0000010a, gCreditsText_ArtDirector - - .align 2 -gCreditsEntry_BattleDirector:: @ 85E662C - .4byte 0x0000010a, gCreditsText_BattleDirector - - .align 2 -gCreditsEntry_MainProgrammer:: @ 85E6634 - .4byte 0x0000010a, gCreditsText_MainProgrammer - - .align 2 -gCreditsEntry_BattleSystemPgrms:: @ 85E663C - .4byte 0x00000108, gCreditsText_BattleSystemPgrms - - .align 2 -gCreditsEntry_FieldSystemPgrms:: @ 85E6644 - .4byte 0x00000107, gCreditsText_FieldSystemPgrms - - .align 2 -gCreditsEntry_Programmers:: @ 85E664C - .4byte 0x0000010c, gCreditsText_Programmers - - .align 2 -gCreditsEntry_MainGraphicDesigner:: @ 85E6654 - .4byte 0x00000107, gCreditsText_MainGraphicDesigner - - .align 2 -gCreditsEntry_GraphicDesigners:: @ 85E665C - .4byte 0x00000109, gCreditsText_GraphicDesigners - - .align 2 -gCreditsEntry_PkmnDesigners:: @ 85E6664 - .4byte 0x0000010a, gCreditsText_PkmnDesigners - - .align 2 -gCreditsEntry_MusicComposition:: @ 85E666C - .4byte 0x0000010d, gCreditsText_MusicComposition - - .align 2 -gCreditsEntry_SoundEffectsAndPkmnVoices:: @ 85E6674 - .4byte 0x00000104, gCreditsText_SoundEffectsAndPkmnVoices - - .align 2 -gCreditsEntry_GameDesigners:: @ 85E667C - .4byte 0x0000010b, gCreditsText_GameDesigners - - .align 2 -gCreditsEntry_ScenarioPlot:: @ 85E6684 - .4byte 0x0000010b, gCreditsText_ScenarioPlot - - .align 2 -gCreditsEntry_Scenario:: @ 85E668C - .4byte 0x0000010d, gCreditsText_Scenario - - .align 2 -gCreditsEntry_ScriptDesigners:: @ 85E6694 - .4byte 0x0000010a, gCreditsText_ScriptDesigners - - .align 2 -gCreditsEntry_MapDesigners:: @ 85E669C - .4byte 0x0000010b, gCreditsText_MapDesigners - - .align 2 -gCreditsEntry_MapDataDesigners:: @ 85E66A4 - .4byte 0x00000109, gCreditsText_MapDataDesigners - - .align 2 -gCreditsEntry_ParametricDesigners:: @ 85E66AC - .4byte 0x00000109, gCreditsText_ParametricDesigners - - .align 2 -gCreditsEntry_PokedexText:: @ 85E66B4 - .4byte 0x0000010b, gCreditsText_PokedexText - - .align 2 -gCreditsEntry_EnvAndToolPgrms:: @ 85E66BC - .4byte 0x00000106, gCreditsText_EnvAndToolPgrms - - .align 2 -gCreditsEntry_NCLProductTesting:: @ 85E66C4 - .4byte 0x0000010b, gCreditsText_NCLProductTesting - - .align 2 -gCreditsEntry_SpecialThanks:: @ 85E66CC - .4byte 0x0000010a, gCreditsText_SpecialThanks - - .align 2 -gCreditsEntry_Coordinators:: @ 85E66D4 - .4byte 0x0000010b, gCreditsText_Coordinators - - .align 2 -gCreditsEntry_Producers:: @ 85E66DC - .4byte 0x0000010b, gCreditsText_Producers - - .align 2 -gCreditsEntry_ExecProducers:: @ 85E66E4 - .4byte 0x00000107, gCreditsText_ExecProducers - - .align 2 -gCreditsEntry_InfoSupervisors:: @ 85E66EC - .4byte 0x0000010a, gCreditsText_InfoSupervisors - - .align 2 -gCreditsEntry_TaskManagers:: @ 85E66F4 - .4byte 0x00000108, gCreditsText_TaskManagers - - .align 2 -gCreditsEntry_BrailleCodeCheck:: @ 85E66FC - .4byte 0x0000010a, gCreditsText_BrailleCodeCheck - - .align 2 -gCreditsEntry_WorldDirector:: @ 85E6704 - .4byte 0x0000010a, gCreditsText_WorldDirector - - .align 2 -gCreditsEntry_BattleFrontierData:: @ 85E670C - .4byte 0x00000108, gCreditsText_BattleFrontierData - - .align 2 -gCreditsEntry_SupportProgrammers:: @ 85E6714 - .4byte 0x0000010a, gCreditsText_SupportProgrammers - - .align 2 -gCreditsEntry_Artwork:: @ 85E671C - .4byte 0x0000010c, gCreditsText_Artwork - - .align 2 -gCreditsEntry_LeadProgrammer:: @ 85E6724 - .4byte 0x0000010a, gCreditsText_LeadProgrammer - - .align 2 -gCreditsEntry_LeadGraphicArtist:: @ 85E672C - .4byte 0x00000109, gCreditsText_LeadGraphicArtist - - .align 2 -gCreditsEntry_SatoshiTajiri:: @ 85E6734 - .4byte 0x0000000b, gCreditsText_SatoshiTajiri - - .align 2 -gCreditsEntry_JunichiMasuda:: @ 85E673C - .4byte 0x0000000b, gCreditsText_JunichiMasuda - - .align 2 -gCreditsEntry_KenSugimori:: @ 85E6744 - .4byte 0x0000000b, gCreditsText_KenSugimori - - .align 2 -gCreditsEntry_ShigekiMorimoto:: @ 85E674C - .4byte 0x0000000b, gCreditsText_ShigekiMorimoto - - .align 2 -gCreditsEntry_TetsuyaWatanabe:: @ 85E6754 - .4byte 0x0000000b, gCreditsText_TetsuyaWatanabe - - .align 2 -gCreditsEntry_HisashiSogabe:: @ 85E675C - .4byte 0x0000000b, gCreditsText_HisashiSogabe - - .align 2 -gCreditsEntry_SosukeTamada:: @ 85E6764 - .4byte 0x0000000b, gCreditsText_SosukeTamada - - .align 2 -gCreditsEntry_AkitoMori:: @ 85E676C - .4byte 0x0000000b, gCreditsText_AkitoMori - - .align 2 -gCreditsEntry_KeitaKagaya:: @ 85E6774 - .4byte 0x0000000b, gCreditsText_KeitaKagaya - - .align 2 -gCreditsEntry_YoshinoriMatsuda:: @ 85E677C - .4byte 0x0000000b, gCreditsText_YoshinoriMatsuda - - .align 2 -gCreditsEntry_HiroyukiNakamura:: @ 85E6784 - .4byte 0x0000000b, gCreditsText_HiroyukiNakamura - - .align 2 -gCreditsEntry_MasaoTaya:: @ 85E678C - .4byte 0x0000000b, gCreditsText_MasaoTaya - - .align 2 -gCreditsEntry_SatoshiNohara:: @ 85E6794 - .4byte 0x0000000b, gCreditsText_SatoshiNohara - - .align 2 -gCreditsEntry_TomomichiOhta:: @ 85E679C - .4byte 0x0000000b, gCreditsText_TomomichiOhta - - .align 2 -gCreditsEntry_MiyukiIwasawa:: @ 85E67A4 - .4byte 0x0000000b, gCreditsText_MiyukiIwasawa - - .align 2 -gCreditsEntry_TakenoriOhta:: @ 85E67AC - .4byte 0x0000000b, gCreditsText_TakenoriOhta - - .align 2 -gCreditsEntry_HironobuYoshida:: @ 85E67B4 - .4byte 0x0000000b, gCreditsText_HironobuYoshida - - .align 2 -gCreditsEntry_MotofumiFujiwara:: @ 85E67BC - .4byte 0x0000000b, gCreditsText_MotofumiFujiwara - - .align 2 -gCreditsEntry_SatoshiOhta:: @ 85E67C4 - .4byte 0x0000000b, gCreditsText_SatoshiOhta - - .align 2 -gCreditsEntry_AsukaIwashita:: @ 85E67CC - .4byte 0x0000000b, gCreditsText_AsukaIwashita - - .align 2 -gCreditsEntry_AimiTomita:: @ 85E67D4 - .4byte 0x0000000b, gCreditsText_AimiTomita - - .align 2 -gCreditsEntry_TakaoUnno:: @ 85E67DC - .4byte 0x0000000b, gCreditsText_TakaoUnno - - .align 2 -gCreditsEntry_KanakoEo:: @ 85E67E4 - .4byte 0x0000000b, gCreditsText_KanakoEo - - .align 2 -gCreditsEntry_JunOkutani:: @ 85E67EC - .4byte 0x0000000b, gCreditsText_JunOkutani - - .align 2 -gCreditsEntry_AtsukoNishida:: @ 85E67F4 - .4byte 0x0000000b, gCreditsText_AtsukoNishida - - .align 2 -gCreditsEntry_MuneoSaito:: @ 85E67FC - .4byte 0x0000000b, gCreditsText_MuneoSaito - - .align 2 -gCreditsEntry_RenaYoshikawa:: @ 85E6804 - .4byte 0x0000000b, gCreditsText_RenaYoshikawa - - .align 2 -gCreditsEntry_GoIchinose:: @ 85E680C - .4byte 0x0000000b, gCreditsText_GoIchinose - - .align 2 -gCreditsEntry_MorikazuAoki:: @ 85E6814 - .4byte 0x0000000b, gCreditsText_MorikazuAoki - - .align 2 -gCreditsEntry_KojiNishino:: @ 85E681C - .4byte 0x0000000b, gCreditsText_KojiNishino - - .align 2 -gCreditsEntry_KenjiMatsushima:: @ 85E6824 - .4byte 0x0000000b, gCreditsText_KenjiMatsushima - - .align 2 -gCreditsEntry_TetsujiOhta:: @ 85E682C - .4byte 0x0000000b, gCreditsText_TetsujiOhta - - .align 2 -gCreditsEntry_HitomiSato:: @ 85E6834 - .4byte 0x0000000b, gCreditsText_HitomiSato - - .align 2 -gCreditsEntry_TakeshiKawachimaru:: @ 85E683C - .4byte 0x0000000b, gCreditsText_TakeshiKawachimaru - - .align 2 -gCreditsEntry_TeruyukiShimoyamada:: @ 85E6844 - .4byte 0x0000000b, gCreditsText_TeruyukiShimoyamada - - .align 2 -gCreditsEntry_ShigeruOhmori:: @ 85E684C - .4byte 0x0000000b, gCreditsText_ShigeruOhmori - - .align 2 -gCreditsEntry_TadashiTakahashi:: @ 85E6854 - .4byte 0x0000000b, gCreditsText_TadashiTakahashi - - .align 2 -gCreditsEntry_ToshinobuMatsumiya:: @ 85E685C - .4byte 0x0000000b, gCreditsText_ToshinobuMatsumiya - - .align 2 -gCreditsEntry_AkihitoTomisawa:: @ 85E6864 - .4byte 0x0000000b, gCreditsText_AkihitoTomisawa - - .align 2 -gCreditsEntry_HirokiEnomoto:: @ 85E686C - .4byte 0x0000000b, gCreditsText_HirokiEnomoto - - .align 2 -gCreditsEntry_KazuyukiTerada:: @ 85E6874 - .4byte 0x0000000b, gCreditsText_KazuyukiTerada - - .align 2 -gCreditsEntry_YuriSakurai:: @ 85E687C - .4byte 0x0000000b, gCreditsText_YuriSakurai - - .align 2 -gCreditsEntry_HiromiSagawa:: @ 85E6884 - .4byte 0x0000000b, gCreditsText_HiromiSagawa - - .align 2 -gCreditsEntry_KenjiTominaga:: @ 85E688C - .4byte 0x0000000b, gCreditsText_KenjiTominaga - - .align 2 -gCreditsEntry_YoshioTajiri:: @ 85E6894 - .4byte 0x0000000b, gCreditsText_YoshioTajiri - - .align 2 -gCreditsEntry_TeikoSasaki:: @ 85E689C - .4byte 0x0000000b, gCreditsText_TeikoSasaki - - .align 2 -gCreditsEntry_SachikoHamano:: @ 85E68A4 - .4byte 0x0000000b, gCreditsText_SachikoHamano - - .align 2 -gCreditsEntry_ChieMatsumiya:: @ 85E68AC - .4byte 0x0000000b, gCreditsText_ChieMatsumiya - - .align 2 -gCreditsEntry_AkikoShinozaki:: @ 85E68B4 - .4byte 0x0000000b, gCreditsText_AkikoShinozaki - - .align 2 -gCreditsEntry_AstukoFujii:: @ 85E68BC - .4byte 0x0000000b, gCreditsText_AstukoFujii - - .align 2 -gCreditsEntry_NozomuSaito:: @ 85E68C4 - .4byte 0x0000000b, gCreditsText_NozomuSaito - - .align 2 -gCreditsEntry_KenkichiToyama:: @ 85E68CC - .4byte 0x0000000b, gCreditsText_KenkichiToyama - - .align 2 -gCreditsEntry_SuguruNakatsui:: @ 85E68D4 - .4byte 0x0000000b, gCreditsText_SuguruNakatsui - - .align 2 -gCreditsEntry_YumiFunasaka:: @ 85E68DC - .4byte 0x0000000b, gCreditsText_YumiFunasaka - - .align 2 -gCreditsEntry_NaokoYanase:: @ 85E68E4 - .4byte 0x0000000b, gCreditsText_NaokoYanase - - .align 2 -gCreditsEntry_NCLSuperMarioClub:: @ 85E68EC - .4byte 0x0000000b, gCreditsText_NCLSuperMarioClub - - .align 2 -gCreditsEntry_AtsushiTada:: @ 85E68F4 - .4byte 0x0000000b, gCreditsText_AtsushiTada - - .align 2 -gCreditsEntry_TakahiroOhnishi:: @ 85E68FC - .4byte 0x0000000b, gCreditsText_TakahiroOhnishi - - .align 2 -gCreditsEntry_NorihideOkamura:: @ 85E6904 - .4byte 0x0000000b, gCreditsText_NorihideOkamura - - .align 2 -gCreditsEntry_HiroNakamura:: @ 85E690C - .4byte 0x0000000b, gCreditsText_HiroNakamura - - .align 2 -gCreditsEntry_HiroyukiUesugi:: @ 85E6914 - .4byte 0x0000000b, gCreditsText_HiroyukiUesugi - - .align 2 -gCreditsEntry_TerukiMurakawa:: @ 85E691C - .4byte 0x0000000b, gCreditsText_TerukiMurakawa - - .align 2 -gCreditsEntry_AkiraKinashi:: @ 85E6924 - .4byte 0x0000000b, gCreditsText_AkiraKinashi - - .align 2 -gCreditsEntry_MichikoTakizawa:: @ 85E692C - .4byte 0x0000000b, gCreditsText_MichikoTakizawa - - .align 2 -gCreditsEntry_MakikoTakada:: @ 85E6934 - .4byte 0x0000000b, gCreditsText_MakikoTakada - - .align 2 -gCreditsEntry_TakanaoKondo:: @ 85E693C - .4byte 0x0000000b, gCreditsText_TakanaoKondo - - .align 2 -gCreditsEntry_AiMashima:: @ 85E6944 - .4byte 0x0000000b, gCreditsText_AiMashima - - .align 2 -gCreditsEntry_GakujiNomoto:: @ 85E694C - .4byte 0x0000000b, gCreditsText_GakujiNomoto - - .align 2 -gCreditsEntry_TakehiroIzushi:: @ 85E6954 - .4byte 0x0000000b, gCreditsText_TakehiroIzushi - - .align 2 -gCreditsEntry_HitoshiYamagami:: @ 85E695C - .4byte 0x0000000b, gCreditsText_HitoshiYamagami - - .align 2 -gCreditsEntry_KyokoWatanabe:: @ 85E6964 - .4byte 0x0000000b, gCreditsText_KyokoWatanabe - - .align 2 -gCreditsEntry_TakaoNakano:: @ 85E696C - .4byte 0x0000000b, gCreditsText_TakaoNakano - - .align 2 -gCreditsEntry_HiroyukiJinnai:: @ 85E6974 - .4byte 0x0000000b, gCreditsText_HiroyukiJinnai - - .align 2 -gCreditsEntry_HiroakiTsuru:: @ 85E697C - .4byte 0x0000000b, gCreditsText_HiroakiTsuru - - .align 2 -gCreditsEntry_TsunekazIshihara:: @ 85E6984 - .4byte 0x0000000b, gCreditsText_TsunekazIshihara - - .align 2 -gCreditsEntry_SatoruIwata:: @ 85E698C - .4byte 0x0000000b, gCreditsText_SatoruIwata - - .align 2 -gCreditsEntry_KazuyaSuyama:: @ 85E6994 - .4byte 0x0000000b, gCreditsText_KazuyaSuyama - - .align 2 -gCreditsEntry_SatoshiMitsuhara:: @ 85E699C - .4byte 0x0000000b, gCreditsText_SatoshiMitsuhara - - .align 2 -gCreditsEntry_JapanBrailleLibrary:: @ 85E69A4 - .4byte 0x00000009, gCreditsText_JapanBrailleLibrary - - .align 2 -gCreditsEntry_TomotakaKomura:: @ 85E69AC - .4byte 0x0000000b, gCreditsText_TomotakaKomura - - .align 2 -gCreditsEntry_MikikoOhhashi:: @ 85E69B4 - .4byte 0x0000000b, gCreditsText_MikikoOhhashi - - .align 2 -gCreditsEntry_DaisukeHoshino:: @ 85E69BC - .4byte 0x0000000b, gCreditsText_DaisukeHoshino - - .align 2 -gCreditsEntry_KenjiroIto:: @ 85E69C4 - .4byte 0x0000000b, gCreditsText_KenjiroIto - - .align 2 -gCreditsEntry_RuiKawaguchi:: @ 85E69CC - .4byte 0x0000000b, gCreditsText_RuiKawaguchi - - .align 2 -gCreditsEntry_ShunsukeKohori:: @ 85E69D4 - .4byte 0x0000000b, gCreditsText_ShunsukeKohori - - .align 2 -gCreditsEntry_SachikoNakamichi:: @ 85E69DC - .4byte 0x0000000b, gCreditsText_SachikoNakamichi - - .align 2 -gCreditsEntry_FujikoNomura:: @ 85E69E4 - .4byte 0x0000000b, gCreditsText_FujikoNomura - - .align 2 -gCreditsEntry_KazukiYoshihara:: @ 85E69EC - .4byte 0x0000000b, gCreditsText_KazukiYoshihara - - .align 2 -gCreditsEntry_RetsujiNomoto:: @ 85E69F4 - .4byte 0x0000000b, gCreditsText_RetsujiNomoto - - .align 2 -gCreditsEntry_AzusaTajima:: @ 85E69FC - .4byte 0x0000000b, gCreditsText_AzusaTajima - - .align 2 -gCreditsEntry_ShusakuEgami:: @ 85E6A04 - .4byte 0x0000000b, gCreditsText_ShusakuEgami - - .align 2 -gCreditsEntry_PackageAndManual:: @ 85E6A0C - .4byte 0x00000100, gCreditsText_PackageAndManual - - .align 2 -gCreditsEntry_EnglishVersion:: @ 85E6A14 - .4byte 0x00000100, gCreditsText_EnglishVersion - - .align 2 -gCreditsEntry_Translator:: @ 85E6A1C - .4byte 0x00000100, gCreditsText_Translator - - .align 2 -gCreditsEntry_TextEditor:: @ 85E6A24 - .4byte 0x00000100, gCreditsText_TextEditor - - .align 2 -gCreditsEntry_NCLCoordinator:: @ 85E6A2C - .4byte 0x00000100, gCreditsText_NCLCoordinator - - .align 2 -gCreditsEntry_GraphicDesigner:: @ 85E6A34 - .4byte 0x00000100, gCreditsText_GraphicDesigner - - .align 2 -gCreditsEntry_NOAProductTesting:: @ 85E6A3C - .4byte 0x00000100, gCreditsText_NOAProductTesting - - .align 2 -gCreditsEntry_HideyukiNakajima:: @ 85E6A44 - .4byte 0x00000000, gCreditsText_HideyukiNakajima - - .align 2 -gCreditsEntry_HidenoriSaeki:: @ 85E6A4C - .4byte 0x00000000, gCreditsText_HidenoriSaeki - - .align 2 -gCreditsEntry_YokoWatanabe:: @ 85E6A54 - .4byte 0x00000000, gCreditsText_YokoWatanabe - - .align 2 -gCreditsEntry_SakaeKimura:: @ 85E6A5C - .4byte 0x00000000, gCreditsText_SakaeKimura - - .align 2 -gCreditsEntry_ChiakiShinkai:: @ 85E6A64 - .4byte 0x00000000, gCreditsText_ChiakiShinkai - - .align 2 -gCreditsEntry_SethMcMahill:: @ 85E6A6C - .4byte 0x00000000, gCreditsText_SethMcMahill - - .align 2 -gCreditsEntry_NobOgasawara:: @ 85E6A74 - .4byte 0x00000000, gCreditsText_NobOgasawara - - .align 2 -gCreditsEntry_TeresaLillygren:: @ 85E6A7C - .4byte 0x00000000, gCreditsText_TeresaLillygren - - .align 2 -gCreditsEntry_KimikoNakamichi:: @ 85E6A84 - .4byte 0x00000000, gCreditsText_KimikoNakamichi - - .align 2 -gCreditsEntry_SouichiYamamoto:: @ 85E6A8C - .4byte 0x00000000, gCreditsText_SouichiYamamoto - - .align 2 -gCreditsEntry_YuichiroIto:: @ 85E6A94 - .4byte 0x00000000, gCreditsText_YuichiroIto - - .align 2 -gCreditsEntry_ThomasHertzog:: @ 85E6A9C - .4byte 0x00000000, gCreditsText_ThomasHertzog - - .align 2 -gCreditsEntry_MikaKurosawa:: @ 85E6AA4 - .4byte 0x00000000, gCreditsText_MikaKurosawa - - .align 2 -gCreditsEntry_NationalFederationBlind:: @ 85E6AAC - .4byte 0x00000000, gCreditsText_NationalFederationBlind - - .align 2 -gCreditsEntry_PatriciaAMaurer:: @ 85E6AB4 - .4byte 0x00000000, gCreditsText_PatriciaAMaurer - - .align 2 -gCreditsEntry_EuropeanBlindUnion:: @ 85E6ABC - .4byte 0x00000000, gCreditsText_EuropeanBlindUnion - - .align 2 -gCreditsEntry_AustralianBrailleAuthority:: @ 85E6AC4 - .4byte 0x00000000, gCreditsText_AustralianBrailleAuthority - - .align 2 -gCreditsEntry_RoyalNewZealandFederationBlind:: @ 85E6ACC - .4byte 0x00000000, gCreditsText_RoyalNewZealandFederationBlind - - .align 2 -gCreditsEntry_MotoyasuTojima:: @ 85E6AD4 - .4byte 0x00000000, gCreditsText_MotoyasuTojima - - .align 2 -gCreditsEntry_NicolaPrattBarlow:: @ 85E6ADC - .4byte 0x00000000, gCreditsText_NicolaPrattBarlow - - .align 2 -gCreditsEntry_ShellieDow:: @ 85E6AE4 - .4byte 0x00000000, gCreditsText_ShellieDow - - .align 2 -gCreditsEntry_ErikJohnson:: @ 85E6AEC - .4byte 0x00000000, gCreditsText_ErikJohnson - - .align 2 -gUnknown_085E6AF4:: @ 85E6AF4 - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_PkmnEmeraldVersion - .4byte gCreditsEntry_Credits - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_Director - .4byte gCreditsEntry_ShigekiMorimoto - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_ArtDirector - .4byte gCreditsEntry_KenSugimori - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_WorldDirector - .4byte gCreditsEntry_JunichiMasuda - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_LeadProgrammer - .4byte gCreditsEntry_HisashiSogabe - .4byte gCreditsEntry_LeadGraphicArtist - .4byte gCreditsEntry_MotofumiFujiwara - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_Programmers - .4byte gCreditsEntry_HisashiSogabe - .4byte gCreditsEntry_TomomichiOhta - .4byte gCreditsEntry_NozomuSaito - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_Programmers - .4byte gCreditsEntry_AkitoMori - .4byte gCreditsEntry_HiroyukiNakamura - .4byte gCreditsEntry_MasaoTaya - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_Programmers - .4byte gCreditsEntry_SatoshiNohara - .4byte gCreditsEntry_MiyukiIwasawa - .4byte gCreditsEntry_YoshinoriMatsuda - .4byte gCreditsEntry_KeitaKagaya - - .4byte gCreditsEntry_Programmers - .4byte gCreditsEntry_TetsuyaWatanabe - .4byte gCreditsEntry_SosukeTamada - .4byte gCreditsEntry_TakenoriOhta - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_GraphicDesigners - .4byte gCreditsEntry_MotofumiFujiwara - .4byte gCreditsEntry_SatoshiOhta - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_GraphicDesigners - .4byte gCreditsEntry_KenkichiToyama - .4byte gCreditsEntry_AsukaIwashita - .4byte gCreditsEntry_TakaoUnno - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_GraphicDesigners - .4byte gCreditsEntry_KenSugimori - .4byte gCreditsEntry_HironobuYoshida - .4byte gCreditsEntry_AimiTomita - .4byte gCreditsEntry_KanakoEo - - .4byte gCreditsEntry_MusicComposition - .4byte gCreditsEntry_GoIchinose - .4byte gCreditsEntry_JunichiMasuda - .4byte gCreditsEntry_MorikazuAoki - .4byte gCreditsEntry_HitomiSato - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_SoundEffectsAndPkmnVoices - .4byte gCreditsEntry_GoIchinose - .4byte gCreditsEntry_MorikazuAoki - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_GameDesigners - .4byte gCreditsEntry_ShigekiMorimoto - .4byte gCreditsEntry_TeruyukiShimoyamada - .4byte gCreditsEntry_TakeshiKawachimaru - .4byte gCreditsEntry_AkihitoTomisawa - - .4byte gCreditsEntry_GameDesigners - .4byte gCreditsEntry_SuguruNakatsui - .4byte gCreditsEntry_TetsujiOhta - .4byte gCreditsEntry_HitomiSato - .4byte gCreditsEntry_KenjiMatsushima - - .4byte gCreditsEntry_GameDesigners - .4byte gCreditsEntry_JunichiMasuda - .4byte gCreditsEntry_KojiNishino - .4byte gCreditsEntry_ShigeruOhmori - .4byte gCreditsEntry_TadashiTakahashi - - .4byte gCreditsEntry_ScenarioPlot - .4byte gCreditsEntry_AkihitoTomisawa - .4byte gCreditsEntry_JunichiMasuda - .4byte gCreditsEntry_KojiNishino - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_Scenario - .4byte gCreditsEntry_AkihitoTomisawa - .4byte gCreditsEntry_HitomiSato - .4byte gCreditsEntry_ToshinobuMatsumiya - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_ScriptDesigners - .4byte gCreditsEntry_TomomichiOhta - .4byte gCreditsEntry_SatoshiNohara - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_MapDesigners - .4byte gCreditsEntry_SuguruNakatsui - .4byte gCreditsEntry_TeruyukiShimoyamada - .4byte gCreditsEntry_ShigeruOhmori - .4byte gCreditsEntry_TetsujiOhta - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_BattleFrontierData - .4byte gCreditsEntry_TetsujiOhta - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_ParametricDesigners - .4byte gCreditsEntry_TeruyukiShimoyamada - .4byte gCreditsEntry_ShigekiMorimoto - .4byte gCreditsEntry_TetsujiOhta - .4byte gCreditsEntry_KojiNishino - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_PokedexText - .4byte gCreditsEntry_KenjiMatsushima - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EnvAndToolPgrms - .4byte gCreditsEntry_HisashiSogabe - .4byte gCreditsEntry_SosukeTamada - .4byte gCreditsEntry_HiroyukiNakamura - .4byte gCreditsEntry_AkitoMori - - .4byte gCreditsEntry_PkmnDesigners - .4byte gCreditsEntry_KenSugimori - .4byte gCreditsEntry_MotofumiFujiwara - .4byte gCreditsEntry_ShigekiMorimoto - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_PkmnDesigners - .4byte gCreditsEntry_HironobuYoshida - .4byte gCreditsEntry_SatoshiOhta - .4byte gCreditsEntry_AsukaIwashita - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_PkmnDesigners - .4byte gCreditsEntry_TakaoUnno - .4byte gCreditsEntry_KanakoEo - .4byte gCreditsEntry_AimiTomita - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_PkmnDesigners - .4byte gCreditsEntry_AtsukoNishida - .4byte gCreditsEntry_MuneoSaito - .4byte gCreditsEntry_RenaYoshikawa - .4byte gCreditsEntry_JunOkutani - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_SupportProgrammers - .4byte gCreditsEntry_SatoshiMitsuhara - .4byte gCreditsEntry_DaisukeHoshino - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_NCLProductTesting - .4byte gCreditsEntry_NCLSuperMarioClub - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_PackageAndManual - .4byte gCreditsEntry_KenSugimori - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_SpecialThanks - .4byte gCreditsEntry_KenjiTominaga - .4byte gCreditsEntry_HirokiEnomoto - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_SpecialThanks - .4byte gCreditsEntry_KazuyaSuyama - .4byte gCreditsEntry_KenjiroIto - .4byte gCreditsEntry_MichikoTakizawa - .4byte gCreditsEntry_MakikoTakada - - .4byte gCreditsEntry_SpecialThanks - .4byte gCreditsEntry_MikikoOhhashi - .4byte gCreditsEntry_TakanaoKondo - .4byte gCreditsEntry_RuiKawaguchi - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_SpecialThanks - .4byte gCreditsEntry_TakahiroOhnishi - .4byte gCreditsEntry_NorihideOkamura - .4byte gCreditsEntry_ShunsukeKohori - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_InfoSupervisors - .4byte gCreditsEntry_KazuyukiTerada - .4byte gCreditsEntry_YuriSakurai - .4byte gCreditsEntry_YumiFunasaka - .4byte gCreditsEntry_NaokoYanase - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_Artwork - .4byte gCreditsEntry_SachikoNakamichi - .4byte gCreditsEntry_FujikoNomura - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_Artwork - .4byte gCreditsEntry_HideyukiNakajima - .4byte gCreditsEntry_HidenoriSaeki - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_Artwork - .4byte gCreditsEntry_YokoWatanabe - .4byte gCreditsEntry_SakaeKimura - .4byte gCreditsEntry_ChiakiShinkai - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_Coordinators - .4byte gCreditsEntry_KazukiYoshihara - .4byte gCreditsEntry_AkiraKinashi - .4byte gCreditsEntry_RetsujiNomoto - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EnglishVersion - .4byte gCreditsEntry_HiroNakamura - .4byte gCreditsEntry_SethMcMahill - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_Translator - .4byte gCreditsEntry_NobOgasawara - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_TextEditor - .4byte gCreditsEntry_TeresaLillygren - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_NCLCoordinator - .4byte gCreditsEntry_KimikoNakamichi - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_Programmers - .4byte gCreditsEntry_TerukiMurakawa - .4byte gCreditsEntry_SouichiYamamoto - .4byte gCreditsEntry_YuichiroIto - .4byte gCreditsEntry_AkiraKinashi - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_GraphicDesigner - .4byte gCreditsEntry_AkiraKinashi - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EnvAndToolPgrms - .4byte gCreditsEntry_TerukiMurakawa - .4byte gCreditsEntry_SouichiYamamoto - .4byte gCreditsEntry_KimikoNakamichi - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_NOAProductTesting - .4byte gCreditsEntry_ThomasHertzog - .4byte gCreditsEntry_ErikJohnson - .4byte gCreditsEntry_MikaKurosawa - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_BrailleCodeCheck - .4byte gCreditsEntry_NationalFederationBlind - .4byte gCreditsEntry_PatriciaAMaurer - .4byte gCreditsEntry_JapanBrailleLibrary - .4byte gCreditsEntry_EuropeanBlindUnion - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_BrailleCodeCheck - .4byte gCreditsEntry_AustralianBrailleAuthority - .4byte gCreditsEntry_RoyalNewZealandFederationBlind - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_SpecialThanks - .4byte gCreditsEntry_HiroyukiUesugi - .4byte gCreditsEntry_MotoyasuTojima - .4byte gCreditsEntry_NicolaPrattBarlow - .4byte gCreditsEntry_ShellieDow - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_TaskManagers - .4byte gCreditsEntry_AzusaTajima - .4byte gCreditsEntry_ShusakuEgami - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_Producers - .4byte gCreditsEntry_HiroyukiJinnai - .4byte gCreditsEntry_HitoshiYamagami - .4byte gCreditsEntry_GakujiNomoto - .4byte gCreditsEntry_HiroakiTsuru - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_ExecutiveDirector - .4byte gCreditsEntry_SatoshiTajiri - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_ExecProducers - .4byte gCreditsEntry_SatoruIwata - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_ExecProducers - .4byte gCreditsEntry_TsunekazIshihara - .4byte gCreditsEntry_EmptyString - .4byte gCreditsEntry_EmptyString - - .align 2 -gUnknown_085E6F68:: @ 85E6F68 struct BgTemplate - .4byte 0x000001C8 - - .align 2 -gUnknown_085E6F6C:: @ 85E6F6C - window_template 0x00, 0x00, 0x09, 0x1e, 0x0c, 0x08, 0x0001 - null_window_template - - .align 2 -gUnknown_085E6F7C:: @ 85E6F7C - .byte 0x68, 0x24, 0x78, 0x24, 0x88, 0x24, 0x00, 0x00 - - .align 2 -gUnknown_085E6F84:: @ 85E6F84 - .2byte 0x0000, 0x0008, 0x0040, 0x0008, 0x0080, 0x0008, 0x00c0, 0x0008, 0xfffe, 0x0000 - - .align 2 -gUnknown_085E6F98:: @ 85E6F98 - .2byte 0x0000, 0x0004, 0x0040, 0x0004, 0x0080, 0x0004, 0x00c0, 0x0004, 0xfffe, 0x0000 - - .align 2 -gUnknown_085E6FAC:: @ 85E6FAC - .2byte 0x0100, 0x0004, 0x0140, 0x0004, 0x0180, 0x0004, 0xffff, 0x0000 - - .align 2 -gUnknown_085E6FBC:: @ 85E6FBC - .2byte 0x0180, 0x001e, 0x0140, 0x001e, 0x0100, 0x001e, 0x0100, 0x001e, 0xffff, 0x0000 - - .align 2 -gUnknown_085E6FD0:: @ 85E6FD0 - .4byte gUnknown_085E6F84 - .4byte gUnknown_085E6F98 - .4byte gUnknown_085E6FAC - .4byte gUnknown_085E6FBC - - .align 2 -gUnknown_085E6FE0:: @ 85E6FE0 - .2byte 0x0000, 0x0008, 0x0040, 0x0008, 0x0080, 0x0008, 0x00c0, 0x0008, 0xfffe, 0x0000 - - .align 2 -gUnknown_085E6FF4:: @ 85E6FF4 - .2byte 0x0000, 0x0004, 0x0040, 0x0004, 0x0080, 0x0004, 0x00c0, 0x0004, 0xfffe, 0x0000 - - .align 2 -gUnknown_085E7008:: @ 85E7008 - .2byte 0x0000, 0x0004, 0xffff, 0x0000 - - .align 2 -gUnknown_085E7010:: @ 85E7010 - .4byte gUnknown_085E6FE0 - .4byte gUnknown_085E6FF4 - .4byte gUnknown_085E7008 - - .align 2 -gUnknown_085E701C:: @ 85E701C - obj_tiles gDecompressionBuffer, 0x1800, 0x03E9 - null_obj_tiles - - .align 2 -gUnknown_085E702C:: @ 85E702C - obj_pal gDecompressionBuffer + 0x1800, 0x03E9 - null_obj_pal - - .align 2 -gUnknown_085E703C:: @ 85E703C - .2byte 0x00a0, 0xc000, 0x0400, 0x0000 - - .align 2 -gUnknown_085E7044:: @ 85E7044 - .2byte 0x0000, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E704C:: @ 85E704C - .2byte 0x0040, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E7054:: @ 85E7054 - .2byte 0x0080, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E705C:: @ 85E705C - .4byte gUnknown_085E7044 - .4byte gUnknown_085E704C - .4byte gUnknown_085E7054 - - .align 2 -gUnknown_085E7068:: @ 85E7068 - spr_template 0x03e9, 0x03e9, gUnknown_085E703C, gUnknown_085E705C, NULL, gDummySpriteAffineAnimTable, sub_81772B8 diff --git a/data/intro.s b/data/intro.s deleted file mode 100644 index d43a57972..000000000 --- a/data/intro.s +++ /dev/null @@ -1,529 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - .align 2 -gIntro1DropsPal:: @ 85DFF90 - .incbin "graphics/intro/intro1_drops.gbapal" - - .align 2 -gIntro1GFLogoPal:: @ 85DFFB0 - .incbin "graphics/intro/intro1_gflogo.gbapal" - - .align 2 -gIntroTiles:: @ 85DFFD0 - .incbin "graphics/intro/intro.4bpp.lz" - - .align 2 -gIntro1BGPals:: @ 85E05C4 - .incbin "graphics/intro/intro1_bgpal.gbapal" - - .align 2 -gIntro1BG0_Tilemap:: @ 85E07C4 - .incbin "graphics/intro/intro1_bg0_map.bin.lz" - - .align 2 -gIntro1BG1_Tilemap:: @ 85E0B78 - .incbin "graphics/intro/intro1_bg1_map.bin.lz" - - .align 2 -gIntro1BG2_Tilemap:: @ 85E0EAC - .incbin "graphics/intro/intro1_bg2_map.bin.lz" - - .align 2 -gIntro1BG3_Tilemap:: @ 85E119C - .incbin "graphics/intro/intro1_bg3_map.bin.lz" - - .align 2 -gIntro1BGLeavesGfx:: @ 85E13B4 - .incbin "graphics/intro/introgfx.4bpp.lz" - - .align 2 -gIntro3PokeballPal:: @ 85E3524 - .incbin "graphics/intro/intro3_pokeball.gbapal" - - .align 2 -gIntro3Pokeball_Tilemap:: @ 85E3724 - .incbin "graphics/intro/intro3_pokeball_map.bin.lz" - - .align 2 -gIntro3Pokeball_Gfx:: @ 85E3854 - .incbin "graphics/intro/intro3_pokeball.8bpp.lz" - - .align 2 - .incbin "graphics/intro/intro3_streaks.gbapal" - - .align 2 - .incbin "graphics/intro/intro3_streaks.4bpp.lz" - - .align 2 - .incbin "graphics/intro/intro3_streaks_map.bin.lz" - - .align 2 -gIntro3Misc1Pal:: @ 85E4570 - .incbin "graphics/intro/intro3_misc1.gbapal" - - .align 2 - .incbin "graphics/intro/intro3_misc2.gbapal" - - .align 2 -gIntro3MiscTiles:: @ 85E45B0 - .incbin "graphics/intro/intro3_misc.4bpp.lz" - - .align 2 -gIntro1FlygonPal:: @ 85E492C - .incbin "graphics/intro/intro1_flygon.gbapal" - - .align 2 - .incbin "graphics/intro/intro1_eon.4bpp.lz" - - .align 2 - .byte 0x02, 0x03, 0x04, 0x05, 0x01, 0x01, 0x01, 0x06 - .byte 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x02, 0x0d - .byte 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15 - .byte 0x16, 0x17, 0x18, 0x19, 0x02, 0x0d, 0x0e, 0x0f - .byte 0x10, 0x11, 0x12, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e - .byte 0x1f, 0x20, 0x21, 0x02, 0x0d, 0x0e, 0x0f, 0x10 - .byte 0x11, 0x12, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27 - .byte 0x28, 0x29, 0x2a, 0x00 - - .align 2 -gUnknown_085E4A74:: @ 85E4A74 - obj_tiles gIntro1SparkleGfx, 0x0400, 0x05e1 - null_obj_tiles - - .align 2 -gUnknown_085E4A84:: @ 85E4A84 - obj_pal gIntro3LightningPal, 0x05e1 - null_obj_pal - - .align 2 -gUnknown_085E4A94:: @ 85E4A94 - .byte 0xa0, 0x00, 0x00, 0x40, 0x00, 0x04, 0x00, 0x00 - - .align 2 -gUnknown_085E4A9C:: @ 85E4A9C - .2byte 0x0000, 0x0002, 0x0004, 0x0002, 0x0008, 0x0002, 0x000c, 0x0002, 0x0010, 0x0002, 0xfffe, 0x0000 - - .align 2 -gUnknown_085E4AB4:: @ 85E4AB4 - .4byte gUnknown_085E4A9C - - .align 2 -gUnknown_085E4AB8:: @ 85E4AB8 - spr_template 0x05e1, 0x05e1, gUnknown_085E4A94, gUnknown_085E4AB4, NULL, gDummySpriteAffineAnimTable, sub_816D338 - - .align 2 -gUnknown_085E4AD0:: @ 85E4AD0 - .byte 0x7c, 0x28, 0x66, 0x1e, 0x4d, 0x1e, 0x36, 0x0f - .byte 0x94, 0x09, 0x3f, 0x1c, 0x5d, 0x28, 0x94, 0x20 - .byte 0xad, 0x29, 0x5e, 0x14, 0xd0, 0x26, 0x00, 0x00 - - .align 2 -gUnknown_085E4AE8:: @ 85E4AE8 - obj_tiles gIntro2VolbeatGfx, 0x0400, 0x05dc - obj_tiles gIntro2TorchicGfx, 0x0c00, 0x05dd - obj_tiles gIntro2ManectricGfx, 0x2000, 0x05de - null_obj_tiles - - .align 2 -gUnknown_085E4B08:: @ 85E4B08 - obj_pal gIntro2VolbeatPal, 0x05dc - obj_pal gIntro2TorchicPal, 0x05dd - obj_pal gIntro2ManectricPal, 0x05de - null_obj_pal - - .align 2 -gUnknown_085E4B28:: @ 85E4B28 - .byte 0xa0, 0x00, 0x00, 0x80, 0x00, 0x04, 0x00, 0x00 - - .align 2 -gUnknown_085E4B30:: @ 85E4B30 - .2byte 0x0000, 0x0002, 0x0010, 0x0002, 0xfffe, 0x0000 - - .align 2 -gUnknown_085E4B3C:: @ 85E4B3C - .4byte gUnknown_085E4B30 - - .align 2 -gUnknown_085E4B40:: @ 85E4B40 - spr_template 0x05dc, 0x05dc, gUnknown_085E4B28, gUnknown_085E4B3C, NULL, gDummySpriteAffineAnimTable, sub_816D81C - - .align 2 -gUnknown_085E4B58:: @ 85E4B58 - .byte 0xa0, 0x00, 0x00, 0x80, 0x00, 0x04, 0x00, 0x00 - - .align 2 -gUnknown_085E4B60:: @ 85E4B60 - .2byte 0x0000, 0x0005, 0x0010, 0x0005, 0x0020, 0x0005, 0x0010, 0x0005, 0xfffe, 0x0000 - - .align 2 -gUnknown_085E4B74:: @ 85E4B74 - .2byte 0x0000, 0x0003, 0x0010, 0x0003, 0x0020, 0x0003, 0x0010, 0x0003, 0xfffe, 0x0000 - - .align 2 -gUnknown_085E4B88:: @ 85E4B88 - .2byte 0x0030, 0x0004, 0x0040, 0x0006, 0x0050, 0x0000, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4B98:: @ 85E4B98 - .4byte gUnknown_085E4B60 - .4byte gUnknown_085E4B74 - .4byte gUnknown_085E4B88 - - .align 2 -gUnknown_085E4BA4:: @ 85E4BA4 - spr_template 0x05dd, 0x05dd, gUnknown_085E4B58, gUnknown_085E4B98, NULL, gDummySpriteAffineAnimTable, sub_816D9C0 - - .align 2 -gUnknown_085E4BBC:: @ 85E4BBC - .byte 0xa0, 0x00, 0x00, 0xc0, 0x00, 0x04, 0x00, 0x00 - - .align 2 -gUnknown_085E4BC4:: @ 85E4BC4 - .2byte 0x0000, 0x0004, 0x0040, 0x0004, 0x0080, 0x0004, 0x00c0, 0x0004, 0xfffe, 0x0000 - - .align 2 -gUnknown_085E4BD8:: @ 85E4BD8 - .4byte gUnknown_085E4BC4 - - .align 2 -gUnknown_085E4BDC:: @ 85E4BDC - spr_template 0x05de, 0x05de, gUnknown_085E4BBC, gUnknown_085E4BD8, NULL, gDummySpriteAffineAnimTable, sub_816DAE8 - - .align 2 -gUnknown_085E4BF4:: @ 85E4BF4 - obj_tiles gIntro3LightningGfx, 0x0c00, 0x05df - null_obj_tiles - - .align 2 -gUnknown_085E4C04:: @ 85E4C04 - obj_pal gIntro3LightningPal, 0x05df - null_obj_pal - - .align 2 -gUnknown_085E4C14:: @ 85E4C14 - .byte 0xa0, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_085E4C1C:: @ 85E4C1C - .2byte 0x0000, 0x0002, 0x0030, 0x0002, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4C28:: @ 85E4C28 - .2byte 0x0010, 0x0002, 0x0040, 0x0002, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4C34:: @ 85E4C34 - .2byte 0x0020, 0x0002, 0x0050, 0x0002, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4C40:: @ 85E4C40 - .4byte gUnknown_085E4C1C - .4byte gUnknown_085E4C28 - .4byte gUnknown_085E4C34 - - .align 2 -gUnknown_085E4C4C:: @ 85E4C4C - spr_template 0x05df, 0x05df, gUnknown_085E4C14, gUnknown_085E4C40, NULL, gDummySpriteAffineAnimTable, sub_816EC6C - - .align 2 -gUnknown_085E4C64:: @ 85E4C64 - .2byte 0x0068, 0x0000, 0x00c0, 0x008e, 0x0003, 0x0280, 0x0053, 0x0001 - .2byte 0x0180, 0x009b, 0x0000, 0x0080, 0x0038, 0x0002, 0x0200, 0x00ae - .2byte 0x0001, 0x0100 - - .align 2 -gUnknown_085E4C88:: @ 85E4C88 - obj_tiles gIntro2BubblesGfx, 0x0600, 0x05e0 - null_obj_tiles - - .align 2 -gUnknown_085E4C98:: @ 85E4C98 - obj_pal gIntro2BubblesPal, 0x05e0 - null_obj_pal - - .align 2 -gUnknown_085E4CA8:: @ 85E4CA8 - .2byte 0x0042, 0x0040, 0x0001, 0x0060, 0x0060, 0x0008, 0x0080, 0x0040 - .2byte 0x0001, 0x0090, 0x0030, 0x0008, 0x00a0, 0x0048, 0x0001, 0x00b0 - .2byte 0x0060, 0x0008, 0x0060, 0x0060, 0x0004, 0x0070, 0x0068, 0x0008 - .2byte 0x0080, 0x0060, 0x0004, 0x0058, 0x0020, 0x0004, 0x0068, 0x0018 - .2byte 0x0008, 0x0078, 0x0020, 0x0004 - - .align 2 -gUnknown_085E4CF0:: @ 85E4CF0 - .byte 0xa0, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_085E4CF8:: @ 85E4CF8 - .2byte 0x0000, 0x0004, 0x0008, 0x0004, 0x0010, 0x0004, 0x0018, 0x0004 - .2byte 0x0020, 0x0004, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4D10:: @ 85E4D10 - .4byte gUnknown_085E4CF8 - - .align 2 -gUnknown_085E4D14:: @ 85E4D14 - spr_template 0x05e0, 0x05e0, gUnknown_085E4CF0, gUnknown_085E4D10, NULL, gDummySpriteAffineAnimTable, sub_816E7B4 - - .align 2 -gUnknown_085E4D2C:: @ 85E4D2C - .byte 0xa0, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_085E4D34:: @ 85E4D34 - .2byte 0x0010, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4D3C:: @ 85E4D3C - .2byte 0x0018, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4D44:: @ 85E4D44 - .2byte 0x0000, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4D4C:: @ 85E4D4C - .2byte 0x0030, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4D54:: @ 85E4D54 - .4byte gUnknown_085E4D34 - .4byte gUnknown_085E4D3C - .4byte gUnknown_085E4D44 - .4byte gUnknown_085E4D4C - - .align 2 -gUnknown_085E4D64:: @ 85E4D64 - spr_template 0x07d0, 0x07d0, gUnknown_085E4D2C, gUnknown_085E4D54, NULL, gDummySpriteAffineAnimTable, sub_816F454 - - .align 2 -gUnknown_085E4D7C:: @ 85E4D7C - .byte 0x00, 0x00, 0x04, 0x00, 0x40, 0x00, 0x04, 0x00 - - .align 2 -gUnknown_085E4D84:: @ 85E4D84 - .2byte 0x0080, 0x0004, 0x00c0, 0x0004, 0xfffe, 0x0000 - - .align 2 -gUnknown_085E4D90:: @ 85E4D90 - .2byte 0x0000, 0x0008, 0x0040, 0x0008, 0x0080, 0x0008, 0x00c0, 0x0008, 0xfffe, 0x0000 - - .align 2 -gUnknown_085E4DA4:: @ 85E4DA4 - .2byte 0x0100, 0x0004, 0x0140, 0x0004, 0x0180, 0x0004, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4DB4:: @ 85E4DB4 - .2byte 0x0180, 0x0010, 0x0140, 0x0010, 0x0100, 0x0010, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4DC4:: @ 85E4DC4 - .4byte gUnknown_085E4D7C - .4byte gUnknown_085E4D90 - .4byte gUnknown_085E4DA4 - .4byte gUnknown_085E4DB4 - - .align 2 -gUnknown_085E4DD4:: @ 85E4DD4 - .2byte 0x03a0, 0x4000, 0x0000, 0x0000 - - .align 2 -gUnknown_085E4DDC:: @ 85E4DDC - .2byte 0x00a0, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085E4DE4:: @ 85E4DE4 - .2byte 0x87a0, 0xc000, 0x0000, 0x0000 - - .align 2 -gUnknown_085E4DEC:: @ 85E4DEC - .2byte 0x0050, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4DF4:: @ 85E4DF4 - .2byte 0x0054, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4DFC:: @ 85E4DFC - .2byte 0x0058, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4E04:: @ 85E4E04 - .2byte 0x005c, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4E0C:: @ 85E4E0C - .2byte 0x0060, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4E14:: @ 85E4E14 - .2byte 0x0064, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4E1C:: @ 85E4E1C - .2byte 0x0068, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4E24:: @ 85E4E24 - .2byte 0x0070, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4E2C:: @ 85E4E2C - .2byte 0x0071, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4E34:: @ 85E4E34 - .2byte 0x0072, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4E3C:: @ 85E4E3C - .2byte 0x0073, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4E44:: @ 85E4E44 - .2byte 0x0074, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4E4C:: @ 85E4E4C - .2byte 0x0075, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4E54:: @ 85E4E54 - .2byte 0x0080, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E4E5C:: @ 85E4E5C - .4byte gUnknown_085E4DEC - .4byte gUnknown_085E4DF4 - .4byte gUnknown_085E4DFC - .4byte gUnknown_085E4E04 - .4byte gUnknown_085E4E0C - .4byte gUnknown_085E4E14 - .4byte gUnknown_085E4E1C - - .align 2 -gUnknown_085E4E78:: @ 85E4E78 - .4byte gUnknown_085E4E24 - .4byte gUnknown_085E4E2C - .4byte gUnknown_085E4E34 - .4byte gUnknown_085E4E3C - .4byte gUnknown_085E4E44 - .4byte gUnknown_085E4E4C - - .align 2 -gUnknown_085E4E90:: @ 85E4E90 - .4byte gUnknown_085E4E54 - - .align 2 -gUnknown_085E4E94:: @ 85E4E94 - .2byte 0x0000, 0xffb8, 0x0001, 0xffc8, 0x0002, 0xffd8, 0x0003, 0xffe8 - .2byte 0x0004, 0x0008, 0x0005, 0x0018, 0x0003, 0x0028, 0x0001, 0x0038 - .2byte 0x0006, 0x0048, 0x0000, 0xffe4, 0x0001, 0xffec, 0x0002, 0xfff4 - .2byte 0x0003, 0xfffc, 0x0002, 0x0004, 0x0004, 0x000c, 0x0005, 0x0014 - .2byte 0x0003, 0x001c - - .align 2 -gUnknown_085E4ED8:: @ 85E4ED8 - .2byte 0x0080, 0x0080, 0x0000, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085E4EE8:: @ 85E4EE8 - .2byte 0x0080, 0x0080, 0x0000, 0x0000, 0x0010, 0x0010, 0x1000, 0x0000 - .2byte 0xfff0, 0xfff0, 0x0800, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085E4F08:: @ 85E4F08 - .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x0008, 0x0008, 0x3000, 0x0000 - .2byte 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085E4F20:: @ 85E4F20 - .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x0002, 0x0002, 0x3000, 0x0000 - .2byte 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085E4F38:: @ 85E4F38 - .4byte gUnknown_085E4ED8 - .4byte gUnknown_085E4EE8 - .4byte gUnknown_085E4F08 - .4byte gUnknown_085E4F20 - - .align 2 -gUnknown_085E4F48:: @ 85E4F48 - .2byte 0x0100, 0x00c0, 0x0080, 0x0040, 0x0000, 0x0040, 0x0080, 0x00c0 - .2byte 0x0100, 0x0000 - - .align 2 -gUnknown_085E4F5C:: @ 85E4F5C - spr_template 0x07d0, 0x07d1, gUnknown_085E4DD4, gUnknown_085E4E5C, NULL, gUnknown_085E4F38, sub_816FB38 - spr_template 0x07d0, 0x07d1, gUnknown_085E4DDC, gUnknown_085E4E78, NULL, gDummySpriteAffineAnimTable, sub_816FB38 - - .align 2 -gUnknown_085E4F8C:: @ 85E4F8C - spr_template 0x07d0, 0x07d1, gUnknown_085E4DE4, gUnknown_085E4E90, NULL, gUnknown_085E4F38, sub_816FD44 - - .align 2 -gUnknown_085E4FA4:: @ 85E4FA4 - .byte 0x00, 0x17, 0x17, 0x31, 0x3e, 0x24, 0x24, 0x0a, 0x0a, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_085E4FB0:: @ 85E4FB0 - .byte 0xa0, 0x40, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_085E4FB8:: @ 85E4FB8 - .2byte 0x0000, 0x000a, 0xfffe, 0x0000 - - .align 2 -gUnknown_085E4FC0:: @ 85E4FC0 - .4byte gUnknown_085E4FB8 - - .align 2 -gUnknown_085E4FC4:: @ 85E4FC4 - spr_template 0x07d2, 0x07d2, gUnknown_085E4FB0, gUnknown_085E4FC0, NULL, gDummySpriteAffineAnimTable, sub_816FEDC - - .align 2 -gUnknown_085E4FDC:: @ 85E4FDC - obj_tiles gIntroTiles, 0x1400, 0x07d0 - null_obj_tiles - -gUnknown_085E4FEC:: @ 85E4FEC - obj_tiles gIntro1FlygonGfx, 0x0400, 0x07d2 - null_obj_tiles - - .align 2 -gUnknown_085E4FFC:: @ 85E4FFC - obj_pal gIntro1DropsPal, 0x07d0 - obj_pal gIntro1GFLogoPal, 0x07d1 - obj_pal gIntro1FlygonPal, 0x07d2 - null_obj_pal - - .align 2 -gUnknown_085E501C:: @ 85E501C - .byte 0xa0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_085E5024:: @ 85E5024 - .2byte 0x0010, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085E502C:: @ 85E502C - .4byte gUnknown_085E5024 - - .align 2 -gUnknown_085E5030:: @ 85E5030 - spr_template 0x07d3, 0x07d3, gUnknown_085E501C, gUnknown_085E502C, NULL, gDummySpriteAffineAnimTable, sub_8170040 - - .align 2 -gUnknown_085E5048:: @ 85E5048 - obj_tiles gIntro3MiscTiles, 0x0a00, 0x07d3 - null_obj_tiles - -gUnknown_085E5058:: @ 85E5058 - obj_pal gIntro3Misc1Pal, 0x07d3 - null_obj_pal - diff --git a/data/intro_credits_graphics.s b/data/intro_credits_graphics.s deleted file mode 100644 index 636c1a8fb..000000000 --- a/data/intro_credits_graphics.s +++ /dev/null @@ -1,459 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - .align 2 -gUnknown_085F06E0:: @ 85F06E0 - .incbin "graphics/intro/intro2_grass.gbapal" - - .align 2 -gUnknown_085F0700:: @ 85F0700 - .incbin "graphics/intro/intro2_grass_afternoon.gbapal" - - .align 2 -gUnknown_085F0720:: @ 85F0720 - .incbin "graphics/intro/intro2_grass_night.gbapal" - - .align 2 -gUnknown_085F0740:: @ 85F0740 - .incbin "graphics/intro/intro2_grass.4bpp.lz" - - .align 2 -gUnknown_085F0BC0:: @ 85F0BC0 - .incbin "graphics/intro/intro2_grass_map.bin.lz" - - .align 2 -gUnknown_085F0CFC:: @ 85F0CFC - .incbin "graphics/intro/85F0CFC.gbapal" - - .align 2 -gUnknown_085F0D5C:: @ 85F0D5C - .incbin "graphics/intro/85F0D5C.gbapal" - - .align 2 -gUnknown_085F0DBC:: @ 85F0DBC - .incbin "graphics/intro/intro2_bgclouds.4bpp.lz" - - .align 2 -gUnknown_085F1398:: @ 85F1398 - .incbin "graphics/intro/intro2_bgclouds_map.bin.lz" - - .align 2 -gUnknown_085F1668:: @ 85F1668 - .incbin "graphics/intro/intro2_bgclouds.gbapal" - - .align 2 -gUnknown_085F1688:: @ 85F1688 - .incbin "graphics/intro/intro2_bgclouds_afternoon.gbapal" - - .align 2 -gUnknown_085F16A8:: @ 85F16A8 - .incbin "graphics/intro/intro2_bgclouds2.4bpp.lz" - - .align 2 -gUnknown_085F17E4:: @ 85F17E4 - .incbin "graphics/intro/intro2_bgtrees2.gbapal" - - .align 2 -gUnknown_085F1804:: @ 85F1804 - .incbin "graphics/intro/intro2_bgtrees2_afternoon.gbapal" - - .align 2 -gUnknown_085F1824:: @ 85F1824 - .incbin "graphics/intro/intro2_bgtrees.4bpp.lz" - - .align 2 -gUnknown_085F1EAC:: @ 85F1EAC - .incbin "graphics/intro/intro2_bgtrees_map.bin.lz" - - .align 2 -gUnknown_085F21B0:: @ 85F21B0 - .incbin "graphics/intro/intro2_bgtrees.gbapal" - - .align 2 -gIntro2TreeGfx:: @ 85F21D0 - .incbin "graphics/intro/intro2_bgtreessmall.4bpp.lz" - - .align 2 -gUnknown_085F231C:: @ 85F231C - .incbin "graphics/intro/85F231C.gbapal" - - .align 2 -gUnknown_085F235C:: @ 85F235C - .incbin "graphics/intro/intro2_bgnight.4bpp.lz" - - .align 2 -gUnknown_085F2548:: @ 85F2548 - .incbin "graphics/intro/intro2_bgnight.gbapal" - - .align 2 -gUnknown_085F2568:: @ 85F2568 - .incbin "graphics/intro/intro2_bgnight_map.bin.lz" - - .align 2 -gIntro2NightGfx:: @ 85F2814 - .incbin "graphics/intro/intro2_night.4bpp.lz" - - .align 2 -gIntro2BrendanPal:: @ 85F2898 - .incbin "graphics/intro/intro2_brendan.gbapal" - - .align 2 -gIntro2BrendanGfx:: @ 85F28B8 - .incbin "graphics/intro/intro2_brendan.4bpp.lz" - - .align 2 -gIntro2MayPal:: @ 85F3470 - .incbin "graphics/intro/intro2_may.gbapal" - - .align 2 -gUnknown_085F3490:: @ 85F3490 - .space 0x1E0 - - .align 2 -gIntro2MayGfx:: @ 85F3670 - .incbin "graphics/intro/intro2_may.4bpp.lz" - - .align 2 -gIntro2BicycleGfx:: @ 85F4318 - .incbin "graphics/intro/intro2_bicycle.4bpp.lz" - - .align 2 -gIntro2LatiosPal:: @ 85F4744 - .incbin "graphics/intro/intro2_latios.gbapal" - - .align 2 -gIntro2LatiosGfx:: @ 85F4764 - .incbin "graphics/intro/intro2_latios.4bpp.lz" - - .align 2 -gIntro2LatiasPal:: @ 85F4C08 - .incbin "graphics/intro/intro2_latias.gbapal" - - .align 2 -gIntro2LatiasGfx:: @ 85F4C28 - .incbin "graphics/intro/intro2_latias.4bpp.lz" - - .align 2 -gUnknown_085F504C:: @ 85F504C - spr_template 0x07d0, 0xffff, gDummyOamData, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_817B62C - - .align 2 -gUnknown_085F5064:: @ 85F5064 - obj_tiles gUnknown_085F16A8, 0x0400, 0x07d0 - null_obj_tiles - - .align 2 -gUnknown_085F5074:: @ 85F5074 - obj_image_anim_frame 0, 30 - obj_image_anim_end - - .align 2 -gUnknown_085F507C:: @ 85F507C - obj_image_anim_frame 16, 30 - obj_image_anim_end - - .align 2 -gUnknown_085F5084:: @ 85F5084 - obj_image_anim_frame 20, 30 - obj_image_anim_end - - .align 2 -gUnknown_085F508C:: @ 85F508C - obj_image_anim_frame 22, 30 - obj_image_anim_end - - .align 2 -gUnknown_085F5094:: @ 85F5094 - .4byte gUnknown_085F5074 - .4byte gUnknown_085F507C - .4byte gUnknown_085F5084 - .4byte gUnknown_085F508C - - .align 2 -gUnknown_085F50A4:: @ 85F50A4 - .byte -128, 72, 32, 100 - .2byte 0xC00 - .space 2 - .byte -128, -98, 32, 100 - .2byte 0xC00 - .space 2 - .byte 65, -64, 40, 101 - .2byte 0x800 - .space 2 - .byte 65, 56, 40, 101 - .2byte 0x800 - .space 2 - .byte 18, 100, 44, 102 - .2byte 0x400 - .space 2 - .byte 18, -104, 44, 102 - .2byte 0x400 - .space 2 - .byte 19, 8, 46, 103 - .2byte 0x100 - .space 2 - .byte 19, 56, 46, 103 - .2byte 0x100 - .space 2 - .byte 19, -16, 46, 103 - .2byte 0x100 - .space 2 - - .align 2 -gUnknown_085F50EC:: @ 85F50EC - obj_tiles gIntro2TreeGfx, 0x0400, 0x07d0 - null_obj_tiles - - .align 2 -gUnknown_085F50FC:: @ 85F50FC - obj_image_anim_frame 0, 30 - obj_image_anim_end - - .align 2 -gUnknown_085F5104:: @ 85F5104 - obj_image_anim_frame 16, 30 - obj_image_anim_end - - .align 2 -gUnknown_085F510C:: @ 85F510C - obj_image_anim_frame 24, 30 - obj_image_anim_end - - .align 2 -gUnknown_085F5114:: @ 85F5114 - .4byte gUnknown_085F50FC - .4byte gUnknown_085F5104 - .4byte gUnknown_085F510C - - .align 2 -gUnknown_085F5120:: @ 85F5120 - .byte -128, 16, 88, 100 - .2byte 0x2000 - .space 2 - .byte -128, 80, 88, 100 - .2byte 0x2000 - .space 2 - .byte -128, -112, 88, 100 - .2byte 0x2000 - .space 2 - .byte -128, -48, 88, 100 - .2byte 0x2000 - .space 2 - .byte -95, 40, 88, 101 - .2byte 0x1000 - .space 2 - .byte -95, 104, 88, 101 - .2byte 0x1000 - .space 2 - .byte -95, -88, 88, 101 - .2byte 0x1000 - .space 2 - .byte -95, -24, 88, 101 - .2byte 0x1000 - .space 2 - .byte -94, 56, 88, 102 - .2byte 0x800 - .space 2 - .byte -94, 120, 88, 102 - .2byte 0x800 - .space 2 - .byte -94, -72, 88, 102 - .2byte 0x800 - .space 2 - .byte -94, -8, 88, 102 - .2byte 0x800 - .space 2 - - .align 2 -gUnknown_085F5180:: @ 85F5180 - obj_tiles gIntro2NightGfx, 0x0400, 0x07d0 - null_obj_tiles - - .align 2 -gUnknown_085F5190:: @ 85F5190 - obj_image_anim_frame 0, 30 - obj_image_anim_end - - .align 2 -gUnknown_085F5198:: @ 85F5198 - .4byte gUnknown_085F5190 - - .align 2 -gUnknown_085F519C:: @ 85F519C - .byte -128, 24, 88, 100 - .2byte 0x1000 - .space 2 - .byte -128, 64, 88, 100 - .2byte 0x1000 - .space 2 - .byte -128, 104, 88, 100 - .2byte 0x1000 - .space 2 - .byte -128, -112, 88, 100 - .2byte 0x1000 - .space 2 - .byte -128, -72, 88, 100 - .2byte 0x1000 - .space 2 - .byte -128, -32, 88, 100 - .2byte 0x1000 - .space 2 - - .align 2 -gOamData_85F51CC:: @ 85F51CC - .2byte 0x00A0 - .2byte 0xC000 - .2byte 0x0400 - - .align 2 -gUnknown_085F51D4:: @ 85F51D4 - obj_image_anim_frame 0, 8 - obj_image_anim_frame 64, 8 - obj_image_anim_frame 128, 8 - obj_image_anim_frame 192, 8 - obj_image_anim_jump 0 - - .align 2 -gUnknown_085F51E8:: @ 85F51E8 - .4byte gUnknown_085F51D4 - - .align 2 -gUnknown_085F51EC:: @ 85F51EC - spr_template 0x03ea, 0x03ea, gOamData_85F51CC, gUnknown_085F51E8, NULL, gDummySpriteAffineAnimTable, nullsub_65 - - .align 2 -gUnknown_085F5204:: @ 85F5204 - spr_template 0x03eb, 0x03eb, gOamData_85F51CC, gUnknown_085F51E8, NULL, gDummySpriteAffineAnimTable, nullsub_65 - - .align 2 -gUnknown_085F521C:: @ 85F521C - .2byte 0x40A0 - .2byte 0xC000 - .2byte 0x0400 - - .align 2 -gUnknown_085F5224:: @ 85F5224 - obj_image_anim_frame 0, 8 - obj_image_anim_frame 32, 8 - obj_image_anim_frame 64, 8 - obj_image_anim_frame 96, 8 - obj_image_anim_jump 0 - - .align 2 -gUnknown_085F5238:: @ 85F5238 - .4byte gUnknown_085F5224 - - .align 2 -gUnknown_085F523C:: @ 85F523C - spr_template 0x03e9, 0x03ea, gUnknown_085F521C, gUnknown_085F5238, NULL, gDummySpriteAffineAnimTable, sub_817B7C4 - - .align 2 -gUnknown_085F5254:: @ 85F5254 - spr_template 0x03e9, 0x03eb, gUnknown_085F521C, gUnknown_085F5238, NULL, gDummySpriteAffineAnimTable, sub_817B7C4 - - .align 2 -gUnknown_085F526C:: @ 85F526C - .2byte 0x00A0 - .2byte 0xC000 - .2byte 0x0400 - - .align 2 -gUnknown_085F5274:: @ 85F5274 - obj_image_anim_frame 0, 16 - obj_image_anim_end - - .align 2 -gUnknown_085F527C:: @ 85F527C - obj_image_anim_frame 64, 16 - obj_image_anim_end - - .align 2 -gUnknown_085F5284:: @ 85F5284 - .4byte gUnknown_085F5274 - .4byte gUnknown_085F527C - - .align 2 -gUnknown_085F528C:: @ 85F528C - spr_template 0x03ec, 0x03ec, gUnknown_085F526C, gUnknown_085F5284, NULL, gDummySpriteAffineAnimTable, nullsub_66 - - .align 2 -gUnknown_085F52A4:: @ 85F52A4 - spr_template 0x03ed, 0x03ed, gUnknown_085F526C, gUnknown_085F5284, NULL, gDummySpriteAffineAnimTable, nullsub_66 - - .align 2 -gUnknown_085F52BC:: @ 85F52BC - obj_tiles gIntro2BrendanNoTurnGfx, 0x2000, 0x03ea - null_obj_tiles - - .align 2 -gUnknown_085F52CC:: @ 85F52CC - obj_tiles gIntro2MayNoTurnGfx, 0x2000, 0x03eb - null_obj_tiles - - .align 2 -gUnknown_085F52DC:: @ 85F52DC - obj_tiles gIntro2BicycleGfx, 0x1000, 0x03e9 - null_obj_tiles - - .align 2 -gUnknown_085F52EC:: @ 85F52EC - obj_tiles gIntro2FlygonGfx, 0x1000, 0x03ec - null_obj_tiles - - .align 2 -gUnknown_085F52FC:: @ 85F52FC - obj_tiles gIntro2FlygonGfx, 0x1000, 0x03ed - null_obj_tiles - - .align 2 -gUnknown_085F530C:: @ 85F530C - obj_pal gIntro2BrendanNoTurnPal, 0x03ea - obj_pal gIntro2BrendanNoTurnPal, 0x03eb - obj_pal gIntro2FlygonPal, 0x03ec - obj_pal gIntro2FlygonPal, 0x03ed - null_obj_pal - - .align 2 -gUnknown_085F5334:: @ 85F5334 - obj_tiles gIntro2BrendanGfx, 0x3800, 0x03ea - null_obj_tiles - - .align 2 -gUnknown_085F5344:: @ 85F5344 - obj_tiles gIntro2MayGfx, 0x3800, 0x03eb - null_obj_tiles - - .align 2 -gUnknown_085F5354:: @ 85F5354 - obj_tiles gIntro2BicycleGfx, 0x1000, 0x03e9 - null_obj_tiles - - .align 2 -gUnknown_085F5364:: @ 85F5364 - obj_tiles gIntro2LatiosGfx, 0x1000, 0x03ec - null_obj_tiles - - .align 2 -gUnknown_085F5374:: @ 85F5374 - obj_tiles gIntro2LatiasGfx, 0x1000, 0x03ed - null_obj_pal - - .align 2 -gUnknown_085F5384:: @ 85F5384 - obj_pal gIntro2BrendanPal, 0x03ea - obj_pal gIntro2MayPal, 0x03eb - obj_pal gIntro2LatiosPal, 0x03ec - obj_pal gIntro2LatiasPal, 0x03ed - null_obj_pal - - .align 2 -gUnknown_085F53AC:: @ 85F53AC - obj_tiles gIntro2BrendanGfx, 0x2000, 0x03ea - null_obj_tiles - - .align 2 -gUnknown_085F53BC:: @ 85F53BC - obj_tiles gIntro2MayGfx, 0x2000, 0x03eb - null_obj_tiles diff --git a/include/credits.h b/include/credits.h new file mode 100644 index 000000000..faad1058a --- /dev/null +++ b/include/credits.h @@ -0,0 +1,11 @@ +#ifndef GUARD_CREDITS_H +#define GUARD_CREDITS_H + +// Exported type declarations + +// Exported RAM declarations +extern EWRAM_DATA bool8 gHasHallOfFameRecords; + +// Exported ROM declarations + +#endif //GUARD_CREDITS_H diff --git a/include/decompress.h b/include/decompress.h index b7515250a..34a678cda 100644 --- a/include/decompress.h +++ b/include/decompress.h @@ -28,7 +28,6 @@ void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 void LoadSpecialPokePic_2(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFrontPic); void LoadSpecialPokePic_DontHandleDeoxys(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFrontPic); -extern u8 gDecompressionBuffer[]; u32 sub_8034974(const u8 *ptr); #endif // GUARD_DECOMPRESS_H diff --git a/include/gba/io_reg.h b/include/gba/io_reg.h index c1abcc94c..03fe505b5 100644 --- a/include/gba/io_reg.h +++ b/include/gba/io_reg.h @@ -624,23 +624,6 @@ #define TIMER_INTR_ENABLE 0x40 #define TIMER_ENABLE 0x80 -// BGCNT -#define BGCNT_PRIORITY(n) (n) // Values 0 - 3. Lower priority BGs will be drawn on top of higher priority BGs. -#define BGCNT_CHARBASE(n) ((n) << 2) // Values 0 - 3. Base block for tile pixel data. -#define BGCNT_MOSAIC 0x0040 -#define BGCNT_16COLOR 0x0000 // 4 bits per pixel -#define BGCNT_256COLOR 0x0080 // 8 bits per pixel -#define BGCNT_SCREENBASE(n) ((n) << 8) // Values 0 - 31. Base block for tile map. -#define BGCNT_WRAP 0x2000 // Only affects affine BGs. Text BGs wrap by default. -#define BGCNT_TXT256x256 0x0000 // Internal screen size size of text mode BG in pixels. -#define BGCNT_TXT512x256 0x4000 -#define BGCNT_TXT256x512 0x8000 -#define BGCNT_TXT512x512 0xC000 -#define BGCNT_AFF128x128 0x0000 // Internal screen size size of affine mode BG in pixels. -#define BGCNT_AFF256x256 0x4000 -#define BGCNT_AFF512x512 0x8000 -#define BGCNT_AFF1024x1024 0xC000 - // serial #define SIO_ID 0x0030 // Communication ID diff --git a/include/global.h b/include/global.h index 8c56c0a58..f88203c90 100644 --- a/include/global.h +++ b/include/global.h @@ -35,6 +35,12 @@ // Converts a number to Q4.12 fixed-point format #define Q_4_12(n) ((s16)((n) * 4096)) +// Converts a Q8.8 fixed-point format number to a regular integer +#define Q_8_8_TO_INT(n) ((int)((n) / 256)) + +// Converts a Q4.12 fixed-point format number to a regular integer +#define Q_4_12_TO_INT(n) ((int)((n) / 4096)) + #define PARTY_SIZE 6 #define POKEMON_NAME_LENGTH 10 diff --git a/include/graphics.h b/include/graphics.h index 6e5de9ef4..e0c9431ac 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2725,4 +2725,49 @@ extern const u16 gBagScreenFemale_Pal[]; extern const u16 gBagScreenMale_Pal[]; extern const u8 gBagMenuHMIcon_Gfx[]; +//intro graphics +extern const u8 gIntro1SparkleGfx[]; +extern const u8 gIntro1FlygonGfx[]; +extern const u16 gIntro3LightningPal[]; +extern const u8 gIntroCopyright_Gfx[]; +extern const u8 gIntroCopyright_Tilemap[]; +extern const u16 gIntroCopyright_Pal[16]; +extern const u8 gIntro2VolbeatGfx[]; +extern const u8 gIntro2TorchicGfx[]; +extern const u8 gIntro2ManectricGfx[]; +extern const u16 gIntro2VolbeatPal[]; +extern const u16 gIntro2TorchicPal[]; +extern const u16 gIntro2ManectricPal[]; +extern const u8 gIntro2BubblesGfx[]; +extern const u16 gIntro2BubblesPal[]; +extern const u8 gIntro3LightningGfx[]; +extern const u8 gIntro3GroudonGfx[]; +extern const u8 gIntro3GroudonTilemap[]; +extern const u8 gIntro3LegendBgGfx[]; +extern const u8 gIntro3GroudonBgTilemap[]; +extern const u8 gIntro3GroudonBgTilemap[]; +extern const u8 gIntro3BgPal[0x200]; +extern const u8 gIntro3KyogreGfx[]; +extern const u8 gIntro3KyogreTilemap[]; +extern const u8 gIntro3KyogreBgTilemap[]; +extern const u8 gIntro3CloudsGfx[]; +extern const u8 gIntro3Clouds1Tilemap[]; +extern const u8 gIntro3Clouds2Tilemap[]; +extern const u8 gIntro3Clouds3Tilemap[]; +extern const u8 gIntro3Clouds4Tilemap[]; +extern const u8 gIntro3RayquazaTilemap[]; +extern const u8 gIntro3RayquazaGfx[]; +extern const u8 gIntro3Clouds2Gfx[]; +extern const u16 gIntro1GameFreakTextFadePal[]; + +//intro/credits graphics +extern const u8 gIntro2BrendanNoTurnGfx[]; +extern const u8 gIntro2MayNoTurnGfx[]; +extern const u16 gIntro2BrendanNoTurnPal[]; +extern const u16 gIntro2FlygonPal[]; +extern const u8 gIntro2FlygonGfx[]; + +//credits +extern const u8 gCreditsCopyrightEnd_Gfx[]; + #endif //GUARD_GRAPHICS_H diff --git a/include/intro.h b/include/intro.h index aae3438fe..b1bfe20a4 100644 --- a/include/intro.h +++ b/include/intro.h @@ -6,7 +6,7 @@ // Exported RAM declarations // Exported ROM declarations -void c2_copyright_1(void); +void CB2_InitCopyrightScreenAfterBootup(void); void CB2_InitCopyrightScreenAfterBootup(void); void CB2_InitCopyrightScreenAfterTitleScreen(void); void sub_816F2A8(u16, u16, u16, u16); diff --git a/include/intro_credits_graphics.h b/include/intro_credits_graphics.h new file mode 100644 index 000000000..354d62e05 --- /dev/null +++ b/include/intro_credits_graphics.h @@ -0,0 +1,30 @@ +#ifndef GUARD_INTRO_CREDITS_GRAPHICS_H +#define GUARD_INTRO_CREDITS_GRAPHICS_H + +extern u16 gUnknown_0203BD24; +extern s16 gUnknown_0203BD26; +extern s16 gUnknown_0203BD28; + +extern const struct CompressedSpriteSheet gIntro2BrendanSpriteSheet[]; +extern const struct CompressedSpriteSheet gIntro2MaySpriteSheet[]; +extern const struct CompressedSpriteSheet gIntro2BicycleSpriteSheet[]; +extern const struct CompressedSpriteSheet gIntro2FlygonSpriteSheet[]; +extern const struct SpritePalette gUnknown_085F530C[]; +extern const struct CompressedSpriteSheet gUnknown_085F5334[]; +extern const struct CompressedSpriteSheet gUnknown_085F5344[]; +extern const struct CompressedSpriteSheet gUnknown_085F5354[]; +extern const struct CompressedSpriteSheet gUnknown_085F53AC[]; +extern const struct CompressedSpriteSheet gUnknown_085F53BC[]; +extern const struct SpritePalette gUnknown_085F5384[]; + +void load_intro_part2_graphics(u8 a); +void sub_817B150(u8 a); +void sub_817B1C8(u8); +void sub_817B3A8(u8); +u8 sub_817B3DC(u8 a, u16 b, u16 c, u16 d); +void sub_817B540(u8); +u8 intro_create_brendan_sprite(s16 a, s16 b); +u8 intro_create_may_sprite(s16 a, s16 b); +u8 intro_create_flygon_sprite(s16 a, s16 b); + +#endif // GUARD_INTRO_CREDITS_GRAPHICS_H diff --git a/include/libgcnmultiboot.h b/include/libgcnmultiboot.h new file mode 100644 index 000000000..7d347df05 --- /dev/null +++ b/include/libgcnmultiboot.h @@ -0,0 +1,17 @@ +#ifndef GUARD_LIBGCMMULTIBOOT_H +#define GUARD_LIBGCNMULTIBOOT_H + +struct GcmbStruct +{ + u16 gcmb_field_0; + vu8 gcmb_field_2; + u8 filler3[0x2C - 0x3]; +}; + +void GameCubeMultiBoot_Main(struct GcmbStruct *pStruct); +void GameCubeMultiBoot_ExecuteProgram(struct GcmbStruct *pStruct); +void GameCubeMultiBoot_Init(struct GcmbStruct *pStruct); +void GameCubeMultiBoot_HandleSerialInterrupt(struct GcmbStruct *pStruct); +void GameCubeMultiBoot_Quit(void); + +#endif // GUARD_LIBGCNMULTIBOOT_H diff --git a/include/multiboot_pokemon_colosseum.h b/include/multiboot_pokemon_colosseum.h new file mode 100644 index 000000000..33e4bc33c --- /dev/null +++ b/include/multiboot_pokemon_colosseum.h @@ -0,0 +1,6 @@ +#ifndef GUARD_MULTIBOOT_POKEMON_COLOSSEUM_H +#define GUARD_MULTIBOOT_POKEMON_COLOSSEUM_H + +extern const u16 gMultiBootProgram_PokemonColosseum_Start[0x14000]; + +#endif // GUARD_MULTIBOOT_POKEMON_COLOSSEUM_H diff --git a/include/pokedex.h b/include/pokedex.h index d3cb670c8..19e1162e2 100644 --- a/include/pokedex.h +++ b/include/pokedex.h @@ -17,7 +17,6 @@ enum }; s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId); -u16 GetNationalPokedexCount(u8); -u16 GetHoennPokedexCount(u8); +u16 sub_80C0E9C(u16, s16, s16, u16); #endif // GUARD_POKEDEX_H diff --git a/include/save.h b/include/save.h index 3bd1ff8cf..f06db2955 100644 --- a/include/save.h +++ b/include/save.h @@ -47,19 +47,19 @@ enum // Do save types enum { - NORMAL_SAVE, - LINK_SAVE, - //EREADER_SAVE, // depreciated in Emerald - LINK2_SAVE, // unknown 2nd link save - HOF_SAVE, - DIFFERENT_FILE_SAVE, - HOF_DELETE_SAVE // unused + SAVE_NORMAL, + SAVE_LINK, + //EREADER_SAVE, // deprecated in Emerald + SAVE_LINK2, // unknown 2nd link save + SAVE_HALL_OF_FAME, + SAVE_OVERWRITE_DIFFERENT_FILE, + SAVE_HALL_OF_FAME_ERASE_BEFORE // unused }; #define SECTION_ID_RECORDED_BATTLE 31 void ClearSaveData(void); -void ResetSaveCounters(void); +void Save_ResetSaveCounters(void); bool32 SetDamagedSectorBits(u8 op, u8 bit); u8 save_write_to_flash(u16 a1, const struct SaveSectionLocation *location); u8 HandleWriteSector(u16 a1, const struct SaveSectionLocation *location); @@ -88,7 +88,7 @@ u8 sub_81533E0(void); u8 sub_8153408(void); u8 sub_8153430(void); bool8 sub_8153474(void); -u8 sub_81534D0(u8 a1); +u8 Save_LoadGameData(u8 a1); u16 sub_815355C(void); u32 TryCopySpecialSaveSection(u8 sector, u8* dst); u32 sub_8153634(u8 sector, u8* src); diff --git a/include/starter_choose.h b/include/starter_choose.h index 61bc17735..18af478aa 100644 --- a/include/starter_choose.h +++ b/include/starter_choose.h @@ -1,6 +1,11 @@ #ifndef GUARD_STARTER_CHOOSE_H #define GUARD_STARTER_CHOOSE_H +extern const u16 gBirchBagGrassPal[2][16]; +extern const u8 gBirchBagTilemap[]; +extern const u8 gBirchGrassTilemap[]; +extern const u8 gBirchHelpGfx[]; + u16 GetStarterPokemon(u16 chosenStarterId); void CB2_ChooseStarter(void); diff --git a/ld_script.txt b/ld_script.txt index 979fcf6ea..2adabb59e 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -218,12 +218,12 @@ SECTIONS { asm/use_pokeblock.o(.text); src/battle_controller_wally.o(.text); asm/player_pc.o(.text); - asm/intro.o(.text); + src/intro.o(.text); src/reset_save_heap.o(.text); src/field_region_map.o(.text); asm/battle_anim_8170478.o(.text); src/hall_of_fame.o(.text); - asm/credits.o(.text); + src/credits.o(.text); src/lottery_corner.o(.text); src/diploma.o(.text); src/berry_tag_screen.o(.text); @@ -232,7 +232,7 @@ SECTIONS { src/braille_puzzles.o(.text); src/pokeblock_feed.o(.text); src/clear_save_data_screen.o(.text); - asm/intro_credits_graphics.o(.text); + src/intro_credits_graphics.o(.text); src/evolution_graphics.o(.text); src/bard_music.o(.text); src/fldeff_teleport.o(.text); @@ -494,11 +494,11 @@ SECTIONS { data/use_pokeblock.o(.rodata); src/battle_controller_wally.o(.rodata); data/player_pc.o(.rodata); - data/intro.o(.rodata); + src/intro.o(.rodata); src/field_region_map.o(.rodata); data/battle_anim_8170478.o(.rodata); src/hall_of_fame.o(.rodata); - data/credits.o(.rodata); + src/credits.o(.rodata); src/lottery_corner.o(.rodata); src/diploma.o(.rodata); data/strings.o(.rodata); @@ -508,7 +508,7 @@ SECTIONS { data/braille_puzzles.o(.rodata); src/pokeblock_feed.o(.rodata); src/clear_save_data_screen.o(.rodata); - data/intro_credits_graphics.o(.rodata); + src/intro_credits_graphics.o(.rodata); src/evolution_graphics.o(.rodata); src/bard_music.o(.rodata); data/battle_link_817C95C.o(.rodata); diff --git a/src/credits.c b/src/credits.c new file mode 100644 index 000000000..168f3e8a3 --- /dev/null +++ b/src/credits.c @@ -0,0 +1,2355 @@ +#include "global.h" +#include "palette.h" +#include "main.h" +#include "task.h" +#include "bg.h" +#include "malloc.h" +#include "window.h" +#include "text.h" +#include "menu.h" +#include "international_string_util.h" +#include "constants/songs.h" +#include "gpu_regs.h" +#include "m4a.h" +#include "constants/rgb.h" +#include "battle_dome_cards.h" +#include "starter_choose.h" +#include "decompress.h" +#include "intro_credits_graphics.h" +#include "sound.h" +#include "trig.h" +#include "graphics.h" +#include "pokedex.h" +#include "constants/vars.h" +#include "event_data.h" +#include "random.h" + +enum +{ + PAGE_TITLE, + PAGE_DIRECTOR, + PAGE_ART_DIRECTOR, + PAGE_WORLD_DIRECTOR, + PAGE_LEAD_PROGRAMMER, + PAGE_PROGRAMMERS_1, + PAGE_PROGRAMMERS_2, + PAGE_PROGRAMMERS_3, + PAGE_PROGRAMMERS_4, + PAGE_GRAPHIC_DESIGNERS_1, + PAGE_GRAPHIC_DESIGNERS_2, + PAGE_GRAPHIC_DESIGNERS_3, + PAGE_MUSIC_COMPOSITION, + PAGE_SOUND_EFFECTS, + PAGE_GAME_DESIGNERS_1, + PAGE_GAME_DESIGNERS_2, + PAGE_GAME_DESIGNERS_3, + PAGE_SCENARIO_PLOT, + PAGE_SCENARIO, + PAGE_SCRIPT_DESIGNERS, + PAGE_MAP_DESIGNERS, + PAGE_BATTLE_FRONTIER_DATA, + PAGE_PARAMETRIC_DESIGNERS, + PAGE_POKEDEX_TEXT, + PAGE_ENVIRONMENT_AND_TOOL_PROGRAMS_1, + PAGE_PKMN_DESIGNERS_1, + PAGE_PKMN_DESIGNERS_2, + PAGE_PKMN_DESIGNERS_3, + PAGE_PKMN_DESIGNERS_4, + PAGE_SUPPORT_PROGRAMMERS, + PAGE_NCL_PRODUCT_TESTING, + PAGE_PACKAGE_AND_MANUAL, + PAGE_SPECIAL_THANKS_1, + PAGE_SPECIAL_THANKS_2, + PAGE_SPECIAL_THANKS_3, + PAGE_SPECIAL_THANKS_4, + PAGE_INFORMATION_SUPERVISORS, + PAGE_ARTWORK_1, + PAGE_ARTWORK_2, + PAGE_ARTWORK_3, + PAGE_COORDINATORS, + PAGE_ENGLISH_VERSION, + PAGE_TRANSLATOR, + PAGE_TEXT_EDITOR, + PAGE_NCL_COORDINATOR, + PAGE_PROGRAMMERS_5, + PAGE_GRAPHIC_DESIGNER, + PAGE_ENVIRONMENT_AND_TOOL_PROGRAMS_2, + PAGE_NOA_TESTING, + PAGE_BRAILLE_CODE_CHECK_1, + PAGE_BRAILLE_CODE_CHECK_2, + PAGE_SPECIAL_THANKS_5, + PAGE_TASK_MANAGERS, + PAGE_PRODUCERS, + PAGE_EXECUTIVE_DIRECTOR, + PAGE_EXECUTIVE_PRODUCERS_1, + PAGE_EXECUTIVE_PRODUCERS_2, + PAGE_COUNT +}; + +#define COLOR_DARK_GREEN RGB(7, 11, 6) +#define COLOR_LIGHT_GREEN RGB(13, 20, 12) + +enum +{ + TDA_0 = 0, + TDA_TASK_C_ID = 1, + TDA_TASK_E_ID = 2, + TDA_TASK_D_ID = 3, + TDA_4 = 4, + TDA_PLAYER_CYCLIST = 5, + TDA_RIVAL_CYCLIST = 6, + TDA_7 = 7, // Has something to do with the bike scene + TDA_11 = 11, // Gets set depending on whether the bike or the grass scene should be shown + TDA_12 = 12, + TDA_13 = 13, + TDA_14 = 14, + TDA_TASK_B_ID = 15, + + // Appears to be responsible for text + TDB_0 = 0, + TDB_TASK_A_ID = 1, + TDB_CURRENT_PAGE = 2, + TDB_3 = 3, + + TDC_0 = 0, + TDC_1 = 1, + TDC_2 = 2, + TDC_3 = 3, + TDC_4 = 4, + TDC_5 = 5, + + TDD_STATE = 0, + TDD_TASK_A_ID = 1, + TDD_2 = 2, + TDD_3 = 3, + + TDE_0 = 0, + TDE_1 = 1, + TDE_TASK_A_ID = 2, +}; + +struct Unk201C000 +{ + u16 unk0[71]; + u16 unk8E; + u16 unk90; + u16 unk92; + u16 unk94; + u16 unk96[386]; + u16 unk39A; + u16 unk39C[7]; +}; + +struct CreditsEntry +{ + u8 var_0; + u8 var_1; + const u8 *text; +}; + +static EWRAM_DATA s16 gUnknown_0203BCE0 = 0; +static EWRAM_DATA u16 gUnknown_0203BCE2 = 0; // TASK A +EWRAM_DATA bool8 gHasHallOfFameRecords = 0; +static EWRAM_DATA u8 gUnknown_0203BCE5 = 0; +static EWRAM_DATA struct Unk201C000 *gUnknown_0203BCE8 = {0}; + +static const u16 gUnknown_085E56F0[][16] = +{ + INCBIN_U16("graphics/credits/credits_1.gbapal"), + INCBIN_U16("graphics/credits/credits_2.gbapal"), + INCBIN_U16("graphics/credits/credits_3.gbapal"), + INCBIN_U16("graphics/credits/credits_4.gbapal"), +}; + +static const u8 gCreditsCopyrightEnd_Gfx[] = INCBIN_U8("graphics/credits/the_end_copyright.4bpp.lz"); + +static void sub_81772B8(struct Sprite *sprite); + +static const u8 gUnknown_085E5BAC[] = +{ + 0, 1, 0, + 0xFF, 1, 0xFF, + 0xFF, 1, 0xFF, + 0xFF, 1, 0xFF, + 0xFF, 1, 0xFF, +}; + +static const u8 gUnknown_085E5BBB[] = +{ + 1, 0xFF, 1, + 1, 0xFF, 1, + 1, 2, 1, + 1, 0xFF, 1, + 1, 0xFF, 1, +}; + +static const u8 gUnknown_085E5BCA[] = +{ + 1, 0, 0, + 1, 0xFF, 0xFF, + 1, 2, 2, + 1, 0xFF, 0xFF, + 1, 0x80, 0x80, +}; + +static const u8 gUnknown_085E5BD9[] = +{ + 1, 3, 1, + 1, 4, 1, + 1, 5, 1, + 1, 0xC4, 1, + 1, 0xC3, 1, +}; + +static const u8 gUnknown_085E5BE8[] = +{ + 1, 6, 7, + 1, 8, 9, + 1, 0xFF, 1, + 1, 0x88, 0x89, + 1, 0x86, 0x87, +}; + +static const u8 gCreditsText_EmptyString[] = _(""); +static const u8 gCreditsText_PkmnEmeraldVersion[] = _("POKéMON EMERALD VERSION"); +static const u8 gCreditsText_Credits[] = _("Credits"); +static const u8 gCreditsText_ExecutiveDirector[] = _("Executive Director"); +static const u8 gCreditsText_Director[] = _("Director"); +static const u8 gCreditsText_ArtDirector[] = _("Art Director"); +static const u8 gCreditsText_BattleDirector[] = _("Battle Director"); +static const u8 gCreditsText_MainProgrammer[] = _("Main Programmer"); +static const u8 gCreditsText_BattleSystemPgrms[] = _("Battle System Programmers"); +static const u8 gCreditsText_FieldSystemPgrms[] = _("Field System Programmer"); +static const u8 gCreditsText_Programmers[] = _("Programmers"); +static const u8 gCreditsText_MainGraphicDesigner[] = _("Main Graphic Designer"); +static const u8 gCreditsText_GraphicDesigners[] = _("Graphic Designers"); +static const u8 gCreditsText_PkmnDesigners[] = _("POKéMON Designers"); +static const u8 gCreditsText_MusicComposition[] = _("Music Composition"); +static const u8 gCreditsText_SoundEffectsAndPkmnVoices[] = _("Sound Effects & POKéMON Voices"); +static const u8 gCreditsText_GameDesigners[] = _("Game Designers"); +static const u8 gCreditsText_ScenarioPlot[] = _("Scenario Plot"); +static const u8 gCreditsText_Scenario[] = _("Scenario"); +static const u8 gCreditsText_ScriptDesigners[] = _("Script Designers"); +static const u8 gCreditsText_MapDesigners[] = _("Map Designers"); +static const u8 gCreditsText_MapDataDesigners[] = _("Map Data Designers"); +static const u8 gCreditsText_ParametricDesigners[] = _("Parametric Designers"); +static const u8 gCreditsText_PokedexText[] = _("POKéDEX Text"); +static const u8 gCreditsText_EnvAndToolPgrms[] = _("Environment & Tool Programmers"); +static const u8 gCreditsText_NCLProductTesting[] = _("NCL Product Testing"); +static const u8 gCreditsText_SpecialThanks[] = _("Special Thanks"); +static const u8 gCreditsText_Coordinators[] = _("Coordinators"); +static const u8 gCreditsText_Producers[] = _("Producers"); +static const u8 gCreditsText_ExecProducers[] = _("Executive Producers"); +static const u8 gCreditsText_InfoSupervisors[] = _("Information Supervisors"); +static const u8 gCreditsText_TaskManagers[] = _("Task Managers"); +static const u8 gCreditsText_BrailleCodeCheck[] = _("Braille Code Check"); +static const u8 gCreditsText_WorldDirector[] = _("World Director"); +static const u8 gCreditsText_BattleFrontierData[] = _("Battle Frontier Data"); +static const u8 gCreditsText_SupportProgrammers[] = _("Support Programmers"); +static const u8 gCreditsText_Artwork[] = _("Artwork"); +static const u8 gCreditsText_LeadProgrammer[] = _("Lead Programmer"); +static const u8 gCreditsText_LeadGraphicArtist[] = _("Lead Graphic Artist"); +static const u8 gCreditsText_SatoshiTajiri[] = _("Satoshi Tajiri"); +static const u8 gCreditsText_JunichiMasuda[] = _("Junichi Masuda"); +static const u8 gCreditsText_KenSugimori[] = _("Ken Sugimori"); +static const u8 gCreditsText_ShigekiMorimoto[] = _("Shigeki Morimoto"); +static const u8 gCreditsText_TetsuyaWatanabe[] = _("Tetsuya Watanabe"); +static const u8 gCreditsText_HisashiSogabe[] = _("Hisashi Sogabe"); +static const u8 gCreditsText_SosukeTamada[] = _("Sosuke Tamada"); +static const u8 gCreditsText_AkitoMori[] = _("Akito Mori"); +static const u8 gCreditsText_KeitaKagaya[] = _("Keita Kagaya"); +static const u8 gCreditsText_YoshinoriMatsuda[] = _("Yoshinori Matsuda"); +static const u8 gCreditsText_HiroyukiNakamura[] = _("Hiroyuki Nakamura"); +static const u8 gCreditsText_MasaoTaya[] = _("Masao Taya"); +static const u8 gCreditsText_SatoshiNohara[] = _("Satoshi Nohara"); +static const u8 gCreditsText_TomomichiOhta[] = _("Tomomichi Ohta"); +static const u8 gCreditsText_MiyukiIwasawa[] = _("Miyuki Iwasawa"); +static const u8 gCreditsText_TakenoriOhta[] = _("Takenori Ohta"); +static const u8 gCreditsText_HironobuYoshida[] = _("Hironobu Yoshida"); +static const u8 gCreditsText_MotofumiFujiwara[] = _("Motofumi Fujiwara"); +static const u8 gCreditsText_SatoshiOhta[] = _("Satoshi Ohta"); +static const u8 gCreditsText_AsukaIwashita[] = _("Asuka Iwashita"); +static const u8 gCreditsText_AimiTomita[] = _("Aimi Tomita"); +static const u8 gCreditsText_TakaoUnno[] = _("Takao Unno"); +static const u8 gCreditsText_KanakoEo[] = _("Kanako Eo"); +static const u8 gCreditsText_JunOkutani[] = _("Jun Okutani"); +static const u8 gCreditsText_AtsukoNishida[] = _("Atsuko Nishida"); +static const u8 gCreditsText_MuneoSaito[] = _("Muneo Saito"); +static const u8 gCreditsText_RenaYoshikawa[] = _("Rena Yoshikawa"); +static const u8 gCreditsText_GoIchinose[] = _("Go Ichinose"); +static const u8 gCreditsText_MorikazuAoki[] = _("Morikazu Aoki"); +static const u8 gCreditsText_KojiNishino[] = _("Koji Nishino"); +static const u8 gCreditsText_KenjiMatsushima[] = _("Kenji Matsushima"); +static const u8 gCreditsText_TetsujiOhta[] = _("Tetsuji Ohta"); +static const u8 gCreditsText_HitomiSato[] = _("Hitomi Sato"); +static const u8 gCreditsText_TakeshiKawachimaru[] = _("Takeshi Kawachimaru"); +static const u8 gCreditsText_TeruyukiShimoyamada[] = _("Teruyuki Shimoyamada"); +static const u8 gCreditsText_ShigeruOhmori[] = _("Shigeru Ohmori"); +static const u8 gCreditsText_TadashiTakahashi[] = _("Tadashi Takahashi"); +static const u8 gCreditsText_ToshinobuMatsumiya[] = _("Toshinobu Matsumiya"); +static const u8 gCreditsText_AkihitoTomisawa[] = _("Akihito Tomisawa"); +static const u8 gCreditsText_HirokiEnomoto[] = _("Hiroki Enomoto"); +static const u8 gCreditsText_KazuyukiTerada[] = _("Kazuyuki Terada"); +static const u8 gCreditsText_YuriSakurai[] = _("Yuri Sakurai"); +static const u8 gCreditsText_HiromiSagawa[] = _("Hiromi Sagawa"); +static const u8 gCreditsText_KenjiTominaga[] = _("Kenji Tominaga"); +static const u8 gCreditsText_YoshioTajiri[] = _("Yoshio Tajiri"); +static const u8 gCreditsText_TeikoSasaki[] = _("Teiko Sasaki"); +static const u8 gCreditsText_SachikoHamano[] = _("Sachiko Hamano"); +static const u8 gCreditsText_ChieMatsumiya[] = _("Chie Matsumiya"); +static const u8 gCreditsText_AkikoShinozaki[] = _("Akiko Shinozaki"); +static const u8 gCreditsText_AstukoFujii[] = _("Astuko Fujii"); +static const u8 gCreditsText_NozomuSaito[] = _("Nozomu Saito"); +static const u8 gCreditsText_KenkichiToyama[] = _("Kenkichi Toyama"); +static const u8 gCreditsText_SuguruNakatsui[] = _("Suguru Nakatsui"); +static const u8 gCreditsText_YumiFunasaka[] = _("Yumi Funasaka"); +static const u8 gCreditsText_NaokoYanase[] = _("Naoko Yanase"); +static const u8 gCreditsText_NCLSuperMarioClub[] = _("NCL Super Mario Club"); +static const u8 gCreditsText_AtsushiTada[] = _("Atsushi Tada"); +static const u8 gCreditsText_TakahiroOhnishi[] = _("Takahiro Ohnishi"); +static const u8 gCreditsText_NorihideOkamura[] = _("Norihide Okamura"); +static const u8 gCreditsText_HiroNakamura[] = _("Hiro Nakamura"); +static const u8 gCreditsText_HiroyukiUesugi[] = _("Hiroyuki Uesugi"); +static const u8 gCreditsText_TerukiMurakawa[] = _("Teruki Murakawa"); +static const u8 gCreditsText_AkiraKinashi[] = _("Akira Kinashi"); +static const u8 gCreditsText_MichikoTakizawa[] = _("Michiko Takizawa"); +static const u8 gCreditsText_MakikoTakada[] = _("Makiko Takada"); +static const u8 gCreditsText_TakanaoKondo[] = _("Takanao Kondo"); +static const u8 gCreditsText_AiMashima[] = _("Ai Mashima"); +static const u8 gCreditsText_GakujiNomoto[] = _("Gakuji Nomoto"); +static const u8 gCreditsText_TakehiroIzushi[] = _("Takehiro Izushi"); +static const u8 gCreditsText_HitoshiYamagami[] = _("Hitoshi Yamagami"); +static const u8 gCreditsText_KyokoWatanabe[] = _("Kyoko Watanabe"); +static const u8 gCreditsText_TakaoNakano[] = _("Takao Nakano"); +static const u8 gCreditsText_HiroyukiJinnai[] = _("Hiroyuki Jinnai"); +static const u8 gCreditsText_HiroakiTsuru[] = _("Hiroaki Tsuru"); +static const u8 gCreditsText_TsunekazIshihara[] = _("Tsunekaz Ishihara"); +static const u8 gCreditsText_SatoruIwata[] = _("Satoru Iwata"); +static const u8 gCreditsText_KazuyaSuyama[] = _("Kazuya Suyama"); +static const u8 gCreditsText_SatoshiMitsuhara[] = _("Satoshi Mitsuhara"); +static const u8 gCreditsText_JapanBrailleLibrary[] = _("Japan Braille Library"); +static const u8 gCreditsText_TomotakaKomura[] = _("Tomotaka Komura"); +static const u8 gCreditsText_MikikoOhhashi[] = _("Mikiko Ohhashi"); +static const u8 gCreditsText_DaisukeHoshino[] = _("Daisuke Hoshino"); +static const u8 gCreditsText_KenjiroIto[] = _("Kenjiro Ito"); +static const u8 gCreditsText_RuiKawaguchi[] = _("Rui Kawaguchi"); +static const u8 gCreditsText_ShunsukeKohori[] = _("Shunsuke Kohori"); +static const u8 gCreditsText_SachikoNakamichi[] = _("Sachiko Nakamichi"); +static const u8 gCreditsText_FujikoNomura[] = _("Fujiko Nomura"); +static const u8 gCreditsText_KazukiYoshihara[] = _("Kazuki Yoshihara"); +static const u8 gCreditsText_RetsujiNomoto[] = _("Retsuji Nomoto"); +static const u8 gCreditsText_AzusaTajima[] = _("Azusa Tajima"); +static const u8 gCreditsText_ShusakuEgami[] = _("Shusaku Egami"); +static const u8 gCreditsText_PackageAndManual[] = _("Package & Manual Illustration"); +static const u8 gCreditsText_EnglishVersion[] = _("English Version Coordinators"); +static const u8 gCreditsText_Translator[] = _("Translator"); +static const u8 gCreditsText_TextEditor[] = _("Text Editor"); +static const u8 gCreditsText_NCLCoordinator[] = _("NCL Coordinator"); +static const u8 gCreditsText_GraphicDesigner[] = _("Graphic Designer"); +static const u8 gCreditsText_NOAProductTesting[] = _("NOA Product Testing"); +static const u8 gCreditsText_HideyukiNakajima[] = _("Hideyuki Nakajima"); +static const u8 gCreditsText_HidenoriSaeki[] = _("Hidenori Saeki"); +static const u8 gCreditsText_YokoWatanabe[] = _("Yoko Watanabe"); +static const u8 gCreditsText_SakaeKimura[] = _("Sakae Kimura"); +static const u8 gCreditsText_ChiakiShinkai[] = _("Chiaki Shinkai"); +static const u8 gCreditsText_SethMcMahill[] = _("Seth McMahill"); +static const u8 gCreditsText_NobOgasawara[] = _("Nob Ogasawara"); +static const u8 gCreditsText_TeresaLillygren[] = _("Teresa Lillygren"); +static const u8 gCreditsText_KimikoNakamichi[] = _("Kimiko Nakamichi"); +static const u8 gCreditsText_SouichiYamamoto[] = _("Souichi Yamamoto"); +static const u8 gCreditsText_YuichiroIto[] = _("Yuichiro Ito"); +static const u8 gCreditsText_ThomasHertzog[] = _("Thomas Hertzog"); +static const u8 gCreditsText_MikaKurosawa[] = _("Mika Kurosawa"); +static const u8 gCreditsText_NationalFederationBlind[] = _("National Federation of the Blind"); +static const u8 gCreditsText_PatriciaAMaurer[] = _("Patricia A. Maurer"); +static const u8 gCreditsText_EuropeanBlindUnion[] = _("European Blind Union"); +static const u8 gCreditsText_AustralianBrailleAuthority[] = _("Australian Braille Authority"); +static const u8 gCreditsText_RoyalNewZealandFederationBlind[] = _("Royal New Zealand Federation for the Blind"); +static const u8 gCreditsText_MotoyasuTojima[] = _("Motoyasu Tojima"); +static const u8 gCreditsText_NicolaPrattBarlow[] = _("Nicola Pratt-Barlow"); +static const u8 gCreditsText_ShellieDow[] = _("Shellie Dow"); +static const u8 gCreditsText_ErikJohnson[] = _("Erik Johnson"); +static const struct CreditsEntry gCreditsEntry_EmptyString[] = {0, 0, gCreditsText_EmptyString}; +static const struct CreditsEntry gCreditsEntry_PkmnEmeraldVersion[] = {7, 1, gCreditsText_PkmnEmeraldVersion}; +static const struct CreditsEntry gCreditsEntry_Credits[] = {11, 1, gCreditsText_Credits}; +static const struct CreditsEntry gCreditsEntry_ExecutiveDirector[] = {8, 1, gCreditsText_ExecutiveDirector}; +static const struct CreditsEntry gCreditsEntry_Director[] = {12, 1, gCreditsText_Director}; +static const struct CreditsEntry gCreditsEntry_ArtDirector[] = {10, 1, gCreditsText_ArtDirector}; +static const struct CreditsEntry gCreditsEntry_BattleDirector[] = {10, 1, gCreditsText_BattleDirector}; +static const struct CreditsEntry gCreditsEntry_MainProgrammer[] = {10, 1, gCreditsText_MainProgrammer}; +static const struct CreditsEntry gCreditsEntry_BattleSystemPgrms[] = {8, 1, gCreditsText_BattleSystemPgrms}; +static const struct CreditsEntry gCreditsEntry_FieldSystemPgrms[] = {7, 1, gCreditsText_FieldSystemPgrms}; +static const struct CreditsEntry gCreditsEntry_Programmers[] = {12, 1, gCreditsText_Programmers}; +static const struct CreditsEntry gCreditsEntry_MainGraphicDesigner[] = {7, 1, gCreditsText_MainGraphicDesigner}; +static const struct CreditsEntry gCreditsEntry_GraphicDesigners[] = {9, 1, gCreditsText_GraphicDesigners}; +static const struct CreditsEntry gCreditsEntry_PkmnDesigners[] = {10, 1, gCreditsText_PkmnDesigners}; +static const struct CreditsEntry gCreditsEntry_MusicComposition[] = {13, 1, gCreditsText_MusicComposition}; +static const struct CreditsEntry gCreditsEntry_SoundEffectsAndPkmnVoices[] = {4, 1, gCreditsText_SoundEffectsAndPkmnVoices}; +static const struct CreditsEntry gCreditsEntry_GameDesigners[] = {11, 1, gCreditsText_GameDesigners}; +static const struct CreditsEntry gCreditsEntry_ScenarioPlot[] = {11, 1, gCreditsText_ScenarioPlot}; +static const struct CreditsEntry gCreditsEntry_Scenario[] = {13, 1, gCreditsText_Scenario}; +static const struct CreditsEntry gCreditsEntry_ScriptDesigners[] = {10, 1, gCreditsText_ScriptDesigners}; +static const struct CreditsEntry gCreditsEntry_MapDesigners[] = {11, 1, gCreditsText_MapDesigners}; +static const struct CreditsEntry gCreditsEntry_MapDataDesigners[] = {9, 1, gCreditsText_MapDataDesigners}; +static const struct CreditsEntry gCreditsEntry_ParametricDesigners[] = {9, 1, gCreditsText_ParametricDesigners}; +static const struct CreditsEntry gCreditsEntry_PokedexText[] = {11, 1, gCreditsText_PokedexText}; +static const struct CreditsEntry gCreditsEntry_EnvAndToolPgrms[] = {6, 1, gCreditsText_EnvAndToolPgrms}; +static const struct CreditsEntry gCreditsEntry_NCLProductTesting[] = {11, 1, gCreditsText_NCLProductTesting}; +static const struct CreditsEntry gCreditsEntry_SpecialThanks[] = {10, 1, gCreditsText_SpecialThanks}; +static const struct CreditsEntry gCreditsEntry_Coordinators[] = {11, 1, gCreditsText_Coordinators}; +static const struct CreditsEntry gCreditsEntry_Producers[] = {11, 1, gCreditsText_Producers}; +static const struct CreditsEntry gCreditsEntry_ExecProducers[] = {7, 1, gCreditsText_ExecProducers}; +static const struct CreditsEntry gCreditsEntry_InfoSupervisors[] = {10, 1, gCreditsText_InfoSupervisors}; +static const struct CreditsEntry gCreditsEntry_TaskManagers[] = {8, 1, gCreditsText_TaskManagers}; +static const struct CreditsEntry gCreditsEntry_BrailleCodeCheck[] = {10, 1, gCreditsText_BrailleCodeCheck}; +static const struct CreditsEntry gCreditsEntry_WorldDirector[] = {10, 1, gCreditsText_WorldDirector}; +static const struct CreditsEntry gCreditsEntry_BattleFrontierData[] = {8, 1, gCreditsText_BattleFrontierData}; +static const struct CreditsEntry gCreditsEntry_SupportProgrammers[] = {10, 1, gCreditsText_SupportProgrammers}; +static const struct CreditsEntry gCreditsEntry_Artwork[] = {12, 1, gCreditsText_Artwork}; +static const struct CreditsEntry gCreditsEntry_LeadProgrammer[] = {10, 1, gCreditsText_LeadProgrammer}; +static const struct CreditsEntry gCreditsEntry_LeadGraphicArtist[] = {9, 1, gCreditsText_LeadGraphicArtist}; +static const struct CreditsEntry gCreditsEntry_SatoshiTajiri[] = {11, 0, gCreditsText_SatoshiTajiri}; +static const struct CreditsEntry gCreditsEntry_JunichiMasuda[] = {11, 0, gCreditsText_JunichiMasuda}; +static const struct CreditsEntry gCreditsEntry_KenSugimori[] = {11, 0, gCreditsText_KenSugimori}; +static const struct CreditsEntry gCreditsEntry_ShigekiMorimoto[] = {11, 0, gCreditsText_ShigekiMorimoto}; +static const struct CreditsEntry gCreditsEntry_TetsuyaWatanabe[] = {11, 0, gCreditsText_TetsuyaWatanabe}; +static const struct CreditsEntry gCreditsEntry_HisashiSogabe[] = {11, 0, gCreditsText_HisashiSogabe}; +static const struct CreditsEntry gCreditsEntry_SosukeTamada[] = {11, 0, gCreditsText_SosukeTamada}; +static const struct CreditsEntry gCreditsEntry_AkitoMori[] = {11, 0, gCreditsText_AkitoMori}; +static const struct CreditsEntry gCreditsEntry_KeitaKagaya[] = {11, 0, gCreditsText_KeitaKagaya}; +static const struct CreditsEntry gCreditsEntry_YoshinoriMatsuda[] = {11, 0, gCreditsText_YoshinoriMatsuda}; +static const struct CreditsEntry gCreditsEntry_HiroyukiNakamura[] = {11, 0, gCreditsText_HiroyukiNakamura}; +static const struct CreditsEntry gCreditsEntry_MasaoTaya[] = {11, 0, gCreditsText_MasaoTaya}; +static const struct CreditsEntry gCreditsEntry_SatoshiNohara[] = {11, 0, gCreditsText_SatoshiNohara}; +static const struct CreditsEntry gCreditsEntry_TomomichiOhta[] = {11, 0, gCreditsText_TomomichiOhta}; +static const struct CreditsEntry gCreditsEntry_MiyukiIwasawa[] = {11, 0, gCreditsText_MiyukiIwasawa}; +static const struct CreditsEntry gCreditsEntry_TakenoriOhta[] = {11, 0, gCreditsText_TakenoriOhta}; +static const struct CreditsEntry gCreditsEntry_HironobuYoshida[] = {11, 0, gCreditsText_HironobuYoshida}; +static const struct CreditsEntry gCreditsEntry_MotofumiFujiwara[] = {11, 0, gCreditsText_MotofumiFujiwara}; +static const struct CreditsEntry gCreditsEntry_SatoshiOhta[] = {11, 0, gCreditsText_SatoshiOhta}; +static const struct CreditsEntry gCreditsEntry_AsukaIwashita[] = {11, 0, gCreditsText_AsukaIwashita}; +static const struct CreditsEntry gCreditsEntry_AimiTomita[] = {11, 0, gCreditsText_AimiTomita}; +static const struct CreditsEntry gCreditsEntry_TakaoUnno[] = {11, 0, gCreditsText_TakaoUnno}; +static const struct CreditsEntry gCreditsEntry_KanakoEo[] = {11, 0, gCreditsText_KanakoEo}; +static const struct CreditsEntry gCreditsEntry_JunOkutani[] = {11, 0, gCreditsText_JunOkutani}; +static const struct CreditsEntry gCreditsEntry_AtsukoNishida[] = {11, 0, gCreditsText_AtsukoNishida}; +static const struct CreditsEntry gCreditsEntry_MuneoSaito[] = {11, 0, gCreditsText_MuneoSaito}; +static const struct CreditsEntry gCreditsEntry_RenaYoshikawa[] = {11, 0, gCreditsText_RenaYoshikawa}; +static const struct CreditsEntry gCreditsEntry_GoIchinose[] = {11, 0, gCreditsText_GoIchinose}; +static const struct CreditsEntry gCreditsEntry_MorikazuAoki[] = {11, 0, gCreditsText_MorikazuAoki}; +static const struct CreditsEntry gCreditsEntry_KojiNishino[] = {11, 0, gCreditsText_KojiNishino}; +static const struct CreditsEntry gCreditsEntry_KenjiMatsushima[] = {11, 0, gCreditsText_KenjiMatsushima}; +static const struct CreditsEntry gCreditsEntry_TetsujiOhta[] = {11, 0, gCreditsText_TetsujiOhta}; +static const struct CreditsEntry gCreditsEntry_HitomiSato[] = {11, 0, gCreditsText_HitomiSato}; +static const struct CreditsEntry gCreditsEntry_TakeshiKawachimaru[] = {11, 0, gCreditsText_TakeshiKawachimaru}; +static const struct CreditsEntry gCreditsEntry_TeruyukiShimoyamada[] = {11, 0, gCreditsText_TeruyukiShimoyamada}; +static const struct CreditsEntry gCreditsEntry_ShigeruOhmori[] = {11, 0, gCreditsText_ShigeruOhmori}; +static const struct CreditsEntry gCreditsEntry_TadashiTakahashi[] = {11, 0, gCreditsText_TadashiTakahashi}; +static const struct CreditsEntry gCreditsEntry_ToshinobuMatsumiya[] = {11, 0, gCreditsText_ToshinobuMatsumiya}; +static const struct CreditsEntry gCreditsEntry_AkihitoTomisawa[] = {11, 0, gCreditsText_AkihitoTomisawa}; +static const struct CreditsEntry gCreditsEntry_HirokiEnomoto[] = {11, 0, gCreditsText_HirokiEnomoto}; +static const struct CreditsEntry gCreditsEntry_KazuyukiTerada[] = {11, 0, gCreditsText_KazuyukiTerada}; +static const struct CreditsEntry gCreditsEntry_YuriSakurai[] = {11, 0, gCreditsText_YuriSakurai}; +static const struct CreditsEntry gCreditsEntry_HiromiSagawa[] = {11, 0, gCreditsText_HiromiSagawa}; +static const struct CreditsEntry gCreditsEntry_KenjiTominaga[] = {11, 0, gCreditsText_KenjiTominaga}; +static const struct CreditsEntry gCreditsEntry_YoshioTajiri[] = {11, 0, gCreditsText_YoshioTajiri}; +static const struct CreditsEntry gCreditsEntry_TeikoSasaki[] = {11, 0, gCreditsText_TeikoSasaki}; +static const struct CreditsEntry gCreditsEntry_SachikoHamano[] = {11, 0, gCreditsText_SachikoHamano}; +static const struct CreditsEntry gCreditsEntry_ChieMatsumiya[] = {11, 0, gCreditsText_ChieMatsumiya}; +static const struct CreditsEntry gCreditsEntry_AkikoShinozaki[] = {11, 0, gCreditsText_AkikoShinozaki}; +static const struct CreditsEntry gCreditsEntry_AstukoFujii[] = {11, 0, gCreditsText_AstukoFujii}; +static const struct CreditsEntry gCreditsEntry_NozomuSaito[] = {11, 0, gCreditsText_NozomuSaito}; +static const struct CreditsEntry gCreditsEntry_KenkichiToyama[] = {11, 0, gCreditsText_KenkichiToyama}; +static const struct CreditsEntry gCreditsEntry_SuguruNakatsui[] = {11, 0, gCreditsText_SuguruNakatsui}; +static const struct CreditsEntry gCreditsEntry_YumiFunasaka[] = {11, 0, gCreditsText_YumiFunasaka}; +static const struct CreditsEntry gCreditsEntry_NaokoYanase[] = {11, 0, gCreditsText_NaokoYanase}; +static const struct CreditsEntry gCreditsEntry_NCLSuperMarioClub[] = {11, 0, gCreditsText_NCLSuperMarioClub}; +static const struct CreditsEntry gCreditsEntry_AtsushiTada[] = {11, 0, gCreditsText_AtsushiTada}; +static const struct CreditsEntry gCreditsEntry_TakahiroOhnishi[] = {11, 0, gCreditsText_TakahiroOhnishi}; +static const struct CreditsEntry gCreditsEntry_NorihideOkamura[] = {11, 0, gCreditsText_NorihideOkamura}; +static const struct CreditsEntry gCreditsEntry_HiroNakamura[] = {11, 0, gCreditsText_HiroNakamura}; +static const struct CreditsEntry gCreditsEntry_HiroyukiUesugi[] = {11, 0, gCreditsText_HiroyukiUesugi}; +static const struct CreditsEntry gCreditsEntry_TerukiMurakawa[] = {11, 0, gCreditsText_TerukiMurakawa}; +static const struct CreditsEntry gCreditsEntry_AkiraKinashi[] = {11, 0, gCreditsText_AkiraKinashi}; +static const struct CreditsEntry gCreditsEntry_MichikoTakizawa[] = {11, 0, gCreditsText_MichikoTakizawa}; +static const struct CreditsEntry gCreditsEntry_MakikoTakada[] = {11, 0, gCreditsText_MakikoTakada}; +static const struct CreditsEntry gCreditsEntry_TakanaoKondo[] = {11, 0, gCreditsText_TakanaoKondo}; +static const struct CreditsEntry gCreditsEntry_AiMashima[] = {11, 0, gCreditsText_AiMashima}; +static const struct CreditsEntry gCreditsEntry_GakujiNomoto[] = {11, 0, gCreditsText_GakujiNomoto}; +static const struct CreditsEntry gCreditsEntry_TakehiroIzushi[] = {11, 0, gCreditsText_TakehiroIzushi}; +static const struct CreditsEntry gCreditsEntry_HitoshiYamagami[] = {11, 0, gCreditsText_HitoshiYamagami}; +static const struct CreditsEntry gCreditsEntry_KyokoWatanabe[] = {11, 0, gCreditsText_KyokoWatanabe}; +static const struct CreditsEntry gCreditsEntry_TakaoNakano[] = {11, 0, gCreditsText_TakaoNakano}; +static const struct CreditsEntry gCreditsEntry_HiroyukiJinnai[] = {11, 0, gCreditsText_HiroyukiJinnai}; +static const struct CreditsEntry gCreditsEntry_HiroakiTsuru[] = {11, 0, gCreditsText_HiroakiTsuru}; +static const struct CreditsEntry gCreditsEntry_TsunekazIshihara[] = {11, 0, gCreditsText_TsunekazIshihara}; +static const struct CreditsEntry gCreditsEntry_SatoruIwata[] = {11, 0, gCreditsText_SatoruIwata}; +static const struct CreditsEntry gCreditsEntry_KazuyaSuyama[] = {11, 0, gCreditsText_KazuyaSuyama}; +static const struct CreditsEntry gCreditsEntry_SatoshiMitsuhara[] = {11, 0, gCreditsText_SatoshiMitsuhara}; +static const struct CreditsEntry gCreditsEntry_JapanBrailleLibrary[] = {9, 0, gCreditsText_JapanBrailleLibrary}; +static const struct CreditsEntry gCreditsEntry_TomotakaKomura[] = {11, 0, gCreditsText_TomotakaKomura}; +static const struct CreditsEntry gCreditsEntry_MikikoOhhashi[] = {11, 0, gCreditsText_MikikoOhhashi}; +static const struct CreditsEntry gCreditsEntry_DaisukeHoshino[] = {11, 0, gCreditsText_DaisukeHoshino}; +static const struct CreditsEntry gCreditsEntry_KenjiroIto[] = {11, 0, gCreditsText_KenjiroIto}; +static const struct CreditsEntry gCreditsEntry_RuiKawaguchi[] = {11, 0, gCreditsText_RuiKawaguchi}; +static const struct CreditsEntry gCreditsEntry_ShunsukeKohori[] = {11, 0, gCreditsText_ShunsukeKohori}; +static const struct CreditsEntry gCreditsEntry_SachikoNakamichi[] = {11, 0, gCreditsText_SachikoNakamichi}; +static const struct CreditsEntry gCreditsEntry_FujikoNomura[] = {11, 0, gCreditsText_FujikoNomura}; +static const struct CreditsEntry gCreditsEntry_KazukiYoshihara[] = {11, 0, gCreditsText_KazukiYoshihara}; +static const struct CreditsEntry gCreditsEntry_RetsujiNomoto[] = {11, 0, gCreditsText_RetsujiNomoto}; +static const struct CreditsEntry gCreditsEntry_AzusaTajima[] = {11, 0, gCreditsText_AzusaTajima}; +static const struct CreditsEntry gCreditsEntry_ShusakuEgami[] = {11, 0, gCreditsText_ShusakuEgami}; +static const struct CreditsEntry gCreditsEntry_PackageAndManual[] = {0, 1, gCreditsText_PackageAndManual}; +static const struct CreditsEntry gCreditsEntry_EnglishVersion[] = {0, 1, gCreditsText_EnglishVersion}; +static const struct CreditsEntry gCreditsEntry_Translator[] = {0, 1, gCreditsText_Translator}; +static const struct CreditsEntry gCreditsEntry_TextEditor[] = {0, 1, gCreditsText_TextEditor}; +static const struct CreditsEntry gCreditsEntry_NCLCoordinator[] = {0, 1, gCreditsText_NCLCoordinator}; +static const struct CreditsEntry gCreditsEntry_GraphicDesigner[] = {0, 1, gCreditsText_GraphicDesigner}; +static const struct CreditsEntry gCreditsEntry_NOAProductTesting[] = {0, 1, gCreditsText_NOAProductTesting}; +static const struct CreditsEntry gCreditsEntry_HideyukiNakajima[] = {0, 0, gCreditsText_HideyukiNakajima}; +static const struct CreditsEntry gCreditsEntry_HidenoriSaeki[] = {0, 0, gCreditsText_HidenoriSaeki}; +static const struct CreditsEntry gCreditsEntry_YokoWatanabe[] = {0, 0, gCreditsText_YokoWatanabe}; +static const struct CreditsEntry gCreditsEntry_SakaeKimura[] = {0, 0, gCreditsText_SakaeKimura}; +static const struct CreditsEntry gCreditsEntry_ChiakiShinkai[] = {0, 0, gCreditsText_ChiakiShinkai}; +static const struct CreditsEntry gCreditsEntry_SethMcMahill[] = {0, 0, gCreditsText_SethMcMahill}; +static const struct CreditsEntry gCreditsEntry_NobOgasawara[] = {0, 0, gCreditsText_NobOgasawara}; +static const struct CreditsEntry gCreditsEntry_TeresaLillygren[] = {0, 0, gCreditsText_TeresaLillygren}; +static const struct CreditsEntry gCreditsEntry_KimikoNakamichi[] = {0, 0, gCreditsText_KimikoNakamichi}; +static const struct CreditsEntry gCreditsEntry_SouichiYamamoto[] = {0, 0, gCreditsText_SouichiYamamoto}; +static const struct CreditsEntry gCreditsEntry_YuichiroIto[] = {0, 0, gCreditsText_YuichiroIto}; +static const struct CreditsEntry gCreditsEntry_ThomasHertzog[] = {0, 0, gCreditsText_ThomasHertzog}; +static const struct CreditsEntry gCreditsEntry_MikaKurosawa[] = {0, 0, gCreditsText_MikaKurosawa}; +static const struct CreditsEntry gCreditsEntry_NationalFederationBlind[] = {0, 0, gCreditsText_NationalFederationBlind}; +static const struct CreditsEntry gCreditsEntry_PatriciaAMaurer[] = {0, 0, gCreditsText_PatriciaAMaurer}; +static const struct CreditsEntry gCreditsEntry_EuropeanBlindUnion[] = {0, 0, gCreditsText_EuropeanBlindUnion}; +static const struct CreditsEntry gCreditsEntry_AustralianBrailleAuthority[] = {0, 0, gCreditsText_AustralianBrailleAuthority}; +static const struct CreditsEntry gCreditsEntry_RoyalNewZealandFederationBlind[] = {0, 0, gCreditsText_RoyalNewZealandFederationBlind}; +static const struct CreditsEntry gCreditsEntry_MotoyasuTojima[] = {0, 0, gCreditsText_MotoyasuTojima}; +static const struct CreditsEntry gCreditsEntry_NicolaPrattBarlow[] = {0, 0, gCreditsText_NicolaPrattBarlow}; +static const struct CreditsEntry gCreditsEntry_ShellieDow[] = {0, 0, gCreditsText_ShellieDow}; +static const struct CreditsEntry gCreditsEntry_ErikJohnson[] = {0, 0, gCreditsText_ErikJohnson}; + +#define _ gCreditsEntry_EmptyString +static const struct CreditsEntry *const gCreditsEntryPointerTable[][5] = +{ + { + _, + gCreditsEntry_PkmnEmeraldVersion, + gCreditsEntry_Credits, + _, + _ + }, + { + _, + gCreditsEntry_Director, + gCreditsEntry_ShigekiMorimoto, + _, + _, + }, + { + _, + gCreditsEntry_ArtDirector, + gCreditsEntry_KenSugimori, + _, + _, + }, + { + _, + gCreditsEntry_WorldDirector, + gCreditsEntry_JunichiMasuda, + _, + _, + }, + { + gCreditsEntry_LeadProgrammer, + gCreditsEntry_HisashiSogabe, + gCreditsEntry_LeadGraphicArtist, + gCreditsEntry_MotofumiFujiwara, + _, + }, + { + gCreditsEntry_Programmers, + gCreditsEntry_HisashiSogabe, + gCreditsEntry_TomomichiOhta, + gCreditsEntry_NozomuSaito, + gCreditsEntry_EmptyString, + }, + { + gCreditsEntry_Programmers, + gCreditsEntry_AkitoMori, + gCreditsEntry_HiroyukiNakamura, + gCreditsEntry_MasaoTaya, + _, + }, + { + gCreditsEntry_Programmers, + gCreditsEntry_SatoshiNohara, + gCreditsEntry_MiyukiIwasawa, + gCreditsEntry_YoshinoriMatsuda, + gCreditsEntry_KeitaKagaya, + }, + { + gCreditsEntry_Programmers, + gCreditsEntry_TetsuyaWatanabe, + gCreditsEntry_SosukeTamada, + gCreditsEntry_TakenoriOhta, + _, + }, + { + _, + gCreditsEntry_GraphicDesigners, + gCreditsEntry_MotofumiFujiwara, + gCreditsEntry_SatoshiOhta, + _, + }, + { + gCreditsEntry_GraphicDesigners, + gCreditsEntry_KenkichiToyama, + gCreditsEntry_AsukaIwashita, + gCreditsEntry_TakaoUnno, + _, + }, + { + gCreditsEntry_GraphicDesigners, + gCreditsEntry_KenSugimori, + gCreditsEntry_HironobuYoshida, + gCreditsEntry_AimiTomita, + gCreditsEntry_KanakoEo, + }, + { + gCreditsEntry_MusicComposition, + gCreditsEntry_GoIchinose, + gCreditsEntry_JunichiMasuda, + gCreditsEntry_MorikazuAoki, + gCreditsEntry_HitomiSato, + }, + { + _, + gCreditsEntry_SoundEffectsAndPkmnVoices, + gCreditsEntry_GoIchinose, + gCreditsEntry_MorikazuAoki, + _, + }, + { + gCreditsEntry_GameDesigners, + gCreditsEntry_ShigekiMorimoto, + gCreditsEntry_TeruyukiShimoyamada, + gCreditsEntry_TakeshiKawachimaru, + gCreditsEntry_AkihitoTomisawa, + }, + { + gCreditsEntry_GameDesigners, + gCreditsEntry_SuguruNakatsui, + gCreditsEntry_TetsujiOhta, + gCreditsEntry_HitomiSato, + gCreditsEntry_KenjiMatsushima, + }, + { + gCreditsEntry_GameDesigners, + gCreditsEntry_JunichiMasuda, + gCreditsEntry_KojiNishino, + gCreditsEntry_ShigeruOhmori, + gCreditsEntry_TadashiTakahashi, + }, + { + gCreditsEntry_ScenarioPlot, + gCreditsEntry_AkihitoTomisawa, + gCreditsEntry_JunichiMasuda, + gCreditsEntry_KojiNishino, + _, + }, + { + gCreditsEntry_Scenario, + gCreditsEntry_AkihitoTomisawa, + gCreditsEntry_HitomiSato, + gCreditsEntry_ToshinobuMatsumiya, + _, + }, + { + gCreditsEntry_ScriptDesigners, + gCreditsEntry_TomomichiOhta, + gCreditsEntry_SatoshiNohara, + _, + _, + }, + { + gCreditsEntry_MapDesigners, + gCreditsEntry_SuguruNakatsui, + gCreditsEntry_TeruyukiShimoyamada, + gCreditsEntry_ShigeruOhmori, + gCreditsEntry_TetsujiOhta, + }, + { + _, + gCreditsEntry_BattleFrontierData, + gCreditsEntry_TetsujiOhta, + _, + _, + }, + { + gCreditsEntry_ParametricDesigners, + gCreditsEntry_TeruyukiShimoyamada, + gCreditsEntry_ShigekiMorimoto, + gCreditsEntry_TetsujiOhta, + gCreditsEntry_KojiNishino, + }, + { + _, + gCreditsEntry_PokedexText, + gCreditsEntry_KenjiMatsushima, + _, + _, + }, + { + gCreditsEntry_EnvAndToolPgrms, + gCreditsEntry_HisashiSogabe, + gCreditsEntry_SosukeTamada, + gCreditsEntry_HiroyukiNakamura, + gCreditsEntry_AkitoMori, + }, + { + gCreditsEntry_PkmnDesigners, + gCreditsEntry_KenSugimori, + gCreditsEntry_MotofumiFujiwara, + gCreditsEntry_ShigekiMorimoto, + _, + }, + { + gCreditsEntry_PkmnDesigners, + gCreditsEntry_HironobuYoshida, + gCreditsEntry_SatoshiOhta, + gCreditsEntry_AsukaIwashita, + _, + }, + { + gCreditsEntry_PkmnDesigners, + gCreditsEntry_TakaoUnno, + gCreditsEntry_KanakoEo, + gCreditsEntry_AimiTomita, + _, + }, + { + gCreditsEntry_PkmnDesigners, + gCreditsEntry_AtsukoNishida, + gCreditsEntry_MuneoSaito, + gCreditsEntry_RenaYoshikawa, + gCreditsEntry_JunOkutani, + }, + { + _, + gCreditsEntry_SupportProgrammers, + gCreditsEntry_SatoshiMitsuhara, + gCreditsEntry_DaisukeHoshino, + _, + }, + { + _, + gCreditsEntry_NCLProductTesting, + gCreditsEntry_NCLSuperMarioClub, + _, + _, + }, + { + _, + gCreditsEntry_PackageAndManual, + gCreditsEntry_KenSugimori, + _, + _, + }, + { + _, + gCreditsEntry_SpecialThanks, + gCreditsEntry_KenjiTominaga, + gCreditsEntry_HirokiEnomoto, + _, + }, + { + gCreditsEntry_SpecialThanks, + gCreditsEntry_KazuyaSuyama, + gCreditsEntry_KenjiroIto, + gCreditsEntry_MichikoTakizawa, + gCreditsEntry_MakikoTakada, + }, + { + gCreditsEntry_SpecialThanks, + gCreditsEntry_MikikoOhhashi, + gCreditsEntry_TakanaoKondo, + gCreditsEntry_RuiKawaguchi, + _, + }, + { + gCreditsEntry_SpecialThanks, + gCreditsEntry_TakahiroOhnishi, + gCreditsEntry_NorihideOkamura, + gCreditsEntry_ShunsukeKohori, + _, + }, + { + gCreditsEntry_InfoSupervisors, + gCreditsEntry_KazuyukiTerada, + gCreditsEntry_YuriSakurai, + gCreditsEntry_YumiFunasaka, + gCreditsEntry_NaokoYanase, + }, + { + _, + gCreditsEntry_Artwork, + gCreditsEntry_SachikoNakamichi, + gCreditsEntry_FujikoNomura, + _, + }, + { + _, + gCreditsEntry_Artwork, + gCreditsEntry_HideyukiNakajima, + gCreditsEntry_HidenoriSaeki, + _, + }, + { + gCreditsEntry_Artwork, + gCreditsEntry_YokoWatanabe, + gCreditsEntry_SakaeKimura, + gCreditsEntry_ChiakiShinkai, + _, + }, + { + gCreditsEntry_Coordinators, + gCreditsEntry_KazukiYoshihara, + gCreditsEntry_AkiraKinashi, + gCreditsEntry_RetsujiNomoto, + _, + }, + { + _, + gCreditsEntry_EnglishVersion, + gCreditsEntry_HiroNakamura, + gCreditsEntry_SethMcMahill, + _, + }, + { + _, + gCreditsEntry_Translator, + gCreditsEntry_NobOgasawara, + _, + _, + }, + { + _, + gCreditsEntry_TextEditor, + gCreditsEntry_TeresaLillygren, + _, + _, + }, + { + _, + gCreditsEntry_NCLCoordinator, + gCreditsEntry_KimikoNakamichi, + _, + _, + }, + { + gCreditsEntry_Programmers, + gCreditsEntry_TerukiMurakawa, + gCreditsEntry_SouichiYamamoto, + gCreditsEntry_YuichiroIto, + gCreditsEntry_AkiraKinashi, + }, + { + _, + gCreditsEntry_GraphicDesigner, + gCreditsEntry_AkiraKinashi, + _, + _, + }, + { + gCreditsEntry_EnvAndToolPgrms, + gCreditsEntry_TerukiMurakawa, + gCreditsEntry_SouichiYamamoto, + gCreditsEntry_KimikoNakamichi, + _, + }, + { + gCreditsEntry_NOAProductTesting, + gCreditsEntry_ThomasHertzog, + gCreditsEntry_ErikJohnson, + gCreditsEntry_MikaKurosawa, + _, + }, + { + gCreditsEntry_BrailleCodeCheck, + gCreditsEntry_NationalFederationBlind, + gCreditsEntry_PatriciaAMaurer, + gCreditsEntry_JapanBrailleLibrary, + gCreditsEntry_EuropeanBlindUnion, + }, + { + _, + gCreditsEntry_BrailleCodeCheck, + gCreditsEntry_AustralianBrailleAuthority, + gCreditsEntry_RoyalNewZealandFederationBlind, + _, + }, + { + gCreditsEntry_SpecialThanks, + gCreditsEntry_HiroyukiUesugi, + gCreditsEntry_MotoyasuTojima, + gCreditsEntry_NicolaPrattBarlow, + gCreditsEntry_ShellieDow, + }, + { + _, + gCreditsEntry_TaskManagers, + gCreditsEntry_AzusaTajima, + gCreditsEntry_ShusakuEgami, + _, + }, + { + gCreditsEntry_Producers, + gCreditsEntry_HiroyukiJinnai, + gCreditsEntry_HitoshiYamagami, + gCreditsEntry_GakujiNomoto, + gCreditsEntry_HiroakiTsuru, + }, + { + _, + gCreditsEntry_ExecutiveDirector, + gCreditsEntry_SatoshiTajiri, + _, + _, + }, + { + _, + gCreditsEntry_ExecProducers, + gCreditsEntry_SatoruIwata, + _, + _, + }, + { + _, + gCreditsEntry_ExecProducers, + gCreditsEntry_TsunekazIshihara, + _, + _, + }, +}; +#undef _ + +static const struct BgTemplate gUnknown_085E6F68[] = +{ + { + .bg = 0, + .charBaseIndex = 2, + .mapBaseIndex = 28, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, +}; +static const struct WindowTemplate gUnknown_085E6F6C[] = +{ + { 0x00, 0x00, 0x09, 0x1E, 0x0C, 0x08, 0x0001 }, + DUMMY_WIN_TEMPLATE, +}; +static const u8 gUnknown_085E6F7C[][2] = +{ + {104, 36}, + {120, 36}, + {136, 36}, +}; + +static const union AnimCmd gUnknown_085E6F84[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_FRAME(64, 8), + ANIMCMD_FRAME(128, 8), + ANIMCMD_FRAME(192, 8), + ANIMCMD_JUMP(0), +}; + +static const union AnimCmd gUnknown_085E6F98[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(64, 4), + ANIMCMD_FRAME(128, 4), + ANIMCMD_FRAME(192, 4), + ANIMCMD_JUMP(0), +}; + +static const union AnimCmd gUnknown_085E6FAC[] = +{ + ANIMCMD_FRAME(256, 4), + ANIMCMD_FRAME(320, 4), + ANIMCMD_FRAME(384, 4), + ANIMCMD_END, +}; + +static const union AnimCmd gUnknown_085E6FBC[] = +{ + ANIMCMD_FRAME(384, 30), + ANIMCMD_FRAME(320, 30), + ANIMCMD_FRAME(256, 30), + ANIMCMD_FRAME(256, 30), + ANIMCMD_END, +}; + +static const union AnimCmd *const gUnknown_085E6FD0[] = +{ + gUnknown_085E6F84, + gUnknown_085E6F98, + gUnknown_085E6FAC, + gUnknown_085E6FBC, +}; + +static const union AnimCmd gUnknown_085E6FE0[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_FRAME(64, 8), + ANIMCMD_FRAME(128, 8), + ANIMCMD_FRAME(192, 8), + ANIMCMD_JUMP(0), +}; + +static const union AnimCmd gUnknown_085E6FF4[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(64, 4), + ANIMCMD_FRAME(128, 4), + ANIMCMD_FRAME(192, 4), + ANIMCMD_JUMP(0), +}; + +static const union AnimCmd gUnknown_085E7008[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_END, +}; + +static const union AnimCmd *const gUnknown_085E7010[] = +{ + gUnknown_085E6FE0, + gUnknown_085E6FF4, + gUnknown_085E7008, +}; + +static const struct SpriteSheet gUnknown_085E701C[] = { + { gDecompressionBuffer, 6144, 1001 }, + { NULL }, +}; +static const struct SpritePalette gUnknown_085E702C[] = { + { (const u16 *)(gDecompressionBuffer + 0x1800), 1001 }, + { NULL }, +}; + +static const struct OamData gUnknown_085E703C = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; + +static const union AnimCmd gUnknown_085E7044[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_END, +}; + +static const union AnimCmd gUnknown_085E704C[] = +{ + ANIMCMD_FRAME(64, 8), + ANIMCMD_END, +}; + +static const union AnimCmd gUnknown_085E7054[] = +{ + ANIMCMD_FRAME(128, 8), + ANIMCMD_END, +}; + +static const union AnimCmd *const gUnknown_085E705C[] = +{ + gUnknown_085E7044, + gUnknown_085E704C, + gUnknown_085E7054, +}; + +static const struct SpriteTemplate gUnknown_085E7068 = +{ + .tileTag = 1001, + .paletteTag = 1001, + .oam = &gUnknown_085E703C, + .anims = gUnknown_085E705C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81772B8, +}; + +void sub_8175620(void); +static void sub_8175744(u8 taskIdA); +static void sub_8175774(u8 taskIdA); +static void sub_8175808(u8 taskIdA); +static void c2_080C9BFC(u8 taskIdA); +static void sub_81758E4(u8 taskIdA); +static void sub_81758A4(u8 taskIdA); +static void sub_8175A9C(u8 taskIdA); +static void sub_8175AE4(u8 taskIdA); +static void sub_8175B1C(u8 taskIdA); +static void sub_8175B90(u8 taskIdA); +static void sub_8175BD8(u8 taskIdA); +static void sub_8175C34(u8 taskIdA); +static void sub_8175CC8(u8 taskIdA); +static void sub_8175CE4(void); +static void sub_8175DA0(u8 taskIdB); +static u8 sub_817603C(u8 page, u8 taskIdA); +static void sub_81760FC(u8 taskIdA); +static void sub_817651C(u8 taskIdA); +static void sub_817624C(u8 taskIdA); +static bool8 sub_8176AB0(u8 data, u8 taskIdA); +static void sub_8176CA0(u8 taskIdA); +static void sub_8176D1C(u16, u16, u16); +static void sub_8176E40(u16 arg0, u16 palette); +static void sub_8176EE8(struct Sprite *sprite); +static void sub_8176F90(struct Sprite *sprite); +static u8 sub_8177224(u16 species, s16 x, s16 y, u16 position); +static void sub_8177388(void); + +static void sub_81754C8(void) +{ + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); +} + +static void sub_81754DC(void) +{ + RunTasks(); + AnimateSprites(); + + if ((gMain.heldKeys & B_BUTTON) + && gHasHallOfFameRecords != 0 + && gTasks[gUnknown_0203BCE2].func == sub_8175774) + { + sub_81754C8(); + RunTasks(); + AnimateSprites(); + gUnknown_0203BCE5 = 1; + } + BuildOamBuffer(); + UpdatePaletteFade(); +} + +static void sub_8175548(void) +{ + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, gUnknown_085E6F68, 1); + SetBgTilemapBuffer(0, AllocZeroed(0x800)); + LoadPalette(gUnknown_085E56F0, 0x80, 0x40); + InitWindows(gUnknown_085E6F6C); + DeactivateAllTextPrinters(); + PutWindowTilemap(0); + CopyWindowToVram(0, 3); + ShowBg(0); +} + +static void sub_81755A4(void) +{ + void *ptr; + FreeAllWindowBuffers(); + ptr = GetBgTilemapBuffer(0); + if (ptr) + Free(ptr); +} + +static void sub_81755BC(const u8 *string, u8 y, u8 a2) +{ + u8 x; + u8 color[3]; + + color[0] = 0; + + if (a2 == 1) + { + color[1] = 3; + color[2] = 4; + } + else + { + color[1] = 1; + color[2] = 2; + } + + x = GetStringCenterAlignXOffsetWithLetterSpacing(1, string, 0xF0, 1); + AddTextPrinterParameterized2(0, 1, x, y, 1, 0, color, -1, string); +} + +void sub_8175620(void) +{ + u8 taskIdA; + s16 taskIdC; + u8 taskIdB; + u16 savedIme; + + sub_8175CE4(); + SetVBlankCallback(NULL); + InitHeap(gHeap, HEAP_SIZE); + ResetPaletteFade(); + ResetTasks(); + sub_8175548(); + + taskIdA = CreateTask(sub_8175744, 0); + + gTasks[taskIdA].data[TDA_4] = 0; + gTasks[taskIdA].data[TDA_7] = 0; + gTasks[taskIdA].data[TDA_11] = 0; + gTasks[taskIdA].data[TDA_13] = 1; + + while (TRUE) + { + if (sub_8176AB0(0, taskIdA)) + break; + } + + taskIdC = gTasks[taskIdA].data[TDA_TASK_C_ID]; + gTasks[taskIdC].data[TDC_0] = 40; + + SetGpuReg(REG_OFFSET_BG0VOFS, 0xFFFC); + + taskIdB = CreateTask(sub_8175DA0, 0); + + gTasks[taskIdB].data[TDB_TASK_A_ID] = taskIdA; + gTasks[taskIdA].data[TDA_TASK_B_ID] = taskIdB; + + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + EnableInterrupts(INTR_FLAG_VBLANK); + SetVBlankCallback(sub_81754C8); + m4aSongNumStart(MUS_THANKFOR); + SetMainCallback2(sub_81754DC); + gUnknown_0203BCE5 = 0; + gUnknown_0203BCE8 = AllocZeroed(sizeof(struct Unk201C000)); + + sub_8177388(); + + gUnknown_0203BCE8->unk8E = 0; + gUnknown_0203BCE8->unk90 = 0; + gUnknown_0203BCE8->unk92 = 0; + + gUnknown_0203BCE2 = taskIdA; +} + +static void sub_8175744(u8 taskIdA) +{ + if (!gPaletteFade.active) + gTasks[taskIdA].func = sub_8175774; +} + +static void sub_8175774(u8 taskIdA) +{ + u16 data1; + + if (gTasks[taskIdA].data[TDA_4]) + { + s16 taskIdC; + + taskIdC = gTasks[taskIdA].data[TDA_TASK_C_ID]; + gTasks[taskIdC].data[TDC_0] = 30; + + gTasks[taskIdA].data[TDA_12] = 0x100; + gTasks[taskIdA].func = sub_8175A9C; + return; + } + + gUnknown_0203BCE0 = 0; + data1 = gTasks[taskIdA].data[TDA_11]; + + if (gTasks[taskIdA].data[TDA_11] == 1) + { + gTasks[taskIdA].data[TDA_13] = data1; + gTasks[taskIdA].data[TDA_11] = 0; + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + gTasks[taskIdA].func = sub_8175808; + } + else if (gTasks[taskIdA].data[TDA_11] == 2) + { + gTasks[taskIdA].data[TDA_13] = data1; + gTasks[taskIdA].data[TDA_11] = 0; + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + gTasks[taskIdA].func = sub_81758A4; + } +} + +static void sub_8175808(u8 taskIdA) +{ + if (!gPaletteFade.active) + { + SetGpuReg(REG_OFFSET_DISPCNT, 0); + sub_8176CA0(taskIdA); + gTasks[taskIdA].func = c2_080C9BFC; + } +} + +static void c2_080C9BFC(u8 taskIdA) +{ + u16 backup; + + SetVBlankCallback(NULL); + + if (sub_8176AB0(gTasks[taskIdA].data[TDA_7], taskIdA)) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + EnableInterrupts(INTR_FLAG_VBLANK); + SetVBlankCallback(sub_81754C8); + gTasks[taskIdA].func = sub_8175744; + } +} + +static void sub_81758A4(u8 taskIdA) +{ + if (!gPaletteFade.active) + { + SetGpuReg(REG_OFFSET_DISPCNT, 0); + sub_8176CA0(taskIdA); + gTasks[taskIdA].func = sub_81758E4; + } +} + +static void sub_81758E4(u8 taskIdA) +{ + switch (gMain.state) + { + default: + case 0: + { + u16 i; + u16 *temp; + + ResetSpriteData(); + dp13_810BB8C(); + FreeAllSpritePalettes(); + gReservedSpritePaletteCount = 8; + LZ77UnCompVram(&gBirchHelpGfx, (void *)VRAM); + LZ77UnCompVram(&gBirchGrassTilemap, (void *)(VRAM + 0x3800)); + LoadPalette(gBirchBagGrassPal[0] + 1, 1, 31 * 2); + + for (i = 0; i < 0x800; i++) + gDecompressionBuffer[i] = 0x11; + for (i = 0; i < 0x800; i++) + (gDecompressionBuffer + 0x800)[i] = 0x22; + for (i = 0; i < 0x800; i++) + (gDecompressionBuffer + 0x1000)[i] = 0x33; + + temp = (u16 *)(&gDecompressionBuffer[0x1800]); + temp[0] = RGB_BLACK; + temp[1] = RGB(31, 31, 20); // light yellow + temp[2] = RGB(31, 20, 20); // light red + temp[3] = RGB(20, 20, 31); // light blue + + LoadSpriteSheet(gUnknown_085E701C); + LoadSpritePalette(gUnknown_085E702C); + + gMain.state += 1; + break; + } + case 1: + gTasks[taskIdA].data[TDA_TASK_D_ID] = CreateTask(sub_81760FC, 0); + gTasks[gTasks[taskIdA].data[TDA_TASK_D_ID]].data[TDD_STATE] = 1; + gTasks[gTasks[taskIdA].data[TDA_TASK_D_ID]].data[TDD_TASK_A_ID] = taskIdA; + gTasks[gTasks[taskIdA].data[TDA_TASK_D_ID]].data[TDD_2] = gTasks[taskIdA].data[TDA_7]; + + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + SetGpuReg(REG_OFFSET_BG3HOFS, 0); + SetGpuReg(REG_OFFSET_BG3VOFS, 32); + SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3) + | BGCNT_CHARBASE(0) + | BGCNT_SCREENBASE(7) + | BGCNT_16COLOR + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 + | DISPCNT_OBJ_1D_MAP + | DISPCNT_BG0_ON + | DISPCNT_BG3_ON + | DISPCNT_OBJ_ON); + + gMain.state = 0; + gUnknown_0203BD28 = 0; + gTasks[taskIdA].func = sub_8175744; + break; + } +} + +static void sub_8175A9C(u8 taskIdA) +{ + if (gTasks[taskIdA].data[TDA_12]) + { + gTasks[taskIdA].data[TDA_12] -= 1; + return; + } + + BeginNormalPaletteFade(0xFFFFFFFF, 12, 0, 16, RGB_BLACK); + gTasks[taskIdA].func = sub_8175AE4; +} + +static void sub_8175AE4(u8 taskIdA) +{ + if (!gPaletteFade.active) + { + sub_8176CA0(taskIdA); + gTasks[taskIdA].func = sub_8175B1C; + } +} + +static void sub_8175B1C(u8 taskIdA) +{ + sub_8175CE4(); + ResetPaletteFade(); + sub_8176D1C(0, 0x3800, 0); + ResetSpriteData(); + FreeAllSpritePalettes(); + BeginNormalPaletteFade(0xFFFFFFFF, 8, 16, 0, RGB_BLACK); + + SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0) + | BGCNT_CHARBASE(0) + | BGCNT_SCREENBASE(7) + | BGCNT_16COLOR + | BGCNT_TXT256x256); + EnableInterrupts(INTR_FLAG_VBLANK); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 + | DISPCNT_OBJ_1D_MAP + | DISPCNT_BG0_ON); + + gTasks[taskIdA].data[TDA_0] = 0xEB; + gTasks[taskIdA].func = sub_8175B90; +} + +static void sub_8175B90(u8 taskIdA) +{ + if (gTasks[taskIdA].data[TDA_0]) + { + gTasks[taskIdA].data[TDA_0] -= 1; + return; + } + + BeginNormalPaletteFade(0xFFFFFFFF, 6, 0, 16, RGB_BLACK); + gTasks[taskIdA].func = sub_8175BD8; +} + +static void sub_8175BD8(u8 taskIdA) +{ + if (!gPaletteFade.active) + { + sub_8176E40(0x3800, 0); + + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0, RGB_BLACK); + gTasks[taskIdA].data[TDA_0] = 7200; + gTasks[taskIdA].func = sub_8175C34; + } +} + +static void sub_8175C34(u8 taskIdA) +{ + if (!gPaletteFade.active) + { + if (gTasks[taskIdA].data[TDA_0] == 0 || gMain.newKeys) + { + FadeOutBGM(4); + BeginNormalPaletteFade(0xFFFFFFFF, 8, 0, 16, RGB_WHITEALPHA); + gTasks[taskIdA].func = sub_8175CC8; + return; + } + + if (gTasks[taskIdA].data[TDA_0] == 7144) + FadeOutBGM(8); + + if (gTasks[taskIdA].data[TDA_0] == 6840) + m4aSongNumStart(MUS_END); + + gTasks[taskIdA].data[TDA_0] -= 1; + } +} + +static void sub_8175CC8(u8 taskIdA) +{ + if (!gPaletteFade.active) + SoftReset(0xFF); +} + +static void sub_8175CE4(void) +{ + SetGpuReg(REG_OFFSET_DISPCNT, 0); + + SetGpuReg(REG_OFFSET_BG3HOFS, 0); + SetGpuReg(REG_OFFSET_BG3VOFS, 0); + SetGpuReg(REG_OFFSET_BG2HOFS, 0); + SetGpuReg(REG_OFFSET_BG2VOFS, 0); + SetGpuReg(REG_OFFSET_BG1HOFS, 0); + SetGpuReg(REG_OFFSET_BG1VOFS, 0); + SetGpuReg(REG_OFFSET_BG0HOFS, 0); + SetGpuReg(REG_OFFSET_BG0VOFS, 0); + + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); + + DmaFill16(3, 0, (void *)VRAM, VRAM_SIZE); + DmaFill32(3, 0, (void *)OAM, OAM_SIZE); + DmaFill16(3, 0, (void *)(PLTT + 2), PLTT_SIZE - 2); +} + +static void sub_8175DA0(u8 taskIdB) +{ + int i; + + switch (gTasks[taskIdB].data[TDB_0]) + { + case 0: + case 6: + case 7: + case 8: + case 9: + default: + if (!gPaletteFade.active) + { + gTasks[taskIdB].data[TDB_0] = 1; + gTasks[taskIdB].data[TDB_3] = 0x48; + gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].data[TDA_14] = 0; + gUnknown_0203BCE0 = 0; + } + return; + case 1: + if (gTasks[taskIdB].data[TDB_3] != 0) + { + gTasks[taskIdB].data[TDB_3] -= 1; + return; + } + gTasks[taskIdB].data[TDB_0] += 1; + return; + case 2: + if (gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].func == sub_8175774) + { + if (gTasks[taskIdB].data[TDB_CURRENT_PAGE] < PAGE_COUNT) + { + for (i = 0; i < 5; i++) + sub_81755BC(gCreditsEntryPointerTable[gTasks[taskIdB].data[TDB_CURRENT_PAGE]][i]->text, 5 + i * 16, gCreditsEntryPointerTable[gTasks[taskIdB].data[TDB_CURRENT_PAGE]][i]->var_1); + + CopyWindowToVram(0, 2); + + gTasks[taskIdB].data[TDB_CURRENT_PAGE] += 1; + gTasks[taskIdB].data[TDB_0] += 1; + + gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].data[TDA_14] = 1; + + if (gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].data[TDA_13] == 1) + BeginNormalPaletteFade(0x00000300, 0, 16, 0, COLOR_LIGHT_GREEN); + else + BeginNormalPaletteFade(0x00000300, 0, 16, 0, COLOR_DARK_GREEN); + return; + } + gTasks[taskIdB].data[TDB_0] = 10; + return; + } + gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].data[TDA_14] = 0; + return; + case 3: + if (!gPaletteFade.active) + { + gTasks[taskIdB].data[TDB_3] = 0x73; + gTasks[taskIdB].data[TDB_0] += 1; + } + return; + case 4: + if (gTasks[taskIdB].data[TDB_3] != 0) + { + gTasks[taskIdB].data[TDB_3] -= 1; + return; + } + + if (sub_817603C((u8)gTasks[taskIdB].data[TDB_CURRENT_PAGE], (u8)gTasks[taskIdB].data[TDB_TASK_A_ID])) + { + gTasks[taskIdB].data[TDB_0] += 1; + return; + } + gTasks[taskIdB].data[TDB_0] += 1; + if (gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].data[TDA_13] == 1) + BeginNormalPaletteFade(0x00000300, 0, 0, 16, COLOR_LIGHT_GREEN); + else + BeginNormalPaletteFade(0x00000300, 0, 0, 16, COLOR_DARK_GREEN); + return; + case 5: + if (!gPaletteFade.active) + { + FillWindowPixelBuffer(0, 0); + CopyWindowToVram(0, 2); + gTasks[taskIdB].data[TDB_0] = 2; + } + return; + case 10: + gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].data[TDA_4] = 1; + DestroyTask(taskIdB); + sub_81755A4(); + FREE_AND_SET_NULL(gUnknown_0203BCE8); + return; + } +} + +static u8 sub_817603C(u8 page, u8 taskIdA) +{ + // Starts with bike + ocean + morning + + if (page == 6) + { + // Grass patch + gTasks[taskIdA].data[TDA_11] = 2; + } + + if (page == 12) + { + // Bike + ocean + sunset + gTasks[taskIdA].data[TDA_7] = 1; + gTasks[taskIdA].data[TDA_11] = 1; + } + + if (page == 18) + { + // Grass patch + gTasks[taskIdA].data[TDA_11] = 2; + } + + if (page == 24) + { + // Bike + forest + sunset + gTasks[taskIdA].data[TDA_7] = 2; + gTasks[taskIdA].data[TDA_11] = 1; + } + + if (page == 30) + { + // Grass patch + gTasks[taskIdA].data[TDA_11] = 2; + } + + if (page == 36) + { + // Bike + forest + sunset + gTasks[taskIdA].data[TDA_7] = 3; + gTasks[taskIdA].data[TDA_11] = 1; + } + + if (page == 42) + { + // Grass patch + gTasks[taskIdA].data[TDA_11] = 2; + } + + if (page == 48) + { + // Bike + town + night + gTasks[taskIdA].data[TDA_7] = 4; + gTasks[taskIdA].data[TDA_11] = 1; + } + + if (gTasks[taskIdA].data[TDA_11] != 0) + { + // Returns true if changed? + return TRUE; + } + + return FALSE; +} + +static void sub_81760FC(u8 taskIdD) +{ + u8 r2; + + switch (gTasks[taskIdD].data[TDD_STATE]) + { + case 0: + break; + case 1: + if (gUnknown_0203BCE8->unk90 == 0 && gTasks[gTasks[taskIdD].data[TDD_TASK_A_ID]].data[TDA_14] == 0) + break; + gTasks[taskIdD].data[TDD_STATE]++; + break; + case 2: + if (gUnknown_0203BCE8->unk8E == 71 || gTasks[gTasks[taskIdD].data[TDD_TASK_A_ID]].func != sub_8175774) + break; + r2 = sub_8177224(gUnknown_0203BCE8->unk0[gUnknown_0203BCE8->unk92], gUnknown_085E6F7C[gUnknown_0203BCE8->unk90][0], gUnknown_085E6F7C[gUnknown_0203BCE8->unk90][1], gUnknown_0203BCE8->unk90); + if (gUnknown_0203BCE8->unk92 < gUnknown_0203BCE8->unk94 - 1) + { + gUnknown_0203BCE8->unk92++; + gSprites[r2].data[3] = 50; + } + else + { + gUnknown_0203BCE8->unk92 = 0; + gSprites[r2].data[3] = 512; + } + gUnknown_0203BCE8->unk8E++; + if (gUnknown_0203BCE8->unk90 == 2) + gUnknown_0203BCE8->unk90 = 0; + else + gUnknown_0203BCE8->unk90++; + gTasks[taskIdD].data[TDD_3] = 50; + gTasks[taskIdD].data[TDD_STATE]++; + break; + case 3: + if (gTasks[taskIdD].data[TDD_3] != 0) + gTasks[taskIdD].data[TDD_3]--; + else + gTasks[taskIdD].data[TDD_STATE] = 1; + break; + } +} + +static void sub_817624C(u8 taskIdC) +{ + switch (gTasks[taskIdC].data[TDC_0]) + { + case 0: + gUnknown_0203BD26 = Sin((gTasks[taskIdC].data[TDC_5] >> 1) & 0x7F, 12); + gTasks[taskIdC].data[TDC_5]++; + break; + case 1: + if (gUnknown_0203BD26 != 0) + { + gUnknown_0203BD26 = Sin((gTasks[taskIdC].data[TDC_5] >> 1) & 0x7F, 12); + gTasks[taskIdC].data[TDC_5]++; + } + else + { + gSprites[gTasks[taskIdC].data[TDC_2]].data[0] = 2; + gTasks[taskIdC].data[TDC_5] = 0; + gTasks[taskIdC].data[TDC_0]++; + } + break; + case 2: + if (gTasks[taskIdC].data[TDC_5] < 64) + { + gTasks[taskIdC].data[TDC_5]++; + gUnknown_0203BD26 = Sin(gTasks[taskIdC].data[TDC_5] & 0x7F, 20); + } + else + { + gTasks[taskIdC].data[TDC_0]++; + } + break; + case 3: + gSprites[gTasks[taskIdC].data[TDC_2]].data[0] = 3; + gSprites[gTasks[taskIdC].data[TDC_3]].data[0] = 1; + gTasks[taskIdC].data[TDC_4] = 120; + gTasks[taskIdC].data[TDC_0]++; + break; + case 4: + if (gTasks[taskIdC].data[TDC_4] != 0) + { + gTasks[taskIdC].data[TDC_4]--; + } + else + { + gTasks[taskIdC].data[TDC_5] = 64; + gTasks[taskIdC].data[TDC_0]++; + } + break; + case 5: + if (gTasks[taskIdC].data[TDC_5] > 0) + { + gTasks[taskIdC].data[TDC_5]--; + gUnknown_0203BD26 = Sin(gTasks[taskIdC].data[TDC_5] & 0x7F, 20); + } + else + { + gSprites[gTasks[taskIdC].data[TDC_2]].data[0] = 1; + gTasks[taskIdC].data[TDC_0]++; + } + break; + case 6: + gTasks[taskIdC].data[TDC_0] = 50; + break; + case 10: + gSprites[gTasks[taskIdC].data[TDC_3]].data[0] = 2; + gTasks[taskIdC].data[TDC_0] = 50; + break; + case 20: + gSprites[gTasks[taskIdC].data[TDC_2]].data[0] = 4; + gTasks[taskIdC].data[TDC_0] = 50; + break; + case 30: + gSprites[gTasks[taskIdC].data[TDC_2]].data[0] = 5; + gSprites[gTasks[taskIdC].data[TDC_3]].data[0] = 3; + gTasks[taskIdC].data[TDC_0] = 50; + break; + case 50: + gTasks[taskIdC].data[TDC_0] = 0; + break; + } +} + +static void sub_817651C(u8 taskIdE) +{ + s16 taskIdC; + + switch (gTasks[taskIdE].data[TDE_0]) + { + default: + case 0: + if (gTasks[taskIdE].data[TDE_1] != 0x7FFF) + { + + if (gTasks[gTasks[gTasks[taskIdE].data[TDE_TASK_A_ID]].data[TDA_TASK_B_ID]].data[TDB_CURRENT_PAGE] == 2) + { + gTasks[gTasks[gTasks[taskIdE].data[TDE_TASK_A_ID]].data[TDA_TASK_C_ID]].data[TDC_0] = 20; + gTasks[taskIdE].data[TDE_1] = 0x7FFF; + } + } + sub_817B540(0); + break; + case 1: + sub_817B540(0); + break; + case 2: + if (gTasks[taskIdE].data[TDE_1] != 0x7FFF) + { + taskIdC = gTasks[gTasks[taskIdE].data[TDE_TASK_A_ID]].data[TDA_TASK_C_ID]; + + // Floor to multiple of 128 + if ((gTasks[taskIdC].data[TDC_5] & -128) == 640) + { + gTasks[taskIdC].data[TDC_0] = 1; + gTasks[taskIdE].data[TDE_1] = 0x7FFF; + } + } + sub_817B540(1); + break; + case 3: + if (gTasks[taskIdE].data[TDE_1] != 0x7FFF) + { + + if (gTasks[taskIdE].data[TDE_1] == 0x248) + { + gTasks[gTasks[gTasks[taskIdE].data[TDE_TASK_A_ID]].data[TDA_TASK_C_ID]].data[TDC_0] = 10; + gTasks[taskIdE].data[TDE_1] = 0x7FFF; + } + else + { + gTasks[taskIdE].data[TDE_1] += 1; + } + } + sub_817B540(1); + break; + case 4: + sub_817B540(2); + break; + } +} + +static void sub_817664C(u8 data, u8 taskIdA) +{ + switch (data) + { + case 0: + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].invisible = 0; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].invisible = 0; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.x = 272; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.x = 272; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.y = 46; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.y = 46; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].data[0] = 0; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].data[0] = 0; + gTasks[taskIdA].data[TDA_0] = sub_817B3DC(0, 0x2000, 0x20, 8); + break; + case 1: + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].invisible = 0; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].invisible = 0; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.x = 120; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.x = 272; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.y = 46; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.y = 46; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].data[0] = 0; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].data[0] = 0; + gTasks[taskIdA].data[TDA_0] = sub_817B3DC(0, 0x2000, 0x20, 8); + break; + case 2: + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].invisible = 0; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].invisible = 0; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.x = 120; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.x = 272; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.y = 46; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.y = 46; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].data[0] = 0; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].data[0] = 0; + gTasks[taskIdA].data[TDA_0] = sub_817B3DC(1, 0x2000, 0x200, 8); + break; + case 3: + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].invisible = 0; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].invisible = 0; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.x = 120; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.x = -32; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.y = 46; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.y = 46; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].data[0] = 0; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].data[0] = 0; + gTasks[taskIdA].data[TDA_0] = sub_817B3DC(1, 0x2000, 0x200, 8); + break; + case 4: + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].invisible = 0; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].invisible = 0; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.x = 88; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.x = 152; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.y = 46; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.y = 46; + gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].data[0] = 0; + gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].data[0] = 0; + gTasks[taskIdA].data[TDA_0] = sub_817B3DC(2, 0x2000, 0x200, 8); + break; + } + + gTasks[taskIdA].data[TDA_TASK_E_ID] = CreateTask(sub_817651C, 0); + gTasks[gTasks[taskIdA].data[TDA_TASK_E_ID]].data[TDE_0] = data; + gTasks[gTasks[taskIdA].data[TDA_TASK_E_ID]].data[TDE_1] = 0; + gTasks[gTasks[taskIdA].data[TDA_TASK_E_ID]].data[TDE_TASK_A_ID] = taskIdA; + + gTasks[taskIdA].data[TDA_TASK_C_ID] = CreateTask(sub_817624C, 0); + gTasks[gTasks[taskIdA].data[TDA_TASK_C_ID]].data[TDC_0] = 0; + gTasks[gTasks[taskIdA].data[TDA_TASK_C_ID]].data[TDC_1] = taskIdA; + gTasks[gTasks[taskIdA].data[TDA_TASK_C_ID]].data[TDC_2] = gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]; + gTasks[gTasks[taskIdA].data[TDA_TASK_C_ID]].data[TDC_3] = gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]; + gTasks[gTasks[taskIdA].data[TDA_TASK_C_ID]].data[TDC_4] = 0; + + if (data == 2) + gTasks[gTasks[taskIdA].data[TDA_TASK_C_ID]].data[TDC_5] = 0x45; +} + +static bool8 sub_8176AB0(u8 data, u8 taskIdA) +{ + u8 spriteId; + + switch (gMain.state) + { + default: + case 0: + SetGpuReg(REG_OFFSET_DISPCNT, 0); + SetGpuReg(REG_OFFSET_BG3HOFS, 8); + SetGpuReg(REG_OFFSET_BG3VOFS, 0); + SetGpuReg(REG_OFFSET_BG2HOFS, 0); + SetGpuReg(REG_OFFSET_BG2VOFS, 0); + SetGpuReg(REG_OFFSET_BG1HOFS, 0); + SetGpuReg(REG_OFFSET_BG1VOFS, 0); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + ResetSpriteData(); + FreeAllSpritePalettes(); + gMain.state = 1; + break; + case 1: + gUnknown_0203BD24 = 34; + gUnknown_0203BD26 = 0; + sub_817B1C8(data); + gMain.state += 1; + break; + case 2: + if (gSaveBlock2Ptr->playerGender == MALE) + { + LoadCompressedObjectPic(gUnknown_085F5334); + LoadCompressedObjectPic(gUnknown_085F53BC); + LoadCompressedObjectPic(gUnknown_085F5354); + LoadSpritePalettes(gUnknown_085F5384); + + spriteId = intro_create_brendan_sprite(120, 46); + gTasks[taskIdA].data[TDA_PLAYER_CYCLIST] = spriteId; + gSprites[spriteId].callback = sub_8176EE8; + gSprites[spriteId].anims = gUnknown_085E6FD0; + + spriteId = intro_create_may_sprite(272, 46); + gTasks[taskIdA].data[TDA_RIVAL_CYCLIST] = spriteId; + gSprites[spriteId].callback = sub_8176F90; + gSprites[spriteId].anims = gUnknown_085E7010; + } + else + { + LoadCompressedObjectPic(gUnknown_085F5344); + LoadCompressedObjectPic(gUnknown_085F53AC); + LoadCompressedObjectPic(gUnknown_085F5354); + LoadSpritePalettes(gUnknown_085F5384); + + spriteId = intro_create_may_sprite(120, 46); + gTasks[taskIdA].data[TDA_PLAYER_CYCLIST] = spriteId; + gSprites[spriteId].callback = sub_8176EE8; + gSprites[spriteId].anims = gUnknown_085E6FD0; + + spriteId = intro_create_brendan_sprite(272, 46); + gTasks[taskIdA].data[TDA_RIVAL_CYCLIST] = spriteId; + gSprites[spriteId].callback = sub_8176F90; + gSprites[spriteId].anims = gUnknown_085E7010; + }; + gMain.state += 1; + break; + case 3: + sub_817664C(data, taskIdA); + sub_817B3A8(data); + gMain.state = 0; + return TRUE; + } + return FALSE; +} + +static void sub_8176CA0(u8 taskIdA) +{ + if (gTasks[taskIdA].data[TDA_0] != 0) + { + DestroyTask(gTasks[taskIdA].data[TDA_0]); + gTasks[taskIdA].data[TDA_0] = 0; + } + + if (gTasks[taskIdA].data[TDA_TASK_C_ID] != 0) + { + DestroyTask(gTasks[taskIdA].data[TDA_TASK_C_ID]); + gTasks[taskIdA].data[TDA_TASK_C_ID] = 0; + } + + if (gTasks[taskIdA].data[TDA_TASK_E_ID] != 0) + { + DestroyTask(gTasks[taskIdA].data[TDA_TASK_E_ID]); + gTasks[taskIdA].data[TDA_TASK_E_ID] = 0; + } + + if (gTasks[taskIdA].data[TDA_TASK_D_ID] != 0) + { + DestroyTask(gTasks[taskIdA].data[TDA_TASK_D_ID]); + gTasks[taskIdA].data[TDA_TASK_D_ID] = 0; + } + + gUnknown_0203BD28 = 1; +} + +static void sub_8176D1C(u16 arg0, u16 arg1, u16 arg2) +{ + u16 baseTile; + u16 i; + + LZ77UnCompVram(gCreditsCopyrightEnd_Gfx, (void *)(VRAM + arg0)); + LoadPalette(gIntroCopyright_Pal, arg2, sizeof(gIntroCopyright_Pal)); + + baseTile = (arg2 / 16) << 12; + + for (i = 0; i < 32 * 32; i++) + ((u16 *) (VRAM + arg1))[i] = baseTile + 1; +} + +static u16 sub_8176D78(u8 arg0) +{ + u16 out = (arg0 & 0x3F) + 80; + + if (arg0 == 0xFF) + return 1; + + if (arg0 & (1 << 7)) + out |= 1 << 11; + if (arg0 & (1 << 6)) + out |= 1 << 10; + + return out; +} + +static void sub_8176DBC(const u8 arg0[], u8 baseX, u8 baseY, u16 arg3, u16 palette) +{ + u8 y, x; + const u16 tileOffset = (palette / 16) << 12; + + for (y = 0; y < 5; y++) + { + for (x = 0; x < 3; x++) + ((u16 *) (VRAM + arg3 + (baseY + y) * 64))[baseX + x] = tileOffset + sub_8176D78(arg0[y * 3 + x]); + } +} + +static void sub_8176E40(u16 arg0, u16 palette) +{ + u16 pos; + u16 baseTile = (palette / 16) << 12; + + for (pos = 0; pos < 32 * 32; pos++) + ((u16 *) (VRAM + arg0))[pos] = baseTile + 1; + + sub_8176DBC(gUnknown_085E5BAC, 3, 7, arg0, palette); + sub_8176DBC(gUnknown_085E5BBB, 7, 7, arg0, palette); + sub_8176DBC(gUnknown_085E5BCA, 11, 7, arg0, palette); + sub_8176DBC(gUnknown_085E5BCA, 16, 7, arg0, palette); + sub_8176DBC(gUnknown_085E5BD9, 20, 7, arg0, palette); + sub_8176DBC(gUnknown_085E5BE8, 24, 7, arg0, palette); +} + +static void sub_8176EE8(struct Sprite *sprite) +{ + if (gUnknown_0203BD28 != 0) + { + DestroySprite(sprite); + return; + } + + switch (sprite->data[0]) + { + case 0: + StartSpriteAnimIfDifferent(sprite, 0); + break; + case 1: + StartSpriteAnimIfDifferent(sprite, 1); + if (sprite->pos1.x > -32) + sprite->pos1.x -= 1; + break; + case 2: + StartSpriteAnimIfDifferent(sprite, 2); + break; + case 3: + StartSpriteAnimIfDifferent(sprite, 3); + break; + case 4: + StartSpriteAnimIfDifferent(sprite, 0); + if (sprite->pos1.x > 120) + sprite->pos1.x -= 1; + break; + case 5: + StartSpriteAnimIfDifferent(sprite, 0); + if (sprite->pos1.x > -32) + sprite->pos1.x -= 1; + break; + } +} + +static void sub_8176F90(struct Sprite *sprite) +{ + if (gUnknown_0203BD28 != 0) + { + DestroySprite(sprite); + return; + } + + switch (sprite->data[0]) + { + case 0: + sprite->pos2.y = 0; + StartSpriteAnimIfDifferent(sprite, 0); + break; + case 1: + if (sprite->pos1.x > 200) + StartSpriteAnimIfDifferent(sprite, 1); + else + StartSpriteAnimIfDifferent(sprite, 2); + if (sprite->pos1.x > -32) + sprite->pos1.x -= 2; + sprite->pos2.y = -gUnknown_0203BD26; + break; + case 2: + sprite->data[7] += 1; + StartSpriteAnimIfDifferent(sprite, 0); + if ((sprite->data[7] & 3) == 0) + sprite->pos1.x += 1; + break; + case 3: + StartSpriteAnimIfDifferent(sprite, 0); + if (sprite->pos1.x > -32) + sprite->pos1.x -= 1; + break; + } +} + +static void sub_8177050(struct Sprite *sprite) +{ + if (gUnknown_0203BD28) + { + sub_818D820(sprite->data[6]); + return; + } + + sprite->data[7] += 1; + switch (sprite->data[0]) + { + case 0: + default: + sprite->oam.affineMode = 1; + sprite->oam.matrixNum = sprite->data[1]; + sprite->data[2] = 16; + SetOamMatrix(sprite->data[1], 0x10000 / sprite->data[2], 0, 0, 0x10000 / sprite->data[2]); + sprite->invisible = FALSE; + sprite->data[0] = 1; + break; + case 1: + if (sprite->data[2] < 256) + { + sprite->data[2] += 8; + SetOamMatrix(sprite->data[1], 0x10000 / sprite->data[2], 0, 0, 0x10000 / sprite->data[2]); + } + else + { + sprite->data[0] += 1; + } + switch (sprite->data[1]) + { + case 1: + if ((sprite->data[7] & 3) == 0) + sprite->pos1.y += 1; + sprite->pos1.x -= 2; + break; + case 2: + break; + case 3: + if ((sprite->data[7] & 3) == 0) + sprite->pos1.y += 1; + sprite->pos1.x += 2; + break; + } + break; + case 2: + if (sprite->data[3] != 0) + { + sprite->data[3] -= 1; + } + else + { + SetGpuReg(REG_OFFSET_BLDCNT, 0xF40); + SetGpuReg(REG_OFFSET_BLDALPHA, 0x10); + sprite->oam.objMode = 1; + sprite->data[3] = 16; + sprite->data[0] += 1; + } + break; + case 3: + if (sprite->data[3] != 0) + { + int data3; + + sprite->data[3] -= 1; + + data3 = 16 - sprite->data[3]; + SetGpuReg(REG_OFFSET_BLDALPHA, (data3 << 8) + sprite->data[3]); + } + else + { + sprite->invisible = TRUE; + sprite->data[0] = 9; + } + break; + case 9: + sprite->data[0] += 1; + break; + case 10: + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + sub_818D820(sprite->data[6]); + break; + } +} + +static u8 sub_8177224(u16 species, s16 x, s16 y, u16 position) +{ + u8 spriteId; + u8 spriteId2; + + spriteId = sub_80C0E9C(species, x, y, position); + gSprites[spriteId].oam.priority = 1; + gSprites[spriteId].data[1] = position + 1; + gSprites[spriteId].invisible = TRUE; + gSprites[spriteId].callback = sub_8177050; + gSprites[spriteId].data[6] = spriteId; + + spriteId2 = CreateSprite(&gUnknown_085E7068, gSprites[spriteId].pos1.x, gSprites[spriteId].pos1.y, 1); + gSprites[spriteId2].data[0] = spriteId; + + StartSpriteAnimIfDifferent(&gSprites[spriteId2], position); + + return spriteId; +} + +static void sub_81772B8(struct Sprite *sprite) +{ + if (gSprites[sprite->data[0]].data[0] == 10 || gUnknown_0203BD28) + { + DestroySprite(sprite); + return; + } + + sprite->invisible = gSprites[sprite->data[0]].invisible; + sprite->oam.objMode = gSprites[sprite->data[0]].oam.objMode; + sprite->oam.affineMode = gSprites[sprite->data[0]].oam.affineMode; + sprite->oam.matrixNum = gSprites[sprite->data[0]].oam.matrixNum; + sprite->pos1.x = gSprites[sprite->data[0]].pos1.x; + sprite->pos1.y = gSprites[sprite->data[0]].pos1.y; +} + +static void sub_8177388(void) +{ + u16 starter = SpeciesToNationalPokedexNum(GetStarterPokemon(VarGet(VAR_FIRST_POKE))); + u16 page; + u16 dexNum; + u16 j; + + for (dexNum = 1, j = 0; dexNum < 386; dexNum++) + { + if (GetSetPokedexFlag(dexNum, 1)) + { + gUnknown_0203BCE8->unk96[j] = dexNum; + j++; + } + } + + for (dexNum = j; dexNum < 386; dexNum++) + gUnknown_0203BCE8->unk96[dexNum] = 0; + + gUnknown_0203BCE8->unk39A = j; + if (gUnknown_0203BCE8->unk39A < 71) + gUnknown_0203BCE8->unk94 = j; + else + gUnknown_0203BCE8->unk94 = 71; + + j = 0; + do + { + page = Random() % gUnknown_0203BCE8->unk39A; + gUnknown_0203BCE8->unk0[j] = gUnknown_0203BCE8->unk96[page]; + + j++; + gUnknown_0203BCE8->unk96[page] = 0; + gUnknown_0203BCE8->unk39A--; + if (page != gUnknown_0203BCE8->unk39A) + { + gUnknown_0203BCE8->unk96[page] = gUnknown_0203BCE8->unk96[gUnknown_0203BCE8->unk39A]; + gUnknown_0203BCE8->unk96[gUnknown_0203BCE8->unk39A] = 0; + } + } + while (gUnknown_0203BCE8->unk39A != 0 && j < 71); + + if (gUnknown_0203BCE8->unk94 < 71) + { + for (j = gUnknown_0203BCE8->unk94, page = 0; j < 71; j++) + { + gUnknown_0203BCE8->unk0[j] = gUnknown_0203BCE8->unk0[page]; + + page++; + if (page == gUnknown_0203BCE8->unk94) + page = 0; + } + gUnknown_0203BCE8->unk0[70] = starter; + } + else + { + for (dexNum = 0; gUnknown_0203BCE8->unk0[dexNum] != starter && dexNum < 71; dexNum++); + + if (dexNum < gUnknown_0203BCE8->unk94 - 1) + { + gUnknown_0203BCE8->unk0[dexNum] = gUnknown_0203BCE8->unk0[70]; + gUnknown_0203BCE8->unk0[70] = starter; + } + else + { + gUnknown_0203BCE8->unk0[70] = starter; + } + } + gUnknown_0203BCE8->unk94 = 71; +} diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 6dda6ad9c..83df30d05 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -369,7 +369,7 @@ static const struct HallofFameMon sDummyFameMon = 0x3EA03EA, 0, 0, 0, {0} }; -static const u8 sUnused2[6] = {2, 1, 3, 6, 4, 5}; +static const u8 sUnused2[] = {2, 1, 3, 6, 4, 5, 0, 0}; // code static void VBlankCB_HallOfFame(void) @@ -516,7 +516,7 @@ static void Task_Hof_InitTeamSaveData(u8 taskId) } else { - if (sub_81534D0(3) != TRUE) + if (Save_LoadGameData(3) != TRUE) memset(gDecompressionBuffer, 0, 0x2000); } @@ -885,7 +885,7 @@ void CB2_DoHallOfFamePC(void) static void Task_HofPC_CopySaveData(u8 taskId) { sub_81980F0(0, 0x1E, 0, 0xC, 0x226); - if (sub_81534D0(3) != 1) + if (Save_LoadGameData(3) != 1) { gTasks[taskId].func = Task_HofPC_PrintDataIsCorrupted; } diff --git a/src/intro.c b/src/intro.c new file mode 100644 index 000000000..f21ad348d --- /dev/null +++ b/src/intro.c @@ -0,0 +1,3020 @@ +#include "global.h" +#include "main.h" +#include "palette.h" +#include "scanline_effect.h" +#include "task.h" +#include "title_screen.h" +#include "libgcnmultiboot.h" +#include "malloc.h" +#include "gpu_regs.h" +#include "link.h" +#include "multiboot_pokemon_colosseum.h" +#include "load_save.h" +#include "save.h" +#include "new_game.h" +#include "m4a.h" +#include "random.h" +#include "decompress.h" +#include "constants/songs.h" +#include "intro_credits_graphics.h" +#include "trig.h" +#include "intro.h" +#include "graphics.h" +#include "sound.h" +#include "constants/species.h" +#include "blend_palette.h" +#include "title_screen.h" +#include "constants/rgb.h" + +extern const struct CompressedSpriteSheet gBattleAnimPicTable[]; +extern const struct CompressedSpritePalette gBattleAnimPaletteTable[]; +extern const struct SpriteTemplate gUnknown_08596C10[]; + +//ewram +EWRAM_DATA u16 gUnknown_0203BCC8 = 0; +EWRAM_DATA u16 gUnknown_0203BCCA = 0; +EWRAM_DATA u16 gUnknown_0203BCCC = 0; + +//iwram +u32 gIntroFrameCounter; +struct GcmbStruct gMultibootProgramStruct; + +//.rodata +static const u16 gIntro1DropsPal[] = INCBIN_U16("graphics/intro/intro1_drops.gbapal"); +static const u16 gIntro1GFLogoPal[] = INCBIN_U16("graphics/intro/intro1_gflogo.gbapal"); +static const u8 gIntroTiles[] = INCBIN_U8("graphics/intro/intro.4bpp.lz"); +static const u16 gIntro1BGPals[16][16] = INCBIN_U16("graphics/intro/intro1_bgpal.gbapal"); +static const u8 gIntro1BG0_Tilemap[] = INCBIN_U8("graphics/intro/intro1_bg0_map.bin.lz"); +static const u8 gIntro1BG1_Tilemap[] = INCBIN_U8("graphics/intro/intro1_bg1_map.bin.lz"); +static const u8 gIntro1BG2_Tilemap[] = INCBIN_U8("graphics/intro/intro1_bg2_map.bin.lz"); +static const u8 gIntro1BG3_Tilemap[] = INCBIN_U8("graphics/intro/intro1_bg3_map.bin.lz"); +static const u8 gIntro1BGLeavesGfx[] = INCBIN_U8("graphics/intro/introgfx.4bpp.lz"); +static const u16 gIntro3PokeballPal[] = INCBIN_U16("graphics/intro/intro3_pokeball.gbapal"); +static const u8 gIntro3Pokeball_Tilemap[] = INCBIN_U8("graphics/intro/intro3_pokeball_map.bin.lz"); +static const u8 gIntro3Pokeball_Gfx[] = INCBIN_U8("graphics/intro/intro3_pokeball.8bpp.lz"); +static const u16 gIntro3Streaks_Pal_Unused[] = INCBIN_U16("graphics/intro/intro3_streaks.gbapal"); +static const u8 gIntro3Streaks_Gfx_Unused[] = INCBIN_U8("graphics/intro/intro3_streaks.4bpp.lz"); +static const u8 gIntro3Streaks_Tilemap_Unused[] = INCBIN_U8("graphics/intro/intro3_streaks_map.bin.lz"); +static const u16 gIntro3Misc1Palette[] = INCBIN_U16("graphics/intro/intro3_misc1.gbapal"); +static const u16 gIntro3Misc2Palette_Unused[] = INCBIN_U16("graphics/intro/intro3_misc2.gbapal"); +static const u8 gIntro3MiscTiles[] = INCBIN_U8("graphics/intro/intro3_misc.4bpp.lz"); +static const u16 gIntro1FlygonPalette[] = INCBIN_U16("graphics/intro/intro1_flygon.gbapal"); +static const u8 gIntro1EonTiles_Unused[] = INCBIN_U8("graphics/intro/intro1_eon.4bpp.lz"); +static const u8 sUnknownBytes[] = { + 0x02, 0x03, 0x04, 0x05, 0x01, 0x01, 0x01, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x02, 0x0D, + 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x02, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x02, 0x0D, 0x0E, 0x0F, 0x10, + 0x11, 0x12, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x00 +}; +static const struct CompressedSpriteSheet gUnknown_085E4A74[] = +{ + {gIntro1SparkleGfx, 0x400, 1505}, + {NULL}, +}; +static const struct SpritePalette gUnknown_085E4A84[] = +{ + {gIntro3LightningPal, 1505}, + {NULL}, +}; +static const struct OamData gUnknown_085E4A94 = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; +static const union AnimCmd gUnknown_085E4A9C[] = +{ + ANIMCMD_FRAME(0, 2), + ANIMCMD_FRAME(4, 2), + ANIMCMD_FRAME(8, 2), + ANIMCMD_FRAME(12, 2), + ANIMCMD_FRAME(16, 2), + ANIMCMD_JUMP(0), +}; +static const union AnimCmd *const gUnknown_085E4AB4[] = +{ + gUnknown_085E4A9C, +}; +static void sub_816D338(struct Sprite *sprite); +static const struct SpriteTemplate gUnknown_085E4AB8 = +{ + .tileTag = 1505, + .paletteTag = 1505, + .oam = &gUnknown_085E4A94, + .anims = gUnknown_085E4AB4, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_816D338, +}; +static const u8 gUnknown_085E4AD0[][2] = +{ + {0x7C, 0x28}, + {0x66, 0x1E}, + {0x4D, 0x1E}, + {0x36, 0x0F}, + {0x94, 0x09}, + {0x3F, 0x1C}, + {0x5D, 0x28}, + {0x94, 0x20}, + {0xAD, 0x29}, + {0x5E, 0x14}, + {0xD0, 0x26}, + {0x00, 0x00}, +}; +static const struct CompressedSpriteSheet gUnknown_085E4AE8[] = +{ + {gIntro2VolbeatGfx, 0x400, 1500}, + {gIntro2TorchicGfx, 0xC00, 1501}, + {gIntro2ManectricGfx, 0x2000, 1502}, + {NULL}, +}; +static const struct SpritePalette gUnknown_085E4B08[] = +{ + {gIntro2VolbeatPal, 1500}, + {gIntro2TorchicPal, 1501}, + {gIntro2ManectricPal, 1502}, + {NULL}, +}; +static const struct OamData gUnknown_085E4B28 = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; +static const union AnimCmd gUnknown_085E4B30[] = +{ + ANIMCMD_FRAME(0, 2), + ANIMCMD_FRAME(16, 2), + ANIMCMD_JUMP(0), +}; +static const union AnimCmd *const gUnknown_085E4B3C[] = +{ + gUnknown_085E4B30, +}; +static void sub_816D81C(struct Sprite *sprite); +static const struct SpriteTemplate gUnknown_085E4B40 = +{ + .tileTag = 1500, + .paletteTag = 1500, + .oam = &gUnknown_085E4B28, + .anims = gUnknown_085E4B3C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_816D81C, +}; +static const struct OamData gUnknown_085E4B58 = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; +static const union AnimCmd gUnknown_085E4B60[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_FRAME(16, 5), + ANIMCMD_FRAME(32, 5), + ANIMCMD_FRAME(16, 5), + ANIMCMD_JUMP(0), +}; +static const union AnimCmd gUnknown_085E4B74[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(16, 3), + ANIMCMD_FRAME(32, 3), + ANIMCMD_FRAME(16, 3), + ANIMCMD_JUMP(0), +}; +static const union AnimCmd gUnknown_085E4B88[] = +{ + ANIMCMD_FRAME(48, 4), + ANIMCMD_FRAME(64, 6), + ANIMCMD_FRAME(80, 0), + ANIMCMD_END, +}; +static const union AnimCmd *const gUnknown_085E4B98[] = +{ + gUnknown_085E4B60, + gUnknown_085E4B74, + gUnknown_085E4B88, +}; +static void sub_816D9C0(struct Sprite *sprite); +static const struct SpriteTemplate gUnknown_085E4BA4 = +{ + .tileTag = 1501, + .paletteTag = 1501, + .oam = &gUnknown_085E4B58, + .anims = gUnknown_085E4B98, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_816D9C0, +}; +static const struct OamData gUnknown_085E4BBC = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; +static const union AnimCmd gUnknown_085E4BC4[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(64, 4), + ANIMCMD_FRAME(128, 4), + ANIMCMD_FRAME(192, 4), + ANIMCMD_JUMP(0), +}; +static const union AnimCmd *const gUnknown_085E4BD8[] = +{ + gUnknown_085E4BC4, +}; +static void sub_816DAE8(struct Sprite *sprite); +static const struct SpriteTemplate gUnknown_085E4BDC = +{ + .tileTag = 1502, + .paletteTag = 1502, + .oam = &gUnknown_085E4BBC, + .anims = gUnknown_085E4BD8, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_816DAE8, +}; +static const struct CompressedSpriteSheet gUnknown_085E4BF4[] = +{ + {gIntro3LightningGfx, 0xC00, 1503}, + {NULL}, +}; +static const struct SpritePalette gUnknown_085E4C04[] = +{ + {gIntro3LightningPal, 1503}, + {NULL}, +}; +static const struct OamData gUnknown_085E4C14 = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; +static const union AnimCmd gUnknown_085E4C1C[] = +{ + ANIMCMD_FRAME(0, 2), + ANIMCMD_FRAME(48, 2), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4C28[] = +{ + ANIMCMD_FRAME(16, 2), + ANIMCMD_FRAME(64, 2), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4C34[] = +{ + ANIMCMD_FRAME(32, 2), + ANIMCMD_FRAME(80, 2), + ANIMCMD_END, +}; +static const union AnimCmd *const gUnknown_085E4C40[] = +{ + gUnknown_085E4C1C, + gUnknown_085E4C28, + gUnknown_085E4C34, +}; +static void sub_816EC6C(struct Sprite *sprite); +static const struct SpriteTemplate gUnknown_085E4C4C = +{ + .tileTag = 1503, + .paletteTag = 1503, + .oam = &gUnknown_085E4C14, + .anims = gUnknown_085E4C40, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_816EC6C, +}; +static const s16 gUnknown_085E4C64[][3] = +{ + {0x68, 0x00, 0x0C0}, + {0x8E, 0x03, 0x280}, + {0x53, 0x01, 0x180}, + {0x9B, 0x00, 0x080}, + {0x38, 0x02, 0x200}, + {0xAE, 0x01, 0x100}, +}; +static const struct CompressedSpriteSheet gUnknown_085E4C88[] = +{ + {gIntro2BubblesGfx, 0x600, 1504}, + {NULL}, +}; +static const struct SpritePalette gUnknown_085E4C98[] = +{ + {gIntro2BubblesPal, 1504}, + {NULL}, +}; +static const s16 gUnknown_085E4CA8[][3] = +{ + {0x42, 0x40, 0x1}, + {0x60, 0x60, 0x8}, + {0x80, 0x40, 0x1}, + {0x90, 0x30, 0x8}, + {0xA0, 0x48, 0x1}, + {0xB0, 0x60, 0x8}, + {0x60, 0x60, 0x4}, + {0x70, 0x68, 0x8}, + {0x80, 0x60, 0x4}, + {0x58, 0x20, 0x4}, + {0x68, 0x18, 0x8}, + {0x78, 0x20, 0x4}, +}; +static const struct OamData gUnknown_085E4CF0 = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 2, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; +static const union AnimCmd gUnknown_085E4CF8[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(8, 4), + ANIMCMD_FRAME(16, 4), + ANIMCMD_FRAME(24, 4), + ANIMCMD_FRAME(32, 4), + ANIMCMD_END, +}; +static const union AnimCmd *const gUnknown_085E4D10[] = +{ + gUnknown_085E4CF8, +}; +static void sub_816E7B4(struct Sprite *sprite); +static const struct SpriteTemplate gUnknown_085E4D14 = +{ + .tileTag = 1504, + .paletteTag = 1504, + .oam = &gUnknown_085E4CF0, + .anims = gUnknown_085E4D10, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_816E7B4, +}; +static const struct OamData gUnknown_085E4D2C = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; +static const union AnimCmd gUnknown_085E4D34[] = +{ + ANIMCMD_FRAME(16, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4D3C[] = +{ + ANIMCMD_FRAME(24, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4D44[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4D4C[] = +{ + ANIMCMD_FRAME(48, 8), + ANIMCMD_END, +}; +static const union AnimCmd *const gUnknown_085E4D54[] = +{ + gUnknown_085E4D34, + gUnknown_085E4D3C, + gUnknown_085E4D44, + gUnknown_085E4D4C, +}; +static void sub_816F454(struct Sprite *sprite); +static const struct SpriteTemplate gUnknown_085E4D64 = +{ + .tileTag = 2000, + .paletteTag = 2000, + .oam = &gUnknown_085E4D2C, + .anims = gUnknown_085E4D54, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_816F454, +}; +static const union AnimCmd gUnknown_085E4D7C[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(64, 4), + ANIMCMD_FRAME(128, 4), + ANIMCMD_FRAME(192, 4), + ANIMCMD_JUMP(0), +}; +static const union AnimCmd gUnknown_085E4D90[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_FRAME(64, 8), + ANIMCMD_FRAME(128, 8), + ANIMCMD_FRAME(192, 8), + ANIMCMD_JUMP(0), +}; +static const union AnimCmd gUnknown_085E4DA4[] = +{ + ANIMCMD_FRAME(256, 4), + ANIMCMD_FRAME(0x140, 4), + ANIMCMD_FRAME(0x180, 4), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4DB4[] = +{ + ANIMCMD_FRAME(0x180, 16), + ANIMCMD_FRAME(0x140, 16), + ANIMCMD_FRAME(256, 16), + ANIMCMD_END, +}; +static const union AnimCmd *const gUnknown_085E4DC4[] = +{ + gUnknown_085E4D7C, + gUnknown_085E4D90, + gUnknown_085E4DA4, + gUnknown_085E4DB4, +}; +static const struct OamData gUnknown_085E4DD4 = +{ + .y = 160, + .affineMode = 3, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; +static const struct OamData gUnknown_085E4DDC = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 0, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; +static const struct OamData gUnknown_085E4DE4 = +{ + .y = 160, + .affineMode = 3, + .objMode = 1, + .mosaic = 0, + .bpp = 0, + .shape = 2, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; +static const union AnimCmd gUnknown_085E4DEC[] = +{ + ANIMCMD_FRAME(80, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4DF4[] = +{ + ANIMCMD_FRAME(84, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4DFC[] = +{ + ANIMCMD_FRAME(88, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4E04[] = +{ + ANIMCMD_FRAME(92, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4E0C[] = +{ + ANIMCMD_FRAME(96, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4E14[] = +{ + ANIMCMD_FRAME(100, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4E1C[] = +{ + ANIMCMD_FRAME(104, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4E24[] = +{ + ANIMCMD_FRAME(112, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4E2C[] = +{ + ANIMCMD_FRAME(113, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4E34[] = +{ + ANIMCMD_FRAME(114, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4E3C[] = +{ + ANIMCMD_FRAME(115, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4E44[] = +{ + ANIMCMD_FRAME(116, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4E4C[] = +{ + ANIMCMD_FRAME(117, 8), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_085E4E54[] = +{ + ANIMCMD_FRAME(128, 8), + ANIMCMD_END, +}; +static const union AnimCmd *const gUnknown_085E4E5C[] = +{ + gUnknown_085E4DEC, + gUnknown_085E4DF4, + gUnknown_085E4DFC, + gUnknown_085E4E04, + gUnknown_085E4E0C, + gUnknown_085E4E14, + gUnknown_085E4E1C, +}; +static const union AnimCmd *const gUnknown_085E4E78[] = +{ + gUnknown_085E4E24, + gUnknown_085E4E2C, + gUnknown_085E4E34, + gUnknown_085E4E3C, + gUnknown_085E4E44, + gUnknown_085E4E4C, +}; +static const union AnimCmd *const gUnknown_085E4E90[] = +{ + gUnknown_085E4E54, +}; +static const s16 gUnknown_085E4E94[][2] = +{ + {0, -72}, + {1, -56}, + {2, -40}, + {3, -24}, + {4, 8}, + {5, 24}, + {3, 40}, + {1, 56}, + {6, 72}, + {0, -28}, + {1, -20}, + {2, -12}, + {3, -4}, + {2, 4}, + {4, 12}, + {5, 20}, + {3, 28}, +}; +static const union AffineAnimCmd gUnknown_085E4ED8[] = +{ + AFFINEANIMCMD_FRAME(128, 128, 0, 0), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd gUnknown_085E4EE8[] = +{ + AFFINEANIMCMD_FRAME(128, 128, 0, 0), + AFFINEANIMCMD_FRAME(16, 16, 0, 16), + AFFINEANIMCMD_FRAME(-16, -16, 0, 8), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd gUnknown_085E4F08[] = +{ + AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_FRAME(8, 8, 0, 48), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd gUnknown_085E4F20[] = +{ + AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_FRAME(2, 2, 0, 48), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd *const gUnknown_085E4F38[] = +{ + gUnknown_085E4ED8, + gUnknown_085E4EE8, + gUnknown_085E4F08, + gUnknown_085E4F20, +}; +static const u16 gUnknown_085E4F48[] = +{ + 0x100, 0xC0, 0x80, 0x40, 0x00, 0x40, 0x80, 0xC0, 0x100 +}; +static void sub_816FB38(struct Sprite *sprite); +static const struct SpriteTemplate gUnknown_085E4F5C = +{ + .tileTag = 2000, + .paletteTag = 2001, + .oam = &gUnknown_085E4DD4, + .anims = gUnknown_085E4E5C, + .images = NULL, + .affineAnims = gUnknown_085E4F38, + .callback = sub_816FB38, +}; +static const struct SpriteTemplate gUnknown_085E4F74 = +{ + .tileTag = 2000, + .paletteTag = 2001, + .oam = &gUnknown_085E4DDC, + .anims = gUnknown_085E4E78, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_816FB38, +}; +static void sub_816FD44(struct Sprite *sprite); +static const struct SpriteTemplate gUnknown_085E4F8C = +{ + .tileTag = 2000, + .paletteTag = 2001, + .oam = &gUnknown_085E4DE4, + .anims = gUnknown_085E4E90, + .images = NULL, + .affineAnims = gUnknown_085E4F38, + .callback = sub_816FD44, +}; +static const u8 gUnknown_085E4FA4[] = +{ + 0x00, 0x17, 0x17, 0x31, 0x3E, 0x24, 0x24, 0x0A, 0x0A +}; +static const struct OamData gUnknown_085E4FB0 = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; +static const union AnimCmd gUnknown_085E4FB8[] = +{ + ANIMCMD_FRAME(0, 10), + ANIMCMD_JUMP(0), +}; +static const union AnimCmd *const gUnknown_085E4FC0[] = +{ + gUnknown_085E4FB8, +}; +static void sub_816FEDC(struct Sprite *sprite); +static const struct SpriteTemplate gUnknown_085E4FC4 = +{ + .tileTag = 2002, + .paletteTag = 2002, + .oam = &gUnknown_085E4FB0, + .anims = gUnknown_085E4FC0, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_816FEDC, +}; +static const struct CompressedSpriteSheet gUnknown_085E4FDC[] = +{ + {gIntroTiles, 0x1400, 2000}, + {NULL}, +}; +static const struct CompressedSpriteSheet gUnknown_085E4FEC[] = +{ + {gIntro1FlygonGfx, 0x400, 2002}, + {NULL}, +}; +static const struct SpritePalette gUnknown_085E4FFC[] = +{ + {gIntro1DropsPal, 2000}, + {gIntro1GFLogoPal, 2001}, + {gIntro1FlygonPalette, 2002}, + {NULL}, +}; +static const struct OamData gUnknown_085E501C = +{ + .y = 160, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; +static const union AnimCmd gUnknown_085E5024[] = +{ + ANIMCMD_FRAME(16, 8), + ANIMCMD_END, +}; +static const union AnimCmd *const gUnknown_085E502C[] = +{ + gUnknown_085E5024, +}; +static void sub_8170040(struct Sprite *sprite); +static const struct SpriteTemplate gUnknown_085E5030 = +{ + .tileTag = 2003, + .paletteTag = 2003, + .oam = &gUnknown_085E501C, + .anims = gUnknown_085E502C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8170040, +}; +static const struct CompressedSpriteSheet gUnknown_085E5048[] = +{ + {gIntro3MiscTiles, 0xA00, 2003}, + {NULL}, +}; +static const struct SpritePalette gUnknown_085E5058[] = +{ + {gIntro3Misc1Palette, 2003}, + {NULL}, +}; + +// this file's functions +static void MainCB2_EndIntro(void); +static void Task_IntroLoadPart1Graphics(u8); +static u8 CreateWaterDrop(s16, s16, u16, u16, u16, u8); +static void Task_IntroFadeIn(u8); +static void intro_reset_and_hide_bgs(void); +static void Task_IntroWaterDrops(u8); +static void Task_IntroWaterDrops_1(u8); +static void Task_IntroWaterDrops_2(u8); +static void Task_IntroWaterDrops_3(u8); +static void Task_IntroScrollDownAndShowFlygon(u8); +static void Task_IntroWaitToSetupPart2(u8); +static void Task_IntroLoadPart2Graphics(u8); +static void Task_IntroStartBikeRide(u8); +static void Task_IntroHandleBikeAndFlygonMovement(u8); +static void Task_IntroWaitToSetupPart3(u8); +static void Task_IntroLoadPart3Graphics(u8); +static void Task_IntroSpinAndZoomPokeball(u8); +static void Task_IntroWaitToSetupPart3LegendsFight(u8); +static void Task_IntroLoadPart1Graphics3(u8); +static void Task_IntroLoadPart1Graphics4(u8); +static void Task_IntroLoadPart1Graphics5(u8); +static void Task_IntroLoadPart1Graphics6(u8); +static void Task_IntroLoadPart1Graphics7(u8); +static void Task_IntroLoadPart1Graphics8(u8); +static void Task_IntroLoadPart1Graphics9(u8); +static void Task_IntroFadeIn0(u8); +static void Task_IntroFadeIn1(u8); +static void Task_IntroFadeIn2(u8); +static void Task_IntroFadeIn3(u8); +static void Task_IntroFadeIn4(u8); +static void Task_IntroFadeIn5(u8); +static void Task_IntroFadeIn6(u8); +static void Task_IntroFadeIn7(u8); +static void Task_IntroFadeIn8(u8); +static void Task_IntroFadeIn9(u8); +static void sub_816E190(u8); +static void sub_816E1F8(struct Sprite *); +static void sub_816E6D4(u8); +static void sub_816E74C(void); +static void sub_816EEA8(u8); +static void sub_816F46C(struct Sprite *); +static void sub_816F5B4(struct Sprite *); +static void sub_816F660(struct Sprite *); +static void SpriteCB_WaterDropFall(struct Sprite *); +static void sub_816F318(struct Sprite *); +static void sub_816F9D4(struct Sprite *); +static void sub_816FAB0(struct Sprite *); +static u8 sub_816FDB8(s16, s16, s16); + +static void VBlankCB_Intro(void) +{ + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); + ScanlineEffect_InitHBlankDmaTransfer(); +} + +static void MainCB2_Intro(void) +{ + RunTasks(); + AnimateSprites(); + BuildOamBuffer(); + UpdatePaletteFade(); + if (gMain.newKeys && !gPaletteFade.active) + SetMainCallback2(MainCB2_EndIntro); + else if (gIntroFrameCounter != -1) + gIntroFrameCounter++; +} + +static void MainCB2_EndIntro(void) +{ + if (!UpdatePaletteFade()) + SetMainCallback2(CB2_InitTitleScreen); +} + +static void LoadCopyrightGraphics(u16 tilesetAddress, u16 tilemapAddress, u16 paletteAddress) +{ + LZ77UnCompVram(gIntroCopyright_Gfx, (void *)(VRAM + tilesetAddress)); + LZ77UnCompVram(gIntroCopyright_Tilemap, (void *)(VRAM + tilemapAddress)); + LoadPalette(gIntroCopyright_Pal, paletteAddress, 0x20); +} + +static void SerialCB_CopyrightScreen(void) +{ + GameCubeMultiBoot_HandleSerialInterrupt(&gMultibootProgramStruct); +} + +static u8 SetUpCopyrightScreen(void) +{ + u16 ime; + + switch (gMain.state) + { + case 0: + SetVBlankCallback(NULL); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); + *(u16 *)PLTT = 0x7FFF; + SetGpuReg(REG_OFFSET_DISPCNT, 0); + SetGpuReg(REG_OFFSET_BG0HOFS, 0); + SetGpuReg(REG_OFFSET_BG0VOFS, 0); + CpuFill32(0, (void *)VRAM, VRAM_SIZE); + CpuFill32(0, (void *)OAM, OAM_SIZE); + CpuFill16(0, (void *)(PLTT + 2), PLTT_SIZE - 2); + ResetPaletteFade(); + LoadCopyrightGraphics(0, 0x3800, 0); + ScanlineEffect_Stop(); + ResetTasks(); + ResetSpriteData(); + FreeAllSpritePalettes(); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITEALPHA); + SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0) + | BGCNT_CHARBASE(0) + | BGCNT_SCREENBASE(7) + | BGCNT_16COLOR + | BGCNT_TXT256x256); + EnableInterrupts(INTR_FLAG_VBLANK); + SetVBlankCallback(VBlankCB_Intro); + REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON; + SetSerialCallback(SerialCB_CopyrightScreen); + GameCubeMultiBoot_Init(&gMultibootProgramStruct); + default: + UpdatePaletteFade(); + gMain.state++; + GameCubeMultiBoot_Main(&gMultibootProgramStruct); + break; + case 140: + GameCubeMultiBoot_Main(&gMultibootProgramStruct); + if (gMultibootProgramStruct.gcmb_field_2 != 1) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + gMain.state++; + } + break; + case 141: + if (UpdatePaletteFade()) + break; + CreateTask(Task_IntroLoadPart1Graphics, 0); + SetMainCallback2(MainCB2_Intro); + if (gMultibootProgramStruct.gcmb_field_2 != 0) + { + if (gMultibootProgramStruct.gcmb_field_2 == 2) + { + // check the multiboot ROM header game code to see if we already did this + if (*(u32 *)(EWRAM_START + 0xAC) == 0x65366347) // "Gc6e" in ASCII + { + CpuCopy16(&gMultiBootProgram_PokemonColosseum_Start, (void *)EWRAM_START, sizeof(gMultiBootProgram_PokemonColosseum_Start)); + *(u32 *)(EWRAM_START + 0xAC) = 0x65366347; + } + GameCubeMultiBoot_ExecuteProgram(&gMultibootProgramStruct); + } + } + else + { + GameCubeMultiBoot_Quit(); + SetSerialCallback(SerialCB); + } + return 0; + } + + return 1; +} + +void CB2_InitCopyrightScreenAfterBootup(void) +{ + if (!SetUpCopyrightScreen()) + { + SetSaveBlocksPointers(sub_815355C()); + sub_808447C(); + Save_ResetSaveCounters(); + Save_LoadGameData(SAVE_NORMAL); + if (gSaveFileStatus == 0 || gSaveFileStatus == 2) + Sav2_ClearSetDefault(); + SetPokemonCryStereo(gSaveBlock2Ptr->optionsSound); + InitHeap(gHeap, HEAP_SIZE); + } +} + +void CB2_InitCopyrightScreenAfterTitleScreen(void) +{ + SetUpCopyrightScreen(); +} + +static void Task_IntroLoadPart1Graphics(u8 taskId) +{ + SetVBlankCallback(NULL); + gUnknown_0203BCC8 = Random() & 1; + intro_reset_and_hide_bgs(); + SetGpuReg(REG_OFFSET_BG3VOFS, 0); + SetGpuReg(REG_OFFSET_BG2VOFS, 0x50); + SetGpuReg(REG_OFFSET_BG1VOFS, 0x18); + SetGpuReg(REG_OFFSET_BG0VOFS, 0x28); + LZ77UnCompVram(gIntro1BGLeavesGfx, (void *)VRAM); + LZ77UnCompVram(gIntro1BG0_Tilemap, (void *)(VRAM + 0x8000)); + DmaClear16(3, VRAM + 0x8800, 0x800); + LZ77UnCompVram(gIntro1BG1_Tilemap, (void *)(VRAM + 0x9000)); + DmaClear16(3, VRAM + 0x9800, 0x800); + LZ77UnCompVram(gIntro1BG2_Tilemap, (void *)(VRAM + 0xA000)); + DmaClear16(3, VRAM + 0xA800, 0x800); + LZ77UnCompVram(gIntro1BG3_Tilemap, (void *)(VRAM + 0xB000)); + DmaClear16(3, VRAM + 0xB800, 0x800); + LoadPalette(gIntro1BGPals, 0, sizeof(gIntro1BGPals)); + SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(22) | BGCNT_16COLOR | BGCNT_TXT256x512); + SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(20) | BGCNT_16COLOR | BGCNT_TXT256x512); + SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(1) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(18) | BGCNT_16COLOR | BGCNT_TXT256x512); + SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(16) | BGCNT_16COLOR | BGCNT_TXT256x512); + LoadCompressedObjectPic(gUnknown_085E4FDC); + LoadCompressedObjectPic(gUnknown_085E4FEC); + LoadSpritePalettes(gUnknown_085E4FFC); + LoadCompressedObjectPic(gUnknown_085E4A74); + LoadSpritePalettes(gUnknown_085E4A84); + CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1F0, 0x20); + CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1E1, 0x1E); + CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1D2, 0x1C); + CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1C3, 0x1A); + CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1B4, 0x18); + CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1A5, 0x16); + CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x196, 0x14); + sub_816FDB8(0x78, 0x50, 0); + gTasks[taskId].data[0] = CreateWaterDrop(236, -14, 0x200, 1, 0x78, FALSE); + gTasks[taskId].func = Task_IntroFadeIn; +} + +static void Task_IntroFadeIn(u8 taskId) +{ + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + SetVBlankCallback(VBlankCB_Intro); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_ON); + gTasks[taskId].func = Task_IntroWaterDrops; + gIntroFrameCounter = 0; + m4aSongNumStart(MUS_DEMO1); + ResetSerial(); +} + +static void Task_IntroWaterDrops(u8 taskId) +{ + //start moving rock + if (gIntroFrameCounter == 76) + gSprites[gTasks[taskId].data[0]].data[0] = 1; + + if (gIntroFrameCounter == 128) + CreateTask(Task_IntroWaterDrops_1, 0); + + //drop rock + if (gIntroFrameCounter == 251) + gSprites[gTasks[taskId].data[0]].data[0] = 2; + + if (gIntroFrameCounter == 256) + CreateTask(Task_IntroWaterDrops_2, 0); + + if (gIntroFrameCounter == 368) + CreateWaterDrop(48, 0, 0x400, 5, 0x70, TRUE); + + if (gIntroFrameCounter == 384) + CreateWaterDrop(200, 60, 0x400, 9, 0x80, TRUE); + + if (gIntroFrameCounter == 560) + CreateTask(Task_IntroWaterDrops_3, 0); + + if (gIntroFrameCounter > 560) + { + gTasks[taskId].data[1] = 0x50; + gTasks[taskId].data[2] = 0; + gTasks[taskId].data[3] = 0x18; + gTasks[taskId].data[4] = 0; + gTasks[taskId].data[5] = 0x28; + gTasks[taskId].data[6] = 0; + gTasks[taskId].func = Task_IntroScrollDownAndShowFlygon; + } +} + +static void Task_IntroWaterDrops_3(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + if (++data[2] & 1) + data[3]++; + + switch (data[0]) + { + case 0: + CreateSprite(&gUnknown_085E4AB8, gUnknown_085E4AD0[data[4]][0], gUnknown_085E4AD0[data[4]][1] + data[3], 0); + data[0]++; + data[1] = 0xC; + data[4]++; + break; + case 1: + if (!--data[1]) + data[0] = 0; + break; + } + + if (data[3] > 0x3C) + DestroyTask(taskId); +} + +static void sub_816D338(struct Sprite *sprite) +{ + if (++sprite->data[0] == 0xC) + DestroySprite(sprite); +} + +static void Task_IntroScrollDownAndShowFlygon(u8 taskId) +{ + if (gIntroFrameCounter < 904) + { + s32 r2; + + //slide backgrounds downward + r2 = (gTasks[taskId].data[1] << 16) + (u16)gTasks[taskId].data[2]; + r2 -= 0x6000; + gTasks[taskId].data[1] = r2 >> 16; + gTasks[taskId].data[2] = r2; + SetGpuReg(REG_OFFSET_BG2VOFS, gTasks[taskId].data[1]); + r2 = (gTasks[taskId].data[3] << 16) + (u16)gTasks[taskId].data[4]; + r2 -= 0x8000; + gTasks[taskId].data[3] = r2 >> 16; + gTasks[taskId].data[4] = r2; + SetGpuReg(REG_OFFSET_BG1VOFS, gTasks[taskId].data[3]); + r2 = (gTasks[taskId].data[5] << 16) + (u16)gTasks[taskId].data[6]; + r2 -= 0xC000; + gTasks[taskId].data[5] = r2 >> 16; + gTasks[taskId].data[6] = r2; + SetGpuReg(REG_OFFSET_BG0VOFS, gTasks[taskId].data[5]); + + //show Flygon sprite + if (gIntroFrameCounter == 832) + { + u8 spriteId = CreateSprite(&gUnknown_085E4FC4, 120, 160, 10); + gSprites[spriteId].invisible = TRUE; + } + } + else + { + //fade to white + if (gIntroFrameCounter > 1007) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_WHITEALPHA); + gTasks[taskId].func = Task_IntroWaitToSetupPart2; + } + } +} + +static void Task_IntroWaitToSetupPart2(u8 taskId) +{ + if (gIntroFrameCounter > 1026) + gTasks[taskId].func = Task_IntroLoadPart2Graphics; +} + +static void Task_IntroLoadPart2Graphics(u8 taskId) +{ + intro_reset_and_hide_bgs(); + SetVBlankCallback(NULL); + ResetSpriteData(); + FreeAllSpritePalettes(); + gUnknown_0203BD24 = 0; + gUnknown_0203BD26 = 0; + gUnknown_0203BCCC = 0; + load_intro_part2_graphics(1); + gTasks[taskId].func = Task_IntroStartBikeRide; +} + +static void Task_IntroStartBikeRide(u8 taskId) +{ + u8 spriteId; + + if (gUnknown_0203BCC8 == 0) + LoadCompressedObjectPic(gIntro2BrendanSpriteSheet); + else + LoadCompressedObjectPic(gIntro2MaySpriteSheet); + + LoadCompressedObjectPic(gIntro2BicycleSpriteSheet); + LoadCompressedObjectPic(gIntro2FlygonSpriteSheet); + + for (spriteId = 0; spriteId < 3; spriteId++) + { + LoadCompressedObjectPic(&gUnknown_085E4AE8[spriteId]); + } + + LoadSpritePalettes(gUnknown_085F530C); + LoadSpritePalettes(gUnknown_085E4B08); + CreateSprite(&gUnknown_085E4BDC, 0x110, 0x80, 0); + CreateSprite(&gUnknown_085E4BA4, 0x120, 0x6E, 1); + + if (gUnknown_0203BCC8 == 0) + spriteId = intro_create_brendan_sprite(0x110, 100); + else + spriteId = intro_create_may_sprite(0x110, 100); + + gSprites[spriteId].callback = sub_816F9D4; + gSprites[spriteId].anims = gUnknown_085E4DC4; + gTasks[taskId].data[1] = spriteId; + CreateSprite(&gUnknown_085E4B40, 0x110, 0x50, 0x4); + spriteId = intro_create_flygon_sprite(-0x40, 0x3C); + gSprites[spriteId].callback = sub_816FAB0; + gTasks[taskId].data[2] = spriteId; + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_WHITEALPHA); + SetVBlankCallback(VBlankCB_Intro); + gTasks[taskId].data[0] = sub_817B3DC(1, 0x4000, 0x400, 0x10); + sub_817B150(1); + gTasks[taskId].func = Task_IntroHandleBikeAndFlygonMovement; +} + +static void Task_IntroHandleBikeAndFlygonMovement(u8 taskId) +{ + s16 a; + u16 sine; + + if (gIntroFrameCounter == 1856) + { + gUnknown_0203BD28 = 2; + DestroyTask(gTasks[taskId].data[0]); + } + if (gIntroFrameCounter > 1946) + { + BeginNormalPaletteFade(0xFFFFFFFF, 8, 0, 16, RGB_WHITEALPHA); + gTasks[taskId].func = Task_IntroWaitToSetupPart3; + } + if (gIntroFrameCounter == 1109) + gSprites[gTasks[taskId].data[1]].data[0] = 1; + if (gIntroFrameCounter == 1214) + gSprites[gTasks[taskId].data[1]].data[0] = 0; + if (gIntroFrameCounter == 1394) + gSprites[gTasks[taskId].data[2]].data[0] = 1; + if (gIntroFrameCounter == 1398) + gSprites[gTasks[taskId].data[1]].data[0] = 2; + if (gIntroFrameCounter == 1576) + gSprites[gTasks[taskId].data[1]].data[0] = 3; + if (gIntroFrameCounter == 1727) + gSprites[gTasks[taskId].data[1]].data[0] = 4; + + sine = Sin(gTasks[taskId].data[3] >> 2 & 0x7F, 48); + gUnknown_0203BCCC = sine; + if (gTasks[taskId].data[3] < 512) + gTasks[taskId].data[3]++; + sub_817B540(0); +} + +static void Task_IntroWaitToSetupPart3(u8 taskId) +{ + if (gIntroFrameCounter > 2068) + gTasks[taskId].func = Task_IntroLoadPart3Graphics; +} + +static void sub_816D81C(struct Sprite *sprite) +{ + sprite->data[3] += 4; + switch (sprite->data[0]) + { + case 0: + if (++sprite->data[1] < 180) + break; + ++sprite->data[0]; + case 1: + sprite->pos1.x -= 4; + if (sprite->pos1.x == 0x3C) + { + sprite->data[0] = 8; + sprite->data[1] = 20; + sprite->data[2] = 2; + } + break; + case 2: + sprite->pos1.x += 8; + sprite->pos1.y -= 2; + if (sprite->pos1.x == 0x7C) + { + sprite->data[0] = 8; + sprite->data[1] = 20; + sprite->data[2] = 3; + } + break; + case 3: + sprite->pos1.y += 4; + if (sprite->pos1.y == 0x50) + { + sprite->data[0] = 8; + sprite->data[1] = 10; + sprite->data[2] = 4; + } + break; + case 4: + sprite->pos1.x -= 8; + sprite->pos1.y -= 2; + if (sprite->pos1.x == 0x3C) + { + sprite->data[0] = 8; + sprite->data[1] = 10; + sprite->data[2] = 5; + } + break; + case 5: + sprite->pos1.x += 0x3C; + sprite->data[4] = 0xC0; + sprite->data[5] = 0x80; + sprite->data[6] = 0x3; + sprite->data[0]++; + case 6: + sprite->pos2.x = Sin((u8)sprite->data[4], 0x3C); + sprite->pos2.y = Sin((u8)sprite->data[5], 0x14); + sprite->data[4] += 2; + sprite->data[5] += 4; + if ((sprite->data[4] & 0xFF) == 0x40) + { + sprite->hFlip = FALSE; + if (!--sprite->data[6]) + { + sprite->pos1.x += sprite->pos2.x; + sprite->pos2.x = 0; + sprite->data[0]++; + } + } + break; + case 7: + sprite->pos1.x -= 2; + sprite->pos2.y = Sin((u8)sprite->data[5], 0x14); + sprite->data[5] += 4; + if (sprite->pos1.x < -16) + DestroySprite(sprite); + break; + case 8: + sprite->pos2.y = Cos((u8)sprite->data[3], 2); + if (!--sprite->data[1]) + sprite->data[0] = sprite->data[2]; + break; + } +} + +static void sub_816D9C0(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + if (gIntroFrameCounter == 1224) + { + StartSpriteAnim(sprite, 1); + sprite->data[0]++; + } + break; + case 1: + if (gIntroFrameCounter == 1576) + { + StartSpriteAnim(sprite, 0); + sprite->data[0]++; + } + else + { + sprite->data[1] += 0x40; + if (sprite->data[1] & 0xFF00) + { + sprite->pos1.x--; + sprite->data[1] &= 0xFF; + } + } + break; + case 2: + if (gIntroFrameCounter != 1735) + { + sprite->data[1] += 0x20; + if (sprite->data[1] & 0xFF00) + { + sprite->pos1.x++; + sprite->data[1] &= 0xFF; + } + } + else + { + StartSpriteAnim(sprite, 1); + sprite->data[0]++; + sprite->data[2] = 0x50; + } + break; + case 3: + if (--sprite->data[2]) + { + sprite->data[1] += 0x40; + if (sprite->data[1] & 0xFF00) + { + sprite->pos1.x--; + sprite->data[1] &= 0xFF; + } + } + else + { + StartSpriteAnim(sprite, 2); + sprite->data[0]++; + } + break; + case 4: + if (sprite->animEnded) + sprite->pos1.x += 4; + + if (sprite->pos1.x > 336) + { + StartSpriteAnim(sprite, 1); + sprite->data[0]++; + } + break; + case 5: + if (gIntroFrameCounter > 1855) + sprite->pos1.x -= 2; + break; + } +} + +static void sub_816DAE8(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + if (gIntroFrameCounter == 1088) + sprite->data[0]++; + break; + case 1: + sprite->pos1.x -= 2; + if (gIntroFrameCounter != 1168) + break; + sprite->pos1.y -= 12; + sprite->data[1] = 0x80; + sprite->data[2] = 0; + sprite->data[0]++; + case 2: + if (sprite->pos1.x + sprite->pos2.x <= -0x20) + { + DestroySprite(sprite); + } + else + { + if ((sprite->data[1] & 0xFF) < 0x40) + { + sprite->pos2.x = Sin((u8)sprite->data[1], 0x10); + } + else + { + if ((sprite->data[1] & 0xFF) == 0x40) + sprite->pos1.x -= 0x30; + sprite->pos2.x = Sin((u8)sprite->data[1], 0x40); + } + sprite->data[1]++; + sprite->pos2.y = Cos((u8)sprite->data[2], 0xC); + sprite->data[2]++; + } + break; + } +} + +static void Task_IntroLoadPart3Graphics(u8 taskId) +{ + intro_reset_and_hide_bgs(); + LZ77UnCompVram(gIntro3Pokeball_Gfx, (void *)VRAM); + LZ77UnCompVram(gIntro3Pokeball_Tilemap, (void *)(VRAM + 0x4000)); + LoadPalette(gIntro3PokeballPal, 0, 0x200); + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = 0; + gTasks[taskId].data[2] = 0; + gTasks[taskId].data[3] = 0; + sub_816F2A8(0x78, 0x50, 0, 0); + ResetSpriteData(); + FreeAllSpritePalettes(); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITEALPHA); + SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(8) | BGCNT_256COLOR | BGCNT_AFF256x256); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_1 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG2_ON | DISPCNT_OBJ_ON); + gTasks[taskId].func = Task_IntroSpinAndZoomPokeball; + gIntroFrameCounter = 0; + m4aSongNumStart(MUS_T_BATTLE); +} + +static void Task_IntroSpinAndZoomPokeball(u8 taskId) +{ + gTasks[taskId].data[0] += 0x400; + + if (gTasks[taskId].data[1] <= 0x6BF) + { + gTasks[taskId].data[1] += gTasks[taskId].data[2]; + gTasks[taskId].data[2] += 2; + } + else + { + gTasks[taskId].func = Task_IntroWaitToSetupPart3LegendsFight; + } + + sub_816F2A8(0x78, 0x50, 0x10000 / gTasks[taskId].data[1], gTasks[taskId].data[0]); + + if (gIntroFrameCounter == 28) + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITEALPHA); +} + +static void Task_IntroWaitToSetupPart3LegendsFight(u8 taskId) +{ + if (gIntroFrameCounter > 43) + gTasks[taskId].func = Task_IntroLoadPart1Graphics3; +} + +static void Task_IntroLoadPart1Graphics3(u8 taskId) +{ + u16 i; + + if (!gPaletteFade.active) + { + intro_reset_and_hide_bgs(); + ResetSpriteData(); + FreeAllSpritePalettes(); + gReservedSpritePaletteCount = 8; + LZDecompressVram(gIntro3GroudonGfx, (void *)VRAM); + LZDecompressVram(gIntro3GroudonTilemap, (void *)(VRAM + 0xC000)); + LZDecompressVram(gIntro3LegendBgGfx, (void *)(VRAM + 0x4000)); + LZDecompressVram(gIntro3GroudonBgTilemap, (void *)(VRAM + 0xE000)); + LoadCompressedObjectPicUsingHeap(&gBattleAnimPicTable[0x3A]); + LoadCompressedObjectPaletteUsingHeap(&gBattleAnimPaletteTable[0x3A]); + CpuCopy16(gIntro3BgPal, gPlttBufferUnfaded, sizeof(gIntro3BgPal)); + gTasks[taskId].func = Task_IntroLoadPart1Graphics4; + } +} + +static void Task_IntroLoadPart1Graphics4(u8 taskId) +{ + SetGpuReg(REG_OFFSET_WIN0H, 0xF0); + SetGpuReg(REG_OFFSET_WIN0V, 0xA0); + SetGpuReg(REG_OFFSET_WININ, 0x3F); + SetGpuReg(REG_OFFSET_WINOUT, 0); + SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(0) + | BGCNT_CHARBASE(0) + | BGCNT_SCREENBASE(24) + | BGCNT_256COLOR + | BGCNT_WRAP + | BGCNT_AFF512x512); + SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(1) + | BGCNT_CHARBASE(1) + | BGCNT_SCREENBASE(28) + | BGCNT_16COLOR + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_1 + | DISPCNT_OBJ_1D_MAP + | DISPCNT_BG1_ON + | DISPCNT_BG2_ON + | DISPCNT_OBJ_ON + | DISPCNT_WIN0_ON); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITEALPHA); + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = 0xFFA0; + gTasks[taskId].data[2] = 0xFF51; + gTasks[taskId].data[3] = 0x100; + sub_816F2A8(0xFFA0, 0xFF51, 0x100, 0); + gTasks[taskId].func = Task_IntroLoadPart1Graphics5; +} + +static void Task_IntroLoadPart1Graphics5(u8 taskId) +{ + u16 foo = gTasks[taskId].data[0]; + + if (gTasks[taskId].data[0] != 32) + { + gTasks[taskId].data[0] += 4; + SetGpuReg(REG_OFFSET_WIN0V, (gTasks[taskId].data[0] * 256) - (foo -= 0x9C)); + } + else + { + SetGpuReg(REG_OFFSET_WIN0V, 0x2080); + gTasks[taskId].func = Task_IntroLoadPart1Graphics6; + } +} + +static void Task_IntroLoadPart1Graphics6(u8 taskId) +{ + gTasks[taskId].func = Task_IntroLoadPart1Graphics7; +} + +static void Task_IntroLoadPart1Graphics7(u8 taskId) +{ + gTasks[taskId].data[0] = 0; + gTasks[taskId].func = Task_IntroLoadPart1Graphics8; + ScanlineEffect_InitWave(0, 0xA0, 0x4, 4, 1, 4, 0); +} + +static void Task_IntroLoadPart1Graphics8(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + data[5]++; + if ((u16)(data[0] - 1) < 7 && data[5] % 2 == 0) + data[4] ^= 3; + sub_816F2A8(data[1], data[2] + data[4], data[3], 0); + switch (data[0]) + { + case 0: + data[1] += 0x10; + if (data[1] == 0xA0) + { + data[0]++; + data[6] = 2; + data[7] = 0x1E2; + sub_816E190(taskId); + } + break; + case 1: + if (--data[6] == 0) + { + data[6] = 2; + CpuCopy16(&gIntro3BgPal[data[7]], &gPlttBufferFaded[31], sizeof(u16)); + data[7] += 2; + if (data[7] == 0x1EC) + data[0]++; + } + break; + case 2: + if (--data[6] == 0) + { + data[6] = 2; + data[0]++; + } + break; + case 3: + if (--data[6] == 0) + { + data[6] = 2; + CpuCopy16(&gIntro3BgPal[data[7]], &gPlttBufferFaded[31], sizeof(u16)); + data[7] -= 2; + if (data[7] == 0x1E0) + { + data[6] = 8; + data[0]++; + } + } + break; + case 4: + if (--data[6] == 0) + { + data[1] = -0x60; + data[2] = 0xA9; + data[6] = 3; + data[0]++; + } + break; + case 5: + if (--data[6] == 0) + { + data[1] = 0x50; + data[2] = 0x29; + data[6] = 0x10; + PlayCryInternal(SPECIES_GROUDON, 0, 100, 10, 0); + data[0]++; + } + break; + case 6: + if (--data[6] == 0) + { + data[1] = 0x50; + data[2] = 0x28; + data[0]++; + } + break; + case 7: + data[1] += 4; + data[2] += 4; + data[6] += 0x666; + data[3] = Sin((data[6] & 0xFF00) >> 8, 0x40) + 0x100; + if (data[1] == 0x78) + { + BeginNormalPaletteFade(0xFFFFFFFE, 3, 0, 16, RGB_WHITE); + data[3] = 0x100; + data[4] = 0; + data[0]++; + } + break; + case 8: + if (data[3]) + data[3] -= 8; + else + data[0]++; + break; + case 9: + if (!gPaletteFade.active) + { + gTasks[taskId].func = Task_IntroLoadPart1Graphics9; + gScanlineEffect.state = 3; + } + break; + } +} + +static void sub_816E190(u8 a0) +{ + int i; + u8 spriteId; + + for (i = 0; i < 6; i++) + { + spriteId = CreateSprite(gUnknown_08596C10, gUnknown_085E4C64[i][0], 0xA0, i); + gSprites[spriteId].callback = sub_816E1F8; + gSprites[spriteId].oam.priority = 0; + gSprites[spriteId].data[1] = i; + gSprites[spriteId].data[4] = a0; + StartSpriteAnim(&gSprites[spriteId], gUnknown_085E4C64[i][1]); + } +} + +static void sub_816E1F8(struct Sprite *sprite) +{ + sprite->data[3]++; + if (sprite->data[3] % 2 == 0) + sprite->pos2.y ^= 3; + + switch(sprite->data[0]) + { + case 0: + sprite->data[2] += gUnknown_085E4C64[sprite->data[1]][2]; + sprite->pos1.y -= (sprite->data[2] & 0xFF00) >> 8; + sprite->data[2] &= 0xFF; + if (gTasks[sprite->data[4]].data[0] > 7) + sprite->data[0]++; + break; + case 1: + if (sprite->pos1.x < 0x78) + sprite->pos1.x -= 2; + else + sprite->pos1.x += 2; + + if (sprite->pos1.y < 0x50) + sprite->pos1.y -= 2; + else + sprite->pos1.y += 2; + break; + } +} + +static void Task_IntroLoadPart1Graphics9(u8 taskId) +{ + ResetSpriteData(); + LZDecompressVram(gIntro3KyogreGfx, (void *)VRAM); + LZDecompressVram(gIntro3KyogreTilemap, (void *)(VRAM + 0xC000)); + LZDecompressVram(gIntro3KyogreBgTilemap, (void *)(VRAM + 0xE000)); + LoadCompressedObjectPic(gUnknown_085E4C88); + LoadSpritePalette(gUnknown_085E4C98); + BeginNormalPaletteFade(0xFFFFFFFE, 0, 0x10, 0, RGB_WHITEALPHA); + gTasks[taskId].func = Task_IntroFadeIn0; + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = 0x150; + gTasks[taskId].data[2] = 0x50; + gTasks[taskId].data[6] = 0x10; + gTasks[taskId].data[3] = 0x100; + sub_816F2A8(0x150, 0x50, 0x100, 0); + ScanlineEffect_InitWave(0, 0xA0, 4, 4, 1, 6, 0); +} + +static void Task_IntroFadeIn0(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + sub_816F2A8(data[1], data[2], data[3], 0); + + switch (data[0]) + { + case 0: + if (--data[6] != 0) + break; + data[0]++; + case 1: + data[6] += 4; + gTasks[taskId].data[1] = 0x158 - Sin(data[6], 0x100); + gTasks[taskId].data[2] = 0x54 - Cos(data[6], 0x40); + if (data[6] == 0x40) + { + data[6] = 0x19; + data[7] = 1; + data[0]++; + sub_816E6D4(0); + } + break; + case 2: + if (--data[6] == 0) + { + gTasks[taskId].data[1] += 0x100; + gTasks[taskId].data[2] -= 0x102; + data[6] = 8; + data[0]++; + sub_816E6D4(0); + sub_816E74C(); + } + break; + case 3: + if (--data[6] == 0) + { + gTasks[taskId].data[1] -= 0x100; + gTasks[taskId].data[2] += 0x102; + data[6] = 8; + data[0]++; + } + break; + case 4: + if (--data[6] == 0) + { + gTasks[taskId].data[2] -= 0xFC; + data[6] = 8; + data[0]++; + } + break; + case 5: + if (--data[6] == 0) + { + gTasks[taskId].data[2] += 0xFC; + if (data[7] != 0) + { + data[6] = 12; + data[7]--; + data[0] = 2; + } + else + { + data[6] = 1; + data[0]++; + PlayCryInternal(SPECIES_KYOGRE, 0, 120, 10, 0); + } + } + break; + case 6: + if (--data[6] == 0) + { + data[6] = 4; + data[7] = 0x1EA; + data[0]++; + } + break; + case 7: + if (--data[6] == 0) + { + data[6] = 4; + CpuCopy16(&gIntro3BgPal[data[7]], &gPlttBufferFaded[47], sizeof(u16)); + data[7] -= 2; + if (data[7] == 0x1E0) + data[0]++; + } + break; + case 8: + if (--data[6] == 0) + { + data[6] = 4; + data[7] = 0x1E2; + data[0]++; + } + break; + case 9: + if (--data[6] == 0) + { + data[6] = 4; + CpuCopy16(&gIntro3BgPal[data[7]], &gPlttBufferFaded[47], sizeof(u16)); + data[7] += 2; + if (data[7] == 0x1EE) + { + data[6] = 0x10; + data[0]++; + } + } + break; + case 10: + if (--data[6] == 0) + { + data[6] = 0; + data[0]++; + sub_816E6D4(taskId); + } + break; + case 11: + data[6] += 4; + data[3] -= 8; + gTasks[taskId].data[1] = Sin(data[6], 0x3C) + 0x58; + if (data[6] == 0x40) + { + BeginNormalPaletteFade(0xFFFFFFFE, 3, 0, 16, RGB_WHITE); + data[0]++; + } + break; + case 12: + data[6] += 4; + data[3] -= 8; + gTasks[taskId].data[1] = Sin(data[6], 0x14) + 0x80; + if (data[6] == 0x80) + data[0]++; + break; + case 13: + if (!gPaletteFade.active) + { + gTasks[taskId].func = Task_IntroFadeIn1; + gScanlineEffect.state = 3; + } + break; + } +} + +static void sub_816E6D4(u8 a0) +{ + int i; + u8 spriteId; + + for (i = 0; i < 6; i++) + { + spriteId = CreateSprite(&gUnknown_085E4D14, gUnknown_085E4CA8[i][0], gUnknown_085E4CA8[i][1], i); + gSprites[spriteId].invisible = TRUE; + gSprites[spriteId].data[5] = a0; + gSprites[spriteId].data[6] = gUnknown_085E4CA8[i][2]; + gSprites[spriteId].data[7] = 0x40; + } +} + +static void sub_816E74C(void) +{ + int i; + u8 spriteId; + + for (i = 0; i < 6; i++) + { + spriteId = CreateSprite(&gUnknown_085E4D14, gUnknown_085E4CA8[i + 6][0], gUnknown_085E4CA8[i + 6][1], i); + gSprites[spriteId].invisible = TRUE; + gSprites[spriteId].data[6] = gUnknown_085E4CA8[i][2]; + gSprites[spriteId].data[7] = 0x40; + } +} + +static void sub_816E7B4(struct Sprite *sprite) +{ + switch(sprite->data[0]) + { + case 0: + if (sprite->data[6] == 0) + { + sprite->data[1] = (sprite->data[1] + 11) & 0xFF; + sprite->pos2.x = Sin(sprite->data[1], 4); + sprite->data[2] += 0x30; + sprite->pos2.y = -(sprite->data[2] >> 8); + if (sprite->animEnded) + DestroySprite(sprite); + } + else if (--sprite->data[6] == 0) + { + StartSpriteAnim(sprite, 0); + sprite->invisible = FALSE; + } + if (gTasks[sprite->data[5]].data[0] > 11) + sprite->data[0]++; + break; + case 1: + if (sprite->pos1.x < 120) + sprite->pos1.x -= 3; + else + sprite->pos1.x += 3; + + if (sprite->pos1.y < 80) + sprite->pos1.y -= 3; + else + sprite->pos1.y += 3; + if ((u16)(sprite->pos1.y - 20) > 140) + DestroySprite(sprite); + break; + } +} + +static void Task_IntroFadeIn1(u8 taskId) +{ + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 + | BLDCNT_TGT1_BG1 + | BLDCNT_TGT1_BG2 + | BLDCNT_EFFECT_LIGHTEN); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(31, 31)); + SetGpuReg(REG_OFFSET_BLDY, 31); + SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0) + | BGCNT_CHARBASE(0) + | BGCNT_SCREENBASE(24) + | BGCNT_16COLOR + | BGCNT_TXT512x256); + SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(0) + | BGCNT_CHARBASE(1) + | BGCNT_SCREENBASE(26) + | BGCNT_16COLOR + | BGCNT_TXT512x256); + SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2) + | BGCNT_CHARBASE(1) + | BGCNT_SCREENBASE(28) + | BGCNT_16COLOR + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 + | DISPCNT_OBJ_1D_MAP + | DISPCNT_BG0_ON + | DISPCNT_BG1_ON + | DISPCNT_BG2_ON + | DISPCNT_OBJ_ON + | DISPCNT_WIN0_ON); + SetGpuReg(REG_OFFSET_BG0HOFS, 80); + SetGpuReg(REG_OFFSET_BG0VOFS, 0); + SetGpuReg(REG_OFFSET_BG1HOFS, -80); + SetGpuReg(REG_OFFSET_BG1VOFS, 0); + SetGpuReg(REG_OFFSET_BG2HOFS, 0); + SetGpuReg(REG_OFFSET_BG2VOFS, 0); + LZDecompressVram(gIntro3CloudsGfx, (void *)VRAM); + LZDecompressVram(gIntro3CloudsGfx, (void *)(VRAM + 0x4000)); + LZDecompressVram(gIntro3Clouds3Tilemap, (void *)(VRAM + 0xE000)); + gTasks[taskId].func = Task_IntroFadeIn2; +} + +static void Task_IntroFadeIn2(u8 taskId) +{ + LZDecompressVram(gIntro3Clouds1Tilemap, (void *)(VRAM + 0xC000)); + LZDecompressVram(gIntro3Clouds2Tilemap, (void *)(VRAM + 0xD000)); + gTasks[taskId].func = Task_IntroFadeIn3; +} + +static void Task_IntroFadeIn3(u8 taskId) +{ + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); + gTasks[taskId].func = Task_IntroFadeIn4; + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[6] = 16; +} + +static void Task_IntroFadeIn4(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + SetGpuReg(REG_OFFSET_BG0HOFS, (data[6] >> 8)); + SetGpuReg(REG_OFFSET_BG1HOFS, -(data[6] >> 8)); + + switch (data[0]) + { + case 0: + if (--data[6] == 0) + { + BeginNormalPaletteFade(0xFFFFFFFE, 0, 16, 0, RGB_WHITEALPHA); + data[6] = 0x5000; + data[0]++; + } + break; + case 1: + if (data[6] == 0x2800) + BeginNormalPaletteFade(0x0000FFFE, 3, 0, 16, RGB(9, 10, 10)); + + if (data[6] != 0) + data[6] -= 0x80; + else if (!gPaletteFade.active) + gTasks[taskId].func = Task_IntroFadeIn5; + break; + } +} + +static void Task_IntroFadeIn5(u8 taskId) +{ + LZDecompressVram(gIntro3RayquazaTilemap, (void *)(VRAM + 0xE000)); + LZDecompressVram(gIntro3Clouds4Tilemap, (void *)(VRAM + 0xC000)); + LZDecompressVram(gIntro3RayquazaGfx, (void *)(VRAM + 0x4000)); + LZDecompressVram(gIntro3Clouds2Gfx, (void *)VRAM); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 + | DISPCNT_OBJ_1D_MAP + | DISPCNT_BG0_ON + | DISPCNT_BG2_ON + | DISPCNT_OBJ_ON + | DISPCNT_WIN0_ON); + gTasks[taskId].func = Task_IntroFadeIn6; + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[6] = 1; + gTasks[taskId].data[7] = 0; + LoadCompressedObjectPicUsingHeap(gUnknown_085E4BF4); + LoadSpritePalettes(gUnknown_085E4C04); +} + +static void Task_IntroFadeIn6(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + u8 spriteId; + + switch (data[0]) + { + case 0: + if (--data[6] == 0) + { + CreateSprite(&gUnknown_085E4C4C, 200, 48, 0); + spriteId = CreateSprite(&gUnknown_085E4C4C, 200, 80, 1); + StartSpriteAnim(&gSprites[spriteId], 1); + spriteId = CreateSprite(&gUnknown_085E4C4C, 200, 112, 2); + StartSpriteAnim(&gSprites[spriteId], 2); + data[0]++; + data[6] = 72; + } + break; + case 1: + if (--data[6] == 0) + { + CreateSprite(&gUnknown_085E4C4C, 40, 48, 0); + spriteId = CreateSprite(&gUnknown_085E4C4C, 40, 80, 1); + StartSpriteAnim(&gSprites[spriteId], 1); + spriteId = CreateSprite(&gUnknown_085E4C4C, 40, 112, 2); + StartSpriteAnim(&gSprites[spriteId], 2); + data[0]++; + data[6] = 48; + } + break; + case 2: + if (--data[6] == 0) + gTasks[taskId].func = Task_IntroFadeIn7; + break; + } +} + +static void sub_816EC6C(struct Sprite *sprite) +{ + if (sprite->animEnded) + sprite->invisible = TRUE; + + switch(sprite->data[0]) + { + case 0: + sprite->data[1] = 0x1C2; + sprite->data[0]++; + case 1: + CpuCopy16(&gIntro3BgPal[sprite->data[1]], &gPlttBufferFaded[93], 2); + sprite->data[1] += 2; + if (sprite->data[1] != 0x1CE) + break; + sprite->data[1] = 0x1CC; + sprite->data[2] = 4; + sprite->data[0]++; + case 2: + if (--sprite->data[2] == 0) + { + sprite->data[2] = 4; + CpuCopy16(&gIntro3BgPal[sprite->data[1]], &gPlttBufferFaded[93], 2); + sprite->data[1] -= 2; + if (sprite->data[1] == 0x1C0) + DestroySprite(sprite); + } + break; + } +} + +static void Task_IntroFadeIn7(u8 taskId) +{ + u8 newTaskId; + + LoadCompressedObjectPic(gUnknown_085E5048); + LoadSpritePalettes(gUnknown_085E5058); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 + | DISPCNT_OBJ_1D_MAP + | DISPCNT_BG0_ON + | DISPCNT_BG2_ON + | DISPCNT_OBJ_ON + | DISPCNT_WIN0_ON); + gTasks[taskId].func = Task_IntroFadeIn8; + BeginNormalPaletteFade(0x0000FFDE, 0, 16, 0, RGB(9, 10, 10)); + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = 0xA8; + gTasks[taskId].data[2] = -0x10; + gTasks[taskId].data[3] = -0x88; + gTasks[taskId].data[4] = -0x10; + newTaskId = CreateTask(sub_816EEA8, 0); + gTasks[newTaskId].data[4] = taskId; +} + +static void Task_IntroFadeIn8(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + if (data[7] % 2 == 0) + data[6] ^= 2; + + data[7]++; + + switch(data[0]) + { + case 0: + if ((data[7] & 1) != 0) + { + data[1] -= 2; + data[2]++; + data[3] += 2; + data[4]++; + } + if (data[1] == 0x68) + { + data[0]++; + data[5] = 1; + } + break; + case 1: + data[0]++; + data[5] = 4; + break; + case 2: + data[1] += 4; + data[2] -= 2; + data[3] -= 4; + data[4] -= 2; + if (!gPaletteFade.active) + { + data[5] = 0x8C; + data[0]++; + } + break; + case 3: + if (--data[5] == 0) + gTasks[taskId].func = Task_IntroFadeIn9; + break; + } +} + +static void Task_IntroFadeIn9(u8 taskId) +{ + DestroyTask(taskId); + SetMainCallback2(MainCB2_EndIntro); +} + +static void sub_816EEA8(u8 taskId) +{ + u8 spriteId; + s16 *data = gTasks[taskId].data; + + data[2]++; + + switch(data[0]) + { + case 0: + if ((data[2] & 1) != 0) + { + CpuCopy16(&gIntro3BgPal[0x1A2 + data[1] * 2], &gPlttBufferFaded[94], 2); + data[1]++; + } + if (data[1] == 6) + { + data[0]++; + data[1] = 0; + data[3] = 10; + } + break; + case 1: + if (data[3] == 0) + { + if ((data[2] & 1) != 0) + { + CpuCopy16(&gIntro3BgPal[0x1A2 + data[1] * 2], &gPlttBufferFaded[88], 2); + data[1]++; + } + if (data[1] == 6) + { + data[0]++; + data[3] = 10; + } + } + else + { + data[3]--; + } + break; + case 2: + if (data[3] == 0) + { + if ((data[2] & 1) != 0) + { + CpuCopy16(&gIntro3BgPal[0x182 + data[1] * 2], &gPlttBufferFaded[92], 2); + data[1]++; + } + if (data[1] == 6) + { + spriteId = CreateSprite(&gUnknown_085E5030, 120, 88, 15); + PlaySE(SE_OP_BASYU); + gSprites[spriteId].invisible = TRUE; + gSprites[spriteId].data[3] = data[4]; + data[0]++; + data[3] = 16; + } + } + else + { + data[3]--; + } + break; + case 3: + if ((data[2] & 1) != 0) + { + if (--data[3] != 0) + { + BlendPalette(0x50, 16, data[3], RGB(9, 10, 10)); + CpuCopy16(&gIntro3BgPal[0x1AC], &gPlttBufferFaded[94], 2); + CpuCopy16(&gIntro3BgPal[0x1AC], &gPlttBufferFaded[88], 2); + CpuCopy16(&gIntro3BgPal[0x18C], &gPlttBufferFaded[92], 2); + } + else + { + data[0]++; + data[3] = 53; + } + } + break; + case 4: + if (--data[3] == 0) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_WHITE); + data[0]++; + } + break; + case 5: + if (!gPaletteFade.active) + DestroyTask(taskId); + break; + } +} + +static void intro_reset_and_hide_bgs(void) +{ + SetGpuReg(REG_OFFSET_DISPCNT, 0); + SetGpuReg(REG_OFFSET_BG3HOFS, 0); + SetGpuReg(REG_OFFSET_BG3VOFS, 0); + SetGpuReg(REG_OFFSET_BG2HOFS, 0); + SetGpuReg(REG_OFFSET_BG2VOFS, 0); + SetGpuReg(REG_OFFSET_BG1HOFS, 0); + SetGpuReg(REG_OFFSET_BG1VOFS, 0); + SetGpuReg(REG_OFFSET_BG0HOFS, 0); + SetGpuReg(REG_OFFSET_BG0VOFS, 0); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); +} + +static void Task_IntroWaterDrops_1(u8 taskId) +{ + switch (gTasks[taskId].data[0]) + { + case 0: + default: + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND + | BLDCNT_TGT2_BG0 + | BLDCNT_TGT2_BG1 + | BLDCNT_TGT2_BG2 + | BLDCNT_TGT2_BG3 + | BLDCNT_TGT2_OBJ + | BLDCNT_TGT2_BD); + SetGpuReg(REG_OFFSET_BLDALPHA, gUnknown_0853FF70[31]); + SetGpuReg(REG_OFFSET_BLDY, 0); + gTasks[taskId].data[1] = 0x40; + gTasks[taskId].data[0]++; + break; + case 1: + if (gTasks[taskId].data[1] != 0) + { + u8 tmp; + + gTasks[taskId].data[1]--; + tmp = gTasks[taskId].data[1] / 2; + SetGpuReg(REG_OFFSET_BLDALPHA, gUnknown_0853FF70[tmp]); + } + else + { + SetGpuReg(REG_OFFSET_BLDALPHA, gUnknown_0853FF70[0]); + gTasks[taskId].data[1] = 0x10; + gTasks[taskId].data[0]++; + } + break; + case 2: + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); + DestroyTask(taskId); + break; + } +} + +static void Task_IntroWaterDrops_2(u8 taskId) +{ + switch (gTasks[taskId].data[0]) + { + case 0: + default: + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND + | BLDCNT_TGT2_BG0 + | BLDCNT_TGT2_BG1 + | BLDCNT_TGT2_BG2 + | BLDCNT_TGT2_BG3 + | BLDCNT_TGT2_OBJ + | BLDCNT_TGT2_BD); + SetGpuReg(REG_OFFSET_BLDALPHA, gUnknown_0853FF70[0]); + SetGpuReg(REG_OFFSET_BLDY, 0); + gTasks[taskId].data[1] = 0; + gTasks[taskId].data[0]++; + break; + case 1: + if (gTasks[taskId].data[1] < 62) + { + u8 tmp; + + gTasks[taskId].data[1]++; + tmp = gTasks[taskId].data[1] / 2; + SetGpuReg(REG_OFFSET_BLDALPHA, gUnknown_0853FF70[tmp]); + } + else + { + SetGpuReg(REG_OFFSET_BLDALPHA, gUnknown_0853FF70[31]); + gTasks[taskId].data[1] = 0x10; + gTasks[taskId].data[0]++; + } + break; + case 2: + if (gTasks[taskId].data[1] != 0) + { + gTasks[taskId].data[1]--; + } + else + { + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); + DestroyTask(taskId); + } + break; + } +} + +void sub_816F2A8(u16 scrX, u16 scrY, u16 zoom, u16 alpha) +{ + struct BgAffineSrcData src; + struct BgAffineDstData dest; + + src.texX = 0x8000; + src.texY = 0x8000; + src.scrX = scrX; + src.scrY = scrY; + src.sx = zoom; + src.sy = zoom; + src.alpha = alpha; + BgAffineSet(&src, &dest, 1); + SetGpuReg(REG_OFFSET_BG2PA, dest.pa); + SetGpuReg(REG_OFFSET_BG2PB, dest.pb); + SetGpuReg(REG_OFFSET_BG2PC, dest.pc); + SetGpuReg(REG_OFFSET_BG2PD, dest.pd); + SetGpuReg(REG_OFFSET_BG2X_L, dest.dx); + SetGpuReg(REG_OFFSET_BG2X_H, dest.dx >> 16); + SetGpuReg(REG_OFFSET_BG2Y_L, dest.dy); + SetGpuReg(REG_OFFSET_BG2Y_H, dest.dy >> 16); +} + +static void sub_816F318(struct Sprite *sprite) +{ + u8 r0; + + if (sprite->data[2] >= 192) + { + if (sprite->data[3] != 0) + { + sprite->data[3]--; + } + else + { + sprite->invisible = FALSE; + SetOamMatrix(sprite->data[1], sprite->data[2], 0, 0, sprite->data[2]); + sprite->data[2] = (sprite->data[2] * 95) / 100; + r0 = (sprite->data[2] - 192) / 128 + 9; + if (r0 > 15) + r0 = 15; + sprite->oam.paletteNum = r0; + } + } + else + { + DestroySprite(sprite); + } +} + +static void sub_816F3A4(struct Sprite *sprite) +{ + if (gSprites[sprite->data[7]].data[7] != 0) + { + sprite->invisible = TRUE; + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + StartSpriteAnim(sprite, 3); + sprite->data[2] = 1024; + sprite->data[3] = 8 * (sprite->data[1] & 3); + sprite->callback = sub_816F318; + sprite->oam.shape = 1; + sprite->oam.size = 3; + CalcCenterToCornerVec(sprite, 1, 3, 2); + } + else + { + sprite->pos2.x = gSprites[sprite->data[7]].pos2.x; + sprite->pos2.y = gSprites[sprite->data[7]].pos2.y; + sprite->pos1.x = gSprites[sprite->data[7]].pos1.x; + sprite->pos1.y = gSprites[sprite->data[7]].pos1.y; + } +} + +static void sub_816F454(struct Sprite *sprite) +{ + if (sprite->data[0] != 0) + sprite->callback = sub_816F46C; +} + +static void sub_816F46C(struct Sprite *sprite) +{ + if (sprite->pos1.x <= 116) + { + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.y = 0; + sprite->pos1.x += 4; + sprite->pos2.x = -4; + sprite->data[4] = 128; + sprite->callback = sub_816F5B4; + } + else + { + u16 data2; + u16 data3; + u16 data4; + s16 sin1; + s16 sin2; + s16 sin3; + s16 sin4; + s16 var1; + s16 var2; + s16 var3; + s16 var4; + s16 temp; + + data4 = sprite->data[4]; + sin1 = gSineTable[(u8)data4]; + sin2 = gSineTable[(u8)(data4 + 64)]; + sprite->data[4] += 2; + sprite->pos2.y = sin1 / 32; + sprite->pos1.x--; + if (sprite->pos1.x & 1) + sprite->pos1.y++; + temp = -sin2 / 16; + data2 = sprite->data[2]; + data3 = sprite->data[3]; + sin3 = gSineTable[(u8)(temp - 16)]; + sin4 = gSineTable[(u8)(temp + 48)]; + var1 = sin4 * data2 / 256; + var2 = -sin3 * data3 / 256; + var3 = sin3 * data2 / 256; + var4 = sin4 * data3 / 256; + SetOamMatrix(sprite->data[1], data2, 0, 0, data3); + SetOamMatrix(sprite->data[1] + 1, var1, var3, var2, var4); + SetOamMatrix(sprite->data[1] + 2, var1, var3, var2 * 2, var4 * 2); + } +} + +static void sub_816F5B4(struct Sprite *sprite) +{ + SetOamMatrix(sprite->data[1], sprite->data[6] + 64, 0, 0, sprite->data[6] + 64); + SetOamMatrix(sprite->data[1] + 1, sprite->data[6] + 64, 0, 0, sprite->data[6] + 64); + SetOamMatrix(sprite->data[1] + 2, sprite->data[6] + 64, 0, 0, sprite->data[6] + 64); + if (sprite->data[4] != 64) + { + u16 data4; + + sprite->data[4] -= 8; + data4 = sprite->data[4]; + sprite->pos2.x = gSineTable[(u8)(data4 + 64)] / 64; + sprite->pos2.y = gSineTable[(u8)data4] / 64; + } + else + { + sprite->data[4] = 0; + sprite->callback = sub_816F660; + } +} + +static void sub_816F660(struct Sprite *sprite) +{ + if (sprite->data[0] != 2) + { + s16 r2; + + sprite->data[4] += 8; + r2 = gSineTable[(u8)sprite->data[4]] / 16 + 64; + sprite->pos2.x = gSineTable[(u8)(r2 + 64)] / 64; + sprite->pos2.y = gSineTable[(u8)r2] / 64; + } + else + { + sprite->callback = SpriteCB_WaterDropFall; + } +} + +static void SpriteCB_WaterDropFall(struct Sprite *sprite) +{ + if (sprite->pos1.y < sprite->data[5]) + { + sprite->pos1.y += 4; + } + else + { + sprite->data[7] = 1; + sprite->invisible = TRUE; + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + StartSpriteAnim(sprite, 3); + sprite->data[2] = 1024; + sprite->data[3] = 8 * (sprite->data[1] & 3); + sprite->callback = sub_816F318; + sprite->oam.shape = 1; + sprite->oam.size = 3; + CalcCenterToCornerVec(sprite, 1, 3, 2); + } +} + +//Duplicate function +static void SpriteCB_WaterDropFall_2(struct Sprite *sprite) +{ + if (sprite->pos1.y < sprite->data[5]) + { + sprite->pos1.y += 4; + } + else + { + sprite->data[7] = 1; + sprite->invisible = TRUE; + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + StartSpriteAnim(sprite, 3); + sprite->data[2] = 1024; + sprite->data[3] = 8 * (sprite->data[1] & 3); + sprite->callback = sub_816F318; + sprite->oam.shape = 1; + sprite->oam.size = 3; + CalcCenterToCornerVec(sprite, 1, 3, 2); + } +} + +static u8 CreateWaterDrop(s16 x, s16 y, u16 c, u16 d, u16 e, u8 fallImmediately) +{ + u8 spriteId; + u8 oldSpriteId; + + spriteId = CreateSprite(&gUnknown_085E4D64, x, y, 1); + gSprites[spriteId].data[0] = 0; + gSprites[spriteId].data[7] = 0; + gSprites[spriteId].data[1] = d; + gSprites[spriteId].data[2] = c; + gSprites[spriteId].data[3] = c; + gSprites[spriteId].data[5] = e; + gSprites[spriteId].data[6] = c; + gSprites[spriteId].oam.affineMode = 3; + gSprites[spriteId].oam.matrixNum = d; + CalcCenterToCornerVec(&gSprites[spriteId], 0, 2, 2); + StartSpriteAnim(&gSprites[spriteId], 2); + if (!fallImmediately) + gSprites[spriteId].callback = sub_816F454; + else + gSprites[spriteId].callback = SpriteCB_WaterDropFall_2; + oldSpriteId = spriteId; + + spriteId = CreateSprite(&gUnknown_085E4D64, x, y, 1); + gSprites[spriteId].data[7] = oldSpriteId; + gSprites[spriteId].data[1] = d + 1; + gSprites[spriteId].oam.affineMode = 3; + gSprites[spriteId].oam.matrixNum = d + 1; + CalcCenterToCornerVec(&gSprites[spriteId], 0, 2, 2); + gSprites[spriteId].callback = sub_816F3A4; + + spriteId = CreateSprite(&gUnknown_085E4D64, x, y, 1); + gSprites[spriteId].data[7] = oldSpriteId; + gSprites[spriteId].data[1] = d + 2; + StartSpriteAnim(&gSprites[spriteId], 1); + gSprites[spriteId].oam.affineMode = 3; + gSprites[spriteId].oam.matrixNum = d + 2; + CalcCenterToCornerVec(&gSprites[spriteId], 0, 2, 2); + gSprites[spriteId].callback = sub_816F3A4; + + SetOamMatrix(d, c + 32, 0, 0, c + 32); + SetOamMatrix(d + 1, c + 32, 0, 0, c + 32); + SetOamMatrix(d + 2, c + 32, 0, 0, 2 * (c + 32)); + + return oldSpriteId; +} + +static void sub_816F9D4(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + StartSpriteAnimIfDifferent(sprite, 0); + sprite->pos1.x--; + break; + case 1: + StartSpriteAnimIfDifferent(sprite, 0); + if (gIntroFrameCounter & 7) + return; + sprite->pos1.x++; + break; + case 2: + if (sprite->pos1.x <= 120 || gIntroFrameCounter & 7) + sprite->pos1.x++; + break; + case 3: + break; + case 4: + if (sprite->pos1.x > -32) + sprite->pos1.x -= 2; + break; + } + if (gIntroFrameCounter & 7) + return; + if (sprite->pos2.y != 0) + { + sprite->pos2.y = 0; + } + else + { + switch (Random() & 3) + { + case 0: + sprite->pos2.y = -1; + break; + case 1: + sprite->pos2.y = 1; + break; + case 2: + case 3: + sprite->pos2.y = 0; + break; + } + } +} + +static void sub_816FAB0(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + break; + case 1: + if (sprite->pos2.x + sprite->pos1.x < 304) + sprite->pos2.x += 8; + else + sprite->data[0] = 2; + break; + case 2: + if (sprite->pos2.x + sprite->pos1.x > 120) + sprite->pos2.x -= 1; + else + sprite->data[0] = 3; + break; + case 3: + if (sprite->pos2.x > 0) + sprite->pos2.x -= 2; + break; + } + sprite->pos2.y = Sin((u8)sprite->data[1], 8) - gUnknown_0203BCCC; + sprite->data[1] += 4; +} + +static void sub_816FB38(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + if (sprite->data[1] != 0) + { + sprite->data[1]--; + } + else + { + sprite->invisible = FALSE; + StartSpriteAffineAnim(sprite, 1); + sprite->data[0]++; + } + break; + case 1: + if (gIntroFrameCounter == 0x90) + { + sprite->data[0]++; + sprite->data[1] = 9; + sprite->data[3] = 2; + } + break; + case 2: + if (sprite->data[3] == 0) + { + sprite->data[3] = 2; + if (sprite->data[1] != 0) + { + CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1]], &gPlttBufferFaded[0x11F], 2); + CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1] + 0x10], &gPlttBufferFaded[0x114], 2); + CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1] + 0x20], &gPlttBufferFaded[0x11A], 2); + sprite->data[1]--; + } + else + { + CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1]], &gPlttBufferFaded[0x11F], 2); + CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1] + 0x10], &gPlttBufferFaded[0x114], 2); + CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1] + 0x20], &gPlttBufferFaded[0x11A], 2); + sprite->data[0]++; + } + } + else + { + sprite->data[3]--; + } + break; + case 3: + if (sprite->data[3] != 0) + { + sprite->data[3]--; + } + else + { + sprite->data[3] = 2; + if (sprite->data[1] < 10) + { + CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1]], &gPlttBufferFaded[0x11F], 2); + CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1] + 0x10], &gPlttBufferFaded[0x114], 2); + CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1] + 0x20], &gPlttBufferFaded[0x11A], 2); + sprite->data[1]++; + } + else + { + sprite->data[0]++; + } + } + break; + case 4: + if (gIntroFrameCounter == 0x110) + { + StartSpriteAffineAnim(sprite, 2); + sprite->oam.objMode = 1; + sprite->data[0]++; + } + break; + case 5: + sprite->data[3] += gUnknown_085E4F48[sprite->data[2]]; + sprite->pos2.x = (sprite->data[3] & 0xFF00) >> 8; + if (sprite->data[2] < 4) + { + s16 temp = sprite->pos2.x; + sprite->pos2.x = -temp; + } + if (sprite->affineAnimEnded) + DestroySprite(sprite); + break; + } +} + +static void sub_816FD44(struct Sprite *sprite) +{ + switch(sprite->data[0]) + { + case 0: + if (gIntroFrameCounter == 0x80) + { + sprite->invisible = FALSE; + sprite->data[0]++; + } + break; + case 1: + if (gIntroFrameCounter == 0x110) + { + StartSpriteAffineAnim(sprite, 3); + sprite->data[0]++; + } + break; + case 2: + if (sprite->affineAnimEnded) + DestroySprite(sprite); + break; + } +} + +static u8 sub_816FDB8(s16 a0, s16 a1, s16 a2) +{ + u16 i; + u8 spriteId; + + for (i = 0; i < 9; i++) + { + spriteId = CreateSprite(&gUnknown_085E4F5C, gUnknown_085E4E94[i][1] + a0, a1 - 4, 0); + gSprites[spriteId].data[0] = 0; + gSprites[spriteId].data[1] = gUnknown_085E4FA4[i]; + gSprites[spriteId].data[2] = i; + gSprites[spriteId].invisible = TRUE; + gSprites[spriteId].oam.matrixNum = i + 12; + StartSpriteAnim(&gSprites[spriteId], gUnknown_085E4E94[i][0]); + StartSpriteAffineAnim(&gSprites[spriteId], 0); + } + spriteId = CreateSprite(&gUnknown_085E4F8C, 120, a1 - 6, 0); + gSprites[spriteId].data[0] = 0; + gSprites[spriteId].invisible = TRUE; + gSprites[spriteId].oam.matrixNum = i + 12; + StartSpriteAffineAnim(&gSprites[spriteId], 1); + return spriteId; +} + +static void sub_816FEDC(struct Sprite *sprite) +{ + sprite->data[7]++; + + if (sprite->data[0] != 0) + { + s16 sin1; + s16 sin2; + + s16 a, b, c, d; + + sin1 = gSineTable[(u8)sprite->data[2]]; + sin2 = gSineTable[(u8)(sprite->data[2] + 64)]; + + d = Q_8_8_TO_INT(sin2 * sprite->data[1]); + c = Q_8_8_TO_INT(-sin1 * sprite->data[1]); + b = Q_8_8_TO_INT(sin1 * sprite->data[1]); + a = Q_8_8_TO_INT(sin2 * sprite->data[1]); + + SetOamMatrix(1, a, b, c, d); + } + + switch (sprite->data[0]) + { + case 0: + default: + sprite->oam.affineMode = 3; + sprite->oam.matrixNum = 1; + CalcCenterToCornerVec(sprite, 1, 3, 3); + sprite->invisible = FALSE; + sprite->data[0] = 1; + sprite->data[1] = 0x80; + sprite->data[2] = 0; + sprite->data[3] = 0; + break; + case 1: + sprite->pos2.x = -Sin((u8)sprite->data[3], 140); + sprite->pos2.y = -Sin((u8)sprite->data[3], 120); + sprite->data[1] += 7; + sprite->data[3] += 3; + if (sprite->pos1.x + sprite->pos2.x <= -16) + { + sprite->oam.priority = 3; + sprite->data[0]++; + sprite->pos1.x = 20; + sprite->pos1.y = 40; + sprite->data[1] = 0x200; + sprite->data[2] = 0; + sprite->data[3] = 0x10; + } + break; + case 2: + sprite->pos2.x = Sin((u8)sprite->data[3], 34); + sprite->pos2.y = -Cos((u8)sprite->data[3], 60); + sprite->data[1] += 2; + if (sprite->data[7] % 5 == 0) + sprite->data[3]++; + break; + } +} + +static void sub_8170040(struct Sprite *sprite) +{ + u16 foo; + + //I'm not sure why a switch statement was used here. + //if (sprite->data[0] != 1) would have been more appropriate. + switch (sprite->data[0]) + { + case 0: + default: + sprite->invisible = FALSE; + sprite->oam.affineMode = 3; + sprite->oam.matrixNum = 18; + CalcCenterToCornerVec(sprite, 0, 3, 3); + sprite->data[1] = 0; + sprite->data[0] = 1; + //fall through + case 1: + sprite->data[7]++; + if (sprite->data[7] & 1) + { + sprite->invisible = TRUE; + } + else + { + sprite->invisible = FALSE; + if (sprite->data[1] < 64) + sprite->data[1]++; + } + foo = 256 - gSineTable[(u8)sprite->data[1]] / 2; + SetOamMatrix(18, foo, 0, 0, foo); + break; + } +} diff --git a/src/intro_credits_graphics.c b/src/intro_credits_graphics.c new file mode 100644 index 000000000..d570b2992 --- /dev/null +++ b/src/intro_credits_graphics.c @@ -0,0 +1,740 @@ +#include "global.h" +#include "intro_credits_graphics.h" +#include "palette.h" +#include "decompress.h" +#include "gpu_regs.h" +#include "task.h" +#include "main.h" +#include "graphics.h" + +struct IntroCreditsSpriteMetadata +{ + u8 animNum:4; + u8 shape:2; + u8 size:2; + u8 x; + u8 y; + u8 subpriority; + u16 xOff; +}; + +static const u16 gUnknown_085F06E0[] = INCBIN_U16("graphics/intro/intro2_grass.gbapal"); +static const u16 gUnknown_085F0700[] = INCBIN_U16("graphics/intro/intro2_grass_afternoon.gbapal"); +static const u16 gUnknown_085F0720[] = INCBIN_U16("graphics/intro/intro2_grass_night.gbapal"); +static const u8 gUnknown_085F0740[] = INCBIN_U8("graphics/intro/intro2_grass.4bpp.lz"); +static const u8 gUnknown_085F0BC0[] = INCBIN_U8("graphics/intro/intro2_grass_map.bin.lz"); +static const u16 gUnknown_085F0CFC[] = INCBIN_U16("graphics/intro/85F0CFC.gbapal"); +static const u16 gUnknown_085F0D5C[] = INCBIN_U16("graphics/intro/85F0D5C.gbapal"); +static const u8 gUnknown_085F0DBC[] = INCBIN_U8("graphics/intro/intro2_bgclouds.4bpp.lz"); +static const u8 gUnknown_085F1398[] = INCBIN_U8("graphics/intro/intro2_bgclouds_map.bin.lz"); +static const u16 gUnknown_085F1668[] = INCBIN_U16("graphics/intro/intro2_bgclouds.gbapal"); +static const u16 gUnknown_085F1688[] = INCBIN_U16("graphics/intro/intro2_bgclouds_afternoon.gbapal"); +static const u8 gUnknown_085F16A8[] = INCBIN_U8("graphics/intro/intro2_bgclouds2.4bpp.lz"); +static const u16 gUnknown_085F17E4[] = INCBIN_U16("graphics/intro/intro2_bgtrees2.gbapal"); +static const u16 gUnknown_085F1804[] = INCBIN_U16("graphics/intro/intro2_bgtrees2_afternoon.gbapal"); +static const u8 gUnknown_085F1824[] = INCBIN_U8("graphics/intro/intro2_bgtrees.4bpp.lz"); +static const u8 gUnknown_085F1EAC[] = INCBIN_U8("graphics/intro/intro2_bgtrees_map.bin.lz"); +static const u16 gUnknown_085F21B0[] = INCBIN_U16("graphics/intro/intro2_bgtrees.gbapal"); +static const u8 gIntro2TreeTiles[] = INCBIN_U8("graphics/intro/intro2_bgtreessmall.4bpp.lz"); +static const u16 gUnknown_085F231C[] = INCBIN_U16("graphics/intro/85F231C.gbapal"); +static const u8 gUnknown_085F235C[] = INCBIN_U8("graphics/intro/intro2_bgnight.4bpp.lz"); +static const u16 gUnknown_085F2548[] = INCBIN_U16("graphics/intro/intro2_bgnight.gbapal"); +static const u8 gUnknown_085F2568[] = INCBIN_U8("graphics/intro/intro2_bgnight_map.bin.lz"); +static const u8 gIntro2NightTiles[] = INCBIN_U8("graphics/intro/intro2_night.4bpp.lz"); +static const u16 gIntro2BrendanPalette[] = INCBIN_U16("graphics/intro/intro2_brendan.gbapal"); +static const u8 gIntro2BrendanTiles[] = INCBIN_U8("graphics/intro/intro2_brendan.4bpp.lz"); +static const u16 gIntro2MayPalette[] = INCBIN_U16("graphics/intro/intro2_may.gbapal"); +static const u16 gUnknown_085F3490[0xF0] = {0}; +static const u8 gIntro2MayTiles[] = INCBIN_U8("graphics/intro/intro2_may.4bpp.lz"); +static const u8 gIntro2BicycleTiles[] = INCBIN_U8("graphics/intro/intro2_bicycle.4bpp.lz"); +static const u16 gIntro2LatiosPalette[] = INCBIN_U16("graphics/intro/intro2_latios.gbapal"); +static const u8 gIntro2LatiosTiles[] = INCBIN_U8("graphics/intro/intro2_latios.4bpp.lz"); +static const u16 gIntro2LatiasPalette[] = INCBIN_U16("graphics/intro/intro2_latias.gbapal"); +static const u8 gIntro2LatiasTiles[] = INCBIN_U8("graphics/intro/intro2_latias.4bpp.lz"); + +static void sub_817B62C(struct Sprite *sprite); +static void nullsub_65(struct Sprite *sprite); +static void sub_817B7C4(struct Sprite *sprite); +static void nullsub_66(struct Sprite *sprite); + +static const struct SpriteTemplate gUnknown_085F504C = { + 2000, 0xFFFF, &gDummyOamData, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_817B62C +}; + +static const struct CompressedSpriteSheet gUnknown_085F5064[] = { + { gUnknown_085F16A8, 0x400, 2000 }, + { NULL } +}; + +static const union AnimCmd gUnknown_085F5074[] = { + ANIMCMD_FRAME( 0, 30), + ANIMCMD_END +}; + +static const union AnimCmd gUnknown_085F507C[] = { + ANIMCMD_FRAME(16, 30), + ANIMCMD_END +}; + +static const union AnimCmd gUnknown_085F5084[] = { + ANIMCMD_FRAME(20, 30), + ANIMCMD_END +}; + +static const union AnimCmd gUnknown_085F508C[] = { + ANIMCMD_FRAME(22, 30), + ANIMCMD_END +}; + +static const union AnimCmd *const gUnknown_085F5094[] = { + gUnknown_085F5074, + gUnknown_085F507C, + gUnknown_085F5084, + gUnknown_085F508C +}; + +static const struct IntroCreditsSpriteMetadata gUnknown_085F50A4[] = { + { 0, ST_OAM_SQUARE, 2, 72, 32, 100, 0xc00 }, + { 0, ST_OAM_SQUARE, 2, 158, 32, 100, 0xc00 }, + { 1, ST_OAM_SQUARE, 1, 192, 40, 101, 0x800 }, + { 1, ST_OAM_SQUARE, 1, 56, 40, 101, 0x800 }, + { 2, ST_OAM_H_RECTANGLE, 0, 100, 44, 102, 0x400 }, + { 2, ST_OAM_H_RECTANGLE, 0, 152, 44, 102, 0x400 }, + { 3, ST_OAM_H_RECTANGLE, 0, 8, 46, 103, 0x100 }, + { 3, ST_OAM_H_RECTANGLE, 0, 56, 46, 103, 0x100 }, + { 3, ST_OAM_H_RECTANGLE, 0, 240, 46, 103, 0x100 }, +}; + +static const struct CompressedSpriteSheet gUnknown_085F50EC[] = { + { gIntro2TreeTiles, 0x400, 2000 }, + { NULL } +}; + +static const union AnimCmd gUnknown_085F50FC[] = { + ANIMCMD_FRAME( 0, 30), + ANIMCMD_END +}; + +static const union AnimCmd gUnknown_085F5104[] = { + ANIMCMD_FRAME(16, 30), + ANIMCMD_END +}; + +static const union AnimCmd gUnknown_085F510C[] = { + ANIMCMD_FRAME(24, 30), + ANIMCMD_END +}; + +static const union AnimCmd *const gUnknown_085F5114[] = { + gUnknown_085F50FC, + gUnknown_085F5104, + gUnknown_085F510C +}; + +static const struct IntroCreditsSpriteMetadata gUnknown_085F5120[] = { + { 0, ST_OAM_SQUARE, 2, 16, 88, 100, 0x2000 }, + { 0, ST_OAM_SQUARE, 2, 80, 88, 100, 0x2000 }, + { 0, ST_OAM_SQUARE, 2, 144, 88, 100, 0x2000 }, + { 0, ST_OAM_SQUARE, 2, 208, 88, 100, 0x2000 }, + { 1, ST_OAM_V_RECTANGLE, 2, 40, 88, 101, 0x1000 }, + { 1, ST_OAM_V_RECTANGLE, 2, 104, 88, 101, 0x1000 }, + { 1, ST_OAM_V_RECTANGLE, 2, 168, 88, 101, 0x1000 }, + { 1, ST_OAM_V_RECTANGLE, 2, 232, 88, 101, 0x1000 }, + { 2, ST_OAM_V_RECTANGLE, 2, 56, 88, 102, 0x800 }, + { 2, ST_OAM_V_RECTANGLE, 2, 120, 88, 102, 0x800 }, + { 2, ST_OAM_V_RECTANGLE, 2, 184, 88, 102, 0x800 }, + { 2, ST_OAM_V_RECTANGLE, 2, 248, 88, 102, 0x800 }, +}; + +static const struct CompressedSpriteSheet gUnknown_085F5180[] = { + { gIntro2NightTiles, 0x400, 2000 }, + { NULL } +}; + +static const union AnimCmd gUnknown_085F5190[] = { + ANIMCMD_FRAME(0, 30), + ANIMCMD_END +}; + +static const union AnimCmd *const gUnknown_085F5198[] = { + gUnknown_085F5190 +}; + +static const struct IntroCreditsSpriteMetadata gUnknown_085F519C[] = { + { 0, ST_OAM_SQUARE, 2, 24, 88, 100, 0x1000 }, + { 0, ST_OAM_SQUARE, 2, 64, 88, 100, 0x1000 }, + { 0, ST_OAM_SQUARE, 2, 104, 88, 100, 0x1000 }, + { 0, ST_OAM_SQUARE, 2, 144, 88, 100, 0x1000 }, + { 0, ST_OAM_SQUARE, 2, 184, 88, 100, 0x1000 }, + { 0, ST_OAM_SQUARE, 2, 224, 88, 100, 0x1000 }, +}; + +static const struct OamData gOamData_85F51CC = { + .y = 160, .shape = ST_OAM_SQUARE, .size = 3, .priority = 1 +}; + +static const union AnimCmd gUnknown_085F51D4[] = { + ANIMCMD_FRAME( 0, 8), + ANIMCMD_FRAME( 64, 8), + ANIMCMD_FRAME(128, 8), + ANIMCMD_FRAME(192, 8), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd *const gUnknown_085F51E8[] = { + gUnknown_085F51D4 +}; + +static const struct SpriteTemplate gUnknown_085F51EC = { + 1002, 1002, &gOamData_85F51CC, gUnknown_085F51E8, NULL, gDummySpriteAffineAnimTable, nullsub_65 +}; + +static const struct SpriteTemplate gUnknown_085F5204 = { + 1003, 1003, &gOamData_85F51CC, gUnknown_085F51E8, NULL, gDummySpriteAffineAnimTable, nullsub_65 +}; + +static const struct OamData gUnknown_085F521C = { + .y = 160, .shape = ST_OAM_H_RECTANGLE, .size = 3, .priority = 1 +}; + +static const union AnimCmd gUnknown_085F5224[] = { + ANIMCMD_FRAME( 0, 8), + ANIMCMD_FRAME( 32, 8), + ANIMCMD_FRAME( 64, 8), + ANIMCMD_FRAME( 96, 8), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd *const gUnknown_085F5238[] = { + gUnknown_085F5224 +}; + +static const struct SpriteTemplate gUnknown_085F523C = { + 1001, 1002, &gUnknown_085F521C, gUnknown_085F5238, NULL, gDummySpriteAffineAnimTable, sub_817B7C4 +}; + +static const struct SpriteTemplate gUnknown_085F5254 = { + 1001, 1003, &gUnknown_085F521C, gUnknown_085F5238, NULL, gDummySpriteAffineAnimTable, sub_817B7C4 +}; + +static const struct OamData gUnknown_085F526C = { + .y = 160, .shape = ST_OAM_SQUARE, .size = 3, .priority = 1 +}; + +static const union AnimCmd gUnknown_085F5274[] = { + ANIMCMD_FRAME( 0, 16), + ANIMCMD_END +}; + +static const union AnimCmd gUnknown_085F527C[] = { + ANIMCMD_FRAME( 64, 16), + ANIMCMD_END +}; + +static const union AnimCmd *const gUnknown_085F5284[] = { + gUnknown_085F5274, + gUnknown_085F527C +}; + +static const struct SpriteTemplate gUnknown_085F528C = { + 1004, 1004, &gUnknown_085F526C, gUnknown_085F5284, NULL, gDummySpriteAffineAnimTable, nullsub_66 +}; + +static const struct SpriteTemplate gUnknown_085F52A4 = { + 1005, 1005, &gUnknown_085F526C, gUnknown_085F5284, NULL, gDummySpriteAffineAnimTable, nullsub_66 +}; + +const struct CompressedSpriteSheet gIntro2BrendanSpriteSheet[] = { + { gIntro2BrendanNoTurnGfx, 0x2000, 1002 }, + { NULL } +}; + +const struct CompressedSpriteSheet gIntro2MaySpriteSheet[] = { + { gIntro2MayNoTurnGfx, 0x2000, 1003 }, + { NULL } +}; + +const struct CompressedSpriteSheet gIntro2BicycleSpriteSheet[] = { + { gIntro2BicycleTiles, 0x1000, 1001 }, + { NULL } +}; + +static const struct CompressedSpriteSheet gUnknown_085F52EC[] = { + { gIntro2FlygonGfx, 0x1000, 1004 }, + { NULL } +}; + +const struct CompressedSpriteSheet gIntro2FlygonSpriteSheet[] = { + { gIntro2FlygonGfx, 0x1000, 1005 }, + { NULL } +}; + +const struct SpritePalette gUnknown_085F530C[] = { + { gIntro2BrendanNoTurnPal, 1002 }, + { gIntro2BrendanNoTurnPal, 1003 }, + { gIntro2FlygonPal, 1004 }, + { gIntro2FlygonPal, 1005 }, + { NULL } +}; + +const struct CompressedSpriteSheet gUnknown_085F5334[] = { + { gIntro2BrendanTiles, 0x3800, 1002 }, + { NULL } +}; + +const struct CompressedSpriteSheet gUnknown_085F5344[] = { + { gIntro2MayTiles, 0x3800, 1003 }, + { NULL } +}; + +const struct CompressedSpriteSheet gUnknown_085F5354[] = { + { gIntro2BicycleTiles, 0x1000, 1001 }, + { NULL } +}; + +static const struct CompressedSpriteSheet gUnknown_085F5364[] = { + { gIntro2LatiosTiles, 0x1000, 1004 }, + { NULL } +}; + +static const struct CompressedSpriteSheet gUnknown_085F5374[] = { + { gIntro2LatiasTiles, 0x1000, 1005 }, + { NULL } +}; + +const struct SpritePalette gUnknown_085F5384[] = { + { gIntro2BrendanPalette, 1002 }, + { gIntro2MayPalette, 1003 }, + { gIntro2LatiosPalette, 1004 }, + { gIntro2LatiasPalette, 1005 }, + { NULL } +}; + +const struct CompressedSpriteSheet gUnknown_085F53AC[] = { + { gIntro2BrendanTiles, 0x2000, 1002}, + { NULL } +}; + +const struct CompressedSpriteSheet gUnknown_085F53BC[] = { + { gIntro2MayTiles, 0x2000, 1003}, + { NULL } +}; + +EWRAM_DATA u16 gUnknown_0203BD24 = 0; +EWRAM_DATA s16 gUnknown_0203BD26 = 0; +EWRAM_DATA s16 gUnknown_0203BD28 = 0; + +static void sub_817B76C(void); +static void sub_817B788(void); +static void sub_817B7A4(void); +static void sub_817B458(u8); + +void load_intro_part2_graphics(u8 a) +{ + LZ77UnCompVram(&gUnknown_085F0740, (void *)(VRAM + 0x4000)); + LZ77UnCompVram(&gUnknown_085F0BC0, (void *)(VRAM + 0x7800)); + LoadPalette(&gUnknown_085F06E0, 240, 32); + switch (a) + { + case 0: + default: + LZ77UnCompVram(&gUnknown_085F0DBC, (void *)(VRAM)); + LZ77UnCompVram(&gUnknown_085F1398, (void *)(VRAM + 0x3000)); + LoadPalette(&gUnknown_085F0CFC, 0, 96); + LoadCompressedObjectPic(gUnknown_085F5064); + LoadPalette(&gUnknown_085F1668, 256, 32); + sub_817B76C(); + break; + case 1: + LZ77UnCompVram(&gUnknown_085F1824, (void *)(VRAM)); + LZ77UnCompVram(&gUnknown_085F1EAC, (void *)(VRAM + 0x3000)); + LoadPalette(&gUnknown_085F17E4, 0, 32); + LoadCompressedObjectPic(gUnknown_085F50EC); + LoadPalette(&gUnknown_085F21B0, 256, 32); + sub_817B788(); + break; + } + gUnknown_0203BD28 = 0; + gReservedSpritePaletteCount = 8; +} + +void sub_817B150(u8 a) +{ + switch (a) + { + default: + case 0: + SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3) + | BGCNT_CHARBASE(0) + | BGCNT_16COLOR + | BGCNT_SCREENBASE(6) + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2) + | BGCNT_CHARBASE(0) + | BGCNT_16COLOR + | BGCNT_SCREENBASE(7) + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(1) + | BGCNT_CHARBASE(1) + | BGCNT_16COLOR + | BGCNT_SCREENBASE(15) + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 + | DISPCNT_OBJ_1D_MAP + | DISPCNT_BG1_ON + | DISPCNT_BG2_ON + | DISPCNT_BG3_ON + | DISPCNT_OBJ_ON); + break; + case 1: + SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3) + | BGCNT_CHARBASE(0) + | BGCNT_16COLOR + | BGCNT_SCREENBASE(6) + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2) + | BGCNT_CHARBASE(0) + | BGCNT_16COLOR + | BGCNT_SCREENBASE(7) + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(1) + | BGCNT_CHARBASE(1) + | BGCNT_16COLOR + | BGCNT_SCREENBASE(15) + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 + | DISPCNT_OBJ_1D_MAP + | DISPCNT_BG1_ON + | DISPCNT_BG2_ON + | DISPCNT_BG3_ON + | DISPCNT_OBJ_ON); + break; + case 2: + SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3) + | BGCNT_CHARBASE(0) + | BGCNT_16COLOR + | BGCNT_SCREENBASE(6) + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2) + | BGCNT_CHARBASE(0) + | BGCNT_16COLOR + | BGCNT_SCREENBASE(7) + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(1) + | BGCNT_CHARBASE(1) + | BGCNT_16COLOR + | BGCNT_SCREENBASE(15) + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 + | DISPCNT_OBJ_1D_MAP + | DISPCNT_BG1_ON + | DISPCNT_BG2_ON + | DISPCNT_BG3_ON + | DISPCNT_OBJ_ON); + break; + } +} + +void sub_817B1C8(u8 a) +{ + LZ77UnCompVram(&gUnknown_085F0740, (void *)(VRAM + 0x4000)); + LZ77UnCompVram(&gUnknown_085F0BC0, (void *)(VRAM + 0x7800)); + switch (a) + { + case 0: + default: + LoadPalette(&gUnknown_085F06E0, 240, 32); + LZ77UnCompVram(&gUnknown_085F0DBC, (void *)(VRAM)); + LZ77UnCompVram(&gUnknown_085F1398, (void *)(VRAM + 0x3000)); + LoadPalette(&gUnknown_085F0CFC, 0, 96); + LoadCompressedObjectPic(gUnknown_085F5064); + LZ77UnCompVram(&gUnknown_085F16A8, (void *)(VRAM + 0x10000)); + LoadPalette(&gUnknown_085F1668, 256, 32); + sub_817B76C(); + break; + case 1: + LoadPalette(&gUnknown_085F0700, 240, 32); + LZ77UnCompVram(&gUnknown_085F0DBC, (void *)(VRAM)); + LZ77UnCompVram(&gUnknown_085F1398, (void *)(VRAM + 0x3000)); + LoadPalette(&gUnknown_085F0D5C, 0, 96); + LoadCompressedObjectPic(gUnknown_085F5064); + LZ77UnCompVram(&gUnknown_085F16A8, (void *)(VRAM + 0x10000)); + LoadPalette(&gUnknown_085F1688, 256, 32); + sub_817B76C(); + break; + case 2: + case 3: + LoadPalette(&gUnknown_085F0700, 240, 32); + LZ77UnCompVram(&gUnknown_085F1824, (void *)(VRAM)); + LZ77UnCompVram(&gUnknown_085F1EAC, (void *)(VRAM + 0x3000)); + LoadPalette(&gUnknown_085F1804, 0, 32); + LoadCompressedObjectPic(gUnknown_085F50EC); + LoadPalette(&gUnknown_085F1804, 256, 32); + sub_817B788(); + break; + case 4: + LoadPalette(&gUnknown_085F0720, 240, 32); + LZ77UnCompVram(&gUnknown_085F235C, (void *)(VRAM)); + LZ77UnCompVram(&gUnknown_085F2568, (void *)(VRAM + 0x3000)); + LoadPalette(&gUnknown_085F231C, 0, 64); + LoadCompressedObjectPic(gUnknown_085F5180); + LoadPalette(&gUnknown_085F2548, 256, 32); + sub_817B7A4(); + break; + } + gReservedSpritePaletteCount = 8; + gUnknown_0203BD28 = 0; +} + +void sub_817B3A8(u8 a) +{ + SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3) + | BGCNT_CHARBASE(0) + | BGCNT_16COLOR + | BGCNT_SCREENBASE(6) + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2) + | BGCNT_CHARBASE(0) + | BGCNT_16COLOR + | BGCNT_SCREENBASE(7) + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(1) + | BGCNT_CHARBASE(1) + | BGCNT_16COLOR + | BGCNT_SCREENBASE(15) + | BGCNT_TXT256x256); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 + | DISPCNT_OBJ_1D_MAP + | DISPCNT_BG_ALL_ON + | DISPCNT_OBJ_ON); +} + +u8 sub_817B3DC(u8 a, u16 b, u16 c, u16 d) +{ + u8 taskId = CreateTask(&sub_817B458, 0); + + gTasks[taskId].data[0] = a; + gTasks[taskId].data[1] = b; + gTasks[taskId].data[2] = 0; + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[4] = c; + gTasks[taskId].data[5] = 0; + gTasks[taskId].data[6] = 0; + gTasks[taskId].data[7] = d; + gTasks[taskId].data[8] = 8; + gTasks[taskId].data[9] = 0; + sub_817B458(taskId); + return taskId; +} + +static void sub_817B458(u8 taskId) +{ + s16 data1; + s16 data4; + s16 data7; + s32 r2; + + data1 = gTasks[taskId].data[1]; + if (data1 != 0) + { + r2 = (gTasks[taskId].data[2] << 16) + (u16)gTasks[taskId].data[3]; + r2 -= (u16)data1 << 4; + gTasks[taskId].data[2] = r2 >> 16; + gTasks[taskId].data[3] = r2; + SetGpuReg(REG_OFFSET_BG1HOFS, gTasks[taskId].data[2]); + SetGpuReg(REG_OFFSET_BG1VOFS, gUnknown_0203BD24 + gUnknown_0203BD26); + } + + data4 = gTasks[taskId].data[4]; + if (data4 != 0) + { + r2 = (gTasks[taskId].data[5] << 16) + (u16)gTasks[taskId].data[6]; + r2 -= (u16)data4 << 4; + gTasks[taskId].data[5] = r2 >> 16; + gTasks[taskId].data[6] = r2; + SetGpuReg(REG_OFFSET_BG2HOFS, gTasks[taskId].data[5]); + if (gTasks[taskId].data[0] != 0) + SetGpuReg(REG_OFFSET_BG2VOFS, gUnknown_0203BD24 + gUnknown_0203BD26); + else + SetGpuReg(REG_OFFSET_BG2VOFS, gUnknown_0203BD24); + } + + data7 = gTasks[taskId].data[7]; + if (data7 != 0) + { + r2 = (gTasks[taskId].data[8] << 16) + (u16)gTasks[taskId].data[9]; + r2 -= (u16)data7 << 4; + gTasks[taskId].data[8] = r2 >> 16; + gTasks[taskId].data[9] = r2; + SetGpuReg(REG_OFFSET_BG3HOFS, gTasks[taskId].data[8]); + SetGpuReg(REG_OFFSET_BG3VOFS, gUnknown_0203BD24); + } +} + +void sub_817B540(u8 mode) +{ + u16 x; + u16 y; + switch (mode) + { + case 0: + default: + /* stuff */ + if (gMain.vblankCounter1 & 3 || gPaletteFade.active) + break; + if (gMain.vblankCounter1 & 4) + { + x = gPlttBufferUnfaded[9]; + y = gPlttBufferUnfaded[10]; + } + else + { + x = gPlttBufferUnfaded[10]; + y = gPlttBufferUnfaded[9]; + } + LoadPalette(&x, 9, 2); + LoadPalette(&y, 10, 2); + break; + case 2: + if (gMain.vblankCounter1 & 3 || gPaletteFade.active) + break; + if (gMain.vblankCounter1 & 4) + { + x = 0x3D27; + y = 0x295; + } + else + { + x = 0x31C; + y = 0x3D27; + } + LoadPalette(&x, 12, 2); + LoadPalette(&y, 13, 2); + break; + case 1: + break; + } +} + +static void sub_817B62C(struct Sprite *sprite) +{ + s32 var; + s16 var2 = gUnknown_0203BD28; + + if (var2 != 2) + { + switch (var2) + { + default: + DestroySprite(sprite); + break; + case 0: + var = ((sprite->pos1.x << 16) | (u16)sprite->data[2]) + (u16)sprite->data[1]; + sprite->pos1.x = var >> 16; + sprite->data[2] = var; + if (sprite->pos1.x > 0xFF) + sprite->pos1.x = -0x20; + if (sprite->data[0]) + sprite->pos2.y = -(gUnknown_0203BD24 + gUnknown_0203BD26); + else + sprite->pos2.y = -gUnknown_0203BD24; + break; + } + } +} + +static void sub_817B698(u8 a, const struct IntroCreditsSpriteMetadata *b, const union AnimCmd *const *c, u8 d) +{ + u8 i; + + for(i = 0; i < d; i++) + { + u8 sprite = CreateSprite(&gUnknown_085F504C, b[i].x, b[i].y, b[i].subpriority); + CalcCenterToCornerVec(&gSprites[sprite], b[i].shape, b[i].size, 0); + gSprites[sprite].oam.priority = 3; + gSprites[sprite].oam.shape = b[i].shape; + gSprites[sprite].oam.size = b[i].size; + gSprites[sprite].oam.paletteNum = 0; + gSprites[sprite].anims = c; + StartSpriteAnim(&gSprites[sprite], b[i].animNum); + gSprites[sprite].data[0] = a; + gSprites[sprite].data[1] = b[i].xOff; + gSprites[sprite].data[2] = 0; + } +} + +static void sub_817B76C(void) +{ + sub_817B698(0, gUnknown_085F50A4, gUnknown_085F5094, 9); +} + +static void sub_817B788(void) +{ + sub_817B698(1, gUnknown_085F5120, gUnknown_085F5114, 12); +} + +static void sub_817B7A4(void) +{ + sub_817B698(1, gUnknown_085F519C, gUnknown_085F5198, 6); +} + +static void nullsub_65(struct Sprite *sprite) +{ +} + +static void sub_817B7C4(struct Sprite* sprite) +{ + sprite->invisible = gSprites[sprite->data[0]].invisible; + sprite->pos1.x = gSprites[sprite->data[0]].pos1.x; + sprite->pos1.y = gSprites[sprite->data[0]].pos1.y + 8; + sprite->pos2.x = gSprites[sprite->data[0]].pos2.x; + sprite->pos2.y = gSprites[sprite->data[0]].pos2.y; +} + +u8 intro_create_brendan_sprite(s16 a, s16 b) +{ + u8 sprite = CreateSprite(&gUnknown_085F51EC, a, b, 2); + u8 brendan = CreateSprite(&gUnknown_085F523C, a, b + 8, 3); + gSprites[brendan].data[0] = sprite; + return sprite; +} + +u8 intro_create_may_sprite(s16 a, s16 b) +{ + u8 sprite = CreateSprite(&gUnknown_085F5204, a, b, 2); + u8 may = CreateSprite(&gUnknown_085F5254, a, b + 8, 3); + gSprites[may].data[0] = sprite; + return sprite; +} + +static void nullsub_66(struct Sprite *sprite) +{ +} + +static void sub_817B8E8(struct Sprite* sprite) +{ + sprite->invisible = gSprites[sprite->data[0]].invisible; + sprite->pos1.y = gSprites[sprite->data[0]].pos1.y; + sprite->pos2.x = gSprites[sprite->data[0]].pos2.x; + sprite->pos2.y = gSprites[sprite->data[0]].pos2.y; +} + +static u8 sub_817B948(s16 a, s16 b) +{ + u8 sprite = CreateSprite(&gUnknown_085F528C, a - 32, b, 5); + u8 latios = CreateSprite(&gUnknown_085F528C, a + 32, b, 6); + gSprites[latios].data[0] = sprite; + StartSpriteAnim(&gSprites[latios], 1); + gSprites[latios].callback = &sub_817B8E8; + return sprite; +} + +u8 intro_create_flygon_sprite(s16 a, s16 b) +{ + u8 sprite = CreateSprite(&gUnknown_085F52A4, a - 32, b, 5); + u8 flygon = CreateSprite(&gUnknown_085F52A4, a + 32, b, 6); + gSprites[flygon].data[0] = sprite; + StartSpriteAnim(&gSprites[flygon], 1); + gSprites[flygon].callback = &sub_817B8E8; + return sprite; +} diff --git a/src/main.c b/src/main.c index 3be6b91c7..f04f9b61b 100644 --- a/src/main.c +++ b/src/main.c @@ -166,7 +166,7 @@ static void InitMainCallbacks(void) gUnknown_0203CF5C = NULL; gMain.vblankCounter2 = 0; gMain.callback1 = NULL; - SetMainCallback2(c2_copyright_1); + SetMainCallback2(CB2_InitCopyrightScreenAfterBootup); gSaveBlock2Ptr = &gSaveblock2; gPokemonStoragePtr = &gPokemonStorage; } diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index 22e50f4e7..8a7671c5b 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -241,7 +241,7 @@ static void CB2_MysteryEventMenu(void) u16 unkVal = RunMysteryEventScript(gDecompressionBuffer); CpuFill32(0, gDecompressionBuffer, 0x7D4); if (!GetEventLoadMessage(gStringVar4, unkVal)) - TrySavingData(NORMAL_SAVE); + TrySavingData(SAVE_NORMAL); gMain.state++; } break; diff --git a/src/reset_save_heap.c b/src/reset_save_heap.c index 50692d356..1d90448b2 100644 --- a/src/reset_save_heap.c +++ b/src/reset_save_heap.c @@ -20,8 +20,8 @@ void sub_81700F8(void) gMain.inBattle = FALSE; SetSaveBlocksPointers(sub_815355C()); sub_808447C(); - ResetSaveCounters(); - sub_81534D0(0); + Save_ResetSaveCounters(); + Save_LoadGameData(0); if (gSaveFileStatus == 0 || gSaveFileStatus == 2) Sav2_ClearSetDefault(); SetPokemonCryStereo(gSaveBlock2Ptr->optionsSound); diff --git a/src/save.c b/src/save.c index 8d77e801a..8025d6586 100644 --- a/src/save.c +++ b/src/save.c @@ -3,6 +3,7 @@ #include "save.h" #include "constants/game_stat.h" #include "task.h" +#include "decompress.h" // for the chunk declarations extern struct SaveBlock2 gSaveblock2; @@ -96,7 +97,7 @@ void ClearSaveData(void) } } -void ResetSaveCounters(void) +void Save_ResetSaveCounters(void) { gSaveCounter = 0; gLastWrittenSector = 0; @@ -670,25 +671,25 @@ u8 HandleSavingData(u8 saveType) UpdateSaveAddresses(); switch (saveType) { - case HOF_DELETE_SAVE: // deletes HOF before overwriting HOF completely. unused + case SAVE_HALL_OF_FAME_ERASE_BEFORE: // deletes HOF before overwriting HOF completely. unused for (i = 0xE * 2 + 0; i < 32; i++) EraseFlashSector(i); - case HOF_SAVE: // hall of fame. + case SAVE_HALL_OF_FAME: // hall of fame. if (GetGameStat(GAME_STAT_ENTERED_HOF) < 999) IncrementGameStat(GAME_STAT_ENTERED_HOF); SaveSerializedGame(); save_write_to_flash(0xFFFF, gRamSaveSectionLocations); - tempAddr = (u8 *)0x201C000; // FIXME: make this a label. + tempAddr = gDecompressionBuffer; HandleWriteSectorNBytes(0x1C, tempAddr, 0xF80); HandleWriteSectorNBytes(0x1D, tempAddr + 0xF80, 0xF80); break; - case NORMAL_SAVE: // normal save. also called by overwriting your own save. + case SAVE_NORMAL: // normal save. also called by overwriting your own save. default: SaveSerializedGame(); save_write_to_flash(0xFFFF, gRamSaveSectionLocations); break; - case LINK_SAVE: // _081532C4 - case LINK2_SAVE: + case SAVE_LINK: // _081532C4 + case SAVE_LINK2: SaveSerializedGame(); for(i = 0; i < 5; i++) ClearSaveData_2(i, gRamSaveSectionLocations); @@ -702,7 +703,7 @@ u8 HandleSavingData(u8 saveType) save_write_to_flash(0, gRamSaveSectionLocations); break; */ - case DIFFERENT_FILE_SAVE: + case SAVE_OVERWRITE_DIFFERENT_FILE: for (i = (0xE * 2 + 0); i < 32; i++) EraseFlashSector(i); // erase HOF. SaveSerializedGame(); @@ -799,7 +800,7 @@ bool8 sub_8153474(void) return retVal; } -u8 sub_81534D0(u8 a1) +u8 Save_LoadGameData(u8 a1) { u8 result; diff --git a/src/starter_choose.c b/src/starter_choose.c index 83a7b8112..480edbcb7 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -25,12 +25,6 @@ #define STARTER_PKMN_POS_X 120 #define STARTER_PKMN_POS_Y 64 -// graphics -extern const u32 gBirchHelpGfx[]; -extern const u32 gBirchBagTilemap[]; -extern const u32 gBirchGrassTilemap[]; -extern const u16 gBirchBagGrassPal[]; - // text extern const u8 gText_BirchInTrouble[]; extern const u8 gText_ConfirmStarterChoice[]; diff --git a/sym_common.txt b/sym_common.txt index 56a4063db..ce3540ad9 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -142,7 +142,7 @@ gCB2_AfterEvolution: @ 30061E8 gUnknown_030061EC: @ 30061EC .space 0x4 - .include"save.o" + .include "save.o" .space 0x8 @@ -155,11 +155,7 @@ gUnknown_03006294: @ 3006294 gUnknown_03006298: @ 3006298 .space 0x8 -gUnknown_030062A0: @ 30062A0 - .space 0x10 - -gUnknown_030062B0: @ 30062B0 - .space 0x2C + .include "intro.o" gUnknown_030062DC: @ 30062DC .space 0x4 diff --git a/sym_ewram.txt b/sym_ewram.txt index dd6f295c7..96862ccd5 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -824,34 +824,14 @@ gUnknown_0203BCBC: @ 203BCBC gUnknown_0203BCC4: @ 203BCC4 .space 0x4 -gUnknown_0203BCC8: @ 203BCC8 - .space 0x4 - -gUnknown_0203BCCC: @ 203BCCC - .space 0x4 - + .include "src/intro.o" .include "src/field_region_map.o" gUnknown_0203BCD4: @ 203BCD4 .space 0x4 .include "src/hall_of_fame.o" - -gUnknown_0203BCE0: @ 203BCE0 - .space 0x2 - -gUnknown_0203BCE2: @ 203BCE2 - .space 0x2 - -gHasHallOfFameRecords: @ 203BCE4 - .space 0x1 - -gUnknown_0203BCE5: @ 203BCE5 - .space 0x3 - -gUnknown_0203BCE8: @ 203BCE8 - .space 0x4 - + .include "src/credits.o" .include "src/lottery_corner.o" .include "src/diploma.o" .include "src/berry_tag_screen.o" @@ -862,16 +842,7 @@ gBraillePuzzleCallbackFlag: @ 203BD14 .space 0x4 .include "src/pokeblock_feed.o" - -gUnknown_0203BD24: @ 203BD24 - .space 0x2 - -gUnknown_0203BD26: @ 203BD26 - .space 0x2 - -gUnknown_0203BD28: @ 203BD28 - .space 0x4 - + .include "src/intro_credits_graphics.o" .include "src/recorded_battle.o" .include "src/battle_dome_cards.o" .include "src/lilycove_lady.o"