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.

44 lines
796 B

  1. INCLUDE "hardware.inc"
  2. SECTION "Title Loop", ROM0
  3. titleTiles: INCBIN "png/bg/title.2bpp"
  4. titleMap: INCBIN "png/bg/title.tilemap"
  5. titleMapEnd:
  6. DEF TITLE_TILES_SIZE EQUS "titleMap - titleTiles"
  7. DEF TITLE_MAP_SIZE EQUS "titleMapEnd - titleMap"
  8. Title_Start::
  9. ; load title screen
  10. ld bc, _VRAM
  11. ld hl, titleTiles
  12. ld de, TITLE_TILES_SIZE
  13. call memcpy16
  14. ; could probably be sped up...
  15. FOR Y, 18
  16. ld bc, _SCRN0 + 32 * Y
  17. ld hl, titleMap + 20 * Y
  18. ld d, 20
  19. call memcpy
  20. ENDR
  21. ; enable lcd, sprites and interrupts
  22. ld hl, rLCDC
  23. set 7, [hl]
  24. set 1, [hl]
  25. ei
  26. .loop:
  27. ld hl, frame
  28. inc [hl]
  29. call Keys_Update
  30. ; todo: check for start press and transition to game state
  31. ; wait for vblank
  32. halt
  33. jr .loop