mirror of
https://github.com/pret/pmd-sky.git
synced 2026-08-24 03:25:17 -05:00
Decomp ten dungeon-state accessors in overlay_29
Decompile from asm:
GetForcedLossReason GetHiddenStairsField
SetForcedLossReason SetHiddenStairsField
AreLateGameTrapsEnabledWrapper GetHiddenFloorField
GetSuccessfulExitTracker SetHiddenFloorField
SetDungeonEscapeFields GetMinimapData
All ten read or write struct dungeon through DUNGEON_PTR, and every offset lands
on a field dungeon.h already names: forced_loss_reason at 0x14,
successful_exit_tracker at 0x18, end_floor_no_death_check_flag at 0x8,
minimap_display_data at 0x1A264, and three fields of gen_info at 0x40C4 --
hidden_stairs_type, hidden_floor_type and fixed_room_id. No new types.
These are verified against the preprocessed dungeon.h context built in the
previous commit rather than a hand-written struct, which is why nine of the ten
matched on the first candidate instead of appearing to and then failing the
build. The setup cost of that context is now paid, so any overlay_29 function
reaching DUNGEON_PTR is cheap to verify; a scan finds 59 more small ones.
GetMinimapData needed the null check written as a conditional expression rather
than an if with an early return. The target predicates the whole thing --
addne twice for the non-null path, then moveq for the null one -- where the
statement form branches. That is the same predicate-ordering effect recorded on
the LFO handlers in 909484fb, in the direction that wants the expression form.
The US and JP offsets differ for the gen_info and minimap fields, which the asm
carries as #ifdef JAPAN. Nothing version-specific is needed in the C: the fields
are named the same in both, so dungeon.h resolves each build to its own offset.
No comments are added to any pmd-sky file.
Authored by Claude (Opus 5) under human direction. Confirmed by a matching
build: build/pmdsky.us/pmdsky.us.nds: OK.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,62 +1,13 @@
|
||||
#pragma once
|
||||
.public _020AFC28
|
||||
.public _020AFC70
|
||||
.public AnimationDelayOrSomething
|
||||
.public CopyAndInterleaveWrapper
|
||||
.public DirectoryFileMngr_OpenDirectoryFile
|
||||
.public DUNGEON_BUTTON_INPUT
|
||||
.public DUNGEON_PTR
|
||||
.public DungeonGoesUp
|
||||
.public FillPaletteInitInfo
|
||||
.public GetBgRegionArea
|
||||
.public GetFloorType
|
||||
.public GetHeldButtons
|
||||
.public GetPressedButtons
|
||||
.public GetReleasedStylus
|
||||
.public GetScenarioBalance
|
||||
.public HandleSir0Translation
|
||||
.public IsCurrentTilesetBackground
|
||||
.public IsTouchScreenUseAnywhere
|
||||
.public LoadObjPalette
|
||||
.public LoadTextureUi
|
||||
.public LoadWteFromFileDirectory
|
||||
.public Memcpy32
|
||||
.public Memset32
|
||||
.public OBJ_GRAPHICS_CONTROLS_PTR
|
||||
.public ov10_022C4D54
|
||||
.public StartFadeDungeonWrapper
|
||||
.public WaitUntilFadeIsFinished
|
||||
.public ov29_022DE15C
|
||||
.public ov29_022DE854
|
||||
.public ov29_022E0DFC
|
||||
.public ov29_022E0E44
|
||||
.public ov29_022E34B0
|
||||
.public ov29_022E8778
|
||||
.public ov29_022E8BFC
|
||||
.public ov29_022E9FD0
|
||||
.public ov29_022EA370
|
||||
.public ov29_02335760
|
||||
.public ov29_02335774
|
||||
.public ov29_02335804
|
||||
.public ov29_0233A248
|
||||
.public ov29_0234B1A4
|
||||
.public ov29_023510E0
|
||||
.public ov29_02353540
|
||||
.public ov29_02353544
|
||||
.public ov29_0237C696
|
||||
.public ov29_0237C698
|
||||
.public ov29_0237C6A4
|
||||
.public ov29_0237C6B8
|
||||
.public ov29_0237C6D4
|
||||
.public SetMinimapDataE447
|
||||
.public StartFadeDungeonWrapper
|
||||
.public sub_020063F4
|
||||
.public sub_02006564
|
||||
.public sub_02006BFC
|
||||
.public sub_02008F3C
|
||||
.public sub_020090A0
|
||||
.public sub_02009194
|
||||
.public sub_020091B0
|
||||
.public sub_020091CC
|
||||
.public sub_02009454
|
||||
.public sub_020094C4
|
||||
.public sub_0201E380
|
||||
.public UnloadFile
|
||||
.public UnloadWte
|
||||
.public WaitUntilFadeIsFinished
|
||||
|
||||
54
asm/include/overlay_29_022E0A18.inc
Normal file
54
asm/include/overlay_29_022E0A18.inc
Normal file
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
.public AnimationDelayOrSomething
|
||||
.public CopyAndInterleaveWrapper
|
||||
.public DUNGEON_BUTTON_INPUT
|
||||
.public DUNGEON_PTR
|
||||
.public DirectoryFileMngr_OpenDirectoryFile
|
||||
.public DungeonGoesUp
|
||||
.public FadeToBlack
|
||||
.public FillPaletteInitInfo
|
||||
.public GetBgRegionArea
|
||||
.public GetFloorType
|
||||
.public GetHeldButtons
|
||||
.public GetPressedButtons
|
||||
.public GetReleasedStylus
|
||||
.public HandleSir0Translation
|
||||
.public IsCurrentTilesetBackground
|
||||
.public IsTouchScreenUseAnywhere
|
||||
.public LoadObjPalette
|
||||
.public LoadTextureUi
|
||||
.public LoadWteFromFileDirectory
|
||||
.public Memcpy32
|
||||
.public Memset32
|
||||
.public OBJ_GRAPHICS_CONTROLS_PTR
|
||||
.public SetMinimapDataE447
|
||||
.public UnloadFile
|
||||
.public UnloadWte
|
||||
.public _020AFC28
|
||||
.public _020AFC70
|
||||
.public ov10_022C4D54
|
||||
.public ov29_022E8BFC
|
||||
.public ov29_022E9FD0
|
||||
.public ov29_02335760
|
||||
.public ov29_02335774
|
||||
.public ov29_02335804
|
||||
.public ov29_0234B1A4
|
||||
.public ov29_023510E0
|
||||
.public ov29_02353540
|
||||
.public ov29_02353544
|
||||
.public ov29_0237C696
|
||||
.public ov29_0237C698
|
||||
.public ov29_0237C6A4
|
||||
.public ov29_0237C6B8
|
||||
.public ov29_0237C6D4
|
||||
.public sub_020063F4
|
||||
.public sub_02006564
|
||||
.public sub_02006BFC
|
||||
.public sub_02008F3C
|
||||
.public sub_020090A0
|
||||
.public sub_02009194
|
||||
.public sub_020091B0
|
||||
.public sub_020091CC
|
||||
.public sub_02009454
|
||||
.public sub_020094C4
|
||||
.public sub_0201E380
|
||||
@@ -1,31 +1,10 @@
|
||||
#pragma once
|
||||
.public _020AFC70
|
||||
.public AddSimpleObjToOam
|
||||
.public AdvanceFrame
|
||||
.public AreLateGameTrapsEnabled
|
||||
.public CreateMonsterSummaryFromMonster
|
||||
.public DUNGEON_PTR
|
||||
.public EntityIsValid__022ECDC0
|
||||
.public GetMonsterName
|
||||
.public GetRandomSpawnTrapId
|
||||
.public GetStringFromFileVeneer
|
||||
.public GetTile
|
||||
.public GetTileSafe
|
||||
.public InitRender3dElement64
|
||||
.public LoadWteFromFileDirectory
|
||||
.public memset
|
||||
.public MemZero
|
||||
.public OBJ_GRAPHICS_CONTROLS_PTR
|
||||
.public ov29_02352690
|
||||
.public ov29_02352698
|
||||
.public ov29_023526A0
|
||||
.public ov29_0235359C
|
||||
.public ov29_0237C864
|
||||
.public memset
|
||||
.public ov29_0237C974
|
||||
.public ov29_0237C99C
|
||||
.public ProcessWte
|
||||
.public SpawnTrap
|
||||
.public strcpy
|
||||
.public StringFromId
|
||||
.public sub_0201E080
|
||||
.public sub_0201F2A0
|
||||
|
||||
14
asm/include/overlay_29_022ED030.inc
Normal file
14
asm/include/overlay_29_022ED030.inc
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
.public AdvanceFrame
|
||||
.public InitRender3dElement64
|
||||
.public LoadWteFromFileDirectory
|
||||
.public ProcessWte
|
||||
.public StringFromId
|
||||
.public _020AFC70
|
||||
.public ov29_02352690
|
||||
.public ov29_02352698
|
||||
.public ov29_0235359C
|
||||
.public ov29_0237C99C
|
||||
.public strcpy
|
||||
.public sub_0201E080
|
||||
.public sub_0201F2A0
|
||||
11
asm/include/overlay_29_022ED888.inc
Normal file
11
asm/include/overlay_29_022ED888.inc
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
.public AddSimpleObjToOam
|
||||
.public BindTrapToTile
|
||||
.public DUNGEON_PTR
|
||||
.public GetRandomSpawnTrapId
|
||||
.public GetTile
|
||||
.public GetTileSafe
|
||||
.public OBJ_GRAPHICS_CONTROLS_PTR
|
||||
.public SpawnTrap
|
||||
.public ov29_023526A0
|
||||
.public ov29_0237C864
|
||||
@@ -1,97 +1,11 @@
|
||||
#pragma once
|
||||
.public _020AFC70
|
||||
.public _s32_div_f
|
||||
.public abs
|
||||
.public AddSimpleObjToOam
|
||||
.public ConvertWallsToChasms
|
||||
.public CORNER_CARDINAL_NEIGHBOR_IS_OPEN
|
||||
.public DelayWteFree
|
||||
.public DIRECTIONS_XY
|
||||
.public DirectoryFileMngr_OpenDirectoryFile
|
||||
.public DUNGEON_PTR
|
||||
.public DungeonRandInt
|
||||
.public DungeonRandRange
|
||||
.public DungeonScreenEffectActive
|
||||
.public FLOOR_GENERATION_STATUS
|
||||
.public GenerateSecondaryTerrainFormations
|
||||
.public GetBottomScreenOption
|
||||
.public GetFinalKecleonShopSpawnChance
|
||||
.public GetFloorType
|
||||
.public GetHiddenStairsType
|
||||
.public GetKecleonIdToSpawnByFloor
|
||||
.public DrawMinimapTile
|
||||
.public GetLeader
|
||||
.public GetNextFixedRoomAction
|
||||
.public GetTile
|
||||
.public GetTileSafe
|
||||
.public GetTopScreenOption
|
||||
.public GetTrapInfo
|
||||
.public HandleSir0Translation
|
||||
.public HIDDEN_STAIRS_SPAWN_BLOCKED
|
||||
.public InitRender3dElement64
|
||||
.public IsBehaviorLoneOutlaw
|
||||
.public IsCurrentMissionType
|
||||
.public IsCurrentMissionTypeExact
|
||||
.public IsCurrentTilesetBackground
|
||||
.public IsDestinationFloorWithMonster
|
||||
.public IsExperienceLocked
|
||||
.public IsGoldenChamber
|
||||
.public IsHiddenStairsFloor
|
||||
.public IsMapShownOnEitherScreen
|
||||
.public IsOutlawMonsterHouseFloor
|
||||
.public IsSecretBazaar
|
||||
.public LoadFixedRoomData
|
||||
.public LoadWteFromFileDirectory
|
||||
.public LogMessageByIdWithPopupCheckUser
|
||||
.public MAP_COLOR_TABLE
|
||||
.public MarkEnemySpawns
|
||||
.public MarkNonEnemySpawns
|
||||
.public MarkShopkeeperSpawn
|
||||
.public Memcpy32
|
||||
.public MemZero
|
||||
.public MultiplyByFixedPoint
|
||||
.public OBJ_GRAPHICS_CONTROLS_PTR
|
||||
.public ov10_022BFD20
|
||||
.public ov10_022C6326
|
||||
.public ov29_022DE288
|
||||
.public ov29_022E2418
|
||||
.public ov29_022E7F7C
|
||||
.public ov29_022EA408
|
||||
.public ov29_0234217C
|
||||
.public ov29_02342594
|
||||
.public ov29_023427E4
|
||||
.public ov29_02343DC4
|
||||
.public ov29_02343DD8
|
||||
.public ov29_02352F1C
|
||||
.public ov29_02352F40
|
||||
.public ov29_02352F7C
|
||||
.public ov29_02352FCC
|
||||
.public ov29_02352FF4
|
||||
.public ov29_0235352C
|
||||
.public ov29_0235372C
|
||||
.public ov29_02353730
|
||||
.public ov29_0235376C
|
||||
.public ov29_0235377C
|
||||
.public ov29_02353784
|
||||
.public ov29_0237CACC
|
||||
.public ov29_0237CD40
|
||||
.public ov29_0237CFB8
|
||||
.public PlaceFixedRoomTile
|
||||
.public PlayEffectAnimationPos
|
||||
.public PosIsOutOfBounds
|
||||
.public ProcessWte
|
||||
.public ResetHiddenStairsSpawn
|
||||
.public ResetImportantSpawnPositions
|
||||
.public ResetInnerBoundaryTileRows
|
||||
.public SECONDARY_TERRAIN_TYPES
|
||||
.public ShouldMinimapDisplayEntity
|
||||
.public SinAbs4096
|
||||
.public StairsAlwaysReachable
|
||||
.public sub_0200A174
|
||||
.public sub_0200B330
|
||||
.public sub_0200B3FC
|
||||
.public sub_0200C008
|
||||
.public sub_0201F2A0
|
||||
.public TeamMemberHasExclusiveItemEffectActive
|
||||
.public TILESET_PROPERTIES
|
||||
.public UnloadFile
|
||||
.public UpdateTrapsVisibility
|
||||
.public ov29_022E2418
|
||||
|
||||
31
asm/include/overlay_29_023388B0.inc
Normal file
31
asm/include/overlay_29_023388B0.inc
Normal file
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
.public DelayWteFree
|
||||
.public DirectoryFileMngr_OpenDirectoryFile
|
||||
.public DungeonRandInt
|
||||
.public DungeonScreenEffectActive
|
||||
.public GetMinimapData
|
||||
.public HandleSir0Translation
|
||||
.public InitRender3dElement64
|
||||
.public LoadWteFromFileDirectory
|
||||
.public MemZero
|
||||
.public MultiplyByFixedPoint
|
||||
.public ProcessWte
|
||||
.public SinAbs4096
|
||||
.public UnloadFile
|
||||
.public _020AFC70
|
||||
.public ov10_022C6326
|
||||
.public ov29_022DE288
|
||||
.public ov29_022E7F7C
|
||||
.public ov29_02339148
|
||||
.public ov29_02352F1C
|
||||
.public ov29_02352F40
|
||||
.public ov29_02352F7C
|
||||
.public ov29_0235352C
|
||||
.public ov29_0235372C
|
||||
.public ov29_02353730
|
||||
.public ov29_0235376C
|
||||
.public ov29_02353784
|
||||
.public ov29_0237CACC
|
||||
.public ov29_0237CD40
|
||||
.public ov29_0237CFB8
|
||||
.public sub_0201F2A0
|
||||
70
asm/include/overlay_29_02339138.inc
Normal file
70
asm/include/overlay_29_02339138.inc
Normal file
@@ -0,0 +1,70 @@
|
||||
#pragma once
|
||||
.public AddSimpleObjToOam
|
||||
.public CORNER_CARDINAL_NEIGHBOR_IS_OPEN
|
||||
.public ConvertWallsToChasms
|
||||
.public DIRECTIONS_XY
|
||||
.public DUNGEON_PTR
|
||||
.public DungeonRandInt
|
||||
.public DungeonRandRange
|
||||
.public FLOOR_GENERATION_STATUS
|
||||
.public GenerateSecondaryTerrainFormations
|
||||
.public GetBottomScreenOption
|
||||
.public GetFinalKecleonShopSpawnChance
|
||||
.public GetFloorType
|
||||
.public GetHiddenStairsType
|
||||
.public GetKecleonIdToSpawnByFloor
|
||||
.public GetMinimapData
|
||||
.public GetNextFixedRoomAction
|
||||
.public GetTile
|
||||
.public GetTileSafe
|
||||
.public GetTopScreenOption
|
||||
.public GetTrapInfo
|
||||
.public HIDDEN_STAIRS_SPAWN_BLOCKED
|
||||
.public IsBehaviorLoneOutlaw
|
||||
.public IsCurrentMissionType
|
||||
.public IsCurrentMissionTypeExact
|
||||
.public IsCurrentTilesetBackground
|
||||
.public IsDestinationFloorWithMonster
|
||||
.public IsExperienceLocked
|
||||
.public IsGoldenChamber
|
||||
.public IsHiddenStairsFloor
|
||||
.public IsMapShownOnEitherScreen
|
||||
.public IsOutlawMonsterHouseFloor
|
||||
.public LoadFixedRoomData
|
||||
.public MAP_COLOR_TABLE
|
||||
.public MarkEnemySpawns
|
||||
.public MarkNonEnemySpawns
|
||||
.public MarkShopkeeperSpawn
|
||||
.public MemZero
|
||||
.public Memcpy32
|
||||
.public OBJ_GRAPHICS_CONTROLS_PTR
|
||||
.public PlaceFixedRoomTile
|
||||
.public PosIsOutOfBounds
|
||||
.public ResetHiddenStairsSpawn
|
||||
.public ResetImportantSpawnPositions
|
||||
.public ResetInnerBoundaryTileRows
|
||||
.public SECONDARY_TERRAIN_TYPES
|
||||
.public ShouldMinimapDisplayEntity
|
||||
.public StairsAlwaysReachable
|
||||
.public TILESET_PROPERTIES
|
||||
.public _s32_div_f
|
||||
.public abs
|
||||
.public ov10_022BFD20
|
||||
.public ov29_022E7F7C
|
||||
.public ov29_022EA408
|
||||
.public ov29_0233900C
|
||||
.public ov29_0234217C
|
||||
.public ov29_02342594
|
||||
.public ov29_023427E4
|
||||
.public ov29_02343DC4
|
||||
.public ov29_02343DD8
|
||||
.public ov29_02352FCC
|
||||
.public ov29_02352FF4
|
||||
.public ov29_0235352C
|
||||
.public ov29_0235376C
|
||||
.public ov29_0235377C
|
||||
.public ov29_0237CFB8
|
||||
.public sub_0200A174
|
||||
.public sub_0200B330
|
||||
.public sub_0200B3FC
|
||||
.public sub_0200C008
|
||||
File diff suppressed because it is too large
Load Diff
1015
asm/overlay_29_022E0A18.s
Normal file
1015
asm/overlay_29_022E0A18.s
Normal file
File diff suppressed because it is too large
Load Diff
@@ -186,911 +186,3 @@ _022ECFF8:
|
||||
.align 2, 0
|
||||
_022ED004: .word DUNGEON_PTR
|
||||
arm_func_end ov29_022ECFB8
|
||||
|
||||
arm_func_start SetForcedLossReason
|
||||
SetForcedLossReason: ; 0x022ED008
|
||||
ldr r1, _022ED018 ; =DUNGEON_PTR
|
||||
ldr r1, [r1]
|
||||
str r0, [r1, #0x14]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_022ED018: .word DUNGEON_PTR
|
||||
arm_func_end SetForcedLossReason
|
||||
|
||||
arm_func_start GetForcedLossReason
|
||||
GetForcedLossReason: ; 0x022ED01C
|
||||
ldr r0, _022ED02C ; =DUNGEON_PTR
|
||||
ldr r0, [r0]
|
||||
ldr r0, [r0, #0x14]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_022ED02C: .word DUNGEON_PTR
|
||||
arm_func_end GetForcedLossReason
|
||||
|
||||
arm_func_start ov29_022ED030
|
||||
ov29_022ED030: ; 0x022ED030
|
||||
stmdb sp!, {r3, lr}
|
||||
sub sp, sp, #8
|
||||
ldr r1, _022ED0A0 ; =ov29_02352690
|
||||
ldr r2, _022ED0A4 ; =0x00000401
|
||||
ldr r3, [r1, #4]
|
||||
ldr ip, [r1]
|
||||
str r3, [sp, #4]
|
||||
add r0, sp, #0
|
||||
mov r1, #4
|
||||
mov r3, #0x300
|
||||
str ip, [sp]
|
||||
bl LoadWteFromFileDirectory
|
||||
ldr r0, [sp, #4]
|
||||
mov r1, #0x400
|
||||
mov r2, #0x1d
|
||||
mov r3, #0
|
||||
bl ProcessWte
|
||||
ldr r1, [sp, #4]
|
||||
ldr r0, [sp]
|
||||
ldrh r2, [r1, #0xc]
|
||||
ldr r1, _022ED0A8 ; =ov29_0237C99C
|
||||
strh r2, [r1]
|
||||
bl sub_0201E080
|
||||
ldr r0, _022ED0AC ; =ov29_0235359C
|
||||
mov r1, #1
|
||||
strb r1, [r0]
|
||||
add sp, sp, #8
|
||||
ldmia sp!, {r3, pc}
|
||||
.align 2, 0
|
||||
_022ED0A0: .word ov29_02352690
|
||||
#ifdef JAPAN
|
||||
_022ED0A4: .word 0x000003F5
|
||||
#else
|
||||
_022ED0A4: .word 0x00000401
|
||||
#endif
|
||||
_022ED0A8: .word ov29_0237C99C
|
||||
_022ED0AC: .word ov29_0235359C
|
||||
arm_func_end ov29_022ED030
|
||||
|
||||
arm_func_start ov29_022ED0B0
|
||||
ov29_022ED0B0: ; 0x022ED0B0
|
||||
ldr r0, _022ED0C0 ; =ov29_0235359C
|
||||
mov r1, #0
|
||||
strb r1, [r0]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_022ED0C0: .word ov29_0235359C
|
||||
arm_func_end ov29_022ED0B0
|
||||
|
||||
arm_func_start ov29_022ED0C4
|
||||
ov29_022ED0C4: ; 0x022ED0C4
|
||||
ldr r0, _022ED0D0 ; =ov29_0235359C
|
||||
ldrb r0, [r0, #4]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_022ED0D0: .word ov29_0235359C
|
||||
arm_func_end ov29_022ED0C4
|
||||
|
||||
arm_func_start ov29_022ED0D4
|
||||
ov29_022ED0D4: ; 0x022ED0D4
|
||||
cmp r0, #0
|
||||
movlt r0, #0
|
||||
cmp r0, #0xff
|
||||
ldr r1, _022ED0F0 ; =ov29_0235359C
|
||||
movgt r0, #0xff
|
||||
strb r0, [r1, #4]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_022ED0F0: .word ov29_0235359C
|
||||
arm_func_end ov29_022ED0D4
|
||||
|
||||
arm_func_start ov29_022ED0F4
|
||||
ov29_022ED0F4: ; 0x022ED0F4
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, lr}
|
||||
ldr r1, _022ED180 ; =ov29_0235359C
|
||||
mov r4, r0
|
||||
ldrb r7, [r1, #4]
|
||||
cmp r7, #0x80
|
||||
ldmlsia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
cmp r7, #0x80
|
||||
mov r6, #0x80
|
||||
mov r5, #0x68
|
||||
ble _022ED174
|
||||
b _022ED144
|
||||
_022ED120:
|
||||
sub r0, r7, r4
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r7, r0, asr #0x10
|
||||
cmp r7, #0x80
|
||||
movle r7, r6
|
||||
mov r0, r7
|
||||
bl ov29_022ED0D4
|
||||
mov r0, r5
|
||||
bl AdvanceFrame
|
||||
_022ED144:
|
||||
cmp r7, #0x80
|
||||
bne _022ED120
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
_022ED150:
|
||||
add r0, r7, r4
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r7, r0, asr #0x10
|
||||
cmp r7, #0x80
|
||||
movge r7, r6
|
||||
mov r0, r7
|
||||
bl ov29_022ED0D4
|
||||
mov r0, r5
|
||||
bl AdvanceFrame
|
||||
_022ED174:
|
||||
cmp r7, #0x80
|
||||
bne _022ED150
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
_022ED180: .word ov29_0235359C
|
||||
arm_func_end ov29_022ED0F4
|
||||
|
||||
arm_func_start ov29_022ED184
|
||||
ov29_022ED184: ; 0x022ED184
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, lr}
|
||||
sub sp, sp, #0x88
|
||||
ldr r3, _022ED7F0 ; =ov29_0235359C
|
||||
ldrb r3, [r3]
|
||||
cmp r3, #0
|
||||
beq _022ED7E8
|
||||
ldrb r4, [r2, #0x34]
|
||||
cmp r4, #0
|
||||
bne _022ED1D0
|
||||
ldrb r3, [r2, #0x23]
|
||||
cmp r3, #0
|
||||
ldreqb r3, [r2, #0x24]
|
||||
cmpeq r3, #0
|
||||
ldreqb r3, [r2, #0x30]
|
||||
cmpeq r3, #0
|
||||
movne r3, #1
|
||||
moveq r3, #0
|
||||
cmp r3, #0
|
||||
bne _022ED7E8
|
||||
_022ED1D0:
|
||||
cmp r4, #0
|
||||
bne _022ED1E0
|
||||
cmp r1, #0xff
|
||||
bne _022ED370
|
||||
_022ED1E0:
|
||||
add r0, sp, #0x48
|
||||
bl InitRender3dElement64
|
||||
ldr r1, _022ED7F4 ; =ov29_0237C99C
|
||||
ldr r0, _022ED7F8 ; =_020AFC70
|
||||
ldrh r2, [r1]
|
||||
mov r3, #5
|
||||
mov r1, #0x400
|
||||
strb r3, [sp, #0x84]
|
||||
strh r2, [sp, #0x5c]
|
||||
ldr r0, [r0]
|
||||
str r1, [sp, #0x68]
|
||||
ldr r1, [r0, #0xe0]
|
||||
ldr r0, _022ED7F0 ; =ov29_0235359C
|
||||
add r1, r1, #0x3a00
|
||||
str r1, [sp, #0x6c]
|
||||
ldrb r6, [r0, #4]
|
||||
mov r5, #0
|
||||
mov r3, #0x30
|
||||
mov r4, #4
|
||||
mov r1, #0x100
|
||||
mov r2, #0x22
|
||||
add r0, sp, #0x48
|
||||
strb r6, [sp, #0x77]
|
||||
strh r5, [sp, #0x5e]
|
||||
strh r5, [sp, #0x60]
|
||||
strh r4, [sp, #0x62]
|
||||
strh r4, [sp, #0x64]
|
||||
strh r3, [sp, #0x72]
|
||||
strb r2, [sp, #0x86]
|
||||
strh r5, [sp, #0x48]
|
||||
strh r5, [sp, #0x4a]
|
||||
strh r1, [sp, #0x4c]
|
||||
strh r5, [sp, #0x4e]
|
||||
strh r5, [sp, #0x50]
|
||||
strh r3, [sp, #0x52]
|
||||
strh r1, [sp, #0x54]
|
||||
strh r3, [sp, #0x56]
|
||||
bl sub_0201F2A0
|
||||
mov r4, r5
|
||||
mov r3, #0x90
|
||||
mov r2, #0x100
|
||||
mov r1, #0xc0
|
||||
add r0, sp, #0x48
|
||||
strh r4, [sp, #0x48]
|
||||
strh r3, [sp, #0x4a]
|
||||
strh r2, [sp, #0x4c]
|
||||
strh r3, [sp, #0x4e]
|
||||
strh r4, [sp, #0x50]
|
||||
strh r1, [sp, #0x52]
|
||||
strh r2, [sp, #0x54]
|
||||
strh r1, [sp, #0x56]
|
||||
bl sub_0201F2A0
|
||||
mov r3, #0x30
|
||||
mov r2, #0x50
|
||||
mov r1, #0x90
|
||||
add r0, sp, #0x48
|
||||
strh r4, [sp, #0x48]
|
||||
strh r3, [sp, #0x4a]
|
||||
strh r2, [sp, #0x4c]
|
||||
strh r3, [sp, #0x4e]
|
||||
strh r4, [sp, #0x50]
|
||||
strh r1, [sp, #0x52]
|
||||
strh r2, [sp, #0x54]
|
||||
strh r1, [sp, #0x56]
|
||||
bl sub_0201F2A0
|
||||
mov r3, #0xb0
|
||||
mov r2, #0x30
|
||||
mov r1, #0x100
|
||||
mov r0, #0x90
|
||||
strh r3, [sp, #0x48]
|
||||
strh r2, [sp, #0x4a]
|
||||
strh r1, [sp, #0x4c]
|
||||
strh r2, [sp, #0x4e]
|
||||
strh r3, [sp, #0x50]
|
||||
strh r0, [sp, #0x52]
|
||||
strh r1, [sp, #0x54]
|
||||
strh r0, [sp, #0x56]
|
||||
add r0, sp, #0x48
|
||||
bl sub_0201F2A0
|
||||
mov r6, #0x50
|
||||
mov r5, #0x30
|
||||
mov r4, #0xb0
|
||||
mov r3, #0x90
|
||||
mov r2, #0
|
||||
mov r1, #0x60
|
||||
add r0, sp, #0x48
|
||||
strh r6, [sp, #0x48]
|
||||
strh r5, [sp, #0x4a]
|
||||
strh r4, [sp, #0x4c]
|
||||
strh r5, [sp, #0x4e]
|
||||
strh r6, [sp, #0x50]
|
||||
strh r3, [sp, #0x52]
|
||||
strh r4, [sp, #0x54]
|
||||
strh r3, [sp, #0x56]
|
||||
strh r2, [sp, #0x5e]
|
||||
strh r2, [sp, #0x60]
|
||||
strh r1, [sp, #0x62]
|
||||
strh r1, [sp, #0x64]
|
||||
bl sub_0201F2A0
|
||||
b _022ED7E8
|
||||
_022ED370:
|
||||
ldr r6, _022ED7FC ; =ov29_02352698
|
||||
add r5, sp, #0
|
||||
mov r4, #4
|
||||
_022ED37C:
|
||||
ldrh r3, [r6], #2
|
||||
subs r4, r4, #1
|
||||
strh r3, [r5], #2
|
||||
bne _022ED37C
|
||||
mov r3, #0x1c
|
||||
smlabb r3, r1, r3, r0
|
||||
ldr r1, [r3, #0xc]
|
||||
add r0, sp, #8
|
||||
strh r1, [sp]
|
||||
ldr r1, [r3, #0x10]
|
||||
strh r1, [sp, #2]
|
||||
ldr r1, [r3, #0x14]
|
||||
strh r1, [sp, #4]
|
||||
ldr r1, [r3, #0x18]
|
||||
strh r1, [sp, #6]
|
||||
ldrsh r5, [r2, #0xa]
|
||||
ldrsh r4, [r2, #8]
|
||||
bl InitRender3dElement64
|
||||
ldrsh r3, [sp, #2]
|
||||
ldrsh r6, [sp, #4]
|
||||
ldrsh lr, [sp]
|
||||
sub r3, r3, r5
|
||||
ldrsh r2, [sp, #6]
|
||||
mov r1, #5
|
||||
mov r0, #0x400
|
||||
ldr ip, _022ED7F8 ; =_020AFC70
|
||||
mov r3, r3, lsl #0x10
|
||||
sub r6, r6, r4
|
||||
sub lr, lr, r4
|
||||
mov r4, r3, asr #0x10
|
||||
sub r5, r2, r5
|
||||
mov r3, r6, lsl #0x10
|
||||
mov r6, r5, lsl #0x10
|
||||
ldr r7, _022ED7F4 ; =ov29_0237C99C
|
||||
strb r1, [sp, #0x44]
|
||||
ldrh r1, [r7]
|
||||
ldr r5, [ip]
|
||||
str r0, [sp, #0x28]
|
||||
ldr r0, [r5, #0xe0]
|
||||
mov r2, lr, lsl #0x10
|
||||
add r5, r0, #0x3a00
|
||||
str r5, [sp, #0x2c]
|
||||
strh r1, [sp, #0x1c]
|
||||
ldr r0, _022ED7F0 ; =ov29_0235359C
|
||||
mov r1, #0
|
||||
ldrb ip, [r0, #4]
|
||||
mov r7, #4
|
||||
mov r5, #0x30
|
||||
mov r0, #0x22
|
||||
strh r5, [sp, #0x32]
|
||||
strb ip, [sp, #0x37]
|
||||
strh r1, [sp, #0x1e]
|
||||
strh r1, [sp, #0x20]
|
||||
strh r7, [sp, #0x22]
|
||||
strh r7, [sp, #0x24]
|
||||
strb r0, [sp, #0x46]
|
||||
cmp r4, #0
|
||||
mov r5, r2, asr #0x10
|
||||
mov r7, r3, asr #0x10
|
||||
mov r6, r6, asr #0x10
|
||||
ble _022ED4A4
|
||||
mov r0, r4, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
mov r3, #0x100
|
||||
add r0, sp, #8
|
||||
strh r1, [sp, #8]
|
||||
strh r1, [sp, #0xa]
|
||||
strh r3, [sp, #0xc]
|
||||
strh r1, [sp, #0xe]
|
||||
strh r1, [sp, #0x10]
|
||||
strh r2, [sp, #0x12]
|
||||
strh r3, [sp, #0x14]
|
||||
strh r2, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED4A4:
|
||||
cmp r6, #0
|
||||
movlt r0, #0
|
||||
movge r0, r6
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r1, r0, asr #0x10
|
||||
rsb r0, r1, #0xc0
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, asr #0x10
|
||||
cmp r0, #0
|
||||
ble _022ED508
|
||||
add r0, r1, r0
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
mov ip, #0
|
||||
mov r3, #0x100
|
||||
add r0, sp, #8
|
||||
strh ip, [sp, #8]
|
||||
strh r1, [sp, #0xa]
|
||||
strh r3, [sp, #0xc]
|
||||
strh r1, [sp, #0xe]
|
||||
strh ip, [sp, #0x10]
|
||||
strh r2, [sp, #0x12]
|
||||
strh r3, [sp, #0x14]
|
||||
strh r2, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED508:
|
||||
cmp r4, #0
|
||||
movlt r0, #0
|
||||
movge r0, r4
|
||||
mov r0, r0, lsl #0x10
|
||||
sub r1, r6, r0, asr #16
|
||||
cmp r1, #0xc0
|
||||
movgt r1, #0xc0
|
||||
mov ip, r0, asr #0x10
|
||||
cmp r5, #0
|
||||
mov r0, r1, lsl #0x10
|
||||
ble _022ED574
|
||||
add r1, ip, r0, asr #16
|
||||
mov r0, r5, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
mov r3, #0
|
||||
mov r0, r1, lsl #0x10
|
||||
mov r1, r0, asr #0x10
|
||||
add r0, sp, #8
|
||||
strh r3, [sp, #8]
|
||||
strh ip, [sp, #0xa]
|
||||
strh r2, [sp, #0xc]
|
||||
strh ip, [sp, #0xe]
|
||||
strh r3, [sp, #0x10]
|
||||
strh r1, [sp, #0x12]
|
||||
strh r2, [sp, #0x14]
|
||||
strh r1, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED574:
|
||||
cmp r4, #0
|
||||
movlt r0, #0
|
||||
movge r0, r4
|
||||
mov r0, r0, lsl #0x10
|
||||
rsb r1, r7, #0x100
|
||||
mov r2, r1, lsl #0x10
|
||||
sub r3, r6, r0, asr #16
|
||||
cmp r3, #0xc0
|
||||
mov r2, r2, asr #0x10
|
||||
movgt r3, #0xc0
|
||||
mov r1, r0, asr #0x10
|
||||
cmp r2, #0
|
||||
mov r0, r3, lsl #0x10
|
||||
ble _022ED5EC
|
||||
add r3, r7, r2
|
||||
add r2, r1, r0, asr #16
|
||||
mov r0, r3, lsl #0x10
|
||||
mov r3, r0, asr #0x10
|
||||
mov r0, r2, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
add r0, sp, #8
|
||||
strh r7, [sp, #8]
|
||||
strh r1, [sp, #0xa]
|
||||
strh r3, [sp, #0xc]
|
||||
strh r1, [sp, #0xe]
|
||||
strh r7, [sp, #0x10]
|
||||
strh r2, [sp, #0x12]
|
||||
strh r3, [sp, #0x14]
|
||||
strh r2, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED5EC:
|
||||
mvn r0, #0x1f
|
||||
cmp r5, r0
|
||||
cmpgt r4, r0
|
||||
ble _022ED660
|
||||
cmp r5, #0x120
|
||||
cmplt r4, #0xe0
|
||||
bge _022ED660
|
||||
add r0, r5, #0x20
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
mov ip, #0
|
||||
mov r3, #0x30
|
||||
add r1, r4, #0x20
|
||||
mov r0, r1, lsl #0x10
|
||||
mov r1, r0, asr #0x10
|
||||
add r0, sp, #8
|
||||
strh ip, [sp, #0x1e]
|
||||
strh ip, [sp, #0x20]
|
||||
strh r3, [sp, #0x22]
|
||||
strh r3, [sp, #0x24]
|
||||
strh r5, [sp, #8]
|
||||
strh r4, [sp, #0xa]
|
||||
strh r2, [sp, #0xc]
|
||||
strh r4, [sp, #0xe]
|
||||
strh r5, [sp, #0x10]
|
||||
strh r1, [sp, #0x12]
|
||||
strh r2, [sp, #0x14]
|
||||
strh r1, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED660:
|
||||
sub r7, r7, #0x20
|
||||
mov r0, r7, lsl #0x10
|
||||
mvn r1, #0x1f
|
||||
cmp r1, r0, asr #16
|
||||
mov r2, r0, asr #0x10
|
||||
bge _022ED6E4
|
||||
cmp r4, r1
|
||||
ble _022ED6E4
|
||||
cmp r2, #0x120
|
||||
cmplt r4, #0xe0
|
||||
bge _022ED6E4
|
||||
add r0, r2, #0x20
|
||||
mov r0, r0, lsl #0x10
|
||||
mov ip, r0, asr #0x10
|
||||
mov r1, #0x30
|
||||
add r3, r4, #0x20
|
||||
mov r0, r3, lsl #0x10
|
||||
mov r3, r0, asr #0x10
|
||||
mov lr, #0
|
||||
add r0, sp, #8
|
||||
strh r1, [sp, #0x1e]
|
||||
strh lr, [sp, #0x20]
|
||||
strh r1, [sp, #0x22]
|
||||
strh r1, [sp, #0x24]
|
||||
strh r2, [sp, #8]
|
||||
strh r4, [sp, #0xa]
|
||||
strh ip, [sp, #0xc]
|
||||
strh r4, [sp, #0xe]
|
||||
strh r2, [sp, #0x10]
|
||||
strh r3, [sp, #0x12]
|
||||
strh ip, [sp, #0x14]
|
||||
strh r3, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED6E4:
|
||||
sub r4, r6, #0x20
|
||||
mov r0, r4, lsl #0x10
|
||||
mvn r2, #0x1f
|
||||
mov r1, r0, asr #0x10
|
||||
cmp r5, r2
|
||||
cmpgt r1, r2
|
||||
ble _022ED764
|
||||
cmp r5, #0x120
|
||||
cmplt r1, #0xe0
|
||||
bge _022ED764
|
||||
add r0, r5, #0x20
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r3, r0, asr #0x10
|
||||
mov r6, #0x30
|
||||
add r2, r1, #0x20
|
||||
mov r0, r2, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
mov ip, #0
|
||||
add r0, sp, #8
|
||||
strh ip, [sp, #0x1e]
|
||||
strh r6, [sp, #0x20]
|
||||
strh r6, [sp, #0x22]
|
||||
strh r6, [sp, #0x24]
|
||||
strh r5, [sp, #8]
|
||||
strh r1, [sp, #0xa]
|
||||
strh r3, [sp, #0xc]
|
||||
strh r1, [sp, #0xe]
|
||||
strh r5, [sp, #0x10]
|
||||
strh r2, [sp, #0x12]
|
||||
strh r3, [sp, #0x14]
|
||||
strh r2, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED764:
|
||||
mov r0, r7, lsl #0x10
|
||||
mov r1, r4, lsl #0x10
|
||||
mvn r2, #0x1f
|
||||
cmp r2, r0, asr #16
|
||||
mov r5, r0, asr #0x10
|
||||
mov r4, r1, asr #0x10
|
||||
bge _022ED7E8
|
||||
cmp r4, r2
|
||||
ble _022ED7E8
|
||||
cmp r5, #0x120
|
||||
cmplt r4, #0xe0
|
||||
bge _022ED7E8
|
||||
add r0, r5, #0x20
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
mov r3, #0x30
|
||||
add r1, r4, #0x20
|
||||
mov r0, r1, lsl #0x10
|
||||
mov r1, r0, asr #0x10
|
||||
add r0, sp, #8
|
||||
strh r3, [sp, #0x1e]
|
||||
strh r3, [sp, #0x20]
|
||||
strh r3, [sp, #0x22]
|
||||
strh r3, [sp, #0x24]
|
||||
strh r5, [sp, #8]
|
||||
strh r4, [sp, #0xa]
|
||||
strh r2, [sp, #0xc]
|
||||
strh r4, [sp, #0xe]
|
||||
strh r5, [sp, #0x10]
|
||||
strh r1, [sp, #0x12]
|
||||
strh r2, [sp, #0x14]
|
||||
strh r1, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED7E8:
|
||||
add sp, sp, #0x88
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
_022ED7F0: .word ov29_0235359C
|
||||
_022ED7F4: .word ov29_0237C99C
|
||||
_022ED7F8: .word _020AFC70
|
||||
_022ED7FC: .word ov29_02352698
|
||||
arm_func_end ov29_022ED184
|
||||
|
||||
arm_func_start ov29_022ED800
|
||||
ov29_022ED800: ; 0x022ED800
|
||||
stmdb sp!, {r3, lr}
|
||||
cmp r0, #0
|
||||
ldmeqia sp!, {r3, pc}
|
||||
add r3, r0, #0xe900
|
||||
ldrh r3, [r3, #0xec]
|
||||
tst r3, #1
|
||||
ldmneia sp!, {r3, pc}
|
||||
add r0, r0, #0x224
|
||||
add r0, r0, #0xac00
|
||||
bl ov29_022ED184
|
||||
ldmia sp!, {r3, pc}
|
||||
arm_func_end ov29_022ED800
|
||||
|
||||
arm_func_start GetTrapName
|
||||
GetTrapName: ; 0x022ED82C
|
||||
stmdb sp!, {r4, lr}
|
||||
#if defined(EUROPE)
|
||||
add r1, r1, #0xc3
|
||||
add r1, r1, #0x3400
|
||||
#elif defined(JAPAN)
|
||||
add r1, r1, #0x46
|
||||
add r1, r1, #0x4700
|
||||
#else
|
||||
add r1, r1, #0xc1
|
||||
add r1, r1, #0x3400
|
||||
#endif
|
||||
mov r1, r1, lsl #0x10
|
||||
mov r4, r0
|
||||
mov r0, r1, lsr #0x10
|
||||
bl StringFromId
|
||||
mov r1, r0
|
||||
mov r0, r4
|
||||
bl strcpy
|
||||
ldmia sp!, {r4, pc}
|
||||
arm_func_end GetTrapName
|
||||
|
||||
arm_func_start BindTrapToTile
|
||||
BindTrapToTile: ; 0x022ED858
|
||||
cmp r1, #0
|
||||
strne r1, [r0, #0x10]
|
||||
strneb r2, [r1, #0x20]
|
||||
bx lr
|
||||
arm_func_end BindTrapToTile
|
||||
|
||||
arm_func_start AreLateGameTrapsEnabledWrapper
|
||||
AreLateGameTrapsEnabledWrapper: ; 0x022ED868
|
||||
ldr r0, _022ED880 ; =DUNGEON_PTR
|
||||
ldr ip, _022ED884 ; =AreLateGameTrapsEnabled
|
||||
ldr r0, [r0]
|
||||
add r0, r0, #0x4000
|
||||
#ifdef JAPAN
|
||||
ldrb r0, [r0, #0x36]
|
||||
#else
|
||||
ldrb r0, [r0, #0xda]
|
||||
#endif
|
||||
bx ip
|
||||
.align 2, 0
|
||||
_022ED880: .word DUNGEON_PTR
|
||||
_022ED884: .word AreLateGameTrapsEnabled
|
||||
arm_func_end AreLateGameTrapsEnabledWrapper
|
||||
|
||||
arm_func_start SpawnTraps
|
||||
SpawnTraps: ; 0x022ED888
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
sub sp, sp, #8
|
||||
ldr r0, _022ED96C ; =ov29_023526A0
|
||||
mov sl, #0
|
||||
ldrh r1, [r0]
|
||||
ldrh r0, [r0, #2]
|
||||
add r6, sp, #4
|
||||
strh r1, [sp]
|
||||
strh r0, [sp, #2]
|
||||
mov r4, #6
|
||||
mov fp, #2
|
||||
mov r7, sl
|
||||
_022ED8B8:
|
||||
mov r0, sl, lsl #0x10
|
||||
mov r8, r7
|
||||
mov r5, r0, asr #0x10
|
||||
_022ED8C4:
|
||||
mov r0, r8
|
||||
mov r1, sl
|
||||
bl GetTileSafe
|
||||
mov sb, r0
|
||||
ldrh r0, [sb, #2]
|
||||
tst r0, #4
|
||||
beq _022ED94C
|
||||
strh r8, [sp, #4]
|
||||
strh r5, [sp, #6]
|
||||
ldrh r0, [sb, #2]
|
||||
tst r0, #0x40
|
||||
movne r0, r4
|
||||
bne _022ED8FC
|
||||
bl GetRandomSpawnTrapId
|
||||
_022ED8FC:
|
||||
cmp r0, #0x11
|
||||
mov r1, r6
|
||||
bne _022ED92C
|
||||
mov r2, fp
|
||||
mov r3, #0
|
||||
bl SpawnTrap
|
||||
movs r1, r0
|
||||
beq _022ED94C
|
||||
mov r0, sb
|
||||
mov r2, #1
|
||||
bl BindTrapToTile
|
||||
b _022ED94C
|
||||
_022ED92C:
|
||||
mov r2, #0
|
||||
mov r3, r2
|
||||
bl SpawnTrap
|
||||
movs r1, r0
|
||||
beq _022ED94C
|
||||
mov r0, sb
|
||||
mov r2, #0
|
||||
bl BindTrapToTile
|
||||
_022ED94C:
|
||||
add r8, r8, #1
|
||||
cmp r8, #0x38
|
||||
blt _022ED8C4
|
||||
add sl, sl, #1
|
||||
cmp sl, #0x20
|
||||
blt _022ED8B8
|
||||
add sp, sp, #8
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_022ED96C: .word ov29_023526A0
|
||||
arm_func_end SpawnTraps
|
||||
|
||||
arm_func_start SpawnEnemyTrapAtPos
|
||||
SpawnEnemyTrapAtPos: ; 0x022ED970
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, lr}
|
||||
sub sp, sp, #4
|
||||
mov r7, r1
|
||||
mov r6, r2
|
||||
mov r8, r0
|
||||
mov r0, r7
|
||||
mov r1, r6
|
||||
mov r5, r3
|
||||
bl GetTileSafe
|
||||
mov r4, r0
|
||||
add r1, sp, #0
|
||||
mov r0, r8
|
||||
mov r3, r5
|
||||
mov r2, #0
|
||||
strh r7, [sp]
|
||||
strh r6, [sp, #2]
|
||||
bl SpawnTrap
|
||||
movs r1, r0
|
||||
beq _022ED9C8
|
||||
ldrb r2, [sp, #0x20]
|
||||
mov r0, r4
|
||||
bl BindTrapToTile
|
||||
_022ED9C8:
|
||||
add sp, sp, #4
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, pc}
|
||||
arm_func_end SpawnEnemyTrapAtPos
|
||||
|
||||
arm_func_start CreateTrapAndStairsHallucinations
|
||||
CreateTrapAndStairsHallucinations: ; 0x022ED9D0
|
||||
#ifdef JAPAN
|
||||
#define OV29_022ED9D0_OFFSET -0xA4
|
||||
#else
|
||||
#define OV29_022ED9D0_OFFSET 0
|
||||
#endif
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
sub sp, sp, #8
|
||||
ldr r0, _022EDBB8 ; =DUNGEON_PTR
|
||||
ldr r1, _022EDBBC ; =0x0001A21E
|
||||
ldr r0, [r0]
|
||||
ldrsh r2, [r0, r1]
|
||||
add r1, r0, #0x1a000
|
||||
ldrb r8, [r1, #0x244 + OV29_022ED9D0_OFFSET]
|
||||
sub sb, r2, #5
|
||||
b _022EDB9C
|
||||
_022ED9F8:
|
||||
ldr r1, _022EDBC0 ; =0x0001A21C
|
||||
mov r2, #0x18
|
||||
ldrsh r0, [r0, r1]
|
||||
mul sl, sb, r2
|
||||
sub r7, r0, #6
|
||||
mov r0, r1
|
||||
add fp, r0, #8
|
||||
ldr r0, _022EDBC4 ; =0x0000013E
|
||||
ldr r6, _022EDBC8 ; =ov29_0237C864
|
||||
sub r0, r0, #0x1f
|
||||
str r0, [sp, #4]
|
||||
mov r0, r1
|
||||
add r5, r0, #0xa
|
||||
ldr r4, _022EDBCC ; =0xFFFF000F
|
||||
b _022EDB7C
|
||||
_022EDA34:
|
||||
mov r0, #0
|
||||
str r0, [sp]
|
||||
mov r0, r7
|
||||
mov r1, sb
|
||||
bl GetTile
|
||||
ldr r2, [r0, #0x10]
|
||||
cmp r2, #0
|
||||
beq _022EDA74
|
||||
ldr r1, [r2]
|
||||
cmp r1, #2
|
||||
bne _022EDA74
|
||||
ldrb r1, [r2, #0x20]
|
||||
cmp r1, #0
|
||||
cmpeq r8, #0
|
||||
movne r1, #1
|
||||
strne r1, [sp]
|
||||
_022EDA74:
|
||||
ldrh r0, [r0]
|
||||
tst r0, #0x200
|
||||
movne r0, #1
|
||||
strne r0, [sp]
|
||||
ldr r0, [sp]
|
||||
cmp r0, #0
|
||||
beq _022EDB78
|
||||
ldr r0, _022EDBB8 ; =DUNGEON_PTR
|
||||
ldr r3, [r0]
|
||||
mov r0, #0x18
|
||||
mul r2, r7, r0
|
||||
ldrsh r1, [r3, fp]
|
||||
ldrsh r0, [r3, r5]
|
||||
sub r1, r2, r1
|
||||
sub r2, sl, r0
|
||||
cmp r1, r4, asr #11
|
||||
cmpge r2, r4, asr #11
|
||||
blt _022EDB78
|
||||
ldr r0, [sp, #4]
|
||||
cmp r1, r0
|
||||
cmple r2, #0xe0
|
||||
bgt _022EDB78
|
||||
ldrh ip, [r6]
|
||||
add r0, r2, #4
|
||||
add r1, r1, #4
|
||||
bic ip, ip, #0xc00
|
||||
strh ip, [r6]
|
||||
ldrh ip, [r6, #6]
|
||||
and r3, r1, r4, lsr #23
|
||||
mov r0, r0, lsl #0x14
|
||||
and ip, ip, r4
|
||||
strh ip, [r6, #6]
|
||||
ldrh ip, [r6, #6]
|
||||
mov r1, r6
|
||||
mov r2, #0
|
||||
orr r0, ip, r0, lsr #16
|
||||
strh r0, [r6, #6]
|
||||
ldrh r0, [r6, #2]
|
||||
and r0, r0, r4, asr #7
|
||||
strh r0, [r6, #2]
|
||||
ldrh r0, [r6, #2]
|
||||
orr r0, r0, r3
|
||||
strh r0, [r6, #2]
|
||||
ldrh r0, [r6, #4]
|
||||
bic r0, r0, #0xc00
|
||||
strh r0, [r6, #4]
|
||||
ldrh r0, [r6, #4]
|
||||
orr r0, r0, #0xc00
|
||||
strh r0, [r6, #4]
|
||||
ldrh r0, [r6, #4]
|
||||
bic r0, r0, #0xf000
|
||||
strh r0, [r6, #4]
|
||||
ldrh r0, [r6, #4]
|
||||
orr r0, r0, #0xa000
|
||||
strh r0, [r6, #4]
|
||||
ldrh r0, [r6, #4]
|
||||
and r0, r0, r4, asr #6
|
||||
strh r0, [r6, #4]
|
||||
ldrh r3, [r6, #4]
|
||||
orr r0, r3, #0x3e
|
||||
orr r0, r0, #0x100
|
||||
strh r0, [r6, #4]
|
||||
ldr r0, _022EDBD0 ; =OBJ_GRAPHICS_CONTROLS_PTR
|
||||
ldr r0, [r0]
|
||||
bl AddSimpleObjToOam
|
||||
_022EDB78:
|
||||
add r7, r7, #1
|
||||
_022EDB7C:
|
||||
ldr r0, _022EDBB8 ; =DUNGEON_PTR
|
||||
ldr r1, _022EDBC0 ; =0x0001A21C
|
||||
ldr r0, [r0]
|
||||
ldrsh r1, [r0, r1]
|
||||
add r1, r1, #6
|
||||
cmp r7, r1
|
||||
blt _022EDA34
|
||||
add sb, sb, #1
|
||||
_022EDB9C:
|
||||
ldr r1, _022EDBBC ; =0x0001A21E
|
||||
ldrsh r1, [r0, r1]
|
||||
add r1, r1, #5
|
||||
cmp sb, r1
|
||||
blt _022ED9F8
|
||||
add sp, sp, #8
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_022EDBB8: .word DUNGEON_PTR
|
||||
_022EDBBC: .word 0x0001A21E + OV29_022ED9D0_OFFSET
|
||||
_022EDBC0: .word 0x0001A21C + OV29_022ED9D0_OFFSET
|
||||
_022EDBC4: .word 0x0000013E
|
||||
_022EDBC8: .word ov29_0237C864
|
||||
_022EDBCC: .word 0xFFFF000F
|
||||
_022EDBD0: .word OBJ_GRAPHICS_CONTROLS_PTR
|
||||
arm_func_end CreateTrapAndStairsHallucinations
|
||||
|
||||
arm_func_start PrepareTrapperTrap
|
||||
PrepareTrapperTrap: ; 0x022EDBD4
|
||||
#ifdef JAPAN
|
||||
#define PREPARE_TRAPPER_TRAP_OFFSET -0xA4
|
||||
#else
|
||||
#define PREPARE_TRAPPER_TRAP_OFFSET 0
|
||||
#endif
|
||||
stmdb sp!, {r3, r4, r5, lr}
|
||||
ldr lr, _022EDC28 ; =DUNGEON_PTR
|
||||
ldrsh r5, [r0]
|
||||
ldr r3, _022EDC2C ; =0x00012AAA
|
||||
ldr r4, [lr]
|
||||
add ip, r3, #2
|
||||
strh r5, [r4, r3]
|
||||
ldrsh r4, [r0, #2]
|
||||
ldr r0, [lr]
|
||||
mov r3, #1
|
||||
strh r4, [r0, ip]
|
||||
ldr r0, [lr]
|
||||
add r0, r0, #0x12000
|
||||
strb r1, [r0, #0xaae + PREPARE_TRAPPER_TRAP_OFFSET]
|
||||
ldr r0, [lr]
|
||||
add r0, r0, #0x12000
|
||||
strb r2, [r0, #0xaaf + PREPARE_TRAPPER_TRAP_OFFSET]
|
||||
ldr r0, [lr]
|
||||
add r0, r0, #0x12000
|
||||
strb r3, [r0, #0xaa8 + PREPARE_TRAPPER_TRAP_OFFSET]
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
.align 2, 0
|
||||
_022EDC28: .word DUNGEON_PTR
|
||||
_022EDC2C: .word 0x00012AAA + PREPARE_TRAPPER_TRAP_OFFSET
|
||||
arm_func_end PrepareTrapperTrap
|
||||
|
||||
600
asm/overlay_29_022ED030.s
Normal file
600
asm/overlay_29_022ED030.s
Normal file
@@ -0,0 +1,600 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "overlay_29_022ED030.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start ov29_022ED030
|
||||
ov29_022ED030: ; 0x022ED030
|
||||
stmdb sp!, {r3, lr}
|
||||
sub sp, sp, #8
|
||||
ldr r1, _022ED0A0 ; =ov29_02352690
|
||||
ldr r2, _022ED0A4 ; =0x00000401
|
||||
ldr r3, [r1, #4]
|
||||
ldr ip, [r1]
|
||||
str r3, [sp, #4]
|
||||
add r0, sp, #0
|
||||
mov r1, #4
|
||||
mov r3, #0x300
|
||||
str ip, [sp]
|
||||
bl LoadWteFromFileDirectory
|
||||
ldr r0, [sp, #4]
|
||||
mov r1, #0x400
|
||||
mov r2, #0x1d
|
||||
mov r3, #0
|
||||
bl ProcessWte
|
||||
ldr r1, [sp, #4]
|
||||
ldr r0, [sp]
|
||||
ldrh r2, [r1, #0xc]
|
||||
ldr r1, _022ED0A8 ; =ov29_0237C99C
|
||||
strh r2, [r1]
|
||||
bl sub_0201E080
|
||||
ldr r0, _022ED0AC ; =ov29_0235359C
|
||||
mov r1, #1
|
||||
strb r1, [r0]
|
||||
add sp, sp, #8
|
||||
ldmia sp!, {r3, pc}
|
||||
.align 2, 0
|
||||
_022ED0A0: .word ov29_02352690
|
||||
#ifdef JAPAN
|
||||
_022ED0A4: .word 0x000003F5
|
||||
#else
|
||||
_022ED0A4: .word 0x00000401
|
||||
#endif
|
||||
_022ED0A8: .word ov29_0237C99C
|
||||
_022ED0AC: .word ov29_0235359C
|
||||
arm_func_end ov29_022ED030
|
||||
|
||||
arm_func_start ov29_022ED0B0
|
||||
ov29_022ED0B0: ; 0x022ED0B0
|
||||
ldr r0, _022ED0C0 ; =ov29_0235359C
|
||||
mov r1, #0
|
||||
strb r1, [r0]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_022ED0C0: .word ov29_0235359C
|
||||
arm_func_end ov29_022ED0B0
|
||||
|
||||
arm_func_start ov29_022ED0C4
|
||||
ov29_022ED0C4: ; 0x022ED0C4
|
||||
ldr r0, _022ED0D0 ; =ov29_0235359C
|
||||
ldrb r0, [r0, #4]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_022ED0D0: .word ov29_0235359C
|
||||
arm_func_end ov29_022ED0C4
|
||||
|
||||
arm_func_start ov29_022ED0D4
|
||||
ov29_022ED0D4: ; 0x022ED0D4
|
||||
cmp r0, #0
|
||||
movlt r0, #0
|
||||
cmp r0, #0xff
|
||||
ldr r1, _022ED0F0 ; =ov29_0235359C
|
||||
movgt r0, #0xff
|
||||
strb r0, [r1, #4]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_022ED0F0: .word ov29_0235359C
|
||||
arm_func_end ov29_022ED0D4
|
||||
|
||||
arm_func_start ov29_022ED0F4
|
||||
ov29_022ED0F4: ; 0x022ED0F4
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, lr}
|
||||
ldr r1, _022ED180 ; =ov29_0235359C
|
||||
mov r4, r0
|
||||
ldrb r7, [r1, #4]
|
||||
cmp r7, #0x80
|
||||
ldmlsia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
cmp r7, #0x80
|
||||
mov r6, #0x80
|
||||
mov r5, #0x68
|
||||
ble _022ED174
|
||||
b _022ED144
|
||||
_022ED120:
|
||||
sub r0, r7, r4
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r7, r0, asr #0x10
|
||||
cmp r7, #0x80
|
||||
movle r7, r6
|
||||
mov r0, r7
|
||||
bl ov29_022ED0D4
|
||||
mov r0, r5
|
||||
bl AdvanceFrame
|
||||
_022ED144:
|
||||
cmp r7, #0x80
|
||||
bne _022ED120
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
_022ED150:
|
||||
add r0, r7, r4
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r7, r0, asr #0x10
|
||||
cmp r7, #0x80
|
||||
movge r7, r6
|
||||
mov r0, r7
|
||||
bl ov29_022ED0D4
|
||||
mov r0, r5
|
||||
bl AdvanceFrame
|
||||
_022ED174:
|
||||
cmp r7, #0x80
|
||||
bne _022ED150
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
_022ED180: .word ov29_0235359C
|
||||
arm_func_end ov29_022ED0F4
|
||||
|
||||
arm_func_start ov29_022ED184
|
||||
ov29_022ED184: ; 0x022ED184
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, lr}
|
||||
sub sp, sp, #0x88
|
||||
ldr r3, _022ED7F0 ; =ov29_0235359C
|
||||
ldrb r3, [r3]
|
||||
cmp r3, #0
|
||||
beq _022ED7E8
|
||||
ldrb r4, [r2, #0x34]
|
||||
cmp r4, #0
|
||||
bne _022ED1D0
|
||||
ldrb r3, [r2, #0x23]
|
||||
cmp r3, #0
|
||||
ldreqb r3, [r2, #0x24]
|
||||
cmpeq r3, #0
|
||||
ldreqb r3, [r2, #0x30]
|
||||
cmpeq r3, #0
|
||||
movne r3, #1
|
||||
moveq r3, #0
|
||||
cmp r3, #0
|
||||
bne _022ED7E8
|
||||
_022ED1D0:
|
||||
cmp r4, #0
|
||||
bne _022ED1E0
|
||||
cmp r1, #0xff
|
||||
bne _022ED370
|
||||
_022ED1E0:
|
||||
add r0, sp, #0x48
|
||||
bl InitRender3dElement64
|
||||
ldr r1, _022ED7F4 ; =ov29_0237C99C
|
||||
ldr r0, _022ED7F8 ; =_020AFC70
|
||||
ldrh r2, [r1]
|
||||
mov r3, #5
|
||||
mov r1, #0x400
|
||||
strb r3, [sp, #0x84]
|
||||
strh r2, [sp, #0x5c]
|
||||
ldr r0, [r0]
|
||||
str r1, [sp, #0x68]
|
||||
ldr r1, [r0, #0xe0]
|
||||
ldr r0, _022ED7F0 ; =ov29_0235359C
|
||||
add r1, r1, #0x3a00
|
||||
str r1, [sp, #0x6c]
|
||||
ldrb r6, [r0, #4]
|
||||
mov r5, #0
|
||||
mov r3, #0x30
|
||||
mov r4, #4
|
||||
mov r1, #0x100
|
||||
mov r2, #0x22
|
||||
add r0, sp, #0x48
|
||||
strb r6, [sp, #0x77]
|
||||
strh r5, [sp, #0x5e]
|
||||
strh r5, [sp, #0x60]
|
||||
strh r4, [sp, #0x62]
|
||||
strh r4, [sp, #0x64]
|
||||
strh r3, [sp, #0x72]
|
||||
strb r2, [sp, #0x86]
|
||||
strh r5, [sp, #0x48]
|
||||
strh r5, [sp, #0x4a]
|
||||
strh r1, [sp, #0x4c]
|
||||
strh r5, [sp, #0x4e]
|
||||
strh r5, [sp, #0x50]
|
||||
strh r3, [sp, #0x52]
|
||||
strh r1, [sp, #0x54]
|
||||
strh r3, [sp, #0x56]
|
||||
bl sub_0201F2A0
|
||||
mov r4, r5
|
||||
mov r3, #0x90
|
||||
mov r2, #0x100
|
||||
mov r1, #0xc0
|
||||
add r0, sp, #0x48
|
||||
strh r4, [sp, #0x48]
|
||||
strh r3, [sp, #0x4a]
|
||||
strh r2, [sp, #0x4c]
|
||||
strh r3, [sp, #0x4e]
|
||||
strh r4, [sp, #0x50]
|
||||
strh r1, [sp, #0x52]
|
||||
strh r2, [sp, #0x54]
|
||||
strh r1, [sp, #0x56]
|
||||
bl sub_0201F2A0
|
||||
mov r3, #0x30
|
||||
mov r2, #0x50
|
||||
mov r1, #0x90
|
||||
add r0, sp, #0x48
|
||||
strh r4, [sp, #0x48]
|
||||
strh r3, [sp, #0x4a]
|
||||
strh r2, [sp, #0x4c]
|
||||
strh r3, [sp, #0x4e]
|
||||
strh r4, [sp, #0x50]
|
||||
strh r1, [sp, #0x52]
|
||||
strh r2, [sp, #0x54]
|
||||
strh r1, [sp, #0x56]
|
||||
bl sub_0201F2A0
|
||||
mov r3, #0xb0
|
||||
mov r2, #0x30
|
||||
mov r1, #0x100
|
||||
mov r0, #0x90
|
||||
strh r3, [sp, #0x48]
|
||||
strh r2, [sp, #0x4a]
|
||||
strh r1, [sp, #0x4c]
|
||||
strh r2, [sp, #0x4e]
|
||||
strh r3, [sp, #0x50]
|
||||
strh r0, [sp, #0x52]
|
||||
strh r1, [sp, #0x54]
|
||||
strh r0, [sp, #0x56]
|
||||
add r0, sp, #0x48
|
||||
bl sub_0201F2A0
|
||||
mov r6, #0x50
|
||||
mov r5, #0x30
|
||||
mov r4, #0xb0
|
||||
mov r3, #0x90
|
||||
mov r2, #0
|
||||
mov r1, #0x60
|
||||
add r0, sp, #0x48
|
||||
strh r6, [sp, #0x48]
|
||||
strh r5, [sp, #0x4a]
|
||||
strh r4, [sp, #0x4c]
|
||||
strh r5, [sp, #0x4e]
|
||||
strh r6, [sp, #0x50]
|
||||
strh r3, [sp, #0x52]
|
||||
strh r4, [sp, #0x54]
|
||||
strh r3, [sp, #0x56]
|
||||
strh r2, [sp, #0x5e]
|
||||
strh r2, [sp, #0x60]
|
||||
strh r1, [sp, #0x62]
|
||||
strh r1, [sp, #0x64]
|
||||
bl sub_0201F2A0
|
||||
b _022ED7E8
|
||||
_022ED370:
|
||||
ldr r6, _022ED7FC ; =ov29_02352698
|
||||
add r5, sp, #0
|
||||
mov r4, #4
|
||||
_022ED37C:
|
||||
ldrh r3, [r6], #2
|
||||
subs r4, r4, #1
|
||||
strh r3, [r5], #2
|
||||
bne _022ED37C
|
||||
mov r3, #0x1c
|
||||
smlabb r3, r1, r3, r0
|
||||
ldr r1, [r3, #0xc]
|
||||
add r0, sp, #8
|
||||
strh r1, [sp]
|
||||
ldr r1, [r3, #0x10]
|
||||
strh r1, [sp, #2]
|
||||
ldr r1, [r3, #0x14]
|
||||
strh r1, [sp, #4]
|
||||
ldr r1, [r3, #0x18]
|
||||
strh r1, [sp, #6]
|
||||
ldrsh r5, [r2, #0xa]
|
||||
ldrsh r4, [r2, #8]
|
||||
bl InitRender3dElement64
|
||||
ldrsh r3, [sp, #2]
|
||||
ldrsh r6, [sp, #4]
|
||||
ldrsh lr, [sp]
|
||||
sub r3, r3, r5
|
||||
ldrsh r2, [sp, #6]
|
||||
mov r1, #5
|
||||
mov r0, #0x400
|
||||
ldr ip, _022ED7F8 ; =_020AFC70
|
||||
mov r3, r3, lsl #0x10
|
||||
sub r6, r6, r4
|
||||
sub lr, lr, r4
|
||||
mov r4, r3, asr #0x10
|
||||
sub r5, r2, r5
|
||||
mov r3, r6, lsl #0x10
|
||||
mov r6, r5, lsl #0x10
|
||||
ldr r7, _022ED7F4 ; =ov29_0237C99C
|
||||
strb r1, [sp, #0x44]
|
||||
ldrh r1, [r7]
|
||||
ldr r5, [ip]
|
||||
str r0, [sp, #0x28]
|
||||
ldr r0, [r5, #0xe0]
|
||||
mov r2, lr, lsl #0x10
|
||||
add r5, r0, #0x3a00
|
||||
str r5, [sp, #0x2c]
|
||||
strh r1, [sp, #0x1c]
|
||||
ldr r0, _022ED7F0 ; =ov29_0235359C
|
||||
mov r1, #0
|
||||
ldrb ip, [r0, #4]
|
||||
mov r7, #4
|
||||
mov r5, #0x30
|
||||
mov r0, #0x22
|
||||
strh r5, [sp, #0x32]
|
||||
strb ip, [sp, #0x37]
|
||||
strh r1, [sp, #0x1e]
|
||||
strh r1, [sp, #0x20]
|
||||
strh r7, [sp, #0x22]
|
||||
strh r7, [sp, #0x24]
|
||||
strb r0, [sp, #0x46]
|
||||
cmp r4, #0
|
||||
mov r5, r2, asr #0x10
|
||||
mov r7, r3, asr #0x10
|
||||
mov r6, r6, asr #0x10
|
||||
ble _022ED4A4
|
||||
mov r0, r4, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
mov r3, #0x100
|
||||
add r0, sp, #8
|
||||
strh r1, [sp, #8]
|
||||
strh r1, [sp, #0xa]
|
||||
strh r3, [sp, #0xc]
|
||||
strh r1, [sp, #0xe]
|
||||
strh r1, [sp, #0x10]
|
||||
strh r2, [sp, #0x12]
|
||||
strh r3, [sp, #0x14]
|
||||
strh r2, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED4A4:
|
||||
cmp r6, #0
|
||||
movlt r0, #0
|
||||
movge r0, r6
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r1, r0, asr #0x10
|
||||
rsb r0, r1, #0xc0
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r0, r0, asr #0x10
|
||||
cmp r0, #0
|
||||
ble _022ED508
|
||||
add r0, r1, r0
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
mov ip, #0
|
||||
mov r3, #0x100
|
||||
add r0, sp, #8
|
||||
strh ip, [sp, #8]
|
||||
strh r1, [sp, #0xa]
|
||||
strh r3, [sp, #0xc]
|
||||
strh r1, [sp, #0xe]
|
||||
strh ip, [sp, #0x10]
|
||||
strh r2, [sp, #0x12]
|
||||
strh r3, [sp, #0x14]
|
||||
strh r2, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED508:
|
||||
cmp r4, #0
|
||||
movlt r0, #0
|
||||
movge r0, r4
|
||||
mov r0, r0, lsl #0x10
|
||||
sub r1, r6, r0, asr #16
|
||||
cmp r1, #0xc0
|
||||
movgt r1, #0xc0
|
||||
mov ip, r0, asr #0x10
|
||||
cmp r5, #0
|
||||
mov r0, r1, lsl #0x10
|
||||
ble _022ED574
|
||||
add r1, ip, r0, asr #16
|
||||
mov r0, r5, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
mov r3, #0
|
||||
mov r0, r1, lsl #0x10
|
||||
mov r1, r0, asr #0x10
|
||||
add r0, sp, #8
|
||||
strh r3, [sp, #8]
|
||||
strh ip, [sp, #0xa]
|
||||
strh r2, [sp, #0xc]
|
||||
strh ip, [sp, #0xe]
|
||||
strh r3, [sp, #0x10]
|
||||
strh r1, [sp, #0x12]
|
||||
strh r2, [sp, #0x14]
|
||||
strh r1, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED574:
|
||||
cmp r4, #0
|
||||
movlt r0, #0
|
||||
movge r0, r4
|
||||
mov r0, r0, lsl #0x10
|
||||
rsb r1, r7, #0x100
|
||||
mov r2, r1, lsl #0x10
|
||||
sub r3, r6, r0, asr #16
|
||||
cmp r3, #0xc0
|
||||
mov r2, r2, asr #0x10
|
||||
movgt r3, #0xc0
|
||||
mov r1, r0, asr #0x10
|
||||
cmp r2, #0
|
||||
mov r0, r3, lsl #0x10
|
||||
ble _022ED5EC
|
||||
add r3, r7, r2
|
||||
add r2, r1, r0, asr #16
|
||||
mov r0, r3, lsl #0x10
|
||||
mov r3, r0, asr #0x10
|
||||
mov r0, r2, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
add r0, sp, #8
|
||||
strh r7, [sp, #8]
|
||||
strh r1, [sp, #0xa]
|
||||
strh r3, [sp, #0xc]
|
||||
strh r1, [sp, #0xe]
|
||||
strh r7, [sp, #0x10]
|
||||
strh r2, [sp, #0x12]
|
||||
strh r3, [sp, #0x14]
|
||||
strh r2, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED5EC:
|
||||
mvn r0, #0x1f
|
||||
cmp r5, r0
|
||||
cmpgt r4, r0
|
||||
ble _022ED660
|
||||
cmp r5, #0x120
|
||||
cmplt r4, #0xe0
|
||||
bge _022ED660
|
||||
add r0, r5, #0x20
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
mov ip, #0
|
||||
mov r3, #0x30
|
||||
add r1, r4, #0x20
|
||||
mov r0, r1, lsl #0x10
|
||||
mov r1, r0, asr #0x10
|
||||
add r0, sp, #8
|
||||
strh ip, [sp, #0x1e]
|
||||
strh ip, [sp, #0x20]
|
||||
strh r3, [sp, #0x22]
|
||||
strh r3, [sp, #0x24]
|
||||
strh r5, [sp, #8]
|
||||
strh r4, [sp, #0xa]
|
||||
strh r2, [sp, #0xc]
|
||||
strh r4, [sp, #0xe]
|
||||
strh r5, [sp, #0x10]
|
||||
strh r1, [sp, #0x12]
|
||||
strh r2, [sp, #0x14]
|
||||
strh r1, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED660:
|
||||
sub r7, r7, #0x20
|
||||
mov r0, r7, lsl #0x10
|
||||
mvn r1, #0x1f
|
||||
cmp r1, r0, asr #16
|
||||
mov r2, r0, asr #0x10
|
||||
bge _022ED6E4
|
||||
cmp r4, r1
|
||||
ble _022ED6E4
|
||||
cmp r2, #0x120
|
||||
cmplt r4, #0xe0
|
||||
bge _022ED6E4
|
||||
add r0, r2, #0x20
|
||||
mov r0, r0, lsl #0x10
|
||||
mov ip, r0, asr #0x10
|
||||
mov r1, #0x30
|
||||
add r3, r4, #0x20
|
||||
mov r0, r3, lsl #0x10
|
||||
mov r3, r0, asr #0x10
|
||||
mov lr, #0
|
||||
add r0, sp, #8
|
||||
strh r1, [sp, #0x1e]
|
||||
strh lr, [sp, #0x20]
|
||||
strh r1, [sp, #0x22]
|
||||
strh r1, [sp, #0x24]
|
||||
strh r2, [sp, #8]
|
||||
strh r4, [sp, #0xa]
|
||||
strh ip, [sp, #0xc]
|
||||
strh r4, [sp, #0xe]
|
||||
strh r2, [sp, #0x10]
|
||||
strh r3, [sp, #0x12]
|
||||
strh ip, [sp, #0x14]
|
||||
strh r3, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED6E4:
|
||||
sub r4, r6, #0x20
|
||||
mov r0, r4, lsl #0x10
|
||||
mvn r2, #0x1f
|
||||
mov r1, r0, asr #0x10
|
||||
cmp r5, r2
|
||||
cmpgt r1, r2
|
||||
ble _022ED764
|
||||
cmp r5, #0x120
|
||||
cmplt r1, #0xe0
|
||||
bge _022ED764
|
||||
add r0, r5, #0x20
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r3, r0, asr #0x10
|
||||
mov r6, #0x30
|
||||
add r2, r1, #0x20
|
||||
mov r0, r2, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
mov ip, #0
|
||||
add r0, sp, #8
|
||||
strh ip, [sp, #0x1e]
|
||||
strh r6, [sp, #0x20]
|
||||
strh r6, [sp, #0x22]
|
||||
strh r6, [sp, #0x24]
|
||||
strh r5, [sp, #8]
|
||||
strh r1, [sp, #0xa]
|
||||
strh r3, [sp, #0xc]
|
||||
strh r1, [sp, #0xe]
|
||||
strh r5, [sp, #0x10]
|
||||
strh r2, [sp, #0x12]
|
||||
strh r3, [sp, #0x14]
|
||||
strh r2, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED764:
|
||||
mov r0, r7, lsl #0x10
|
||||
mov r1, r4, lsl #0x10
|
||||
mvn r2, #0x1f
|
||||
cmp r2, r0, asr #16
|
||||
mov r5, r0, asr #0x10
|
||||
mov r4, r1, asr #0x10
|
||||
bge _022ED7E8
|
||||
cmp r4, r2
|
||||
ble _022ED7E8
|
||||
cmp r5, #0x120
|
||||
cmplt r4, #0xe0
|
||||
bge _022ED7E8
|
||||
add r0, r5, #0x20
|
||||
mov r0, r0, lsl #0x10
|
||||
mov r2, r0, asr #0x10
|
||||
mov r3, #0x30
|
||||
add r1, r4, #0x20
|
||||
mov r0, r1, lsl #0x10
|
||||
mov r1, r0, asr #0x10
|
||||
add r0, sp, #8
|
||||
strh r3, [sp, #0x1e]
|
||||
strh r3, [sp, #0x20]
|
||||
strh r3, [sp, #0x22]
|
||||
strh r3, [sp, #0x24]
|
||||
strh r5, [sp, #8]
|
||||
strh r4, [sp, #0xa]
|
||||
strh r2, [sp, #0xc]
|
||||
strh r4, [sp, #0xe]
|
||||
strh r5, [sp, #0x10]
|
||||
strh r1, [sp, #0x12]
|
||||
strh r2, [sp, #0x14]
|
||||
strh r1, [sp, #0x16]
|
||||
bl sub_0201F2A0
|
||||
_022ED7E8:
|
||||
add sp, sp, #0x88
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
_022ED7F0: .word ov29_0235359C
|
||||
_022ED7F4: .word ov29_0237C99C
|
||||
_022ED7F8: .word _020AFC70
|
||||
_022ED7FC: .word ov29_02352698
|
||||
arm_func_end ov29_022ED184
|
||||
|
||||
arm_func_start ov29_022ED800
|
||||
ov29_022ED800: ; 0x022ED800
|
||||
stmdb sp!, {r3, lr}
|
||||
cmp r0, #0
|
||||
ldmeqia sp!, {r3, pc}
|
||||
add r3, r0, #0xe900
|
||||
ldrh r3, [r3, #0xec]
|
||||
tst r3, #1
|
||||
ldmneia sp!, {r3, pc}
|
||||
add r0, r0, #0x224
|
||||
add r0, r0, #0xac00
|
||||
bl ov29_022ED184
|
||||
ldmia sp!, {r3, pc}
|
||||
arm_func_end ov29_022ED800
|
||||
|
||||
arm_func_start GetTrapName
|
||||
GetTrapName: ; 0x022ED82C
|
||||
stmdb sp!, {r4, lr}
|
||||
#if defined(EUROPE)
|
||||
add r1, r1, #0xc3
|
||||
add r1, r1, #0x3400
|
||||
#elif defined(JAPAN)
|
||||
add r1, r1, #0x46
|
||||
add r1, r1, #0x4700
|
||||
#else
|
||||
add r1, r1, #0xc1
|
||||
add r1, r1, #0x3400
|
||||
#endif
|
||||
mov r1, r1, lsl #0x10
|
||||
mov r4, r0
|
||||
mov r0, r1, lsr #0x10
|
||||
bl StringFromId
|
||||
mov r1, r0
|
||||
mov r0, r4
|
||||
bl strcpy
|
||||
ldmia sp!, {r4, pc}
|
||||
arm_func_end GetTrapName
|
||||
|
||||
arm_func_start BindTrapToTile
|
||||
BindTrapToTile: ; 0x022ED858
|
||||
cmp r1, #0
|
||||
strne r1, [r0, #0x10]
|
||||
strneb r2, [r1, #0x20]
|
||||
bx lr
|
||||
arm_func_end BindTrapToTile
|
||||
279
asm/overlay_29_022ED888.s
Normal file
279
asm/overlay_29_022ED888.s
Normal file
@@ -0,0 +1,279 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "overlay_29_022ED888.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start SpawnTraps
|
||||
SpawnTraps: ; 0x022ED888
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
sub sp, sp, #8
|
||||
ldr r0, _022ED96C ; =ov29_023526A0
|
||||
mov sl, #0
|
||||
ldrh r1, [r0]
|
||||
ldrh r0, [r0, #2]
|
||||
add r6, sp, #4
|
||||
strh r1, [sp]
|
||||
strh r0, [sp, #2]
|
||||
mov r4, #6
|
||||
mov fp, #2
|
||||
mov r7, sl
|
||||
_022ED8B8:
|
||||
mov r0, sl, lsl #0x10
|
||||
mov r8, r7
|
||||
mov r5, r0, asr #0x10
|
||||
_022ED8C4:
|
||||
mov r0, r8
|
||||
mov r1, sl
|
||||
bl GetTileSafe
|
||||
mov sb, r0
|
||||
ldrh r0, [sb, #2]
|
||||
tst r0, #4
|
||||
beq _022ED94C
|
||||
strh r8, [sp, #4]
|
||||
strh r5, [sp, #6]
|
||||
ldrh r0, [sb, #2]
|
||||
tst r0, #0x40
|
||||
movne r0, r4
|
||||
bne _022ED8FC
|
||||
bl GetRandomSpawnTrapId
|
||||
_022ED8FC:
|
||||
cmp r0, #0x11
|
||||
mov r1, r6
|
||||
bne _022ED92C
|
||||
mov r2, fp
|
||||
mov r3, #0
|
||||
bl SpawnTrap
|
||||
movs r1, r0
|
||||
beq _022ED94C
|
||||
mov r0, sb
|
||||
mov r2, #1
|
||||
bl BindTrapToTile
|
||||
b _022ED94C
|
||||
_022ED92C:
|
||||
mov r2, #0
|
||||
mov r3, r2
|
||||
bl SpawnTrap
|
||||
movs r1, r0
|
||||
beq _022ED94C
|
||||
mov r0, sb
|
||||
mov r2, #0
|
||||
bl BindTrapToTile
|
||||
_022ED94C:
|
||||
add r8, r8, #1
|
||||
cmp r8, #0x38
|
||||
blt _022ED8C4
|
||||
add sl, sl, #1
|
||||
cmp sl, #0x20
|
||||
blt _022ED8B8
|
||||
add sp, sp, #8
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_022ED96C: .word ov29_023526A0
|
||||
arm_func_end SpawnTraps
|
||||
|
||||
arm_func_start SpawnEnemyTrapAtPos
|
||||
SpawnEnemyTrapAtPos: ; 0x022ED970
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, lr}
|
||||
sub sp, sp, #4
|
||||
mov r7, r1
|
||||
mov r6, r2
|
||||
mov r8, r0
|
||||
mov r0, r7
|
||||
mov r1, r6
|
||||
mov r5, r3
|
||||
bl GetTileSafe
|
||||
mov r4, r0
|
||||
add r1, sp, #0
|
||||
mov r0, r8
|
||||
mov r3, r5
|
||||
mov r2, #0
|
||||
strh r7, [sp]
|
||||
strh r6, [sp, #2]
|
||||
bl SpawnTrap
|
||||
movs r1, r0
|
||||
beq _022ED9C8
|
||||
ldrb r2, [sp, #0x20]
|
||||
mov r0, r4
|
||||
bl BindTrapToTile
|
||||
_022ED9C8:
|
||||
add sp, sp, #4
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, pc}
|
||||
arm_func_end SpawnEnemyTrapAtPos
|
||||
|
||||
arm_func_start CreateTrapAndStairsHallucinations
|
||||
CreateTrapAndStairsHallucinations: ; 0x022ED9D0
|
||||
#ifdef JAPAN
|
||||
#define OV29_022ED9D0_OFFSET -0xA4
|
||||
#else
|
||||
#define OV29_022ED9D0_OFFSET 0
|
||||
#endif
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
sub sp, sp, #8
|
||||
ldr r0, _022EDBB8 ; =DUNGEON_PTR
|
||||
ldr r1, _022EDBBC ; =0x0001A21E
|
||||
ldr r0, [r0]
|
||||
ldrsh r2, [r0, r1]
|
||||
add r1, r0, #0x1a000
|
||||
ldrb r8, [r1, #0x244 + OV29_022ED9D0_OFFSET]
|
||||
sub sb, r2, #5
|
||||
b _022EDB9C
|
||||
_022ED9F8:
|
||||
ldr r1, _022EDBC0 ; =0x0001A21C
|
||||
mov r2, #0x18
|
||||
ldrsh r0, [r0, r1]
|
||||
mul sl, sb, r2
|
||||
sub r7, r0, #6
|
||||
mov r0, r1
|
||||
add fp, r0, #8
|
||||
ldr r0, _022EDBC4 ; =0x0000013E
|
||||
ldr r6, _022EDBC8 ; =ov29_0237C864
|
||||
sub r0, r0, #0x1f
|
||||
str r0, [sp, #4]
|
||||
mov r0, r1
|
||||
add r5, r0, #0xa
|
||||
ldr r4, _022EDBCC ; =0xFFFF000F
|
||||
b _022EDB7C
|
||||
_022EDA34:
|
||||
mov r0, #0
|
||||
str r0, [sp]
|
||||
mov r0, r7
|
||||
mov r1, sb
|
||||
bl GetTile
|
||||
ldr r2, [r0, #0x10]
|
||||
cmp r2, #0
|
||||
beq _022EDA74
|
||||
ldr r1, [r2]
|
||||
cmp r1, #2
|
||||
bne _022EDA74
|
||||
ldrb r1, [r2, #0x20]
|
||||
cmp r1, #0
|
||||
cmpeq r8, #0
|
||||
movne r1, #1
|
||||
strne r1, [sp]
|
||||
_022EDA74:
|
||||
ldrh r0, [r0]
|
||||
tst r0, #0x200
|
||||
movne r0, #1
|
||||
strne r0, [sp]
|
||||
ldr r0, [sp]
|
||||
cmp r0, #0
|
||||
beq _022EDB78
|
||||
ldr r0, _022EDBB8 ; =DUNGEON_PTR
|
||||
ldr r3, [r0]
|
||||
mov r0, #0x18
|
||||
mul r2, r7, r0
|
||||
ldrsh r1, [r3, fp]
|
||||
ldrsh r0, [r3, r5]
|
||||
sub r1, r2, r1
|
||||
sub r2, sl, r0
|
||||
cmp r1, r4, asr #11
|
||||
cmpge r2, r4, asr #11
|
||||
blt _022EDB78
|
||||
ldr r0, [sp, #4]
|
||||
cmp r1, r0
|
||||
cmple r2, #0xe0
|
||||
bgt _022EDB78
|
||||
ldrh ip, [r6]
|
||||
add r0, r2, #4
|
||||
add r1, r1, #4
|
||||
bic ip, ip, #0xc00
|
||||
strh ip, [r6]
|
||||
ldrh ip, [r6, #6]
|
||||
and r3, r1, r4, lsr #23
|
||||
mov r0, r0, lsl #0x14
|
||||
and ip, ip, r4
|
||||
strh ip, [r6, #6]
|
||||
ldrh ip, [r6, #6]
|
||||
mov r1, r6
|
||||
mov r2, #0
|
||||
orr r0, ip, r0, lsr #16
|
||||
strh r0, [r6, #6]
|
||||
ldrh r0, [r6, #2]
|
||||
and r0, r0, r4, asr #7
|
||||
strh r0, [r6, #2]
|
||||
ldrh r0, [r6, #2]
|
||||
orr r0, r0, r3
|
||||
strh r0, [r6, #2]
|
||||
ldrh r0, [r6, #4]
|
||||
bic r0, r0, #0xc00
|
||||
strh r0, [r6, #4]
|
||||
ldrh r0, [r6, #4]
|
||||
orr r0, r0, #0xc00
|
||||
strh r0, [r6, #4]
|
||||
ldrh r0, [r6, #4]
|
||||
bic r0, r0, #0xf000
|
||||
strh r0, [r6, #4]
|
||||
ldrh r0, [r6, #4]
|
||||
orr r0, r0, #0xa000
|
||||
strh r0, [r6, #4]
|
||||
ldrh r0, [r6, #4]
|
||||
and r0, r0, r4, asr #6
|
||||
strh r0, [r6, #4]
|
||||
ldrh r3, [r6, #4]
|
||||
orr r0, r3, #0x3e
|
||||
orr r0, r0, #0x100
|
||||
strh r0, [r6, #4]
|
||||
ldr r0, _022EDBD0 ; =OBJ_GRAPHICS_CONTROLS_PTR
|
||||
ldr r0, [r0]
|
||||
bl AddSimpleObjToOam
|
||||
_022EDB78:
|
||||
add r7, r7, #1
|
||||
_022EDB7C:
|
||||
ldr r0, _022EDBB8 ; =DUNGEON_PTR
|
||||
ldr r1, _022EDBC0 ; =0x0001A21C
|
||||
ldr r0, [r0]
|
||||
ldrsh r1, [r0, r1]
|
||||
add r1, r1, #6
|
||||
cmp r7, r1
|
||||
blt _022EDA34
|
||||
add sb, sb, #1
|
||||
_022EDB9C:
|
||||
ldr r1, _022EDBBC ; =0x0001A21E
|
||||
ldrsh r1, [r0, r1]
|
||||
add r1, r1, #5
|
||||
cmp sb, r1
|
||||
blt _022ED9F8
|
||||
add sp, sp, #8
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_022EDBB8: .word DUNGEON_PTR
|
||||
_022EDBBC: .word 0x0001A21E + OV29_022ED9D0_OFFSET
|
||||
_022EDBC0: .word 0x0001A21C + OV29_022ED9D0_OFFSET
|
||||
_022EDBC4: .word 0x0000013E
|
||||
_022EDBC8: .word ov29_0237C864
|
||||
_022EDBCC: .word 0xFFFF000F
|
||||
_022EDBD0: .word OBJ_GRAPHICS_CONTROLS_PTR
|
||||
arm_func_end CreateTrapAndStairsHallucinations
|
||||
|
||||
arm_func_start PrepareTrapperTrap
|
||||
PrepareTrapperTrap: ; 0x022EDBD4
|
||||
#ifdef JAPAN
|
||||
#define PREPARE_TRAPPER_TRAP_OFFSET -0xA4
|
||||
#else
|
||||
#define PREPARE_TRAPPER_TRAP_OFFSET 0
|
||||
#endif
|
||||
stmdb sp!, {r3, r4, r5, lr}
|
||||
ldr lr, _022EDC28 ; =DUNGEON_PTR
|
||||
ldrsh r5, [r0]
|
||||
ldr r3, _022EDC2C ; =0x00012AAA
|
||||
ldr r4, [lr]
|
||||
add ip, r3, #2
|
||||
strh r5, [r4, r3]
|
||||
ldrsh r4, [r0, #2]
|
||||
ldr r0, [lr]
|
||||
mov r3, #1
|
||||
strh r4, [r0, ip]
|
||||
ldr r0, [lr]
|
||||
add r0, r0, #0x12000
|
||||
strb r1, [r0, #0xaae + PREPARE_TRAPPER_TRAP_OFFSET]
|
||||
ldr r0, [lr]
|
||||
add r0, r0, #0x12000
|
||||
strb r2, [r0, #0xaaf + PREPARE_TRAPPER_TRAP_OFFSET]
|
||||
ldr r0, [lr]
|
||||
add r0, r0, #0x12000
|
||||
strb r3, [r0, #0xaa8 + PREPARE_TRAPPER_TRAP_OFFSET]
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
.align 2, 0
|
||||
_022EDC28: .word DUNGEON_PTR
|
||||
_022EDC2C: .word 0x00012AAA + PREPARE_TRAPPER_TRAP_OFFSET
|
||||
arm_func_end PrepareTrapperTrap
|
||||
File diff suppressed because it is too large
Load Diff
666
asm/overlay_29_023388B0.s
Normal file
666
asm/overlay_29_023388B0.s
Normal file
@@ -0,0 +1,666 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "overlay_29_023388B0.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start LoadWeather3DFiles
|
||||
LoadWeather3DFiles: ; 0x023388B0
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
sub sp, sp, #8
|
||||
ldr r0, _02338974 ; =ov29_02352F1C
|
||||
mov sl, #0
|
||||
ldr r1, [r0, #4]
|
||||
ldr r0, [r0]
|
||||
ldr r7, _02338978 ; =ov29_02352F40
|
||||
add r8, sp, #0
|
||||
str r1, [sp, #4]
|
||||
str r0, [sp]
|
||||
mov r6, #4
|
||||
mov r5, #0x300
|
||||
mov fp, sl
|
||||
mov r4, #0x14
|
||||
_023388E8:
|
||||
mul sb, sl, r4
|
||||
ldrh r2, [r7, sb]
|
||||
mov r0, r8
|
||||
mov r1, r6
|
||||
mov r3, r5
|
||||
add sb, r7, sb
|
||||
bl LoadWteFromFileDirectory
|
||||
ldrsh r2, [sb, #8]
|
||||
ldr r0, [sp, #4]
|
||||
ldr r1, [sb, #4]
|
||||
mov r3, fp
|
||||
bl ProcessWte
|
||||
mov r0, r8
|
||||
bl DelayWteFree
|
||||
add sl, sl, #1
|
||||
cmp sl, #3
|
||||
blt _023388E8
|
||||
ldr r0, _0233897C ; =ov29_0237CACC
|
||||
mov r1, #0
|
||||
bl ov29_02338D94
|
||||
ldr r0, _02338980 ; =ov29_0237CD40
|
||||
mov r1, #1
|
||||
bl ov29_02338D94
|
||||
ldr r0, _02338984 ; =ov29_02352F7C
|
||||
ldr r2, _0233897C ; =ov29_0237CACC
|
||||
mov r1, #0
|
||||
ldr r4, [r0]
|
||||
strb r1, [r2, #0x240]
|
||||
ldr r3, [r0, #4]
|
||||
str r4, [r2, #0x254]
|
||||
ldr r0, _02338980 ; =ov29_0237CD40
|
||||
str r3, [r2, #0x258]
|
||||
bl ov29_02338D34
|
||||
add sp, sp, #8
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_02338974: .word ov29_02352F1C
|
||||
_02338978: .word ov29_02352F40
|
||||
_0233897C: .word ov29_0237CACC
|
||||
_02338980: .word ov29_0237CD40
|
||||
_02338984: .word ov29_02352F7C
|
||||
arm_func_end LoadWeather3DFiles
|
||||
|
||||
arm_func_start Weather3DEffectActive
|
||||
Weather3DEffectActive: ; 0x02338988
|
||||
stmdb sp!, {r3, lr}
|
||||
ldr r0, _023389BC ; =ov29_0237CACC
|
||||
bl ov29_02338D58
|
||||
cmp r0, #0
|
||||
bne _023389AC
|
||||
ldr r0, _023389C0 ; =ov29_0237CD40
|
||||
bl ov29_02338D58
|
||||
cmp r0, #0
|
||||
beq _023389B4
|
||||
_023389AC:
|
||||
mov r0, #1
|
||||
ldmia sp!, {r3, pc}
|
||||
_023389B4:
|
||||
mov r0, #0
|
||||
ldmia sp!, {r3, pc}
|
||||
.align 2, 0
|
||||
_023389BC: .word ov29_0237CACC
|
||||
_023389C0: .word ov29_0237CD40
|
||||
arm_func_end Weather3DEffectActive
|
||||
|
||||
arm_func_start ov29_023389C4
|
||||
ov29_023389C4: ; 0x023389C4
|
||||
stmdb sp!, {r4, lr}
|
||||
sub sp, sp, #8
|
||||
mov r4, r0
|
||||
mov r0, #0xc
|
||||
mul r2, r4, r0
|
||||
ldr r1, _02338A3C ; =ov10_022C6326
|
||||
ldr r0, _02338A40 ; =ov29_0237CACC
|
||||
ldrb r1, [r1, r2]
|
||||
bl ov29_02338D34
|
||||
cmp r4, #0xc3
|
||||
bne _02338A34
|
||||
ldr r1, _02338A44 ; =ov29_02352F1C
|
||||
ldr r2, _02338A48 ; =0x000003EB
|
||||
ldr r3, [r1, #0xc]
|
||||
ldr ip, [r1, #8]
|
||||
str r3, [sp, #4]
|
||||
add r0, sp, #0
|
||||
mov r1, #4
|
||||
mov r3, #0
|
||||
str ip, [sp]
|
||||
bl LoadWteFromFileDirectory
|
||||
ldr r0, [sp, #4]
|
||||
mov r1, #0xb000
|
||||
mov r2, #0x14
|
||||
mov r3, #0
|
||||
bl ProcessWte
|
||||
add r0, sp, #0
|
||||
bl DelayWteFree
|
||||
_02338A34:
|
||||
add sp, sp, #8
|
||||
ldmia sp!, {r4, pc}
|
||||
.align 2, 0
|
||||
_02338A3C: .word ov10_022C6326
|
||||
_02338A40: .word ov29_0237CACC
|
||||
_02338A44: .word ov29_02352F1C
|
||||
_02338A48: .word 0x000003EB
|
||||
arm_func_end ov29_023389C4
|
||||
|
||||
arm_func_start ov29_02338A4C
|
||||
ov29_02338A4C: ; 0x02338A4C
|
||||
stmdb sp!, {r4, r5, r6, r7, r8, sb, sl, lr}
|
||||
ldr r1, _02338AB4 ; =ov29_02353730
|
||||
mov r4, r0
|
||||
ldrb r1, [r1, r4, lsl #3]
|
||||
ldr r0, _02338AB8 ; =ov29_0237CD40
|
||||
bl ov29_02338D34
|
||||
ldr r1, _02338ABC ; =ov29_0235372C
|
||||
mov sb, #0
|
||||
ldr r7, [r1, r4, lsl #3]
|
||||
ldr r0, _02338AC0 ; =ov29_0237CACC
|
||||
ldr r5, _02338AB8 ; =ov29_0237CD40
|
||||
str r7, [r0, #0x4e4]
|
||||
mov r6, sb
|
||||
mov r4, #0xc0
|
||||
_02338A84:
|
||||
mla sl, sb, r4, r5
|
||||
mov r8, r6
|
||||
_02338A8C:
|
||||
mov r1, r7
|
||||
add r0, sl, r8, lsl #6
|
||||
bl ov29_02338E50
|
||||
add r8, r8, #1
|
||||
cmp r8, #3
|
||||
blt _02338A8C
|
||||
add sb, sb, #1
|
||||
cmp sb, #3
|
||||
blt _02338A84
|
||||
ldmia sp!, {r4, r5, r6, r7, r8, sb, sl, pc}
|
||||
.align 2, 0
|
||||
_02338AB4: .word ov29_02353730
|
||||
_02338AB8: .word ov29_0237CD40
|
||||
_02338ABC: .word ov29_0235372C
|
||||
_02338AC0: .word ov29_0237CACC
|
||||
arm_func_end ov29_02338A4C
|
||||
|
||||
arm_func_start RenderWeather3D
|
||||
RenderWeather3D: ; 0x02338AC4
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
mov r5, #0
|
||||
_02338ACC:
|
||||
ldr r1, _02338D28 ; =ov29_0237CACC
|
||||
mov r0, #0x274
|
||||
mla r6, r5, r0, r1
|
||||
ldrb r0, [r6, #0x240]
|
||||
cmp r0, #0
|
||||
beq _02338D18
|
||||
bl DungeonScreenEffectActive
|
||||
cmp r0, #0
|
||||
movne r0, #0
|
||||
strneb r0, [r6, #0x26d]
|
||||
bne _02338B04
|
||||
mov r0, r6
|
||||
mov r1, #1
|
||||
bl ov29_02338D6C
|
||||
_02338B04:
|
||||
mov r0, r6
|
||||
bl ov29_02338D58
|
||||
cmp r0, #0
|
||||
beq _02338D18
|
||||
ldr r4, [r6, #0x24c]
|
||||
ldr fp, [r6, #0x250]
|
||||
mov r7, #0
|
||||
_02338B20:
|
||||
mov r0, #0xc0
|
||||
mla sl, r7, r0, r6
|
||||
mov r0, r7, lsl #7
|
||||
add sb, r0, fp, asr #8
|
||||
mov r0, sb, lsl #0x10
|
||||
mov r0, r0, asr #0x10
|
||||
mov r8, #0
|
||||
str r0, [sp]
|
||||
_02338B40:
|
||||
cmp sb, #0xc0
|
||||
bge _02338B74
|
||||
mov r0, r8, lsl #7
|
||||
ldr r1, [r6, #0x244]
|
||||
add r2, r0, r4, asr #8
|
||||
mov r0, r8, lsl #6
|
||||
strh r2, [sl, r0]
|
||||
ldr r2, [sp]
|
||||
add r0, sl, r8, lsl #6
|
||||
strh r2, [r0, #2]
|
||||
mov r1, r1, asr #8
|
||||
strb r1, [r0, #0x2f]
|
||||
bl sub_0201F2A0
|
||||
_02338B74:
|
||||
add r8, r8, #1
|
||||
cmp r8, #3
|
||||
blt _02338B40
|
||||
add r7, r7, #1
|
||||
cmp r7, #3
|
||||
blt _02338B20
|
||||
ldrb r0, [r6, #0x240]
|
||||
cmp r0, #9
|
||||
beq _02338BBC
|
||||
ldr r1, [r6, #0x24c]
|
||||
ldr r0, [r6, #0x254]
|
||||
add r0, r1, r0
|
||||
str r0, [r6, #0x24c]
|
||||
ldr r1, [r6, #0x250]
|
||||
ldr r0, [r6, #0x258]
|
||||
add r0, r1, r0
|
||||
str r0, [r6, #0x250]
|
||||
b _02338C48
|
||||
_02338BBC:
|
||||
ldr r0, [r6, #0x25c]
|
||||
bl SinAbs4096
|
||||
ldr r3, [r6, #0x254]
|
||||
mov r2, #0xa
|
||||
mov r1, r0
|
||||
mul r0, r3, r2
|
||||
bl MultiplyByFixedPoint
|
||||
ldr r1, [r6, #0x24c]
|
||||
add r0, r1, r0
|
||||
str r0, [r6, #0x24c]
|
||||
ldr r0, [r6, #0x260]
|
||||
bl SinAbs4096
|
||||
ldr r3, [r6, #0x258]
|
||||
mov r2, #0xa
|
||||
mov r1, r0
|
||||
mul r0, r3, r2
|
||||
bl MultiplyByFixedPoint
|
||||
ldr r2, [r6, #0x250]
|
||||
ldr r1, _02338D2C ; =0x00000FFF
|
||||
add r0, r2, r0
|
||||
str r0, [r6, #0x250]
|
||||
ldr r2, [r6, #0x25c]
|
||||
ldr r0, [r6, #0x264]
|
||||
add r0, r2, r0
|
||||
str r0, [r6, #0x25c]
|
||||
ldr r2, [r6, #0x260]
|
||||
ldr r0, [r6, #0x268]
|
||||
add r0, r2, r0
|
||||
str r0, [r6, #0x260]
|
||||
ldr r0, [r6, #0x25c]
|
||||
and r0, r0, r1
|
||||
str r0, [r6, #0x25c]
|
||||
ldr r0, [r6, #0x260]
|
||||
and r0, r0, r1
|
||||
str r0, [r6, #0x260]
|
||||
_02338C48:
|
||||
ldr r1, [r6, #0x24c]
|
||||
cmp r1, #0
|
||||
subgt r0, r1, #0x8000
|
||||
strgt r0, [r6, #0x24c]
|
||||
bgt _02338C70
|
||||
mov r0, #0x8000
|
||||
rsb r0, r0, #0
|
||||
cmp r1, r0
|
||||
addlt r0, r1, #0x8000
|
||||
strlt r0, [r6, #0x24c]
|
||||
_02338C70:
|
||||
ldr r1, [r6, #0x250]
|
||||
cmp r1, #0
|
||||
subgt r0, r1, #0x8000
|
||||
strgt r0, [r6, #0x250]
|
||||
bgt _02338C98
|
||||
mov r0, #0x8000
|
||||
rsb r0, r0, #0
|
||||
cmp r1, r0
|
||||
addlt r0, r1, #0x8000
|
||||
strlt r0, [r6, #0x250]
|
||||
_02338C98:
|
||||
ldrb r0, [r6, #0x26e]
|
||||
cmp r0, #0
|
||||
beq _02338CC8
|
||||
ldr r0, [r6, #0x244]
|
||||
add r0, r0, #0x400
|
||||
str r0, [r6, #0x244]
|
||||
cmp r0, #0x4000
|
||||
movge r0, #1
|
||||
strgeb r0, [r6, #0x26c]
|
||||
movge r0, #0
|
||||
strgeb r0, [r6, #0x26e]
|
||||
b _02338D18
|
||||
_02338CC8:
|
||||
ldrb r0, [r6, #0x26c]
|
||||
ldr r1, [r6, #0x244]
|
||||
cmp r0, #0
|
||||
ldr r0, [r6, #0x248]
|
||||
bne _02338CFC
|
||||
sub r0, r1, r0
|
||||
str r0, [r6, #0x244]
|
||||
cmp r0, #0x4000
|
||||
movlt r0, #1
|
||||
strltb r0, [r6, #0x26c]
|
||||
movlt r0, #0x4000
|
||||
strlt r0, [r6, #0x244]
|
||||
b _02338D18
|
||||
_02338CFC:
|
||||
add r0, r1, r0
|
||||
str r0, [r6, #0x244]
|
||||
cmp r0, #0xc000
|
||||
movgt r0, #0
|
||||
strgtb r0, [r6, #0x26c]
|
||||
movgt r0, #0xc000
|
||||
strgt r0, [r6, #0x244]
|
||||
_02338D18:
|
||||
add r5, r5, #1
|
||||
cmp r5, #2
|
||||
blt _02338ACC
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_02338D28: .word ov29_0237CACC
|
||||
_02338D2C: .word 0x00000FFF
|
||||
arm_func_end RenderWeather3D
|
||||
|
||||
arm_func_start ov29_02338D30
|
||||
ov29_02338D30: ; 0x02338D30
|
||||
bx lr
|
||||
arm_func_end ov29_02338D30
|
||||
|
||||
arm_func_start ov29_02338D34
|
||||
ov29_02338D34: ; 0x02338D34
|
||||
ldr r3, _02338D54 ; =ov29_02352F7C
|
||||
strb r1, [r0, #0x240]
|
||||
add r2, r3, r1, lsl #3
|
||||
ldr r3, [r3, r1, lsl #3]
|
||||
ldr r1, [r2, #4]
|
||||
str r3, [r0, #0x254]
|
||||
str r1, [r0, #0x258]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02338D54: .word ov29_02352F7C
|
||||
arm_func_end ov29_02338D34
|
||||
|
||||
arm_func_start ov29_02338D58
|
||||
ov29_02338D58: ; 0x02338D58
|
||||
ldrb r1, [r0, #0x240]
|
||||
cmp r1, #0
|
||||
moveq r0, #0
|
||||
ldrneb r0, [r0, #0x26d]
|
||||
bx lr
|
||||
arm_func_end ov29_02338D58
|
||||
|
||||
arm_func_start ov29_02338D6C
|
||||
ov29_02338D6C: ; 0x02338D6C
|
||||
cmp r1, #0
|
||||
beq _02338D8C
|
||||
ldrb r2, [r0, #0x26d]
|
||||
cmp r2, #0
|
||||
moveq r2, #1
|
||||
streqb r2, [r0, #0x26e]
|
||||
moveq r2, #0
|
||||
streq r2, [r0, #0x244]
|
||||
_02338D8C:
|
||||
strb r1, [r0, #0x26d]
|
||||
bx lr
|
||||
arm_func_end ov29_02338D6C
|
||||
|
||||
arm_func_start ov29_02338D94
|
||||
ov29_02338D94: ; 0x02338D94
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
mov sl, r0
|
||||
mov r0, #0x4000
|
||||
str r0, [sl, #0x244]
|
||||
mov r0, #0
|
||||
str r0, [sl, #0x248]
|
||||
strb r0, [sl, #0x26c]
|
||||
str r0, [sl, #0x24c]
|
||||
str r0, [sl, #0x250]
|
||||
mov r0, #0x400
|
||||
mov sb, r1
|
||||
bl DungeonRandInt
|
||||
str r0, [sl, #0x25c]
|
||||
mov r0, #0x400
|
||||
bl DungeonRandInt
|
||||
str r0, [sl, #0x260]
|
||||
mov r0, #4
|
||||
str r0, [sl, #0x264]
|
||||
mov r0, #1
|
||||
str r0, [sl, #0x268]
|
||||
mov r5, #0
|
||||
strb r0, [sl, #0x26d]
|
||||
strb r5, [sl, #0x26e]
|
||||
str sb, [sl, #0x270]
|
||||
mov fp, r5
|
||||
_02338DF8:
|
||||
mov r0, #0xc0
|
||||
mla r8, r5, r0, sl
|
||||
mov r6, #0
|
||||
_02338E04:
|
||||
add r7, r8, r6, lsl #6
|
||||
mov r0, r7
|
||||
mov r4, r6, lsl #6
|
||||
bl InitRender3dElement64
|
||||
strb fp, [r7, #0x3c]
|
||||
strh fp, [r8, r4]
|
||||
strh fp, [r7, #2]
|
||||
ldr r2, [sl, #0x244]
|
||||
mov r0, r7
|
||||
mov r1, sb
|
||||
strb r2, [r7, #0x2f]
|
||||
bl ov29_02338E50
|
||||
add r6, r6, #1
|
||||
cmp r6, #3
|
||||
blt _02338E04
|
||||
add r5, r5, #1
|
||||
cmp r5, #3
|
||||
blt _02338DF8
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
arm_func_end ov29_02338D94
|
||||
|
||||
arm_func_start ov29_02338E50
|
||||
ov29_02338E50: ; 0x02338E50
|
||||
ldr r3, _02338F08 ; =ov29_02352F40
|
||||
mov r2, #0x14
|
||||
mla r2, r1, r2, r3
|
||||
ldr r3, [r2, #4]
|
||||
mov r1, #0
|
||||
str r3, [r0, #0x20]
|
||||
strh r1, [r0, #0x16]
|
||||
strh r1, [r0, #0x18]
|
||||
mov r1, #0x80
|
||||
strh r1, [r0, #0x1a]
|
||||
strh r1, [r0, #0x1c]
|
||||
ldrh r3, [r0, #0x14]
|
||||
ldr r1, _02338F0C ; =_020AFC70
|
||||
bic r3, r3, #7
|
||||
orr r3, r3, #4
|
||||
strh r3, [r0, #0x14]
|
||||
ldrh r3, [r0, #0x14]
|
||||
bic r3, r3, #0x38
|
||||
orr r3, r3, #0x20
|
||||
strh r3, [r0, #0x14]
|
||||
ldrh r3, [r0, #0x14]
|
||||
bic r3, r3, #0xc0
|
||||
strh r3, [r0, #0x14]
|
||||
ldrh r3, [r0, #0x14]
|
||||
bic r3, r3, #0x700
|
||||
orr r3, r3, #0x300
|
||||
strh r3, [r0, #0x14]
|
||||
ldrh r3, [r0, #0x14]
|
||||
bic r3, r3, #0x1800
|
||||
strh r3, [r0, #0x14]
|
||||
ldrh r3, [r0, #0x14]
|
||||
bic r3, r3, #0x6000
|
||||
strh r3, [r0, #0x14]
|
||||
ldrh r3, [r0, #0x14]
|
||||
orr r3, r3, #0x8000
|
||||
strh r3, [r0, #0x14]
|
||||
ldr r3, [r1]
|
||||
ldrsh r1, [r2, #8]
|
||||
ldr r3, [r3, #0xe0]
|
||||
add r1, r3, r1, lsl #9
|
||||
str r1, [r0, #0x24]
|
||||
ldr r1, [r2, #0xc]
|
||||
strh r1, [r0, #0x2a]
|
||||
ldr r1, [r2, #0x10]
|
||||
strb r1, [r0, #0x3e]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02338F08: .word ov29_02352F40
|
||||
_02338F0C: .word _020AFC70
|
||||
arm_func_end ov29_02338E50
|
||||
|
||||
arm_func_start ov29_02338F10
|
||||
ov29_02338F10: ; 0x02338F10
|
||||
ldr r0, _02338F20 ; =ov29_0235376C
|
||||
mov r1, #0x64
|
||||
strh r1, [r0, #2]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02338F20: .word ov29_0235376C
|
||||
arm_func_end ov29_02338F10
|
||||
|
||||
arm_func_start ov29_02338F24
|
||||
ov29_02338F24: ; 0x02338F24
|
||||
ldr r2, _02338F34 ; =ov29_0235376C
|
||||
strh r0, [r2, #2]
|
||||
strh r1, [r2, #4]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02338F34: .word ov29_0235376C
|
||||
arm_func_end ov29_02338F24
|
||||
|
||||
arm_func_start ov29_02338F38
|
||||
ov29_02338F38: ; 0x02338F38
|
||||
ldr r1, _02338F44 ; =ov29_0237CFB8
|
||||
strb r0, [r1, #2]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02338F44: .word ov29_0237CFB8
|
||||
arm_func_end ov29_02338F38
|
||||
|
||||
arm_func_start ov29_02338F48
|
||||
ov29_02338F48: ; 0x02338F48
|
||||
ldr r1, _02338F54 ; =ov29_0237CFB8
|
||||
strb r0, [r1]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02338F54: .word ov29_0237CFB8
|
||||
arm_func_end ov29_02338F48
|
||||
|
||||
arm_func_start ov29_02338F58
|
||||
ov29_02338F58: ; 0x02338F58
|
||||
ldr r1, _02338F64 ; =ov29_0235376C
|
||||
strb r0, [r1, #1]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02338F64: .word ov29_0235376C
|
||||
arm_func_end ov29_02338F58
|
||||
|
||||
arm_func_start ov29_02338F68
|
||||
ov29_02338F68: ; 0x02338F68
|
||||
stmdb sp!, {r3, lr}
|
||||
ldr r1, _02338FBC ; =0x0000040B
|
||||
ldr r2, _02338FC0 ; =ov29_02353784
|
||||
mov r0, #4
|
||||
mov r3, #0
|
||||
bl DirectoryFileMngr_OpenDirectoryFile
|
||||
ldr r1, _02338FC4 ; =ov29_0235376C
|
||||
add r0, sp, #0
|
||||
ldr r1, [r1, #0x18]
|
||||
bl HandleSir0Translation
|
||||
ldr r1, [sp]
|
||||
ldr r0, _02338FC4 ; =ov29_0235376C
|
||||
str r1, [r0, #8]
|
||||
bl GetMinimapData
|
||||
add r0, r0, #0xe000
|
||||
mov r2, #0
|
||||
ldr r1, _02338FC4 ; =ov29_0235376C
|
||||
strb r2, [r0, #0x447]
|
||||
str r2, [r1, #0xc]
|
||||
strb r2, [r1]
|
||||
ldmia sp!, {r3, pc}
|
||||
.align 2, 0
|
||||
#ifdef JAPAN
|
||||
_02338FBC: .word 0x000003FF
|
||||
#else
|
||||
_02338FBC: .word 0x0000040B
|
||||
#endif
|
||||
_02338FC0: .word ov29_02353784
|
||||
_02338FC4: .word ov29_0235376C
|
||||
arm_func_end ov29_02338F68
|
||||
|
||||
arm_func_start ov29_02338FC8
|
||||
ov29_02338FC8: ; 0x02338FC8
|
||||
stmdb sp!, {r3, lr}
|
||||
ldr r0, _02339000 ; =ov29_0235376C
|
||||
ldr r0, [r0, #8]
|
||||
cmp r0, #0
|
||||
beq _02338FF0
|
||||
ldr r0, _02339004 ; =ov29_02353784
|
||||
bl UnloadFile
|
||||
ldr r0, _02339000 ; =ov29_0235376C
|
||||
mov r1, #0
|
||||
str r1, [r0, #8]
|
||||
_02338FF0:
|
||||
ldr r0, _02339008 ; =ov29_0237CFB8
|
||||
mov r1, #0
|
||||
strb r1, [r0, #2]
|
||||
ldmia sp!, {r3, pc}
|
||||
.align 2, 0
|
||||
_02339000: .word ov29_0235376C
|
||||
_02339004: .word ov29_02353784
|
||||
_02339008: .word ov29_0237CFB8
|
||||
arm_func_end ov29_02338FC8
|
||||
|
||||
arm_func_start ov29_0233900C
|
||||
ov29_0233900C: ; 0x0233900C
|
||||
stmdb sp!, {r3, lr}
|
||||
ldr r0, _02339044 ; =ov29_0235352C
|
||||
ldr r0, [r0]
|
||||
add r0, r0, #0x20
|
||||
bl ov29_022DE288
|
||||
ldr r1, _02339044 ; =ov29_0235352C
|
||||
ldr r2, _02339048 ; =ov29_0235376C
|
||||
ldr r1, [r1]
|
||||
str r0, [r2, #0x10]
|
||||
add r0, r1, #0x2c
|
||||
bl ov29_022DE288
|
||||
ldr r1, _02339048 ; =ov29_0235376C
|
||||
str r0, [r1, #0x14]
|
||||
ldmia sp!, {r3, pc}
|
||||
.align 2, 0
|
||||
_02339044: .word ov29_0235352C
|
||||
_02339048: .word ov29_0235376C
|
||||
arm_func_end ov29_0233900C
|
||||
|
||||
arm_func_start ov29_0233904C
|
||||
ov29_0233904C: ; 0x0233904C
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
mov fp, r0
|
||||
bl GetMinimapData
|
||||
mov r7, r0
|
||||
mov r6, #0
|
||||
add r4, r7, #0x7000
|
||||
_02339064:
|
||||
mov r0, #0x700
|
||||
mul r1, r6, r0
|
||||
mov r0, #0x1c
|
||||
mla sl, r6, r0, r7
|
||||
mov r5, #0
|
||||
add r8, r7, r1
|
||||
add sb, r4, r1
|
||||
_02339080:
|
||||
add r0, r8, r5, lsl #6
|
||||
mov r1, #0x20
|
||||
bl MemZero
|
||||
add r0, sb, r5, lsl #6
|
||||
mov r1, #0x20
|
||||
bl MemZero
|
||||
add r0, sl, r5
|
||||
add r1, r0, #0xe000
|
||||
mov r0, #0
|
||||
add r5, r5, #1
|
||||
strb r0, [r1]
|
||||
cmp r5, #0x1c
|
||||
blt _02339080
|
||||
add r6, r6, #1
|
||||
cmp r6, #0x10
|
||||
blt _02339064
|
||||
cmp fp, #0
|
||||
ldreq r0, _02339110 ; =ov29_0235376C
|
||||
moveq r1, #0x64
|
||||
streqh r1, [r0, #2]
|
||||
streqh r1, [r0, #4]
|
||||
add r0, r7, #0xe000
|
||||
mov r3, #0
|
||||
str r3, [r0, #0x440]
|
||||
mov r2, #1
|
||||
strb r2, [r0, #0x444]
|
||||
ldr r1, _02339114 ; =ov29_0237CFB8
|
||||
strb r3, [r0, #0x446]
|
||||
strb r2, [r1, #3]
|
||||
bl ov29_0233900C
|
||||
bl ov29_022E7F7C
|
||||
ldr r0, _02339114 ; =ov29_0237CFB8
|
||||
mov r1, #1
|
||||
strb r1, [r0, #2]
|
||||
bl ov29_02339148
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_02339110: .word ov29_0235376C
|
||||
_02339114: .word ov29_0237CFB8
|
||||
arm_func_end ov29_0233904C
|
||||
8995
asm/overlay_29_02339138.s
Normal file
8995
asm/overlay_29_02339138.s
Normal file
File diff suppressed because it is too large
Load Diff
10
include/overlay_29_022E0A04.h
Normal file
10
include/overlay_29_022E0A04.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef PMDSKY_OVERLAY_29_022E0A04_H
|
||||
#define PMDSKY_OVERLAY_29_022E0A04_H
|
||||
|
||||
#include "dungeon.h"
|
||||
#include "util.h"
|
||||
|
||||
void SetDungeonEscapeFields(u32 tracker, bool8 end_floor);
|
||||
u32 GetSuccessfulExitTracker(void);
|
||||
|
||||
#endif
|
||||
10
include/overlay_29_022ED01C.h
Normal file
10
include/overlay_29_022ED01C.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef PMDSKY_OVERLAY_29_022ED01C_H
|
||||
#define PMDSKY_OVERLAY_29_022ED01C_H
|
||||
|
||||
#include "dungeon.h"
|
||||
#include "util.h"
|
||||
|
||||
void SetForcedLossReason(enum forced_loss_reason reason);
|
||||
enum forced_loss_reason GetForcedLossReason(void);
|
||||
|
||||
#endif
|
||||
9
include/overlay_29_022ED868.h
Normal file
9
include/overlay_29_022ED868.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef PMDSKY_OVERLAY_29_022ED868_H
|
||||
#define PMDSKY_OVERLAY_29_022ED868_H
|
||||
|
||||
#include "dungeon.h"
|
||||
#include "util.h"
|
||||
|
||||
s32 AreLateGameTrapsEnabledWrapper(void);
|
||||
|
||||
#endif
|
||||
12
include/overlay_29_02338850.h
Normal file
12
include/overlay_29_02338850.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef PMDSKY_OVERLAY_29_02338850_H
|
||||
#define PMDSKY_OVERLAY_29_02338850_H
|
||||
|
||||
#include "dungeon.h"
|
||||
#include "util.h"
|
||||
|
||||
enum hidden_stairs_type GetHiddenStairsField(void);
|
||||
void SetHiddenStairsField(enum hidden_stairs_type value);
|
||||
enum hidden_stairs_type GetHiddenFloorField(void);
|
||||
void SetHiddenFloorField(enum hidden_stairs_type value);
|
||||
|
||||
#endif
|
||||
9
include/overlay_29_02339118.h
Normal file
9
include/overlay_29_02339118.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef PMDSKY_OVERLAY_29_02339118_H
|
||||
#define PMDSKY_OVERLAY_29_02339118_H
|
||||
|
||||
#include "dungeon.h"
|
||||
#include "util.h"
|
||||
|
||||
struct minimap_display_data* GetMinimapData(void);
|
||||
|
||||
#endif
|
||||
10
main.lsf
10
main.lsf
@@ -753,6 +753,8 @@ Overlay OVY_29
|
||||
Object asm/overlay_29_022E0378.o
|
||||
Object src/run_dungeon_1.o
|
||||
Object asm/overlay_29_022E08A0.o
|
||||
Object src/overlay_29_022E0A04.o
|
||||
Object asm/overlay_29_022E0A18.o
|
||||
Object src/overlay_29_022E1610.o
|
||||
Object asm/overlay_29_022E1618.o
|
||||
Object src/dungeon_util_1.o
|
||||
@@ -791,6 +793,10 @@ Overlay OVY_29
|
||||
Object asm/overlay_29_022EC62C.o
|
||||
Object src/overlay_29_022ECDC0.o
|
||||
Object asm/overlay_29_022ECDE4.o
|
||||
Object src/overlay_29_022ED01C.o
|
||||
Object asm/overlay_29_022ED030.o
|
||||
Object src/overlay_29_022ED868.o
|
||||
Object asm/overlay_29_022ED888.o
|
||||
Object src/trap.o
|
||||
Object asm/overlay_29_022EDCBC.o
|
||||
Object src/overlay_29_022EE348.o
|
||||
@@ -1018,6 +1024,10 @@ Overlay OVY_29
|
||||
Object src/overlay_29_02338560.o
|
||||
Object src/overlay_29_02338604.o
|
||||
Object asm/overlay_29_0233861C.o
|
||||
Object src/overlay_29_02338850.o
|
||||
Object asm/overlay_29_023388B0.o
|
||||
Object src/overlay_29_02339118.o
|
||||
Object asm/overlay_29_02339138.o
|
||||
Object src/overlay_29_02340CAC.o
|
||||
Object asm/overlay_29_02340CE4.o
|
||||
Object src/dungeon_generation.o
|
||||
|
||||
17
src/overlay_29_022E0A04.c
Normal file
17
src/overlay_29_022E0A04.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "overlay_29_022E0A04.h"
|
||||
#include "dungeon.h"
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR;
|
||||
|
||||
s32 AreLateGameTrapsEnabled(enum fixed_room_id fixed_room_id);
|
||||
|
||||
void SetDungeonEscapeFields(u32 tracker, bool8 end_floor)
|
||||
{
|
||||
DUNGEON_PTR->successful_exit_tracker = tracker;
|
||||
DUNGEON_PTR->end_floor_no_death_check_flag = end_floor;
|
||||
}
|
||||
|
||||
u32 GetSuccessfulExitTracker(void)
|
||||
{
|
||||
return DUNGEON_PTR->successful_exit_tracker;
|
||||
}
|
||||
16
src/overlay_29_022ED01C.c
Normal file
16
src/overlay_29_022ED01C.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "overlay_29_022ED01C.h"
|
||||
#include "dungeon.h"
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR;
|
||||
|
||||
s32 AreLateGameTrapsEnabled(enum fixed_room_id fixed_room_id);
|
||||
|
||||
void SetForcedLossReason(enum forced_loss_reason reason)
|
||||
{
|
||||
DUNGEON_PTR->forced_loss_reason = reason;
|
||||
}
|
||||
|
||||
enum forced_loss_reason GetForcedLossReason(void)
|
||||
{
|
||||
return DUNGEON_PTR->forced_loss_reason;
|
||||
}
|
||||
11
src/overlay_29_022ED868.c
Normal file
11
src/overlay_29_022ED868.c
Normal file
@@ -0,0 +1,11 @@
|
||||
#include "overlay_29_022ED868.h"
|
||||
#include "dungeon.h"
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR;
|
||||
|
||||
s32 AreLateGameTrapsEnabled(enum fixed_room_id fixed_room_id);
|
||||
|
||||
s32 AreLateGameTrapsEnabledWrapper(void)
|
||||
{
|
||||
return AreLateGameTrapsEnabled(DUNGEON_PTR->gen_info.fixed_room_id);
|
||||
}
|
||||
26
src/overlay_29_02338850.c
Normal file
26
src/overlay_29_02338850.c
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "overlay_29_02338850.h"
|
||||
#include "dungeon.h"
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR;
|
||||
|
||||
s32 AreLateGameTrapsEnabled(enum fixed_room_id fixed_room_id);
|
||||
|
||||
enum hidden_stairs_type GetHiddenStairsField(void)
|
||||
{
|
||||
return DUNGEON_PTR->gen_info.hidden_stairs_type;
|
||||
}
|
||||
|
||||
void SetHiddenStairsField(enum hidden_stairs_type value)
|
||||
{
|
||||
DUNGEON_PTR->gen_info.hidden_stairs_type = value;
|
||||
}
|
||||
|
||||
enum hidden_stairs_type GetHiddenFloorField(void)
|
||||
{
|
||||
return DUNGEON_PTR->gen_info.hidden_floor_type;
|
||||
}
|
||||
|
||||
void SetHiddenFloorField(enum hidden_stairs_type value)
|
||||
{
|
||||
DUNGEON_PTR->gen_info.hidden_floor_type = value;
|
||||
}
|
||||
13
src/overlay_29_02339118.c
Normal file
13
src/overlay_29_02339118.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "overlay_29_02339118.h"
|
||||
#include "dungeon.h"
|
||||
|
||||
extern struct dungeon *DUNGEON_PTR;
|
||||
|
||||
s32 AreLateGameTrapsEnabled(enum fixed_room_id fixed_room_id);
|
||||
|
||||
struct minimap_display_data* GetMinimapData(void)
|
||||
{
|
||||
struct dungeon *dungeon = DUNGEON_PTR;
|
||||
|
||||
return dungeon != NULL ? &dungeon->minimap_display_data : NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user