shithub: pokecrystal

Download patch

ref: 754268c6911a24d05c8775783ee708b0f06c5c98
parent: 4ab60eb2d2898c21af540a605b48911954ec4c45
parent: a73ced3b692f100a347bf1785d670ff410ad3657
author: Rangi <35663410+Rangi42@users.noreply.github.com>
date: Tue Feb 25 14:44:07 EST 2020

Merge pull request #690 from Rangi42/master

Identify some labels and constants for Battle Tower

--- a/constants/collision_constants.asm
+++ b/constants/collision_constants.asm
@@ -20,14 +20,14 @@
 COLL_CUT_TREE_1A       EQU $1a ; unused
 COLL_LONG_GRASS_1C     EQU $1c ; unused
 COLL_HEADBUTT_TREE_1D  EQU $1d ; unused
-COLL_WATER_21          EQU $21 ; ???
+COLL_WATER_21          EQU $21 ; unused
 COLL_ICE               EQU $23
 COLL_WHIRLPOOL         EQU $24
 COLL_BUOY              EQU $27
 COLL_CUT_28            EQU $28 ; garbage
 COLL_WATER             EQU $29
-COLL_ICE_2B            EQU $2b ; unused
-COLL_WHIRLPOOL_2C      EQU $2c ; unused
+COLL_ICE_2B            EQU $2b ; 
+COLL_WHIRLPOOL_2C      EQU $2c ; 
 COLL_WATERFALL_RIGHT   EQU $30 ; unused
 COLL_WATERFALL_LEFT    EQU $31 ; unused
 COLL_WATERFALL_UP      EQU $32 ; unused
--- a/data/tilesets/unused_dark_cave_collision.asm
+++ /dev/null
@@ -1,128 +1,0 @@
-	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 00
-	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 01
-	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 02
-	tilecoll TALL_GRASS_10, TALL_GRASS_10, TALL_GRASS_10, TALL_GRASS_10 ; 03
-	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 04
-	tilecoll WALL, WALL, WALL, WALL ; 05
-	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 06
-	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 07
-	tilecoll WALL, WALL, WALL, WALL ; 08
-	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 09
-	tilecoll WALL, WALL, WALL, WALL ; 0a
-	tilecoll WARP_CARPET_LEFT, FLOOR, WARP_CARPET_LEFT, FLOOR ; 0b
-	tilecoll FLOOR, FLOOR, FLOOR, WALL ; 0c
-	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 0d
-	tilecoll FLOOR, WARP_CARPET_RIGHT, FLOOR, WARP_CARPET_RIGHT ; 0e
-	tilecoll WALL, WALL, WALL, WALL ; 0f
-	tilecoll WALL, WALL, WALL, WALL ; 10
-	tilecoll WALL, WALL, WALL, WALL ; 11
-	tilecoll WALL, WALL, WALL, WALL ; 12
-	tilecoll WALL, WALL, WALL, WALL ; 13
-	tilecoll WALL, WALL, WALL, DOOR ; 14
-	tilecoll WALL, WALL, WALL, WALL ; 15
-	tilecoll WALL, WALL, WALL, DOOR ; 16
-	tilecoll WALL, WALL, TOWN_MAP, WALL ; 17
-	tilecoll WALL, WALL, WALL, WALL ; 18
-	tilecoll WALL, WALL, WALL, WALL ; 19
-	tilecoll WALL, WALL, WALL, DOOR ; 1a
-	tilecoll WALL, WALL, TOWN_MAP, WALL ; 1b
-	tilecoll WALL, WALL, WALL, WALL ; 1c
-	tilecoll WALL, WALL, DOOR, WALL ; 1d
-	tilecoll WALL, WALL, WALL, WALL ; 1e
-	tilecoll WALL, WALL, WALL, WALL ; 1f
-	tilecoll WALL, WALL, WALL, WALL ; 20
-	tilecoll WALL, WALL, WALL, WALL ; 21
-	tilecoll WALL, WALL, WALL, WALL ; 22
-	tilecoll WALL, WALL, WALL, WALL ; 23
-	tilecoll WALL, WALL, WALL, WALL ; 24
-	tilecoll WALL, WALL, WALL, WALL ; 25
-	tilecoll WALL, WALL, WALL, WALL ; 26
-	tilecoll WALL, WALL, WALL, WALL ; 27
-	tilecoll WALL, WALL, WALL, DOOR ; 28
-	tilecoll WALL, WALL, WALL, WALL ; 29
-	tilecoll WALL, WALL, WALL, DOOR ; 2a
-	tilecoll WALL, WALL, WALL, WALL ; 2b
-	tilecoll FLOOR, FLOOR, WALL, WALL ; 2c
-	tilecoll FLOOR, FLOOR, WALL, WALL ; 2d
-	tilecoll WALL, WALL, WALL, DOOR ; 2e
-	tilecoll WALL, WALL, WALL, WALL ; 2f
-	tilecoll BUOY, BUOY, BUOY, WATER_21 ; 30
-	tilecoll BUOY, BUOY, WATER_21, WATER_21 ; 31
-	tilecoll BUOY, BUOY, WATER_21, BUOY ; 32
-	tilecoll FLOOR, FLOOR, WALL, WALL ; 33
-	tilecoll BUOY, WATER_21, BUOY, WATER_21 ; 34
-	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 35
-	tilecoll WATER_21, BUOY, WATER_21, BUOY ; 36
-	tilecoll WALL, WALL, WALL, WALL ; 37
-	tilecoll BUOY, WATER_21, BUOY, BUOY ; 38
-	tilecoll WATER_21, WATER_21, BUOY, BUOY ; 39
-	tilecoll WATER_21, BUOY, BUOY, BUOY ; 3a
-	tilecoll WALL, WALL, WALL, WALL ; 3b
-	tilecoll WALL, FLOOR, FLOOR, FLOOR ; 3c
-	tilecoll FLOOR, WALL, FLOOR, FLOOR ; 3d
-	tilecoll FLOOR, FLOOR, WALL, FLOOR ; 3e
-	tilecoll FLOOR, FLOOR, FLOOR, WALL ; 3f
-	tilecoll WALL, WALL, WALL, FLOOR ; 40
-	tilecoll WALL, WALL, FLOOR, FLOOR ; 41
-	tilecoll WALL, WALL, FLOOR, WALL ; 42
-	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 43
-	tilecoll WALL, FLOOR, WALL, FLOOR ; 44
-	tilecoll TOWN_MAP, FLOOR, FLOOR, FLOOR ; 45
-	tilecoll FLOOR, WALL, FLOOR, WALL ; 46
-	tilecoll FLOOR, FLOOR, FLOOR, TOWN_MAP ; 47
-	tilecoll WALL, FLOOR, WALL, WALL ; 48
-	tilecoll FLOOR, FLOOR, WALL, WALL ; 49
-	tilecoll FLOOR, WALL, WALL, WALL ; 4a
-	tilecoll HOP_DOWN, FLOOR, WALL, FLOOR ; 4b
-	tilecoll WALL, HOP_LEFT, WALL, HOP_LEFT ; 4c
-	tilecoll HOP_RIGHT, WALL, HOP_RIGHT, WALL ; 4d
-	tilecoll WALL, HOP_LEFT, WALL, HOP_LEFT ; 4e
-	tilecoll HOP_RIGHT, WALL, HOP_RIGHT, WALL ; 4f
-	tilecoll WALL, HOP_DOWN_LEFT, WALL, WALL ; 50
-	tilecoll HOP_DOWN_RIGHT, WALL, WALL, WALL ; 51
-	tilecoll WALL, HOP_DOWN_LEFT, WALL, WALL ; 52
-	tilecoll HOP_DOWN_RIGHT, WALL, WALL, WALL ; 53
-	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 54
-	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 55
-	tilecoll HOP_DOWN, HOP_DOWN, WALL, WALL ; 56
-	tilecoll HOP_DOWN, HOP_DOWN, WALL, WALL ; 57
-	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 58
-	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 59
-	tilecoll HOP_DOWN, FLOOR, WALL, FLOOR ; 5a
-	tilecoll WALL, CUT_TREE, FLOOR, FLOOR ; 5b
-	tilecoll WALL, WALL, WALL, FLOOR ; 5c
-	tilecoll WALL, WALL, FLOOR, FLOOR ; 5d
-	tilecoll WALL, WALL, FLOOR, WALL ; 5e
-	tilecoll FLOOR, WALL, FLOOR, CUT_TREE ; 5f
-	tilecoll WALL, FLOOR, WALL, FLOOR ; 60
-	tilecoll WALL, WALL, WALL, WALL ; 61
-	tilecoll FLOOR, WALL, FLOOR, WALL ; 62
-	tilecoll FLOOR, FLOOR, CUT_TREE, WALL ; 63
-	tilecoll WALL, FLOOR, WALL, WALL ; 64
-	tilecoll FLOOR, FLOOR, WALL, WALL ; 65
-	tilecoll FLOOR, WALL, WALL, WALL ; 66
-	tilecoll CUT_TREE, FLOOR, WALL, FLOOR ; 67
-	tilecoll WALL, FLOOR, WALL, FLOOR ; 68
-	tilecoll FLOOR, WALL, FLOOR, WALL ; 69
-	tilecoll WALL, UP_WALL, WALL, FLOOR ; 6a
-	tilecoll UP_WALL, WALL, FLOOR, WALL ; 6b
-	tilecoll WALL, FLOOR, WALL, WALL ; 6c
-	tilecoll FLOOR, WALL, WALL, WALL ; 6d
-	tilecoll FLOOR, FLOOR, WALL, FLOOR ; 6e
-	tilecoll FLOOR, FLOOR, FLOOR, WALL ; 6f
-	tilecoll UP_WALL, UP_WALL, FLOOR, FLOOR ; 70
-	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 71
-	tilecoll FLOOR, FLOOR, WALL, WALL ; 72
-	tilecoll FLOOR, FLOOR, DOOR, WALL ; 73
-	tilecoll WALL, FLOOR, FLOOR, FLOOR ; 74
-	tilecoll WALL, WALL, FLOOR, FLOOR ; 75
-	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 76
-	tilecoll WALL, WALL, WALL, WALL ; 77
-	tilecoll WALL, WALL, WALL, WALL ; 78
-	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 79
-	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 7a
-	tilecoll WALL, WALL, WALL, WALL ; 7b
-	tilecoll WALL, WALL, WALL, WALL ; 7c
-	tilecoll WALL, WALL, WALL, WALL ; 7d
-	tilecoll WALL, WALL, WALL, WALL ; 7e
-	tilecoll WALL, WALL, WALL, WALL ; 7f
binary files a/data/tilesets/unused_dark_cave_metatiles.bin /dev/null differ
--- /dev/null
+++ b/data/tilesets/unused_johto_collision.asm
@@ -1,0 +1,128 @@
+	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 00
+	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 01
+	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 02
+	tilecoll TALL_GRASS_10, TALL_GRASS_10, TALL_GRASS_10, TALL_GRASS_10 ; 03
+	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 04
+	tilecoll WALL, WALL, WALL, WALL ; 05
+	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 06
+	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 07
+	tilecoll WALL, WALL, WALL, WALL ; 08
+	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 09
+	tilecoll WALL, WALL, WALL, WALL ; 0a
+	tilecoll WARP_CARPET_LEFT, FLOOR, WARP_CARPET_LEFT, FLOOR ; 0b
+	tilecoll FLOOR, FLOOR, FLOOR, WALL ; 0c
+	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 0d
+	tilecoll FLOOR, WARP_CARPET_RIGHT, FLOOR, WARP_CARPET_RIGHT ; 0e
+	tilecoll WALL, WALL, WALL, WALL ; 0f
+	tilecoll WALL, WALL, WALL, WALL ; 10
+	tilecoll WALL, WALL, WALL, WALL ; 11
+	tilecoll WALL, WALL, WALL, WALL ; 12
+	tilecoll WALL, WALL, WALL, WALL ; 13
+	tilecoll WALL, WALL, WALL, DOOR ; 14
+	tilecoll WALL, WALL, WALL, WALL ; 15
+	tilecoll WALL, WALL, WALL, DOOR ; 16
+	tilecoll WALL, WALL, TOWN_MAP, WALL ; 17
+	tilecoll WALL, WALL, WALL, WALL ; 18
+	tilecoll WALL, WALL, WALL, WALL ; 19
+	tilecoll WALL, WALL, WALL, DOOR ; 1a
+	tilecoll WALL, WALL, TOWN_MAP, WALL ; 1b
+	tilecoll WALL, WALL, WALL, WALL ; 1c
+	tilecoll WALL, WALL, DOOR, WALL ; 1d
+	tilecoll WALL, WALL, WALL, WALL ; 1e
+	tilecoll WALL, WALL, WALL, WALL ; 1f
+	tilecoll WALL, WALL, WALL, WALL ; 20
+	tilecoll WALL, WALL, WALL, WALL ; 21
+	tilecoll WALL, WALL, WALL, WALL ; 22
+	tilecoll WALL, WALL, WALL, WALL ; 23
+	tilecoll WALL, WALL, WALL, WALL ; 24
+	tilecoll WALL, WALL, WALL, WALL ; 25
+	tilecoll WALL, WALL, WALL, WALL ; 26
+	tilecoll WALL, WALL, WALL, WALL ; 27
+	tilecoll WALL, WALL, WALL, DOOR ; 28
+	tilecoll WALL, WALL, WALL, WALL ; 29
+	tilecoll WALL, WALL, WALL, DOOR ; 2a
+	tilecoll WALL, WALL, WALL, WALL ; 2b
+	tilecoll FLOOR, FLOOR, WALL, WALL ; 2c
+	tilecoll FLOOR, FLOOR, WALL, WALL ; 2d
+	tilecoll WALL, WALL, WALL, DOOR ; 2e
+	tilecoll WALL, WALL, WALL, WALL ; 2f
+	tilecoll BUOY, BUOY, BUOY, WATER_21 ; 30
+	tilecoll BUOY, BUOY, WATER_21, WATER_21 ; 31
+	tilecoll BUOY, BUOY, WATER_21, BUOY ; 32
+	tilecoll FLOOR, FLOOR, WALL, WALL ; 33
+	tilecoll BUOY, WATER_21, BUOY, WATER_21 ; 34
+	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 35
+	tilecoll WATER_21, BUOY, WATER_21, BUOY ; 36
+	tilecoll WALL, WALL, WALL, WALL ; 37
+	tilecoll BUOY, WATER_21, BUOY, BUOY ; 38
+	tilecoll WATER_21, WATER_21, BUOY, BUOY ; 39
+	tilecoll WATER_21, BUOY, BUOY, BUOY ; 3a
+	tilecoll WALL, WALL, WALL, WALL ; 3b
+	tilecoll WALL, FLOOR, FLOOR, FLOOR ; 3c
+	tilecoll FLOOR, WALL, FLOOR, FLOOR ; 3d
+	tilecoll FLOOR, FLOOR, WALL, FLOOR ; 3e
+	tilecoll FLOOR, FLOOR, FLOOR, WALL ; 3f
+	tilecoll WALL, WALL, WALL, FLOOR ; 40
+	tilecoll WALL, WALL, FLOOR, FLOOR ; 41
+	tilecoll WALL, WALL, FLOOR, WALL ; 42
+	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 43
+	tilecoll WALL, FLOOR, WALL, FLOOR ; 44
+	tilecoll TOWN_MAP, FLOOR, FLOOR, FLOOR ; 45
+	tilecoll FLOOR, WALL, FLOOR, WALL ; 46
+	tilecoll FLOOR, FLOOR, FLOOR, TOWN_MAP ; 47
+	tilecoll WALL, FLOOR, WALL, WALL ; 48
+	tilecoll FLOOR, FLOOR, WALL, WALL ; 49
+	tilecoll FLOOR, WALL, WALL, WALL ; 4a
+	tilecoll HOP_DOWN, FLOOR, WALL, FLOOR ; 4b
+	tilecoll WALL, HOP_LEFT, WALL, HOP_LEFT ; 4c
+	tilecoll HOP_RIGHT, WALL, HOP_RIGHT, WALL ; 4d
+	tilecoll WALL, HOP_LEFT, WALL, HOP_LEFT ; 4e
+	tilecoll HOP_RIGHT, WALL, HOP_RIGHT, WALL ; 4f
+	tilecoll WALL, HOP_DOWN_LEFT, WALL, WALL ; 50
+	tilecoll HOP_DOWN_RIGHT, WALL, WALL, WALL ; 51
+	tilecoll WALL, HOP_DOWN_LEFT, WALL, WALL ; 52
+	tilecoll HOP_DOWN_RIGHT, WALL, WALL, WALL ; 53
+	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 54
+	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 55
+	tilecoll HOP_DOWN, HOP_DOWN, WALL, WALL ; 56
+	tilecoll HOP_DOWN, HOP_DOWN, WALL, WALL ; 57
+	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 58
+	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 59
+	tilecoll HOP_DOWN, FLOOR, WALL, FLOOR ; 5a
+	tilecoll WALL, CUT_TREE, FLOOR, FLOOR ; 5b
+	tilecoll WALL, WALL, WALL, FLOOR ; 5c
+	tilecoll WALL, WALL, FLOOR, FLOOR ; 5d
+	tilecoll WALL, WALL, FLOOR, WALL ; 5e
+	tilecoll FLOOR, WALL, FLOOR, CUT_TREE ; 5f
+	tilecoll WALL, FLOOR, WALL, FLOOR ; 60
+	tilecoll WALL, WALL, WALL, WALL ; 61
+	tilecoll FLOOR, WALL, FLOOR, WALL ; 62
+	tilecoll FLOOR, FLOOR, CUT_TREE, WALL ; 63
+	tilecoll WALL, FLOOR, WALL, WALL ; 64
+	tilecoll FLOOR, FLOOR, WALL, WALL ; 65
+	tilecoll FLOOR, WALL, WALL, WALL ; 66
+	tilecoll CUT_TREE, FLOOR, WALL, FLOOR ; 67
+	tilecoll WALL, FLOOR, WALL, FLOOR ; 68
+	tilecoll FLOOR, WALL, FLOOR, WALL ; 69
+	tilecoll WALL, UP_WALL, WALL, FLOOR ; 6a
+	tilecoll UP_WALL, WALL, FLOOR, WALL ; 6b
+	tilecoll WALL, FLOOR, WALL, WALL ; 6c
+	tilecoll FLOOR, WALL, WALL, WALL ; 6d
+	tilecoll FLOOR, FLOOR, WALL, FLOOR ; 6e
+	tilecoll FLOOR, FLOOR, FLOOR, WALL ; 6f
+	tilecoll UP_WALL, UP_WALL, FLOOR, FLOOR ; 70
+	tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 71
+	tilecoll FLOOR, FLOOR, WALL, WALL ; 72
+	tilecoll FLOOR, FLOOR, DOOR, WALL ; 73
+	tilecoll WALL, FLOOR, FLOOR, FLOOR ; 74
+	tilecoll WALL, WALL, FLOOR, FLOOR ; 75
+	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 76
+	tilecoll WALL, WALL, WALL, WALL ; 77
+	tilecoll WALL, WALL, WALL, WALL ; 78
+	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 79
+	tilecoll WATER_21, WATER_21, WATER_21, WATER_21 ; 7a
+	tilecoll WALL, WALL, WALL, WALL ; 7b
+	tilecoll WALL, WALL, WALL, WALL ; 7c
+	tilecoll WALL, WALL, WALL, WALL ; 7d
+	tilecoll WALL, WALL, WALL, WALL ; 7e
+	tilecoll WALL, WALL, WALL, WALL ; 7f
binary files /dev/null b/data/tilesets/unused_johto_metatiles.bin differ
--- a/engine/events/battle_tower/battle_tower.asm
+++ b/engine/events/battle_tower/battle_tower.asm
@@ -29,7 +29,7 @@
 	call CopyBytes
 	ld hl, w3_d202Name
 	ld de, s5_aa8e
-	ld bc, 7 * $cc ; length of battle tower struct from japanese games?
+	ld bc, BATTLETOWER_STREAK_LENGTH * $cc ; length of battle tower struct from japanese games?
 	call CopyBytes
 	ld hl, s5_aa5d ; some sort of count
 	ld a, [hl]
@@ -582,22 +582,22 @@
 	ret
 
 Unreferenced_Function1704ca:
-	ld a, [$be46]
-	cp $7
-	jr c, .asm_1704d3
-	ld a, $6
+	ld a, [s5_be46]
+	cp BATTLETOWER_STREAK_LENGTH
+	jr c, .not_max
+	ld a, BATTLETOWER_STREAK_LENGTH - 1
 
-.asm_1704d3
-	ld hl, $afce
-	ld de, -$e0
-.asm_1704d9
+.not_max
+	ld hl, s5_aa8e + BATTLE_TOWER_STRUCT_LENGTH * (BATTLETOWER_STREAK_LENGTH - 1)
+	ld de, -BATTLE_TOWER_STRUCT_LENGTH
+.loop
 	and a
-	jr z, .asm_1704e0
+	jr z, .done
 	add hl, de
 	dec a
-	jr .asm_1704d9
+	jr .loop
 
-.asm_1704e0
+.done
 	ret
 
 Function1704e1:
--- a/gfx/tilesets.asm
+++ b/gfx/tilesets.asm
@@ -190,11 +190,11 @@
 TilesetDarkCaveGFX::
 INCBIN "gfx/tilesets/dark_cave.2bpp.lz"
 
-UnusedTilesetDarkCaveMeta::
-INCBIN "data/tilesets/unused_dark_cave_metatiles.bin"
+UnusedTilesetJohtoMeta::
+INCBIN "data/tilesets/unused_johto_metatiles.bin"
 
-UnusedTilesetDarkCaveColl::
-INCLUDE "data/tilesets/unused_dark_cave_collision.asm"
+UnusedTilesetJohtoColl::
+INCLUDE "data/tilesets/unused_johto_collision.asm"
 
 
 SECTION "Tileset Data 5", ROMX