aboutsummaryrefslogtreecommitdiff
path: root/scroll/include/globals.s
diff options
context:
space:
mode:
Diffstat (limited to 'scroll/include/globals.s')
-rw-r--r--scroll/include/globals.s43
1 files changed, 43 insertions, 0 deletions
diff --git a/scroll/include/globals.s b/scroll/include/globals.s
new file mode 100644
index 0000000..d941736
--- /dev/null
+++ b/scroll/include/globals.s
@@ -0,0 +1,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