Author Topic: GLideN64 Android port  (Read 141049 times)

Offline retroben

  • float
  • ****
  • Posts: 432
    • View Profile
Re: GLideN64 Android port
« Reply #120 on: May 15, 2015, 11:52:02 AM »
So the GLES 2.0 porting is barely functional at the moment? (yes)

Good luck on getting it to run at full power. :)

But how does Rice work with multisampling on GLES 2.0 though?
Is it using a different method,and can it somehow be ported over from Rice?
Or is your code for that feature not fixed up yet since you've only initially got ES 2.0 running?

Sorry for all of these questions. :( I just can't get over the fact that Rice does multisampling on ES2. :P

Though somebody removed the option on later builds...why? ???
I KNOW it works with my early testing of Rice's multisampling on Banjo-Tooie since it looked much sharper and lighting quality was more intense. :-\
« Last Edit: May 15, 2015, 12:03:07 PM by retroben »

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: GLideN64 Android port
« Reply #121 on: May 15, 2015, 08:07:23 PM »
@Paul I mirrored GLideN64 into the mupen64plus-ae repository and we are getting our first auto-builds of the gliden64-integration branch.  Unfortunately it looks like the native stuff isn't getting compiled.  Would you mind checking the build logs on your server?  Perhaps you might need to install additional Android SDK levels?

@Gonetz Right now the gliden64-integration branch contains the source from your Public_Release_1.1 tag.  I wanted to get the autobuilds working first.  Once that's ironed out, all you need to do to pull in your latest revision is pull up a shell and type

Code: [Select]
cd tools
pull-gliden64.sh

Tap enter a few times to accept the defaults and the head revision of GLideN64 will be mirrored into mupen64plus-ae (along with an updated Revision.h).  The commit message will contain a summary of all commits since the last sync.  For example, the message from my latest sync summarizes all the commits between Public_Release_1 and Public_Release_1.1.
https://github.com/mupen64plus-ae/mupen64plus-ae/commit/7413012
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Gonetz

  • Developer
  • long
  • *****
  • Posts: 104
    • View Profile
Re: GLideN64 Android port
« Reply #122 on: May 16, 2015, 09:58:27 AM »
Yesterday I managed to run GLES2 build of my plugin on NVidia Shield tablet. I rewrote large part of code to get that result. Today I had been porting my work on true GLES2 device and found that my yesterday struggle was just a warm-up before the real battle. I forgot how limited GLES2 is. Lots of things which I considered as basic just do not present here. I feel myself as returning back to stone age. I rewrote all " switch case" with "if else". I replaced "texture" with "texture2D". And so on. Lots of plugin's functionality is disabled because I don't know how to implement it with GLES2 functionality. For example, my mip-mapping code requires textureLod function, which is not supported here. My code is all perforated by "#ifdef #endif" because GLES2 can't do this and requires special code for that. It looks ugly.

Nevertheless, I finally got it working on my Note 2. The work is not finished and I will not push it to repo yet. However, I built an apk with current code. You may try it on your device. I was afraid that GLES2 will run slow, but speed is ok despite of plenty of debug output. Download link:
https://drive.google.com/file/d/0B0YqMPjGo3B2WmZON0ZkdXRNZWs/view?usp=sharing

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: GLideN64 Android port
« Reply #123 on: May 16, 2015, 11:29:36 AM »
@Paul I mirrored GLideN64 into the mupen64plus-ae repository and we are getting our first auto-builds of the gliden64-integration branch.  Unfortunately it looks like the native stuff isn't getting compiled.  Would you mind checking the build logs on your server?  Perhaps you might need to install additional Android SDK levels?

The ndk-build is failing with the following output:

Code: [Select]
jni/./mupen64plus-video-gliden64/src/Textures.cpp: In member function 'CachedTexture* TextureCache::_addTexture(u32)':
jni/./mupen64plus-video-gliden64/src/Textures.cpp:539:13: error: 'TextureCache::Textures' has no member named 'emplace'
jni/./mupen64plus-video-gliden64/src/Textures.cpp: In member function 'CachedTexture* TextureCache::addFrameBufferTexture()':
jni/./mupen64plus-video-gliden64/src/Textures.cpp:559:15: error: 'TextureCache::Textures' has no member named 'emplace'
jni/./mupen64plus-video-gliden64/src/Textures.cpp: In member function 'void TextureCache::update(u32)':
jni/./mupen64plus-video-gliden64/src/Textures.cpp:1277:10: error: 'std::this_thread' has not been declared
jni/./mupen64plus-video-gliden64/src/Textures.cpp:1281:10: error: 'std::this_thread' has not been declared
make: *** [obj/local/armeabi-v7a/objs/mupen64plus-video-gliden64/./mupen64plus-video-gliden64/src/Textures.o] Error 1
make: *** Waiting for unfinished jobs....

I'll grab the latest ndk version and see if that makes a difference.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline retroben

  • float
  • ****
  • Posts: 432
    • View Profile
Re: GLideN64 Android port
« Reply #124 on: May 16, 2015, 12:03:48 PM »
Here is a page about multisampling for Rice in mupen64plus and details of how to implement it.

https://code.google.com/p/mupen64plus/issues/detail?id=338

Maybe this can be done in the same exact way for GLideN64 ES2 but with the Android equivalent,wherever that is.
Hopefully whomever ported Rice as GLES2 to AE or that feature alone could speak up and tell us what instructions were used to implement multisampling.

Figured i'd at least try to help get this feature available one way or another. ;D

Offline gdark100

  • Green Team
  • byte
  • *
  • Posts: 48
    • View Profile
Re: GLideN64 Android port
« Reply #125 on: May 16, 2015, 12:03:57 PM »
Yesterday I managed to run GLES2 build of my plugin on NVidia Shield tablet. I rewrote large part of code to get that result. Today I had been porting my work on true GLES2 device and found that my yesterday struggle was just a warm-up before the real battle. I forgot how limited GLES2 is. Lots of things which I considered as basic just do not present here. I feel myself as returning back to stone age. I rewrote all " switch case" with "if else". I replaced "texture" with "texture2D". And so on. Lots of plugin's functionality is disabled because I don't know how to implement it with GLES2 functionality. For example, my mip-mapping code requires textureLod function, which is not supported here. My code is all perforated by "#ifdef #endif" because GLES2 can't do this and requires special code for that. It looks ugly.

Nevertheless, I finally got it working on my Note 2. The work is not finished and I will not push it to repo yet. However, I built an apk with current code. You may try it on your device. I was afraid that GLES2 will run slow, but speed is ok despite of plenty of debug output. Download link:
https://drive.google.com/file/d/0B0YqMPjGo3B2WmZON0ZkdXRNZWs/view?usp=sharing
Tested it here, heavy graphical glitches and poor speed, but it is probably expected since youre rewriting lots of code...

Here are  some screenshots:
First this appeared:

then:

This is Super Mario 64. Only a few polygons actually appears on the screen, the rest is black.
I will test other games and let you know how they perform.

Also, good luck with your indiegogo campaign  ;D
Motorola Xoom 2 ME:
OMAP CPU Dual Core @ 1.2 Ghz and PowerVR SGX 540 GPU
8.2'' 1280x800 Screen
1GB Ram Dual Channel
32 GB internal storage

Galaxy SII Lite:
NovaThor U8500 CPU Dual Core @ 1.0 Ghz and Mali-400MP GPU
4.0'' 800x480 Screen
768MB Ram
8GB internal storage

Huawei U8150:
Qualcomm CPU @ 532 Mhz, no GPU
3'' 240x320 Screen
256 MB Ram

Offline retroben

  • float
  • ****
  • Posts: 432
    • View Profile
Re: GLideN64 Android port
« Reply #126 on: May 16, 2015, 12:31:36 PM »
I tried a few games on my FireTV.

Banjo-Tooie ran like the once broken part of Glide64 AE with atari style graphics,but with bumps.
After selecting a file and skipping the cutscene,it hits a grey screen and exits the game briefly.
Currently performance is a bit slow,but with good reason. I used fast forward and it only gave me 23fps out of 20.

Super Smash Bros. intro is the first messed up looking part,menus look fine,but it exits with the same grey screen when entering VS. Mode and possibly other modes.

I hope you are not using glblitFrameBuffer since Qualcomm hates that feature.
At least it is running,so that's a plus. ;D

DK64 is the first one that was playable in-game for me.
No crashing at all,the same atari-esque graphics,but text and 2D objects are invisible.
A unique issue is that the resolution changes when in certain spots and there is the same model stretching as Glide64 when near Cranky's Lab.
I got all the way to Jungle Japes,and I have to say the actual framerate is really smooth.
I neglected to remember the debug stuff is the slowdown.
« Last Edit: May 16, 2015, 01:01:55 PM by retroben »

Offline xperia64

  • Moderator
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: GLideN64 Android port
« Reply #127 on: May 16, 2015, 12:40:36 PM »
@Paul I mirrored GLideN64 into the mupen64plus-ae repository and we are getting our first auto-builds of the gliden64-integration branch.  Unfortunately it looks like the native stuff isn't getting compiled.  Would you mind checking the build logs on your server?  Perhaps you might need to install additional Android SDK levels?

The ndk-build is failing with the following output:

Code: [Select]
jni/./mupen64plus-video-gliden64/src/Textures.cpp: In member function 'CachedTexture* TextureCache::_addTexture(u32)':
jni/./mupen64plus-video-gliden64/src/Textures.cpp:539:13: error: 'TextureCache::Textures' has no member named 'emplace'
jni/./mupen64plus-video-gliden64/src/Textures.cpp: In member function 'CachedTexture* TextureCache::addFrameBufferTexture()':
jni/./mupen64plus-video-gliden64/src/Textures.cpp:559:15: error: 'TextureCache::Textures' has no member named 'emplace'
jni/./mupen64plus-video-gliden64/src/Textures.cpp: In member function 'void TextureCache::update(u32)':
jni/./mupen64plus-video-gliden64/src/Textures.cpp:1277:10: error: 'std::this_thread' has not been declared
jni/./mupen64plus-video-gliden64/src/Textures.cpp:1281:10: error: 'std::this_thread' has not been declared
make: *** [obj/local/armeabi-v7a/objs/mupen64plus-video-gliden64/./mupen64plus-video-gliden64/src/Textures.o] Error 1
make: *** Waiting for unfinished jobs....

I'll grab the latest ndk version and see if that makes a difference.
You either need the latest ndk version or force GCC 4.8 or higher. I'm still on ndk r9d and forcing gcc 4.8 got it to build after experiencing that error.

Offline Gonetz

  • Developer
  • long
  • *****
  • Posts: 104
    • View Profile
Re: GLideN64 Android port
« Reply #128 on: May 16, 2015, 12:57:33 PM »
@gdark100 - from which of your devices these screenshots? As I know, my Note 2 is powered by Mali400, and I have almost no glitches or speed issues. Some games crashes, but those which work run pretty well.

@retroben GLES2 does not support glblitFrameBuffer.

Offline gdark100

  • Green Team
  • byte
  • *
  • Posts: 48
    • View Profile
Re: GLideN64 Android port
« Reply #129 on: May 16, 2015, 01:01:14 PM »
@gdark100 - from which of your devices these screenshots? As I know, my Note 2 is powered by Mali400, and I have almost no glitches or speed issues. Some games crashes, but those which work run pretty well.

@retroben GLES2 does not support glblitFrameBuffer.
Galaxy S2 Lite (Samsung Janice).
Ill test on the Xoom

Edit: On the Xoom it doesnt show anything. I can only hear the sound.
« Last Edit: May 16, 2015, 01:11:58 PM by gdark100 »
Motorola Xoom 2 ME:
OMAP CPU Dual Core @ 1.2 Ghz and PowerVR SGX 540 GPU
8.2'' 1280x800 Screen
1GB Ram Dual Channel
32 GB internal storage

Galaxy SII Lite:
NovaThor U8500 CPU Dual Core @ 1.0 Ghz and Mali-400MP GPU
4.0'' 800x480 Screen
768MB Ram
8GB internal storage

Huawei U8150:
Qualcomm CPU @ 532 Mhz, no GPU
3'' 240x320 Screen
256 MB Ram

Offline retroben

  • float
  • ****
  • Posts: 432
    • View Profile
Re: GLideN64 Android port
« Reply #130 on: May 16, 2015, 01:12:00 PM »
Never mind about DK64 being crashless,Chunky's crotch made it crash,it was hilarious!
He actually "crashes" into the screen on the DK Rap I skipped last time.

The Tiny Kong scene "changes her size to suit her mood" has stretchy glitching like Glide64.
Maybe these have always been core/RSP issues.

Another general issue is that fading transitions are missing,then again buffering is not functional currently.

Also,Conker's Bad Fur Day hits a grey screen exit on boot.

Edit: I decided to try custom settings,and a few things I noticed...
I made the Nintendo logo appear on DK64 (glitchy booting frame before) after enabling one of the options. (sorry can't remember)
I find that FBEmulation disabled makes it much faster,as one would expect.
Turning on the RDRAM settings must not work on GLES2,but HW Lighting worked with spooky looking kongs.
I can't tell if MultiSampling works yet since textures don't load.
« Last Edit: May 16, 2015, 01:36:40 PM by retroben »

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: GLideN64 Android port
« Reply #131 on: May 16, 2015, 01:46:55 PM »
You either need the latest ndk version or force GCC 4.8 or higher. I'm still on ndk r9d and forcing gcc 4.8 got it to build after experiencing that error.

I'm running ndk-10d and everything builds fine.  I would suggest just staying current with the ndk.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline retroben

  • float
  • ****
  • Posts: 432
    • View Profile
Re: GLideN64 Android port
« Reply #132 on: May 16, 2015, 01:52:31 PM »
Strange.

When gdark100 tested Super Mario 64,he got blackness and black spots on eyes and mouth.

On the normal GlideN64 profile:
First,I get the logo and then Mario's head with the obvious atari texture issue.
I get a full world of atari textures and a blank faced Mario with skin colors intact,but without eye textures or much others.
The text is garbled and unreadable,but the stat counters are visible with solid backgrounds instead of alpha ones.
The Mario icon is perfect looking.

And this is on Qualcomm Snapdragon 600 with Adreno 320 and V@15.0 drivers.
Am I lucky?

Sorry about the complete lack of screenshots. :(

Edit: Zelda Ocarina starts and reaches Link on Epona at the right edge of the screen before hitting the grey screen exit.
« Last Edit: May 16, 2015, 02:54:17 PM by retroben »

Offline retroben

  • float
  • ****
  • Posts: 432
    • View Profile
Re: GLideN64 Android port
« Reply #133 on: May 16, 2015, 02:57:49 PM »
It is pointless to test anything further until you can fix texture and buffer issues and the grey screen exiting. :)

Any chance you are using TMEM?
One time,I enabled that setting on Rice and all of the visuals were broken with extremely similar atari graphics as a result.

Edit: Who ported Glide64 to Android?
What stuff was used to make it work as decent as it does aside from missing polygons?
Somebody knowledgable needs to help out Gonetz if they can please.
« Last Edit: May 16, 2015, 03:53:58 PM by retroben »

Offline gdark100

  • Green Team
  • byte
  • *
  • Posts: 48
    • View Profile
Re: GLideN64 Android port
« Reply #134 on: May 16, 2015, 09:23:25 PM »
Well, just a note to gonetz. The problem is not the polygon themselves, but the textures. All textures are black. So only the polygons with colors (not textures) are visible.
Motorola Xoom 2 ME:
OMAP CPU Dual Core @ 1.2 Ghz and PowerVR SGX 540 GPU
8.2'' 1280x800 Screen
1GB Ram Dual Channel
32 GB internal storage

Galaxy SII Lite:
NovaThor U8500 CPU Dual Core @ 1.0 Ghz and Mali-400MP GPU
4.0'' 800x480 Screen
768MB Ram
8GB internal storage

Huawei U8150:
Qualcomm CPU @ 532 Mhz, no GPU
3'' 240x320 Screen
256 MB Ram