Touch Controls Not Working #62

Open
Rusty-9 opened this Issue Mar 9, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@Rusty-9

Rusty-9 commented Mar 9, 2018

Hi @taisel

Would you be able to provide the source code for the i53emu site? I'm having hassle getting the touch controls to work on the default Iodine one (samsung galaxy S7 in chrome browser). I can load a rom but the controls are totally unresponsive. I tried to trace through to see where they were 'failing' but the press and release events seemed to be registering as far as 'GameBoyAdvanceJoyPad.prototype.checkForMatch' and I got stuck looking further (my working knowledge of JS is kinda scratchy!).

I noticed a reference to the controls being better on the i53emu version but I want to host locally (planning on switching out the google drive integration for server storage - it's only for my own use :) ) - would you be able to get me the SC? Or maybe a pointer as to where the issue with controls might be?

Hope that is OK, and makes sense...

@Onimishra

This comment has been minimized.

Show comment
Hide comment
@Onimishra

Onimishra Mar 20, 2018

@Rusty-9

I havn't been able to work on this project for some time now, but I'll try to help you the best I can.
Why would you target Android in the first place? I tried to get this up to running speeds on iOS, as Android already has native support for GBA emulator while iOS does not. It is not possible to play GBA games on iOS, unless we do it through the browser. The native versions for Android uses a lot less power, includes more features and has better support overall.

For mobile (i53emu) I had to redo the entire control scheme that was already present in the stock version of Iodine. It's luckily not that hard, as taisel did a really good job at separating specific integrations into modules.
If you open the source on i53emu (cmd+alt+i on a mac), go to Sources and find folder user_script/mvi. In there is most of my additions. i53emu is put together in a hurry just to see what could be done on iOS, so don't expect the same level of prettiness as the rest of Iodine ;)
In the Setup.js file, there is a function called bindBetterVirtualControls at ~L260. This sets up my own UI to handle the touch events.

The reason this is not working in Android Chrome, is most likely due to me using "touchstart" and something about nesting. This is usually the problematic areas. Again, I might be wrong - I haven't debugged it.

Let me know what you find :)

@Rusty-9

I havn't been able to work on this project for some time now, but I'll try to help you the best I can.
Why would you target Android in the first place? I tried to get this up to running speeds on iOS, as Android already has native support for GBA emulator while iOS does not. It is not possible to play GBA games on iOS, unless we do it through the browser. The native versions for Android uses a lot less power, includes more features and has better support overall.

For mobile (i53emu) I had to redo the entire control scheme that was already present in the stock version of Iodine. It's luckily not that hard, as taisel did a really good job at separating specific integrations into modules.
If you open the source on i53emu (cmd+alt+i on a mac), go to Sources and find folder user_script/mvi. In there is most of my additions. i53emu is put together in a hurry just to see what could be done on iOS, so don't expect the same level of prettiness as the rest of Iodine ;)
In the Setup.js file, there is a function called bindBetterVirtualControls at ~L260. This sets up my own UI to handle the touch events.

The reason this is not working in Android Chrome, is most likely due to me using "touchstart" and something about nesting. This is usually the problematic areas. Again, I might be wrong - I haven't debugged it.

Let me know what you find :)

@Rusty-9

This comment has been minimized.

Show comment
Hide comment
@Rusty-9

Rusty-9 Mar 20, 2018

Rusty-9 commented Mar 20, 2018

@taisel

This comment has been minimized.

Show comment
Hide comment
@taisel

taisel Mar 20, 2018

Owner

mobile was left in an incomplete state.

  • The control bar needs to be redone for it.
  • The audio backend needs to be replaced with an upcoming version that is able to jack into touch events a developer specifies so iOS restrictions can be removed and so it can be unmuted.

Tangential to this, I wonder if you noticed that meltdown/spectre kinda is forcing every browser to use the single threaded version again (The off-thread settings, it'll be greyed out on platforms that disabled sharedarraybuffer or don't support it). This affects mobile the most. It can be re-enabled in firefox settings. Even phones nowadays are dual/quad/hexa core, so we can offload the graphics thread for like a 40% gain.

Owner

taisel commented Mar 20, 2018

mobile was left in an incomplete state.

  • The control bar needs to be redone for it.
  • The audio backend needs to be replaced with an upcoming version that is able to jack into touch events a developer specifies so iOS restrictions can be removed and so it can be unmuted.

Tangential to this, I wonder if you noticed that meltdown/spectre kinda is forcing every browser to use the single threaded version again (The off-thread settings, it'll be greyed out on platforms that disabled sharedarraybuffer or don't support it). This affects mobile the most. It can be re-enabled in firefox settings. Even phones nowadays are dual/quad/hexa core, so we can offload the graphics thread for like a 40% gain.

@Onimishra

This comment has been minimized.

Show comment
Hide comment
@Onimishra

Onimishra Mar 20, 2018

And do you think this will become available again in the future, or will a hardware update be needed in order to mitigate the flaws? (meaning sharedarraybuffer will not be reintroduced anytime soon).

Yes, the audio backend needs an update in order to get it to work on iOS. This was one of the reasons I didn't complete i53emu - I knew that writing a new audio backend out of scope for the time I had to put into it.

And do you think this will become available again in the future, or will a hardware update be needed in order to mitigate the flaws? (meaning sharedarraybuffer will not be reintroduced anytime soon).

Yes, the audio backend needs an update in order to get it to work on iOS. This was one of the reasons I didn't complete i53emu - I knew that writing a new audio backend out of scope for the time I had to put into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment