Merge pull request #267 from NoblesseOblige/master
Massive cleanup and organization of processes by function
This commit is contained in:
commit
e4c0e8ec61
|
@ -44,7 +44,7 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".GL2JNIActivity"
|
||||
android:name="com.reicast.emulator.emu.GL2JNIActivity"
|
||||
android:configChanges="orientation|screenSize|screenLayout|uiMode|keyboard|keyboardHidden"
|
||||
android:screenOrientation="landscape"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
|
||||
|
@ -91,7 +91,7 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".EditVJoyActivity"
|
||||
android:name="com.reicast.emulator.config.EditVJoyActivity"
|
||||
android:configChanges="orientation|screenSize|screenLayout|uiMode|keyboard|keyboardHidden"
|
||||
android:screenOrientation="landscape"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
|
||||
|
|
|
@ -21,114 +21,114 @@
|
|||
|
||||
extern "C"
|
||||
{
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_config(JNIEnv *env,jobject obj,jstring dirName) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_init(JNIEnv *env,jobject obj,jstring fileName) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_run(JNIEnv *env,jobject obj,jobject track) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_stop(JNIEnv *env,jobject obj) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_config(JNIEnv *env,jobject obj,jstring dirName) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_init(JNIEnv *env,jobject obj,jstring fileName) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_run(JNIEnv *env,jobject obj,jobject track) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_stop(JNIEnv *env,jobject obj) __attribute__((visibility("default")));
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_reicast_emulator_JNIdc_send(JNIEnv *env,jobject obj,jint id, jint v) __attribute__((visibility("default")));
|
||||
JNIEXPORT jint JNICALL Java_com_reicast_emulator_JNIdc_data(JNIEnv *env,jobject obj,jint id, jbyteArray d) __attribute__((visibility("default")));
|
||||
JNIEXPORT jint JNICALL Java_com_reicast_emulator_emu_JNIdc_send(JNIEnv *env,jobject obj,jint id, jint v) __attribute__((visibility("default")));
|
||||
JNIEXPORT jint JNICALL Java_com_reicast_emulator_emu_JNIdc_data(JNIEnv *env,jobject obj,jint id, jbyteArray d) __attribute__((visibility("default")));
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_rendinit(JNIEnv *env,jobject obj,jint w,jint h) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_rendframe(JNIEnv *env,jobject obj) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_rendinit(JNIEnv *env,jobject obj,jint w,jint h) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_rendframe(JNIEnv *env,jobject obj) __attribute__((visibility("default")));
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_kcode(JNIEnv * env, jobject obj, jintArray k_code, jintArray l_t, jintArray r_t, jintArray jx, jintArray jy) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_vjoy(JNIEnv * env, jobject obj,u32 id,float x, float y, float w, float h) __attribute__((visibility("default")));
|
||||
//JNIEXPORT jint JNICALL Java_com_reicast_emulator_JNIdc_play(JNIEnv *env,jobject obj,jshortArray result,jint size);
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_kcode(JNIEnv * env, jobject obj, jintArray k_code, jintArray l_t, jintArray r_t, jintArray jx, jintArray jy) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_vjoy(JNIEnv * env, jobject obj,u32 id,float x, float y, float w, float h) __attribute__((visibility("default")));
|
||||
//JNIEXPORT jint JNICALL Java_com_reicast_emulator_emu_JNIdc_play(JNIEnv *env,jobject obj,jshortArray result,jint size);
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_initControllers(JNIEnv *env, jobject obj, jbooleanArray controllers) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_initControllers(JNIEnv *env, jobject obj, jbooleanArray controllers) __attribute__((visibility("default")));
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_setupMic(JNIEnv *env,jobject obj,jobject sip) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_vmuSwap(JNIEnv *env,jobject obj) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_setupMic(JNIEnv *env,jobject obj,jobject sip) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_vmuSwap(JNIEnv *env,jobject obj) __attribute__((visibility("default")));
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_dynarec(JNIEnv *env,jobject obj, jint dynarec) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_idleskip(JNIEnv *env,jobject obj, jint idleskip) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_unstable(JNIEnv *env,jobject obj, jint unstable) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_cable(JNIEnv *env,jobject obj, jint cable) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_region(JNIEnv *env,jobject obj, jint region) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_broadcast(JNIEnv *env,jobject obj, jint broadcast) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_limitfps(JNIEnv *env,jobject obj, jint limiter) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_nobatch(JNIEnv *env,jobject obj, jint nobatch) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_mipmaps(JNIEnv *env,jobject obj, jint mipmaps) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_widescreen(JNIEnv *env,jobject obj, jint stretch) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_subdivide(JNIEnv *env,jobject obj, jint subdivide) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_frameskip(JNIEnv *env,jobject obj, jint frames) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_pvrrender(JNIEnv *env,jobject obj, jint render) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_cheatdisk(JNIEnv *env,jobject obj, jstring disk) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_dreamtime(JNIEnv *env,jobject obj, u32 clock) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_dynarec(JNIEnv *env,jobject obj, jint dynarec) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_idleskip(JNIEnv *env,jobject obj, jint idleskip) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_unstable(JNIEnv *env,jobject obj, jint unstable) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_cable(JNIEnv *env,jobject obj, jint cable) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_region(JNIEnv *env,jobject obj, jint region) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_broadcast(JNIEnv *env,jobject obj, jint broadcast) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_limitfps(JNIEnv *env,jobject obj, jint limiter) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_nobatch(JNIEnv *env,jobject obj, jint nobatch) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_mipmaps(JNIEnv *env,jobject obj, jint mipmaps) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_widescreen(JNIEnv *env,jobject obj, jint stretch) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_subdivide(JNIEnv *env,jobject obj, jint subdivide) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_frameskip(JNIEnv *env,jobject obj, jint frames) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_pvrrender(JNIEnv *env,jobject obj, jint render) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_cheatdisk(JNIEnv *env,jobject obj, jstring disk) __attribute__((visibility("default")));
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_dreamtime(JNIEnv *env,jobject obj, u32 clock) __attribute__((visibility("default")));
|
||||
};
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_dynarec(JNIEnv *env,jobject obj, jint dynarec)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_dynarec(JNIEnv *env,jobject obj, jint dynarec)
|
||||
{
|
||||
settings.dynarec.Enable = dynarec;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_idleskip(JNIEnv *env,jobject obj, jint idleskip)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_idleskip(JNIEnv *env,jobject obj, jint idleskip)
|
||||
{
|
||||
settings.dynarec.idleskip = idleskip;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_unstable(JNIEnv *env,jobject obj, jint unstable)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_unstable(JNIEnv *env,jobject obj, jint unstable)
|
||||
{
|
||||
settings.dynarec.unstable_opt = unstable;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_cable(JNIEnv *env,jobject obj, jint cable)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_cable(JNIEnv *env,jobject obj, jint cable)
|
||||
{
|
||||
settings.dreamcast.cable = cable;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_region(JNIEnv *env,jobject obj, jint region)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_region(JNIEnv *env,jobject obj, jint region)
|
||||
{
|
||||
settings.dreamcast.region = region;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_broadcast(JNIEnv *env,jobject obj, jint broadcast)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_broadcast(JNIEnv *env,jobject obj, jint broadcast)
|
||||
{
|
||||
settings.dreamcast.broadcast = broadcast;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_limitfps(JNIEnv *env,jobject obj, jint limiter)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_limitfps(JNIEnv *env,jobject obj, jint limiter)
|
||||
{
|
||||
settings.aica.LimitFPS = limiter;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_nobatch(JNIEnv *env,jobject obj, jint nobatch)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_nobatch(JNIEnv *env,jobject obj, jint nobatch)
|
||||
{
|
||||
settings.aica.NoBatch = nobatch;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_mipmaps(JNIEnv *env,jobject obj, jint mipmaps)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_mipmaps(JNIEnv *env,jobject obj, jint mipmaps)
|
||||
{
|
||||
settings.rend.UseMipmaps = mipmaps;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_widescreen(JNIEnv *env,jobject obj, jint stretch)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_widescreen(JNIEnv *env,jobject obj, jint stretch)
|
||||
{
|
||||
settings.rend.WideScreen = stretch;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_subdivide(JNIEnv *env,jobject obj, jint subdivide)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_subdivide(JNIEnv *env,jobject obj, jint subdivide)
|
||||
{
|
||||
settings.pvr.subdivide_transp = subdivide;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_frameskip(JNIEnv *env,jobject obj, jint frames)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_frameskip(JNIEnv *env,jobject obj, jint frames)
|
||||
{
|
||||
settings.pvr.ta_skip = frames;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_pvrrender(JNIEnv *env,jobject obj, jint render)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_pvrrender(JNIEnv *env,jobject obj, jint render)
|
||||
{
|
||||
settings.pvr.rend = render;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_cheatdisk(JNIEnv *env,jobject obj, jstring disk)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_cheatdisk(JNIEnv *env,jobject obj, jstring disk)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_dreamtime(JNIEnv *env,jobject obj, u32 clock)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_dreamtime(JNIEnv *env,jobject obj, u32 clock)
|
||||
{
|
||||
settings.dreamcast.RTC = clock;
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ void os_SetWindowText(char const *Text)
|
|||
{
|
||||
putinf(Text);
|
||||
}
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_config(JNIEnv *env,jobject obj,jstring dirName)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_config(JNIEnv *env,jobject obj,jstring dirName)
|
||||
{
|
||||
// Set home directory based on User config
|
||||
const char* D = dirName? env->GetStringUTFChars(dirName,0):0;
|
||||
|
@ -246,7 +246,7 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_config(JNIEnv *env,jobjec
|
|||
printf("Home dir is: '%s'\n",GetPath("/").c_str());
|
||||
env->ReleaseStringUTFChars(dirName,D);
|
||||
}
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_init(JNIEnv *env,jobject obj,jstring fileName)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_init(JNIEnv *env,jobject obj,jstring fileName)
|
||||
{
|
||||
|
||||
// Get filename string from Java
|
||||
|
@ -290,7 +290,7 @@ jobject track;
|
|||
jobject sipemu;
|
||||
jmethodID getmicdata;
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_run(JNIEnv *env,jobject obj,jobject trk)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_run(JNIEnv *env,jobject obj,jobject trk)
|
||||
{
|
||||
install_prof_handler(0);
|
||||
|
||||
|
@ -303,7 +303,7 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_run(JNIEnv *env,jobject o
|
|||
dc_run();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_setupMic(JNIEnv *env,jobject obj,jobject sip)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_setupMic(JNIEnv *env,jobject obj,jobject sip)
|
||||
{
|
||||
sipemu = env->NewGlobalRef(sip);
|
||||
getmicdata = env->GetMethodID(env->GetObjectClass(sipemu),"getData","()[B");
|
||||
|
@ -311,12 +311,12 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_setupMic(JNIEnv *env,jobj
|
|||
mcfg_Create(MDT_Microphone,0,1);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_stop(JNIEnv *env,jobject obj)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_stop(JNIEnv *env,jobject obj)
|
||||
{
|
||||
dc_term();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_vmuSwap(JNIEnv *env,jobject obj)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_vmuSwap(JNIEnv *env,jobject obj)
|
||||
{
|
||||
LOGD("vmuSwap go!");
|
||||
|
||||
|
@ -333,7 +333,7 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_vmuSwap(JNIEnv *env,jobje
|
|||
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_reicast_emulator_JNIdc_send(JNIEnv *env,jobject obj,jint cmd, jint param)
|
||||
JNIEXPORT jint JNICALL Java_com_reicast_emulator_emu_JNIdc_send(JNIEnv *env,jobject obj,jint cmd, jint param)
|
||||
{
|
||||
if (cmd==0)
|
||||
{
|
||||
|
@ -366,7 +366,7 @@ JNIEXPORT jint JNICALL Java_com_reicast_emulator_JNIdc_send(JNIEnv *env,jobject
|
|||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_reicast_emulator_JNIdc_data(JNIEnv *env,jobject obj,jint id, jbyteArray d)
|
||||
JNIEXPORT jint JNICALL Java_com_reicast_emulator_emu_JNIdc_data(JNIEnv *env,jobject obj,jint id, jbyteArray d)
|
||||
{
|
||||
if (id==1)
|
||||
{
|
||||
|
@ -380,12 +380,12 @@ JNIEXPORT jint JNICALL Java_com_reicast_emulator_JNIdc_data(JNIEnv *env,jobject
|
|||
}
|
||||
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_rendframe(JNIEnv *env,jobject obj)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_rendframe(JNIEnv *env,jobject obj)
|
||||
{
|
||||
while(!rend_single_frame()) ;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_kcode(JNIEnv * env, jobject obj, jintArray k_code, jintArray l_t, jintArray r_t, jintArray jx, jintArray jy)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_kcode(JNIEnv * env, jobject obj, jintArray k_code, jintArray l_t, jintArray r_t, jintArray jx, jintArray jy)
|
||||
{
|
||||
jint *k_code_body = env->GetIntArrayElements(k_code, 0);
|
||||
jint *l_t_body = env->GetIntArrayElements(l_t, 0);
|
||||
|
@ -409,7 +409,7 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_kcode(JNIEnv * env, jobje
|
|||
env->ReleaseIntArrayElements(jy, jy_body, 0);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_rendinit(JNIEnv * env, jobject obj, jint w,jint h)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_rendinit(JNIEnv * env, jobject obj, jint w,jint h)
|
||||
{
|
||||
screen_width = w;
|
||||
screen_height = h;
|
||||
|
@ -424,7 +424,7 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_rendinit(JNIEnv * env, jo
|
|||
install_prof_handler(1);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_vjoy(JNIEnv * env, jobject obj,u32 id,float x, float y, float w, float h)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_vjoy(JNIEnv * env, jobject obj,u32 id,float x, float y, float w, float h)
|
||||
{
|
||||
if(id<sizeof(vjoy_pos)/sizeof(vjoy_pos[0]))
|
||||
{
|
||||
|
@ -435,7 +435,7 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_vjoy(JNIEnv * env, jobjec
|
|||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_initControllers(JNIEnv *env, jobject obj, jbooleanArray controllers)
|
||||
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_initControllers(JNIEnv *env, jobject obj, jbooleanArray controllers)
|
||||
{
|
||||
jboolean *controllers_body = env->GetBooleanArrayElements(controllers, 0);
|
||||
memcpy(add_controllers, controllers_body, 3);
|
||||
|
|
|
@ -135,6 +135,109 @@
|
|||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/optimization_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/optimization_opts" />
|
||||
</TableRow>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/list_item_border" />
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/software_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:ems="10"
|
||||
android:gravity="center_vertical|left"
|
||||
android:text="@string/select_software" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="right"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<de.ankri.views.Switch
|
||||
android:id="@+id/software_option"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sound_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:ems="10"
|
||||
android:gravity="center_vertical|left"
|
||||
android:text="@string/select_sound" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="right"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<de.ankri.views.Switch
|
||||
android:id="@+id/sound_option"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/force_gpu_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:ems="10"
|
||||
android:gravity="center_vertical|left"
|
||||
android:text="@string/select_force_gpu" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="right"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<de.ankri.views.Switch
|
||||
android:id="@+id/force_gpu_option"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
@ -166,6 +269,19 @@
|
|||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/debug_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="8"
|
||||
android:text="@string/menu_debug" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/experimental_text"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -176,8 +292,13 @@
|
|||
android:text="@string/experimental_opts" />
|
||||
</TableRow>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/list_item_border" />
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<TextView
|
||||
|
@ -316,75 +437,6 @@
|
|||
</EditText>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/software_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:ems="10"
|
||||
android:gravity="center_vertical|left"
|
||||
android:text="@string/select_software" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="right"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<de.ankri.views.Switch
|
||||
android:id="@+id/software_option"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/force_gpu_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:ems="10"
|
||||
android:gravity="center_vertical|left"
|
||||
android:text="@string/select_force_gpu" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="right"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<de.ankri.views.Switch
|
||||
android:id="@+id/force_gpu_option"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/debug_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="8"
|
||||
android:text="@string/menu_debug" />
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<string name="folder_bios">BOOT BIOS</string>
|
||||
<string name="folder_select">SELECT CURRENT FOLDER</string>
|
||||
|
||||
<string name="optimization_opts">Optimization and Debugging Options</string>
|
||||
<string name="experimental_opts">Experimental (May cause widespread panic)</string>
|
||||
<string name="select_dynarec">Dynarec Options</string>
|
||||
<string name="select_unstable">Unstable Optimisations</string>
|
||||
|
@ -26,6 +27,7 @@
|
|||
<string name="set_frameskip">Frameskip Value</string>
|
||||
<string name="select_render">PVR Rendering (does nothing for now)</string>
|
||||
<string name="select_software">Force Software Rendering</string>
|
||||
<string name="select_sound">Enable Emulator Sound</string>
|
||||
<string name="select_force_gpu">Force v6 GPU Config</string>
|
||||
<string name="default_disk">Set Default Disk</string>
|
||||
<string name="show_profiling_tools">Show BIOS Debug Tools</string>
|
||||
|
|
|
@ -92,6 +92,8 @@ import android.widget.SlidingDrawer.OnDrawerOpenListener;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.reicast.emulator.debug.GitAdapter;
|
||||
|
||||
public class AboutFragment extends Fragment {
|
||||
|
||||
SlidingDrawer slidingGithub;
|
||||
|
|
|
@ -40,6 +40,8 @@ import android.widget.TextView;
|
|||
import android.widget.Toast;
|
||||
|
||||
import com.android.util.FileUtils;
|
||||
import com.reicast.emulator.config.OptionsFragment;
|
||||
import com.reicast.emulator.emu.JNIdc;
|
||||
|
||||
public class FileBrowser extends Fragment {
|
||||
|
||||
|
|
|
@ -29,6 +29,12 @@ import com.android.util.DreamTime;
|
|||
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
|
||||
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnOpenListener;
|
||||
import com.jeremyfeinstein.slidingmenu.lib.app.SlidingFragmentActivity;
|
||||
import com.reicast.emulator.config.ConfigureFragment;
|
||||
import com.reicast.emulator.config.InputFragment;
|
||||
import com.reicast.emulator.config.OptionsFragment;
|
||||
import com.reicast.emulator.debug.GenerateLogs;
|
||||
import com.reicast.emulator.emu.GL2JNIActivity;
|
||||
import com.reicast.emulator.emu.JNIdc;
|
||||
|
||||
public class MainActivity extends SlidingFragmentActivity implements
|
||||
FileBrowser.OnItemSelectedListener, OptionsFragment.OnClickListener {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.config;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
@ -34,6 +34,11 @@ import android.widget.TextView;
|
|||
import android.widget.Toast;
|
||||
|
||||
import com.android.util.DreamTime;
|
||||
import com.reicast.emulator.MainActivity;
|
||||
import com.reicast.emulator.R;
|
||||
import com.reicast.emulator.debug.GenerateLogs;
|
||||
import com.reicast.emulator.emu.GL2JNIView;
|
||||
import com.reicast.emulator.emu.JNIdc;
|
||||
|
||||
import de.ankri.views.Switch;
|
||||
|
||||
|
@ -140,6 +145,24 @@ public class ConfigureFragment extends Fragment {
|
|||
}
|
||||
force_software_opt.setOnCheckedChangeListener(force_software);
|
||||
|
||||
Switch sound_opt = (Switch) getView().findViewById(
|
||||
R.id.sound_option);
|
||||
OnCheckedChangeListener emu_sound = new OnCheckedChangeListener() {
|
||||
|
||||
public void onCheckedChanged(CompoundButton buttonView,
|
||||
boolean isChecked) {
|
||||
mPrefs.edit().putBoolean("sound_enabled", isChecked).commit();
|
||||
}
|
||||
};
|
||||
boolean sound = mPrefs.getBoolean("sound_enabled",
|
||||
true);
|
||||
if (sound) {
|
||||
sound_opt.setChecked(true);
|
||||
} else {
|
||||
sound_opt.setChecked(false);
|
||||
}
|
||||
sound_opt.setOnCheckedChangeListener(emu_sound);
|
||||
|
||||
OnCheckedChangeListener dynarec_options = new OnCheckedChangeListener() {
|
||||
|
||||
public void onCheckedChanged(CompoundButton buttonView,
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.config;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
|
@ -18,6 +18,13 @@ import android.widget.LinearLayout;
|
|||
import android.widget.PopupWindow;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.reicast.emulator.MainActivity;
|
||||
import com.reicast.emulator.R;
|
||||
import com.reicast.emulator.emu.GL2JNIView;
|
||||
import com.reicast.emulator.emu.JNIdc;
|
||||
import com.reicast.emulator.emu.OnScreenMenu;
|
||||
import com.reicast.emulator.emu.VJoy;
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
|
||||
public class EditVJoyActivity extends Activity {
|
||||
GL2JNIView mView;
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.config;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
|
@ -29,6 +29,9 @@ import com.bda.controller.Controller;
|
|||
import com.bda.controller.ControllerListener;
|
||||
import com.bda.controller.MotionEvent;
|
||||
import com.bda.controller.StateEvent;
|
||||
import com.reicast.emulator.MainActivity;
|
||||
import com.reicast.emulator.R;
|
||||
import com.reicast.emulator.emu.MOGAInput;
|
||||
|
||||
import de.ankri.views.Switch;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.config;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -29,6 +29,9 @@ import android.widget.CompoundButton.OnCheckedChangeListener;
|
|||
import android.widget.ImageView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.reicast.emulator.R;
|
||||
|
||||
import de.ankri.views.Switch;
|
||||
|
||||
public class InputModFragment extends Fragment {
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.config;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
@ -16,6 +16,9 @@ import android.view.ViewGroup;
|
|||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.reicast.emulator.MainActivity;
|
||||
import com.reicast.emulator.R;
|
||||
|
||||
public class OptionsFragment extends Fragment {
|
||||
|
||||
Activity parentActivity;
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.debug;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
|
@ -53,7 +53,7 @@
|
|||
* subject to to the terms and conditions of the Apache License, Version 2.0.
|
||||
*/
|
||||
|
||||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.debug;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -84,6 +84,7 @@ import com.nostra13.universalimageloader.core.DisplayImageOptions;
|
|||
import com.nostra13.universalimageloader.core.ImageLoader;
|
||||
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
|
||||
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
|
||||
import com.reicast.emulator.R;
|
||||
|
||||
public class GitAdapter extends BaseAdapter {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.debug;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
|
@ -22,6 +22,8 @@ import android.net.Uri;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
|
||||
import com.reicast.emulator.R;
|
||||
|
||||
|
||||
public class UploadLogs extends AsyncTask<String, Integer, Object> {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.emu;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
@ -23,9 +23,12 @@ import android.view.Window;
|
|||
import android.widget.PopupWindow;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.reicast.emulator.R;
|
||||
import com.reicast.emulator.config.ConfigureFragment;
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
|
||||
public class GL2JNIActivity extends Activity {
|
||||
GL2JNIView mView;
|
||||
public GL2JNIView mView;
|
||||
OnScreenMenu menu;
|
||||
PopupWindow popUp;
|
||||
MOGAInput moga = new MOGAInput();
|
||||
|
@ -470,13 +473,31 @@ public class GL2JNIActivity extends Activity {
|
|||
}
|
||||
|
||||
public void displayPopUp(PopupWindow popUp) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
popUp.showAtLocation(mView, Gravity.BOTTOM, 0, 60);
|
||||
} else {
|
||||
popUp.showAtLocation(mView, Gravity.BOTTOM, 0, 0);
|
||||
}
|
||||
popUp.update(LayoutParams.WRAP_CONTENT,
|
||||
LayoutParams.WRAP_CONTENT);
|
||||
}
|
||||
|
||||
public void displayDebug(PopupWindow popUpDebug) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
popUpDebug.showAtLocation(mView, Gravity.BOTTOM, 0, 60);
|
||||
} else {
|
||||
popUpDebug.showAtLocation(mView, Gravity.BOTTOM, 0, 0);
|
||||
}
|
||||
popUpDebug.update(LayoutParams.WRAP_CONTENT,
|
||||
LayoutParams.WRAP_CONTENT);
|
||||
}
|
||||
|
||||
public void displayConfig(PopupWindow popUpConfig) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
popUpConfig.showAtLocation(mView, Gravity.BOTTOM, 0, 60);
|
||||
} else {
|
||||
popUpConfig.showAtLocation(mView, Gravity.BOTTOM, 0, 0);
|
||||
}
|
||||
popUpConfig.update(LayoutParams.WRAP_CONTENT,
|
||||
LayoutParams.WRAP_CONTENT);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.emu;
|
||||
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
@ -28,6 +28,8 @@ import android.view.ScaleGestureDetector;
|
|||
import android.view.ScaleGestureDetector.SimpleOnScaleGestureListener;
|
||||
import android.view.View;
|
||||
|
||||
import com.reicast.emulator.MainActivity;
|
||||
|
||||
|
||||
/**
|
||||
* A simple GLSurfaceView sub-class that demonstrate how to perform
|
||||
|
@ -48,11 +50,11 @@ import android.view.View;
|
|||
* bit depths). Failure to do so would result in an EGL_BAD_MATCH error.
|
||||
*/
|
||||
|
||||
class GL2JNIView extends GLSurfaceView
|
||||
public class GL2JNIView extends GLSurfaceView
|
||||
{
|
||||
private static String fileName;
|
||||
//private AudioThread audioThread;
|
||||
private EmuThread ethd = new EmuThread();
|
||||
private EmuThread ethd;
|
||||
|
||||
public static final boolean DEBUG = false;
|
||||
|
||||
|
@ -104,9 +106,8 @@ class GL2JNIView extends GLSurfaceView
|
|||
Runtime.getRuntime().freeMemory();
|
||||
System.gc();
|
||||
|
||||
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
ethd = new EmuThread(prefs.getBoolean("sound_enabled", true));
|
||||
touchVibrationEnabled = prefs.getBoolean("touch_vibration_enabled", true);
|
||||
|
||||
int rederType = prefs.getInt("render_type", LAYER_TYPE_HARDWARE);
|
||||
|
@ -172,6 +173,7 @@ class GL2JNIView extends GLSurfaceView
|
|||
//configAudio(44100,250);
|
||||
|
||||
ethd.start();
|
||||
|
||||
}
|
||||
|
||||
public GLSurfaceView.Renderer getRenderer()
|
||||
|
@ -304,8 +306,11 @@ class GL2JNIView extends GLSurfaceView
|
|||
return -1; // Invalid
|
||||
}
|
||||
|
||||
static int[] kcode_raw = { 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF };
|
||||
static int[] lt = new int[4], rt = new int[4], jx = new int[4], jy = new int[4];
|
||||
public static int[] kcode_raw = { 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF };
|
||||
public static int[] lt = new int[4];
|
||||
public static int[] rt = new int[4];
|
||||
public static int[] jx = new int[4];
|
||||
public static int[] jy = new int[4];
|
||||
|
||||
float editLastX = 0, editLastY = 0;
|
||||
|
||||
|
@ -805,9 +810,15 @@ private static class ContextFactory implements GLSurfaceView.EGLContextFactory
|
|||
AudioTrack Player;
|
||||
long pos; //write position
|
||||
long size; //size in frames
|
||||
private boolean sound;
|
||||
|
||||
public EmuThread(boolean sound) {
|
||||
this.sound = sound;
|
||||
}
|
||||
|
||||
@Override public void run()
|
||||
{
|
||||
if (sound) {
|
||||
int min=AudioTrack.getMinBufferSize(44100,AudioFormat.CHANNEL_OUT_STEREO,AudioFormat.ENCODING_PCM_16BIT);
|
||||
|
||||
if (2048>min)
|
||||
|
@ -827,12 +838,14 @@ private static class ContextFactory implements GLSurfaceView.EGLContextFactory
|
|||
|
||||
Log.i("audcfg", "Audio streaming: buffer size " + min + " samples / " + min/44100.0 + " ms");
|
||||
Player.play();
|
||||
}
|
||||
|
||||
JNIdc.run(this);
|
||||
}
|
||||
|
||||
int WriteBuffer(short[] samples, int wait)
|
||||
{
|
||||
if (sound) {
|
||||
int newdata=samples.length/2;
|
||||
|
||||
if (wait==0)
|
||||
|
@ -850,6 +863,7 @@ private static class ContextFactory implements GLSurfaceView.EGLContextFactory
|
|||
pos+=newdata;
|
||||
|
||||
Player.write(samples, 0, samples.length);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.emu;
|
||||
|
||||
import javax.microedition.khronos.egl.EGL10;
|
||||
import javax.microedition.khronos.egl.EGLConfig;
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.emu;
|
||||
|
||||
|
||||
public class JNIdc
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.emu;
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -15,6 +15,7 @@ import com.bda.controller.ControllerListener;
|
|||
import com.bda.controller.KeyEvent;
|
||||
import com.bda.controller.MotionEvent;
|
||||
import com.bda.controller.StateEvent;
|
||||
import com.reicast.emulator.R;
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
@ -27,12 +28,12 @@ public class MOGAInput
|
|||
|
||||
static final int DELAY = 1000 / 50; // 50 Hz
|
||||
|
||||
static final int ACTION_CONNECTED = Controller.ACTION_CONNECTED;
|
||||
public static final int ACTION_CONNECTED = Controller.ACTION_CONNECTED;
|
||||
static final int ACTION_DISCONNECTED = Controller.ACTION_DISCONNECTED;
|
||||
static final int ACTION_VERSION_MOGA = Controller.ACTION_VERSION_MOGA;
|
||||
static final int ACTION_VERSION_MOGAPRO = Controller.ACTION_VERSION_MOGAPRO;
|
||||
|
||||
Controller mController = null;
|
||||
public Controller mController = null;
|
||||
private Handler handler;
|
||||
private String notify;
|
||||
|
||||
|
@ -107,7 +108,7 @@ public class MOGAInput
|
|||
*/
|
||||
}
|
||||
|
||||
protected void onCreate(Activity act)
|
||||
public void onCreate(Activity act)
|
||||
{
|
||||
this.act = act;
|
||||
|
||||
|
@ -120,17 +121,17 @@ public class MOGAInput
|
|||
mController.setListener(new ExampleControllerListener(), new Handler());
|
||||
}
|
||||
|
||||
protected void onDestroy()
|
||||
public void onDestroy()
|
||||
{
|
||||
mController.exit();
|
||||
}
|
||||
|
||||
protected void onPause()
|
||||
public void onPause()
|
||||
{
|
||||
mController.onPause();
|
||||
}
|
||||
|
||||
protected void onResume()
|
||||
public void onResume()
|
||||
{
|
||||
mController.onResume();
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.emu;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
@ -15,6 +15,10 @@ import android.widget.ImageView.ScaleType;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.PopupWindow;
|
||||
|
||||
import com.reicast.emulator.MainActivity;
|
||||
import com.reicast.emulator.R;
|
||||
import com.reicast.emulator.config.ConfigureFragment;
|
||||
|
||||
public class OnScreenMenu {
|
||||
|
||||
private GL2JNIActivity mContext;
|
||||
|
@ -40,7 +44,7 @@ public class OnScreenMenu {
|
|||
}
|
||||
}
|
||||
|
||||
PopupWindow createPopup() {
|
||||
public PopupWindow createPopup() {
|
||||
final PopupWindow popUp = new PopupWindow(mContext);
|
||||
|
||||
int p = getPixelsFromDp(60, mContext);
|
||||
|
@ -60,41 +64,13 @@ public class OnScreenMenu {
|
|||
|
||||
if (prefs.getBoolean("debug_profling_tools", false)) {
|
||||
|
||||
hlay.addView(addbut(R.drawable.clear_cache, new OnClickListener() {
|
||||
hlay.addView(addbut(R.drawable.disk_unknown, new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
JNIdc.send(0, 0); // Killing texture cache
|
||||
displayDebugPopup(popUp);
|
||||
popUp.dismiss();
|
||||
}
|
||||
}), params);
|
||||
|
||||
hlay.addView(addbut(R.drawable.profiler, new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
JNIdc.send(1, 3000); // sample_Start(param);
|
||||
popUp.dismiss();
|
||||
}
|
||||
}), params);
|
||||
|
||||
hlay.addView(addbut(R.drawable.profiler, new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
JNIdc.send(1, 0); // sample_Start(param);
|
||||
popUp.dismiss();
|
||||
}
|
||||
}), params);
|
||||
|
||||
// hlay.addView(addbut(R.drawable.disk_unknown, new
|
||||
// OnClickListener() {
|
||||
// public void onClick(View v) {
|
||||
// JNIdc.send(0, 1); //settings.pvr.ta_skip
|
||||
// popUp.dismiss();
|
||||
// }
|
||||
// }), params);
|
||||
|
||||
hlay.addView(addbut(R.drawable.print_stats, new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
JNIdc.send(0, 2);
|
||||
popUp.dismiss(); // print_stats=true;
|
||||
}
|
||||
}), params);
|
||||
}
|
||||
hlay.addView(addbut(R.drawable.vmu_swap, new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
|
@ -115,7 +91,68 @@ public class OnScreenMenu {
|
|||
return popUp;
|
||||
}
|
||||
|
||||
void displayDebugPopup(final PopupWindow popUp) {
|
||||
final PopupWindow popUpDebug = new PopupWindow(mContext);
|
||||
|
||||
int p = getPixelsFromDp(60, mContext);
|
||||
LayoutParams debugParams = new LayoutParams(p, p);
|
||||
|
||||
LinearLayout hlay = new LinearLayout(mContext);
|
||||
|
||||
hlay.setOrientation(LinearLayout.HORIZONTAL);
|
||||
|
||||
hlay.addView(addbut(R.drawable.close, new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
popUpDebug.dismiss();
|
||||
}
|
||||
}), debugParams);
|
||||
|
||||
hlay.addView(addbut(R.drawable.clear_cache, new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
JNIdc.send(0, 0); // Killing texture cache
|
||||
popUpDebug.dismiss();
|
||||
}
|
||||
}), debugParams);
|
||||
|
||||
hlay.addView(addbut(R.drawable.profiler, new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
JNIdc.send(1, 3000); // sample_Start(param);
|
||||
popUpDebug.dismiss();
|
||||
}
|
||||
}), debugParams);
|
||||
|
||||
hlay.addView(addbut(R.drawable.profiler, new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
JNIdc.send(1, 0); // sample_Start(param);
|
||||
popUpDebug.dismiss();
|
||||
}
|
||||
}), debugParams);
|
||||
|
||||
// hlay.addView(addbut(R.drawable.disk_unknown, new
|
||||
// OnClickListener() {
|
||||
// public void onClick(View v) {
|
||||
// JNIdc.send(0, 1); //settings.pvr.ta_skip
|
||||
// popUp.dismiss();
|
||||
// }
|
||||
// }), debugParams);
|
||||
|
||||
hlay.addView(addbut(R.drawable.print_stats, new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
JNIdc.send(0, 2);
|
||||
popUpDebug.dismiss(); // print_stats=true;
|
||||
}
|
||||
}), debugParams);
|
||||
|
||||
hlay.addView(addbut(R.drawable.up, new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
popUpDebug.dismiss();
|
||||
mContext.displayPopUp(popUp);
|
||||
}
|
||||
}), debugParams);
|
||||
|
||||
popUpDebug.setContentView(hlay);
|
||||
mContext.displayDebug(popUpDebug);
|
||||
}
|
||||
|
||||
void displayConfigPopup(final PopupWindow popUp) {
|
||||
final PopupWindow popUpConfig = new PopupWindow(mContext);
|
||||
|
@ -132,6 +169,7 @@ public class OnScreenMenu {
|
|||
popUpConfig.dismiss();
|
||||
}
|
||||
}), configParams);
|
||||
|
||||
View fullscreen;
|
||||
if (!widescreen) {
|
||||
fullscreen = addbut(R.drawable.widescreen, new OnClickListener() {
|
||||
|
@ -151,6 +189,7 @@ public class OnScreenMenu {
|
|||
});
|
||||
}
|
||||
hlay.addView(fullscreen, params);
|
||||
|
||||
View frames_up = addbut(R.drawable.frames_up, new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
frameskip++;
|
||||
|
@ -161,6 +200,7 @@ public class OnScreenMenu {
|
|||
}
|
||||
});
|
||||
hlay.addView(frames_up, params);
|
||||
|
||||
if (frameskip >= 5) {
|
||||
frames_up.setEnabled(false);
|
||||
}
|
||||
|
@ -177,6 +217,7 @@ public class OnScreenMenu {
|
|||
if (frameskip <= 0) {
|
||||
frames_down.setEnabled(false);
|
||||
}
|
||||
|
||||
View framelimit;
|
||||
if (!limitframes) {
|
||||
framelimit = addbut(R.drawable.frames_limit_on,
|
||||
|
@ -198,6 +239,8 @@ public class OnScreenMenu {
|
|||
});
|
||||
}
|
||||
hlay.addView(framelimit, params);
|
||||
|
||||
if (prefs.getBoolean("sound_enabled", true)) {
|
||||
View audiosetting;
|
||||
if (!audiodisabled) {
|
||||
audiosetting = addbut(R.drawable.mute_sound,
|
||||
|
@ -219,6 +262,8 @@ public class OnScreenMenu {
|
|||
});
|
||||
}
|
||||
hlay.addView(audiosetting, params);
|
||||
}
|
||||
|
||||
hlay.addView(addbut(R.drawable.up, new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
popUpConfig.dismiss();
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.emu;
|
||||
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.reicast.emulator;
|
||||
package com.reicast.emulator.emu;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
Loading…
Reference in New Issue