Author Topic: Finishing up the final pieces  (Read 14455 times)

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Finishing up the final pieces
« on: December 16, 2012, 08:35:02 PM »
As we get closer to having all the main missing pieces filled in and moving on to stress-testing release candidates in the near future, it will probably start becoming more likely for collisions to start happening between developers.  So I thought I would start a thread, where I can post what I'm working on, to avoid stepping on anyones toes.

The next things I'm working on are fixing the remaining bugs with the cheats menu, and then re-implementing hi-res texture pack importing.  I am currently writing a generic "Please Wait" dialog system for threading process that previously just annoyingly blocked the UI thread.  This will take a context, message, and extension of runnable that implements a callback to hook into to know when the process is complete.  I'm making this generic, since it will be useful in a lot of places (for starters, I need it for reading the CRC header to fill the cheats menu, and for extracting hi-res texture packs).
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: Finishing up the final pieces
« Reply #1 on: December 16, 2012, 09:13:34 PM »
Good idea.  Might also be good to make a working list on the OP of major elements that remain.

Besides the bugfixes noted in the other thread, here's what's on the top of my plate, and the default order I plan to tackle them:
 - Finishing up the Assets unpacker so that we can put raw assets in the repo instead of the zip.
 - IMEs (like USB/BT Joystick Center) are not being heard... I know the problem but it's not a one-line fix.
 - True multiplayer support.  This will require the most creativity... a clear and unobtrusive UI is critical since it will have to be called every time the device reboots or a controller is re-plugged and multiplayer is enabled.
 - User pref to hide overlays while touchscreen enabled (for IMEs that map to touch).  Should be straightforward.
 - Special function mapping front-end.

Paul, let me know if you'd like a different prioritization.
« Last Edit: January 03, 2013, 10:30:12 PM by littleguy »
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: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Finishing up the final pieces
« Reply #2 on: December 16, 2012, 11:46:29 PM »
Sounds good to me.  I may begin calling builds "release candidates" before all of your list there is implimented once the most serious issues are fixed, since I'd like to get published -- really what we have now is a lot further than I was with the first GUI implementation when I published version 1.0 (can be very easy to get caught in the trap of wanting everything perfect first and never publishing, like drk has with nulldce)

EDIT: BTW, I won't actually publish until I get the go-ahead from you guys.  If the app is really not ready to go at that point , then just let me know.  There is definitely a difference between important features and necessary functionality.
« Last Edit: December 17, 2012, 04:29:53 AM by Paul »
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: Finishing up the final pieces
« Reply #3 on: December 17, 2012, 09:05:58 AM »
That sounds wise.  If it were only up to me I'd probably be too perfectionist to ever push it out the door.  We'll just need to be clear what functions don't work when we push so people aren't screaming WTF...
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: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Finishing up the final pieces
« Reply #4 on: December 17, 2012, 10:30:33 AM »
We'll just need to be clear what functions don't work when we push so people aren't screaming WTF...

That's a good point.  When I publish, I'll be sure to clearly lay out what functionality is hooked up, and what is in the process of being re-hooked up (anything missing that was in the 1.x series).  I also think the fact that I'll be labeling it version Beta 2.0, and the GUI being significantly different than 1.9.2 (and from all the other copycats :P), most folks will understand that the app is undergoing a rather large overhaul of the GUI.  There will of course be the 1-stars from the devices where the app runs slower, a game doesn't work as well, or someone was using a customization or feature that isn't available.  And of course there will still be the 1-stars that say something like "Sucks! Dev took months to update and [insert game title here] still runs like crap on my [insert ARM6 device here]!"
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: Finishing up the final pieces
« Reply #5 on: December 17, 2012, 11:03:56 AM »
LOL!  Yeah for some people free just isn't good enough.

Been thinking for a while it would be nice to have a popup whenever the user first launches the app after an update... like seen in a lot of the major apps.  Would show the new features added and the bugs fixed, and any major items still missing/broken.  Seeing popups like "Multiplayer fully supported now" or "Crash on Zelda OOT fixed" would help ensure our hard work doesn't go unnoticed.  Just imagining users getting the popup and saying Sweet!! and racing to try out the new fix.  I do that all the time when I see a new beta available for Apex launcher.

Anyhow, there's probably an API for that, or at least a general pattern for implementing it.  Maybe you already have some ideas.
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: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Finishing up the final pieces
« Reply #6 on: December 17, 2012, 11:12:34 AM »
That would be a great idea.  I was going to do something like that with the old GUI, but never got around to it.  Definitely wouldn't want it to be a nag-screen though - it should go away permanently after the first run of an update.
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: Finishing up the final pieces
« Reply #7 on: December 17, 2012, 11:22:40 AM »
Absolutely.  A lot of apps do it, and only do it only on the first launch after an update. 
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: Finishing up the final pieces
« Reply #8 on: December 19, 2012, 11:47:05 AM »
I added the menu/preferences for special function mapping.  Now I need to wire it into the core.  Do you recall how the special functions are invoked from Java?  I can't tell if this translation happens in Java or C.

For example, I could just decode the inputs in Java and call functions like NativeMethods.stateSaveEmulator().  However, only a subset of the special functions are accessible through NativeMethods at the moment.

Alternatively, the C code might decode the inputs and respond accordingly (e.g. something like the C function DoCommand IIRC).  I looked at the old code and it looks like a key map is written to the config file... but we moved away from that approach in version 2.

Currently, button and stick signals are decoded in java and AbstractController passes them to the core via NativeMethods.updateVirtualGamePadStates.  So all else equal, maybe for consistency we decode and invoke from Java for the special functions as well.
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: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Finishing up the final pieces
« Reply #9 on: December 19, 2012, 12:54:33 PM »
Yes, I think that's how to handle this.  They are being updated on key presses, so not sure if it should be individual JNI calls per function, or a single JNI call that passes an array of press states to a handler function on the native side.  Whichever is easier for you to think about is probably fine.  These will be invoking core commands I think rather than hacking the core for a direct rout (unless we find that this slows things down and we need something more direct)
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: Finishing up the final pieces
« Reply #10 on: December 19, 2012, 01:55:24 PM »
Cool.  I'll just handle the keypresses in Java then.  I'll stub out any functions that don't exist yet so it will be obvious what remains.
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: Finishing up the final pieces
« Reply #11 on: December 20, 2012, 02:08:09 PM »
Last night's commit takes care of special function mapping and the front-end for handling the input.  Just need to implement/call the right functions on the back-end.  I noted a weakness in the UI for it in the commit log, but this should be good enough for now I think.
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: Finishing up the final pieces
« Reply #12 on: December 20, 2012, 11:00:28 PM »
Tonight's commit takes care of multiplayer deconfliction and the UI for defining the controller->player mapping.
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: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Finishing up the final pieces
« Reply #13 on: December 22, 2012, 01:01:33 AM »
Next I'm going to debug the re-broken "Reset" function, and hook up the missing pieces for the mappable core functions.  I could possibly step on your toes for that last one, so let me know if you'd rather take it, and I'll work on something else.
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: Finishing up the final pieces
« Reply #14 on: December 22, 2012, 07:22:27 AM »
No, you won't step on my toes.  I think for the last one you'll just be creating/extending the java->jni methods, and then just calling them from PeripheralController where all the TODOs are.  If any of the switch cases involve more than a few lines of code, it would probably make sense to encapsulate them in CoreInterface or something to keep PeripheralController clean.

For the reset function, if all else fails, a completely front-end solution is just to kick the user back the main menu and delete the auto-save file.  The next time they launch they'll be reset.

I'm working on IME listening now, and I'll probably put in the Hide Overlay preference at some point when I get distracted :P.  The finer polishes after that will be fixing the screen orientation loss of state for all the custom preferences (it doesn't just affect the cheats preference), I think this just requires getting more into the nitty gritty of Android's documentation.

Edit: One more thing for me before publishing to google is an interface to copy the savegames, skins, etc.  Shouldn't be hard, but just wanted to mention it so we don't forget.

Also, I suppose we can clean up the assets folder a bit now that it's uncompressed in git.  Was thinking some of those text files listing all the skins and stuff can be removed.
« Last Edit: December 22, 2012, 07:30:05 AM by littleguy »
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version