summaryrefslogtreecommitdiff
path: root/engine/overworld/spinners.asm
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2020-07-15 12:26:16 -0400
committerGitHub <noreply@github.com>2020-07-15 12:26:16 -0400
commite18e5d50b5e154c1a7c94a2a1f39a3a99daa689a (patch)
treed8a157ae5aa323a00873efe79eb4693327b8bb70 /engine/overworld/spinners.asm
parentaa97e196dd5b37e89db5ddf154dc7aea9b02a045 (diff)
parent93d0697f37aca8ed7a21298a980876af6d43268b (diff)
Merge pull request #273 from Rangi42/master
Clean up some data, using macros for multiline list entries
Diffstat (limited to 'engine/overworld/spinners.asm')
-rw-r--r--engine/overworld/spinners.asm65
1 files changed, 65 insertions, 0 deletions
diff --git a/engine/overworld/spinners.asm b/engine/overworld/spinners.asm
new file mode 100644
index 00000000..0ac6380d
--- /dev/null
+++ b/engine/overworld/spinners.asm
@@ -0,0 +1,65 @@
+LoadSpinnerArrowTiles::
+ ld a, [wSpritePlayerStateData1ImageIndex]
+ srl a
+ srl a
+ ld hl, SpinnerPlayerFacingDirections
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [hl]
+ ld [wSpritePlayerStateData1ImageIndex], a
+ ld a, [wCurMapTileset]
+ cp FACILITY
+ ld hl, FacilitySpinnerArrows
+ jr z, .asm_44ff6
+ ld hl, GymSpinnerArrows
+.asm_44ff6
+ ld a, [wSimulatedJoypadStatesIndex]
+ bit 0, a
+ jr nz, .asm_45001
+ ld de, $18
+ add hl, de
+.asm_45001
+ ld a, $4
+ ld bc, $0
+.asm_45006
+ push af
+ push hl
+ push bc
+ add hl, bc
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ ld a, [hli]
+ ld c, a
+ ld a, [hli]
+ ld b, a
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ call CopyVideoData
+ pop bc
+ ld a, $6
+ add c
+ ld c, a
+ pop hl
+ pop af
+ dec a
+ jr nz, .asm_45006
+ ret
+
+INCLUDE "data/tilesets/spinner_tiles.asm"
+
+SpinnerPlayerFacingDirections:
+; This isn't the order of the facing directions. Rather, it's a list of
+; the facing directions that come next. For example, when the player is
+; facing down (00), the next facing direction is left (08).
+ db $08 ; down -> left
+ db $0C ; up -> right
+ db $04 ; left -> up
+ db $00 ; right -> down
+
+; these tiles are the animation for the tiles that push the player in dungeons like Rocket HQ
+SpinnerArrowAnimTiles:
+ INCBIN "gfx/overworld/spinners.2bpp"