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.

40 lines
543 B

  1. INCLUDE "hardware.inc"
  2. SECTION "Game Loop", ROM0
  3. Game_Start::
  4. ; disable ldc (CAN ONLY BE DONE DURING VBLANK) & interrupts
  5. halt
  6. di
  7. ld hl, rLCDC
  8. res 7, [hl]
  9. ld hl, intro_Data
  10. call Map_Load
  11. call Player_Init
  12. call Font_Init
  13. ; re-enable ldc & interrupts
  14. ld hl, rLCDC
  15. set 7, [hl]
  16. ei
  17. .loop:
  18. ld hl, frame
  19. inc [hl]
  20. call Keys_Update
  21. call Player_Update
  22. ; wait for vblank
  23. halt
  24. call Map_Update
  25. ; ~160 cycles
  26. ld a, HIGH(_OAM)
  27. call DMA_Start
  28. jr .loop