Skip to content
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

Fixes ppu_modes_timing.svg to more properly reflect the description b… #355

Merged
merged 6 commits into from
Oct 8, 2021

Conversation

Kim-Dewelski
Copy link
Contributor

…ox above. Also added extra detail in the description box found under Rendering -> Pixel FIFO to more accurately explain what is meant by a 'dot'.

…ox above. Also added extra detail in the description box found under Rendering -> Pixel FIFO to more accurately explain what is meant by a 'dot'.
certain action *lengthens mode 3* it means that mode 0 (hblank) is
All references to a cycle or dot are meant as T-cycles (4.19 MHz) and cycle
counts are doubled on CGB in double speed mode. Dots are the terminology used
for cycles in the context of rendering, and are synonymous with a T-cycle.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dots are not synonymous, as they stay at 4 MiHz even when double-speed causes T-cycles to be at 8 MiHz. Hence why a different unit is used.

This terminology issue generally overlaps with #194.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really, then, the word "cycle" should be removed from the page and replaced with "dot", since it is really the unit being used throughout the document (just with a wrong name). Then this box can be simplified to just explaining what a "dot" is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overlooking the typo 'perscanline'
'All references to a cycle are meant as T-cycles (4.19 MHz) and cycle counts are doubled on CGB in double speed mode. On DMG, a dot is equal to a single T-cycle. However, for CGB in double speed a dot is 2 T-cycles as to keep the amount of dots perscanline and frame similar regardless of processor speeds. When it is stated that a certain action lengthens mode 3 it means that mode 0 (hblank) is shortened to make up for the additional time in mode 3, as shown in the following diagram.'
Should the term cycle be omitted from here? Does it cause confusion over the meaning of a 'dot'?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T-cycles do not intervene in any of the document. T-cycles and M-cycles are bound to the CPU clock, which speeds up when double-speed mode is enabled.

Dots, however, stem from another clock which is not affected by double-speed mode. This is why they are a separate unit: because they are not relative to the CPU speed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem comes then later down the line when T-cycles are used the measure the duration of, for instance, the the pixel fetcher's different steps.
'The fetcher fetches a row of 8 background or window pixels and queues them up to be mixed with sprite pixels. The pixel fetcher has 5 steps. The first four steps take 2 cycles each and the fifth step is attempted every cycle until it succeeds.'

I could gladly omit the reference to T-cycles and just instead give an overview of "dot", but I personally think it's beneficial to give the insight that, on a normal DMG, a single dot seems to equate to a sinlge T-cycle. Although again I could be very wrong on this and I don't have the specific clock rate for the PPU. I could completely omit the T-cycle parallel and just start explaining, and researching, the frequency of the PPU clock and only explain dots in via the PPU clock rather than any parallels to the CPU, if that's preferred? Either way, originally the diagram used to have M-cycles to explain the timings of the different modes. Or at least it seemed to be M-cycles or what was otherwise meant by the "(= cycles)" comments? I didn't want to omit any original information just clarify what was there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I explained above, the unit used throughout the document is really dots, not T-cycles.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah my bad. I see now what you mean.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! That's much better, but now there's a needlessly confusing alias. Could you try replacing all occurrences of "cycle" with "dot" in the document?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure! I'm on it!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fixed now! :)

src/imgs/ppu_modes_timing.svg Outdated Show resolved Hide resolved
src/imgs/ppu_modes_timing.svg Outdated Show resolved Hide resolved
Copy link
Sponsor Member

@avivace avivace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A part from the mentioned suggestion, LGTM! Thanks @Kim-Dewelski

src/pixel_fifo.md Outdated Show resolved Hide resolved
@avivace avivace requested a review from ISSOtm September 27, 2021 21:12
@ISSOtm
Copy link
Member

ISSOtm commented Oct 6, 2021

Small word of update: I realized that some of the document's wording needed changing, and the scope crept into a rewrite of the entire article. Hope you won't mind—the changes already brought in are good, it's just that it's a good time as ever to do this.

@avivace
Copy link
Sponsor Member

avivace commented Oct 6, 2021

Small word of update: I realized that some of the document's wording needed changing, and the scope crept into a rewrite of the entire article. Hope you won't mind—the changes already brought in are good, it's just that it's a good time as ever to do this.

Isn't that feasible in the second moment? Can we start merging this then iterate over later?

@ISSOtm
Copy link
Member

ISSOtm commented Oct 6, 2021

My usual concerns apply, but if it's like last time, then sure, okay to merge.

@avivace
Copy link
Sponsor Member

avivace commented Oct 8, 2021

My usual concerns apply, but if it's like last time, then sure, okay to merge.

Yep, I do think it's reasonable to merge and iterate afterwards. Can you check if the last thread here looks resolved to you?

@ISSOtm
Copy link
Member

ISSOtm commented Oct 8, 2021

The fact that it isn't is how I came to rewrite the entire article :P If we're planning to merge the changes I'm working on quickly, there's no reason to dwell on this, anyway.

@avivace avivace merged commit b99d50b into gbdev:master Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants