rynorris / nes

NES emulator written in Rust
MIT License
11 stars 0 forks source link

Fix sprites never rendering at y=0 #25

Closed rynorris closed 5 years ago

rynorris commented 5 years ago

Fixes #19

image

Due to the (lack of) overflow on this subtraction, sprites with y=0 would never render. This caused the sprite 0-hit in the top-left of the Indiana Jones title screen to not trigger, which apparently causes a cascade of hilarity that breaks the game entirely.

Note that this title screen still has a glitch along the right-hand side. I think it's because our CPU isn't cycle-accurate, so we might write the update to the palette 2-3 CPU cycles early, which could be as much as 9 pixels, which is about what we see here.

codecov-io commented 5 years ago

Codecov Report

Merging #25 into master will increase coverage by 0.34%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
+ Coverage   94.44%   94.78%   +0.34%     
==========================================
  Files          42       42              
  Lines        5276     5276              
==========================================
+ Hits         4983     5001      +18     
+ Misses        293      275      -18
Impacted Files Coverage Δ
src/emulator/ppu/mod.rs 90.97% <100%> (+3.24%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bbdce7d...674fa0d. Read the comment docs.