Skip to content
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

Merged
merged 16 commits into from
Jun 26, 2013

Conversation

thedax
Copy link
Collaborator

@thedax thedax commented Jun 21, 2013

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.. :) ).

@thedax
Copy link
Collaborator Author

thedax commented Jun 21, 2013

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) {
Copy link
Contributor

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;
?

@VIRGINKLM
Copy link
Contributor

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;
Copy link
Collaborator

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]

Copy link
Collaborator Author

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.

@thedax
Copy link
Collaborator Author

thedax commented Jun 22, 2013

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.

@thedax
Copy link
Collaborator Author

thedax commented Jun 22, 2013

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" />
Copy link
Contributor

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?

Copy link
Collaborator

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]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@BlackBeetleKing
Copy link

This commit makes K-ON HD ver. works very well.
really appreciate your hard work
Big thank

@thedax
Copy link
Collaborator Author

thedax commented Jun 23, 2013

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;
Copy link
Owner

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 .

Copy link
Collaborator Author

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. 👍

Copy link
Collaborator Author

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..

Copy link
Collaborator

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]

Copy link
Collaborator Author

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..)?

Copy link
Collaborator

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]

@hrydgard
Copy link
Owner

I think I need to look at this more. No time before 0.8, so I will merge this after, sorry.

@thedax
Copy link
Collaborator Author

thedax commented Jun 26, 2013

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.
@hrydgard
Copy link
Owner

Seems okay now, merging.

hrydgard added a commit that referenced this pull request Jun 26, 2013
Add preliminary support for PS3 PSP HD Remasters.
@hrydgard hrydgard merged commit ed47eac into hrydgard:master Jun 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants