JNIEXPORT jboolean JNICALL Java_com_ssb_droidsound_plugins_VICEPlugin_N_1setTune(JNIEnv *env, jclass cl, jint tune) { psid_set_tune(tune); c64_song_init(); return true; }
JNIEXPORT jstring JNICALL Java_com_ssb_droidsound_plugins_VICEPlugin_N_1loadFile(JNIEnv *env, jclass cl, jstring name) { __android_log_print(ANDROID_LOG_VERBOSE, "VICEPlugin", "in load()"); const char* cname = env->GetStringUTFChars(name, 0); int ret = psid_load_file(cname); env->ReleaseStringUTFChars(name, cname); if (ret != 0) { return NewString(env, (const char *) "failure code from psid_load_file()"); } c64_song_init(); return 0; }
void load_sid_song(char *data, int size) { FILE *fp = fopen("worker.sid", "wb"); fwrite(data, 1, size, fp); fclose(fp); //char name[size+1]; //memcpy(name, data, size); //name[size] = 0; int ret = psid_load_file("worker.sid"); if (ret == 0) { int defaultSong; int songs = psid_tunes(&defaultSong); c64_song_init(); emscripten_worker_respond("OK", 3); } else emscripten_worker_respond("FAIL", 5); }