PaulsCode Forum

General => Your Projects => Topic started by: xperia64 on April 29, 2012, 02:13:44 PM

Title: NXEngine AE
Post by: xperia64 on April 29, 2012, 02:13:44 PM
I am working on porting NXEngine to android (aka Cave Story)
It is unplayable yet as it doesn't want to recognize the data files or even start in landscape mode.
So far, I have gotten this:
http://www.paulscode.com/forum/index.php?action=dlattach;topic=443.0;attach=474;image (http://www.paulscode.com/forum/index.php?action=dlattach;topic=443.0;attach=474;image)



Current download links:
App:
http://db.tt/KYl38Rs5 (http://db.tt/KYl38Rs5)
Data:
http://db.tt/6nKdu9Za (http://db.tt/6nKdu9Za)
extract nxengine folder to /sdcard/data so you have /sdcard/data/nxengine/<a lot of data files>
not /sdcard/data/nxengine/nxengine

If you want to make a video, please upload it to youtube as a video response to http://youtu.be/NwMQKcV1wgc (http://youtu.be/NwMQKcV1wgc)

Todo:
Fix the mess that is the input system. if(key>1073​741824) { key = key - 1073741824; }
Add gamepad
Find out what is causing the lag

Videos (may be outdated):
Spoiler: show

Samsung Galaxy Tab 10.1: http://www.youtube.com/embed/Y4G94lyAQ74
HTC Amaze 4g: http://www.youtube.com/watch?v=N_DdG9ArdyM http://www.youtube.com/watch?v=0TsLQEdfKD8
xperia Play: http://www.youtube.com/watch?v=0LdXrvdZItQ http://www.youtube.com/watch?v=NwMQKcV1wgc
Motorola Droid: coming soon.

Device Compatibility/Speed (newest version):
Spoiler: show

Samsung Galaxy Tab 10.1: 50FPS full speed
xperia play: 30-50FPS occasional lag spikes
Motorola Droid: 10FPS very slow, even without sound

Title: Re: NXEngine AE
Post by: Vincentmrl on May 02, 2012, 12:13:44 AM
Awesome, hope you get a way to make android recognize the files!
Title: Re: NXEngine AE
Post by: xperia64 on May 09, 2012, 05:56:24 PM
Ok i got android to find the files, now i just need to fix the hanging black screen i am getting. Surprisingly, it extracts all of the files properly  :o. Latest apk here http://db.tt/KYl38Rs5
and put the files in this zip file into /sdcard/data/nxengine/ http://db.tt/auEYvyMN
Title: Re: NXEngine AE
Post by: Paul on May 09, 2012, 06:08:12 PM
Code: [Select]
05-09 19:05:44.806: I/SDL(19186): [STUB] GL_UnloadLibrary
05-09 19:05:44.837: W/InputDispatcher(182): channel '41cd8c98 com.xperia64.nxengineae/com.xperia64.nxengineae.SDLActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
05-09 19:05:44.837: E/InputDispatcher(182): channel '41cd8c98 com.xperia64.nxengineae/com.xperia64.nxengineae.SDLActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
05-09 19:05:44.837: W/InputDispatcher(182): Attempted to unregister already unregistered input channel '41cd8c98 com.xperia64.nxengineae/com.xperia64.nxengineae.SDLActivity (server)'
05-09 19:05:44.837: I/WindowManager(182): WINDOW DIED Window{41cd8c98 com.xperia64.nxengineae/com.xperia64.nxengineae.SDLActivity paused=false}
05-09 19:05:44.837: W/WindowManager(182): Force-removing child win Window{41df75c8 SurfaceView paused=false} from container Window{41cd8c98 com.xperia64.nxengineae/com.xperia64.nxengineae.SDLActivity paused=false}
05-09 19:05:44.837: I/ActivityManager(182): Process com.xperia64.nxengineae (pid 19186) has died.
05-09 19:05:44.837: W/ActivityManager(182): Force removing ActivityRecord{41b760d0 com.xperia64.nxengineae/.SDLActivity}: app died, no saved state
05-09 19:05:45.025: I/InputReader(182): Reconfiguring input devices.  changes=0x00000004
05-09 19:05:45.025: I/InputReader(182): Device reconfigured: id=6, name='Melfas MMSxxx Touchscreen', surface size is now 720x1280, mode is 1
05-09 19:05:45.025: W/WindowManager(182): Failed looking up window
05-09 19:05:45.025: W/WindowManager(182): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@41cff8b8 does not exist
05-09 19:05:45.025: W/WindowManager(182): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7029)
05-09 19:05:45.025: W/WindowManager(182): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7020)
05-09 19:05:45.025: W/WindowManager(182): at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1439)
05-09 19:05:45.025: W/WindowManager(182): at android.os.BinderProxy.sendDeathNotice(Binder.java:417)
05-09 19:05:45.025: W/WindowManager(182): at dalvik.system.NativeStart.run(Native Method)
05-09 19:05:45.025: I/WindowManager(182): WIN DEATH: null
05-09 19:05:45.025: W/WindowManager(182): Failed looking up window
05-09 19:05:45.025: W/WindowManager(182): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@41dd0e28 does not exist
05-09 19:05:45.025: W/WindowManager(182): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7029)
05-09 19:05:45.025: W/WindowManager(182): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7020)
05-09 19:05:45.025: W/WindowManager(182): at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1439)
05-09 19:05:45.025: W/WindowManager(182): at android.os.BinderProxy.sendDeathNotice(Binder.java:417)
05-09 19:05:45.025: W/WindowManager(182): at dalvik.system.NativeStart.run(Native Method)
05-09 19:05:45.025: I/WindowManager(182): WIN DEATH: null
Title: Re: NXEngine AE
Post by: xperia64 on June 02, 2012, 03:13:46 PM
Ok made some more progress and found where it is freezing. It appears to be repeatedly loading the drumtable which is apparently what its supposed to do? I sent sebt3 on the open pandora boards another message.
Title: Re: NXEngine AE
Post by: xperia64 on June 02, 2012, 08:32:37 PM
Version 1.0 alpha:
APK: http://db.tt/KYl38Rs5
Data files: http://db.tt/6nKdu9Za
Extract the folder 'nxengine' FROM the zip file to /sdcard/data/
Requires an xperia play OR GameKeyboard from the play store configured to emulate the xperia play keys.
Edit: keys can be mapped by pressing the back key, selecting controls, pressing enter and then mapping the keys how you want
Title: Re: NXEngine AE
Post by: Vincentmrl on June 03, 2012, 02:56:50 AM
Version 1.0 alpha:
APK: http://db.tt/KYl38Rs5
Data files: http://db.tt/6nKdu9Za
Extract the folder 'nxengine' FROM the zip file to /sdcard/data/
Requires an xperia play OR GameKeyboard from the play store configured to emulate the xperia play keys.
Edit: keys can be mapped by pressing the back key, selecting controls, pressing enter and then mapping the keys how you want
Nice progress! I have a problem tho, I have no clue about setting the gamepad to emulate xperia play's keys, I can't use the.back button to map because it hides gamepad and when I press any button on the gamepad it freezes.
Edit: Freezes after I press any hardware button binded to anything, but menu button works fine when it says press any key
Edit2: I have an idea to use settings without closing gamekeyboard: Make some interface opening before the game, interface having play and settings button, the settings interface would just edit the game's config file and we could play correctly this way
Title: Re: NXEngine AE
Post by: Paul on June 03, 2012, 04:21:20 PM
So that stack corruption detection code, without the macros:

This would go at the top of a local method:

Code: [Select]
unsigned int u_STACK_CHECK_EBP_VALUE_ENTER = 0;
asm( "str fp, %0 \n" : "=m" (u_STACK_CHECK_EBP_VALUE_ENTER) );
u_STACK_CHECK_EBP_VALUE_ENTER = (u_STACK_CHECK_EBP_VALUE_ENTER & 0x00FFFFFF) | 0xCD000000;

And this would go at the bottom:

Code: [Select]
do
{
    unsigned int u_STACK_CHECK_EBP_VALUE_RETURN = 0;
    asm( "str fp, %0 \n" : "=m" (u_STACK_CHECK_EBP_VALUE_RETURN) );

    u_STACK_CHECK_EBP_VALUE_RETURN = ( (u_STACK_CHECK_EBP_VALUE_RETURN & 0x00FFFFFF) | 0xCD000000);
    if( (u_STACK_CHECK_EBP_VALUE_ENTER & ~0x00FFFFFF) != 0xCD000000 )
    {
        printf( "Corrupted u_STACK_CHECK_EBP_VALUE_ENTER!! It's %x\n", u_STACK_CHECK_EBP_VALUE_ENTER );
        assert( (u_STACK_CHECK_EBP_VALUE_ENTER & ~0x00FFFFFF) == 0xCD000000 );
    }
    if( (u_STACK_CHECK_EBP_VALUE_RETURN & ~0x00FFFFFF) != 0xCD000000 )
    {
        printf( "Corrupted u_STACK_CHECK_EBP_VALUE_RETURN!! It's %x\n", u_STACK_CHECK_EBP_VALUE_RETURN );
        assert( (u_STACK_CHECK_EBP_VALUE_RETURN & ~0x00FFFFFF) == 0xCD000000 );
    }
    if( u_STACK_CHECK_EBP_VALUE_ENTER != u_STACK_CHECK_EBP_VALUE_RETURN )
    {
        printf( "Stack overflow!!!\nThe EBP should be %x, but it's %x( %s )\n\n", u_STACK_CHECK_EBP_VALUE_ENTER, u_STACK_CHECK_EBP_VALUE_RETURN, (char*)&u_STACK_CHECK_EBP_VALUE_RETURN );
        assert( u_STACK_CHECK_EBP_VALUE_RETURN == u_STACK_CHECK_EBP_VALUE_ENTER );
    }
} while( 0 );

Note that I changed the fprintf to stderr into printf (which I am assuming you have defined as __android_log_print at the top of your code.. if not, use that instead).

This will help you figure out what the compiler is having problems with.
Title: Re: NXEngine AE
Post by: Paul on June 03, 2012, 04:48:02 PM
Got it back into a macro.  Here is the test file that I compiled, for copy/pasting:

Code: [Select]
#include <jni.h>
#include <android/log.h>
#define printf(...) __android_log_print(ANDROID_LOG_VERBOSE, "arm-checker", __VA_ARGS__)

#define STACKCHECK

#ifdef STACKCHECK
#define STACK_CHECK_RAND 0xCD000000
#define STACK_CHECK_MASK 0x00FFFFFF

#define STACK_CHECK_END_INTERNAL() u_STACK_CHECK_EBP_VALUE_RETURN = ((u_STACK_CHECK_EBP_VALUE_RETURN & STACK_CHECK_MASK) | STACK_CHECK_RAND);\
if( (u_STACK_CHECK_EBP_VALUE_ENTER & ~STACK_CHECK_MASK) != STACK_CHECK_RAND )\
{\
    printf( "Corrupted u_STACK_CHECK_EBP_VALUE_ENTER!! It's %x\n", u_STACK_CHECK_EBP_VALUE_ENTER );\
    assert( (u_STACK_CHECK_EBP_VALUE_ENTER & ~STACK_CHECK_MASK) == STACK_CHECK_RAND );\
}\
if( (u_STACK_CHECK_EBP_VALUE_RETURN & ~STACK_CHECK_MASK) != STACK_CHECK_RAND )\
{\
    printf( "Corrupted u_STACK_CHECK_EBP_VALUE_RETURN!! It's %x\n", u_STACK_CHECK_EBP_VALUE_RETURN );\
    assert( (u_STACK_CHECK_EBP_VALUE_RETURN & ~STACK_CHECK_MASK) == STACK_CHECK_RAND );\
}\
if( u_STACK_CHECK_EBP_VALUE_ENTER != u_STACK_CHECK_EBP_VALUE_RETURN )\
{\
    printf( "Stack overflow!!!\nThe EBP should be %x, but it's %x( %s )\n\n", u_STACK_CHECK_EBP_VALUE_ENTER, u_STACK_CHECK_EBP_VALUE_RETURN, (char*)&u_STACK_CHECK_EBP_VALUE_RETURN );\
    assert( u_STACK_CHECK_EBP_VALUE_RETURN == u_STACK_CHECK_EBP_VALUE_ENTER );\
}

#define STACK_CHECK_BEGIN() unsigned int u_STACK_CHECK_EBP_VALUE_ENTER = 0; \
asm( "str fp, %0 \n" : "=m" (u_STACK_CHECK_EBP_VALUE_ENTER) ); \
u_STACK_CHECK_EBP_VALUE_ENTER = (u_STACK_CHECK_EBP_VALUE_ENTER & STACK_CHECK_MASK) | STACK_CHECK_RAND

#define STACK_CHECK_END() do{ unsigned int u_STACK_CHECK_EBP_VALUE_RETURN = 0;\
asm( "str fp, %0 \n" : "=m" (u_STACK_CHECK_EBP_VALUE_RETURN) );\
STACK_CHECK_END_INTERNAL(); }while(0)

#else
#define STACK_CHECK_BEGIN() do{}while(0)
#define STACK_CHECK_END() do{}while(0)
#endif


jboolean Java_paulscode_android_mupen64plusae_Utility_isARM7( JNIEnv* env, jclass cls )
{
    STACK_CHECK_BEGIN();

#ifdef _armv7
    printf( "arm-checker determined this is an ARMv7 device" );
    return JNI_TRUE;
#else
    printf( "arm-checker determined this is NOT an ARMv7 device" );
    return JNI_FALSE;
#endif

    STACK_CHECK_END();
}
Title: Re: NXEngine AE
Post by: xperia64 on November 08, 2012, 05:33:03 AM
To anyone who may want to pick this up:
Stack Corruption happens between when characters are added to the buffer to be drawn and the time they are actually drawn. If a sign contains the character that tells the entire sign to be drawn instantly (instead of displaying character by character), Stack Corruption will occur.
Changing the sound Hz rate does not fix the sound quality or the sound buffer issues (it just makes the sound faster or slower).
Title: Re: NXEngine AE
Post by: xperia64 on December 10, 2012, 07:23:30 PM
Thanks to the people working on the iOS port of NXEngine, the sound issue is mostly fixed. Sound effects wont play for some reason. And, since google released their ndk-r8 with proper c++ support, stack corruption is fixed. For some reason the crystax ndk was causing the stack corruption. Only other issue unique to the android edition is that its very slow.
Title: Re: NXEngine AE
Post by: Paul on December 11, 2012, 07:19:40 AM
Excellent work!
Title: Re: NXEngine AE
Post by: OnijJoku on December 11, 2012, 10:12:16 AM
Awesome, I love the innovative projects on here! Yabause and now this, what's next? Thanks you guys.
Title: Re: NXEngine AE
Post by: xperia64 on December 11, 2012, 06:26:15 PM
Video of latest update:
http://www.youtube.com/watch?v=NwMQKcV1wgc
And the download links:
App:
http://db.tt/KYl38Rs5
Data (extract the folder named 'nxengine' to /mnt/sdcard/data/):
http://db.tt/6nKdu9Za
Title: Re: NXEngine AE
Post by: Paul on December 11, 2012, 06:31:51 PM
Looks great!
Title: Re: NXEngine AE
Post by: Vincentmrl on December 13, 2012, 02:39:49 PM
Awesome Work!
So, as written in the video's beginning, no way to try this on phones without an external controller? I would like to test this on my O1
Title: Re: NXEngine AE
Post by: xperia64 on December 13, 2012, 03:11:07 PM
Someone got it working with game keyboard on their s3 but the virtual keyboard crashes it on mine. .
Title: Re: NXEngine AE
Post by: Tom.K on December 14, 2012, 09:00:09 AM
App just closes, used newest build, logcat included.
Title: Re: NXEngine AE
Post by: xperia64 on December 14, 2012, 11:31:29 AM
What is the resolution of your screen?
Title: Re: NXEngine AE
Post by: Vincentmrl on December 14, 2012, 12:09:14 PM
hey xperia64, is nxengine for armv7 devices only right now? After I press the button it just closes, not even a crash signal, only closing. I'm confused about how to use alogcat, so if you tell me I can add the log. I think it's a screen size related issue since tom gets this problem too
Title: Re: NXEngine AE
Post by: xperia64 on December 14, 2012, 12:16:07 PM
If your screen has less than 480x800 pixels it wont work. And it should work with arm anything now
Title: Re: NXEngine AE
Post by: xperia64 on December 14, 2012, 12:27:51 PM
If your screen has less than 480x640 pixels it wont work. And it should work with arm anything now
Title: Re: NXEngine AE
Post by: Tom.K on December 14, 2012, 12:39:04 PM
Mine is 320x240...  :(
Title: Re: NXEngine AE
Post by: Vincentmrl on December 14, 2012, 01:14:03 PM
mine is 320x480, will you try to fix this? I really want to test NXengine on my phone
Title: Re: NXEngine AE
Post by: xperia64 on December 14, 2012, 01:17:43 PM
I'll see if I can try to add a resolution setting that wont crash the app.
Title: Re: NXEngine AE
Post by: Vincentmrl on December 14, 2012, 01:51:58 PM
I wonder what happens if you make it "think" any screen's res is 480x800, unless it does already so
Title: Re: NXEngine AE
Post by: Tibedabeeto on December 16, 2012, 10:46:47 AM
Was waiting for an android port.  Just tried on my s3, seems smooth to me. Keep up the good work.
Title: Re: NXEngine AE
Post by: xperia64 on December 17, 2012, 02:37:02 PM
Added resolution detection code. Delete /sdcard/data/nxengine/settings.dat to apply resolution changes. Also, delete /sdcard/data/nxengine/sndcache.pcm if your sound fx are missing. same links:
App:
http://db.tt/KYl38Rs5
Data:
http://db.tt/6nKdu9Za
Title: Re: NXEngine AE
Post by: 5318008 on December 20, 2012, 12:06:03 PM
Thank you so much for making this.  I've been hoping for ages someone would port Cave Story to Android.  I registered at PaulsCode just so I could provide feedback in this thread.

There's a Cave Story thread over on xda, and a few days ago someone there linked to the version of this that you'd posted October 12th over at CaveStory-dot-org, and since then I've been trying out first that version, and then the most recent one you'd posted in this thread.

I'm using a Droid 3. It's got a dual-core 1GHz processor, a slide-out keyboard, 512MB RAM, and a resolution of 540 x 960 pixels.


Using the previous version:

Video fills almost the whole screen, probably about 400x800 I guess, with a small black border around.

Music works, and sound effects work using the fix you described above.

Game play runs about 60% of full speed, though music is unaffected. There's no lag, it's just slow.

Up, Down, Right, Left, OK, Shift, Alt, and Search keys work on the keyboard. Jump defaults to the OK button, so using that I can reassign jump, shoot, map, inventory etc and actually play the game. Pressing any other hard key crashes the app.


Using the current version:

Video has shrunk by about half, it's really hard to make out the game now. It's all crammed into a tiny floating window with a huge black space around it. Using the resolution detection fix doesn't change anything, it's still tiny afterwards.

Music works, and sound effects work using the fix you described above.

Game play runs 100% of full speed. Maybe the video scaling was slowing it down?

All the buttons *except* Shift, Alt, Tab, Sym, Voice, @, and Search work, so I can set up a really comfortable key layout. Pressing unassigned buttons don't crash the game any more. Pressing the Home button appears to be the only way to exit the app.


For now, I've reverted back to the previous version so I don't have to strain as much to make everything out.

I'm picking up a Bionic lapdock later today, there's a mod to make it fit the Droid 3. I'm going to try plugging in my USB game pad to the lapdock to play Cave Story, and I'll post here with my experiences.

Thanks again for doing such a great job, and I look forward to further testing if newer versions come out.
Title: Re: NXEngine AE
Post by: xperia64 on December 21, 2012, 09:11:31 PM
Just tested myself on an original motorola droid. (yes the droid 1). It works pretty well considering its clocked at 600Mhz.
Title: Re: NXEngine AE
Post by: Tom.K on December 22, 2012, 11:34:44 AM
After running it once with completely clean release, it managed to work, but I couldn't re-define keys as it won't go up and down to set up.

Additionally, after trying to running it again, it quits like before so it's pretty much back to beginning for me.
Title: Re: NXEngine AE
Post by: xperia64 on December 28, 2012, 06:45:24 PM
New update with major speed improvements (30-50fps on my xperia play). May cause the app to run slower on old devices such as the original motorola droid (14fps). Delete /sdcard/data/nxengine and extract the contents of this zip to /sdcard/data/: http://db.tt/mAoi7Sa0
Then install this apk: http://db.tt/iEPC7eSA
Title: Re: NXEngine AE
Post by: Tom.K on December 29, 2012, 04:04:07 AM
Works functional, 40 FPS, whole screen fits.
There are lag spikes (2 FPS) when music is on.
Title: Re: NXEngine AE
Post by: Vincentmrl on December 29, 2012, 05:31:55 AM
there are lagspikes here too when music is on, luckily I can just imagine the music in my head since I completed cs 3 times
Title: Re: NXEngine AE
Post by: xperia64 on December 29, 2012, 11:25:03 AM
I might be able to replace the .org music with wav files so it just plays the raw audio instead of having to generate it.
Title: Re: NXEngine AE
Post by: 5318008 on December 30, 2012, 12:00:42 PM
Latest version is running great on my Droid 3, solid 30-50 fps range, no dips/lags. Still seems to be a hair slow, maybe 90% of full speed? No sound or music issues. The tiny-window issue is gone, but I think it's actually a little too big now. The bottom appears to be clipped off, and some notification boxes appear to overlay other elements. I'm going to try including screenshots. Even if it stays like it is, it's 100% playable, and is beyond anything I'd ever expected to have on my phone.
Title: Re: NXEngine AE
Post by: xperia64 on January 05, 2013, 09:58:00 PM
Latest version is running great on my Droid 3, solid 30-50 fps range, no dips/lags. Still seems to be a hair slow, maybe 90% of full speed? No sound or music issues. The tiny-window issue is gone, but I think it's actually a little too big now. The bottom appears to be clipped off, and some notification boxes appear to overlay other elements. I'm going to try including screenshots. Even if it stays like it is, it's 100% playable, and is beyond anything I'd ever expected to have on my phone.
Thats an issue with the droid 3's weird 960x540 resolution. Its trying to run at 960x640. I am going to upload settings.dat files soon that force each resolution.
Title: Re: NXEngine AE
Post by: k0en on January 07, 2013, 10:26:22 AM
Hello I'm new here. I am very attentive to the evolution of Nxengine AE. I just try it on my Galaxy Nexus. Unfortunately the application crashes after a few seconds. I will also test soon on Nexus7 and a JXD S5110. If I can help in any way let me know!
Sorry for my bad English i'm french  ;D

edit : i've just test on my JXD S5110. I can run the game and access to the menu. But same crash than on my Galaxy Nexus after the intro...Back to the Home.
Title: Re: NXEngine AE
Post by: xperia64 on January 07, 2013, 01:40:35 PM
send me /sdcard/data/nxengine/debug.txt
If you are having issues, send me this file. I think I know the problem though but I want to be sure.
Title: Re: NXEngine AE
Post by: k0en on January 07, 2013, 01:44:57 PM
Thanks for your fast reply !

my debug.txt on this link: https://docs.google.com/open?id=0B0hhMSaaI4MFOUVpeTlQYnBsLUE
Title: Re: NXEngine AE
Post by: xperia64 on January 07, 2013, 01:48:13 PM
Make sure /sdcard/data/endpic/pixel.bmp exists. If it doesn't, copy endpic from /sdcard/data/nxengine/. Also, are you using the latest data here: http://db.tt/mAoi7Sa0
Title: Re: NXEngine AE
Post by: k0en on January 07, 2013, 02:08:42 PM
Ok it works !
Shame on me, i'v forget to copy endpic folder !

I will make a little video to show your great work !

Say me if you want test on other Android Device.

Cheers.

edit : works good on Galaxy Nexus with an Xbox 360 wired pad. But impossible to assign control to the A, B, X, Y buttons. Only directionnal actions works.

Edit 2 : my video : http://youtu.be/EvKquf8FI20
Title: Re: NXEngine AE
Post by: xperia64 on January 20, 2013, 02:01:56 PM
When I tested with a logitech keyboard designed for the samsung galaxy tab, only the number keys and some ctrl+key combinations would register key presses. Weird.
Title: Re: NXEngine AE
Post by: Quietlyawesome94 on January 27, 2013, 08:44:28 PM
As a user interested in seamless performance: The recently released RetroArch runs the game perfectly with on screen controls and support for tons of controllers.

As a person interested in projects like this: Great work , man. Did you have any involvement with RetroArch's port of NXengine?
Title: Re: NXEngine AE
Post by: xperia64 on January 27, 2013, 08:52:04 PM
No and I didn't even realize someone had ported RetroArch to android. RetroArch looks really awesome, shame I can't use it :(
Maybe I'll finally have to get a nexus 7 or something like that...
Title: Re: NXEngine AE
Post by: Tom.K on January 28, 2013, 01:22:27 AM
No and I didn't even realize someone had ported RetroArch to android. RetroArch looks really awesome, shame I can't use it :(
Maybe I'll finally have to get a nexus 7 or something like that...
How you aren't able to use it? You do have Xperia Play, right?
Title: Re: NXEngine AE
Post by: xperia64 on January 28, 2013, 11:17:28 AM
It needs at least honeycomb
Title: Re: NXEngine AE
Post by: Quietlyawesome94 on January 28, 2013, 09:34:46 PM
Needs that, and has to be an ARM7 device. The dev is also a real hard ass when it comes to his project. He's been experiencing some input issues and I said he should look here at what littleguy has done with input and what not. He didn't really have anything nice to say about this site/project either. :/
Title: Re: NXEngine AE
Post by: Tom.K on January 29, 2013, 01:45:09 AM
Well... there is RetroArch source code, so you can still make your own release if I'm not wrong. Though, I don't have any use of it as I don't use 3.x+ for now.
Title: Re: NXEngine AE
Post by: Revolter on January 29, 2013, 12:52:56 PM
Hey guys. I just wanted tell my thanks to xperia64, for you are making this awesome port of an awesome game, that currently runs great on an awesome phone (I'm also using the XP) :) As I mentioned it runs great, although the Grasstown's graphics are broken so I'll be stuck there for a while, but oh well :) Thanks again for making the Cave Story AE possible, and best of luck to ya. If I can help with testing or something or other - just say so and I gladly will.
Title: Re: NXEngine AE
Post by: xperia64 on January 29, 2013, 01:28:43 PM
Thats strange, I thought I fixed those in this version: http://www.paulscode.com/forum/index.php?topic=443.msg7459#msg7459
If it still doesn't work, you should be able to copy the save to a PC and load it in the PC version of nxengine.
Title: Re: NXEngine AE
Post by: kronoxx on January 30, 2013, 06:47:15 PM
Guys I believe I'm doing something wrong here. I downloaded the latest NXengine and data, unzipped the data in android/data folder. I already have Bluezime and the key HOME as ENTER

I Open NXENGINE-AE but when pressing Start the screen goes black for 4 secs then it goes back to desktop
I'm using an i9300 (Galaxy S3 international quad exynos @ 1.6ghz) running Jelly Bean 4.1 ( Maybe this is the problem?)

Also i noticed i have a Endpic clone directory on my root data folder and another one inside the NXengine Data folder ( is this normal?)

Any help would be appreciated. One last thing my game doesn't produce a debug.ini in the NXengine folder =(

Thanks! and great videos :D

Kronox
Title: Re: NXEngine AE
Post by: xperia64 on January 30, 2013, 06:58:41 PM
Since you have 4.1 try retroarch: https://play.google.com/store/apps/details?id=org.retroarch&rdid=org.retroarch&rdot=1
It also has nxengine and might work better.
Title: Re: NXEngine AE
Post by: Squarepusher2 on January 30, 2013, 07:17:34 PM
Needs that, and has to be an ARM7 device. The dev is also a real hard ass when it comes to his project. He's been experiencing some input issues and I said he should look here at what littleguy has done with input and what not. He didn't really have anything nice to say about this site/project either. :/

Hi,

I'm the author of RetroArch along with Themaister. In partcular, I ported RetroArch to Android along with most of the other cores that are part of  this project (including the NxEngine port). Along the way I got help from ToadKing and other members.

I never told you anything bad about the members involved in this project - all I told you was that I wouldn't be incorporating anymore Java code into my project than absolutely necessary - I prefer to have almost all of my runtime state code in C because of garbage collector stalls and Dalvik JVM heapsize increasing when too much stuff is being done on the Java side. I avoid Java like the plague and I will never, ever go down that road except for boilerplate frontend code. If you call that 'being a real hard ass', then so be it - I just prefer to think of it as 'maintaining code quality/performance'.

I would really appreciate it if users didn't go behind my back , tell me one thing on certain forums and then go back to the other dev to tell them 'he said something about you - blabla' and try to stir up fights that way. I've seen this happen in the Wii scene too and I'm calling for this irresponsible behavior to stop - because I certainly am not out to cause infighting with anyone.

I am a very plain outspoken guy that says exactly what is on his mind - and exactly that. If people get offended by that, that is just tough - because I will never compromise on what I believe to be the truth and will always say it right like it is.

Anyway, past this emo drama BS and onto the NXEngine part -

we really did this port pretty much independently - it involved a lot of work (gutting the SDL font code, rewriting the sound playback code, changing the control flow main loop and having it run exactly once per frame, adding an optional 60fps option - rewriting all the hardcoded paths to something sane that would scale across Win32/UNIX-based filesystems), and it's pretty much unrelated to this porting project. The only issues I still have are issues on non-LInux based consoles - for some reason, all the animations/script routines seem to be screwed up on Wii/Xbox 1/360/PS3 - it's for that reason that the NXengine libretro port right now only works on Android and PC targets of RetroArch.

Title: Re: NXEngine AE
Post by: xperia64 on January 30, 2013, 07:58:23 PM
My nxengine port is currently based off of the ios port and except for the SDL linkage code, is all c based. I have not added virtual controls yet and and probably will not for a while. My guess as to why nxengine doesn't work on other consoles is that it isn't interpreting the x86 assembly scripts correctly. Also, could you add external install support? just add
Code: [Select]
android:installLocation="auto" below the package line in the android manifest.
Title: Re: NXEngine AE
Post by: Squarepusher2 on January 30, 2013, 08:16:38 PM
My nxengine port is currently based off of the ios port and except for the SDL linkage code, is all c based. I have not added virtual controls yet and and probably will not for a while. My guess as to why nxengine doesn't work on other consoles is that it isn't interpreting the x86 assembly scripts correctly. Also, could you add external install support? just add
Code: [Select]
android:installLocation="auto" below the package line in the android manifest.

This can't be done because SD cards are mounted with 'noexec' and RetroArch's core plugin system - emulators/games compiled as native libraries, libraries which we call libretro ports - depends on it being able to load native libraries to do anything. You can't 'load' native libraries from an SD card unless you have root permissions, remount the SD card with exec permissions to allow for this.

Also, RetroArch itself is compiled as a dynamic library - and, just like the cores, can't be executed from the SD card which is normally mounted with 'noexec'.
Title: Re: NXEngine AE
Post by: Squarepusher2 on January 30, 2013, 08:18:28 PM
My nxengine port is currently based off of the ios port and except for the SDL linkage code, is all c based. I have not added virtual controls yet and and probably will not for a while. My guess as to why nxengine doesn't work on other consoles is that it isn't interpreting the x86 assembly scripts correctly.

Thing is, it's also not working properly on Xbox 1 - and that is an x86 Celeron console.
Title: Re: NXEngine AE
Post by: pashkoff on February 01, 2013, 07:12:46 AM
@Squarepusher2, @xperia64

Hello, people. I'm the one who begun to port nxengine to iOS. Squarepusher2, you, probably, don't know me and the project. Project page - https://github.com/PIlin/NXEngine-iOS

I have a proposition to both of you. I'd like to propose to merge our projects and maintain one crossplatform NXEngine. We all made some changes in engine, which are duplicate each other. For example, iOS and libreto versions both have made efforts to get out hard coded paths to files from code. Both have made bug fixes in sound system. And so on.
But, for example, I have moved my project to SDL2, SDL_ttf2 and almost rewritten graphical part to use hardware-accelerated rendering (FPS increased from 15 to 50), which can be an interesting thing for libreto. Or, I have fixed one bug in sound system, which have you not found (yet?) - https://github.com/PIlin/NXEngine-iOS/issues/18 And I have made a lot of changes in different parts of engine to support touch control, which is, probably, not intersting for libreto, but can be interesting for android port.
You, for example, have done 60Hz mode, which is cool. Probably, a lot more. I just haven't checked yet your project closely.

What I want to say is that I think, everyone will win if we continue to develop together. I think, it is possible to select everything platform-specific, hide it behind common interface so there will be no need to change other parts of the engine. I had this in mind when I changed file processing in my project. But, surely, there are much more work.


It is not the best time for me to make this proposition. I'm really busy with other stuff going in my life. But, I'm afraid, if I will wait longer - differences between projects will grow. And I really want to bring nxengine to other platforms.
Squarepusher2, I will try to check your project and compare it with my version. Then, if you interested in my proposition, we will define platform specific parts and decide, how we will rewrite them.

Is my proposition looks interesting to both of you? Looking forward to your answers.
Title: Re: NXEngine AE
Post by: xperia64 on February 01, 2013, 03:01:55 PM
Sure, I cleaned up my code and moved the android project folders into the root of Nxengine's source. Here is the latest source: http://db.tt/nlzq9t9g
Among the android code, I also fixed the "pervious" typo that was bugging me in the input menu :P
Title: Re: NXEngine AE
Post by: Squarepusher2 on February 03, 2013, 09:24:07 PM
@Squarepusher2, @xperia64

Hello, people. I'm the one who begun to port nxengine to iOS. Squarepusher2, you, probably, don't know me and the project. Project page - https://github.com/PIlin/NXEngine-iOS

I have a proposition to both of you. I'd like to propose to merge our projects and maintain one crossplatform NXEngine. We all made some changes in engine, which are duplicate each other. For example, iOS and libreto versions both have made efforts to get out hard coded paths to files from code. Both have made bug fixes in sound system. And so on.
But, for example, I have moved my project to SDL2, SDL_ttf2 and almost rewritten graphical part to use hardware-accelerated rendering (FPS increased from 15 to 50), which can be an interesting thing for libreto. Or, I have fixed one bug in sound system, which have you not found (yet?) - https://github.com/PIlin/NXEngine-iOS/issues/18 And I have made a lot of changes in different parts of engine to support touch control, which is, probably, not intersting for libreto, but can be interesting for android port.
You, for example, have done 60Hz mode, which is cool. Probably, a lot more. I just haven't checked yet your project closely.

What I want to say is that I think, everyone will win if we continue to develop together. I think, it is possible to select everything platform-specific, hide it behind common interface so there will be no need to change other parts of the engine. I had this in mind when I changed file processing in my project. But, surely, there are much more work.


It is not the best time for me to make this proposition. I'm really busy with other stuff going in my life. But, I'm afraid, if I will wait longer - differences between projects will grow. And I really want to bring nxengine to other platforms.
Squarepusher2, I will try to check your project and compare it with my version. Then, if you interested in my proposition, we will define platform specific parts and decide, how we will rewrite them.

Is my proposition looks interesting to both of you? Looking forward to your answers.

I have looked at your codebase, and you definitely have done a lot of substantial core improvements. I was definitely impressed.

I don't think a merger can happen just yet, but swapping out ideas and working towards one central core codebase over time? Definitely. It doesn't seem like the original author of NXEngine is still active these days, so it might be the best route to take.

One big issue is the sheer amount of bugs that exist right now when you run this codebase on something other than a PC - a user has reported to me for instance that some of the game AI logic fails to work right now in the Labyrinth section on Android - this does not happen on PC. On consoles, there are even worse problems that all have to do with either AI not working or something else of this nature. I saw that in some of your commits you fixed some undefined behavior - based on your own experience, how much of these issues do you think still remain at large?
Title: Re: NXEngine AE
Post by: xperia64 on February 04, 2013, 05:12:12 PM
Hey guys. I just wanted tell my thanks to xperia64, for you are making this awesome port of an awesome game, that currently runs great on an awesome phone (I'm also using the XP) :) As I mentioned it runs great, although the Grasstown's graphics are broken so I'll be stuck there for a while, but oh well :) Thanks again for making the Cave Story AE possible, and best of luck to ya. If I can help with testing or something or other - just say so and I gladly will.
I went back to grasstown and the textures are indeed broken/trippy. I will see if I can fix that...
Edit: the problem seems to be from NXSurface::DrawSurface. It is spamming the log with SetAsTarget messages and no other maps/stages do this.
Edit2: Fixed. I disabled the SetTargetAs function for all of the various NXSurface::Draw and NXSurface::Clear functions. Squarepusher, you should see if this might be the problem.
Edit3: The only function causing the glitched graphics was ClearRect. All others can and should be left enabled.
Title: Re: NXEngine AE
Post by: xperia64 on February 06, 2013, 03:40:04 PM
Here is the fixed APK: http://db.tt/KYl38Rs5
Title: Re: NXEngine AE
Post by: pashkoff on February 07, 2013, 04:07:35 AM

I have looked at your codebase, and you definitely have done a lot of substantial core improvements. I was definitely impressed.

I don't think a merger can happen just yet, but swapping out ideas and working towards one central core codebase over time? Definitely. It doesn't seem like the original author of NXEngine is still active these days, so it might be the best route to take.

Cool. I'm glad to read it. I've made some steps in my codebase to make it easier to merge. I've returned sdl1 rendering as optional. I event have local repo, where our projects have the same git history root, so it will be easier to preserve history. In time, I will try to combine code. I don't know, what to do with the things, you have removed. I will think about it later.

One big issue is the sheer amount of bugs that exist right now when you run this codebase on something other than a PC - a user has reported to me for instance that some of the game AI logic fails to work right now in the Labyrinth section on Android - this does not happen on PC. On consoles, there are even worse problems that all have to do with either AI not working or something else of this nature. I saw that in some of your commits you fixed some undefined behavior - based on your own experience, how much of these issues do you think still remain at large?

Well, actually, I have no idea. Probably, a lot. I have not touched AI code. I was lucky enough and there were no problems with AI on my devices. Or, at least, I have not seen problems, which look specific to port. I have seen bats  and birds in Grasstown and in Sand Zone, stuck into scenery, but I think they will do the same on original linux version. But, there was nothing like a completely not working AI.
Title: Re: NXEngine AE
Post by: BobCat on February 16, 2013, 08:08:08 AM
Not really related to NXEngine ae but what typos are in the lxdream Android
Build
Title: Re: NXEngine AE
Post by: pashkoff on March 09, 2013, 01:05:27 PM
Rolled out new version of ios port. Now with great speed-up of render.
I'm afraid, it would work only on devices that support gles2. Just because I had to copy and edit internal parts of SDL_render. And i've done it only for gl and gles2. But I'm sure, that gles1 support will be easy to implement.
Also, there is patch for SDL2 with implementation RenderGeometry http://bugzilla.libsdl.org/show_bug.cgi?id=1734. It does exactly what I need, I just have found it after I've coded required functionality by myself. But, if that patch would be accepted to SDL upstream - I will rewrite current code with that new API.

Also, I've fixed crash on music change. People complained, that engine crashed when they tried to open chests. Well, I'm sure it was this issue.

Squarepusher2, I did nothing towards our codebase merge.
Title: Re: NXEngine AE
Post by: krysztal on March 15, 2013, 06:16:12 PM
I have a problem with nxengine. When i try to launch and click that big button ( :P ) game freezes. I have sony x10 mini pro (that with physic keyboard), so it's should work. There's debug.txt
Code: [Select]
Loading settings...
Couldn't open file /sdcard/data/nxengine/settings.dat.
No saved settings; using defaults.
Graphics::SetResolution(3)
closest w = 320, h = 240, dm = 2232750082
SDL_CreateWindow: 320x240 @ 16bpp
Graphics::FlushAll()
SIFLoader::LoadHeader: read index of 6 sections
Loading SIF section 1 from address 003b
Loading SIF section 2 from address 043a
SIFSpritesSect: loading 490 sprites
fonts: using bitmapped from /sdcard/data/nxengine/smalfont.bmp
 error << Couldn't open bitmap font file: '/sdcard/data/nxengine/smalfont.bmp' >>
 error << Failed to load font. >>
 
Where can I find smalfont.bmp?
Title: Re: NXEngine AE
Post by: Paul on March 15, 2013, 06:26:30 PM
I wonder if that's a typo (missing an L in small)?
Title: Re: NXEngine AE
Post by: xperia64 on March 15, 2013, 06:29:53 PM
Make sure that the data files are extracted into /sdcard/data
http://db.tt/mAoi7Sa0
So you have /sdcard/data/nxengine/ and /sdcard/data/endpic/
Title: Re: NXEngine AE
Post by: krysztal on March 16, 2013, 09:10:06 AM
I have only /data/nxengine. Endpic folder is inside of nxengine, so I copy it to /data folder.
Still don't work, still smalfont.bmp missing...

Oh, new package, i see... it's now work, but... how can i reconfigure controls? I dont have directional keys...
Only keys i can use is X(choose button), ?(terminal thing) and left directional button(works as X). In keyboard-layout, in system settings, Enter key is assigned to "META_ENTER" value...
Title: Re: NXEngine AE
Post by: xperia64 on March 16, 2013, 10:27:22 AM
Uninstall the app you have, install this one: http://db.tt/KYl38Rs5
Delete /sdcard/data/nxengine/settings.dat and replace it with the attached one. I mapped it from my moto droid so wasd is the dpad, l is jump, k is fire etc
Title: Re: NXEngine AE
Post by: krysztal on March 16, 2013, 01:03:23 PM
It works! Thanks :)
If you want to know, i have stable 29-30 fps, but without music :(. You should record it to wav or something...
Title: Re: NXEngine AE
Post by: xperia64 on March 16, 2013, 02:11:07 PM
I was thinking about recording it to wav, but I'd have to make sure it loops absolutely correct
Title: Re: NXEngine AE
Post by: Otak313 on March 23, 2013, 12:24:42 AM
Thanks for all your effort into porting this to android. I really would love to play cave story again, but I've run into a problem. I've got a Teclast p76e tablet that I'm trying to run this on. I'm using a xbox360 controller, and have to use arctools to get the tablet to recognize the controller. When I run cave story the a and b buttons are not being recognized in the controller setup. I tried setting the jump button to another button, but every other button that it recognized is already in use and won't let you program to it. It seems to recognize x,y,lb,rb,d pad, and joystick, but not a,b,l trigger, r trigger, or the buttons where you click the analog sticks in. Any help would be greatly appreciated, and thanks in advance.
Title: Re: NXEngine AE
Post by: krysztal on April 05, 2013, 05:09:36 AM
I have a Little problem. Game don't respond whem i'm using SwiftKey keyboard.
Title: Re: NXEngine AE
Post by: xperia64 on April 05, 2013, 03:52:34 PM
I'm not sure that some keyboards are supported, plus this game isn't really suited for standard keyboards. You can always try the version included with retroarch..
Title: Re: NXEngine AE
Post by: Epic_bubble on April 09, 2013, 07:18:38 PM
Great job on the android port! I dont know if you knew this buts its possible to run cave story on Android using the PSP emulator PPSSPP. Obviously its not ideal and you need a powerful device to play it but its still pretty cool to see. :)

http://forums.ppsspp.org/showthread.php?tid=2201
Title: Re: NXEngine AE
Post by: xperia64 on April 09, 2013, 07:27:56 PM
I tried cave story multiple times on android ppsspp and I just get a black screen. I think retroarch still has the best port of it for now
Title: Re: NXEngine AE
Post by: Epic_bubble on April 30, 2013, 03:45:12 PM
Using the latest revision from github Cave Story now seems to work in PPSSPP. :)
Title: Re: NXEngine AE
Post by: krysztal on May 14, 2013, 08:15:07 AM
Yeah, but i can't install retroarch, because of too Old android...
Title: Re: NXEngine AE
Post by: Otak313 on May 18, 2013, 03:06:25 AM
Using the latest revision from github Cave Story now seems to work in PPSSPP. :)
Cave story seems to work well in the latest daily release, but saving does not work. If saving works for you could you tell me which release you are using?
Title: Re: NXEngine AE
Post by: krysztal on September 15, 2013, 01:26:01 PM
Hey, xperia64, did you still working on this port? I'm just curious.
Title: Re: NXEngine AE
Post by: xperia64 on September 15, 2013, 01:41:04 PM
No not really. Even been considering selling my xperia play
Title: Re: NXEngine AE
Post by: krysztal on September 15, 2013, 01:45:00 PM
Oh, ok. I just want to ask if you have done something with sound system recently...