示例#1
0
JNIEXPORT void JNICALL Java_com_seleuco_mame4droid_Emulator_init
  (JNIEnv *env, jclass c,  jstring s1, jstring s2)
{
    __android_log_print(ANDROID_LOG_INFO, "mame4droid-jni", "init");

    const char *str1 = (*env)->GetStringUTFChars(env, s1, 0);

    load_lib(str1);

    (*env)->ReleaseStringUTFChars(env, s1, str1);
    
    __android_log_print(ANDROID_LOG_INFO, "mame4droid-jni","calling setVideoCallbacks");
    if(setVideoCallbacks!=NULL)
        setVideoCallbacks(&myJNI_initVideo,&myJNI_dumpVideo,&myJNI_changeVideo);   

    __android_log_print(ANDROID_LOG_INFO, "mame4droid-jni","calling setAudioCallbacks");
    if(setAudioCallbacks!=NULL)
       setAudioCallbacks(&myJNI_openAudio,&myJNI_dumpAudio,&myJNI_closeAudio);

    __android_log_print(ANDROID_LOG_INFO, "mame4droid-jni","calling setNetplayCallbacks");
    if(setNetplayCallbacks!=NULL)
       setNetplayCallbacks(&myJNI_netplayWarn);

    const char *str2 = (*env)->GetStringUTFChars(env, s2, 0);

    __android_log_print(ANDROID_LOG_INFO, "mame4droid-jni", "path %s",str2);

    setGlobalPath(str2);

    (*env)->ReleaseStringUTFChars(env, s2, str2);

    //int i = pthread_create(&main_tid, NULL, app_Thread_Start, NULL);

    //if(i!=0)__android_log_print(ANDROID_LOG_ERROR, "mame4droid-jni", "Error setting creating pthread %d",i);	
    //struct sched_param    param;
    //param.sched_priority = 63;
    //param.sched_priority = 46;
    //param.sched_priority = 100;
    /*  
    if(pthread_setschedparam(main_tid, SCHED_RR, &param) != 0)
    {
        __android_log_print(ANDROID_LOG_ERROR, "mame4droid-jni", "Error setting pthread priority");
        return;
    }
    */  
}
示例#2
0
//==============================================================================
int performCommandLine (const String& commandLine)
{
    StringArray args;
    args.addTokens (commandLine, true);
    args.trim();

    if (findArgument (args, "--lf") || findArgument (args, "-lf"))
       preferredLinefeed = "\n";

    String command (args[0]);

    try
    {
        if (matchArgument (command, "help"))                     { showHelp();                            return 0; }
        if (matchArgument (command, "h"))                        { showHelp();                            return 0; }
        if (matchArgument (command, "resave"))                   { resaveProject (args, false);           return 0; }
        if (matchArgument (command, "resave-resources"))         { resaveProject (args, true);            return 0; }
        if (matchArgument (command, "get-version"))              { getVersion (args);                     return 0; }
        if (matchArgument (command, "set-version"))              { setVersion (args);                     return 0; }
        if (matchArgument (command, "bump-version"))             { bumpVersion (args);                    return 0; }
        if (matchArgument (command, "git-tag-version"))          { gitTag (args);                         return 0; }
        if (matchArgument (command, "buildmodule"))              { buildModules (args, false);            return 0; }
        if (matchArgument (command, "buildallmodules"))          { buildModules (args, true);             return 0; }
        if (matchArgument (command, "status"))                   { showStatus (args);                     return 0; }
        if (matchArgument (command, "trim-whitespace"))          { cleanWhitespace (args, false);         return 0; }
        if (matchArgument (command, "remove-tabs"))              { cleanWhitespace (args, true);          return 0; }
        if (matchArgument (command, "tidy-divider-comments"))    { tidyDividerComments (args);            return 0; }
        if (matchArgument (command, "fix-broken-include-paths")) { fixRelativeIncludePaths (args);        return 0; }
        if (matchArgument (command, "obfuscated-string-code"))   { generateObfuscatedStringCode (args);   return 0; }
        if (matchArgument (command, "encode-binary"))            { encodeBinary (args);                   return 0; }
        if (matchArgument (command, "trans"))                    { scanFoldersForTranslationFiles (args); return 0; }
        if (matchArgument (command, "trans-finish"))             { createFinishedTranslationFile (args);  return 0; }
        if (matchArgument (command, "set-global-search-path"))   { setGlobalPath (args);                  return 0; }
        if (matchArgument (command, "create-project-from-pip"))  { createProjectFromPIP (args);           return 0; }
    }
    catch (const CommandLineError& error)
    {
        std::cout << error.message << std::endl << std::endl;
        return 1;
    }

    return commandLineNotPerformed;
}