diff options
| author | Miquel Sabaté Solà <msabate@suse.com> | 2023-11-27 10:31:03 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-02-04 21:02:54 +0100 |
| commit | cee93625989b651cfe91387eabd0abd3f64a00df (patch) | |
| tree | d1525bd15c191c2926ea1166263b249a8bbeb79c /scroll/include/globals.s | |
| parent | 0e1839f48ada69b81f5879449d0e0fe435f851c5 (diff) | |
| download | code.nes-cee93625989b651cfe91387eabd0abd3f64a00df.tar.gz code.nes-cee93625989b651cfe91387eabd0abd3f64a00df.zip | |
scroll: Start with the scrolling examples
This is still work in progress but at least there's some basic structure
to it.
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'scroll/include/globals.s')
| -rw-r--r-- | scroll/include/globals.s | 43 |
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 |
