diff --git a/asm/battle_dome_cards.s b/asm/battle_dome_cards.s deleted file mode 100644 index 2661d4667..000000000 --- a/asm/battle_dome_cards.s +++ /dev/null @@ -1,1280 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - - thumb_func_start nullsub_122 -nullsub_122: @ 818CFC8 - bx lr - thumb_func_end nullsub_122 - - thumb_func_start dp13_810BB8C -dp13_810BB8C: @ 818CFCC - push {r4-r7,lr} - ldr r4, =gUnknown_0860B058 - ldr r3, =gUnknown_0203CD04 - movs r2, 0x7 -_0818CFD4: - adds r1, r3, 0 - adds r0, r4, 0 - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - adds r3, 0xC - subs r2, 0x1 - cmp r2, 0 - bge _0818CFD4 - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end dp13_810BB8C - - thumb_func_start load_pokemon_image_TODO -@ int load_pokemon_image_TODO(int species_num, unsigned int a2, u8 a3, void *a4, int a5, u8 a6) -load_pokemon_image_TODO: @ 818CFF4 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r1, 0 - adds r5, r3, 0 - ldr r3, [sp, 0x18] - ldr r1, [sp, 0x1C] - lsls r0, 16 - lsrs r4, r0, 16 - adds r7, r4, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsls r1, 24 - lsrs r1, 24 - adds r0, r1, 0 - cmp r3, 0 - bne _0818D068 - cmp r2, 0 - beq _0818D034 - cmp r1, 0 - bne _0818D028 - lsls r0, r4, 3 - ldr r1, =gMonFrontPicTable - b _0818D03C - .pool -_0818D028: - lsls r0, r4, 3 - ldr r1, =gMonFrontPicTable - b _0818D054 - .pool -_0818D034: - cmp r0, 0 - bne _0818D050 - lsls r0, r4, 3 - ldr r1, =gMonBackPicTable -_0818D03C: - adds r0, r1 - str r2, [sp] - adds r1, r5, 0 - adds r2, r4, 0 - adds r3, r6, 0 - bl LoadSpecialPokePic - b _0818D08E - .pool -_0818D050: - lsls r0, r4, 3 - ldr r1, =gMonBackPicTable -_0818D054: - adds r0, r1 - str r2, [sp] - adds r1, r5, 0 - adds r2, r4, 0 - adds r3, r6, 0 - bl LoadSpecialPokePic_DontHandleDeoxys - b _0818D08E - .pool -_0818D068: - cmp r2, 0 - beq _0818D080 - lsls r0, r4, 3 - ldr r1, =gTrainerFrontPicTable - adds r0, r1 - adds r1, r5, 0 - adds r2, r4, 0 - bl DecompressPicFromTable - b _0818D08E - .pool -_0818D080: - lsls r0, r7, 3 - ldr r1, =gTrainerBackPicTable - adds r0, r1 - adds r1, r5, 0 - adds r2, r7, 0 - bl DecompressPicFromTable -_0818D08E: - movs r0, 0 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end load_pokemon_image_TODO - - thumb_func_start sub_818D09C -sub_818D09C: @ 818D09C - push {r4,lr} - sub sp, 0x8 - ldr r4, [sp, 0x10] - lsls r0, 16 - lsrs r0, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - bl load_pokemon_image_TODO - lsls r0, 16 - lsrs r0, 16 - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_818D09C - - thumb_func_start sub_818D0C4 -sub_818D0C4: @ 818D0C4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r1, 0 - mov r8, r2 - ldr r1, [sp, 0x18] - ldr r2, [sp, 0x1C] - lsls r0, 16 - lsrs r4, r0, 16 - adds r6, r4, 0 - lsls r3, 24 - lsrs r5, r3, 24 - mov r12, r5 - lsls r1, 16 - lsrs r3, r1, 16 - adds r1, r3, 0 - lsls r2, 24 - cmp r2, 0 - bne _0818D128 - ldr r0, =0x0000ffff - cmp r3, r0 - bne _0818D110 - ldr r2, =gUnknown_0203CCEC - ldrh r1, [r2, 0x2] - adds r0, r3, 0 - orrs r0, r1 - strh r0, [r2, 0x2] - adds r0, r4, 0 - adds r1, r7, 0 - mov r2, r8 - bl species_and_otid_get_pal - lsls r1, r5, 20 - b _0818D144 - .pool -_0818D110: - ldr r0, =gUnknown_0203CCEC - strh r3, [r0, 0x2] - adds r0, r4, 0 - adds r1, r7, 0 - mov r2, r8 - bl sub_806E7CC - bl LoadCompressedObjectPalette - b _0818D16E - .pool -_0818D128: - ldr r0, =0x0000ffff - cmp r3, r0 - bne _0818D160 - ldr r2, =gUnknown_0203CCEC - ldrh r1, [r2, 0x2] - adds r0, r3, 0 - orrs r0, r1 - strh r0, [r2, 0x2] - ldr r1, =gTrainerFrontPicPaletteTable - lsls r0, r4, 3 - adds r0, r1 - ldr r0, [r0] - mov r2, r12 - lsls r1, r2, 20 -_0818D144: - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl LoadCompressedPalette - b _0818D16E - .pool -_0818D160: - ldr r0, =gUnknown_0203CCEC - strh r1, [r0, 0x2] - lsls r0, r6, 3 - ldr r1, =gTrainerFrontPicPaletteTable - adds r0, r1 - bl LoadCompressedObjectPalette -_0818D16E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818D0C4 - - thumb_func_start sub_818D180 -sub_818D180: @ 818D180 - push {r4,r5,lr} - adds r5, r1, 0 - ldr r1, [sp, 0xC] - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r4, r3, 24 - lsls r1, 24 - cmp r1, 0 - bne _0818D1A4 - adds r1, r5, 0 - bl species_and_otid_get_pal - lsls r1, r4, 4 - movs r2, 0x20 - bl LoadCompressedPalette - b _0818D1B4 -_0818D1A4: - ldr r1, =gTrainerFrontPicPaletteTable - lsls r0, 3 - adds r0, r1 - ldr r0, [r0] - lsls r1, r4, 4 - movs r2, 0x20 - bl LoadCompressedPalette -_0818D1B4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818D180 - - thumb_func_start uns_builder_assign_animtable1 -uns_builder_assign_animtable1: @ 818D1C0 - push {lr} - lsls r0, 24 - cmp r0, 0 - bne _0818D1D8 - ldr r1, =gUnknown_0203CCEC - ldr r0, =gUnknown_082FF70C - str r0, [r1, 0x8] - b _0818D1E0 - .pool -_0818D1D8: - ldr r0, =gUnknown_0203CCEC - ldr r1, =gUnknown_0830536C - ldr r1, [r1] - str r1, [r0, 0x8] -_0818D1E0: - pop {r0} - bx r0 - .pool - thumb_func_end uns_builder_assign_animtable1 - - thumb_func_start oamt_spawn_poke_or_trainer_picture -oamt_spawn_poke_or_trainer_picture: @ 818D1EC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - str r1, [sp, 0xC] - str r2, [sp, 0x10] - ldr r1, [sp, 0x50] - ldr r2, [sp, 0x54] - ldr r4, [sp, 0x58] - ldr r5, [sp, 0x5C] - ldr r6, [sp, 0x60] - ldr r7, [sp, 0x64] - mov r8, r7 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x18] - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x1C] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x20] - lsls r5, 16 - lsrs r5, 16 - mov r10, r5 - lsls r6, 24 - lsrs r6, 24 - mov r9, r6 - mov r0, r8 - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r1, =gUnknown_0203CD04 - ldrb r0, [r1, 0xB] - cmp r0, 0 - beq _0818D25C -_0818D244: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bhi _0818D25C - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0xB] - cmp r0, 0 - bne _0818D244 -_0818D25C: - cmp r4, 0x8 - beq _0818D280 - movs r0, 0x80 - lsls r0, 6 - bl Alloc - adds r7, r0, 0 - cmp r7, 0 - beq _0818D280 - movs r0, 0x20 - bl Alloc - mov r8, r0 - cmp r0, 0 - bne _0818D28C - adds r0, r7, 0 - bl Free -_0818D280: - ldr r0, =0x0000ffff - b _0818D356 - .pool -_0818D28C: - mov r1, r9 - str r1, [sp] - str r5, [sp, 0x4] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x10] - ldr r2, [sp, 0x14] - adds r3, r7, 0 - bl load_pokemon_image_TODO - lsls r0, 16 - cmp r0, 0 - bne _0818D280 - lsls r2, r4, 1 - str r2, [sp, 0x2C] - ldr r5, =gUnknown_0203CCEC - ldr r0, =gUnknown_0860B064 - mov r12, r0 - ldr r1, [sp, 0x18] - lsls r1, 16 - str r1, [sp, 0x24] - ldr r2, [sp, 0x1C] - lsls r2, 16 - str r2, [sp, 0x28] - movs r3, 0x80 - lsls r3, 4 - mov r0, r8 - adds r1, r7, 0 - adds r6, r3, 0 - movs r2, 0x3 -_0818D2C6: - str r1, [r0] - strh r3, [r0, 0x4] - adds r0, 0x8 - adds r1, r6 - subs r2, 0x1 - cmp r2, 0 - bge _0818D2C6 - ldr r0, =0x0000ffff - strh r0, [r5] - mov r0, r12 - str r0, [r5, 0x4] - mov r0, r9 - bl uns_builder_assign_animtable1 - mov r1, r8 - str r1, [r5, 0xC] - ldr r0, =gDummySpriteAffineAnimTable - str r0, [r5, 0x10] - ldr r0, =nullsub_122 - str r0, [r5, 0x14] - mov r2, r10 - str r2, [sp] - mov r0, r9 - str r0, [sp, 0x4] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0xC] - ldr r2, [sp, 0x10] - ldr r3, [sp, 0x20] - bl sub_818D0C4 - ldr r2, [sp, 0x24] - asrs r1, r2, 16 - ldr r0, [sp, 0x28] - asrs r2, r0, 16 - adds r0, r5, 0 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r2, r0, 24 - adds r6, r2, 0 - ldr r0, =0x0000ffff - cmp r10, r0 - bne _0818D336 - ldr r0, =gSprites - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldr r2, [sp, 0x20] - lsls r3, r2, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] -_0818D336: - ldr r1, =gUnknown_0203CD04 - ldr r2, [sp, 0x2C] - adds r0, r2, r4 - lsls r0, 2 - adds r2, r0, r1 - str r7, [r2] - adds r1, 0x4 - adds r0, r1 - mov r7, r8 - str r7, [r0] - mov r0, r10 - strh r0, [r2, 0x8] - strb r6, [r2, 0xA] - movs r0, 0x1 - strb r0, [r2, 0xB] - adds r0, r6, 0 -_0818D356: - add sp, 0x30 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end oamt_spawn_poke_or_trainer_picture - - thumb_func_start sub_818D384 -sub_818D384: @ 818D384 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - ldr r4, [sp, 0x34] - ldr r5, [sp, 0x38] - ldr r6, [sp, 0x3C] - ldr r7, [sp, 0x40] - mov r8, r7 - ldr r7, [sp, 0x44] - mov r9, r7 - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - mov r7, r8 - lsls r7, 16 - lsrs r7, 16 - mov r8, r7 - mov r7, r9 - lsls r7, 24 - lsrs r7, 24 - lsls r4, 16 - asrs r4, 16 - str r4, [sp] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x4] - str r6, [sp, 0x8] - mov r4, r8 - str r4, [sp, 0xC] - str r7, [sp, 0x10] - movs r4, 0 - str r4, [sp, 0x14] - bl oamt_spawn_poke_or_trainer_picture - lsls r0, 16 - lsrs r0, 16 - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818D384 - - thumb_func_start sub_818D3E4 -sub_818D3E4: @ 818D3E4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - str r1, [sp, 0x8] - str r2, [sp, 0xC] - ldr r1, [sp, 0x4C] - ldr r2, [sp, 0x50] - ldr r4, [sp, 0x54] - ldr r5, [sp, 0x58] - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r3, 24 - lsrs r6, r3, 24 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x10] - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x14] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x18] - lsls r5, 16 - lsrs r5, 16 - str r5, [sp, 0x1C] - movs r5, 0 - ldr r1, =gUnknown_0203CD04 - ldrb r0, [r1, 0xB] - cmp r0, 0 - beq _0818D440 -_0818D428: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x7 - bhi _0818D440 - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0xB] - cmp r0, 0 - bne _0818D428 -_0818D440: - cmp r5, 0x8 - beq _0818D47C - movs r0, 0x80 - lsls r0, 6 - bl Alloc - adds r7, r0, 0 - cmp r7, 0 - beq _0818D47C - movs r0, 0x80 - ands r0, r6 - cmp r0, 0 - beq _0818D468 - movs r0, 0x7F - ands r6, r0 - movs r0, 0x3 - mov r9, r0 - b _0818D46A - .pool -_0818D468: - mov r9, r6 -_0818D46A: - movs r0, 0x20 - bl Alloc - mov r8, r0 - cmp r0, 0 - bne _0818D484 - adds r0, r7, 0 - bl Free -_0818D47C: - ldr r0, =0x0000ffff - b _0818D588 - .pool -_0818D484: - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r10 - ldr r1, [sp, 0xC] - adds r2, r6, 0 - adds r3, r7, 0 - bl load_pokemon_image_TODO - lsls r0, 16 - cmp r0, 0 - bne _0818D47C - lsls r1, r5, 1 - str r1, [sp, 0x28] - ldr r4, =gUnknown_0203CCEC - mov r2, r10 - lsls r2, 2 - mov r12, r2 - ldr r0, [sp, 0x10] - lsls r0, 16 - str r0, [sp, 0x20] - ldr r1, [sp, 0x14] - lsls r1, 16 - str r1, [sp, 0x24] - movs r3, 0x80 - lsls r3, 4 - mov r0, r8 - adds r1, r7, 0 - adds r6, r3, 0 - movs r2, 0x3 -_0818D4C0: - str r1, [r0] - strh r3, [r0, 0x4] - adds r0, 0x8 - adds r1, r6 - subs r2, 0x1 - cmp r2, 0 - bge _0818D4C0 - ldr r0, =0x0000ffff - strh r0, [r4] - ldr r0, =gUnknown_08309AAC - add r0, r12 - ldr r0, [r0] - str r0, [r4, 0x8] - mov r2, r8 - str r2, [r4, 0xC] - mov r0, r9 - cmp r0, 0x1 - bne _0818D4F8 - ldr r0, =gUnknown_082FF694 - b _0818D500 - .pool -_0818D4F8: - mov r1, r9 - cmp r1, 0 - bne _0818D510 - ldr r0, =gUnknown_082FF618 -_0818D500: - str r0, [r4, 0x10] - ldr r0, =gUnknown_0860B06C - str r0, [r4, 0x4] - b _0818D518 - .pool -_0818D510: - ldr r0, =gUnknown_0860B064 - str r0, [r4, 0x4] - ldr r0, =gDummySpriteAffineAnimTable - str r0, [r4, 0x10] -_0818D518: - ldr r2, =nullsub_122 - str r2, [r4, 0x14] - ldr r0, [sp, 0x1C] - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - mov r0, r10 - ldr r1, [sp, 0x8] - ldr r2, [sp, 0xC] - ldr r3, [sp, 0x18] - bl sub_818D0C4 - ldr r2, [sp, 0x20] - asrs r1, r2, 16 - ldr r0, [sp, 0x24] - asrs r2, r0, 16 - adds r0, r4, 0 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r2, r0, 24 - adds r6, r2, 0 - ldr r0, =0x0000ffff - ldr r1, [sp, 0x1C] - cmp r1, r0 - bne _0818D566 - ldr r0, =gSprites - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldr r2, [sp, 0x18] - lsls r3, r2, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] -_0818D566: - ldr r1, =gUnknown_0203CD04 - ldr r2, [sp, 0x28] - adds r0, r2, r5 - lsls r0, 2 - adds r2, r0, r1 - str r7, [r2] - adds r1, 0x4 - adds r0, r1 - mov r1, r8 - str r1, [r0] - mov r0, sp - ldrh r0, [r0, 0x1C] - strh r0, [r2, 0x8] - strb r6, [r2, 0xA] - movs r0, 0x1 - strb r0, [r2, 0xB] - adds r0, r6, 0 -_0818D588: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818D3E4 - - thumb_func_start sub_818D5B0 -sub_818D5B0: @ 818D5B0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r4, r0, 16 - movs r2, 0 - ldr r0, =gUnknown_0203CD04 - ldrb r1, [r0, 0xA] - adds r3, r0, 0 - cmp r1, r4 - beq _0818D5E0 - adds r1, r3, 0 -_0818D5C8: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bhi _0818D5E0 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0xA] - cmp r0, r4 - bne _0818D5C8 -_0818D5E0: - cmp r2, 0x8 - bne _0818D5F0 - ldr r0, =0x0000ffff - b _0818D646 - .pool -_0818D5F0: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r5, r0, r3 - ldr r1, [r5] - mov r8, r1 - adds r1, r3, 0x4 - adds r0, r1 - ldr r7, [r0] - ldrh r1, [r5, 0x8] - ldr r0, =0x0000ffff - lsls r6, r4, 4 - cmp r1, r0 - beq _0818D624 - ldr r1, =gSprites - adds r0, r6, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - bl GetSpritePaletteTagByPaletteNum - lsls r0, 16 - lsrs r0, 16 - bl FreeSpritePaletteByTag -_0818D624: - adds r0, r6, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - mov r0, r8 - bl Free - adds r0, r7, 0 - bl Free - adds r1, r5, 0 - ldr r0, =gUnknown_0860B058 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - movs r0, 0 -_0818D646: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818D5B0 - - thumb_func_start sub_818D65C -sub_818D65C: @ 818D65C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - mov r9, r1 - adds r7, r2, 0 - adds r4, r3, 0 - ldr r1, [sp, 0x20] - ldr r2, [sp, 0x24] - ldr r3, [sp, 0x28] - lsls r0, 16 - lsrs r5, r0, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - adds r0, r2, 0 - movs r1, 0x7 - bl GetWindowAttribute - adds r3, r0, 0 - movs r0, 0 - str r0, [sp] - adds r0, r5, 0 - adds r1, r7, 0 - adds r2, r4, 0 - bl sub_818D09C - lsls r0, 16 - cmp r0, 0 - bne _0818D6B8 - str r6, [sp] - adds r0, r5, 0 - mov r1, r9 - adds r2, r7, 0 - mov r3, r8 - bl sub_818D180 - movs r0, 0 - b _0818D6BA -_0818D6B8: - ldr r0, =0x0000ffff -_0818D6BA: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818D65C - - thumb_func_start sub_818D6CC -sub_818D6CC: @ 818D6CC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - str r1, [sp, 0x18] - str r2, [sp, 0x1C] - ldr r1, [sp, 0x44] - ldr r2, [sp, 0x48] - ldr r4, [sp, 0x4C] - ldr r5, [sp, 0x50] - ldr r6, [sp, 0x54] - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x20] - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0x80 - lsls r0, 6 - bl Alloc - adds r4, r0, 0 - cmp r4, 0 - beq _0818D762 - str r6, [sp] - mov r0, r9 - ldr r1, [sp, 0x1C] - adds r2, r7, 0 - adds r3, r4, 0 - bl sub_818D09C - lsls r0, 16 - cmp r0, 0 - bne _0818D762 - movs r0, 0x40 - str r0, [sp] - str r0, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - mov r1, r8 - str r1, [sp, 0xC] - str r0, [sp, 0x10] - str r0, [sp, 0x14] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl BlitBitmapRectToWindow - str r6, [sp] - mov r0, r9 - ldr r1, [sp, 0x18] - ldr r2, [sp, 0x1C] - ldr r3, [sp, 0x20] - bl sub_818D180 - adds r0, r4, 0 - bl Free - movs r0, 0 - b _0818D764 -_0818D762: - ldr r0, =0x0000ffff -_0818D764: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818D6CC - - thumb_func_start sub_818D778 -sub_818D778: @ 818D778 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - ldr r4, [sp, 0x34] - ldr r5, [sp, 0x38] - ldr r6, [sp, 0x3C] - ldr r7, [sp, 0x40] - mov r8, r7 - ldr r7, [sp, 0x44] - mov r9, r7 - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - mov r7, r8 - lsls r7, 16 - lsrs r7, 16 - mov r8, r7 - mov r7, r9 - lsls r7, 24 - lsrs r7, 24 - lsls r4, 16 - asrs r4, 16 - str r4, [sp] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x4] - str r6, [sp, 0x8] - mov r4, r8 - str r4, [sp, 0xC] - movs r4, 0 - str r4, [sp, 0x10] - str r7, [sp, 0x14] - bl oamt_spawn_poke_or_trainer_picture - lsls r0, 16 - lsrs r0, 16 - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818D778 - - thumb_func_start sub_818D7D8 -sub_818D7D8: @ 818D7D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - ldr r4, [sp, 0x2C] - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - ldr r7, [sp, 0x38] - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r7, 16 - lsrs r7, 16 - lsls r4, 16 - asrs r4, 16 - str r4, [sp] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x4] - str r6, [sp, 0x8] - str r7, [sp, 0xC] - movs r4, 0 - str r4, [sp, 0x10] - bl sub_818D778 - lsls r0, 16 - lsrs r0, 16 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818D7D8 - - thumb_func_start sub_818D820 -sub_818D820: @ 818D820 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_818D5B0 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_818D820 - - thumb_func_start sub_818D834 -sub_818D834: @ 818D834 - push {r4,r5,lr} - sub sp, 0xC - ldr r4, [sp, 0x18] - ldr r5, [sp, 0x1C] - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - str r4, [sp] - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - bl sub_818D65C - lsls r0, 16 - lsrs r0, 16 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_818D834 - - thumb_func_start sub_818D864 -sub_818D864: @ 818D864 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - ldr r4, [sp, 0x2C] - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - ldr r7, [sp, 0x38] - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 24 - lsrs r6, 24 - lsls r7, 24 - lsrs r7, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - str r7, [sp, 0xC] - movs r4, 0 - str r4, [sp, 0x10] - bl sub_818D6CC - lsls r0, 16 - lsrs r0, 16 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818D864 - - thumb_func_start sub_818D8AC -sub_818D8AC: @ 818D8AC - push {r4,r5,lr} - sub sp, 0x14 - adds r5, r1, 0 - ldr r1, [sp, 0x20] - ldr r4, [sp, 0x24] - lsls r0, 16 - lsrs r0, 16 - lsls r5, 24 - lsrs r5, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r4, 16 - lsrs r4, 16 - lsls r2, 16 - asrs r2, 16 - str r2, [sp] - lsls r3, 16 - asrs r3, 16 - str r3, [sp, 0x4] - str r1, [sp, 0x8] - str r4, [sp, 0xC] - movs r1, 0x1 - str r1, [sp, 0x10] - movs r1, 0 - movs r2, 0 - adds r3, r5, 0 - bl sub_818D384 - lsls r0, 16 - lsrs r0, 16 - add sp, 0x14 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_818D8AC - - thumb_func_start sub_818D8F0 -sub_818D8F0: @ 818D8F0 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_818D5B0 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_818D8F0 - - thumb_func_start sub_818D904 -sub_818D904: @ 818D904 - push {r4,lr} - sub sp, 0xC - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r2, [sp] - str r3, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0 - adds r3, r4, 0 - bl sub_818D65C - lsls r0, 16 - lsrs r0, 16 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_818D904 - - thumb_func_start sub_818D938 -sub_818D938: @ 818D938 - push {r4,r5,lr} - sub sp, 0x14 - adds r5, r1, 0 - ldr r1, [sp, 0x20] - ldr r4, [sp, 0x24] - lsls r0, 16 - lsrs r0, 16 - lsls r5, 24 - lsrs r5, 24 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r1, 24 - lsrs r1, 24 - lsls r4, 24 - lsrs r4, 24 - str r2, [sp] - str r3, [sp, 0x4] - str r1, [sp, 0x8] - str r4, [sp, 0xC] - movs r1, 0x1 - str r1, [sp, 0x10] - movs r1, 0 - movs r2, 0 - adds r3, r5, 0 - bl sub_818D6CC - lsls r0, 16 - lsrs r0, 16 - add sp, 0x14 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_818D938 - - thumb_func_start sub_818D97C -sub_818D97C: @ 818D97C - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - bne _0818D9A2 - cmp r0, 0 - beq _0818D99C - ldr r0, =gUnknown_0831F578 - adds r0, 0x3F - ldrb r0, [r0] - b _0818D9A2 - .pool -_0818D99C: - ldr r0, =gUnknown_0831F578 - adds r0, 0x3C - ldrb r0, [r0] -_0818D9A2: - pop {r1} - bx r1 - .pool - thumb_func_end sub_818D97C - .align 2, 0 @ Don't pad with nop. diff --git a/data/data_emerald.s b/data/data_emerald.s index 54bda4a0e..88c57af8d 100644 --- a/data/data_emerald.s +++ b/data/data_emerald.s @@ -3,15 +3,6 @@ .section .rodata -gUnknown_0860B058:: @ 860B058 - .incbin "baserom.gba", 0x60b058, 0xc - -gUnknown_0860B064:: @ 860B064 - .incbin "baserom.gba", 0x60b064, 0x8 - -gUnknown_0860B06C:: @ 860B06C - .incbin "baserom.gba", 0x60b06c, 0x8 - gUnknown_0860B074:: @ 860B074 .incbin "baserom.gba", 0x60b074, 0xa diff --git a/include/battle_dome_cards.h b/include/battle_dome_cards.h new file mode 100644 index 000000000..a0696d156 --- /dev/null +++ b/include/battle_dome_cards.h @@ -0,0 +1,13 @@ +#ifndef GUARD_BATTLE_DOME_CARDS_H +#define GUARD_BATTLE_DOME_CARDS_H + +bool16 dp13_810BB8C(void); +u16 sub_818D3E4(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y, u8 paletteSlot, u16 paletteTag); +u16 sub_818D7D8(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag); +u16 sub_818D820(u16 spriteId); +u16 sub_818D8AC(u16 species, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag); +u16 sub_818D8F0(u16 spriteId); +u16 sub_818D938(u16 species, bool8 isFrontPic, u16 destX, u16 destY, u8 paletteSlot, u8 windowId); +u8 sub_818D97C(u8 a0, u8 a1); + +#endif //GUARD_BATTLE_DOME_CARDS_H diff --git a/ld_script.txt b/ld_script.txt index a6855681f..d5480d5ef 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -239,7 +239,7 @@ SECTIONS { asm/recorded_battle.o(.text); asm/battle_controller_recorded_opponent.o(.text); asm/battle_controller_recorded_player.o(.text); - asm/battle_dome_cards.o(.text); + src/battle_dome_cards.o(.text); asm/lilycove_lady.o(.text); asm/battle_frontier_1.o(.text); asm/new_menu_helpers.o(.text); @@ -378,6 +378,7 @@ SECTIONS { data/data_860A4AC.o(.rodata); data/battle_controller_recorded_opponent.o(.rodata); data/battle_controller_recorded_player.o(.rodata); + src/battle_dome_cards.o(.rodata); data/data_emerald.o(.rodata); data/battle_controller_player_partner.o(.rodata); data/data_emerald2.o(.rodata); diff --git a/src/battle_dome_cards.c b/src/battle_dome_cards.c new file mode 100644 index 000000000..c0557ac70 --- /dev/null +++ b/src/battle_dome_cards.c @@ -0,0 +1,430 @@ + +// Includes +#include "global.h" +#include "sprite.h" +#include "window.h" +#include "malloc.h" +#include "species.h" +#include "palette.h" +#include "decompress.h" +#include "battle_dome_cards.h" + +extern const struct CompressedSpriteSheet gMonFrontPicTable[NUM_SPECIES]; +extern const struct CompressedSpriteSheet gMonBackPicTable[NUM_SPECIES]; +extern const struct CompressedSpriteSheet gTrainerFrontPicTable[]; +extern const struct CompressedSpriteSheet gTrainerBackPicTable[]; +extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; +extern const union AffineAnimCmd *const gUnknown_082FF618[]; +extern const union AffineAnimCmd *const gUnknown_082FF694[]; +extern const union AnimCmd *const gUnknown_082FF70C[]; +extern const union AnimCmd *const *const gUnknown_08309AAC[NUM_SPECIES]; +extern const union AnimCmd *const *const gUnknown_0830536C[]; +extern const u8 gUnknown_0831F578[]; + +// Static type declarations + +struct BattleDomeCard { + u8 *frames; + struct SpriteFrameImage *images; + u16 paletteTag; + u8 spriteId; + u8 active; +}; + +// Static RAM declarations + +static EWRAM_DATA struct SpriteTemplate gUnknown_0203CCEC = {}; +static EWRAM_DATA struct BattleDomeCard gUnknown_0203CD04[8] = {}; + +// Static ROM declarations + +// .rodata + +static const struct BattleDomeCard gUnknown_0860B058 = {}; +static const struct OamData gUnknown_0860B064 = { + .size = 3 +}; +static const struct OamData gUnknown_0860B06C = { + .affineMode = 1, .size = 3 +}; + +// .text + +static void nullsub_122(struct Sprite *sprite) +{ + +} + +bool16 dp13_810BB8C(void) +{ + int i; + + for (i = 0; i < 8; i ++) + { + gUnknown_0203CD04[i] = gUnknown_0860B058; + } + return FALSE; +} + +static bool16 load_pokemon_image_TODO(u16 species, u32 personality, bool8 isFrontPic, u8 *dest, bool8 isTrainer, bool8 ignoreDeoxys) +{ + if (!isTrainer) + { + if (isFrontPic) + { + if (!ignoreDeoxys) + { + LoadSpecialPokePic(&gMonFrontPicTable[species], dest, species, personality, isFrontPic); + } + else + { + LoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], dest, species, personality, isFrontPic); + } + } + else + { + if (!ignoreDeoxys) + { + LoadSpecialPokePic(&gMonBackPicTable[species], dest, species, personality, isFrontPic); + } + else + { + LoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], dest, species, personality, isFrontPic); + } + } + } + else + { + if (isFrontPic) + { + DecompressPicFromTable(&gTrainerFrontPicTable[species], dest, species); + } + else + { + DecompressPicFromTable(&gTrainerBackPicTable[species], dest, species); + } + } + return FALSE; +} + +static bool16 sub_818D09C(u16 species, u32 personality, bool8 isFrontPic, u8 *dest, bool8 isTrainer) +{ + return load_pokemon_image_TODO(species, personality, isFrontPic, dest, isTrainer, FALSE); +} + +static void sub_818D0C4(u16 species, u32 otId, u32 personality, u8 paletteSlot, u16 paletteTag, bool8 isTrainer) +{ + if (!isTrainer) + { + if (paletteTag == 0xFFFF) + { + gUnknown_0203CCEC.paletteTag |= 0xFFFF; + LoadCompressedPalette(species_and_otid_get_pal(species, otId, personality), 0x100 + paletteSlot * 0x10, 0x20); + } + else + { + gUnknown_0203CCEC.paletteTag = paletteTag; + LoadCompressedObjectPalette(sub_806E7CC(species, otId, personality)); + } + } + else + { + if (paletteTag == 0xFFFF) + { + gUnknown_0203CCEC.paletteTag |= 0xFFFF; + LoadCompressedPalette(gTrainerFrontPicPaletteTable[species].data, 0x100 + paletteSlot * 0x10, 0x20); + } + else + { + gUnknown_0203CCEC.paletteTag = paletteTag; + LoadCompressedObjectPalette(&gTrainerFrontPicPaletteTable[species]); + } + } +} + +static void sub_818D180(u16 species, u32 otId, u32 personality, u8 paletteSlot, bool8 isTrainer) +{ + if (!isTrainer) + { + LoadCompressedPalette(species_and_otid_get_pal(species, otId, personality), paletteSlot * 0x10, 0x20); + } + else + { + LoadCompressedPalette(gTrainerFrontPicPaletteTable[species].data, paletteSlot * 0x10, 0x20); + } +} + +static void uns_builder_assign_animtable1(bool8 isTrainer) +{ + if (!isTrainer) + { + gUnknown_0203CCEC.anims = gUnknown_082FF70C; + } + else + { + gUnknown_0203CCEC.anims = gUnknown_0830536C[0]; + } +} + +static u16 oamt_spawn_poke_or_trainer_picture(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag, bool8 isTrainer, bool8 ignoreDeoxys) +{ + u8 i; + u8 *framePics; + struct SpriteFrameImage *images; + int j; + u8 spriteId; + + for (i = 0; i < 8; i ++) + { + if (!gUnknown_0203CD04[i].active) + { + break; + } + } + if (i == 8) + { + return 0xFFFF; + } + framePics = Alloc(4 * 0x800); + if (!framePics) + { + return 0xFFFF; + } + images = Alloc(4 * sizeof(struct SpriteFrameImage)); + if (!images) + { + Free(framePics); + return 0xFFFF; + } + if (load_pokemon_image_TODO(species, personality, isFrontPic, framePics, isTrainer, ignoreDeoxys)) + { + // debug trap? + return 0xFFFF; + } + for (j = 0; j < 4; j ++) + { + images[j].data = framePics + 0x800 * j; + images[j].size = 0x800; + } + gUnknown_0203CCEC.tileTag = 0xFFFF; + gUnknown_0203CCEC.oam = &gUnknown_0860B064; + uns_builder_assign_animtable1(isTrainer); + gUnknown_0203CCEC.images = images; + gUnknown_0203CCEC.affineAnims = gDummySpriteAffineAnimTable; + gUnknown_0203CCEC.callback = nullsub_122; + sub_818D0C4(species, otId, personality, paletteSlot, paletteTag, isTrainer); + spriteId = CreateSprite(&gUnknown_0203CCEC, x, y, 0); + if (paletteTag == 0xFFFF) + { + gSprites[spriteId].oam.paletteNum = paletteSlot; + } + gUnknown_0203CD04[i].frames = framePics; + gUnknown_0203CD04[i].images = images; + gUnknown_0203CD04[i].paletteTag = paletteTag; + gUnknown_0203CD04[i].spriteId = spriteId; + gUnknown_0203CD04[i].active = TRUE; + return spriteId; +} + +static u16 sub_818D384(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag, bool8 isTrainer) +{ + return oamt_spawn_poke_or_trainer_picture(species, otId, personality, isFrontPic, x, y, paletteSlot, paletteTag, isTrainer, FALSE); +} + +u16 sub_818D3E4(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y, u8 paletteSlot, u16 paletteTag) +{ + u8 *framePics; + struct SpriteFrameImage *images; + int j; + u8 i; + u8 spriteId; + u8 flags2; + + for (i = 0; i < 8; i ++) + { + if (!gUnknown_0203CD04[i].active) + { + break; + } + } + if (i == 8) + { + return 0xFFFF; + } + framePics = Alloc(4 * 0x800); + if (!framePics) + { + return 0xFFFF; + } + if (flags & 0x80) + { + flags &= 0x7F; + flags2 = 3; + } + else + { + flags2 = flags; + } + images = Alloc(4 * sizeof(struct SpriteFrameImage)); + if (!images) + { + Free(framePics); + return 0xFFFF; + } + if (load_pokemon_image_TODO(species, personality, flags, framePics, FALSE, FALSE)) + { + // debug trap? + return 0xFFFF; + } + for (j = 0; j < 4; j ++) + { + images[j].data = framePics + 0x800 * j; + images[j].size = 0x800; + } + gUnknown_0203CCEC.tileTag = 0xFFFF; + gUnknown_0203CCEC.anims = gUnknown_08309AAC[species]; + gUnknown_0203CCEC.images = images; + if (flags2 == 0x01) + { + gUnknown_0203CCEC.affineAnims = gUnknown_082FF694; + gUnknown_0203CCEC.oam = &gUnknown_0860B06C; + } + else if (flags2 == 0x00) + { + gUnknown_0203CCEC.affineAnims = gUnknown_082FF618; + gUnknown_0203CCEC.oam = &gUnknown_0860B06C; + } + else + { + gUnknown_0203CCEC.oam = &gUnknown_0860B064; + gUnknown_0203CCEC.affineAnims = gDummySpriteAffineAnimTable; + } + gUnknown_0203CCEC.callback = nullsub_122; + sub_818D0C4(species, otId, personality, paletteSlot, paletteTag, FALSE); + spriteId = CreateSprite(&gUnknown_0203CCEC, x, y, 0); + if (paletteTag == 0xFFFF) + { + gSprites[spriteId].oam.paletteNum = paletteSlot; + } + gUnknown_0203CD04[i].frames = framePics; + gUnknown_0203CD04[i].images = images; + gUnknown_0203CD04[i].paletteTag = paletteTag; + gUnknown_0203CD04[i].spriteId = spriteId; + gUnknown_0203CD04[i].active = TRUE; + return spriteId; +} + +static u16 sub_818D5B0(u16 spriteId) +{ + u8 i; + u8 *framePics; + struct SpriteFrameImage *images; + + for (i = 0; i < 8; i ++) + { + if (gUnknown_0203CD04[i].spriteId == spriteId) + { + break; + } + } + if (i == 8) + { + return 0xFFFF; + } + framePics = gUnknown_0203CD04[i].frames; + images = gUnknown_0203CD04[i].images; + if (gUnknown_0203CD04[i].paletteTag != 0xFFFF) + { + FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(gSprites[spriteId].oam.paletteNum)); + } + DestroySprite(&gSprites[spriteId]); + Free(framePics); + Free(images); + gUnknown_0203CD04[i] = gUnknown_0860B058; + return 0; +} + +static u16 sub_818D65C(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u8 paletteSlot, u8 windowId, bool8 isTrainer) +{ + if (sub_818D09C(species, personality, isFrontPic, (u8 *)GetWindowAttribute(windowId, WINDOW_TILE_DATA), FALSE)) + { + return 0xFFFF; + } + sub_818D180(species, otId, personality, paletteSlot, isTrainer); + return 0; +} + +static u16 sub_818D6CC(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u16 destX, u16 destY, u8 paletteSlot, u8 windowId, bool8 isTrainer) +{ + u8 *framePics; + + framePics = Alloc(4 * 0x800); + if (framePics && !sub_818D09C(species, personality, isFrontPic, framePics, isTrainer)) + { + BlitBitmapRectToWindow(windowId, framePics, 0, 0, 0x40, 0x40, destX, destY, 0x40, 0x40); + sub_818D180(species, otId, personality, paletteSlot, isTrainer); + Free(framePics); + return 0; + } + return 0xFFFF; +} + +static u16 sub_818D778(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag, bool8 ignoreDeoxys) +{ + return oamt_spawn_poke_or_trainer_picture(species, otId, personality, isFrontPic, x, y, paletteSlot, paletteTag, FALSE, ignoreDeoxys); +} + +u16 sub_818D7D8(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag) +{ + return sub_818D778(species, otId, personality, isFrontPic, x, y, paletteSlot, paletteTag, FALSE); +} + +u16 sub_818D820(u16 spriteId) +{ + return sub_818D5B0(spriteId); +} + +u16 sub_818D834(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u8 paletteSlot, u8 windowId) +{ + return sub_818D65C(species, otId, personality, isFrontPic, paletteSlot, windowId, FALSE); +} + +u16 sub_818D864(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u16 destX, u16 destY, u8 paletteSlot, u8 windowId) +{ + return sub_818D6CC(species, otId, personality, isFrontPic, destX, destY, paletteSlot, windowId, FALSE); +} + +u16 sub_818D8AC(u16 species, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag) +{ + return sub_818D384(species, 0, 0, isFrontPic, x, y, paletteSlot, paletteTag, TRUE); +} + +u16 sub_818D8F0(u16 spriteId) +{ + return sub_818D5B0(spriteId); +} + +u16 sub_818D904(u16 species, bool8 isFrontPic, u8 paletteSlot, u8 windowId) +{ + return sub_818D65C(species, 0, 0, isFrontPic, paletteSlot, windowId, TRUE); +} + +u16 sub_818D938(u16 species, bool8 isFrontPic, u16 destX, u16 destY, u8 paletteSlot, u8 windowId) +{ + return sub_818D6CC(species, 0, 0, isFrontPic, destX, destY, paletteSlot, windowId, TRUE); +} + +u8 sub_818D97C(u8 a0, u8 a1) +{ + if (a1 == 1) + { + switch (a0) + { + default: + return gUnknown_0831F578[0x3F]; + case 0: + return gUnknown_0831F578[0x3C]; + } + } + return a0; +} diff --git a/sym_ewram.txt b/sym_ewram.txt index 1995bf7bf..9f3d81418 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -1762,11 +1762,7 @@ gUnknown_0203CCDC: @ 203CCDC gUnknown_0203CCE8: @ 203CCE8 .space 0x4 -gUnknown_0203CCEC: @ 203CCEC - .space 0x18 - -gUnknown_0203CD04: @ 203CD04 - .space 0x60 + .include "src/battle_dome_cards.o" gUnknown_0203CD64: @ 203CD64 .space 0x4