From 06ee3c12345d06aad15303394430b2f07e1bbf69 Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Fri, 4 Sep 2026 18:42:41 -0600 Subject: [PATCH] =?UTF-8?q?feat(phase-31):=20S79=20#8=20(1)=20=E2=80=94=20?= =?UTF-8?q?main:=20func=5F80015760=20(106=20ins)=20banked=20from=20a=20per?= =?UTF-8?q?muter=20ILS=20score-0=20winner=20(cycle=201)=20+=20plumbing:=20?= =?UTF-8?q?TU=20data=20spelling=20(u8=20*D=5F800A5E60),=20the=20callee's?= =?UTF-8?q?=20TU=20prototype=20with=20a=20(u16)=20call-site=20cast=20for?= =?UTF-8?q?=20the=20target's=20andi,=20the=20permuter's=20typedef=20preamb?= =?UTF-8?q?le=20stripped;=20gate=5Fmain=20BYTE-IDENTICAL=20143dbb89=20?= =?UTF-8?q?=E2=80=94=20the=20S76=20journal=20had=20filed=20it=20as=20a=20'?= =?UTF-8?q?genuine=20sched1=20artifact'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/800.c | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/src/800.c b/src/800.c index 8f0539d0aa..16514661c1 100644 --- a/src/800.c +++ b/src/800.c @@ -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[];