Update 'src/main.asm'

This commit is contained in:
villadelfia 2023-10-18 01:11:05 +00:00
parent 3b68b0ffa1
commit f90d414e8e
1 changed files with 6 additions and 17 deletions

View File

@ -49,25 +49,10 @@ Main::
call ClearOAM call ClearOAM
call CopyOAMHandler call CopyOAMHandler
; Set up the palettes.
ld a, PALETTE_REGULAR
set_bg_palette
set_obj0_palette
ld a, PALETTE_LIGHTER_1
set_obj1_palette
; Get the timer going. It's used for RNG.
xor a, a
ldh [rTMA], a
ld a, TACF_262KHZ | TACF_START
; Zero out the ram where needed. ; Zero out the ram where needed.
call TimeInit call TimeInit
call IntrInit call IntrInit
call InputInit call InputInit
call ScoreInit
call LevelInit
call FieldInit
call SFXInit call SFXInit
; Set up the interrupt handlers. ; Set up the interrupt handlers.
@ -93,8 +78,12 @@ EventLoop::
jp hl jp hl
EventLoopPostHandler:: EventLoopPostHandler::
; Wait for vblank and update OAM. ; Wait for vblank.
wait_vblank : ldh a, [rLY]
cp a, 144
jr nz, :-
; Do OAM DMA.
call hOAMDMA call hOAMDMA
; Call the current state's vblank handler. ; Call the current state's vblank handler.