mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-27 12:47:39 -05:00
dae72255ffd3fe2cf28c2793100827019de3e9b6
Re-land eight already-matching functions in more idiomatic C. Every one was verified at score 0 in each region it has a target for BEFORE landing, and by a matching US build AFTER landing, one function at a time. CreateGridCellConnections 320 -> 278 eight (u32) index casts removed GenerateExtraHallways 170 -> 161 terrain_flags & 3 -> GetTerrainType ActivateEndOfTurnEffects 538 -> 533 MAX_HP_LIMIT for the 999 literals ApplyDamageAndEffects 316 -> 314 CalcDamage 635 -> 631 one volatile local dropped ApplyDamage 807 -> 818 ov11_022ED69C 242 -> 240 const void * -> typed pointers ov11_02307334 733 -> 735 three redundant (u8 *) casts dropped The CreateGridCellConnections index casts had been recorded as load-bearing. They are not. MWCC keys common-subexpression elimination on the address expression INCLUDING integer conversion nodes, so an `int` alias of an `s32` index splits the use-set exactly as a cast does, while a same-type copy is erased by copy propagation. An identity (s32) cast is byte-identical to the (u32) one, and casting every site is byte-identical to casting none, which is what shows the lever is the split rather than the cast. overlay_29_0233C9E8.c gains #include "dungeon.h" and "dungeon_util_static.h" for TERRAIN_TYPE_*, DUNGEON_MAX_SIZE_* and GetTerrainType. All three were already in the tree; no name is introduced here. Three candidate rephrasings were rejected on measurement and are not included: one scored 1195 in EUROPE against a landed baseline of 10, one carried an artificial `damage_data++; damage_data--;` pair, and one did not match at all. Authored by Claude (Opus 5) under human direction. Confirmed by a matching build after each individual change: build/pmdsky.us/pmdsky.us.nds: OK. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…
…
…
…
…
…
Pokémon Mystery Dungeon: Explorers of Sky
This is a WIP disassembly of Pokémon Mystery Dungeon: Explorers of Sky. For instructions on how to set up the repository, please read INSTALL.md. For information on how to contribute changes, see CONTRIBUTING.md.
This repository builds the following ROMs:
- pmdsky.us.nds
sha1: 5fa96ca8d8dd6405d6cd2bad73ed68bc73a9d152 - pmdsky.eu.nds
sha1: c838a5adf1ed32d2da8454976e5b1a1aa189c139 - pmdsky.jp.nds
sha1: 7785138dd343b6f2d0f2c9cadc26b4aa927161d7
For contacts and other pret projects, see pret.github.io.
Description
Languages
Assembly
66.3%
C
18%
C++
7.1%
Boogie
4.3%
sed
1.5%
Other
2.8%