diff --git a/src/main.s b/src/main.s index 3715d36..7cf5085 100644 --- a/src/main.s +++ b/src/main.s @@ -14,6 +14,11 @@ SECTION "Frame", WRAM0 frame:: db +SECTION "VBlank", ROM0[$40] + +handle_vblank: + reti + SECTION "Code", ROM0 start: @@ -21,6 +26,9 @@ start: res 7, [hl] res 2, [hl] + ld hl, rIE + ld [hl], IEF_VBLANK + call BG_Init call OAM_Init call Keys_Init @@ -46,7 +54,8 @@ start: call Keys_Update call Player_Update - call wait_for_vblank + ; wait for vblank + halt ld a, HIGH(_OAM) call DMA_Start diff --git a/src/player.s b/src/player.s index 5afcc70..8a549d3 100644 --- a/src/player.s +++ b/src/player.s @@ -54,11 +54,11 @@ Player_Init:: Player_Update:: ; Only update every 2 frames - ld hl, frame - ld a, [hl] - and %1 - cp %1 - ret nz + ; ld hl, frame + ; ld a, [hl] + ; and %1 + ; cp %1 + ; ret nz ld hl, keys ld b, [hl]