mirror of
https://github.com/pret/pmd-sky.git
synced 2026-03-21 17:25:15 -05:00
Decomped IsChargingAnyTwoTurnMove
This commit is contained in:
parent
754717de9d
commit
3f53ea0f72
|
|
@ -1,76 +1,51 @@
|
|||
#pragma once
|
||||
.public _s32_div_f
|
||||
.public AbilityIsActiveVeneer
|
||||
.public AdvanceFrame
|
||||
.public AnimationDelayOrSomething
|
||||
.public AnimationHasMoreFrames
|
||||
.public ChangeMonsterAnimation
|
||||
.public DefenderAbilityIsActive__02322D64
|
||||
.public DETECT_BAND_MOVE_ACCURACY_DROP
|
||||
.public DIRECTIONS_XY
|
||||
.public DUNGEON_PTR
|
||||
.public DefenderAbilityIsActive__02322D64
|
||||
.public DungeonRandInt
|
||||
.public DungeonRandOutcome__022EAB50
|
||||
.public DungeonRandRange
|
||||
.public EntityIsValid__02321438
|
||||
.public EntityIsValid__02325620
|
||||
.public EXCL_ITEM_EFFECTS_EVASION_BOOST
|
||||
.public EntityIsValid__02321438
|
||||
.public ExclusiveItemEffectFlagTest
|
||||
.public ExecuteMoveEffect
|
||||
.public FormatMoveStringMore
|
||||
.public GetApparentWeather
|
||||
.public GetBodySize
|
||||
.public GetDamageSource
|
||||
.public GetEntityMoveTargetAndRange
|
||||
.public GetMonsterGenderVeneer
|
||||
.public GetMoveAccuracyOrAiChance
|
||||
.public GetMoveAnimation
|
||||
.public GetMoveAnimationId
|
||||
.public GetMoveAnimationSpeed
|
||||
.public GetMoveMaxGinsengBoost
|
||||
.public GetMoveNbStrikes
|
||||
.public GetNaturePowerVariant
|
||||
.public GetSpriteIndex__02052708
|
||||
.public GetTile
|
||||
.public GetTreatmentBetweenMonsters
|
||||
.public HasHeldItem
|
||||
.public IqSkillIsEnabled
|
||||
.public Is2TurnsMove
|
||||
.public IsAffectedByTaunt
|
||||
.public IsCopyingMove
|
||||
.public IsFloorOver
|
||||
.public LogMessageByIdWithPopupCheckUser
|
||||
.public LogMessageQuiet
|
||||
.public LogMessageWithPopup
|
||||
.public MALE_ACCURACY_STAGE_MULTIPLIERS
|
||||
.public MALE_EVASION_STAGE_MULTIPLIERS
|
||||
.public MoveIsNotPhysical
|
||||
.public NATURE_POWER_TABLE
|
||||
.public PlayMoveAnimation
|
||||
.public PositionHasMonster
|
||||
.public QUICK_DODGER_MOVE_ACCURACY_DROP
|
||||
.public ShouldDisplayEntityWrapper
|
||||
.public TWO_TURN_MOVES_AND_STATUSES
|
||||
.public TwoTurnMoveForcedMiss
|
||||
.public _s32_div_f
|
||||
.public ov10_022BDE50
|
||||
.public ov10_022BE9E8
|
||||
.public ov10_022BEB2C
|
||||
.public ov10_022BF01C
|
||||
.public ov10_022BF0F4
|
||||
.public ov10_022BF1FC
|
||||
.public ov10_022BFA3C
|
||||
.public ov10_022BFAA8
|
||||
.public ov10_022BFD58
|
||||
.public ov10_022BFD8C
|
||||
.public ov10_022BFDAC
|
||||
.public ov10_022BFDCC
|
||||
.public ov10_022BFDEC
|
||||
.public ov29_022DE5D8
|
||||
.public ov29_022DE5F0
|
||||
.public ov29_022E28D4
|
||||
.public ov29_022E2CA0
|
||||
.public ov29_022E3560
|
||||
.public ov29_022E56A0
|
||||
.public ov29_022E65A8
|
||||
.public ov29_022E6D68
|
||||
.public ov29_022EA370
|
||||
.public ov29_022EACCC
|
||||
.public ov29_022ED0C4
|
||||
.public ov29_022ED0D4
|
||||
.public ov29_022F87C0
|
||||
.public ov29_022F8830
|
||||
.public ov29_022F88C0
|
||||
|
|
@ -78,33 +53,18 @@
|
|||
.public ov29_0230040C
|
||||
.public ov29_023024E0
|
||||
.public ov29_02304A48
|
||||
.public ov29_02325644
|
||||
.public ov29_02325D20
|
||||
.public ov29_02325D7C
|
||||
.public ov29_02324D60
|
||||
.public ov29_02324E78
|
||||
.public ov29_023250D4
|
||||
.public ov29_0234B034
|
||||
.public ov29_0234B084
|
||||
.public ov29_0234B09C
|
||||
.public ov29_0234B4CC
|
||||
.public ov29_0235171E
|
||||
.public ov29_0235175C
|
||||
.public ov29_02352A54
|
||||
.public ov29_02352A60
|
||||
.public ov29_02352A6C
|
||||
.public ov29_02352A8C
|
||||
.public ov29_02352AD8
|
||||
.public ov29_02352B1C
|
||||
.public ov29_0235370C
|
||||
.public ov29_0237CA84
|
||||
.public PlayMoveAnimation
|
||||
.public PositionHasMonster
|
||||
.public QUICK_DODGER_MOVE_ACCURACY_DROP
|
||||
.public SetAndLoadCurrentAttackAnimation
|
||||
.public ShouldDisplayEntityAdvanced
|
||||
.public ShouldDisplayEntityWrapper
|
||||
.public ShouldMovePlayAlternativeAnimation
|
||||
.public sub_020018D0
|
||||
.public sub_02001980
|
||||
.public sub_0201CF90
|
||||
.public sub_0201D1D4
|
||||
.public TWO_TURN_MOVES_AND_STATUSES
|
||||
.public WanTableSpriteHasAnimationGroup
|
||||
|
|
|
|||
58
asm/include/overlay_29_02324698.inc
Normal file
58
asm/include/overlay_29_02324698.inc
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#pragma once
|
||||
.public AbilityIsActiveVeneer
|
||||
.public AdvanceFrame
|
||||
.public AnimationDelayOrSomething
|
||||
.public AnimationHasMoreFrames
|
||||
.public ChangeMonsterAnimation
|
||||
.public DUNGEON_PTR
|
||||
.public DefenderAbilityIsActive__02322D64
|
||||
.public DungeonRandInt
|
||||
.public DungeonRandOutcome__022EAB50
|
||||
.public EntityIsValid__02321438
|
||||
.public EntityIsValid__02325620
|
||||
.public GetApparentWeather
|
||||
.public GetDamageSource
|
||||
.public GetMoveAnimation
|
||||
.public GetMoveAnimationId
|
||||
.public GetMoveMaxGinsengBoost
|
||||
.public GetNaturePowerVariant
|
||||
.public GetSpriteIndex__02052708
|
||||
.public Is2TurnsMove
|
||||
.public IsAffectedByTaunt
|
||||
.public IsCopyingMove
|
||||
.public IsFloorOver
|
||||
.public LogMessageByIdWithPopupCheckUser
|
||||
.public NATURE_POWER_TABLE
|
||||
.public SetAndLoadCurrentAttackAnimation
|
||||
.public ShouldDisplayEntityAdvanced
|
||||
.public ShouldMovePlayAlternativeAnimation
|
||||
.public WanTableSpriteHasAnimationGroup
|
||||
.public ov10_022BF01C
|
||||
.public ov10_022BF0F4
|
||||
.public ov10_022BF1FC
|
||||
.public ov10_022BFA3C
|
||||
.public ov10_022BFAA8
|
||||
.public ov10_022BFD58
|
||||
.public ov10_022BFD8C
|
||||
.public ov10_022BFDCC
|
||||
.public ov10_022BFDEC
|
||||
.public ov29_022DE5D8
|
||||
.public ov29_022DE5F0
|
||||
.public ov29_022E3560
|
||||
.public ov29_022E56A0
|
||||
.public ov29_022E65A8
|
||||
.public ov29_022E6D68
|
||||
.public ov29_022EA370
|
||||
.public ov29_022EACCC
|
||||
.public ov29_022ED0C4
|
||||
.public ov29_022ED0D4
|
||||
.public ov29_02304A48
|
||||
.public ov29_02325644
|
||||
.public ov29_02325D20
|
||||
.public ov29_02325D7C
|
||||
.public ov29_0234B09C
|
||||
.public ov29_02352AD8
|
||||
.public ov29_02352B1C
|
||||
.public ov29_0237CA84
|
||||
.public sub_0201CF90
|
||||
.public sub_0201D1D4
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
.public CreateAdvancedTextBoxWithArg
|
||||
.public CreateParentMenuFromStringIds
|
||||
.public CreateTextBox
|
||||
.public DUNGEON_PTR
|
||||
.public DisplayMessage
|
||||
.public DrawTextInWindow
|
||||
.public DungeonGoesUp
|
||||
|
|
@ -31,30 +32,13 @@
|
|||
.public MemFree
|
||||
.public MemZero
|
||||
.public OpenMessageLog
|
||||
.public OthersMenuLoop
|
||||
.public ov10_022C4760
|
||||
.public ov10_022C4814
|
||||
.public ov10_022C48C4
|
||||
.public ov10_022C48CC
|
||||
.public ov10_022C48D4
|
||||
.public ov10_022C48F4
|
||||
.public ov10_022C490C
|
||||
.public ov10_022C4918
|
||||
.public ov10_022C4934
|
||||
.public ov10_022C49E4
|
||||
.public ov10_022C49F8
|
||||
.public ov10_022C4A0C
|
||||
.public ov10_022C4A20
|
||||
.public ov10_022C4A34
|
||||
.public ov10_022C4A48
|
||||
.public ov10_022C4A70
|
||||
.public ov10_022C4A88
|
||||
.public ov10_022C4AA0
|
||||
.public ov10_022C4AB8
|
||||
.public ov10_022C4AD0
|
||||
.public ov10_022C4AE8
|
||||
.public ov10_022C4B00
|
||||
.public ov10_022C4B98
|
||||
.public PreprocessString
|
||||
.public SetAdvancedTextBoxField0x1C2
|
||||
.public ShowKeyboard
|
||||
.public StoryRestrictionsEnabled
|
||||
.public StringFromId
|
||||
.public StrncpySimple
|
||||
.public StrncpySimpleNoPadSafe
|
||||
.public ov29_022E8708
|
||||
.public ov29_022E8768
|
||||
.public ov29_022E87DC
|
||||
|
|
@ -66,10 +50,6 @@
|
|||
.public ov29_022EA428
|
||||
.public ov29_022F0C98
|
||||
.public ov29_022F9C34
|
||||
.public ov29_0230D704
|
||||
.public ov29_0230D70C
|
||||
.public ov29_0230D738
|
||||
.public ov29_0230D76C
|
||||
.public ov29_02347100
|
||||
.public ov29_0234DD90
|
||||
.public ov29_0234DDA0
|
||||
|
|
@ -79,6 +59,25 @@
|
|||
.public ov29_0234EB28
|
||||
.public ov29_0234EBAC
|
||||
.public ov29_0234EBCC
|
||||
.public ov29_023533B0
|
||||
.public ov29_023533C0
|
||||
.public ov29_023533D0
|
||||
.public ov29_023533E0
|
||||
.public ov29_023533F0
|
||||
.public ov29_023533F8
|
||||
.public ov29_02353404
|
||||
.public ov29_0235340C
|
||||
.public ov29_0235341C
|
||||
.public ov29_0235342C
|
||||
.public ov29_0235343C
|
||||
.public ov29_02353474
|
||||
.public ov29_023534B4
|
||||
.public ov29_0235352C
|
||||
.public ov29_02353834
|
||||
.public ov29_02353838
|
||||
.public ov29_0235383C
|
||||
.public ov29_02353848
|
||||
.public ov29_0238280C
|
||||
.public ov31_023833D8
|
||||
.public ov31_02383434
|
||||
.public ov31_0238647C
|
||||
|
|
@ -90,13 +89,6 @@
|
|||
.public ov31_02388714
|
||||
.public ov31_02388E88
|
||||
.public ov31_0238941C
|
||||
.public PreprocessString
|
||||
.public SetAdvancedTextBoxField0x1C2
|
||||
.public ShowKeyboard
|
||||
.public StoryRestrictionsEnabled
|
||||
.public StringFromId
|
||||
.public StrncpySimple
|
||||
.public StrncpySimpleNoPadSafe
|
||||
.public sub_0200B3D4
|
||||
.public sub_020282F4
|
||||
.public sub_0202AB80
|
||||
|
|
|
|||
199
asm/include/overlay_29_02352A54.inc
Normal file
199
asm/include/overlay_29_02352A54.inc
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
#pragma once
|
||||
.public FIXED_ROOM_ITEM_SPAWN_TABLE
|
||||
.public FIXED_ROOM_MONSTER_SPAWN_TABLE
|
||||
.public FIXED_ROOM_TILE_SPAWN_TABLE
|
||||
.public ov29_0234FDD4
|
||||
.public ov29_0234FDD8
|
||||
.public ov29_0234FDDC
|
||||
.public ov29_0234FDE0
|
||||
.public ov29_0234FDE4
|
||||
.public ov29_0234FDE8
|
||||
.public ov29_0234FDEC
|
||||
.public ov29_0234FDF0
|
||||
.public ov29_0234FDF4
|
||||
.public ov29_0234FDF8
|
||||
.public ov29_0234FF18
|
||||
.public ov29_0234FF1C
|
||||
.public ov29_0234FF20
|
||||
.public ov29_0234FF24
|
||||
.public ov29_0234FF28
|
||||
.public ov29_0234FF2C
|
||||
.public ov29_0234FF30
|
||||
.public ov29_0234FF34
|
||||
.public ov29_0234FF38
|
||||
.public ov29_0234FF3C
|
||||
.public ov29_0234FF40
|
||||
.public ov29_0234FF44
|
||||
.public ov29_0234FF48
|
||||
.public ov29_0234FF4C
|
||||
.public ov29_0234FF50
|
||||
.public ov29_0234FF54
|
||||
.public ov29_0234FF58
|
||||
.public ov29_0234FF5C
|
||||
.public ov29_0234FF60
|
||||
.public ov29_0234FF64
|
||||
.public ov29_0234FF68
|
||||
.public ov29_0234FF6C
|
||||
.public ov29_0234FF70
|
||||
.public ov29_0234FF74
|
||||
.public ov29_0234FF78
|
||||
.public ov29_0234FF7C
|
||||
.public ov29_0234FF80
|
||||
.public ov29_0234FF84
|
||||
.public ov29_0234FF88
|
||||
.public ov29_0234FF8C
|
||||
.public ov29_0234FF90
|
||||
.public ov29_0234FF94
|
||||
.public ov29_0234FF98
|
||||
.public ov29_0234FF9C
|
||||
.public ov29_0234FFA0
|
||||
.public ov29_0234FFA4
|
||||
.public ov29_0234FFA8
|
||||
.public ov29_0234FFAC
|
||||
.public ov29_0234FFB0
|
||||
.public ov29_0234FFB4
|
||||
.public ov29_0234FFB8
|
||||
.public ov29_0234FFBC
|
||||
.public ov29_0234FFC0
|
||||
.public ov29_0234FFC4
|
||||
.public ov29_0234FFC8
|
||||
.public ov29_0234FFCC
|
||||
.public ov29_0234FFD0
|
||||
.public ov29_0234FFD4
|
||||
.public ov29_0234FFD8
|
||||
.public ov29_0234FFDC
|
||||
.public ov29_0234FFE0
|
||||
.public ov29_0234FFE4
|
||||
.public ov29_0234FFE8
|
||||
.public ov29_0234FFEC
|
||||
.public ov29_0234FFF0
|
||||
.public ov29_0234FFF4
|
||||
.public ov29_0234FFF8
|
||||
.public ov29_0234FFFC
|
||||
.public ov29_02350000
|
||||
.public ov29_02350004
|
||||
.public ov29_02350008
|
||||
.public ov29_02350010
|
||||
.public ov29_02350014
|
||||
.public ov29_02350018
|
||||
.public ov29_0235001C
|
||||
.public ov29_02350020
|
||||
.public ov29_02350024
|
||||
.public ov29_02350028
|
||||
.public ov29_0235002C
|
||||
.public ov29_02350030
|
||||
.public ov29_02350034
|
||||
.public ov29_02350038
|
||||
.public ov29_0235003C
|
||||
.public ov29_02350040
|
||||
.public ov29_02350044
|
||||
.public ov29_02350048
|
||||
.public ov29_0235004C
|
||||
.public ov29_02350050
|
||||
.public ov29_02350054
|
||||
.public ov29_02350058
|
||||
.public ov29_0235005C
|
||||
.public ov29_02350060
|
||||
.public ov29_02350064
|
||||
.public ov29_02350068
|
||||
.public ov29_0235006C
|
||||
.public ov29_02350070
|
||||
.public ov29_02350074
|
||||
.public ov29_02350078
|
||||
.public ov29_0235007C
|
||||
.public ov29_02350080
|
||||
.public ov29_02350084
|
||||
.public ov29_02350088
|
||||
.public ov29_0235008C
|
||||
.public ov29_02350090
|
||||
.public ov29_02350094
|
||||
.public ov29_02350098
|
||||
.public ov29_0235009C
|
||||
.public ov29_023500A0
|
||||
.public ov29_023500A4
|
||||
.public ov29_023500A8
|
||||
.public ov29_023500AC
|
||||
.public ov29_023500B0
|
||||
.public ov29_023500B4
|
||||
.public ov29_023500B8
|
||||
.public ov29_023500BC
|
||||
.public ov29_023500C0
|
||||
.public ov29_023500C4
|
||||
.public ov29_023500C8
|
||||
.public ov29_023500CC
|
||||
.public ov29_023500D0
|
||||
.public ov29_023500D4
|
||||
.public ov29_023500D8
|
||||
.public ov29_023500DC
|
||||
.public ov29_023500E0
|
||||
.public ov29_023500E4
|
||||
.public ov29_023500E8
|
||||
.public ov29_023500EC
|
||||
.public ov29_023500F0
|
||||
.public ov29_023500FC
|
||||
.public ov29_02350104
|
||||
.public ov29_0235010C
|
||||
.public ov29_02350114
|
||||
.public ov29_0235011C
|
||||
.public ov29_02350124
|
||||
.public ov29_0235012C
|
||||
.public ov29_02350134
|
||||
.public ov29_0235013C
|
||||
.public ov29_02350144
|
||||
.public ov29_0235014C
|
||||
.public ov29_02350154
|
||||
.public ov29_0235015C
|
||||
.public ov29_02350164
|
||||
.public ov29_0235016C
|
||||
.public ov29_02350174
|
||||
.public ov29_0235017C
|
||||
.public ov29_02350184
|
||||
.public ov29_0235018C
|
||||
.public ov29_02350194
|
||||
.public ov29_0235019C
|
||||
.public ov29_023501A4
|
||||
.public ov29_023501AC
|
||||
.public ov29_023501B4
|
||||
.public ov29_023501BC
|
||||
.public ov29_023501C4
|
||||
.public ov29_023501CC
|
||||
.public ov29_023501D4
|
||||
.public ov29_023501DC
|
||||
.public ov29_023501E4
|
||||
.public ov29_023501EC
|
||||
.public ov29_023501F4
|
||||
.public ov29_023501FC
|
||||
.public ov29_02350204
|
||||
.public ov29_0235020C
|
||||
.public ov29_02350214
|
||||
.public ov29_0235021C
|
||||
.public ov29_02350224
|
||||
.public ov29_0235022C
|
||||
.public ov29_02350234
|
||||
.public ov29_0235023C
|
||||
.public ov29_02350244
|
||||
.public ov29_0235024C
|
||||
.public ov29_02350254
|
||||
.public ov29_0235025C
|
||||
.public ov29_02350264
|
||||
.public ov29_0235026C
|
||||
.public ov29_02350274
|
||||
.public ov29_0235027C
|
||||
.public ov29_02350284
|
||||
.public ov29_0235028C
|
||||
.public ov29_02350294
|
||||
.public ov29_0235029C
|
||||
.public ov29_023502A4
|
||||
.public ov29_023502AC
|
||||
.public ov29_023502B4
|
||||
.public ov29_023502BC
|
||||
.public ov29_023502C4
|
||||
.public ov29_023502CC
|
||||
.public ov29_023502D4
|
||||
.public ov29_023502DC
|
||||
.public ov29_023502E4
|
||||
.public ov29_02351974
|
||||
.public ov29_02351B00
|
||||
.public ov29_02351C94
|
||||
.public ov29_023529C4
|
||||
.public ov29_023529EC
|
||||
54
asm/include/overlay_29_0238280C.inc
Normal file
54
asm/include/overlay_29_0238280C.inc
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#pragma once
|
||||
.public OthersMenuLoop
|
||||
.public ov10_022C4760
|
||||
.public ov10_022C4814
|
||||
.public ov10_022C48C4
|
||||
.public ov10_022C48CC
|
||||
.public ov10_022C48D4
|
||||
.public ov10_022C48F4
|
||||
.public ov10_022C490C
|
||||
.public ov10_022C4918
|
||||
.public ov10_022C4934
|
||||
.public ov10_022C49E4
|
||||
.public ov10_022C49F8
|
||||
.public ov10_022C4A0C
|
||||
.public ov10_022C4A20
|
||||
.public ov10_022C4A34
|
||||
.public ov10_022C4A48
|
||||
.public ov10_022C4A70
|
||||
.public ov10_022C4A88
|
||||
.public ov10_022C4AA0
|
||||
.public ov10_022C4AB8
|
||||
.public ov10_022C4AD0
|
||||
.public ov10_022C4AE8
|
||||
.public ov10_022C4B00
|
||||
.public ov10_022C4B98
|
||||
.public ov29_0230D704
|
||||
.public ov29_0230D70C
|
||||
.public ov29_0230D738
|
||||
.public ov29_0230D76C
|
||||
.public ov29_0234F21C
|
||||
.public ov29_0234F248
|
||||
.public ov29_0234F9E8
|
||||
.public ov29_0234FD28
|
||||
.public ov29_0234FD38
|
||||
.public ov29_0234FD58
|
||||
.public ov29_0234FD6C
|
||||
.public ov29_0234FD80
|
||||
.public ov29_0234FD88
|
||||
.public ov29_0234FD90
|
||||
.public ov29_0234FD98
|
||||
.public ov29_0234FDA0
|
||||
.public ov29_0234FDA8
|
||||
.public ov29_0234FDB0
|
||||
.public ov29_0234FDB8
|
||||
.public ov29_0234FDC0
|
||||
.public ov29_0234FDC8
|
||||
.public ov29_023527E0
|
||||
.public ov29_023527E4
|
||||
.public ov29_023527E8
|
||||
.public ov29_02353128
|
||||
.public ov29_02353140
|
||||
.public ov29_02353158
|
||||
.public ov29_02353170
|
||||
.public ov29_02353188
|
||||
|
|
@ -8209,6 +8209,7 @@ _020908D0: .word _020AEEF0
|
|||
arm_func_end sub_020908A8
|
||||
; 0x020908D4
|
||||
|
||||
.rodata
|
||||
.global _020908D4
|
||||
_020908D4:
|
||||
.byte 0x20, 0xFF, 0x09, 0x60, 0x00, 0x00, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -108621,6 +108621,7 @@ _02317F3C:
|
|||
arm_func_end ov00_02317EF8
|
||||
; 0x02317F44
|
||||
|
||||
.rodata
|
||||
#ifdef EUROPE
|
||||
.global ov00_02318758_EU
|
||||
ov00_02318758_EU:
|
||||
|
|
|
|||
|
|
@ -22232,6 +22232,7 @@ _0233AE74: .word ov01_0233C0A4
|
|||
arm_func_end ov01_0233AE64
|
||||
; 0x0233AE78
|
||||
|
||||
.rodata
|
||||
.global ov01_0233AE78
|
||||
ov01_0233AE78:
|
||||
.byte 0x44, 0x41, 0x54, 0x41, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -53081,6 +53081,7 @@ _0234FBC4: .word ov02_0235ABE8
|
|||
arm_func_end ov02_0234FBB0
|
||||
; 0x0234FBC8
|
||||
|
||||
.rodata
|
||||
#ifdef EUROPE
|
||||
.global ov02_023503F4_EU
|
||||
ov02_023503F4_EU:
|
||||
|
|
|
|||
|
|
@ -11428,6 +11428,7 @@ _02346734: .word ov03_02346BDC
|
|||
arm_func_end ov03_023466E8
|
||||
; 0x02346738
|
||||
|
||||
.rodata
|
||||
.global ov03_02346738
|
||||
ov03_02346738:
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -3211,6 +3211,7 @@ _0233F564: .word ov04_0233F644
|
|||
arm_func_end ov04_0233F534
|
||||
; 0x0233F568
|
||||
|
||||
.rodata
|
||||
.global ov04_0233F568
|
||||
ov04_0233F568:
|
||||
#if defined(EUROPE)
|
||||
|
|
|
|||
|
|
@ -3604,6 +3604,7 @@ _0233FB48: .word ov05_0233FC6C
|
|||
arm_func_end ov05_0233FA74
|
||||
; 0x0233FB4C
|
||||
|
||||
.rodata
|
||||
.global ov05_0233FB4C
|
||||
ov05_0233FB4C:
|
||||
#if defined(EUROPE)
|
||||
|
|
|
|||
|
|
@ -2645,6 +2645,7 @@ _0233ED00: .word ov06_0233EEF0
|
|||
arm_func_end ov06_0233ECCC
|
||||
; 0x0233ED04
|
||||
|
||||
.rodata
|
||||
.global ov06_0233ED04
|
||||
ov06_0233ED04:
|
||||
#if defined(EUROPE)
|
||||
|
|
|
|||
|
|
@ -6307,6 +6307,7 @@ _023418B8: .word ov07_02341B78
|
|||
; 0x023418BC
|
||||
#endif
|
||||
|
||||
.rodata
|
||||
.global ov07_023418BC
|
||||
ov07_023418BC:
|
||||
#if defined(EUROPE)
|
||||
|
|
|
|||
|
|
@ -2805,6 +2805,7 @@ _0233E8A4:
|
|||
arm_func_end ov08_0233E874
|
||||
; 0x0233E8AC
|
||||
|
||||
.rodata
|
||||
#ifdef EUROPE
|
||||
.global _0233F038_EU
|
||||
_0233F038_EU:
|
||||
|
|
|
|||
|
|
@ -3161,6 +3161,7 @@ _0233F564:
|
|||
arm_func_end UpdateInputLockBox
|
||||
; 0x0233F56C
|
||||
|
||||
.rodata
|
||||
.global ov09_0233F56C
|
||||
ov09_0233F56C:
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x0A, 0x0A, 0x0C, 0x02, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -9305,6 +9305,7 @@ ov10_022C434C: ; 0x022C434C
|
|||
arm_func_end ov10_022C434C
|
||||
; 0x022C4394
|
||||
|
||||
.rodata
|
||||
.global INVENTORY_MENU_DEFAULT_WINDOW_PARAMS
|
||||
INVENTORY_MENU_DEFAULT_WINDOW_PARAMS:
|
||||
.word UpdateInventoryMenu
|
||||
|
|
|
|||
|
|
@ -70761,6 +70761,7 @@ _02316A38: .word 0x000008DF
|
|||
#endif
|
||||
arm_func_end ov11_023168E0
|
||||
|
||||
.rodata
|
||||
.global ov11_02316A3C
|
||||
ov11_02316A3C:
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ _0238C00C: .word 0x000006CD + OV13_0238BE6C_OFFSET
|
|||
arm_func_end ov13_0238BE6C
|
||||
; 0x0238C010
|
||||
|
||||
.rodata
|
||||
.global QUIZ_BORDER_COLOR_TABLE
|
||||
QUIZ_BORDER_COLOR_TABLE:
|
||||
.byte 0x00, 0x01, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -4222,6 +4222,7 @@ _0238D968: .word 0x0000080F
|
|||
arm_func_end ov14_0238D828
|
||||
; 0x0238D96C
|
||||
|
||||
.rodata
|
||||
.global ov14_0238D96C
|
||||
ov14_0238D96C:
|
||||
.byte 0x03, 0x03, 0x03, 0x03
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
.text
|
||||
; 0x0238B054
|
||||
|
||||
.rodata
|
||||
.global BANK_MAIN_MENU_ITEMS
|
||||
BANK_MAIN_MENU_ITEMS:
|
||||
#ifdef JAPAN
|
||||
|
|
|
|||
|
|
@ -3169,6 +3169,7 @@ _0238CD04: .word OVERLAY16_UNKNOWN_POINTER__NA_238CE40
|
|||
arm_func_end ov16_0238CCF0
|
||||
; 0x0238CD08
|
||||
|
||||
.rodata
|
||||
.global EVO_MENU_ITEMS_CONFIRM
|
||||
EVO_MENU_ITEMS_CONFIRM:
|
||||
#ifdef JAPAN
|
||||
|
|
|
|||
|
|
@ -2044,6 +2044,7 @@ _0238BB30: .word OVERLAY17_UNKNOWN_POINTER__NA_238BE00
|
|||
arm_func_end ov17_0238BB1C
|
||||
; 0x0238BB34
|
||||
|
||||
.rodata
|
||||
.global ASSEMBLY_WINDOW_PARAMS_1
|
||||
ASSEMBLY_WINDOW_PARAMS_1:
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x1E, 0x0F, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -3811,6 +3811,7 @@ _0238D204: .word OVERLAY18_UNKNOWN_POINTER__NA_238D620
|
|||
arm_func_end ov18_0238D174
|
||||
; 0x0238D208
|
||||
|
||||
.rodata
|
||||
.global ov18_0238D208
|
||||
ov18_0238D208:
|
||||
.byte 0x18, 0x00, 0x9F, 0xE5, 0x03, 0x30, 0xA0, 0xE3, 0x00, 0x20, 0x90, 0xE5, 0x49, 0x10, 0xA0, 0xE3
|
||||
|
|
|
|||
|
|
@ -4319,6 +4319,7 @@ _0238DADC: .word ov19_0238E324
|
|||
arm_func_end ov19_0238D698
|
||||
; 0x0238DAE0
|
||||
|
||||
.rodata
|
||||
.global OVERLAY19_UNKNOWN_TABLE__NA_238DAE0
|
||||
OVERLAY19_UNKNOWN_TABLE__NA_238DAE0:
|
||||
.byte 0x0A, 0x00, 0x0A, 0x00, 0x0A, 0x00, 0x0A, 0x00
|
||||
|
|
|
|||
|
|
@ -3518,6 +3518,7 @@ _0238CF78: .word 0x00004628
|
|||
arm_func_end ov20_0238CF20
|
||||
; 0x0238CF7C
|
||||
|
||||
.rodata
|
||||
.global OVERLAY20_UNKNOWN_POINTER__NA_238CF7C
|
||||
OVERLAY20_UNKNOWN_POINTER__NA_238CF7C:
|
||||
#if defined(EUROPE)
|
||||
|
|
|
|||
|
|
@ -3014,6 +3014,7 @@ _0238CA24: .word 0x00000225
|
|||
arm_func_end ov21_0238C9A4
|
||||
; 0x0238CA28
|
||||
|
||||
.rodata
|
||||
.global SWAP_SHOP_WINDOW_PARAMS_1
|
||||
SWAP_SHOP_WINDOW_PARAMS_1:
|
||||
#ifdef JAPAN
|
||||
|
|
|
|||
|
|
@ -5071,6 +5071,7 @@ _0238E818: .word OVERLAY22_UNKNOWN_POINTER__NA_238EC70
|
|||
arm_func_end ov22_0238E7E4
|
||||
; 0x0238E81C
|
||||
|
||||
.rodata
|
||||
.global SHOP_WINDOW_PARAMS_1
|
||||
SHOP_WINDOW_PARAMS_1:
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x12, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -3824,6 +3824,7 @@ _0238D2E4: .word OVERLAY23_UNKNOWN_POINTER__NA_238D8A0
|
|||
arm_func_end ov23_0238D278
|
||||
; 0x0238D2E8
|
||||
|
||||
.rodata
|
||||
.global OVERLAY23_UNKNOWN_VALUE__NA_238D2E8
|
||||
OVERLAY23_UNKNOWN_VALUE__NA_238D2E8:
|
||||
.byte 0x00, 0x03, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -2501,6 +2501,7 @@ _0238C504: .word OVERLAY24_UNKNOWN_POINTER__NA_238C600
|
|||
arm_func_end ov24_0238C4CC
|
||||
; 0x0238C508
|
||||
|
||||
.rodata
|
||||
.global OVERLAY24_UNKNOWN_STRUCT__NA_238C508
|
||||
OVERLAY24_UNKNOWN_STRUCT__NA_238C508:
|
||||
.byte 0xF8, 0x00
|
||||
|
|
|
|||
|
|
@ -1402,6 +1402,7 @@ _0238B494: .word 0x00000225
|
|||
arm_func_end ov25_0238B414
|
||||
; 0x0238B498
|
||||
|
||||
.rodata
|
||||
.global OVERLAY25_UNKNOWN_STRUCT__NA_238B498
|
||||
OVERLAY25_UNKNOWN_STRUCT__NA_238B498:
|
||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -989,6 +989,7 @@ _0238AE1C: .word OVERLAY26_UNKNOWN_POINTER5__NA_238AF70
|
|||
arm_func_end ov26_0238AD3C
|
||||
; 0x0238AE20
|
||||
|
||||
.rodata
|
||||
.global OVERLAY26_UNKNOWN_TABLE__NA_238AE20
|
||||
OVERLAY26_UNKNOWN_TABLE__NA_238AE20:
|
||||
.byte 0xFF, 0x00, 0x18, 0x02, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -2986,6 +2986,7 @@ _0238C944: .word OVERLAY27_UNKNOWN_POINTER__NA_238CE84
|
|||
arm_func_end ov27_0238C900
|
||||
; 0x0238C948
|
||||
|
||||
.rodata
|
||||
.global OVERLAY27_UNKNOWN_VALUE__NA_238C948
|
||||
OVERLAY27_UNKNOWN_VALUE__NA_238C948:
|
||||
.byte 0x00, 0x03, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -855,6 +855,7 @@ _0238ACF8: .word ov28_0238AD80
|
|||
arm_func_end ov28_0238ABD4
|
||||
; 0x0238ACFC
|
||||
|
||||
.rodata
|
||||
.global ov28_0238ACFC
|
||||
ov28_0238ACFC:
|
||||
.byte 0x0D, 0x00, 0x00, 0x00
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
1198
asm/overlay_29_02324698.s
Normal file
1198
asm/overlay_29_02324698.s
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2316
asm/overlay_29_02352A54.s
Normal file
2316
asm/overlay_29_02352A54.s
Normal file
File diff suppressed because it is too large
Load Diff
1378
asm/overlay_29_0238280C.s
Normal file
1378
asm/overlay_29_0238280C.s
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -4332,6 +4332,7 @@ _0238607C: .word ov30_02385CA4
|
|||
arm_func_end ov30_02386074
|
||||
; 0x02386080
|
||||
|
||||
.rodata
|
||||
.global OVERLAY30_JP_STRING_1
|
||||
OVERLAY30_JP_STRING_1:
|
||||
.byte 0x82, 0xDD, 0x82, 0xB3, 0x82, 0xAB, 0x97, 0x6C, 0x00, 0x00, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -8885,6 +8885,7 @@ ov31_02389D80: ; 0x02389D80
|
|||
arm_func_end ov31_02389D80
|
||||
; 0x02389D94
|
||||
|
||||
.rodata
|
||||
.global DUNGEON_WINDOW_PARAMS_1
|
||||
DUNGEON_WINDOW_PARAMS_1:
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
|
|
|
|||
|
|
@ -1132,6 +1132,7 @@ _022DCFF0: .word OVERLAY34_UNKNOWN_POINTER__NA_22DD08C
|
|||
arm_func_end ov34_022DCED8
|
||||
; 0x022DCFF4
|
||||
|
||||
.rodata
|
||||
.global ov34_022DCFF4
|
||||
ov34_022DCFF4:
|
||||
.byte 0x42, 0x41, 0x43, 0x4B, 0x2F, 0x6E, 0x5F, 0x6C, 0x6F, 0x67, 0x6F, 0x2E, 0x62, 0x67, 0x70, 0x00
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ struct monster {
|
|||
u8 badly_poisoned_damage_count;
|
||||
struct frozen_class_status frozen_class_status; // 0xC4
|
||||
struct cringe_class_status cringe_class_status; // 0xD0
|
||||
struct bide_class_status bide_class_status;
|
||||
struct bide_class_status bide_class_status; // 0xD2
|
||||
u8 reflect; // 0xD5: STATUS_REFLECT if 1
|
||||
u8 reflect_turns; // 0xD6: Turns left for the status in statuses::reflect
|
||||
// 0xD7: Turns left until residual healing for the status in statuses::reflect, if applicable
|
||||
|
|
|
|||
8
include/dungeon_move.h
Normal file
8
include/dungeon_move.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef PMDSKY_DUNGEON_MOVE_H
|
||||
#define PMDSKY_DUNGEON_MOVE_H
|
||||
|
||||
#include "dungeon_mode.h"
|
||||
|
||||
bool8 IsChargingAnyTwoTurnMove(struct entity *pokemon, bool8 check_charge);
|
||||
|
||||
#endif //PMDSKY_DUNGEON_MOVE_H
|
||||
|
|
@ -3638,7 +3638,18 @@ enum status_id {
|
|||
#define FROZEN_STATUS_WRAPPED (STATUS_WRAPPED - STATUS_FROZEN + 1) // 4
|
||||
#define FROZEN_STATUS_PETRIFIED (STATUS_PETRIFIED - STATUS_FROZEN + 1) // 6
|
||||
|
||||
#define BIDE_STATUS_BIDE (STATUS_BIDE - STATUS_BIDE + 1) // 1
|
||||
#define BIDE_STATUS_BIDE (STATUS_BIDE - STATUS_BIDE + 1) // 1
|
||||
#define BIDE_STATUS_SOLARBEAM (STATUS_SOLARBEAM - STATUS_BIDE + 1) // 2
|
||||
#define BIDE_STATUS_SKY_ATTACK (STATUS_SKY_ATTACK - STATUS_BIDE + 1) // 3
|
||||
#define BIDE_STATUS_RAZOR_WIND (STATUS_RAZOR_WIND - STATUS_BIDE + 1) // 4
|
||||
#define BIDE_STATUS_FOCUS_PUNCH (STATUS_FOCUS_PUNCH - STATUS_BIDE + 1) // 5
|
||||
#define BIDE_STATUS_SKULL_BASH (STATUS_SKULL_BASH - STATUS_BIDE + 1) // 6
|
||||
#define BIDE_STATUS_FLYING (STATUS_FLYING - STATUS_BIDE + 1) // 7
|
||||
#define BIDE_STATUS_BOUNCING (STATUS_BOUNCING - STATUS_BIDE + 1) // 8
|
||||
#define BIDE_STATUS_DIVING (STATUS_DIVING - STATUS_BIDE + 1) // 9
|
||||
#define BIDE_STATUS_DIGGING (STATUS_DIGGING - STATUS_BIDE + 1) // 10
|
||||
#define BIDE_STATUS_CHARGING (STATUS_CHARGING - STATUS_BIDE + 1) // 11
|
||||
#define BIDE_STATUS_SHADOW_FORCE (STATUS_SHADOW_FORCE - STATUS_BIDE + 1)// 13
|
||||
|
||||
#define CRINGE_STATUS_CONFUSED (STATUS_CONFUSED - STATUS_CRINGE + 1) // 2
|
||||
#define CRINGE_STATUS_PAUSED (STATUS_PAUSED - STATUS_CRINGE + 1) // 3
|
||||
|
|
|
|||
6
main.lsf
6
main.lsf
|
|
@ -149,8 +149,8 @@ Overlay OVY_15
|
|||
Object asm/overlay_15_0238A234.o
|
||||
Object src/overlay_15_0238AD78.o
|
||||
Object asm/overlay_15_0238ADC4.o
|
||||
Object src/overlay_15_0238AE6C.o
|
||||
Object asm/overlay_15_0238B054.o
|
||||
Object src/overlay_15_0238AE6C.o
|
||||
}
|
||||
Overlay OVY_16
|
||||
{
|
||||
|
|
@ -344,6 +344,9 @@ Overlay OVY_29
|
|||
Object asm/overlay_29_0232145C.o
|
||||
Object src/overlay_29_02322DB8.o
|
||||
Object asm/overlay_29_02322DDC.o
|
||||
Object asm/overlay_29_02352A54.o
|
||||
Object src/dungeon_move.o
|
||||
Object asm/overlay_29_02324698.o
|
||||
Object src/overlay_29_02325620.o
|
||||
Object asm/overlay_29_02325644.o
|
||||
Object src/overlay_29_0232800C.o
|
||||
|
|
@ -382,6 +385,7 @@ Overlay OVY_29
|
|||
Object asm/overlay_29_0234DDF4.o
|
||||
Object src/overlay_29_0234EC14.o
|
||||
Object asm/overlay_29_0234EC38.o
|
||||
Object asm/overlay_29_0238280C.o
|
||||
}
|
||||
Overlay OVY_30
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@
|
|||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_capabilities_2.h"
|
||||
#include "dungeon_move.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "joined_at_checks.h"
|
||||
|
||||
extern bool8 IsChargingAnyTwoTurnMove(struct entity *pokemon, bool8 check_charge);
|
||||
|
||||
bool8 CheckVariousConditions(struct entity *pokemon)
|
||||
{
|
||||
struct monster *pokemon_info = GetEntInfo(pokemon);
|
||||
|
|
|
|||
39
src/dungeon_move.c
Normal file
39
src/dungeon_move.c
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#include "dungeon_move.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "overlay_29_02321438.h"
|
||||
|
||||
const u8 MULTI_TURN_BIDE_CLASS_STATUSES[11] =
|
||||
{
|
||||
BIDE_STATUS_SOLARBEAM,
|
||||
BIDE_STATUS_SKY_ATTACK,
|
||||
BIDE_STATUS_RAZOR_WIND,
|
||||
BIDE_STATUS_FOCUS_PUNCH,
|
||||
BIDE_STATUS_SKULL_BASH,
|
||||
BIDE_STATUS_FLYING,
|
||||
BIDE_STATUS_BOUNCING,
|
||||
BIDE_STATUS_DIVING,
|
||||
BIDE_STATUS_DIGGING,
|
||||
BIDE_STATUS_SHADOW_FORCE,
|
||||
STATUS_NONE
|
||||
};
|
||||
|
||||
bool8 IsChargingAnyTwoTurnMove(struct entity *pokemon, bool8 check_charge)
|
||||
{
|
||||
if (!EntityIsValid__02321438(pokemon))
|
||||
return FALSE;
|
||||
|
||||
struct monster *pokemon_info = GetEntInfo(pokemon);
|
||||
for (s32 i = 0; i < 100; i++)
|
||||
{
|
||||
if (MULTI_TURN_BIDE_CLASS_STATUSES[i] == STATUS_NONE)
|
||||
return FALSE;
|
||||
|
||||
if (pokemon_info->bide_class_status.bide == MULTI_TURN_BIDE_CLASS_STATUSES[i])
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// BUG: This condition is never reached because the for loop terminates by returning FALSE at the end of the MULTI_TURN_BIDE_CLASS_STATUSES array.
|
||||
if (check_charge && pokemon_info->bide_class_status.bide == BIDE_STATUS_CHARGING)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
from typing import List
|
||||
from write_inc_file import write_inc_file
|
||||
|
||||
# Use this script to extract a function out of assembly and create a blank C function as a placeholder.
|
||||
# If the function is in the middle, the assembly file is split in two. If the function is at either end, it is added to the next/previous source file.
|
||||
|
|
@ -128,56 +128,6 @@ for i, line in enumerate(lsf_lines):
|
|||
lsf_lines[i] += f'\tObject asm/{new_asm_base_name}.o\n'
|
||||
break
|
||||
|
||||
BRANCH_LINK_INSTRUCTION = '\tbl '
|
||||
BRANCH_LINK_EXCHANGE_INSTRUCTION = '\tblx '
|
||||
BRANCH_INSTRUCTION = '\tb '
|
||||
WORD_KEY = '.word '
|
||||
WORD_PLUS_OFFSET = ' + 0x'
|
||||
"""
|
||||
Searches through an ASM file's contents for all external symbols, then populates a .inc file with all the necessary .public definitions.
|
||||
"""
|
||||
def write_inc_file(lines: List[str], file_path: str):
|
||||
defined_functions = set()
|
||||
used_functions = set()
|
||||
for line in lines:
|
||||
if line.startswith(ARM_FUNC_START):
|
||||
defined_functions.add(line[len(ARM_FUNC_START) : -1])
|
||||
elif line.startswith(BRANCH_LINK_INSTRUCTION):
|
||||
used_functions.add(line[len(BRANCH_LINK_INSTRUCTION) : -1])
|
||||
elif line.startswith(BRANCH_INSTRUCTION):
|
||||
function = line[len(BRANCH_INSTRUCTION) : -1]
|
||||
if function[0] != '_':
|
||||
semicolon_index = function.index(' ; ')
|
||||
used_functions.add(function[:semicolon_index])
|
||||
elif line.startswith(BRANCH_LINK_EXCHANGE_INSTRUCTION):
|
||||
function = line[len(BRANCH_LINK_EXCHANGE_INSTRUCTION) : -1]
|
||||
if function not in {'fp', 'ip', 'lr', 'sb', 'sl'} and not (
|
||||
function.startswith('r') and function[1:].isdigit() # rN
|
||||
):
|
||||
used_functions.add(function)
|
||||
else:
|
||||
word_index = line.find(WORD_KEY)
|
||||
if word_index >= 0 and f'{WORD_KEY}0x' not in line:
|
||||
word_plus_offset_index = line.find(WORD_PLUS_OFFSET)
|
||||
if word_plus_offset_index >= 0:
|
||||
new_word = line[word_index + len(WORD_KEY) : word_plus_offset_index]
|
||||
else:
|
||||
new_word = line[word_index + len(WORD_KEY) : -1]
|
||||
|
||||
if new_word[0] < '0' or new_word > '9':
|
||||
used_functions.add(new_word)
|
||||
|
||||
for function in defined_functions:
|
||||
if function in used_functions:
|
||||
used_functions.remove(function)
|
||||
|
||||
write_lines = ['#pragma once\n']
|
||||
for function in sorted(used_functions):
|
||||
write_lines.append(f'.public {function}\n')
|
||||
|
||||
with open(file_path, 'w') as inc_file:
|
||||
inc_file.writelines(write_lines)
|
||||
|
||||
print('Updating', LSF_FILE_PATH)
|
||||
with open(LSF_FILE_PATH, 'w') as lsf_file:
|
||||
lsf_file.writelines(lsf_lines)
|
||||
|
|
|
|||
95
tools/extract_function/split_data.py
Normal file
95
tools/extract_function/split_data.py
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
from write_inc_file import write_inc_file
|
||||
|
||||
# Use this script to split a data file at a certain symbol.
|
||||
# Example usage: python split_data.py overlay_29_0234EC38 MULTI_TURN_BIDE_CLASS_STATUSES
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
print('Usage: python extract_function.py <asm_file> <split_symbol_name>')
|
||||
exit(1)
|
||||
|
||||
_, symbol_location, symbol_name = sys.argv[0:3]
|
||||
|
||||
|
||||
if symbol_location.endswith('.s'):
|
||||
symbol_location = symbol_location[:-2]
|
||||
if symbol_location.startswith("./asm/"):
|
||||
symbol_location = symbol_location[6:]
|
||||
|
||||
ASM_FOLDER = 'asm'
|
||||
INCLUDE_FOLDER = os.path.join(ASM_FOLDER, 'include')
|
||||
original_file_path = os.path.join(ASM_FOLDER, f'{symbol_location}.s')
|
||||
original_inc_path = os.path.join(INCLUDE_FOLDER, f'{symbol_location}.inc')
|
||||
with open(original_file_path, 'r') as original_file:
|
||||
original_lines = original_file.readlines()
|
||||
|
||||
SYMBOL_START = '\t.global '
|
||||
symbol_line = None
|
||||
new_symbol_address = None
|
||||
hex_regex = re.compile('_[0-9A-F]{8}$')
|
||||
for i, line in enumerate(original_lines):
|
||||
if line.startswith(f'{SYMBOL_START}{symbol_name}'):
|
||||
symbol_line = i
|
||||
|
||||
if symbol_line is not None and line.startswith(SYMBOL_START) and hex_regex.search(line) is not None:
|
||||
new_symbol_address = line[-9:-1]
|
||||
|
||||
if symbol_line is None:
|
||||
print(f'Failed to find symbol {symbol_name}.')
|
||||
exit(1)
|
||||
|
||||
new_asm_lines = original_lines[symbol_line:]
|
||||
original_asm_lines = original_lines[:symbol_line]
|
||||
|
||||
if symbol_location.startswith('main'):
|
||||
file_prefix = 'main_'
|
||||
else:
|
||||
file_prefix = symbol_location[:len('overlay_00_')]
|
||||
if file_prefix[-1] != '_':
|
||||
file_prefix += '_'
|
||||
|
||||
LSF_FILE_PATH = 'main.lsf'
|
||||
with open(LSF_FILE_PATH, 'r') as lsf_file:
|
||||
lsf_lines = lsf_file.readlines()
|
||||
|
||||
extract_file_name = f'{file_prefix}{new_symbol_address}'
|
||||
|
||||
new_asm_base_name = f"{file_prefix}{new_symbol_address}"
|
||||
|
||||
# If needed, add the extracted function's new .o file to main.lsf.
|
||||
merge_prev_file = None
|
||||
merge_next_file = None
|
||||
SRC_LSF_PREFIX = '\tObject src/'
|
||||
for i, line in enumerate(lsf_lines):
|
||||
if line.endswith(f'{symbol_location}.o\n'):
|
||||
lsf_lines[i] += f'\tObject asm/{new_asm_base_name}.o\n'
|
||||
|
||||
print('Updating', LSF_FILE_PATH)
|
||||
with open(LSF_FILE_PATH, 'w') as lsf_file:
|
||||
lsf_file.writelines(lsf_lines)
|
||||
|
||||
print('Updating', original_file_path)
|
||||
with open(original_file_path, 'w') as original_file:
|
||||
original_file.writelines(original_asm_lines)
|
||||
print('Updating', original_inc_path)
|
||||
write_inc_file(original_asm_lines, original_inc_path)
|
||||
|
||||
new_inc_file_name = f"{new_asm_base_name}.inc"
|
||||
new_asm_name = f'{new_asm_base_name}.s'
|
||||
new_asm_header = f"""\t.include "asm/macros.inc"
|
||||
\t.include "{new_inc_file_name}"
|
||||
|
||||
\t.rodata
|
||||
"""
|
||||
new_asm_file_path = os.path.join(ASM_FOLDER, new_asm_name)
|
||||
print('Creating', new_asm_file_path)
|
||||
with open(os.path.join(ASM_FOLDER, new_asm_name), 'w') as new_asm_file:
|
||||
new_asm_file.write(new_asm_header)
|
||||
new_asm_file.writelines(new_asm_lines)
|
||||
|
||||
new_asm_inc_path = os.path.join(INCLUDE_FOLDER, f'{new_asm_base_name}.inc')
|
||||
print('Creating', new_asm_inc_path)
|
||||
write_inc_file(new_asm_lines, new_asm_inc_path)
|
||||
52
tools/extract_function/write_inc_file.py
Normal file
52
tools/extract_function/write_inc_file.py
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
from typing import List
|
||||
|
||||
ARM_FUNC_START = '\tarm_func_start '
|
||||
BRANCH_LINK_INSTRUCTION = '\tbl '
|
||||
BRANCH_LINK_EXCHANGE_INSTRUCTION = '\tblx '
|
||||
BRANCH_INSTRUCTION = '\tb '
|
||||
WORD_KEY = '.word '
|
||||
WORD_PLUS_OFFSET = ' + 0x'
|
||||
"""
|
||||
Searches through an ASM file's contents for all external symbols, then populates a .inc file with all the necessary .public definitions.
|
||||
"""
|
||||
def write_inc_file(lines: List[str], file_path: str):
|
||||
defined_functions = set()
|
||||
used_functions = set()
|
||||
for line in lines:
|
||||
if line.startswith(ARM_FUNC_START):
|
||||
defined_functions.add(line[len(ARM_FUNC_START) : -1])
|
||||
elif line.startswith(BRANCH_LINK_INSTRUCTION):
|
||||
used_functions.add(line[len(BRANCH_LINK_INSTRUCTION) : -1])
|
||||
elif line.startswith(BRANCH_INSTRUCTION):
|
||||
function = line[len(BRANCH_INSTRUCTION) : -1]
|
||||
if function[0] != '_':
|
||||
semicolon_index = function.index(' ; ')
|
||||
used_functions.add(function[:semicolon_index])
|
||||
elif line.startswith(BRANCH_LINK_EXCHANGE_INSTRUCTION):
|
||||
function = line[len(BRANCH_LINK_EXCHANGE_INSTRUCTION) : -1]
|
||||
if function not in {'fp', 'ip', 'lr', 'sb', 'sl'} and not (
|
||||
function.startswith('r') and function[1:].isdigit() # rN
|
||||
):
|
||||
used_functions.add(function)
|
||||
else:
|
||||
word_index = line.find(WORD_KEY)
|
||||
if word_index >= 0 and f'{WORD_KEY}0x' not in line:
|
||||
word_plus_offset_index = line.find(WORD_PLUS_OFFSET)
|
||||
if word_plus_offset_index >= 0:
|
||||
new_word = line[word_index + len(WORD_KEY) : word_plus_offset_index]
|
||||
else:
|
||||
new_word = line[word_index + len(WORD_KEY) : -1]
|
||||
|
||||
if new_word[0] < '0' or new_word > '9':
|
||||
used_functions.add(new_word)
|
||||
|
||||
for function in defined_functions:
|
||||
if function in used_functions:
|
||||
used_functions.remove(function)
|
||||
|
||||
write_lines = ['#pragma once\n']
|
||||
for function in sorted(used_functions):
|
||||
write_lines.append(f'.public {function}\n')
|
||||
|
||||
with open(file_path, 'w') as inc_file:
|
||||
inc_file.writelines(write_lines)
|
||||
Loading…
Reference in New Issue
Block a user