-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add preliminary support for PS3 PSP HD Remasters. #2381
Conversation
I tested a number of non-hd remaster games before opening the pullrq and none seemed to be affected by the RAM_SIZE being doubled, just to let you know. |
|
||
u8* buf = (u8*)context; | ||
*(u32*)(buf + 0xfc) = atrac->atracID; | ||
if(!g_RemasterMode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I suggest
if (g_RemasterMode)
return;
?
Remasters use the dev kit option to increase the available RAM, it has options of 32,64,96,128,256 MB (depends on hardware revisions, some exclude 96 and 256MB which became available to later revisions). |
|
||
g_MemoryMask = g_MemorySize - 1; | ||
for(int i = 4; i < 7; i++) | ||
views[i].size = g_MemorySize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than magic numbers (4, 7) it might be better to check if size == 0. As you have it above, g_MemorySize is always 0 at that point...
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's since changed, heh.
Thanks to @unknownbrackets and @daniel-dressler for all of their help this evening. Without them, I probably would've taken days longer to get this up to this point. |
Currently investigating a minor breakage of the HD Remasters. |
@@ -188,6 +188,7 @@ | |||
<ClCompile Include="FileSystems\MetaFileSystem.cpp" /> | |||
<ClCompile Include="FileSystems\tlzrc.cpp" /> | |||
<ClCompile Include="Font\PGF.cpp" /> | |||
<ClCompile Include="HDRemaster.cpp" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this compile under non-windows platforms? Does windows use the CMake build system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows does not use CMake, but that's a good point, this should be added to the Android makefile and CMakeLists.txt, and probably the Qt stuff too.
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
This commit makes K-ON HD ver. works very well. |
No problem. Hopefully it'll be merged tomorrow for 0.8. :) |
{ | ||
u16 *uv = (u16 *)(decoded_ + decFmt.uvoff); | ||
const u16 *uvdata = (const u16*)(ptr_ + tcoff); | ||
uv[0] = uvdata[0] * 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might overflow. There's a better way to double the texture coordinates - just double the u16 factor in the rescale array in ShaderManager.cpp .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'll look into it. Thanks. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hrydgard Erm..are you referring to the one on line 320 in ShaderManager.cpp? Just double checking. Messing with that array didn't seem to fix the game I have that uses double coordinates..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at it, you want to double in through mode right? Would that be in there (above that) and in TransformPipeline (uscale /= gstate_c.curTextureWidth etc.)?
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uscale /= gstate_c.curTextureWidth / 2;
vscale /= gstate_c.curTextureHeight / 2;
In TransformPipeline seems to make K-ON happy. @hrydgard, is this an acceptable solution(along with an if(g_doubletexturecoordinates), of course, though it would probably be renamed since we divide by two..)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, you're still "doubling", what's happening here is that you're dividing the scale (multiplier) by half as much... x = x / (y / 2)
is the same as x = (x * 2) / ((y / 2) * 2)
, or x = (x * 2) / y
, or x = (x / y) * 2
.
-[Unknown]
I think I need to look at this more. No time before 0.8, so I will merge this after, sorry. |
Did this rebase work? Seems to be okay.. |
…properly rewritten so that allocation and stuff work better. This is based off the work of BlackDaemon, and I added in the auto check to switch the code on/off depending on if the game is a remaster or not. It does not affect or break any games that I know of.
…Memory::Init is called before LOAD_PSP_ISO, so I'm slightly perplexed on how to proceed at the moment.
…exture coordinates. Fixes hrydgard#2314. Also address various coding style issues.
… preliminary support, no further coding style issues withstanding.
…ZE instead of a variable.
…remnant of the debugging process.
Seems okay now, merging. |
Add preliminary support for PS3 PSP HD Remasters.
It's a hack, but it doesn't/shouldn't affect any games due to how I structured the code. It's based off of BlackDaemon's work(#1494) and has double texture coordinate support now(#2314), so K-ON Live! and other HD remasters will be rendered fine now. Huge props to @unknownbrackets and @daniel-dressler for their help with coding style, and putting up with my lack of C++ skill(yeah, I admit it.. :) ).