mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-05 00:47:54 -04:00
feat(phase-31): S79 #8 (1) — main: func_80015760 (106 ins) banked from a permuter ILS score-0 winner (cycle 1) + plumbing: TU data spelling (u8 *D_800A5E60), the callee's TU prototype with a (u16) call-site cast for the target's andi, the permuter's typedef preamble stripped; gate_main BYTE-IDENTICAL 143dbb89 — the S76 journal had filed it as a 'genuine sched1 artifact'
This commit is contained in:
@@ -2725,7 +2725,106 @@ void func_80015498(void)
|
||||
|
||||
INCLUDE_ASM("asm/nonmatchings/800", func_80015608);
|
||||
|
||||
INCLUDE_ASM("asm/nonmatchings/800", func_80015760);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u16 unk0;
|
||||
u16 x;
|
||||
u16 y;
|
||||
u16 unk6;
|
||||
s32 value;
|
||||
u8 flags;
|
||||
} Obj_80015760;
|
||||
extern u16 D_800AF7BC;
|
||||
extern u16 D_800AF7BE;
|
||||
extern u8 *D_800A5E60;
|
||||
extern u8 D_80062B78[];
|
||||
extern u32 func_80015A74(u32 param_1);
|
||||
extern s16 *func_80015908(s32 a0, s32 a1);
|
||||
void func_80015760(Obj_80015760 *obj, s32 *ot)
|
||||
{
|
||||
s32 x0;
|
||||
register u32 tx __asm__("$5");
|
||||
s32 y0;
|
||||
s32 flags;
|
||||
u32 value;
|
||||
u32 digits;
|
||||
register s32 count __asm__("$2");
|
||||
u8 digitCount;
|
||||
u8 width;
|
||||
u32 tagHi;
|
||||
u32 color;
|
||||
u32 yWord;
|
||||
register u32 tagCode __asm__("$21");
|
||||
s32 *pkt;
|
||||
tx = obj->x;
|
||||
x0 = ((s32) tx) - (D_800AF7BC >> 1);
|
||||
flags = obj->flags;
|
||||
y0 = ((s32) obj->y) - (D_800AF7BE >> 1);
|
||||
value = (u32) obj->value;
|
||||
count = flags & 0xF;
|
||||
digitCount = count;
|
||||
if (count == 0)
|
||||
{
|
||||
digitCount = 8;
|
||||
}
|
||||
if (flags & 0x40)
|
||||
{
|
||||
digits = func_80015A74(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
digits = value;
|
||||
}
|
||||
width = 8;
|
||||
if (flags & 0x80)
|
||||
{
|
||||
y0++;
|
||||
y0--;
|
||||
width = 0x10;
|
||||
}
|
||||
tagHi = width;
|
||||
if (tagHi == 8)
|
||||
{
|
||||
tagHi = 0x74000000;
|
||||
}
|
||||
else
|
||||
{
|
||||
tagHi = 0x7C000000;
|
||||
}
|
||||
tagCode = 0x03000000;
|
||||
pkt = (s32 *) D_800A5E60;
|
||||
if (digitCount != 0)
|
||||
{
|
||||
color = tagHi | 0x00808080;
|
||||
yWord = (u32) (y0 << 16);
|
||||
do
|
||||
{
|
||||
u32 xLow;
|
||||
u32 idx;
|
||||
s32 tile;
|
||||
u16 *uvPtr;
|
||||
u32 uvc;
|
||||
register u32 mask __asm__("$3");
|
||||
xLow = (u16) x0;
|
||||
x0 = width + x0;
|
||||
idx = (digits >> ((digitCount - 1) << 2)) & 0xF;
|
||||
tile = D_80062B78[idx];
|
||||
pkt[1] = (s32) color;
|
||||
digitCount--;
|
||||
pkt[2] = (s32) (xLow | yWord);
|
||||
uvPtr = func_80015908(tile, (u16) flags); /* the caller's original prototype took u16: the target masks (andi) before the call */
|
||||
uvc = 0x40560000;
|
||||
pkt[3] = (s32) ((*uvPtr) | uvc);
|
||||
mask = 0x00FFFFFF;
|
||||
pkt[0] = (s32) (((*ot) & mask) | tagCode);
|
||||
*ot = (s32) (((u32) pkt) & mask);
|
||||
pkt += 4;
|
||||
}
|
||||
while (digitCount != 0);
|
||||
}
|
||||
D_800A5E60 = (u8 *) pkt;
|
||||
}
|
||||
|
||||
extern s16 D_80062A78[];
|
||||
extern s16 D_80062AF8[];
|
||||
|
||||
Reference in New Issue
Block a user