From fb022aa6d7ae1d9e6651b996c330fc98c60d28ec Mon Sep 17 00:00:00 2001 From: villadelfia Date: Wed, 18 Oct 2023 02:09:12 +0000 Subject: [PATCH] Update 'src/main.asm' --- src/main.asm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main.asm b/src/main.asm index 08bff8e..8ed2598 100644 --- a/src/main.asm +++ b/src/main.asm @@ -7,9 +7,8 @@ INCLUDE "res/tiles.inc" INCLUDE "res/gameplay_map.inc" -SECTION "Globals", WRAM0 -wStateEventHandler:: ds 2 -wStateVBlankHandler:: ds 2 +SECTION "Globals", HRAM +hGameState:: ds 1 SECTION "Stack", WRAM0 @@ -65,11 +64,8 @@ EventLoop:: call HandleTimers ; Call the current state's event handler. - ld a, [wStateEventHandler] - ld l, a - ld a, [wStateEventHandler + 1] - ld h, a - jp hl + ldh a, [hGameState] + jp nz, GamePlayEventLoopHandler EventLoopPostHandler:: ; Wait for vblank.