mirror of https://github.com/zeldaret/tmc.git
Match sub_080AE324
This commit is contained in:
parent
76634df376
commit
9a293559eb
|
|
@ -1,50 +0,0 @@
|
|||
.syntax unified
|
||||
push {r4, r5, r6, r7, lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
adds r3, r1, #0
|
||||
ldr r2, _080AE380 @ =gGFXSlots
|
||||
lsls r1, r0, #1
|
||||
adds r1, r1, r0
|
||||
lsls r1, r1, #2
|
||||
adds r5, r1, r2
|
||||
ldrb r4, [r5, #5]
|
||||
subs r4, #1
|
||||
movs r0, #1
|
||||
rsbs r0, r0, #0
|
||||
cmp r4, r0
|
||||
beq _080AE372
|
||||
lsls r0, r3, #1
|
||||
adds r0, r0, r3
|
||||
lsls r0, r0, #2
|
||||
adds r0, r0, r2
|
||||
mov r8, r0
|
||||
adds r0, r1, #4
|
||||
adds r6, r0, r2
|
||||
_080AE350:
|
||||
mov r0, r8
|
||||
adds r0, #4
|
||||
adds r1, r5, #4
|
||||
ldm r1!, {r2, r3, r7}
|
||||
stm r0!, {r2, r3, r7}
|
||||
adds r0, r6, #0
|
||||
movs r1, #0xc
|
||||
bl MemClear
|
||||
adds r6, #0xc
|
||||
adds r5, #0xc
|
||||
movs r0, #0xc
|
||||
add r8, r0
|
||||
subs r4, #1
|
||||
subs r0, #0xd
|
||||
cmp r4, r0
|
||||
bne _080AE350
|
||||
_080AE372:
|
||||
ldr r1, _080AE380 @ =gGFXSlots
|
||||
movs r0, #1
|
||||
strb r0, [r1, #3]
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
_080AE380: .4byte gGFXSlots
|
||||
.syntax divided
|
||||
19
src/vram.c
19
src/vram.c
|
|
@ -16,7 +16,7 @@ void SetGFXSlotStatus(GfxSlot*, u32);
|
|||
u32 FindNextOccupiedGFXSlot(u32);
|
||||
u32 FindFirstFreeGFXSlot(void);
|
||||
void sub_080AE218(u32, u32);
|
||||
void sub_080AE324(u32, u32);
|
||||
void MoveGFXSlots(u32, u32);
|
||||
|
||||
void ResetPalettes(void) {
|
||||
GfxSlot* slots;
|
||||
|
|
@ -296,7 +296,7 @@ void CleanUpGFXSlots(void) {
|
|||
firstFreeIndex = FindFirstFreeGFXSlot();
|
||||
if (firstFreeIndex <= occupiedIndex) {
|
||||
sub_080AE218(occupiedIndex, firstFreeIndex);
|
||||
sub_080AE324(occupiedIndex, firstFreeIndex);
|
||||
MoveGFXSlots(occupiedIndex, firstFreeIndex);
|
||||
occupiedIndex = firstFreeIndex;
|
||||
}
|
||||
}
|
||||
|
|
@ -306,8 +306,19 @@ void CleanUpGFXSlots(void) {
|
|||
// Swap gfx
|
||||
ASM_FUNC("asm/non_matching/vram/sub_080AE218.inc", void sub_080AE218(u32 a, u32 b))
|
||||
|
||||
// Swap palettes
|
||||
ASM_FUNC("asm/non_matching/vram/sub_080AE324.inc", void sub_080AE324(u32 a, u32 b))
|
||||
void MoveGFXSlots(u32 srcIndex, u32 targetIndex) {
|
||||
s32 index;
|
||||
u32 count;
|
||||
|
||||
count = gGFXSlots.slots[srcIndex].slotCount;
|
||||
for (count = count - 1; count != -1; count--) {
|
||||
gGFXSlots.slots[targetIndex] = gGFXSlots.slots[srcIndex];
|
||||
MemClear(&gGFXSlots.slots[srcIndex], sizeof(GfxSlot));
|
||||
srcIndex++;
|
||||
targetIndex++;
|
||||
}
|
||||
gGFXSlots.unk_3 = 1;
|
||||
}
|
||||
|
||||
u32 FindNextOccupiedGFXSlot(u32 index) {
|
||||
for (; index < MAX_GFX_SLOTS - 1; index++) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue