aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Clear VBlank on reset on all examplesMiquel Sabaté Solà2025-03-2011-1/+14
| | | | | | | This was an oversight from the very first example that has propagated into the other ones. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* scroll: Provide an example with the MMC3 chipMiquel Sabaté Solà2025-03-129-47/+462
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Provide a reference to my code styleMiquel Sabaté Solà2025-03-111-0/+1
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* shared: Bring joypad into a proper styleMiquel Sabaté Solà2025-03-119-78/+66
| | | | | | | Put functions inside of the scope, avoid useless fallthroughs and be more realistic on what is needed from elsewhere. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* scroll: Provide better wording for the READMEMiquel Sabaté Solà2025-03-111-18/+19
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Small code style cleanupsMiquel Sabaté Solà2025-03-112-5/+3
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* scroll: Provide an even more basic exampleMiquel Sabaté Solà2025-03-115-3/+296
| | | | | | That is, just toggle between two fixed nametables. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* scroll: Provide an example with sprite 0 collisionMiquel Sabaté Solà2025-03-118-23/+331
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* docs: Align GIFs to the centerMiquel Sabaté Solà2025-03-101-2/+6
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Expand some comments on sprite.sMiquel Sabaté Solà2025-03-101-13/+28
| | | | | | | | After digging deeper into this good ol' machine, I've found that there are better ways to explain some of the basic things, or things that seemed easy but came back to bite me. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Provide an example on multiscreen scrollingMiquel Sabaté Solà2025-03-1019-131/+1947
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Bring code style to better standardsMiquel Sabaté Solà2025-03-1016-196/+206
| | | | | | | | Be more careful on everything and try to follow along style.nes from my repository. This might change in the future, but it's in a much better state now. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* shared: Add utilities for clearing screensMiquel Sabaté Solà2025-03-074-0/+50
| | | | | | | | | | | | | These are quite mindless, but they are rather useful on simple examples in which we don't care about performance and we just want to show something on the screen. For now this didn't matter much, but on real hardware I was able to reproduce the same glitches as with emulators which randomized memory on both the CPU memory and on the PPU. Hence, just allow some examples to manually reset these regions and avoid silly graphical glitches. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add an editorconfig fileMiquel Sabaté Solà2025-02-051-0/+8
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Ensure background/sprite tiles are spread properlyMiquel Sabaté Solà2025-02-045-27/+50
| | | | | | | | At least on the MMC3 chip, it's important to have background tiles on the first pattern table and then sprite tiles on the second pattern table. This avoids a hardware bug on scanline IRQs. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* scroll: Implement a roulette-like gameMiquel Sabaté Solà2025-02-0412-39/+580
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* fx: Provide an example of PPU bank switchingMiquel Sabaté Solà2025-02-048-6/+531
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add a note about nasmMiquel Sabaté Solà2025-02-041-3/+6
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Move macros globallyMiquel Sabaté Solà2025-02-041-22/+22
| | | | | | | | | | | | | | | It's a pity that cl65 allows macros to be written inside of scopes while their usage is only possible from the global scope. Hence, by allowing programmers to write macros inside of scopes, it feels like 'cc65' is actually lying to programmers. 'nasm' double downs on this by simply refusing to assemble such a case, which is the sensible thing to do if it's not allowed anyways. Long story short, macro statements have to be written in the global scope and so this commit moves the READ_CONTROLLER one from the `space` example globally. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Don't leave segments emptyMiquel Sabaté Solà2025-02-042-0/+20
| | | | | | Otherwise we will get a warning from nasm. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Use custom configurations everywhereMiquel Sabaté Solà2025-02-049-44/+100
| | | | | | | Moreover, I have introduced a linker configuration for MMC1 as well, so to properly implement the `basics/persist.s` example. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Clean up the Makefile outputMiquel Sabaté Solà2025-02-043-32/+30
| | | | | | | | This also involves moving the target for the `space` example to the general Makefile. The Makefile is not as clear as I'd like, but at least it's not a mess (yet). Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Vastly improve the documentationMiquel Sabaté Solà2025-02-0410-83/+184
| | | | | | This includes more clear explanations, images, etc. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add a way to safely read from controllersMiquel Sabaté Solà2025-02-044-104/+74
| | | | | | | | | First of all, move some reading utilities into the new `shared` directory, so controllers can be read by more than one example. Second, even if we keep the example on `basics/input.s` simple, let's provide a safe alternative for the other examples. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
* basics: Add a flickering exampleMiquel Sabaté Solà2025-02-044-4/+435
| | | | | | | Add an example on how to flicker sprites so to not surpass the scanline limit for them. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
* Move assets into a global directoryMiquel Sabaté Solà2025-02-049-189/+3
| | | | Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
* basics: Add an example on CHR-RAMMiquel Sabaté Solà2025-02-047-9/+321
| | | | | | Moreover, add a simple fix to the CI. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
* scroll: Start with the scrolling examplesMiquel Sabaté Solà2025-02-0412-14/+471
| | | | | | | 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>
* space: Improve comments and documentationMiquel Sabaté Solà2025-02-044-6/+22
| | | | Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
* Make READMEs more clear for absolute beginnersMiquel Sabaté Solà2025-02-042-2/+11
| | | | | | Hopefully the path is now more clear. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
* space: Simplify the code and its goalsMiquel Sabaté Solà2025-02-048-152/+335
| | | | | | | | | Originally this was supposed to be a sort of mini game, but that would have probably made it too complex for newcomers. Thus, let's just keep it to subpixel movement and shooting bullets, which is already a big step from the `basics/sprite.s` example. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
* basics: Add an example on UNROMMiquel Sabaté Solà2025-02-046-1/+256
| | | | Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
* basics: Improve documentationMiquel Sabaté Solà2025-02-043-9/+23
| | | | | | | Add more comments to `sprite.s` and `persist.s` so they can be read by a newcomer, and also introduce a README for this directory. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
* basics: Add an example on persisting dataMiquel Sabaté Solà2025-02-043-3/+166
| | | | Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
* Lay out a proper structure for the projectMiquel Sabaté Solà2025-02-0423-39/+847
| | | | | | | | 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>
* Add a sprite exampleMiquel Sabaté Solà2025-02-048-104/+654
| | | | | | | This is way better documented. Moreover, the `input.s` example has been further simplified. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
* Initial commitMiquel Sabaté Solà2025-02-049-0/+978
Add the basic structure and the first example: managing controller input. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>