Skip to content

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.

}
}

#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.

// 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.

#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.

#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?

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