You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

61 lines
834 B

INCLUDE "game.inc"
INCLUDE "hardware.inc"
INCLUDE "util.inc"
SECTION "Header", ROM0[$100]
_entry:
di
jp start
rept $150 - _entry
db 0
endr
SECTION "Game State", WRAM0
frame:: db
state:: db
SECTION "VBlank", ROM0[$40]
handle_vblank:
reti
SECTION "Code", ROM0
start:
; init/disable lcd
ld hl, rLCDC
res 7, [hl]
res 2, [hl]
; enable vblank
ld hl, rIE
ld [hl], IEF_VBLANK
call OAM_Init
call Keys_Init
; set palette
ld a, %11100100
ld hl, rOBP0
ld [hl], a
ld hl, rBGP
ld [hl], a
ld a, GAME_STATEF_TITLE
ld [state], a
.loop:
ld a, [state]
cp GAME_STATEF_TITLE
jr nz, .check_game_state
call Title_Start
jr .loop
; only two states atm, no need to check anything yet
.check_game_state:
call Game_Start
jr .loop