aboutsummaryrefslogtreecommitdiff
path: root/space/src/states/game.s
blob: ef5b6efefcb908ecfa894104f0fa7d8609f3e4ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
.scope Game
    ;; Contains relevant flags for the execution of the game:
    ;;   - 7: set to 1 whenever the game logic is over and we can start
    ;;        rendering; set to 0 when rendering is done.
    ;;   - 6-0: unused.
    zp_flags = $20
.endscope

;; SET_RENDER_FLAG sets the render bit on Game::flags to 1.
.macro SET_RENDER_FLAG
  lda #%10000000
  ora Game::zp_flags
  sta Game::zp_flags
.endmacro

;; UNSET_RENDER_FLAG sets the render bit on Game::flags to 0.
.macro UNSET_RENDER_FLAG
  lda #%01111111
  and Game::zp_flags
  sta Game::zp_flags
.endmacro