Decompiled 4 more functions

This commit is contained in:
Phlosioneer 2019-02-14 17:26:34 -05:00
parent cb800e4708
commit 6d929c61c5
2 changed files with 54 additions and 119 deletions

View File

@ -5,119 +5,6 @@
.text
thumb_func_start sub_81C7BA4
sub_81C7BA4: @ 81C7BA4
push {r4,r5,lr}
sub sp, 0xC
adds r4, r0, 0
movs r0, 0
bl sub_81C763C
adds r5, r0, 0
ldr r0, [r5, 0x10]
bl sub_81C7BF8
ldrb r0, [r5, 0x10]
ldr r1, =gUnknown_0861FA48
str r1, [sp]
movs r1, 0
str r1, [sp, 0x4]
ldr r1, =gUnknown_0861FA18
lsls r4, 2
adds r4, r1
ldr r1, [r4]
str r1, [sp, 0x8]
movs r1, 0x1
movs r2, 0
movs r3, 0x1
bl AddTextPrinterParameterized3
add sp, 0xC
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_81C7BA4
thumb_func_start sub_81C7BE8
sub_81C7BE8: @ 81C7BE8
push {lr}
bl IsDma3ManagerBusyWithBgCopy
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
thumb_func_end sub_81C7BE8
thumb_func_start sub_81C7BF8
sub_81C7BF8: @ 81C7BF8
push {r4,lr}
sub sp, 0x8
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
adds r0, r4, 0
movs r1, 0x44
bl FillWindowPixelBuffer
movs r0, 0x80
str r0, [sp]
movs r0, 0x1
str r0, [sp, 0x4]
adds r0, r4, 0
movs r1, 0x55
movs r2, 0
movs r3, 0
bl FillWindowPixelRect
add sp, 0x8
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_81C7BF8
thumb_func_start sub_81C7C28
sub_81C7C28: @ 81C7C28
push {r4-r6,lr}
movs r0, 0
bl sub_81C763C
adds r6, r0, 0
movs r5, 0
ldr r4, =gUnknown_0861FA4C
_081C7C36:
adds r0, r4, 0
bl LoadCompressedSpriteSheet
adds r4, 0x8
adds r5, 0x1
cmp r5, 0
beq _081C7C36
ldr r0, =gUnknown_0861FA54
bl sub_81C795C
movs r0, 0
bl IndexOfSpritePaletteTag
lsls r0, 24
lsrs r0, 24
movs r1, 0x80
lsls r1, 9
lsls r1, r0
movs r0, 0x2
negs r0, r0
bics r0, r1
str r0, [r6, 0x14]
ldr r0, =gUnknown_0861FB04
movs r1, 0xDC
movs r2, 0xC
movs r3, 0
bl CreateSprite
lsls r0, 24
lsrs r0, 24
lsls r1, r0, 4
adds r1, r0
lsls r1, 2
ldr r0, =gSprites
adds r1, r0
str r1, [r6, 0x18]
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_81C7C28
thumb_func_start sub_81C7C94
sub_81C7C94: @ 81C7C94
push {lr}

View File

@ -14,6 +14,7 @@
#include "menu.h"
#include "graphics.h"
#include "gba/macro.h"
#include "decompress.h"
#define UNKNOWN_OFFSET 100000
@ -44,21 +45,28 @@ struct UnknownStruct_sub_81C76C4 {
u32 data[523];
};
struct UnknownStruct_sub_81C7C28 {
struct CompressedSpriteSheet sheet;
u32 field4;
};
extern struct BgTemplate gUnknown_0861FA04;
extern struct WindowTemplate gUnknown_0861FA08;
extern struct UnknownStruct_0203CF40 *gUnknown_0203CF40;
extern u8 gUnknown_0203CF3C;
extern u8 gUnknown_0861FA48;
extern struct UnknownStruct_0861F3EC gUnknown_0861F3EC[7]; // Unknown size; at least 7.
extern const u8 *(gUnknown_0861FA18[]);
extern const struct CompressedSpriteSheet gUnknown_0861FA4C[];
extern const struct PaletteDescriptor gUnknown_0861FA54;
extern const struct SpriteTemplate gUnknown_0861FB04;
extern void sub_81C9430(void);
extern void sub_81CAADC(void);
extern void sub_81C99D4(void);
extern void sub_81C7C94(void);
extern void sub_8199D98(void);
extern void sub_81C7C28(void);
extern void sub_81C7D28(void);
extern void sub_81C7BF8(void);
u32 sub_81C791C(s32 a0);
@ -77,6 +85,7 @@ void sub_81C7834(u32 (*a0)(void), u32(*a1)(void));
void sub_81C7360(struct UnknownStruct_0203CF40 *a0);
void sub_81C7650(u32 index);
void sub_81C7850(u32 a0);
void sub_81C7BF8(u32 a0);
void sub_81C71E4(u8 a0);
void sub_81C7170(u8 a0);
void sub_81C742C(u8 taskId);
@ -85,6 +94,7 @@ void sub_81C75F4(void);
void sub_81C7334(void);
void sub_81C7418(void);
void sub_81C7400(void);
void sub_81C7C28(void);
void sub_81C72BC(void);
void sub_81C7B74(void);
@ -607,8 +617,8 @@ void CopyPaletteIntoBufferUnfaded(void *palette, u32 bufferOffset, u32 size) {
CpuCopy16(palette, gPlttBufferUnfaded + bufferOffset, size);
}
void sub_81C795C(struct PaletteDescriptor *palettes) {
struct PaletteDescriptor *current;
void sub_81C795C(const struct PaletteDescriptor *palettes) {
const struct PaletteDescriptor *current;
u32 index;
for (current = palettes; current->palette != NULL; current++)
@ -808,7 +818,45 @@ void sub_81C7B74(void) {
v1 = sub_81C763C(0);
InitWindows(&gUnknown_0861FA08);
v1[4] = 0;
sub_81C7BF8();
sub_81C7BF8(0);
PutWindowTilemap(v1[4]);
CopyWindowToVram(v1[4], 3); // TODO: Use a defined constant here.
}
void sub_81C7BA4(u32 a0) {
u32* v1;
v1 = sub_81C763C(0);
sub_81C7BF8(v1[4]);
AddTextPrinterParameterized3(v1[4], 1, 0, 1, &gUnknown_0861FA48, 0, gUnknown_0861FA18[a0]);
}
bool8 sub_81C7BE8(void) {
return IsDma3ManagerBusyWithBgCopy();
}
void sub_81C7BF8(u32 a0) {
FillWindowPixelBuffer(a0, 0x44);
FillWindowPixelRect(a0, 0x55, 0, 0, 0x80, 1);
}
void sub_81C7C28(void) {
u32* v1;
u32 i;
u8 v2;
u32 v3;
u32 v4;
u8 spriteId;
v1 = sub_81C763C(0);
for (i = 0; i == 0; i++) {
LoadCompressedSpriteSheet(&gUnknown_0861FA4C[i]);
}
sub_81C795C(&gUnknown_0861FA54);
v2 = IndexOfSpritePaletteTag(0);
v3 = 0x80 << 9 << v2;
v1[5] = -2 & ~v3;
spriteId = CreateSprite(&gUnknown_0861FB04, 0xDC, 0xC, 0);
v1[6] = (u32)(&gSprites[spriteId]);
}