gbdev / pandocs

The single, most comprehensive Game Boy technical reference.
https://gbdev.io/pandocs/
Creative Commons Zero v1.0 Universal
615 stars 93 forks source link

lcd-position-and-scrolling: wrap behavior #502

Closed dan-mcdonald closed 1 year ago

dan-mcdonald commented 1 year ago

It's my understanding that when the value of SCX/SCY are large so that the coordinate would exceed 256, it will wrap over to 0.

zlago commented 1 year ago

"yes, no, kinda" you literally cant write a value bigger than 255 to an 8 bit register

dan-mcdonald commented 1 year ago

The SCX/Y values define the top-left corner of the screen's view of the BG/window area. So if SCY=255 then the first line will be the bottom of the BG/window area and the remaining lines will wrap to rows 0-142, right?

zlago commented 1 year ago

yup! the background wraps around

dan-mcdonald commented 1 year ago

Is this documented anywhere in the pandocs? It seems like the logical place to mention it is in the scrolling section https://gbdev.io/pandocs/Scrolling.html

ISSOtm commented 1 year ago

Seems about right. Would you like to open a PR?

alloncm commented 1 year ago

Ill open a PR soon