Skip to content

Initial Vita port.#818

Draft
OmniBlade wants to merge 1 commit into
TheAssemblyArmada:vanillafrom
OmniBlade:port/vita
Draft

Initial Vita port.#818
OmniBlade wants to merge 1 commit into
TheAssemblyArmada:vanillafrom
OmniBlade:port/vita

Conversation

@OmniBlade
Copy link
Copy Markdown
Contributor

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

Comment thread 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)
Copy link
Copy Markdown
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

Comment thread common/mixfile.h
#define basename basename_vita

// fails to link due to undefined basename. old newlib?
static char* basename_vita(const char* filename)
Copy link
Copy Markdown
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?

Comment thread common/video.h
#ifdef VITA
#include <SDL.h>

const int32_t VITA_FULLSCREEN_WIDTH = 960;
Copy link
Copy Markdown
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.

Comment thread common/wwstd.h
}
}

#ifndef VITA
Copy link
Copy Markdown
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.

Comment thread redalert/globals.cpp
// Variables for helping track how much time goes bye in routines
//
#ifndef VITA
//multiple definition of `LogLevel' with openal vita port.
Copy link
Copy Markdown
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.

Comment thread redalert/startup.cpp
#endif

#ifdef VITA
int _newlib_heap_size_user = 340 * 1024 * 1024;
Copy link
Copy Markdown
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?

Comment thread redalert/startup.cpp
#ifdef VITA
const char* progpath = "ux0:data";
#else
const char* progpath = args.ArgV[0];
Copy link
Copy Markdown
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.

Comment thread tiberiandawn/startup.cpp
#endif

#ifdef VITA
int _newlib_heap_size_user = 340 * 1024 * 1024;
Copy link
Copy Markdown
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?

Comment thread tiberiandawn/startup.cpp
int main(int argc, char** argv)
{
#ifdef VITA
scePowerSetArmClockFrequency(444);
Copy link
Copy Markdown
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