sprite animation testing
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

142 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, 100
  29. ld [Player_YPos], a
  30. ld a, 40
  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. ld a, 1
  48. ld [NPC01_GFXState], a
  49. xor a
  50. ld [NPC01_TileData], a
  51. ld a, HIGH(ActorROM)
  52. ld [NPC01_GFXData+1], a
  53. ld a, LOW(ActorROM)
  54. ld [NPC01_GFXData], a
  55. ld a, 48
  56. ld [NPC02_YPos], a
  57. ld a, 48
  58. ld [NPC02_XPos], a
  59. ld a, 30
  60. ld [NPC02_GFXCounter], a
  61. xor a
  62. ld [NPC02_GFXState], a
  63. ld [NPC02_TileData], a
  64. ld a, HIGH(ActorROM)
  65. ld [NPC02_GFXData+1], a
  66. ld a, LOW(ActorROM)
  67. ld [NPC02_GFXData], a
  68. ld a, 72
  69. ld [NPC03_YPos], a
  70. ld a, 72
  71. ld [NPC03_XPos], a
  72. ld a, 40
  73. ld [NPC03_GFXCounter], a
  74. xor a
  75. ld [NPC03_GFXState], a
  76. ld [NPC03_TileData], a
  77. ld a, HIGH(ActorROM)
  78. ld [NPC03_GFXData+1], a
  79. ld a, LOW(ActorROM)
  80. ld [NPC03_GFXData], a
  81. ld a, 96
  82. ld [NPC04_YPos], a
  83. ld a, 96
  84. ld [NPC04_XPos], a
  85. ld a, 50
  86. ld [NPC04_GFXCounter], a
  87. xor a
  88. ld [NPC04_GFXState], a
  89. ld [NPC04_TileData], a
  90. ld a, HIGH(ActorROM)
  91. ld [NPC04_GFXData+1], a
  92. ld a, LOW(ActorROM)
  93. ld [NPC04_GFXData], a
  94. ld a, 130
  95. ld [NPC05_YPos], a
  96. ld a, 130
  97. ld [NPC05_XPos], a
  98. ld a, 10
  99. ld [NPC05_GFXCounter], a
  100. xor a
  101. ld [NPC05_GFXState], a
  102. ld [NPC05_TileData], a
  103. ld a, HIGH(ActorROM)
  104. ld [NPC05_GFXData+1], a
  105. ld a, LOW(ActorROM)
  106. ld [NPC05_GFXData], a
  107. ld a, LCDCF_ON | LCDCF_OBJON | LCDCF_BGON
  108. ld [rLCDC], a
  109. game_loop:
  110. call Hide_OAM
  111. call Read_Pad
  112. call PC_Update
  113. ld de, wShadowOAM
  114. ld hl, Player
  115. call RenderActor
  116. ld hl, NPC01
  117. call RenderActor
  118. ld hl, NPC02
  119. call RenderActor
  120. ld hl, NPC03
  121. call RenderActor
  122. ld hl, NPC04
  123. call RenderActor
  124. ld hl, NPC05
  125. call RenderActor
  126. call Wait_VBlank
  127. ld a, HIGH(wShadowOAM)
  128. call hOAMDMA
  129. jr game_loop