Giter Club home page Giter Club logo

pelya / commandergenius Goto Github PK

View Code? Open in Web Editor NEW

This project forked from albertz/commandergenius

529.0 529.0 248.0 560.36 MB

Port of SDL library and several games to the Android OS.

Home Page: http://libsdl-android.sourceforge.net/

License: GNU Lesser General Public License v2.1

Shell 0.33% Java 0.41% Python 17.21% Makefile 1.51% C 61.89% C++ 17.35% Assembly 0.42% HTML 0.46% Perl 0.04% Objective-C 0.13% E 0.01% CSS 0.01% CMake 0.05% R 0.01% Inno Setup 0.02% Logos 0.01% Batchfile 0.02% DIGITAL Command Language 0.01% Yacc 0.01% xBase 0.12%

commandergenius's People

Contributors

albertz avatar bob-the-hamster avatar cgisquet avatar gerstrong avatar gjtorikian avatar grumbel avatar gyf9835 avatar jahrome avatar jil8885 avatar krosk avatar licaon-kter avatar lubomyr avatar miguelhorta avatar nitomartinez avatar pelya avatar semphriss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

commandergenius's Issues

"powered by" logo

I had done porting one of the classic game, and i think it is good idea to add logo of you project.

Do you have such logos?

Rebuilding SDL_Sound

I'm trying to build SDL_Sound for Android, specifically, a patched model for MKXP, as it's part of the sound system that the project uses along with fluidsynth etc. (https://github.com/Ancurio/mkxp) This project seems to be one of the better ones for working with SDL_Sound, so I'm wondering if I can use these tools to build SDL_Sound for SDL2, include the patches, and have a library to build other projects with.

Problems on video 'adreno 320'

I use 8bpp SDL_SWSURFACE | SDL_HWPALETTE video mode, and i have some problems with adreno 320: game hangs up on devices with this video.

Problem devices:

    Google
        Nexus 4– mako
        Nexus 10– manta
    HTC
        HTC One– m7
    Huawei
        MTC Viva– hwu8816
        HUAWEI U9508– hwu9508
    LGE
        LG-E615– m4ds
    Samsung
        Galaxy S 4– jflte
        Galaxy S4 LTE A– ks01lteskt
        Galaxy S4– jflteMetroPCS
        Galaxy S 4– jaltektt
    Sony Ericsson
        Xperia Z – SO-02E
        Xperia Z– C6603
        Xperia ZL– C6502
        Xperia Z– C6606
    Нет данных
        SGP321

Common cases:

Just downloaded last night. I have a stock Sprint HTC One. When the game starts up, it hangs as soon as I touch the screen. Cannot start a game even it that menu comes up.
Device: Samsung Galaxy s4 i9505.
Trouble: When open application on few moments see splashscreen. After only black screen and google advertisment top of screen. Advertisment work. Android think that application work. But no reaction on screen click.
I have galaxy s4. Game starts and then freezes with Westwood logo in background.

Been waiting for the whole dune series to end up on Android. Now it's here and it doesn't work. Very frustrating. I see many others complaining about the same thing.

I was hoping with this latest update it would be fixed. But it not.

Hover does not work with jitter filter disabled

Also tone down jitter filter, add togglable on-screen buttons for Ctrl/Alt/Shift to Gimp, and modify it's default config - turn off 'Show pointer for paint tools', 'Show brush outline' and rulers.

Trackball movement much too slow

I'm trying out OpenTTD on a HTC Dream, which has a relatively small trackball, and the cursor movement speed is just glacial, even with speed and acceleration set to "fast". Makes the game as good as unplayable.

Trying to compile fheroes2

Is there a build script missing for the fheroes2 application? I downloaded the source code for fheroes2 and put it under project/jni/application/src/fheroes2 however when i run build.sh it does not seem to compile the project. Is it missing the AndroidBuild.sh or some other build file?

jack and midi input not run

hello i am connecting a Hecules midi controller to mixxx program. the controller is detected in console but to launch Qjaq-control show an error: could not connect to jack server from client. the global operation fallen. and in the text message i see

shm:remove: shmid32160006 is still mapedd to addr 0x42454000, it will be deleted on shmdt () call
shmdt: unmaped addr addr 0x42454000 for FD16 ID 2 shmid 32160006
shm_remove deleting shmid 32160006
shm_find id: can not find shmid 32160006
shm_remove: ERROR shmid 32160006 does not exist

i read it is an bug.
I put the user in the audio group but nothing
in other reading i see the error is does not exist the snd-pcm-oss module and others
with the lsmod command i see there is not modules installed and when i install with modprobe it, they shown error and i can not to install

helpme please.

Ported SDL app runtime problems

Hi

I ported an SDL game into an app using commandergenius. the build is successful, I have a signed app MainActivity-debug.apk and able to install it into the Andriod emulator.

In the emulator the app launches with a splash screen, data.zip is loaded then it fails.

This is the output from the emulator shell, logcat:

(Other information about the ported application, build, resources and emulator follow this logcat output)

I/SDL     ( 1269): libSDL: Creating startup screen
I/Choreographer(  662): Skipped 166 frames!  The application may be doing too much work on its main thread.
I/SDL     ( 1269): libSDL: onWindowFocusChanged: true - sending onPause/onResume
I/SDL     ( 1269): libSDL: Loading libraries
I/SDL     ( 1269): libSDL: loaded GLESv2 lib
I/SDL     ( 1269): libSDL: loading lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_native_helpers.so
D/dalvikvm( 1269): Trying to load lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_native_helpers.so 0xb2d186e0
D/dalvikvm( 1269): Added shared lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_native_helpers.so 0xb2d186e0
D/dalvikvm( 1269): No JNI_OnLoad found in /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_native_helpers.so 0xb2d186e0, skipping init
I/SDL     ( 1269): libSDL: loading lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl-1.2.so
D/dalvikvm( 1269): Trying to load lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl-1.2.so 0xb2d186e0
D/dalvikvm( 1269): Added shared lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl-1.2.so 0xb2d186e0
I/SDL     ( 1269): libSDL: loading lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_mixer.so
D/dalvikvm( 1269): Trying to load lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_mixer.so 0xb2d186e0
D/gralloc_goldfish( 1269): Emulator without GPU emulation detected.
D/dalvikvm( 1269): Added shared lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_mixer.so 0xb2d186e0
D/dalvikvm( 1269): No JNI_OnLoad found in /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_mixer.so 0xb2d186e0, skipping init
I/SDL     ( 1269): libSDL: loading lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_image.so
D/dalvikvm( 1269): Trying to load lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_image.so 0xb2d186e0
D/dalvikvm( 1269): Added shared lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_image.so 0xb2d186e0
D/dalvikvm( 1269): No JNI_OnLoad found in /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_image.so 0xb2d186e0, skipping init
I/SDL     ( 1269): libSDL: Trying to extract binaries from assets binaries-armeabi-v7a.zip
I/SDL     ( 1269): libSDL: Trying to extract binaries from assets binaries-armeabi.zip
I/SDL     ( 1269): libSDL: Trying to extract binaries from assets binaries.zip
I/SDL     ( 1269): libSDL: Loading settings
I/SDL     ( 1269): libSDL: Settings.Load(): enter
I/ActivityManager(  372): Displayed uk.co.interlinux.dsi/.MainActivity: +1s796ms (total +2s146ms)
D/dalvikvm( 1269): GC_CONCURRENT freed 288K, 11% free 2887K/3240K, paused 4ms+4ms, total 101ms
I/SDL     ( 1269): android.os.Build.MODEL: sdk
I/SDL     ( 1269): libSDL: We don't have permission to write to SD card, switching to the internal storage.
I/SDL     ( 1269): libSDL: Settings.Load(): loading settings failed, running config dialog
I/SDL     ( 1269): Device RAM size: 501 Mb, required minimum RAM: 50 Mb
I/SDL     ( 1269): libSDL: Starting data downloader
I/SDL     ( 1269): libSDL: Starting downloader
I/SDL     ( 1269): Downloading data to: '/data/data/uk.co.interlinux.dsi/files'
I/SDL     ( 1269): libSDL: loading lib /data/data/uk.co.interlinux.dsi/files/../lib/libapplication.so
D/dalvikvm( 1269): Trying to load lib /data/data/uk.co.interlinux.dsi/files/../lib/libapplication.so 0xb2d186e0
D/dalvikvm( 1269): Added shared lib /data/data/uk.co.interlinux.dsi/files/../lib/libapplication.so 0xb2d186e0
D/dalvikvm( 1269): No JNI_OnLoad found in /data/data/uk.co.interlinux.dsi/files/../lib/libapplication.so 0xb2d186e0, skipping init
I/SDL     ( 1269): libSDL: loading lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_main.so
D/dalvikvm( 1269): Trying to load lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_main.so 0xb2d186e0
D/dalvikvm( 1269): Added shared lib /data/data/uk.co.interlinux.dsi/files/../lib/libsdl_main.so 0xb2d186e0
I/SDL     ( 1269): Processing download data.zip
I/Choreographer( 1269): Skipped 30 frames!  The application may be doing too much work on its main thread.
I/SDL     ( 1269): Fetching file from assets: data.zip
I/SDL     ( 1269): Reading from zip file 'data.zip'
I/SDL     ( 1269): Reading from zip file 'data.zip' entry 'data/'
I/SDL     ( 1269): Creating dir '/data/data/uk.co.interlinux.dsi/files/data/'

...
... more data continued ...
...

I/SDL     ( 1269): Saving file '/data/data/uk.co.interlinux.dsi/files/data/score.gif'
I/SDL     ( 1269): Saving file '/data/data/uk.co.interlinux.dsi/files/data/score.gif' done
I/SDL     ( 1269): Reading from zip file 'data.zip' finished
I/SDL     ( 1269): libSDL: Initializing video and SDL application
V/SDL     ( 1269): GLSurfaceView_SDL::onWindowResize(): 480x800
V/SDL     ( 1269): GLSurfaceView_SDL::EglHelper::start(): creating GL context
V/SDL     ( 1269): Desired GL config: R5G6B5A0 depth 0 stencil 0 type GLES
V/SDL     ( 1269): GL config 0: R5G6B5A0 depth 0 stencil 0 type 1 (GLES) caveat SLOW nr 1 pos 4 (0,0,0,0,0)
V/SDL     ( 1269): GL config 1: R5G6B5A0 depth 16 stencil 0 type 1 (GLES) caveat SLOW nr 1 pos 5 (0,0,1,1,1)
V/SDL     ( 1269): GL config 2: R8G8B8A0 depth 0 stencil 0 type 1 (GLES) caveat SLOW nr 1 pos 12 (8,8,8,8,8)
V/SDL     ( 1269): GL config 3: R8G8B8A0 depth 16 stencil 0 type 1 (GLES) caveat SLOW nr 1 pos 13 (8,8,9,9,9)
V/SDL     ( 1269): GL config 4: R8G8B8A8 depth 0 stencil 0 type 1 (GLES) caveat SLOW nr 1 pos 13 (8,9,9,9,9)
V/SDL     ( 1269): GL config 5: R8G8B8A8 depth 16 stencil 0 type 1 (GLES) caveat SLOW nr 1 pos 14 (8,9,10,10,10)
V/SDL     ( 1269): GL config 6: R0G0B0A8 depth 0 stencil 0 type 1 (GLES) caveat SLOW nr 1 pos 21 (16,17,17,17,17)
V/SDL     ( 1269): GL config 7: R0G0B0A8 depth 16 stencil 0 type 1 (GLES) caveat SLOW nr 1 pos 22 (16,17,18,18,18)
V/SDL     ( 1269): GLSurfaceView_SDL::EGLConfigChooser::chooseConfig(): selected 0: R5G6B5A0 depth 0 stencil 0 type 1 (GLES) caveat SLOW nr 1 pos 4 (0,0,0,0,0)
V/SDL     ( 1269): GLSurfaceView_SDL::EglHelper::createSurface(): creating GL context
I/SDL     ( 1269): libSDL: DemoRenderer.onSurfaceCreated(): paused false mFirstTimeStart true
I/SDL     ( 1269): libSDL: DemoRenderer.onSurfaceChanged(): paused false mFirstTimeStart false w 480 h 800
I/libSDL  ( 1269): Physical screen resolution is 480x800
I/SDL     ( 1269): libSDL: setting envvar LANGUAGE to 'en_US'
D/SDL     ( 1269): libSDL: Is running on OUYA: false
D/dalvikvm( 1269): GC_CONCURRENT freed 339K, 12% free 3033K/3444K, paused 25ms+2ms, total 133ms
D/dalvikvm( 1269): WAIT_FOR_CONCURRENT_GC blocked 108ms
I/dalvikvm-heap( 1269): Grow heap (frag case) to 8.023MB for 5242896-byte allocation
D/dalvikvm( 1269): GC_FOR_ALLOC freed <1K, 5% free 8153K/8568K, paused 53ms, total 54ms
I/libSDL  ( 1269): Changing curdir to "/data/data/uk.co.interlinux.dsi/files"
I/libSDL  ( 1269): Calling SDL_main("sdl")
I/libSDL  ( 1269): param 0 = "sdl"
I/libSDL  ( 1269): Application closed, calling exit(0)
I/WindowState(  372): WIN DEATH: Window{b33b3bf0 u0 SurfaceView}
I/ActivityManager(  372): Process uk.co.interlinux.dsi (pid 1269) has died.
W/ActivityManager(  372): Force removing ActivityRecord{b2f8b038 u0 uk.co.interlinux.dsi/.MainActivity t7}: app died, no saved state
W/InputDispatcher(  372): channel 'b33e0a10 uk.co.interlinux.dsi/uk.co.interlinux.dsi.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
E/InputDispatcher(  372): channel 'b33e0a10 uk.co.interlinux.dsi/uk.co.interlinux.dsi.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
W/InputDispatcher(  372): Attempted to unregister already unregistered input channel 'b33e0a10 uk.co.interlinux.dsi/uk.co.interlinux.dsi.MainActivity (server)'
I/WindowState(  372): WIN DEATH: Window{b33e0a10 u0 uk.co.interlinux.dsi/uk.co.interlinux.dsi.MainActivity}

Other information about the ported application, build, resources and emulator:

Emulator:

Android 4.4.2 is a basic Android platform.
ARM (armeabi-v7a) processor,
with the following hardware config:
hw.lcd.density=240
hw.ramSize=512
hw.sdCard=yes
vm.heapSize=48

Build:

  • ndk - android-ndk-r8c
  • sdk - android-sdk_r21-linux
  • Ubuntu 12.04.4 LTS
  • Java installed from apt-get repos
    java version "1.6.0_31"
    OpenJDK Runtime Environment (IcedTea6 1.13.3) (6b31-1.13.3-1ubuntu1~0.12.04.2)
    OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)
  • Ant installed from apt-get repos
    Apache Ant(TM) version 1.8.2 compiled on December 3 2011

Environment variables:

PATH=/home/myuserid/andriod-dev/ndk/android-ndk-r8c:/home/myuserid/andriod-dev/sdk/android-sdk-linux/tools/

  • AndroidAppSettings.cfg
AppName="dsi"
AppFullName=uk.co.interlinux.dsi
AppVersionCode=100002
AppVersionName="1.00.07.01"
'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
AppDataDownloadUrl="!DSI Data Files|data.zip"
ResetSdlConfigForThisVersion=y
DeleteFilesOnUpgrade="y"
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
LibSdlVersion=1.2
ScreenOrientation=p
VideoDepthBpp=16
NeedDepthBuffer=n
NeedStencilBuffer=n
NeedGles2=n
SwVideoMode=y
SdlVideoResize=y
SdlVideoResizeKeepAspect=n
InhibitSuspend=y
CreateService=n
CompatibilityHacks=y
CompatibilityHacksStaticInit=n
CompatibilityHacksTextInputEmulatesHwKeyboard=n
CompatibilityHacksPreventAudioChopping=n
CompatibilityHacksAppIgnoresAudioBufferSize=n
CompatibilityHacksAdditionalPreloadedSharedLibraries=""
CompatibilityHacksSlowCompatibleEventQueue=n
CompatibilityHacksTouchscreenKeyboardSaveRestoreOpenGLState=n
CompatibilityHacksProperUsageOfSDL_UpdateRects=n
AppUsesMouse=n
AppNeedsTwoButtonMouse=n
RightMouseButtonLongPress=n
ShowMouseCursor=n
GenerateSubframeTouchEvents=n
ForceRelativeMouseMode=n
AppNeedsArrowKeys=y
AppNeedsTextInput=y
AppUsesJoystick=y
AppUsesSecondJoystick=n
AppUsesThirdJoystick=n
AppUsesAccelerometer=y
AppUsesGyroscope=n
MoveMouseWithGyroscope=n
AppUsesMultitouch=n
AppRecordsAudio=n
AccessSdCard=n
AccessInternet=n
ImmersiveMode=n
NonBlockingSwapBuffers=n
RedefinedKeys="SPACE RETURN PLUS MINUS TAB ESCAPE DELETE"
AppTouchscreenKeyboardKeysAmount=0
RedefinedKeysScreenKb="SPACE RETURN PLUS MINUS TAB ESCAPE DELETE"
RedefinedKeysScreenKbNames="SPACE RETURN PLUS MINUS TAB ESCAPE DELETE"
TouchscreenKeysTheme=0
RedefinedKeysGamepad="SPACE RETURN PLUS MINUS TAB ESCAPE DELETE"
StartupMenuButtonTimeout=0
HiddenMenuOptions=''
FirstStartMenuOptions=''
MultiABI='n'
AppMinimumRAM=50
CompiledLibraries="sdl_mixer sdl_image"
CustomBuildScript=y
AppCflags=''
AppLdflags=''
AppOverlapsSystemHeaders=
AppSubdirsBuild=''
AppBuildExclude=''
AppCmdline=''
MinimumScreenSize=s
AdmobPublisherId=n
AdmobTestDeviceId=
AdmobBannerSize=
  • AndroidBuild.sh
#!/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 dsi/configure ] ; then
    sh -c "cd dsi && ./autogen.sh"
    sh -c "./autogen.sh"
fi
if [ \! -f dsi/Makefile ] ; then
    ../setEnvironment.sh sh -c "cd dsi && ./configure --host=arm-linux-androideabi"
fi
make -C dsi && mv -f dsi libapplication.so

--- end ---

Application structure

Main src folder

../src/dsi

Data folder

../src/data

data.zip created in ../src using zip -r': zip -r data data/

ls AndroidData/
data.zip logo.png

Makefile.am

INCLUDES = -I$(top_srcdir) -I$(srcdir)
bin_PROGRAMS = DSI
#DSI_CFLAGS = -DDSI_DIR=\"$(DESTDIR)$(pkgdatadir)\" \
#  -DDSI_DATA_DIR=\"$(DESTDIR)$(pkgdatadir)/data\" \
#  -DDSI_SCORE_DIR=\"$(DESTDIR)$(localstatedir)/lib/games/dsi\" \
#  -DDSI_PIXMAP_DIR=\"$(DESTDIR)$(datadir)/pixmaps\"
DSI_CFLAGS = -DDSI_DIR=\"$(DESTDIR)\" \
  -DDSI_DATA_DIR=\"$(DESTDIR)data\" \
  -DDSI_SCORE_DIR=\"$(DESTDIR)/lib/games/dsi\" \
  -DDSI_PIXMAP_DIR=\"$(DESTDIR)/pixmaps\"
DSI_SOURCES = main.c rcfile.c sprite.c aliens.c intro.c rungame.c \
  data.c hi_score.c final_score.c sound.c bombs.c  shots.c level.c \
  player.c
DSI_LDADD = -lSDL_mixer -lSDL_image
noinst_HEADERS = *.h

--- end ---

main.c

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <time.h>

#include <SDL/SDL.h>
#include <SDL/SDL_mixer.h>
#include <SDL/SDL_image.h>

#include "config.h"
#include "sound.h"
#include "structs.h"
#include "data.h"
#include "hi_score.h"
#include "final_score.h"
#include "sprite.h"
#include "rungame.h"
#include "intro.h"
#include "rcfile.h"

SDL_Surface *screen;
SDL_Surface *background;

int fullscreen;
char *rcfile;

static void _usage(void)
{
    printf("Usage:\n  %s [Option...]\n\n", PACKAGE_NAME);
    printf("  -?      \tshow this message\n");
    printf("  -v      \tprint version number\n");
    printf("  -f      \tfullscreen\n");
    printf("  -m    m \tbuiltin MOD music\n");
    printf("        w \tbuiltin WAV music\n");
    printf("        n \tno music\n");
    printf("  -t   <file>\tplay music file\n\n");
}

static int _get_rc_prefs(void)
{
    FILE *f = NULL;
    char *arg;

    rcfile = dsi_rc_init("dsirc", 1);
    if (rcfile == NULL)
        return 0;
    if ((f = dsi_open_prefs(rcfile, "[dsi-prefs]")) == NULL)
        return 0;

    if ((arg = dsi_get_tag_arg(f, "fullscreen")) != NULL)
    {
        int i = atoi(arg);
        if (i == 1 || i == 0)
            fullscreen = i;
    }
    if ((arg = dsi_get_tag_arg(f, "track-mode")) != NULL)
    {
        if (0 == strcmp(arg, "m"))
            music_decoder = MPLAY_MOD;
        else if (0 == strcmp(arg, "w"))
            music_decoder = MPLAY_WAV;
        else if (0 == strcmp(arg, "n"))
            music_decoder = MPLAY_NONE;
    }
    if ((arg = dsi_get_tag_arg(f, "track-file")) != NULL)
    {
        if (*arg) {
            music_file = malloc(strlen(arg)+1);
            if (music_file)
            {
                strcpy(music_file, arg);
                music_decoder = MPLAY_FILE;
            }
        }
    }
    fclose(f);
    return 1;
}

static int _init_all(void)
{
    int tally;

    if ((background = LoadImage(DATAFILE("background.gif"), 0)) == NULL)
        return -1;
    if ((tally = rungame_init()) < 0)
        return -1;
    if (sprite_init(tally) < 0)
        return -1;

    if (sound_init() < 0)
        return -1;
    if (intro_init() < 0)
        return -1;
    if (hi_score_init() < 0)
        return -1;
    if (final_score_init() < 0)
        return -1;
    return 1;
}

static void _free_all(void)
{
    rungame_free();
    sprite_free();
    intro_free();
    hi_score_free();
    final_score_free();
    sound_free();
    SDL_FreeSurface(background);
    free(music_file);
}

int main(int argc, char *argv[])
{
    int leave = 0, CarryScore = 0;
    int opt;
    music_decoder = MPLAY_WAV;
    music_file = NULL;
    SDL_Surface *image = NULL;
    SDL_Joystick *joy = NULL;

    //rcfile overrides defaults
    _get_rc_prefs();

    //Command line overrides rcfile
    while ((opt = getopt(argc, argv, "fv?m:t:")) != -1) {
        switch (opt) {
        case 'f':
            fullscreen = 1;
            break;
        case 'm':
            if (0 == strcmp(optarg, "m"))
                music_decoder = MPLAY_MOD;
            else if (0 == strcmp(optarg, "w"))
                music_decoder = MPLAY_WAV;
            else if (0 == strcmp(optarg, "n"))
                music_decoder = MPLAY_NONE;
            else
            {
            printf("%s invalid option to -m   '%s'\n",
                    PACKAGE_NAME, optarg);
                _usage();
                return 0;
            }
            break;
        case 't':
            strncpy(music_file, optarg, PATH_MAX);
            music_file[PATH_MAX -1] = '\0';
            music_decoder = MPLAY_FILE;
            break;
        case 'v':
            printf("%s version is %s\n",
                    PACKAGE_NAME, PACKAGE_VERSION);
            return 0;
        default: /* '?' */
            _usage();
            return 0;
        }
    }

    //Initialize the SDL library
    if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0 )
    {
        fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
        exit(2);
    }

    //Open the audio device
    if ( Mix_OpenAudio(11025, AUDIO_U8, 1, 512) < 0 )
    {
        fprintf(stderr,
        "Warning: Couldn't set 11025 Hz 8-bit audio\n- Reason: %s\n",
                            SDL_GetError());
    }
// seems to be a compile problem with GetNumMusicDecoders and getMusicDecoder
//  else
//  {
//      //Detect music decoders
//      int i, n;
//      n = Mix_GetNumMusicDecoders();
//      for (i = 0; i < n; ++i)
//      {
//          if (0 == strcmp(Mix_GetMusicDecoder(i), "MIKMOD"));
//              music_decoder = MPLAY_MOD;
//      }
//  }
    //Open the display device (if fullscreen -f flag selected
    //at command line)
    //Open the joy stick
#ifdef __LINUX__
    if (SDL_NumJoysticks())
        joy=SDL_JoystickOpen(0);
#endif
    if(fullscreen == 1)
    {
        screen = SDL_SetVideoMode(640, 480, 16, SDL_SWSURFACE|SDL_FULLSCREEN);
        if ( screen == NULL )
        {
            fprintf(stderr, "Couldn't set 640x480 video mode: %s\n",
                                SDL_GetError());
            exit(2);
        }
    }else
    {
#ifdef __LINUX__
        image = IMG_Load(DSI_PIXMAP_DIR "/alien.png");
#else
        image = SDL_LoadBMP("/Alien.ICO");
#endif
        if (image)
            SDL_WM_SetIcon(image, NULL);
        screen = SDL_SetVideoMode(640, 480, 16, SDL_SWSURFACE);
        if ( screen == NULL )
        {
            fprintf(stderr, "Couldn't set 640x480 video mode: %s\n",
                                SDL_GetError());
            exit(2);
        }
        SDL_WM_SetCaption("DSI Space Invaders", "DSI");
    }

    //Initialize the random number generator
    srand(time(NULL));

    //Load the artwork
    if (_init_all() > 0)
    {
        while (leave != RUN_QUIT)
        {
            if (leave == RUN_INTRO)
            {
                leave = intro_run();
            }
            if (leave == RUN_GAME)
            {
                CarryScore = 0;
                leave = RunGame(&CarryScore);
            }
            if (leave == RUN_FINAL)
            {
                leave = final_score_view(CarryScore);
            }
            //if 'v' for view score is pressed in intro and after game
            if (leave == RUN_SCORE)
            {
                leave = hi_score_view();
            }
        }
        //Free the artwork
        _free_all();
    }
    if(joy)
        SDL_JoystickClose(joy);
    Mix_CloseAudio();
    SDL_Quit();
    return 0;
}

I have used these online resources:

http://anddev.at.ua/src/porting_manual.txt

I also attempted this in a different project directory, the demo, alien.c did not run.

I'll try things and run changes as people might think necessary and report back.

This is the project I'm porting: https://sourceforge.net/projects/dspaceinvadors/

I am the lead developer, see REAME

https://sourceforge.net/p/dspaceinvadors/code/HEAD/tree/

Thank you.
Damian

Crash on startup with threading error

I am using a Nexus 6 on Android 5.0.1.
This happens in OpenMSX (see my bug report there), but they told me it was likely a commanderGenius issue so I'm reporting it here.

Below is a copypaste of the issue from OpenMSX:

Just want to post my experience. This happens with both nightly builds and 0.12 stable.

I am on said phone at the moment so forgive my bad log posting. Also note that I am rooted (using superuser, not superSU).

I suck at using locgat, so if this is not enough to go on, I've made a backup of my entire logcat output. Let me know when you need more info.

I think it should be enough though, since it clearly looks like an issue with threading. I have threading turned off in the settings, btw.

I/ActivityManager(  807): Start proc org.openmsx.android.openmsx for activity org.openmsx.android.openmsx/.MainActivity: pid=19671 uid=10211 gids={50211, 9997, 1028, 1015} abi=armeabi
E/AndroidRuntime(19671): FATAL EXCEPTION: Thread-2069
E/AndroidRuntime(19671): Process: org.openmsx.android.openmsx, PID: 19671
E/AndroidRuntime(19671): android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
E/AndroidRuntime(19671):    at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6247)
E/AndroidRuntime(19671):    at android.view.ViewRootImpl.recomputeViewAttributes(ViewRootImpl.java:2877)
E/AndroidRuntime(19671):    at android.view.ViewGroup.recomputeViewAttributes(ViewGroup.java:1292)
E/AndroidRuntime(19671):    at android.view.ViewGroup.recomputeViewAttributes(ViewGroup.java:1292)
E/AndroidRuntime(19671):    at android.view.ViewGroup.recomputeViewAttributes(ViewGroup.java:1292)
E/AndroidRuntime(19671):    at android.view.View.setSystemUiVisibility(View.java:17970)
E/AndroidRuntime(19671):    at org.openmsx.android.openmsx.DimSystemStatusBar$DimSystemStatusBarHoneycomb.dim(MainActivity.java:1302)
E/AndroidRuntime(19671):    at org.openmsx.android.openmsx.MainActivity$1.run(MainActivity.java:296)
E/AndroidRuntime(19671):    at java.lang.Thread.run(Thread.java:818)
I/ActivityManager(  807): Process org.openmsx.android.openmsx (pid 19671) has died
W/InputMethodManagerService(  807): Got RemoteException sending setActive(false) notification to pid 19671 uid 10211

I can't gon on compiling your project

I followed your instruction and compiled your project, but stopped while compiling project/jni/freetype/builds/amiga/src/base/ftdebug.c with many include file missing errors, such as exec/types.h, utility/tagitem.h, and so on. I searched for a long time and couldn't find how to get them. Please tell me a way to compile your project successfully. I use ubuntu with android-ndk-r4.

Blocking SDL_Flip() + Accelerometer control => deadlock

Having some free time again (after several months ...), I adapted the enigma UI for smartphone controls and got the Pause/Resume functionality working. Howewer there is a deadlock if the accelerometer is initialized, the blocking SDL_Flip() behaviour is used and the App ist being paused. In this case, the nativeAccelerometer() call blocks, locking up the whole App.

I did not want to check in changes to the main java source tree after this period of time, but the fix itself is simple - just destroy the accelerometer listener in onPause() and re-initialize it in onResume().

-- Michi

xserver mouse moves only horizontal

Hi

Thanks for the xserver xsdl port. I have one issue with it. It seems like the mouxe clicking does not work. Then i tried relative mode which shows the pointer however the pointerl only moves on a horizantal line.

I am using nexus 7 and4.4.4 cyanogenmod

Thanks

Patch to complete support for any GCC version

This patch completes the partial support for any GCC version

From 98823390351f6a7f58605a26c9114b7e260af358 Mon Sep 17 00:00:00 2001
From: Alex Wulms <[email protected]>
Date: Sun, 5 Oct 2014 15:54:47 +0200
Subject: [PATCH] Support GCCVER parameter in all scripts so that projects can
 be build with any GCC version

---
 build.sh                                  | 13 ++++++++-----
 project/jni/application/setEnvironment.sh |  2 +-
 project/jni/setCrossEnvironment.sh        |  2 +-
 readme.txt                                | 10 ++++++++++
 4 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/build.sh b/build.sh
index 2fd7da1..cc7854d 100755
--- a/build.sh
+++ b/build.sh
@@ -54,6 +54,9 @@ fi
        android update project -p project || exit 1
        rm -f project/src/Globals.java
 }
+
+[ -z "$GCCVER" ] && GCCVER=4.6
+
 # Set here your own NDK path if needed
 # export PATH=$PATH:~/src/endless_space/android-ndk-r7
 NDKBUILDPATH=$PATH
@@ -98,7 +101,7 @@ cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j
                rm obj/local/armeabi/libapplication.so && \
                cp jni/application/src/libapplication-armeabi.so obj/local/armeabi/libapplication.so && \
                cp jni/application/src/libapplication-armeabi.so libs/armeabi/libapplication.so && \
-               `which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-4.6/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi/libapplication.so \
+               `which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-${GCCVER}/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi/libapplication.so \
                || true ; } && \
        {       grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
                grep "MultiABI=" ../AndroidAppSettings.cfg | grep "y\\|all\\|armeabi-v7a" > /dev/null && \
@@ -106,7 +109,7 @@ cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j
                rm obj/local/armeabi-v7a/libapplication.so && \
                cp jni/application/src/libapplication-armeabi-v7a.so obj/local/armeabi-v7a/libapplication.so && \
                cp jni/application/src/libapplication-armeabi-v7a.so libs/armeabi-v7a/libapplication.so && \
-               `which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-4.6/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi-v7a/libapplication.so \
+               `which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-${GCCVER}/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi-v7a/libapplication.so \
                || true ; } && \
         {       grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
                grep "MultiABI=" ../AndroidAppSettings.cfg | grep "armeabi-v7a-hard" > /dev/null && \
@@ -114,7 +117,7 @@ cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j
                rm obj/local/armeabi-v7a-hard/libapplication.so && \
                cp jni/application/src/libapplication-armeabi-v7a-hard.so obj/local/armeabi-v7a-hard/libapplication.so && \
                cp jni/application/src/libapplication-armeabi-v7a-hard.so libs/armeabi-v7a/libapplication.so && \
-               `which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-4.6/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi-v7a/libapplication.so \
+               `which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-${GCCVER}/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi-v7a/libapplication.so \
                || true ; } && \
        {       grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
                grep "MultiABI=" ../AndroidAppSettings.cfg | grep "all\\|mips" > /dev/null && \
@@ -122,7 +125,7 @@ cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j
                rm obj/local/mips/libapplication.so && \
                cp jni/application/src/libapplication-mips.so obj/local/mips/libapplication.so && \
                cp jni/application/src/libapplication-mips.so libs/mips/libapplication.so && \
-               `which ndk-build | sed 's@/ndk-build@@'`/toolchains/mipsel-linux-android-4.6/prebuilt/$MYARCH/bin/mipsel-linux-android-strip --strip-unneeded libs/mips/libapplication.so \
+               `which ndk-build | sed 's@/ndk-build@@'`/toolchains/mipsel-linux-android-${GCCVER}/prebuilt/$MYARCH/bin/mipsel-linux-android-strip --strip-unneeded libs/mips/libapplication.so \
                || true ; } && \
        {       grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
                grep "MultiABI=" ../AndroidAppSettings.cfg | grep "all\\|x86" > /dev/null && \
@@ -130,7 +133,7 @@ cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j
                rm obj/local/x86/libapplication.so && \
                cp jni/application/src/libapplication-x86.so obj/local/x86/libapplication.so && \
                cp jni/application/src/libapplication-x86.so libs/x86/libapplication.so && \
-               `which ndk-build | sed 's@/ndk-build@@'`/toolchains/x86-4.6/prebuilt/$MYARCH/bin/i686-linux-android-strip --strip-unneeded libs/x86/libapplication.so \
+               `which ndk-build | sed 's@/ndk-build@@'`/toolchains/x86-${GCCVER}/prebuilt/$MYARCH/bin/i686-linux-android-strip --strip-unneeded libs/x86/libapplication.so \
                || true ; } && \
        cd .. && ./copyAssets.sh && cd project && \
        {       if $build_release ; then \
diff --git a/project/jni/application/setEnvironment.sh b/project/jni/application/setEnvironment.sh
index a2e8ddc..233f6c9 100755
--- a/project/jni/application/setEnvironment.sh
+++ b/project/jni/application/setEnvironment.sh
@@ -22,7 +22,7 @@ grep "64.bit" "$NDK/RELEASE.TXT" >/dev/null 2>&1 && MYARCH="${MYARCH}_64"

 #echo NDK $NDK
 GCCPREFIX=arm-linux-androideabi
-GCCVER=4.6
+[ -z "$GCCVER" ] && GCCVER=4.6
 PLATFORMVER=android-14
 LOCAL_PATH=`dirname $0`
 if which realpath > /dev/null ; then
diff --git a/project/jni/setCrossEnvironment.sh b/project/jni/setCrossEnvironment.sh
index c779fd9..1d43dc5 100755
--- a/project/jni/setCrossEnvironment.sh
+++ b/project/jni/setCrossEnvironment.sh
@@ -20,7 +20,7 @@ NDK=`readlink -f $NDK`

 #echo NDK $NDK
 GCCPREFIX=arm-linux-androideabi
-GCCVER=4.6
+[ -z "$GCCVER" ] && GCCVER=4.6
 PLATFORMVER=android-8
 LOCAL_PATH=`dirname $0`
 if which realpath > /dev/null ; then
diff --git a/readme.txt b/readme.txt
index cddd184..29d355d 100644
--- a/readme.txt
+++ b/readme.txt
@@ -279,6 +279,16 @@ There is helper script project/jni/application/setEnvironment.sh which will set
 for configure script and makefile, see AndroidBuild.sh in project/jni/application/scummvm dir for reference.


+How to compile your own application using GCC 4.7 or newer
+==========================================================
+
+By default, your application will be build with GCC 4.6. To use a newer version of GCC, e.g. GCC 4.8, set-up
+your project like described but execute following commands before running any of the commandergenius scripts
+to configure or build your project:
+export GCCVER=4.8
+export NDK_TOOLCHAIN_VERSION=${GCCVER}
+
+
 Android application sleep/resume support
 ========================================

-- 
1.8.4.5

SDL resets when native Android display resolution changes

Hello,

As described in issue 3 of XServer XSDL, the SDL app resets itself whenever the native Android display resolution changes.

For example, when I connect my Android device to my computer monitor via HDMI, I increase Android's native display resolution to 1920x1080 using these Android shell commands:

wm resize 1920x1080
wm density 160

This causes any existing SDL apps to reset themselves (I am shown the initial SDL logo screen again --- with the "Change device configuration" button at the top of the screen) and thus lose their state/progress.

Please make SDL resilient to native Android resolution changes so that I don't lose state/progress in my SDL apps (XServer XSDL, OpenTyrian, and more!).

Thanks for your consideration.

Request for game "Simple Sokoban"

I haven't seen any requests for games to be added, but I also didn't see anything against it either, so I'll shoot.

Simple Sokoban is a fairly bare-bones implementation of Sokoban in ANSI C89, that uses SDL for I/O. I think this would be a great game to be able to play on Android. Since it seems like a simple game (really, there are only four buttons), I am hoping someone would not mind porting it.

Problem with portrait mode on Samsung Galaxy Tab 4 tablet (Android 4.4.2 OS)

Hi Pelya,

One of the openMSX users reported following problem:
"I installed openMSX android version (0.11.0-251) on my Samsung Galaxy Tab 4 tablet (Android 4.4.2 OS).
In "Landscape Screen Orientation", openMSX works very well, but when configure "Portrait Screen Orientation" (Change Device Configuration > Video Settings > Portrait/vertical screen orientation) the openMSX cuts the image on both sides"

See https://onedrive.live.com/?cid=5765a0dc9e19ecee&id=5765A0DC9E19ECEE!539&ithint=folder,png&authkey=!ANcYr-_GtoDtq0o for a screenshot

OpenMSX is compiled against version of commandergenius from more then 6 months ago. Don't know the exact date.

Is this a known issue that has meanwhile been fixed? Can we fix openMSX by simply re-baselining against latest version of commandergenius?

Thanks and kind regards,
Alex

Playing midi files through SDL_mixer

It is possible to play .mid files through Mix_PlayMusic in android? In native app its work as expected. But when i build android app i dont hear music. Also i implement sound effects through Mix_PlayChannel and they work in native app and android app.

Maybe i miss something?

Also, this files i can play through Android Media Player and it is work fine.

arx-libertatis

Чувак!
Если возможно, сделай доброе дело:
Arx-Libertatis на SDL и у тебя порт SDL, можно их объединить, как-нибудь?
У меня Android 4.0.4, CPU 1Ghz_2, MEM 215Mb, и я смотрю такая конфа у многих в среднем.
Пускай даже только оболочка, а образ(CD), доставать надо,
Пускай даже минимум 800_600 бесплатный, а большее - за денюжку.
В Рунете очень многие хотят, аж воют от тоски!
А у меня свой резон - комп сломался и будет не скоро.
Объявить можно на 4PDA и на самом arx-libertatis.org
Спасибо.
Удачи в хороших проектах!!!
:-)

Error when closing SDL_Video system

Every time when i exit the game, i have error:

I/libSDL  ( 6328): Calling VideoQuit()
E/libSDL  ( 6328): ERROR: Invalid window
E/libSDL  ( 6328): ERROR: Invalid texture
E/libSDL  ( 6328): ERROR: ANDROID_FreeHWSurface: cannot find freed HW surface in HwSurfaceList array

Any ideas?

Problems with Italian Keyboards (possibly with other non-US keyboards)

I have tested it on an Asus TF700T, both with the dock (italian) keyboard and with an external (wireless) Italian keyboard. I checked, from within a chrooted linux environment, that the keyboard input events are correct (I used evtest to check), but XServer XSDL does not handle all of them correctly (I used xev to check):

  1. Keys AE11 (in the Italian keyboard: apostrophe, question, grave, questiondown)
    and AB10 (minus, underscore, dead_macron, division) are swapped.
  2. DEL, ESC, INS and 102ND (in the Italian keyboard: less, greater) keys do not work at all, they are not even detected by X server
  3. Alt/AltGr+WHATEVERKEY events are seen as if only WHATEVERKEY is pressed (without Alt/AltGr)

See my posts here:
http://forum.xda-developers.com/showpost.php?p=57875401&postcount=7
http://forum.xda-developers.com/showpost.php?p=58129816&postcount=11

Milkytracker and Grafx2 issues

Hi.

I've tested your milkytracker and grafx2 ports for android on my tablet ASUS Transfomer TF101. There are great ports but there isn't support for my keboard+mouse docking.

Is not possible to configure my docking mouse to work with your programs and gain some precision on grafx2 for example. With milkytracker there are some more problems. It seems not working with my physical keyboard anyway. There aren't any keyboard layout or possible configuration to use my keyboard to compose with the pattern editor.

It will be a GREAT idea and improvement to add physical keyboard and mouse support to your programs to users with tablets with docking extensions (keyboard and mouse) like me.

Great job anyway.

Cheers.

Surface error

Hi

I know this may not have anything to do with your particular code, but I'm really needing help here. I'm porting a SDL 1.2 game, using your repo as base, and i'm getting the following error on SDL_SetVideoMode:

04-01 10:37:36.006 15620-15719/com.webpolis.game.soccerkup V/libSDL﹕ calling SDL_SetVideoMode(800, 480, 32, -1879048192)
04-01 10:37:36.006 15620-15719/com.webpolis.game.soccerkup I/libSDL﹕ SDL_SetVideoMode(): application requested mode 800x480 OpenGL 0 HW 0 BPP 32
04-01 10:37:36.006 15620-15719/com.webpolis.game.soccerkup E/libSDL﹕ ERROR: Setting the swap interval is not supported
04-01 10:37:36.006 15620-15719/com.webpolis.game.soccerkup E/libSDL﹕ ERROR: Getting the swap interval is not supported
04-01 10:37:36.006 15620-15719/com.webpolis.game.soccerkup E/libSDL﹕ ERROR: GL_GetAttribute not supported
04-01 10:37:36.006 15620-15719/com.webpolis.game.soccerkup I/libSDL﹕ ANDROID_GL_GetProcAddress("glGetString"): 0x40090cb4
04-01 10:37:36.016 15620-15719/com.webpolis.game.soccerkup V/libSDL﹕ SDL_SetVideoMode(): Requested mode: 800x480x32, obtained mode 800x480x32
04-01 10:37:36.016 15620-15719/com.webpolis.game.soccerkup V/libSDL﹕ SDL_SetVideoMode(): returning surface 0x4f4f0ad0

As you see, the surface is created, but nothing is shown. I'm using existing code, which has been proved to work fine in my desktop. Any way, this error is triggered at the beginning, on initialization, before the game loop.

The piece of code here is:

    SDL_SetVideoMode(ww, hh, 32, SDL_SWSURFACE|SDL_ANYFORMAT|SDL_FULLSCREEN);

I'm doing ndk-debug and the error is triggered after the above line is executed.

In AndroidAppSettings.cfg I have (between other stuff, of course):

VideoDepthBpp=32
SwVideoMode=y
SdlVideoResize=y

Also, inside the game loop, I had to disable

SDL_GL_SwapBuffers();

because it was causing OpenGL video mode has not been set

Is there anything I should check? I am very new to SDL/OpenGL stuff, but I was successful in getting some of the games included in your package to work on my device.

Thanks in advance, any help is very very appreciated. If successful, I will share my code with you.

Mouse still doesn't works and new mouse related problems in Grafx2 after actualitation

Hi! After updating Grafx2 and MilkyTracker from market, new issues appears on my Asus Transformer.

Asus touchpad still unuseable in both applications (Grafx2 and MilkyTracker). Android system cursor moves at different speed than grafx2 and Milkytracker cursors. It will be a good idea make use of Android system cursor only when using mouse/touchpad configurations. Random pulsations are made too when using touchpad and applications went crazy. Mouse is still not working.

Keyboard layout seems to be ok now in Milkytracker.

New issue with Grafx2: Painting cursor appears now like a big 8x8 white square over the original cursor. Impossible to use it now with mouse or without it (touch mode).

Fails to start on a N7 w/ user profiles

I have a Nexus 7. I'm trying to run Xsdl in a second user profile, but I always receive the message: 'Error: X server failed to launch, because of stale Unix socket with non-existing path.'. Power cycling makes no difference.

I've attached the logs.

I suspect this is because there are hard-coded references to paths which aren't valid in a multiprofile system --- e.g. /data/data/x.org.server/files/usr/share/X11/xkb/rules/evdev; on my device it's at /data/user/10/x.org.server/files/usr/share/X11/xkb/rules/evdev.

I also notice that it's failing to create the Unix socket in /tmp/.X11-unix, because I don't have a /tmp; but don't all Android devices not have a /tmp?

I/libSDL (14085): Physical screen resolution is 1920x1200
I/SDL (14085): libSDL: setting envvar LANGUAGE to 'en_GB'
D/SDL (14085): libSDL: Is running on OUYA: false
I/libSDL (14085): moveMouseWithGyroscopeSpeed 2 = 5.000000
I/libSDL (14085): Changing curdir to "/storage/emulated/10/Android/data/x.org.server/files"
I/libSDL (14085): Calling SDL_main("XSDL")
I/libSDL (14085): param 0 = "XSDL"
I/XSDL (14085): Actual video resolution 1920/152x1200/86
I/XSDL (14085): User u10_a95 ID 1010095
I/XSDL (14085): Current video mode: 1920 1200
V/libSDL (14085): calling SDL_SetVideoMode(480, 320, 0, 0)
I/libSDL (14085): SDL_SetVideoMode(): application requested mode 480x320 OpenGL 0 HW 0 BPP 16
E/libSDL (14085): ERROR: Setting the swap interval is not supported
E/libSDL (14085): ERROR: Getting the swap interval is not supported
E/libSDL (14085): ERROR: GL_GetAttribute not supported
I/libSDL (14085): ANDROID_GL_GetProcAddress("glGetString"): 0x408ae864
V/libSDL (14085): SDL_SetVideoMode(): Requested mode: 480x320x16, obtained mode 480x320x16
V/libSDL (14085): SDL_SetVideoMode(): returning surface 0x758333e8
I/SDL (14085): Device: flo
I/SDL (14085): Device name: KTU84L
I/SDL (14085): Device model: Nexus 7
I/SDL (14085): Device board: flo
I/System.out(14085): libSDL: input device ID -1 type 769 name Virtual
I/System.out(14085): libSDL: input device ID 1 type 257 name gpio-keys
I/System.out(14085): libSDL: input device ID 2 type -2147483648 name apq8064-tabla-snd-card Headset Jack
I/System.out(14085): libSDL: input device ID 3 type 257 name apq8064-tabla-snd-card Button Jack
I/System.out(14085): libSDL: input device ID 4 type 257 name h2w button
I/System.out(14085): libSDL: input device ID 5 type -2147483648 name lid_input
I/System.out(14085): libSDL: input device ID 6 type 4098 name elan-touchscreen
I/SDL (14085): AutoDetectTouchInput: hoverTouchDistance 0.0 threshold 552 hover false fingerHover false
I/XSDL (14085): Screen coords 53 74 res 0
I/XSDL (14085): Screen coords 183 125 dpi 0
I/XSDL (14085): TCP port 6000 already used, trying next one: Address already in use
I/XSDL (14085): 2 network interfaces found
I/XSDL (14085): interface: lo address: 127.0.0.1
I/XSDL (14085): interface: wlan0 address: 192.168.148.60
I/XSDL (14085): XSDL video resolution 1920/152x1200/86x16, args:
I/XSDL (14085): > XSDL
I/XSDL (14085): > :1
I/XSDL (14085): > -nolock
I/XSDL (14085): > -noreset
I/XSDL (14085): > -screen
I/XSDL (14085): > 1920/152x1200/86x16
I/XSDL (14085): > -exec
I/XSDL (14085): > /data/user/10/x.org.server/files/usr/bin/xhost + ; /data/user/10/x.org.server/files/usr/bin/xli -onroot -center background.bmp
I/XSDL (14085): InitConnectionLimits: MaxClients = 255
I/XSDL (14085): InitCard: (null)
I/XSDL (14085): Calling SDL_Init()
I/XSDL (14085): _XSERVTrans
I/XSDL (14085): mkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
I/XSDL (14085): _XSERVTrans
I/XSDL (14085): mkdir: ERROR: Cannot create /tmp/.X11-unix
I/XSDL (14085): _XSERVTrans
I/XSDL (14085): SocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
I/XSDL (14085): _XSERVTrans
I/XSDL (14085): MakeAllCOTSServerListeners: failed to create listener for unix
I/XSDL (14085): (WW) Failed to open protocol names file /data/data/x.org.server/files/usr/lib/xorg/protocol.txt
I/XSDL (14085): sdlScreenInit
I/XSDL (14085): Attempting for 1920x1200/16bpp mode
V/libSDL (14085): calling SDL_SetVideoMode(1920, 1200, 16, 0)
I/libSDL (14085): SDL_SetVideoMode(): application requested mode 1920x1200 OpenGL 0 HW 0 BPP 16
E/libSDL (14085): ERROR: Setting the swap interval is not supported
E/libSDL (14085): ERROR: Getting the swap interval is not supported
E/libSDL (14085): ERROR: GL_GetAttribute not supported
I/libSDL (14085): ANDROID_GL_GetProcAddress("glGetString"): 0x408ae864
V/libSDL (14085): SDL_SetVideoMode(): Requested mode: 1920x1200x16, obtained mode 1920x1200x16
V/libSDL (14085): SDL_SetVideoMode(): returning surface 0x758333e8
I/XSDL (14085): Set 1920x1200/16bpp mode
I/XSDL (14085): sdlMapFramebuffer: shadow 0
I/XSDL (14085): sdlRandRInit
I/XSDL (14085): InitOutput()
I/XSDL (14085): sdlCreateRes
I/XSDL (14085): [dix] Could not init font path element /usr/share/fonts/X11/misc/, removing from list!
I/XSDL (14085): [dix] Could not init font path element /usr/share/fonts/X11/TTF/, removing from list!
I/XSDL (14085): [dix] Could not init font path element /usr/share/fonts/X11/OTF/, removing from list!
I/XSDL (14085): [dix] Could not init font path element /usr/share/fonts/X11/Type1/, removing from list!
I/XSDL (14085): [dix] Could not init font path element /usr/share/fonts/X11/100dpi/, removing from list!
I/XSDL (14085): [dix] Could not init font path element /usr/share/fonts/X11/75dpi/, removing from list!
I/XSDL (14085): (EE) XKB: Couldn't open rules file /data/data/x.org.server/files/usr/share/X11/xkb/rules/evdev
I/XSDL (14085): (EE) XKB: Failed to load keymap. Loading default keymap instead.
I/XSDL (14085): (EE) XKB: Couldn't open rules file /data/data/x.org.server/files/usr/share/X11/xkb/rules/evdev
I/XSDL (14085): XKB: Failed to compile keymap
I/XSDL (14085): Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
I/XSDL (14085):
I/XSDL (14085): Fatal server error:
I/XSDL (14085): Failed to activate core devices.
I/XSDL (14085):
I/XSDL (14085): (dix) removing device 2
I/XSDL (14085): (dix) removing device 3
I/XSDL (14085): Current video mode: 1920 1200
V/libSDL (14085): calling SDL_SetVideoMode(480, 320, 0, 0)
I/libSDL (14085): SDL_SetVideoMode(): application requested mode 480x320 OpenGL 0 HW 0 BPP 16
E/libSDL (14085): ERROR: Setting the swap interval is not supported
E/libSDL (14085): ERROR: Getting the swap interval is not supported
E/libSDL (14085): ERROR: GL_GetAttribute not supported
I/libSDL (14085): ANDROID_GL_GetProcAddress("glGetString"): 0x408ae864
V/libSDL (14085): SDL_SetVideoMode(): Requested mode: 480x320x16, obtained mode 480x320x16
V/libSDL (14085): SDL_SetVideoMode(): returning surface 0x758333e8

Deadlock in change device config button's onClick method

If user clicks the button too fast deadlock may happen.

It tries to loadedLibraries.acquireUninterruptibly(); and blocks UI thread so loadedLibraries.release(); never gets called.

Suggested fix (hack): disable button untill it's "ready":

@@ -113,6 +117,7 @@ public class MainActivity extends Activity
                if( Globals.StartupMenuButtonTimeout > 0 )
                {
                        _btn = new Button(this);
+                       _btn.setEnabled(false);
                        _btn.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
                        _btn.setText(getResources().getString(R.string.device_change_cfg));
                        class onClickListener implements View.OnClickListener
@@ -185,6 +190,7 @@ public class MainActivity extends Activity
                                                        Settings.Load(Parent);
                                                        loaded.release();
                                                        loadedLibraries.release();
+                                                       _btn.setEnabled(true);
                                                }
                                        }
                                        Callback2 cb = new Callback2();

unicodestuff.h missing in SDL 1.3

I tried to compile a game using SDL 1.3, but it complained that it couldn't find unicodestuff.h:

jni/../jni/sdl-1.3/src/video/android/SDL_androidinput.c:45:26: fatal error: unicodestuff.h: No such file or directory

Add support for SuperSU where available

It would be great to have support for SuperSU in devices with it available, thus allowing to run a full Debian system without troubles due to not using a true chroot environment.

Middle mouse button emulation

Hi this is not really bug, it is a question. It is possible to configure build to emulate middle button with 2 fingers tap? I mean when i touch screen with two fingers sdl will recive mouse middle press with coords of first finger, when i move fingers it will recive mouse move events with middle button pressed, and finally send mouse up event.

If not, what the best way to implement this behaviour. If possible please say what classes should be modified to implement this. I plan to implement this feature if is not yet available.

Thanks.

XSDL "Change resolution" untouchable resolutions 1024x768 800x600 800x480 640x480

In landscape :
Bottom 3rd row is untouchable.
When a resolution is picked it sets the resolution above it instead.

In portrait :
Right most 3rd column is untouchable.
When a resolution is picked it sets the resolution to the left of it instead.

The following are the resolutions that can't be set :
1024x768 800x600 800x480 640x480

I think it do be better if we could just type in the resolution (& DPI number) inside "Change device configuration"

Choppy video

Trying to run a PC-based arcade game on my MemoPad 7 tablet (x86). 1 GB RAM, CPU Intel Atom Z3745. This runs perfectly on identical hardware on a PC running puppylinux. But it's choppy to the point of being unplayable on my tablet. I am preloading the x86 libandroid-shmem.so file and have the video in a different thread (option in the gui of xserver-xsdl). Anyone else have any suggestions?

singleInstance -> singleTask

I found that android:launchMode="singleInstance" does not work with In-app billing V3, because singleInstance mode does not permits launch subtasks. So i think that it is better to use singleTask mode. Is there any disadvantages?

Cannot compile VCMI

Hello. So, I have got 2387 revision of VCMI and am trying to compile it. Everything seems to work up to step

launch "make" from directory project/jni/application/vcmi

Then compilation fails and make command outputs huge log - http://paste.pocoo.org/show/585738/
I am using Archlinux (Linux localhost 3.3.2-1-ARCH #1 SMP PREEMPT Sat Apr 14 09:48:37 CEST 2012 x86_64 Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz GenuineIntel GNU/Linux) if that matters.
NDK is android-ndk-r5-crystax-2

Combine GLSurfaceView_SDL variant with Android defined view

Hi Buddy,
I have extended your GLSurfaceView_SDL and combine it with Android MediaController which is a FrameLayout.
But it seems that when GLSurfaceView_SDL don't have actual content the MediaController is displayed, once there
comes a drawing picture request from native code(Such as from a specific SDL_main routine) the Android defined
MediaController disappeared.
Do you have any similar try to combine these? What's the expected behavior of it?

XSDL portrait mode + mouse emulation(large,tablets) not working correctly

When moving finger from left-to-right & top-to-bottom WM mouse cursor is incrementally going further away from the finger to the left & bottom.

This happens only in portrait mode. In landscape the problem does not exsist.

How to reproduce:
Settings :
"Video settings" > "Portrait/vertical.screen orientation"
"Mouse emulation" > "Mouse emulation mode" > "Large (tablets)" or "Small, magnifying glass"

Request to support android tv and moga and shield controllers

Hi,

I have received a request from one of the users of openMSX for Android to support android tv and also the moga and shield controllers.

Are there any plans to include this in Android SDL? Or maybe it's already included in most recent version?

Thanks and kind regards,
Alex

Unable to create overlay button.

I want to create button in left-top corner of the screen. I add creation code into end of initSDLInternal method:

private void initSDLInternal()
{
...
        // Receive keyboard events
        DimSystemStatusBar.get().dim(_videoLayout);
        DimSystemStatusBar.get().dim(mGLView);

        Button btnTag = new Button(this);
        btnTag.setLayoutParams(new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.WRAP_CONTENT,
                ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.TOP
                        | Gravity.LEFT));
        btnTag.setText("O");
        btnTag.setId(1);
        btnTag.setClickable(true);
        btnTag.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                Log.e("APP", "CLICK");
                Toast toast = Toast.makeText(MainActivity.this, "YARR!@", Toast.LENGTH_LONG);
                toast.show();
            }
        });

        _videoLayout.addView(btnTag);
}

When game starts i see this button but i cant click on it. I miss something, why this code does not work? Is there any workraound?

xserver with metacity refresh issues

Hi

I can run the xserver ni oroblem. I am running it the way it is sown in the screen, with metacity. Alll works except that when i drag a window it leaves trail meaning tat it never clears the screen, looks like 80s tv effects.

Thanks

Why can't i prevent the a thread exited without detaching from JVM

Hi Pelya,

In my latest commit 1, i created a pthread_key_t 2for threads that created in Java layer, to do a automatically detaching from JVM when the thread exits.

I verified this way works fine in my other JNI related project.

Have your meet the same issue(crashed when a thread created in Java layer & exited from native code without formerly detaching from JVM)?

Just as the typical log:
437 07-28 11:55:45.989 9615 9652 D dalvikvm: threadid=13: thread exiting, not yet detached (count=0)
438 07-28 11:55:45.989 9615 9652 D dalvikvm: threadid=13: thread exiting, not yet detached (count=1)
439 07-28 11:55:45.989 9615 9652 E dalvikvm: threadid=13: native thread exited without detaching
440 07-28 11:55:45.989 9615 9652 E dalvikvm: VM aborting
441 07-28 11:55:45.989 9615 9652 F libc : Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 9652 (GLThread)
442 07-28 11:55:46.020 437 476 D KeyguardUpdateMonitor: Lawmo lock is mLawmoLock=false
443 07-28 11:55:46.028 10275 10322 D AudioHardwareMot: Output latency, from ALSA = 99
444 07-28 11:55:46.051 10275 10322 D AudioHardwareMot: Output latency, from ALSA = 99
445 07-28 11:55:46.075 10275 10322 D AudioHardwareMot: Output latency, from ALSA = 99
446 07-28 11:55:46.098 10275 10322 D AudioHardwareMot: Output latency, from ALSA = 99
447 07-28 11:55:46.114 15784 15784 I DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
448 07-28 11:55:46.114 15784 15784 I DEBUG : Build fingerprint: 'motorola/XT910_cn/umts_spyder:4.1.2/6.7.2_GC-381/398:user/release-keys'
449 07-28 11:55:46.114 15784 15784 I DEBUG : pid: 9615, tid: 9652, name: GLThread >>> org.ffmpeg.ffplayer <<<
450 07-28 11:55:46.114 15784 15784 I DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
451 07-28 11:55:46.122 10275 10322 D AudioHardwareMot: Output latency, from ALSA = 99
452 07-28 11:55:46.145 10275 10322 D AudioHardwareMot: Output latency, from ALSA = 99
453 07-28 11:55:46.176 10275 10322 D AudioHardwareMot: Output latency, from ALSA = 99
454 07-28 11:55:46.614 15784 15784 I DEBUG : tls: 5580af00
455 07-28 11:55:46.614 15784 15784 I DEBUG :
456 07-28 11:55:46.614 15784 15784 I DEBUG : r0 00000000 r1 4081265c r2 deadd00d r3 000000ff
457 07-28 11:55:46.614 15784 15784 I DEBUG : r4 40812656 r5 0000020c r6 40138460 r7 00000001
458 07-28 11:55:46.614 15784 15784 I DEBUG : r8 407d7a2d r9 40138454 sl 5136afc0 fp 00000001
459 07-28 11:55:46.614 15784 15784 I DEBUG : ip 00001f00 sp 5580ac20 lr 407cb00f pc 407cb01e cpsr 80000030
460 07-28 11:55:46.614 15784 15784 I DEBUG : d0 74726f6261204d75 d1 6977206465746973
461 07-28 11:55:46.614 15784 15784 I DEBUG : d2 6568636174656465 d3 746e756f63282072
462 07-28 11:55:46.614 15784 15784 I DEBUG : d4 3ff0000000000000 d5 0000000000000000
463 07-28 11:55:46.614 15784 15784 I DEBUG : d6 3ff0000000000000 d7 3ff0000000000000
464 07-28 11:55:46.614 15784 15784 I DEBUG : d8 7ff8000000000000 d9 412e848000000000
465 07-28 11:55:46.614 15784 15784 I DEBUG : d10 0000000000000000 d11 0000000000000000
466 07-28 11:55:46.614 15784 15784 I DEBUG : d12 0000000000000000 d13 0000000000000000
467 07-28 11:55:46.614 15784 15784 I DEBUG : d14 0000000000000000 d15 0000000000000000
468 07-28 11:55:46.614 15784 15784 I DEBUG : d16 3ff0000000000000 d17 7e37e43c8800759c
469 07-28 11:55:46.614 15784 15784 I DEBUG : d18 3f964134a0a972e0 d19 c0256370281281e3

Thanks,
faywong

Compilation errors

while the NO_REMAP functionality was added i got this errors:

compile:
    [javac] Compiling 10 source files to /home/matthieu/android/commandergenius/project/bin/classes
    [javac] /home/matthieu/android/commandergenius/project/src/Settings.java:453: cannot find symbol
    [javac] symbol: method showAdditionalInputConfig(net.bigorno.xrick.MainActivity)
    [javac]                                             showAdditionalInputConfig(p);
    [javac]                                             ^
    [javac] /home/matthieu/android/commandergenius/project/src/Settings.java:472: cannot find symbol
    [javac] symbol: method showArrowKeysConfig(net.bigorno.xrick.MainActivity)
    [javac]                                                     showArrowKeysConfig(p);
    [javac]                                                     ^
    [javac] /home/matthieu/android/commandergenius/project/src/Settings.java:479: cannot find symbol
    [javac] symbol: method showAccelerometerConfig(net.bigorno.xrick.MainActivity)
    [javac]                                                     showAccelerometerConfig(p);
    [javac]                                                     ^
    [javac] /home/matthieu/android/commandergenius/project/src/Settings.java:485: cannot find symbol
    [javac] symbol: method showAudioConfig(net.bigorno.xrick.MainActivity)
    [javac]                                             showAudioConfig(p);
    [javac]                                             ^
    [javac] /home/matthieu/android/commandergenius/project/src/Settings.java:567: cannot find symbol
    [javac] symbol: method showLeftClickConfig(net.bigorno.xrick.MainActivity)
    [javac]                                             showLeftClickConfig(p);
    [javac]                                             ^
    [javac] /home/matthieu/android/commandergenius/project/src/Settings.java:572: cannot find symbol
    [javac] symbol: method showRightClickConfig(net.bigorno.xrick.MainActivity)
    [javac]                                                     showRightClickConfig(p);
    [javac]                                                     ^
    [javac] /home/matthieu/android/commandergenius/project/src/Settings.java:578: cannot find symbol
    [javac] symbol: method showAdditionalMouseConfig(net.bigorno.xrick.MainActivity)
    [javac]                                             showAdditionalMouseConfig(p);
    [javac]                                             ^
    [javac] /home/matthieu/android/commandergenius/project/src/Settings.java:655: cannot find symbol
    [javac] symbol: method showScreenKeyboardThemeConfig(net.bigorno.xrick.MainActivity)
    [javac]                                             showScreenKeyboardThemeConfig(p);
    [javac]                                             ^
    [javac] /home/matthieu/android/commandergenius/project/src/Settings.java:659: cannot find symbol
    [javac] symbol: method showScreenKeyboardSizeConfig(net.bigorno.xrick.MainActivity)
    [javac]                                             showScreenKeyboardSizeConfig(p);
    [javac]                                             ^
    [javac] /home/matthieu/android/commandergenius/project/src/Settings.java:663: cannot find symbol
    [javac] symbol: method showScreenKeyboardTransparencyConfig(net.bigorno.xrick.MainActivity)
    [javac]                                             showScreenKeyboardTransparencyConfig(p);
    [javac]                                             ^
    [javac] 10 errors

i'm using the latest ndk (r5b).

lollipop

Both the standalone SDL and Debian noroot give a stale socket error in lollipop so can't be used.

Don't work in Android 5.1.1

Running non rooted stock 5.1.1 on 16GB Nexus 5 (Version LMY48B) don't load main screen.The screen is black and nothing happens.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.