Fix indentation

This commit is contained in:
DizzyEggg 2018-11-26 20:19:52 +01:00
parent 8e10d7c0e5
commit c9b3f3e3cb
5 changed files with 1030 additions and 1043 deletions

546
src/bg.c
View File

@ -479,27 +479,27 @@ void SetBgAttribute(u8 bg, u8 attributeId, u8 value)
{
switch (attributeId)
{
case 1:
SetBgControlAttributes(bg, value, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
break;
case 2:
SetBgControlAttributes(bg, 0xFF, value, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
break;
case 3:
SetBgControlAttributes(bg, 0xFF, 0xFF, value, 0xFF, 0xFF, 0xFF, 0xFF);
break;
case 4:
SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, value, 0xFF, 0xFF, 0xFF);
break;
case 7:
SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, 0xFF, value, 0xFF, 0xFF);
break;
case 5:
SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, value, 0xFF);
break;
case 6:
SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, value);
break;
case 1:
SetBgControlAttributes(bg, value, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
break;
case 2:
SetBgControlAttributes(bg, 0xFF, value, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
break;
case 3:
SetBgControlAttributes(bg, 0xFF, 0xFF, value, 0xFF, 0xFF, 0xFF, 0xFF);
break;
case 4:
SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, value, 0xFF, 0xFF, 0xFF);
break;
case 7:
SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, 0xFF, value, 0xFF, 0xFF);
break;
case 5:
SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, value, 0xFF);
break;
case 6:
SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, value);
break;
}
}
@ -507,36 +507,36 @@ u16 GetBgAttribute(u8 bg, u8 attributeId)
{
switch (attributeId)
{
case 1:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_CHARBASEINDEX);
case 2:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_MAPBASEINDEX);
case 3:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE);
case 4:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_PALETTEMODE);
case 7:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_PRIORITY);
case 5:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_MOSAIC);
case 6:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_WRAPAROUND);
case 8:
switch (GetBgType(bg))
{
case 0:
return GetBgMetricTextMode(bg, 0) * 0x800;
case 1:
return GetBgMetricAffineMode(bg, 0) * 0x100;
default:
return 0;
}
case 9:
return GetBgType(bg);
case 10:
return sGpuBgConfigs2[bg].baseTile;
default:
return -1;
case 1:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_CHARBASEINDEX);
case 2:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_MAPBASEINDEX);
case 3:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE);
case 4:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_PALETTEMODE);
case 7:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_PRIORITY);
case 5:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_MOSAIC);
case 6:
return GetBgControlAttribute(bg, BG_CTRL_ATTR_WRAPAROUND);
case 8:
switch (GetBgType(bg))
{
case 0:
return GetBgMetricTextMode(bg, 0) * 0x800;
case 1:
return GetBgMetricAffineMode(bg, 0) * 0x100;
default:
return 0;
}
case 9:
return GetBgType(bg);
case 10:
return sGpuBgConfigs2[bg].baseTile;
default:
return -1;
}
}
@ -553,58 +553,58 @@ u32 ChangeBgX(u8 bg, u32 value, u8 op)
switch (op)
{
case 0:
default:
sGpuBgConfigs2[bg].bg_x = value;
break;
case 1:
sGpuBgConfigs2[bg].bg_x += value;
break;
case 2:
sGpuBgConfigs2[bg].bg_x -= value;
break;
case 0:
default:
sGpuBgConfigs2[bg].bg_x = value;
break;
case 1:
sGpuBgConfigs2[bg].bg_x += value;
break;
case 2:
sGpuBgConfigs2[bg].bg_x -= value;
break;
}
mode = GetBgMode();
switch (bg)
{
case 0:
temp1 = sGpuBgConfigs2[0].bg_x >> 0x8;
SetGpuReg(REG_OFFSET_BG0HOFS, temp1);
break;
case 1:
temp1 = sGpuBgConfigs2[1].bg_x >> 0x8;
SetGpuReg(REG_OFFSET_BG1HOFS, temp1);
break;
case 2:
if (mode == 0)
{
temp1 = sGpuBgConfigs2[2].bg_x >> 0x8;
SetGpuReg(REG_OFFSET_BG2HOFS, temp1);
}
else
{
temp1 = sGpuBgConfigs2[2].bg_x >> 0x10;
temp2 = sGpuBgConfigs2[2].bg_x & 0xFFFF;
SetGpuReg(REG_OFFSET_BG2X_H, temp1);
SetGpuReg(REG_OFFSET_BG2X_L, temp2);
}
break;
case 3:
if (mode == 0)
{
temp1 = sGpuBgConfigs2[3].bg_x >> 0x8;
SetGpuReg(REG_OFFSET_BG3HOFS, temp1);
}
else if (mode == 2)
{
temp1 = sGpuBgConfigs2[3].bg_x >> 0x10;
temp2 = sGpuBgConfigs2[3].bg_x & 0xFFFF;
SetGpuReg(REG_OFFSET_BG3X_H, temp1);
SetGpuReg(REG_OFFSET_BG3X_L, temp2);
}
break;
case 0:
temp1 = sGpuBgConfigs2[0].bg_x >> 0x8;
SetGpuReg(REG_OFFSET_BG0HOFS, temp1);
break;
case 1:
temp1 = sGpuBgConfigs2[1].bg_x >> 0x8;
SetGpuReg(REG_OFFSET_BG1HOFS, temp1);
break;
case 2:
if (mode == 0)
{
temp1 = sGpuBgConfigs2[2].bg_x >> 0x8;
SetGpuReg(REG_OFFSET_BG2HOFS, temp1);
}
else
{
temp1 = sGpuBgConfigs2[2].bg_x >> 0x10;
temp2 = sGpuBgConfigs2[2].bg_x & 0xFFFF;
SetGpuReg(REG_OFFSET_BG2X_H, temp1);
SetGpuReg(REG_OFFSET_BG2X_L, temp2);
}
break;
case 3:
if (mode == 0)
{
temp1 = sGpuBgConfigs2[3].bg_x >> 0x8;
SetGpuReg(REG_OFFSET_BG3HOFS, temp1);
}
else if (mode == 2)
{
temp1 = sGpuBgConfigs2[3].bg_x >> 0x10;
temp2 = sGpuBgConfigs2[3].bg_x & 0xFFFF;
SetGpuReg(REG_OFFSET_BG3X_H, temp1);
SetGpuReg(REG_OFFSET_BG3X_L, temp2);
}
break;
}
return sGpuBgConfigs2[bg].bg_x;
@ -617,7 +617,7 @@ u32 GetBgX(u8 bg)
else if (GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE) == 0)
return -1;
else
return sGpuBgConfigs2[bg].bg_x;
return sGpuBgConfigs2[bg].bg_x;
}
u32 ChangeBgY(u8 bg, u32 value, u8 op)
@ -633,58 +633,58 @@ u32 ChangeBgY(u8 bg, u32 value, u8 op)
switch (op)
{
case 0:
default:
sGpuBgConfigs2[bg].bg_y = value;
break;
case 1:
sGpuBgConfigs2[bg].bg_y += value;
break;
case 2:
sGpuBgConfigs2[bg].bg_y -= value;
break;
case 0:
default:
sGpuBgConfigs2[bg].bg_y = value;
break;
case 1:
sGpuBgConfigs2[bg].bg_y += value;
break;
case 2:
sGpuBgConfigs2[bg].bg_y -= value;
break;
}
mode = GetBgMode();
switch (bg)
{
case 0:
temp1 = sGpuBgConfigs2[0].bg_y >> 0x8;
SetGpuReg(REG_OFFSET_BG0VOFS, temp1);
break;
case 1:
temp1 = sGpuBgConfigs2[1].bg_y >> 0x8;
SetGpuReg(REG_OFFSET_BG1VOFS, temp1);
break;
case 2:
if (mode == 0)
{
temp1 = sGpuBgConfigs2[2].bg_y >> 0x8;
SetGpuReg(REG_OFFSET_BG2VOFS, temp1);
}
else
{
temp1 = sGpuBgConfigs2[2].bg_y >> 0x10;
temp2 = sGpuBgConfigs2[2].bg_y & 0xFFFF;
SetGpuReg(REG_OFFSET_BG2Y_H, temp1);
SetGpuReg(REG_OFFSET_BG2Y_L, temp2);
}
break;
case 3:
if (mode == 0)
{
temp1 = sGpuBgConfigs2[3].bg_y >> 0x8;
SetGpuReg(REG_OFFSET_BG3VOFS, temp1);
}
else if (mode == 2)
{
temp1 = sGpuBgConfigs2[3].bg_y >> 0x10;
temp2 = sGpuBgConfigs2[3].bg_y & 0xFFFF;
SetGpuReg(REG_OFFSET_BG3Y_H, temp1);
SetGpuReg(REG_OFFSET_BG3Y_L, temp2);
}
break;
case 0:
temp1 = sGpuBgConfigs2[0].bg_y >> 0x8;
SetGpuReg(REG_OFFSET_BG0VOFS, temp1);
break;
case 1:
temp1 = sGpuBgConfigs2[1].bg_y >> 0x8;
SetGpuReg(REG_OFFSET_BG1VOFS, temp1);
break;
case 2:
if (mode == 0)
{
temp1 = sGpuBgConfigs2[2].bg_y >> 0x8;
SetGpuReg(REG_OFFSET_BG2VOFS, temp1);
}
else
{
temp1 = sGpuBgConfigs2[2].bg_y >> 0x10;
temp2 = sGpuBgConfigs2[2].bg_y & 0xFFFF;
SetGpuReg(REG_OFFSET_BG2Y_H, temp1);
SetGpuReg(REG_OFFSET_BG2Y_L, temp2);
}
break;
case 3:
if (mode == 0)
{
temp1 = sGpuBgConfigs2[3].bg_y >> 0x8;
SetGpuReg(REG_OFFSET_BG3VOFS, temp1);
}
else if (mode == 2)
{
temp1 = sGpuBgConfigs2[3].bg_y >> 0x10;
temp2 = sGpuBgConfigs2[3].bg_y & 0xFFFF;
SetGpuReg(REG_OFFSET_BG3Y_H, temp1);
SetGpuReg(REG_OFFSET_BG3Y_L, temp2);
}
break;
}
return sGpuBgConfigs2[bg].bg_y;
@ -703,59 +703,59 @@ u32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op)
switch (op)
{
case 0:
default:
sGpuBgConfigs2[bg].bg_y = value;
break;
case 1:
sGpuBgConfigs2[bg].bg_y += value;
break;
case 2:
sGpuBgConfigs2[bg].bg_y -= value;
break;
case 0:
default:
sGpuBgConfigs2[bg].bg_y = value;
break;
case 1:
sGpuBgConfigs2[bg].bg_y += value;
break;
case 2:
sGpuBgConfigs2[bg].bg_y -= value;
break;
}
mode = GetBgMode();
switch (bg)
{
case 0:
temp1 = sGpuBgConfigs2[0].bg_y >> 0x8;
SetGpuReg_ForcedBlank(REG_OFFSET_BG0VOFS, temp1);
break;
case 1:
temp1 = sGpuBgConfigs2[1].bg_y >> 0x8;
SetGpuReg_ForcedBlank(REG_OFFSET_BG1VOFS, temp1);
break;
case 2:
if (mode == 0)
{
temp1 = sGpuBgConfigs2[2].bg_y >> 0x8;
SetGpuReg_ForcedBlank(REG_OFFSET_BG2VOFS, temp1);
case 0:
temp1 = sGpuBgConfigs2[0].bg_y >> 0x8;
SetGpuReg_ForcedBlank(REG_OFFSET_BG0VOFS, temp1);
break;
case 1:
temp1 = sGpuBgConfigs2[1].bg_y >> 0x8;
SetGpuReg_ForcedBlank(REG_OFFSET_BG1VOFS, temp1);
break;
case 2:
if (mode == 0)
{
temp1 = sGpuBgConfigs2[2].bg_y >> 0x8;
SetGpuReg_ForcedBlank(REG_OFFSET_BG2VOFS, temp1);
}
else
{
temp1 = sGpuBgConfigs2[2].bg_y >> 0x10;
temp2 = sGpuBgConfigs2[2].bg_y & 0xFFFF;
SetGpuReg_ForcedBlank(REG_OFFSET_BG2Y_H, temp1);
SetGpuReg_ForcedBlank(REG_OFFSET_BG2Y_L, temp2);
}
break;
case 3:
if (mode == 0)
{
temp1 = sGpuBgConfigs2[3].bg_y >> 0x8;
SetGpuReg_ForcedBlank(REG_OFFSET_BG3VOFS, temp1);
}
else if (mode == 2)
{
temp1 = sGpuBgConfigs2[3].bg_y >> 0x10;
temp2 = sGpuBgConfigs2[3].bg_y & 0xFFFF;
SetGpuReg_ForcedBlank(REG_OFFSET_BG3Y_H, temp1);
SetGpuReg_ForcedBlank(REG_OFFSET_BG3Y_L, temp2);
}
break;
}
else
{
temp1 = sGpuBgConfigs2[2].bg_y >> 0x10;
temp2 = sGpuBgConfigs2[2].bg_y & 0xFFFF;
SetGpuReg_ForcedBlank(REG_OFFSET_BG2Y_H, temp1);
SetGpuReg_ForcedBlank(REG_OFFSET_BG2Y_L, temp2);
}
break;
case 3:
if (mode == 0)
{
temp1 = sGpuBgConfigs2[3].bg_y >> 0x8;
SetGpuReg_ForcedBlank(REG_OFFSET_BG3VOFS, temp1);
}
else if (mode == 2)
{
temp1 = sGpuBgConfigs2[3].bg_y >> 0x10;
temp2 = sGpuBgConfigs2[3].bg_y & 0xFFFF;
SetGpuReg_ForcedBlank(REG_OFFSET_BG3Y_H, temp1);
SetGpuReg_ForcedBlank(REG_OFFSET_BG3Y_L, temp2);
}
break;
}
return sGpuBgConfigs2[bg].bg_y;
@ -768,7 +768,7 @@ u32 GetBgY(u8 bg)
else if (GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE) == 0)
return -1;
else
return sGpuBgConfigs2[bg].bg_y;
return sGpuBgConfigs2[bg].bg_y;
}
void SetBgAffine(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle)
@ -790,57 +790,57 @@ u8 Unused_AdjustBgMosaic(u8 a1, u8 a2)
switch (a2)
{
case 0:
default:
test1 = a1 & 0xF;
test2 = a1 >> 0x4;
break;
case 1:
test1 = a1 & 0xF;
break;
case 2:
if ((test1 + a1) > 0xF)
{
test1 = 0xF;
}
else
{
test1 += a1;
}
break;
case 3:
if ((test1 - a1) < 0)
{
test1 = 0x0;
}
else
{
test1 -= a1;
}
break;
case 4:
test2 = a1 & 0xF;
break;
case 5:
if ((test2 + a1) > 0xF)
{
test2 = 0xF;
}
else
{
test2 += a1;
}
break;
case 6:
if ((test2 - a1) < 0)
{
test2 = 0x0;
}
else
{
test2 -= a1;
}
break;
case 0:
default:
test1 = a1 & 0xF;
test2 = a1 >> 0x4;
break;
case 1:
test1 = a1 & 0xF;
break;
case 2:
if ((test1 + a1) > 0xF)
{
test1 = 0xF;
}
else
{
test1 += a1;
}
break;
case 3:
if ((test1 - a1) < 0)
{
test1 = 0x0;
}
else
{
test1 -= a1;
}
break;
case 4:
test2 = a1 & 0xF;
break;
case 5:
if ((test2 + a1) > 0xF)
{
test2 = 0xF;
}
else
{
test2 += a1;
}
break;
case 6:
if ((test2 - a1) < 0)
{
test2 = 0x0;
}
else
{
test2 -= a1;
}
break;
}
result |= ((test2 << 0x4) & 0xF0);
@ -874,7 +874,7 @@ void* GetBgTilemapBuffer(u8 bg)
else if (GetBgControlAttribute(bg, BG_CTRL_ATTR_VISIBLE) == 0)
return NULL;
else
return sGpuBgConfigs2[bg].tilemap;
return sGpuBgConfigs2[bg].tilemap;
}
void CopyToBgTilemapBuffer(u8 bg, const void *src, u16 mode, u16 destOffset)
@ -896,15 +896,15 @@ void CopyBgTilemapBufferToVram(u8 bg)
{
switch (GetBgType(bg))
{
case 0:
sizeToLoad = GetBgMetricTextMode(bg, 0) * 0x800;
break;
case 1:
sizeToLoad = GetBgMetricAffineMode(bg, 0) * 0x100;
break;
default:
sizeToLoad = 0;
break;
case 0:
sizeToLoad = GetBgMetricTextMode(bg, 0) * 0x800;
break;
case 1:
sizeToLoad = GetBgMetricAffineMode(bg, 0) * 0x100;
break;
default:
sizeToLoad = 0;
break;
}
LoadBgVram(bg, sGpuBgConfigs2[bg].tilemap, sizeToLoad, 0, 2);
}
@ -921,27 +921,27 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi
{
switch (GetBgType(bg))
{
case 0:
srcCopy = src;
for (destY16 = destY; destY16 < (destY + height); destY16++)
{
for (destX16 = destX; destX16 < (destX + width); destX16++)
{
((u16*)sGpuBgConfigs2[bg].tilemap)[((destY16 * 0x20) + destX16)] = *((u16*)srcCopy)++;
}
}
break;
case 1:
srcCopy = src;
mode = GetBgMetricAffineMode(bg, 0x1);
for (destY16 = destY; destY16 < (destY + height); destY16++)
{
for (destX16 = destX; destX16 < (destX + width); destX16++)
{
((u8*)sGpuBgConfigs2[bg].tilemap)[((destY16 * mode) + destX16)] = *((u8*)srcCopy)++;
}
}
break;
case 0:
srcCopy = src;
for (destY16 = destY; destY16 < (destY + height); destY16++)
{
for (destX16 = destX; destX16 < (destX + width); destX16++)
{
((u16*)sGpuBgConfigs2[bg].tilemap)[((destY16 * 0x20) + destX16)] = *((u16*)srcCopy)++;
}
}
break;
case 1:
srcCopy = src;
mode = GetBgMetricAffineMode(bg, 0x1);
for (destY16 = destY; destY16 < (destY + height); destY16++)
{
for (destX16 = destX; destX16 < (destX + width); destX16++)
{
((u8*)sGpuBgConfigs2[bg].tilemap)[((destY16 * mode) + destX16)] = *((u8*)srcCopy)++;
}
}
break;
}
}
}

View File

@ -3073,134 +3073,134 @@ NAKED
u8 sub_80B8F98(void)
{
asm_unified("push {r4-r7,lr}\n\
mov r7, r8\n\
push {r7}\n\
ldr r0, =gFieldEffectObjectTemplatePointers\n\
adds r0, 0x90\n\
ldr r0, [r0]\n\
movs r2, 0x18\n\
negs r2, r2\n\
movs r1, 0x78\n\
movs r3, 0x1\n\
bl CreateSprite\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r8, r0\n\
lsls r1, r0, 4\n\
add r1, r8\n\
lsls r1, 2\n\
ldr r0, =gSprites\n\
adds r1, r0\n\
ldrb r2, [r1, 0x5]\n\
movs r0, 0xD\n\
negs r0, r0\n\
ands r0, r2\n\
movs r2, 0x4\n\
orrs r0, r2\n\
movs r2, 0xF\n\
ands r0, r2\n\
movs r2, 0x40\n\
orrs r0, r2\n\
strb r0, [r1, 0x5]\n\
movs r2, 0\n\
strh r2, [r1, 0x2E]\n\
strh r2, [r1, 0x30]\n\
strh r2, [r1, 0x32]\n\
ldr r0, =0x0000ffff\n\
strh r0, [r1, 0x34]\n\
ldrh r0, [r1, 0x22]\n\
strh r0, [r1, 0x36]\n\
strh r2, [r1, 0x38]\n\
ldr r1, =0x00003e41\n\
movs r0, 0x50\n\
bl SetGpuReg\n\
ldr r1, =0x00000e0e\n\
movs r0, 0x52\n\
bl SetGpuReg\n\
ldr r1, =0x00003f3f\n\
movs r0, 0x48\n\
bl SetGpuReg\n\
ldr r0, =gUnknown_0855B610\n\
movs r1, 0xC0\n\
movs r2, 0x20\n\
bl LoadPalette\n\
movs r0, 0x12\n\
movs r1, 0x78\n\
bl SetGpuReg\n\
movs r4, 0x3\n\
ldr r7, =0x0600f800\n\
ldr r0, =0x0000bff4\n\
adds r6, r0, 0\n\
mov r7, r8\n\
push {r7}\n\
ldr r0, =gFieldEffectObjectTemplatePointers\n\
adds r0, 0x90\n\
ldr r0, [r0]\n\
movs r2, 0x18\n\
negs r2, r2\n\
movs r1, 0x78\n\
movs r3, 0x1\n\
bl CreateSprite\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r8, r0\n\
lsls r1, r0, 4\n\
add r1, r8\n\
lsls r1, 2\n\
ldr r0, =gSprites\n\
adds r1, r0\n\
ldrb r2, [r1, 0x5]\n\
movs r0, 0xD\n\
negs r0, r0\n\
ands r0, r2\n\
movs r2, 0x4\n\
orrs r0, r2\n\
movs r2, 0xF\n\
ands r0, r2\n\
movs r2, 0x40\n\
orrs r0, r2\n\
strb r0, [r1, 0x5]\n\
movs r2, 0\n\
strh r2, [r1, 0x2E]\n\
strh r2, [r1, 0x30]\n\
strh r2, [r1, 0x32]\n\
ldr r0, =0x0000ffff\n\
strh r0, [r1, 0x34]\n\
ldrh r0, [r1, 0x22]\n\
strh r0, [r1, 0x36]\n\
strh r2, [r1, 0x38]\n\
ldr r1, =0x00003e41\n\
movs r0, 0x50\n\
bl SetGpuReg\n\
ldr r1, =0x00000e0e\n\
movs r0, 0x52\n\
bl SetGpuReg\n\
ldr r1, =0x00003f3f\n\
movs r0, 0x48\n\
bl SetGpuReg\n\
ldr r0, =gUnknown_0855B610\n\
movs r1, 0xC0\n\
movs r2, 0x20\n\
bl LoadPalette\n\
movs r0, 0x12\n\
movs r1, 0x78\n\
bl SetGpuReg\n\
movs r4, 0x3\n\
ldr r7, =0x0600f800\n\
ldr r0, =0x0000bff4\n\
adds r6, r0, 0\n\
_080B901A:\n\
movs r2, 0xC\n\
lsls r0, r4, 1\n\
lsls r5, r4, 5\n\
adds r0, r4\n\
lsls r3, r0, 1\n\
movs r2, 0xC\n\
lsls r0, r4, 1\n\
lsls r5, r4, 5\n\
adds r0, r4\n\
lsls r3, r0, 1\n\
_080B9024:\n\
adds r0, r5, r2\n\
lsls r0, 1\n\
adds r0, r7\n\
adds r1, r2, r6\n\
adds r1, r3, r1\n\
adds r1, 0x1\n\
strh r1, [r0]\n\
adds r0, r2, 0x1\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
cmp r2, 0x11\n\
bls _080B9024\n\
adds r0, r4, 0x1\n\
lsls r0, 24\n\
lsrs r4, r0, 24\n\
cmp r4, 0xE\n\
bls _080B901A\n\
movs r0, 0\n\
ldr r5, =gUnknown_0855B630\n\
adds r0, r5, r2\n\
lsls r0, 1\n\
adds r0, r7\n\
adds r1, r2, r6\n\
adds r1, r3, r1\n\
adds r1, 0x1\n\
strh r1, [r0]\n\
adds r0, r2, 0x1\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
cmp r2, 0x11\n\
bls _080B9024\n\
adds r0, r4, 0x1\n\
lsls r0, 24\n\
lsrs r4, r0, 24\n\
cmp r4, 0xE\n\
bls _080B901A\n\
movs r0, 0\n\
ldr r5, =gUnknown_0855B630\n\
_080B904A:\n\
movs r4, 0\n\
adds r7, r0, 0x1\n\
lsls r6, r0, 5\n\
movs r4, 0\n\
adds r7, r0, 0x1\n\
lsls r6, r0, 5\n\
_080B9050:\n\
lsls r1, r4, 2\n\
adds r1, r6, r1\n\
ldr r0, =0x06008020\n\
adds r3, r1, r0\n\
adds r0, r1, 0x1\n\
adds r0, r5\n\
ldrb r2, [r0]\n\
lsls r2, 8\n\
adds r0, r1, r5\n\
ldrb r0, [r0]\n\
adds r0, r2\n\
strh r0, [r3]\n\
ldr r0, =0x06008022\n\
adds r3, r1, r0\n\
adds r0, r1, 0x3\n\
adds r0, r5\n\
ldrb r2, [r0]\n\
lsls r2, 8\n\
adds r1, 0x2\n\
adds r1, r5\n\
ldrb r0, [r1]\n\
adds r0, r2\n\
strh r0, [r3]\n\
adds r0, r4, 0x1\n\
lsls r0, 24\n\
lsrs r4, r0, 24\n\
cmp r4, 0x7\n\
bls _080B9050\n\
lsls r0, r7, 24\n\
lsrs r0, 24\n\
cmp r0, 0x59\n\
bls _080B904A\n\
mov r0, r8\n\
pop {r3}\n\
mov r8, r3\n\
pop {r4-r7}\n\
pop {r1}\n\
bx r1\n\
.pool");
lsls r1, r4, 2\n\
adds r1, r6, r1\n\
ldr r0, =0x06008020\n\
adds r3, r1, r0\n\
adds r0, r1, 0x1\n\
adds r0, r5\n\
ldrb r2, [r0]\n\
lsls r2, 8\n\
adds r0, r1, r5\n\
ldrb r0, [r0]\n\
adds r0, r2\n\
strh r0, [r3]\n\
ldr r0, =0x06008022\n\
adds r3, r1, r0\n\
adds r0, r1, 0x3\n\
adds r0, r5\n\
ldrb r2, [r0]\n\
lsls r2, 8\n\
adds r1, 0x2\n\
adds r1, r5\n\
ldrb r0, [r1]\n\
adds r0, r2\n\
strh r0, [r3]\n\
adds r0, r4, 0x1\n\
lsls r0, 24\n\
lsrs r4, r0, 24\n\
cmp r4, 0x7\n\
bls _080B9050\n\
lsls r0, r7, 24\n\
lsrs r0, 24\n\
cmp r0, 0x59\n\
bls _080B904A\n\
mov r0, r8\n\
pop {r3}\n\
mov r8, r3\n\
pop {r4-r7}\n\
pop {r1}\n\
bx r1\n\
.pool");
}
#endif // NONMATCHING

View File

@ -1595,102 +1595,102 @@ static void sub_81561FC(struct Sprite *sprite /*r6*/, u8 z, u8 offset)
NAKED void sub_81561FC(struct Sprite *sprite /*r6*/, u8 z, u8 offset)
{
asm_unified("push {r4-r7,lr}\n\
adds r6, r0, 0\n\
adds r0, r1, 0\n\
lsls r0, 24\n\
lsrs r0, 24\n\
lsls r2, 24\n\
lsrs r2, 24\n\
adds r1, r6, 0\n\
bl SetObjectSubpriorityByZCoord\n\
movs r7, 0\n\
adds r6, r0, 0\n\
adds r0, r1, 0\n\
lsls r0, 24\n\
lsrs r0, 24\n\
lsls r2, 24\n\
lsrs r2, 24\n\
adds r1, r6, 0\n\
bl SetObjectSubpriorityByZCoord\n\
movs r7, 0\n\
_08156212:\n\
lsls r0, r7, 3\n\
adds r0, r7\n\
lsls r0, 2\n\
ldr r1, =gEventObjects\n\
adds r4, r0, r1\n\
ldrb r0, [r4]\n\
lsls r0, 31\n\
cmp r0, 0\n\
beq _081562B4\n\
ldrb r0, [r4, 0x5]\n\
bl GetEventObjectGraphicsInfo\n\
ldrb r1, [r4, 0x4]\n\
lsls r0, r1, 4\n\
adds r0, r1\n\
lsls r0, 2\n\
ldr r1, =gSprites\n\
adds r5, r0, r1\n\
adds r0, r6, 0\n\
adds r0, 0x28\n\
movs r2, 0\n\
ldrsb r2, [r0, r2]\n\
ldrh r0, [r6, 0x20]\n\
adds r1, r0, r2\n\
subs r0, r2\n\
lsls r0, 16\n\
lsrs r4, r0, 16\n\
lsls r1, 16\n\
asrs r1, 16\n\
movs r0, 0x20\n\
ldrsh r2, [r5, r0]\n\
cmp r1, r2\n\
bge _081562B4\n\
lsls r0, r4, 16\n\
asrs r0, 16\n\
cmp r0, r2\n\
ble _081562B4\n\
adds r0, r5, 0\n\
adds r0, 0x29\n\
movs r3, 0\n\
ldrsb r3, [r0, r3]\n\
ldrh r2, [r5, 0x22]\n\
adds r2, r3\n\
ldrh r4, [r5, 0x22]\n\
adds r0, r6, 0\n\
adds r0, 0x29\n\
movs r1, 0\n\
ldrsb r1, [r0, r1]\n\
ldrh r0, [r6, 0x22]\n\
subs r0, r1\n\
lsls r0, 16\n\
asrs r0, 16\n\
adds r3, r0, r3\n\
lsls r2, 16\n\
asrs r2, 16\n\
lsls r3, 16\n\
asrs r3, 16\n\
cmp r2, r3\n\
blt _0815628C\n\
cmp r2, r0\n\
bge _081562B4\n\
lsls r0, r7, 3\n\
adds r0, r7\n\
lsls r0, 2\n\
ldr r1, =gEventObjects\n\
adds r4, r0, r1\n\
ldrb r0, [r4]\n\
lsls r0, 31\n\
cmp r0, 0\n\
beq _081562B4\n\
ldrb r0, [r4, 0x5]\n\
bl GetEventObjectGraphicsInfo\n\
ldrb r1, [r4, 0x4]\n\
lsls r0, r1, 4\n\
adds r0, r1\n\
lsls r0, 2\n\
ldr r1, =gSprites\n\
adds r5, r0, r1\n\
adds r0, r6, 0\n\
adds r0, 0x28\n\
movs r2, 0\n\
ldrsb r2, [r0, r2]\n\
ldrh r0, [r6, 0x20]\n\
adds r1, r0, r2\n\
subs r0, r2\n\
lsls r0, 16\n\
lsrs r4, r0, 16\n\
lsls r1, 16\n\
asrs r1, 16\n\
movs r0, 0x20\n\
ldrsh r2, [r5, r0]\n\
cmp r1, r2\n\
bge _081562B4\n\
lsls r0, r4, 16\n\
asrs r0, 16\n\
cmp r0, r2\n\
ble _081562B4\n\
adds r0, r5, 0\n\
adds r0, 0x29\n\
movs r3, 0\n\
ldrsb r3, [r0, r3]\n\
ldrh r2, [r5, 0x22]\n\
adds r2, r3\n\
ldrh r4, [r5, 0x22]\n\
adds r0, r6, 0\n\
adds r0, 0x29\n\
movs r1, 0\n\
ldrsb r1, [r0, r1]\n\
ldrh r0, [r6, 0x22]\n\
subs r0, r1\n\
lsls r0, 16\n\
asrs r0, 16\n\
adds r3, r0, r3\n\
lsls r2, 16\n\
asrs r2, 16\n\
lsls r3, 16\n\
asrs r3, 16\n\
cmp r2, r3\n\
blt _0815628C\n\
cmp r2, r0\n\
bge _081562B4\n\
_0815628C:\n\
lsls r0, r4, 16\n\
asrs r0, 16\n\
cmp r0, r3\n\
ble _081562B4\n\
adds r2, r6, 0\n\
adds r2, 0x43\n\
adds r0, r5, 0\n\
adds r0, 0x43\n\
ldrb r1, [r0]\n\
ldrb r0, [r2]\n\
cmp r0, r1\n\
bhi _081562B4\n\
adds r0, r1, 0x2\n\
strb r0, [r2]\n\
b _081562BE\n\
.pool\n\
lsls r0, r4, 16\n\
asrs r0, 16\n\
cmp r0, r3\n\
ble _081562B4\n\
adds r2, r6, 0\n\
adds r2, 0x43\n\
adds r0, r5, 0\n\
adds r0, 0x43\n\
ldrb r1, [r0]\n\
ldrb r0, [r2]\n\
cmp r0, r1\n\
bhi _081562B4\n\
adds r0, r1, 0x2\n\
strb r0, [r2]\n\
b _081562BE\n\
.pool\n\
_081562B4:\n\
adds r0, r7, 0x1\n\
lsls r0, 24\n\
lsrs r7, r0, 24\n\
cmp r7, 0xF\n\
bls _08156212\n\
adds r0, r7, 0x1\n\
lsls r0, 24\n\
lsrs r7, r0, 24\n\
cmp r7, 0xF\n\
bls _08156212\n\
_081562BE:\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0");
pop {r4-r7}\n\
pop {r0}\n\
bx r0");
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -260,8 +260,6 @@ u32 RenderFont(struct TextPrinter *textPrinter)
void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor)
{
u32 fg12, bg12, shadow12;
u32 fg8, bg8, shadow8;
u32 fg4, bg4, shadow4;
u32 temp;
u16 *current = gFontHalfRowLookupTable;
@ -274,148 +272,137 @@ void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor)
fg12 = fgColor << 12;
shadow12 = shadowColor << 12;
bg8 = bgColor << 8;
bg4 = bgColor << 4;
temp = (bg8) | (bg4) | bgColor;
temp = (bgColor << 8) | (bgColor << 4) | bgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
fg8 = fgColor << 8;
temp = (fg8) | (bg4) | bgColor;
temp = (fgColor << 8) | (bgColor << 4) | bgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
shadow8 = shadowColor << 8;
temp = (shadow8) | (bg4) | bgColor;
temp = (shadowColor << 8) | (bgColor << 4) | bgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
fg4 = fgColor << 4;
temp = (bg8) | (fg4) | bgColor;
temp = (bgColor << 8) | (fgColor << 4) | bgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (fg8) | (fg4) | bgColor;
temp = (fgColor << 8) | (fgColor << 4) | bgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (shadow8) | (fg4) | bgColor;
temp = (shadowColor << 8) | (fgColor << 4) | bgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
shadow4 = shadowColor << 4;
temp = (bg8) | (shadow4) | bgColor;
temp = (bgColor << 8) | (shadowColor << 4) | bgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (fg8) | (shadow4) | bgColor;
temp = (fgColor << 8) | (shadowColor << 4) | bgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (shadow8) | (shadow4) | bgColor;
temp = (shadowColor << 8) | (shadowColor << 4) | bgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (bg8) | (bg4) | fgColor;
temp = (bgColor << 8) | (bgColor << 4) | fgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (fg8) | (bg4) | fgColor;
temp = (fgColor << 8) | (bgColor << 4) | fgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (shadow8) | (bg4) | fgColor;
temp = (shadowColor << 8) | (bgColor << 4) | fgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (bg8) | (fg4) | fgColor;
temp = (bgColor << 8) | (fgColor << 4) | fgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (fg8) | (fg4) | fgColor;
temp = (fgColor << 8) | (fgColor << 4) | fgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (shadow8) | (fg4) | fgColor;
temp = (shadowColor << 8) | (fgColor << 4) | fgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (bg8) | (shadow4) | fgColor;
temp = (bgColor << 8) | (shadowColor << 4) | fgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (fg8) | (shadow4) | fgColor;
temp = (fgColor << 8) | (shadowColor << 4) | fgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (shadow8) | (shadow4) | fgColor;
temp = (shadowColor << 8) | (shadowColor << 4) | fgColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (bg8) | (bg4) | shadowColor;
temp = (bgColor << 8) | (bgColor << 4) | shadowColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (fg8) | (bg4) | shadowColor;
temp = (fgColor << 8) | (bgColor << 4) | shadowColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (shadow8) | (bg4) | shadowColor;
temp = (shadowColor << 8) | (bgColor << 4) | shadowColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (bg8) | (fg4) | shadowColor;
temp = (bgColor << 8) | (fgColor << 4) | shadowColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (fg8) | (fg4) | shadowColor;
temp = (fgColor << 8) | (fgColor << 4) | shadowColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (shadow8) | (fg4) | shadowColor;
temp = (shadowColor << 8) | (fgColor << 4) | shadowColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (bg8) | (shadow4) | shadowColor;
temp = (bgColor << 8) | (shadowColor << 4) | shadowColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (fg8) | (shadow4) | shadowColor;
temp = (fgColor << 8) | (shadowColor << 4) | shadowColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;
temp = (shadow8) | (shadow4) | shadowColor;
temp = (shadowColor << 8) | (shadowColor << 4) | shadowColor;
*(current++) = (bg12) | temp;
*(current++) = (fg12) | temp;
*(current++) = (shadow12) | temp;