From cee93625989b651cfe91387eabd0abd3f64a00df Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 27 Nov 2023 10:31:03 +0100 Subject: scroll: Start with the scrolling examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is still work in progress but at least there's some basic structure to it. Signed-off-by: Miquel Sabaté Solà --- scroll/include/globals.s | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 scroll/include/globals.s (limited to 'scroll/include/globals.s') 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 -- cgit v1.2.3