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 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 vita branch 3 times, most recently from 0441e07 to 073a3f3 Compare March 1, 2017 23:33
@rsn8887 rsn8887 mentioned this pull request Mar 2, 2017
Copy link
Member

@sev- sev- left a comment

Choose a reason for hiding this comment

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

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
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

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

#endif
#endif
Copy link
Member

Choose a reason for hiding this comment

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

This must be reverted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

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

#ifdef PSP2
#include "vita2d.h"
#include "lcd3x_v.h"
Copy link
Member

Choose a reason for hiding this comment

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

Please use relative paths for all includes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,37 @@
#ifndef BIN_PACKING_2D_H
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

@rsn8887 rsn8887 Mar 2, 2017

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did this change this code is now removed.

Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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
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
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)
Copy link
Member

Choose a reason for hiding this comment

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

Code formatting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

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

Choose a reason for hiding this comment

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

Formatting...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

_screen = NULL;
}

#if SDL_VERSION_ATLEAST(2, 0, 0)
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

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

Choose a reason for hiding this comment

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

Formatting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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);
Copy link
Member

Choose a reason for hiding this comment

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

Formatting...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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)
Copy link
Member

Choose a reason for hiding this comment

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

This is PSP2 code, so WIN32 could be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@sev-
Copy link
Member

sev- commented Mar 4, 2017

Great work! Merging

@sev- sev- merged commit 547e584 into scummvm:master Mar 4, 2017
@wjp
Copy link
Contributor

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
Labels
None yet
Projects
None yet
4 participants