libretro / beetle-psx-libretro

Standalone port/fork of Mednafen PSX to the Libretro API.
GNU General Public License v2.0
308 stars 131 forks source link

FFIX graphic clitches #64

Closed mjuzikfrik closed 8 years ago

mjuzikfrik commented 8 years ago

Since a few days ago I've been experiencing strange bugs. I've made some snaps of it. Everything is set to default. Software renderer not opengl. One the first picture there's the issue of ?shadow? on the left of the box. And the next three show some strange lines, points on the forests when moving. retroarch-0608-172355 retroarch-0608-173201 retroarch-0608-173214 retroarch-0608-173238

simias commented 8 years ago

What's the problem in your first screenshot exactly? I don't see this shadow you're talking about.

mjuzikfrik commented 8 years ago

I think I have put it into wrong words. I mean the line I've showed on this picture. retroarch-0608-172355

simias commented 8 years ago

Ah, the other left :)

inactive123 commented 8 years ago

Could be the changes I made to GTE where I tried to make the code more like Rustation's. Id invite simias there to doublecheck what I did there in case I made some mistakes.

simias commented 8 years ago

We'd have to bisect until I can isolate the commit that introduced the regression. Seems odd that the GTE would introduce a regression on 2D graphics though.

Can I get a savestate of FFIX on the map?

personaone commented 8 years ago

I can confirm these issues are also present in FF7 - polygon edges have weird colors like the map screenshots, also the scroll handle in the item inventory has a corruption on the right side of it.

mjuzikfrik commented 8 years ago

Here's the savestate. I'm using USA-NTSC version. Final Fantasy IX SLUS01251.zip

personaone commented 8 years ago

Shots of FF7 issue.

http://imgur.com/5J7Uhtg

http://imgur.com/Cs3pSTY

simias commented 8 years ago

@mjuzikfrik thank you, I can reproduce it here. I'm currently tracking down the commit that caused the regression.

simias commented 8 years ago

Apparently it was caused by this commit.

I don't quite understand what's the point of that, can't MSVC optimize simple bitshifts correctly on its own? What does "fx32" mean here? I'm not sure we gain anything from this commit besides obfuscating bitshifts and a free regression for our troubles.

rz5 commented 8 years ago

@simias: Seems @twinaphex was refactoring beetle-psx, getting it to use more libretro parts and such. And since you can't compile it with MSVC anymore, you can safely assume these bugs are happening with GCC.

simias commented 8 years ago

@rz5 right, but my point is that I don't understand the point of this particular commit, MSVC or not. I don't understand why this fxp.h is in libretro-common when I can't imagine fixed point 20.12 arithmetic is that common in the wild.

I don't really understand why it causes a regression either mind you. Could be something to do with a logical/arithmetic right shift or something changing the behaviour of integer promotion.

IMO I'd be for reverting this commit altogether, but I'm going to wait for @twinaphex's opinion on the subject, maybe he has a good reason for making this change.

saftle commented 8 years ago

Would any of the more recent bugs that were added to the GL Renderer Bug thread be related as well?

simias commented 8 years ago

@saftle I'm not sure but I don't think so.

saftle commented 8 years ago

@simias ok thanks.

inactive123 commented 8 years ago

@simias I already fixed a previous regression in that commit here -

https://github.com/libretro/beetle-psx-libretro/commit/d7e6d83b02ebaa383d70da7f62248f0d8c02303e#diff-6c5e302cc1da48dbaafda2d1ac4be8b2L84

So I'd just like to find out which other line currently is causing the regression.

As for why I'm doing this, these are functions used by Desmume which is now going to be using libretro-common more and more for its core emulation code, so I thought it would be a good idea to bring the functions to libretro-common and to also use them in other emulators that rely on fixedpoint. There is also a potential PS1 RetroArch port coming up where any usage of float will be very heavily penalized, so I'd like to start looking at ways to bring fixed-point handling to libretro-common in a sane way. Same for Nintendo DS which also doesn't have an FPU. Doesn't mean we are going to be changing everything over to fixed point but just to have some common helper functions in there in libretro-common can't hurt.

inactive123 commented 8 years ago

https://github.com/libretro/beetle-psx-libretro/commit/9b1e98e408273aef170a283f6e4bb973e252f50a

Check if this fixes it.

However, I'd still like a savestate or a way to reproduce this issue though since I'd still like to go through these inlined functions eventually for code clarity. But it's not massively important.

simias commented 8 years ago

@twinaphex Thanks! It seems to fix the issues in the FFIX savestate provided by @mjuzikfrik at least.

mjuzikfrik commented 8 years ago

Great! I see no lines or dots now. What about that border to the right of the tables in the menu battle summary? It should be like at the bottom with out the extra grey line.

simias commented 8 years ago

@mjuzikfrik I don't notice this issue with the latest version using the software renderer:

retroarch-0609-165851

personaone commented 8 years ago

It looks like the weird polygon colors are indeed gone, however the 2d issue in FF7 persists.

inactive123 commented 8 years ago

what 2D issue, and where can I reproduce this? Screenshot please.

simias commented 8 years ago

@personaone I don't see any problem in FF7 at 1x software with the latest version:

retroarch-0609-172928

personaone commented 8 years ago

untitled

Also i just ran FF9 to see that right side line thing, for me it's still there:

22

That's weird cause I have just updated the PSX core from the online updater. Can it have something to do that i'm running on OS X?

simias commented 8 years ago

I think you must be running an older version, not sure how up to date the online build is:

retroarch-0609-173441

personaone commented 8 years ago

I don't know it's kind of weird that I don't see the weird polygons on 3d objects anymore and the 2d ones are off, I guess i'll wait a few days and try again. Cheers.

simias commented 8 years ago

The buildbot giveth, the buildbot taketh.

mjuzikfrik commented 8 years ago

Weird... I'm in the same situation as personaone. Will check again tomorrow.

personaone commented 8 years ago

I just cloned the repo and compiled the core myself, that 2D thing in FF7 is still appearing, I'm really puzzled to what's causing it o_O I even downloaded the latest RA nightly, removed the config directory and did a clean config, using the default settings for the software psx core.

simias commented 8 years ago

@personaone Using Software or GL? Which internal resolution? Can you provide a savestate?

personaone commented 8 years ago

I always use software, all default running at 1x. ff7.state.zip

simias commented 8 years ago

Damn you're right, it seems my core was outdated somehow. I'm going to try to figure out what caused that then.

simias commented 8 years ago

I end up on the same commit when I bisect, it's the same code that introduced the regression. Maybe the revert wasn't complete?

mjuzikfrik commented 8 years ago

Any progress with that second issue?

ghost commented 8 years ago

It was only a partial revert; completely reverting d7e6d83b02ebaa383d70da7f62248f0d8c02303e fixes the issue.

Here's a patch that reverts d7e6d83b02ebaa383d70da7f62248f0d8c02303e and related commits: https://gist.githubusercontent.com/anonymous/../0001-beetle-psx.patch

I didn't really bother checking whether I reverted all necessary commits or not, just that git revert was happy and the core built.

inactive123 commented 8 years ago

Applied the patch, sorry about putting you guys through this for some rather unnecessary code readability sensibilities. I guess it's not really important to use the fxp.h header for this.