aboutsummaryrefslogtreecommitdiff
path: root/scroll/include/globals.s
blob: d9417366410bf06c872c6ed4003c409be7fea391 (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
40
41
42
43
;; Resets the background buffer to a zero-sized array.
.macro CLEAR_BACKGROUND_BUFFER
    lda #$FF
    sta Globals::m_background_buffer
.endmacro

;; TODO: macro PUSH_TO_BACKGROUND_BUFFER_X

;; Global variables used throughout the scrolling examples.
.scope Globals
    ;;;
    ;; Temporary values.

    m_tmp_1  = $90
    m_tmp_2  = $91
    m_tmp_3  = $92

    ;; Current value for the scroll on the X axis.
    m_scroll = $93

    m_background_idx = $19

    ;; TODO
    m_collisions = $20

    ;; TODO
    m_background_buffer = $40

    ;; Initialize global variables.
    .proc init
        lda #0
        sta m_tmp_1
        sta m_tmp_2
        sta m_tmp_3
        sta m_scroll
        sta m_background_idx

        CLEAR_BACKGROUND_BUFFER
        sta m_collisions

        rts
    .endproc
.endscope