Files
pmd-sky/include/overlay_29_0232CD90.h
cecilarmitais 5ffad87a1b Decomp five leftover single-function asm files
Eleventh cleanup sweep. Five asm files and their includes removed:

  asm/main_0205B6CC.s         sub_0205B6CC
  asm/main_0202C75C.s         sub_0202C75C
  asm/overlay_29_0232CDA4.s   DoMoveOneShot
  asm/overlay_29_0232A078.s   DoMoveNightShade
  asm/overlay_29_023016D8.s   DisplayRunAwayIfTriggered

All five merged into an adjacent source rather than splitting one. None carries
a region conditional, so US alone verifies this commit.

sub_0205B6CC is a 64-bit unsigned >= 2 (cmp/cmpeq/movhs) on a value at offset
0xC. A u64 member sits there: MWCC aligns long long to 4, not 8. Rebuilding the
value from two u32s scores 200, and `> 1` in place of `>= 2` scores 310.

sub_0202C75C uses struct unk_0202C5E0, the collection-menu window struct its
neighbours already use; GetWindowIdSelectedMenuItemIdx immediately before it
already spells the same `GetWindowContents(window_id) + 4`. field_0x1AC[6]
covered 0x1B0/0x1B1 and is split into three members.

DoMoveOneShot and DoMoveNightShade are twins staging eleven arguments for
CalcDamageFixedWrapper, which had no declaration in the tree. The only obstacle
was the temporary holding GetMoveType's result: as enum type_id, -enum min sizes
it to a byte and emits an and #0xff the target lacks (950); as s32, 0.

DisplayRunAwayIfTriggered needs Min(999, max_hp), not Min(max_hp, 999) -- Min is
a static inline, so the argument order is not free (200). That exact expression
in that exact order already sat in the NONMATCHING block of AiMovement in
dungeon_ai_movement.c; the guess was right and had never been confirmed.

include/main_02042AF8.h's provisional `s32 sub_0202C75C(s8 a);` is retired in
favour of the real header. It was written from the one call site, which passes an
s8 field; the parameter is a window id.

A sixth was prepared and not landed: FixedPoint64ToInt (asm/main_02001CB0.s)
stands at 225. The target keeps an arithmetically redundant & 0xFFFF0000, and
whether MWCC folds it away is decided by which side of the | the masked term is
written on -- masked second folds it (735), masked first keeps it (225). Writing
it first is also what makes it evaluate first, and the target needs it preserved
but evaluated second; ten spellings found none that does both. Spelling it as a
real 64-bit shift scores 1020.

Authored by Claude (Opus 5) under human direction. All five verified at score 0.
Confirmed by a matching build: build/pmdsky.us/pmdsky.us.nds: OK.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 22:25:23 -07:00

14 lines
390 B
C

#ifndef PMDSKY_OVERLAY_29_0232CD90_H
#define PMDSKY_OVERLAY_29_0232CD90_H
#include "util.h"
#include "dungeon_mode.h"
#include "item.h"
#include "move.h"
bool8 DoMoveInvisify(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id);
bool8 DoMoveOneShot(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id);
#endif