Update 'src/main.asm'

This commit is contained in:
villadelfia 2023-10-18 01:13:20 +00:00
parent f90d414e8e
commit d36ac9159b
1 changed files with 4 additions and 12 deletions

View File

@ -13,9 +13,9 @@ wStateVBlankHandler:: ds 2
SECTION "Stack", WRAM0
wStack:
wStack::
ds STACK_SIZE
wStackEnd:
wStackEnd::
SECTION "Code Entry Point", ROM0
@ -25,7 +25,7 @@ Main::
xor a, a
ldh [rLCDC], a
; Stack
; Set up stack
ld sp, wStackEnd
; We use a single set of tiles for the entire game, so we copy it at the start.
@ -34,12 +34,6 @@ Main::
ld bc, TilesEnd - Tiles
call UnsafeMemCopy
; Also to the second bank of tile data.
ld de, Tiles
ld hl, _VRAM + $800
ld bc, TilesEnd - Tiles
call UnsafeMemCopy
; Make sure both sprites and bg use the same tile data.
ldh a, [rLCDC]
or LCDCF_BLK01
@ -92,10 +86,8 @@ EventLoopPostHandler::
ld a, [wStateVBlankHandler + 1]
ld h, a
jp hl
EventLoopPostVBlankHandler::
; Jump back to the start of the event loop.
jr EventLoop
; The VBlank Handler is expected to end with jp EventLoop.
ENDC