Decomp five more leftover single-function asm files

Fourth cleanup sweep; five more asm files and their includes removed:

  asm/overlay_29_0232B8E4.s   DoMoveCalmMind
  asm/overlay_29_0232D22C.s   DoMoveHammerArm
  asm/overlay_29_023495E8.s   IsDestinationFloorWithFleeingOutlaw
  asm/overlay_29_023492D4.s   IsLegendaryChallengeFloor
  asm/main_02030850.s         CloseAdvancedTextBox2

The two mission predicates merged into files that already declared
IsCurrentMissionType and IsCurrentMissionTypeExact with enum mission_type
parameters, so they use those declarations and the MISSION_* enumerators rather
than fresh externs with integer types. IsLegendaryChallengeFloor's floor check
is a byte subtraction written `+ 0xFF`, the same encoding DoMoveGust needed.

Both predicates only match written as a nested `if` that falls through to a
single return; the early-return spellings score 610 and 405.

CloseAdvancedTextBox2 uses the existing sub_0202836C, sub_0202812C, DeleteWindow
and MemFree declarations; only sub_020288DC needed a provisional extern.

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. None carries a
region conditional, so US alone is sufficient.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
cecilarmitais
2026-08-19 19:37:38 -07:00
parent 0587a6efcb
commit 901ba2aa8f
21 changed files with 71 additions and 148 deletions

View File

@@ -1,7 +0,0 @@
#pragma once
.public DeleteWindow
.public GetWindowContents
.public MemFree
.public sub_0202812C
.public sub_0202836C
.public sub_020288DC

View File

@@ -1,4 +0,0 @@
#pragma once
.public BoostDefensiveStat
.public BoostOffensiveStat
.public SPATK_STAT_IDX

View File

@@ -1,3 +0,0 @@
#pragma once
.public DealDamage
.public LowerSpeed

View File

@@ -1,3 +0,0 @@
#pragma once
.public DUNGEON_PTR
.public IsCurrentMissionType

View File

@@ -1,2 +0,0 @@
#pragma once
.public IsCurrentMissionTypeExact

View File

@@ -1,23 +0,0 @@
.include "asm/macros.inc"
.include "main_02030850.inc"
.text
arm_func_start CloseAdvancedTextBox2
CloseAdvancedTextBox2: ; 0x02030850
stmdb sp!, {r3, r4, r5, lr}
mov r5, r0
bl sub_0202836C
mov r0, r5
bl sub_020288DC
mov r0, r5
bl sub_0202812C
mov r0, r5
bl GetWindowContents
mov r4, r0
mov r0, r5
bl DeleteWindow
mov r0, r4
bl MemFree
ldmia sp!, {r3, r4, r5, pc}
arm_func_end CloseAdvancedTextBox2

View File

@@ -1,26 +0,0 @@
.include "asm/macros.inc"
.include "overlay_29_0232B8E4.inc"
.text
arm_func_start DoMoveCalmMind
DoMoveCalmMind: ; 0x0232B8E4
stmdb sp!, {r3, r4, r5, lr}
ldr r2, _0232B924 ; =SPATK_STAT_IDX
mov r3, #1
ldr r2, [r2]
mov r5, r0
mov r4, r1
str r2, [sp]
bl BoostOffensiveStat
add r1, sp, #0
ldr r2, [r1]
mov r0, r5
mov r1, r4
mov r3, #1
bl BoostDefensiveStat
mov r0, #1
ldmia sp!, {r3, r4, r5, pc}
.align 2, 0
_0232B924: .word SPATK_STAT_IDX
arm_func_end DoMoveCalmMind

View File

@@ -1,26 +0,0 @@
.include "asm/macros.inc"
.include "overlay_29_0232D22C.inc"
.text
arm_func_start DoMoveHammerArm
DoMoveHammerArm: ; 0x0232D22C
stmdb sp!, {r3, r4, lr}
sub sp, sp, #4
str r3, [sp]
mov r3, #0x100
mov r4, r0
bl DealDamage
cmp r0, #0
moveq r0, #0
beq _0232D268
mov r2, #1
mov r0, r4
mov r1, r4
mov r3, r2
bl LowerSpeed
mov r0, #1
_0232D268:
add sp, sp, #4
ldmia sp!, {r3, r4, pc}
arm_func_end DoMoveHammerArm

View File

@@ -1,26 +0,0 @@
.include "asm/macros.inc"
.include "overlay_29_023492D4.inc"
.text
arm_func_start IsLegendaryChallengeFloor
IsLegendaryChallengeFloor: ; 0x023492D4
stmdb sp!, {r3, lr}
mov r0, #0xb
bl IsCurrentMissionType
cmp r0, #0
beq _02349308
ldr r0, _02349310 ; =DUNGEON_PTR
ldr r0, [r0]
ldrb r0, [r0, #0x762]
add r0, r0, #0xff
and r0, r0, #0xff
cmp r0, #4
movls r0, #1
ldmlsia sp!, {r3, pc}
_02349308:
mov r0, #0
ldmia sp!, {r3, pc}
.align 2, 0
_02349310: .word DUNGEON_PTR
arm_func_end IsLegendaryChallengeFloor

View File

@@ -1,23 +0,0 @@
.include "asm/macros.inc"
.include "overlay_29_023495E8.inc"
.text
arm_func_start IsDestinationFloorWithFleeingOutlaw
IsDestinationFloorWithFleeingOutlaw: ; 0x023495E8
stmdb sp!, {r3, lr}
mov r0, #0xa
mov r1, #5
bl IsCurrentMissionTypeExact
cmp r0, #0
bne _02349618
mov r0, #9
mov r1, #2
bl IsCurrentMissionTypeExact
cmp r0, #0
moveq r0, #0
ldmeqia sp!, {r3, pc}
_02349618:
mov r0, #1
ldmia sp!, {r3, pc}
arm_func_end IsDestinationFloorWithFleeingOutlaw

View File

@@ -1,6 +1,9 @@
#ifndef PMDSKY_MAIN_0203083C_H
#define PMDSKY_MAIN_0203083C_H
#include "util.h"
void SetAdvancedTextBoxField0x1C2(s32 window_id);
void CloseAdvancedTextBox2(s32 window_id);
#endif

View File

@@ -1,10 +1,13 @@
#ifndef PMDSKY_OVERLAY_29_0232B8D4_H
#define PMDSKY_OVERLAY_29_0232B8D4_H
#include "util.h"
#include "dungeon_mode.h"
#include "item.h"
#include "move.h"
bool8 DoMoveMirrorCoat(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id);
bool8 DoMoveCalmMind(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id);
#endif

View File

@@ -1,6 +1,8 @@
#ifndef PMDSKY_OVERLAY_29_0232D1DC_H
#define PMDSKY_OVERLAY_29_0232D1DC_H
#include "util.h"
#include "dungeon_mode.h"
#include "item.h"
#include "move.h"
@@ -10,5 +12,6 @@ bool8 DoMoveMobile(struct entity* attacker, struct entity* defender, struct move
bool8 DoMoveSeeStairs(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id);
bool8 DoMoveLongToss(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id);
bool8 DoMovePierce(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id);
bool8 DoMoveHammerArm(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id);
#endif

View File

@@ -6,5 +6,6 @@
bool8 IsOutlawMonsterHouseFloor(void);
bool8 IsGoldenChamber(void);
bool8 IsLegendaryChallengeFloor(void);
#endif

View File

@@ -5,5 +5,6 @@
#include "util.h"
bool8 IsDestinationFloorWithHiddenOutlaw(void);
bool8 IsDestinationFloorWithFleeingOutlaw(void);
#endif

View File

@@ -193,7 +193,6 @@ Static main
Object src/main_020307A4.o
Object asm/main_020307B8.o
Object src/main_0203083C.o
Object asm/main_02030850.o
Object src/main_0203088C.o
Object asm/main_020308A0.o
Object src/main_02030A18.o
@@ -1122,7 +1121,6 @@ Overlay OVY_29
Object asm/overlay_29_0232B820.o
Object src/overlay_29_0232B8A0.o
Object src/overlay_29_0232B8D4.o
Object asm/overlay_29_0232B8E4.o
Object src/overlay_29_0232B928.o
Object asm/overlay_29_0232B940.o
Object src/overlay_29_0232BE34.o
@@ -1150,7 +1148,6 @@ Overlay OVY_29
Object src/overlay_29_0232CF74.o
Object asm/overlay_29_0232CF84.o
Object src/overlay_29_0232D1DC.o
Object asm/overlay_29_0232D22C.o
Object src/overlay_29_0232D270.o
Object asm/overlay_29_0232D298.o
Object src/overlay_29_0232D368.o
@@ -1237,13 +1234,11 @@ Overlay OVY_29
Object src/overlay_29_02349208.o
Object asm/overlay_29_0234921C.o
Object src/overlay_29_0234928C.o
Object asm/overlay_29_023492D4.o
Object src/overlay_29_02349314.o
Object asm/overlay_29_02349378.o
Object src/overlay_29_02349470.o
Object asm/overlay_29_023494CC.o
Object src/overlay_29_023495C4.o
Object asm/overlay_29_023495E8.o
Object src/overlay_29_02349620.o
Object src/overlay_29_02349688.o
Object src/overlay_29_023496D8.o

View File

@@ -1,4 +1,6 @@
#include "main_0203083C.h"
extern void sub_020288DC(s32 window_id);
#include "main_0202AAA8.h"
#include "main_02001188.h"
@@ -8,3 +10,15 @@ void SetAdvancedTextBoxField0x1C2(s32 window_id)
w->field_0x1C2 = 1;
}
void CloseAdvancedTextBox2(s32 window_id)
{
void *contents;
sub_0202836C(window_id);
sub_020288DC(window_id);
sub_0202812C(window_id);
contents = GetWindowContents(window_id);
DeleteWindow(window_id);
MemFree(contents);
}

View File

@@ -1,4 +1,7 @@
#include "overlay_29_0232B8D4.h"
#include "move_orb_effects.h"
extern const struct StatIndex SPATK_STAT_IDX;
extern void TryInflictMirrorCoatStatus(struct entity *user, struct entity *target);
@@ -8,3 +11,11 @@ bool8 DoMoveMirrorCoat(struct entity* attacker, struct entity* defender, struct
return TRUE;
}
bool8 DoMoveCalmMind(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id)
{
BoostOffensiveStat(attacker, defender, SPATK_STAT_IDX, 1);
BoostDefensiveStat(attacker, defender, SPATK_STAT_IDX, 1);
return TRUE;
}

View File

@@ -1,4 +1,7 @@
#include "overlay_29_0232D1DC.h"
#include "move_orb_effects.h"
extern s32 DealDamage(struct entity *attacker, struct entity *defender, struct move *move, s32 damageMultiplier, enum item_id item_id);
extern void TryInflictPierceStatus(struct entity *user, struct entity *target);
@@ -44,3 +47,14 @@ bool8 DoMovePierce(struct entity* attacker, struct entity* defender, struct move
return TRUE;
}
bool8 DoMoveHammerArm(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id)
{
if (DealDamage(attacker, defender, move, 0x100, item_id) == 0) {
return FALSE;
}
LowerSpeed(attacker, attacker, 1, TRUE);
return TRUE;
}

View File

@@ -1,4 +1,5 @@
#include "overlay_29_0234928C.h"
#include "dungeon.h"
#include "mission.h"
@@ -19,3 +20,14 @@ bool8 IsGoldenChamber(void)
{
return IsCurrentMissionTypeExact(MISSION_EXPLORE_WITH_CLIENT, 2) != 0;
}
bool8 IsLegendaryChallengeFloor(void)
{
if (IsCurrentMissionType(MISSION_CHALLENGE_REQUEST)) {
if ((u8) (DUNGEON_PTR->mission_destination.subtype + 0xFF) <= 4) {
return TRUE;
}
}
return FALSE;
}

View File

@@ -14,3 +14,12 @@ bool8 IsDestinationFloorWithHiddenOutlaw(void)
{
return IsCurrentMissionTypeExact(MISSION_TAKE_ITEM_FROM_OUTLAW, 1) != 0;
}
bool8 IsDestinationFloorWithFleeingOutlaw(void)
{
if (!IsCurrentMissionTypeExact(MISSION_ARREST_OUTLAW, 5) && !IsCurrentMissionTypeExact(MISSION_TAKE_ITEM_FROM_OUTLAW, 2)) {
return FALSE;
}
return TRUE;
}