-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature fifo ppu #51
Merged
Merged
Feature fifo ppu #51
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this video to the resources - https://www.youtube.com/watch?v=HyzD8pNlpwI |
and progressed with the fifo implementation
The bootrom npw displays the logo!
Not working as intended
Rendered the first tile twice in the bg
to include the ultimate gb talk as one of the resources
Ordering the sprites after fetching them from oam ram
Both fifos cant operate at the same time. the sprite fifo stops the bg fifo and the pixels to the lcd pusher.
The fifo is 8 pxiels length. If it contains pixels from previous sprite the new sprite first number of pixels in the fifo are discarded and not pushed to the fifo. This way sprite whos ovelapping wont override each other and the sprite with the lowest x value (higher priority) will be drawn.
The bug was a case when the x position is more advanced than the start of the obj x pos. the pixels would still be pushed and we will end up with more than 8 pixels in the fifo. Solve it by checking the x pos too.
I think I know how to solve the problem with the x axis scroll animation It has something to do with SCX mod 8 pixels wich are discarded at the beginning of the stage 3 (push).
Allow the smooth moving animation on X axis
alloncm
force-pushed
the
feature-fifo_ppu
branch
from
August 21, 2021 18:48
eb03d73
to
1926087
Compare
The bug would ocour only for objects drawn with odd scx register. Since the state machine of the sprite fetcher worked in steps of 2 t_cycles it would miss some lines. Moved the state machine to work for every t_cycle and not for the even ones.
# Conflicts: # lib_gb/src/machine/gameboy.rs
alloncm
commented
Sep 3, 2021
Remove all the regular PPU files and change the fifo ppu name to gb_ppu |
This commit is a result of a SCR (self code review).
alloncm
commented
Sep 3, 2021
alloncm
commented
Sep 5, 2021
alloncm
commented
Sep 6, 2021
Now using a better state machine mechanism.
alloncm
force-pushed
the
feature-fifo_ppu
branch
from
September 6, 2021 10:35
7bee195
to
15b1b6c
Compare
SCR - Arrange code and extract some to functions, fix typos and made some fields private
Change BGFetcher to BackgroundFetcher Move the to color code into the color mod
Made this more safe and less error prone
Replaced the scanline based ppu with the fifo ppu and adpted the rest of the project to it
Added a lot of constants for the code to make it clearer
Add some tests (not fully coverage) the code still dont works
alloncm
force-pushed
the
feature-fifo_ppu
branch
from
September 8, 2021 13:27
ff498ca
to
d2fe771
Compare
In rust ! operator will bitwise not integers, I forgot to add a proper pranthesis and this broke the ppu
Implement the window rendering correctly: - handle the LY==WY case - increment the internal window counter correctly (only when LY is greater than WY) - Some more fixes (reseting vars on vblank etc)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This new implementation should be more accurate and faster than the current one.
Closes #50
Closes #52