summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/code_804AFAC.s (renamed from asm/code_804AF74.s)32
-rw-r--r--include/tile_types.h2
-rwxr-xr-xld_script.txt2
-rw-r--r--src/tile_types.c15
4 files changed, 16 insertions, 35 deletions
diff --git a/asm/code_804AF74.s b/asm/code_804AFAC.s
index 12fa236..ccfc75d 100644
--- a/asm/code_804AF74.s
+++ b/asm/code_804AFAC.s
@@ -5,38 +5,6 @@
.text
- thumb_func_start IsWaterTileset
-IsWaterTileset:
- push {lr}
- ldr r0, _0804AF9C
- ldr r0, [r0]
- ldr r1, _0804AFA0
- adds r0, r1
- movs r1, 0
- ldrsh r0, [r0, r1]
- cmp r0, 0
- beq _0804AF96
- cmp r0, 0x31
- beq _0804AF96
- cmp r0, 0x20
- beq _0804AF96
- cmp r0, 0x21
- beq _0804AF96
- cmp r0, 0x36
- bne _0804AFA4
-_0804AF96:
- movs r0, 0x1
- b _0804AFA6
- .align 2, 0
-_0804AF9C: .4byte gDungeonGlobalData
-_0804AFA0: .4byte 0x00003a0e
-_0804AFA4:
- movs r0, 0
-_0804AFA6:
- pop {r1}
- bx r1
- thumb_func_end IsWaterTileset
-
thumb_func_start sub_804AFAC
sub_804AFAC:
push {r4-r7,lr}
diff --git a/include/tile_types.h b/include/tile_types.h
index 2096201..f1bc412 100644
--- a/include/tile_types.h
+++ b/include/tile_types.h
@@ -9,5 +9,7 @@
// 0x4AF20
bool8 IsTileGround(struct MapTile* tile);
+// 0x4AF74
+bool8 IsWaterTileset();
#endif
diff --git a/ld_script.txt b/ld_script.txt
index 4885780..895844e 100755
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -202,7 +202,7 @@ SECTIONS {
src/dungeon_map_access.o(.text);
asm/code_80495E4.o(.text);
src/tile_types.o(.text);
- asm/code_804AF74.o(.text);
+ asm/code_804AFAC.o(.text);
src/code_80521D0.o(.text);
asm/code_80521D0.o(.text);
src/charge_move.o(.text);
diff --git a/src/tile_types.c b/src/tile_types.c
index fe28d9d..cad63fa 100644
--- a/src/tile_types.c
+++ b/src/tile_types.c
@@ -82,8 +82,6 @@ const u8 gDungeonWaterType[] = {
DUNGEON_WATER_TYPE_NONE,
};
-extern bool8 IsWaterTileset();
-
bool8 IsTileGround(struct MapTile* tile)
{
bool8 isGround = FALSE;
@@ -101,3 +99,16 @@ bool8 IsTileGround(struct MapTile* tile)
}
return isGround;
}
+
+bool8 IsWaterTileset()
+{
+ if (gDungeonGlobalData->tileset == 0 ||
+ gDungeonGlobalData->tileset == 0x31 ||
+ gDungeonGlobalData->tileset == 0x20 ||
+ gDungeonGlobalData->tileset == 0x21 ||
+ gDungeonGlobalData->tileset == 0x36)
+ {
+ return TRUE;
+ }
+ return FALSE;
+}