summaryrefslogtreecommitdiff
path: root/engine/overworld/doors.asm
blob: 3f7b5f0fc00b1bca122d3e1d4694ff11d7f08d1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
; returns whether the player is standing on a door tile in carry
IsPlayerStandingOnDoorTile: ; 1a785 (6:6785)
	push de
	ld hl, DoorTileIDPointers
	ld a, [wCurMapTileset]
	ld de, $3
	call IsInArray
	pop de
	jr nc, .notStandingOnDoor
	inc hl
	ld a, [hli]
	ld h, [hl]
	ld l, a
	aCoord 8, 9 ; a = lower left background tile under player's sprite
	ld b, a
.loop
	ld a, [hli]
	and a
	jr z, .notStandingOnDoor
	cp b
	jr nz, .loop
	scf
	ret
.notStandingOnDoor
	and a
	ret

DoorTileIDPointers: ; 1a7a8 (6:67a8)
	dbw OVERWORLD,   OverworldDoorTileIDs
	dbw FOREST,      ForestDoorTileIDs
	dbw MART,        MartDoorTileIDs
	dbw HOUSE,       HouseDoorTileIDs
	dbw FOREST_GATE, TilesetMuseumDoorTileIDs
	dbw MUSEUM,      TilesetMuseumDoorTileIDs
	dbw GATE,        TilesetMuseumDoorTileIDs
	dbw SHIP,        ShipDoorTileIDs
	dbw LOBBY,       LobbyDoorTileIDs
	dbw MANSION,     MansionDoorTileIDs
	dbw LAB,         LabDoorTileIDs
	dbw FACILITY,    FacilityDoorTileIDs
	dbw PLATEAU,     PlateauDoorTileIDs
	dbw INTERIOR,    InteriorDoorTileIDs
	db $ff

OverworldDoorTileIDs: ; 1a7d3 (6:67d3)
	db $1B,$58,$00

ForestDoorTileIDs: ; 1a7d6 (6:67d6)
	db $3a,$00

MartDoorTileIDs: ; 1a7d8 (6:67d8)
	db $5e,$00

HouseDoorTileIDs: ; 1a7da (6:67da)
	db $54,$00

TilesetMuseumDoorTileIDs: ; 1a7dc (6:67dc)
	db $3b,$00

ShipDoorTileIDs: ; 1a7de (6:67de)
	db $1e,$00

LobbyDoorTileIDs: ; 1a7e0 (6:67e0)
	db $1c,$38,$1a,$00

MansionDoorTileIDs: ; 1a7e4 (6:67e4)
	db $1a,$1c,$53,$00

LabDoorTileIDs: ; 1a7e8 (6:67e8)
	db $34,$00

FacilityDoorTileIDs: ; 1a7ea (6:67ea)
	db $43,$58,$1b,$00

PlateauDoorTileIDs: ; 1a7ee (6:67ee)
	db $3b,$1b,$00

InteriorDoorTileIDs: ; 1a7f1 (6:67f1)
	db $04,$15,$00