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

Initial Vita port. #818

Draft
wants to merge 1 commit into
base: vanilla
Choose a base branch
from

Conversation

OmniBlade
Copy link
Contributor

Based on Northfear's work for the Kyuhen homebrew contest and subsequent improvements.
https://github.com/Northfear/Vanilla-Conquer-vita

}

// fnmatch is missing from vita newlib, this is here until otherwise.
int fnmatch(const char *pattern, const char *string, int flags)
Copy link
Collaborator

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

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;
Copy link
Collaborator

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

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.
Copy link
Collaborator

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;
Copy link
Collaborator

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];
Copy link
Collaborator

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;
Copy link
Collaborator

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

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.

Based on Northfear's work for the Kyuhen homebrew contest.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants