Update 'src/main.asm'
This commit is contained in:
parent
f90d414e8e
commit
d36ac9159b
16
src/main.asm
16
src/main.asm
|
@ -13,9 +13,9 @@ wStateVBlankHandler:: ds 2
|
||||||
|
|
||||||
|
|
||||||
SECTION "Stack", WRAM0
|
SECTION "Stack", WRAM0
|
||||||
wStack:
|
wStack::
|
||||||
ds STACK_SIZE
|
ds STACK_SIZE
|
||||||
wStackEnd:
|
wStackEnd::
|
||||||
|
|
||||||
|
|
||||||
SECTION "Code Entry Point", ROM0
|
SECTION "Code Entry Point", ROM0
|
||||||
|
@ -25,7 +25,7 @@ Main::
|
||||||
xor a, a
|
xor a, a
|
||||||
ldh [rLCDC], a
|
ldh [rLCDC], a
|
||||||
|
|
||||||
; Stack
|
; Set up stack
|
||||||
ld sp, wStackEnd
|
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.
|
||||||
|
@ -34,12 +34,6 @@ Main::
|
||||||
ld bc, TilesEnd - Tiles
|
ld bc, TilesEnd - Tiles
|
||||||
call UnsafeMemCopy
|
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.
|
; Make sure both sprites and bg use the same tile data.
|
||||||
ldh a, [rLCDC]
|
ldh a, [rLCDC]
|
||||||
or LCDCF_BLK01
|
or LCDCF_BLK01
|
||||||
|
@ -92,10 +86,8 @@ EventLoopPostHandler::
|
||||||
ld a, [wStateVBlankHandler + 1]
|
ld a, [wStateVBlankHandler + 1]
|
||||||
ld h, a
|
ld h, a
|
||||||
jp hl
|
jp hl
|
||||||
EventLoopPostVBlankHandler::
|
|
||||||
|
|
||||||
; Jump back to the start of the event loop.
|
; The VBlank Handler is expected to end with jp EventLoop.
|
||||||
jr EventLoop
|
|
||||||
|
|
||||||
|
|
||||||
ENDC
|
ENDC
|
||||||
|
|
Loading…
Reference in New Issue