Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/overworld/spinners.asm
1271 views
1
LoadSpinnerArrowTiles::
2
ld a, [wSpritePlayerStateData1ImageIndex]
3
srl a
4
srl a
5
ld hl, SpinnerPlayerFacingDirections
6
ld c, a
7
ld b, $0
8
add hl, bc
9
ld a, [hl]
10
ld [wSpritePlayerStateData1ImageIndex], a
11
ld a, [wCurMapTileset]
12
cp FACILITY
13
ld hl, FacilitySpinnerArrows
14
jr z, .gotSpinnerArrows
15
ld hl, GymSpinnerArrows
16
.gotSpinnerArrows
17
ld a, [wSimulatedJoypadStatesIndex]
18
bit 0, a ; even or odd?
19
jr nz, .alternateGraphics
20
ld de, 6 * 4
21
add hl, de
22
.alternateGraphics
23
ld a, $4
24
ld bc, $0
25
.loop
26
push af
27
push hl
28
push bc
29
add hl, bc
30
ld a, [hli]
31
ld e, a
32
ld a, [hli]
33
ld d, a
34
ld a, [hli]
35
ld c, a
36
ld a, [hli]
37
ld b, a
38
ld a, [hli]
39
ld h, [hl]
40
ld l, a
41
call CopyVideoData
42
pop bc
43
ld a, $6
44
add c
45
ld c, a
46
pop hl
47
pop af
48
dec a
49
jr nz, .loop
50
ret
51
52
INCLUDE "data/tilesets/spinner_tiles.asm"
53
54
SpinnerPlayerFacingDirections:
55
; This isn't the order of the facing directions. Rather, it's a list of
56
; the facing directions that come next. For example, when the player is
57
; facing down (00), the next facing direction is left (08).
58
db $08 ; down -> left
59
db $0C ; up -> right
60
db $04 ; left -> up
61
db $00 ; right -> down
62
63
; these tiles are the animation for the tiles that push the player in dungeons like Rocket HQ
64
SpinnerArrowAnimTiles:
65
INCBIN "gfx/overworld/spinners.2bpp"
66
67