PS2 uses a -0.5 offset before sampling so texels must be rounded to half-pixel boundary
If fixes glitches on Venus and taisho-mononoke
Note: I didn't fixed yet texture render in reverse because I don't have any test for it.
UserHacks_round_sprite_offset = 1 <= enable correction of flat sprites
UserHacks_round_sprite_offset = 2 <= enable correction of all sprites (better on a couple of dump but not sure of the consequence)
I completely redo the algorithm. This time I do the projection and
interpolation of the 2 extrem vertex. This way I can compute the min/max
valid texture coordinate.
It gives stronger guarantee that texture sampling will be done inside the texture.
However it might have a performance impact, likely reasonable because it
is limited to sprite vertex.
A big thanks you to all people that provide me GS dump and test reports.
It is replacement of the previous hack (UserHacks_stretch_sprite). Don't enable both in the same time!
The idea of the hack is to move the sprite to the pixel boundary. It
avoids most of rounding issue. It also rescales verticaly the sprite (avoid horizontal line on ace combat).
I don't like this rescaling maybe we can limit it to only 1 pixels.
On my limited testcase, results are much better with any upscaling factor.
I still have a bad line in Kingdom heart. If you have issue with others
game please provide us a GS dump.
there was already code for this, but it was broken due to:
- the message is WM_SYSCOMMAND and wParam is SC_SCREENSAVE etc.
- GSPanel doesn't get WM_SYSCOMMAND - GSFrame does.
- also disabled screen saver while paused if not set to hide the GS window.
- it's an ugly hack where windows keeps trying to activate the screen saver
every few seconds but such code prevents it (Lilypad has the same hack).
the new code uses windows API which was designed for this.
the screen saver is now disabled while the window is focused and the emulation
is running. it's on by defauly and without GUI - the same as with normal games.
this patch addresses Windows only, but adds a placeholder for future
implementations for other platforms.
2x upscaling is pixel perfects. Bigger upscaling is better but not yet perfect
Feedbacks are welcomes (note it doesn't solve all upscaling issue, only wrong texture sampling)
For the history:
If you have a texture of [0;16[ texels and draws a primitive [0;16[
The formulae to sample last pixels of texture is
0.5 + (16*s-1)/(16*s) * 16
Native (s==1): 15.5 (good)
2x (s==2): 16 (bad, outside of the texture)
4x (s==4): 16.25 (bad, really outside of the texure))
Performance is not important here. I'm not sure Windows could handle VLA
* new/delete can still be used otherwise.
* Put an assert(0) because debugger surely don't use string bigger than
128 bytes.
code is much more compact 20 lines vs 700 lines ...
-Replaced googlecode link with Github
-Updated hotkeys section with more hotkeys (taken from our wiki, thanks
people!)
Thanks to karasuhebi from our forum for bringing this to my attention!
+ This is not yet perfect. Really, this standard seems like a load of crap to me in fact...
At least it works now. Should test again when gcc 5 & new c++ libs gets out.. Until then, it will do.
ask the OS to asynchronously fetch the next chunk from disk before we actually
use it. We then cancel this request and ignore the data before the next extract
but it's very likely that when extract tries to read from disk the data will
already be cached by the OS.
This frequently allows to overcome HDD seek time (mostly due to fragmentation)
of the compressed file.