Author Topic: 3.0 Alpha Testing  (Read 336796 times)

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: 3.0 Alpha Testing
« Reply #450 on: January 18, 2015, 02:05:42 PM »
Seems to be a problem with the zip file itself that makes it incompatible with the ZipFile class.  The crash happens at the call to "new ZipFile( file )", which is before doing anything mupen64plus-ae specific to look at the contents to find N64 ROMs.

I've been playing around with the file itself, and unable to extract it with any other utilities I have either.  Definitely appears to just be a corrupt zip file (either a bad zip, interrupted download, or possibly an exploit of some type).  Whatever the case, I'll add in a try/ catch block to make sure when these types of files are encountered they do not crash the app.
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 littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: 3.0 Alpha Testing
« Reply #451 on: January 18, 2015, 04:13:48 PM »
Is there another file in the zip besides the z64 file?  It may be "that one text file" included in it causing issues if there is such a file.

Just an FYI for anyone who's curious - the latest version has no difficulty with zip files that contain ROM files and other kinds of files together.

So tweaking the GLES related code is the only way to get rid of the requirement of specific offsets for each game on Android.
What makes that more difficult is the GLES differences between GPU brands.

Yes, GLES hardware implementation is all over the place.  Here was my first ever post to GitHub:
https://github.com/mupen64plus-ae/mupen64plus-ae/issues/5

And it's still discussed to this day:
https://github.com/mupen64plus/mupen64plus-video-rice/issues/42
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: 3.0 Alpha Testing
« Reply #452 on: January 18, 2015, 04:17:15 PM »
@scorpio16v: this build (commit 8c69c17) shouldn't crash any more if it encounters that corrupt zip file.
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 Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: 3.0 Alpha Testing
« Reply #453 on: January 18, 2015, 06:17:32 PM »
- Polygon offset wizard or something (need to know GL)

I don't know enough GL myself, but my thought on a possible strategy for this would be to set up a scene with two colored polygons (say red and blue, with red being the one you want to be on top).  Then pick an offset value and use glReadPixels to determine the color of a particular pixel.  Repeat using a bisect-like "higher, lower" function until the proper offset is found (presumably the threshold at which the pixel is red and would become blue if adjusted any further).
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 Zaneris

  • byte
  • *
  • Posts: 39
    • View Profile
Re: 3.0 Alpha Testing
« Reply #454 on: January 18, 2015, 06:37:23 PM »
I don't know enough GL myself, but my thought on a possible strategy for this would be to set up a scene with two colored polygons (say red and blue, with red being the one you want to be on top).  Then pick an offset value and use glReadPixels to determine the color of a particular pixel.  Repeat using a bisect-like "higher, lower" function until the proper offset is found (presumably the threshold at which the pixel is red and would become blue if adjusted any further).

The problem is with GLES 1.0, which I think is what Mupen uses? (Correct me if I'm wrong here)
Unlike GLES 2.0+ which is entirely shader based, 1.x has a fixed pipeline which doesn't directly talk to the GPU, it has to run through a hardware translation layer that converts your fixed pipe into a shader based one that the GPU understands, and this is what varies chip to chip.

The solution to permanently fix it would be to switch to GLES 2.0, but this would be a shit ton of work... and... I'm not doing that unless someone is paying me, lmao. As an added bonus you'd get a significant bump in performance though.

p.s. Don't actually offer me money to do this, I value my free time too much, haha.
« Last Edit: January 18, 2015, 06:41:08 PM by Zaneris »

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: 3.0 Alpha Testing
« Reply #455 on: January 18, 2015, 06:42:22 PM »
@Paul Yes that's exactly what I was thinking :D  I tried tinkering with this a long time ago, to see if I could make a simple java-based dialog with java GL calls (simpler to avoid jni).  I might dig that up again.  I think it might be important to have a few polygons, some at an angle with respect to the viewer to address polygon-offset-factor.

Edit: @Zaneris - mupen is already GLES 2.0.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: 3.0 Alpha Testing
« Reply #456 on: January 18, 2015, 08:24:51 PM »
I dug up my old polygon offset stuff.  Just a start, but pushed it to my fork.

Was thinking an ideal test would have a spinning cube where you tweak the settings until you see blue, green, and red sides.  Too much offset and the green side turns red, too little offset and the green side turns blue.  Then do the bisect algorithm to narrow down on the right values.  Having the cube tumbling randomly would ensure that the offset works well at various viewing angles.  Would be trivial to program in GL, just need to figure out the java context management stuff.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: 3.0 Alpha Testing
« Reply #457 on: January 18, 2015, 08:58:58 PM »
The "tumbling around randomly" concept would require human interaction though.  Would be nice if possible to determine a specific set of angles that could be sampled programmatically to auto-detect the correct offset value (versus having the user tweak the settings until it looks right).  Probably wouldn't take more than a second or two for the program to do, and could potentially be added as part of the "first run" actions.

That said, a manual process like you are thinking would be easier to develop (and probably a good place to start -- certainly better than what we have now, where you change the value, fire up Mario 64, rinse, and repeat).
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 littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: 3.0 Alpha Testing
« Reply #458 on: January 18, 2015, 09:31:04 PM »
Yeah good point.  I guess it's just baby steps at this point ;)
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Zaneris

  • byte
  • *
  • Posts: 39
    • View Profile
Re: 3.0 Alpha Testing
« Reply #459 on: January 18, 2015, 10:10:25 PM »
Edit: @Zaneris - mupen is already GLES 2.0.
Just took a look and I'm not so sure...

It says it requires it in the manifest, yes.
Code: [Select]
<uses-feature android:glEsVersion="0x00020000" />And SDL has support for GLES2 rendering...

But I'm not seeing a 2.0 surface initialized anywhere...

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: 3.0 Alpha Testing
« Reply #460 on: January 18, 2015, 10:19:38 PM »
See GameSurface.java for context creation.  Android.mk links against glesv2.  All video plugins include SDL_opengl_es2.h.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Gillou68310

  • Developer
  • long
  • *****
  • Posts: 112
    • View Profile
Re: 3.0 Alpha Testing
« Reply #461 on: January 19, 2015, 07:32:38 AM »
I made some modifications to the new dynarec and the DMULTU instruction is now recompiled instead of interpreted (ARM).  I need some testers to be sure nothing has been broken during the process. Autobuild is available here http://www.paulscode.com/source/Mupen64Plus-AE/AutoBuilds/Mupen64PlusAE_DMULTU_201501191001_fc16ce2.apk
« Last Edit: January 19, 2015, 10:13:57 AM by Gillou68310 »

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: 3.0 Alpha Testing
« Reply #462 on: January 19, 2015, 08:20:33 AM »
Awesome, thanks Gilles.  Testers - you can install this side-by-side with the Alpha builds - no need to uninstall.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: 3.0 Alpha Testing
« Reply #463 on: January 19, 2015, 08:30:43 AM »
Autobuild will be available here http://www.paulscode.com/source/Mupen64Plus-AE/AutoBuilds/ within an hour and should start with "Mupen64PlusAE_DMULTU"

Phooey.. doesn't look like it built.  I'll have to diagnose when I get home this evening, sorry about that!
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 Gillou68310

  • Developer
  • long
  • *****
  • Posts: 112
    • View Profile
Re: 3.0 Alpha Testing
« Reply #464 on: January 19, 2015, 08:35:13 AM »
Autobuild problem?