diff options
| author | Miquel Sabaté Solà <msabate@suse.com> | 2023-10-24 17:40:19 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-02-04 20:58:36 +0100 |
| commit | 149020464517ff3d021eef5ccd50d3939ad463e6 (patch) | |
| tree | 056ec1919fe0c0d515e7a0a414916307b768ef84 /scroll | |
| parent | be2414f5b11b182998fca7e87712ff0502c8ee93 (diff) | |
| download | code.nes-149020464517ff3d021eef5ccd50d3939ad463e6.tar.gz code.nes-149020464517ff3d021eef5ccd50d3939ad463e6.zip | |
Lay out a proper structure for the project
Let's divide things by topic instead of a broad "examples" directory.
This will allow for simple files to co-exist together with full-blown
projects.
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'scroll')
| -rw-r--r-- | scroll/README.md | 24 | ||||
| -rw-r--r-- | scroll/level.s | 1 | ||||
| -rw-r--r-- | scroll/mmc3.s | 1 | ||||
| -rw-r--r-- | scroll/sprite0.s | 1 |
4 files changed, 27 insertions, 0 deletions
diff --git a/scroll/README.md b/scroll/README.md new file mode 100644 index 0000000..553a497 --- /dev/null +++ b/scroll/README.md @@ -0,0 +1,24 @@ +## Scrolling + +Scrolling is a big topic and it's something that evolved with the NES hardware. +This set of examples try to cover it as much as possible while being +approachable as single files. + +First of all, you should take a look at `level.s`, which shows how games can +scroll a level and continuously load/unload the next/previous sections of the +level. + +The second example is `sprite0.s`, which covers the scrolling done by games such +as Super Mario Bros. or Punch-out. That is, we use the "sprite 0 hit" detection +to keep the top level part of the screen from moving (so to show relevant +information), while allowing the rest of the screen to scroll as expected. In +the end, it's the same example as `level.s` (same level to scroll), but the top +part does not move and shows a "THIS DOES NOT MOVE" message. + +Last but not least, the `mmc3.s` example shows how to configure the MMC3 chip +(e.g. Super Mario Bros. 3, Kirby's Adventure) to have better control on which +parts of the screen to scroll or not. To showcase this the example implements a +Pong game by scrolling the paddles instead of directly setting their positions. +This is probably the most stupid way to use this hardware expansion (kind of +like killing a fly with a cannon), but it at least shows a simple way to have +two independent scrolls while having a static middle ground. diff --git a/scroll/level.s b/scroll/level.s new file mode 100644 index 0000000..9480a4a --- /dev/null +++ b/scroll/level.s @@ -0,0 +1 @@ +;; TODO: Scroll everything and show how to load the level diff --git a/scroll/mmc3.s b/scroll/mmc3.s new file mode 100644 index 0000000..3f97a52 --- /dev/null +++ b/scroll/mmc3.s @@ -0,0 +1 @@ +;; TODO: Through MMC3 diff --git a/scroll/sprite0.s b/scroll/sprite0.s new file mode 100644 index 0000000..215a491 --- /dev/null +++ b/scroll/sprite0.s @@ -0,0 +1 @@ +;; TODO: Through sprite0 hit |
