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

PSP2: Add Playstation Vita support #915

Merged
merged 1 commit into from Mar 4, 2017
Merged

PSP2: Add Playstation Vita support #915

merged 1 commit into from Mar 4, 2017

Conversation

@rsn8887
Copy link
Contributor

rsn8887 commented Mar 1, 2017

This is the merge-able version of #901 with all suggested changes applied. I think we should merge this "single commit" version because of all the merge issues with #901.

Is it possible to change the author of this PR and of the included commit to Cpasjuste? He did almost all the work on implementing the Vita port, I just did the merge and a few small changes to it here and there over time. So Cpasjuste should be listed in the history as the original author of the Vita port.

The file dists/psp2/readme-psp2.md includes build instructions. All done by Cpasjuste.

@rsn8887 rsn8887 force-pushed the rsn8887:vita branch 3 times, most recently from 0441e07 to 073a3f3 Mar 1, 2017
@rsn8887 rsn8887 mentioned this pull request Mar 2, 2017
Copy link
Member

sev- left a comment

Good start, but I do not like code pollution in surfacesdl-graphics.cpp. It will be difficult to maintain the the future.

Also, why this patch has object files? Isn't it possible to compile them?

@@ -43,6 +43,55 @@
#include "graphics/surface.h"
#include "gui/EventRecorder.h"

#ifdef PSP2

This comment has been minimized.

Copy link
@sev-

sev- Mar 2, 2017

Member

Would it be possible to overload the SurfaceSdlGraphicsManager class instead of these #ifdefs?

This comment has been minimized.

Copy link
@rsn8887

rsn8887 Mar 2, 2017

Author Contributor

I will try to do this on the weekend but it might take a while.

This comment has been minimized.

Copy link
@rsn8887

rsn8887 Mar 2, 2017

Author Contributor

Done

}
#endif // SDL_VERSION_ATLEAST(2, 0, 0)

#endif
#endif

This comment has been minimized.

Copy link
@sev-

sev- Mar 2, 2017

Member

This must be reverted.

This comment has been minimized.

Copy link
@rsn8887

rsn8887 Mar 2, 2017

Author Contributor

Done

@@ -43,6 +43,55 @@
#include "graphics/surface.h"
#include "gui/EventRecorder.h"

#ifdef PSP2
#include "vita2d.h"
#include "lcd3x_v.h"

This comment has been minimized.

Copy link
@sev-

sev- Mar 2, 2017

Member

Please use relative paths for all includes

This comment has been minimized.

Copy link
@rsn8887

rsn8887 Mar 2, 2017

Author Contributor

Done

@@ -0,0 +1,37 @@
#ifndef BIN_PACKING_2D_H

This comment has been minimized.

Copy link
@sev-

sev- Mar 2, 2017

Member

Where does all of this code come from? It is missing the copyright headers.

This comment has been minimized.

Copy link
@rsn8887

rsn8887 Mar 2, 2017

Author Contributor

These are dependencies to enable shader support. They don't need to be here. I will remove them and add instructions how to install these dependencies to the build instructions in readme-psp2. They can just be installed like any other library, into the users standard SDK paths, and then simply linked.

This comment has been minimized.

Copy link
@rsn8887

rsn8887 Mar 2, 2017

Author Contributor

I did this change this code is now removed.

This comment has been minimized.

Copy link
@sev-

sev- Mar 4, 2017

Member

Since this code is removed, how it should be possible to build the port?

One of the alternatives is that you provide a pre-built package with sources and we put it to our server, and you refer to it from our Wiki at the port building instructions.

This comment has been minimized.

Copy link
@rsn8887

rsn8887 Mar 5, 2017

Author Contributor

vita2d is a standard library of the vitasdk but it is Frangarcj's "fbo" branch. it can be just downloaded from github and built with "make install" basically. Detailed instructions are on readme-psp2.md. Tldr: this is a "standard" library similar to SDL. No need to include it with scummVM

@rsn8887
Copy link
Contributor Author

rsn8887 commented Mar 3, 2017

Hmm but now it crashes on startup. Must be missing something when I refactored psp2sdl graphics manager...

@rsn8887 rsn8887 force-pushed the rsn8887:vita branch from 1fd5451 to 315d77d Mar 3, 2017
@rsn8887
Copy link
Contributor Author

rsn8887 commented Mar 3, 2017

It is not crashing on startup anymore, but now it crashes on exit whenever it tries to delete _graphicsManager (must have to do with inheritance of new PSP2SdlGraphicsManager). Also it crashes when launching Dreamweb but not any other game.

@rsn8887 rsn8887 force-pushed the rsn8887:vita branch from 315d77d to ea6428f Mar 4, 2017
@rsn8887
Copy link
Contributor Author

rsn8887 commented Mar 4, 2017

Ok it is done, no crashes anymore. The code is now properly inheriting from SurfaceSdlGraphicsManager.

:
SurfaceSdlGraphicsManager(sdlEventSource, window),
_vitatex_hwscreen(nullptr),
_sdlpixels_hwscreen(nullptr)

This comment has been minimized.

Copy link
@sev-

sev- Mar 4, 2017

Member

Code formatting

This comment has been minimized.

Copy link
@rsn8887

rsn8887 Mar 4, 2017

Author Contributor

done

PSP2SdlGraphicsManager::~PSP2SdlGraphicsManager() {
if (_vitatex_hwscreen) {
vita2d_free_texture(_vitatex_hwscreen);
for(int i = 0; i < 6; i++) {

This comment has been minimized.

Copy link
@sev-

sev- Mar 4, 2017

Member

Formatting...

This comment has been minimized.

Copy link
@rsn8887

rsn8887 Mar 4, 2017

Author Contributor

done

_screen = NULL;
}

#if SDL_VERSION_ATLEAST(2, 0, 0)

This comment has been minimized.

Copy link
@sev-

sev- Mar 4, 2017

Member

Do you plan to compile with SDL1? If not, then these #if's are not needed.

This comment has been minimized.

Copy link
@rsn8887

rsn8887 Mar 4, 2017

Author Contributor

done

if (_hwscreen) {
if (_vitatex_hwscreen) {
vita2d_free_texture(_vitatex_hwscreen);
for(int i = 0; i < 6; i++) {

This comment has been minimized.

Copy link
@sev-

sev- Mar 4, 2017

Member

Formatting.

This comment has been minimized.

Copy link
@rsn8887

rsn8887 Mar 4, 2017

Author Contributor

done

if (_vitatex_hwscreen) {
if (_shaders[0] == NULL) {
// load shaders
_shaders[GFX_SHADER_NONE] = vita2d_create_shader((const SceGxmProgram *) texture_v, (const SceGxmProgram *) texture_f);

This comment has been minimized.

Copy link
@sev-

sev- Mar 4, 2017

Member

Formatting...

This comment has been minimized.

Copy link
@rsn8887

rsn8887 Mar 4, 2017

Author Contributor

done

int scale1;

// definitions not available for non-DEBUG here. (needed this to compile in SYMBIAN32 & linux?)
#if defined(DEBUG) && !defined(WIN32) && !defined(_WIN32_WCE)

This comment has been minimized.

Copy link
@sev-

sev- Mar 4, 2017

Member

This is PSP2 code, so WIN32 could be removed

This comment has been minimized.

Copy link
@rsn8887

rsn8887 Mar 4, 2017

Author Contributor

done

@rsn8887 rsn8887 force-pushed the rsn8887:vita branch from 6916cb4 to b6df0ba Mar 4, 2017
@rsn8887 rsn8887 force-pushed the rsn8887:vita branch from b6df0ba to 7098852 Mar 4, 2017
@sev-
Copy link
Member

sev- commented Mar 4, 2017

Great work! Merging

@sev- sev- merged commit 547e584 into scummvm:master Mar 4, 2017
1 check was pending
1 check was pending
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@wjp
Copy link
Member

wjp commented Mar 4, 2017

We should also update the credits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.