WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 8e60b1c

Browse files
Merge pull request #83 from chordtoll/main
Disassemble more dungeon functions
2 parents 4be2971 + 79a4a36 commit 8e60b1c

12 files changed

+117
-176
lines changed

asm/include/overlay_29_0231CBEC.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
.public ov29_02305814
104104
.public ov29_0233665C
105105
.public ov29_0233785C
106-
.public ov29_02338530
106+
.public GetDoughSeedFlag
107107
.public ov29_02339FF4
108108
.public ov29_0233FB1C
109109
.public ov29_02344B44

asm/include/overlay_29_02337CCC.inc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
.public GetVictoriesOnOneFloor
1313
.public HiddenStairsTrigger
1414
.public IqSkillIsEnabled
15-
.public IsFullFloorFixedRoom
1615
.public LogMessageByIdWithPopupCheckUser
1716
.public MemAlloc
1817
.public MemFree
@@ -21,7 +20,6 @@
2120
.public RandInt
2221
.public SECONDARY_TERRAIN_TYPES
2322
.public SetVictoriesOnOneFloor
24-
.public TeamMemberHasExclusiveItemEffectActive
2523
.public UpdateTrapsVisibility
2624
.public ov10_022C6327
2725
.public ov29_022E66C4
@@ -30,5 +28,3 @@
3028
.public ov29_02304BAC
3129
.public ov29_02306D54
3230
.public ov29_02336694
33-
.public ov29_02344E88
34-
.public ov29_02352B5C
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#pragma once
2+
.public DUNGEON_PTR
3+
.public IsFullFloorFixedRoom
4+
.public ov29_02344E88
5+
.public ov29_02352B5C

asm/overlay_29_0231CBEC.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ ApplyDoughSeedEffect: ; 0x0231D6E0
893893
ldrb r0, [r0, #6]
894894
cmp r0, #0
895895
bne _0231D730
896-
bl ov29_02338530
896+
bl GetDoughSeedFlag
897897
cmp r0, #0
898898
bne _0231D730
899899
mov r0, #1

asm/overlay_29_02337CCC.s

Lines changed: 0 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -694,165 +694,3 @@ _023384BC: .word 0x00012A5A
694694
_023384BC: .word 0x00012AFE
695695
#endif
696696
arm_func_end ov29_0233847C
697-
698-
arm_func_start ShouldBoostKecleonShopSpawnChance
699-
ShouldBoostKecleonShopSpawnChance: ; 0x023384C0
700-
ldr r0, _023384D4 ; =DUNGEON_PTR
701-
ldr r0, [r0]
702-
add r0, r0, #0x12000
703-
#ifdef JAPAN
704-
ldrb r0, [r0, #0xa80]
705-
#else
706-
ldrb r0, [r0, #0xb24]
707-
#endif
708-
bx lr
709-
.align 2, 0
710-
_023384D4: .word DUNGEON_PTR
711-
arm_func_end ShouldBoostKecleonShopSpawnChance
712-
713-
arm_func_start SetShouldBoostKecleonShopSpawnChance
714-
SetShouldBoostKecleonShopSpawnChance: ; 0x023384D8
715-
ldr r1, _023384EC ; =DUNGEON_PTR
716-
ldr r1, [r1]
717-
add r1, r1, #0x12000
718-
#ifdef JAPAN
719-
strb r0, [r1, #0xa80]
720-
#else
721-
strb r0, [r1, #0xb24]
722-
#endif
723-
bx lr
724-
.align 2, 0
725-
_023384EC: .word DUNGEON_PTR
726-
arm_func_end SetShouldBoostKecleonShopSpawnChance
727-
728-
arm_func_start UpdateShouldBoostKecleonShopSpawnChance
729-
UpdateShouldBoostKecleonShopSpawnChance: ; 0x023384F0
730-
stmdb sp!, {r3, lr}
731-
ldr r0, _0233852C ; =DUNGEON_PTR
732-
mov r2, #0
733-
ldr r1, [r0]
734-
mov r0, #0x5e
735-
add r1, r1, #0x12000
736-
#ifdef JAPAN
737-
strb r2, [r1, #0xa80]
738-
#else
739-
strb r2, [r1, #0xb24]
740-
#endif
741-
bl TeamMemberHasExclusiveItemEffectActive
742-
cmp r0, #0
743-
ldrne r0, _0233852C ; =DUNGEON_PTR
744-
movne r1, #1
745-
ldrne r0, [r0]
746-
addne r0, r0, #0x12000
747-
#ifdef JAPAN
748-
strneb r1, [r0, #0xa80]
749-
#else
750-
strneb r1, [r0, #0xb24]
751-
#endif
752-
ldmia sp!, {r3, pc}
753-
.align 2, 0
754-
_0233852C: .word DUNGEON_PTR
755-
arm_func_end UpdateShouldBoostKecleonShopSpawnChance
756-
757-
arm_func_start ov29_02338530
758-
ov29_02338530: ; 0x02338530
759-
ldr r0, _02338544 ; =DUNGEON_PTR
760-
ldr r0, [r0]
761-
add r0, r0, #0x4000
762-
#ifdef JAPAN
763-
ldrb r0, [r0, #0x24]
764-
#else
765-
ldrb r0, [r0, #0xc8]
766-
#endif
767-
bx lr
768-
.align 2, 0
769-
_02338544: .word DUNGEON_PTR
770-
arm_func_end ov29_02338530
771-
772-
arm_func_start SetDoughSeedFlag
773-
SetDoughSeedFlag: ; 0x02338548
774-
ldr r1, _0233855C ; =DUNGEON_PTR
775-
ldr r1, [r1]
776-
add r1, r1, #0x4000
777-
#ifdef JAPAN
778-
strb r0, [r1, #0x24]
779-
#else
780-
strb r0, [r1, #0xc8]
781-
#endif
782-
bx lr
783-
.align 2, 0
784-
_0233855C: .word DUNGEON_PTR
785-
arm_func_end SetDoughSeedFlag
786-
787-
arm_func_start TrySpawnDoughSeedPoke
788-
TrySpawnDoughSeedPoke: ; 0x02338560
789-
stmdb sp!, {r3, lr}
790-
ldr r0, _023385BC ; =DUNGEON_PTR
791-
ldr r0, [r0]
792-
add r0, r0, #0x4000
793-
#ifdef JAPAN
794-
ldrb r0, [r0, #0x24]
795-
#else
796-
ldrb r0, [r0, #0xc8]
797-
#endif
798-
cmp r0, #0
799-
ldmeqia sp!, {r3, pc}
800-
bl IsFullFloorFixedRoom
801-
cmp r0, #0
802-
bne _023385A4
803-
ldr r1, _023385C0 ; =ov29_02352B5C
804-
add r0, sp, #0
805-
ldrh r2, [r1]
806-
strh r2, [sp]
807-
ldrh r1, [r1, #2]
808-
strh r1, [sp, #2]
809-
bl ov29_02344E88
810-
_023385A4:
811-
ldr r0, _023385BC ; =DUNGEON_PTR
812-
mov r1, #0
813-
ldr r0, [r0]
814-
add r0, r0, #0x4000
815-
#ifdef JAPAN
816-
strb r1, [r0, #0x24]
817-
#else
818-
strb r1, [r0, #0xc8]
819-
#endif
820-
ldmia sp!, {r3, pc}
821-
.align 2, 0
822-
_023385BC: .word DUNGEON_PTR
823-
_023385C0: .word ov29_02352B5C
824-
arm_func_end TrySpawnDoughSeedPoke
825-
826-
arm_func_start IsSecretBazaar
827-
IsSecretBazaar: ; 0x023385C4
828-
ldr r0, _023385E8 ; =DUNGEON_PTR
829-
ldr r0, [r0]
830-
add r0, r0, #0x4000
831-
#ifdef JAPAN
832-
ldrb r0, [r0, #0x36]
833-
#else
834-
ldrb r0, [r0, #0xda]
835-
#endif
836-
cmp r0, #0x70
837-
moveq r0, #1
838-
movne r0, #0
839-
and r0, r0, #0xff
840-
bx lr
841-
.align 2, 0
842-
_023385E8: .word DUNGEON_PTR
843-
arm_func_end IsSecretBazaar
844-
845-
arm_func_start ShouldBoostHiddenStairsSpawnChance
846-
ShouldBoostHiddenStairsSpawnChance: ; 0x023385EC
847-
ldr r0, _02338600 ; =DUNGEON_PTR
848-
ldr r0, [r0]
849-
add r0, r0, #0x12000
850-
#ifdef JAPAN
851-
ldrb r0, [r0, #0xa81]
852-
#else
853-
ldrb r0, [r0, #0xb25]
854-
#endif
855-
bx lr
856-
.align 2, 0
857-
_02338600: .word DUNGEON_PTR
858-
arm_func_end ShouldBoostHiddenStairsSpawnChance

asm/overlay_29_02338560.s

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.include "asm/macros.inc"
2+
.include "overlay_29_02338560.inc"
3+
4+
.text
5+
6+
arm_func_start TrySpawnDoughSeedPoke
7+
TrySpawnDoughSeedPoke: ; 0x02338560
8+
stmdb sp!, {r3, lr}
9+
ldr r0, _023385BC ; =DUNGEON_PTR
10+
ldr r0, [r0]
11+
add r0, r0, #0x4000
12+
#ifdef JAPAN
13+
ldrb r0, [r0, #0x24]
14+
#else
15+
ldrb r0, [r0, #0xc8]
16+
#endif
17+
cmp r0, #0
18+
ldmeqia sp!, {r3, pc}
19+
bl IsFullFloorFixedRoom
20+
cmp r0, #0
21+
bne _023385A4
22+
ldr r1, _023385C0 ; =ov29_02352B5C
23+
add r0, sp, #0
24+
ldrh r2, [r1]
25+
strh r2, [sp]
26+
ldrh r1, [r1, #2]
27+
strh r1, [sp, #2]
28+
bl ov29_02344E88
29+
_023385A4:
30+
ldr r0, _023385BC ; =DUNGEON_PTR
31+
mov r1, #0
32+
ldr r0, [r0]
33+
add r0, r0, #0x4000
34+
#ifdef JAPAN
35+
strb r1, [r0, #0x24]
36+
#else
37+
strb r1, [r0, #0xc8]
38+
#endif
39+
ldmia sp!, {r3, pc}
40+
.align 2, 0
41+
_023385BC: .word DUNGEON_PTR
42+
_023385C0: .word ov29_02352B5C
43+
arm_func_end TrySpawnDoughSeedPoke

include/dungeon.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,10 @@ struct dungeon {
10161016
u8 field_0x3b1c;
10171017
u8 field_0x3b1d;
10181018
u8 field_0x3b1e;
1019+
// TODO Something is omitted from the dungeon struct in JP, but it is not known what is missing.
1020+
// For the time being, take out these unknown fields from JP to allow JP usage of this struct to match.
1021+
// As more functions are decomped, move this conditional up the struct until we find where the actual difference is in the struct.
1022+
#ifndef JAPAN
10191023
u8 field_0x3b1f;
10201024
u8 field_0x3b20;
10211025
u8 field_0x3b21;
@@ -1101,6 +1105,7 @@ struct dungeon {
11011105
u8 field_0x3b71;
11021106
u8 field_0x3b72;
11031107
u8 field_0x3b73;
1108+
#endif
11041109
// 0x3B74: Unknown array, likely one entry per monster species. This might be related to
11051110
// the IQ skill Exp. Go-Getter so the AI knows which monsters to prioritize.
11061111
u8 unknown_array_0x3B74[600];
@@ -1372,11 +1377,7 @@ struct dungeon {
13721377

13731378
// TODO Something is omitted from the dungeon struct in JP, but it is not known what is missing.
13741379
// For the time being, take some bytes out of this array to allow JP usage of this struct to match.
1375-
#ifdef JAPAN
1376-
u8 unknown_file_buffer_0x12162[2268];
1377-
#else
13781380
u8 unknown_file_buffer_0x12162[2352];
1379-
#endif
13801381
// 0x12A92: Unknown array, probably related to unknown_tile_matrix
13811382
// since they get initialized together.
13821383
u16 unknown_array_0x12A92[9];

include/overlay_29_02338548.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef PMDSKY_OVERLAY_29_02338548_H
2+
#define PMDSKY_OVERLAY_29_02338548_H
3+
4+
#include "util.h"
5+
6+
bool ShouldBoostKecleonShopSpawnChance(void);
7+
void SetShouldBoostKecleonShopSpawnChance(bool boost);
8+
void UpdateShouldBoostKecleonShopSpawnChance(void);
9+
bool GetDoughSeedFlag(void);
10+
void SetDoughSeedFlag(bool flag);
11+
12+
#endif //PMDSKY_OVERLAY_29_02338548_H

include/overlay_29_02338604.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef PMDSKY_OVERLAY_29_02338604_H
22
#define PMDSKY_OVERLAY_29_02338604_H
33

4+
u8 IsSecretBazaar();
5+
u8 ShouldBoostHiddenStairsSpawnChance();
46
void SetShouldBoostHiddenStairsSpawnChance(u8 should_boost);
57

68
#endif //PMDSKY_OVERLAY_29_02338604_H

main.lsf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ Overlay OVY_29
311311
Object asm/overlay_29_023350FC.o
312312
Object src/overlay_29_02337CA8.o
313313
Object asm/overlay_29_02337CCC.o
314+
Object src/overlay_29_02338548.o
315+
Object asm/overlay_29_02338560.o
314316
Object src/overlay_29_02338604.o
315317
Object asm/overlay_29_0233861C.o
316318
Object src/overlay_29_02344AF8.o

0 commit comments

Comments
 (0)