-
Notifications
You must be signed in to change notification settings - Fork 54
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
Initial Vita port. #818
base: vanilla
Are you sure you want to change the base?
Initial Vita port. #818
Conversation
common/file_posix.cpp
Outdated
} | ||
|
||
// fnmatch is missing from vita newlib, this is here until otherwise. | ||
int fnmatch(const char *pattern, const char *string, int flags) |
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.
What is interesting in this is that I also had to provide an fnmatch implementation for fnmatch, which I stole from newlib. I think this can be refactored later to use newlib's implementation of fnmatch
#define basename basename_vita | ||
|
||
// fails to link due to undefined basename. old newlib? | ||
static char* basename_vita(const char* filename) |
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.
Same thing here. Maybe we should test if the platform has a basename
implementation on build time?
#ifdef VITA | ||
#include <SDL.h> | ||
|
||
const int32_t VITA_FULLSCREEN_WIDTH = 960; |
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.
Maybe one of the vita headers already declare that? Libnds does for Nintendo DS at least.
@@ -258,12 +258,15 @@ inline static void _splitpath(const char* path, char* drive, char* dir, char* fn | |||
} | |||
} | |||
|
|||
#ifndef VITA |
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 also had to remove some of those functions, as they were already provided by the toolchain libs. I think the best way is to leave cmake detect those.
@@ -650,7 +650,10 @@ int MouseInstalled; | |||
// | |||
// Variables for helping track how much time goes bye in routines | |||
// | |||
#ifndef VITA | |||
//multiple definition of `LogLevel' with openal vita port. |
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.
Rename the variable. I did the same thing with Keyboard
, which aliased with typedef struct <> Keyboard
from libnds.
@@ -61,6 +61,13 @@ HINSTANCE ProgramInstance; | |||
#include <unistd.h> | |||
#define vc_chdir(x) chdir(x) | |||
#endif | |||
|
|||
#ifdef VITA | |||
int _newlib_heap_size_user = 340 * 1024 * 1024; |
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 wonder why he had to increase the HeapSize to 340Mb?
#ifdef VITA | ||
const char* progpath = "ux0:data"; | ||
#else | ||
const char* progpath = args.ArgV[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.
I remember fixing this on my NDS branch without having to do this on startup
.
@@ -54,6 +54,12 @@ HINSTANCE ProgramInstance; | |||
#define vc_chdir(x) chdir(x) | |||
#endif | |||
|
|||
#ifdef VITA | |||
int _newlib_heap_size_user = 340 * 1024 * 1024; |
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.
Move it to some of the vita specific files?
@@ -202,6 +208,9 @@ int DLL_Startup(const char* command_line_in) | |||
|
|||
int main(int argc, char** argv) | |||
{ | |||
#ifdef VITA | |||
scePowerSetArmClockFrequency(444); |
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.
CPU speed could be set in some of the VITA specific files. For instance, on my NDS Branch I set the ARM9 on Set_Video_Mode(), and all hardware specific initialization is done there.
4f5da3f
to
5e6f503
Compare
Based on Northfear's work for the Kyuhen homebrew contest.
5e6f503
to
4cb9e04
Compare
Based on Northfear's work for the Kyuhen homebrew contest and subsequent improvements.
https://github.com/Northfear/Vanilla-Conquer-vita