Advertisement
Guest User

som_spirit_icon

a guest
Dec 10th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. .thumb
  2. .thumb_func
  3.  
  4. .org 0x006874
  5. getCharIndex:
  6.  
  7. .org 0x006cb8
  8. drawHUD:
  9.  
  10. .org 0x03bd9a
  11. @bl drawHUD
  12. bl drawSpiritHUD
  13.  
  14. .org 0x05bb5e
  15. @restore maxmana / 5 while sitting
  16. mov r1,#0x5
  17.  
  18. .org 0x3cc040
  19. .align 2
  20. drawSpiritHUD:
  21. push {r14}
  22. bl drawHUD
  23. mov r6,r0
  24. bl check_SpiritIcon
  25. pop {r15}
  26. .align 2
  27. check_SpiritIcon:
  28. push {r14}
  29. bl checkCurrentSpirit
  30. cmp r0,#0x0
  31. beq check_SpiritIcon_done
  32. bl draw_SpiritIcon
  33. check_SpiritIcon_done:
  34. mov r0,r6
  35. pop {r15}
  36. .align 2
  37. draw_SpiritIcon:
  38. push {r4,r14}
  39. sub r0,#0x1
  40. mov r4,r0
  41.  
  42. ldr r3,draw_SpiritIcon_Spiritpalette_Pointer
  43. add r3,r0
  44.  
  45. ldr r0,draw_SpiritIcon_Vram
  46. ldr r1,draw_SpiritIcon_BackgroundAddr
  47. mov r2,#0x20
  48. bl copySpriteVram
  49. mov r2,r0
  50. mov r0,r4
  51.  
  52. mov r1,#0xa0
  53. lsl r1,#0x2
  54. mul r0,r1
  55. ldr r1,draw_SpiritIcon_SpriteAddr
  56. add r1,r0
  57. mov r0,r2
  58. mov r2,#0x20
  59. bl copySpriteVram
  60. @frame ---
  61. ldr r1,draw_SpiritIcon_FrameAddr
  62. mov r2,#0x20
  63. bl copySpriteVram
  64.  
  65. mov r0,#0x0
  66. lsl r0,#0xc
  67. mov r1,#0xa2
  68. lsl r1,#0x2
  69. add r0,r1
  70.  
  71. str r0,[r6,#0x4]
  72. ldr r0,draw_SpiritIcon_OAM_0
  73. str r0,[r6]
  74. add r6,#0x8
  75. @sprite ---
  76. ldrb r0,[r3]
  77. lsl r0,#0xc
  78. mov r1,#0xa1
  79. lsl r1,#0x2
  80. add r0,r1
  81.  
  82. str r0,[r6,#0x4]
  83. ldr r0,draw_SpiritIcon_OAM_0
  84. str r0,[r6]
  85. add r6,#0x8
  86. @background ---
  87. mov r0,#0x0
  88. lsl r0,#0xc
  89. mov r1,#0xa0
  90. lsl r1,#0x2
  91. add r0,r1
  92.  
  93. str r0,[r6,#0x4]
  94. ldr r0,draw_SpiritIcon_OAM_0
  95. str r0,[r6]
  96. add r6,#0x8
  97. pop {r4}
  98. pop {r15}
  99. .align 2
  100. draw_SpiritIcon_OAM_0: .word 0x40b20080
  101. draw_SpiritIcon_SpriteAddr: .word 0x0881e690
  102. draw_SpiritIcon_FrameAddr: .word 0x083cc440
  103. draw_SpiritIcon_BackgroundAddr: .word 0x083cc4c0
  104. draw_SpiritIcon_Vram: .word 0x06015000
  105. draw_SpiritIcon_Spiritpalette_Pointer: .word (draw_SpiritIcon_Spiritpalette + 0x8000000)
  106. draw_SpiritIcon_Spiritpalette:
  107. @wisp
  108. .byte 0x03
  109. @shade
  110. .byte 0x03
  111. @luna
  112. .byte 0x03
  113. @salamder
  114. .byte 0x03
  115. @undine
  116. .byte 0x02
  117. @dryad
  118. .byte 0x01
  119. @jinn
  120. .byte 0x03
  121. @gnome
  122. .byte 0x01
  123. .align 2
  124. copySpriteVram:
  125. push {r3-r4}
  126. mov r4,#0x0
  127. copySpriteVram_loop:
  128. ldr r3,[r1]
  129. str r3,[r0]
  130.  
  131. add r0,#0x4
  132. add r1,#0x4
  133. add r4,#0x1
  134. cmp r4,r2
  135. blt copySpriteVram_loop
  136. pop {r3-r4}
  137. bx r14
  138. .align 2
  139. checkCurrentSpirit:
  140. ldr r0,checkCurrentSpirit_currentChar
  141. ldrb r1,[r0]
  142. lsl r0,r1,#0x1
  143. add r0,r1
  144. lsl r0,#0x2
  145. sub r0,r1
  146. lsl r0,#0x5
  147. ldr r1,checkCurrentSpirit_RamAddr0
  148. add r0,r1
  149. mov r1,#0x91
  150. lsl r1,#0x1
  151. add r1,#0x1
  152. add r0,r1
  153. ldrb r0,[r0]
  154. mov r1,#0x58
  155. mul r0,r1
  156. ldr r1,checkCurrentSpirit_RamAddr1
  157. add r0,r1
  158. ldrb r0,[r0,#0x17]
  159. lsl r0,#0x1b
  160. lsr r0,#0x1c
  161. bx r14
  162. .align 2
  163. checkCurrentSpirit_currentChar: .word 0x2002f44@0x2000604
  164. checkCurrentSpirit_RamAddr0: .word 0x2001650
  165. checkCurrentSpirit_RamAddr1: .word 0x20203f0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement