Define constants for collision types

This commit is contained in:
Remy Oukaour 2017-12-12 16:15:58 -05:00
parent 047c8e4bc0
commit b006415371
9 changed files with 335 additions and 218 deletions

View File

@ -35,6 +35,7 @@ INCLUDE "constants/npctrade_constants.asm"
INCLUDE "constants/sprite_constants.asm" INCLUDE "constants/sprite_constants.asm"
INCLUDE "constants/sprite_data_constants.asm" INCLUDE "constants/sprite_data_constants.asm"
INCLUDE "constants/tileset_constants.asm" INCLUDE "constants/tileset_constants.asm"
INCLUDE "constants/collision_constants.asm"
INCLUDE "constants/cgb_constants.asm" INCLUDE "constants/cgb_constants.asm"
INCLUDE "constants/battle_tower_constants.asm" INCLUDE "constants/battle_tower_constants.asm"
INCLUDE "constants/cry_constants.asm" INCLUDE "constants/cry_constants.asm"

View File

@ -0,0 +1,115 @@
; collision permissions (see tilesets/collision_permissions.asm)
LANDTILE EQU $00
WATERTILE EQU $01
WALLTILE EQU $0f
TALK EQU $10
; collision data types (see tilesets/*_collision.asm)
; TileCollisionTable indexes (see data/collision_permissions.asm)
COLL_FLOOR EQU $00
COLL_01 EQU $01 ; garbage
COLL_03 EQU $03 ; garbage
COLL_04 EQU $04 ; garbage
COLL_WALL EQU $07
COLL_CUT_08 EQU $08 ; unused
COLL_TALL_GRASS_10 EQU $10 ; unused
COLL_CUT_TREE EQU $12
COLL_LONG_GRASS EQU $14
COLL_HEADBUTT_TREE EQU $15
COLL_TALL_GRASS EQU $18
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_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_WATERFALL_RIGHT EQU $30 ; unused !!!
COLL_WATERFALL_LEFT EQU $31 ; unused !!!
COLL_WATERFALL_UP EQU $32 ; unused !!!
COLL_WATERFALL EQU $33
COLL_CURRENT_RIGHT EQU $38 ; unused !!!
COLL_CURRENT_LEFT EQU $39 ; unused !!!
COLL_CURRENT_UP EQU $3a ; unused !!!
COLL_CURRENT_DOWN EQU $3b ; unused !!!
COLL_BRAKE EQU $40 ; unused !!!
COLL_WALK_RIGHT EQU $41 ; unused !!!
COLL_WALK_LEFT EQU $42 ; unused !!!
COLL_WALK_UP EQU $43 ; unused !!!
COLL_WALK_DOWN EQU $44 ; unused !!!
COLL_BRAKE_45 EQU $45 ; garbage
COLL_BRAKE_46 EQU $46 ; unused
COLL_BRAKE_47 EQU $47 ; unused
COLL_GRASS_48 EQU $48 ; unused
COLL_GRASS_49 EQU $49 ; unused
COLL_GRASS_4A EQU $4a ; garbage
COLL_GRASS_4B EQU $4b ; garbage
COLL_GRASS_4C EQU $4c ; unused
COLL_WALK_RIGHT_ALT EQU $50 ; unused
COLL_WALK_LEFT_ALT EQU $51 ; unused
COLL_WALK_UP_ALT EQU $52 ; unused
COLL_WALK_DOWN_ALT EQU $53 ; unused
COLL_BRAKE_ALT EQU $54 ; unused
COLL_BRAKE_55 EQU $55 ; unused
COLL_BRAKE_56 EQU $56 ; unused
COLL_BRAKE_57 EQU $57 ; unused
COLL_5B EQU $5b ; garbage
COLL_PIT EQU $60
COLL_VIRTUAL_BOY EQU $61 ; garbage
COLL_64 EQU $64 ; garbage
COLL_65 EQU $65 ; garbage
COLL_PIT_68 EQU $68 ; unused
COLL_WARP_CARPET_DOWN EQU $70
COLL_DOOR EQU $71
COLL_LADDER EQU $72
COLL_STAIRCASE_73 EQU $73 ; unused
COLL_CAVE_74 EQU $74 ; unused
COLL_DOOR_75 EQU $75 ; unused
COLL_WARP_CARPET_LEFT EQU $76
COLL_WARP_77 EQU $77 ; unused
COLL_WARP_CARPET_UP EQU $78
COLL_DOOR_79 EQU $79 ; unused
COLL_STAIRCASE EQU $7a
COLL_CAVE EQU $7b
COLL_WARP_PANEL EQU $7c
COLL_DOOR_7D EQU $7d ; unused
COLL_WARP_CARPET_RIGHT EQU $7e
COLL_WARP_7F EQU $7f ; unused
COLL_COUNTER EQU $90
COLL_BOOKSHELF EQU $91
COLL_PC EQU $93
COLL_RADIO EQU $94
COLL_TOWN_MAP EQU $95
COLL_MART_SHELF EQU $96
COLL_TV EQU $97
COLL_COUNTER_98 EQU $98 ; unused
COLL_9C EQU $9c ; garbage
COLL_WINDOW EQU $9d
COLL_INCENSE_BURNER EQU $9f
COLL_HOP_RIGHT EQU $a0
COLL_HOP_LEFT EQU $a1
COLL_HOP_UP EQU $a2 ; unused !!!
COLL_HOP_DOWN EQU $a3
COLL_HOP_DOWN_RIGHT EQU $a4
COLL_HOP_DOWN_LEFT EQU $a5
COLL_HOP_UP_RIGHT EQU $a6 ; unused !!!
COLL_HOP_UP_LEFT EQU $a7 ; unused !!!
COLL_RIGHT_WALL EQU $b0
COLL_LEFT_WALL EQU $b1
COLL_UP_WALL EQU $b2
COLL_DOWN_WALL EQU $b3 ; unused !!!
COLL_FF EQU $ff ; garbage
; collision data type nybbles
LO_NYBBLE_GRASS EQU $07
HI_NYBBLE_TALL_GRASS EQU $10
HI_NYBBLE_WATER EQU $20
HI_NYBBLE_CURRENT EQU $30
HI_NYBBLE_WALK EQU $40
HI_NYBBLE_WALK_ALT EQU $50
HI_NYBBLE_WARPS EQU $70
HI_NYBBLE_LEDGES EQU $a0

View File

@ -1,9 +1,3 @@
; collision values (see tilesets/collision.asm)
LANDTILE EQU $0
WATERTILE EQU $1
WALLTILE EQU $f
TALK EQU $10
; Tilesets indexes (see tilesets/tileset_headers.asm) ; Tilesets indexes (see tilesets/tileset_headers.asm)
const_value SET 1 const_value SET 1
const TILESET_JOHTO_1 ; 01 const TILESET_JOHTO_1 ; 01

196
tilesets/collision.asm → data/collision_permissions.asm Executable file → Normal file
View File

@ -2,16 +2,16 @@ NONTALKABLE EQUS "db"
TALKABLE EQUS "db TALK +" TALKABLE EQUS "db TALK +"
TileCollisionTable:: ; 4ce1f TileCollisionTable:: ; 4ce1f
; entries correspond to collision ids ; entries correspond to COLL_* constants
NONTALKABLE LANDTILE ; 00 NONTALKABLE LANDTILE ; COLL_FLOOR
NONTALKABLE LANDTILE ; 01 NONTALKABLE LANDTILE ; COLL_01
NONTALKABLE LANDTILE ; 02 NONTALKABLE LANDTILE ; 02
NONTALKABLE LANDTILE ; 03 NONTALKABLE LANDTILE ; COLL_03
NONTALKABLE LANDTILE ; 04 NONTALKABLE LANDTILE ; COLL_04
NONTALKABLE LANDTILE ; 05 NONTALKABLE LANDTILE ; 05
NONTALKABLE LANDTILE ; 06 NONTALKABLE LANDTILE ; 06
NONTALKABLE WALLTILE ; 07 NONTALKABLE WALLTILE ; COLL_WALL
NONTALKABLE LANDTILE ; 08 NONTALKABLE LANDTILE ; COLL_CUT_08
NONTALKABLE LANDTILE ; 09 NONTALKABLE LANDTILE ; 09
NONTALKABLE LANDTILE ; 0a NONTALKABLE LANDTILE ; 0a
NONTALKABLE LANDTILE ; 0b NONTALKABLE LANDTILE ; 0b
@ -19,95 +19,95 @@ TileCollisionTable:: ; 4ce1f
NONTALKABLE LANDTILE ; 0d NONTALKABLE LANDTILE ; 0d
NONTALKABLE LANDTILE ; 0e NONTALKABLE LANDTILE ; 0e
NONTALKABLE WALLTILE ; 0f NONTALKABLE WALLTILE ; 0f
NONTALKABLE LANDTILE ; 10 NONTALKABLE LANDTILE ; COLL_TALL_GRASS_10
NONTALKABLE LANDTILE ; 11 NONTALKABLE LANDTILE ; 11
TALKABLE WALLTILE ; 12 TALKABLE WALLTILE ; COLL_CUT_TREE
NONTALKABLE LANDTILE ; 13 NONTALKABLE LANDTILE ; 13
NONTALKABLE LANDTILE ; 14 NONTALKABLE LANDTILE ; COLL_LONG_GRASS
TALKABLE WALLTILE ; 15 TALKABLE WALLTILE ; COLL_HEADBUTT_TREE
NONTALKABLE LANDTILE ; 16 NONTALKABLE LANDTILE ; 16
NONTALKABLE LANDTILE ; 17 NONTALKABLE LANDTILE ; 17
NONTALKABLE LANDTILE ; 18 NONTALKABLE LANDTILE ; COLL_TALL_GRASS
NONTALKABLE LANDTILE ; 19 NONTALKABLE LANDTILE ; 19
TALKABLE WALLTILE ; 1a TALKABLE WALLTILE ; COLL_CUT_TREE_1A
NONTALKABLE LANDTILE ; 1b NONTALKABLE LANDTILE ; 1b
NONTALKABLE LANDTILE ; 1c NONTALKABLE LANDTILE ; COLL_LONG_GRASS_1C
TALKABLE WALLTILE ; 1d TALKABLE WALLTILE ; COLL_HEADBUTT_TREE_1D
NONTALKABLE LANDTILE ; 1e NONTALKABLE LANDTILE ; 1e
NONTALKABLE LANDTILE ; 1f NONTALKABLE LANDTILE ; 1f
NONTALKABLE WATERTILE ; 20 NONTALKABLE WATERTILE ; 20
NONTALKABLE WATERTILE ; 21 NONTALKABLE WATERTILE ; COLL_WATER_21
TALKABLE WATERTILE ; 22 TALKABLE WATERTILE ; 22
NONTALKABLE LANDTILE ; 23 NONTALKABLE LANDTILE ; COLL_ICE
TALKABLE WATERTILE ; 24 TALKABLE WATERTILE ; COLL_WHIRLPOOL
NONTALKABLE WATERTILE ; 25 NONTALKABLE WATERTILE ; 25
NONTALKABLE WATERTILE ; 26 NONTALKABLE WATERTILE ; 26
NONTALKABLE WALLTILE ; 27 NONTALKABLE WALLTILE ; COLL_BUOY
NONTALKABLE WATERTILE ; 28 NONTALKABLE WATERTILE ; COLL_CUT_28
NONTALKABLE WATERTILE ; 29 NONTALKABLE WATERTILE ; COLL_WATER
TALKABLE WATERTILE ; 2a TALKABLE WATERTILE ; 2a
NONTALKABLE LANDTILE ; 2b NONTALKABLE LANDTILE ; COLL_ICE_2B
TALKABLE WATERTILE ; 2c TALKABLE WATERTILE ; COLL_WHIRLPOOL_2C
NONTALKABLE WATERTILE ; 2d NONTALKABLE WATERTILE ; 2d
NONTALKABLE WATERTILE ; 2e NONTALKABLE WATERTILE ; 2e
NONTALKABLE WALLTILE ; 2f NONTALKABLE WALLTILE ; 2f
NONTALKABLE WATERTILE ; 30 NONTALKABLE WATERTILE ; COLL_WATERFALL_RIGHT
NONTALKABLE WATERTILE ; 31 NONTALKABLE WATERTILE ; COLL_WATERFALL_LEFT
NONTALKABLE WATERTILE ; 32 NONTALKABLE WATERTILE ; COLL_WATERFALL_UP
NONTALKABLE WATERTILE ; 33 NONTALKABLE WATERTILE ; COLL_WATERFALL
NONTALKABLE WATERTILE ; 34 NONTALKABLE WATERTILE ; 34
NONTALKABLE WATERTILE ; 35 NONTALKABLE WATERTILE ; 35
NONTALKABLE WATERTILE ; 36 NONTALKABLE WATERTILE ; 36
NONTALKABLE WATERTILE ; 37 NONTALKABLE WATERTILE ; 37
NONTALKABLE WATERTILE ; 38 NONTALKABLE WATERTILE ; COLL_CURRENT_RIGHT
NONTALKABLE WATERTILE ; 39 NONTALKABLE WATERTILE ; COLL_CURRENT_LEFT
NONTALKABLE WATERTILE ; 3a NONTALKABLE WATERTILE ; COLL_CURRENT_UP
NONTALKABLE WATERTILE ; 3b NONTALKABLE WATERTILE ; COLL_CURRENT_DOWN
NONTALKABLE WATERTILE ; 3c NONTALKABLE WATERTILE ; 3c
NONTALKABLE WATERTILE ; 3d NONTALKABLE WATERTILE ; 3d
NONTALKABLE WATERTILE ; 3e NONTALKABLE WATERTILE ; 3e
NONTALKABLE WATERTILE ; 3f NONTALKABLE WATERTILE ; 3f
NONTALKABLE LANDTILE ; 40 NONTALKABLE LANDTILE ; COLL_BRAKE
NONTALKABLE LANDTILE ; 41 NONTALKABLE LANDTILE ; COLL_WALK_RIGHT
NONTALKABLE LANDTILE ; 42 NONTALKABLE LANDTILE ; COLL_WALK_LEFT
NONTALKABLE LANDTILE ; 43 NONTALKABLE LANDTILE ; COLL_WALK_UP
NONTALKABLE LANDTILE ; 44 NONTALKABLE LANDTILE ; COLL_WALK_DOWN
NONTALKABLE LANDTILE ; 45 NONTALKABLE LANDTILE ; COLL_BRAKE_45
NONTALKABLE LANDTILE ; 46 NONTALKABLE LANDTILE ; COLL_BRAKE_46
NONTALKABLE LANDTILE ; 47 NONTALKABLE LANDTILE ; COLL_BRAKE_47
NONTALKABLE LANDTILE ; 48 NONTALKABLE LANDTILE ; COLL_GRASS_48
NONTALKABLE LANDTILE ; 49 NONTALKABLE LANDTILE ; COLL_GRASS_49
NONTALKABLE LANDTILE ; 4a NONTALKABLE LANDTILE ; COLL_GRASS_4A
NONTALKABLE LANDTILE ; 4b NONTALKABLE LANDTILE ; COLL_GRASS_4B
NONTALKABLE LANDTILE ; 4c NONTALKABLE LANDTILE ; COLL_GRASS_4C
NONTALKABLE LANDTILE ; 4d NONTALKABLE LANDTILE ; 4d
NONTALKABLE LANDTILE ; 4e NONTALKABLE LANDTILE ; 4e
NONTALKABLE LANDTILE ; 4f NONTALKABLE LANDTILE ; 4f
NONTALKABLE LANDTILE ; 50 NONTALKABLE LANDTILE ; COLL_WALK_RIGHT_ALT
NONTALKABLE LANDTILE ; 51 NONTALKABLE LANDTILE ; COLL_WALK_LEFT_ALT
NONTALKABLE LANDTILE ; 52 NONTALKABLE LANDTILE ; COLL_WALK_UP_ALT
NONTALKABLE LANDTILE ; 53 NONTALKABLE LANDTILE ; COLL_WALK_DOWN_ALT
NONTALKABLE LANDTILE ; 54 NONTALKABLE LANDTILE ; COLL_BRAKE_ALT
NONTALKABLE LANDTILE ; 55 NONTALKABLE LANDTILE ; COLL_BRAKE_55
NONTALKABLE LANDTILE ; 56 NONTALKABLE LANDTILE ; COLL_BRAKE_56
NONTALKABLE LANDTILE ; 57 NONTALKABLE LANDTILE ; COLL_BRAKE_57
NONTALKABLE LANDTILE ; 58 NONTALKABLE LANDTILE ; 58
NONTALKABLE LANDTILE ; 59 NONTALKABLE LANDTILE ; 59
NONTALKABLE LANDTILE ; 5a NONTALKABLE LANDTILE ; 5a
NONTALKABLE LANDTILE ; 5b NONTALKABLE LANDTILE ; COLL_5B
NONTALKABLE LANDTILE ; 5c NONTALKABLE LANDTILE ; 5c
NONTALKABLE LANDTILE ; 5d NONTALKABLE LANDTILE ; 5d
NONTALKABLE LANDTILE ; 5e NONTALKABLE LANDTILE ; 5e
NONTALKABLE LANDTILE ; 5f NONTALKABLE LANDTILE ; 5f
NONTALKABLE LANDTILE ; 60 NONTALKABLE LANDTILE ; COLL_PIT
NONTALKABLE LANDTILE ; 61 NONTALKABLE LANDTILE ; COLL_VIRTUAL_BOY
NONTALKABLE WALLTILE ; 62 NONTALKABLE WALLTILE ; 62
NONTALKABLE LANDTILE ; 63 NONTALKABLE LANDTILE ; 63
NONTALKABLE LANDTILE ; 64 NONTALKABLE LANDTILE ; COLL_64
NONTALKABLE LANDTILE ; 65 NONTALKABLE LANDTILE ; COLL_65
NONTALKABLE LANDTILE ; 66 NONTALKABLE LANDTILE ; 66
NONTALKABLE LANDTILE ; 67 NONTALKABLE LANDTILE ; 67
NONTALKABLE LANDTILE ; 68 NONTALKABLE LANDTILE ; COLL_PIT_68
NONTALKABLE LANDTILE ; 69 NONTALKABLE LANDTILE ; 69
NONTALKABLE WALLTILE ; 6a NONTALKABLE WALLTILE ; 6a
NONTALKABLE LANDTILE ; 6b NONTALKABLE LANDTILE ; 6b
@ -115,22 +115,22 @@ TileCollisionTable:: ; 4ce1f
NONTALKABLE LANDTILE ; 6d NONTALKABLE LANDTILE ; 6d
NONTALKABLE LANDTILE ; 6e NONTALKABLE LANDTILE ; 6e
NONTALKABLE LANDTILE ; 6f NONTALKABLE LANDTILE ; 6f
NONTALKABLE LANDTILE ; 70 NONTALKABLE LANDTILE ; COLL_WARP_CARPET_DOWN
NONTALKABLE LANDTILE ; 71 NONTALKABLE LANDTILE ; COLL_DOOR
NONTALKABLE LANDTILE ; 72 NONTALKABLE LANDTILE ; COLL_LADDER
NONTALKABLE LANDTILE ; 73 NONTALKABLE LANDTILE ; COLL_STAIRCASE_73
NONTALKABLE LANDTILE ; 74 NONTALKABLE LANDTILE ; COLL_CAVE_74
NONTALKABLE LANDTILE ; 75 NONTALKABLE LANDTILE ; COLL_DOOR_75
NONTALKABLE LANDTILE ; 76 NONTALKABLE LANDTILE ; COLL_WARP_CARPET_LEFT
NONTALKABLE LANDTILE ; 77 NONTALKABLE LANDTILE ; COLL_WARP_77
NONTALKABLE LANDTILE ; 78 NONTALKABLE LANDTILE ; COLL_WARP_CARPET_UP
NONTALKABLE LANDTILE ; 79 NONTALKABLE LANDTILE ; COLL_DOOR_79
NONTALKABLE LANDTILE ; 7a NONTALKABLE LANDTILE ; COLL_STAIRCASE
NONTALKABLE LANDTILE ; 7b NONTALKABLE LANDTILE ; COLL_CAVE
NONTALKABLE LANDTILE ; 7c NONTALKABLE LANDTILE ; COLL_WARP_PANEL
NONTALKABLE LANDTILE ; 7d NONTALKABLE LANDTILE ; COLL_DOOR_7D
NONTALKABLE LANDTILE ; 7e NONTALKABLE LANDTILE ; COLL_WARP_CARPET_RIGHT
NONTALKABLE LANDTILE ; 7f NONTALKABLE LANDTILE ; COLL_WARP_7F
NONTALKABLE WALLTILE ; 80 NONTALKABLE WALLTILE ; 80
NONTALKABLE WALLTILE ; 81 NONTALKABLE WALLTILE ; 81
NONTALKABLE WALLTILE ; 82 NONTALKABLE WALLTILE ; 82
@ -147,30 +147,30 @@ TileCollisionTable:: ; 4ce1f
NONTALKABLE LANDTILE ; 8d NONTALKABLE LANDTILE ; 8d
NONTALKABLE LANDTILE ; 8e NONTALKABLE LANDTILE ; 8e
NONTALKABLE LANDTILE ; 8f NONTALKABLE LANDTILE ; 8f
NONTALKABLE WALLTILE ; 90 NONTALKABLE WALLTILE ; COLL_COUNTER
NONTALKABLE WALLTILE ; 91 NONTALKABLE WALLTILE ; COLL_BOOKSHELF
NONTALKABLE WALLTILE ; 92 NONTALKABLE WALLTILE ; 92
NONTALKABLE WALLTILE ; 93 NONTALKABLE WALLTILE ; COLL_PC
NONTALKABLE WALLTILE ; 94 NONTALKABLE WALLTILE ; COLL_RADIO
NONTALKABLE WALLTILE ; 95 NONTALKABLE WALLTILE ; COLL_TOWN_MAP
NONTALKABLE WALLTILE ; 96 NONTALKABLE WALLTILE ; COLL_MART_SHELF
NONTALKABLE WALLTILE ; 97 NONTALKABLE WALLTILE ; COLL_TV
NONTALKABLE WALLTILE ; 98 NONTALKABLE WALLTILE ; COLL_COUNTER_98
NONTALKABLE WALLTILE ; 99 NONTALKABLE WALLTILE ; 99
NONTALKABLE WALLTILE ; 9a NONTALKABLE WALLTILE ; 9a
NONTALKABLE WALLTILE ; 9b NONTALKABLE WALLTILE ; 9b
NONTALKABLE WALLTILE ; 9c NONTALKABLE WALLTILE ; COLL_9C
NONTALKABLE WALLTILE ; 9d NONTALKABLE WALLTILE ; COLL_WINDOW
NONTALKABLE WALLTILE ; 9e NONTALKABLE WALLTILE ; 9e
NONTALKABLE WALLTILE ; 9f NONTALKABLE WALLTILE ; COLL_INCENSE_BURNER
NONTALKABLE LANDTILE ; a0 NONTALKABLE LANDTILE ; COLL_HOP_RIGHT
NONTALKABLE LANDTILE ; a1 NONTALKABLE LANDTILE ; COLL_HOP_LEFT
NONTALKABLE LANDTILE ; a2 NONTALKABLE LANDTILE ; COLL_HOP_UP
NONTALKABLE LANDTILE ; a3 NONTALKABLE LANDTILE ; COLL_HOP_DOWN
NONTALKABLE LANDTILE ; a4 NONTALKABLE LANDTILE ; COLL_HOP_DOWN_RIGHT
NONTALKABLE LANDTILE ; a5 NONTALKABLE LANDTILE ; COLL_HOP_DOWN_LEFT
NONTALKABLE LANDTILE ; a6 NONTALKABLE LANDTILE ; COLL_HOP_UP_RIGHT
NONTALKABLE LANDTILE ; a7 NONTALKABLE LANDTILE ; COLL_HOP_UP_LEFT
NONTALKABLE LANDTILE ; a8 NONTALKABLE LANDTILE ; a8
NONTALKABLE LANDTILE ; a9 NONTALKABLE LANDTILE ; a9
NONTALKABLE LANDTILE ; aa NONTALKABLE LANDTILE ; aa
@ -179,10 +179,10 @@ TileCollisionTable:: ; 4ce1f
NONTALKABLE LANDTILE ; ad NONTALKABLE LANDTILE ; ad
NONTALKABLE LANDTILE ; ae NONTALKABLE LANDTILE ; ae
NONTALKABLE LANDTILE ; af NONTALKABLE LANDTILE ; af
NONTALKABLE LANDTILE ; b0 NONTALKABLE LANDTILE ; COLL_RIGHT_WALL
NONTALKABLE LANDTILE ; b1 NONTALKABLE LANDTILE ; COLL_LEFT_WALL
NONTALKABLE LANDTILE ; b2 NONTALKABLE LANDTILE ; COLL_UP_WALL
NONTALKABLE LANDTILE ; b3 NONTALKABLE LANDTILE ; COLL_DOWN_WALL
NONTALKABLE LANDTILE ; b4 NONTALKABLE LANDTILE ; b4
NONTALKABLE LANDTILE ; b5 NONTALKABLE LANDTILE ; b5
NONTALKABLE LANDTILE ; b6 NONTALKABLE LANDTILE ; b6
@ -258,5 +258,5 @@ TileCollisionTable:: ; 4ce1f
NONTALKABLE LANDTILE ; fc NONTALKABLE LANDTILE ; fc
NONTALKABLE LANDTILE ; fd NONTALKABLE LANDTILE ; fd
NONTALKABLE LANDTILE ; fe NONTALKABLE LANDTILE ; fe
NONTALKABLE WALLTILE ; ff NONTALKABLE WALLTILE ; COLL_FF
; 4cf1f ; 4cf1f

View File

@ -0,0 +1,13 @@
; stdscripts associated with tile collisions
TileCollisionStdScripts:
; collision type, stdscript
dbw COLL_BOOKSHELF, magazinebookshelf
dbw COLL_PC, pcscript
dbw COLL_RADIO, radio1
dbw COLL_TOWN_MAP, townmap
dbw COLL_MART_SHELF, merchandiseshelf
dbw COLL_TV, tv
dbw COLL_WINDOW, window
dbw COLL_INCENSE_BURNER, incenseburner
db -1 ; end

View File

@ -128,13 +128,13 @@ DoPlayerMovement:: ; 80000
.not_whirlpool .not_whirlpool
and $f0 and $f0
cp $30 ; moving water cp HI_NYBBLE_CURRENT
jr z, .water jr z, .water
cp $40 ; moving land 1 cp HI_NYBBLE_WALK
jr z, .land1 jr z, .land1
cp $50 ; moving land 2 cp HI_NYBBLE_WALK_ALT
jr z, .land2 jr z, .land2
cp $70 ; warps cp HI_NYBBLE_WARPS
jr z, .warps jr z, .warps
jr .no_walk jr .no_walk
@ -150,10 +150,10 @@ DoPlayerMovement:: ; 80000
jr .continue_walk jr .continue_walk
.water_table .water_table
db RIGHT db RIGHT ; COLL_WATERFALL_RIGHT
db LEFT db LEFT ; COLL_WATERFALL_LEFT
db UP db UP ; COLL_WATERFALL_UP
db DOWN db DOWN ; COLL_WATERFALL
.land1 .land1
ld a, c ld a, c
@ -169,14 +169,14 @@ DoPlayerMovement:: ; 80000
jr .continue_walk jr .continue_walk
.land1_table .land1_table
db STANDING db STANDING ; COLL_BRAKE
db RIGHT db RIGHT ; COLL_WALK_RIGHT
db LEFT db LEFT ; COLL_WALK_LEFT
db UP db UP ; COLL_WALK_UP
db DOWN db DOWN ; COLL_WALK_DOWN
db STANDING db STANDING ; COLL_BRAKE_45
db STANDING db STANDING ; COLL_BRAKE_46
db STANDING db STANDING ; COLL_BRAKE_47
.land2 .land2
ld a, c ld a, c
@ -192,24 +192,24 @@ DoPlayerMovement:: ; 80000
jr .continue_walk jr .continue_walk
.land2_table .land2_table
db RIGHT db RIGHT ; COLL_WALK_RIGHT_ALT
db LEFT db LEFT ; COLL_WALK_LEFT_ALT
db UP db UP ; COLL_WALK_UP_ALT
db DOWN db DOWN ; COLL_WALK_DOWN_ALT
db STANDING db STANDING ; COLL_BRAKE_ALT
db STANDING db STANDING ; COLL_BRAKE_55
db STANDING db STANDING ; COLL_BRAKE_56
db STANDING db STANDING ; COLL_BRAKE_57
.warps .warps
ld a, c ld a, c
cp $71 ; door cp COLL_DOOR
jr z, .down jr z, .down
cp $79 cp COLL_DOOR_79
jr z, .down jr z, .down
cp $7a ; stairs cp COLL_STAIRCASE
jr z, .down jr z, .down
cp $7b ; cave cp COLL_CAVE
jr nz, .no_walk jr nz, .no_walk
.down .down
@ -365,7 +365,7 @@ DoPlayerMovement:: ; 80000
ld a, [PlayerStandingTile] ld a, [PlayerStandingTile]
ld e, a ld e, a
and $f0 and $f0
cp $a0 ; ledge cp HI_NYBBLE_LEDGES
jr nz, .DontJump jr nz, .DontJump
ld a, e ld a, e
@ -391,14 +391,14 @@ DoPlayerMovement:: ; 80000
ret ret
.data_8021e .data_8021e
db FACE_RIGHT db FACE_RIGHT ; COLL_HOP_RIGHT
db FACE_LEFT db FACE_LEFT ; COLL_HOP_LEFT
db FACE_UP db FACE_UP ; COLL_HOP_UP
db FACE_DOWN db FACE_DOWN ; COLL_HOP_DOWN
db FACE_RIGHT | FACE_DOWN db FACE_RIGHT | FACE_DOWN ; COLL_HOP_DOWN_RIGHT
db FACE_DOWN | FACE_LEFT db FACE_DOWN | FACE_LEFT ; COLL_HOP_DOWN_LEFT
db FACE_UP | FACE_RIGHT db FACE_UP | FACE_RIGHT ; COLL_HOP_UP_RIGHT
db FACE_UP | FACE_LEFT db FACE_UP | FACE_LEFT ; COLL_HOP_UP_LEFT
; 80226 ; 80226
.CheckWarp: ; 80226 .CheckWarp: ; 80226
@ -443,7 +443,10 @@ DoPlayerMovement:: ; 80000
ret ret
.EdgeWarps: .EdgeWarps:
db $70, $78, $76, $7e db COLL_WARP_CARPET_DOWN
db COLL_WARP_CARPET_UP
db COLL_WARP_CARPET_LEFT
db COLL_WARP_CARPET_RIGHT
; 8025f ; 8025f
.DoStep: .DoStep:
@ -759,7 +762,7 @@ DoPlayerMovement:: ; 80000
; Return 0 if tile a is land. Otherwise, return carry. ; Return 0 if tile a is land. Otherwise, return carry.
call GetTileCollision call GetTileCollision
and a ; land and a ; LANDTILE?
ret z ret z
scf scf
ret ret
@ -774,7 +777,7 @@ DoPlayerMovement:: ; 80000
jr z, .Water jr z, .Water
; Can walk back onto land from water. ; Can walk back onto land from water.
and a and a ; LANDTILE?
jr z, .Land jr z, .Land
jr .Neither jr .Neither

View File

@ -1,12 +1,12 @@
CheckWarpCollision:: ; 1499a CheckWarpCollision:: ; 1499a
; Is this tile a warp? ; Is this tile a warp?
ld a, [PlayerStandingTile] ld a, [PlayerStandingTile]
cp $60 cp COLL_PIT
jr z, .warp jr z, .warp
cp $68 cp COLL_PIT_68
jr z, .warp jr z, .warp
and $f0 and $f0
cp $70 cp HI_NYBBLE_WARPS
jr z, .warp jr z, .warp
and a and a
ret ret
@ -20,13 +20,13 @@ CheckDirectionalWarp:: ; 149af
; If this is a directional warp, clear carry (press the designated button to warp). ; If this is a directional warp, clear carry (press the designated button to warp).
; Else, set carry (immediate warp). ; Else, set carry (immediate warp).
ld a, [PlayerStandingTile] ld a, [PlayerStandingTile]
cp $70 ; Warp on down cp COLL_WARP_CARPET_DOWN
jr z, .directional jr z, .directional
cp $76 ; Warp on left cp COLL_WARP_CARPET_LEFT
jr z, .directional jr z, .directional
cp $78 ; Warp on up cp COLL_WARP_CARPET_UP
jr z, .directional jr z, .directional
cp $7e ; Warp on right cp COLL_WARP_CARPET_RIGHT
jr z, .directional jr z, .directional
scf scf
ret ret
@ -45,15 +45,15 @@ CheckWarpFacingDown: ; 149c6
; 149d3 ; 149d3
.blocks ; 149d3 .blocks ; 149d3
db $71 ; door db COLL_DOOR
db $79 db COLL_DOOR_79
db $7a ; stairs db COLL_STAIRCASE
db $73 db COLL_STAIRCASE_73
db $7b ; cave entrance db COLL_CAVE
db $74 db COLL_CAVE_74
db $7c ; warp pad db COLL_WARP_PANEL
db $75 db COLL_DOOR_75
db $7d db COLL_DOOR_7D
db -1 db -1
; 149dd ; 149dd
@ -66,16 +66,16 @@ CheckGrassCollision:: ; 149dd
; 149ea ; 149ea
.blocks ; 149ea .blocks ; 149ea
db $08 db COLL_CUT_08
db $18 ; tall grass db COLL_TALL_GRASS
db $14 ; tall grass db COLL_LONG_GRASS
db $28 db COLL_CUT_28
db $29 db COLL_WATER
db $48 db COLL_GRASS_48
db $49 db COLL_GRASS_49
db $4a db COLL_GRASS_4A
db $4b db COLL_GRASS_4B
db $4c db COLL_GRASS_4C
db -1 db -1
; 149f5 ; 149f5
@ -88,22 +88,22 @@ CheckCutCollision: ; 149f5
; 14a00 ; 14a00
.blocks ; 14a00 .blocks ; 14a00
db $12 ; cut tree db COLL_CUT_TREE
db $1a ; cut tree db COLL_CUT_TREE_1A
db $10 ; tall grass db COLL_TALL_GRASS_10
db $18 ; tall grass db COLL_TALL_GRASS
db $14 ; tall grass db COLL_LONG_GRASS
db $1c ; tall grass db COLL_LONG_GRASS_1C
db -1 db -1
; 14a07 ; 14a07
GetWarpSFX:: ; 14a07 GetWarpSFX:: ; 14a07
ld a, [PlayerStandingTile] ld a, [PlayerStandingTile]
ld de, SFX_ENTER_DOOR ld de, SFX_ENTER_DOOR
cp $71 ; door cp COLL_DOOR
ret z ret z
ld de, SFX_WARP_TO ld de, SFX_WARP_TO
cp $7c ; warp pad cp COLL_WARP_PANEL
ret z ret z
ld de, SFX_EXIT_BUILDING ld de, SFX_EXIT_BUILDING
ret ret

View File

@ -120,67 +120,67 @@ GetTileCollision:: ; 185d
CheckGrassTile:: ; 1875 CheckGrassTile:: ; 1875
ld d, a ld d, a
and $f0 and $f0
cp $10 cp HI_NYBBLE_TALL_GRASS
jr z, .ok_10 jr z, .grass
cp $20 cp HI_NYBBLE_WATER
jr z, .ok_20 jr z, .water
scf scf
ret ret
.ok_10 .grass
ld a, d ld a, d
and 7 and LO_NYBBLE_GRASS
ret z ret z
scf scf
ret ret
; For some reason, the above code is duplicated down here. ; For some reason, the above code is duplicated down here.
.ok_20 .water
ld a, d ld a, d
and 7 and LO_NYBBLE_GRASS
ret z ret z
scf scf
ret ret
; 188e ; 188e
CheckSuperTallGrassTile:: ; 188e CheckSuperTallGrassTile:: ; 188e
cp $14 cp COLL_LONG_GRASS
ret z ret z
cp $1c cp COLL_LONG_GRASS_1C
ret ret
; 1894 ; 1894
CheckCutTreeTile:: ; 1894 CheckCutTreeTile:: ; 1894
cp $12 cp COLL_CUT_TREE
ret z ret z
cp $1a cp COLL_CUT_TREE_1A
ret ret
; 189a ; 189a
CheckHeadbuttTreeTile:: ; 189a CheckHeadbuttTreeTile:: ; 189a
cp $15 cp COLL_HEADBUTT_TREE
ret z ret z
cp $1d cp COLL_HEADBUTT_TREE_1D
ret ret
; 18a0 ; 18a0
CheckCounterTile:: ; 18a0 CheckCounterTile:: ; 18a0
cp $90 cp COLL_COUNTER
ret z ret z
cp $98 cp COLL_COUNTER_98
ret ret
; 18a6 ; 18a6
CheckPitTile:: ; 18a6 CheckPitTile:: ; 18a6
cp $60 cp COLL_PIT
ret z ret z
cp $68 cp COLL_PIT_68
ret ret
; 18ac ; 18ac
CheckIceTile:: ; 18ac CheckIceTile:: ; 18ac
cp $23 cp COLL_ICE
ret z ret z
cp $2b cp COLL_ICE_2B
ret z ret z
scf scf
ret ret
@ -188,30 +188,30 @@ CheckIceTile:: ; 18ac
CheckWhirlpoolTile:: ; 18b4 CheckWhirlpoolTile:: ; 18b4
nop nop
cp $24 cp COLL_WHIRLPOOL
ret z ret z
cp $2c cp COLL_WHIRLPOOL_2C
ret z ret z
scf scf
ret ret
; 18bd ; 18bd
CheckWaterfallTile:: ; 18bd CheckWaterfallTile:: ; 18bd
cp $33 cp COLL_WATERFALL
ret z ret z
cp $3b cp COLL_CURRENT_DOWN
ret ret
; 18c3 ; 18c3
CheckStandingOnEntrance:: ; 18c3 CheckStandingOnEntrance:: ; 18c3
ld a, [PlayerStandingTile] ld a, [PlayerStandingTile]
cp $71 ; door cp COLL_DOOR
ret z ret z
cp $79 cp COLL_DOOR_79
ret z ret z
cp $7a ; stairs cp COLL_STAIRCASE
ret z ret z
cp $7b ; cave cp COLL_CAVE
ret ret
; 18d2 ; 18d2

View File

@ -508,7 +508,7 @@ CheckFacingTileForStd:: ; 1365b
; Checks to see if the tile you're facing has a std script associated with it. If so, executes the script and returns carry. ; Checks to see if the tile you're facing has a std script associated with it. If so, executes the script and returns carry.
ld a, c ld a, c
ld de, 3 ld de, 3
ld hl, .table1 ld hl, TileCollisionStdScripts
call IsInArray call IsInArray
jr nc, .notintable jr nc, .notintable
@ -529,16 +529,7 @@ CheckFacingTileForStd:: ; 1365b
xor a xor a
ret ret
.table1 INCLUDE "data/collision_stdscripts.asm"
dbw $91, magazinebookshelf
dbw $93, pcscript
dbw $94, radio1
dbw $95, townmap
dbw $96, merchandiseshelf
dbw $97, tv
dbw $9d, window
dbw $9f, incenseburner
db -1 ; end
Script_JumpStdFromRAM: ; 0x1369a Script_JumpStdFromRAM: ; 0x1369a
jump wJumpStdScriptBuffer jump wJumpStdScriptBuffer
@ -1952,7 +1943,7 @@ ScrollBGMapPalettes:: ; 4c03f
INCLUDE "tilesets/palette_maps.asm" INCLUDE "tilesets/palette_maps.asm"
INCLUDE "tilesets/collision.asm" INCLUDE "data/collision_permissions.asm"
EmptyAllSRAMBanks: ; 4cf1f EmptyAllSRAMBanks: ; 4cf1f
ld a, $0 ld a, $0