Closed daniel229 closed 10 years ago
I knew it, there are always regressions after changing that function :)
breaks video in VP
Valkyrie Profile. And also the text, wow. It's horrible. It seems to think the framebuffers are 394x224, which they actually are, but it seems to draw in a region of the framebuffer.
This causes lines in the character faces and makes the text scale up very poorly.
To explain more, imagine this is the 394x224 buffer:
+------------------------+
| |
| |
| |
| |
+------------------------+
When drawing, you can see it then draw only in the top left corner (and the vertex preview is misaligned to where it actually draws):
XXXXXXXXXXXXXXXXXX-------+
XXXXXXXXXXXXXXXXXX |
XXXXXXXXXXXXXXXXXX |
XXXXXXXXXXXXXXXXXX |
| |
+------------------------+
Then, it draws this (with linear filtering) to the screen. It uses the "right" percentage of the framebuffer, so it's full screen, but this means it's using afaik approx 323x194 (btw, 323 = 394 * (394/480)...) to actually render. Here's a screenshot of the terrible-ness:
All of this rendering is done in throughmode. I suppose this is the same reason the video is wrong.
It draws the video to a 512x512 texture framebuffer that is detected as 320x224, and then copies it onto itself (ugh, silly game) in the top left 320x240 quadrant. Then it copies that (as a 512x512 texture) to the primary framebuffer which is correctly detected as 512x512.
If I force 0x04110000 to always be detected as 394x224, it fixes the text (the menu looks wrong, but that's because I'm forcing it incorrectly for some places.) This does not help the video, which needs it to be >= 480x272 of course.
-[Unknown]
This also affects some areas of Tales of Phantasia X.
-[Unknown]
Super Robot War Z2 get lots of.
Ikuze Gen San Flickering
Gungnir is also affected in a similarish way to Valkyrie Profile, where some things are rendered (in throughmode) at a significantly lower resolution than they should be. In this case, it's only on the second of two framebuffers.
It does set the scissor while drawing, so I guess that's making it misdetect.
-[Unknown]
So, the general problem here for Valkyrie Profile seems to be like this:
Step 1. Framebuffer is created at 394x224.
Step 2. At some point, framebuffer is detected as 480x272.
Step 3. This stops happening, and it returns to 394x224. if (v->width < drawing_width && v->height < drawing_height) {
prevents the width/height from being decreased, so they stay at 480x272.
Step 4. In renderWidthFactor = (float)renderWidth / framebufferManager_->GetTargetWidth();
, renderWidth = 394 but TargetWidth = 480, so it draws in the top corner.
This is the same thing affecting Gungnir and Tales of Phantasia X (when you watch a skit.)
Commenting out v->width = drawing_width;
etc. fixes it, but I'm sure that'll break something.
The video in Valkyrie Profile is a separate problem, since it really is the case that there's an FBO of the wrong size there. Probably need to resize it after X frames when there's no render.
-[Unknown]
This also affects Aedis Eclipse, which seems to be unplayable due to this problem (can't see most any graphics.)
-[Unknown]
Gran Turismo Driving Challenge mode lower resolution.
revert
Castlevania Rondo of Blood original total black screen.
I've added some notes at the top from games that have and don't have problems with non-480x272 buffers.
I'm curious about games I don't have, like GTA.
This also logs some useful info:
if (drawing_width != 480 || drawing_height != 272) {
NOTICE_LOG(SCEGE, "%08x V: %ix%i, R: %ix%i, S: %ix%i, STR: %i, THR:%i, Z:%08x", gstate.getFrameBufAddress(), viewport_width,viewport_height, region_width, region_height, scissor_width, scissor_height, fb_stride, gstate.isModeThrough(), gstate.isDepthWriteEnabled() ? gstate.getDepthBufAddress() : 0);
}
-[Unknown]
Yes,above games fixed,however, boku no natsuyasumi 1 and 4 broken again natsuyasumi 1 display in a wrong size and flickering natsuyasumi 4 black in the sea
beats crashes on startup
Tactics Ogre black
dragon ball tgavs transparent block box sometime on the ground
GTA VCS looks fine.
I don't have the first three, but I've made some improvements.
Dragon Ball Z needs the framebuffer size to reduce. The problem is, the code in StateMapping seems to work under the impression that width/height is the real width/height, and scales through drawing up. I tried fixing that and it helped, but then in some games I got things not copied to the framebuffer at the right size. Grr.
-[Unknown]
beats and Tactics Ogre are fiexd,the others no change.
kingdom heart also seeing transparent black box
@daniel229 I'm not seeing the transparent black box in KH BBS using @unknownbrackets test build:-
@solarmystic yes,not every area,it's specific,that area is where fight the last boss.
The Dragon Ball Z shadows issue is the Frogger issue. Anything that makes it "work" by not showing the shadows at all is just a bug in disguise.
-[Unknown]
So the kingdom heart might be the same.
Hmm, it could be. Does it use that same matrix tex gen mode? I don't have Final Mix... maybe I can find the issue somewhere.
Edit: I found it, right near the beginning, it is using that same mode. But shadows work at the very very beginning. Interesting, because it's using that mode both times.
-[Unknown]
going into or finished the battle,the screen glickering a moment like the following showing.since https://github.com/hrydgard/ppsspp/commit/c31a1b18f7ab78e72ab5867000e9849cff9a3214 ,Sorry for finding out the problem after Merged.@raven02
WRONG:
NOT CORRECT (but no issue):
CORRECT: (most games that use 480x272)