gbdev / gbdev.github.io

the 'game boy development community' institutional website: showcases projects and hosts some community content
https://gbdev.io
GNU General Public License v3.0
23 stars 11 forks source link

Improve "The Timing of LYC STAT Handlers" #42

Closed ISSOtm closed 2 years ago

ISSOtm commented 2 years ago

Largely editing work, but also some content changes.

[EDIT] The article as of 2022-02-28 is now online

rondnelson99 commented 2 years ago

Thanks so much for these changes. They definitely add a lot of polish to the document. The only change I'm a little unsure about is the one regarding hardware.inc constants. I added the STATB_xxxx constants to hardware.inc back in august, so they are present as long as the reader is using a recent version. I personally prefer using these constants with set and res so that it is more clear that I'm setting and resetting bits. I find it especially confusing when people invert the flag constants when resetting bits with and. Most importantly, I also use those flags when reading STAT later in the tutorial using bit n, [hl]. Since and and or aren't usable this way, the STATB_xxxx constants need to be used anyways, so I was inclined to use them throughout the whole document for consistency. I get why you'd want to use the older constants that everyone is more familiar with though.

ISSOtm commented 2 years ago

Yeah, STATB_ constants are present, but LCDCB_ aren't.

rondnelson99 commented 2 years ago

Right, yeah, my bad. Come to think of it, I wonder why I didn't add those when I added all those other bit numbers to hardware.inc. I probably just missed them.

ISSOtm commented 2 years ago

Wow, this looks impressive (and definitely not overkilled :P).

Thank you! And hey, aiming too high is how we got a lot of our resources where they are, isn't it? :stuck_out_tongue_winking_eye:

Congrats on the custom Vue component @ISSOtm :partying_face:

It took some effort form both of us, but I'm mostly glad that what I bodged up didn't make you want to throw up too hard :sweat_smile:

Some stuff I'd like to do:

  • propose a new palette (and maybe make it consistent also with similar graphical assets on Pan Docs)

That I'll leave to you, both so that I can focus on improving the content, and because you're much better at this task than I. (All I could do to pick colors for the Pan Docs SVGs was use a colorblind-friendly palette as-is...)

  • set the "Scanline cycle" numbers to monospaced (or fixed-width sans serif)

Should be a simple fix indeed. Note that we currently are using what seems to be Vuepress' default font stack and not Inter.

  • Replace the first timing image from Pan Docs with its SVG version, using Pan Docs upstream location so the two remain in sync

I don't think it would be possible to pull the image directly from Pan Docs. It should however be possible to e.g. have CI warn when deploying if the upstream image was updated, which should be the next best thing.

I'll look into making it themed as well, though as you suggested this is likely to require a special plugin since <style> inside SVGs trigger a failsafe (?) in Vuepress, and it'd be nice to have the "image" partial be external anyway.

A part from that it looks like an appreciated and already merge-able upgrade.

Well, the content still needs some changes (mostly editorial, like polishing the article's pacing a bit, showcasing STAT VRAM accesses with a block of code and a more detailed explanation) as well as corrections (some timings were incorrect, and thus some timelines are no longer consistent with the text). So I don't think it should be merged as-is—hence the draft status, actually.

avivace commented 2 years ago

I'm trying to work on a updated palette. Main issue now is how bright STAT read

image

and call some func are

image

Also, some of the timeline graphs reach eight different colors.. That's definitely too much and confusing but I still didn't manage to find a better solution..

ISSOtm commented 2 years ago

Agree about the yellow, but I'm having a hard time getting good-looking colors with both the light and dark schemes.

Are that many colors a problem? They are separated into two columns, after all?

avivace commented 2 years ago

Thanks @ISSOtm I'll start merging it in the current state and we can proceed from here with another PR