Update 'src/main.asm'

This commit is contained in:
villadelfia 2023-10-18 01:02:46 +00:00
parent 4460fd5cb4
commit 77d831dc7a
1 changed files with 16 additions and 19 deletions

View File

@ -12,6 +12,12 @@ wStateEventHandler:: ds 2
wStateVBlankHandler:: ds 2 wStateVBlankHandler:: ds 2
SECTION "Stack", WRAM0
wStack:
ds STACK_SIZE
wStackEnd:
SECTION "Code Entry Point", ROM0 SECTION "Code Entry Point", ROM0
Main:: Main::
; Turn off LCD during initialization. ; Turn off LCD during initialization.
@ -19,6 +25,9 @@ Main::
xor a, a xor a, a
ldh [rLCDC], a ldh [rLCDC], a
; Stack
ld sp, wStackEnd
; We use a single set of tiles for the entire game, so we copy it at the start. ; We use a single set of tiles for the entire game, so we copy it at the start.
ld de, Tiles ld de, Tiles
ld hl, _VRAM ld hl, _VRAM
@ -53,7 +62,13 @@ Main::
ld a, TACF_262KHZ | TACF_START ld a, TACF_262KHZ | TACF_START
; Zero out the ram where needed. ; Zero out the ram where needed.
call InitializeVariables call TimeInit
call IntrInit
call InputInit
call ScoreInit
call LevelInit
call FieldInit
call SFXInit
; Set up the interrupt handlers. ; Set up the interrupt handlers.
call InitializeLCDCInterrupt call InitializeLCDCInterrupt
@ -94,22 +109,4 @@ EventLoopPostVBlankHandler::
jr EventLoop jr EventLoop
; *****************************************************************************
; * *
; * Functions *
; * *
; *****************************************************************************
SECTION "Functions", ROM0
InitializeVariables:
call TimeInit
call IntrInit
call InputInit
call ScoreInit
call LevelInit
call FieldInit
call SFXInit
ret
ENDC ENDC