Skip sending info on missing ID, Use id on blank name
This commit is contained in:
parent
dc5a3df78f
commit
c1494b9363
|
@ -659,7 +659,7 @@ public class GL2JNIView extends GLSurfaceView
|
|||
}
|
||||
|
||||
void reiosInfo(String reiosId, String reiosSoftware) {
|
||||
if (fileName != null && !reiosId.equals("") && !reiosSoftware.equals("")) {
|
||||
if (fileName != null) {
|
||||
String gameId = reiosId.replaceAll("[^a-zA-Z0-9]+", "").toLowerCase();
|
||||
SharedPreferences mPrefs = context.getSharedPreferences(gameId, Activity.MODE_PRIVATE);
|
||||
Emulator app = (Emulator) context.getApplicationContext();
|
||||
|
@ -668,6 +668,8 @@ public class GL2JNIView extends GLSurfaceView
|
|||
((GL2JNIActivity) context).getPad().joystick[0] = mPrefs.getBoolean(
|
||||
Gamepad.pref_js_merged + "_A",
|
||||
((GL2JNIActivity) context).getPad().joystick[0]);
|
||||
// Assign the ID as a placeholder if a name isn't found
|
||||
if (reiosSoftware.equals("")) reiosSoftware = reiosId;
|
||||
mPrefs.edit().putString(Config.game_title, reiosSoftware.trim()).apply();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -390,14 +390,16 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_query(JNIEnv *env,job
|
|||
jmethodID reiosInfoMid=env->GetMethodID(env->GetObjectClass(emu_thread),"reiosInfo","(Ljava/lang/String;Ljava/lang/String;)V");
|
||||
|
||||
char *id = (char*)malloc(11);
|
||||
// Verify that there is an ID assigned
|
||||
if ((id != NULL) && (id[0] == '\0')) {
|
||||
strcpy(id, reios_disk_id());
|
||||
jstring reios_id = env->NewStringUTF(id);
|
||||
|
||||
char *name = (char *) malloc(129);
|
||||
strcpy(name, reios_software_name);
|
||||
jstring reios_name = env->NewStringUTF(name);
|
||||
|
||||
env->CallVoidMethod(emu_thread, reiosInfoMid, reios_id, reios_name);
|
||||
}
|
||||
|
||||
dc_init();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue