Advertisement
wolfboyft

AAAGH

Jul 22nd, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. Start::
  2. di
  3. ld sp, $D000
  4. InitDone::
  5. call StopLCD
  6. ld a, $e4
  7. ld [rBGP], a
  8. xor a
  9. ld [rSCX], a
  10. ld [rSCY], a
  11. ld hl, Font
  12. ld de, _VRAM
  13. ld bc, FontEnd - Font
  14. call CopyDoubleForwards
  15. ld hl, Text_HelloWorld
  16. ld de, $9800+3+(SCRN_VY_B*7)
  17. ld bc, 13
  18. call CopyForwards
  19. call StartLCD
  20. Finished::
  21. jr Finished
  22.  
  23. Text_HelloWorld::
  24. db "Hello, world!"
  25.  
  26. CopyForwards::
  27. ;copy bc bytes forward from hl to de
  28. ld a, b
  29. or c
  30. ret z
  31. ld a, [hli]
  32. ld [de], a
  33. inc de
  34. dec bc
  35. jr CopyForwards
  36.  
  37. CopyDoubleForwards::
  38. ;copy bc bytes forward from hl to de, twice for each byte
  39. ld a, b
  40. or c
  41. ret z
  42. ld a, [hli]
  43. ld [de], a
  44. inc de
  45. ld [de], a
  46. inc de
  47. dec bc
  48. jr CopyForwards
  49.  
  50. ; CopyBackwards::
  51. ; ;copy bc bytes backward from hl to de
  52. ; ld a, b
  53. ; or c
  54. ; ret z
  55. ; ld a, [hld]
  56. ; ld [de], a
  57. ; dec de
  58. ; inc bc
  59. ; jr CopyBackwards
  60.  
  61. StopLCD::
  62. ld a, [rLCDC]
  63. rlca
  64. ret nc
  65. .wait
  66. ld a, [rLY]
  67. cp 145
  68. jr nz, .wait
  69. ld a, [rLCDC]
  70. res 7, a
  71. ld [rLCDC], a
  72. ret
  73.  
  74. StartLCD::
  75. ld a, LCDCF_ON|LCDCF_BG8000|LCDCF_BG9800|LCDCF_BGON|LCDCF_OBJ16|LCDCF_OBJOFF
  76. ld [rLCDC], a
  77. ret
  78.  
  79. Font::
  80. INCBIN "font.1bpp"
  81. FontEnd::
  82. ;*** End Of File ***
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement