Match CreateUIElement

This commit is contained in:
octorock 2022-11-06 10:17:10 +00:00
parent 5209d6af3a
commit e4898c53d4
2 changed files with 12 additions and 51 deletions

View File

@ -1,41 +0,0 @@
.syntax unified
push {r4, r5, r6, r7, lr}
adds r5, r0, #0
adds r6, r1, #0
movs r3, #0
ldr r7, _0801CAA8 @ =gUnk_0200AF34
movs r0, #1
mov ip, r0
ldr r1, _0801CAAC @ =gUIElementDefinitions
lsls r0, r5, #4
adds r4, r0, r1
_0801CA80:
lsls r0, r3, #5
adds r1, r0, r7
ldrb r2, [r1]
movs r0, #1
ands r0, r2
cmp r0, #0
bne _0801CAB0
strb r5, [r1, #1]
strb r6, [r1, #2]
movs r0, #0xff
strb r0, [r1, #0x10]
mov r0, ip
orrs r0, r2
strb r0, [r1]
ldrh r0, [r4, #4]
strh r0, [r1, #0x1a]
ldrb r0, [r4, #0xc]
strb r0, [r1, #3]
b _0801CAB6
.align 2, 0
_0801CAA8: .4byte gUnk_0200AF34
_0801CAAC: .4byte gUIElementDefinitions
_0801CAB0:
adds r3, #1
cmp r3, #0x17
bls _0801CA80
_0801CAB6:
pop {r4, r5, r6, r7, pc}
.syntax divided

View File

@ -592,27 +592,29 @@ void DrawKeys(void) {
}
}
NONMATCH("asm/non_matching/ui/CreateUIElement.inc", void CreateUIElement(u32 type, u32 type2)) {
u8 bVar1;
void CreateUIElement(u32 type, u32 type2) {
u32 index;
UIElement* new_var;
UIElement* element;
UIElementDefinition* definition;
for (index = 0; index < MAX_UI_ELEMENTS; index++) {
element = &gUnk_0200AF00.elements[index];
if (element->used == 0) {
definition = &gUIElementDefinitions[type];
element->type = (u8)type;
element = gUnk_0200AF00.elements;
element += index;
if (!element->used) {
element->type = type;
element->type2 = type2;
element->frameIndex = 0xff;
element->used = 1;
element->unk_1a = definition->unk_4;
element->buttonElementId = definition->buttonElementId;
element->unk_1a = gUIElementDefinitions[type].unk_4;
// Permuter trickery. TODO find something more senseful?
index = type;
element->buttonElementId = gUIElementDefinitions[index].buttonElementId;
return;
}
}
}
END_NONMATCH
void sub_0801CAB8(UIElement* element, Frame* frame) {
element->framePtr = frame;