From 16b0b386be02390ab847a68b279f51aea54c3a95 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 18 Sep 2017 21:28:28 -0400 Subject: [PATCH] sub_818D180 --- asm/battle_dome_cards.s | 33 --------------------------------- src/battle_dome_cards.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/asm/battle_dome_cards.s b/asm/battle_dome_cards.s index 1e0db8e71..774872c65 100644 --- a/asm/battle_dome_cards.s +++ b/asm/battle_dome_cards.s @@ -6,39 +6,6 @@ .text - 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} diff --git a/src/battle_dome_cards.c b/src/battle_dome_cards.c index 085afeb0c..810ee82eb 100644 --- a/src/battle_dome_cards.c +++ b/src/battle_dome_cards.c @@ -122,3 +122,15 @@ void sub_818D0C4(u16 species, u32 otId, u32 personality, u8 paletteSlot, u16 pal } } } + +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); + } +}