-
Notifications
You must be signed in to change notification settings - Fork 753
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
PSP port #1918
PSP port #1918
Changes from 9 commits
61aebc1
bffa425
949afbf
cd4c65c
aa76765
5c445ae
24ad192
f49b551
5f5321a
58e5b18
392d8da
703d7c1
87a6641
751197e
79ddbff
c04de03
d762a2b
3cef15a
0192517
94e3168
633e459
0794731
76437aa
ce11c9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#General compilation options | ||
set(NONET ON) | ||
set(USE_SDL1 ON) | ||
set(NOSOUND ON) | ||
|
||
# keeping the 3DS defaults for now | ||
# Streaming audio is broken on the 3DS as of 25 Mar 2021: | ||
# https://github.com/devkitPro/SDL/issues/72 | ||
set(DISABLE_STREAMING_MUSIC ON) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is no longer needed, it was due to a bug that has since been resolved. |
||
set(DISABLE_STREAMING_SOUNDS ON) | ||
|
||
#Force scaling, for now.. | ||
set(SDL1_VIDEO_MODE_FLAGS SDL_FULLSCREEN) | ||
set(DEFAULT_WIDTH 640) | ||
set(DEFAULT_HEIGHT 480) | ||
|
||
#SDL Joystick axis mapping (circle-pad) | ||
# set(JOY_AXIS_LEFTX 0) | ||
# set(JOY_AXIS_LEFTY 1) | ||
#SDL Joystick button mapping (A / B and X / Y inverted) | ||
# set(JOY_BUTTON_A 2) | ||
# set(JOY_BUTTON_B 1) | ||
# set(JOY_BUTTON_X 4) | ||
# set(JOY_BUTTON_Y 3) | ||
# set(JOY_BUTTON_LEFTSHOULDER 5) | ||
# set(JOY_BUTTON_RIGHTSHOULDER 6) | ||
# set(JOY_BUTTON_BACK 7) | ||
# set(JOY_BUTTON_START 0) | ||
# set(JOY_BUTTON_DPAD_DOWN 8) | ||
# set(JOY_BUTTON_DPAD_LEFT 9) | ||
# set(JOY_BUTTON_DPAD_UP 10) | ||
# set(JOY_BUTTON_DPAD_RIGHT 11) | ||
# set(JOY_BUTTON_TRIGGERLEFT 12) | ||
# set(JOY_BUTTON_TRIGGERRIGHT 13) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
# Building for PSP | ||
|
||
Install psptoolchain from https://github.com/pspdev/psptoolchain | ||
|
||
It should have set the ENV var "PSPDEV" to "/usr/local/pspdev" and added "$PSPDEV/bin" to PATH automatically. If not, just do it as stated on the github page. | ||
|
||
After that you should run build.sh from this folder ("Packaging/psp)" and it will put EBOOT.PBP under "build/". |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
psp-cmake . -DPSPDEV=/usr/local/pspdev -DPSP=ON -DCMAKE_BUILD_TYPE=Release | ||
make |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -723,4 +723,27 @@ bool PostMessage(uint32_t type, int32_t wParam, int32_t lParam) | |
return true; | ||
} | ||
|
||
#ifdef __PSP__ | ||
|
||
int snprintf(char *s, size_t n, const char *format, ...) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be best to fix this in the PSP libc instead |
||
{ | ||
char message[256]; | ||
va_list ap; | ||
va_start(ap, format); | ||
vsprintf(message, format, ap); | ||
va_end(ap); | ||
|
||
return sprintf(s, format, message); // Security? | ||
} | ||
|
||
int vsnprintf(char *s, size_t n, const char *format, va_list arg) | ||
{ | ||
char message[256]; | ||
vsprintf(message, format, arg); | ||
|
||
return sprintf(s, format, message); // Security? | ||
} | ||
|
||
#endif | ||
|
||
} // namespace devilution |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,8 @@ bool ResizeFile(const char *path, std::uintmax_t size) | |
} | ||
::CloseHandle(file); | ||
return true; | ||
#elif defined(__PSP__) | ||
return false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some form of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While it would obviously require more code, the PSP has its own save data utility accessible to all games. It is fairly trivial to implement, you can either call the SceUtility functions when saving the game or implement the save data dialog and let players choose files so they can scroll through the fancy icons ;) https://github.com/pspdev/pspsdk/blob/master/src/samples/savedata/utility/main.c There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PSP libc is supposed to already support There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's the problem on pspdev/psptoolchain#108. C++ for some reason doesn't have the functions C does. |
||
#elif _POSIX_C_SOURCE >= 200112L || defined(_BSD_SOURCE) || defined(__APPLE__) | ||
return ::truncate(path, static_cast<off_t>(size)) == 0; | ||
#else | ||
|
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.
Is this needed? These look like the defaults for an unknown platform