Page 1 of 1

Programming Specs feedback/question

Posted: October 27th, 2023, 9:13 am
by gwald
While it's not incorrect using the extreme boundaries, not mentioning the tpage boundary wrapping, I think is misleading.
The wrapping occurs on each TPage, after 255 values.
Or does the TPage wrapping occur somewhere else?

https://problemkaputt.de/psxspx-gpu-mem ... mmands.htm
Wrapping
If the Source/Dest starting points plus the width/height value exceed the 1024x512 pixel VRAM size, then the Copy/Fill operations wrap to the opposite memory edge (without any carry-out from X to Y, nor from Y to X).

Re: Programming Specs feedback/question

Posted: October 27th, 2023, 9:04 pm
by nocash
What you are quoting there is about Memory Transfer/Fill commands, that's unrelated to texture pages (and it's a corner case that would happen only if you are (un-)intentionally using invalid parameters in those Memory commands).

For the Polygon/Rectangle commands, the texture wrapping occurs each 256 pixels (or less when using the texture mask feature).

And yes, elsewhere, there seems to be a texture corner case, too. If the lower 2bit of texpage.x base address are nonzero (=if the texpage isn't aligned to a 256-halfword boundary)... then something "extreme" happens.
I haven't yet figured out what happens exactly, and when it happens exactly. Maybe it happens only for 8bp and 16bpp textures? Interestingly, that issue does happen even if the upper 2bit of texpage.x are zero (=when it's far away from the right memory boundary).

I've been working on better GPU accuracy in past some weeks, and came across that texpage.x issue just a few hours ago. I'll get some sleep now, and do more tests tomorrow.

Re: Programming Specs feedback/question

Posted: October 28th, 2023, 8:40 am
by gwald
Thanks for the explanation, I saw wrapping and assumed it was texture wrapping.