diff --git a/.gitignore b/.gitignore index 3c861e01a..e9d2d99ec 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ src/*.s tools/* *.map *.ld +*.sa* diff --git a/asm/battle_814AEAC.s b/asm/battle_814AEAC.s index 5f18788e5..2474ba2eb 100644 --- a/asm/battle_814AEAC.s +++ b/asm/battle_814AEAC.s @@ -5119,7 +5119,7 @@ _0814DC06: lsls r2, 1 adds r1, r4, r2 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r2, =gUnknown_02020630 ldr r1, =gUnknown_020241E4 ldr r5, =gUnknown_02024064 @@ -5625,7 +5625,7 @@ sub_814E040: @ 814E040 movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 - bl sub_80A2390 + bl BeginFastPaletteFade bl dp01_tbl4_exec_completed ldr r1, =gUnknown_03005D60 ldrb r0, [r5] diff --git a/asm/battle_anim_80FE840.s b/asm/battle_anim_80FE840.s index 04b560698..53a1a830e 100644 --- a/asm/battle_anim_80FE840.s +++ b/asm/battle_anim_80FE840.s @@ -4012,7 +4012,7 @@ _0810081C: adds r1, r4 ldrh r3, [r1] movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette ldrh r0, [r5, 0x20] ldrb r2, [r5, 0x1C] movs r3, 0x1E @@ -4021,7 +4021,7 @@ _0810081C: adds r1, r4 ldrh r3, [r1] movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette ldrh r0, [r5, 0x1C] adds r0, 0x1 strh r0, [r5, 0x1C] @@ -4977,7 +4977,7 @@ sub_8100FD4: @ 8100FD4 ble _08101032 movs r0, 0 strh r0, [r4, 0x30] - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded movs r2, 0x32 ldrsh r0, [r4, r2] adds r0, 0x1 @@ -5955,7 +5955,7 @@ _081017A4: lsls r1, 24 lsrs r1, 24 ldr r2, =0x00007fff - bl sub_80A2A20 + bl BlendPalettes movs r3, 0x30 ldrsh r0, [r4, r3] cmp r0, 0x10 @@ -5966,14 +5966,14 @@ _081017A4: ldrb r1, [r4, 0x5] lsrs r1, 4 lsls r0, r1, 5 - ldr r2, =gUnknown_02037924 + ldr r2, =gPlttBufferUnfaded + 0x210 adds r0, r2 lsls r1, 4 ldr r3, =0x00000101 adds r2, r3, 0 orrs r1, r2 movs r2, 0x4 - bl gpu_pal_apply + bl LoadPalette movs r0, 0x3F bl sub_80A5178 adds r1, r0, 0 @@ -7820,7 +7820,7 @@ sub_81025C0: @ 81025C0 movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =sub_81026A8 str r1, [r6] adds r0, r7, 0 @@ -7938,7 +7938,7 @@ _0810274C: cmp r0, 0 beq _08102778 movs r1, 0x1 - ldr r2, =gUnknown_02037B14 + ldr r2, =gPlttBufferFaded _08102764: adds r0, r3, r1 lsls r0, 1 @@ -7962,7 +7962,7 @@ _08102778: b _08102832 .pool _08102794: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -8019,7 +8019,7 @@ _081027EC: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _08102814: ldrh r0, [r4, 0x8] adds r0, 0x1 @@ -8027,7 +8027,7 @@ _08102814: b _08102832 .pool _08102820: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -8265,7 +8265,7 @@ sub_81029B4: @ 81029B4 adds r0, 0x10 lsls r4, r0, 4 movs r5, 0x1 - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded _08102A0C: adds r1, r3, r5 lsls r1, 1 @@ -8284,7 +8284,7 @@ _08102A0C: movs r1, 0x10 movs r2, 0xB movs r3, 0 - bl pal_fade_1 + bl BlendPalette movs r0, 0 strh r0, [r6, 0xE] movs r5, 0 @@ -8513,7 +8513,7 @@ sub_8102BE8: @ 8102BE8 adds r0, r1 lsrs r3, r0, 16 movs r2, 0x1 - ldr r5, =gUnknown_02037B14 + ldr r5, =gPlttBufferFaded _08102C14: adds r1, r3, r2 lsls r1, 1 @@ -8551,7 +8551,7 @@ _08102C32: adds r0, r1 lsrs r3, r0, 16 movs r2, 0x1 - ldr r7, =gUnknown_02037B14 + ldr r7, =gPlttBufferFaded ldr r6, =gUnknown_08593020 adds r4, r5, 0 _08102C60: @@ -10998,7 +10998,7 @@ sub_8104018: @ 8104018 movs r0, 0 strh r0, [r4, 0x30] ldrh r5, [r4, 0x2E] - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded adds r0, r5, 0 adds r0, 0x8 lsls r0, 1 @@ -13560,7 +13560,7 @@ sub_81054E8: @ 81054E8 ldrb r2, [r1, 0xA] ldrh r3, [r1, 0x8] movs r1, 0xF - bl pal_fade_1 + bl BlendPalette _0810550E: adds r0, r4, 0 movs r1, 0x1 @@ -14588,7 +14588,7 @@ _08105D00: adds r1, r2 lsrs r1, 16 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette adds r4, 0x1 cmp r4, 0x2 ble _08105D00 @@ -14899,7 +14899,7 @@ sub_8105F84: @ 8105F84 bl sub_80A75AC ldr r2, =0x00007fff movs r1, 0x10 - bl sub_80A2A20 + bl BlendPalettes b _0810600C .pool _08105FD8: @@ -15333,7 +15333,7 @@ _0810632A: ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -15592,7 +15592,7 @@ _081065A6: ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -17568,7 +17568,7 @@ sub_810756C: @ 810756C adds r0, 0x1 lsls r0, 16 lsrs r5, r0, 16 - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded lsls r0, r5, 1 adds r0, r1 ldrh r6, [r0] @@ -18111,7 +18111,7 @@ _081079EA: ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette b _08107A32 .pool _08107A24: @@ -18120,7 +18120,7 @@ _08107A24: ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette _08107A32: ldr r0, =sub_8107D58 ldr r4, =gTasks @@ -18292,7 +18292,7 @@ sub_8107B84: @ 8107B84 asrs r0, 16 cmp r0, 0x4 bne _08107C18 - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded mov r0, sp ldrb r0, [r0, 0x8] lsls r0, 4 @@ -22930,7 +22930,7 @@ sub_810A060: @ 810A060 ldrb r2, [r1] ldrh r3, [r1, 0x2] movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette adds r0, r4, 0 bl move_anim_task_del add sp, 0x10 @@ -26978,7 +26978,7 @@ _0810C0E2: ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -27260,7 +27260,7 @@ _0810C366: ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -30627,7 +30627,7 @@ sub_810DF18: @ 810DF18 movs r0, 0 strh r0, [r3, 0x1C] ldrb r0, [r3, 0xC] - ldr r2, =gUnknown_02037B14 + ldr r2, =gPlttBufferFaded lsls r0, 4 movs r3, 0x84 lsls r3, 1 @@ -33300,7 +33300,7 @@ sub_810F400: @ 810F400 movs r0, 0 strh r0, [r3, 0x30] ldrh r4, [r3, 0x2E] - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded adds r0, r4, 0 adds r0, 0x8 lsls r0, 1 @@ -36248,7 +36248,7 @@ _08110C10: ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_0203841E movs r1, 0 ldrsh r0, [r0, r1] @@ -38663,12 +38663,12 @@ _08111FD0: movs r2, 0x10 ldrsh r0, [r5, r2] lsls r0, 1 - ldr r1, =gUnknown_02037714 + ldr r1, =gPlttBufferUnfaded adds r0, r1 movs r2, 0x24 ldrsh r1, [r5, r2] lsls r1, 1 - ldr r2, =gUnknown_02037B14 + ldr r2, =gPlttBufferFaded adds r1, r2 ldr r2, =0x04000008 bl CpuSet @@ -38676,7 +38676,7 @@ _08111FD0: ldr r3, =0x00003c0d movs r1, 0x10 movs r2, 0xA - bl pal_fade_1 + bl BlendPalette b _081120C6 .pool _08112014: @@ -38910,7 +38910,7 @@ _081121DC: ldr r3, =0x00003c0d movs r1, 0x10 movs r2, 0 - bl pal_fade_1 + bl BlendPalette b _08112258 .pool _081121F0: @@ -39788,7 +39788,7 @@ _08112938: movs r1, 0 movs r2, 0x10 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_8112994 str r0, [r4] _08112966: @@ -39817,7 +39817,7 @@ sub_8112994: @ 8112994 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -42105,7 +42105,7 @@ _08113C1E: lsls r1, 4 movs r0, 0 movs r2, 0x20 - bl rboxid_80040B8 + bl FillPalette ldr r0, =0x04000016 str r0, [sp] movs r7, 0x2 @@ -42126,7 +42126,7 @@ _08113C80: movs r0, 0 movs r1, 0x90 movs r2, 0x20 - bl rboxid_80040B8 + bl FillPalette ldr r0, =0x0400001a str r0, [sp] movs r7, 0x4 @@ -42443,7 +42443,7 @@ _08113F40: lsls r1, 4 movs r0, 0 movs r2, 0x20 - bl rboxid_80040B8 + bl FillPalette b _08113F78 .pool _08113F68: @@ -42453,7 +42453,7 @@ _08113F68: movs r0, 0 movs r1, 0x90 movs r2, 0x20 - bl rboxid_80040B8 + bl FillPalette _08113F78: movs r0, 0x3 bl sub_8114374 @@ -43311,7 +43311,7 @@ _0811465C: ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r2, =gUnknown_02022E18 ldr r0, =gUnknown_02020630 lsls r1, r4, 4 @@ -43346,7 +43346,7 @@ _08114708: ldrh r3, [r2, 0x4] movs r1, 0x10 movs r2, 0xB - bl pal_fade_1 + bl BlendPalette _08114714: ldr r1, =gTasks lsls r0, r7, 2 @@ -45425,7 +45425,7 @@ sub_81157FC: @ 81157FC ldrb r3, [r4, 0x6] ldrh r4, [r4, 0x8] str r4, [sp] - bl pal_fade_maybe + bl BeginNormalPaletteFade adds r2, r5, 0 adds r2, 0x3E ldrb r0, [r2] @@ -45484,7 +45484,7 @@ sub_811583C: @ 811583C sub_8115884: @ 8115884 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -45523,7 +45523,7 @@ sub_81158A4: @ 81158A4 bl sub_811583C ldrb r1, [r4, 0x8] ldrh r2, [r4, 0x6] - bl sub_80A2A20 + bl BlendPalettes adds r2, r5, 0 adds r2, 0x3E ldrb r0, [r2] @@ -45551,7 +45551,7 @@ sub_81158F8: @ 81158F8 strh r0, [r4, 0x2E] b _0811597C _0811590C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -45581,7 +45581,7 @@ _08115930: lsrs r1, 24 ldrh r2, [r4, 0x34] adds r0, r3, 0 - bl sub_80A2A20 + bl BlendPalettes b _08115964 _08115956: ldrh r1, [r4, 0x3A] @@ -45589,7 +45589,7 @@ _08115956: lsrs r1, 24 ldrh r2, [r4, 0x38] adds r0, r3, 0 - bl sub_80A2A20 + bl BlendPalettes _08115964: ldrh r0, [r4, 0x30] movs r2, 0x80 @@ -45613,7 +45613,7 @@ _0811597C: sub_8115984: @ 8115984 push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -45624,7 +45624,7 @@ sub_8115984: @ 8115984 bl sub_811583C movs r1, 0 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes adds r0, r4, 0 bl move_anim_8072740 _081159AA: @@ -45734,7 +45734,7 @@ sub_8115A54: @ 8115A54 str r2, [sp] adds r2, r5, 0 adds r3, r6, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r4, 0xC] subs r0, 0x1 strh r0, [r4, 0xC] @@ -45755,7 +45755,7 @@ sub_8115AA4: @ 8115AA4 lsls r0, 24 lsrs r3, r0, 24 adds r4, r3, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -45920,7 +45920,7 @@ sub_8115BC8: @ 8115BC8 ldrh r2, [r4, 0x12] str r2, [sp] adds r2, r5, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r4, 0xC] subs r0, 0x1 strh r0, [r4, 0xC] @@ -45941,7 +45941,7 @@ sub_8115C18: @ 8115C18 lsls r0, 24 lsrs r3, r0, 24 adds r4, r3, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -46059,7 +46059,7 @@ sub_8115CD0: @ 8115CD0 adds r0, r2, 0 adds r2, r5, 0 adds r3, r6, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r4, 0xC] subs r0, 0x1 strh r0, [r4, 0xC] @@ -46080,7 +46080,7 @@ sub_8115D2C: @ 8115D2C lsls r0, 24 lsrs r3, r0, 24 adds r4, r3, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -46171,7 +46171,7 @@ sub_8115D94: @ 8115D94 adds r0, r1, 0 movs r1, 0 adds r2, r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_8115E00 str r0, [r4] add sp, 0x4 @@ -46202,7 +46202,7 @@ sub_8115E00: @ 8115E00 b _08115EAC .pool _08115E28: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -46236,7 +46236,7 @@ _08115E4C: adds r0, r2, 0 movs r1, 0 adds r2, r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _08115E8A _08115E7A: ldrb r3, [r4, 0x14] @@ -46245,7 +46245,7 @@ _08115E7A: adds r0, r2, 0 movs r1, 0 adds r2, r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _08115E8A: ldr r0, =gTasks lsls r1, r5, 2 @@ -46278,7 +46278,7 @@ sub_8115EB8: @ 8115EB8 sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -46303,7 +46303,7 @@ sub_8115EB8: @ 8115EB8 movs r1, 0 movs r2, 0 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade adds r0, r4, 0 bl move_anim_task_del _08115EFE: @@ -46366,7 +46366,7 @@ _08115F5C: orrs r2, r0 _08115F6E: adds r0, r2, 0 - bl sub_80A2218 + bl InvertPlttBuffer mov r0, r8 bl move_anim_task_del add sp, 0xC @@ -46485,7 +46485,7 @@ _08116050: movs r3, 0x16 ldrsb r3, [r4, r3] adds r0, r5, 0 - bl sub_80A2260 + bl TintPlttBuffer movs r2, 0x8 ldrsh r1, [r4, r2] movs r2, 0xA @@ -46493,7 +46493,7 @@ _08116050: cmp r1, r0 bne _0811607A adds r0, r5, 0 - bl sub_80A2334 + bl UnfadePlttBuffer mov r0, r8 bl move_anim_task_del _0811607A: @@ -47512,7 +47512,7 @@ _081168F8: ldrh r3, [r5, 0x12] adds r0, r6, 0 movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette _0811690C: adds r0, r6, 0 adds r0, 0x10 @@ -47575,7 +47575,7 @@ sub_8116960: @ 8116960 ldrb r3, [r4, 0x6] ldrb r4, [r4, 0x8] str r4, [sp] - bl sub_80A27B0 + bl BeginHardwarePaletteFade ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -47595,7 +47595,7 @@ sub_81169A0: @ 81169A0 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -47983,7 +47983,7 @@ _08116CAC: lsls r1, 4 adds r1, 0x1 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldr r2, =gUnknown_02022E18 ldr r0, =gUnknown_02020630 lsls r1, r4, 4 @@ -48514,7 +48514,7 @@ _081171E6: ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette b _08117206 .pool _081171F8: @@ -48523,7 +48523,7 @@ _081171F8: ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette _08117206: ldr r3, =gUnknown_02022E18 movs r2, 0 @@ -48940,7 +48940,7 @@ _08117560: ldrb r2, [r4, 0xC] movs r1, 0x10 ldr r3, =0x0000ffff - bl pal_fade_1 + bl BlendPalette _0811757A: movs r1, 0x24 ldrsh r0, [r4, r1] @@ -48956,7 +48956,7 @@ _0811757A: ldrb r2, [r4, 0xC] movs r1, 0x10 movs r3, 0 - bl pal_fade_1 + bl BlendPalette _0811759A: adds r0, r5, 0x1 lsls r0, 16 @@ -49002,7 +49002,7 @@ _081175CE: adds r0, 0x10 cmp r2, r0 bge _081175FA - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded adds r3, r0, 0 _081175EA: lsls r0, r2, 1 @@ -49484,7 +49484,7 @@ _081179CC: lsls r1, 4 ldr r0, [sp, 0x5C] movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_02022E18 movs r1, 0 strh r1, [r0] @@ -49866,7 +49866,7 @@ _08117CFC: lsls r0, 5 adds r0, r1 lsls r1, r4, 5 - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded adds r1, r2 movs r2, 0x20 bl memcpy @@ -49930,7 +49930,7 @@ _08117D92: adds r4, 0x10 _08117D98: lsls r0, r4, 5 - ldr r1, =gUnknown_02037714 + ldr r1, =gPlttBufferUnfaded adds r0, r1 ldr r1, =gUnknown_020244D4 ldr r2, [r1] @@ -50005,9 +50005,9 @@ _08117E2E: adds r4, 0x10 _08117E34: lsls r1, r4, 5 - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded adds r0, r1, r0 - ldr r2, =gUnknown_02037B14 + ldr r2, =gPlttBufferFaded adds r1, r2 movs r2, 0x20 bl memcpy diff --git a/asm/battle_message.s b/asm/battle_message.s index 149ad531a..78fea08e5 100644 --- a/asm/battle_message.s +++ b/asm/battle_message.s @@ -3010,7 +3010,7 @@ sub_814FBAC: @ 814FBAC ldrb r1, [r1] bl sub_814FC20 lsls r0, 24 - ldr r5, =gUnknown_02037714 + ldr r5, =gPlttBufferUnfaded lsrs r0, 22 adds r0, r4 ldrh r1, [r0] @@ -3020,7 +3020,7 @@ sub_814FBAC: @ 814FBAC ldrh r0, [r0, 0x2] adds r5, 0xB6 strh r0, [r5] - ldr r4, =gUnknown_02037BCC + ldr r4, =gPlttBufferFaded + 0xB8 adds r0, r2, 0 adds r1, r4, 0 movs r2, 0x1 diff --git a/asm/battle_setup.s b/asm/battle_setup.s index 29a1dee6f..e14954e63 100644 --- a/asm/battle_setup.s +++ b/asm/battle_setup.s @@ -1373,7 +1373,7 @@ sub_80B1158: @ 80B1158 thumb_func_start sub_80B11A8 sub_80B11A8: @ 80B11A8 push {lr} - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl RunTasks bl sub_8145F20 lsls r0, 24 diff --git a/asm/battle_transition.s b/asm/battle_transition.s index 9d11fd99d..df940ef66 100644 --- a/asm/battle_transition.s +++ b/asm/battle_transition.s @@ -124,8 +124,8 @@ sub_8145FE0: @ 8145FE0 push {r4,lr} adds r4, r0, 0 bl sub_80AC3D0 - ldr r0, =gUnknown_02037B14 - ldr r1, =gUnknown_02037714 + ldr r0, =gPlttBufferFaded + ldr r1, =gPlttBufferUnfaded ldr r2, =0x04000100 bl CpuSet ldr r1, =gUnknown_085C8948 @@ -356,7 +356,7 @@ _0814618E: adds r0, r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _081461B0: ldrh r1, [r4, 0xC] movs r0, 0xF @@ -383,7 +383,7 @@ _081461CE: thumb_func_start sub_81461D8 sub_81461D8: @ 81461D8 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -443,7 +443,7 @@ sub_814623C: @ 814623C movs r1, 0x4 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_020393A8 ldr r1, =gUnknown_0203ABA0 ldr r1, [r1] @@ -501,7 +501,7 @@ sub_81462A8: @ 81462A8 adds r0, r3, 0 movs r3, 0x2 bl sub_8149F98 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -614,7 +614,7 @@ sub_81463BC: @ 81463BC movs r1, 0x4 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_0203ABA0 ldr r1, [r0] ldr r0, =gUnknown_020393A8 @@ -684,7 +684,7 @@ _08146448: lsrs r4, r0, 16 cmp r5, 0x9F bls _08146448 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1023,7 +1023,7 @@ sub_814670C: @ 814670C ldr r0, =gUnknown_085BAEB0 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -1059,7 +1059,7 @@ sub_8146760: @ 8146760 ldr r0, =gUnknown_085BAEB0 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -1129,7 +1129,7 @@ sub_8146800: @ 8146800 ldr r0, =gFieldEffectObjectPalette10 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -1291,7 +1291,7 @@ sub_8146974: @ 8146974 ldr r0, =gUnknown_085BC2B4 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085BC314 ldr r1, [sp, 0x8] movs r2, 0xA0 @@ -1330,7 +1330,7 @@ sub_81469CC: @ 81469CC ldr r0, =gUnknown_085BC2D4 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085BCB14 ldr r1, [sp, 0x8] movs r2, 0xA0 @@ -1369,7 +1369,7 @@ sub_8146A24: @ 8146A24 ldr r0, =gUnknown_085BC2F4 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085BD314 ldr r1, [sp, 0x8] movs r2, 0xA0 @@ -1454,7 +1454,7 @@ sub_8146AC8: @ 8146AC8 adds r0, r1 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _08146B00: ldrh r0, [r4, 0xA] adds r0, 0x1 @@ -1497,7 +1497,7 @@ sub_8146B24: @ 8146B24 adds r0, r1 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _08146B52: ldrh r0, [r4, 0xA] adds r0, 0x1 @@ -1532,7 +1532,7 @@ sub_8146B7C: @ 8146B7C movs r1, 0x1 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -1548,7 +1548,7 @@ sub_8146B7C: @ 8146B7C sub_8146BA8: @ 8146BA8 push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1811,7 +1811,7 @@ sub_8146DAC: @ 8146DAC movs r1, 0x1 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -1827,7 +1827,7 @@ sub_8146DAC: @ 8146DAC sub_8146DD8: @ 8146DD8 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2066,7 +2066,7 @@ sub_8146FCC: @ 8146FCC ldr r0, =gFieldEffectObjectPalette10 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -3077,13 +3077,13 @@ _081477E8: movs r2, 0 str r2, [sp] movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _08147838: movs r5, 0x10 ldrsh r0, [r6, r5] cmp r0, 0 beq _0814785A - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3573,7 +3573,7 @@ sub_8147C24: @ 8147C24 ldr r0, [r0] movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_085C8FF0 ldr r0, =gUnknown_03005D90 ldr r0, [r0] @@ -3583,7 +3583,7 @@ sub_8147C24: @ 8147C24 ldr r0, [r0] movs r1, 0xFA movs r2, 0xC - bl gpu_pal_apply + bl LoadPalette movs r1, 0 ldr r5, [sp] movs r0, 0xF0 @@ -4050,7 +4050,7 @@ sub_8148008: @ 8148008 negs r0, r0 ldr r2, =0x00007fff movs r1, 0x10 - bl sub_80A2A20 + bl BlendPalettes ldr r1, [r5] movs r0, 0xFF strh r0, [r1, 0xE] @@ -5828,7 +5828,7 @@ sub_8148E8C: @ 8148E8C ldr r0, =gFieldEffectObjectPalette10 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r1, 0 movs r4, 0x1 movs r0, 0x1 @@ -6222,7 +6222,7 @@ sub_81491C8: @ 81491C8 adds r0, r1 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _08149200: ldrh r0, [r4, 0xA] adds r0, 0x1 @@ -6265,7 +6265,7 @@ sub_8149224: @ 8149224 adds r0, r1 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _08149252: ldrh r0, [r4, 0xA] adds r0, 0x1 @@ -6352,7 +6352,7 @@ sub_81492B4: @ 81492B4 ldr r0, =gUnknown_085BF540 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r2, 0 ldr r3, =gUnknown_02038C28 movs r6, 0 @@ -6429,7 +6429,7 @@ _081493A0: adds r0, r1 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _081493B4: ldrh r0, [r4, 0xA] adds r0, 0x1 @@ -6472,7 +6472,7 @@ sub_81493D8: @ 81493D8 str r2, [sp] movs r1, 0x2 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _08149402: movs r0, 0 add sp, 0x4 @@ -6485,7 +6485,7 @@ _08149402: sub_8149410: @ 8149410 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -6512,11 +6512,11 @@ sub_814943C: @ 814943C ldr r0, =0x00007fff movs r1, 0x8 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r0, =0xffff8000 movs r1, 0 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -6548,7 +6548,7 @@ sub_814946C: @ 814946C adds r0, r1 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _0814949A: ldrh r0, [r4, 0xA] adds r0, 0x1 @@ -6796,7 +6796,7 @@ sub_814969C: @ 814969C negs r0, r0 ldr r2, =0x00007fff movs r1, 0x10 - bl sub_80A2A20 + bl BlendPalettes ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -7158,7 +7158,7 @@ sub_8149994: @ 8149994 ldr r0, =gFieldEffectObjectPalette10 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -7741,7 +7741,7 @@ _08149E64: negs r0, r0 ldrb r1, [r4, 0x16] ldr r2, =0x00002d6b - bl sub_80A2A20 + bl BlendPalettes _08149E70: movs r2, 0x16 ldrsh r0, [r4, r2] @@ -7791,7 +7791,7 @@ _08149EBE: negs r0, r0 ldrb r1, [r4, 0x16] ldr r2, =0x00002d6b - bl sub_80A2A20 + bl BlendPalettes _08149ECA: movs r0, 0x16 ldrsh r1, [r4, r0] @@ -7845,7 +7845,7 @@ sub_8149F2C: @ 8149F2C push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_8149F2C @@ -7896,7 +7896,7 @@ sub_8149F84: @ 8149F84 negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes pop {r0} bx r0 thumb_func_end sub_8149F84 @@ -8414,7 +8414,7 @@ sub_814A324: @ 814A324 ldr r0, =gUnknown_085C7BE0 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -8566,7 +8566,7 @@ sub_814A42C: @ 814A42C ldr r0, =gUnknown_085C7BE0 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, [r6] strh r5, [r0, 0x16] ldrh r0, [r4, 0x8] @@ -8751,13 +8751,13 @@ _0814A5E4: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0814A632: movs r2, 0x10 ldrsh r0, [r4, r2] cmp r0, 0 beq _0814A654 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -8964,7 +8964,7 @@ sub_814A798: @ 814A798 ldr r0, =gUnknown_085C8578 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0 mov r1, r8 strh r6, [r1, 0xC] @@ -9077,9 +9077,9 @@ _0814A8CA: b _0814A92C _0814A8D4: movs r2, 0xFA - ldr r6, =gUnknown_02037714 + ldr r6, =gPlttBufferUnfaded movs r3, 0 - ldr r5, =gUnknown_02037B14 + ldr r5, =gPlttBufferFaded _0814A8DC: lsls r1, r2, 1 adds r0, r1, r6 @@ -9097,7 +9097,7 @@ _0814A8FC: ldr r0, =0xffff7fff movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r0, =gUnknown_085C86F4 b _0814A91E .pool @@ -9186,16 +9186,16 @@ sub_814A960: @ 814A960 adds r0, r4, 0 movs r1, 0xE0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette adds r0, r4, 0 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0xE0 movs r1, 0x10 movs r2, 0x8 movs r3, 0 - bl pal_fade_1 + bl BlendPalette movs r1, 0 movs r0, 0x22 mov r2, r8 @@ -9283,11 +9283,11 @@ sub_814AA84: @ 814AA84 movs r1, 0x10 movs r2, 0x3 movs r3, 0 - bl pal_fade_1 + bl BlendPalette ldr r0, =0xffff3fff movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes movs r0, 0 strh r0, [r4, 0xC] strh r0, [r4, 0xE] @@ -9432,7 +9432,7 @@ sub_814ABA0: @ 814ABA0 negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r0, [r4] bl FindTaskIdByFunc lsls r0, 24 @@ -9509,7 +9509,7 @@ sub_814AC38: @ 814AC38 ldr r0, =gUnknown_085C8578 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_02022E14 strh r5, [r0] ldr r4, =gUnknown_02022E16 @@ -9661,7 +9661,7 @@ sub_814ADB4: @ 814ADB4 ldr r0, =0xffff7fff movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes movs r0, 0 strh r0, [r4, 0xC] ldrh r0, [r4, 0x8] @@ -9754,7 +9754,7 @@ sub_814AE40: @ 814AE40 negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r0, [r5] bl FindTaskIdByFunc lsls r0, 24 diff --git a/asm/berry_blender.s b/asm/berry_blender.s index 3dcd0e3cb..ae0f4209a 100644 --- a/asm/berry_blender.s +++ b/asm/berry_blender.s @@ -72,7 +72,7 @@ sub_807F764: @ 807F764 bl SetBgAffine bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer add sp, 0x10 pop {r4} pop {r0} @@ -139,7 +139,7 @@ _0807F854: movs r2, 0x80 lsls r2, 1 movs r1, 0 - bl gpu_pal_apply + bl LoadPalette b _0807F962 .pool _0807F880: @@ -219,7 +219,7 @@ _0807F940: ldr r0, =gUnknown_083394F4 movs r1, 0x80 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _0807F962 .pool _0807F950: @@ -536,12 +536,12 @@ _0807FC38: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade bl sub_8082D28 b _0807FCA0 _0807FC4E: bl sub_807F9D0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -573,7 +573,7 @@ _0807FC90: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0807FCA0: ldr r0, =gUnknown_020322A4 ldr r1, [r0] @@ -584,7 +584,7 @@ _0807FCA4: b _0807FCE2 .pool _0807FCB0: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -608,7 +608,7 @@ _0807FCE2: bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0x4 pop {r4-r6} pop {r0} @@ -1141,11 +1141,11 @@ _0808019C: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _080804F8 _080801AE: bl sub_807F9D0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1582,7 +1582,7 @@ _08080546: bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0x4 pop {r4-r7} pop {r0} @@ -2161,7 +2161,7 @@ _08080A58: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r2, =gUnknown_020322A4 ldr r1, [r2] ldrb r0, [r1] @@ -2187,7 +2187,7 @@ _08080A84: bne _08080A9C bl sub_807F9D0 _08080A9C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2560,7 +2560,7 @@ _08080DAE: bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0x4 pop {r4-r7} pop {r0} @@ -3856,7 +3856,7 @@ _0808191A: bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r4-r6} pop {r0} bx r0 @@ -5306,7 +5306,7 @@ _0808249E: bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r3} mov r8, r3 pop {r4-r7} @@ -5688,13 +5688,13 @@ _08082828: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_020322A4 ldr r1, [r0] b _080828BC .pool _0808284C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -5776,7 +5776,7 @@ _080828DC: bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0x4 pop {r4-r6} pop {r0} @@ -5898,7 +5898,7 @@ _08082A00: .pool _08082A30: movs r0, 0x3 - bl sub_80A2390 + bl BeginFastPaletteFade ldr r0, =gUnknown_020322A4 ldr r1, [r0] adds r1, 0x63 @@ -5908,7 +5908,7 @@ _08082A30: b _08082A92 .pool _08082A48: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -5956,7 +5956,7 @@ _08082A92: bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r4-r6} pop {r0} bx r0 diff --git a/asm/berry_tag_screen.s b/asm/berry_tag_screen.s index 0314caa7c..d747c6e03 100644 --- a/asm/berry_tag_screen.s +++ b/asm/berry_tag_screen.s @@ -37,7 +37,7 @@ sub_8177C54: @ 8177C54 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_8177C54 @@ -47,7 +47,7 @@ sub_8177C70: @ 8177C70 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_8177C70 @@ -122,8 +122,8 @@ _08177D26: bl remove_some_task b _08177DDC _08177D2C: - bl sub_80A1A74 - ldr r2, =gUnknown_02037FD4 + bl ResetPaletteFade + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -185,7 +185,7 @@ _08177DB4: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes b _08177DDC _08177DC2: movs r0, 0x1 @@ -194,8 +194,8 @@ _08177DC2: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe - ldr r2, =gUnknown_02037FD4 + bl BeginNormalPaletteFade + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -393,7 +393,7 @@ _08177FA8: ldr r0, =gUnknown_08D9BEF0 movs r1, 0 movs r2, 0xC0 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_0203BCF4 ldr r1, [r0] ldr r0, =0x00001808 @@ -438,7 +438,7 @@ sub_8178008: @ 8178008 ldr r0, =gUnknown_085EFD00 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r4, 0 _08178020: lsls r0, r4, 24 @@ -1109,7 +1109,7 @@ sub_81785D0: @ 81785D0 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -1129,7 +1129,7 @@ sub_8178610: @ 8178610 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1158,7 +1158,7 @@ sub_8178654: @ 8178654 lsls r0, 24 lsrs r2, r0, 24 adds r4, r2, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/blend_palette.s b/asm/blend_palette.s deleted file mode 100644 index 9fa7ee4c3..000000000 --- a/asm/blend_palette.s +++ /dev/null @@ -1,90 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start pal_fade_1 -pal_fade_1: @ 806F98C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r1, 16 - mov r12, r1 - lsls r2, 24 - lsrs r7, r2, 24 - mov r0, sp - strh r3, [r0] - movs r6, 0 - cmp r6, r12 - bcs _0806FA12 - ldr r0, =gUnknown_02037714 - mov r10, r0 - ldr r1, =gUnknown_02037B14 - mov r9, r1 -_0806F9BA: - mov r0, r8 - adds r5, r6, r0 - lsls r5, 16 - lsrs r5, 15 - mov r1, r10 - adds r0, r5, r1 - ldr r3, [r0] - lsls r4, r3, 27 - lsls r2, r3, 22 - lsls r3, 17 - add r5, r9 - lsrs r4, 27 - ldr r1, [sp] - lsls r0, r1, 27 - lsrs r0, 27 - subs r0, r4 - muls r0, r7 - asrs r0, 4 - adds r4, r0 - lsrs r2, 27 - lsls r0, r1, 22 - lsrs r0, 27 - subs r0, r2 - muls r0, r7 - asrs r0, 4 - adds r2, r0 - lsls r2, 5 - orrs r4, r2 - lsrs r3, 27 - lsls r1, 17 - lsrs r1, 27 - subs r1, r3 - adds r0, r1, 0 - muls r0, r7 - asrs r0, 4 - adds r3, r0 - lsls r3, 10 - orrs r4, r3 - strh r4, [r5] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, r12 - bcc _0806F9BA -_0806FA12: - 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 pal_fade_1 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/cable_car.s b/asm/cable_car.s index 3ec687ebe..96f97f0ac 100644 --- a/asm/cable_car.s +++ b/asm/cable_car.s @@ -10,7 +10,7 @@ sub_814FC70: @ 814FC70 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -41,7 +41,7 @@ sub_814FC9C: @ 814FC9C str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade add sp, 0x4 pop {r0} bx r0 @@ -168,7 +168,7 @@ _0814FDD8: bl ResetAllObjectData bl ResetTasks bl ResetObjectPaletteAllocator - bl sub_80A1A74 + bl ResetPaletteFade bl reset_temp_tile_data_buffers bl sub_80AAFA4 movs r4, 0 @@ -300,7 +300,7 @@ _0814FF5C: ldr r0, =gUnknown_08DBA518 movs r1, 0 movs r2, 0x80 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_030022C0 movs r3, 0x87 lsls r3, 3 @@ -555,7 +555,7 @@ _08150190: movs r1, 0x3 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =0x000001a9 movs r1, 0x1 bl sub_80A3194 @@ -620,7 +620,7 @@ mainloop: @ 815023C bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl sound_something pop {r0} bx r0 @@ -665,7 +665,7 @@ _08150298: bls _08150298 bl ResetTasks bl ResetAllObjectData - bl sub_80A1A74 + bl ResetPaletteFade movs r0, 0 bl UnsetBgTilemapBuffer movs r0, 0x1 @@ -940,13 +940,13 @@ _081504EA: movs r1, 0x3 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x4 bl play_sound_effect b _08150542 .pool _08150510: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1341,7 +1341,7 @@ sub_8150800: @ 8150800 bl SetGpuReg bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r4} pop {r0} bx r0 diff --git a/asm/cable_club.s b/asm/cable_club.s index e6f3026dd..1e21e4029 100644 --- a/asm/cable_club.s +++ b/asm/cable_club.s @@ -1817,7 +1817,7 @@ _080B32F8: b _080B3346 .pool _080B3318: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1932,7 +1932,7 @@ _080B3408: b _080B3532 .pool _080B342C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2403,7 +2403,7 @@ _080B382E: bl sub_8009FAC b _080B3864 _080B3840: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2474,7 +2474,7 @@ _080B38C6: bl Rfu_set_zero b _080B38FC _080B38D8: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/clear_save_data_screen.s b/asm/clear_save_data_screen.s index 76c21278f..dce70330f 100644 --- a/asm/clear_save_data_screen.s +++ b/asm/clear_save_data_screen.s @@ -141,7 +141,7 @@ sub_817ADC0: @ 817ADC0 sub_817ADE4: @ 817ADE4 push {lr} bl RunTasks - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_817ADE4 @@ -149,7 +149,7 @@ sub_817ADE4: @ 817ADE4 thumb_func_start sub_817ADF4 sub_817ADF4: @ 817ADF4 push {lr} - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_817ADF4 @@ -236,11 +236,11 @@ _0817AE18: ldr r0, =0x810001ff str r0, [r1, 0x8] ldr r0, [r1, 0x8] - bl sub_80A1A74 - ldr r2, =gUnknown_02037714 + bl ResetPaletteFade + ldr r2, =gPlttBufferUnfaded ldr r0, =0x00007fff strh r0, [r2] - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded strh r0, [r1] ldr r0, =0x00003945 strh r0, [r2, 0x2] @@ -296,7 +296,7 @@ _0817AEEC: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x1 bl EnableInterrupts ldr r0, =sub_817ADF4 @@ -310,8 +310,8 @@ _0817AEEC: b _0817AFC8 .pool _0817AFA4: - bl fade_and_return_progress_probably - ldr r0, =gUnknown_02037FD4 + bl UpdatePaletteFade + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -350,14 +350,14 @@ _0817AFEA: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x1 strb r0, [r4] b _0817B020 .pool _0817B008: - bl fade_and_return_progress_probably - ldr r0, =gUnknown_02037FD4 + bl UpdatePaletteFade + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -390,7 +390,7 @@ sub_817B02C: @ 817B02C ldr r0, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r0} bx r0 .pool diff --git a/asm/contest.s b/asm/contest.s index fd6f47cb3..25cf1062d 100644 --- a/asm/contest.s +++ b/asm/contest.s @@ -97,7 +97,7 @@ sub_80D7724: @ 80D7724 movs r2, 0x80 lsls r2, 2 movs r1, 0 - bl decompress_palette + bl LoadCompressedPalette bl sub_80D782C movs r4, 0 movs r5, 0xA0 @@ -110,7 +110,7 @@ _080D775E: adds r1, 0x5 lsls r1, 4 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette adds r5, 0x20 adds r4, 0x1 cmp r4, 0x3 @@ -192,19 +192,19 @@ sub_80D782C: @ 80D782C ldr r0, =gUnknown_08587C30 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0 movs r1, 0 movs r2, 0x2 - bl rboxid_80040B8 + bl FillPalette movs r5, 0xA movs r4, 0xFA lsls r4, 16 _080D7848: lsrs r1, r4, 16 - ldr r0, =gUnknown_020378F6 + ldr r0, =gPlttBufferUnfaded + 0x1E2 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette movs r0, 0x80 lsls r0, 9 adds r4, r0 @@ -214,7 +214,7 @@ _080D7848: ldr r0, =0x00007e3f movs r1, 0xF3 movs r2, 0x2 - bl rboxid_80040B8 + bl FillPalette pop {r4,r5} pop {r0} bx r0 @@ -564,8 +564,8 @@ _080D7B4E: bl sub_80D77E4 bl sub_80D7678 bl dp12_8087EA4 - bl sub_80A1A74 - ldr r2, =gUnknown_02037FD4 + bl ResetPaletteFade + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -617,8 +617,8 @@ _080D7C04: ldr r0, =gUnknown_02022E1A strh r1, [r0] movs r0, 0x2 - bl sub_80A2390 - ldr r2, =gUnknown_02037FD4 + bl BeginFastPaletteFade + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -656,7 +656,7 @@ sub_80D7C7C: @ 80D7C7C push {lr} lsls r0, 24 lsrs r3, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -743,7 +743,7 @@ _080D7D28: adds r0, 0x1 strh r0, [r4, 0x8] _080D7D3A: - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r1, [r2, 0x7] movs r0, 0x80 ands r0, r1 @@ -891,7 +891,7 @@ _080D7E68: .4byte _080D7F7C .4byte _080D8004 _080D7E84: - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -990,8 +990,8 @@ _080D7F7C: movs r2, 0x80 lsls r2, 2 movs r1, 0 - bl decompress_palette - ldr r5, =gUnknown_02037814 + bl LoadCompressedPalette + ldr r5, =gPlttBufferUnfaded + 0x100 ldr r6, =0x04000008 adds r0, r5, 0 mov r1, sp @@ -1112,7 +1112,7 @@ sub_80D80C8: @ 80D80C8 push {lr} lsls r0, 24 lsrs r3, r0, 24 - ldr r1, =gUnknown_02037FD4 + ldr r1, =gPaletteFade ldrb r2, [r1, 0x8] movs r0, 0x7F ands r0, r2 @@ -1288,7 +1288,7 @@ sub_80D823C: @ 80D823C bl CallObjectCallbacks bl RunTasks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade movs r4, 0 _080D8250: ldr r5, =gUnknown_02039F38 @@ -1364,7 +1364,7 @@ vblank_cb_battle: @ 80D827C ldrh r1, [r0] movs r0, 0x46 bl SetGpuReg - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl LoadOamFromSprites bl ProcessObjectCopyRequests bl sub_80BA0A8 @@ -1392,7 +1392,7 @@ sub_80D833C: @ 80D833C ldr r0, =gUnknown_02022E1E strh r1, [r0] bl sub_80DCD48 - ldr r1, =gUnknown_02037714 + ldr r1, =gPlttBufferUnfaded ldr r2, =0x0201a204 ldr r0, =0x040000d4 str r1, [r0] @@ -2069,7 +2069,7 @@ _080D897C: ble _080D897C movs r0, 0 bl sub_80DED60 - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded ldr r0, =0x0201a604 movs r2, 0x80 lsls r2, 3 @@ -2085,7 +2085,7 @@ _080D897C: ldr r1, =0xfffffc00 adds r0, r1 movs r1, 0 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gTasks lsls r0, r7, 2 adds r0, r7 @@ -4171,7 +4171,7 @@ _080D9C3E: strh r0, [r4, 0x1C] b _080DA100 _080D9C46: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -4332,7 +4332,7 @@ _080D9D6C: b _080DA100 .pool _080D9D84: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -5013,7 +5013,7 @@ sub_80DA348: @ 80DA348 lsls r0, 24 lsrs r0, 24 ldr r2, =0x0201a204 - ldr r3, =gUnknown_02037714 + ldr r3, =gPlttBufferUnfaded ldr r1, =0x040000d4 str r2, [r1] str r3, [r1, 0x4] @@ -5495,7 +5495,7 @@ _080DA780: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_80DA830 _080DA792: str r0, [r4] @@ -5551,7 +5551,7 @@ sub_80DA7EC: @ 80DA7EC str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r2, =gTasks ldr r0, =gUnknown_02039F34 ldr r0, [r0] @@ -5574,7 +5574,7 @@ sub_80DA830: @ 80DA830 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -6656,7 +6656,7 @@ sub_80DB0C4: @ 80DB0C4 movs r1, 0x88 lsls r1, 1 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_08587BE8 movs r1, 0x70 movs r2, 0x24 @@ -6767,7 +6767,7 @@ _080DB1CC: movs r1, 0x90 lsls r1, 1 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette adds r0, r5, 0 movs r1, 0 bl sub_806A068 @@ -9472,7 +9472,7 @@ _080DC6DC: ldr r3, =0x00004bff movs r1, 0x2 movs r2, 0 - bl pal_fade_1 + bl BlendPalette adds r0, r6, 0 bl DestroyTask _080DC716: @@ -9567,7 +9567,7 @@ _080DC7AA: ldrb r2, [r1] movs r1, 0x2 ldr r3, =0x00004bff - bl pal_fade_1 + bl BlendPalette _080DC7CA: adds r0, r6, 0x1 lsls r0, 24 @@ -9670,9 +9670,9 @@ sub_80DC87C: @ 80DC87C bl sub_80DC81C adds r0, r4, 0x5 lsls r2, r0, 5 - ldr r3, =gUnknown_02037728 + ldr r3, =gPlttBufferUnfaded + 0x14 adds r6, r2, r3 - ldr r5, =gUnknown_02037B28 + ldr r5, =gPlttBufferFaded + 0x14 adds r2, r5 ldr r1, =0x040000d4 str r6, [r1] @@ -9790,14 +9790,14 @@ _080DC970: ldrb r2, [r5] movs r1, 0x1 mov r3, r10 - bl pal_fade_1 + bl BlendPalette adds r4, 0xC adds r4, r7 ldrb r2, [r5] adds r0, r4, 0 movs r1, 0x1 mov r3, r10 - bl pal_fade_1 + bl BlendPalette _080DC996: adds r0, r7, 0x1 lsls r0, 24 @@ -10647,7 +10647,7 @@ _080DD052: adds r1, 0x5 lsls r1, 4 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette adds r5, 0x20 adds r4, 0x1 cmp r4, 0x3 @@ -11893,7 +11893,7 @@ _080DDA98: ldrb r2, [r4, 0x10] ldr r3, =0x00007fff movs r1, 0x1 - bl pal_fade_1 + bl BlendPalette movs r1, 0x10 ldrsh r0, [r4, r1] cmp r0, 0 @@ -11922,7 +11922,7 @@ _080DDACA: movs r1, 0x1 movs r2, 0 movs r3, 0x1F - bl pal_fade_1 + bl BlendPalette adds r0, r5, 0 bl DestroyTask _080DDAFE: @@ -12522,12 +12522,12 @@ _080DDFB8: ldrh r3, [r4, 0x8] movs r0, 0x11 movs r1, 0x1 - bl pal_fade_1 + bl BlendPalette ldrb r2, [r4, 0xA] ldrh r3, [r4, 0x8] movs r0, 0x1A movs r1, 0x1 - bl pal_fade_1 + bl BlendPalette movs r2, 0xA ldrsh r1, [r4, r2] movs r2, 0xE diff --git a/asm/contest_link_80F57C4.s b/asm/contest_link_80F57C4.s index 7d74ea9a4..7a8141c6e 100644 --- a/asm/contest_link_80F57C4.s +++ b/asm/contest_link_80F57C4.s @@ -155,11 +155,11 @@ sub_80F591C: @ 80F591C movs r2, 0x80 lsls r2, 2 movs r1, 0 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_0858D6B0 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r7, 0 movs r0, 0x1 mov r8, r0 @@ -335,7 +335,7 @@ _080F5AE4: sub_80F5B00: @ 80F5B00 push {r4-r6,lr} sub sp, 0x4 - ldr r5, =gUnknown_02037FD4 + ldr r5, =gPaletteFade ldrb r0, [r5, 0x8] movs r6, 0x80 orrs r0, r6 @@ -345,7 +345,7 @@ sub_80F5B00: @ 80F5B00 bl sub_80F7DF4 bl sub_80F57C4 bl dp12_8087EA4 - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl ResetTasks bl ResetObjectPaletteAllocator @@ -374,7 +374,7 @@ sub_80F5B00: @ 80F5B00 str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrb r1, [r5, 0x8] movs r0, 0x7F ands r0, r1 @@ -429,7 +429,7 @@ sub_80F5C00: @ 80F5C00 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTasks - bl fade_and_return_progress_probably + bl UpdatePaletteFade movs r0, 0x1 bl CopyBgTilemapBufferToVram movs r0, 0x2 @@ -491,7 +491,7 @@ sub_80F5C24: @ 80F5C24 bl SetGpuReg bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl sub_80BA0A8 pop {r0} bx r0 @@ -624,7 +624,7 @@ _080F5E0A: movs r0, 0xDF lsls r0, 1 bl song_play_for_text - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -634,7 +634,7 @@ _080F5E0A: _080F5E2C: strh r0, [r4, 0x8] _080F5E2E: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1758,7 +1758,7 @@ _080F67E6: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl sub_80A27B0 + bl BeginHardwarePaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -1779,7 +1779,7 @@ sub_80F6820: @ 80F6820 lsls r0, 24 lsrs r2, r0, 24 adds r5, r2, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1809,7 +1809,7 @@ _080F6868: _080F686E: movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldrh r0, [r4, 0xA] adds r0, 0x1 strh r0, [r4, 0xA] @@ -1925,17 +1925,17 @@ _080F6944: ldr r3, =0x00002ede movs r0, 0x6B movs r1, 0x1 - bl pal_fade_1 + bl BlendPalette ldrb r2, [r4, 0xA] ldr r3, =0x00007fff movs r0, 0x68 movs r1, 0x1 - bl pal_fade_1 + bl BlendPalette ldrb r2, [r4, 0xA] ldr r3, =0x000077be movs r0, 0x6E movs r1, 0x1 - bl pal_fade_1 + bl BlendPalette _080F6972: ldr r1, =gTasks lsls r0, r5, 2 @@ -2103,7 +2103,7 @@ _080F6AA6: adds r0, r1 lsrs r1, r5, 16 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0x80 lsls r0, 13 adds r5, r0 @@ -3402,7 +3402,7 @@ sub_80F753C: @ 80F753C ldr r3, =0x00006f8d movs r0, 0x91 movs r1, 0x1 - bl pal_fade_1 + bl BlendPalette movs r1, 0x22 ldrsh r0, [r4, r1] cmp r0, 0 @@ -5176,7 +5176,7 @@ sub_80F83E0: @ 80F83E0 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -5206,7 +5206,7 @@ sub_80F840C: @ 80F840C str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade add sp, 0x4 pop {r0} bx r0 @@ -5232,7 +5232,7 @@ sub_80F8458: @ 80F8458 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -5262,7 +5262,7 @@ sub_80F8484: @ 80F8484 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade add sp, 0x4 pop {r0} bx r0 diff --git a/asm/contest_painting.s b/asm/contest_painting.s index 8f6a0f82f..d0c98eb01 100644 --- a/asm/contest_painting.s +++ b/asm/contest_painting.s @@ -46,7 +46,7 @@ sub_812FDF8: @ 812FDF8 push {lr} bl sub_812FFC8 bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_812FDF8 @@ -124,7 +124,7 @@ _0812FE94: b _0812FF3E .pool _0812FEC8: - bl sub_80A1A74 + bl ResetPaletteFade movs r2, 0xC0 lsls r2, 19 movs r3, 0xC0 @@ -193,7 +193,7 @@ _0812FF54: ldr r0, =gUnknown_085B0838 movs r1, 0 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette movs r1, 0xA0 lsls r1, 19 movs r4, 0 @@ -206,7 +206,7 @@ _0812FF54: str r1, [r0, 0x8] ldr r0, [r0, 0x8] movs r0, 0x2 - bl sub_80A2390 + bl BeginFastPaletteFade ldr r0, =sub_81302D0 bl SetVBlankCallback ldr r0, =gUnknown_030011F0 @@ -244,7 +244,7 @@ _0812FFE4: beq _0813005C b _08130082 _0812FFEA: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -282,7 +282,7 @@ _0813002E: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _08130040: ldr r0, =gUnknown_030011F6 ldrb r0, [r0] @@ -293,7 +293,7 @@ _08130040: b _08130080 .pool _0813005C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -554,7 +554,7 @@ sub_81302D0: @ 81302D0 bl sub_8130280 bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_81302D0 @@ -732,7 +732,7 @@ sub_8130430: @ 8130430 movs r2, 0x80 lsls r2, 1 movs r1, 0 - bl gpu_pal_apply + bl LoadPalette cmp r4, 0x1 beq _0813044E b _081305A4 @@ -1156,7 +1156,7 @@ _08130846: lsls r1, 1 movs r2, 0x80 lsls r2, 2 - bl gpu_pal_apply + bl LoadPalette pop {r4} pop {r0} bx r0 diff --git a/asm/decoration.s b/asm/decoration.s index 17ea507f4..f07946c25 100644 --- a/asm/decoration.s +++ b/asm/decoration.s @@ -240,7 +240,7 @@ sub_8126B80: @ 8126B80 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -504,7 +504,7 @@ sub_8126DCC: @ 8126DCC ldr r0, =gUnknown_085A6BB0 movs r1, 0xD0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0 movs r1, 0 bl sub_8197434 @@ -823,7 +823,7 @@ sub_8127088: @ 8127088 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1000,7 +1000,7 @@ sub_8127208: @ 8127208 ldr r0, =gUnknown_085A6BB0 movs r1, 0xD0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0 movs r1, 0 bl sub_8197434 @@ -1500,7 +1500,7 @@ sub_812764C: @ 812764C lsls r0, 3 ldr r1, =gTasks + 0x8 adds r5, r0, r1 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2738,7 +2738,7 @@ _08128088: beq _081280FC b _08128112 _0812808E: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2751,7 +2751,7 @@ _0812808E: b _08128112 .pool _081280AC: - ldr r4, =gUnknown_02037FD4 + ldr r4, =gPaletteFade ldrb r0, [r4, 0x8] movs r1, 0x80 orrs r0, r1 @@ -4133,7 +4133,7 @@ c1_overworld_prev_quest: @ 8128BEC .pool _08128C10: bl script_env_2_enable - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -5779,7 +5779,7 @@ _0812991E: strh r0, [r4, 0xC] b _08129994 _08129928: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -5977,7 +5977,7 @@ _08129AE4: beq _08129B1A b _08129B2E _08129AEA: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -6893,7 +6893,7 @@ sub_812A25C: @ 812A25C b _0812A2B2 .pool _0812A280: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/diploma.s b/asm/diploma.s index 815ac7ee5..a7b84ff07 100644 --- a/asm/diploma.s +++ b/asm/diploma.s @@ -10,7 +10,7 @@ sub_8177874: @ 8177874 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_8177874 @@ -94,12 +94,12 @@ sub_8177888: @ 8177888 bl remove_some_task bl ResetTasks bl ResetAllObjectData - bl sub_80A1A74 + bl ResetPaletteFade bl ResetObjectPaletteAllocator ldr r0, =gUnknown_085E7088 movs r1, 0 movs r2, 0x40 - bl gpu_pal_apply + bl LoadPalette ldr r4, =gUnknown_0203BCF0 movs r0, 0x80 lsls r0, 5 @@ -132,13 +132,13 @@ _0817797C: adds r0, r4, 0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes str r5, [sp] adds r0, r4, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x1 bl EnableInterrupts ldr r0, =sub_8177874 @@ -161,7 +161,7 @@ sub_8177A08: @ 8177A08 bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_8177A08 @@ -171,7 +171,7 @@ sub_8177A20: @ 8177A20 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -208,7 +208,7 @@ sub_8177A50: @ 8177A50 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -229,7 +229,7 @@ sub_8177A98: @ 8177A98 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -337,7 +337,7 @@ sub_8177B9C: @ 8177B9C ldr r0, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0 movs r1, 0 bl FillWindowPixelBuffer diff --git a/asm/easy_chat.s b/asm/easy_chat.s index f7d95493b..7bbe31ff0 100644 --- a/asm/easy_chat.s +++ b/asm/easy_chat.s @@ -58,7 +58,7 @@ sub_811A278: @ 811A278 bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_811A278 @@ -66,7 +66,7 @@ sub_811A278: @ 811A278 thumb_func_start sub_811A290 sub_811A290: @ 811A290 push {lr} - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl LoadOamFromSprites bl ProcessObjectCopyRequests pop {r0} @@ -161,14 +161,14 @@ _0811A344: adds r0, r4, 0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes movs r0, 0 str r0, [sp] adds r0, r4, 0 adds r1, r4, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x5 b _0811A41A .pool @@ -188,7 +188,7 @@ _0811A370: movs r2, 0 str r2, [sp] movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x3 strh r0, [r5] strh r4, [r5, 0xC] @@ -202,7 +202,7 @@ _0811A39E: adds r0, r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x4 b _0811A41A _0811A3B6: @@ -220,7 +220,7 @@ _0811A3CC: lsls r0, 24 b _0811A414 _0811A3D4: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -231,7 +231,7 @@ _0811A3D4: b _0811A41C .pool _0811A3EC: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -244,7 +244,7 @@ _0811A3EC: b _0811A41C .pool _0811A40C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -294,7 +294,7 @@ _0811A468: bl SetVBlankCallback bl ResetAllObjectData bl ResetObjectPaletteAllocator - bl sub_80A1A74 + bl ResetPaletteFade b _0811A4C0 _0811A47C: bl sub_811F28C @@ -637,7 +637,7 @@ _0811A7D4: thumb_func_start sub_811A7E4 sub_811A7E4: @ 811A7E4 push {lr} - bl fade_and_return_progress_probably + bl UpdatePaletteFade ldr r0, =gUnknown_030022C0 movs r1, 0x87 lsls r1, 3 @@ -655,7 +655,7 @@ _0811A804: bl fade_screen b _0811A840 _0811A80E: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -5809,36 +5809,36 @@ sub_811CF04: @ 811CF04 thumb_func_start sub_811CF64 sub_811CF64: @ 811CF64 push {r4,lr} - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =gUnknown_08DCBDB0 movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_08597B14 movs r1, 0x10 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_08597B34 movs r1, 0x40 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_08597C1C movs r1, 0xA0 movs r2, 0x8 - bl gpu_pal_apply + bl LoadPalette ldr r4, =gUnknown_08597C24 adds r0, r4, 0 movs r1, 0xB0 movs r2, 0xC - bl gpu_pal_apply + bl LoadPalette adds r0, r4, 0 movs r1, 0xF0 movs r2, 0xC - bl gpu_pal_apply + bl LoadPalette adds r0, r4, 0 movs r1, 0x30 movs r2, 0xC - bl gpu_pal_apply + bl LoadPalette pop {r4} pop {r0} bx r0 diff --git a/asm/egg_hatch.s b/asm/egg_hatch.s index 8f675adb7..5a13ee9b7 100644 --- a/asm/egg_hatch.s +++ b/asm/egg_hatch.s @@ -460,7 +460,7 @@ sub_807172C: @ 807172C push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_807172C @@ -485,7 +485,7 @@ sub_8071760: @ 8071760 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -597,7 +597,7 @@ _080717EC: movs r0, 0 bl SetBgTilemapBuffer bl DeactivateAllTextPrinters - bl sub_80A1A74 + bl ResetPaletteFade bl ResetObjectPaletteAllocator bl ResetAllObjectData bl ResetTasks @@ -629,7 +629,7 @@ _080718D0: ldr r0, =gUnknown_08C004E0 movs r1, 0 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette b _080719A6 .pool _08071904: @@ -680,7 +680,7 @@ _08071970: ldr r0, =gUnknown_08DD7300 movs r1, 0x10 movs r2, 0xA0 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_08DD7360 movs r2, 0xA1 lsls r2, 5 @@ -717,7 +717,7 @@ _080719D6: bl RunTextPrinters bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0x4 pop {r4} pop {r0} @@ -834,7 +834,7 @@ _08071AF4: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_0832BFFC movs r1, 0x78 movs r2, 0x4B @@ -857,7 +857,7 @@ _08071AF4: b _08071E06 .pool _08071B40: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1133,7 +1133,7 @@ _08071DB4: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _08071DC4: ldr r0, =gUnknown_03000DE0 ldr r1, [r0] @@ -1144,7 +1144,7 @@ _08071DC8: b _08071E06 .pool _08071DD4: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1168,7 +1168,7 @@ _08071E06: bl RunTextPrinters bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0x8 pop {r3,r4} mov r8, r3 @@ -1393,7 +1393,7 @@ sub_8071FC8: @ 8071FC8 adds r0, r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _08071FE8: ldrh r0, [r5, 0x2E] cmp r0, 0x3 @@ -1413,7 +1413,7 @@ _08072004: ldrh r0, [r5, 0x2E] adds r0, 0x1 strh r0, [r5, 0x2E] - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1483,7 +1483,7 @@ _08072084: adds r0, r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0807209E: movs r1, 0x2E ldrsh r0, [r5, r1] diff --git a/asm/evolution_scene.s b/asm/evolution_scene.s index 0ee6137ca..979efe3c0 100644 --- a/asm/evolution_scene.s +++ b/asm/evolution_scene.s @@ -8,7 +8,7 @@ thumb_func_start sub_813D9B0 sub_813D9B0: @ 813D9B0 push {lr} - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl RunTasks pop {r0} bx r0 @@ -41,13 +41,13 @@ _0813D9E8: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r6, 0x8] adds r0, 0x1 strh r0, [r6, 0x8] b _0813DA30 _0813DA00: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -164,7 +164,7 @@ evolution_cutscene: @ 813DA8C movs r0, 0x4A movs r1, 0 bl SetGpuReg - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =gUnknown_02022E14 movs r2, 0 strh r2, [r0] @@ -248,7 +248,7 @@ evolution_cutscene: @ 813DA8C movs r1, 0x88 lsls r1, 1 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette adds r0, r5, 0 movs r1, 0x1 bl sub_806A068 @@ -304,7 +304,7 @@ evolution_cutscene: @ 813DA8C movs r1, 0x90 lsls r1, 1 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette mov r0, r10 movs r1, 0x3 bl sub_806A068 @@ -369,7 +369,7 @@ evolution_cutscene: @ 813DA8C strh r2, [r0, 0x1C] ldr r1, =gUnknown_0203AB80 ldr r0, [r1] - ldr r1, =gUnknown_02037754 + ldr r1, =gPlttBufferUnfaded + 0x40 adds r0, 0x4 movs r2, 0x60 bl memcpy @@ -459,7 +459,7 @@ sub_813DD7C: @ 813DD7C movs r0, 0x4A movs r1, 0 bl SetGpuReg - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =gUnknown_02022E14 strh r4, [r0] ldr r0, =gUnknown_02022E16 @@ -505,7 +505,7 @@ sub_813DD7C: @ 813DD7C movs r1, 0x90 lsls r1, 1 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette adds r0, r5, 0 movs r1, 0x3 bl sub_806A068 @@ -553,7 +553,7 @@ sub_813DD7C: @ 813DD7C movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0 bl ShowBg movs r0, 0x1 @@ -652,7 +652,7 @@ _0813DFE0: b _0813E180 .pool _0813E050: - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =nullsub_83 bl SetHBlankCallback ldr r0, =sub_813FD64 @@ -710,7 +710,7 @@ _0813E0A8: movs r1, 0x90 lsls r1, 1 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette b _0813E180 .pool _0813E0F0: @@ -769,7 +769,7 @@ _0813E174: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes _0813E180: ldr r1, =gUnknown_030022C0 movs r0, 0x87 @@ -788,7 +788,7 @@ _0813E198: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade bl sub_807B140 movs r0, 0 bl ShowBg @@ -880,7 +880,7 @@ sub_813E1D4: @ 813E1D4 movs r1, 0x90 lsls r1, 1 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette adds r0, r5, 0 movs r1, 0x1 bl sub_806A068 @@ -986,7 +986,7 @@ sub_813E3A4: @ 813E3A4 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl RunTasks pop {r0} bx r0 @@ -998,7 +998,7 @@ sub_813E3C0: @ 813E3C0 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl RunTasks pop {r0} bx r0 @@ -1290,7 +1290,7 @@ _0813E670: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r2, =gUnknown_02020630 ldr r0, =gUnknown_0203AB80 ldr r0, [r0] @@ -1324,7 +1324,7 @@ _0813E670: bl _0813F1A4 .pool _0813E6D4: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1406,11 +1406,11 @@ _0813E780: movs r1, 0x4 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade bl _0813F1A4 .pool _0813E7B0: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1573,7 +1573,7 @@ _0813E918: bl _0813F1A4 _0813E926: bl m4aMPlayAllStop - ldr r0, =gUnknown_02037754 + ldr r0, =gPlttBufferUnfaded + 0x40 ldr r1, =gUnknown_0203AB80 ldr r1, [r1] adds r1, 0x4 @@ -1586,7 +1586,7 @@ _0813E926: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gTasks mov r3, r8 adds r1, r3, r7 @@ -1595,7 +1595,7 @@ _0813E926: b _0813EC52 .pool _0813E964: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1733,7 +1733,7 @@ _0813EAA8: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gTasks mov r2, r8 adds r1, r2, r7 @@ -1742,7 +1742,7 @@ _0813EAA8: b _0813EC52 .pool _0813EAC8: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r2, 0x80 adds r0, r2, 0 @@ -1805,7 +1805,7 @@ _0813EB48: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade mov r2, r8 adds r1, r2, r7 lsls r1, 3 @@ -1813,7 +1813,7 @@ _0813EB48: b _0813EC52 .pool _0813EB74: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2186,7 +2186,7 @@ _0813EECC: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0813EEF2: ldr r0, =gUnknown_030022C0 ldrh r1, [r0, 0x2E] @@ -2215,7 +2215,7 @@ _0813EF00: b _0813F1A4 .pool _0813EF30: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2247,7 +2247,7 @@ _0813EF3E: b _0813F1A4 .pool _0813EF88: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2608,7 +2608,7 @@ _0813F2EC: b _0813F9C8 .pool _0813F314: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2789,7 +2789,7 @@ _0813F4A6: adds r4, r1 ldrh r1, [r4, 0xC] bl sub_81401E0 - ldr r0, =gUnknown_02037754 + ldr r0, =gPlttBufferUnfaded + 0x40 ldr r1, [r5] adds r1, 0x4 movs r2, 0x60 @@ -2983,7 +2983,7 @@ _0813F67C: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0813F6AC: lsls r0, r7, 2 adds r0, r7 @@ -2996,7 +2996,7 @@ _0813F6B4: b _0813FCC4 .pool _0813F6D0: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3324,7 +3324,7 @@ _0813F9C0: _0813F9C8: movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0813FCC4 .pool _0813F9E4: @@ -3351,7 +3351,7 @@ _0813F9E4: b _0813FCC4 .pool _0813FA24: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3398,7 +3398,7 @@ _0813FA3E: b _0813FCC4 .pool _0813FAA8: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3664,7 +3664,7 @@ sub_813FCDC: @ 813FCDC bl SetGpuReg bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl sub_80BA0A8 pop {r0} bx r0 @@ -3708,7 +3708,7 @@ sub_813FD64: @ 813FD64 bl SetGpuReg bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl sub_80BA0A8 pop {r0} bx r0 @@ -3789,7 +3789,7 @@ _0813FE74: adds r0, r1 movs r1, 0xA0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette strh r5, [r4] ldrh r0, [r4, 0x2] adds r0, 0x1 @@ -3997,7 +3997,7 @@ _0814002C: ldr r0, =gUnknown_085B51E4 movs r1, 0xA0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_085B4134 movs r0, 0 str r0, [sp] @@ -4089,7 +4089,7 @@ _0814011E: movs r0, 0 movs r1, 0xA0 movs r2, 0x20 - bl rboxid_80040B8 + bl FillPalette pop {r0} bx r0 .pool @@ -4117,7 +4117,7 @@ _0814015A: movs r0, 0 movs r1, 0xA0 movs r2, 0x20 - bl rboxid_80040B8 + bl FillPalette bl sub_8140174 pop {r0} bx r0 diff --git a/asm/field_map_obj.s b/asm/field_map_obj.s index 570eca428..44f8f0c06 100644 --- a/asm/field_map_obj.s +++ b/asm/field_map_obj.s @@ -2829,7 +2829,7 @@ pal_patch_for_npc: @ 808E91C lsrs r4, 16 adds r1, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r4} pop {r0} bx r0 diff --git a/asm/fieldmap.s b/asm/fieldmap.s index 312ac290a..33d9953f9 100644 --- a/asm/fieldmap.s +++ b/asm/fieldmap.s @@ -2135,7 +2135,7 @@ apply_map_tileset_palette: @ 8088CC4 mov r0, sp adds r1, r5, 0 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldr r0, [r4, 0x8] adds r0, 0x2 adds r5, 0x1 @@ -2145,7 +2145,7 @@ apply_map_tileset_palette: @ 8088CC4 lsls r2, r4, 16 lsrs r2, 16 adds r1, r5, 0 - bl gpu_pal_apply + bl LoadPalette lsls r4, 15 lsrs r4, 16 adds r0, r5, 0 @@ -2159,7 +2159,7 @@ _08088D18: adds r0, 0xC0 adds r1, r5, 0 adds r2, r7, 0 - bl gpu_pal_apply + bl LoadPalette lsrs r1, r6, 17 adds r0, r5, 0 bl nullsub_3 @@ -2167,7 +2167,7 @@ _08088D18: _08088D32: ldr r0, [r4, 0x8] mov r1, r8 - bl decompress_palette + bl LoadCompressedPalette lsrs r1, r6, 17 mov r0, r8 bl nullsub_3 diff --git a/asm/fldeff_80F9BCC.s b/asm/fldeff_80F9BCC.s index c74e23312..41c207bf1 100644 --- a/asm/fldeff_80F9BCC.s +++ b/asm/fldeff_80F9BCC.s @@ -219,8 +219,8 @@ _080F9D50: negs r0, r0 movs r1, 0 movs r2, 0 - bl sub_80A2A20 - ldr r0, =gUnknown_02037B14 + bl BlendPalettes + ldr r0, =gPlttBufferFaded strh r5, [r0] _080F9D76: ldrh r1, [r4, 0xE] @@ -318,7 +318,7 @@ _080F9E24: beq _080F9ED8 b _080F9F2C _080F9E2E: - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded strh r1, [r0] b _080F9F4E .pool @@ -421,8 +421,8 @@ _080F9EF6: subs r0, 0x79 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 - ldr r1, =gUnknown_02037B14 + bl BlendPalettes + ldr r1, =gPlttBufferFaded movs r0, 0 strh r0, [r1] _080F9F0C: diff --git a/asm/front_pic_anim.s b/asm/front_pic_anim.s index 46616bad0..6b9e4b6db 100644 --- a/asm/front_pic_anim.s +++ b/asm/front_pic_anim.s @@ -1641,7 +1641,7 @@ _081800EC: movs r1, 0x10 movs r2, 0 movs r3, 0 - bl pal_fade_1 + bl BlendPalette ldr r0, =sub_8184D88 str r0, [r4, 0x1C] b _08180128 @@ -1658,7 +1658,7 @@ _0818010C: lsrs r2, 24 movs r1, 0x10 movs r3, 0 - bl pal_fade_1 + bl BlendPalette _08180128: ldrh r0, [r4, 0x32] adds r0, 0x1 @@ -2870,7 +2870,7 @@ _08180AA8: ldr r3, =0x000002df movs r1, 0x10 movs r2, 0 - bl pal_fade_1 + bl BlendPalette ldr r0, =sub_8184D88 str r0, [r4, 0x1C] b _08180AE8 @@ -2887,7 +2887,7 @@ _08180ACC: lsrs r2, 24 ldr r3, =0x000002df movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette _08180AE8: ldrh r0, [r4, 0x32] adds r0, 0x2 @@ -2923,7 +2923,7 @@ _08180B14: movs r1, 0x10 movs r2, 0 movs r3, 0x1F - bl pal_fade_1 + bl BlendPalette ldr r0, =sub_8184D88 str r0, [r4, 0x1C] b _08180B50 @@ -2940,7 +2940,7 @@ _08180B34: lsrs r2, 24 movs r1, 0x10 movs r3, 0x1F - bl pal_fade_1 + bl BlendPalette _08180B50: ldrh r0, [r4, 0x32] adds r0, 0x2 @@ -2976,7 +2976,7 @@ _08180B78: lsls r3, 7 movs r1, 0x10 movs r2, 0 - bl pal_fade_1 + bl BlendPalette ldr r0, =sub_8184D88 str r0, [r4, 0x1C] b _08180BB6 @@ -2994,7 +2994,7 @@ _08180B98: movs r3, 0xF8 lsls r3, 7 movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette _08180BB6: ldrh r0, [r4, 0x32] adds r0, 0x2 @@ -3029,7 +3029,7 @@ _08180BE0: ldr r3, =0x000003ff movs r1, 0x10 movs r2, 0 - bl pal_fade_1 + bl BlendPalette ldr r0, =sub_8184D88 str r0, [r4, 0x1C] b _08180C20 @@ -3046,7 +3046,7 @@ _08180C04: lsrs r2, 24 ldr r3, =0x000003ff movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette _08180C20: ldrh r0, [r4, 0x32] adds r0, 0x2 @@ -3082,7 +3082,7 @@ _08180C4C: ldr r3, =0x00006018 movs r1, 0x10 movs r2, 0 - bl pal_fade_1 + bl BlendPalette ldr r0, =sub_8184D88 str r0, [r4, 0x1C] b _08180C8C @@ -3099,7 +3099,7 @@ _08180C70: lsrs r2, 24 ldr r3, =0x00006018 movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette _08180C8C: ldrh r0, [r4, 0x32] adds r0, 0x2 @@ -4131,7 +4131,7 @@ _08181464: ldr r3, =0x000003ff movs r1, 0x10 movs r2, 0x10 - bl pal_fade_1 + bl BlendPalette b _08181494 .pool _08181488: @@ -4139,7 +4139,7 @@ _08181488: ldr r3, =0x000003ff movs r1, 0x10 movs r2, 0 - bl pal_fade_1 + bl BlendPalette _08181494: movs r0, 0 strh r0, [r4, 0x36] @@ -10887,7 +10887,7 @@ _081847D0: ldr r3, =0x000003ff movs r1, 0x10 movs r2, 0x10 - bl pal_fade_1 + bl BlendPalette b _081847FC .pool _081847F0: @@ -10895,7 +10895,7 @@ _081847F0: ldr r3, =0x000003ff movs r1, 0x10 movs r2, 0 - bl pal_fade_1 + bl BlendPalette _081847FC: movs r0, 0 strh r0, [r4, 0x36] @@ -11037,7 +11037,7 @@ sub_81848E0: @ 81848E0 movs r1, 0x10 movs r2, 0 movs r3, 0x1F - bl pal_fade_1 + bl BlendPalette ldr r0, =sub_8184D88 str r0, [r4, 0x1C] b _0818492A @@ -11059,7 +11059,7 @@ _08184904: adds r1, r3 ldrh r3, [r1] movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette _0818492A: pop {r4,r5} pop {r0} diff --git a/asm/intro.s b/asm/intro.s index 41e9547fc..fc548bc93 100644 --- a/asm/intro.s +++ b/asm/intro.s @@ -10,7 +10,7 @@ sub_816CBE8: @ 816CBE8 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl sub_80BA0A8 pop {r0} bx r0 @@ -22,12 +22,12 @@ sub_816CC00: @ 816CC00 bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade ldr r0, =gUnknown_030022C0 ldrh r0, [r0, 0x2E] cmp r0, 0 beq _0816CC3C - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -55,7 +55,7 @@ _0816CC4C: thumb_func_start sub_816CC54 sub_816CC54: @ 816CC54 push {lr} - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _0816CC66 @@ -93,7 +93,7 @@ load_copyright_graphics: @ 816CC70 ldr r0, =gIntroCopyright_Pal adds r1, r5, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r4-r6} pop {r0} bx r0 @@ -178,7 +178,7 @@ _0816CCF4: ldr r1, =0x05000002 ldr r2, =0x010001ff bl CpuSet - bl sub_80A1A74 + bl ResetPaletteFade movs r1, 0xE0 lsls r1, 6 movs r0, 0 @@ -195,7 +195,7 @@ _0816CCF4: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r1, 0xE0 lsls r1, 3 movs r0, 0x8 @@ -215,7 +215,7 @@ _0816CCF4: ldr r0, =gUnknown_030062B0 bl GameCubeMultiBoot_Init _0816CDBC: - bl fade_and_return_progress_probably + bl UpdatePaletteFade ldr r0, =gUnknown_030022C0 movs r1, 0x87 lsls r1, 3 @@ -240,14 +240,14 @@ _0816CE00: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrb r0, [r5] adds r0, 0x1 strb r0, [r5] b _0816CEA0 .pool _0816CE2C: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _0816CEA0 @@ -428,7 +428,7 @@ task_intro_1: @ 816CF18 lsls r5, 2 movs r1, 0 adds r2, r5, 0 - bl gpu_pal_apply + bl LoadPalette ldr r1, =0x00009603 movs r0, 0xE bl SetGpuReg @@ -452,7 +452,7 @@ task_intro_1: @ 816CF18 bl LoadCompressedObjectPic ldr r0, =gUnknown_085E4A84 bl LoadTaggedObjectPalettes - ldr r4, =gUnknown_02037914 + ldr r4, =gPlttBufferUnfaded + 0x200 movs r3, 0xF0 lsls r3, 1 adds r1, r4, r3 @@ -543,7 +543,7 @@ task_intro_2: @ 816D12C movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_816CBE8 bl SetVBlankCallback movs r1, 0xFA @@ -886,7 +886,7 @@ _0816D418: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -1069,7 +1069,7 @@ _0816D598: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_816CBE8 bl SetVBlankCallback movs r1, 0x80 @@ -1129,7 +1129,7 @@ _0816D67C: movs r1, 0x8 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -1790,7 +1790,7 @@ task_intro_10: @ 816DBAC movs r2, 0x80 lsls r2, 2 movs r1, 0 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gTasks lsls r4, r5, 2 adds r4, r5 @@ -1815,7 +1815,7 @@ task_intro_10: @ 816DBAC movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =0x00004883 movs r0, 0xC bl SetGpuReg @@ -1897,7 +1897,7 @@ _0816DCA8: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0816DCE6: add sp, 0x4 pop {r4,r5} @@ -1933,7 +1933,7 @@ task_intro_13: @ 816DD28 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1963,7 +1963,7 @@ task_intro_13: @ 816DD28 ldr r0, =gUnknown_0852561C bl LoadCompressedObjectPaletteUsingHeap ldr r0, =gUnknown_08D85CD0 - ldr r1, =gUnknown_02037714 + ldr r1, =gPlttBufferUnfaded movs r2, 0x80 lsls r2, 1 bl CpuSet @@ -2016,7 +2016,7 @@ task_intro_14: @ 816DDD8 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gTasks lsls r4, r5, 2 adds r4, r5 @@ -2231,7 +2231,7 @@ _0816DFF4: ldrsh r0, [r4, r1] ldr r1, =gUnknown_08D85CD0 adds r0, r1 - ldr r1, =gUnknown_02037B52 + ldr r1, =gPlttBufferFaded + 0x3E movs r2, 0x1 bl CpuSet ldrh r0, [r4, 0xE] @@ -2273,7 +2273,7 @@ _0816E046: ldrsh r0, [r4, r2] ldr r1, =gUnknown_08D85CD0 adds r0, r1 - ldr r1, =gUnknown_02037B52 + ldr r1, =gPlttBufferFaded + 0x3E movs r2, 0x1 bl CpuSet ldrh r0, [r4, 0xE] @@ -2376,7 +2376,7 @@ _0816E0DE: movs r1, 0x3 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade strh r5, [r4, 0x6] movs r0, 0 strh r0, [r4, 0x8] @@ -2398,7 +2398,7 @@ _0816E14E: strh r0, [r4] b _0816E176 _0816E156: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2592,7 +2592,7 @@ task_intro_19: @ 816E2A0 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gTasks lsls r1, r4, 2 adds r1, r4 @@ -2890,7 +2890,7 @@ _0816E56E: ldrsh r0, [r5, r2] ldr r1, =gUnknown_08D85CD0 adds r0, r1 - ldr r1, =gUnknown_02037B72 + ldr r1, =gPlttBufferFaded + 0x5E movs r2, 0x1 bl CpuSet ldrh r0, [r5, 0xE] @@ -2934,7 +2934,7 @@ _0816E5BC: ldrsh r0, [r5, r2] ldr r1, =gUnknown_08D85CD0 adds r0, r1 - ldr r1, =gUnknown_02037B72 + ldr r1, =gPlttBufferFaded + 0x5E movs r2, 0x1 bl CpuSet ldrh r0, [r5, 0xE] @@ -2993,7 +2993,7 @@ _0816E61A: movs r1, 0x3 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0816E690 .pool _0816E664: @@ -3025,7 +3025,7 @@ _0816E690: b _0816E6BC .pool _0816E69C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3448,7 +3448,7 @@ _0816EA24: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r2, 0xA0 lsls r2, 7 adds r0, r2, 0 @@ -3471,7 +3471,7 @@ _0816EA58: movs r1, 0x3 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0816EA74: ldrh r1, [r4, 0xC] movs r2, 0xC @@ -3484,7 +3484,7 @@ _0816EA74: b _0816EAA6 .pool _0816EA90: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3727,7 +3727,7 @@ _0816ECAC: ldrsh r0, [r4, r1] ldr r1, =gUnknown_08D85CD0 adds r0, r1 - ldr r1, =gUnknown_02037BCE + ldr r1, =gPlttBufferFaded + 0xBA movs r2, 0x1 bl CpuSet ldrh r0, [r4, 0x30] @@ -3759,7 +3759,7 @@ _0816ECDC: ldrsh r0, [r4, r1] ldr r1, =gUnknown_08D85CD0 adds r0, r1 - ldr r1, =gUnknown_02037BCE + ldr r1, =gPlttBufferFaded + 0xBA movs r2, 0x1 bl CpuSet ldrh r0, [r4, 0x30] @@ -3807,7 +3807,7 @@ task_intro_27: @ 816ED20 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0 strh r0, [r4, 0x8] movs r0, 0xA8 @@ -3919,7 +3919,7 @@ _0816EE3A: ldrh r0, [r2, 0x8] subs r0, 0x2 strh r0, [r2, 0x8] - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -4009,7 +4009,7 @@ _0816EEF4: lsls r0, 1 ldr r1, =gUnknown_08D85E72 adds r0, r1 - ldr r1, =gUnknown_02037BD0 + ldr r1, =gPlttBufferFaded + 0xBC movs r2, 0x1 bl CpuSet ldrh r0, [r5, 0x2] @@ -4045,7 +4045,7 @@ _0816EF34: lsls r0, 1 ldr r1, =gUnknown_08D85E72 adds r0, r1 - ldr r1, =gUnknown_02037BC4 + ldr r1, =gPlttBufferFaded + 0xB0 movs r2, 0x1 bl CpuSet ldrh r0, [r5, 0x2] @@ -4082,7 +4082,7 @@ _0816EF80: lsls r0, 1 ldr r1, =gUnknown_08D85E52 adds r0, r1 - ldr r1, =gUnknown_02037BCC + ldr r1, =gPlttBufferFaded + 0xB8 movs r2, 0x1 bl CpuSet ldrh r0, [r5, 0x2] @@ -4147,9 +4147,9 @@ _0816F00A: ldr r3, =0x00002949 movs r0, 0x50 movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette ldr r4, =gUnknown_08D85E7C - ldr r5, =gUnknown_02037BD0 + ldr r5, =gPlttBufferFaded + 0xBC adds r0, r4, 0 adds r1, r5, 0 movs r2, 0x1 @@ -4188,14 +4188,14 @@ _0816F074: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] b _0816F0B2 .pool _0816F0A0: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/item_use.s b/asm/item_use.s index 095da509c..987616448 100644 --- a/asm/item_use.s +++ b/asm/item_use.s @@ -1508,7 +1508,7 @@ sub_80FDC00: @ 80FDC00 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/link.s b/asm/link.s index 5a6798e59..72c296413 100644 --- a/asm/link.s +++ b/asm/link.s @@ -60,7 +60,7 @@ sub_8009414: @ 8009414 ldr r0, =gUnknown_082ECF20 lsls r1, r5, 4 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r3, =0x040000d4 ldr r0, =gUnknown_082ECF40 str r0, [r3] @@ -162,7 +162,7 @@ sub_80094EC: @ 80094EC mov r2, r8 lsls r1, r2, 4 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r2, =0x040000d4 ldr r0, =gUnknown_082ECF40 str r0, [r2] @@ -242,7 +242,7 @@ _080095A0: bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade ldr r0, =gUnknown_03000D60 str r4, [r0] bl sub_8009638 @@ -330,7 +330,7 @@ sub_80096BC: @ 80096BC push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_80096BC @@ -605,7 +605,7 @@ _0800992A: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _08009946: ldrh r1, [r4, 0x2E] movs r0, 0x8 @@ -666,7 +666,7 @@ c2_08009A8C: @ 80099BC bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end c2_08009A8C @@ -3354,11 +3354,11 @@ c2_800ACD4: @ 800AF30 bl InitHeap bl ResetAllObjectData bl ResetObjectPaletteAllocator - bl pal_fade_control_reset_maybe + bl ResetPaletteFadeControl movs r0, 0 movs r1, 0 movs r2, 0x2 - bl rboxid_80040B8 + bl FillPalette bl ResetTasks bl remove_some_task ldr r1, =gUnknown_030030FC @@ -3422,7 +3422,7 @@ _0800AF8C: ldr r0, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_03002700 movs r0, 0 strb r0, [r1] @@ -3436,7 +3436,7 @@ _0800AF8C: bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade ldr r0, =sub_800B1A0 bl SetMainCallback2 _0800B03C: @@ -3472,7 +3472,7 @@ sub_800B080: @ 800B080 ldr r0, =gUnknown_082EC86C movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0 movs r1, 0 bl FillWindowPixelBuffer @@ -16590,7 +16590,7 @@ sub_8011AE8: @ 8011AE8 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_8011AE8 @@ -16601,7 +16601,7 @@ sub_8011AFC: @ 8011AFC bl ResetAllObjectData bl ResetObjectPaletteAllocator bl ResetTasks - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =sub_8011AE8 bl SetVBlankCallback bl sub_80093CC @@ -16635,7 +16635,7 @@ _08011B38: bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl sub_8011BA4 ldr r0, =sub_8011BF8 bl SetMainCallback2 @@ -16705,7 +16705,7 @@ sub_8011BF8: @ 8011BF8 bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_8011BF8 @@ -21689,7 +21689,7 @@ _080148CC: strh r0, [r7] b _080149B2 _080148E4: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -24533,11 +24533,11 @@ _0801638E: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x12 b _08016876 _080163A2: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 beq _080163AE @@ -24674,11 +24674,11 @@ _080164E0: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x36 b _08016876 _080164F4: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -28584,7 +28584,7 @@ sub_8018424: @ 8018424 push {lr} bl ProcessObjectCopyRequests bl LoadOamFromSprites - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_8018424 @@ -28633,7 +28633,7 @@ _08018480: _08018482: movs r0, 0 bl SetVBlankCallback - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl ResetObjectPaletteAllocator bl ResetTasks @@ -28722,12 +28722,12 @@ _08018574: ldr r0, =gUnknown_082F0548 movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0x2 bl stdpal_get movs r1, 0xD0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0xC0 bl sub_81978B0 movs r0, 0 @@ -32545,7 +32545,7 @@ sub_801A3F4: @ 801A3F4 bl RunTextPrinters bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade _0801A414: pop {r0} bx r0 @@ -32556,7 +32556,7 @@ sub_801A418: @ 801A418 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_801A418 @@ -32617,7 +32617,7 @@ sub_801A43C: @ 801A43C ldr r0, =gUnknown_082F0D3C bl InitWindows bl DeactivateAllTextPrinters - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl ResetTasks bl remove_some_task @@ -32656,7 +32656,7 @@ sub_801A43C: @ 801A43C ldr r0, =gUnknown_082F0790 movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0xF0 bl sub_81978B0 bl sub_81AFBF0 @@ -32678,7 +32678,7 @@ sub_801A43C: @ 801A43C bl RunTextPrinters bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0xC pop {r4,r5} pop {r0} @@ -32742,7 +32742,7 @@ _0801A5E4: adds r0, r1 movs r1, 0 movs r2, 0x10 - bl gpu_pal_apply + bl LoadPalette pop {r0} bx r0 .pool @@ -32889,7 +32889,7 @@ _0801A728: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x1 bl ShowBg movs r0, 0 @@ -32898,7 +32898,7 @@ _0801A728: bl ShowBg b _0801A86C _0801A74C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -33029,7 +33029,7 @@ _0801A85C: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0801A86C: ldr r1, =gTasks lsls r0, r5, 2 @@ -33043,7 +33043,7 @@ _0801A876: b _0801A89C .pool _0801A884: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -33541,7 +33541,7 @@ sub_801AC40: @ 801AC40 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_801AC40 @@ -33705,7 +33705,7 @@ _0801AE24: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0 bl ShowBg ldr r1, =gUnknown_030022C0 @@ -33715,7 +33715,7 @@ _0801AE24: b _0801AF8A .pool _0801AE48: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 beq _0801AE54 @@ -33772,7 +33772,7 @@ _0801AEA6: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_030022C0 movs r1, 0x87 lsls r1, 3 @@ -33809,7 +33809,7 @@ _0801AF16: b _0801AFAE .pool _0801AF24: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _0801AFAE @@ -33870,7 +33870,7 @@ _0801AFAE: bl RunTextPrinters bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade _0801AFC2: add sp, 0xC pop {r4} @@ -35438,10 +35438,10 @@ _0801BBC8: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0801BD86 _0801BBDA: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _0801BBE6 @@ -35529,8 +35529,8 @@ _0801BC9A: bl stdpal_get movs r1, 0x20 movs r2, 0x20 - bl gpu_pal_apply - ldr r2, =gUnknown_02037FD4 + bl LoadPalette + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -35544,7 +35544,7 @@ _0801BC9A: ldr r0, [r0, 0xC] movs r1, 0x10 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, [r5] adds r4, r1, r4 ldr r0, [r4] @@ -35596,7 +35596,7 @@ _0801BD3A: bl ShowBg movs r0, 0x2 bl ShowBg - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -35608,12 +35608,12 @@ _0801BD3A: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe - bl fade_and_return_progress_probably + bl BeginNormalPaletteFade + bl UpdatePaletteFade b _0801BD86 .pool _0801BD70: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -35685,10 +35685,10 @@ _0801BDF0: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0801BEDA _0801BE02: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 beq _0801BEDA @@ -35767,11 +35767,11 @@ _0801BE9E: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0801BEDA .pool _0801BEC4: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -36868,10 +36868,10 @@ _0801C7B4: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0801CA1E _0801C7C6: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 beq _0801C7D2 @@ -36993,8 +36993,8 @@ _0801C8E2: bl stdpal_get movs r1, 0x20 movs r2, 0x20 - bl gpu_pal_apply - ldr r2, =gUnknown_02037FD4 + bl LoadPalette + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -37009,7 +37009,7 @@ _0801C8E2: ldr r0, [r0, 0xC] movs r1, 0x10 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette mov r2, r8 ldr r1, [r2] adds r4, r1, r4 @@ -37082,7 +37082,7 @@ _0801C9A8: bl ShowBg movs r0, 0x3 bl ShowBg - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -37106,12 +37106,12 @@ _0801C9A8: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe - bl fade_and_return_progress_probably + bl BeginNormalPaletteFade + bl UpdatePaletteFade b _0801CA1E .pool _0801CA04: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _0801CA38 @@ -37195,10 +37195,10 @@ _0801CAA0: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0801CC0E _0801CAB2: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 beq _0801CABE @@ -37327,11 +37327,11 @@ _0801CBC0: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0801CC0E .pool _0801CBF4: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _0801CC28 @@ -39783,13 +39783,13 @@ _0801DE8C: adds r0, r4, 0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes str r5, [sp] adds r0, r4, 0 adds r1, r4, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_801DF20 bl SetVBlankCallback _0801DEBC: @@ -39799,8 +39799,8 @@ _0801DEBC: b _0801DF04 .pool _0801DEC8: - bl fade_and_return_progress_probably - ldr r0, =gUnknown_02037FD4 + bl UpdatePaletteFade + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -39834,7 +39834,7 @@ _0801DF04: thumb_func_start sub_801DF20 sub_801DF20: @ 801DF20 push {lr} - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl LoadOamFromSprites bl ProcessObjectCopyRequests bl sub_80BA0A8 @@ -39849,7 +39849,7 @@ sub_801DF38: @ 801DF38 bl sub_801F5B8 bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_801DF38 @@ -41313,7 +41313,7 @@ _0801EB88: adds r0, r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_02022C84 ldr r1, [r0] movs r0, 0xD @@ -41321,7 +41321,7 @@ _0801EB88: b _0801EBC2 .pool _0801EBA8: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -44666,11 +44666,11 @@ sub_80205B4: @ 80205B4 ldr r0, =gUnknown_08DD4BD0 movs r1, 0x70 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_08DD4BB0 movs r1, 0xC0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_08DD4BF0 movs r0, 0 str r0, [sp] @@ -44698,7 +44698,7 @@ task_tutorial_story_unknown: @ 8020604 ldr r0, =gUnknown_08DD4860 movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_08DD4880 movs r0, 0 str r0, [sp] @@ -44747,7 +44747,7 @@ sub_8020680: @ 8020680 ldr r0, =gUnknown_082F2C20 movs r1, 0x80 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =0x06004020 movs r0, 0 movs r2, 0x20 @@ -44764,7 +44764,7 @@ sub_80206A4: @ 80206A4 ldr r0, =gUnknown_082F2C40 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0 bl PutWindowTilemap movs r0, 0 @@ -44850,7 +44850,7 @@ sub_8020740: @ 8020740 ldr r0, =gUnknown_0860F074 movs r1, 0xE0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r0} bx r0 .pool @@ -45141,7 +45141,7 @@ sub_80209AC: @ 80209AC lsrs r1, 16 adds r0, r4, 0 movs r2, 0x4 - bl gpu_pal_apply + bl LoadPalette pop {r4} pop {r0} bx r0 @@ -45842,7 +45842,7 @@ _08020F66: thumb_func_start sub_8020F74 sub_8020F74: @ 8020F74 push {lr} - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl LoadOamFromSprites bl ProcessObjectCopyRequests pop {r0} @@ -46017,7 +46017,7 @@ _080210BE: b _080212FC .pool _080210E4: - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl ResetObjectPaletteAllocator b _080212FC @@ -46138,7 +46138,7 @@ _080211F8: bl sub_8022588 adds r0, r5, 0 bl sub_8022600 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x8] movs r2, 0x80 orrs r1, r2 @@ -46150,7 +46150,7 @@ _0802121C: movs r2, 0xC0 lsls r2, 1 movs r1, 0 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_082F3C8C movs r0, 0x1 movs r2, 0 @@ -46201,7 +46201,7 @@ _08021278: b _080212FC .pool _080212B4: - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -46210,7 +46210,7 @@ _080212B4: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes movs r0, 0 bl ShowBg movs r0, 0x1 @@ -46290,11 +46290,11 @@ _08021368: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe - bl fade_and_return_progress_probably + bl BeginNormalPaletteFade + bl UpdatePaletteFade b _0802143E _0802137E: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 beq _0802143E @@ -49312,7 +49312,7 @@ sub_8022C58: @ 8022C58 lsls r4, 8 ldrb r2, [r1, 0x7] orrs r4, r2 - ldr r5, =gUnknown_02037FD4 + ldr r5, =gPaletteFade ldrb r3, [r5, 0x8] movs r2, 0x7F ands r2, r3 @@ -49323,8 +49323,8 @@ sub_8022C58: @ 8022C58 ldrb r3, [r1, 0x6] str r4, [sp] adds r1, r5, 0 - bl pal_fade_maybe - bl fade_and_return_progress_probably + bl BeginNormalPaletteFade + bl UpdatePaletteFade movs r0, 0x2 strb r0, [r6, 0xE] movs r0, 0 @@ -49355,7 +49355,7 @@ _08022CC6: beq _08022CF6 b _08022D06 _08022CD0: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _08022D0C @@ -51118,7 +51118,7 @@ _08023A64: negs r0, r0 ldr r2, =0x000003ff movs r1, 0x8 - bl sub_80A2A20 + bl BlendPalettes movs r0, 0x9C lsls r0, 1 adds r1, r4, r0 @@ -51143,7 +51143,7 @@ _08023AA2: negs r0, r0 ldr r2, =0x000003ff movs r1, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r2, =0x00000139 adds r1, r4, r2 movs r0, 0x4 @@ -51301,7 +51301,7 @@ _08023BE2: negs r0, r0 movs r1, 0x8 movs r2, 0x1F - bl sub_80A2A20 + bl BlendPalettes movs r0, 0x9C lsls r0, 1 adds r1, r5, r0 @@ -51323,7 +51323,7 @@ _08023C04: negs r0, r0 movs r1, 0 movs r2, 0x1F - bl sub_80A2A20 + bl BlendPalettes movs r0, 0 strb r0, [r4] b _08023C9C @@ -52312,7 +52312,7 @@ _080243DC: movs r3, 0x10 b _08024410 _080243EA: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 beq _08024434 @@ -52330,11 +52330,11 @@ _080243F6: movs r2, 0x10 movs r3, 0 _08024410: - bl pal_fade_maybe - bl fade_and_return_progress_probably + bl BeginNormalPaletteFade + bl UpdatePaletteFade b _08024434 _0802441A: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _0802443A @@ -53443,21 +53443,21 @@ _08024CE6: adds r0, r4, 0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_80261E4 bl SetVBlankCallback b _08024D20 .pool _08024D10: - bl fade_and_return_progress_probably - ldr r0, =gUnknown_02037FD4 + bl UpdatePaletteFade + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -54656,11 +54656,11 @@ _080256CE: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0802571A _080256E0: - bl fade_and_return_progress_probably - ldr r0, =gUnknown_02037FD4 + bl UpdatePaletteFade + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -54745,7 +54745,7 @@ _08025798: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _08025848 _080257B0: movs r0, 0 @@ -54796,18 +54796,18 @@ _08025818: adds r0, r4, 0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _08025848 _08025838: - bl fade_and_return_progress_probably - ldr r0, =gUnknown_02037FD4 + bl UpdatePaletteFade + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -55982,7 +55982,7 @@ sub_80261CC: @ 80261CC bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_80261CC @@ -55990,7 +55990,7 @@ sub_80261CC: @ 80261CC thumb_func_start sub_80261E4 sub_80261E4: @ 80261E4 push {lr} - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl LoadOamFromSprites bl ProcessObjectCopyRequests pop {r0} @@ -61963,7 +61963,7 @@ sub_8028FF8: @ 8028FF8 ldr r0, [r0, 0x4] movs r1, 0xA0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r4} pop {r0} bx r0 @@ -64752,7 +64752,7 @@ _0802A928: ldr r0, =gUnknown_082F7DF0 movs r1, 0 movs r2, 0x40 - bl gpu_pal_apply + bl LoadPalette b _0802A98A .pool _0802A938: @@ -64788,7 +64788,7 @@ _0802A972: bl stdpal_get movs r1, 0xD0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _0802A98A _0802A982: movs r0, 0 @@ -65137,7 +65137,7 @@ sub_802AC2C: @ 802AC2C thumb_func_start sub_802AC58 sub_802AC58: @ 802AC58 push {lr} - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl LoadOamFromSprites bl ProcessObjectCopyRequests pop {r0} @@ -65150,7 +65150,7 @@ sub_802AC6C: @ 802AC6C bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_802AC6C @@ -65256,14 +65256,14 @@ _0802AD68: adds r0, r4, 0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes movs r0, 0 str r0, [sp] adds r0, r4, 0 adds r1, r4, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_802AC58 bl SetVBlankCallback ldr r0, =gUnknown_02022CFC @@ -65271,8 +65271,8 @@ _0802AD68: b _0802ADC0 .pool _0802ADA4: - bl fade_and_return_progress_probably - ldr r0, =gUnknown_02037FD4 + bl UpdatePaletteFade + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -67211,11 +67211,11 @@ _0802BCC8: adds r0, r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r4] b _0802BD02 _0802BCEE: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -69942,7 +69942,7 @@ _0802D178: ldr r0, =gUnknown_082FC044 movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_082FC064 str r5, [sp] movs r0, 0x3 @@ -69959,7 +69959,7 @@ _0802D178: ldr r0, =gUnknown_082FC440 movs r1, 0x30 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_082FC460 str r5, [sp] movs r0, 0x2 @@ -69975,7 +69975,7 @@ _0802D178: ldr r0, =gUnknown_082FD168 movs r1, 0x10 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_082FD188 str r5, [sp] movs r0, 0x1 @@ -69991,7 +69991,7 @@ _0802D178: ldr r0, =gUnknown_082FC024 movs r1, 0x20 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, [r6] movs r0, 0xD3 lsls r0, 1 diff --git a/asm/mail.s b/asm/mail.s index fb7cdf2df..a2f6e8ce5 100644 --- a/asm/mail.s +++ b/asm/mail.s @@ -221,7 +221,7 @@ _0812166E: b _081219D4 .pool _08121688: - bl sub_80A1A74 + bl ResetPaletteFade b _081219D4 _0812168E: bl ResetTasks @@ -367,8 +367,8 @@ _081217EC: bl sub_8098C64 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply - ldr r6, =gUnknown_02037714 + bl LoadPalette + ldr r6, =gPlttBufferUnfaded ldr r4, =gUnknown_0859F2B8 ldr r0, =gUnknown_0203A134 ldr r3, [r0] @@ -383,7 +383,7 @@ _081217EC: subs r2, 0x26 adds r0, r6, r2 strh r1, [r0] - ldr r5, =gUnknown_02037B14 + ldr r5, =gPlttBufferFaded ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 @@ -418,7 +418,7 @@ _081217EC: ldr r0, [r0] movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_0859F2B0 ldr r0, =gUnknown_03005D90 ldr r2, [r0] @@ -482,7 +482,7 @@ _081218EC: _081218F6: ldr r0, =sub_8121C50 bl SetVBlankCallback - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -557,8 +557,8 @@ _08121980: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe - ldr r2, =gUnknown_02037FD4 + bl BeginNormalPaletteFade + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -885,7 +885,7 @@ sub_8121C50: @ 8121C50 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_8121C50 @@ -918,7 +918,7 @@ _08121C7C: thumb_func_start sub_8121C98 sub_8121C98: @ 8121C98 push {lr} - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _08121CB2 @@ -951,7 +951,7 @@ sub_8121CC0: @ 8121CC0 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_0203A134 ldr r0, [r0] movs r1, 0x84 @@ -969,7 +969,7 @@ _08121CEE: thumb_func_start sub_8121D00 sub_8121D00: @ 8121D00 push {r4,lr} - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _08121D88 @@ -1013,7 +1013,7 @@ _08121D58: ldr r2, =0x0000222c movs r1, 0 bl memset - bl sub_80A1A74 + bl ResetPaletteFade movs r0, 0 bl UnsetBgTilemapBuffer movs r0, 0x1 diff --git a/asm/main_menu.s b/asm/main_menu.s index decb11542..660b6c599 100644 --- a/asm/main_menu.s +++ b/asm/main_menu.s @@ -12,7 +12,7 @@ CB2_MainMenu: @ 802F6B0 bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end CB2_MainMenu @@ -23,7 +23,7 @@ VBlankCB_MainMenu: @ 802F6C8 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end VBlankCB_MainMenu @@ -118,15 +118,15 @@ InitMainMenu: @ 802F6F4 ldr r0, =0x810001ff str r0, [r1, 0x8] ldr r0, [r1, 0x8] - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =gUnknown_082FF0A0 movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_082FF0C0 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette bl remove_some_task bl ResetTasks bl ResetAllObjectData @@ -139,7 +139,7 @@ InitMainMenu: @ 802F6F4 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0802F7FE .pool _0802F7EC: @@ -150,7 +150,7 @@ _0802F7EC: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0802F7FE: movs r0, 0 bl ResetBgsAndClearDma3BusyFlags @@ -240,7 +240,7 @@ Task_MainMenuCheckSaveFile: @ 802F8D8 ldr r0, =gTasks + 0x8 mov r8, r0 adds r4, r7, r0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -452,7 +452,7 @@ Task_MainMenuCheckBattery: @ 802FAB0 lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -562,7 +562,7 @@ Task_DisplayMainMenu: @ 802FBA4 lsls r0, 3 ldr r1, =gTasks + 0x8 adds r6, r0, r1 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -597,7 +597,7 @@ _0802FBCE: strh r4, [r0] movs r1, 0xFE movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette add r1, sp, 0xC ldr r2, =0x00007fff adds r0, r2, 0 @@ -605,7 +605,7 @@ _0802FBCE: adds r0, r1, 0 movs r1, 0xFA movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette add r1, sp, 0xC ldr r2, =0x0000318c adds r0, r2, 0 @@ -613,7 +613,7 @@ _0802FBCE: adds r0, r1, 0 movs r1, 0xFB movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette add r1, sp, 0xC ldr r2, =0x0000675a adds r0, r2, 0 @@ -621,7 +621,7 @@ _0802FBCE: adds r0, r1, 0 movs r1, 0xFC movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_03005D90 ldr r0, [r0] ldrb r0, [r0, 0x8] @@ -634,7 +634,7 @@ _0802FBCE: adds r0, r1, 0 movs r1, 0xF1 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette b _0802FC96 .pool _0802FC84: @@ -645,7 +645,7 @@ _0802FC84: adds r0, r1, 0 movs r1, 0xF1 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette _0802FC96: ldr r0, =gTasks mov r8, r0 @@ -1093,7 +1093,7 @@ HandleMainMenuInput: @ 80300E0 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade adds r0, r7, 0 subs r0, 0x8 adds r0, r4, r0 @@ -1117,7 +1117,7 @@ _08030130: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x40 movs r1, 0xF0 bl SetGpuReg @@ -1269,7 +1269,7 @@ Task_HandleMainMenuAPressed: @ 803027C sub sp, 0x4 lsls r0, 24 lsrs r6, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1461,10 +1461,10 @@ _08030400: .4byte _08030488 .4byte _0803049C _0803041C: - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded movs r1, 0 strh r1, [r0] - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded strh r1, [r0] ldr r1, =gTasks adds r0, r7, r6 @@ -1475,10 +1475,10 @@ _0803041C: b _08030514 .pool _08030444: - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded movs r1, 0 strh r1, [r0] - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded strh r1, [r0] ldr r0, =sub_8086230 b _0803048A @@ -1515,13 +1515,13 @@ _0803049C: strh r4, [r0, 0xA] ldr r1, =Task_DisplayMainMenuInvalidActionError str r1, [r0] - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded movs r2, 0xF1 lsls r2, 1 adds r0, r2 ldr r1, =0x00007fff strh r1, [r0] - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded adds r0, r2 strh r1, [r0] movs r0, 0x18 @@ -1548,7 +1548,7 @@ _0803049C: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _08030536 .pool _08030514: @@ -1583,7 +1583,7 @@ Task_HandleMainMenuBPressed: @ 8030544 lsls r0, 24 lsrs r2, r0, 24 adds r5, r2, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1695,7 +1695,7 @@ _08030622: b _08030688 .pool _0803063C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1727,7 +1727,7 @@ _08030664: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =Task_HandleMainMenuBPressed str r0, [r4] _08030688: @@ -1924,11 +1924,11 @@ task_new_game_prof_birch_speech_1: @ 80307B0 ldr r0, =gUnknown_082FECFC movs r1, 0 movs r2, 0x40 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_082FF028 movs r1, 0x1 movs r2, 0x10 - bl gpu_pal_apply + bl LoadPalette bl remove_some_task bl ResetAllObjectData bl ResetObjectPaletteAllocator @@ -1942,7 +1942,7 @@ task_new_game_prof_birch_speech_1: @ 80307B0 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -2105,7 +2105,7 @@ task_new_game_prof_birch_speech_4: @ 80309CC push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2895,7 +2895,7 @@ _0803105C: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -2917,7 +2917,7 @@ task_new_game_prof_birch_speech_17: @ 8031090 sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3478,7 +3478,7 @@ task_new_game_prof_birch_speech_part2_9: @ 80314C4 movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x4 bl play_sound_effect ldr r0, =task_new_game_prof_birch_speech_part2_10 @@ -3528,7 +3528,7 @@ task_new_game_prof_birch_speech_part2_11: @ 80315BC sub sp, 0x4 lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3558,7 +3558,7 @@ task_new_game_prof_birch_speech_part2_11: @ 80315BC movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =task_new_game_prof_birch_speech_part2_12 str r0, [r4] _0803160A: @@ -3574,7 +3574,7 @@ task_new_game_prof_birch_speech_part2_12: @ 8031630 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3678,7 +3678,7 @@ new_game_prof_birch_speech_part2_start: @ 8031678 ldr r0, =0x81000200 str r0, [r1, 0x8] ldr r0, [r1, 0x8] - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =gUnknown_082FED3C adds r1, r4, 0 bl LZ77UnCompVram @@ -3688,11 +3688,11 @@ new_game_prof_birch_speech_part2_start: @ 8031678 ldr r0, =gUnknown_082FECFC movs r1, 0 movs r2, 0x40 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_082FF01A movs r1, 0x1 movs r2, 0x10 - bl gpu_pal_apply + bl LoadPalette bl ResetTasks ldr r0, =task_new_game_prof_birch_speech_part2_1 movs r1, 0 @@ -3758,7 +3758,7 @@ _080317E0: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x40 movs r1, 0 bl SetGpuReg @@ -4282,7 +4282,7 @@ _08031C62: adds r0, r1 movs r1, 0x1 movs r2, 0x10 - bl gpu_pal_apply + bl LoadPalette _08031C7C: pop {r4} pop {r0} @@ -4371,7 +4371,7 @@ _08031D0E: adds r0, r1 movs r1, 0x1 movs r2, 0x10 - bl gpu_pal_apply + bl LoadPalette _08031D28: pop {r4} pop {r0} @@ -4797,7 +4797,7 @@ LoadMainMenuWindowFrameTiles: @ 80320A4 ldr r0, [r0, 0x4] movs r1, 0x20 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r4-r6} pop {r0} bx r0 diff --git a/asm/mystery_event_menu.s b/asm/mystery_event_menu.s index de54321f3..80512dbd7 100644 --- a/asm/mystery_event_menu.s +++ b/asm/mystery_event_menu.s @@ -10,7 +10,7 @@ sub_8178944: @ 8178944 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_8178944 @@ -92,11 +92,11 @@ _081789AC: bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade movs r0, 0 movs r1, 0 movs r2, 0x2 - bl rboxid_80040B8 + bl FillPalette ldr r0, =sub_8178A78 bl SetMainCallback2 _08178A22: @@ -196,7 +196,7 @@ _08178AE4: movs r3, 0 b _08178E30 _08178B12: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -539,7 +539,7 @@ _08178E24: movs r2, 0 movs r3, 0x10 _08178E30: - bl pal_fade_maybe + bl BeginNormalPaletteFade _08178E34: ldr r1, =gUnknown_030022C0 movs r0, 0x87 @@ -552,7 +552,7 @@ _08178E3C: b _08178E58 .pool _08178E48: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -593,7 +593,7 @@ _08178E98: bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0x8 pop {r4-r6} pop {r0} diff --git a/asm/naming_screen.s b/asm/naming_screen.s index 0222ff82a..f84ad3946 100644 --- a/asm/naming_screen.s +++ b/asm/naming_screen.s @@ -101,7 +101,7 @@ _080E2E52: bl choose_name_or_words_screen_init_bgs b _080E2E86 _080E2E58: - bl sub_80A1A74 + bl ResetPaletteFade b _080E2E86 _080E2E5E: bl ResetAllObjectData @@ -118,7 +118,7 @@ _080E2E74: b _080E2E86 _080E2E7A: bl sub_80E3CC8 - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl sub_80E501C _080E2E86: ldr r1, =gUnknown_030022C0 @@ -630,13 +630,13 @@ sub_80E3294: @ 80E3294 adds r0, r4, 0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes str r6, [sp] adds r0, r4, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r5] ldr r0, =0x00001e10 adds r1, r0 @@ -654,7 +654,7 @@ sub_80E3294: @ 80E3294 thumb_func_start sub_80E335C sub_80E335C: @ 80E335C push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -769,7 +769,7 @@ sub_80E3448: @ 80E3448 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_02039F94 ldr r1, [r0] ldr r0, =0x00001e10 @@ -787,7 +787,7 @@ sub_80E3448: @ 80E3448 thumb_func_start sub_80E347C sub_80E347C: @ 80E347C push {r4,r5,lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1545,10 +1545,10 @@ sub_80E3AE8: @ 80E3AE8 lsrs r0, 24 bl sub_80E3A74 lsls r0, 16 - ldr r2, =gUnknown_02037B14 + ldr r2, =gPlttBufferFaded lsrs r0, 15 adds r2, r0, r2 - ldr r1, =gUnknown_02037714 + ldr r1, =gPlttBufferUnfaded adds r0, r1 ldrh r0, [r0] strh r0, [r2] @@ -3763,16 +3763,16 @@ choose_name_or_words_screen_apply_bg_pals: @ 80E4CC8 ldr r0, =gUnknown_08DD3778 movs r1, 0 movs r2, 0xC0 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0858BD78 movs r1, 0xA0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0x2 bl stdpal_get movs r1, 0xB0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r0} bx r0 .pool @@ -4061,7 +4061,7 @@ sub_80E4F58: @ 80E4F58 bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_80E4F58 @@ -4092,7 +4092,7 @@ sub_80E4F94: @ 80E4F94 push {r4,r5,lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer ldr r5, =gUnknown_02039F94 ldr r0, [r5] ldr r1, =0x00001e18 diff --git a/asm/option_menu.s b/asm/option_menu.s index 498321226..a9e13c7b8 100644 --- a/asm/option_menu.s +++ b/asm/option_menu.s @@ -11,7 +11,7 @@ sub_80BA4B0: @ 80BA4B0 bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_80BA4B0 @@ -21,7 +21,7 @@ sub_80BA4C8: @ 80BA4C8 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_80BA4C8 @@ -209,7 +209,7 @@ _080BA56A: b _080BA7EC .pool _080BA69C: - bl sub_80A1A74 + bl ResetPaletteFade bl remove_some_task bl ResetTasks bl ResetAllObjectData @@ -238,7 +238,7 @@ _080BA6E0: ldr r0, =gUnknown_0855C6A0 movs r1, 0 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_03005D90 ldr r0, [r0] ldrb r0, [r0, 0x14] @@ -247,7 +247,7 @@ _080BA6E0: ldr r0, [r0, 0x4] movs r1, 0x70 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_030022C0 movs r0, 0x87 lsls r0, 3 @@ -258,7 +258,7 @@ _080BA718: ldr r0, =gUnknown_0855C604 movs r1, 0x10 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _080BA7EC .pool _080BA728: @@ -365,7 +365,7 @@ _080BA80C: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_80BA4C8 bl SetVBlankCallback ldr r0, =sub_80BA4B0 @@ -385,7 +385,7 @@ sub_80BA83C: @ 80BA83C push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -718,7 +718,7 @@ sub_80BAA64: @ 80BAA64 movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_80BAB08 str r0, [r4] add sp, 0x4 @@ -733,7 +733,7 @@ sub_80BAB08: @ 80BAB08 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1186,7 +1186,7 @@ _080BAE82: ldr r0, [r0, 0x4] movs r1, 0x70 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_02039B48 movs r0, 0x1 strb r0, [r1] @@ -1221,7 +1221,7 @@ _080BAED2: ldr r0, [r0, 0x4] movs r1, 0x70 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_02039B48 movs r0, 0x1 strb r0, [r1] diff --git a/asm/palette.s b/asm/palette.s deleted file mode 100644 index 4392bca49..000000000 --- a/asm/palette.s +++ /dev/null @@ -1,2831 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_80A1818 -sub_80A1818: @ 80A1818 - push {lr} - lsls r0, 16 - ldr r2, =gUnknown_0852487C - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r1, 14 - adds r1, r2 - ldr r0, [r1] - ldr r1, =gUnknown_02037814 - movs r2, 0x10 - bl CpuSet - ldr r0, =gUnknown_02037FD4 - ldrh r2, [r0, 0x4] - lsls r2, 21 - lsrs r2, 27 - ldrh r3, [r0, 0x6] - lsls r3, 17 - lsrs r3, 17 - movs r0, 0x80 - movs r1, 0x10 - bl pal_fade_1 - ldr r0, =sub_8149DFC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080A1862 - ldr r1, =gUnknown_03000F44 - ldr r0, =sub_80A1670 - str r0, [r1] - ldr r1, =gUnknown_03000F3C - movs r0, 0x20 - strh r0, [r1] -_080A1862: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A1818 - - thumb_func_start sub_80A1884 -sub_80A1884: @ 80A1884 - push {lr} - lsls r0, 16 - ldr r2, =gUnknown_0852487C - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r1, 14 - adds r1, r2 - ldr r0, [r1] - ldr r1, =gUnknown_02037814 - movs r2, 0x10 - bl CpuSet - ldr r0, =sub_8149DFC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080A18D6 - ldr r0, =gUnknown_02037FD4 - ldrh r2, [r0, 0x4] - lsls r2, 21 - lsrs r2, 27 - ldrh r3, [r0, 0x6] - lsls r3, 17 - lsrs r3, 17 - movs r0, 0x80 - movs r1, 0x10 - bl pal_fade_1 - ldr r1, =gUnknown_03000F3C - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _080A18D6 - ldr r0, =gUnknown_03000F44 - str r1, [r0] -_080A18D6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A1884 - - thumb_func_start decompress_palette -@ void decompress_palette(void *src, u16 offset, u16 size) -decompress_palette: @ 80A18F4 - push {r4-r6,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - ldr r6, =gUnknown_02037FE8 - adds r1, r6, 0 - bl LZDecompressWram - lsls r4, 1 - ldr r1, =gUnknown_02037714 - adds r1, r4, r1 - lsrs r5, 17 - adds r0, r6, 0 - adds r2, r5, 0 - bl CpuSet - ldr r0, =gUnknown_02037B14 - adds r4, r0 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl CpuSet - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end decompress_palette - - thumb_func_start gpu_pal_apply -@ void gpu_pal_apply(void *src, int dest_offset, int mode) -gpu_pal_apply: @ 80A1938 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsls r5, 16 - lsrs r4, 15 - ldr r1, =gUnknown_02037714 - adds r1, r4, r1 - lsrs r5, 17 - adds r2, r5, 0 - bl CpuSet - ldr r0, =gUnknown_02037B14 - adds r4, r0 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl CpuSet - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end gpu_pal_apply - - thumb_func_start rboxid_80040B8 -rboxid_80040B8: @ 80A1970 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r6, 16 - lsrs r6, 16 - lsls r4, 16 - lsls r5, 16 - mov r0, sp - strh r6, [r0] - lsrs r4, 15 - ldr r1, =gUnknown_02037714 - adds r1, r4, r1 - lsrs r5, 17 - movs r0, 0x80 - lsls r0, 17 - orrs r5, r0 - mov r0, sp - adds r2, r5, 0 - bl CpuSet - mov r0, sp - adds r0, 0x2 - strh r6, [r0] - ldr r1, =gUnknown_02037B14 - adds r4, r1 - adds r1, r4, 0 - adds r2, r5, 0 - bl CpuSet - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end rboxid_80040B8 - - thumb_func_start copy_pal_bg_faded_to_pal_ram -@ void copy_pal_bg_faded_to_pal_ram() -copy_pal_bg_faded_to_pal_ram: @ 80A19C0 - push {r4,r5,lr} - ldr r4, =gUnknown_02037FD4 - ldrb r1, [r4, 0x8] - movs r5, 0x80 - adds r0, r5, 0 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _080A1A02 - ldr r1, =gUnknown_02037B14 - movs r2, 0xA0 - lsls r2, 19 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000200 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - ldr r0, =gUnknown_02037FE4 - str r3, [r0] - ldrb r1, [r4, 0x9] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - bne _080A1A02 - ldrb r1, [r4, 0x7] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080A1A02 - bl sub_80A2968 -_080A1A02: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end copy_pal_bg_faded_to_pal_ram - - thumb_func_start fade_and_return_progress_probably -@ int fade_and_return_progress_probably() -fade_and_return_progress_probably: @ 80A1A1C - push {lr} - ldr r0, =gUnknown_02037FE4 - ldr r0, [r0] - cmp r0, 0 - beq _080A1A30 - movs r0, 0xFF - b _080A1A68 - .pool -_080A1A30: - ldr r0, =gUnknown_02037FD4 - ldrb r0, [r0, 0x9] - movs r1, 0x3 - ands r1, r0 - cmp r1, 0 - bne _080A1A48 - bl pal_fade__0 - b _080A1A56 - .pool -_080A1A48: - cmp r1, 0x1 - bne _080A1A52 - bl pal_fade__1 - b _080A1A56 -_080A1A52: - bl pal_fade__2 -_080A1A56: - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gUnknown_02037FE4 - ldr r0, =gUnknown_02037FD4 - ldr r0, [r0] - movs r1, 0 - orrs r0, r1 - str r0, [r2] - adds r0, r3, 0 -_080A1A68: - pop {r1} - bx r1 - .pool - thumb_func_end fade_and_return_progress_probably - - thumb_func_start sub_80A1A74 -sub_80A1A74: @ 80A1A74 - push {r4,lr} - movs r4, 0 -_080A1A78: - adds r0, r4, 0 - bl palslot_dead_struct_update - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080A1A78 - bl pal_fade_control_reset_maybe - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A1A74 - - thumb_func_start sub_80A1A94 -sub_80A1A94: @ 80A1A94 - push {r4-r7,lr} - movs r0, 0xA0 - lsls r0, 19 - mov r12, r0 - movs r4, 0 - ldr r7, =gUnknown_02037714 - ldr r6, =gUnknown_02037B14 - ldr r5, =0x000001ff -_080A1AA4: - lsls r1, r4, 1 - adds r3, r1, r7 - mov r0, r12 - adds r2, r1, r0 - ldrh r0, [r2] - strh r0, [r3] - adds r1, r6 - ldrh r0, [r2] - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r5 - bls _080A1AA4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A1A94 - - thumb_func_start pal_fade_maybe -pal_fade_maybe: @ 80A1AD4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - ldr r0, [sp, 0x18] - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r12, r2 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r5, =gUnknown_02037FD4 - ldrb r1, [r5, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080A1B08 - movs r0, 0 - b _080A1C00 - .pool -_080A1B08: - ldrb r0, [r5, 0xA] - movs r3, 0x79 - negs r3, r3 - adds r2, r3, 0 - ands r2, r0 - movs r0, 0x10 - orrs r2, r0 - strb r2, [r5, 0xA] - lsls r0, r6, 24 - asrs r1, r0, 24 - cmp r1, 0 - bge _080A1B36 - lsls r0, r2, 25 - lsrs r0, 28 - negs r1, r1 - adds r0, r1 - movs r1, 0xF - ands r0, r1 - lsls r0, 3 - ands r2, r3 - orrs r2, r0 - strb r2, [r5, 0xA] - movs r6, 0 -_080A1B36: - str r4, [r5] - movs r4, 0x3F - adds r1, r6, 0 - ands r1, r4 - ldrb r2, [r5, 0x4] - movs r3, 0x40 - negs r3, r3 - adds r0, r3, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x4] - ands r6, r4 - ldrb r0, [r5, 0x8] - ands r3, r0 - orrs r3, r6 - strb r3, [r5, 0x8] - movs r0, 0x1F - mov r1, r12 - ands r1, r0 - lsls r1, 6 - ldrh r2, [r5, 0x4] - ldr r0, =0xfffff83f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - lsls r2, r7, 3 - ldrb r1, [r5, 0x5] - movs r0, 0x7 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - ldr r1, =0x00007fff - mov r0, r8 - ands r1, r0 - ldrh r2, [r5, 0x6] - ldr r0, =0xffff8000 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x6] - ldrb r0, [r5, 0x7] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r5, 0x7] - ldrb r1, [r5, 0x9] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x9] - cmp r12, r7 - bcs _080A1BB0 - movs r0, 0x41 - negs r0, r0 - ands r3, r0 - b _080A1BB4 - .pool -_080A1BB0: - movs r0, 0x40 - orrs r3, r0 -_080A1BB4: - strb r3, [r5, 0x8] - bl fade_and_return_progress_probably - ldr r4, =gUnknown_02037FD4 - ldrb r1, [r4, 0x8] - lsrs r5, r1, 7 - movs r0, 0x7F - ands r0, r1 - strb r0, [r4, 0x8] - ldr r0, =gUnknown_02037B14 - movs r1, 0xA0 - lsls r1, 19 - ldr r2, =0x04000100 - bl CpuSet - ldr r1, =gUnknown_02037FE4 - movs r0, 0 - str r0, [r1] - ldrb r1, [r4, 0x9] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - bne _080A1BF0 - ldrb r1, [r4, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080A1BF0 - bl sub_80A2968 -_080A1BF0: - ldr r2, =gUnknown_02037FD4 - lsls r3, r5, 7 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - orrs r0, r3 - strb r0, [r2, 0x8] - movs r0, 0x1 -_080A1C00: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pal_fade_maybe - - thumb_func_start sub_80A1C1C -sub_80A1C1C: @ 80A1C1C - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x8 - mov r8, r0 - adds r4, r1, 0 - adds r6, r2, 0 - ldr r5, [sp, 0x1C] - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 16 - lsrs r5, 16 - str r3, [sp, 0x4] - bl sub_80A1A94 - lsls r4, 24 - asrs r4, 24 - str r5, [sp] - mov r0, r8 - adds r1, r4, 0 - adds r2, r6, 0 - ldr r3, [sp, 0x4] - bl pal_fade_maybe - lsls r0, 24 - lsrs r0, 24 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80A1C1C - - thumb_func_start sub_80A1C64 -sub_80A1C64: @ 80A1C64 - push {r4-r7,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - movs r5, 0 -_080A1C6E: - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - ldr r1, =gUnknown_02037F14 - adds r4, r0, r1 - ldrb r0, [r4, 0x4] - lsls r0, 31 - cmp r0, 0 - beq _080A1CCC - ldr r2, [r4] - ldrb r0, [r2, 0x8] - lsls r0, 31 - lsrs r0, 31 - cmp r0, r7 - bne _080A1CCC - ldrh r1, [r4, 0x6] - lsls r1, 20 - lsrs r1, 25 - ldrb r0, [r2, 0xB] - lsls r0, 27 - lsrs r0, 27 - cmp r1, r0 - bne _080A1CAA - adds r0, r4, 0 - bl sub_80A1F00 - ldrb r0, [r4, 0x4] - lsls r0, 31 - cmp r0, 0 - beq _080A1CCC -_080A1CAA: - ldrb r0, [r4, 0x8] - cmp r0, 0 - bne _080A1CC0 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_80A1CDC - b _080A1CC4 - .pool -_080A1CC0: - subs r0, 0x1 - strb r0, [r4, 0x8] -_080A1CC4: - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_80A1E40 -_080A1CCC: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xF - bls _080A1C6E - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A1C64 - - thumb_func_start sub_80A1CDC -sub_80A1CDC: @ 80A1CDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - mov r8, r1 - movs r6, 0 - ldrh r1, [r4, 0x6] - lsls r1, 20 - lsrs r1, 25 - ldr r3, [r4] - ldrb r0, [r3, 0x9] - lsls r2, r0, 25 - lsrs r0, r2, 27 - adds r5, r1, 0 - muls r5, r0 - ldrb r1, [r3, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080A1D78 - lsrs r0, r2, 27 - cmp r6, r0 - bcs _080A1DC4 - ldr r0, =gUnknown_02037714 - mov r12, r0 - ldr r7, =gUnknown_02037B14 -_080A1D10: - ldr r0, [r4, 0x4] - lsls r0, 11 - lsrs r0, 22 - lsls r0, 1 - add r0, r12 - ldr r1, [r3, 0x4] - lsls r2, r5, 1 - adds r1, r2, r1 - ldrh r1, [r1] - strh r1, [r0] - ldr r0, [r4, 0x4] - lsls r0, 11 - lsrs r0, 22 - lsls r0, 1 - adds r0, r7 - ldr r1, [r4] - ldr r1, [r1, 0x4] - adds r2, r1 - ldrh r1, [r2] - strh r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, [r4, 0x4] - lsls r1, r2, 11 - lsrs r1, 22 - adds r1, 0x1 - ldr r0, =0x000003ff - ands r1, r0 - lsls r1, 11 - ldr r0, =0xffe007ff - ands r0, r2 - orrs r0, r1 - str r0, [r4, 0x4] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r3, [r4] - ldrb r0, [r3, 0x9] - lsls r0, 25 - lsrs r0, 27 - cmp r6, r0 - bcc _080A1D10 - b _080A1DC4 - .pool -_080A1D78: - lsrs r0, r2, 27 - cmp r6, r0 - bcs _080A1DC4 - ldr r3, =gUnknown_02037B14 -_080A1D80: - ldr r1, [r4, 0x4] - lsls r1, 11 - lsrs r1, 22 - lsls r1, 1 - adds r1, r3 - ldr r0, [r4] - ldr r2, [r0, 0x4] - lsls r0, r5, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, [r4, 0x4] - lsls r1, r2, 11 - lsrs r1, 22 - adds r1, 0x1 - ldr r0, =0x000003ff - ands r1, r0 - lsls r1, 11 - ldr r0, =0xffe007ff - ands r0, r2 - orrs r0, r1 - str r0, [r4, 0x4] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, [r4] - ldrb r0, [r0, 0x9] - lsls r0, 25 - lsrs r0, 27 - cmp r6, r0 - bcc _080A1D80 -_080A1DC4: - ldrh r0, [r4, 0x4] - lsls r0, 21 - lsrs r0, 23 - lsls r0, 11 - ldr r1, [r4, 0x4] - ldr r2, =0xffe007ff - ands r1, r2 - orrs r1, r0 - str r1, [r4, 0x4] - ldr r3, [r4] - ldrb r0, [r3, 0xA] - strb r0, [r4, 0x8] - ldrh r2, [r4, 0x6] - lsls r0, r2, 20 - lsrs r0, 25 - adds r0, 0x1 - movs r1, 0x7F - ands r0, r1 - lsls r0, 5 - ldr r5, =0xfffff01f - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strh r1, [r4, 0x6] - lsls r1, 20 - lsrs r1, 25 - ldrb r0, [r3, 0xB] - lsls r0, 27 - lsrs r0, 27 - cmp r1, r0 - blt _080A1E14 - ldrb r0, [r4, 0x9] - cmp r0, 0 - beq _080A1E0C - subs r0, 0x1 - strb r0, [r4, 0x9] -_080A1E0C: - ldrh r1, [r4, 0x6] - adds r0, r5, 0 - ands r0, r1 - strh r0, [r4, 0x6] -_080A1E14: - ldrh r0, [r4, 0x4] - lsls r0, 21 - lsrs r0, 27 - movs r1, 0x1 - lsls r1, r0 - mov r2, r8 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A1CDC - - thumb_func_start sub_80A1E40 -sub_80A1E40: @ 80A1E40 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r3, =gUnknown_02037FD4 - ldrb r1, [r3, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080A1EF4 - ldrh r0, [r4, 0x4] - lsls r0, 21 - lsrs r6, r0, 23 - asrs r1, r6, 4 - movs r5, 0x1 - adds r0, r5, 0 - lsls r0, r1 - ldr r1, [r3] - ands r0, r1 - cmp r0, 0 - beq _080A1EF4 - ldr r2, [r4] - ldrb r1, [r2, 0x8] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _080A1E9C - ldrb r1, [r3, 0x4] - lsls r1, 26 - ldrb r0, [r3, 0x8] - lsls r0, 26 - cmp r1, r0 - beq _080A1EF4 - adds r0, r6, 0 - ldrb r1, [r2, 0x9] - lsls r1, 25 - lsrs r1, 27 - ldrh r2, [r3, 0x4] - lsls r2, 21 - lsrs r2, 27 - ldrh r3, [r3, 0x6] - lsls r3, 17 - lsrs r3, 17 - bl pal_fade_1 - b _080A1EF4 - .pool -_080A1E9C: - ldrb r1, [r3, 0x4] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - bne _080A1EF4 - ldrb r0, [r4, 0x8] - ldrb r1, [r2, 0xA] - cmp r0, r1 - beq _080A1EF4 - ldrh r0, [r4, 0x6] - lsls r0, 20 - lsrs r0, 25 - ldrb r1, [r2, 0x9] - lsls r1, 25 - lsrs r2, r1, 27 - adds r5, r0, 0 - muls r5, r2 - movs r3, 0 - adds r1, r2, 0 - cmp r3, r1 - bcs _080A1EF4 - ldr r6, =gUnknown_02037B14 -_080A1EC8: - ldrh r1, [r4, 0x4] - lsls r1, 21 - lsrs r1, 23 - adds r1, r3 - lsls r1, 1 - adds r1, r6 - ldr r2, [r4] - adds r0, r5, r3 - ldr r2, [r2, 0x4] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, [r4] - ldrb r0, [r0, 0x9] - lsls r0, 25 - lsrs r0, 27 - cmp r3, r0 - bcc _080A1EC8 -_080A1EF4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A1E40 - - thumb_func_start sub_80A1F00 -sub_80A1F00: @ 80A1F00 - push {lr} - adds r3, r0, 0 - ldrb r0, [r3, 0x9] - cmp r0, 0 - bne _080A1F50 - ldr r2, [r3] - ldrb r0, [r2, 0xB] - lsrs r0, 5 - cmp r0, 0 - bne _080A1F40 - ldrh r1, [r3, 0x6] - ldr r0, =0xfffff01f - ands r0, r1 - strh r0, [r3, 0x6] - ldrb r0, [r2, 0xA] - strb r0, [r3, 0x8] - ldrb r0, [r2, 0xC] - strb r0, [r3, 0x9] - ldrh r0, [r3, 0x4] - lsls r0, 21 - lsrs r0, 23 - lsls r0, 11 - ldr r1, [r3, 0x4] - ldr r2, =0xffe007ff - ands r1, r2 - orrs r1, r0 - str r1, [r3, 0x4] - b _080A1F54 - .pool -_080A1F40: - cmp r0, 0 - blt _080A1F54 - cmp r0, 0x2 - bgt _080A1F54 - ldrh r0, [r2] - bl sub_80A1F58 - b _080A1F54 -_080A1F50: - subs r0, 0x1 - strb r0, [r3, 0x9] -_080A1F54: - pop {r0} - bx r0 - thumb_func_end sub_80A1F00 - - thumb_func_start sub_80A1F58 -sub_80A1F58: @ 80A1F58 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_80A20A4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _080A1F6E - bl palslot_dead_struct_update -_080A1F6E: - pop {r0} - bx r0 - thumb_func_end sub_80A1F58 - - thumb_func_start palslot_dead_struct_update -palslot_dead_struct_update: @ 80A1F74 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_02037F14 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldr r0, =gUnknown_0852488C - str r0, [r1] - ldrb r2, [r1, 0x4] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x4] - ldrh r2, [r1, 0x4] - ldr r0, =0xfffff803 - ands r0, r2 - strh r0, [r1, 0x4] - ldr r0, [r1, 0x4] - ldr r2, =0xffe007ff - ands r0, r2 - str r0, [r1, 0x4] - ldrh r2, [r1, 0x6] - ldr r0, =0xfffff01f - ands r0, r2 - strh r0, [r1, 0x6] - ldrb r2, [r1, 0x4] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x4] - movs r0, 0 - strb r0, [r1, 0x8] - strb r0, [r1, 0x9] - bx lr - .pool - thumb_func_end palslot_dead_struct_update - - thumb_func_start pal_fade_control_reset_maybe -pal_fade_control_reset_maybe: @ 80A1FD0 - ldr r2, =gUnknown_02037FD4 - movs r0, 0 - str r0, [r2] - subs r0, 0x40 - ldrb r1, [r2, 0x4] - ands r0, r1 - strb r0, [r2, 0x4] - ldrh r1, [r2, 0x4] - ldr r0, =0xfffff83f - ands r0, r1 - strh r0, [r2, 0x4] - ldrb r1, [r2, 0x5] - movs r0, 0x7 - ands r0, r1 - strb r0, [r2, 0x5] - ldrh r1, [r2, 0x6] - ldr r0, =0xffff8000 - ands r0, r1 - strh r0, [r2, 0x6] - ldrb r1, [r2, 0x7] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x7] - movs r0, 0 - strb r0, [r2, 0x8] - ldrb r1, [r2, 0x9] - movs r3, 0x5 - negs r3, r3 - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x9 - negs r1, r1 - ands r0, r1 - strb r0, [r2, 0x9] - ldrb r1, [r2, 0xA] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xA] - ldr r0, [r2, 0x8] - ldr r1, =0xfffe0fff - ands r0, r1 - str r0, [r2, 0x8] - ldrb r0, [r2, 0xA] - ands r3, r0 - movs r0, 0x79 - negs r0, r0 - ands r3, r0 - movs r0, 0x10 - orrs r3, r0 - strb r3, [r2, 0xA] - bx lr - .pool - thumb_func_end pal_fade_control_reset_maybe - - thumb_func_start sub_80A2048 -sub_80A2048: @ 80A2048 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_80A20A4 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x10 - beq _080A206C - ldr r1, =gUnknown_02037F14 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x4] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0, 0x4] -_080A206C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2048 - - thumb_func_start sub_80A2074 -sub_80A2074: @ 80A2074 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_80A20A4 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x10 - beq _080A209A - ldr r0, =gUnknown_02037F14 - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x4] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x4] -_080A209A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2074 - - thumb_func_start sub_80A20A4 -sub_80A20A4: @ 80A20A4 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0 - ldr r3, =gUnknown_02037F14 -_080A20AE: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, r2 - bne _080A20C8 - adds r0, r1, 0 - b _080A20D4 - .pool -_080A20C8: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _080A20AE - movs r0, 0x10 -_080A20D4: - pop {r1} - bx r1 - thumb_func_end sub_80A20A4 - - thumb_func_start pal_fade__0 -pal_fade__0: @ 80A20D8 - push {r4-r7,lr} - ldr r4, =gUnknown_02037FD4 - ldrb r1, [r4, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080A20F0 - movs r0, 0 - b _080A220C - .pool -_080A20F0: - bl sub_80A29BC - lsls r0, 24 - cmp r0, 0 - beq _080A20FE - ldrb r0, [r4, 0x7] - b _080A220A -_080A20FE: - ldrb r1, [r4, 0xA] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080A2132 - ldrb r2, [r4, 0x4] - lsls r1, r2, 26 - ldrb r0, [r4, 0x8] - lsls r0, 26 - cmp r1, r0 - bcs _080A212A - lsrs r0, r1, 26 - adds r0, 0x1 - movs r1, 0x3F - ands r0, r1 - movs r1, 0x40 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x4] - movs r0, 0x2 - b _080A220C -_080A212A: - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - strb r0, [r4, 0x4] -_080A2132: - movs r5, 0 - ldr r2, =gUnknown_02037FD4 - ldrb r1, [r2, 0xA] - movs r0, 0x4 - ands r0, r1 - adds r7, r2, 0 - cmp r0, 0 - bne _080A214C - ldrh r4, [r7] - b _080A2152 - .pool -_080A214C: - ldrh r4, [r7, 0x2] - movs r5, 0x80 - lsls r5, 1 -_080A2152: - cmp r4, 0 - beq _080A2184 - ldr r7, =gUnknown_02037FD4 - adds r6, r7, 0 -_080A215A: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _080A2176 - ldrh r2, [r6, 0x4] - lsls r2, 21 - lsrs r2, 27 - ldrh r3, [r6, 0x6] - lsls r3, 17 - lsrs r3, 17 - adds r0, r5, 0 - movs r1, 0x10 - bl pal_fade_1 -_080A2176: - lsrs r4, 1 - adds r0, r5, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - bne _080A215A -_080A2184: - ldrb r2, [r7, 0xA] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r4, 0x5 - negs r4, r4 - ands r4, r2 - orrs r4, r1 - strb r4, [r7, 0xA] - movs r0, 0x4 - ands r0, r4 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _080A2208 - ldrh r6, [r7, 0x4] - lsls r2, r6, 21 - ldrb r0, [r7, 0x5] - lsls r5, r0, 24 - lsrs r1, r2, 27 - lsrs r0, r5, 27 - cmp r1, r0 - bne _080A21C4 - str r3, [r7] - movs r0, 0x2 - orrs r4, r0 - strb r4, [r7, 0xA] - b _080A2208 - .pool -_080A21C4: - ldrb r1, [r7, 0x8] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080A21E0 - lsrs r3, r2, 27 - lsls r0, r4, 25 - lsrs r0, 28 - adds r3, r0, r3 - lsrs r0, r5, 27 - cmp r3, r0 - ble _080A21F6 - adds r3, r0, 0 - b _080A21F6 -_080A21E0: - lsrs r3, r2, 27 - lsls r0, r4, 25 - lsrs r0, 28 - subs r0, r3, r0 - lsls r0, 24 - lsrs r3, r0, 24 - asrs r0, 24 - lsrs r1, r5, 27 - cmp r0, r1 - bge _080A21F6 - adds r3, r1, 0 -_080A21F6: - lsls r0, r3, 24 - asrs r0, 24 - movs r1, 0x1F - ands r0, r1 - lsls r0, 6 - ldr r1, =0xfffff83f - ands r1, r6 - orrs r1, r0 - strh r1, [r7, 0x4] -_080A2208: - ldrb r0, [r7, 0x7] -_080A220A: - lsrs r0, 7 -_080A220C: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pal_fade__0 - - thumb_func_start sub_80A2218 -sub_80A2218: @ 80A2218 - push {r4-r7,lr} - adds r1, r0, 0 - movs r3, 0 - cmp r1, 0 - beq _080A2256 - ldr r7, =gUnknown_02037B14 -_080A2224: - movs r0, 0x1 - ands r0, r1 - lsrs r4, r1, 1 - adds r5, r3, 0 - adds r5, 0x10 - cmp r0, 0 - beq _080A224C - movs r2, 0 - adds r6, r7, 0 -_080A2236: - adds r0, r3, r2 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r0] - mvns r1, r1 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080A2236 -_080A224C: - adds r1, r4, 0 - lsls r0, r5, 16 - lsrs r3, r0, 16 - cmp r1, 0 - bne _080A2224 -_080A2256: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2218 - - thumb_func_start sub_80A2260 -sub_80A2260: @ 80A2260 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x4] - movs r0, 0 - mov r9, r0 - cmp r4, 0 - beq _080A231C - lsls r1, 24 - str r1, [sp, 0x8] -_080A228A: - movs r0, 0x1 - ands r0, r4 - lsrs r4, 1 - str r4, [sp, 0xC] - movs r1, 0x10 - add r1, r9 - mov r10, r1 - cmp r0, 0 - beq _080A230E - movs r4, 0 - ldr r2, =gUnknown_02037B14 - mov r8, r2 - ldr r1, [sp] - lsls r0, r1, 24 - ldr r2, [sp, 0x4] - lsls r1, r2, 24 - ldr r2, [sp, 0x8] - asrs r2, 24 - mov r12, r2 - movs r5, 0x1F - asrs r7, r0, 24 - asrs r6, r1, 24 -_080A22B6: - mov r0, r9 - adds r2, r0, r4 - lsls r2, 1 - add r2, r8 - ldr r1, [r2] - lsls r1, 27 - lsrs r1, 27 - add r1, r12 - ands r1, r5 - ldrb r3, [r2] - movs r0, 0x20 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r1, [r2] - lsls r1, 22 - lsrs r1, 27 - adds r1, r7 - movs r0, 0x1F - ands r1, r0 - lsls r1, 5 - ldrh r3, [r2] - ldr r0, =0xfffffc1f - ands r0, r3 - orrs r0, r1 - strh r0, [r2] - ldr r1, [r2] - lsls r1, 17 - lsrs r1, 27 - adds r1, r6 - ands r1, r5 - lsls r1, 2 - ldrb r3, [r2, 0x1] - movs r0, 0x7D - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080A22B6 -_080A230E: - ldr r4, [sp, 0xC] - mov r1, r10 - lsls r0, r1, 16 - lsrs r0, 16 - mov r9, r0 - cmp r4, 0 - bne _080A228A -_080A231C: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2260 - - thumb_func_start sub_80A2334 -sub_80A2334: @ 80A2334 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r1, r0, 0 - movs r3, 0 - cmp r1, 0 - beq _080A237E - ldr r0, =gUnknown_02037B14 - mov r8, r0 - ldr r0, =gUnknown_02037714 - mov r12, r0 -_080A234A: - movs r0, 0x1 - ands r0, r1 - lsrs r4, r1, 1 - adds r5, r3, 0 - adds r5, 0x10 - cmp r0, 0 - beq _080A2374 - movs r2, 0 - mov r7, r8 - mov r6, r12 -_080A235E: - adds r0, r3, r2 - lsls r0, 1 - adds r1, r0, r7 - adds r0, r6 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080A235E -_080A2374: - adds r1, r4, 0 - lsls r0, r5, 16 - lsrs r3, r0, 16 - cmp r1, 0 - bne _080A234A -_080A237E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2334 - - thumb_func_start sub_80A2390 -sub_80A2390: @ 80A2390 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_02037FD4 - ldrb r2, [r3, 0xA] - movs r1, 0x79 - negs r1, r1 - ands r1, r2 - movs r2, 0x10 - orrs r1, r2 - strb r1, [r3, 0xA] - bl sub_80A23B4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2390 - - thumb_func_start sub_80A23B4 -sub_80A23B4: @ 80A23B4 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r2, =gUnknown_02037FD4 - ldrh r0, [r2, 0x4] - movs r3, 0xF8 - lsls r3, 3 - adds r1, r3, 0 - orrs r0, r1 - strh r0, [r2, 0x4] - movs r1, 0x3F - ands r1, r4 - ldrb r3, [r2, 0x8] - movs r0, 0x40 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x8] - ldrb r0, [r2, 0x7] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x7] - ldrb r1, [r2, 0x9] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - cmp r4, 0x2 - bne _080A2406 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02037B14 - ldr r2, =0x01000200 - mov r0, sp - bl CpuSet -_080A2406: - cmp r4, 0 - bne _080A241C - mov r0, sp - adds r0, 0x2 - ldr r2, =0x00007fff - adds r1, r2, 0 - strh r1, [r0] - ldr r1, =gUnknown_02037B14 - ldr r2, =0x01000200 - bl CpuSet -_080A241C: - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A23B4 - - thumb_func_start pal_fade__1 -pal_fade__1: @ 80A2438 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r4, =gUnknown_02037FD4 - ldrb r1, [r4, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080A2458 - movs r0, 0 - b _080A2792 - .pool -_080A2458: - bl sub_80A29BC - lsls r0, 24 - cmp r0, 0 - beq _080A2466 - ldrb r0, [r4, 0x7] - b _080A2790 -_080A2466: - ldrb r1, [r4, 0xA] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080A247C - movs r2, 0x80 - lsls r2, 1 - movs r0, 0x80 - lsls r0, 2 - mov r10, r0 - b _080A2484 -_080A247C: - movs r2, 0 - movs r1, 0x80 - lsls r1, 1 - mov r10, r1 -_080A2484: - ldr r1, =gUnknown_02037FD4 - ldrb r0, [r1, 0x8] - lsls r0, 26 - lsrs r0, 26 - cmp r0, 0x1 - beq _080A2544 - cmp r0, 0x1 - bgt _080A24A0 - cmp r0, 0 - beq _080A24AE - b _080A2694 - .pool -_080A24A0: - cmp r0, 0x2 - bne _080A24A6 - b _080A25A8 -_080A24A6: - cmp r0, 0x3 - bne _080A24AC - b _080A2630 -_080A24AC: - b _080A2694 -_080A24AE: - adds r7, r2, 0 - cmp r7, r10 - bcc _080A24B6 - b _080A2694 -_080A24B6: - lsls r2, r7, 1 - ldr r0, =gUnknown_02037714 - adds r0, r2, r0 - ldr r1, [r0] - lsls r3, r1, 27 - lsls r0, r1, 22 - lsrs r0, 27 - mov r12, r0 - lsls r1, 17 - lsrs r1, 27 - mov r8, r1 - ldr r0, =gUnknown_02037B14 - adds r2, r0 - mov r9, r2 - ldr r1, [r2] - lsls r2, r1, 27 - lsrs r2, 3 - movs r4, 0xFE - lsls r4, 24 - adds r2, r4 - lsls r0, r1, 22 - lsrs r0, 27 - subs r0, 0x2 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 17 - lsrs r1, 27 - subs r1, 0x2 - lsls r1, 24 - lsrs r4, r1, 24 - lsrs r6, r2, 24 - asrs r2, 24 - lsrs r3, 3 - asrs r0, r3, 24 - cmp r2, r0 - bge _080A2500 - lsrs r6, r3, 24 -_080A2500: - lsls r0, r5, 24 - asrs r0, 24 - mov r2, r12 - lsls r1, r2, 24 - cmp r0, r12 - bge _080A250E - lsrs r5, r1, 24 -_080A250E: - lsls r0, r4, 24 - asrs r0, 24 - mov r3, r8 - lsls r1, r3, 24 - cmp r0, r8 - bge _080A251C - lsrs r4, r1, 24 -_080A251C: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 24 - asrs r0, 19 - orrs r1, r0 - lsls r0, r4, 24 - asrs r0, 14 - orrs r1, r0 - mov r4, r9 - strh r1, [r4] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, r10 - bcc _080A24B6 - b _080A2694 - .pool -_080A2544: - adds r7, r2, 0 - cmp r7, r10 - bcc _080A254C - b _080A2694 -_080A254C: - lsls r1, r7, 1 - ldr r0, =gUnknown_02037B14 - adds r2, r1, r0 - ldr r1, [r2] - lsls r0, r1, 27 - lsrs r0, 3 - movs r3, 0x80 - lsls r3, 18 - adds r0, r3 - lsrs r6, r0, 24 - lsls r0, r1, 22 - lsrs r0, 27 - adds r5, r0, 0x2 - lsls r1, 17 - lsrs r1, 27 - adds r4, r1, 0x2 - cmp r6, 0x1F - ble _080A2572 - movs r6, 0x1F -_080A2572: - lsls r0, r5, 24 - asrs r0, 24 - cmp r0, 0x1F - ble _080A257C - movs r5, 0x1F -_080A257C: - lsls r0, r4, 24 - asrs r0, 24 - cmp r0, 0x1F - ble _080A2586 - movs r4, 0x1F -_080A2586: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 24 - asrs r0, 19 - orrs r1, r0 - lsls r0, r4, 24 - asrs r0, 14 - orrs r1, r0 - strh r1, [r2] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, r10 - bcc _080A254C - b _080A2694 - .pool -_080A25A8: - adds r7, r2, 0 - cmp r7, r10 - bcs _080A2694 -_080A25AE: - lsls r2, r7, 1 - ldr r0, =gUnknown_02037714 - adds r0, r2, r0 - ldr r1, [r0] - lsls r3, r1, 27 - lsls r0, r1, 22 - lsrs r0, 27 - mov r12, r0 - lsls r1, 17 - lsrs r1, 27 - mov r8, r1 - ldr r0, =gUnknown_02037B14 - adds r2, r0 - ldr r1, [r2] - lsls r0, r1, 27 - lsrs r0, 3 - movs r4, 0x80 - lsls r4, 18 - adds r0, r4 - lsrs r6, r0, 24 - lsls r0, r1, 22 - lsrs r0, 27 - adds r5, r0, 0x2 - lsls r1, 17 - lsrs r1, 27 - adds r4, r1, 0x2 - lsrs r3, 3 - asrs r0, r3, 24 - cmp r6, r0 - ble _080A25EC - lsrs r6, r3, 24 -_080A25EC: - lsls r0, r5, 24 - asrs r0, 24 - mov r3, r12 - lsls r1, r3, 24 - cmp r0, r12 - ble _080A25FA - lsrs r5, r1, 24 -_080A25FA: - lsls r0, r4, 24 - asrs r0, 24 - mov r3, r8 - lsls r1, r3, 24 - cmp r0, r8 - ble _080A2608 - lsrs r4, r1, 24 -_080A2608: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 24 - asrs r0, 19 - orrs r1, r0 - lsls r0, r4, 24 - asrs r0, 14 - orrs r1, r0 - strh r1, [r2] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, r10 - bcc _080A25AE - b _080A2694 - .pool -_080A2630: - adds r7, r2, 0 - cmp r7, r10 - bcs _080A2694 - ldr r4, =gUnknown_02037B14 - mov r8, r4 -_080A263A: - lsls r0, r7, 1 - mov r1, r8 - adds r3, r0, r1 - ldr r1, [r3] - lsls r2, r1, 27 - lsrs r2, 3 - movs r4, 0xFE - lsls r4, 24 - adds r2, r4 - lsls r0, r1, 22 - lsrs r0, 27 - subs r0, 0x2 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 17 - lsrs r1, 27 - subs r1, 0x2 - lsls r1, 24 - lsrs r4, r1, 24 - lsrs r6, r2, 24 - cmp r2, 0 - bge _080A2668 - movs r6, 0 -_080A2668: - lsls r0, r5, 24 - cmp r0, 0 - bge _080A2670 - movs r5, 0 -_080A2670: - lsls r0, r4, 24 - cmp r0, 0 - bge _080A2678 - movs r4, 0 -_080A2678: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 24 - asrs r0, 19 - orrs r1, r0 - lsls r0, r4, 24 - asrs r0, 14 - orrs r1, r0 - strh r1, [r3] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, r10 - bcc _080A263A -_080A2694: - ldr r0, =gUnknown_02037FD4 - ldrb r2, [r0, 0xA] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r3, 0x5 - negs r3, r3 - ands r3, r2 - orrs r3, r1 - ldr r1, =gUnknown_02037FD4 - strb r3, [r1, 0xA] - movs r0, 0x4 - ands r0, r3 - cmp r0, 0 - beq _080A26C4 - ldrb r0, [r1, 0x7] - b _080A2790 - .pool -_080A26C4: - ldr r2, =gUnknown_02037FD4 - ldrh r4, [r2, 0x4] - lsls r5, r4, 21 - lsrs r0, r5, 27 - lsls r2, r3, 25 - lsrs r1, r2, 28 - subs r0, r1 - cmp r0, 0 - bge _080A26E8 - ldr r0, =0xfffff83f - ands r0, r4 - ldr r3, =gUnknown_02037FD4 - strh r0, [r3, 0x4] - b _080A26FE - .pool -_080A26E8: - lsrs r1, r5, 27 - lsrs r0, r2, 28 - subs r1, r0 - movs r0, 0x1F - ands r1, r0 - lsls r1, 6 - ldr r0, =0xfffff83f - ands r0, r4 - orrs r0, r1 - ldr r4, =gUnknown_02037FD4 - strh r0, [r4, 0x4] -_080A26FE: - ldr r1, =gUnknown_02037FD4 - ldrh r0, [r1, 0x4] - movs r1, 0xF8 - lsls r1, 3 - ands r1, r0 - cmp r1, 0 - bne _080A278C - ldr r2, =gUnknown_02037FD4 - ldrb r0, [r2, 0x8] - lsls r0, 26 - lsrs r0, 26 - cmp r0, 0x1 - beq _080A2750 - cmp r0, 0x1 - bgt _080A272C - cmp r0, 0 - beq _080A2736 - b _080A2778 - .pool -_080A272C: - cmp r0, 0x2 - beq _080A2736 - cmp r0, 0x3 - beq _080A276C - b _080A2778 -_080A2736: - ldr r0, =gUnknown_02037714 - ldr r1, =gUnknown_02037B14 - ldr r2, =0x04000100 - bl CpuSet - b _080A2778 - .pool -_080A2750: - movs r0, 0x1 - negs r0, r0 - str r0, [sp] - ldr r1, =gUnknown_02037B14 - ldr r2, =0x05000100 - mov r0, sp - bl CpuSet - b _080A2778 - .pool -_080A276C: - str r1, [sp, 0x4] - add r0, sp, 0x4 - ldr r1, =gUnknown_02037B14 - ldr r2, =0x05000100 - bl CpuSet -_080A2778: - ldr r2, =gUnknown_02037FD4 - ldrb r1, [r2, 0x9] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x9] - ldrb r0, [r2, 0xA] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0xA] -_080A278C: - ldr r3, =gUnknown_02037FD4 - ldrb r0, [r3, 0x7] -_080A2790: - lsrs r0, 7 -_080A2792: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pal_fade__1 - - thumb_func_start sub_80A27B0 -sub_80A27B0: @ 80A27B0 - push {r4-r7,lr} - ldr r5, [sp, 0x14] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r7, =gUnknown_02037FD4 - str r0, [r7] - movs r0, 0x3F - ands r1, r0 - ldrb r4, [r7, 0x4] - movs r6, 0x40 - negs r6, r6 - adds r0, r6, 0 - ands r0, r4 - orrs r0, r1 - strb r0, [r7, 0x4] - ldrb r0, [r7, 0x8] - ands r6, r0 - orrs r6, r1 - strb r6, [r7, 0x8] - movs r0, 0x1F - adds r1, r2, 0 - ands r1, r0 - lsls r1, 6 - ldrh r4, [r7, 0x4] - ldr r0, =0xfffff83f - ands r0, r4 - orrs r0, r1 - strh r0, [r7, 0x4] - lsls r4, r3, 3 - ldrb r1, [r7, 0x5] - movs r0, 0x7 - ands r0, r1 - orrs r0, r4 - strb r0, [r7, 0x5] - ldrb r0, [r7, 0x7] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r7, 0x7] - ldrb r1, [r7, 0x9] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - movs r1, 0x1 - ands r5, r1 - lsls r5, 2 - subs r1, 0x6 - ands r0, r1 - orrs r0, r5 - subs r1, 0x4 - ands r0, r1 - strb r0, [r7, 0x9] - cmp r2, r3 - bcs _080A2840 - movs r0, 0x41 - negs r0, r0 - ands r6, r0 - b _080A2844 - .pool -_080A2840: - movs r0, 0x40 - orrs r6, r0 -_080A2844: - strb r6, [r7, 0x8] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A27B0 - - thumb_func_start pal_fade__2 -pal_fade__2: @ 80A284C - push {r4-r7,lr} - ldr r2, =gUnknown_02037FD4 - ldrb r1, [r2, 0x7] - movs r0, 0x80 - ands r0, r1 - adds r4, r2, 0 - cmp r0, 0 - bne _080A2864 - movs r0, 0 - b _080A295C - .pool -_080A2864: - ldrb r2, [r4, 0x4] - lsls r1, r2, 26 - ldrb r3, [r4, 0x8] - lsls r0, r3, 26 - cmp r1, r0 - bcs _080A2886 - lsrs r0, r1, 26 - adds r0, 0x1 - movs r1, 0x3F - ands r0, r1 - movs r1, 0x40 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x4] - movs r0, 0x2 - b _080A295C -_080A2886: - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - strb r0, [r4, 0x4] - movs r0, 0x40 - ands r0, r3 - cmp r0, 0 - bne _080A28E4 - ldrh r1, [r4, 0x4] - lsls r0, r1, 21 - lsrs r0, 27 - adds r0, 0x1 - movs r7, 0x1F - ands r0, r7 - lsls r0, 6 - ldr r6, =0xfffff83f - adds r3, r6, 0 - ands r3, r1 - orrs r3, r0 - strh r3, [r4, 0x4] - lsls r5, r3, 21 - ldrb r0, [r4, 0x5] - lsrs r1, r5, 27 - lsrs r0, 3 - cmp r1, r0 - bls _080A2930 - ldrb r2, [r4, 0x9] - lsls r1, r2, 28 - lsrs r1, 31 - adds r1, 0x1 - movs r0, 0x1 - ands r1, r0 - lsls r1, 3 - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x9] - lsrs r0, r5, 27 - subs r0, 0x1 - ands r0, r7 - lsls r0, 6 - ands r3, r6 - b _080A292C - .pool -_080A28E4: - ldrh r2, [r4, 0x4] - lsls r1, r2, 21 - lsrs r0, r1, 27 - subs r0, 0x1 - movs r6, 0x1F - ands r0, r6 - lsls r0, 6 - ldr r5, =0xfffff83f - adds r3, r5, 0 - ands r3, r2 - orrs r3, r0 - strh r3, [r4, 0x4] - lsrs r1, 27 - subs r1, 0x1 - ldrb r0, [r4, 0x5] - lsrs r0, 3 - cmp r1, r0 - bge _080A2930 - ldrb r2, [r4, 0x9] - lsls r1, r2, 28 - lsrs r1, 31 - adds r1, 0x1 - movs r0, 0x1 - ands r1, r0 - lsls r1, 3 - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x9] - lsls r0, r3, 21 - lsrs r0, 27 - adds r0, 0x1 - ands r0, r6 - lsls r0, 6 - ands r3, r5 -_080A292C: - orrs r3, r0 - strh r3, [r4, 0x4] -_080A2930: - ldrb r1, [r4, 0x9] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080A2958 - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080A294E - movs r0, 0 - str r0, [r4] - ldrh r1, [r4, 0x4] - ldr r0, =0xfffff83f - ands r0, r1 - strh r0, [r4, 0x4] -_080A294E: - ldrb r1, [r4, 0x9] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x9] -_080A2958: - ldrb r0, [r4, 0x7] - lsrs r0, 7 -_080A295C: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pal_fade__2 - - thumb_func_start sub_80A2968 -sub_80A2968: @ 80A2968 - push {r4,lr} - ldr r4, =gUnknown_02037FD4 - ldrh r1, [r4] - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r4, 0x4] - lsls r1, 21 - lsrs r1, 27 - movs r0, 0x54 - bl SetGpuReg - ldrb r1, [r4, 0x9] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080A29AC - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - negs r1, r1 - ands r0, r1 - strb r0, [r4, 0x9] - movs r0, 0 - str r0, [r4] - ldrh r1, [r4, 0x4] - ldr r0, =0xfffff83f - ands r0, r1 - strh r0, [r4, 0x4] - ldrb r1, [r4, 0x7] - movs r0, 0x7F - ands r0, r1 - strb r0, [r4, 0x7] -_080A29AC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2968 - - thumb_func_start sub_80A29BC -sub_80A29BC: @ 80A29BC - push {r4,lr} - ldr r3, =gUnknown_02037FD4 - ldrb r4, [r3, 0xA] - movs r0, 0x2 - ands r0, r4 - cmp r0, 0 - beq _080A2A18 - ldr r2, [r3, 0x8] - movs r0, 0xF8 - lsls r0, 9 - ands r0, r2 - movs r1, 0x80 - lsls r1, 7 - cmp r0, r1 - bne _080A29FC - ldrb r1, [r3, 0x7] - movs r0, 0x7F - ands r0, r1 - strb r0, [r3, 0x7] - movs r0, 0x3 - negs r0, r0 - ands r0, r4 - strb r0, [r3, 0xA] - ldr r0, [r3, 0x8] - ldr r1, =0xfffe0fff - ands r0, r1 - str r0, [r3, 0x8] - b _080A2A10 - .pool -_080A29FC: - lsls r0, r2, 15 - lsrs r0, 27 - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - lsls r0, 12 - ldr r1, =0xfffe0fff - ands r1, r2 - orrs r1, r0 - str r1, [r3, 0x8] -_080A2A10: - movs r0, 0x1 - b _080A2A1A - .pool -_080A2A18: - movs r0, 0 -_080A2A1A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80A29BC - - thumb_func_start sub_80A2A20 -sub_80A2A20: @ 80A2A20 - push {r4-r7,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 16 - lsrs r6, r2, 16 - movs r5, 0 - cmp r4, 0 - beq _080A2A54 -_080A2A32: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _080A2A46 - adds r0, r5, 0 - movs r1, 0x10 - adds r2, r7, 0 - adds r3, r6, 0 - bl pal_fade_1 -_080A2A46: - lsrs r4, 1 - adds r0, r5, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - bne _080A2A32 -_080A2A54: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A2A20 - - thumb_func_start sub_80A2A5C -sub_80A2A5C: @ 80A2A5C - push {r4,r5,lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r4, =gUnknown_02037714 - ldr r5, =gUnknown_02037B14 - ldr r3, =0x040000d4 - str r4, [r3] - str r5, [r3, 0x4] - ldr r4, =0x84000100 - str r4, [r3, 0x8] - ldr r3, [r3, 0x8] - bl sub_80A2A20 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2A5C - - thumb_func_start TintPalette_GrayScale -TintPalette_GrayScale: @ 80A2A90 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0 - beq _080A2AD8 - movs r6, 0x1F - adds r5, r1, 0 -_080A2AA0: - ldrh r1, [r4] - movs r2, 0x1F - ands r2, r1 - lsls r1, 16 - lsrs r3, r1, 21 - ands r3, r6 - lsrs r1, 26 - ands r1, r6 - movs r0, 0x4C - muls r2, r0 - movs r0, 0x97 - muls r0, r3 - adds r2, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r1 - adds r2, r0 - asrs r2, 8 - lsls r0, r2, 10 - lsls r1, r2, 5 - orrs r0, r1 - orrs r0, r2 - strh r0, [r4] - adds r4, 0x2 - subs r5, 0x1 - cmp r5, 0 - bne _080A2AA0 -_080A2AD8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end TintPalette_GrayScale - - thumb_func_start sub_80A2AE0 -sub_80A2AE0: @ 80A2AE0 - push {r4-r7,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0 - beq _080A2B34 - movs r6, 0x1F - ldr r7, =gUnknown_0852489C - adds r5, r1, 0 -_080A2AF2: - ldrh r1, [r4] - movs r2, 0x1F - ands r2, r1 - lsls r1, 16 - lsrs r3, r1, 21 - ands r3, r6 - lsrs r1, 26 - ands r1, r6 - movs r0, 0x4C - muls r2, r0 - movs r0, 0x97 - muls r0, r3 - adds r2, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r1 - adds r2, r0 - asrs r2, 8 - cmp r2, 0x1F - bls _080A2B1E - movs r2, 0x1F -_080A2B1E: - adds r0, r2, r7 - ldrb r2, [r0] - lsls r0, r2, 10 - lsls r1, r2, 5 - orrs r0, r1 - orrs r0, r2 - strh r0, [r4] - adds r4, 0x2 - subs r5, 0x1 - cmp r5, 0 - bne _080A2AF2 -_080A2B34: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2AE0 - - thumb_func_start TintPalette_SepiaTone -TintPalette_SepiaTone: @ 80A2B40 - push {r4-r7,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0 - beq _080A2BA2 - movs r7, 0x1F - adds r6, r1, 0 -_080A2B50: - ldrh r0, [r5] - movs r1, 0x1F - ands r1, r0 - lsls r0, 16 - lsrs r2, r0, 21 - ands r2, r7 - lsrs r3, r0, 26 - ands r3, r7 - movs r0, 0x4C - muls r1, r0 - movs r0, 0x97 - muls r0, r2 - adds r1, r0 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r3 - adds r1, r0 - asrs r1, 8 - ldr r0, =0x00000133 - muls r0, r1 - lsls r0, 16 - lsrs r2, r0, 24 - lsls r0, r1, 24 - lsrs r4, r0, 24 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 20 - lsrs r3, r0, 24 - cmp r2, 0x1F - ble _080A2B90 - movs r2, 0x1F -_080A2B90: - lsls r0, r3, 10 - lsls r1, r4, 5 - orrs r0, r1 - orrs r0, r2 - strh r0, [r5] - adds r5, 0x2 - subs r6, 0x1 - cmp r6, 0 - bne _080A2B50 -_080A2BA2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end TintPalette_SepiaTone - - thumb_func_start sub_80A2BAC -sub_80A2BAC: @ 80A2BAC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - ldr r0, [sp, 0x1C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - lsls r3, 16 - lsrs r3, 16 - mov r8, r3 - lsls r0, 16 - lsrs r0, 16 - mov r12, r0 - cmp r1, 0 - beq _080A2C38 - movs r7, 0x1F - adds r6, r1, 0 -_080A2BD6: - ldrh r0, [r5] - movs r1, 0x1F - ands r1, r0 - lsls r0, 16 - lsrs r2, r0, 21 - ands r2, r7 - lsrs r3, r0, 26 - ands r3, r7 - movs r0, 0x4C - muls r1, r0 - movs r0, 0x97 - muls r0, r2 - adds r1, r0 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r3 - adds r1, r0 - asrs r1, 8 - mov r0, r9 - muls r0, r1 - lsls r0, 16 - lsrs r4, r0, 24 - mov r0, r8 - muls r0, r1 - lsls r0, 16 - lsrs r2, r0, 24 - mov r0, r12 - muls r0, r1 - lsls r0, 16 - lsrs r3, r0, 24 - cmp r4, 0x1F - ble _080A2C1A - movs r4, 0x1F -_080A2C1A: - cmp r2, 0x1F - ble _080A2C20 - movs r2, 0x1F -_080A2C20: - cmp r3, 0x1F - ble _080A2C26 - movs r3, 0x1F -_080A2C26: - lsls r0, r3, 10 - lsls r1, r2, 5 - orrs r0, r1 - orrs r0, r4 - strh r0, [r5] - adds r5, 0x2 - subs r6, 0x1 - cmp r6, 0 - bne _080A2BD6 -_080A2C38: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A2BAC - - thumb_func_start sub_80A2C44 -sub_80A2C44: @ 80A2C44 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - adds r4, r1, 0 - ldr r0, [sp, 0x20] - ldr r1, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r1, 24 - lsrs r1, 24 - lsls r5, 24 - lsrs r5, 24 - mov r8, r5 - ldr r0, =sub_80A2D54 - bl CreateTask - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r1 - strh r7, [r1, 0x8] - strh r6, [r1, 0xA] - lsls r4, 24 - asrs r4, 24 - cmp r4, 0 - blt _080A2CA4 - strh r4, [r1, 0xE] - movs r0, 0x1 - b _080A2CAC - .pool -_080A2CA4: - movs r0, 0 - strh r0, [r1, 0xE] - negs r0, r4 - adds r0, 0x1 -_080A2CAC: - strh r0, [r1, 0xC] - lsls r4, r5, 2 - cmp r6, r7 - bcs _080A2CC4 - ldr r0, =gTasks - adds r1, r4, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0xC - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0xC] -_080A2CC4: - adds r0, r5, 0 - movs r1, 0x5 - mov r2, r10 - bl SetWordTaskArg - ldr r0, =gTasks - adds r1, r4, r5 - lsls r1, 3 - adds r1, r0 - mov r0, r9 - strh r0, [r1, 0x16] - mov r2, r8 - strh r2, [r1, 0x18] - ldr r1, [r1] - adds r0, r5, 0 - bl _call_via_r1 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2C44 - - thumb_func_start sub_80A2CF8 -sub_80A2CF8: @ 80A2CF8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r3, r0, 24 - movs r2, 0 - ldr r4, =sub_80A2D54 - ldr r1, =gTasks -_080A2D04: - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - bne _080A2D24 - ldr r0, [r1] - cmp r0, r4 - bne _080A2D24 - movs r5, 0x18 - ldrsh r0, [r1, r5] - cmp r0, r3 - bne _080A2D24 - movs r0, 0x1 - b _080A2D2E - .pool -_080A2D24: - adds r1, 0x28 - adds r2, 0x1 - cmp r2, 0xF - ble _080A2D04 - movs r0, 0 -_080A2D2E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80A2CF8 - - thumb_func_start sub_80A2D34 -sub_80A2D34: @ 80A2D34 - push {lr} - b _080A2D3C -_080A2D38: - bl DestroyTask -_080A2D3C: - ldr r0, =sub_80A2D54 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080A2D38 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2D34 - - thumb_func_start sub_80A2D54 -sub_80A2D54: @ 80A2D54 - push {r4-r6,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 - adds r0, r5, 0 - movs r1, 0x5 - bl GetWordTaskArg - adds r3, r0, 0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x6 - ldrsh r1, [r4, r2] - cmp r0, r1 - ble _080A2DCC - movs r0, 0 - strh r0, [r4, 0x8] - ldrb r1, [r4] - ldrh r2, [r4, 0xE] - adds r0, r3, 0 - bl sub_80A2A20 - ldrh r1, [r4] - movs r6, 0 - ldrsh r0, [r4, r6] - ldrh r3, [r4, 0x2] - movs r6, 0x2 - ldrsh r2, [r4, r6] - cmp r0, r2 - bne _080A2DAC - adds r0, r5, 0 - bl DestroyTask - b _080A2DCC - .pool -_080A2DAC: - ldrh r0, [r4, 0x4] - adds r1, r0 - strh r1, [r4] - lsls r0, 16 - cmp r0, 0 - blt _080A2DC2 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r2 - blt _080A2DCC - b _080A2DCA -_080A2DC2: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r2 - bgt _080A2DCC -_080A2DCA: - strh r3, [r4] -_080A2DCC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80A2D54 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/player_pc.s b/asm/player_pc.s index 7ce1e1824..d2ce8084c 100644 --- a/asm/player_pc.s +++ b/asm/player_pc.s @@ -563,7 +563,7 @@ sub_816B2F0: @ 816B2F0 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1006,7 +1006,7 @@ sub_816B674: @ 816B674 mov r10, r0 mov r4, r9 add r4, r10 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1240,7 +1240,7 @@ sub_816B8A4: @ 816B8A4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1514,7 +1514,7 @@ sub_816BAF8: @ 816BAF8 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/pokedex.s b/asm/pokedex.s index a5e987f3c..bcf5e2e61 100644 --- a/asm/pokedex.s +++ b/asm/pokedex.s @@ -81,7 +81,7 @@ sub_80BB370: @ 80BB370 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_80BB370 @@ -382,7 +382,7 @@ _080BB5FC: bl remove_some_task bl ResetTasks bl ResetAllObjectData - bl sub_80A1A74 + bl ResetPaletteFade bl ResetObjectPaletteAllocator ldr r1, =gUnknown_0300301C movs r0, 0x8 @@ -517,7 +517,7 @@ sub_80BB774: @ 80BB774 bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_80BB774 @@ -621,7 +621,7 @@ _080BB810: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, [r7] adds r0, r5 ldrh r1, [r0] @@ -691,7 +691,7 @@ _080BB8FC: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade bl sub_80C1258 ldr r1, =gTasks lsls r3, r6, 2 @@ -751,7 +751,7 @@ _080BB9A0: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r6, 2 adds r0, r6 @@ -922,7 +922,7 @@ _080BBB34: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r7, 2 adds r0, r7 @@ -1213,7 +1213,7 @@ sub_80BBDE8: @ 80BBDE8 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1357,7 +1357,7 @@ _080BBEEC: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r6, 2 adds r0, r6 @@ -1415,7 +1415,7 @@ _080BBFC8: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade bl sub_80C1258 ldr r2, =gTasks lsls r1, r6, 2 @@ -1450,7 +1450,7 @@ _080BC024: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r6, 2 adds r0, r6 @@ -1631,7 +1631,7 @@ _080BC1E4: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r6, 2 adds r0, r6 @@ -1650,7 +1650,7 @@ _080BC214: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r6, 2 adds r0, r6 @@ -1848,7 +1848,7 @@ sub_80BC3DC: @ 80BC3DC push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1913,7 +1913,7 @@ sub_80BC47C: @ 80BC47C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2001,7 +2001,7 @@ _080BC540: .4byte _080BC790 .4byte _080BC818 _080BC55C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2089,7 +2089,7 @@ _080BC640: movs r2, 0 bl CopyToBgTilemapBuffer _080BC64E: - bl sub_80A1A74 + bl ResetPaletteFade cmp r5, 0 bne _080BC674 ldr r3, =gUnknown_02039B4C @@ -2200,7 +2200,7 @@ _080BC768: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_80BB370 bl SetVBlankCallback ldr r1, =gUnknown_030022C0 @@ -2260,7 +2260,7 @@ _080BC800: b _080BC838 .pool _080BC818: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2302,19 +2302,19 @@ _080BC858: _080BC862: movs r1, 0x1 movs r2, 0xBE - bl gpu_pal_apply + bl LoadPalette b _080BC87A .pool _080BC870: ldr r0, =gUnknown_08DC1876 movs r1, 0x1 movs r2, 0xBE - bl gpu_pal_apply + bl LoadPalette _080BC87A: bl sub_8098C64 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r0} bx r0 .pool @@ -3568,7 +3568,7 @@ sub_80BD2B4: @ 80BD2B4 lsls r1, 16 lsrs r1, 16 mov r8, r1 - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -3693,7 +3693,7 @@ _080BD39C: ldr r1, =0x00000632 adds r0, r1 strh r2, [r0] - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -6319,7 +6319,7 @@ _080BEA50: .4byte _080BED5E .4byte _080BED7C _080BEA7C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -6454,10 +6454,10 @@ _080BEB98: ands r0, r1 cmp r0, 0 bne _080BEBD0 - ldr r0, =gUnknown_02037716 + ldr r0, =gPlttBufferUnfaded + 2 movs r1, 0x31 movs r2, 0x1E - bl gpu_pal_apply + bl LoadPalette _080BEBD0: movs r0, 0 movs r1, 0x3 @@ -6547,7 +6547,7 @@ _080BEC98: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_030060B4 ldr r0, [r0] bl SetVBlankCallback @@ -6582,7 +6582,7 @@ _080BECBC: b _080BED70 .pool _080BED04: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -6716,7 +6716,7 @@ sub_80BEDF4: @ 80BEDF4 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_80BF038 str r0, [r4] movs r0, 0x6C @@ -6768,7 +6768,7 @@ _080BEE82: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, [r5] ldr r3, =0x0000064e adds r0, r3 @@ -6782,7 +6782,7 @@ _080BEEA0: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, [r5] ldr r1, =0x0000064e adds r0, r1 @@ -6807,7 +6807,7 @@ _080BEED8: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, [r5] ldr r3, =0x0000064e adds r0, r3 @@ -6828,7 +6828,7 @@ _080BEF0E: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_80BF070 str r0, [r4] movs r0, 0x3 @@ -6915,7 +6915,7 @@ sub_80BEFD0: @ 80BEFD0 push {r4,lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -6963,7 +6963,7 @@ sub_80BF038: @ 80BF038 push {r4,lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -6990,7 +6990,7 @@ sub_80BF070: @ 80BF070 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -7030,7 +7030,7 @@ sub_80BF0AC: @ 80BF0AC cmp r0, 0x2 beq _080BF15C _080BF0C8: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -7147,7 +7147,7 @@ sub_80BF1EC: @ 80BF1EC push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -7220,7 +7220,7 @@ _080BF27C: .4byte _080BF540 .4byte _080BF590 _080BF2A8: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -7302,7 +7302,7 @@ _080BF360: b _080BF57A .pool _080BF38C: - bl sub_80A1A74 + bl ResetPaletteFade ldr r1, =gUnknown_030022C0 movs r2, 0x87 lsls r2, 3 @@ -7462,7 +7462,7 @@ _080BF514: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_030060B4 ldr r0, [r0] bl SetVBlankCallback @@ -7569,7 +7569,7 @@ _080BF5F2: b _080BF772 .pool _080BF624: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -7591,7 +7591,7 @@ _080BF636: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gMPlay_BGM bl m4aMPlayContinue ldr r0, =gUnknown_02039B4C @@ -7633,7 +7633,7 @@ _080BF6B0: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gMPlay_BGM bl m4aMPlayContinue ldr r0, =gUnknown_02039B4C @@ -7688,7 +7688,7 @@ _080BF73C: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gMPlay_BGM bl m4aMPlayContinue ldr r0, =gUnknown_02039B4C @@ -7719,7 +7719,7 @@ sub_80BF790: @ 80BF790 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -7781,7 +7781,7 @@ _080BF812: mov r0, sp movs r1, 0x5D movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette add sp, 0x4 pop {r0} bx r0 @@ -7821,7 +7821,7 @@ _080BF858: .4byte _080BFB14 .4byte _080BFB64 _080BF880: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -7917,7 +7917,7 @@ _080BF93C: b _080BFB56 .pool _080BF97C: - bl sub_80A1A74 + bl ResetPaletteFade b _080BFB4E _080BF982: ldr r0, =gUnknown_03005D90 @@ -7979,7 +7979,7 @@ _080BF982: adds r1, 0x10 lsls r1, 4 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gTasks lsls r0, r7, 2 adds r0, r7 @@ -8048,7 +8048,7 @@ _080BFA34: adds r1, 0x10 lsls r1, 4 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gTasks lsls r0, r7, 2 adds r0, r7 @@ -8073,7 +8073,7 @@ _080BFAE8: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_030060B4 ldr r0, [r0] bl SetVBlankCallback @@ -8117,7 +8117,7 @@ _080BFB56: b _080BFB94 .pool _080BFB64: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -8170,7 +8170,7 @@ sub_80BFBB0: @ 80BFBB0 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_02039B4C ldr r0, [r0] ldr r1, =0x0000064e @@ -8210,7 +8210,7 @@ _080BFC2C: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_02039B4C ldr r0, [r0] ldr r1, =0x0000064e @@ -8239,7 +8239,7 @@ sub_80BFC78: @ 80BFC78 push {r4,lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -8495,7 +8495,7 @@ _080BFE68: .4byte _080C0000 .4byte _080C0044 _080BFE84: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -8574,7 +8574,7 @@ _080BFF0C: movs r0, 0x1 movs r1, 0x2 bl CopyWindowToVram - bl sub_80A1A74 + bl ResetPaletteFade movs r0, 0 bl sub_80BC844 ldrh r0, [r4, 0x8] @@ -8628,7 +8628,7 @@ _080BFFA8: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_030060B4 ldr r0, [r0] bl SetVBlankCallback @@ -8671,7 +8671,7 @@ _080C0038: b _080C0074 .pool _080C0044: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -8718,7 +8718,7 @@ sub_80C0088: @ 80C0088 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r3, =gUnknown_02020630 ldr r0, =gTasks lsls r1, r4, 2 @@ -8754,14 +8754,14 @@ _080C00E8: ldr r0, =gUnknown_08DC16F6 movs r1, 0x31 movs r2, 0xE - bl gpu_pal_apply + bl LoadPalette b _080C011E .pool _080C0114: ldr r0, =gUnknown_08DC1756 movs r1, 0x31 movs r2, 0xE - bl gpu_pal_apply + bl LoadPalette _080C011E: add sp, 0x4 pop {r4} @@ -8775,7 +8775,7 @@ blockset_load_palette_to_gpu: @ 80C012C push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -8832,7 +8832,7 @@ _080C0168: orrs r4, r1 adds r1, r4, 0 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette adds r0, r6, 0 bl DestroyTask _080C01BA: @@ -11084,7 +11084,7 @@ _080C130C: .4byte _080C14A0 .4byte _080C14F0 _080C1320: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -11162,7 +11162,7 @@ _080C13F0: ldr r0, =gUnknown_08DC3286 movs r1, 0x1 movs r2, 0x7E - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_030022C0 movs r2, 0x87 lsls r2, 3 @@ -11218,7 +11218,7 @@ _080C1480: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gUnknown_030022C0 movs r2, 0x87 lsls r2, 3 @@ -11259,7 +11259,7 @@ _080C14E2: b _080C1516 .pool _080C14F0: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -12204,7 +12204,7 @@ sub_80C1D38: @ 80C1D38 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -12224,7 +12224,7 @@ sub_80C1D70: @ 80C1D70 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/pokedex_area_screen.s b/asm/pokedex_area_screen.s index 476bbbbfb..0b58ca1b6 100644 --- a/asm/pokedex_area_screen.s +++ b/asm/pokedex_area_screen.s @@ -79,7 +79,7 @@ _0813CAEC: cmp r0, 0 bne _0813CB34 ldr r0, =gUnknown_085B3D94 - ldr r1, =gUnknown_02037854 + ldr r1, =gPlttBufferUnfaded + 0x140 ldr r2, =0x04000008 bl CpuSet b _0813CB24 @@ -1361,7 +1361,7 @@ _0813D532: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0813D584 _0813D544: ldr r1, =0x00003f41 @@ -1442,7 +1442,7 @@ _0813D5D4: movs r0, 0 strh r0, [r1, 0x8] _0813D5E2: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1491,10 +1491,10 @@ _0813D640: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0813D698 _0813D652: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/pokedex_cry_screen.s b/asm/pokedex_cry_screen.s index fddf56816..909d81483 100644 --- a/asm/pokedex_cry_screen.s +++ b/asm/pokedex_cry_screen.s @@ -116,7 +116,7 @@ _08145434: ldrb r1, [r6, 0x3] lsls r1, 4 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0x1 mov r8, r0 _0814544A: @@ -668,7 +668,7 @@ _08145884: ldrb r1, [r4, 0x3] lsls r1, 4 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r6] adds r0, 0x1 strb r0, [r6] diff --git a/asm/porthole.s b/asm/porthole.s index daf067ca5..bfca49844 100644 --- a/asm/porthole.s +++ b/asm/porthole.s @@ -80,7 +80,7 @@ _080FB624: beq _080FB6C4 b _080FB6E2 _080FB62E: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/region_map.s b/asm/region_map.s index 5bf19da34..266daf1cb 100644 --- a/asm/region_map.s +++ b/asm/region_map.s @@ -207,7 +207,7 @@ _08122E84: ldr r0, =gUnknown_0859F73C movs r1, 0x70 movs r2, 0x60 - bl gpu_pal_apply + bl LoadPalette b _08123014 .pool _08122E94: @@ -408,9 +408,9 @@ sub_8123030: @ 8123030 lsls r0, 2 lsls r1, 24 lsrs r1, 24 - bl sub_80A2A20 - ldr r0, =gUnknown_02037BF4 - ldr r1, =gUnknown_020377F4 + bl BlendPalettes + ldr r0, =gPlttBufferFaded + 0xE0 + ldr r1, =gPlttBufferUnfaded + 0xE0 movs r2, 0x30 bl CpuSet pop {r0} @@ -3377,7 +3377,7 @@ _081246E4: b _081248AA .pool _08124754: - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl FreeAllObjectTiles bl ResetObjectPaletteAllocator @@ -3446,7 +3446,7 @@ _0812480C: ldr r0, =gUnknown_085A1C38 movs r1, 0x10 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0x2 bl PutWindowTilemap movs r0, 0x2 @@ -3474,7 +3474,7 @@ _08124852: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r0, =sub_81248C0 bl SetVBlankCallback b _0812489C @@ -3518,7 +3518,7 @@ sub_81248C0: @ 81248C0 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_81248C0 @@ -4058,14 +4058,14 @@ _08124D2C: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r4] ldrh r0, [r1, 0x4] adds r0, 0x1 strh r0, [r1, 0x4] b _08124D56 _08124D46: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _08124D56 @@ -4167,14 +4167,14 @@ _08124E24: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r4] ldrh r0, [r1, 0x4] adds r0, 0x1 strh r0, [r1, 0x4] b _08124F1A _08124E3E: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _08124F1A diff --git a/asm/reset_rtc_screen.s b/asm/reset_rtc_screen.s index 044433775..83ad70e69 100644 --- a/asm/reset_rtc_screen.s +++ b/asm/reset_rtc_screen.s @@ -891,7 +891,7 @@ _0809EFCA: bl dp12_8087EA4 bl ResetAllObjectData bl ResetTasks - bl sub_80A1A74 + bl ResetPaletteFade bl sub_809F048 ldr r0, =sub_809F0AC bl SetVBlankCallback @@ -941,7 +941,7 @@ sub_809F090: @ 809F090 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_809F090 @@ -951,7 +951,7 @@ sub_809F0AC: @ 809F0AC push {lr} bl ProcessObjectCopyRequests bl LoadOamFromSprites - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_809F0AC @@ -1140,13 +1140,13 @@ _0809F24C: movs r1, 0x1 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x1 strh r0, [r5] b _0809F404 .pool _0809F268: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1302,11 +1302,11 @@ _0809F3C8: movs r1, 0x1 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x6 strh r0, [r5] _0809F3EA: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/rom4.s b/asm/rom4.s index 271120f25..ada072f4e 100644 --- a/asm/rom4.s +++ b/asm/rom4.s @@ -3065,7 +3065,7 @@ c2_overworld_basic: @ 8085E24 bl CameraUpdate bl UpdateCameraPanning bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl sub_80A0A38 bl do_scheduled_bg_tilemap_copies_to_vram pop {r0} @@ -3083,7 +3083,7 @@ sub_8085E50: @ 8085E50 thumb_func_start c2_overworld c2_overworld: @ 8085E5C push {r4,lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r0, [r0, 0x7] lsrs r0, 7 adds r4, r0, 0 @@ -3639,7 +3639,7 @@ VBlankCB_Field: @ 8086390 bl ProcessObjectCopyRequests bl sub_80BA0A8 bl FieldUpdateBgTilemapScroll - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl sub_80A09D0 pop {r0} bx r0 @@ -4293,7 +4293,7 @@ sub_8086988: @ 8086988 adds r4, r0, 0 bl ResetTasks bl ResetAllObjectData - bl sub_80A1A74 + bl ResetPaletteFade bl dp12_8087EA4 bl dp13_810BB8C bl ResetCameraUpdateInfo @@ -5873,7 +5873,7 @@ sub_80875C8: @ 80875C8 strb r1, [r0] cmp r2, 0x1 beq _08087614 - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r1, [r2, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/rom5.s b/asm/rom5.s index 6f13ca2e8..007494bab 100644 --- a/asm/rom5.s +++ b/asm/rom5.s @@ -13,7 +13,7 @@ nullsub_35: @ 80A92F4 thumb_func_start sub_80A92F8 sub_80A92F8: @ 80A92F8 push {lr} - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -97,7 +97,7 @@ _080A93B0: bl ShowBg movs r0, 0x3 bl ShowBg - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =gUnknown_02022E14 movs r1, 0 strh r1, [r0] @@ -295,8 +295,8 @@ _080A95A4: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl sub_80A27B0 - ldr r2, =gUnknown_02037FD4 + bl BeginHardwarePaletteFade + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -1214,7 +1214,7 @@ sub_80A9DB4: @ 80A9DB4 ldrb r2, [r4, 0x10] ldrh r3, [r4, 0xA] movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette ldrh r2, [r4, 0x12] movs r1, 0x12 ldrsh r0, [r4, r1] @@ -1513,7 +1513,7 @@ sub_80AA020: @ 80AA020 asrs r0, 16 cmp r0, 0x3 bne _080AA0B0 - ldr r3, =gUnknown_02037B14 + ldr r3, =gPlttBufferFaded lsls r2, 4 mov r12, r2 ldr r1, =0x0000010d diff --git a/asm/rom6.s b/asm/rom6.s index 1a0027a8e..5f60e46a8 100644 --- a/asm/rom6.s +++ b/asm/rom6.s @@ -573,7 +573,7 @@ sub_813591C: @ 813591C bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_813591C @@ -583,7 +583,7 @@ sub_8135938: @ 8135938 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_8135938 @@ -668,8 +668,8 @@ _08135A08: bl ResetObjectPaletteAllocator b _08135B9E _08135A0E: - bl sub_80A1A74 - ldr r2, =gUnknown_02037FD4 + bl ResetPaletteFade + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -808,7 +808,7 @@ _08135B6A: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r1, =gUnknown_030022C0 movs r0, 0x87 lsls r0, 3 @@ -822,8 +822,8 @@ _08135B84: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe - ldr r2, =gUnknown_02037FD4 + bl BeginNormalPaletteFade + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -945,7 +945,7 @@ _08135CBC: ldr r0, =gUnknown_08D9B470 movs r1, 0 movs r2, 0xC0 - bl decompress_palette + bl LoadCompressedPalette b _08135CDE .pool _08135CCC: @@ -1004,7 +1004,7 @@ sub_8135D24: @ 8135D24 ldr r0, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r4, 0 _08135D50: adds r0, r4, 0 @@ -1943,7 +1943,7 @@ sub_81364EC: @ 81364EC str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -1968,7 +1968,7 @@ sub_8136524: @ 8136524 lsls r0, 3 ldr r1, =gTasks + 0x8 adds r2, r0, r1 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2041,7 +2041,7 @@ sub_81365C8: @ 81365C8 mov r10, r0 mov r6, r8 add r6, r10 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3420,7 +3420,7 @@ sub_81371D4: @ 81371D4 bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_81371D4 @@ -3430,7 +3430,7 @@ sub_81371EC: @ 81371EC push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_81371EC @@ -3501,7 +3501,7 @@ c2_change_map: @ 8137200 ldr r0, =0x810001ff str r0, [r1, 0x8] ldr r0, [r1, 0x8] - bl sub_80A1A74 + bl ResetPaletteFade bl ResetTasks bl ResetAllObjectData ldr r3, =0x04000208 @@ -3710,11 +3710,11 @@ sub_8137420: @ 8137420 ldr r0, =gUnknown_085B2850 movs r1, 0xE0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085B28A0 movs r1, 0xE0 movs r2, 0x10 - bl gpu_pal_apply + bl LoadPalette ldr r1, =0x00003e41 movs r0, 0x50 bl SetGpuReg @@ -3812,14 +3812,14 @@ sub_813750C: @ 813750C lsls r2, 16 lsrs r2, 16 movs r1, 0xE0 - bl gpu_pal_apply + bl LoadPalette b _08137566 .pool _08137554: ldr r0, =gUnknown_085B2850 movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =sub_8137574 str r0, [r4] movs r0, 0x8 @@ -3920,11 +3920,11 @@ sub_81375D8: @ 81375D8 ldr r0, =gUnknown_085B2850 movs r1, 0xE0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085B2870 movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -3967,7 +3967,7 @@ sub_8137678: @ 8137678 lsls r2, 17 lsrs r2, 16 movs r1, 0xE0 - bl gpu_pal_apply + bl LoadPalette b _081376C8 .pool _081376B4: @@ -4018,7 +4018,7 @@ _08137714: ldr r0, =gUnknown_085B2870 movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_030022C0 ldr r0, [r0, 0x8] bl SetMainCallback2 @@ -4673,7 +4673,7 @@ mapldr_080CA5C0: @ 8137C5C str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_8137C94 movs r1, 0xA bl CreateTask @@ -4688,7 +4688,7 @@ sub_8137C94: @ 8137C94 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -5719,7 +5719,7 @@ _081384C6: lsls r2, 1 adds r1, r3, r2 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _081384E6 .pool _081384D8: @@ -5728,7 +5728,7 @@ _081384D8: lsls r2, 1 adds r1, r3, r2 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _081384E6: pop {r4,r5} pop {r0} @@ -11017,7 +11017,7 @@ sub_813B0B4: @ 813B0B4 movs r1, 0xD0 lsls r1, 1 movs r2, 0x8 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_03005D8C ldr r0, [r0] ldrb r1, [r0, 0x5] @@ -11147,12 +11147,12 @@ sub_813B1D0: @ 813B1D0 movs r1, 0xD0 lsls r1, 1 movs r2, 0x8 - bl gpu_pal_apply + bl LoadPalette movs r0, 0x80 lsls r0, 19 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes pop {r0} bx r0 .pool diff --git a/asm/rom_8034C54.s b/asm/rom_8034C54.s index 9fe4f9b7b..191e4f90d 100644 --- a/asm/rom_8034C54.s +++ b/asm/rom_8034C54.s @@ -1397,7 +1397,7 @@ sub_803570C: @ 803570C ldr r0, =gUnknown_08D85600 movs r1, 0x50 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_02022FEC ldr r0, [r0] movs r1, 0x80 @@ -1411,11 +1411,11 @@ sub_803570C: @ 803570C movs r1, 0x30 movs r2, 0x70 bl copy_textbox_border_tile_patterns_to_vram - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded adds r0, 0xEC movs r1, 0 strh r1, [r0] - ldr r1, =gUnknown_02037C00 + ldr r1, =gPlttBufferFaded + 0xEC movs r2, 0x1 bl CpuSet _0803575A: @@ -1646,7 +1646,7 @@ _08035A40: _08035A52: movs r1, 0x20 movs r2, 0x60 - bl decompress_palette + bl LoadCompressedPalette b _08035A8A .pool _08035A70: @@ -1659,7 +1659,7 @@ _08035A70: ldr r0, =gUnknown_08D7C9EC movs r1, 0x20 movs r2, 0x60 - bl decompress_palette + bl LoadCompressedPalette _08035A8A: pop {r4,r5} pop {r0} @@ -1684,7 +1684,7 @@ sub_8035AA4: @ 8035AA4 ldr r0, =gUnknown_08C004E0 movs r1, 0 movs r2, 0x40 - bl decompress_palette + bl LoadCompressedPalette bl sub_803570C bl load_battle_oval_graphics pop {r0} @@ -2175,12 +2175,12 @@ _08035EC4: ldr r0, =0x00002710 bl AllocObjectPalette lsls r0, 24 - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded lsrs r0, 19 ldr r3, =0x0000021e adds r0, r3 adds r2, r0, r2 - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded adds r0, r1 ldr r1, =0x00007fff strh r1, [r0] @@ -2475,7 +2475,7 @@ sub_8036154: @ 8036154 ldr r0, =gUnknown_08D77AE4 movs r1, 0x60 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette movs r0, 0x1 movs r1, 0x3 movs r2, 0x1 @@ -2716,7 +2716,7 @@ _08036424: ldr r0, =gUnknown_08C004E0 movs r1, 0 movs r2, 0x40 - bl decompress_palette + bl LoadCompressedPalette b _08036758 .pool _08036434: @@ -3047,7 +3047,7 @@ _08036740: _08036742: movs r1, 0x20 movs r2, 0x60 - bl decompress_palette + bl LoadCompressedPalette b _08036758 .pool _08036750: @@ -3207,7 +3207,7 @@ _080368A6: ldr r2, [r4, 0x8] bl sub_80BA038 _080368BE: - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =gUnknown_02022E14 movs r1, 0 strh r1, [r0] @@ -5356,7 +5356,7 @@ _08037C64: lsls r0, 24 cmp r0, 0 beq _08037D0A - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -5476,7 +5476,7 @@ _08037D64: b _08037DD6 .pool _08037DA4: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -6219,7 +6219,7 @@ sub_8038420: @ 8038420 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl RunTasks ldr r0, =gUnknown_030022C0 ldrh r1, [r0, 0x2C] @@ -6244,14 +6244,14 @@ sub_8038420: @ 8038420 strb r0, [r1] movs r0, 0x5 strh r0, [r2] - bl pal_fade_control_reset_maybe + bl ResetPaletteFadeControl movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_80384E4 bl SetMainCallback2 _08038482: @@ -6292,8 +6292,8 @@ sub_803849C: @ 803849C thumb_func_start sub_80384E4 sub_80384E4: @ 80384E4 push {lr} - bl fade_and_return_progress_probably - ldr r0, =gUnknown_02037FD4 + bl UpdatePaletteFade + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -7023,7 +7023,7 @@ _08038A3A: bl SetGpuReg bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl sub_80BA0A8 pop {r0} bx r0 @@ -7421,7 +7421,7 @@ _08038E1A: adds r1, 0x1 cmp r1, 0x9F ble _08038E1A - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =gUnknown_02022E14 movs r4, 0 strh r4, [r0] @@ -7443,7 +7443,7 @@ _08038E1A: ldr r0, =gUnknown_08C004E0 movs r1, 0 movs r2, 0x40 - bl decompress_palette + bl LoadCompressedPalette bl sub_803570C bl ResetAllObjectData bl ResetTasks @@ -7494,7 +7494,7 @@ sub_8038F14: @ 8038F14 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl RunTasks pop {r0} bx r0 @@ -7557,10 +7557,10 @@ _08038FB0: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0803910C _08038FC2: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -7685,11 +7685,11 @@ _080390DA: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _08039172 .pool _08039100: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -7893,7 +7893,7 @@ sub_80392A8: @ 80392A8 ldr r2, =0x05006000 add r0, sp, 0x4 bl CpuSet - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =gUnknown_02022E14 strh r4, [r0] ldr r0, =gUnknown_02022E16 @@ -7940,7 +7940,7 @@ _080392FE: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_02024332 strb r4, [r0] add sp, 0x8 @@ -7957,7 +7957,7 @@ sub_803937C: @ 803937C bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl RunTasks pop {r0} bx r0 @@ -8043,7 +8043,7 @@ _0803945E: b _0803975C .pool _08039470: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -8248,7 +8248,7 @@ _08039634: negs r0, r0 ands r0, r1 strb r0, [r2] - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -8354,7 +8354,7 @@ _0803974A: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gUnknown_02024332 movs r0, 0x20 strb r0, [r1, 0x1] @@ -8439,7 +8439,7 @@ oac_poke_opponent: @ 80397DC movs r1, 0 movs r2, 0xA movs r3, 0xA - bl pal_fade_maybe + bl BeginNormalPaletteFade add sp, 0x4 pop {r0} bx r0 @@ -8503,7 +8503,7 @@ sub_8039838: @ 8039838 movs r1, 0 movs r2, 0xA movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _08039880: add sp, 0x4 pop {r4} @@ -8516,7 +8516,7 @@ _08039880: sub_8039894: @ 8039894 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -16384,7 +16384,7 @@ _0803DDB6: _0803DDD2: bl sub_8186444 movs r0, 0x3 - bl sub_80A2390 + bl BeginFastPaletteFade movs r0, 0x5 bl sub_80A2F50 ldr r1, =gUnknown_03005D04 @@ -16420,7 +16420,7 @@ _0803DE2A: thumb_func_start sub_803DE40 sub_803DE40: @ 803DE40 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -45554,7 +45554,7 @@ _0804E10C: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0804E192 .pool _0804E150: @@ -45568,7 +45568,7 @@ _0804E15A: bl audio_play b _0804E20A _0804E162: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -45599,7 +45599,7 @@ _0804E192: b _0804E3B8 .pool _0804E1B8: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -45619,7 +45619,7 @@ _0804E1D2: b _0804E3B6 .pool _0804E1E4: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -47402,7 +47402,7 @@ sub_804F17C: @ 804F17C ldr r0, =gUnknown_0831C2C8 movs r1, 0x60 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_0831C2E8 movs r0, 0xE movs r2, 0 @@ -61149,10 +61149,10 @@ _08056918: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _08056A06 _0805692A: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -61183,7 +61183,7 @@ _08056938: b _08056A08 .pool _08056978: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -61232,7 +61232,7 @@ _080569E0: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0 bl ShowBg movs r0, 0x3 @@ -61246,7 +61246,7 @@ _08056A08: b _08056A2C .pool _08056A18: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -61584,7 +61584,7 @@ _08056CAE: adds r0, 0x1 strb r0, [r1] movs r0, 0x3 - bl sub_80A2390 + bl BeginFastPaletteFade b _08056E62 .pool _08056CE0: @@ -61603,7 +61603,7 @@ _08056CF2: b _08056E62 .pool _08056CFC: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -61698,7 +61698,7 @@ _08056DD4: ldr r0, =sub_8038420 cmp r1, r0 bne _08056E62 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -64599,7 +64599,7 @@ _08058798: thumb_func_start sub_80587B0 sub_80587B0: @ 80587B0 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -66415,7 +66415,7 @@ _080597C6: thumb_func_start sub_80597CC sub_80597CC: @ 80597CC push {r4,lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -66457,7 +66457,7 @@ sub_8059828: @ 8059828 ldr r0, =sub_8038420 cmp r1, r0 bne _08059898 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -66503,7 +66503,7 @@ _08059898: thumb_func_start sub_80598A4 sub_80598A4: @ 80598A4 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -66533,7 +66533,7 @@ sub_80598E0: @ 80598E0 ldr r0, =sub_8038420 cmp r1, r0 bne _08059906 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -70415,7 +70415,7 @@ sub_805BBA4: @ 805BBA4 movs r1, 0x2 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade bl dp01_tbl1_exec_completed add sp, 0x4 pop {r0} @@ -71152,7 +71152,7 @@ sub_805C248: @ 805C248 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gUnknown_03005D60 ldr r2, =gUnknown_02024064 ldrb r0, [r2] @@ -71301,7 +71301,7 @@ _0805C330: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gUnknown_03005D60 ldrb r0, [r4] lsls r0, 2 @@ -71333,7 +71333,7 @@ sub_805C3EC: @ 805C3EC movs r1, 0x2 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade bl dp01_tbl1_exec_completed add sp, 0x4 pop {r0} @@ -72181,7 +72181,7 @@ dp01t_2F_1_pokemon_enter: @ 805CA80 lsls r2, 1 adds r1, r4, r2 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldrb r0, [r7] adds r0, r6 ldrb r0, [r0] @@ -72809,7 +72809,7 @@ sub_805D094: @ 805D094 movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 - bl sub_80A2390 + bl BeginFastPaletteFade bl dp01_tbl1_exec_completed ldr r1, =gUnknown_03005D60 ldrb r0, [r5] @@ -74237,12 +74237,12 @@ _0805DCC6: adds r0, r4, 0 adds r1, r7, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette mov r1, r9 adds r1, 0x80 adds r0, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =0x00000181 cmp r5, r0 bne _0805DD1A @@ -74265,7 +74265,7 @@ _0805DCC6: adds r0, r1 adds r1, r7, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _0805DD1A: ldr r0, =gUnknown_020244D0 ldr r0, [r0] @@ -74279,11 +74279,11 @@ _0805DD1A: adds r0, r7, 0 movs r1, 0x10 movs r2, 0x6 - bl pal_fade_1 + bl BlendPalette lsls r1, r7, 1 - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded adds r0, r1, r0 - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded adds r1, r2 ldr r2, =0x04000008 bl CpuSet @@ -74422,12 +74422,12 @@ _0805DE7E: adds r0, r4, 0 adds r1, r7, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette mov r1, r9 adds r1, 0x80 adds r0, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =0x00000181 cmp r5, r0 bne _0805DED2 @@ -74450,7 +74450,7 @@ _0805DE7E: adds r0, r1 adds r1, r7, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _0805DED2: ldr r0, =gUnknown_020244D0 ldr r0, [r0] @@ -74463,11 +74463,11 @@ _0805DED2: adds r0, r7, 0 movs r1, 0x10 movs r2, 0x6 - bl pal_fade_1 + bl BlendPalette lsls r1, r7, 1 - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded adds r0, r1, r0 - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded adds r1, r2 ldr r2, =0x04000008 bl CpuSet @@ -74560,7 +74560,7 @@ sub_805DF84: @ 805DF84 lsrs r4, 16 adds r1, r4, 0 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette pop {r4,r5} pop {r0} bx r0 @@ -75130,7 +75130,7 @@ sub_805E448: @ 805E448 adds r0, r1 adds r1, r6, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_020244E4 adds r1, r7, r1 ldr r0, [r4] @@ -75148,11 +75148,11 @@ sub_805E448: @ 805E448 adds r0, r6, 0 movs r1, 0x10 movs r2, 0x6 - bl pal_fade_1 + bl BlendPalette lsls r1, r6, 1 - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded adds r0, r1, r0 - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded adds r1, r2 ldr r2, =0x04000008 bl CpuSet @@ -75352,7 +75352,7 @@ _0805E662: adds r0, r4, 0 adds r1, r6, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =0x00000181 cmp r8, r0 bne _0805E70A @@ -75387,17 +75387,17 @@ _0805E662: adds r0, r1 adds r1, r6, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _0805E70A: ldr r3, =0x00007fff adds r0, r6, 0 movs r1, 0x10 movs r2, 0x6 - bl pal_fade_1 + bl BlendPalette lsls r1, r6, 1 - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded adds r0, r1, r0 - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded adds r1, r2 ldr r2, =0x04000008 bl CpuSet @@ -75533,7 +75533,7 @@ _0805E860: adds r1, r6, r0 adds r0, r7, 0 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette b _0805E8E6 .pool _0805E898: @@ -92377,7 +92377,7 @@ _08067A08: movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 - bl sub_80A2390 + bl BeginFastPaletteFade bl sub_8065068 ldr r1, =gUnknown_03005D60 ldrb r0, [r4] diff --git a/asm/rom_8072304.s b/asm/rom_8072304.s index a04cc995e..e9a56069d 100644 --- a/asm/rom_8072304.s +++ b/asm/rom_8072304.s @@ -4190,9 +4190,9 @@ _080745B8: lsls r3, 1 adds r1, r4, r3 movs r2, 0x2 - bl rboxid_80040B8 + bl FillPalette lsls r4, 1 - ldr r0, =gUnknown_02037914 + ldr r0, =gPlttBufferUnfaded + 0x200 adds r0, r4, r0 ldr r1, =0x05000200 adds r4, r1 diff --git a/asm/rom_80A3934.s b/asm/rom_80A3934.s index 252688e01..d01c01f97 100644 --- a/asm/rom_80A3934.s +++ b/asm/rom_80A3934.s @@ -1330,14 +1330,14 @@ _080A44B0: movs r0, 0x16 bl SetGpuReg lsls r4, r6, 5 - ldr r0, =gUnknown_02037914 + ldr r0, =gPlttBufferUnfaded + 0x200 adds r4, r0 add r0, sp, 0x10 ldrb r1, [r0, 0x8] lsls r1, 4 adds r0, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette add r0, sp, 0x10 ldrb r1, [r0, 0x8] lsls r1, 5 @@ -1471,12 +1471,12 @@ _080A460E: movs r0, 0x1A bl SetGpuReg lsls r4, r6, 5 - ldr r0, =gUnknown_02037914 + ldr r0, =gPlttBufferUnfaded + 0x200 adds r4, r0 adds r0, r4, 0 movs r1, 0x90 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =0x05000120 ldr r2, =0x04000008 adds r0, r4, 0 @@ -1727,7 +1727,7 @@ task_pA_ma0A_obj_to_bg_pal: @ 80A47D8 adds r0, r5 strh r0, [r1] lsls r0, r6, 5 - ldr r2, =gUnknown_02037D14 + ldr r2, =gPlttBufferFaded + 0x200 adds r0, r2 mov r1, sp ldrb r1, [r1, 0x8] @@ -1753,7 +1753,7 @@ _080A4870: adds r0, r5 strh r0, [r1] lsls r0, r6, 5 - ldr r1, =gUnknown_02037D14 + ldr r1, =gPlttBufferFaded + 0x200 adds r0, r1 subs r1, 0xE0 ldr r2, =0x04000008 @@ -2582,14 +2582,14 @@ task_p5_load_battle_screen_elements: @ 80A4EF4 movs r1, 0 movs r2, 0 movs r3, 0x10 - bl sub_80A27B0 + bl BeginHardwarePaletteFade ldrh r0, [r4, 0x1C] adds r0, 0x1 strh r0, [r4, 0x1C] b _080A4FBC .pool _080A4F2C: - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r1, [r2, 0x7] movs r0, 0x80 ands r0, r1 @@ -2626,7 +2626,7 @@ _080A4F6E: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl sub_80A27B0 + bl BeginHardwarePaletteFade ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -2713,7 +2713,7 @@ sub_80A4FC8: @ 80A4FC8 lsrs r1, 20 adds r0, r4, 0 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette b _080A507E .pool _080A5050: @@ -2736,7 +2736,7 @@ _080A5050: ldr r0, [r4] movs r1, 0x20 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette _080A507E: pop {r4-r7} pop {r0} @@ -5662,7 +5662,7 @@ sub_80A67A4: @ 80A67A4 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x38] - bl sub_80A1F58 + bl ResetPaletteStructByUid adds r0, r4, 0 bl move_anim_8074EE0 pop {r4} @@ -7456,8 +7456,8 @@ sub_80A750C: @ 80A750C lsrs r0, 16 cmp r1, 0 bne _080A7588 - ldr r2, =gUnknown_02037714 - ldr r1, =gUnknown_02037B14 + ldr r2, =gPlttBufferUnfaded + ldr r1, =gPlttBufferFaded lsls r0, 1 adds r4, r0, r1 adds r5, r0, r2 @@ -7509,9 +7509,9 @@ _080A7524: .pool _080A7588: lsls r1, r0, 1 - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded adds r0, r1, r0 - ldr r2, =gUnknown_02037B14 + ldr r2, =gPlttBufferFaded adds r1, r2 ldr r2, =0x04000008 bl CpuSet @@ -8371,7 +8371,7 @@ sub_80A7C1C: @ 80A7C1C lsrs r2, 24 ldrh r3, [r4, 0xA] movs r1, 0xF - bl pal_fade_1 + bl BlendPalette movs r2, 0xC ldrsh r1, [r4, r2] movs r2, 0xE @@ -8391,7 +8391,7 @@ _080A7C78: lsrs r2, 24 ldrh r3, [r4, 0xA] movs r1, 0xF - bl pal_fade_1 + bl BlendPalette movs r0, 0xC ldrsh r1, [r4, r0] cmp r1, 0 @@ -9384,7 +9384,7 @@ _080A8412: adds r1, r2 lsrs r1, 16 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r3, [sp, 0x44] cmp r3, 0x1 beq _080A845E @@ -9447,7 +9447,7 @@ _080A84B0: adds r1, r3 lsrs r1, 16 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r0, [sp, 0x44] cmp r0, 0x1 beq _080A84F6 @@ -10367,10 +10367,10 @@ _080A8C68: _080A8C6A: strh r0, [r5, 0x14] lsls r0, r4, 1 - ldr r1, =gUnknown_02037714 + ldr r1, =gPlttBufferUnfaded adds r0, r1 lsls r1, r6, 1 - ldr r2, =gUnknown_02037B14 + ldr r2, =gPlttBufferFaded adds r1, r2 ldr r2, =0x04000008 bl CpuSet @@ -10379,7 +10379,7 @@ _080A8C6A: ldrh r3, [r0] adds r0, r6, 0 movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette ldr r0, =sub_80A8CAC str r0, [r5] pop {r4-r7} diff --git a/asm/rom_80AEFFC.s b/asm/rom_80AEFFC.s index 97289eab7..134c63248 100644 --- a/asm/rom_80AEFFC.s +++ b/asm/rom_80AEFFC.s @@ -11,7 +11,7 @@ palette_bg_faded_fill_white: @ 80AEFFC sub sp, 0x4 ldr r0, =0x7fff7fff str r0, [sp] - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded ldr r2, =0x01000100 mov r0, sp bl CpuFastSet @@ -27,7 +27,7 @@ palette_bg_faded_fill_black: @ 80AF020 sub sp, 0x4 movs r0, 0 str r0, [sp] - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded ldr r2, =0x01000100 mov r0, sp bl CpuFastSet @@ -881,7 +881,7 @@ sub_80AF6F0: @ 80AF6F0 thumb_func_start sub_80AF710 sub_80AF710: @ 80AF710 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r0, [r0, 0x7] lsrs r0, 7 bx lr @@ -2313,7 +2313,7 @@ _080B02AA: lsrs r1, r4, 16 mov r0, sp movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette movs r0, 0x80 lsls r0, 9 adds r4, r0 diff --git a/asm/rom_80B5E6C.s b/asm/rom_80B5E6C.s index 23282ebfc..9b62a18f7 100644 --- a/asm/rom_80B5E6C.s +++ b/asm/rom_80B5E6C.s @@ -94,7 +94,7 @@ sub_80B5F0C: @ 80B5F0C ldr r0, [r4] adds r1, r5, 0 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette pop {r4,r5} pop {r0} bx r0 @@ -284,7 +284,7 @@ sub_80B609C: @ 80B609C lsrs r2, 24 lsls r3, 24 lsrs r3, 24 - ldr r4, =gUnknown_02037714 + ldr r4, =gPlttBufferUnfaded lsrs r0, 15 adds r4, r0, r4 ldrh r4, [r4] @@ -329,7 +329,7 @@ sub_80B609C: @ 80B609C lsls r4, 26 orrs r4, r6 lsrs r4, 16 - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded adds r0, r1 strh r4, [r0] pop {r3,r4} @@ -353,7 +353,7 @@ sub_80B6128: @ 80B6128 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 - ldr r4, =gUnknown_02037714 + ldr r4, =gPlttBufferUnfaded lsrs r0, 15 adds r4, r0, r4 ldrh r4, [r4] @@ -390,7 +390,7 @@ sub_80B6128: @ 80B6128 lsls r4, 26 orrs r4, r5 lsrs r4, 16 - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded adds r0, r1 strh r4, [r0] pop {r3} @@ -1589,7 +1589,7 @@ c3_080843F8: @ 80B6B0C ldrsh r0, [r4, r1] cmp r0, 0 bne _080B6B3E - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2255,7 +2255,7 @@ sub_80B7050: @ 80B7050 thumb_func_start sub_80B7060 sub_80B7060: @ 80B7060 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3222,7 +3222,7 @@ sub_80B77F8: @ 80B77F8 thumb_func_start sub_80B7814 sub_80B7814: @ 80B7814 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3697,7 +3697,7 @@ _080B7BEA: thumb_func_start sub_80B7BF4 sub_80B7BF4: @ 80B7BF4 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3888,7 +3888,7 @@ _080B7D86: ldrsh r0, [r4, r1] cmp r0, 0 bne _080B7DF8 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -4369,7 +4369,7 @@ _080B817E: sub_80B8198: @ 80B8198 push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -4896,7 +4896,7 @@ sub_80B85F8: @ 80B85F8 ldr r0, =gUnknown_0855B050 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette adds r0, r4, 0 bl sub_80B8874 ldrh r0, [r6, 0x8] @@ -5290,7 +5290,7 @@ sub_80B8920: @ 80B8920 ldr r0, =gUnknown_0855B370 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldrh r0, [r6, 0x8] adds r0, 0x1 strh r0, [r6, 0x8] @@ -6103,7 +6103,7 @@ sub_80B8F98: @ 80B8F98 ldr r0, =gUnknown_0855B610 movs r1, 0xC0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0x12 movs r1, 0x78 bl SetGpuReg @@ -6649,7 +6649,7 @@ _080B948E: thumb_func_start sub_80B9494 sub_80B9494: @ 80B9494 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -7648,13 +7648,13 @@ sub_80B9C54: @ 80B9C54 adds r0, r6, 0 movs r1, 0x10 adds r2, r5, 0 - bl sub_80A2A20 + bl BlendPalettes str r5, [sp] adds r0, r6, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade adds r0, r4, 0 bl sub_80B9D24 movs r0, 0x57 @@ -7680,7 +7680,7 @@ sub_80B9CDC: @ 80B9CDC adds r4, r0, 0 lsls r1, 24 lsrs r5, r1, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/rom_80C6FA0.s b/asm/rom_80C6FA0.s index e77d4e7f9..01cd80664 100644 --- a/asm/rom_80C6FA0.s +++ b/asm/rom_80C6FA0.s @@ -730,7 +730,7 @@ _080C7532: b _080C756A .pool _080C7544: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1703,7 +1703,7 @@ sub_80C7D28: @ 80C7D28 bl LoadOamFromSprites bl ProcessObjectCopyRequests bl sub_80D2AA4 - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer ldr r0, =gUnknown_02039D08 ldr r0, [r0] movs r1, 0xB3 @@ -1849,7 +1849,7 @@ sub_80C7E50: @ 80C7E50 sub_80C7E98: @ 80C7E98 push {r4,lr} sub sp, 0x4 - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl FreeAllObjectTiles bl ResetObjectPaletteAllocator @@ -2144,7 +2144,7 @@ _080C814A: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r0, =sub_80C81AC bl add_to_c3_somehow b _080C8186 @@ -2154,7 +2154,7 @@ _080C8174: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r0, =box_related_2 bl add_to_c3_somehow _080C8186: @@ -2241,10 +2241,10 @@ _080C821E: adds r0, r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _080C8282 _080C8230: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _080C82A0 @@ -4953,14 +4953,14 @@ _080C9AE0: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r5] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b _080C9B18 _080C9AFE: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _080C9B18 @@ -5000,14 +5000,14 @@ _080C9B40: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r5] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b _080C9B78 _080C9B5E: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -5046,14 +5046,14 @@ _080C9BA0: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r4] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b _080C9BD6 _080C9BBA: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _080C9BD6 @@ -5622,15 +5622,15 @@ sub_80CA0D8: @ 80CA0D8 ldr r0, =gUnknown_085723DC movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085723FC movs r1, 0x20 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085726F4 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_02039D08 ldr r0, [r0] ldrb r0, [r0, 0x1] @@ -5639,14 +5639,14 @@ sub_80CA0D8: @ 80CA0D8 ldr r0, =gUnknown_0857241C movs r1, 0x30 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _080CA12E .pool _080CA124: ldr r0, =gUnknown_0857243C movs r1, 0x30 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _080CA12E: ldr r1, =0x00001e05 movs r0, 0xA @@ -6061,7 +6061,7 @@ sub_80CA44C: @ 80CA44C ldrh r1, [r0] adds r0, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, [r6] adds r0, r7 ldr r1, [r0] @@ -6323,7 +6323,7 @@ sub_80CA704: @ 80CA704 ldr r0, =gUnknown_08DD36A8 movs r1, 0x10 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r2, [r4] adds r2, 0xB0 movs r0, 0x16 @@ -10233,14 +10233,14 @@ _080CC6F0: movs r1, 0x1 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r4] ldr r2, =0x00000a62 adds r1, r2 b _080CC77E .pool _080CC718: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _080CC794 @@ -10266,14 +10266,14 @@ _080CC732: movs r1, 0x1 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r4] ldr r2, =0x00000a62 adds r1, r2 b _080CC77E .pool _080CC76C: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _080CC794 @@ -10386,7 +10386,7 @@ _080CC7E6: adds r1, r3 lsrs r1, 16 movs r2, 0x40 - bl gpu_pal_apply + bl LoadPalette b _080CC888 .pool _080CC874: @@ -10395,7 +10395,7 @@ _080CC874: adds r1, r2 ldrb r1, [r1] lsls r1, 6 - ldr r2, =gUnknown_02037794 + ldr r2, =gPlttBufferUnfaded + 0x80 adds r1, r2 movs r2, 0x20 bl CpuSet @@ -10476,7 +10476,7 @@ _080CC8C4: adds r1, r3 lsrs r1, 16 movs r2, 0x40 - bl gpu_pal_apply + bl LoadPalette b _080CC976 .pool _080CC960: @@ -10486,7 +10486,7 @@ _080CC960: adds r1, r3 ldrb r1, [r1] lsls r1, 6 - ldr r2, =gUnknown_02037794 + ldr r2, =gPlttBufferUnfaded + 0x80 adds r1, r2 movs r2, 0x20 bl CpuSet @@ -11025,7 +11025,7 @@ _080CCDB0: adds r0, r1 mov r1, r9 movs r2, 0x4 - bl gpu_pal_apply + bl LoadPalette ldr r0, [sp, 0x28] bl sav3_get_box_name bl sub_80CD00C @@ -11250,7 +11250,7 @@ sub_80CCF9C: @ 80CCF9C adds r1, r2, r3 ldrh r1, [r1] lsls r1, 1 - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded adds r1, r2 movs r2, 0x2 bl CpuSet @@ -11264,7 +11264,7 @@ _080CCFE4: adds r1, r2, r3 ldrh r1, [r1] lsls r1, 1 - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded adds r1, r2 movs r2, 0x2 bl CpuSet @@ -17265,7 +17265,7 @@ _080D027C: lsls r0, 6 ldr r2, =0x00007fff movs r1, 0x8 - bl sub_80A2A20 + bl BlendPalettes movs r0, 0x2 bl sub_80CFE54 movs r0, 0x8 @@ -17338,7 +17338,7 @@ _080D0382: bl stdpal_get movs r1, 0xD0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0 bl ShowBg movs r0, 0 @@ -17565,7 +17565,7 @@ _080D0550: bl stdpal_get movs r1, 0xD0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette bl sub_80CFE84 movs r0, 0 bl ShowBg @@ -19640,7 +19640,7 @@ _080D1562: ldrh r1, [r0] adds r0, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _080D15AC: add sp, 0x4 pop {r3,r4} @@ -23163,7 +23163,7 @@ _080D305A: ldr r0, [r6] adds r1, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette adds r0, r4, 0 adds r0, 0x10 lsls r0, 16 @@ -26654,7 +26654,7 @@ _080D4C0A: ldr r0, =gUnknown_0857F444 movs r1, 0xE0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _080D4C7A .pool _080D4C6C: @@ -26663,7 +26663,7 @@ _080D4C6C: adds r0, r1 movs r1, 0xE0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _080D4C7A: lsls r1, r4, 4 subs r1, r4 diff --git a/asm/rom_813C5BC.s b/asm/rom_813C5BC.s index 672543987..554c066f1 100644 --- a/asm/rom_813C5BC.s +++ b/asm/rom_813C5BC.s @@ -10,7 +10,7 @@ sub_813C5BC: @ 813C5BC push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -74,7 +74,7 @@ sub_813C62C: @ 813C62C str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -94,7 +94,7 @@ sub_813C664: @ 813C664 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -282,7 +282,7 @@ sub_813C80C: @ 813C80C bl remove_some_task bl ResetTasks bl ResetAllObjectData - bl sub_80A1A74 + bl ResetPaletteFade bl ResetObjectPaletteAllocator pop {r0} bx r0 @@ -361,7 +361,7 @@ sub_813C890: @ 813C890 ldr r0, =gUnknown_085B3544 movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette add sp, 0x8 pop {r4} pop {r0} @@ -374,7 +374,7 @@ sub_813C8D8: @ 813C8D8 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_813C8D8 @@ -385,7 +385,7 @@ sub_813C8EC: @ 813C8EC bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_813C8EC @@ -464,7 +464,7 @@ _0813C9A8: bl stdpal_get movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _0813CA00 _0813C9BE: bl IsDma3ManagerBusyWithBgCopy @@ -492,7 +492,7 @@ _0813C9F0: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0813CA00: ldr r1, =gUnknown_030022C0 movs r0, 0x87 diff --git a/asm/rom_8145E84.s b/asm/rom_8145E84.s index fc4bb4175..566d90c9b 100644 --- a/asm/rom_8145E84.s +++ b/asm/rom_8145E84.s @@ -38,7 +38,7 @@ _08145EC0: bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r4} pop {r0} bx r0 diff --git a/asm/rom_8158B30.s b/asm/rom_8158B30.s index d9d675726..c26779f96 100644 --- a/asm/rom_8158B30.s +++ b/asm/rom_8158B30.s @@ -1301,7 +1301,7 @@ _081595D0: thumb_func_start sub_81595E4 sub_81595E4: @ 81595E4 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1358,7 +1358,7 @@ _0815964E: thumb_func_start sub_8159660 sub_8159660: @ 8159660 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1387,7 +1387,7 @@ sub_8159698: @ 8159698 ldr r0, =sub_8038420 cmp r1, r0 bne _081596BE - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1912,7 +1912,7 @@ sub_8159B14: @ 8159B14 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gUnknown_03005D60 ldr r2, =gUnknown_02024064 ldrb r0, [r2] @@ -2379,7 +2379,7 @@ sub_8159E90: @ 8159E90 movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 - bl sub_80A2390 + bl BeginFastPaletteFade bl dp01_tbl6_exec_completed ldr r0, =gUnknown_02022FEC ldr r0, [r0] @@ -2461,14 +2461,14 @@ sub_8159F5C: @ 8159F5C sub sp, 0x4 movs r0, 0xEC bl audio_play - ldr r5, =gUnknown_02037714 - ldr r1, =gUnknown_02037FE8 + ldr r5, =gPlttBufferUnfaded + ldr r1, =sPaletteDecompressionBuffer movs r4, 0x80 lsls r4, 1 adds r0, r5, 0 adds r2, r4, 0 bl CpuFastSet - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded adds r1, r5, 0 adds r2, r4, 0 bl CpuFastSet @@ -2491,7 +2491,7 @@ sub_8159F5C: @ 8159F5C movs r1, 0x4 movs r2, 0 movs r3, 0x8 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_8159FEC movs r1, 0 bl CreateTask @@ -2519,7 +2519,7 @@ sub_8159FEC: @ 8159FEC sub sp, 0x4 lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2531,7 +2531,7 @@ sub_8159FEC: @ 8159FEC movs r0, 0x40 movs r1, 0x8 movs r2, 0x1F - bl sub_80A2A20 + bl BlendPalettes ldr r0, =gTasks lsls r1, r5, 2 adds r1, r5 @@ -2574,7 +2574,7 @@ _0815A044: movs r1, 0x4 movs r2, 0x8 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade bl sub_81BE6B8 b _0815A088 .pool @@ -2593,14 +2593,14 @@ sub_815A090: @ 815A090 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne _0815A0BE - ldr r0, =gUnknown_02037FE8 - ldr r1, =gUnknown_02037714 + ldr r0, =sPaletteDecompressionBuffer + ldr r1, =gPlttBufferUnfaded movs r2, 0x80 lsls r2, 1 bl CpuFastSet @@ -3197,7 +3197,7 @@ sub_815A52C: @ 815A52C asrs r0, 16 cmp r0, 0x4 bne _0815A59C - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded lsls r2, r6, 4 adds r1, r2, 0 adds r1, 0xB @@ -3295,7 +3295,7 @@ sub_815A5F0: @ 815A5F0 asrs r0, 16 cmp r0, 0x4 bne _0815A692 - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded lsls r2, r7, 4 adds r1, r2, 0 adds r1, 0xB @@ -3306,7 +3306,7 @@ sub_815A5F0: @ 815A5F0 mov r10, r3 mov r9, r0 adds r5, r2, 0 - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded mov r12, r2 lsls r0, r7, 5 add r0, r9 @@ -6033,7 +6033,7 @@ _0815BC5E: ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gTasks lsls r1, r4, 2 adds r1, r4 @@ -6674,7 +6674,7 @@ _0815C1CC: ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gTasks lsls r1, r6, 2 adds r1, r6 @@ -8519,7 +8519,7 @@ _0815D05A: adds r2, r3, 0 orrs r1, r2 movs r2, 0x20 - bl rboxid_80040B8 + bl FillPalette ldrb r0, [r5, 0x5] ands r4, r0 mov r0, r8 @@ -10319,7 +10319,7 @@ sub_815DF64: @ 815DF64 ldrh r3, [r1] movs r1, 0x10 movs r2, 0x8 - bl pal_fade_1 + bl BlendPalette ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -10340,7 +10340,7 @@ _0815DFB4: movs r1, 0x10 movs r2, 0 movs r3, 0 - bl pal_fade_1 + bl BlendPalette adds r0, r5, 0 bl move_anim_task_del _0815DFC6: @@ -13837,7 +13837,7 @@ _0815FB50: ldr r3, =0x00007fff movs r1, 0x10 movs r2, 0x6 - bl pal_fade_1 + bl BlendPalette _0815FBBA: ldr r0, =gTasks mov r3, r8 @@ -15101,7 +15101,7 @@ sub_8160624: @ 8160624 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_8160624 @@ -15120,7 +15120,7 @@ sub_8160638: @ 8160638 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade add sp, 0x4 pop {r0} bx r0 @@ -15132,7 +15132,7 @@ sub_8160664: @ 8160664 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -15197,7 +15197,7 @@ sub_81606A0: @ 81606A0 movs r0, 0 movs r1, 0 movs r2, 0x2 - bl rboxid_80040B8 + bl FillPalette ldr r0, =sub_816082C bl SetMainCallback2 pop {r4-r6} @@ -15254,7 +15254,7 @@ sub_8160740: @ 8160740 movs r0, 0 movs r1, 0 movs r2, 0x2 - bl rboxid_80040B8 + bl FillPalette ldr r0, =sub_816082C bl SetMainCallback2 pop {r4,r5} @@ -15298,7 +15298,7 @@ sub_816082C: @ 816082C bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_816082C @@ -15388,7 +15388,7 @@ _08160918: movs r1, 0 b _08160CAE _08160932: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -15730,11 +15730,11 @@ _08160C2A: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _08160E8A .pool _08160C48: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -15778,7 +15778,7 @@ _08160CA6: _08160CAE: movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _08160E8A _08160CB8: movs r0, 0x1 @@ -15787,7 +15787,7 @@ _08160CB8: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_0203BC34 ldr r1, [r0] ldrb r0, [r1] @@ -15795,7 +15795,7 @@ _08160CB8: b _08160E88 .pool _08160CD8: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -15815,7 +15815,7 @@ _08160CFC: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_0203BC34 ldr r1, [r0] ldrb r0, [r1] @@ -15841,7 +15841,7 @@ _08160D3A: bl CopyWindowToVram b _08160E8A _08160D48: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -25879,7 +25879,7 @@ sub_81662C0: @ 81662C0 bl _call_via_r0 bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade ldr r4, [r4] ldr r1, [r4] ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive @@ -25904,7 +25904,7 @@ sub_8166304: @ 8166304 bl sub_81668F8 bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_8166304 @@ -25919,7 +25919,7 @@ sub_816631C: @ 816631C bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 .pool @@ -25930,7 +25930,7 @@ sub_8166340: @ 8166340 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer ldr r0, =gUnknown_0203BCAC ldr r0, [r0] ldr r1, =0x00007c58 @@ -26166,7 +26166,7 @@ _08166580: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_8166340 bl SetVBlankCallback movs r0, 0 @@ -26185,7 +26185,7 @@ _08166580: b _08166610 .pool _081665C0: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -26469,7 +26469,7 @@ _08166838: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r5] adds r1, 0x50 ldrb r0, [r1] @@ -26478,7 +26478,7 @@ _08166838: b _081668D4 .pool _08166888: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -26590,7 +26590,7 @@ _081669A0: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes b _081669DE _081669AE: movs r0, 0 @@ -26611,7 +26611,7 @@ _081669C8: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _081669DE: ldr r0, =gUnknown_0203BC90 ldr r1, [r0] @@ -26623,7 +26623,7 @@ _081669E2: b _08166A18 .pool _081669F4: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -26856,10 +26856,10 @@ _08166C16: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _08166C4A _08166C28: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -28181,7 +28181,7 @@ _08167714: adds r1, r3, r2 ldrh r1, [r1] movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _08167742: add sp, 0x28 pop {r3} @@ -28525,7 +28525,7 @@ _08167A74: ldr r0, =gUnknown_085DFA60 movs r1, 0xD0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0203BCAC ldr r0, [r0] ldr r1, =0x00007b0e @@ -28550,7 +28550,7 @@ _08167AB0: ldr r0, =gUnknown_08DCCF5C movs r1, 0x20 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _08167B7E .pool _08167AD4: @@ -28604,11 +28604,11 @@ _08167B38: ldr r0, =gUnknown_086231E8 movs r1, 0x30 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_08623208 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0x2 bl sub_81D21DC b _08167B7E @@ -29832,7 +29832,7 @@ _081685CA: thumb_func_start sub_81685D4 sub_81685D4: @ 81685D4 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -29862,7 +29862,7 @@ sub_8168610: @ 8168610 ldr r0, =sub_8038420 cmp r1, r0 bne _08168636 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -33355,7 +33355,7 @@ sub_816A57C: @ 816A57C str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gUnknown_03005D60 ldr r2, =gUnknown_02024064 ldrb r0, [r2] @@ -33877,7 +33877,7 @@ sub_816A90C: @ 816A90C lsls r2, 1 adds r1, r4, r2 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldrb r0, [r7] adds r0, r6 ldrb r0, [r0] @@ -34317,7 +34317,7 @@ sub_816AD94: @ 816AD94 movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 - bl sub_80A2390 + bl BeginFastPaletteFade bl dp01_tbl5_exec_completed ldr r0, =gUnknown_02022FEC ldr r0, [r0] diff --git a/asm/rom_816F318.s b/asm/rom_816F318.s index a685d5d28..eac830ae7 100644 --- a/asm/rom_816F318.s +++ b/asm/rom_816F318.s @@ -1137,7 +1137,7 @@ _0816FBB4: lsls r0, 1 ldr r4, =gUnknown_08D85C50 adds r0, r4 - ldr r5, =gUnknown_02037D52 + ldr r5, =gPlttBufferFaded + 0x23E adds r1, r5, 0 movs r2, 0x1 bl CpuSet @@ -1171,7 +1171,7 @@ _0816FC14: lsls r0, 1 ldr r4, =gUnknown_08D85C50 adds r0, r4 - ldr r5, =gUnknown_02037D52 + ldr r5, =gPlttBufferFaded + 0x23E adds r1, r5, 0 movs r2, 0x1 bl CpuSet @@ -1216,7 +1216,7 @@ _0816FC6C: lsls r0, 1 ldr r4, =gUnknown_08D85C50 adds r0, r4 - ldr r5, =gUnknown_02037D52 + ldr r5, =gPlttBufferFaded + 0x23E adds r1, r5, 0 movs r2, 0x1 bl CpuSet @@ -1925,7 +1925,7 @@ sub_8170260: @ 8170260 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_8170260 @@ -1936,7 +1936,7 @@ sub_8170274: @ 8170274 bl sub_8170290 bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl do_scheduled_bg_tilemap_copies_to_vram pop {r0} bx r0 @@ -2041,7 +2041,7 @@ _08170358: b _081703D8 .pool _08170380: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2077,7 +2077,7 @@ _081703C0: movs r2, 0 movs r3, 0x10 _081703CC: - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_0203BCD0 ldr r1, [r0] _081703D4: @@ -2090,7 +2090,7 @@ _081703D8: b _08170416 .pool _081703E8: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2320,7 +2320,7 @@ sub_8170478: @ 8170478 ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r1, =gUnknown_02022E18 ldrh r0, [r7, 0x20] negs r0, r0 @@ -2624,7 +2624,7 @@ sub_8170834: @ 8170834 lsls r4, 4 orrs r4, r3 lsls r0, 1 - ldr r1, =gUnknown_02037714 + ldr r1, =gPlttBufferUnfaded mov r8, r1 add r0, r8 mov r2, r9 @@ -2633,7 +2633,7 @@ sub_8170834: @ 8170834 adds r1, r3, r1 movs r2, 0x20 str r3, [sp] - bl gpu_pal_apply + bl LoadPalette lsls r4, 1 add r4, r8 ldrb r0, [r7] @@ -2643,7 +2643,7 @@ sub_8170834: @ 8170834 adds r0, r4, 0 adds r1, r3, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette mov r0, r9 ldrb r1, [r0] lsls r1, 4 @@ -2872,7 +2872,7 @@ _08170A9E: ldrb r2, [r4, 0xC] ldr r3, =0x00007f74 movs r1, 0x1 - bl pal_fade_1 + bl BlendPalette movs r3, 0xC ldrsh r0, [r4, r3] cmp r0, 0x10 @@ -2899,7 +2899,7 @@ _08170AD6: ldrb r2, [r4, 0xC] ldr r3, =0x00007f74 movs r1, 0x1 - bl pal_fade_1 + bl BlendPalette movs r3, 0xC ldrsh r0, [r4, r3] cmp r0, 0 @@ -4505,7 +4505,7 @@ sub_81717F8: @ 81717F8 lsls r0, r1 movs r1, 0x6 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes adds r0, r6, 0 bl sub_81719EC b _081718BC @@ -4523,7 +4523,7 @@ _0817183C: movs r1, 0x2 movs r2, 0x6 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _081718BC _0817185A: cmp r1, 0x5F @@ -4626,7 +4626,7 @@ _081718F6: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _08171982 .pool _08171944: @@ -4667,7 +4667,7 @@ _08171982: strh r0, [r4, 0x2E] b _081719B0 _0817198A: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -6675,7 +6675,7 @@ sub_81729E8: @ 81729E8 ldrh r3, [r1] movs r1, 0x10 movs r2, 0 - bl pal_fade_1 + bl BlendPalette movs r0, 0x1 strh r0, [r5, 0xA] b _08172A7E @@ -6692,7 +6692,7 @@ _08172A58: ldrh r3, [r1] movs r1, 0x10 movs r2, 0x10 - bl pal_fade_1 + bl BlendPalette movs r0, 0x10 strh r0, [r5, 0x8] ldr r0, =0x0000ffff @@ -6706,7 +6706,7 @@ _08172A7E: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade mov r0, r8 add sp, 0x4 pop {r3,r4} @@ -6750,7 +6750,7 @@ sub_8172AB0: @ 8172AB0 adds r1, r3 ldrh r3, [r1] movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette ldrh r0, [r4, 0xA] ldrh r1, [r4, 0x8] adds r0, r1 @@ -6761,7 +6761,7 @@ sub_8172AB0: @ 8172AB0 b _08172B30 .pool _08172B08: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -6776,7 +6776,7 @@ _08172B08: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade adds r0, r5, 0 bl DestroyTask _08172B30: @@ -6793,7 +6793,7 @@ sub_8172B40: @ 8172B40 sub sp, 0x4 lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -6813,7 +6813,7 @@ sub_8172B40: @ 8172B40 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_8172B90 str r0, [r4] _08172B78: @@ -6854,7 +6854,7 @@ sub_8172B90: @ 8172B90 adds r1, r3 ldrh r3, [r1] movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette ldrh r0, [r4, 0xA] ldrh r1, [r4, 0x8] adds r0, r1 @@ -7987,7 +7987,7 @@ sub_817354C: @ 817354C push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_817354C @@ -7999,7 +7999,7 @@ sub_8173560: @ 8173560 bl RunTextPrinters bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_8173560 @@ -8081,7 +8081,7 @@ _08173620: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _08173642: ldr r1, =gUnknown_030022C0 movs r0, 0x87 @@ -8093,8 +8093,8 @@ _08173642: b _08173688 .pool _0817365C: - bl fade_and_return_progress_probably - ldr r0, =gUnknown_02037FD4 + bl UpdatePaletteFade + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -8850,7 +8850,7 @@ _08173C78: movs r1, 0 movs r2, 0xC movs r3, 0xC - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0 ldrsh r1, [r6, r0] lsls r0, r1, 4 @@ -8899,7 +8899,7 @@ sub_8173D24: @ 8173D24 str r1, [sp] movs r2, 0 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r3, 0 lsls r1, r4, 2 adds r0, r1, r4 @@ -9036,7 +9036,7 @@ _08173E40: movs r1, 0 movs r2, 0xC movs r3, 0xC - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0 movs r1, 0 bl FillWindowPixelBuffer @@ -9148,7 +9148,7 @@ sub_8173EE4: @ 8173EE4 bl stdpal_get movs r1, 0xE0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0x78 strh r0, [r4, 0xE] ldr r0, =sub_8173F84 @@ -9271,8 +9271,8 @@ sub_8174060: @ 8174060 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_02037B14 - ldr r1, =gUnknown_02037714 + ldr r0, =gPlttBufferFaded + ldr r1, =gPlttBufferUnfaded movs r2, 0x80 lsls r2, 2 bl CpuSet @@ -9283,7 +9283,7 @@ sub_8174060: @ 8174060 movs r1, 0x8 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -9306,7 +9306,7 @@ sub_81740B0: @ 81740B0 push {r6,r7} lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -9492,7 +9492,7 @@ _08174280: bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl sub_80F9C1C lsls r0, 24 cmp r0, 0 @@ -9822,7 +9822,7 @@ _0817454E: ldr r0, =0xffff0000 ldr r2, =0x000063b0 movs r1, 0xC - bl sub_80A2A20 + bl BlendPalettes ldr r0, =gUnknown_02021CC4 ldr r1, =gTasks ldr r4, [sp, 0x14] @@ -9978,7 +9978,7 @@ _0817466C: str r0, [r2] ldr r2, =0x000063b0 movs r1, 0xC - bl sub_80A2A5C + bl BlendPalettesUnfaded movs r0, 0xC ldrsh r1, [r6, r0] lsls r0, r1, 2 @@ -10186,8 +10186,8 @@ sub_8174898: @ 8174898 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r0, =gUnknown_02037B14 - ldr r1, =gUnknown_02037714 + ldr r0, =gPlttBufferFaded + ldr r1, =gPlttBufferUnfaded movs r2, 0x80 lsls r2, 2 bl CpuSet @@ -10935,11 +10935,11 @@ _08174EEA: orrs r3, r0 str r3, [r2, 0x8] ldr r0, [r2, 0x8] - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =gUnknown_085E54E8 movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette add sp, 0x8 pop {r3} mov r8, r3 @@ -11582,7 +11582,7 @@ sub_81754C8: @ 81754C8 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_81754C8 @@ -11621,7 +11621,7 @@ sub_81754DC: @ 81754DC strb r0, [r1] _08175522: bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 .pool @@ -11645,7 +11645,7 @@ sub_8175548: @ 8175548 ldr r0, =gUnknown_085E56F0 movs r1, 0x80 movs r2, 0x40 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085E6F6C bl InitWindows bl DeactivateAllTextPrinters @@ -11741,7 +11741,7 @@ sub_8175620: @ 8175620 movs r1, 0xE0 lsls r1, 9 bl InitHeap - bl sub_80A1A74 + bl ResetPaletteFade bl ResetTasks bl sub_8175548 ldr r0, =sub_8175744 @@ -11803,7 +11803,7 @@ _0817566A: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x1 bl EnableInterrupts ldr r0, =sub_81754C8 @@ -11845,7 +11845,7 @@ sub_8175744: @ 8175744 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -11909,7 +11909,7 @@ _081757B0: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_8175808 b _081757FA .pool @@ -11924,7 +11924,7 @@ _081757E0: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_81758A4 _081757FA: str r0, [r4] @@ -11941,7 +11941,7 @@ sub_8175808: @ 8175808 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -11992,7 +11992,7 @@ c2_080C9BFC: @ 8175848 str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x1 bl EnableInterrupts ldr r0, =sub_81754C8 @@ -12012,7 +12012,7 @@ sub_81758A4: @ 81758A4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -12073,7 +12073,7 @@ _08175906: ldr r0, =gUnknown_085B0A02 movs r1, 0x1 movs r2, 0x3E - bl gpu_pal_apply + bl LoadPalette movs r1, 0 ldr r4, =0x0201c000 movs r3, 0x11 @@ -12180,7 +12180,7 @@ _081759F0: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x1C movs r1, 0 bl SetGpuReg @@ -12239,7 +12239,7 @@ _08175AC4: movs r1, 0xC movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_8175AE4 str r0, [r4] _08175AD8: @@ -12255,7 +12255,7 @@ sub_8175AE4: @ 8175AE4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -12285,7 +12285,7 @@ sub_8175B1C: @ 8175B1C lsls r4, 24 lsrs r4, 24 bl sub_8175CE4 - bl sub_80A1A74 + bl ResetPaletteFade movs r1, 0xE0 lsls r1, 6 movs r0, 0 @@ -12300,7 +12300,7 @@ sub_8175B1C: @ 8175B1C movs r1, 0x8 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r1, 0xE0 lsls r1, 3 movs r0, 0x8 @@ -12354,7 +12354,7 @@ _08175BB8: movs r1, 0x6 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_8175BD8 str r0, [r4] _08175BCC: @@ -12371,7 +12371,7 @@ sub_8175BD8: @ 8175BD8 sub sp, 0x4 lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -12389,7 +12389,7 @@ sub_8175BD8: @ 8175BD8 movs r1, 0 movs r2, 0 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -12414,7 +12414,7 @@ sub_8175C34: @ 8175C34 sub sp, 0x4 lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -12443,7 +12443,7 @@ _08175C62: movs r1, 0x8 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_8175CC8 str r0, [r4] b _08175CB8 @@ -12478,7 +12478,7 @@ _08175CB8: thumb_func_start sub_8175CC8 sub_8175CC8: @ 8175CC8 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -12607,7 +12607,7 @@ _08175DD4: .4byte _08175E00 .4byte _08175FFC _08175E00: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -12745,7 +12745,7 @@ _08175F1A: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0817602A .pool _08175F2C: @@ -12757,7 +12757,7 @@ _08175F32: strh r0, [r5, 0x24] b _0817602A _08175F38: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -12826,11 +12826,11 @@ _08175FB6: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0817602A .pool _08175FC8: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -14438,7 +14438,7 @@ sub_8176D1C: @ 8176D1C ldr r0, =gIntroCopyright_Pal adds r1, r5, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette lsrs r4, 20 lsls r4, 28 lsrs r4, 16 diff --git a/asm/rom_81795E8.s b/asm/rom_81795E8.s index 9a873cce6..66e872c39 100644 --- a/asm/rom_81795E8.s +++ b/asm/rom_81795E8.s @@ -631,7 +631,7 @@ sub_8179B68: @ 8179B68 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_8179B68 @@ -641,7 +641,7 @@ sub_8179B84: @ 8179B84 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_8179B84 @@ -695,8 +695,8 @@ _08179BF8: b _08179D3A .pool _08179C20: - bl sub_80A1A74 - ldr r2, =gUnknown_02037FD4 + bl ResetPaletteFade + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -789,7 +789,7 @@ _08179CFE: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r1, =gUnknown_030022C0 movs r2, 0x87 lsls r2, 3 @@ -803,8 +803,8 @@ _08179D18: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe - ldr r2, =gUnknown_02037FD4 + bl BeginNormalPaletteFade + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -1045,7 +1045,7 @@ _08179F78: ldr r0, =gUnknown_08D7C9EC movs r1, 0x20 movs r2, 0x60 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_0203BD18 ldr r0, [r0] ldr r1, =0x0000107e @@ -1077,7 +1077,7 @@ sub_8179FAC: @ 8179FAC ldr r0, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0 movs r1, 0 bl FillWindowPixelBuffer @@ -1123,7 +1123,7 @@ sub_817A030: @ 817A030 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1394,7 +1394,7 @@ sub_817A2C0: @ 817A2C0 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1437,7 +1437,7 @@ sub_817A320: @ 817A320 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 diff --git a/asm/rom_817B064.s b/asm/rom_817B064.s index 1f22b8043..d9898c388 100644 --- a/asm/rom_817B064.s +++ b/asm/rom_817B064.s @@ -19,7 +19,7 @@ load_intro_part2_graphics: @ 817B064 ldr r0, =gUnknown_085F06E0 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette cmp r4, 0 beq _0817B08C cmp r4, 0x1 @@ -35,14 +35,14 @@ _0817B08C: ldr r0, =gUnknown_085F0CFC movs r1, 0 movs r2, 0x60 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085F5064 bl LoadCompressedObjectPic ldr r0, =gUnknown_085F1668 movs r1, 0x80 lsls r1, 1 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette bl sub_817B76C b _0817B11E .pool @@ -57,14 +57,14 @@ _0817B0EC: ldr r0, =gUnknown_085F17E4 movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085F50EC bl LoadCompressedObjectPic ldr r0, =gUnknown_085F21B0 movs r1, 0x80 lsls r1, 1 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette bl sub_817B788 _0817B11E: ldr r1, =gUnknown_0203BD28 @@ -156,7 +156,7 @@ _0817B214: ldr r0, =gUnknown_085F06E0 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085F0DBC movs r1, 0xC0 lsls r1, 19 @@ -167,7 +167,7 @@ _0817B214: ldr r0, =gUnknown_085F0CFC movs r1, 0 movs r2, 0x60 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085F5064 bl LoadCompressedObjectPic ldr r0, =gUnknown_085F16A8 @@ -180,7 +180,7 @@ _0817B270: ldr r0, =gUnknown_085F0700 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085F0DBC movs r1, 0xC0 lsls r1, 19 @@ -191,7 +191,7 @@ _0817B270: ldr r0, =gUnknown_085F0D5C movs r1, 0 movs r2, 0x60 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085F5064 bl LoadCompressedObjectPic ldr r0, =gUnknown_085F16A8 @@ -202,7 +202,7 @@ _0817B2A6: movs r1, 0x80 lsls r1, 1 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette bl sub_817B76C b _0817B370 .pool @@ -210,7 +210,7 @@ _0817B2DC: ldr r0, =gUnknown_085F0700 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085F1824 movs r1, 0xC0 lsls r1, 19 @@ -222,14 +222,14 @@ _0817B2DC: adds r0, r4, 0 movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085F50EC bl LoadCompressedObjectPic movs r1, 0x80 lsls r1, 1 adds r0, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette bl sub_817B788 b _0817B370 .pool @@ -237,7 +237,7 @@ _0817B334: ldr r0, =gUnknown_085F0720 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085F235C movs r1, 0xC0 lsls r1, 19 @@ -248,14 +248,14 @@ _0817B334: ldr r0, =gUnknown_085F231C movs r1, 0 movs r2, 0x40 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085F5180 bl LoadCompressedObjectPic ldr r0, =gUnknown_085F2548 movs r1, 0x80 lsls r1, 1 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette bl sub_817B7A4 _0817B370: ldr r1, =gUnknown_0300301C @@ -479,7 +479,7 @@ _0817B554: ands r0, r2 cmp r0, 0 bne _0817B620 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -489,7 +489,7 @@ _0817B554: ands r2, r0 cmp r2, 0 beq _0817B58C - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded ldrh r1, [r2, 0x12] mov r0, sp strh r1, [r0] @@ -497,7 +497,7 @@ _0817B554: b _0817B596 .pool _0817B58C: - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded ldrh r1, [r2, 0x14] mov r0, sp strh r1, [r0] @@ -509,11 +509,11 @@ _0817B596: mov r0, sp movs r1, 0x9 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette adds r0, r4, 0 movs r1, 0xA movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette b _0817B620 .pool _0817B5B8: @@ -523,7 +523,7 @@ _0817B5B8: ands r0, r2 cmp r0, 0 bne _0817B620 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -556,11 +556,11 @@ _0817B606: mov r0, sp movs r1, 0xC movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette adds r0, r4, 0 movs r1, 0xD movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette _0817B620: add sp, 0x4 pop {r4} @@ -1689,7 +1689,7 @@ sub_817BEC4: @ 817BEC4 movs r1, 0xA movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_817BF14 str r0, [r5] movs r0, 0x8C @@ -2035,8 +2035,8 @@ sub_817C174: @ 817C174 adds r5, r0 movs r0, 0 strh r0, [r5, 0x26] - ldr r0, =gUnknown_02037B54 - ldr r1, =gUnknown_02037754 + ldr r0, =gPlttBufferFaded + 0x40 + ldr r1, =gPlttBufferUnfaded + 0x40 movs r2, 0x30 bl CpuSet ldr r0, =0xfff9041c @@ -2045,7 +2045,7 @@ sub_817C174: @ 817C174 movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_817C1D4 str r0, [r5] movs r0, 0xCA @@ -2103,7 +2103,7 @@ _0817C224: movs r1, 0x10 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0817C234: ldr r0, =gTasks adds r1, r5, r6 @@ -2130,7 +2130,7 @@ sub_817C260: @ 817C260 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2182,8 +2182,8 @@ sub_817C2B0: @ 817C2B0 adds r5, r0 movs r0, 0 strh r0, [r5, 0x26] - ldr r0, =gUnknown_02037B54 - ldr r1, =gUnknown_02037754 + ldr r0, =gPlttBufferFaded + 0x40 + ldr r1, =gPlttBufferUnfaded + 0x40 movs r2, 0x30 bl CpuSet ldr r0, =0xfff90400 @@ -2192,7 +2192,7 @@ sub_817C2B0: @ 817C2B0 movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_817C310 str r0, [r5] movs r0, 0xCA @@ -2250,7 +2250,7 @@ _0817C360: movs r1, 0x10 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0817C370: ldr r0, =gTasks adds r1, r5, r6 @@ -2381,7 +2381,7 @@ _0817C3BA: ldrb r1, [r2, 0x5] lsrs r1, 4 lsls r1, 5 - ldr r0, =gUnknown_02037D14 + ldr r0, =gPlttBufferFaded + 0x200 mov r10, r0 add r1, r10 add r0, sp, 0x4 diff --git a/asm/rom_8184DA4.s b/asm/rom_8184DA4.s index 6956a1588..4144bc665 100644 --- a/asm/rom_8184DA4.s +++ b/asm/rom_8184DA4.s @@ -340,14 +340,14 @@ _0818507A: strb r0, [r1] movs r0, 0x5 strh r0, [r2] - bl pal_fade_control_reset_maybe + bl ResetPaletteFadeControl movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_80384E4 bl SetMainCallback2 movs r0, 0xFF @@ -8688,7 +8688,7 @@ _08189910: movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 - bl sub_80A2390 + bl BeginFastPaletteFade bl sub_81871AC ldr r1, =gUnknown_03005D60 ldr r0, =gUnknown_02024064 @@ -14349,7 +14349,7 @@ _0818CB5A: lsls r2, 1 adds r1, r4, r2 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r2, =gUnknown_02020630 ldr r1, =gUnknown_020241E4 ldr r5, =gUnknown_02024064 @@ -14822,7 +14822,7 @@ sub_818CF78: @ 818CF78 movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 - bl sub_80A2390 + bl BeginFastPaletteFade bl sub_818A514 ldr r1, =gUnknown_03005D60 ldrb r0, [r4] @@ -15044,7 +15044,7 @@ _0818D144: adds r1, r2 lsrs r1, 16 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette b _0818D16E .pool _0818D160: @@ -15079,7 +15079,7 @@ sub_818D180: @ 818D180 bl species_and_otid_get_pal lsls r1, r4, 4 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette b _0818D1B4 _0818D1A4: ldr r1, =gTrainerFrontPicPaletteTable @@ -15088,7 +15088,7 @@ _0818D1A4: ldr r0, [r0] lsls r1, r4, 4 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette _0818D1B4: pop {r4,r5} pop {r0} @@ -21260,7 +21260,7 @@ _08190508: movs r0, 0x4A movs r1, 0x3F bl SetGpuReg - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl ResetObjectPaletteAllocator ldr r1, =gUnknown_0300301C @@ -21299,27 +21299,27 @@ _08190570: lsls r4, 2 movs r1, 0 adds r2, r4, 0 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_08D85444 movs r1, 0x80 lsls r1, 1 adds r2, r4, 0 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_08D85600 movs r1, 0xF0 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette mov r0, r9 cmp r0, 0x2 bne _081905DE ldr r0, =gUnknown_08D854C8 movs r1, 0x50 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette _081905DE: str r7, [sp, 0x8] add r0, sp, 0x8 - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded ldr r2, =0x05000100 bl CpuSet movs r0, 0 @@ -22232,7 +22232,7 @@ _08190D18: .4byte _081920BC .4byte _08192106 _08190D3C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -22248,7 +22248,7 @@ _08190D50: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks mov r6, r8 lsls r0, r6, 2 @@ -22260,7 +22260,7 @@ _08190D50: bl _08192202 .pool _08190D7C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -22299,7 +22299,7 @@ _08190DC6: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks mov r3, r8 lsls r0, r3, 2 @@ -24434,7 +24434,7 @@ _08192100: strh r0, [r1, 0x8] b _08192202 _08192106: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -27350,7 +27350,7 @@ _08193990: .4byte _08193BC2 .4byte _08193B84 _081939B0: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -27366,7 +27366,7 @@ _081939C2: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -27384,7 +27384,7 @@ _081939C2: b _08193BC2 .pool _08193A00: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -27422,7 +27422,7 @@ _08193A3C: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -27439,7 +27439,7 @@ _08193A60: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -27456,7 +27456,7 @@ _08193A84: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -27467,7 +27467,7 @@ _08193A84: b _08193BC2 .pool _08193AA8: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -27514,7 +27514,7 @@ _08193ABA: b _08193BC2 .pool _08193B20: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -27554,7 +27554,7 @@ _08193B20: b _08193BC2 .pool _08193B84: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -28490,7 +28490,7 @@ _0819431C: movs r0, 0x4A movs r1, 0x3F bl SetGpuReg - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl ResetObjectPaletteAllocator ldr r1, =gTasks @@ -28545,19 +28545,19 @@ _0819438C: lsls r4, 2 movs r1, 0 adds r2, r4, 0 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_08D85444 movs r1, 0x80 lsls r1, 1 adds r2, r4, 0 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_08D85600 movs r1, 0xF0 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette str r6, [sp, 0x18] add r0, sp, 0x18 - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded ldr r2, =0x05000100 bl CpuSet movs r0, 0 @@ -29168,7 +29168,7 @@ _0819499C: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -29179,7 +29179,7 @@ _0819499C: b _08194B3C .pool _081949C0: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -29332,7 +29332,7 @@ _08194AEE: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -29343,7 +29343,7 @@ _08194AEE: b _08194B3C .pool _08194B24: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -29370,7 +29370,7 @@ sub_8194B54: @ 8194B54 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl RunTasks pop {r0} bx r0 @@ -29413,7 +29413,7 @@ sub_8194B70: @ 8194B70 bl SetGpuReg bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 .pool @@ -29541,7 +29541,7 @@ sub_8194CE4: @ 8194CE4 bl ChangeBgY bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl sub_80BA0A8 pop {r0} bx r0 @@ -32022,11 +32022,11 @@ _08196188: ldr r0, =gUnknown_0860EA4C movs r1, 0xE0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0860EB6C movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =0xffffe000 movs r0, 0 movs r2, 0 @@ -34063,7 +34063,7 @@ sub_8197184: @ 8197184 lsrs r5, 16 adds r1, r5, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r4,r5} pop {r0} bx r0 @@ -34924,7 +34924,7 @@ sub_819789C: @ 819789C ldr r0, =gUnknown_0860F074 movs r1, 0xE0 movs r2, 0x14 - bl gpu_pal_apply + bl LoadPalette pop {r0} bx r0 .pool @@ -34938,7 +34938,7 @@ sub_81978B0: @ 81978B0 lsrs r1, 16 ldr r0, =gUnknown_0860F074 movs r2, 0x14 - bl gpu_pal_apply + bl LoadPalette pop {r0} bx r0 .pool @@ -36037,7 +36037,7 @@ _0819815C: ldr r0, =gUnknown_0860F0B0 adds r1, r5, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0203CDA0 ldrb r0, [r0] add sp, 0x8 @@ -40409,7 +40409,7 @@ sub_819A25C: @ 819A25C bl sub_80D30B0 adds r1, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r4} pop {r0} bx r0 @@ -40474,7 +40474,7 @@ _0819A2E4: _0819A2E6: adds r1, r2, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r0} bx r0 .pool @@ -40713,7 +40713,7 @@ sub_819A4C8: @ 819A4C8 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl RunTasks pop {r0} bx r0 @@ -40724,7 +40724,7 @@ sub_819A4E4: @ 819A4E4 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_819A4E4 @@ -40887,7 +40887,7 @@ _0819A5C0: b _0819A8EE .pool _0819A69C: - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl ResetTasks bl ResetObjectPaletteAllocator @@ -40928,22 +40928,22 @@ _0819A69C: ldr r0, =gUnknown_08DC0714 movs r1, 0 movs r2, 0x40 - bl gpu_pal_apply + bl LoadPalette ldr r4, =gUnknown_0861046C adds r0, r4, 0 movs r1, 0xF0 movs r2, 0x8 - bl gpu_pal_apply + bl LoadPalette adds r0, r4, 0 movs r1, 0xE0 movs r2, 0xA - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0300127C ldr r1, [r0] ldrb r0, [r1, 0x6] cmp r0, 0x1 bne _0819A738 - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded movs r2, 0xA9 lsls r2, 2 adds r1, r2 @@ -40956,7 +40956,7 @@ _0819A738: ldr r0, =gUnknown_0861039C movs r1, 0x20 movs r2, 0x4 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_030022C0 movs r0, 0x87 lsls r0, 3 @@ -41014,7 +41014,7 @@ _0819A7CC: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r1, 0x9A lsls r1, 5 movs r0, 0 @@ -41768,8 +41768,8 @@ _0819AE30: beq _0819AEE8 b _0819AF50 _0819AE36: - ldr r1, =gUnknown_02037714 - ldr r0, =gUnknown_02037B14 + ldr r1, =gPlttBufferUnfaded + ldr r0, =gPlttBufferFaded movs r2, 0xE4 lsls r2, 1 adds r0, r2 @@ -41782,13 +41782,13 @@ _0819AE36: str r2, [sp] movs r1, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x7 strh r0, [r6, 0x8] b _0819AF50 .pool _0819AE64: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -41836,7 +41836,7 @@ _0819AE64: _0819AEE8: ldr r4, =gUnknown_0300127C ldr r1, [r4] - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded movs r3, 0xE4 lsls r3, 1 adds r0, r3 @@ -41925,13 +41925,13 @@ _0819AFA0: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b _0819B00E _0819AFB8: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 @@ -42287,7 +42287,7 @@ _0819B2EA: bl sub_819AC10 b _0819B36E _0819B300: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -42300,7 +42300,7 @@ _0819B300: ldrb r0, [r2, 0x6] cmp r0, 0x1 bne _0819B338 - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded movs r7, 0xA9 lsls r7, 2 adds r0, r2, r7 @@ -42309,7 +42309,7 @@ _0819B300: lsls r2, 1 adds r1, r2 strh r0, [r1] - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded subs r7, 0xBC adds r1, r0, r7 ldrh r1, [r1] @@ -42377,7 +42377,7 @@ _0819B3B4: beq _0819B440 b _0819B476 _0819B3BA: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -44730,7 +44730,7 @@ _0819C764: adds r1, r4 ldrb r1, [r1] movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r2, [r7] adds r4, r2, r4 ldrb r0, [r4] @@ -44786,7 +44786,7 @@ sub_819C7E0: @ 819C7E0 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl RunTextPrinters - bl fade_and_return_progress_probably + bl UpdatePaletteFade bl RunTasks pop {r0} bx r0 @@ -44797,7 +44797,7 @@ sub_819C7FC: @ 819C7FC push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_819C7FC @@ -44947,12 +44947,12 @@ _0819C93A: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x7 strh r0, [r6, 0x8] b _0819C9F0 _0819C950: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -44999,7 +44999,7 @@ _0819C9C4: movs r0, 0x1 strb r0, [r1, 0x15] ldr r2, [r2] - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded movs r1, 0xF4 lsls r1, 1 adds r0, r1 @@ -45092,14 +45092,14 @@ _0819CA8C: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0819CA9C: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b _0819CAFE _0819CAA4: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 @@ -45537,7 +45537,7 @@ sub_819CE40: @ 819CE40 b _0819CF4C .pool _0819CE64: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -45732,7 +45732,7 @@ _0819CFF8: adds r1, 0x28 ldrb r1, [r1] movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r2, [r6] adds r0, r2, 0 adds r0, 0x28 @@ -45815,10 +45815,10 @@ _0819D092: b _0819D0AE .pool _0819D0A4: - ldr r0, =gUnknown_020378F4 + ldr r0, =gPlttBufferUnfaded+ 0x1E0 movs r1, 0xE0 movs r2, 0xA - bl gpu_pal_apply + bl LoadPalette _0819D0AE: ldrh r0, [r4, 0x8] adds r0, 0x1 @@ -45851,8 +45851,8 @@ _0819D0D2: bls _0819D108 movs r0, 0 strb r0, [r1] - ldr r1, =gUnknown_02037714 - ldr r0, =gUnknown_02037B14 + ldr r1, =gPlttBufferUnfaded + ldr r0, =gPlttBufferFaded movs r3, 0xE4 lsls r3, 1 adds r0, r3 @@ -45872,7 +45872,7 @@ _0819D108: adds r1, 0x28 ldrb r1, [r1] movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes _0819D118: pop {r4} pop {r0} @@ -46475,7 +46475,7 @@ _0819D5D4: ldr r0, =gUnknown_08610918 movs r1, 0xE0 movs r2, 0xA - bl gpu_pal_apply + bl LoadPalette bl sub_819ED34 movs r0, 0x5 bl PutWindowTilemap @@ -46504,7 +46504,7 @@ _0819D60C: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0819D622: ldr r1, =gTasks lsls r0, r5, 2 @@ -46517,7 +46517,7 @@ _0819D622: b _0819D762 .pool _0819D63C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -46818,7 +46818,7 @@ _0819D8C0: beq _0819D8CA b _0819D9D8 _0819D8CA: - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded ldr r0, =gUnknown_0860F13C adds r0, 0x4A ldrh r0, [r0] @@ -46844,11 +46844,11 @@ _0819D8F4: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0819D990 .pool _0819D910: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -47343,7 +47343,7 @@ _0819DCD4: b _0819E006 .pool _0819DDA8: - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl ResetTasks bl ResetObjectPaletteAllocator @@ -47385,20 +47385,20 @@ _0819DDA8: ldr r0, =gUnknown_08DC0714 movs r1, 0 movs r2, 0x40 - bl gpu_pal_apply + bl LoadPalette ldr r4, =gUnknown_08610918 adds r0, r4, 0 movs r1, 0xF0 movs r2, 0xA - bl gpu_pal_apply + bl LoadPalette adds r0, r4, 0 movs r1, 0xE0 movs r2, 0xA - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0861039C movs r1, 0x20 movs r2, 0x4 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_030022C0 movs r0, 0x87 lsls r0, 3 @@ -47534,7 +47534,7 @@ _0819DFA4: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r1, 0x82 lsls r1, 5 movs r0, 0 @@ -49324,7 +49324,7 @@ sub_819EE08: @ 819EE08 cmp r0, 0 bne _0819EE3C add r0, sp, 0xC - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded movs r2, 0xE4 lsls r2, 1 adds r1, r2 @@ -49340,7 +49340,7 @@ _0819EE42: add r0, sp, 0xC movs r1, 0xF0 movs r2, 0xA - bl gpu_pal_apply + bl LoadPalette movs r0, 0x7 bl PutWindowTilemap movs r0, 0x7 @@ -49418,9 +49418,9 @@ sub_819EEF0: @ 819EEF0 ldr r0, =gUnknown_08610918 movs r1, 0xE0 movs r2, 0xA - bl gpu_pal_apply - ldr r0, =gUnknown_020378F4 - ldr r1, =gUnknown_02037CD4 + bl LoadPalette + ldr r0, =gPlttBufferUnfaded+ 0x1E0 + ldr r1, =gPlttBufferFaded + 0x1C0 movs r2, 0x5 bl CpuSet ldr r0, =gUnknown_03001284 @@ -61224,7 +61224,7 @@ _081A52A4: movs r1, 0x4 movs r2, 0 movs r3, 0x8 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =0x00003f3e movs r0, 0x48 bl SetGpuReg @@ -61234,7 +61234,7 @@ _081A52A4: movs r1, 0xF8 lsls r1, 1 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r1, =gUnknown_02022E24 movs r0, 0xFF strh r0, [r1] @@ -61244,7 +61244,7 @@ _081A52A4: b _081A553E .pool _081A52F4: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -61449,11 +61449,11 @@ _081A54D4: movs r1, 0x4 movs r2, 0x8 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _081A553E .pool _081A5520: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -66402,7 +66402,7 @@ _081A7DBC: negs r0, r0 ldrb r1, [r4, 0x16] ldr r2, =0x00002d6b - bl sub_80A2A20 + bl BlendPalettes _081A7DC8: movs r2, 0x16 ldrsh r0, [r4, r2] @@ -66452,7 +66452,7 @@ _081A7E16: negs r0, r0 ldrb r1, [r4, 0x16] ldr r2, =0x00002d6b - bl sub_80A2A20 + bl BlendPalettes _081A7E22: movs r0, 0x16 ldrsh r1, [r4, r0] @@ -69455,7 +69455,7 @@ _081A96B4: bgt _081A9754 cmp r0, 0 bne _081A9754 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -69591,7 +69591,7 @@ sub_81A97DC: @ 81A97DC push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -69605,7 +69605,7 @@ sub_81A97DC: @ 81A97DC lsls r0, 5 ldr r1, =gUnknown_08D856C8 adds r0, r1 - ldr r1, =gUnknown_020377D4 + ldr r1, =gPlttBufferUnfaded + 0xC0 movs r2, 0x10 bl CpuSet adds r0, r4, 0 @@ -72286,7 +72286,7 @@ c2_bag_3: @ 81AAD5C bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end c2_bag_3 @@ -72296,7 +72296,7 @@ vblank_cb_bag_menu: @ 81AAD78 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end vblank_cb_bag_menu @@ -72384,8 +72384,8 @@ _081AAE50: bl ResetObjectPaletteAllocator b _081AB012 _081AAE56: - bl sub_80A1A74 - ldr r2, =gUnknown_02037FD4 + bl ResetPaletteFade + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -72547,7 +72547,7 @@ _081AAFDE: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r1, =gUnknown_030022C0 movs r2, 0x87 lsls r2, 3 @@ -72561,8 +72561,8 @@ _081AAFF8: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe - ldr r2, =gUnknown_02037FD4 + bl BeginNormalPaletteFade + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -72703,14 +72703,14 @@ _081AB13C: ldr r0, =gUnknown_08D9A5D4 movs r1, 0 movs r2, 0x40 - bl decompress_palette + bl LoadCompressedPalette b _081AB1AE .pool _081AB164: ldr r0, =gUnknown_08D9A588 movs r1, 0 movs r2, 0x40 - bl decompress_palette + bl LoadCompressedPalette b _081AB1AE .pool _081AB174: @@ -73584,7 +73584,7 @@ unknown_ItemMenu_Confirm: @ 81AB8F8 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -73609,7 +73609,7 @@ task_close_bag_menu_2: @ 81AB930 lsls r0, 3 ldr r1, =gTasks + 0x8 adds r2, r0, r1 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -74114,7 +74114,7 @@ Task_BagMenu: @ 81ABD28 bne _081ABD66 b _081ABEB2 _081ABD66: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -77684,7 +77684,7 @@ Task_WallyTutorialBagMenu: @ 81ADD98 lsls r0, 3 ldr r1, =gTasks + 0x8 adds r4, r0, r1 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -78007,7 +78007,7 @@ setup_bag_menu_textboxes: @ 81AE054 ldr r0, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r4, 0 _081AE088: adds r0, r4, 0 @@ -80541,7 +80541,7 @@ AddScrollIndicatorArrowPair: @ 81AF380 adds r1, r2 lsrs r1, 16 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _081AF3EE .pool _081AF3DC: @@ -81135,7 +81135,7 @@ ListMenuAddRedOutlineCursorObject: @ 81AF828 adds r1, r2 lsrs r1, 16 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _081AF896 .pool _081AF884: @@ -81397,7 +81397,7 @@ ListMenuAddRedArrowCursorObject: @ 81AFA60 adds r1, r2 lsrs r1, 16 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _081AFAC6 .pool _081AFAB4: @@ -82303,7 +82303,7 @@ sub_81B01B0: @ 81B01B0 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_81B01B0 @@ -82313,7 +82313,7 @@ sub_81B01CC: @ 81B01CC push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_81B01CC @@ -82401,8 +82401,8 @@ _081B02AC: bl remove_some_task b _081B0484 _081B02B2: - bl sub_80A1A74 - ldr r2, =gUnknown_02037FD4 + bl ResetPaletteFade + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -82586,8 +82586,8 @@ _081B044C: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 - ldr r2, =gUnknown_02037FD4 + bl BlendPalettes + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -82605,7 +82605,7 @@ _081B0474: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _081B0484: ldr r1, =gUnknown_030022C0 movs r2, 0x87 @@ -82644,7 +82644,7 @@ sub_81B04BC: @ 81B04BC str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_81B04F8 movs r1, 0 bl CreateTask @@ -82663,7 +82663,7 @@ sub_81B04F8: @ 81B04F8 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -82807,8 +82807,8 @@ _081B0658: movs r2, 0xB0 lsls r2, 1 movs r1, 0 - bl decompress_palette - ldr r0, =gUnknown_02037714 + bl LoadCompressedPalette + ldr r0, =gPlttBufferUnfaded ldr r4, =gUnknown_0203CEC4 ldr r1, [r4] adds r1, 0x18 @@ -82862,7 +82862,7 @@ sub_81B06C0: @ 81B06C0 push {r4,r5,lr} adds r4, r0, 0 lsls r4, 28 - ldr r5, =gUnknown_02037774 + ldr r5, =gPlttBufferUnfaded + 0x60 lsrs r4, 23 adds r1, r5, 0 subs r1, 0x60 @@ -82870,7 +82870,7 @@ sub_81B06C0: @ 81B06C0 adds r0, r5, 0 movs r2, 0x10 bl CpuSet - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded adds r4, r0 adds r0, r5, 0 adds r1, r4, 0 @@ -84346,7 +84346,7 @@ sub_81B12C0: @ 81B12C0 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -84366,7 +84366,7 @@ c3_0811FAB4: @ 81B12F8 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -84426,7 +84426,7 @@ sub_81B1370: @ 81B1370 lsls r0, 24 lsrs r5, r0, 24 adds r6, r5, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -86505,11 +86505,11 @@ _081B23E8: bl sub_8098C64 movs r1, 0xE0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r4} pop {r0} bx r0 @@ -86943,19 +86943,19 @@ _081B2794: ldrb r1, [r4] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x1] bl sub_81B2564 ldrb r1, [r4, 0x1] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x2] bl sub_81B2564 ldrb r1, [r4, 0x2] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldr r5, =gUnknown_08615AEE b _081B2976 .pool @@ -86971,19 +86971,19 @@ _081B27D8: ldrb r1, [r4] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x1] bl sub_81B2564 ldrb r1, [r4, 0x1] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x2] bl sub_81B2564 ldrb r1, [r4, 0x2] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldr r5, =gUnknown_08615AEE b _081B2976 .pool @@ -87007,19 +87007,19 @@ _081B283C: ldrb r1, [r4] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x1] bl sub_81B2564 ldrb r1, [r4, 0x1] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x2] bl sub_81B2564 ldrb r1, [r4, 0x2] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldr r5, =gUnknown_08615AEE b _081B2976 .pool @@ -87043,19 +87043,19 @@ _081B2898: ldrb r1, [r4] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x1] bl sub_81B2564 ldrb r1, [r4, 0x1] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x2] bl sub_81B2564 ldrb r1, [r4, 0x2] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldr r5, =gUnknown_08615AE8 b _081B2976 .pool @@ -87079,19 +87079,19 @@ _081B28F4: ldrb r1, [r4] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x1] bl sub_81B2564 ldrb r1, [r4, 0x1] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x2] bl sub_81B2564 ldrb r1, [r4, 0x2] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldr r5, =gUnknown_08615AE5 b _081B2976 .pool @@ -87108,19 +87108,19 @@ _081B2942: ldrb r1, [r4] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x1] bl sub_81B2564 ldrb r1, [r4, 0x1] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x2] bl sub_81B2564 ldrb r1, [r4, 0x2] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldr r5, =gUnknown_08615AEB _081B2976: ldrb r0, [r5] @@ -87130,19 +87130,19 @@ _081B297E: ldrb r1, [r4] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x1] bl sub_81B2564 ldrb r1, [r4, 0x1] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x2] bl sub_81B2564 ldrb r1, [r4, 0x2] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette b _081B2A24 .pool _081B29BC: @@ -87153,19 +87153,19 @@ _081B29BC: ldrb r1, [r4] adds r1, r7 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x1] bl sub_81B2564 ldrb r1, [r4, 0x1] adds r1, r7 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x2] bl sub_81B2564 ldrb r1, [r4, 0x2] adds r1, r7 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldr r5, =gUnknown_08615AE2 ldrb r0, [r5] bl sub_81B2564 @@ -87173,19 +87173,19 @@ _081B29BC: ldrb r1, [r4] adds r1, r7 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x1] bl sub_81B2564 ldrb r1, [r4, 0x1] adds r1, r7 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x2] bl sub_81B2564 ldrb r1, [r4, 0x2] adds r1, r7 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette _081B2A24: pop {r4-r7} pop {r0} @@ -87463,13 +87463,13 @@ _081B2C48: ldrb r1, [r4] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x1] bl sub_81B2564 ldrb r1, [r4, 0x1] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r7, 0x8] ldr r1, =gUnknown_085E8D49 ldr r3, [r7] @@ -87486,13 +87486,13 @@ _081B2C88: ldrb r1, [r4] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x1] bl sub_81B2564 ldrb r1, [r4, 0x1] adds r1, r6 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r7, 0x8] ldr r1, =gUnknown_085E8D4B ldr r3, [r7] @@ -87753,13 +87753,13 @@ _081B2EB2: ldrb r1, [r4] adds r1, r7 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x1] bl sub_81B2564 ldrb r1, [r4, 0x1] adds r1, r7 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette b _081B2F04 .pool _081B2EE0: @@ -87770,13 +87770,13 @@ _081B2EE0: ldrb r1, [r4] adds r1, r7 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r5, 0x1] bl sub_81B2564 ldrb r1, [r4, 0x1] adds r1, r7 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette _081B2F04: mov r1, r8 lsls r0, r1, 16 @@ -88776,7 +88776,7 @@ sub_81B3730: @ 81B3730 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -88928,7 +88928,7 @@ _081B3880: sub_81B3894: @ 81B3894 push {lr} sub sp, 0xC - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -90130,7 +90130,7 @@ sub_81B42D0: @ 81B42D0 push {r7} lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -90182,7 +90182,7 @@ sub_81B4350: @ 81B4350 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -90486,7 +90486,7 @@ sub_81B4624: @ 81B4624 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -90982,7 +90982,7 @@ sub_81B4A98: @ 81B4A98 sub_81B4AE0: @ 81B4AE0 push {lr} sub sp, 0xC - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -93746,7 +93746,7 @@ sub_81B6280: @ 81B6280 push {lr} lsls r0, 24 lsrs r3, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -95376,7 +95376,7 @@ sub_81B711C: @ 81B711C lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -96848,7 +96848,7 @@ sub_81B7E4C: @ 81B7E4C push {r7} lsls r0, 24 lsrs r6, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -97091,7 +97091,7 @@ sub_81B8088: @ 81B8088 push {r7} lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -97271,7 +97271,7 @@ sub_81B8230: @ 81B8230 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -99185,7 +99185,7 @@ sub_81B91B4: @ 81B91B4 lsls r0, 3 ldr r1, =gTasks + 0x8 adds r4, r0, r1 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -99477,7 +99477,7 @@ sub_81B9424: @ 81B9424 sub sp, 0xC lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -99553,7 +99553,7 @@ sub_81B94D0: @ 81B94D0 sub sp, 0xC lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -99603,7 +99603,7 @@ sub_81B953C: @ 81B953C sub sp, 0xC lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -99724,7 +99724,7 @@ sub_81B9640: @ 81B9640 sub sp, 0xC lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/rom_81BAD84.s b/asm/rom_81BAD84.s index 2bdbb32ec..dccf10f5e 100644 --- a/asm/rom_81BAD84.s +++ b/asm/rom_81BAD84.s @@ -5882,7 +5882,7 @@ sub_81BE10C: @ 81BE10C lsls r2, 1 adds r1, r4, r2 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette b _081BE21A .pool _081BE1FC: @@ -5898,7 +5898,7 @@ _081BE1FC: lsls r2, 1 adds r1, r4, r2 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette _081BE21A: ldr r2, =gUnknown_02020630 ldr r1, =gUnknown_020241E4 @@ -6372,7 +6372,7 @@ sub_81BE61C: @ 81BE61C movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 - bl sub_80A2390 + bl BeginFastPaletteFade bl dp01_tbl3_exec_completed ldr r1, =gUnknown_03005D60 ldrb r0, [r4] @@ -8762,7 +8762,7 @@ sub_81BFAB4: @ 81BFAB4 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_81BFAB4 @@ -8772,7 +8772,7 @@ sub_81BFAD0: @ 81BFAD0 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_81BFAD0 @@ -8861,8 +8861,8 @@ _081BFBAA: b _081BFDEE .pool _081BFBBC: - bl sub_80A1A74 - ldr r2, =gUnknown_02037FD4 + bl ResetPaletteFade + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -9067,7 +9067,7 @@ _081BFDB0: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r1, =gUnknown_030022C0 movs r0, 0x87 lsls r0, 3 @@ -9081,8 +9081,8 @@ _081BFDCC: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe - ldr r2, =gUnknown_02037FD4 + bl BeginNormalPaletteFade + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -9274,11 +9274,11 @@ _081BFFC0: movs r2, 0x80 lsls r2, 1 movs r1, 0 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_08D85620 movs r1, 0x81 movs r2, 0x1E - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0203CF1C ldr r1, [r0] ldr r2, =0x000040f0 @@ -9333,7 +9333,7 @@ _081C0064: movs r1, 0xE8 lsls r1, 1 movs r2, 0x60 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_0203CF1C ldr r0, [r0] ldr r1, =0x000040f0 @@ -9782,7 +9782,7 @@ sub_81C044C: @ 81C044C str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -9807,7 +9807,7 @@ sub_81C0484: @ 81C0484 lsrs r0, 24 cmp r0, 0x1 beq _081C04EC - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -9859,7 +9859,7 @@ sub_81C0510: @ 81C0510 lsrs r0, 24 cmp r0, 0x1 beq _081C05FE - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r2, 0x80 adds r0, r2, 0 @@ -11949,7 +11949,7 @@ sub_81C174C: @ 81C174C bne _081C176A b _081C189A _081C176A: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r2, 0x80 adds r0, r2, 0 @@ -17584,7 +17584,7 @@ sub_81C4844: @ 81C4844 ldr r0, [r0] adds r5, r0, 0 adds r5, 0x70 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -17709,8 +17709,8 @@ sub_81C48F0: @ 81C48F0 adds r0, r1, 0 orrs r3, r0 movs r2, 0 - ldr r5, =gUnknown_02037714 - ldr r4, =gUnknown_02037B14 + ldr r5, =gPlttBufferUnfaded + ldr r4, =gPlttBufferFaded _081C494C: adds r0, r2, r3 lsls r0, 16 @@ -18316,7 +18316,7 @@ _081C4E2E: movs r2, 0x1 bl SetBgAttribute ldr r0, =gUnknown_0861D140 - ldr r1, =gUnknown_020377F4 + ldr r1, =gPlttBufferUnfaded + 0xE0 ldr r2, =0x04000018 bl CpuSet ldr r0, =gUnknown_0203CF28 @@ -18437,7 +18437,7 @@ sub_81C4F44: @ 81C4F44 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -18531,7 +18531,7 @@ sub_81C501C: @ 81C501C bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_81C501C @@ -18541,7 +18541,7 @@ sub_81C5038: @ 81C5038 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_81C5038 @@ -18619,8 +18619,8 @@ _081C50F4: bl ResetObjectPaletteAllocator b _081C51A2 _081C50FA: - bl sub_80A1A74 - ldr r2, =gUnknown_02037FD4 + bl ResetPaletteFade + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -18680,7 +18680,7 @@ _081C517A: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes b _081C51A2 _081C5188: movs r0, 0x1 @@ -18689,8 +18689,8 @@ _081C5188: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe - ldr r2, =gUnknown_02037FD4 + bl BeginNormalPaletteFade + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -18812,7 +18812,7 @@ _081C52B8: ldr r0, =gUnknown_08D9AF44 movs r1, 0 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette b _081C52D8 .pool _081C52C8: @@ -19808,7 +19808,7 @@ sub_81C5B14: @ 81C5B14 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -19833,7 +19833,7 @@ sub_81C5B4C: @ 81C5B4C lsls r0, 3 ldr r1, =gTasks + 0x8 adds r2, r0, r1 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -19893,7 +19893,7 @@ sub_81C5BC8: @ 81C5BC8 bne _081C5BEA b _081C5D16 _081C5BEA: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -21675,7 +21675,7 @@ sub_81C6BD8: @ 81C6BD8 ldr r0, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r4, 0 _081C6C04: adds r0, r4, 0 @@ -22497,8 +22497,8 @@ sub_81C72A4: @ 81C72A4 thumb_func_start sub_81C72BC sub_81C72BC: @ 81C72BC push {r4,lr} - bl fade_and_return_progress_probably - ldr r0, =gUnknown_02037FD4 + bl UpdatePaletteFade + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -22654,7 +22654,7 @@ sub_81C7400: @ 81C7400 bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_81C7400 @@ -22662,7 +22662,7 @@ sub_81C7400: @ 81C7400 thumb_func_start sub_81C7418 sub_81C7418: @ 81C7418 push {lr} - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl LoadOamFromSprites bl ProcessObjectCopyRequests pop {r0} @@ -23061,7 +23061,7 @@ sub_81C7710: @ 81C7710 adds r0, r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade add sp, 0x4 pop {r0} bx r0 @@ -23070,7 +23070,7 @@ sub_81C7710: @ 81C7710 thumb_func_start sub_81C7738 sub_81C7738: @ 81C7738 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -23336,7 +23336,7 @@ _081C793E: sub_81C7944: @ 81C7944 push {lr} lsls r1, 1 - ldr r3, =gUnknown_02037714 + ldr r3, =gPlttBufferUnfaded adds r1, r3 lsls r2, 10 lsrs r2, 11 @@ -23386,7 +23386,7 @@ sub_81C7990: @ 81C7990 mov r0, sp strh r1, [r0] lsls r3, 5 - ldr r0, =gUnknown_02037D14 + ldr r0, =gPlttBufferFaded + 0x200 adds r3, r0 ldr r2, =0x01000010 mov r0, sp @@ -23566,7 +23566,7 @@ _081C7AF0: str r2, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _081C7B2C _081C7B04: movs r0, 0x1 @@ -23577,7 +23577,7 @@ _081C7B04: str r2, [sp] _081C7B10: movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _081C7B2C _081C7B18: movs r0, 0x1 @@ -23588,7 +23588,7 @@ _081C7B18: str r2, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _081C7B2C: add sp, 0x4 pop {r4} @@ -23598,7 +23598,7 @@ _081C7B2C: thumb_func_start sub_81C7B34 sub_81C7B34: @ 81C7B34 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r0, [r0, 0x7] lsrs r0, 7 bx lr @@ -23611,7 +23611,7 @@ sub_81C7B40: @ 81C7B40 ldr r0, =0xfffefffe movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes pop {r0} bx r0 .pool @@ -24028,7 +24028,7 @@ sub_81C7E58: @ 81C7E58 lsrs r1, 16 adds r0, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r4, =0x0201c000 mov r0, r8 adds r1, r4, 0 @@ -24110,7 +24110,7 @@ sub_81C7F24: @ 81C7F24 lsrs r1, 16 adds r0, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r4, =0x0201d000 adds r0, r6, 0 adds r1, r4, 0 @@ -29491,7 +29491,7 @@ sub_81CA8B0: @ 81CA8B0 add r0, sp, 0x8 movs r1, 0x31 movs r2, 0x4 - bl gpu_pal_apply + bl LoadPalette movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0xC @@ -29509,7 +29509,7 @@ _081CA908: thumb_func_start sub_81CA914 sub_81CA914: @ 81CA914 push {lr} - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl LoadOamFromSprites bl ProcessObjectCopyRequests bl sub_80BA0A8 @@ -32042,18 +32042,18 @@ sub_81CBC64: @ 81CBC64 movs r3, 0x2 ldrsh r2, [r2, r3] str r2, [sp] - ldr r4, =gUnknown_020377B4 + ldr r4, =gPlttBufferUnfaded + 0xA0 str r4, [sp, 0x4] movs r2, 0x10 movs r3, 0x10 bl sub_81C79BC - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne _081CBCC8 - ldr r1, =gUnknown_02037BB4 + ldr r1, =gPlttBufferFaded + 0xA0 ldr r2, =0x04000008 adds r0, r4, 0 bl CpuSet @@ -32965,7 +32965,7 @@ sub_81CC39C: @ 81CC39C ldrh r1, [r7, 0x1A] adds r0, r6, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, [r7, 0x20] movs r0, 0 strh r0, [r1, 0x2E] @@ -33327,7 +33327,7 @@ sub_81CC670: @ 81CC670 thumb_func_start sub_81CC6A4 sub_81CC6A4: @ 81CC6A4 push {lr} - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl LoadOamFromSprites bl ProcessObjectCopyRequests bl sub_81237B4 @@ -38070,7 +38070,7 @@ _081CEDFC: add r1, r8 ldrh r1, [r1] movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _081CEE26: add sp, 0x28 pop {r3} @@ -38088,7 +38088,7 @@ sub_81CEE44: @ 81CEE44 adds r4, r0, 0 bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer adds r0, r4, 0 bl sub_81D2108 bl sub_80BA0A8 @@ -45757,7 +45757,7 @@ sub_81D2824: @ 81D2824 ldr r0, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r4, 0 _081D284A: adds r0, r4, 0 @@ -53207,7 +53207,7 @@ sub_81D64C0: @ 81D64C0 ldr r0, =gUnknown_0862A5D4 movs r1, 0x70 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _081D64D4: pop {r0} bx r0 @@ -53537,13 +53537,13 @@ sub_81D6774: @ 81D6774 bl clear_scheduled_bg_copies_to_vram bl remove_some_task bl ResetObjectPaletteAllocator - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl ResetTasks movs r0, 0 movs r1, 0xF0 movs r2, 0x20 - bl rboxid_80040B8 + bl FillPalette ldr r1, =gUnknown_0862A6A0 ldr r0, =gUnknown_0203CF60 ldr r0, [r0] @@ -53569,7 +53569,7 @@ sub_81D67D0: @ 81D67D0 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_81D67D0 @@ -53579,7 +53579,7 @@ sub_81D67EC: @ 81D67EC push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_81D67EC @@ -53589,7 +53589,7 @@ sub_81D6800: @ 81D6800 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -53618,7 +53618,7 @@ sub_81D6840: @ 81D6840 lsls r0, 24 lsrs r3, r0, 24 adds r6, r3, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -53686,10 +53686,10 @@ sub_81D68C8: @ 81D68C8 ldr r1, =0x00001888 movs r0, 0x44 bl SetGpuReg - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded movs r1, 0 strh r1, [r0] - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded strh r1, [r0] pop {r0} bx r0 @@ -53721,7 +53721,7 @@ sub_81D691C: @ 81D691C ldr r1, =gTasks + 0x8 adds r5, r0, r1 bl sub_81D750C - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -54638,7 +54638,7 @@ _081D7082: ldr r0, =gUnknown_08DA37E8 movs r1, 0 movs r2, 0x40 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_0862A8C4 bl LoadCompressedObjectPic ldr r0, =gUnknown_0862A8F8 @@ -54737,14 +54737,14 @@ _081D71EE: adds r0, r4, 0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_81D6FD0 bl SetVBlankCallback movs r0, 0x53 @@ -54934,7 +54934,7 @@ sub_81D736C: @ 81D736C ldr r7, =gTasks + 0x8 adds r4, r0, r7 bl sub_81D750C - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -55222,7 +55222,7 @@ sub_81D75B4: @ 81D75B4 adds r1, r4, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -55248,7 +55248,7 @@ sub_81D7600: @ 81D7600 ldr r7, =gTasks + 0x8 adds r5, r6, r7 bl sub_81D750C - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -56343,7 +56343,7 @@ _081D7ED0: ldr r0, =gUnknown_08DA4DA8 movs r1, 0 movs r2, 0x40 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_0862AA90 bl LoadCompressedObjectPic ldr r0, =gUnknown_0862AA98 @@ -56381,7 +56381,7 @@ sub_81D7F4C: @ 81D7F4C negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r0, =sub_81D67EC bl SetVBlankCallback ldr r0, =sub_81D81A4 @@ -56441,7 +56441,7 @@ _081D7FF4: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade strh r5, [r4, 0x4] movs r0, 0x1E strh r0, [r4, 0x6] @@ -56580,7 +56580,7 @@ _081D80F4: movs r1, 0x6 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _081D815A .pool _081D8124: @@ -56621,7 +56621,7 @@ sub_81D8164: @ 81D8164 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -56899,11 +56899,11 @@ _081D8380: ldr r0, =gUnknown_08DA7744 movs r1, 0 movs r2, 0x40 - bl decompress_palette - ldr r0, =gUnknown_02037714 + bl LoadCompressedPalette + ldr r0, =gPlttBufferUnfaded ldr r1, =0x00007fff strh r1, [r0] - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded strh r1, [r0] ldr r0, =gUnknown_0862AAFC bl LoadCompressedObjectPic @@ -57018,7 +57018,7 @@ sub_81D84EC: @ 81D84EC negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r0, =sub_81D67EC bl SetVBlankCallback ldr r0, =gUnknown_0203CF60 @@ -57089,11 +57089,11 @@ _081D85BC: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade strh r4, [r5, 0x2] b _081D864E _081D85DC: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -57160,7 +57160,7 @@ _081D8656: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -57181,7 +57181,7 @@ sub_81D8684: @ 81D8684 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -57498,7 +57498,7 @@ _081D8904: ldr r0, =gUnknown_08DA8E84 movs r1, 0 movs r2, 0x80 - bl decompress_palette + bl LoadCompressedPalette add sp, 0x4 pop {r4} pop {r0} @@ -57523,7 +57523,7 @@ sub_81D8980: @ 81D8980 negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r0, =sub_81D67EC bl SetVBlankCallback movs r0, 0 @@ -57604,7 +57604,7 @@ _081D8A3E: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade strh r5, [r4, 0x2] b _081D8A9A _081D8A5C: @@ -57652,7 +57652,7 @@ _081D8AA8: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r6, 2 adds r0, r6 @@ -57818,7 +57818,7 @@ sub_81D8BEC: @ 81D8BEC ldr r6, =gTasks + 0x8 adds r4, r5, r6 bl sub_81D8BB4 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -57933,7 +57933,7 @@ _081D8CEA: ldr r0, =gUnknown_08DAAFEC movs r1, 0 movs r2, 0x60 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_0862AC28 bl LoadCompressedObjectPic ldr r0, =gUnknown_0862AC30 @@ -57988,7 +57988,7 @@ sub_81D8DB4: @ 81D8DB4 negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r0, =sub_81D67EC bl SetVBlankCallback movs r0, 0 @@ -58091,7 +58091,7 @@ _081D8EBA: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade strh r5, [r4, 0x2] b _081D8F30 _081D8EDE: @@ -58177,7 +58177,7 @@ _081D8F84: movs r1, 0x4 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade mov r0, r8 subs r0, 0x8 adds r0, r7, r0 @@ -58275,7 +58275,7 @@ sub_81D9034: @ 81D9034 lsls r6, r1, 3 ldr r7, =gTasks + 0x8 adds r4, r6, r7 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -61111,7 +61111,7 @@ sub_81DA700: @ 81DA700 ldr r0, =gUnknown_0862B53C movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0862B724 bl LoadCompressedObjectPic ldr r0, =gUnknown_0862B72C @@ -61665,7 +61665,7 @@ _081DAB64: adds r0, r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -61800,7 +61800,7 @@ sub_81DAC14: @ 81DAC14 sub_81DAC80: @ 81DAC80 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -61907,7 +61907,7 @@ sub_81DACEC: @ 81DACEC sub_81DAD58: @ 81DAD58 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -62023,7 +62023,7 @@ sub_81DADC4: @ 81DADC4 sub_81DAE44: @ 81DAE44 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -62141,7 +62141,7 @@ sub_81DAEB0: @ 81DAEB0 sub_81DAF34: @ 81DAF34 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -62266,7 +62266,7 @@ _081DB01A: sub_81DB02C: @ 81DB02C push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -62391,7 +62391,7 @@ _081DB112: sub_81DB124: @ 81DB124 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -62520,7 +62520,7 @@ _081DB212: sub_81DB224: @ 81DB224 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -62651,7 +62651,7 @@ _081DB316: sub_81DB328: @ 81DB328 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/roulette.s b/asm/roulette.s index 08bcd5bf2..0240322b2 100644 --- a/asm/roulette.s +++ b/asm/roulette.s @@ -32,7 +32,7 @@ sub_8140264: @ 8140264 sub sp, 0x4 bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl sub_8142814 ldr r4, =gUnknown_0203AB88 ldr r0, [r4] @@ -305,15 +305,15 @@ _081404AA: ldrb r0, [r0, 0x19] cmp r0, 0x1 bne _08140520 - ldr r4, =gUnknown_02037714 - ldr r3, =gUnknown_02037B14 + ldr r4, =gPlttBufferUnfaded + ldr r3, =gPlttBufferFaded mov r0, sp ldrh r2, [r0] b _08140528 .pool _08140520: - ldr r4, =gUnknown_02037714 - ldr r3, =gUnknown_02037B14 + ldr r4, =gPlttBufferUnfaded + ldr r3, =gPlttBufferFaded mov r0, sp ldrh r2, [r0, 0x2] _08140528: @@ -441,7 +441,7 @@ _08140630: b _081407F8 .pool _08140650: - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl ResetTasks bl reset_temp_tile_data_buffers @@ -451,7 +451,7 @@ _08140662: movs r2, 0xE0 lsls r2, 1 movs r1, 0 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_08DBC2E8 movs r4, 0 str r4, [sp] @@ -559,7 +559,7 @@ _0814077A: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl sub_80A27B0 + bl BeginHardwarePaletteFade ldr r0, =sub_81408A8 movs r1, 0 bl CreateTask @@ -691,7 +691,7 @@ sub_81408A8: @ 81408A8 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 @@ -3205,7 +3205,7 @@ _08141E3C: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl sub_80A27B0 + bl BeginHardwarePaletteFade ldr r1, =gTasks lsls r0, r5, 2 adds r0, r5 @@ -3225,7 +3225,7 @@ sub_8141E7C: @ 8141E7C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 @@ -3248,7 +3248,7 @@ sub_8141E7C: @ 8141E7C movs r1, 0 bl SetGpuReg bl ResetObjectPaletteAllocator - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl sub_8140418 ldr r1, =gUnknown_03005DAC @@ -4495,7 +4495,7 @@ sub_81428E4: @ 81428E4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -4532,8 +4532,8 @@ sub_8142918: @ 8142918 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe - ldr r2, =gUnknown_02037FD4 + bl BeginNormalPaletteFade + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] lsls r1, 26 lsrs r1, 26 @@ -4543,7 +4543,7 @@ sub_8142918: @ 8142918 ands r0, r3 orrs r0, r1 strb r0, [r2, 0x4] - bl fade_and_return_progress_probably + bl UpdatePaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 diff --git a/asm/roulette_util.s b/asm/roulette_util.s index 10f420997..61f6f67b1 100644 --- a/asm/roulette_util.s +++ b/asm/roulette_util.s @@ -151,9 +151,9 @@ _0815176C: ldrh r0, [r5, 0x6] add r0, r12 lsls r0, 1 - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded adds r3, r0, r1 - ldr r1, =gUnknown_02037714 + ldr r1, =gPlttBufferUnfaded adds r6, r0, r1 ldrb r0, [r5] lsls r0, 25 @@ -419,7 +419,7 @@ _08151962: ldrb r0, [r3, 0x8] cmp r2, r0 bcs _08151982 - ldr r4, =gUnknown_02037B14 + ldr r4, =gPlttBufferFaded _0815196A: ldrh r0, [r3, 0x6] adds r0, r2 @@ -444,8 +444,8 @@ _08151990: ldrb r0, [r3, 0x8] cmp r2, r0 bcs _081519B4 - ldr r5, =gUnknown_02037B14 - ldr r4, =gUnknown_02037714 + ldr r5, =gPlttBufferFaded + ldr r4, =gPlttBufferUnfaded _0815199A: ldrh r0, [r3, 0x6] adds r0, r2 @@ -619,9 +619,9 @@ _08151AAA: beq _08151B12 ldrh r1, [r4, 0xA] lsls r1, 1 - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded adds r0, r1, r0 - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded adds r1, r2 ldrb r2, [r4, 0xC] lsls r2, 1 @@ -778,8 +778,8 @@ sub_8151BD4: @ 8151BD4 adds r0, r2, r0 cmp r2, r0 bge _08151C16 - ldr r5, =gUnknown_02037B14 - ldr r3, =gUnknown_02037714 + ldr r5, =gPlttBufferFaded + ldr r3, =gPlttBufferUnfaded _08151BFC: lsls r0, r2, 1 adds r1, r0, r5 @@ -981,8 +981,8 @@ sub_8151D28: @ 8151D28 adds r0, r2, r0 cmp r2, r0 bge _08151D8E - ldr r5, =gUnknown_02037B14 - ldr r4, =gUnknown_02037714 + ldr r5, =gPlttBufferFaded + ldr r4, =gPlttBufferUnfaded _08151D74: lsls r0, r2, 1 adds r1, r0, r5 @@ -1053,8 +1053,8 @@ _08151DE4: adds r0, r2, r0 cmp r2, r0 bge _08151E1A - ldr r6, =gUnknown_02037B14 - ldr r4, =gUnknown_02037714 + ldr r6, =gPlttBufferFaded + ldr r4, =gPlttBufferUnfaded _08151E00: lsls r0, r2, 1 adds r1, r0, r6 @@ -1136,7 +1136,7 @@ _08151E78: beq _08151E92 b _08151FE6 _08151E92: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] adds r0, r3, 0 ands r0, r1 @@ -1164,7 +1164,7 @@ _08151EB8: lsls r2, 28 lsrs r2, 28 ldrh r3, [r4, 0x4] - bl pal_fade_1 + bl BlendPalette ldrb r5, [r4, 0xB] lsls r0, r5, 26 asrs r0, 30 diff --git a/asm/save_failed_screen.s b/asm/save_failed_screen.s index c4a6a9c46..52ff44cc6 100644 --- a/asm/save_failed_screen.s +++ b/asm/save_failed_screen.s @@ -73,7 +73,7 @@ sub_8178FC8: @ 8178FC8 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_8178FC8 @@ -228,24 +228,24 @@ _08178FF8: bl DeactivateAllTextPrinters bl ResetAllObjectData bl ResetTasks - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =gUnknown_085B0A00 movs r1, 0 movs r2, 0x40 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085EFDC4 movs r1, 0x80 lsls r1, 1 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0850FEFC movs r1, 0xE0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r4] movs r1, 0 adds r2, r6, 0 @@ -279,7 +279,7 @@ _08178FF8: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x1 bl EnableInterrupts ldr r0, =sub_8178FC8 @@ -300,7 +300,7 @@ _08178FF8: b _08179272 .pool _0817925C: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _08179272 @@ -468,7 +468,7 @@ sub_81793E0: @ 81793E0 str r2, [sp] movs r1, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_8178FC8 bl SetVBlankCallback ldr r0, =sub_8179428 @@ -483,7 +483,7 @@ _08179410: thumb_func_start sub_8179428 sub_8179428: @ 8179428 push {r4,r5,lr} - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 diff --git a/asm/scrcmd.s b/asm/scrcmd.s index 08e755325..17b9ccfdb 100644 --- a/asm/scrcmd.s +++ b/asm/scrcmd.s @@ -1338,7 +1338,7 @@ s99_unknown: @ 8099C8C thumb_func_start sub_8099CA8 sub_8099CA8: @ 8099CA8 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1420,8 +1420,8 @@ _08099D3A: cmp r4, 0x2 beq _08099D60 _08099D3E: - ldr r0, =gUnknown_02037714 - ldr r1, =gUnknown_02037FE8 + ldr r0, =gPlttBufferUnfaded + ldr r1, =sPaletteDecompressionBuffer ldr r2, =0x04000100 bl CpuSet adds r0, r4, 0 @@ -1430,8 +1430,8 @@ _08099D3E: b _08099D72 .pool _08099D60: - ldr r0, =gUnknown_02037FE8 - ldr r1, =gUnknown_02037714 + ldr r0, =sPaletteDecompressionBuffer + ldr r1, =gPlttBufferUnfaded ldr r2, =0x04000100 bl CpuSet adds r0, r4, 0 diff --git a/asm/script_menu.s b/asm/script_menu.s index 382010cda..d1978b033 100644 --- a/asm/script_menu.s +++ b/asm/script_menu.s @@ -308,7 +308,7 @@ sub_80E2058: @ 80E2058 lsls r0, 3 ldr r1, =gTasks + 0x8 adds r5, r0, r1 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/script_pokemon_util_80F87D8.s b/asm/script_pokemon_util_80F87D8.s index 2c2aba2c2..b68c2418f 100644 --- a/asm/script_pokemon_util_80F87D8.s +++ b/asm/script_pokemon_util_80F87D8.s @@ -550,14 +550,14 @@ _080F8C38: ldr r0, =gFieldObjectPalette8 _080F8C42: movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _080F8C5A .pool _080F8C50: lsrs r1, r4, 16 ldr r0, =gFieldObjectPalette17 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _080F8C5A: movs r0, 0x80 lsls r0, 13 diff --git a/asm/secret_base.s b/asm/secret_base.s index 94cdf27ec..26d87219a 100644 --- a/asm/secret_base.s +++ b/asm/secret_base.s @@ -655,7 +655,7 @@ sub_80E8FD0: @ 80E8FD0 b _080E904A .pool _080E8FF4: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -827,7 +827,7 @@ sub_80E916C: @ 80E916C sub sp, 0x4 lsls r0, 24 lsrs r6, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1472,7 +1472,7 @@ _080E96D2: strh r0, [r4, 0x8] b _080E9714 _080E96DC: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/shop.s b/asm/shop.s index a2d518a08..6e5c140ad 100644 --- a/asm/shop.s +++ b/asm/shop.s @@ -276,7 +276,7 @@ Task_GoToBuyOrSellMenu: @ 80DFCA4 lsls r0, 3 ldr r1, =gTasks + 0x8 adds r4, r0, r1 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -369,7 +369,7 @@ CB2_BuyMenu: @ 80DFD64 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end CB2_BuyMenu @@ -380,7 +380,7 @@ VBlankCB_BuyMenu: @ 80DFD80 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end VBlankCB_BuyMenu @@ -427,13 +427,13 @@ _080DFDAC: adds r0, r4, 0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes str r5, [sp] adds r0, r4, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =VBlankCB_BuyMenu bl SetVBlankCallback ldr r0, =CB2_BuyMenu @@ -451,7 +451,7 @@ _080DFE20: bl remove_some_task bl reset_temp_tile_data_buffers bl ResetObjectPaletteAllocator - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData bl ResetTasks bl clear_scheduled_bg_copies_to_vram @@ -1140,7 +1140,7 @@ BuyMenuDecompressBgGraphics: @ 80E0424 ldr r0, =gUnknown_08D9B0C8 movs r1, 0xC0 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette add sp, 0x4 pop {r0} bx r0 @@ -1967,7 +1967,7 @@ Task_BuyMenu: @ 80E0AC8 lsls r0, 3 ldr r1, =gTasks + 0x8 adds r4, r0, r1 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2677,7 +2677,7 @@ ExitBuyMenu: @ 80E1168 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -2698,7 +2698,7 @@ Task_ExitBuyMenu: @ 80E11B0 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/slot_machine.s b/asm/slot_machine.s index 9f5946b2a..a99ceaf30 100644 --- a/asm/slot_machine.s +++ b/asm/slot_machine.s @@ -31,13 +31,13 @@ _0812A500: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b _0812A530 _0812A518: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -148,7 +148,7 @@ _0812A60E: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0 bl ShowBg movs r0, 0x1 @@ -193,7 +193,7 @@ sub_812A670: @ 812A670 bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_812A670 @@ -203,7 +203,7 @@ sub_812A688: @ 812A688 push {r4,lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer ldr r4, =gUnknown_0203AB34 ldr r0, [r4] adds r0, 0x58 @@ -568,7 +568,7 @@ _0812A934: thumb_func_start sub_812A9AC sub_812A9AC: @ 812A9AC push {lr} - bl sub_80A1A74 + bl ResetPaletteFade bl ResetAllObjectData ldr r1, =gUnknown_02021B38 movs r0, 0x80 @@ -722,7 +722,7 @@ sub_812AB04: @ 812AB04 str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r4, =gUnknown_0203AB34 ldr r0, [r4] ldrb r0, [r0, 0x2] @@ -742,7 +742,7 @@ sub_812AB04: @ 812AB04 thumb_func_start sub_812AB38 sub_812AB38: @ 812AB38 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1751,7 +1751,7 @@ sub_812B2EC: @ 812B2EC str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r4] ldrb r0, [r1] adds r0, 0x1 @@ -1767,7 +1767,7 @@ sub_812B2EC: @ 812B2EC thumb_func_start sub_812B32C sub_812B32C: @ 812B32C push {r4-r6,lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -5264,7 +5264,7 @@ sub_812CE2C: @ 812CE2C ldrb r1, [r0] adds r0, r2, 0 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette pop {r0} bx r0 .pool @@ -5284,7 +5284,7 @@ sub_812CE54: @ 812CE54 ldrb r1, [r0] adds r0, r2, 0 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette pop {r0} bx r0 .pool @@ -5640,7 +5640,7 @@ _0812D10C: ldr r0, [r0] movs r1, 0x10 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0x1 _0812D120: pop {r1} @@ -5691,7 +5691,7 @@ _0812D166: ldr r0, [r1] movs r1, 0x10 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r0} bx r0 .pool @@ -7149,7 +7149,7 @@ sub_812DD04: @ 812DD04 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -7163,7 +7163,7 @@ sub_812DD04: @ 812DD04 sub_812DD28: @ 812DD28 push {lr} adds r2, r0, 0 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -7225,7 +7225,7 @@ sub_812DD78: @ 812DD78 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -7263,7 +7263,7 @@ sub_812DDC4: @ 812DDC4 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -7319,7 +7319,7 @@ sub_812DE48: @ 812DE48 str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -10138,7 +10138,7 @@ sub_812F470: @ 812F470 lsrs r1, 16 adds r0, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldrh r0, [r5, 0x32] adds r0, 0x1 strh r0, [r5, 0x32] @@ -10171,7 +10171,7 @@ _0812F4C0: lsrs r1, 16 adds r0, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldrh r0, [r5, 0x32] adds r0, 0x1 movs r1, 0 @@ -10550,7 +10550,7 @@ sub_812F794: @ 812F794 lsrs r1, 16 adds r0, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r4} pop {r0} bx r0 @@ -10725,11 +10725,11 @@ sub_812F908: @ 812F908 ldr r0, =gUnknown_08DCDA90 movs r1, 0 movs r2, 0xA0 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085A8524 movs r1, 0xD0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r4,r5} pop {r0} bx r0 diff --git a/asm/sprite.s b/asm/sprite.s index 9e161cd75..a214a7f92 100644 --- a/asm/sprite.s +++ b/asm/sprite.s @@ -4115,7 +4115,7 @@ LoadObjectPalette: @ 80087BC adds r1, r2 lsrs r1, 16 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r0} bx r0 thumb_func_end LoadObjectPalette diff --git a/asm/start_menu.s b/asm/start_menu.s index 65a41f047..9e3a43e3e 100644 --- a/asm/start_menu.s +++ b/asm/start_menu.s @@ -853,7 +853,7 @@ _0809FBAE: thumb_func_start StartMenu_Pokedex StartMenu_Pokedex: @ 809FBB4 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -880,7 +880,7 @@ _0809FBE6: thumb_func_start StartMenu_Pokemon StartMenu_Pokemon: @ 809FBF0 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -905,7 +905,7 @@ _0809FC1C: thumb_func_start StartMenu_Bag StartMenu_Bag: @ 809FC24 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -930,7 +930,7 @@ _0809FC50: thumb_func_start StartMenu_PokeNav StartMenu_PokeNav: @ 809FC58 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -955,7 +955,7 @@ _0809FC84: thumb_func_start StartMenu_PlayerName StartMenu_PlayerName: @ 809FC8C push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1020,7 +1020,7 @@ _0809FD0C: thumb_func_start StartMenu_Option StartMenu_Option: @ 809FD20 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1069,7 +1069,7 @@ StartMenu_SafariZoneRetire: @ 809FD74 thumb_func_start StartMenu_LinkModePlayerName StartMenu_LinkModePlayerName: @ 809FD88 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1120,7 +1120,7 @@ sub_809FDD4: @ 809FDD4 thumb_func_start StartMenu_BattlePyramidBag StartMenu_BattlePyramidBag: @ 809FDF4 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1854,7 +1854,7 @@ _080A03D4: thumb_func_start sub_80A03D8 sub_80A03D8: @ 80A03D8 push {lr} - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_80A03D8 @@ -1940,7 +1940,7 @@ _080A045A: _080A0490: bl ResetAllObjectData bl ResetTasks - bl sub_80A1A74 + bl ResetPaletteFade bl dp12_8087EA4 b _080A04FC _080A04A2: @@ -1967,7 +1967,7 @@ _080A04D4: negs r0, r0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes ldr r0, =sub_80A03D8 bl SetVBlankCallback movs r0, 0x1 @@ -2014,7 +2014,7 @@ _080A052E: sub_80A0540: @ 80A0540 push {lr} bl RunTasks - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_80A0540 @@ -2030,7 +2030,7 @@ sub_80A0550: @ 80A0550 lsls r0, 3 ldr r1, =gTasks + 0x8 adds r5, r0, r1 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -2091,7 +2091,7 @@ _080A05AC: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_030030FC ldrb r0, [r0] cmp r0, 0 @@ -2140,7 +2140,7 @@ _080A065C: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x4 b _080A06A6 _080A0670: diff --git a/asm/starter_choose.s b/asm/starter_choose.s index abc4bca71..1c23ea3aa 100644 --- a/asm/starter_choose.s +++ b/asm/starter_choose.s @@ -28,7 +28,7 @@ sub_8133EF8: @ 8133EF8 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_8133EF8 @@ -148,17 +148,17 @@ set_256color_bg_bg0: @ 8133F0C bl remove_some_task bl ResetTasks bl ResetAllObjectData - bl sub_80A1A74 + bl ResetPaletteFade bl ResetObjectPaletteAllocator bl dp13_810BB8C bl sub_8098C64 movs r1, 0xE0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085B0A00 movs r1, 0 movs r2, 0x40 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085B1ED8 bl LoadCompressedObjectPic ldr r0, =gUnknown_085B1EE8 @@ -172,7 +172,7 @@ set_256color_bg_bg0: @ 8133F0C movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x1 bl EnableInterrupts ldr r0, =sub_8133EF8 @@ -304,7 +304,7 @@ sub_81341E0: @ 81341E0 bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_81341E0 diff --git a/asm/text_window.s b/asm/text_window.s index e9ce0b4a1..e2b729a51 100644 --- a/asm/text_window.s +++ b/asm/text_window.s @@ -49,7 +49,7 @@ copy_textbox_border_tile_patterns_to_vram: @ 809877C bl sub_8098C64 adds r1, r5, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r4,r5} pop {r0} bx r0 @@ -105,7 +105,7 @@ sub_80987D4: @ 80987D4 ldr r0, [r4] mov r1, r8 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r3} mov r8, r3 pop {r4-r6} @@ -676,7 +676,7 @@ sub_8098C6C: @ 8098C6C ldr r0, [r0, 0x4] adds r1, r4, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette pop {r4,r5} pop {r0} bx r0 diff --git a/asm/title_screen.s b/asm/title_screen.s index ef95185b6..27dd55e05 100644 --- a/asm/title_screen.s +++ b/asm/title_screen.s @@ -283,13 +283,13 @@ _080AA5F8: cmp r0, 0x90 bne _080AA62C _080AA61C: - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded ldr r0, =0x000033f8 strh r0, [r1] b _080AA630 .pool _080AA62C: - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded strh r2, [r0] _080AA630: adds r0, r4, 0x4 @@ -297,7 +297,7 @@ _080AA630: b _080AA648 .pool _080AA63C: - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded movs r0, 0 strh r0, [r1] adds r0, r3, 0 @@ -467,7 +467,7 @@ title_screen_vblank_callback: @ 80AA780 bl sub_80BA0A8 bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer ldr r0, =gUnknown_02022E1A ldrh r1, [r0] movs r0, 0x16 @@ -580,7 +580,7 @@ _080AA7E0: ldr r0, =0x810001ff str r0, [r1, 0x8] ldr r0, [r1, 0x8] - bl sub_80A1A74 + bl ResetPaletteFade ldr r0, =gUnknown_030022C0 movs r1, 0x87 lsls r1, 3 @@ -601,7 +601,7 @@ _080AA8C4: movs r2, 0xF0 lsls r2, 1 movs r1, 0 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gTitleScreenRayquazaTiles ldr r1, =0x06008000 bl LZ77UnCompVram @@ -631,7 +631,7 @@ _080AA8C4: movs r1, 0x80 lsls r1, 1 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_08540100 bl LoadTaggedObjectPalette ldr r0, =gUnknown_030022C0 @@ -678,7 +678,7 @@ _080AA9E0: movs r1, 0x1 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =title_screen_vblank_callback bl SetVBlankCallback ldr r0, =gUnknown_030022C0 @@ -763,7 +763,7 @@ _080AAA14: b _080AAB1E .pool _080AAAF0: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 @@ -797,7 +797,7 @@ c2_title_screen_2: @ 80AAB2C bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end c2_title_screen_2 @@ -1078,7 +1078,7 @@ _080AAD84: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =Cb2_GoToMainMenu bl SetMainCallback2 b _080AAE98 @@ -1109,7 +1109,7 @@ _080AADC8: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =c2_reset_rtc_screen_1 bl SetMainCallback2 b _080AAE98 @@ -1129,7 +1129,7 @@ _080AADFC: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =c2_berry_program_update_screen_1 bl SetMainCallback2 b _080AAE98 @@ -1180,7 +1180,7 @@ _080AAE72: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =c2_show_copyright_and_intro_again_1 bl SetMainCallback2 _080AAE98: @@ -1194,7 +1194,7 @@ _080AAE98: thumb_func_start Cb2_GoToMainMenu Cb2_GoToMainMenu: @ 80AAEB8 push {lr} - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _080AAECA @@ -1209,7 +1209,7 @@ _080AAECA: thumb_func_start c2_show_copyright_and_intro_again_1 c2_show_copyright_and_intro_again_1: @ 80AAED4 push {lr} - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _080AAEE6 @@ -1224,7 +1224,7 @@ _080AAEE6: thumb_func_start c2_clear_save_data_screen_1 c2_clear_save_data_screen_1: @ 80AAEF0 push {lr} - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _080AAF02 @@ -1239,7 +1239,7 @@ _080AAF02: thumb_func_start c2_reset_rtc_screen_1 c2_reset_rtc_screen_1: @ 80AAF0C push {lr} - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _080AAF1E @@ -1254,7 +1254,7 @@ _080AAF1E: thumb_func_start c2_berry_program_update_screen_1 c2_berry_program_update_screen_1: @ 80AAF28 push {lr} - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _080AAF3E @@ -1311,7 +1311,7 @@ _080AAF82: strh r1, [r0] movs r1, 0xEF movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette _080AAF9C: add sp, 0x4 pop {r0} diff --git a/asm/trade.s b/asm/trade.s index db4f075c0..46d5398ed 100644 --- a/asm/trade.s +++ b/asm/trade.s @@ -178,8 +178,8 @@ sub_80772A4: @ 80772A4 bl ResetAllObjectData bl ResetObjectPaletteAllocator bl ResetTasks - bl sub_80A1A74 - ldr r2, =gUnknown_02037FD4 + bl ResetPaletteFade + ldr r2, =gPaletteFade ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 @@ -190,11 +190,11 @@ sub_80772A4: @ 80772A4 adds r0, r4, 0 movs r1, 0xF0 movs r2, 0x14 - bl gpu_pal_apply + bl LoadPalette adds r0, r4, 0 movs r1, 0xD0 movs r2, 0x14 - bl gpu_pal_apply + bl LoadPalette movs r0, 0 bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_0832DEE4 @@ -370,7 +370,7 @@ _08077476: b _08077B22 .pool _080774A4: - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -1033,7 +1033,7 @@ _08077ABC: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gUnknown_030022C0 movs r5, 0x87 lsls r5, 3 @@ -1078,7 +1078,7 @@ _08077B22: b _08077B46 .pool _08077B30: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1093,7 +1093,7 @@ _08077B46: bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0x28 pop {r3} mov r8, r3 @@ -1639,7 +1639,7 @@ _08078040: b _080780D8 .pool _08078068: - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -1649,14 +1649,14 @@ _08078068: adds r0, r4, 0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gUnknown_030022C0 movs r3, 0x87 lsls r3, 3 @@ -1695,7 +1695,7 @@ _080780D8: b _080780F6 .pool _080780E4: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1707,7 +1707,7 @@ _080780F6: bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0x24 pop {r3} mov r8, r3 @@ -1722,7 +1722,7 @@ sub_807811C: @ 807811C push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_807811C @@ -1747,7 +1747,7 @@ sub_8078130: @ 8078130 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, [r4] adds r0, 0x6F movs r1, 0xA @@ -1763,7 +1763,7 @@ _08078160: thumb_func_start sub_807816C sub_807816C: @ 807816C push {r4,lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -1884,7 +1884,7 @@ sub_807825C: @ 807825C bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r4} pop {r0} bx r0 @@ -1912,7 +1912,7 @@ _080782D4: ldr r0, =gUnknown_08DDB3E4 movs r1, 0 movs r2, 0x60 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_08DDB464 movs r2, 0x94 lsls r2, 5 @@ -2628,7 +2628,7 @@ _08078950: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x4 bl sub_807A19C ldr r0, =gUnknown_0203229C @@ -2669,7 +2669,7 @@ _080789AC: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_0203229C ldr r0, [r0] adds r0, 0x6F @@ -2847,7 +2847,7 @@ _08078B00: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, [r6] adds r1, r0, 0 adds r1, 0x79 @@ -3270,7 +3270,7 @@ _08078E98: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, [r4] adds r0, 0x6F movs r1, 0x2 @@ -3373,7 +3373,7 @@ _08078F7E: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_0203229C ldr r0, [r0] adds r0, 0x6F @@ -3475,7 +3475,7 @@ _08079054: sub_807905C: @ 807905C push {lr} sub sp, 0x4 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -3998,7 +3998,7 @@ _0807947C: thumb_func_start sub_8079490 sub_8079490: @ 8079490 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -6769,7 +6769,7 @@ _0807AA98: lsls r1, 4 adds r1, 0x4 movs r2, 0x2 - bl gpu_pal_apply + bl LoadPalette _0807AAB2: pop {r0} bx r0 @@ -6962,7 +6962,7 @@ sub_807AC24: @ 807AC24 bl sub_807ABCC bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_807AC24 @@ -7477,7 +7477,7 @@ _0807B0B0: str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0 bl ShowBg ldr r1, =gUnknown_030022C0 @@ -7501,7 +7501,7 @@ _0807B0E4: b _0807B116 .pool _0807B0F0: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -7523,7 +7523,7 @@ _0807B116: bl RunTextPrinters bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0x4 pop {r4,r5} pop {r0} @@ -7623,7 +7623,7 @@ sub_807B170: @ 807B170 adds r0, r6, 0 movs r1, 0 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette ldr r0, =gUnknown_08338FFC bl InitWindows mov r0, r9 @@ -7644,7 +7644,7 @@ sub_807B170: @ 807B170 adds r0, r6, 0 movs r1, 0 movs r2, 0x20 - bl decompress_palette + bl LoadCompressedPalette add sp, 0x4 pop {r3-r5} mov r8, r3 @@ -7842,7 +7842,7 @@ _0807B43E: bl RunTextPrinters bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0xC pop {r3} mov r8, r3 @@ -8056,7 +8056,7 @@ sub_807B60C: @ 807B60C bl RunTextPrinters bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_807B60C @@ -8106,7 +8106,7 @@ _0807B668: ldr r0, =gUnknown_08DD7300 movs r1, 0x10 movs r2, 0x60 - bl gpu_pal_apply + bl LoadPalette ldr r3, =gUnknown_08DD7360 ldr r4, =0x06004000 movs r5, 0xA1 @@ -8235,14 +8235,14 @@ _0807B7C0: _0807B7DA: movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes b _0807BA68 .pool _0807B7F8: ldr r0, =gUnknown_08337EA0 movs r1, 0x30 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_08337EC0 ldr r1, =0x06004000 bl LZ77UnCompVram @@ -8447,7 +8447,7 @@ _0807B9FC: ldr r0, =gUnknown_08DD7300 movs r1, 0x10 movs r2, 0x60 - bl gpu_pal_apply + bl LoadPalette ldr r3, =gUnknown_08DD7360 ldr r4, =0x06004000 movs r5, 0xA1 @@ -9131,7 +9131,7 @@ _0807C248: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_020322A0 ldr r0, [r0] adds r0, 0x94 @@ -9140,7 +9140,7 @@ _0807C248: bl _0807CFB4 .pool _0807C26C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -9168,7 +9168,7 @@ _0807C29C: movs r3, 0 bl _0807CF44 _0807C2AE: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -9405,7 +9405,7 @@ _0807C4B8: adds r0, r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_020322A0 ldr r0, [r0] adds r0, 0x94 @@ -9414,7 +9414,7 @@ _0807C4B8: bl _0807CFB4 .pool _0807C4DC: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -9452,7 +9452,7 @@ _0807C528: adds r0, r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r5, =gUnknown_08338DC8 adds r0, r5, 0 movs r1, 0x6F @@ -9476,7 +9476,7 @@ _0807C528: bl _0807CF4C .pool _0807C574: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -9566,21 +9566,21 @@ _0807C630: ldr r2, =0x0000ffff movs r0, 0x1 movs r1, 0x10 - bl sub_80A2A20 + bl BlendPalettes bl _0807CF48 .pool _0807C644: ldr r2, =0x0000ffff movs r0, 0x1 movs r1, 0 - bl sub_80A2A20 + bl BlendPalettes bl _0807CF48 .pool _0807C658: ldr r2, =0x0000ffff movs r0, 0x1 movs r1, 0x10 - bl sub_80A2A20 + bl BlendPalettes bl _0807CF48 .pool _0807C66C: @@ -9814,7 +9814,7 @@ _0807C7FC: ldr r2, =0x0000ffff movs r0, 0x1 movs r1, 0 - bl sub_80A2A20 + bl BlendPalettes b _0807CFB4 .pool _0807C864: @@ -9859,7 +9859,7 @@ _0807C8A6: adds r0, r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r7] adds r2, r1, 0 adds r2, 0x94 @@ -9884,7 +9884,7 @@ _0807C8A6: b _0807CFB4 .pool _0807C8EC: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -9947,7 +9947,7 @@ _0807C974: lsls r1, 5 movs r0, 0 bl SetGpuReg - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -10196,7 +10196,7 @@ _0807CB70: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_020322A0 ldr r0, [r0] adds r0, 0x94 @@ -10205,7 +10205,7 @@ _0807CB70: b _0807CFB4 .pool _0807CB90: - ldr r4, =gUnknown_02037FD4 + ldr r4, =gPaletteFade ldrb r1, [r4, 0x7] movs r0, 0x80 ands r0, r1 @@ -10224,7 +10224,7 @@ _0807CB9E: b _0807CF48 .pool _0807CBB8: - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -10242,7 +10242,7 @@ _0807CBD4: lsls r1, 5 movs r0, 0 bl SetGpuReg - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -10313,7 +10313,7 @@ _0807CBF4: lsls r0, r1 ldr r2, =0x0000ffff movs r1, 0x10 - bl sub_80A2A20 + bl BlendPalettes ldr r2, [r5] adds r1, r2, 0 adds r1, 0x94 @@ -10342,7 +10342,7 @@ _0807CC9C: movs r1, 0x1 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r7] b _0807CF4C .pool @@ -10626,7 +10626,7 @@ _0807CF38: movs r2, 0 movs r3, 0x10 _0807CF44: - bl pal_fade_maybe + bl BeginNormalPaletteFade _0807CF48: ldr r0, =gUnknown_020322A0 ldr r1, [r0] @@ -10638,7 +10638,7 @@ _0807CF4C: b _0807CFB4 .pool _0807CF5C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -11193,7 +11193,7 @@ _0807D624: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_020322A0 ldr r0, [r0] adds r0, 0x94 @@ -11202,7 +11202,7 @@ _0807D624: bl _0807E400 .pool _0807D648: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -11230,7 +11230,7 @@ _0807D678: movs r3, 0 bl _0807E390 _0807D68A: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -11474,7 +11474,7 @@ _0807D8B4: adds r0, r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_020322A0 ldr r0, [r0] adds r0, 0x94 @@ -11483,7 +11483,7 @@ _0807D8B4: bl _0807E400 .pool _0807D8D8: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -11521,7 +11521,7 @@ _0807D924: adds r0, r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r5, =gUnknown_08338DC8 adds r0, r5, 0 movs r1, 0x6F @@ -11545,7 +11545,7 @@ _0807D924: bl _0807E398 .pool _0807D970: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -11640,21 +11640,21 @@ _0807DA38: ldr r2, =0x0000ffff movs r0, 0x8 movs r1, 0x10 - bl sub_80A2A20 + bl BlendPalettes bl _0807E394 .pool _0807DA4C: ldr r2, =0x0000ffff movs r0, 0x8 movs r1, 0x10 - bl sub_80A2A20 + bl BlendPalettes bl _0807E394 .pool _0807DA60: ldr r2, =0x0000ffff movs r0, 0x8 movs r1, 0x10 - bl sub_80A2A20 + bl BlendPalettes bl _0807E394 .pool _0807DA74: @@ -11933,7 +11933,7 @@ _0807DCAE: adds r0, r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r7] adds r2, r1, 0 adds r2, 0x94 @@ -11958,7 +11958,7 @@ _0807DCAE: b _0807E400 .pool _0807DCF4: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -12039,7 +12039,7 @@ _0807DDA4: lsls r1, 5 movs r0, 0 bl SetGpuReg - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -12301,7 +12301,7 @@ _0807DFBC: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_020322A0 ldr r0, [r0] adds r0, 0x94 @@ -12310,7 +12310,7 @@ _0807DFBC: b _0807E400 .pool _0807DFDC: - ldr r4, =gUnknown_02037FD4 + ldr r4, =gPaletteFade ldrb r1, [r4, 0x7] movs r0, 0x80 ands r0, r1 @@ -12329,7 +12329,7 @@ _0807DFEA: b _0807E394 .pool _0807E004: - ldr r2, =gUnknown_02037FD4 + ldr r2, =gPaletteFade ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @@ -12347,7 +12347,7 @@ _0807E020: lsls r1, 5 movs r0, 0 bl SetGpuReg - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -12418,7 +12418,7 @@ _0807E040: lsls r0, r1 ldr r2, =0x0000ffff movs r1, 0x10 - bl sub_80A2A20 + bl BlendPalettes ldr r2, [r5] adds r1, r2, 0 adds r1, 0x94 @@ -12447,7 +12447,7 @@ _0807E0E8: movs r1, 0x1 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r7] b _0807E398 .pool @@ -12731,7 +12731,7 @@ _0807E384: movs r2, 0 movs r3, 0x10 _0807E390: - bl pal_fade_maybe + bl BeginNormalPaletteFade _0807E394: ldr r0, =gUnknown_020322A0 ldr r1, [r0] @@ -12743,7 +12743,7 @@ _0807E398: b _0807E400 .pool _0807E3A8: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -12864,7 +12864,7 @@ _0807E4B4: _0807E4C2: bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r3} mov r8, r3 pop {r4-r7} @@ -13043,7 +13043,7 @@ _0807E600: str r2, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade _0807E636: add sp, 0x4 pop {r4} @@ -13558,7 +13558,7 @@ _0807EA96: bl RunTextPrinters bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r4-r6} pop {r0} bx r0 @@ -13612,7 +13612,7 @@ _0807EB2C: bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r4} pop {r0} bx r0 @@ -14021,10 +14021,10 @@ _0807EF64: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _0807EFDC _0807EF7E: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -14107,7 +14107,7 @@ _0807F03A: _0807F048: bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0x4 pop {r4} pop {r0} @@ -14118,7 +14118,7 @@ _0807F048: thumb_func_start c2_080543C4 c2_080543C4: @ 807F068 push {r4,r5,lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -14154,7 +14154,7 @@ _0807F0BE: bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r4,r5} pop {r0} bx r0 @@ -14175,7 +14175,7 @@ sub_807F0E4: @ 807F0E4 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade add sp, 0x4 pop {r0} bx r0 @@ -14187,7 +14187,7 @@ sub_807F110: @ 807F110 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -14346,7 +14346,7 @@ _0807F25C: _0807F25E: movs r1, 0x30 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _0807F27A .pool _0807F26C: @@ -14355,7 +14355,7 @@ _0807F26C: adds r0, r1 movs r1, 0x30 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _0807F27A: ldr r0, =gUnknown_08339090 movs r2, 0 @@ -14576,7 +14576,7 @@ _0807F3D8: ldr r2, =0x0000ffff movs r0, 0x8 movs r1, 0 - bl sub_80A2A20 + bl BlendPalettes b _0807F45C .pool _0807F44C: @@ -14842,7 +14842,7 @@ _0807F694: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_030022C0 movs r1, 0x87 lsls r1, 3 @@ -14852,7 +14852,7 @@ _0807F694: b _0807F70C .pool _0807F6C4: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -14891,7 +14891,7 @@ _0807F70C: _0807F71A: bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade add sp, 0x4 pop {r4,r5} pop {r0} diff --git a/asm/trainer_card.s b/asm/trainer_card.s index 24675c1ed..7a34f9136 100644 --- a/asm/trainer_card.s +++ b/asm/trainer_card.s @@ -10,7 +10,7 @@ sub_80C2690: @ 80C2690 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer bl sub_80C48C8 ldr r0, =gUnknown_02039CE8 ldr r0, [r0] @@ -66,7 +66,7 @@ sub_80C2710: @ 80C2710 bl RunTasks bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_80C2710 @@ -209,7 +209,7 @@ _080C2852: ldrh r2, [r0] adds r0, r6, 0 movs r1, 0x10 - bl sub_80A2A20 + bl BlendPalettes ldr r0, [r4] adds r0, r5 ldrh r0, [r0] @@ -218,14 +218,14 @@ _080C2852: movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =sub_80C2690 bl SetVBlankCallback ldr r1, [r4] b _080C28D8 .pool _080C289C: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 beq _080C28A8 @@ -445,14 +445,14 @@ _080C2A74: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, [r4] movs r0, 0xE strb r0, [r1] b _080C2ACA .pool _080C2A98: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _080C2ACA @@ -729,7 +729,7 @@ _080C2D36: _080C2D50: bl ResetAllObjectData bl ResetObjectPaletteAllocator - bl sub_80A1A74 + bl ResetPaletteFade ldr r1, =gUnknown_030022C0 movs r0, 0x87 lsls r0, 3 @@ -3108,7 +3108,7 @@ _080C424A: adds r0, r1 movs r1, 0x50 movs r2, 0xC0 - bl gpu_pal_apply + bl LoadPalette movs r4, 0 _080C425E: ldr r0, =gUnknown_02039CE8 @@ -3219,19 +3219,19 @@ sub_80C4330: @ 80C4330 ldr r0, =gUnknown_0856F54C movs r1, 0xB0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0856F56C movs r1, 0xC0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0856F58C movs r1, 0xD0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0856F5AC movs r1, 0xE0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_02039CE8 ldr r1, [r0] ldr r0, =0x000017a8 @@ -3326,11 +3326,11 @@ _080C4418: ldr r0, [r0] movs r1, 0 movs r2, 0x60 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0856F4EC movs r1, 0x30 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, [r4] ldr r1, =0x00000534 adds r0, r1 @@ -3340,7 +3340,7 @@ _080C4418: ldr r0, =gUnknown_0856F4AC movs r1, 0x10 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _080C44B2 .pool _080C447C: @@ -3353,11 +3353,11 @@ _080C447C: ldr r0, [r0] movs r1, 0 movs r2, 0x60 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_0856F50C movs r1, 0x30 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, [r4] ldr r1, =0x00000534 adds r0, r1 @@ -3367,12 +3367,12 @@ _080C447C: ldr r0, =gUnknown_0856F4CC movs r1, 0x10 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _080C44B2: ldr r0, =gUnknown_0856F52C movs r1, 0x40 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _080C4536 .pool _080C44D8: @@ -5228,7 +5228,7 @@ pokemon_details: @ 80C53AC _080C5416: bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer add sp, 0x10 pop {r4-r7} pop {r0} @@ -5322,7 +5322,7 @@ _080C54F4: bl ResetTasks bl ResetAllObjectData bl ResetObjectPaletteAllocator - bl sub_80A1A74 + bl ResetPaletteFade bl reset_temp_tile_data_buffers b _080C56F4 _080C550A: @@ -5437,7 +5437,7 @@ _080C5624: lsls r2, 1 adds r0, r4, 0 movs r1, 0 - bl gpu_pal_apply + bl LoadPalette ldr r5, =gUnknown_02039CEC ldr r0, [r5] ldrb r0, [r0, 0xE] @@ -5447,12 +5447,12 @@ _080C5624: adds r0, r4 movs r1, 0x10 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette movs r0, 0 bl stdpal_get movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette bl sub_80C629C ldr r1, [r5] ldrb r0, [r1, 0xC] @@ -5491,20 +5491,20 @@ _080C5684: adds r0, r4, 0 movs r1, 0x10 movs r2, 0 - bl sub_80A2A20 + bl BlendPalettes movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _080C56F4 .pool _080C56D0: bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -5570,14 +5570,14 @@ _080C5748: str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _080C57E4 _080C576A: ldr r1, [r2] movs r0, 0x2 b _080C57EC _080C5770: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 beq _080C57E4 @@ -6162,7 +6162,7 @@ _080C5C14: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _080C5CA4 .pool _080C5C4C: @@ -6195,13 +6195,13 @@ _080C5C4C: adds r0, r5, 0 movs r1, 0x10 adds r2, r4, 0 - bl sub_80A2A20 + bl BlendPalettes str r4, [sp] adds r0, r5, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _080C5CA4: ldr r4, =gUnknown_02039CF0 ldr r0, [r4] @@ -6221,7 +6221,7 @@ _080C5CA4: b _080C5D9C .pool _080C5CD4: - bl fade_and_return_progress_probably + bl UpdatePaletteFade ldrh r0, [r6, 0x6] ldrh r1, [r6, 0x2] adds r0, r1 @@ -6272,7 +6272,7 @@ _080C5D2A: movs r0, 0 strb r0, [r1] _080C5D3C: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _080C5DA6 @@ -7198,7 +7198,7 @@ _080C6520: _080C6526: bl ResetAllObjectData bl ResetObjectPaletteAllocator - bl sub_80A1A74 + bl ResetPaletteFade bl reset_temp_tile_data_buffers b _080C6694 _080C6538: @@ -7275,12 +7275,12 @@ _080C65E8: movs r2, 0xD0 lsls r2, 1 movs r1, 0 - bl gpu_pal_apply + bl LoadPalette movs r0, 0 bl stdpal_get movs r1, 0xF0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r1, =gUnknown_08570E00 movs r0, 0x2 movs r2, 0 @@ -7311,17 +7311,17 @@ _080C6628: adds r0, r5, 0 movs r1, 0x10 adds r2, r4, 0 - bl sub_80A2A20 + bl BlendPalettes str r4, [sp] adds r0, r5, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _080C6694 .pool _080C6678: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -7379,11 +7379,11 @@ _080C66E4: movs r1, 0 movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade b _080C67A4 .pool _080C66FC: - bl fade_and_return_progress_probably + bl UpdatePaletteFade lsls r0, 24 cmp r0, 0 bne _080C67AE diff --git a/asm/truck_scene.s b/asm/truck_scene.s index 4c5a4784c..db8458d09 100644 --- a/asm/truck_scene.s +++ b/asm/truck_scene.s @@ -415,7 +415,7 @@ _080FB404: ldrh r0, [r4, 0x2] adds r3, r0, 0x1 strh r3, [r4, 0x2] - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -530,7 +530,7 @@ sub_80FB4E0: @ 80FB4E0 bl script_env_2_enable movs r0, 0 str r0, [sp] - ldr r1, =gUnknown_02037B14 + ldr r1, =gPlttBufferFaded ldr r2, =0x01000100 mov r0, sp bl CpuFastSet diff --git a/asm/wallclock.s b/asm/wallclock.s index 7065194ed..77f5013e8 100644 --- a/asm/wallclock.s +++ b/asm/wallclock.s @@ -10,7 +10,7 @@ sub_81347B4: @ 81347B4 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram + bl TransferPlttBuffer pop {r0} bx r0 thumb_func_end sub_81347B4 @@ -144,23 +144,23 @@ _0813486C: ldr r0, =gUnknown_08DCC01C movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette b _08134906 .pool _081348FC: ldr r0, =gUnknown_08DCC03C movs r1, 0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette _08134906: bl sub_8098C64 movs r1, 0xE0 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldr r0, =gUnknown_085B21D4 movs r1, 0xC0 movs r2, 0x8 - bl gpu_pal_apply + bl LoadPalette movs r0, 0 bl ResetBgsAndClearDma3BusyFlags ldr r1, =gUnknown_085B21FC @@ -179,7 +179,7 @@ _08134906: bl remove_some_task bl ResetTasks bl ResetAllObjectData - bl sub_80A1A74 + bl ResetPaletteFade bl ResetObjectPaletteAllocator ldr r0, =gUnknown_085B2208 bl LoadCompressedObjectPic @@ -204,7 +204,7 @@ sub_813498C: @ 813498C str r1, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade movs r0, 0x1 bl EnableInterrupts ldr r0, =sub_81347B4 @@ -531,7 +531,7 @@ sub_8134C9C: @ 8134C9C bl CallObjectCallbacks bl PrepareSpritesForOamLoad bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably + bl UpdatePaletteFade pop {r0} bx r0 thumb_func_end sub_8134C9C @@ -541,7 +541,7 @@ sub_8134CB8: @ 8134CB8 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -792,7 +792,7 @@ sub_8134EA4: @ 8134EA4 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =c2_080111BC str r0, [r4] add sp, 0x4 @@ -805,7 +805,7 @@ sub_8134EA4: @ 8134EA4 thumb_func_start c2_080111BC c2_080111BC: @ 8134EE8 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -826,7 +826,7 @@ sub_8134F10: @ 8134F10 push {lr} lsls r0, 24 lsrs r2, r0, 24 - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -885,7 +885,7 @@ sub_8134F78: @ 8134F78 str r1, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r1, =gTasks lsls r0, r4, 2 adds r0, r4 @@ -903,7 +903,7 @@ sub_8134F78: @ 8134F78 thumb_func_start sub_8134FB0 sub_8134FB0: @ 8134FB0 push {lr} - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 diff --git a/asm/weather.s b/asm/weather.s index 955aa5047..53e2d8398 100644 --- a/asm/weather.s +++ b/asm/weather.s @@ -23,7 +23,7 @@ sub_80AAFA4: @ 80AAFA4 lsrs r5, 24 ldr r0, =gUnknown_0854C270 lsls r1, r5, 5 - ldr r2, =gUnknown_02037914 + ldr r2, =gPlttBufferUnfaded + 0x200 adds r1, r2 ldr r2, =0x04000008 bl CpuSet @@ -647,7 +647,7 @@ _080AB4F4: b _080AB53C .pool _080AB51C: - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 @@ -838,9 +838,9 @@ _080AB684: cmp r0, 0 bne _080AB6C0 lsls r1, r6, 1 - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded adds r0, r1, r0 - ldr r2, =gUnknown_02037B14 + ldr r2, =gPlttBufferFaded adds r1, r2 movs r2, 0x8 bl CpuFastSet @@ -883,12 +883,12 @@ _080AB6EA: mov r8, r2 adds r4, 0x1 mov r12, r4 - ldr r3, =gUnknown_02037B14 + ldr r3, =gPlttBufferFaded mov r10, r3 _080AB6FE: adds r2, r6, 0 lsls r0, r2, 1 - ldr r1, =gUnknown_02037714 + ldr r1, =gPlttBufferUnfaded adds r0, r1 ldr r1, [r0] lsls r0, r1, 27 @@ -949,9 +949,9 @@ _080AB770: cmp r0, 0 bne _080AB7AC lsls r1, r6, 1 - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded adds r0, r1, r0 - ldr r2, =gUnknown_02037B14 + ldr r2, =gPlttBufferFaded adds r1, r2 movs r2, 0x8 bl CpuFastSet @@ -980,9 +980,9 @@ _080AB7AC: asrs r5, r0, 11 _080AB7C2: lsls r0, r6, 1 - ldr r3, =gUnknown_02037B14 + ldr r3, =gPlttBufferFaded adds r4, r0, r3 - ldr r1, =gUnknown_02037714 + ldr r1, =gPlttBufferUnfaded adds r0, r1 ldrh r3, [r0] lsls r3, 16 @@ -1022,9 +1022,9 @@ _080AB804: .pool _080AB81C: lsls r1, r4, 5 - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded adds r0, r1, r0 - ldr r2, =gUnknown_02037B14 + ldr r2, =gPlttBufferFaded adds r1, r2 mov r3, r9 lsls r2, r3, 3 @@ -1099,7 +1099,7 @@ _080AB8A0: adds r0, r6, 0 movs r1, 0x10 mov r2, r8 - bl pal_fade_1 + bl BlendPalette adds r0, r6, 0 adds r0, 0x10 lsls r0, 16 @@ -1133,7 +1133,7 @@ _080AB8EA: _080AB8F6: adds r4, r6, 0 lsls r0, r4, 1 - ldr r1, =gUnknown_02037714 + ldr r1, =gPlttBufferUnfaded adds r0, r1 ldr r1, [r0] lsls r0, r1, 27 @@ -1177,7 +1177,7 @@ _080AB8F6: lsls r0, 16 lsrs r6, r0, 16 lsls r4, 1 - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded adds r4, r0 lsrs r1, 14 lsrs r2, 19 @@ -1249,7 +1249,7 @@ _080AB9C8: adds r0, r5, 0 movs r1, 0x10 adds r2, r6, 0 - bl pal_fade_1 + bl BlendPalette adds r0, r5, 0 adds r0, 0x10 lsls r0, 16 @@ -1271,7 +1271,7 @@ _080AB9F4: _080ABA06: adds r4, r5, 0 lsls r0, r4, 1 - ldr r5, =gUnknown_02037714 + ldr r5, =gPlttBufferUnfaded adds r0, r5 ldr r0, [r0] lsls r2, r0, 27 @@ -1321,7 +1321,7 @@ _080ABA06: lsls r0, 16 lsrs r5, r0, 16 lsls r4, 1 - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded adds r4, r0 lsrs r1, 14 lsrs r2, 19 @@ -1371,7 +1371,7 @@ sub_80ABAB0: @ 80ABAB0 lsls r1, 1 movs r0, 0 adds r2, r7, 0 - bl pal_fade_1 + bl BlendPalette ldr r0, [sp] lsls r1, r0, 27 lsrs r1, 27 @@ -1403,7 +1403,7 @@ _080ABAEC: mov r8, r0 _080ABB10: lsls r5, r6, 1 - ldr r0, =gUnknown_02037714 + ldr r0, =gPlttBufferUnfaded adds r0, r5, r0 ldr r2, [r0] lsls r4, r2, 27 @@ -1455,7 +1455,7 @@ _080ABB10: asrs r0, 4 adds r2, r0 lsls r2, 24 - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded adds r5, r0 lsrs r2, 14 lsrs r3, 19 @@ -1476,7 +1476,7 @@ _080ABB9C: ldrh r3, [r1] movs r1, 0x10 adds r2, r7, 0 - bl pal_fade_1 + bl BlendPalette adds r4, 0x1 mov r9, r4 _080ABBB0: @@ -1688,8 +1688,8 @@ _080ABD3A: beq _080ABD7C cmp r2, 0 beq _080ABD4E - ldr r0, =gUnknown_02037B14 - ldr r1, =gUnknown_02037714 + ldr r0, =gPlttBufferFaded + ldr r1, =gPlttBufferUnfaded movs r2, 0x80 lsls r2, 1 bl CpuFastSet @@ -1701,7 +1701,7 @@ _080ABD4E: str r4, [sp] movs r2, 0 movs r3, 0x10 - bl pal_fade_maybe + bl BeginNormalPaletteFade ldr r0, =gUnknown_02038454 ldr r3, =0x000006c6 adds r0, r3 @@ -1730,7 +1730,7 @@ _080ABDA0: str r4, [sp] movs r2, 0x10 movs r3, 0 - bl pal_fade_maybe + bl BeginNormalPaletteFade _080ABDB2: ldr r4, =gUnknown_02038454 ldr r1, =0x000006c6 @@ -1831,7 +1831,7 @@ _080ABE7C: lsls r0, r4, 20 lsrs r4, r0, 16 movs r2, 0 - ldr r6, =gUnknown_02037B14 + ldr r6, =gPlttBufferFaded ldr r0, =0x000006c4 adds r3, r5, r0 _080ABE88: @@ -1851,13 +1851,13 @@ _080ABEAC: lsls r0, r4, 20 lsrs r4, r0, 16 lsls r1, r4, 1 - ldr r0, =gUnknown_02037B14 + ldr r0, =gPlttBufferFaded adds r0, r1, r0 - ldr r2, =gUnknown_02037714 + ldr r2, =gPlttBufferUnfaded adds r1, r2 movs r2, 0x8 bl CpuFastSet - ldr r0, =gUnknown_02037FD4 + ldr r0, =gPaletteFade ldrh r2, [r0, 0x4] lsls r2, 21 lsrs r2, 27 @@ -1866,7 +1866,7 @@ _080ABEAC: lsrs r3, 17 adds r0, r4, 0 movs r1, 0x10 - bl pal_fade_1 + bl BlendPalette b _080ABEF4 .pool _080ABEE4: @@ -1876,7 +1876,7 @@ _080ABEE4: adds r0, r4, 0 movs r1, 0x10 movs r2, 0xC - bl pal_fade_1 + bl BlendPalette _080ABEF4: pop {r4-r6} pop {r0} @@ -1937,7 +1937,7 @@ sub_80ABF4C: @ 80ABF4C adds r1, r2 lsrs r1, 16 movs r2, 0x20 - bl gpu_pal_apply + bl LoadPalette ldrb r0, [r4] bl sub_80ABE18 pop {r4} diff --git a/data/data2.s b/data/data2.s index 35076df11..fc4f1c009 100644 --- a/data/data2.s +++ b/data/data2.s @@ -3115,9 +3115,13 @@ gUnknown_08524870:: @ 8524870 gUnknown_0852487C:: @ 852487C .incbin "baserom.gba", 0x52487c, 0x10 -gUnknown_0852488C:: @ 852488C - .incbin "baserom.gba", 0x52488c, 0x10 +gDummyPaletteStructTemplate:: @ 852488C + .2byte 0xFFFF + .space 9 + .byte 0x20 + .space 4 + .align 2 gUnknown_0852489C:: @ 852489C .incbin "baserom.gba", 0x52489c, 0x20 diff --git a/include/palette.h b/include/palette.h new file mode 100644 index 000000000..de2cf0083 --- /dev/null +++ b/include/palette.h @@ -0,0 +1,68 @@ +#ifndef GUARD_PALETTE_H +#define GUARD_PALETTE_H + +#include "global.h" + +#define gPaletteFade_selectedPalettes (gPaletteFade.multipurpose1) // normal and fast fade +#define gPaletteFade_blendCnt (gPaletteFade.multipurpose1) // hardware fade +#define gPaletteFade_delay (gPaletteFade.multipurpose2) // normal and hardware fade +#define gPaletteFade_submode (gPaletteFade.multipurpose2) // fast fade + +enum +{ + FAST_FADE_IN_FROM_WHITE, + FAST_FADE_OUT_TO_WHTIE, + FAST_FADE_IN_FROM_BLACK, + FAST_FADE_OUT_TO_BLACK, +}; + +struct PaletteFadeControl +{ + u32 multipurpose1; + u8 delayCounter:6; + u16 y:5; // blend coefficient + u16 targetY:5; // target blend coefficient + u16 blendColor:15; + u16 active:1; + u16 multipurpose2:6; + u16 yDec:1; // whether blend coefficient is decreasing + u16 bufferTransferDisabled:1; + u16 mode:2; + u16 shouldResetBlendRegisters:1; + u16 hardwareFadeFinishing:1; + u16 softwareFadeFinishingCounter:5; + u16 softwareFadeFinishing:1; + u16 objPaletteToggle:1; + u8 deltaY:4; // rate of change of blend coefficient +}; + +extern struct PaletteFadeControl gPaletteFade; +extern u32 gPlttBufferTransferPending; +extern u8 gPaletteDecompressionBuffer[]; +extern u16 gPlttBufferUnfaded[]; +extern u16 gPlttBufferFaded[]; + +void LoadCompressedPalette(const void *, u16, u16); +void LoadPalette(const void *, u16, u16); +void FillPalette(u16, u16, u16); +void TransferPlttBuffer(void); +u8 UpdatePaletteFade(void); +void ResetPaletteFade(void); +void ReadPlttIntoBuffers(void); +bool8 BeginNormalPaletteFade(u32, s8, u8, u8, u16); +bool8 unref_sub_8073D3C(u32, u8, u8, u8, u16); +void unref_sub_8073D84(u8, u32 *); +void ResetPaletteStructByUid(u16); +void ResetPaletteStruct(u8); +void ResetPaletteFadeControl(); +void unref_sub_8074168(u16); +void unref_sub_8074194(u16); +void InvertPlttBuffer(u32); +void TintPlttBuffer(u32, s8, s8, s8); +void UnfadePlttBuffer(u32); +void BeginFastPaletteFade(u8); +void BeginHardwarePaletteFade(u8, u8, u8, u8, u8); +void BlendPalettes(u32, u8, u16); +void BlendPalettesUnfaded(u32, u8, u16); + +#endif // GUARD_PALETTE_H diff --git a/include/task.h b/include/task.h index a536bcab5..d06de8525 100644 --- a/include/task.h +++ b/include/task.h @@ -15,15 +15,17 @@ struct Task extern struct Task gTasks[]; -void ResetTasks(); +void ResetTasks(void); u8 CreateTask(TaskFunc func, u8 priority); void DestroyTask(u8 taskId); -void RunTasks(); +void RunTasks(void); void TaskDummy(u8 taskId); void SetTaskFuncWithFollowupFunc(u8 taskId, TaskFunc func, TaskFunc followupFunc); void SwitchTaskToFollowupFunc(u8 taskId); bool8 FuncIsActiveTask(TaskFunc func); u8 FindTaskIdByFunc(TaskFunc func); -u8 GetTaskCount(); +u8 GetTaskCount(void); +void SetWordTaskArg(u8 taskId, u8 dataElem, u32 value); +u32 GetWordTaskArg(u8 taskId, u8 dataElem); #endif // GUARD_TASK_H diff --git a/ld_script.txt b/ld_script.txt index d22d0ddc9..1fdc52525 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -62,7 +62,7 @@ SECTIONS { asm/trig.o(.text); asm/rng.o(.text); asm/rom_806F640.o(.text); - asm/blend_palette.o(.text); + src/blend_palette.o(.text); asm/daycare.o(.text); asm/egg_hatch.o(.text); asm/rom_8072304.o(.text); @@ -92,7 +92,7 @@ SECTIONS { asm/reset_rtc_screen.o(.text); asm/start_menu.o(.text); asm/tileset.o(.text); - asm/palette.o(.text); + src/palette.o(.text); asm/sound.o(.text); asm/rom_80A3934.o(.text); src/task.o(.text); diff --git a/src/blend_palette.c b/src/blend_palette.c new file mode 100644 index 000000000..c9503388f --- /dev/null +++ b/src/blend_palette.c @@ -0,0 +1,19 @@ +#include "global.h" +#include "palette.h" + +void BlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) +{ + u16 i; + for (i = 0; i < numEntries; i++) + { + u16 index = i + palOffset; + struct PlttData *data1 = (struct PlttData *)&gPlttBufferUnfaded[index]; + s8 r = data1->r; + s8 g = data1->g; + s8 b = data1->b; + struct PlttData *data2 = (struct PlttData *)&blendColor; + gPlttBufferFaded[index] = ((r + (((data2->r - r) * coeff) >> 4)) << 0) + | ((g + (((data2->g - g) * coeff) >> 4)) << 5) + | ((b + (((data2->b - b) * coeff) >> 4)) << 10); + } +} diff --git a/src/palette.c b/src/palette.c new file mode 100644 index 000000000..6f5dfff24 --- /dev/null +++ b/src/palette.c @@ -0,0 +1,1270 @@ +#include "global.h" +#include "palette.h" +#include "task.h" + +enum +{ + NORMAL_FADE, + FAST_FADE, + HARDWARE_FADE, +}; + +// These are structs for some unused palette system. +// The full functionality of this system is unknown. + +struct PaletteStructTemplate +{ + u16 uid; + u16 *src; + u16 pst_field_8_0:1; + u16 pst_field_8_1:9; + u16 size:5; + u16 pst_field_9_7:1; + u8 pst_field_A; + u8 srcCount:5; + u8 pst_field_B_5:3; + u8 pst_field_C; +}; + +struct PaletteStruct +{ + struct PaletteStructTemplate *base; + u32 ps_field_4_0:1; + u16 ps_field_4_1:1; + u32 baseDestOffset:9; + u16 destOffset:10; + u16 srcIndex:7; + u8 ps_field_8; + u8 ps_field_9; +}; + +extern void LZDecompressWram(const void *src, void *dest); +extern void SetGpuReg(u8 regOffset, u16 value); +extern void sub_8149DFC(u8 a1); +extern void sub_80A1670(u16 a1); +extern void sub_80A2D54(u8 a1); +extern void SetWordTaskArg(u8 taskId, u8 dataElem, u32 value); +extern void _call_via_r1(u32 a1, void *a2); + +extern void BlendPalette(u16, u16, u8, u16); + +EWRAM_DATA u16 gPlttBufferUnfaded[0x200] = {0}; +EWRAM_DATA u16 gPlttBufferFaded[0x200] = {0}; +EWRAM_DATA struct PaletteStruct sPaletteStructs[0x10] = {0}; +EWRAM_DATA struct PaletteFadeControl gPaletteFade = {0}; +EWRAM_DATA u32 gFiller_2037FE0 = 0; +EWRAM_DATA u32 sPlttBufferTransferPending = 0; +EWRAM_DATA u8 sPaletteDecompressionBuffer[0x400] = {0}; + +extern struct PaletteStructTemplate gDummyPaletteStructTemplate; +extern void *gUnknown_0852487C; +extern u8 gUnknown_0852489C[]; + +extern u16 gUnknown_03000F3C; +extern void *gUnknown_03000F44; + +static void unused_sub_80A1CDC(struct PaletteStruct *, u32 *); +static void unused_sub_80A1E40(struct PaletteStruct *, u32 *); +static void unused_sub_80A1F00(struct PaletteStruct *); +static u8 GetPaletteNumByUid(u16); +static u8 UpdateNormalPaletteFade(void); +static void BeginFastPaletteFadeInternal(u8); +static u8 UpdateFastPaletteFade(void); +static u8 UpdateHardwarePaletteFade(void); +static void UpdateBlendRegisters(void); +static bool8 IsSoftwarePaletteFadeFinishing(void); + +void sub_80A1818(u16 a1) +{ + void **v1 = &gUnknown_0852487C; + CpuSet(v1[a1 & 0x3], gPlttBufferUnfaded + 0x80, 0x10); + BlendPalette(0x80, 0x10, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF); + if ((u8)FindTaskIdByFunc(sub_8149DFC) != 0xFF ) + { + gUnknown_03000F44 = sub_80A1670; + gUnknown_03000F3C = 0x20; + } + return; +} + +void sub_80A1884(u16 a1) +{ + void **v1 = &gUnknown_0852487C; + CpuSet(v1[a1 & 0x3], gPlttBufferUnfaded + 0x80, 0x10); + if ((u8)FindTaskIdByFunc(sub_8149DFC) == 0xFF ) + { + BlendPalette(0x80, 0x10, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF); + if (!--gUnknown_03000F3C) + gUnknown_03000F44 = 0; + } + return; +} + +void LoadCompressedPalette(const void *src, u16 offset, u16 size) +{ + LZDecompressWram(src, sPaletteDecompressionBuffer); + CpuCopy16(sPaletteDecompressionBuffer, gPlttBufferUnfaded + offset, size); + CpuCopy16(sPaletteDecompressionBuffer, gPlttBufferFaded + offset, size); +} + +void LoadPalette(const void *src, u16 offset, u16 size) +{ + CpuCopy16(src, gPlttBufferUnfaded + offset, size); + CpuCopy16(src, gPlttBufferFaded + offset, size); +} + +void FillPalette(u16 value, u16 offset, u16 size) +{ + CpuFill16(value, gPlttBufferUnfaded + offset, size); + CpuFill16(value, gPlttBufferFaded + offset, size); +} + +void TransferPlttBuffer(void) +{ + if (!gPaletteFade.bufferTransferDisabled) + { + void *src = gPlttBufferFaded; + void *dest = (void *)PLTT; + DmaCopy16(3, src, dest, PLTT_SIZE); + sPlttBufferTransferPending = 0; + if (gPaletteFade.mode == HARDWARE_FADE && gPaletteFade.active) + UpdateBlendRegisters(); + } +} + +u8 UpdatePaletteFade(void) +{ + u8 result; + u8 dummy = 0; + + if (sPlttBufferTransferPending) + return -1; + + if (gPaletteFade.mode == NORMAL_FADE) + result = UpdateNormalPaletteFade(); + else if (gPaletteFade.mode == FAST_FADE) + result = UpdateFastPaletteFade(); + else + result = UpdateHardwarePaletteFade(); + + sPlttBufferTransferPending = gPaletteFade.multipurpose1 | dummy; + + return result; +} + +void ResetPaletteFade(void) +{ + u8 i; + + for (i = 0; i < 16; i++) + ResetPaletteStruct(i); + + ResetPaletteFadeControl(); +} + +void ReadPlttIntoBuffers(void) +{ + u16 i; + u16 *pltt = (u16 *)PLTT; + + for (i = 0; i < PLTT_SIZE / 2; i++) + { + gPlttBufferUnfaded[i] = pltt[i]; + gPlttBufferFaded[i] = pltt[i]; + } +} + +bool8 BeginNormalPaletteFade(u32 selectedPalettes, s8 delay, u8 startY, u8 targetY, u16 blendColor) +{ + u8 temp; + register u32 _blendColor asm("r8") = blendColor; + + if (gPaletteFade.active) + { + return FALSE; + } + else + { + gPaletteFade.deltaY = 2; + + if (delay < 0) + { + gPaletteFade.deltaY += (delay * -1); + delay = 0; + } + + gPaletteFade_selectedPalettes = selectedPalettes; + gPaletteFade.delayCounter = delay; + gPaletteFade_delay = delay; + gPaletteFade.y = startY; + gPaletteFade.targetY = targetY; + gPaletteFade.blendColor = _blendColor; + gPaletteFade.active = 1; + gPaletteFade.mode = NORMAL_FADE; + + if (startY < targetY) + gPaletteFade.yDec = 0; + else + gPaletteFade.yDec = 1; + + UpdatePaletteFade(); + + temp = gPaletteFade.bufferTransferDisabled; + gPaletteFade.bufferTransferDisabled = 0; + CpuCopy32(gPlttBufferFaded, (void *)PLTT, PLTT_SIZE); + sPlttBufferTransferPending = 0; + if (gPaletteFade.mode == HARDWARE_FADE && gPaletteFade.active) + UpdateBlendRegisters(); + gPaletteFade.bufferTransferDisabled = temp; + return TRUE; + } +} + +bool8 unref_sub_80A1C1C(u32 a1, u8 a2, u8 a3, u8 a4, u16 a5) +{ + ReadPlttIntoBuffers(); + return BeginNormalPaletteFade(a1, a2, a3, a4, a5); +} + +void unref_sub_80A1C64(u8 a1, u32 *a2) +{ + u8 i; + + for (i = 0; i < 16; i++) + { + struct PaletteStruct *palstruct = &sPaletteStructs[i]; + if (palstruct->ps_field_4_0) + { + if (palstruct->base->pst_field_8_0 == a1) + { + u8 val1 = palstruct->srcIndex; + u8 val2 = palstruct->base->srcCount; + if (val1 == val2) + { + unused_sub_80A1F00(palstruct); + if (!palstruct->ps_field_4_0) + continue; + } + if (palstruct->ps_field_8 == 0) + unused_sub_80A1CDC(palstruct, a2); + else + palstruct->ps_field_8--; + + unused_sub_80A1E40(palstruct, a2); + } + } + } +} + +static void unused_sub_80A1CDC(struct PaletteStruct *a1, u32 *a2) +{ + s32 srcIndex; + s32 srcCount; + u8 i = 0; + u16 srcOffset = a1->srcIndex * a1->base->size; + + if (!a1->base->pst_field_8_0) + { + while (i < a1->base->size) + { + gPlttBufferUnfaded[a1->destOffset] = a1->base->src[srcOffset]; + gPlttBufferFaded[a1->destOffset] = a1->base->src[srcOffset]; + i++; + a1->destOffset++; + srcOffset++; + } + } + else + { + while (i < a1->base->size) + { + gPlttBufferFaded[a1->destOffset] = a1->base->src[srcOffset]; + i++; + a1->destOffset++; + srcOffset++; + } + } + + a1->destOffset = a1->baseDestOffset; + a1->ps_field_8 = a1->base->pst_field_A; + a1->srcIndex++; + + srcIndex = a1->srcIndex; + srcCount = a1->base->srcCount; + + if (srcIndex >= srcCount) + { + if (a1->ps_field_9) + a1->ps_field_9--; + a1->srcIndex = 0; + } + + *a2 |= 1 << (a1->baseDestOffset >> 4); +} + +static void unused_sub_80A1E40(struct PaletteStruct *a1, u32 *a2) +{ + if (gPaletteFade.active && ((1 << (a1->baseDestOffset >> 4)) & gPaletteFade_selectedPalettes)) + { + if (!a1->base->pst_field_8_0) + { + if (gPaletteFade.delayCounter != gPaletteFade_delay) + { + BlendPalette( + a1->baseDestOffset, + a1->base->size, + gPaletteFade.y, + gPaletteFade.blendColor); + } + } + else + { + if (!gPaletteFade.delayCounter) + { + if (a1->ps_field_8 != a1->base->pst_field_A) + { + u32 srcOffset = a1->srcIndex * a1->base->size; + u8 i; + + for (i = 0; i < a1->base->size; i++) + gPlttBufferFaded[a1->baseDestOffset + i] = a1->base->src[srcOffset + i]; + } + } + } + } +} + +static void unused_sub_80A1F00(struct PaletteStruct *a1) +{ + if (!a1->ps_field_9) + { + s32 val = a1->base->pst_field_B_5; + + if (!val) + { + a1->srcIndex = 0; + a1->ps_field_8 = a1->base->pst_field_A; + a1->ps_field_9 = a1->base->pst_field_C; + a1->destOffset = a1->baseDestOffset; + } + else + { + if (val < 0) + return; + if (val > 2) + return; + ResetPaletteStructByUid(a1->base->uid); + } + } + else + { + a1->ps_field_9--; + } +} + +void ResetPaletteStructByUid(u16 a1) +{ + u8 paletteNum = GetPaletteNumByUid(a1); + if (paletteNum != 16) + ResetPaletteStruct(paletteNum); +} + +void ResetPaletteStruct(u8 paletteNum) +{ + sPaletteStructs[paletteNum].base = &gDummyPaletteStructTemplate; + sPaletteStructs[paletteNum].ps_field_4_0 = 0; + sPaletteStructs[paletteNum].baseDestOffset = 0; + sPaletteStructs[paletteNum].destOffset = 0; + sPaletteStructs[paletteNum].srcIndex = 0; + sPaletteStructs[paletteNum].ps_field_4_1 = 0; + sPaletteStructs[paletteNum].ps_field_8 = 0; + sPaletteStructs[paletteNum].ps_field_9 = 0; +} + +void ResetPaletteFadeControl() +{ + gPaletteFade.multipurpose1 = 0; + gPaletteFade.multipurpose2 = 0; + gPaletteFade.delayCounter = 0; + gPaletteFade.y = 0; + gPaletteFade.targetY = 0; + gPaletteFade.blendColor = 0; + gPaletteFade.active = 0; + gPaletteFade.multipurpose2 = 0; // assign same value twice + gPaletteFade.yDec = 0; + gPaletteFade.bufferTransferDisabled = 0; + gPaletteFade.shouldResetBlendRegisters = 0; + gPaletteFade.hardwareFadeFinishing = 0; + gPaletteFade.softwareFadeFinishing = 0; + gPaletteFade.softwareFadeFinishingCounter = 0; + gPaletteFade.objPaletteToggle = 0; + gPaletteFade.deltaY = 2; +} + +void unref_sub_80A2048(u16 uid) +{ + u8 paletteNum = GetPaletteNumByUid(uid); + if (paletteNum != 16) + sPaletteStructs[paletteNum].ps_field_4_1 = 1; +} + +void unref_sub_80A2074(u16 uid) +{ + u8 paletteNum = GetPaletteNumByUid(uid); + if (paletteNum != 16) + sPaletteStructs[paletteNum].ps_field_4_1 = 0; +} + +static u8 GetPaletteNumByUid(u16 uid) +{ + u8 i; + + for (i = 0; i < 16; i++) + if (sPaletteStructs[i].base->uid == uid) + return i; + + return 16; +} + +static u8 UpdateNormalPaletteFade() +{ + u16 paletteOffset; + u16 selectedPalettes; + + if (!gPaletteFade.active) + return 0; + + if (IsSoftwarePaletteFadeFinishing()) + { + return gPaletteFade.active; + } + else + { + if (!gPaletteFade.objPaletteToggle) + { + if (gPaletteFade.delayCounter < gPaletteFade_delay) + { + gPaletteFade.delayCounter++; + return 2; + } + gPaletteFade.delayCounter = 0; + } + + paletteOffset = 0; + + if (!gPaletteFade.objPaletteToggle) + { + selectedPalettes = gPaletteFade_selectedPalettes; + } + else + { + selectedPalettes = gPaletteFade_selectedPalettes >> 16; + paletteOffset = 256; + } + + while (selectedPalettes) + { + if (selectedPalettes & 1) + BlendPalette( + paletteOffset, + 16, + gPaletteFade.y, + gPaletteFade.blendColor); + selectedPalettes >>= 1; + paletteOffset += 16; + } + + gPaletteFade.objPaletteToggle ^= 1; + + if (!gPaletteFade.objPaletteToggle) + { + if (gPaletteFade.y == gPaletteFade.targetY) + { + gPaletteFade_selectedPalettes = 0; + gPaletteFade.softwareFadeFinishing = 1; + } + else + { + s8 val; + + if (!gPaletteFade.yDec) + { + val = gPaletteFade.y; + val += gPaletteFade.deltaY; + if (val > gPaletteFade.targetY) + val = gPaletteFade.targetY; + gPaletteFade.y = val; + } + else + { + val = gPaletteFade.y; + val -= gPaletteFade.deltaY; + if (val < gPaletteFade.targetY) + val = gPaletteFade.targetY; + gPaletteFade.y = val; + } + } + } + + return gPaletteFade.active; + } +} + +void InvertPlttBuffer(u32 selectedPalettes) +{ + u16 paletteOffset = 0; + + while (selectedPalettes) + { + if (selectedPalettes & 1) + { + u8 i; + for (i = 0; i < 16; i++) + gPlttBufferFaded[paletteOffset + i] = ~gPlttBufferFaded[paletteOffset + i]; + } + selectedPalettes >>= 1; + paletteOffset += 16; + } +} + +void TintPlttBuffer(u32 selectedPalettes, s8 r, s8 g, s8 b) +{ + u16 paletteOffset = 0; + + while (selectedPalettes) + { + if (selectedPalettes & 1) + { + u8 i; + for (i = 0; i < 16; i++) + { + struct PlttData *data = (struct PlttData *)&gPlttBufferFaded[paletteOffset + i]; + data->r += r; + data->g += g; + data->b += b; + } + } + selectedPalettes >>= 1; + paletteOffset += 16; + } +} + +void UnfadePlttBuffer(u32 selectedPalettes) +{ + u16 paletteOffset = 0; + + while (selectedPalettes) + { + if (selectedPalettes & 1) + { + u8 i; + for (i = 0; i < 16; i++) + gPlttBufferFaded[paletteOffset + i] = gPlttBufferUnfaded[paletteOffset + i]; + } + selectedPalettes >>= 1; + paletteOffset += 16; + } +} + +void BeginFastPaletteFade(u8 submode) +{ + gPaletteFade.deltaY = 2; + BeginFastPaletteFadeInternal(submode); +} + +static void BeginFastPaletteFadeInternal(u8 submode) +{ + gPaletteFade.y = 31; + gPaletteFade_submode = submode & 0x3F; + gPaletteFade.active = 1; + gPaletteFade.mode = FAST_FADE; + + if (submode == FAST_FADE_IN_FROM_BLACK) + CpuFill16(RGB_BLACK, gPlttBufferFaded, PLTT_SIZE); + + if (submode == FAST_FADE_IN_FROM_WHITE) + CpuFill16(RGB_WHITE, gPlttBufferFaded, PLTT_SIZE); + + UpdatePaletteFade(); +} + +static u8 UpdateFastPaletteFade(void) +{ + u16 i; + u16 paletteOffsetStart; + u16 paletteOffsetEnd; + s8 r0; + s8 g0; + s8 b0; + s8 r; + s8 g; + s8 b; + + if (!gPaletteFade.active) + return 0; + + if (IsSoftwarePaletteFadeFinishing()) + return gPaletteFade.active; + + if (gPaletteFade.objPaletteToggle) + { + paletteOffsetStart = 256; + paletteOffsetEnd = 512; + } + else + { + paletteOffsetStart = 0; + paletteOffsetEnd = 256; + } + + switch (gPaletteFade_submode) + { + case FAST_FADE_IN_FROM_WHITE: + for (i = paletteOffsetStart; i < paletteOffsetEnd; i++) + { + struct PlttData *unfaded; + struct PlttData *faded; + + unfaded = (struct PlttData *)&gPlttBufferUnfaded[i]; + r0 = unfaded->r; + g0 = unfaded->g; + b0 = unfaded->b; + + faded = (struct PlttData *)&gPlttBufferFaded[i]; + r = faded->r - 2; + g = faded->g - 2; + b = faded->b - 2; + + if (r < r0) + r = r0; + if (g < g0) + g = g0; + if (b < b0) + b = b0; + + gPlttBufferFaded[i] = r | (g << 5) | (b << 10); + } + break; + case FAST_FADE_OUT_TO_WHTIE: + for (i = paletteOffsetStart; i < paletteOffsetEnd; i++) + { + struct PlttData *data = (struct PlttData *)&gPlttBufferFaded[i]; + r = data->r + 2; + g = data->g + 2; + b = data->b + 2; + + if (r > 31) + r = 31; + if (g > 31) + g = 31; + if (b > 31) + b = 31; + + gPlttBufferFaded[i] = r | (g << 5) | (b << 10); + } + break; + case FAST_FADE_IN_FROM_BLACK: + for (i = paletteOffsetStart; i < paletteOffsetEnd; i++) + { + struct PlttData *unfaded; + struct PlttData *faded; + + unfaded = (struct PlttData *)&gPlttBufferUnfaded[i]; + r0 = unfaded->r; + g0 = unfaded->g; + b0 = unfaded->b; + + faded = (struct PlttData *)&gPlttBufferFaded[i]; + r = faded->r + 2; + g = faded->g + 2; + b = faded->b + 2; + + if (r > r0) + r = r0; + if (g > g0) + g = g0; + if (b > b0) + b = b0; + + gPlttBufferFaded[i] = r | (g << 5) | (b << 10); + } + break; + case FAST_FADE_OUT_TO_BLACK: + for (i = paletteOffsetStart; i < paletteOffsetEnd; i++) + { + struct PlttData *data = (struct PlttData *)&gPlttBufferFaded[i]; + r = data->r - 2; + g = data->g - 2; + b = data->b - 2; + + if (r < 0) + r = 0; + if (g < 0) + g = 0; + if (b < 0) + b = 0; + + gPlttBufferFaded[i] = r | (g << 5) | (b << 10); + } + } + + gPaletteFade.objPaletteToggle ^= 1; + + if (gPaletteFade.objPaletteToggle) + return gPaletteFade.active; + + if (gPaletteFade.y - gPaletteFade.deltaY < 0) + gPaletteFade.y = 0; + else + gPaletteFade.y -= gPaletteFade.deltaY; + + if (gPaletteFade.y == 0) + { + switch (gPaletteFade_submode) + { + case FAST_FADE_IN_FROM_WHITE: + case FAST_FADE_IN_FROM_BLACK: + CpuCopy32(gPlttBufferUnfaded, gPlttBufferFaded, PLTT_SIZE); + break; + case FAST_FADE_OUT_TO_WHTIE: + CpuFill32(0xFFFFFFFF, gPlttBufferFaded, PLTT_SIZE); + break; + case FAST_FADE_OUT_TO_BLACK: + CpuFill32(0x00000000, gPlttBufferFaded, PLTT_SIZE); + break; + } + + gPaletteFade.mode = NORMAL_FADE; + gPaletteFade.softwareFadeFinishing = 1; + } + + return gPaletteFade.active; +} + +void BeginHardwarePaletteFade(u8 blendCnt, u8 delay, u8 y, u8 targetY, u8 shouldResetBlendRegisters) +{ + gPaletteFade_blendCnt = blendCnt; + gPaletteFade.delayCounter = delay; + gPaletteFade_delay = delay; + gPaletteFade.y = y; + gPaletteFade.targetY = targetY; + gPaletteFade.active = 1; + gPaletteFade.mode = HARDWARE_FADE; + gPaletteFade.shouldResetBlendRegisters = shouldResetBlendRegisters & 1; + gPaletteFade.hardwareFadeFinishing = 0; + + if (y < targetY) + gPaletteFade.yDec = 0; + else + gPaletteFade.yDec = 1; +} + +static u8 UpdateHardwarePaletteFade(void) +{ + if (!gPaletteFade.active) + return 0; + + if (gPaletteFade.delayCounter < gPaletteFade_delay) + { + gPaletteFade.delayCounter++; + return 2; + } + + gPaletteFade.delayCounter = 0; + + if (!gPaletteFade.yDec) + { + gPaletteFade.y++; + if (gPaletteFade.y > gPaletteFade.targetY) + { + gPaletteFade.hardwareFadeFinishing++; + gPaletteFade.y--; + } + } + else + { + s32 y = gPaletteFade.y--; + if (y - 1 < gPaletteFade.targetY) + { + gPaletteFade.hardwareFadeFinishing++; + gPaletteFade.y++; + } + } + + if (gPaletteFade.hardwareFadeFinishing) + { + if (gPaletteFade.shouldResetBlendRegisters) + { + gPaletteFade_blendCnt = 0; + gPaletteFade.y = 0; + } + gPaletteFade.shouldResetBlendRegisters = 0; + } + + return gPaletteFade.active; +} + +static void UpdateBlendRegisters(void) +{ + SetGpuReg(REG_OFFSET_BLDCNT, (u16)gPaletteFade_blendCnt); + SetGpuReg(REG_OFFSET_BLDY, gPaletteFade.y); + if (gPaletteFade.hardwareFadeFinishing) + { + gPaletteFade.hardwareFadeFinishing = 0; + gPaletteFade.mode = 0; + gPaletteFade_blendCnt = 0; + gPaletteFade.y = 0; + gPaletteFade.active = 0; + } +} + +static bool8 IsSoftwarePaletteFadeFinishing(void) +{ + if (gPaletteFade.softwareFadeFinishing) + { + if (gPaletteFade.softwareFadeFinishingCounter == 4) + { + gPaletteFade.active = 0; + gPaletteFade.softwareFadeFinishing = 0; + gPaletteFade.softwareFadeFinishingCounter = 0; + } + else + { + gPaletteFade.softwareFadeFinishingCounter++; + } + + return TRUE; + } + else + { + return FALSE; + } +} + +void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color) +{ + u16 paletteOffset; + + for (paletteOffset = 0; selectedPalettes; paletteOffset += 16) + { + if (selectedPalettes & 1) + BlendPalette(paletteOffset, 16, coeff, color); + selectedPalettes >>= 1; + } +} + +void BlendPalettesUnfaded(u32 selectedPalettes, u8 coeff, u16 color) +{ + void *src = gPlttBufferUnfaded; + void *dest = gPlttBufferFaded; + DmaCopy32(3, src, dest, PLTT_SIZE); + BlendPalettes(selectedPalettes, coeff, color); +} + +void TintPalette_GrayScale(u16 *palette, u16 count) +{ + s32 r; + s32 g; + s32 b; + s32 gray; + + int i; + for (i = 0; i < count; i++) + { + r = *palette & 0x1F; + g = (*palette >> 5) & 0x1F; + b = (*palette >> 10) & 0x1F; + + r *= 0x4C; + r += g * 0x97; + r += b * 0x1D; + + gray = r >> 8; + + *palette++ = gray << 10 | gray << 5 | gray; + } + return; +} + +void TintPalette_GrayScale2(u16 *palette, u16 count) +{ + s32 r; + s32 g; + s32 b; + s32 gray; + + int i; + for (i = 0; i < count; i++) + { + r = *palette & 0x1F; + g = (*palette >> 5) & 0x1F; + b = (*palette >> 10) & 0x1F; + + r *= 0x4C; + r += g * 0x97; + r += b * 0x1D; + + gray = r >> 8; + + if ((u32)gray > 0x1F) + gray = 0x1F; + + gray = gUnknown_0852489C[gray]; + + *palette++ = gray << 10 | gray << 5 | gray; + } + return; +} + +#ifdef NONMATCHING +void TintPalette_SepiaTone(u16 *palette, u16 count) +{ + s32 r; + s32 g; + s32 b; + u32 gray; + u32 sepia; + s8 r2; + s8 g2; + s8 b2; + + int i; + for (i = 0; i < count; i++) + { + r = *palette & 0x1F; + g = (*palette >> 5) & 0x1F; + b = (*palette >> 10) & 0x1F; + + r *= 0x4C; + r += g * 0x97; + r += b * 0x1D; + + gray = (s32)(r >> 8); + + sepia = (gray * 0x133); + + r2 = (u16)sepia >> 8; + + g2 = gray; + + b2 = (gray * 15); + + if (r2 > 0x1F) + r2 = 0x1F; + + *palette++ = b2 << 10 | g2 << 5 | r2; + } + return; +} +#else +__attribute__((naked)) +void TintPalette_SepiaTone(u16 *palette, u16 count) +{ + asm("push {r4-r7,lr}\n\ + add r5, r0, #0\n\ + lsl r1, #16\n\ + lsr r1, #16\n\ + cmp r1, #0\n\ + beq _080A2BA2\n\ + mov r7, #0x1F\n\ + add r6, r1, #0\n\ +_080A2B50:\n\ + ldrh r0, [r5]\n\ + mov r1, #0x1F\n\ + and r1, r0\n\ + lsl r0, #16\n\ + lsr r2, r0, #21\n\ + and r2, r7\n\ + lsr r3, r0, #26\n\ + and r3, r7\n\ + mov r0, #0x4C\n\ + mul r1, r0\n\ + mov r0, #0x97\n\ + mul r0, r2\n\ + add r1, r0\n\ + lsl r0, r3, #3\n\ + sub r0, r3\n\ + lsl r0, #2\n\ + add r0, r3\n\ + add r1, r0\n\ + asr r1, #8\n\ + ldr r0, =0x00000133\n\ + mul r0, r1\n\ + lsl r0, #16\n\ + lsr r2, r0, #24\n\ + lsl r0, r1, #24\n\ + lsr r4, r0, #24\n\ + lsl r0, r1, #4\n\ + sub r0, r1\n\ + lsl r0, #20\n\ + lsr r3, r0, #24\n\ + cmp r2, #0x1F\n\ + ble _080A2B90\n\ + mov r2, #0x1F\n\ +_080A2B90:\n\ + lsl r0, r3, #10\n\ + lsl r1, r4, #5\n\ + orr r0, r1\n\ + orr r0, r2\n\ + strh r0, [r5]\n\ + add r5, #0x2\n\ + sub r6, #0x1\n\ + cmp r6, #0\n\ + bne _080A2B50\n\ +_080A2BA2:\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool"); +} +#endif // NONMATCHING + +#ifdef NONMATCHING +void sub_80A2BAC(u16 *palette, u16 count, u16 a3, u16 a4, u16 a5) +{ + s32 r; + s32 g; + s32 b; + s32 gray; + u8 r2; + u8 g2; + u8 b2; + + int i; + for (i = 0; i < count; i++) + { + r = *palette & 0x1F; + g = (*palette >> 5) & 0x1F; + b = (*palette >> 10) & 0x1F; + + r *= 0x4C; + r += g * 0x97; + r += b * 0x1D; + + gray = r >> 8; + + r2 = (u16)(gray * a3) >> 8; + + g2 = (u16)(gray * a4) >> 8; + + b2 = (u16)(gray * a5) >> 8; + + if (r2 > 0x1F) + r2 = 0x1F; + + if (g2 > 0x1F) + g2 = 0x1F; + + if (b2 > 0x1F) + b2 = 0x1F; + + *palette++ = b2 << 10 | g2 << 5 | r2; + } + return; +} +#else +__attribute__((naked)) +void sub_80A2BAC(u16 *palette, u16 count, u16 a3, u16 a4, u16 a5) +{ + asm("push {r4-r7,lr}\n\ + mov r7, r9\n\ + mov r6, r8\n\ + push {r6,r7}\n\ + add r5, r0, #0\n\ + ldr r0, [sp, #0x1C]\n\ + lsl r1, #16\n\ + lsr r1, #16\n\ + lsl r2, #16\n\ + lsr r2, #16\n\ + mov r9, r2\n\ + lsl r3, #16\n\ + lsr r3, #16\n\ + mov r8, r3\n\ + lsl r0, #16\n\ + lsr r0, #16\n\ + mov r12, r0\n\ + cmp r1, #0\n\ + beq _080A2C38\n\ + mov r7, #0x1F\n\ + add r6, r1, #0\n\ +_080A2BD6:\n\ + ldrh r0, [r5]\n\ + mov r1, #0x1F\n\ + and r1, r0\n\ + lsl r0, #16\n\ + lsr r2, r0, #21\n\ + and r2, r7\n\ + lsr r3, r0, #26\n\ + and r3, r7\n\ + mov r0, #0x4C\n\ + mul r1, r0\n\ + mov r0, #0x97\n\ + mul r0, r2\n\ + add r1, r0\n\ + lsl r0, r3, #3\n\ + sub r0, r3\n\ + lsl r0, #2\n\ + add r0, r3\n\ + add r1, r0\n\ + asr r1, #8\n\ + mov r0, r9\n\ + mul r0, r1\n\ + lsl r0, #16\n\ + lsr r4, r0, #24\n\ + mov r0, r8\n\ + mul r0, r1\n\ + lsl r0, #16\n\ + lsr r2, r0, #24\n\ + mov r0, r12\n\ + mul r0, r1\n\ + lsl r0, #16\n\ + lsr r3, r0, #24\n\ + cmp r4, #0x1F\n\ + ble _080A2C1A\n\ + mov r4, #0x1F\n\ +_080A2C1A:\n\ + cmp r2, #0x1F\n\ + ble _080A2C20\n\ + mov r2, #0x1F\n\ +_080A2C20:\n\ + cmp r3, #0x1F\n\ + ble _080A2C26\n\ + mov r3, #0x1F\n\ +_080A2C26:\n\ + lsl r0, r3, #10\n\ + lsl r1, r2, #5\n\ + orr r0, r1\n\ + orr r0, r4\n\ + strh r0, [r5]\n\ + add r5, #0x2\n\ + sub r6, #0x1\n\ + cmp r6, #0\n\ + bne _080A2BD6\n\ +_080A2C38:\n\ + pop {r3,r4}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0"); +} +#endif + +void sub_80A2C44(u32 a1, s8 a2, u8 a3, u8 a4, u16 a5, u8 a6, u8 a7) +{ + u8 v11; + struct Task *v12; + u32 v13; + struct Task *v14; + struct Task *v15; + struct Task *v16; + + v11 = CreateTask((void *)sub_80A2D54, a6); + v15 = gTasks; + v12 = &v15[v11]; + v12->data[0] = a3; + v12->data[1] = a4; + + if (a2 >= 0) + { + v12->data[3] = a2; + v13 = 1; + } + else + { + v12->data[3] = 0; + v13 = -a2 + 1; + } + + v12->data[2] = v13; + + if (a4 < a3) + gTasks[v11].data[2] *= -1; + + SetWordTaskArg(v11, 5, a1); + v16 = gTasks; + v14 = &v16[v11]; + v14->data[7] = a5; + v14->data[8] = a7; + _call_via_r1(v11, v14->func); +} + +u32 sub_80A2CF8(u8 a1) +{ + int i = 0; + void *func = sub_80A2D54; + struct Task *v2 = gTasks; + + for (; i <= 0xF; i++) + { + if ((v2->isActive == 1) && (v2->func == func) && (v2->data[8] == a1)) + return 1; + v2++; + } + return 0; +} + +void sub_80A2D34() +{ + int v0; + + while (1) + { + v0 = FindTaskIdByFunc(sub_80A2D54); + if (v0 == 0xFF) + break; + DestroyTask(v0); + } +} + +void sub_80A2D54(u8 a1) +{ + s16 *v2; + u32 v3; + u16 v4; + u16 v5; + s32 v6; + u16 v7; + u32 v8; + s16 v9; + u16 v10; + s32 v11; + + v2 = gTasks[a1].data; + v3 = GetWordTaskArg(a1, 5); + v2[4] += 1; + + if (v2[4] > v2[3]) + { + v2[4] = 0; + BlendPalettes(v3, v2[0], v2[7]); + v10 = v2[0]; + v11 = v2[0]; + v5 = v2[1]; + v6 = v2[1]; + if (v11 == v6) + { + DestroyTask(a1); + } + else + { + v7 = v2[2]; + v8 = v10 + v7; + v2[0] = v8; + if (v7 << 16 >= 0) + { + v9 = v8; + if (v9 < v6) + { + return; + } + } + else if ((v9 = v8) > v6) + { + return; + } + v2[0] = v5; + } + } + return; +} diff --git a/sym_ewram.txt b/sym_ewram.txt index 794c81d8d..f606787dc 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -946,108 +946,9 @@ gUnknown_02037622: @ 2037622 gUnknown_02037624: @ 2037624 .space 0xF0 -gUnknown_02037714: @ 2037714 - .space 0x2 - -gUnknown_02037716: @ 2037716 - .space 0x12 - -gUnknown_02037728: @ 2037728 - .space 0x2C - -gUnknown_02037754: @ 2037754 - .space 0x20 - -gUnknown_02037774: @ 2037774 - .space 0x20 - -gUnknown_02037794: @ 2037794 - .space 0x20 - -gUnknown_020377B4: @ 20377B4 - .space 0x20 - -gUnknown_020377D4: @ 20377D4 - .space 0x20 - -gUnknown_020377F4: @ 20377F4 - .space 0x20 - -gUnknown_02037814: @ 2037814 - .space 0x40 - -gUnknown_02037854: @ 2037854 - .space 0xA0 - -gUnknown_020378F4: @ 20378F4 - .space 0x2 - -gUnknown_020378F6: @ 20378F6 - .space 0x1E - -gUnknown_02037914: @ 2037914 - .space 0x10 - -gUnknown_02037924: @ 2037924 - .space 0x1F0 - -gUnknown_02037B14: @ 2037B14 - .space 0x14 - -gUnknown_02037B28: @ 2037B28 - .space 0x2A - -gUnknown_02037B52: @ 2037B52 - .space 0x2 - -gUnknown_02037B54: @ 2037B54 - .space 0x1E - -gUnknown_02037B72: @ 2037B72 - .space 0x42 - -gUnknown_02037BB4: @ 2037BB4 - .space 0x10 - -gUnknown_02037BC4: @ 2037BC4 - .space 0x8 - -gUnknown_02037BCC: @ 2037BCC - .space 0x2 - -gUnknown_02037BCE: @ 2037BCE - .space 0x2 - -gUnknown_02037BD0: @ 2037BD0 - .space 0x24 - -gUnknown_02037BF4: @ 2037BF4 - .space 0xC - -gUnknown_02037C00: @ 2037C00 - .space 0xD4 - -gUnknown_02037CD4: @ 2037CD4 - .space 0x40 - -gUnknown_02037D14: @ 2037D14 - .space 0x3E - -gUnknown_02037D52: @ 2037D52 - .space 0x1C2 - -gUnknown_02037F14: @ 2037F14 - .space 0xC0 - -gUnknown_02037FD4: @ 2037FD4 - .space 0x10 - -gUnknown_02037FE4: @ 2037FE4 - .space 0x4 - -gUnknown_02037FE8: @ 2037FE8 - .space 0x400 + .include "src/palette.o" + .align 0x2 gUnknown_020383E8: @ 20383E8 .space 0x4