Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Won't work on iOS #5

Open
WafflyChar01 opened this issue Jun 16, 2023 · 9 comments
Open

Won't work on iOS #5

WafflyChar01 opened this issue Jun 16, 2023 · 9 comments

Comments

@WafflyChar01
Copy link

I put the .4gs file in and then it says no file chosen. I have tried safari, chrome, etc. idk what to do

@Thysbelon
Copy link
Owner

@WafflyChar01
Copy link
Author

WafflyChar01 commented Jun 17, 2023

Yes, I can

@WafflyChar01
Copy link
Author

For more clarity, I can select a file and for a split-second it shows my file and then says no file chosen

@WafflyChar01
Copy link
Author

WafflyChar01 commented Jun 17, 2023

Is there anything I can do? I was wanting to play on my gba tonight

@Thysbelon
Copy link
Owner

Thysbelon commented Jun 18, 2023

Sorry for not saying much, and thank you for being patient with me. I don't have an iPhone, so I don't think I'll ever be able to fix this issue. The fact that this doesn't seem to happen on all iPhones would make it even more difficult to solve.

It would be very helpful to see what the Console says when the website fails. The problem with that is I don't think you can view the iPhone browser Console without connecting a Mac. I tried redirecting all console.log commands to a visible part of the webpage, but doing that didn't redirect the logs made by the Emscripten module (which is the code that does most of the conversion work).

Unless you have a Mac and are willing to help, I don't think I can fix this bug.

I noticed that your comment said "pc" before you edited it. Do you have a PC? If you do, maybe you can work around this bug by copying the 4gs file to your pc, then using the website on your pc.

@WafflyChar01
Copy link
Author

No worries, I have a of that I'll try, I'll let you know the results

@euan-forrester
Copy link

@Thysbelon There's a couple options to get C log messages to the browser console that you might want to try:

#include <emscripten.h>

emscripten_run_script("console.log('Hello from C!')");

or

#include <emscripten.h>

EM_JS(void, call_console_log, (), {
  console.log('Hello from C!');
});

int main() {
  call_console_log();
  return 0;
}

https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html#calling-javascript-from-c-c

@Thysbelon
Copy link
Owner

Thank you for your help @euan-forrester. I have created a "debug mode" that redirects most console messages to html. Hopefully it helps.

@euan-forrester
Copy link

No problem! I hope it helps! I wonder if the issue will end up being the file I/O

For reference, when I did something similar (for decrypting PSP saves -- the code for that is all in C) I did all the file I/O in javascript and just passed the C stuff an array of bytes:

https://github.com/euan-forrester/save-file-converter/blob/main/frontend/src/save-formats/PSP/Savefile.js#L85

Then I wrote a wrapper in C that translated that array of bytes into what the rest of the C code was expecting:

https://github.com/euan-forrester/psp-encryption-webassembly/blob/main/src/Tools/SaveTool/decrypt.cpp#L117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants