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.

52 lines
865 B

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