From 49842414e2c570c511ef5c3c9e1860ee8d2fd504 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 12 Mar 2025 19:42:43 +0100 Subject: scroll: Provide an example with the MMC3 chip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- scroll/include/background.s | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'scroll/include/background.s') diff --git a/scroll/include/background.s b/scroll/include/background.s index 69725fd..e637380 100644 --- a/scroll/include/background.s +++ b/scroll/include/background.s @@ -36,6 +36,16 @@ BACKGROUND_ROW_OFFSET = 0 .endif + ;; The maximum row coordinate this engine is allowed to go. That is, until + ;; which row each column is supposed to be rendered. By default it's $0F, + ;; but it could be set to something else to allow a status element down the + ;; screen. + ;; + ;; NOTE: configurable. + .ifndef BACKGROUND_ROW_MAX + BACKGROUND_ROW_MAX = $0F + .endif + ;; Current column (or the next to be loaded by functions like ;; `load_column`). zp_cur_column = $75 @@ -251,7 +261,7 @@ ;; We are actually at the end of the screen definition. Then the offset ;; is simply the current row until the end. If that turns out to be ;; zero, then we are done. - lda #$0F + lda #BACKGROUND_ROW_MAX sec sbc zp_cur_row beq @done @@ -293,7 +303,7 @@ ;; We are done pushing default metatiles. Check if we are done with the ;; column entirely. lda zp_cur_row - cmp #$0F + cmp #BACKGROUND_ROW_MAX beq @done ;; Push the metatile pointed by the screen pointer. @@ -498,7 +508,7 @@ @to_the_end: ;; We aren't: go until the last row. - lda #$0F + lda #BACKGROUND_ROW_MAX @compute: ;; Subtract the current row with the one we are trying to reach. -- cgit v1.2.3