diploma.asm 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. DisplayDiploma:
  2. call SaveScreenTilesToBuffer2
  3. call GBPalWhiteOutWithDelay3
  4. call ClearScreen
  5. xor a
  6. ld [wUpdateSpritesEnabled], a
  7. ld hl, wd730
  8. set 6, [hl]
  9. call DisableLCD
  10. ld hl, CircleTile
  11. ld de, vChars2 + $700
  12. ld bc, $0010
  13. ld a, BANK(CircleTile)
  14. call FarCopyData2
  15. coord hl, 0, 0
  16. lb bc, 16, 18
  17. predef Diploma_TextBoxBorder
  18. ld hl, DiplomaTextPointersAndCoords
  19. ld c, $5
  20. .asm_56715
  21. push bc
  22. ld a, [hli]
  23. ld e, a
  24. ld a, [hli]
  25. ld d, a
  26. ld a, [hli]
  27. push hl
  28. ld h, [hl]
  29. ld l, a
  30. call PlaceString
  31. pop hl
  32. inc hl
  33. pop bc
  34. dec c
  35. jr nz, .asm_56715
  36. coord hl, 10, 4
  37. ld de, wPlayerName
  38. call PlaceString
  39. callba DrawPlayerCharacter
  40. ; Move the player 33 pixels right and set the priority bit so he appears
  41. ; behind the background layer.
  42. ld hl, wOAMBuffer + $01
  43. lb bc, $80, $28
  44. .adjustPlayerGfxLoop
  45. ld a, [hl] ; X
  46. add 33
  47. ld [hli], a
  48. inc hl
  49. ld a, b
  50. ld [hli], a ; attributes
  51. inc hl
  52. dec c
  53. jr nz, .adjustPlayerGfxLoop
  54. call EnableLCD
  55. callba LoadTrainerInfoTextBoxTiles
  56. ld b, SET_PAL_GENERIC
  57. call RunPaletteCommand
  58. call Delay3
  59. call GBPalNormal
  60. ld a, $90
  61. ld [rOBP0], a
  62. call WaitForTextScrollButtonPress
  63. ld hl, wd730
  64. res 6, [hl]
  65. call GBPalWhiteOutWithDelay3
  66. call RestoreScreenTilesAndReloadTilePatterns
  67. call Delay3
  68. jp GBPalNormal
  69. UnusedPlayerNameLengthFunc:
  70. ; Unused function that does a calculation involving the length of the player's
  71. ; name.
  72. ld hl, wPlayerName
  73. ld bc, $ff00
  74. .loop
  75. ld a, [hli]
  76. cp "@"
  77. ret z
  78. dec c
  79. jr .loop
  80. DiplomaTextPointersAndCoords:
  81. dw DiplomaText
  82. dwCoord 5, 2
  83. dw DiplomaPlayer
  84. dwCoord 3, 4
  85. dw DiplomaEmptyText
  86. dwCoord 15, 4
  87. dw DiplomaCongrats
  88. dwCoord 2, 6
  89. dw DiplomaGameFreak
  90. dwCoord 9, 16
  91. DiplomaText:
  92. db $70,"Diploma",$70,"@"
  93. DiplomaPlayer:
  94. db "Player@"
  95. DiplomaEmptyText:
  96. db "@"
  97. DiplomaCongrats:
  98. db "Congrats! This"
  99. next "diploma certifies"
  100. next "that you have"
  101. next "completed your"
  102. next "#DEX.@"
  103. DiplomaGameFreak:
  104. db "GAME FREAK@"