properly clear and enable interrupts
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
INCLUDE "hardware.inc"
|
INCLUDE "hardware.inc"
|
||||||
|
INCLUDE "utils.inc"
|
||||||
|
|
||||||
RENDER_IN_HBL EQU 0
|
RENDER_IN_HBL EQU 0
|
||||||
|
|
||||||
@@ -126,9 +127,7 @@ ELSE
|
|||||||
ld a, IEF_VBLANK
|
ld a, IEF_VBLANK
|
||||||
ENDC
|
ENDC
|
||||||
ld [rIE], a
|
ld [rIE], a
|
||||||
xor a
|
ClearAndEnableInterrupts
|
||||||
ei
|
|
||||||
ldh [rIF], a
|
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -141,6 +140,7 @@ WaitRender:
|
|||||||
halt
|
halt
|
||||||
jr WaitRender
|
jr WaitRender
|
||||||
|
|
||||||
|
di
|
||||||
IF RENDER_IN_HBL != 0
|
IF RENDER_IN_HBL != 0
|
||||||
; enable only v-blank interrupt and wait for vbl
|
; enable only v-blank interrupt and wait for vbl
|
||||||
ld a, IEF_VBLANK
|
ld a, IEF_VBLANK
|
||||||
|
|||||||
Reference in New Issue
Block a user