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.
 
 
 
 

66 lines
819 B

INCLUDE "hardware.inc"
SECTION "Header", ROM0[$100]
_entry:
di
jp start
rept $150 - _entry
db 0
endr
SECTION "Frame", WRAM0
frame:: db
SECTION "VBlank", ROM0[$40]
handle_vblank:
reti
SECTION "Code", ROM0
start:
ld hl, rLCDC
res 7, [hl]
res 2, [hl]
ld hl, rIE
ld [hl], IEF_VBLANK
call OAM_Init
; call Keys_Init
; call Player_Init
ld hl, intro_Data
call Map_Load
; set palette
ld a, %11100100
ld hl, rOBP0
ld [hl], a
ld hl, rBGP
ld [hl], a
; enable lcd, sprites and interrupts
ld hl, rLCDC
set 7, [hl]
set 1, [hl]
ei
.loop:
ld hl, frame
inc [hl]
call Keys_Update
; call Player_Update
; wait for vblank
halt
; ~160 cycles
ld a, HIGH(_OAM)
call DMA_Start
jp .loop