HoF_room_pc.asm 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. HallOfFamePC:
  2. callba AnimateHallOfFame
  3. call ClearScreen
  4. ld c, 100
  5. call DelayFrames
  6. call DisableLCD
  7. ld hl, vFont
  8. ld bc, $800 / 2
  9. call ZeroMemory
  10. ld hl, vChars2 + $600
  11. ld bc, $200 / 2
  12. call ZeroMemory
  13. ld hl, vChars2 + $7e0
  14. ld bc, $10
  15. ld a, $ff
  16. call FillMemory
  17. coord hl, 0, 0
  18. call FillFourRowsWithBlack
  19. coord hl, 0, 14
  20. call FillFourRowsWithBlack
  21. ld a, %11000000
  22. ld [rBGP], a
  23. call EnableLCD
  24. ld a, $ff
  25. call PlaySoundWaitForCurrent
  26. ld c, BANK(Music_Credits)
  27. ld a, MUSIC_CREDITS
  28. call PlayMusic
  29. ld c, 128
  30. call DelayFrames
  31. xor a
  32. ld [wUnusedCD3D], a ; not read
  33. ld [wNumCreditsMonsDisplayed], a
  34. jp Credits
  35. FadeInCreditsText:
  36. ld hl, HoFGBPalettes
  37. ld b, 4
  38. .loop
  39. ld a, [hli]
  40. ld [rBGP], a
  41. ld c, 5
  42. call DelayFrames
  43. dec b
  44. jr nz, .loop
  45. ret
  46. DisplayCreditsMon:
  47. xor a
  48. ld [H_AUTOBGTRANSFERENABLED], a
  49. call SaveScreenTilesToBuffer1
  50. call FillMiddleOfScreenWithWhite
  51. ; display the next monster from CreditsMons
  52. ld hl, wNumCreditsMonsDisplayed
  53. ld c, [hl] ; how many monsters have we displayed so far?
  54. inc [hl]
  55. ld b, 0
  56. ld hl, CreditsMons
  57. add hl, bc ; go that far in the list of monsters and get the next one
  58. ld a, [hl]
  59. ld [wcf91], a
  60. ld [wd0b5], a
  61. coord hl, 8, 6
  62. call GetMonHeader
  63. call LoadFrontSpriteByMonIndex
  64. ld hl, vBGMap0 + $c
  65. call CreditsCopyTileMapToVRAM
  66. xor a
  67. ld [H_AUTOBGTRANSFERENABLED], a
  68. call LoadScreenTilesFromBuffer1
  69. ld hl, vBGMap0
  70. call CreditsCopyTileMapToVRAM
  71. ld a, $A7
  72. ld [rWX], a
  73. ld hl, vBGMap1
  74. call CreditsCopyTileMapToVRAM
  75. call FillMiddleOfScreenWithWhite
  76. ld a, %11111100 ; make the mon a black silhouette
  77. ld [rBGP], a
  78. ; scroll the mon left by one tile 7 times
  79. ld bc, 7
  80. .scrollLoop1
  81. call ScrollCreditsMonLeft
  82. dec c
  83. jr nz, .scrollLoop1
  84. ; scroll the mon left by one tile 20 times
  85. ; This time, we have to move the window left too in order to hide the text that
  86. ; is wrapping around to the right side of the screen.
  87. ld c, 20
  88. .scrollLoop2
  89. call ScrollCreditsMonLeft
  90. ld a, [rWX]
  91. sub 8
  92. ld [rWX], a
  93. dec c
  94. jr nz, .scrollLoop2
  95. xor a
  96. ld [hWY], a
  97. ld a, %11000000
  98. ld [rBGP], a
  99. ret
  100. INCLUDE "data/credit_mons.asm"
  101. ScrollCreditsMonLeft:
  102. ld h, b
  103. ld l, $20
  104. call ScrollCreditsMonLeft_SetSCX
  105. ld h, $0
  106. ld l, $70
  107. call ScrollCreditsMonLeft_SetSCX
  108. ld a, b
  109. add $8
  110. ld b, a
  111. ret
  112. ScrollCreditsMonLeft_SetSCX:
  113. ld a, [rLY]
  114. cp l
  115. jr nz, ScrollCreditsMonLeft_SetSCX
  116. ld a, h
  117. ld [rSCX], a
  118. .loop
  119. ld a, [rLY]
  120. cp h
  121. jr z, .loop
  122. ret
  123. HoFGBPalettes:
  124. db %11000000
  125. db %11010000
  126. db %11100000
  127. db %11110000
  128. CreditsCopyTileMapToVRAM:
  129. ld a, l
  130. ld [H_AUTOBGTRANSFERDEST], a
  131. ld a, h
  132. ld [H_AUTOBGTRANSFERDEST + 1], a
  133. ld a, 1
  134. ld [H_AUTOBGTRANSFERENABLED], a
  135. jp Delay3
  136. ZeroMemory:
  137. ; zero bc bytes at hl
  138. ld [hl], 0
  139. inc hl
  140. inc hl
  141. dec bc
  142. ld a, b
  143. or c
  144. jr nz, ZeroMemory
  145. ret
  146. FillFourRowsWithBlack:
  147. ld bc, SCREEN_WIDTH * 4
  148. ld a, $7e
  149. jp FillMemory
  150. FillMiddleOfScreenWithWhite:
  151. coord hl, 0, 4
  152. ld bc, SCREEN_WIDTH * 10
  153. ld a, " "
  154. jp FillMemory
  155. Credits:
  156. ld de, CreditsOrder
  157. push de
  158. .nextCreditsScreen
  159. pop de
  160. coord hl, 9, 6
  161. push hl
  162. call FillMiddleOfScreenWithWhite
  163. pop hl
  164. .nextCreditsCommand
  165. ld a, [de]
  166. inc de
  167. push de
  168. cp $ff
  169. jr z, .fadeInTextAndShowMon
  170. cp $fe
  171. jr z, .showTextAndShowMon
  172. cp $fd
  173. jr z, .fadeInText
  174. cp $fc
  175. jr z, .showText
  176. cp $fb
  177. jr z, .showCopyrightText
  178. cp $fa
  179. jr z, .showTheEnd
  180. push hl
  181. push hl
  182. ld hl, CreditsTextPointers
  183. add a
  184. ld c, a
  185. ld b, 0
  186. add hl, bc
  187. ld e, [hl]
  188. inc hl
  189. ld d, [hl]
  190. ld a, [de]
  191. inc de
  192. ld c, a
  193. ld b, $ff
  194. pop hl
  195. add hl, bc
  196. call PlaceString
  197. pop hl
  198. ld bc, SCREEN_WIDTH * 2
  199. add hl, bc
  200. pop de
  201. jr .nextCreditsCommand
  202. .fadeInTextAndShowMon
  203. call FadeInCreditsText
  204. ld c, 90
  205. jr .next1
  206. .showTextAndShowMon
  207. ld c, 110
  208. .next1
  209. call DelayFrames
  210. call DisplayCreditsMon
  211. jr .nextCreditsScreen
  212. .fadeInText
  213. call FadeInCreditsText
  214. ld c, 120
  215. jr .next2
  216. .showText
  217. ld c, 140
  218. .next2
  219. call DelayFrames
  220. jr .nextCreditsScreen
  221. .showCopyrightText
  222. push de
  223. callba LoadCopyrightTiles
  224. pop de
  225. pop de
  226. jr .nextCreditsCommand
  227. .showTheEnd
  228. ld c, 16
  229. call DelayFrames
  230. call FillMiddleOfScreenWithWhite
  231. pop de
  232. ld de, TheEndGfx
  233. ld hl, vChars2 + $600
  234. lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10
  235. call CopyVideoData
  236. coord hl, 4, 8
  237. ld de, TheEndTextString
  238. call PlaceString
  239. coord hl, 4, 9
  240. inc de
  241. call PlaceString
  242. jp FadeInCreditsText
  243. TheEndTextString:
  244. ; "T H E E N D"
  245. db $60," ",$62," ",$64," ",$64," ",$66," ",$68,"@"
  246. db $61," ",$63," ",$65," ",$65," ",$67," ",$69,"@"
  247. INCLUDE "data/credits_order.asm"
  248. INCLUDE "text/credits_text.asm"
  249. TheEndGfx:
  250. INCBIN "gfx/theend.2bpp"
  251. TheEndGfxEnd: