#include "PHL.h" #include "game.h" #include #include #include #ifdef ODROID #define _XTYPEDEF_MASK #include #endif void createSaveLocations() { //Force create save data folders #ifdef _3DS //3DS builds mkdir("sdmc:/3ds", 0777); mkdir("sdmc:/3ds/appdata", 0777); mkdir("sdmc:/3ds/appdata/HydraCastleLabyrinth", 0777); mkdir("sdmc:/3ds/appdata/HydraCastleLabyrinth/data", 0777); mkdir("sdmc:/3ds/appdata/HydraCastleLabyrinth/map", 0777); #elif defined(_SDL) char buff[4096]; strcpy(buff, getenv("HOME")); strcat(buff, "/.hydracastlelabyrinth"); // if exist first? struct stat sb; if(!(stat(buff, &sb)==0 && S_ISDIR(sb.st_mode))) mkdir(buff, 0777); #else //psp, wii mkdir("/data", 0777); mkdir("/map", 0777); #endif } int main(int argc, char **argv) { //Setup #ifdef _3DS sdmcInit(); osSetSpeedupEnable(false); #endif #ifdef _SDL if ( SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK ) < 0) { fprintf(stderr, "Error"); SDL_Delay(5000); exit(EXIT_FAILURE); } #if defined(PANDORA) || defined(PYRA) || defined(CHIP) || defined(ODROID) wantFullscreen = 1; #else wantFullscreen = 0; #endif #ifdef CHIP screenScale = 1; #elif defined(PYRA) screenScale = 3; #elif defined(ODROID) const SDL_VideoInfo* infos = SDL_GetVideoInfo(); int maxy = infos->current_h; if(maxy < 640) screenScale = 1; else if (maxy < 720) screenScale = 2; else if (maxy < 960) screenScale = 3; else screenScale = 4; #else screenScale = 2; #endif useJoystick = 1; // get command line arguments for (int i=1; i