ssanne.asm 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. AnimateBoulderDust:
  2. ld a, $1
  3. ld [wWhichAnimationOffsets], a ; select the boulder dust offsets
  4. ld a, [wUpdateSpritesEnabled]
  5. push af
  6. ld a, $ff
  7. ld [wUpdateSpritesEnabled], a
  8. ld a, %11100100
  9. ld [rOBP1], a
  10. call LoadSmokeTileFourTimes
  11. callba WriteCutOrBoulderDustAnimationOAMBlock
  12. ld c, 8 ; number of steps in animation
  13. .loop
  14. push bc
  15. call GetMoveBoulderDustFunctionPointer
  16. ld bc, .returnAddress
  17. push bc
  18. ld c, 4
  19. jp hl
  20. .returnAddress
  21. ld a, [rOBP1]
  22. xor %01100100
  23. ld [rOBP1], a
  24. call Delay3
  25. pop bc
  26. dec c
  27. jr nz, .loop
  28. pop af
  29. ld [wUpdateSpritesEnabled], a
  30. jp LoadPlayerSpriteGraphics
  31. GetMoveBoulderDustFunctionPointer:
  32. ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
  33. ld hl, MoveBoulderDustFunctionPointerTable
  34. ld c, a
  35. ld b, $0
  36. add hl, bc
  37. ld a, [hli]
  38. ld [wCoordAdjustmentAmount], a
  39. ld a, [hli]
  40. ld e, a
  41. ld a, [hli]
  42. ld h, [hl]
  43. ld l, a
  44. push hl
  45. ld hl, wOAMBuffer + $90
  46. ld d, $0
  47. add hl, de
  48. ld e, l
  49. ld d, h
  50. pop hl
  51. ret
  52. MoveBoulderDustFunctionPointerTable:
  53. ; facing down
  54. db $FF,$00
  55. dw AdjustOAMBlockYPos
  56. ; facing up
  57. db $01,$00
  58. dw AdjustOAMBlockYPos
  59. ; facing left
  60. db $01,$01
  61. dw AdjustOAMBlockXPos
  62. ; facing right
  63. db $FF,$01
  64. dw AdjustOAMBlockXPos
  65. LoadSmokeTileFourTimes:
  66. ld hl, vChars1 + $7c0
  67. ld c, $4
  68. .loop
  69. push bc
  70. push hl
  71. call LoadSmokeTile
  72. pop hl
  73. ld bc, $10
  74. add hl, bc
  75. pop bc
  76. dec c
  77. jr nz, .loop
  78. ret
  79. LoadSmokeTile:
  80. ld de, SSAnneSmokePuffTile
  81. lb bc, BANK(SSAnneSmokePuffTile), (SSAnneSmokePuffTileEnd - SSAnneSmokePuffTile) / $10
  82. jp CopyVideoData
  83. SSAnneSmokePuffTile:
  84. INCBIN "gfx/ss_anne_smoke_puff.2bpp"
  85. SSAnneSmokePuffTileEnd: