aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-04-07 23:23:56 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-04-07 23:23:56 +0200
commit1907fb0562fd17088c64695157e9320c8a49818f (patch)
tree9d5701dc09e49afe0570f66c1bee4c7207360cc7
parentcd7e1e5514a6fd26ec0f01960807c6f2ab6f1a5b (diff)
downloadcode.nes-1907fb0562fd17088c64695157e9320c8a49818f.tar.gz
code.nes-1907fb0562fd17088c64695157e9320c8a49818f.zip
Expand on attribute tables
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
-rw-r--r--basics/sprite.s18
1 files changed, 17 insertions, 1 deletions
diff --git a/basics/sprite.s b/basics/sprite.s
index 94cc0db..5070ef5 100644
--- a/basics/sprite.s
+++ b/basics/sprite.s
@@ -490,7 +490,7 @@ palettes:
;; Now we have to do the same for the rest of the elements. I have gone
;; through the same process of fetching the offset from a canvas I drew on
- ;; NEXXT and here's the result. Instead of repeating te same code over and
+ ;; NEXXT and here's the result. Instead of repeating the same code over and
;; over but with slightly different values, I am using the WRITE_PPU_DATA
;; from `shared/ppu.s` to do the same.
WRITE_PPU_DATA $20B9, $04
@@ -522,6 +522,22 @@ palettes:
;; background element resides in. In this case it's the first square, so we
;; just need to assign $01 to the bits reserved to this square if I want to
;; change the palette to 1. This is what we pass as a value.
+ ;;
+ ;; Let me reiterate: this design of attribute tables/offsets means that
+ ;; background palettes need to be changed at a 4-tile basis. This is
+ ;; important as designers need to lay out the background in a way that two
+ ;; elements which need different palettes are not contained into this 4-tile
+ ;; square. Knowing this, you will be able to understand why isometric view
+ ;; games had some visual troubles here and there, and also why games like
+ ;; Super Mario Bros. 3 sometimes have a weird glitchy color at the right
+ ;; edge of the screen which is easy to spot on a non-CRT television (even if
+ ;; the whole explanation is also about how scrolling was managed on these
+ ;; kinds of diagonally-scrolled games). As an extra piece of information,
+ ;; the MMC5 mapper chip, among many other things, added extra memory so
+ ;; programmers could allocate space for attributes tables and index palettes
+ ;; at a tile level instead of this 4-tile squares. The MMC5 mapper chip was
+ ;; quite complex and came late to the party, so not a lot of games used it
+ ;; (e.g. Castlevania 3).
WRITE_PPU_DATA $23CE, %00000001
rts