diff --git a/project/jni/application/src b/project/jni/application/src index 59d41f41e..1530582ff 120000 --- a/project/jni/application/src +++ b/project/jni/application/src @@ -1 +1 @@ -fheroes2 \ No newline at end of file +vice \ No newline at end of file diff --git a/project/jni/application/vice/AndroidAppSettings.cfg b/project/jni/application/vice/AndroidAppSettings.cfg new file mode 100644 index 000000000..2663cc217 --- /dev/null +++ b/project/jni/application/vice/AndroidAppSettings.cfg @@ -0,0 +1,33 @@ +# The application settings for Android libSDL port +AppSettingVersion=15 +LibSdlVersion=1.2 +AppName="ViceC64" +AppFullName=org.viceteam.sdl +ScreenOrientation=h +InhibitSuspend=n +AppDataDownloadUrl="Data files size is 1 Mb|http://anddev.at.ua/data/vice-data.zip?attredirects=0&d=1" +SdlVideoResize=y +SdlVideoResizeKeepAspect=n +NeedDepthBuffer=n +AppUsesMouse=n +AppNeedsTwoButtonMouse=n +AppNeedsArrowKeys=y +AppNeedsTextInput=y +AppUsesJoystick=n +AppHandlesJoystickSensitivity=n +AppUsesMultitouch=n +NonBlockingSwapBuffers=n +RedefinedKeys="LALT RETURN KP_PLUS KP_MINUS LCTRL" +AppTouchscreenKeyboardKeysAmount=3 +AppTouchscreenKeyboardKeysAmountAutoFire=0 +MultiABI=n +AppVersionCode=12001 +AppVersionName="2.2.01" +CompiledLibraries="jpeg png" +CustomBuildScript=y +AppCflags='' +AppLdflags='' +AppSubdirsBuild='' +AppUseCrystaXToolchain=n +AppCmdline='/sdcard/app-data/org.viceteam.sdl/vice -sdlcustomw 480 -sdlcustomh 320 -sdllimitmode 1 -menukey 306' +ReadmeText='^You may press "Home" now - the data will be downloaded in background' diff --git a/project/jni/application/vice/AndroidBuild.sh b/project/jni/application/vice/AndroidBuild.sh new file mode 100755 index 000000000..bcbb0eedb --- /dev/null +++ b/project/jni/application/vice/AndroidBuild.sh @@ -0,0 +1,17 @@ +#!/bin/sh + + +LOCAL_PATH=`dirname $0` +LOCAL_PATH=`cd $LOCAL_PATH && pwd` + +ln -sf libsdl-1.2.so $LOCAL_PATH/../../../obj/local/armeabi/libSDL.so + +if [ \! -f vice/configure ] ; then + sh -c "cd vice && ./autogen.sh" +fi + +if [ \! -f vice/Makefile ] ; then + ../setEnvironment.sh sh -c "cd vice && ./configure --host=arm-eabi --without-x --enable-sdlui --with-sdlsound --without-resid" +fi + +make -C vice && mv -f vice/src/x64 libapplication.so diff --git a/project/jni/application/vice/icon.png b/project/jni/application/vice/icon.png new file mode 100644 index 000000000..d67d70b87 Binary files /dev/null and b/project/jni/application/vice/icon.png differ diff --git a/project/jni/application/vice/readme.txt b/project/jni/application/vice/readme.txt new file mode 100644 index 000000000..114006ebd --- /dev/null +++ b/project/jni/application/vice/readme.txt @@ -0,0 +1,2 @@ +Download VICE from https://vice-emu.svn.sourceforge.net/svnroot/vice-emu/trunk/vice , +put or symlink it here under dir name "vice", and hit build.sh. diff --git a/project/jni/application/vice/vice b/project/jni/application/vice/vice new file mode 120000 index 000000000..3756e5e02 --- /dev/null +++ b/project/jni/application/vice/vice @@ -0,0 +1 @@ +../../../../../vice \ No newline at end of file diff --git a/project/jni/sdl-1.2/src/video/android/SDL_androidvideo-1.2.c b/project/jni/sdl-1.2/src/video/android/SDL_androidvideo-1.2.c index b53d7eb00..02f61f06c 100644 --- a/project/jni/sdl-1.2/src/video/android/SDL_androidvideo-1.2.c +++ b/project/jni/sdl-1.2/src/video/android/SDL_androidvideo-1.2.c @@ -100,7 +100,7 @@ static void ANDROID_UpdateRects(_THIS, int numrects, SDL_Rect *rects); /* Private display data */ -#define SDL_NUMMODES 9 +#define SDL_NUMMODES 10 static SDL_Rect *SDL_modelist[SDL_NUMMODES+1]; //#define SDL_modelist (this->hidden->SDL_modelist) @@ -233,12 +233,14 @@ int ANDROID_VideoInit(_THIS, SDL_PixelFormat *vformat) SDL_modelist[3]->w = 640; SDL_modelist[3]->h = 400; // Will likely be shrinked SDL_modelist[4]->w = 320; SDL_modelist[4]->h = 240; // Always available on any screen and any orientation SDL_modelist[5]->w = 320; SDL_modelist[5]->h = 200; // Always available on any screen and any orientation - SDL_modelist[6]->w = 256; SDL_modelist[6]->h = 224; // Always available on any screen and any orientation + SDL_modelist[6]->w = 256; SDL_modelist[6]->h = 224; // For REminiscence SDL_modelist[7]->w = SDL_ANDROID_sWindowWidth * 2 / 3; SDL_modelist[7]->h = SDL_ANDROID_sWindowHeight * 2 / 3; SDL_modelist[8]->w = SDL_ANDROID_sWindowWidth / 2; SDL_modelist[8]->h = SDL_ANDROID_sWindowHeight / 2; SDL_modelist[9] = NULL; + //SDL_modelist[9]->w = 533; SDL_modelist[9]->h = 320; // For VICE + //SDL_modelist[10] = NULL; SDL_VideoInit_1_3(NULL, 0); diff --git a/project/jni/sdl_main/sdl_main.c b/project/jni/sdl_main/sdl_main.c index 76e2ddf7d..6c1bb540d 100644 --- a/project/jni/sdl_main/sdl_main.c +++ b/project/jni/sdl_main/sdl_main.c @@ -30,7 +30,7 @@ extern C_LINKAGE void JAVA_EXPORT_NAME(DemoRenderer_nativeInit) ( JNIEnv* env, jobject thiz, jstring cmdline ) { int i = 0; - char curdir[512]; + char curdir[512], realcurdir[512]; const jbyte *jstr; const char * str = "sdl"; int argc = 0; @@ -47,8 +47,10 @@ JAVA_EXPORT_NAME(DemoRenderer_nativeInit) ( JNIEnv* env, jobject thiz, jstring strcat(curdir, SDL_CURDIR_PATH); strcat(curdir, "/files"); } - chdir(curdir); - setenv("HOME", curdir, 1); + if( realpath(curdir, realcurdir) == NULL ) + strcpy(realcurdir, curdir); + chdir(realcurdir); + setenv("HOME", realcurdir, 1); jstr = (*env)->GetStringUTFChars(env, cmdline, NULL);