diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-03-20 18:01:34 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-03-20 18:01:34 +0100 |
| commit | b21e3d2588749568c777a84435905bef110f3479 (patch) | |
| tree | 957615ee80680a21abcbe67427455f946fdf9486 /basics/sprite.s | |
| parent | 49842414e2c570c511ef5c3c9e1860ee8d2fd504 (diff) | |
| download | code.nes-b21e3d2588749568c777a84435905bef110f3479.tar.gz code.nes-b21e3d2588749568c777a84435905bef110f3479.zip | |
Clear VBlank on reset on all examples
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>
Diffstat (limited to 'basics/sprite.s')
| -rw-r--r-- | basics/sprite.s | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/basics/sprite.s b/basics/sprite.s index b9e183b..27beb91 100644 --- a/basics/sprite.s +++ b/basics/sprite.s @@ -174,7 +174,10 @@ ;; will see how we can take advantage of this when we use the PPU properly ;; down the road. - ;; First of the two waits. + ;; First of the two waits. The `bit` outside of the loop is not a typo, but + ;; since the VBlank flag is in an unknown state after reset, we clear it now + ;; so the next loop does not exit immediately by mistake. + bit $2002 ; PPUSTATUS @vblankwait1: bit $2002 ; PPUSTATUS bpl @vblankwait1 |
