<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><a href="#file1">Makefile.am</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+3</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-2</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt><a href="#file2">Makefile.in</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">-2</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr><td><tt>android/<a href="#file3">AndroidManifest.xml</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+2</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-2</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt>       /<a href="#file4">build.xml</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+37</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-31</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr><td><tt>android/gen/org/lxdream/<a href="#file5">R.java</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+18</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">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt>android/res/drawable/tb_cdrom.png</tt></td><td colspan="2" align="center"><small id="info" style="color: #888888;" >[empty]</small></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr><td><tt>                    /tb_preferences.png</tt></td><td colspan="2" align="center"><small id="info" style="color: #888888;" >[empty]</small></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt>                    /tb_reset.png</tt></td><td colspan="2" align="center"><small id="info" style="color: #888888;" >[empty]</small></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr><td><tt>                    /tb_run.png</tt></td><td colspan="2" align="center"><small id="info" style="color: #888888;" >[empty]</small></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt>android/res/menu/<a href="#file10"><span id="addedalt" style="background-color:#ccf7cc;" >main.xml</span></a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+17</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" align="right" nowrap="nowrap">added 01e0020adf88</td></tr>
<tr><td><tt>android/res/values/<a href="#file11">strings.xml</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+3</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt>android/src/org/lxdream/<a href="#file12">Dreamcast.java</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+10</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-11</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr><td><tt>                       /<a href="#file13">LxdreamActivity.java</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+27</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-2</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt>                       /<a href="#file14">LxdreamView.java</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+20</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-95</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr><td><tt><a href="#file15">configure</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+29</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-18</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt><a href="#file16">configure.in</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+9</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-11</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr><td><tt>m4/<a href="#file17">android.m4</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+7</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-4</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt>src/<a href="#file18">Makefile.am</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+2</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-2</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr><td><tt>   /<a href="#file19">Makefile.in</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+36</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-15</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt>   /<a href="#file20">display.c</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+2</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">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr><td><tt>   /<a href="#file21">display.h</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+1</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt>src/drivers/<a href="#file22">gl_fbo.c</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+3</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-2</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr><td><tt>           /<a href="#file23"><span id="added" style="background-color:#ddffdd;" >video_egl.c</span></a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+168</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" align="right" nowrap="nowrap">added 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt>           /<a href="#file24"><span id="addedalt" style="background-color:#ccf7cc;" >video_egl.h</span></a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+38</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" align="right" nowrap="nowrap">added 01e0020adf88</td></tr>
<tr><td><tt>src/<a href="#file25"><span id="added" style="background-color:#ddffdd;" >gui_android.c</span></a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+331</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" align="right" nowrap="nowrap">added 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt>   /<a href="#file26"><span id="removedalt" style="background-color:#f7cccc;" >gui_jni.c</span></a></tt></td><td></td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-120</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 removed</td></tr>
<tr><td><tt>src/pvr2/<a href="#file27">glutil.c</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+8</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt>        /<a href="#file28">glutil.h</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+14</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr><td><tt>src/tools/<a href="#file29">Makefile.in</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+1</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">6b54ef5ed413 -> 01e0020adf88</td></tr>
<tr class="alt" style=";" ><td><tt>src/<a href="#file30"><span id="addedalt" style="background-color:#ccf7cc;" >tqueue.c</span></a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+137</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" align="right" nowrap="nowrap">added 01e0020adf88</td></tr>
<tr><td><tt>   /<a href="#file31"><span id="added" style="background-color:#ddffdd;" >tqueue.h</span></a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+62</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" align="right" nowrap="nowrap">added 01e0020adf88</td></tr>
<tr><td></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+989</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-319</td><td></td></tr>
</table>
<small id="info" style="color: #888888;" >6 added + 1 removed + 24 modified, total 31 files</small><br />
<div class="tasklist" style="padding:4px;border:1px dashed #000000;margin-top:1em;" ><ul>
<li><a href="#task1">TODO */</a></li>
<li><a href="#task2">TODO: Report error */</a></li>
<li><a href="#task3">TODO */</a></li>
<li><a href="#task4">TODO */</a></li>
<li><a href="#task5">TODO */</a></li>
</ul></div>
<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;" >
Android WIP:
 * Rename gui_jni.c to gui_android.c - now quite android specific.
 * Implement generic EGL driver with very minimal Java wrapper
 * Run emulation in separate thread, and implement simple queue for
   inter-thread communication.
 * Add menu/action-bar items for start + reset
</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</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>Makefile.am</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/Makefile.am
+++ lxdream/Makefile.am
@@ -100,7 +100,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > bundle: all
 
 if GUI_ANDROID
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-Lxdream-debug.apk: src/liblxdream.so
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+apk: src/liblxdream.so
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >    $(mkdir_p) android/libs/armeabi
        $(INSTALL) src/liblxdream.so android/libs/armeabi/liblxdream.so
        $(INSTALL) $(ANDROID_GDBSERVER) android/libs/armeabi/gdbserver
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -109,8 +109,9 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >          $(ANT) -buildfile build.xml -Dsdk.dir=$(ANDROID_SDK_HOME) \
               -Dout.dir="$$TARGETDIR" \
               -Dnative.libs.dir="$$TARGETDIR/libs" \
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+            -Dnative.libs.absolute.dir="$$TARGETDIR/libs" \
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >           -Dtarget=$(ANDROID_SDK_VERSION) debug )
        cp android/Lxdream-debug.apk Lxdream-debug.apk
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-all-local: Lxdream-debug.apk
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+all-local: apk
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > endif
</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</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>Makefile.in</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/Makefile.in
+++ lxdream/Makefile.in
@@ -96,6 +96,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > AMTAR = @AMTAR@
 ANDROID_GDBSERVER = @ANDROID_GDBSERVER@
 ANDROID_NDK_HOME = @ANDROID_NDK_HOME@
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ANDROID_NDK_VERSION = @ANDROID_NDK_VERSION@
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > ANDROID_SDK_HOME = @ANDROID_SDK_HOME@
 ANDROID_SDK_VERSION = @ANDROID_SDK_VERSION@
 ANT = @ANT@
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -889,7 +890,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 bundle: all
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-@GUI_ANDROID_TRUE@<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >Lxdream-debug.</span>apk: src/liblxdream.so
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+@GUI_ANDROID_TRUE@apk: src/liblxdream.so
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @GUI_ANDROID_TRUE@ $(mkdir_p) android/libs/armeabi
 @GUI_ANDROID_TRUE@     $(INSTALL) src/liblxdream.so android/libs/armeabi/liblxdream.so
 @GUI_ANDROID_TRUE@     $(INSTALL) $(ANDROID_GDBSERVER) android/libs/armeabi/gdbserver
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -898,10 +899,11 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @GUI_ANDROID_TRUE@       $(ANT) -buildfile build.xml -Dsdk.dir=$(ANDROID_SDK_HOME) \
 @GUI_ANDROID_TRUE@            -Dout.dir="$$TARGETDIR" \
 @GUI_ANDROID_TRUE@            -Dnative.libs.dir="$$TARGETDIR/libs" \
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+@GUI_ANDROID_TRUE@          -Dnative.libs.absolute.dir="$$TARGETDIR/libs" \
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @GUI_ANDROID_TRUE@        -Dtarget=$(ANDROID_SDK_VERSION) debug )
 @GUI_ANDROID_TRUE@     cp android/Lxdream-debug.apk Lxdream-debug.apk
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-@GUI_ANDROID_TRUE@all-local: <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >Lxdream-debug.</span>apk
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+@GUI_ANDROID_TRUE@all-local: apk
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
</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</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>AndroidManifest.xml</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/android/AndroidManifest.xml
+++ lxdream/android/AndroidManifest.xml
@@ -2,8 +2,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.lxdream">
     <application android:label="@string/lxdream_activity">
         <activity android:name="LxdreamActivity"
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-                android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >                    android:launchMode="singleTask"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+             android:theme="@android:style/Theme.Holo"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >                    android:configChanges="orientation|keyboardHidden">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -12,5 +12,5 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         </activity>
     </application>
     <uses-feature android:glEsVersion="0x00020000"/>
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    <uses-sdk android:minSdkVersion="<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >8</span>"/>
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    <uses-sdk android:minSdkVersion="<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >11</span>"/>
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > </manifest>
</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/android</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>build.xml</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/android/build.xml
+++ lxdream/android/build.xml
@@ -1,15 +1,14 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > <?xml version="1.0" encoding="UTF-8"?>
 <project name="Lxdream" default="help">
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-<!-- The local.properties file is created and updated by the 'android'
-     tool.
-     It contains the path to the SDK. It should *NOT* be checked into
-     Version Control Systems. -->
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    <!-- The local.properties file is created and updated by the 'android' tool.
+         It contains the path to the SDK. It should *NOT* be checked into
+         Version Control Systems. -->
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     <property file="local.properties" />
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    <!-- The build.properties file can be created by you and is never touched
-         by the 'android' tool. This is the place to change some of the
-         default property values used by the Ant rules.
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    <!-- The ant.properties file can be created by you. It is only edited by the
+         'android' tool to add properties to it.
+         This is the place to change some Ant specific build properties.
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >          Here are some properties you may want to change/update:
 
          source.dir
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -17,6 +16,9 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >          out.dir
              The name of the output directory. Default is 'bin'.
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+         For other overridable properties, look at the beginning of the rules
+         files in the SDK, at tools/ant/build.xml
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >          Properties related to the SDK location or the project target should
          be updated using the 'android' tool with the 'update' action.
 
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -24,17 +26,24 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >          application and should be checked into Version Control Systems.
 
          -->
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    <property file="<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >build</span>.properties" />
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    <property file="<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >ant</span>.properties" />
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    <!-- The <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >defaul</span>t.properties file is created and updated by the 'android'
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    <!-- The <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >projec</span>t.properties file is created and updated by the 'android'
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >          tool, as well as ADT.
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+
+         This contains project specific properties such as project target, and library
+         dependencies. Lower level build properties are stored in ant.properties
+         (or in .classpath for Eclipse projects).
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >          This file is an integral part of the build system for your
          application and should be checked into Version Control Systems. -->
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    <property file="default.properties" />
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    <loadproperties srcFile="project.properties" />
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-
-    <!-- Required pre-setup import -->
-    <import file="${sdk.dir}/tools/ant/pre_setup.xml" />
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    <!-- quick check on sdk.dir -->
+    <fail
+            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
+            unless="sdk.dir"
+    />
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 
 <!-- extension targets. Uncomment the ones where you want to do custom work
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -45,35 +54,32 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     <target name="-pre-compile">
     </target>
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    [This is typically used for code obfuscation.
-     Compiled code location: ${out.classes.absolute.dir}
-     If this is not done in place, override ${out.dex.input.absolute.dir}]
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    /* This is typically used for code obfuscation.
+       Compiled code location: ${out.classes.absolute.dir}
+       If this is not done in place, override ${out.dex.input.absolute.dir} */
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     <target name="-post-compile">
     </target>
 -->
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    <!-- Execute the Android Setup task that will setup some properties
-         specific to the target, and import the build rules files.
-
-         The rules file is imported from
-            <SDK>/tools/ant/
-         Depending on the project type it can be either:
-         - main_rules.xml
-         - lib_rules.xml
-         - test_rules.xml
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    <!-- Import the actual build file.
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
          To customize existing targets, there are two options:
          - Customize only one target:
              - copy/paste the target into this file, *before* the
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-               <<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >setup</span>> task.
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+               <<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >import</span>> task.
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >              - customize it to your needs.
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-         - Customize the whole script.
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+         - Customize the whole content of build.xml
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >              - copy/paste the content of the rules files (minus the top node)
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-               into this file, *after* the <setup> task
-             - disable the import of the rules by changing the setup task
-               below to <setup import="false" />.
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+               into this file, replacing the <import> task.
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >              - customize to your needs.
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+
+         ***********************
+         ****** IMPORTANT ******
+         ***********************
+         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+         in order to avoid having your file be overridden by tools such as "android update project"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     -->
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    <setup />
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    <!-- version-tag: 1 -->
+    <import file="${sdk.dir}/tools/ant/build.xml" />
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 </project>
</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/android/gen/org/lxdream</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>R.java</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/android/gen/org/lxdream/R.java
+++ lxdream/android/gen/org/lxdream/R.java
@@ -10,7 +10,24 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > public final class R {
     public static final class attr {
     }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    public static final class drawable {
+        public static final int tb_cdrom=0x7f020000;
+        public static final int tb_preferences=0x7f020001;
+        public static final int tb_reset=0x7f020002;
+        public static final int tb_run=0x7f020003;
+    }
+    public static final class id {
+        public static final int menu_reset=0x7f050001;
+        public static final int menu_run=0x7f050000;
+        public static final int menu_settings=0x7f050002;
+    }
+    public static final class menu {
+        public static final int main=0x7f040000;
+    }
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     public static final class string {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        public static final int lxdream_activity=0x7f0<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >2</span>0000;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        public static final int lxdream_activity=0x7f0<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >3</span>0000;
+        public static final int menu_preferences=0x7f030003;
+        public static final int menu_reset=0x7f030002;
+        public static final int menu_run=0x7f030001;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     }
 }
</pre></div>
<hr /><a name="file10" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span id="added" class="pathname" style="font-family:monospace; float:right; background-color:#ddffdd;" >lxdream/android/res/menu</span><br />
<div id="added" class="fileheader" style="margin-bottom:.5em; background-color:#ddffdd;" ><big><b>main.xml</b></big> <small id="info" style="color: #888888;" >added at 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/android/res/menu/main.xml
+++ lxdream/android/res/menu/main.xml
@@ -0,0 +1,17 @@
</small></pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:id="@+id/menu_run"
+        android:icon="@drawable/tb_run"
+        android:onClick="onRunClicked"
+        android:title="@string/menu_run"
+        android:showAsAction="always" />
+    <item android:id="@+id/menu_reset"
+        android:icon="@drawable/tb_reset"
+        android:onClick="onResetClicked"
+        android:title="@string/menu_reset"
+        android:showAsAction="always" />
+    <item android:id="@+id/menu_settings"
+        android:icon="@drawable/tb_preferences"
+        android:onClick="onPreferencesClicked"
+        android:title="@string/menu_preferences"
+        android:showAsAction="never" />
+</menu>
</pre></div>
<hr /><a name="file11" /><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/res/values</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>strings.xml</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/android/res/values/strings.xml
+++ lxdream/android/res/values/strings.xml
@@ -1,4 +1,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <string name="lxdream_activity">Lxdream</string>
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    <string name="menu_run">Run</string>
+    <string name="menu_reset">Reset</string>
+    <string name="menu_preferences">Preferences</string>
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > </resources>
</pre></div>
<hr /><a name="file12" /><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;" >6b54ef5ed413 -> 01e0020adf88</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
@@ -26,14 +26,18 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
      /* Core emulation */
      public static native void init( String appHome );
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-     public static native void setViewSize(int width, int height);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >      public static native void run();
      public static native void stop();
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-     /*
-     public static native void start();
-     public static native void run_slice();
-     public static boolean canRun();
-*/
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+     public static native void reset();
+     public static native void toggleRun();
+     public static native boolean isRunnable();
+     public static native boolean isRunning();
+
+     /* GD-Rom */
+     public static native boolean mount( String filename );
+     public static native void unmount();
+
+     
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >      /* Save state management */
 /*     public static native boolean saveState( String filename );
      public static native boolean loadState( String filename );
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -41,9 +45,4 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >      public static native boolean quickLoad();
      public static native void setQuickState(int state);
   */   
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-     /* GD-Rom */
-/*     public static native boolean mount_disc( String filename );
-     public static native void unmount_disc();
-  */   
-     /* ... */
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
</pre></div>
<hr /><a name="file13" /><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;" >6b54ef5ed413 -> 01e0020adf88</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
@@ -22,6 +22,9 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > import android.content.Context;
 import android.os.Bundle;
 import android.util.Log;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > import android.view.WindowManager;
 
 import java.io.File;
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -34,20 +37,42 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     protected void onCreate(Bundle bundle) {
         super.onCreate(bundle);
         Context ctx = getApplication();
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        
+        Log.i("LxdreamActivity", "Calling Dreamcast.init");
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         Dreamcast.init( ctx.getFilesDir().toString() );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        Log.i("LxdreamActivity", "Finished Dreamcast.init");
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         view = new LxdreamView(ctx);
         setContentView(view);
     }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        MenuInflater inflater = getMenuInflater();
+        inflater.inflate(R.menu.main, menu);
+        return true;
+    }
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
     @Override 
     protected void onPause() {
         super.onPause();
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        view.onPause();
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        Dreamcast.stop();
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     }
 
     @Override 
     protected void onResume() {
         super.onResume();
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        view.onResume();
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    }
+    
+    public void onRunClicked( MenuItem item ) {
+       Dreamcast.toggleRun();
+    }
+    
+    public void onResetClicked( MenuItem item ) {
+       Dreamcast.reset();
+    }
+    
+    public void onPreferencesClicked( MenuItem item ) {
<a name="task1" />+     /* <span class="task" style="background-color:#ffff00;" >TODO</span> */
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     }
 }
</pre></div>
<hr /><a name="file14" /><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;" >6b54ef5ed413 -> 01e0020adf88</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
@@ -36,114 +36,39 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 import android.content.Context;
 import android.graphics.PixelFormat;
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-import android.opengl.GLSurfaceView;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > import android.util.AttributeSet;
 import android.util.Log;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+import android.view.Surface;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.egl.EGLContext;
-import javax.microedition.khronos.egl.EGLDisplay;
-import javax.microedition.khronos.opengles.GL10;
-
-/**
- * A simple GLSurfaceView sub-class that demonstrate how to perform
- * OpenGL ES 2.0 rendering into a GL Surface. Note the following important
- * details:
- *
- * - The class must use a custom context factory to enable 2.0 rendering.
- *   See ContextFactory class definition below.
- *
- * - The class must use a custom EGLConfigChooser to be able to select
- *   an EGLConfig that supports 2.0. This is done by providing a config
- *   specification to eglChooseConfig() that has the attribute
- *   EGL10.ELG_RENDERABLE_TYPE containing the EGL_OPENGL_ES2_BIT flag
- *   set. See ConfigChooser class definition below.
- *
- * - The class must select the surface's format, then choose an EGLConfig
- *   that matches it exactly (with regards to red/green/blue/alpha channels
- *   bit depths). Failure to do so would result in an EGL_BAD_MATCH error.
- */
-class LxdreamView extends GLSurfaceView {
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+class LxdreamView extends SurfaceView implements SurfaceHolder.Callback {
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     private static String TAG = "LxdreamView";
     private static final boolean DEBUG = false;
 
     public LxdreamView(Context context) {
         super(context);
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        init(false, 0, 0);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        getHolder().addCallback(this);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     }
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    public LxdreamView(Context context, boolean translucent, int depth, int stencil) {
-        super(context);
-        init(translucent, depth, stencil);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    @Override
+    public void surfaceCreated( SurfaceHolder holder ) {
+       /* Ignore */
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     }
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-
-    private void init(boolean translucent, int depth, int stencil) {
-
-        /* By default, GLSurfaceView() creates a RGB_565 opaque surface.
-         * If we want a translucent one, we should change the surface's
-         * format here, using PixelFormat.TRANSLUCENT for GL Surfaces
-         * is interpreted as any 32-bit surface with alpha by SurfaceFlinger.
-         */
-        if (translucent) {
-            this.getHolder().setFormat(PixelFormat.TRANSLUCENT);
-        }
-
-        /* Setup the context factory for 2.0 rendering.
-         * See ContextFactory class definition below
-         */
-        setEGLContextFactory(new ContextFactory());
-
-        /* We need to choose an EGLConfig that matches the format of
-         * our surface exactly. This is going to be done in our
-         * custom config chooser. See ConfigChooser class definition
-         * below.
-         */
-        setEGLConfigChooser( translucent ?
-                             new ConfigChooser(8, 8, 8, 8, depth, stencil) :
-                             new ConfigChooser(5, 6, 5, 0, depth, stencil) );
-
-        /* Set the renderer responsible for frame rendering */
-        setRenderer(new Renderer());
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    
+    @Override
+    public void surfaceChanged( SurfaceHolder holder, int format, int width, int height ) {
+       setSurface( holder.getSurface(), 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;" >-
-    private static class ContextFactory implements GLSurfaceView.EGLContextFactory {
-        private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
-        public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
-            Log.w(TAG, "creating OpenGL ES 2.0 context");
-            checkEglError("Before eglCreateContext", egl);
-            int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
-            EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
-            checkEglError("After eglCreateContext", egl);
-            return context;
-        }
-
-        public void destroyContext(EGL10 egl, EGLDisplay display, EGLContext context) {
-            egl.eglDestroyContext(display, context);
-        }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    
+    @Override
+    public void surfaceDestroyed( SurfaceHolder holder ) {
+       clearSurface( holder.getSurface() );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     }
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-
-    private static void checkEglError(String prompt, EGL10 egl) {
-        int error;
-        while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {
-            Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error));
-        }
-    }
-

-    private static class Renderer implements GLSurfaceView.Renderer {
-        public void onDrawFrame(GL10 gl) {
-            Dreamcast.run();
-        }
-
-        public void onSurfaceChanged(GL10 gl, int width, int height) {
-            Dreamcast.setViewSize(width,height);
-        }
-
-        public void onSurfaceCreated(GL10 gl, EGLConfig config) {
-            // Do nothing.
-        }
-    }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    
+    private native void setSurface( Surface surface, int width, int height );
+    private native void clearSurface( Surface surface );
+    
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
</pre></div>
<hr /><a name="file15" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>configure</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/configure
+++ lxdream/configure
@@ -686,6 +686,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > ANDROID_SDK_HOME
 ANDROID_NDK_HOME
 ANDROID_SDK_VERSION
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ANDROID_NDK_VERSION
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > ANDROID_GDBSERVER
 GUI_ANDROID_TRUE
 GUI_ANDROID_FALSE
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -1465,6 +1466,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >   --with-android=SDK      Specify the location of the Android SDK
   --with-android-ndk=NDK  Specify the location of the Android NDK
   --with-android-version  Specify target Android SDK version
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+  --with-android-version  Specify target Android NDK version
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >   --with-osmesa           Build with the osmesa GL library (software
                           rendering)
   --with-gtk              Build with the GTK UI. Default on X11 systems
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -2543,7 +2545,15 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > if test "${with_android_version+set}" = set; then
   withval=$with_android_version;
 else
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-  with_android_version="android-<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >8</span>"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+  with_android_version="android-<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >11</span>"
+fi
+
+
+# Check whether --with-android-ndk-version was given.
+if test "${with_android_ndk_version+set}" = set; then
+  withval=$with_android_ndk_version;
+else
+  with_ndk_version="android-9"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > fi
 
 
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -2562,6 +2572,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >       ANDROID_SDK_HOME="$with_android"
       ANDROID_NDK_HOME="$with_android_ndk"
       ANDROID_SDK_VERSION="$with_android_version"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+      ANDROID_NDK_VERSION="$with_ndk_version"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
       as_ac_File=`echo "ac_cv_file_$ANDROID_SDK_HOME/tools/ant/pre_setup.xml" | $as_tr_sh`
 { echo "$as_me:$LINENO: checking for $ANDROID_SDK_HOME/tools/ant/pre_setup.xml" >&5
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -2653,7 +2664,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             host_os="linux-androideabi"
             ANDROID_NDK_BIN=`echo $ANDROID_NDK_HOME/toolchains/arm-*/prebuilt/*/bin`
             ANDROID_GDBSERVER=`echo $ANDROID_NDK_HOME/toolchains/arm-*/prebuilt/gdbserver`
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-            ANDROID_SYSROOT="$ANDROID_NDK_HOME/platforms/$ANDROID_<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >S</span>DK_VERSION/arch-arm"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+            ANDROID_SYSROOT="$ANDROID_NDK_HOME/platforms/$ANDROID_<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >N</span>DK_VERSION/arch-arm"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             TARGETFLAGS="-ffunction-sections -funwind-tables -fstack-protector -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID -Wno-psabi -Wa,--noexecstack"
             TARGETFLAGS="$TARGETFLAGS -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -mthumb -Os"
             ;;
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -2664,7 +2675,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             host_os="linux"
             ANDROID_NDK_BIN=`echo $ANDROID_NDK_HOME/toolchains/x86-*/prebuilt/*/bin`
             ANDROID_GDBSERVER=`echo $ANDROID_NDK_HOME/toolchains/x86-*/prebuilt/gdbserver`
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-            ANDROID_SYSROOT="$ANDROID_NDK_HOME/platforms/$ANDROID_<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >S</span>DK_VERSION/arch-x86"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+            ANDROID_SYSROOT="$ANDROID_NDK_HOME/platforms/$ANDROID_<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >N</span>DK_VERSION/arch-x86"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             TARGETFLAGS=""
             ;;
          *)
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -2725,7 +2736,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >       OBJDUMP="$ANDROID_NDK_BIN/${host_alias}-objdump"
       CPPFLAGS="-fPIC --sysroot=$ANDROID_SYSROOT -I$ANDROID_SYSROOT/usr/include $TARGETFLAGS $CPPFLAGS"
       LDFLAGS="-nostdlib -Wl,--no-undefined -L${ANDROID_SYSROOT}/usr/lib -Wl,-rpath-link,${ANDROID_SYSROOT}/usr/lib -Wl,-allow-shlib-undefined -Wl,-z,noexecstack $LDFLAGS"
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-      LIBS="$LIBS -liconv -llog -lgcc -lc"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+      LIBS="$LIBS -liconv -landroid -llog -lgcc -lc -lm"
+
</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;" >@@ -8966,16 +8978,16 @@
</small></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="context" class="diff" style="margin:0; background-color:#eeeeee;" > if test "$ANDROID_BUILD" = "yes"; then
    with_gtk=no;
    EXTRA_OUTPUT_FILES="src/android/build.properties"
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-   LIBS="-lGLESv2 $LIBS"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+   LIBS="-l<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >EGL -l</span>GLESv2 $LIBS"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_GLES2 1
 _ACEOF
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+   UI_DRIVER="Android"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >    with_sdl=no
 else
 
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -9442,6 +9454,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #define APPLE_BUILD 1
 _ACEOF
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+      UI_DRIVER="Cocoa"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >       if test "x$with_gtk" = "xx11"; then
         with_gtk=no
       fi
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -11020,6 +11033,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #define HAVE_GTK 1
 _ACEOF
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+       UI_DRIVER="GTK"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 fi
 
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -16749,6 +16763,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > ANDROID_SDK_HOME!$ANDROID_SDK_HOME$ac_delim
 ANDROID_NDK_HOME!$ANDROID_NDK_HOME$ac_delim
 ANDROID_SDK_VERSION!$ANDROID_SDK_VERSION$ac_delim
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ANDROID_NDK_VERSION!$ANDROID_NDK_VERSION$ac_delim
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > ANDROID_GDBSERVER!$ANDROID_GDBSERVER$ac_delim
 GUI_ANDROID_TRUE!$GUI_ANDROID_TRUE$ac_delim
 GUI_ANDROID_FALSE!$GUI_ANDROID_FALSE$ac_delim
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -16772,7 +16787,6 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > CC!$CC$ac_delim
 CFLAGS!$CFLAGS$ac_delim
 CPPFLAGS!$CPPFLAGS$ac_delim
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-CC_FOR_BUILD!$CC_FOR_BUILD$ac_delim
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -16814,6 +16828,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+CC_FOR_BUILD!$CC_FOR_BUILD$ac_delim
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > ac_ct_CC_FOR_BUILD!$ac_ct_CC_FOR_BUILD$ac_delim
 CC_FOR_BUILDDEPMODE!$CC_FOR_BUILDDEPMODE$ac_delim
 am__fastdepCC_FOR_BUILD_TRUE!$am__fastdepCC_FOR_BUILD_TRUE$ac_delim
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -16910,7 +16925,6 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > BUILD_ARMTEST_TRUE!$BUILD_ARMTEST_TRUE$ac_delim
 BUILD_ARMTEST_FALSE!$BUILD_ARMTEST_FALSE$ac_delim
 LXDREAM_LIBS!$LXDREAM_LIBS$ac_delim
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-GETTEXT_PACKAGE!$GETTEXT_PACKAGE$ac_delim
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -16952,6 +16966,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+GETTEXT_PACKAGE!$GETTEXT_PACKAGE$ac_delim
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > USE_NLS!$USE_NLS$ac_delim
 MSGFMT!$MSGFMT$ac_delim
 MSGFMT_OPTS!$MSGFMT_OPTS$ac_delim
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -16972,7 +16987,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 1<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >8</span>; then
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 1<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >9</span>; then
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -17613,18 +17628,14 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > echo "Configuration complete"
 echo
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-if test "x$HAVE_GTK" = x; then
-  if test "x$HAVE_COCOA" = x; then
-     echo "  User interface: none"
-  else
-     echo "  User interface: Cocoa"
-  fi
-else
-  echo "  User interface: GTK"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+if test "x$UI_DRIVER" = x; then
+  echo "  User interface: none"
+else
+  echo "  User interface: $UI_DRIVER"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > fi
 
 if test "x$SH4_TRANSLATOR" = "x"; then
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-  echo "  SH4 translator: <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >N</span>one (emulation core only)"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+  echo "  SH4 translator: <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >n</span>one (emulation core only)"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > else
   echo "  SH4 translator: $SH4_TRANSLATOR"
 fi
</pre></div>
<hr /><a name="file16" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>configure.in</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/configure.in
+++ lxdream/configure.in
@@ -79,15 +79,15 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > AC_ARG_WITH( sdl,
    AS_HELP_STRING( [--with-sdl], [Build with support for SDL audio]) )
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-
-dnl ------------ Check if we're building on Darwin --------------
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+dnl ------------ Check if we're building on Darwin or Android --------------
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 dnl For starters, do we have a working objective-c compiler?
 if test "$ANDROID_BUILD" = "yes"; then
    with_gtk=no;
    EXTRA_OUTPUT_FILES="src/android/build.properties"
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-   LIBS="-lGLESv2 $LIBS"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+   LIBS="-l<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >EGL -l</span>GLESv2 $LIBS"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >    AC_DEFINE(HAVE_GLES2, 1, [Using GLESv2])
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+   UI_DRIVER="Android"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >    with_sdl=no
 else
 AC_HAVE_OBJC([
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -100,6 +100,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >       LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"
       AC_DEFINE(HAVE_COCOA,[1],[Have Cocoa framework])
       AC_DEFINE(APPLE_BUILD,[1],[Building on an apple platform. Things are different...])
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+      UI_DRIVER="Cocoa"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >       if test "x$with_gtk" = "xx11"; then
         with_gtk=no
       fi
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -230,6 +231,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >    PKG_CHECK_MODULES(GTK, gtk+-2.0, [
        HAVE_GTK='yes'
        AC_DEFINE([HAVE_GTK],1,[Have GTK libraries])
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+       UI_DRIVER="GTK"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >    ])
 
    dnl Which GTK port do we have?
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -485,18 +487,14 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > echo "Configuration complete"
 echo
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-if test "x$HAVE_GTK" = x; then
-  if test "x$HAVE_COCOA" = x; then
-     echo "  User interface: none"
-  else
-     echo "  User interface: Cocoa"
-  fi
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+if test "x$UI_DRIVER" = x; then
+  echo "  User interface: none"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > else
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-  echo "  User interface: <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >GTK</span>"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+  echo "  User interface: <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >$UI_DRIVER</span>"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > fi
 
 if test "x$SH4_TRANSLATOR" = "x"; then
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-  echo "  SH4 translator: <span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >N</span>one (emulation core only)"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+  echo "  SH4 translator: <span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >n</span>one (emulation core only)"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > else
   echo "  SH4 translator: $SH4_TRANSLATOR"
 fi
</pre></div>
<hr /><a name="file17" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/m4</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>android.m4</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/m4/android.m4
+++ lxdream/m4/android.m4
@@ -6,7 +6,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >    AC_REQUIRE([AC_CANONICAL_HOST])
    AC_ARG_WITH( android, AS_HELP_STRING( [--with-android=SDK], [Specify the location of the Android SDK] ) )
    AC_ARG_WITH( android-ndk, AS_HELP_STRING( [--with-android-ndk=NDK], [Specify the location of the Android NDK] ) )
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-   AC_ARG_WITH( android-version, AS_HELP_STRING( [--with-android-version], [Specify target Android SDK version]), [], [with_android_version="android-<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >8</span>"] )
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+   AC_ARG_WITH( android-version, AS_HELP_STRING( [--with-android-version], [Specify target Android SDK version]), [], [with_android_version="android-<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >11</span>"] )
+   AC_ARG_WITH( android-ndk-version, AS_HELP_STRING( [--with-android-version], [Specify target Android NDK version]), [], [with_ndk_version="android-9"] )
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
    if test "x$with_android" != "x"; then
       if test "$with_android" = "yes"; then
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -19,6 +20,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >       ANDROID_SDK_HOME="$with_android"
       ANDROID_NDK_HOME="$with_android_ndk"
       ANDROID_SDK_VERSION="$with_android_version"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+      ANDROID_NDK_VERSION="$with_ndk_version"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >       
       AC_CHECK_FILE( [$ANDROID_SDK_HOME/tools/ant/pre_setup.xml], [], [ AC_MSG_ERROR([Android SDK not found in $ANDROID_SDK_HOME]) ])
       AC_CHECK_FILE( [$ANDROID_SDK_HOME/platforms/$ANDROID_SDK_VERSION/sdk.properties], [], [ AC_MSG_ERROR([Android platform version $ANDROID_SDK_VERSION not found in $ANDROID_SDK_HOME]) ])
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -32,7 +34,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             host_os="linux-androideabi"
             ANDROID_NDK_BIN=`echo $ANDROID_NDK_HOME/toolchains/arm-*/prebuilt/*/bin`
             ANDROID_GDBSERVER=`echo $ANDROID_NDK_HOME/toolchains/arm-*/prebuilt/gdbserver`
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-            ANDROID_SYSROOT="$ANDROID_NDK_HOME/platforms/$ANDROID_<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >S</span>DK_VERSION/arch-arm"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+            ANDROID_SYSROOT="$ANDROID_NDK_HOME/platforms/$ANDROID_<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >N</span>DK_VERSION/arch-arm"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             TARGETFLAGS="-ffunction-sections -funwind-tables -fstack-protector -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID -Wno-psabi -Wa,--noexecstack"
             TARGETFLAGS="$TARGETFLAGS -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -mthumb -Os"
             ;;
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -43,7 +45,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             host_os="linux"
             ANDROID_NDK_BIN=`echo $ANDROID_NDK_HOME/toolchains/x86-*/prebuilt/*/bin`
             ANDROID_GDBSERVER=`echo $ANDROID_NDK_HOME/toolchains/x86-*/prebuilt/gdbserver`
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-            ANDROID_SYSROOT="$ANDROID_NDK_HOME/platforms/$ANDROID_<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >S</span>DK_VERSION/arch-x86"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+            ANDROID_SYSROOT="$ANDROID_NDK_HOME/platforms/$ANDROID_<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >N</span>DK_VERSION/arch-x86"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >             TARGETFLAGS=""
             ;;
          *)
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -63,11 +65,12 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >       OBJDUMP="$ANDROID_NDK_BIN/${host_alias}-objdump"
       CPPFLAGS="-fPIC --sysroot=$ANDROID_SYSROOT -I$ANDROID_SYSROOT/usr/include $TARGETFLAGS $CPPFLAGS"
       LDFLAGS="-nostdlib -Wl,--no-undefined -L${ANDROID_SYSROOT}/usr/lib -Wl,-rpath-link,${ANDROID_SYSROOT}/usr/lib -Wl,-allow-shlib-undefined -Wl,-z,noexecstack $LDFLAGS"
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-      LIBS="$LIBS -liconv -llog -lgcc -lc"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+      LIBS="$LIBS -liconv -landroid -llog -lgcc -lc -lm"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >       
       AC_SUBST(ANDROID_SDK_HOME)
       AC_SUBST(ANDROID_NDK_HOME)
       AC_SUBST(ANDROID_SDK_VERSION)
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+      AC_SUBST(ANDROID_NDK_VERSION)
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >       AC_SUBST(ANDROID_GDBSERVER)
       
       ANDROID_BUILD=yes
</pre></div>
<hr /><a name="file18" /><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>Makefile.am</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/Makefile.am
+++ lxdream/src/Makefile.am
@@ -111,11 +111,11 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > endif
 
 if GUI_ANDROID
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-lxdream_SOURCES += gui_none.c
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+lxdream_SOURCES += gui_none.c drivers/video_egl.c drivers/video_egl.h
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > noinst_PROGRAMS=liblxdream.so
 liblxdream_so_LINK = $(LINK) -Wl,-soname,liblxdream.so -shared
 liblxdream_so_LDADD = liblxdream-core.a @GLIB_LIBS@ @GTK_LIBS@ @LIBPNG_LIBS@ @LIBISOFS_LIBS@ $(INTLLIBS) @LXDREAM_LIBS@ -lm
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-liblxdream_so_SOURCES = gui_jni.c drivers/cdrom/cd_none.c
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+liblxdream_so_SOURCES = gui_android.c drivers/cdrom/cd_none.c drivers/video_egl.c drivers/video_egl.h tqueue.c tqueue.h
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > liblxdream_so_LIBS = liblxdream-core.a
 endif
 
</pre></div>
<hr /><a name="file19" /><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>Makefile.in</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/Makefile.in
+++ lxdream/src/Makefile.in
@@ -58,7 +58,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @GUI_GTK_TRUE@        gtkui/gtk_ctrl.c gtkui/gtk_gd.c \
 @GUI_GTK_TRUE@        drivers/video_gtk.c
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-@GUI_ANDROID_TRUE@am__append_5 = gui_none.c
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+@GUI_ANDROID_TRUE@am__append_5 = gui_none.c drivers/video_egl.c drivers/video_egl.h
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @GUI_ANDROID_TRUE@noinst_PROGRAMS = liblxdream.so$(EXEEXT)
 @GUI_COCOA_TRUE@am__append_6 = cocoaui/paths_osx.m drivers/io_osx.m drivers/mac_keymap.h drivers/mac_keymap.txt
 @GUI_COCOA_TRUE@am__append_7 = cocoaui/cocoaui.m cocoaui/cocoaui.h cocoaui/cocoa_cfg.m \
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -216,9 +216,11 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > input_lirc_@SOEXT@_OBJECTS = $(am_input_lirc_@SOEXT@_OBJECTS)
 @BUILD_PLUGINS_TRUE@@INPUT_LIRC_TRUE@input_lirc_@SOEXT@_DEPENDENCIES =  \
 @BUILD_PLUGINS_TRUE@@INPUT_LIRC_TRUE@  input_lirc.lo
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-am__liblxdream_so_SOURCES_DIST = gui_jni.c drivers/cdrom/cd_none.c
-@GUI_ANDROID_TRUE@am_liblxdream_so_OBJECTS = gui_jni.$(OBJEXT) \
-@GUI_ANDROID_TRUE@     cd_none.$(OBJEXT)
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+am__liblxdream_so_SOURCES_DIST = gui_android.c drivers/cdrom/cd_none.c \
+       drivers/video_egl.c drivers/video_egl.h tqueue.c tqueue.h
+@GUI_ANDROID_TRUE@am_liblxdream_so_OBJECTS = gui_android.$(OBJEXT) \
+@GUI_ANDROID_TRUE@     cd_none.$(OBJEXT) video_egl.$(OBJEXT) \
+@GUI_ANDROID_TRUE@     tqueue.$(OBJEXT)
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > liblxdream_so_OBJECTS = $(am_liblxdream_so_OBJECTS)
 am__DEPENDENCIES_1 =
 @GUI_ANDROID_TRUE@liblxdream_so_DEPENDENCIES = liblxdream-core.a \
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -227,14 +229,15 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >      gtkui/gtkui.h gtkui/gtk_win.c gtkui/gtkcb.c gtkui/gtk_cfg.c \
        gtkui/gtk_mmio.c gtkui/gtk_debug.c gtkui/gtk_dump.c \
        gtkui/gtk_ctrl.c gtkui/gtk_gd.c drivers/video_gtk.c gui_none.c \
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-   cocoaui/cocoaui.m cocoaui/cocoaui.h cocoaui/cocoa_cfg.m \
-       cocoaui/cocoa_win.m cocoaui/cocoa_gd.m cocoaui/cocoa_prefs.m \
-       cocoaui/cocoa_ctrl.m drivers/video_osx.m drivers/video_gdk.c \
-       drivers/video_glx.c drivers/video_glx.h drivers/video_nsgl.m \
-       drivers/video_nsgl.h drivers/audio_osx.m drivers/audio_sdl.c \
-       drivers/audio_pulse.c drivers/audio_esd.c drivers/audio_alsa.c \
-       drivers/input_lirc.c drivers/cdrom/cd_linux.c \
-       drivers/cdrom/cd_osx.c drivers/osx_iokit.m drivers/osx_iokit.h \
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+     drivers/video_egl.c drivers/video_egl.h cocoaui/cocoaui.m \
+       cocoaui/cocoaui.h cocoaui/cocoa_cfg.m cocoaui/cocoa_win.m \
+       cocoaui/cocoa_gd.m cocoaui/cocoa_prefs.m cocoaui/cocoa_ctrl.m \
+       drivers/video_osx.m drivers/video_gdk.c drivers/video_glx.c \
+       drivers/video_glx.h drivers/video_nsgl.m drivers/video_nsgl.h \
+       drivers/audio_osx.m drivers/audio_sdl.c drivers/audio_pulse.c \
+       drivers/audio_esd.c drivers/audio_alsa.c drivers/input_lirc.c \
+       drivers/cdrom/cd_linux.c drivers/cdrom/cd_osx.c \
+       drivers/osx_iokit.m drivers/osx_iokit.h \
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >    drivers/cdrom/cd_none.c drivers/joy_linux.c \
        drivers/joy_linux.h
 @BUILD_PLUGINS_TRUE@am__objects_4 = plugin.$(OBJEXT)
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -243,7 +246,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @GUI_GTK_TRUE@       gtk_mmio.$(OBJEXT) gtk_debug.$(OBJEXT) \
 @GUI_GTK_TRUE@ gtk_dump.$(OBJEXT) gtk_ctrl.$(OBJEXT) \
 @GUI_GTK_TRUE@ gtk_gd.$(OBJEXT) video_gtk.$(OBJEXT)
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-@GUI_ANDROID_TRUE@am__objects_6 = gui_none.$(OBJEXT)
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+@GUI_ANDROID_TRUE@am__objects_6 = gui_none.$(OBJEXT)<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" > \</span>
+@GUI_ANDROID_TRUE@     video_egl.$(OBJEXT)
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @GUI_COCOA_TRUE@am__objects_7 = cocoaui.$(OBJEXT) cocoa_cfg.$(OBJEXT) \
 @GUI_COCOA_TRUE@       cocoa_win.$(OBJEXT) cocoa_gd.$(OBJEXT) \
 @GUI_COCOA_TRUE@       cocoa_prefs.$(OBJEXT) cocoa_ctrl.$(OBJEXT) \
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -343,6 +347,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > AMTAR = @AMTAR@
 ANDROID_GDBSERVER = @ANDROID_GDBSERVER@
 ANDROID_NDK_HOME = @ANDROID_NDK_HOME@
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ANDROID_NDK_VERSION = @ANDROID_NDK_VERSION@
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > ANDROID_SDK_HOME = @ANDROID_SDK_HOME@
 ANDROID_SDK_VERSION = @ANDROID_SDK_VERSION@
 ANT = @ANT@
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -624,7 +629,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 @GUI_ANDROID_TRUE@liblxdream_so_LINK = $(LINK) -Wl,-soname,liblxdream.so -shared
 @GUI_ANDROID_TRUE@liblxdream_so_LDADD = liblxdream-core.a @GLIB_LIBS@ @GTK_LIBS@ @LIBPNG_LIBS@ @LIBISOFS_LIBS@ $(INTLLIBS) @LXDREAM_LIBS@ -lm
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-@GUI_ANDROID_TRUE@liblxdream_so_SOURCES = gui_jni.c drivers/cdrom/cd_none.c
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+@GUI_ANDROID_TRUE@liblxdream_so_SOURCES = gui_android.c drivers/cdrom/cd_none.c drivers/video_egl.c drivers/video_egl.h tqueue.c tqueue.h
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @GUI_ANDROID_TRUE@liblxdream_so_LIBS = liblxdream-core.a
 @BUILD_PLUGINS_TRUE@lxdream_dummy_@SOEXT@_SOURCES = 
 @BUILD_PLUGINS_TRUE@lxdream_dummy_@SOEXT@_LDADD = lxdream_dummy.lo @SDL_LIBS@
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -844,7 +849,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtk_win.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkcb.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkui.Po@am__quote@
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >jni</span>.Po@am__quote@
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >android</span>.Po@am__quote@
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_none.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hotkeys.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386-dis.Po@am__quote@
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -897,8 +902,10 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testxlt.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texcache.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Po@am__quote@
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tqueue.Po@am__quote@
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/video_egl.Po@am__quote@
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/video_gdk.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/video_gl.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/video_glx.Po@am__quote@
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -1852,6 +1859,20 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @AMDEP_TRUE@@am__fastdepCC_FALSE@    DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cd_none.obj `if test -f 'drivers/cdrom/cd_none.c'; then $(CYGPATH_W) 'drivers/cdrom/cd_none.c'; else $(CYGPATH_W) '$(srcdir)/drivers/cdrom/cd_none.c'; fi`
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+video_egl.o: drivers/video_egl.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_egl.o -MD -MP -MF "$(DEPDIR)/video_egl.Tpo" -c -o video_egl.o `test -f 'drivers/video_egl.c' || echo '$(srcdir)/'`drivers/video_egl.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/video_egl.Tpo" "$(DEPDIR)/video_egl.Po"; else rm -f "$(DEPDIR)/video_egl.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='drivers/video_egl.c' object='video_egl.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_egl.o `test -f 'drivers/video_egl.c' || echo '$(srcdir)/'`drivers/video_egl.c
+
+video_egl.obj: drivers/video_egl.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_egl.obj -MD -MP -MF "$(DEPDIR)/video_egl.Tpo" -c -o video_egl.obj `if test -f 'drivers/video_egl.c'; then $(CYGPATH_W) 'drivers/video_egl.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_egl.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/video_egl.Tpo" "$(DEPDIR)/video_egl.Po"; else rm -f "$(DEPDIR)/video_egl.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='drivers/video_egl.c' object='video_egl.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_egl.obj `if test -f 'drivers/video_egl.c'; then $(CYGPATH_W) 'drivers/video_egl.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_egl.c'; fi`
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > gtkui.o: gtkui/gtkui.c
 @am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtkui.o -MD -MP -MF "$(DEPDIR)/gtkui.Tpo" -c -o gtkui.o `test -f 'gtkui/gtkui.c' || echo '$(srcdir)/'`gtkui/gtkui.c; \
 @am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/gtkui.Tpo" "$(DEPDIR)/gtkui.Po"; else rm -f "$(DEPDIR)/gtkui.Tpo"; exit 1; fi
</pre></div>
<hr /><a name="file20" /><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>display.c</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/display.c
+++ lxdream/src/display.c
@@ -23,6 +23,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #include "dream.h"
 #include "display.h"
 #include "pvr2/pvr2.h"
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+#include "pvr2/glutil.h"
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 display_driver_t display_driver_list[] = {
 #ifdef HAVE_GTK
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -33,7 +34,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #endif
 #endif
 #ifdef __ANDROID__
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        &display_gl_driver,
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        &display_<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >e</span>gl_driver,
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #endif
         &display_null_driver,
         NULL };
</pre></div>
<hr /><a name="file21" /><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>display.h</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/display.h
+++ lxdream/src/display.h
@@ -282,6 +282,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > extern struct display_driver display_gtk_driver;
 extern struct display_driver display_osx_driver;
 extern struct display_driver display_gl_driver;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+extern struct display_driver display_egl_driver;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > extern struct display_driver display_null_driver;
 
 /****************** Input methods **********************/
</pre></div>
<hr /><a name="file22" /><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/drivers</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>gl_fbo.c</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/drivers/gl_fbo.c
+++ lxdream/src/drivers/gl_fbo.c
@@ -67,7 +67,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 gboolean gl_fbo_is_supported()
 {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    return isGLExtensionSupported("GL_EXT_framebuffer_object");
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    return isGLExtensionSupported("GL_EXT_framebuffer_object")<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" > || isOpenGLES2()</span>;
</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;" >@@ -353,7 +353,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     glDrawBuffer( GL_FRONT );
     glReadBuffer( GL_FRONT );
 #endif
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    display_driver->swap_buffers();
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    if( display_driver->swap_buffers )
+        display_driver->swap_buffers();
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }    
 
 static gboolean gl_fbo_read_render_buffer( unsigned char *target, render_buffer_t buffer, 
</pre></div>
<hr /><a name="file23" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span id="added" class="pathname" style="font-family:monospace; float:right; background-color:#ddffdd;" >lxdream/src/drivers</span><br />
<div id="added" class="fileheader" style="margin-bottom:.5em; background-color:#ddffdd;" ><big><b>video_egl.c</b></big> <small id="info" style="color: #888888;" >added at 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/drivers/video_egl.c
+++ lxdream/src/drivers/video_egl.c
@@ -0,0 +1,168 @@
</small></pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+/**
+ * $Id$
+ *
+ * Window management using EGL.
+ *
+ * Copyright (c) 2012 Nathan Keynes.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include "lxdream.h"
+#include "display.h"
+#include "video_egl.h"
+#include "video_gl.h"
+#include "pvr2/pvr2.h"
+#include "pvr2/glutil.h"
+
+static const char *getEGLErrorString( EGLint code )
+{
+    switch( code ) {
+    case EGL_SUCCESS: return "OK";
+    case EGL_NOT_INITIALIZED: return "EGL not initialized";
+    case EGL_BAD_ACCESS: return "Bad access";
+    case EGL_BAD_ALLOC: return "Allocation failed";
+    case EGL_BAD_ATTRIBUTE: return "Bad attribute";
+    case EGL_BAD_CONTEXT: return "Bad context";
+    case EGL_BAD_CONFIG: return "Bad config";
+    case EGL_BAD_CURRENT_SURFACE: return "Bad current surface";
+    case EGL_BAD_DISPLAY: return "Bad display";
+    case EGL_BAD_MATCH: return "Bad match";
+    case EGL_BAD_PARAMETER: return "Bad parameter";
+    case EGL_BAD_NATIVE_PIXMAP: return "Bad native pixmap";
+    case EGL_BAD_NATIVE_WINDOW: return "Bad native window";
+    default: return "Unknown error";
+    }
+}
+
+
+static void logEGLError(const char *msg)
+{
+    EGLint error = eglGetError();
+    const char *errorStr = getEGLErrorString(error);
+
+    ERROR( "%s: %s (%x)", msg, errorStr, error );
+}
+
+static const EGLint RGB888_attributes[] = {
+        EGL_RED_SIZE,       8,
+        EGL_GREEN_SIZE,     8,
+        EGL_BLUE_SIZE,      8,
+        EGL_DEPTH_SIZE,     16,
+        EGL_STENCIL_SIZE,   8,
+        EGL_SURFACE_TYPE,   EGL_WINDOW_BIT,
+        EGL_RENDERABLE_TYPE,EGL_OPENGL_ES2_BIT,
+        EGL_NONE, EGL_NONE };
+
+static const EGLint RGB565_attributes[] = {
+        EGL_RED_SIZE,       5,
+        EGL_GREEN_SIZE,     6,
+        EGL_BLUE_SIZE,      5,
+        EGL_DEPTH_SIZE,     16,
+        EGL_STENCIL_SIZE,   8,
+        EGL_SURFACE_TYPE,   EGL_WINDOW_BIT,
+        EGL_RENDERABLE_TYPE,EGL_OPENGL_ES2_BIT,
+        EGL_NONE, EGL_NONE };
+
+static const EGLint context_attributes[] = {
+        EGL_CONTEXT_CLIENT_VERSION, 2,
+        EGL_NONE, EGL_NONE };
+
+static EGLDisplay display;
+static EGLContext context = EGL_NO_CONTEXT;
+static EGLSurface surface = EGL_NO_SURFACE;
+static gboolean fbo_created = FALSE;
+
+gboolean video_egl_set_window(EGLNativeWindowType window, int width, int height, int format)
+{
+    EGLConfig config;
+    EGLint num_config, major = 0, minor = 0;
+    const EGLint *attribute_list;
+
+    display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+    if( eglInitialize(display, &major, &minor) != EGL_TRUE ) {
+        logEGLError( "Unable to initialise EGL display" );
+        return FALSE;
+    }
+
+    if( format == COLFMT_RGB565 || format == COLFMT_BGRA1555 ) {
+        attribute_list = RGB565_attributes;
+    } else {
+        attribute_list = RGB888_attributes;
+    }
+
+
+    eglChooseConfig(display, attribute_list, &config, 1, &num_config);
+
+    context = eglCreateContext(display, config, EGL_NO_CONTEXT, context_attributes);
+    if( context == EGL_NO_CONTEXT ) {
+        logEGLError( "Unable to create EGL context" );
+        video_egl_clear_window();
+        return FALSE;
+    }
+
+    surface = eglCreateWindowSurface(display, config, window, NULL);
+    if( surface == EGL_NO_SURFACE ) {
+        logEGLError( "Unable to create EGL surface" );
+        video_egl_clear_window();
+        return FALSE;
+    }
+
+    if( eglMakeCurrent( display, surface, surface, context ) == EGL_FALSE ) {
+        video_egl_clear_window();
+        return FALSE;
+    }
+
+    if( gl_fbo_is_supported() ) {
+        display_gl_driver.capabilities.has_gl = TRUE;
+        gl_fbo_init(&display_egl_driver);
+        gl_vbo_init(&display_egl_driver);
+        fbo_created = TRUE;
+    } else {
+        ERROR( "Display does not support FBO" );
+        video_egl_clear_window();
+        return FALSE;
+    }
+    pvr2_setup_gl_context();
+    INFO( "Initialised EGL %d.%d\n", major, minor );
+    return TRUE;
+}
+
+void video_egl_clear_window()
+{
+    if( fbo_created ) {
+        gl_fbo_shutdown();
+        fbo_created = FALSE;
+    }
+    eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+    if( surface != EGL_NO_SURFACE )  {
+        eglDestroySurface(display, surface);
+        surface = EGL_NO_SURFACE;
+    }
+    if( context != EGL_NO_CONTEXT ) {
+        eglDestroyContext(display, context);
+        context = EGL_NO_CONTEXT;
+    }
+    eglTerminate(display);
+}
+
+
+
+/**
+ * Minimal init and shutdown. The real work is done from set_window
+ */
+struct display_driver display_egl_driver = {
+        "egl", N_("OpenGLES driver"), NULL, NULL,
+        NULL, NULL, NULL,
+        NULL, NULL, NULL, NULL,
+        gl_load_frame_buffer, gl_display_render_buffer, gl_display_blank,
+        NULL, gl_read_render_buffer, NULL, NULL
+};
</pre></div>
<hr /><a name="file24" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span id="added" class="pathname" style="font-family:monospace; float:right; background-color:#ddffdd;" >lxdream/src/drivers</span><br />
<div id="added" class="fileheader" style="margin-bottom:.5em; background-color:#ddffdd;" ><big><b>video_egl.h</b></big> <small id="info" style="color: #888888;" >added at 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/drivers/video_egl.h
+++ lxdream/src/drivers/video_egl.h
@@ -0,0 +1,38 @@
</small></pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+/**
+ * $Id$
+ *
+ * Window management using EGL.
+ *
+ * Copyright (c) 2012 Nathan Keynes.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+
+#ifndef lxdream_video_egl_H
+#define lxdream_video_egl_H 1
+
+#include "glib/gtypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EGL/egl.h>
+
+gboolean video_egl_set_window(EGLNativeWindowType window, int width, int height, int format);
+void video_egl_clear_window();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !lxdream_video_egl_H */
</pre></div>
<hr /><a name="file25" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span id="added" class="pathname" style="font-family:monospace; float:right; background-color:#ddffdd;" >lxdream/src</span><br />
<div id="added" class="fileheader" style="margin-bottom:.5em; background-color:#ddffdd;" ><big><b>gui_android.c</b></big> <small id="info" style="color: #888888;" >added at 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/gui_android.c
+++ lxdream/src/gui_android.c
@@ -0,0 +1,331 @@
</small></pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+/**
+ * $Id$
+ *
+ * Native shims for the Android front-end (implemented in Java).
+ *
+ * This is complicated by the fact that all the emulation runs in a
+ * separate thread.
+ *
+ * Copyright (c) 2012 Nathan Keynes.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <jni.h>
+#include <pthread.h>
+#include <android/log.h>
+#include <android/native_window_jni.h>
+#include <libisofs.h>
+#include "dream.h"
+#include "dreamcast.h"
+#include "gui.h"
+#include "config.h"
+#include "lxpaths.h"
+#include "tqueue.h"
+#include "display.h"
+#include "gdlist.h"
+#include "gdrom/gdrom.h"
+#include "hotkeys.h"
+#include "serial.h"
+#include "aica/audio.h"
+#include "drivers/video_egl.h"
+#include "maple/maple.h"
+#include "vmu/vmulist.h"
+
+struct surface_info {
+    ANativeWindow *win;
+    int width, height, format;
+};
+
+static struct surface_info current_surface;
+static const char *appHome = NULL;
+
+/**
+ * Count of running nanoseconds - used to cut back on the GUI runtime
+ */
+static uint32_t android_gui_nanos = 0;
+static uint32_t android_gui_ticks = 0;
+static struct timeval android_gui_lasttv;
+
+
+void android_gui_start( void )
+{
+    /* Dreamcast starting up hook */
+}
+
+void android_gui_stop( void )
+{
+    /* Dreamcast stopping hook */
+}
+
+void android_gui_reset( void )
+{
+    /* Dreamcast reset hook */
+}
+
+/**
+ * The main emulation thread. (as opposed to the UI thread).
+ */
+void *android_thread_main(void *data)
+{
+    while(1) {
+        tqueue_process_wait();
+    }
+    return NULL;
+}
+
+int android_set_surface(void *data)
+{
+    struct surface_info *surface = (struct surface_info *)data;
+    video_egl_set_window(surface->win, surface->width, surface->height, surface->format);
+    return 0;
+}
+
+int android_clear_surface(void *data)
+{
+    struct surface_info *surface = (struct surface_info *)data;
+
+    if( dreamcast_is_running() ) {
+        dreamcast_stop();
+    }
+    video_egl_clear_window();
+    ANativeWindow_release(surface->win);
+    surface->win = NULL;
+    return 0;
+}
+
+static pthread_t dreamcast_thread;
+
+void android_start_thread()
+{
+    pthread_attr_t attr;
+
+    pthread_attr_init(&attr);
+    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
+    int status = pthread_create(&dreamcast_thread, &attr, android_thread_main, NULL);
+    if( status != 0 ) {
+        /* Handle errors */
+    }
+}
+
+/** tqueue callback wrapper to get the right call type for simple events */
+int android_callback_wrapper( void *fn )
+{
+    void (*cast_fn)(void) = fn;
+    cast_fn();
+}
+
+int android_mount_disc( void *data )
+{
+    char *s = (char *)data;
+    ERROR err;
<a name="task2" />+    gboolean result = gdrom_mount_image( s, &err ); /* <span class="task" style="background-color:#ffff00;" >TODO</span>: Report error */
+    return result;
+}
+
+int android_toggle_run( void *data )
+{
+    if( dreamcast_is_running() ) {
+        dreamcast_stop();
+    } else {
+        dreamcast_run();
+    }
+}
+
+uint32_t android_gui_run_slice( uint32_t nanosecs )
+{
+    android_gui_nanos += nanosecs;
+    if( android_gui_nanos > GUI_TICK_PERIOD ) { /* 10 ms */
+        android_gui_nanos -= GUI_TICK_PERIOD;
+        android_gui_ticks ++;
+        uint32_t current_period = android_gui_ticks * GUI_TICK_PERIOD;
+
+        // Run the event loop
+        tqueue_process_all();
+
+        struct timeval tv;
+        gettimeofday(&tv,NULL);
+        uint32_t ns = ((tv.tv_sec - android_gui_lasttv.tv_sec) * 1000000000) +
+        (tv.tv_usec - android_gui_lasttv.tv_usec)*1000;
+        if( (ns * 1.05) < current_period ) {
+            // We've gotten ahead - sleep for a little bit
+            struct timespec tv;
+            tv.tv_sec = 0;
+            tv.tv_nsec = current_period - ns;
+            nanosleep(&tv, &tv);
+        }
+
+#if 0
+        /* Update the display every 10 ticks (ie 10 times a second) and
+         * save the current tv value */
+        if( android_gui_ticks > 10 ) {
+            android_gui_ticks -= 10;
+
+            double speed = (float)( (double)current_period * 100.0 / ns );
+            android_gui_lasttv.tv_sec = tv.tv_sec;
+            android_gui_lasttv.tv_usec = tv.tv_usec;
+            main_window_set_speed( main_win, speed );
+        }
+#endif
+    }
+    return nanosecs;
+
+
+}
+
+struct dreamcast_module android_gui_module = { "gui", NULL,
+        android_gui_reset,
+        android_gui_start,
+        android_gui_run_slice,
+        android_gui_stop,
+        NULL, NULL };
+
+gboolean gui_error_dialog( const char *fmt, ... )
+{
<a name="task3" />+    return FALSE; /* <span class="task" style="background-color:#ffff00;" >TODO</span> */
+}
+
+void gui_update_state()
+{
<a name="task4" />+    /* <span class="task" style="background-color:#ffff00;" >TODO</span> */
+}
+
+void gui_set_use_grab( gboolean grab )
+{
+    /* No implementation - mouse grab doesn't exist */
+}
+
+void gui_update_io_activity( io_activity_type activity, gboolean active )
+{
+    /* No implementation */
+}
+
+void gui_do_later( do_later_callback_t func )
+{
<a name="task5" />+    func(); /* <span class="task" style="background-color:#ffff00;" >TODO</span> */
+}
+
+static void android_init( const char *appHomeDir )
+{
+    set_global_log_level("info");
+    appHome = appHomeDir;
+    const char *confFile = g_strdup_printf("%s/lxdreamrc", appHome);
+    set_user_data_path(appHome);
+    lxdream_set_config_filename( confFile );
+    lxdream_make_config_dir( );
+    lxdream_load_config( );
+    iso_init();
+    gdrom_list_init();
+    vmulist_init();
+    dreamcast_init(1);
+
+    dreamcast_register_module( &android_gui_module );
+    audio_init_driver(NULL);
+    display_driver_t display_driver = get_display_driver_by_name(NULL);
+    display_set_driver(display_driver);
+
+    hotkeys_init();
+    serial_init();
+    maple_reattach_all();
+    INFO( "%s! ready...", APP_NAME );
+    android_start_thread();
+}
+
+
+/************************* Dreamcast native entry points **************************/
+
+static char *getStringChars( JNIEnv *env, jstring str );
+
+/**
+ * Main initialization entry point. We need to do all the setup that main()
+ * would normally do, as well as any UI specific setup.
+ */
+JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_init(JNIEnv * env, jclass obj,  jstring homeDir )
+{
+    android_init( getStringChars(env, homeDir) );
+}
+
+JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_run(JNIEnv * env, jclass obj)
+{
+    tqueue_post_message( android_callback_wrapper, dreamcast_run );
+}
+
+JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_toggleRun(JNIEnv * env, jclass obj)
+{
+    tqueue_post_message( android_toggle_run, NULL );
+}
+
+JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_reset(JNIEnv * env, jclass obj)
+{
+    tqueue_post_message( android_callback_wrapper, dreamcast_reset );
+}
+
+JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_stop(JNIEnv * env, jclass obj)
+{
+    /* Need to make sure this completely shuts down before we return */
+    tqueue_send_message( android_callback_wrapper, dreamcast_stop );
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lxdream_Dreamcast_isRunning(JNIEnv *env, jclass obj)
+{
+    return dreamcast_is_running();
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lxdream_Dreamcast_isRunnable(JNIEnv *env, jclass obj)
+{
+    return dreamcast_can_run();
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lxdream_Dreamcast_mount(JNIEnv *env, jclass obj, jstring str)
+{
+    char *s = getStringChars(env, str);
+    return tqueue_send_message( android_mount_disc, s );
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lxdream_Dreamcast_unmount(JNIEnv *env, jclass obj)
+{
+    tqueue_post_message( android_callback_wrapper, gdrom_unmount_disc );
+}
+
+
+/************************* LxdreamView native entry points **************************/
+
+JNIEXPORT void JNICALL Java_org_lxdream_LxdreamView_setSurface(JNIEnv * env, jobject view, jobject surface, jint width, jint height)
+{
+    current_surface.win = ANativeWindow_fromSurface(env, surface);
+    current_surface.width = width;
+    current_surface.height = height;
+    int fmt = ANativeWindow_getFormat(current_surface.win);
+    if( fmt == WINDOW_FORMAT_RGB_565 ) {
+        current_surface.format = COLFMT_RGB565;
+    } else {
+        current_surface.format = COLFMT_RGB888;
+    }
+    tqueue_post_message( android_set_surface, &current_surface );
+}
+
+JNIEXPORT void JNICALL Java_org_lxdream_LxdreamView_clearSurface(JNIEnv * env, jobject view, jobject surface)
+{
+    /* Need to make sure this completely shuts down before we return */
+    tqueue_send_message( android_clear_surface, &current_surface );
+}
+
+
+/************************* JNI Support functions **************************/
+
+static char *getStringChars( JNIEnv *env, jstring str )
+{
+    jboolean iscopy;
+    const char *p = (*env)->GetStringUTFChars(env, str, &iscopy);
+    char *result = strdup(p);
+    (*env)->ReleaseStringUTFChars(env,str,p);
+    return result;
+}
</pre></div>
<hr /><a name="file26" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span id="removed" class="pathname" style="font-family:monospace; float:right; background-color:#ffdddd;" >lxdream/src</span><br />
<div id="removed" class="fileheader" style="margin-bottom:.5em; background-color:#ffdddd;" ><big><b>gui_jni.c</b></big> <small id="info" style="color: #888888;" >removed after 6b54ef5ed413</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/gui_jni.c
+++ lxdream/src/gui_jni.c
@@ -1,120 +0,0 @@
</small></pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-/**
- * $Id$
- *
- * JNI wrappers for operating the emulator from Java.
- *
- * Copyright (c) 2012 Nathan Keynes.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <jni.h>
-#include <android/log.h>
-#include <libisofs.h>
-#include "dreamcast.h"
-#include "gui.h"
-#include "config.h"
-#include "lxpaths.h"
-#include "display.h"
-#include "gdlist.h"
-#include "hotkeys.h"
-#include "serial.h"
-#include "aica/audio.h"
-#include "drivers/video_gl.h"
-#include "maple/maple.h"
-#include "vmu/vmulist.h"
-
-static char *getStringChars( JNIEnv *env, jstring str )
-{
-    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 );
-    lxdream_make_config_dir( );
-    lxdream_load_config( );
-    iso_init();
-    gdrom_list_init();
-    vmulist_init();
-    dreamcast_init(1);
-
-    audio_init_driver(NULL);
-    display_driver_t display_driver = get_display_driver_by_name(NULL);
-    display_set_driver(display_driver);
-
-    hotkeys_init();
-    serial_init();
-    maple_reattach_all();
-    INFO( "%s! ready...", APP_NAME );
-}
-
-JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_setViewSize(JNIEnv * env, jclass obj, jint width, jint height)
-{
-    gl_set_video_size(width, height);
-}
-
-JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_run(JNIEnv * env, jclass obj)
-{
-    dreamcast_run();
-}
-
-JNIEXPORT void JNICALL Java_org_lxdream_Dreamcast_stop(JNIEnv * env, jclass obj)
-{
-    dreamcast_stop();
-}
-
-gboolean gui_parse_cmdline( int *argc, char **argv[] )
-{
-    return TRUE;
-}
-
-gboolean gui_init( gboolean debug, gboolean fullscreen )
-{
-    return TRUE;
-}
-
-void gui_main_loop( gboolean run ) {
-    if( run ) {
-        dreamcast_run();
-    }
-}
-
-gboolean gui_error_dialog( const char *fmt, ... )
-{
-    return TRUE;
-}
-
-void gui_update_state()
-{
-}
-
-void gui_set_use_grab( gboolean grab )
-{
-}
-
-void gui_update_io_activity( io_activity_type activity, gboolean active )
-{
-}
-
-void gui_do_later( do_later_callback_t func )
-{
-    func();
-}
</pre></div>
<hr /><a name="file27" /><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/pvr2</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>glutil.c</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/pvr2/glutil.c
+++ lxdream/src/pvr2/glutil.c
@@ -41,6 +41,14 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     return isGLExtensionSupported("GL_ARB_texture_mirrored_repeat");
 }
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+gboolean isOpenGLES2()
+{
+    const char *str = glGetString(GL_VERSION);
+    if( strncmp(str, "OpenGL ES 2.", 12) == 0 ) {
+        return TRUE;
+    }
+}
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > /**
  * Check if there's at least 2 texture units
  */
</pre></div>
<hr /><a name="file28" /><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/pvr2</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>glutil.h</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/pvr2/glutil.h
+++ lxdream/src/pvr2/glutil.h
@@ -33,6 +33,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >  */
 gboolean isGLExtensionSupported( const char *extension );
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+gboolean isOpenGLES2();
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > /**
  * Dump GL information to the output stream, usually for debugging purposes
  */
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -106,6 +108,18 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT
 #endif
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+#if defined(GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT) && !defined(GL_UNSIGNED_SHORT_1_5_5_5_REV)
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT
+#endif
+
+#if defined(GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT) && !defined(GL_UNSIGNED_SHORT_4_4_4_4_REV)
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT
+#endif
+
+#if defined(GL_BGRA_EXT) && !defined(GL_BGRA)
+#define GL_BGRA GL_BGRA_EXT
+#endif
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #if defined(HAVE_OPENGL_FBO_EXT) && !defined(HAVE_OPENGL_FBO)
 #define glGenFramebuffers glGenFramebuffersEXT
 #define glGenRenderbuffers glGenRenderbuffersEXT
</pre></div>
<hr /><a name="file29" /><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/tools</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>Makefile.in</b></big> <small id="info" style="color: #888888;" >6b54ef5ed413 -> 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/tools/Makefile.in
+++ lxdream/src/tools/Makefile.in
@@ -80,6 +80,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > AMTAR = @AMTAR@
 ANDROID_GDBSERVER = @ANDROID_GDBSERVER@
 ANDROID_NDK_HOME = @ANDROID_NDK_HOME@
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ANDROID_NDK_VERSION = @ANDROID_NDK_VERSION@
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > ANDROID_SDK_HOME = @ANDROID_SDK_HOME@
 ANDROID_SDK_VERSION = @ANDROID_SDK_VERSION@
 ANT = @ANT@
</pre></div>
<hr /><a name="file30" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span id="added" class="pathname" style="font-family:monospace; float:right; background-color:#ddffdd;" >lxdream/src</span><br />
<div id="added" class="fileheader" style="margin-bottom:.5em; background-color:#ddffdd;" ><big><b>tqueue.c</b></big> <small id="info" style="color: #888888;" >added at 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/tqueue.c
+++ lxdream/src/tqueue.c
@@ -0,0 +1,137 @@
</small></pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+/**
+ * $Id$
+ *
+ * Bounded, blocking queue for inter-thread communication.
+ *
+ * Copyright (c) 2012 Nathan Keynes.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <assert.h>
+#include <pthread.h>
+#include "tqueue.h"
+
+#define TQUEUE_LENGTH 64
+
+typedef struct {
+    tqueue_callback callback;
+    void *data;
+    gboolean synchronous;
+} tqueue_entry;
+
+struct {
+    pthread_mutex_t mutex;
+    pthread_cond_t consumer_wait;
+    pthread_cond_t producer_sync_wait;
+    pthread_cond_t producer_full_wait;
+    int head;  /* next item returned by dequeue */
+    int tail;  /* next item filled in by enqueue */
+    int last_result; /* Result value of last dequeued callback */
+    tqueue_entry tqueue[TQUEUE_LENGTH];
+} tqueue = {PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0, -1};
+
+/************** Producer thread **************/
+#define TQUEUE_EMPTY() (tqueue.head == tqueue.tail)
+#define TQUEUE_FULL() ((tqueue.head == tqueue.tail+1) || (tqueue.head == 0 && tqueue.tail == TQUEUE_LENGTH))
+
+static void tqueue_enqueue( tqueue_callback callback, void *data, gboolean sync )
+{
+    assert( !TQUEUE_FULL() );
+    tqueue.tqueue[tqueue.tail].callback = callback;
+    tqueue.tqueue[tqueue.tail].data = data;
+    tqueue.tqueue[tqueue.tail].synchronous = sync;
+    tqueue.tail++;
+}
+
+/**
+ * Add a message to the UI queue and return immediately.
+ */
+void tqueue_post_message( tqueue_callback callback, void *data )
+{
+    pthread_mutex_lock(&tqueue.mutex);
+    if( TQUEUE_FULL() ) {
+        /* Wait for the queue to clear */
+        pthread_cond_wait(&tqueue.producer_full_wait, &tqueue.mutex);
+    }
+    tqueue_enqueue( callback, data, FALSE );
+    pthread_cond_signal(&tqueue.consumer_wait);
+    pthread_mutex_unlock(&tqueue.mutex);
+}
+
+/**
+ * Add a message to the UI queue and wait for it to be handled.
+ * @return the result from the handler function.
+ */
+int tqueue_send_message( tqueue_callback callback, void *data )
+{
+    pthread_mutex_lock(&tqueue.mutex);
+    if( TQUEUE_FULL() ) {
+        /* Wait for the queue to clear */
+        pthread_cond_wait(&tqueue.producer_full_wait, &tqueue.mutex);
+    }
+    tqueue_enqueue( callback, data, TRUE );
+    pthread_cond_signal(&tqueue.consumer_wait);
+    pthread_cond_wait(&tqueue.producer_sync_wait, &tqueue.mutex);
+    return tqueue.last_result;
+    pthread_mutex_unlock(&tqueue.mutex);
+}
+
+/************** Consumer thread **************/
+
+/* Note: must be called with mutex locked */
+static void tqueue_process_loop() {
+    while( !TQUEUE_EMPTY() ) {
+        gboolean wasFull = TQUEUE_FULL();
+        tqueue_callback callback = tqueue.tqueue[tqueue.head].callback;
+        void *data = tqueue.tqueue[tqueue.head].data;
+        gboolean sync = tqueue.tqueue[tqueue.head].synchronous;
+        tqueue.head++;
+
+        if( wasFull ) {
+            pthread_cond_signal( &tqueue.producer_full_wait );
+        }
+
+        pthread_mutex_unlock(&tqueue.mutex);
+        int result = callback(data);
+        pthread_mutex_lock(&tqueue.mutex);
+        if( sync ) {
+            tqueue.last_result = result;
+            pthread_cond_signal( &tqueue.producer_sync_wait );
+        }
+    }
+}
+
+/**
+ * Process all messages in the queue, if any.
+ */
+void tqueue_process_all()
+{
+    pthread_mutex_lock(&tqueue.mutex);
+    if( !TQUEUE_EMPTY() ) {
+        tqueue_process_loop();
+    }
+    pthread_mutex_unlock(&tqueue.mutex);
+}
+
+/**
+ * Process the first message in the queue. If no messages are on the
+ * queue, waits for the next one to be queued and then processes it.
+ */
+void tqueue_process_wait()
+{
+    pthread_mutex_lock(&tqueue.mutex);
+    if( TQUEUE_EMPTY() ) {
+        pthread_cond_wait( &tqueue.consumer_wait, &tqueue.mutex );
+    }
+    tqueue_process_loop();
+    pthread_mutex_unlock(&tqueue.mutex);
+}
</pre></div>
<hr /><a name="file31" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span id="added" class="pathname" style="font-family:monospace; float:right; background-color:#ddffdd;" >lxdream/src</span><br />
<div id="added" class="fileheader" style="margin-bottom:.5em; background-color:#ddffdd;" ><big><b>tqueue.h</b></big> <small id="info" style="color: #888888;" >added at 01e0020adf88</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/tqueue.h
+++ lxdream/src/tqueue.h
@@ -0,0 +1,62 @@
</small></pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+/**
+ * $Id$
+ *
+ * Bounded, blocking queue for inter-thread communication. Note: consumer side is
+ * re-entrant.
+ *
+ * Copyright (c) 2012 Nathan Keynes.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef lxdream_tqueue_H
+#define lxdream_tqueue_H 1
+
+#include "glib/gtypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Callback function to be invoked on the consumer side.
+ */
+typedef int (*tqueue_callback)(void *);
+
+/**
+ * Add a message to the UI queue and return immediately.
+ */
+void tqueue_post_message( tqueue_callback callback, void *data );
+
+/**
+ * Add a message to the UI queue and wait for it to be handled.
+ * @return the result from the handler function.
+ */
+int tqueue_send_message( tqueue_callback callback, void *data );
+
+/************** Consumer thread **************/
+
+/**
+ * Process all messages in the queue, if any.
+ */
+void tqueue_process_all();
+
+/**
+ * Process the first message in the queue. If no messages are on the
+ * queue, waits for the next one to be queued and then processes it.
+ */
+void tqueue_process_wait();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !lxdream_tqueue_H */
</pre></div>
<center><small>Chaos Theory</small></center>
</div></body></html>