aboutsummaryrefslogtreecommitdiff
path: root/include/globals.s
blob: ca56ff464bde0eb8a1bbbc54e719682967c4a859 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.scope Globals
    ;;;
    ;; Temporary values.

    m_tmp_1  = $90
    m_tmp_2  = $91
    m_tmp_3  = $92
    m_tmp_4  = $93
    m_tmp_5  = $94

    ;; Bit map to be used as flags during execution.
    m_flags = $20

    ;; Initialize global variables.
    .proc init
        lda #0
        sta m_tmp_1
        sta m_tmp_2
        sta m_tmp_3
        sta m_tmp_4
        sta m_tmp_5
        sta m_flags
        rts
    .endproc
.endscope

;; SET_RENDER_FLAG sets the render bit on Globals::m_flags to 1.
.macro SET_RENDER_FLAG
  lda #%10000000
  ora Globals::m_flags
  sta Globals::m_flags
.endmacro

;; UNSET_RENDER_FLAG sets the render bit on Globals::m_flags to 0.
.macro UNSET_RENDER_FLAG
  lda #%01111111
  and Globals::m_flags
  sta Globals::m_flags
.endmacro