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.

26 lines
473 B

  1. INCLUDE "font.inc"
  2. INCLUDE "game.inc"
  3. INCLUDE "hardware.inc"
  4. SECTION "Font Data", ROM0
  5. fontTiles:: FONT_TILE_DATA
  6. fontTilesEnd::
  7. SECTION "Font Code", ROM0
  8. Font_Init::
  9. ; copy font to tile VRAM. font data must be doubled to render correctly
  10. ld hl, _VRAM + TILE_INDEX_FONT * TILE_SIZE
  11. ld de, fontTiles
  12. ld bc, fontTilesEnd - fontTiles
  13. .loop:
  14. ld a, [de]
  15. ld [hli], a
  16. ld [hli], a
  17. inc de
  18. dec bc
  19. ld a, b
  20. or c
  21. jr nz, .loop
  22. ret