diff --git a/src/game.s b/src/game.s index f589300..dcad180 100644 --- a/src/game.s +++ b/src/game.s @@ -1,11 +1,24 @@ +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 + ; re-enable ldc & interrupts + ld hl, rLCDC + set 7, [hl] + ei + .loop: ld hl, frame inc [hl] diff --git a/src/title.s b/src/title.s index aff4067..a1ecaa9 100644 --- a/src/title.s +++ b/src/title.s @@ -1,3 +1,4 @@ +INCLUDE "game.inc" INCLUDE "hardware.inc" SECTION "Title Loop", ROM0 @@ -36,8 +37,15 @@ Title_Start:: call Keys_Update - ; todo: check for start press and transition to game state + ld a, [keys] + and PADF_START + jr z, .wait + ld a, GAME_STATEF_GAME + ld [state], a + ret + +.wait: ; wait for vblank halt