sprite animation testing
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

141 lines
2.5KB

  1. ;----------------
  2. ; Program Start
  3. ;----------------
  4. INCLUDE "src/actor.asm"
  5. SECTION "Program Start", ROM0[$150]
  6. Start:
  7. ld a, IEF_VBLANK
  8. ld [rIE], a
  9. ei
  10. xor a
  11. ld [hVBlankFlag], a
  12. call Wait_VBlank
  13. xor a
  14. ldh [rLCDC], a
  15. call Clear_Map
  16. call Clear_OAM
  17. call Load_Tiles
  18. ; call Load_Map
  19. ld a, %11100100
  20. ld [rBGP], a
  21. ld [rOBP0], a
  22. ld [rOBP1], a
  23. xor a
  24. ld [rSCY], a
  25. ld [rSCX], a
  26. ld [rNR52], a
  27. call CopyDMARoutine
  28. ld a, 72
  29. ld [Player_YPos], a
  30. ld a, 80
  31. ld [Player_XPos], a
  32. ld a, $FF
  33. ld [Player_GFXCounter], a
  34. xor a
  35. ld [Player_GFXState], a
  36. ld [Player_TileData], a
  37. ld a, HIGH(ActorROM)
  38. ld [Player_GFXData+1], a
  39. ld a, LOW(ActorROM)
  40. ld [Player_GFXData], a
  41. ld a, 24
  42. ld [NPC01_YPos], a
  43. ld a, 24
  44. ld [NPC01_XPos], a
  45. ld a, 20
  46. ld [NPC01_GFXCounter], a
  47. xor a
  48. ld [NPC01_GFXState], a
  49. ld [NPC01_TileData], a
  50. ld a, HIGH(ActorROM)
  51. ld [NPC01_GFXData+1], a
  52. ld a, LOW(ActorROM)
  53. ld [NPC01_GFXData], a
  54. ld a, 24
  55. ld [NPC02_YPos], a
  56. ld a, 48
  57. ld [NPC02_XPos], a
  58. ld a, 30
  59. ld [NPC02_GFXCounter], a
  60. xor a
  61. ld [NPC02_GFXState], a
  62. ld [NPC02_TileData], a
  63. ld a, HIGH(ActorROM)
  64. ld [NPC02_GFXData+1], a
  65. ld a, LOW(ActorROM)
  66. ld [NPC02_GFXData], a
  67. ld a, 48
  68. ld [NPC03_YPos], a
  69. ld a, 48
  70. ld [NPC03_XPos], a
  71. ld a, 40
  72. ld [NPC03_GFXCounter], a
  73. xor a
  74. ld [NPC03_GFXState], a
  75. ld [NPC03_TileData], a
  76. ld a, HIGH(ActorROM)
  77. ld [NPC03_GFXData+1], a
  78. ld a, LOW(ActorROM)
  79. ld [NPC03_GFXData], a
  80. ld a, 48
  81. ld [NPC04_YPos], a
  82. ld a, 24
  83. ld [NPC04_XPos], a
  84. ld a, 50
  85. ld [NPC04_GFXCounter], a
  86. xor a
  87. ld [NPC04_GFXState], a
  88. ld [NPC04_TileData], a
  89. ld a, HIGH(ActorROM)
  90. ld [NPC04_GFXData+1], a
  91. ld a, LOW(ActorROM)
  92. ld [NPC04_GFXData], a
  93. ld a, 64
  94. ld [NPC05_YPos], a
  95. ld a, 64
  96. ld [NPC05_XPos], a
  97. ld a, 10
  98. ld [NPC05_GFXCounter], a
  99. xor a
  100. ld [NPC05_GFXState], a
  101. ld [NPC05_TileData], a
  102. ld a, HIGH(ActorROM)
  103. ld [NPC05_GFXData+1], a
  104. ld a, LOW(ActorROM)
  105. ld [NPC05_GFXData], a
  106. ld a, LCDCF_ON | LCDCF_OBJON | LCDCF_BGON
  107. ld [rLCDC], a
  108. game_loop:
  109. call Hide_OAM
  110. call Read_Pad
  111. call PC_Update
  112. ld de, wShadowOAM
  113. ld hl, Player
  114. call RenderActor
  115. ld hl, NPC01
  116. call RenderActor
  117. ld hl, NPC02
  118. call RenderActor
  119. ld hl, NPC03
  120. call RenderActor
  121. ld hl, NPC04
  122. call RenderActor
  123. ld hl, NPC05
  124. call RenderActor
  125. call Wait_VBlank
  126. ld a, HIGH(wShadowOAM)
  127. call hOAMDMA
  128. jr game_loop