|
|
- INCLUDE "game.inc"
- INCLUDE "hardware.inc"
-
- SECTION "Title Loop", ROM0
-
- titleTiles: INCBIN "png/bg/title.2bpp"
- titleMap: INCBIN "png/bg/title.tilemap"
- titleMapEnd:
-
- DEF TITLE_TILES_SIZE EQUS "titleMap - titleTiles"
- DEF TITLE_MAP_SIZE EQUS "titleMapEnd - titleMap"
-
- Title_Start::
- ; load title screen
- ld bc, _VRAM
- ld hl, titleTiles
- ld de, TITLE_TILES_SIZE
- call memcpy16
-
- ; could probably be sped up...
- FOR Y, 18
- ld bc, _SCRN0 + 32 * Y
- ld hl, titleMap + 20 * Y
- ld d, 20
- call memcpy
- ENDR
-
- ; enable lcd, sprites and interrupts
- ld hl, rLCDC
- set 7, [hl]
- set 1, [hl]
- ei
-
- .loop:
- ld hl, frame
- inc [hl]
-
- call Keys_Update
-
- ld a, [keys]
- and PADF_START
- jr z, .wait
-
- ld a, GAME_STATEF_GAME
- ld [state], a
- ret
-
- .wait:
- ; wait for vblank
- halt
-
- jr .loop
|