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
789 B

INCLUDE "hardware.inc"
SECTION "Header", ROM0[$100]
_entry:
di
jp start
rept $150 - _entry
db 0
endr
SECTION "Code", ROM0
start:
ld hl, rLCDC
res 7, [hl]
res 2, [hl]
; set tilemap to tile index 1
ld hl, _SCRN0
ld a, 1
ld c, 32
.loop0:
ld b, 32
.loop1
ld [hli], a
dec b
jr nz, .loop1
dec c
jr nz, .loop0
; clear 2nd sprite
ld hl, _VRAM + 16
ld a, 0
ld c, 16
call memset
call OAM_Init
call Keys_Init
call Player_Init
; enable lcd, sprites and interrupts
ld hl, rLCDC
set 7, [hl]
set 1, [hl]
ei
ld hl, rOBP0
ld [hl], %11100100
.loop:
call Keys_Update
call Player_Update
call waitForVblank
ld a, HIGH(_OAM)
call DMA_Start
jp .loop