Browse Source

Transition from title to game

master
Forest Belton 3 years ago
parent
commit
8822967fdf
2 changed files with 22 additions and 1 deletions
  1. +13
    -0
      src/game.s
  2. +9
    -1
      src/title.s

+ 13
- 0
src/game.s View File

@ -1,11 +1,24 @@
INCLUDE "hardware.inc"
SECTION "Game Loop", ROM0 SECTION "Game Loop", ROM0
Game_Start:: Game_Start::
; disable ldc (CAN ONLY BE DONE DURING VBLANK) & interrupts
halt
di
ld hl, rLCDC
res 7, [hl]
ld hl, intro_Data ld hl, intro_Data
call Map_Load call Map_Load
call Player_Init call Player_Init
; re-enable ldc & interrupts
ld hl, rLCDC
set 7, [hl]
ei
.loop: .loop:
ld hl, frame ld hl, frame
inc [hl] inc [hl]

+ 9
- 1
src/title.s View File

@ -1,3 +1,4 @@
INCLUDE "game.inc"
INCLUDE "hardware.inc" INCLUDE "hardware.inc"
SECTION "Title Loop", ROM0 SECTION "Title Loop", ROM0
@ -36,8 +37,15 @@ Title_Start::
call Keys_Update call Keys_Update
; todo: check for start press and transition to game state
ld a, [keys]
and PADF_START
jr z, .wait
ld a, GAME_STATEF_GAME
ld [state], a
ret
.wait:
; wait for vblank ; wait for vblank
halt halt

Loading…
Cancel
Save