<html>
<body>
  <div id="body" style="background-color:#ffffff;" >
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head" style="border-bottom-width:1px;border-bottom-style:solid;" ><td class="headtd" style="padding:0;padding-top:.2em;" colspan="4">Commit in <b><tt>lxdream</tt></b></td></tr>
<tr><td><tt>android/src/org/lxdream/<a href="#file1">Dreamcast.java</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+1</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-1</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">67909902ede9 -> 7f28eb5b815a</td></tr>
<tr class="alt" style=";" ><td><tt>                       /<a href="#file2">LxdreamActivity.java</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+4</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-1</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">67909902ede9 -> 7f28eb5b815a</td></tr>
<tr><td><tt>                       /<a href="#file3">LxdreamView.java</a></tt></td><td></td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-1</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">67909902ede9 -> 7f28eb5b815a</td></tr>
<tr class="alt" style=";" ><td><tt>src/<a href="#file4">gui_jni.c</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+22</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-5</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">67909902ede9 -> 7f28eb5b815a</td></tr>
<tr><td><tt>   /<a href="#file5">lxpaths.h</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+5</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">67909902ede9 -> 7f28eb5b815a</td></tr>
<tr class="alt" style=";" ><td><tt>   /<a href="#file6">paths_unix.c</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+11</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">67909902ede9 -> 7f28eb5b815a</td></tr>
<tr><td></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+43</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-8</td><td></td></tr>
</table>
<small id="info" style="color: #888888;" >6 modified files</small><br />
<pre class="comment" style="white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd;" >
Merge
</pre>
<hr /><a name="file1" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/android/src/org/lxdream</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>Dreamcast.java</b></big> <small id="info" style="color: #888888;" >67909902ede9 -> 7f28eb5b815a</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/android/src/org/lxdream/Dreamcast.java
+++ lxdream/android/src/org/lxdream/Dreamcast.java
@@ -25,7 +25,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >      }
 
      /* Core emulation */
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-     public static native void init();
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+     public static native void init(<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" > String appHome </span>);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >      public static native void setViewSize(int width, int height);
      public static native void run();
      public static native void stop();
</pre></div>
<hr /><a name="file2" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/android/src/org/lxdream</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>LxdreamActivity.java</b></big> <small id="info" style="color: #888888;" >67909902ede9 -> 7f28eb5b815a</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/android/src/org/lxdream/LxdreamActivity.java
+++ lxdream/android/src/org/lxdream/LxdreamActivity.java
@@ -19,6 +19,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > package org.lxdream;
 
 import android.app.Activity;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+import android.content.Context;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > import android.os.Bundle;
 import android.util.Log;
 import android.view.WindowManager;
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -32,7 +33,9 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     @Override 
     protected void onCreate(Bundle bundle) {
         super.onCreate(bundle);
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        view = new LxdreamView(getApplication());
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        Context ctx = getApplication();
+        Dreamcast.init( ctx.getFilesDir().toString() );
+        view = new LxdreamView(ctx);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         setContentView(view);
     }
 
</pre></div>
<hr /><a name="file3" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/android/src/org/lxdream</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>LxdreamView.java</b></big> <small id="info" style="color: #888888;" >67909902ede9 -> 7f28eb5b815a</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/android/src/org/lxdream/LxdreamView.java
+++ lxdream/android/src/org/lxdream/LxdreamView.java
@@ -139,7 +139,6 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         }
 
         public void onSurfaceChanged(GL10 gl, int width, int height) {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-            Dreamcast.init();
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             Dreamcast.setViewSize(width,height);
         }
 
</pre></div>
<hr /><a name="file4" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>gui_jni.c</b></big> <small id="info" style="color: #888888;" >67909902ede9 -> 7f28eb5b815a</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/gui_jni.c
+++ lxdream/src/gui_jni.c
@@ -22,16 +22,33 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #include "dreamcast.h"
 #include "gui.h"
 #include "config.h"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+#include "lxpaths.h"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #include "display.h"
 #include "gdlist.h"
 #include "hotkeys.h"
 #include "serial.h"
 #include "aica/audio.h"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+#include "drivers/video_gl.h"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #include "maple/maple.h"
 #include "vmu/vmulist.h"
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_init(JNIEnv * env, jobject obj,  jint width, jint height)
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+static char *getStringChars( JNIEnv *env, jstring str )
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    jboolean iscopy;
+    const char *p = (*env)->GetStringUTFChars(env, str, &iscopy);
+    char *result = strdup(p);
+    (*env)->ReleaseStringUTFChars(env,str,p);
+    return result;
+}
+
+static const char *appHome = NULL;
+
+JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_init(JNIEnv * env, jclass obj,  jstring homeDir )
+{
+    appHome = getStringChars(env, homeDir);
+    const char *confFile = g_strdup_printf("%s/lxdreamrc", appHome);
+    set_user_data_path(appHome);
+    lxdream_set_config_filename( confFile );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     lxdream_make_config_dir( );
     lxdream_load_config( );
     iso_init();
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -49,17 +66,17 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     INFO( "%s! ready...", APP_NAME );
 }
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_setViewSize(JNIEnv * env, j<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >object</span> obj, jint width, jint height)
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_setViewSize(JNIEnv * env, j<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >class</span> obj, jint width, jint height)
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    gl_set_video_size(width, height);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_run(JNIEnv * env, j<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >object</span> obj)
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_run(JNIEnv * env, j<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >class</span> obj)
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
     dreamcast_run();
 }
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_stop(JNIEnv * env, j<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >object</span> obj)
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_stop(JNIEnv * env, j<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >class</span> obj)
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
     dreamcast_stop();
 }
</pre></div>
<hr /><a name="file5" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>lxpaths.h</b></big> <small id="info" style="color: #888888;" >67909902ede9 -> 7f28eb5b815a</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/lxpaths.h
+++ lxdream/src/lxpaths.h
@@ -42,6 +42,11 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >  */
 const char *get_user_data_path();
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+/**
+ * Set the user data path
+ */
+void set_user_data_path( const char *p );
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > /******************** Path helpers *****************/
 
 /**
</pre></div>
<hr /><a name="file6" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>paths_unix.c</b></big> <small id="info" style="color: #888888;" >67909902ede9 -> 7f28eb5b815a</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/paths_unix.c
+++ lxdream/src/paths_unix.c
@@ -47,4 +47,15 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         user_data_path = g_strdup_printf( "%s/.lxdream", home );
     }
     return user_data_path;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+}
+
+void set_user_data_path( const char *p ) 
+{
+    g_free(user_data_path);
+    user_data_path = g_strdup(p);
+}
+
+const char *get_user_home_path()
+{
+    return getenv("HOME");
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >\ No newline at end of file
</small></pre></div>
<center><small>Chaos Theory</small></center>
</div></body></html>