Identify more collision-related constants and data

This commit is contained in:
Rangi 2019-03-03 13:30:27 -05:00
parent e671636bba
commit dc396822d7
4 changed files with 70 additions and 46 deletions

View File

@ -102,6 +102,18 @@ COLL_RIGHT_WALL EQU $b0
COLL_LEFT_WALL EQU $b1 COLL_LEFT_WALL EQU $b1
COLL_UP_WALL EQU $b2 COLL_UP_WALL EQU $b2
COLL_DOWN_WALL EQU $b3 ; unused COLL_DOWN_WALL EQU $b3 ; unused
COLL_DOWN_RIGHT_WALL EQU $b4 ; unused
COLL_DOWN_LEFT_WALL EQU $b5 ; unused
COLL_UP_RIGHT_WALL EQU $b6 ; unused
COLL_UP_LEFT_WALL EQU $b7 ; unused
COLL_RIGHT_BUOY EQU $c0 ; unused
COLL_LEFT_BUOY EQU $c1 ; unused
COLL_UP_BUOY EQU $c2 ; unused
COLL_DOWN_BUOY EQU $c3 ; unused
COLL_DOWN_RIGHT_BUOY EQU $c4 ; unused
COLL_DOWN_LEFT_BUOY EQU $c5 ; unused
COLL_UP_RIGHT_BUOY EQU $c6 ; unused
COLL_UP_LEFT_BUOY EQU $c7 ; unused
COLL_FF EQU $ff ; garbage COLL_FF EQU $ff ; garbage
; collision data type nybbles ; collision data type nybbles
@ -114,4 +126,4 @@ HI_NYBBLE_WALK_ALT EQU $50
HI_NYBBLE_WARPS EQU $70 HI_NYBBLE_WARPS EQU $70
HI_NYBBLE_LEDGES EQU $a0 HI_NYBBLE_LEDGES EQU $a0
HI_NYBBLE_SIDE_WALLS EQU $b0 HI_NYBBLE_SIDE_WALLS EQU $b0
HI_NYBBLE_UNUSED_C0 EQU $c0 HI_NYBBLE_SIDE_BUOYS EQU $c0

View File

@ -183,10 +183,10 @@ TileCollisionTable::
NONTALKABLE LANDTILE ; COLL_LEFT_WALL NONTALKABLE LANDTILE ; COLL_LEFT_WALL
NONTALKABLE LANDTILE ; COLL_UP_WALL NONTALKABLE LANDTILE ; COLL_UP_WALL
NONTALKABLE LANDTILE ; COLL_DOWN_WALL NONTALKABLE LANDTILE ; COLL_DOWN_WALL
NONTALKABLE LANDTILE ; b4 NONTALKABLE LANDTILE ; COLL_DOWN_RIGHT_WALL
NONTALKABLE LANDTILE ; b5 NONTALKABLE LANDTILE ; COLL_DOWN_LEFT_WALL
NONTALKABLE LANDTILE ; b6 NONTALKABLE LANDTILE ; COLL_UP_RIGHT_WALL
NONTALKABLE LANDTILE ; b7 NONTALKABLE LANDTILE ; COLL_UP_LEFT_WALL
NONTALKABLE LANDTILE ; b8 NONTALKABLE LANDTILE ; b8
NONTALKABLE LANDTILE ; b9 NONTALKABLE LANDTILE ; b9
NONTALKABLE LANDTILE ; ba NONTALKABLE LANDTILE ; ba
@ -195,14 +195,14 @@ TileCollisionTable::
NONTALKABLE LANDTILE ; bd NONTALKABLE LANDTILE ; bd
NONTALKABLE LANDTILE ; be NONTALKABLE LANDTILE ; be
NONTALKABLE LANDTILE ; bf NONTALKABLE LANDTILE ; bf
NONTALKABLE WATERTILE ; c0 NONTALKABLE WATERTILE ; COLL_RIGHT_BUOY
NONTALKABLE WATERTILE ; c1 NONTALKABLE WATERTILE ; COLL_LEFT_BUOY
NONTALKABLE WATERTILE ; c2 NONTALKABLE WATERTILE ; COLL_UP_BUOY
NONTALKABLE WATERTILE ; c3 NONTALKABLE WATERTILE ; COLL_DOWN_BUOY
NONTALKABLE WATERTILE ; c4 NONTALKABLE WATERTILE ; COLL_DOWN_RIGHT_BUOY
NONTALKABLE WATERTILE ; c5 NONTALKABLE WATERTILE ; COLL_DOWN_LEFT_BUOY
NONTALKABLE WATERTILE ; c6 NONTALKABLE WATERTILE ; COLL_UP_RIGHT_BUOY
NONTALKABLE WATERTILE ; c7 NONTALKABLE WATERTILE ; COLL_UP_LEFT_BUOY
NONTALKABLE WATERTILE ; c8 NONTALKABLE WATERTILE ; c8
NONTALKABLE WATERTILE ; c9 NONTALKABLE WATERTILE ; c9
NONTALKABLE WATERTILE ; ca NONTALKABLE WATERTILE ; ca

View File

@ -114,7 +114,10 @@ WillObjectBumpIntoTile:
ret ret
.data_6f5b .data_6f5b
db DOWN_MASK, UP_MASK, RIGHT_MASK, LEFT_MASK db DOWN_MASK ; DOWN
db UP_MASK ; UP
db RIGHT_MASK ; LEFT
db LEFT_MASK ; RIGHT
Function6f5f: Function6f5f:
ld hl, OBJECT_STANDING_TILE ld hl, OBJECT_STANDING_TILE
@ -137,19 +140,22 @@ Function6f5f:
ret ret
.data_6f7b .data_6f7b
db UP_MASK, DOWN_MASK, LEFT_MASK, RIGHT_MASK db UP_MASK ; DOWN
db DOWN_MASK ; UP
db LEFT_MASK ; LEFT
db RIGHT_MASK ; RIGHT
Function6f7f: Function6f7f:
ld d, a ld d, a
and $f0 and $f0
cp HI_NYBBLE_SIDE_WALLS cp HI_NYBBLE_SIDE_WALLS
jr z, .done jr z, .continue
cp HI_NYBBLE_UNUSED_C0 cp HI_NYBBLE_SIDE_BUOYS
jr z, .done jr z, .continue
xor a xor a
ret ret
.done .continue
ld a, d ld a, d
and 7 and 7
ld e, a ld e, a
@ -161,8 +167,14 @@ Function6f7f:
ret ret
.data_6f99 .data_6f99
db 8, 4, 1, 2 db RIGHT_MASK ; COLL_RIGHT_WALL/BUOY
db 10, 6, 9, 5 db LEFT_MASK ; COLL_LEFT_WALL/BUOY
db DOWN_MASK ; COLL_UP_WALL/BUOY
db UP_MASK ; COLL_DOWN_WALL/BUOY
db UP_MASK | RIGHT_MASK ; COLL_DOWN_RIGHT_WALL/BUOY
db UP_MASK | LEFT_MASK ; COLL_DOWN_LEFT_WALL/BUOY
db DOWN_MASK | RIGHT_MASK ; COLL_UP_RIGHT_WALL/BUOY
db DOWN_MASK | LEFT_MASK ; COLL_UP_LEFT_WALL/BUOY
Function6fa1: Function6fa1:
ld hl, OBJECT_DIRECTION_WALKING ld hl, OBJECT_DIRECTION_WALKING
@ -493,7 +505,7 @@ Unreferenced_Function7113:
cp d cp d
jr nz, .check_current_coords jr nz, .check_current_coords
ldh a, [hObjectStructIndexBuffer] ldh a, [hObjectStructIndexBuffer]
cp $0 cp PLAYER_OBJECT
jr z, .next jr z, .next
jr .yes jr .yes

View File

@ -325,9 +325,9 @@ CopyWarpData::
ld l, a ld l, a
ld a, c ld a, c
dec a dec a
ld bc, 5 ; warp size ld bc, $5 ; warp size
call AddNTimes call AddNTimes
ld bc, 2 ; warp number ld bc, $2 ; warp number
add hl, bc add hl, bc
ld a, [hli] ld a, [hli]
cp $ff cp $ff
@ -671,7 +671,7 @@ RestoreFacingAfterWarp::
dec a dec a
ld c, a ld c, a
ld b, 0 ld b, 0
ld a, 5 ld a, $5 ; warp size
call AddNTimes call AddNTimes
ld a, [hli] ld a, [hli]
ld [wYCoord], a ld [wYCoord], a
@ -1261,7 +1261,7 @@ UpdateBGMapRow::
push de push de
call .iteration call .iteration
pop de pop de
ld a, $20 ld a, BG_MAP_WIDTH
add e add e
ld e, a ld e, a
@ -1295,7 +1295,7 @@ UpdateBGMapColumn::
ld [hli], a ld [hli], a
ld a, d ld a, d
ld [hli], a ld [hli], a
ld a, $20 ld a, BG_MAP_WIDTH
add e add e
ld e, a ld e, a
jr nc, .skip jr nc, .skip
@ -1344,11 +1344,11 @@ LoadTilesetGFX::
ldh a, [rVBK] ldh a, [rVBK]
push af push af
ld a, $1 ld a, BANK(vTiles5)
ldh [rVBK], a ldh [rVBK], a
ld hl, wDecompressScratch + $60 tiles ld hl, wDecompressScratch + $60 tiles
ld de, vTiles2 ld de, vTiles5
ld bc, $60 tiles ld bc, $60 tiles
call CopyBytes call CopyBytes
@ -1573,12 +1573,12 @@ GetMovementPermissions::
call .CheckHiNybble call .CheckHiNybble
ret nz ret nz
ld a, [wTileDown] ld a, [wTileDown]
and 7 and %111
cp $2 cp COLL_UP_WALL & %111 ; COLL_UP_BUOY & %111
jr z, .ok_down jr z, .ok_down
cp $6 cp COLL_UP_RIGHT_WALL & %111 ; COLL_UP_RIGHT_BUOY & %111
jr z, .ok_down jr z, .ok_down
cp $7 cp COLL_UP_LEFT_WALL & %111 ; COLL_UP_LEFT_BUOY & %111
ret nz ret nz
.ok_down .ok_down
@ -1591,12 +1591,12 @@ GetMovementPermissions::
call .CheckHiNybble call .CheckHiNybble
ret nz ret nz
ld a, [wTileUp] ld a, [wTileUp]
and 7 and %111
cp $3 cp COLL_DOWN_WALL & %111 ; COLL_DOWN_BUOY & %111
jr z, .ok_up jr z, .ok_up
cp $4 cp COLL_DOWN_RIGHT_WALL & %111 ; COLL_DOWN_RIGHT_BUOY & %111
jr z, .ok_up jr z, .ok_up
cp $5 cp COLL_DOWN_LEFT_WALL & %111 ; COLL_DOWN_LEFT_BUOY & %111
ret nz ret nz
.ok_up .ok_up
@ -1609,12 +1609,12 @@ GetMovementPermissions::
call .CheckHiNybble call .CheckHiNybble
ret nz ret nz
ld a, [wTileRight] ld a, [wTileRight]
and 7 and %111
cp $1 cp COLL_LEFT_WALL & %111 ; COLL_LEFT_BUOY & %111
jr z, .ok_right jr z, .ok_right
cp $5 cp COLL_DOWN_LEFT_WALL & %111 ; COLL_DOWN_LEFT_BUOY & %111
jr z, .ok_right jr z, .ok_right
cp $7 cp COLL_UP_LEFT_WALL & %111 ; COLL_UP_LEFT_BUOY & %111
ret nz ret nz
.ok_right .ok_right
@ -1627,12 +1627,12 @@ GetMovementPermissions::
call .CheckHiNybble call .CheckHiNybble
ret nz ret nz
ld a, [wTileLeft] ld a, [wTileLeft]
and 7 and %111
cp $0 cp COLL_RIGHT_WALL & %111 ; COLL_RIGHT_BUOY & %111
jr z, .ok_left jr z, .ok_left
cp $4 cp COLL_DOWN_RIGHT_WALL & %111 ; COLL_DOWN_RIGHT_BUOY & %111
jr z, .ok_left jr z, .ok_left
cp $6 cp COLL_UP_RIGHT_WALL & %111 ; COLL_UP_RIGHT_BUOY & %111
ret nz ret nz
.ok_left .ok_left
@ -1645,7 +1645,7 @@ GetMovementPermissions::
and $f0 and $f0
cp HI_NYBBLE_SIDE_WALLS cp HI_NYBBLE_SIDE_WALLS
ret z ret z
cp HI_NYBBLE_UNUSED_C0 cp HI_NYBBLE_SIDE_BUOYS
ret ret
GetFacingTileCoord:: GetFacingTileCoord::