|
|
- INCLUDE "hardware.inc"
-
- SECTION "Game Loop", ROM0
-
- Game_Start::
- ; disable ldc (CAN ONLY BE DONE DURING VBLANK) & interrupts
- halt
- di
- ld hl, rLCDC
- res 7, [hl]
-
- ld hl, intro_Data
- call Map_Load
-
- call Player_Init
-
- call Font_Init
-
- ; re-enable ldc & interrupts
- ld hl, rLCDC
- set 7, [hl]
- ei
-
- .loop:
- ld hl, frame
- inc [hl]
-
- call Keys_Update
- call Player_Update
-
- ; wait for vblank
- halt
-
- call Map_Update
-
- ; ~160 cycles
- ld a, HIGH(_OAM)
- call DMA_Start
-
- jr .loop
|