Skip to content

Commit 1ef3572

Browse files
asmithbotzcanannclaude
authored
Grind main/menu_favo: FavoDraw name-index computed before posX/posY in nameFont loop (96.53% -> 96.70%) (#17665)
Ghidra 80162360 nameFont loop (lines 313-330): iVar8 (TableStrings name lookup, char(foodId)+0x17d) is materialized with the foodId sign-bias (xoris) emitted ahead of the entry->x/entry->y bias loads. Our source computed posY/posX before name, inverting that schedule. Moving the name lookup ahead matches the target's xoris/extsb order. Drops FavoDraw misalign 12->10. Co-authored-by: Zachary Canann <zacharycanann@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 3a718db commit 1ef3572

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/menu_favo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ void CMenuPcs::FavoDraw()
239239
for (int i = 0; i < 8; i++) {
240240
nameFont->SetColor(
241241
CColor(0xFF, 0xFF, 0xFF, static_cast<unsigned char>(255.0f * entry->alpha)).color);
242+
const char* name = Game.m_cFlatDataArr[1].TableStrings(0)[(static_cast<char>(rank->foodId) + 0x17D) * 5 + 4];
242243
float posY = static_cast<float>(entry->y + 0xB);
243244
float posX = static_cast<float>(entry->x + 0x1C);
244-
const char* name = Game.m_cFlatDataArr[1].TableStrings(0)[(static_cast<char>(rank->foodId) + 0x17D) * 5 + 4];
245245
nameFont->SetPosX(posX);
246246
nameFont->SetPosY(posY - 4.0f);
247247
nameFont->Draw(const_cast<char*>(name));

0 commit comments

Comments
 (0)