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
Conversation
0441e07
to
073a3f3
Compare
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.
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 |
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.
Would it be possible to overload the SurfaceSdlGraphicsManager class instead of these #ifdefs?
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.
I will try to do this on the weekend but it might take a while.
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.
Done
} | ||
#endif // SDL_VERSION_ATLEAST(2, 0, 0) | ||
|
||
#endif | ||
#endif |
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 must be reverted.
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.
Done
@@ -43,6 +43,55 @@ | |||
#include "graphics/surface.h" | |||
#include "gui/EventRecorder.h" | |||
|
|||
#ifdef PSP2 | |||
#include "vita2d.h" | |||
#include "lcd3x_v.h" |
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.
Please use relative paths for all includes
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.
Done
@@ -0,0 +1,37 @@ | |||
#ifndef BIN_PACKING_2D_H |
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.
Where does all of this code come from? It is missing the copyright headers.
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.
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.
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.
I did this change this code is now removed.
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.
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.
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.
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
Hmm but now it crashes on startup. Must be missing something when I refactored psp2sdl graphics manager... |
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. |
Ok it is done, no crashes anymore. The code is now properly inheriting from SurfaceSdlGraphicsManager. |
: | ||
SurfaceSdlGraphicsManager(sdlEventSource, window), | ||
_vitatex_hwscreen(nullptr), | ||
_sdlpixels_hwscreen(nullptr) |
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.
Code formatting
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.
done
PSP2SdlGraphicsManager::~PSP2SdlGraphicsManager() { | ||
if (_vitatex_hwscreen) { | ||
vita2d_free_texture(_vitatex_hwscreen); | ||
for(int i = 0; i < 6; i++) { |
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.
Formatting...
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.
done
_screen = NULL; | ||
} | ||
|
||
#if SDL_VERSION_ATLEAST(2, 0, 0) |
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.
Do you plan to compile with SDL1? If not, then these #if's are not needed.
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.
done
if (_hwscreen) { | ||
if (_vitatex_hwscreen) { | ||
vita2d_free_texture(_vitatex_hwscreen); | ||
for(int i = 0; i < 6; i++) { |
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.
Formatting.
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.
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); |
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.
Formatting...
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.
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) |
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 is PSP2 code, so WIN32 could be removed
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.
done
Great work! Merging |
We should also update the credits. |
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.