mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-27 20:57:49 -05:00
The previous commit dropped eight functions whose only difference from the target was instruction order: retail loads the stat global before materialising the constant destined for the stack, the candidate after. The cause is aliasing. Declared as plain externs, MWCC must assume the stores to [sp] can affect the global, so the load cannot move above them. Declaring the globals const frees it, and all eight match: DoMoveGrowl, DoMoveLowerDefense1, DoMoveFeatherDance, DoMoveFakeTears, DoMoveMetalSound, DoMoveScreech, DoMoveCharm and DoMoveHealOrder. Also LogMessageQuiet and LogMessageWithPopup, which pass FALSE/TRUE to LogMessage. Every existing `extern struct StatIndex` in src/ is const-ified to match, since the globals cannot be const in one translation unit and not another. Thirteen files touched; the functions already landed against them still match, which is independent confirmation of the reading. DoMoveMetalSound lowers by 3 stages, not the 2 assumed when it was first written; the asm says `mov r3, #3`. Authored by Claude (Opus 5) under human direction. All ten verified at score 0. Confirmed by a matching build: build/pmdsky.us/pmdsky.us.nds: OK. None carries a region conditional, so US alone is sufficient. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
12 lines
373 B
C
12 lines
373 B
C
#ifndef PMDSKY_OVERLAY_29_0232A2AC_H
|
|
#define PMDSKY_OVERLAY_29_0232A2AC_H
|
|
|
|
#include "dungeon_mode.h"
|
|
#include "item.h"
|
|
#include "move.h"
|
|
|
|
bool8 DoMoveLowerDefense1(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id);
|
|
bool8 DoMoveWish(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id);
|
|
|
|
#endif
|