What happened to the Emscripten branch?
Re: What happened to the Emscripten branch?
There, for now: https://www.mediafire.com/file/6j90mzob ... c.bas/file
Re: What happened to the Emscripten branch?
Thanks for the file! Compilation runs smoothly , but I get an error when running in the browser:angros47 wrote:There, for now: https://www.mediafire.com/file/6j90mzob ... c.bas/file
And in the javascript console:Exception thrown, see JavaScript console
Okay, I will not distract you anymore, it looks like the version for JS is still far from working. Unfortunately, I'm only good for testing, but it looks like it's still a long way off. Thanks for your work.exception thrown: SyntaxError: Document.querySelector: '0' is not a valid selector,findEventTarget@http://localhost:8000/FBFILE.js:7193:98
__registerKeyEventCallback@http://localhost:8000/FBFILE.js:7251:17
_emscripten_set_keypress_callback_on_thread@http://localhost:8000/FBFILE.js:7266:33
$4@http://localhost:8000/FBFILE.js:627:12
$9@http://localhost:8000/FBFILE.js:714:4
$2@http://localhost:8000/FBFILE.js:603:5
createExportWrapper/<@http://localhost:8000/FBFILE.js:6743:22
callMain@http://localhost:8000/FBFILE.js:8597:28
doRun@http://localhost:8000/FBFILE.js:8656:31
run/<@http://localhost:8000/FBFILE.js:8667:7
setTimeout handler*run@http://localhost:8000/FBFILE.js:8663:15
runCaller@http://localhost:8000/FBFILE.js:8575:19
removeRunDependency@http://localhost:8000/FBFILE.js:6646:7
receiveInstance@http://localhost:8000/FBFILE.js:6813:24
receiveInstantiatedSource@http://localhost:8000/FBFILE.js:6829:20
promise callback*instantiateArrayBuffer@http://localhost:8000/FBFILE.js:6835:8
instantiateAsync@http://localhost:8000/FBFILE.js:6861:14
createWasm@http://localhost:8000/FBFILE.js:6877:3
@http://localhost:8000/FBFILE.js:8332:11
Re: What happened to the Emscripten branch?
Have you edited hinit.c as I showed you before?
Also, what have you tried to compile?
Try something basic like
Also, what have you tried to compile?
Try something basic like
Code: Select all
screenres 640,480
Print "Hello world"
Re: What happened to the Emscripten branch?
Sorry, I really haven't updated the hinit.c file. Actually I made edits, but it looks like I forgot to save to file. Indeed, graphical commands began to work. Thank you for your patience!
I just don’t understand why V1ctor's program doesn’t exit when you press Esc. The key is caught, the END command is executed, but the program continues.
I just don’t understand why V1ctor's program doesn’t exit when you press Esc. The key is caught, the END command is executed, but the program continues.
Re: What happened to the Emscripten branch?
Looks like the "mainloop" function should run continuously? I see a solution like this:
In any case, it's already cool that you can adapt programs to HTML+JS.
Code: Select all
type em_callback_func as sub
#ifdef __FB_JS__
declare sub emscripten_set_main_loop cdecl alias "emscripten_set_main_loop" (byval func as em_callback_func, byval fps as integer = 0, byval simulate_infinite_loop as integer = 0)
#else
sub emscripten_set_main_loop(byval func as em_callback_func, byval fps as integer = 0, byval simulate_infinite_loop as integer = 0)
if fps = 0 then
fps = 60
end if
do
func()
sleep 1000/fps
loop
end sub
#endif
sub mainloop
static iE as Long
var k = inkey
if( k = chr(27) ) andalso iE = 0 then
iE = 1
print "END!!!"
END
elseif iE = 0 then
print time
end if
end sub
screen 15
emscripten_set_main_loop @mainloop
Re: What happened to the Emscripten branch?
You are welcome!
What have you tried so far?
Anyway, I assume there is no real need for end for the program. If the program is running into a web page, it will end when you close the page, there is no need to end it before (what is it supposed to do after ending? Displaying a blank screen?)
What have you tried so far?
Anyway, I assume there is no real need for end for the program. If the program is running into a web page, it will end when you close the page, there is no need to end it before (what is it supposed to do after ending? Displaying a blank screen?)
Re: What happened to the Emscripten branch?
I'm trying different examples for now. When I tried to compile one of the simple games, I ran into a problem:What have you tried so far?
Code: Select all
screen 15
Dim TV As Integer
TV = 2 ^ (Int(Rnd * 2))
print TV
Looks like a problem with the operator ^wasm-ld: error: symbol type mismatch: pow
Re: What happened to the Emscripten branch?
There are still unavailable functions:
sin, cos.
In fact, I think there are many inaccessible functions, I just tried a little.
it is also impossible to create arrays without the shared specifier, for example, such a record will give an error:
sin, cos.
In fact, I think there are many inaccessible functions, I just tried a little.
it is also impossible to create arrays without the shared specifier, for example, such a record will give an error:
Code: Select all
Dim X(500) As Integer
wasm-ld: error: symbol type mismatch: memset
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: What happened to the Emscripten branch?
Maybe you can help emscript by using more c-runtime function !
#include "crt.bi"
cosf(), sinf(), powf() ...
or
#undef cos
#undef sin
#include "crt.bi"
#define cos cos_
#define sin sin_
...
only an idea or workaround
Joshy
#include "crt.bi"
cosf(), sinf(), powf() ...
or
#undef cos
#undef sin
#include "crt.bi"
#define cos cos_
#define sin sin_
...
only an idea or workaround
Joshy
Re: What happened to the Emscripten branch?
Likely you are right, but at the moment we are trying to get the compiler to work, so using a workaround to get a test to work is not the best solution.
It looks like some module might not be linked properly
It looks like some module might not be linked properly
Re: What happened to the Emscripten branch?
That's weird:
works
returns error
Code: Select all
Dim X(15) as integer
Code: Select all
Dim X(16) as integer
Re: What happened to the Emscripten branch?
This does not work. In all cases, an error appears like:D.J.Peters wrote:Maybe you can help emscript by using more c-runtime function !
#include "crt.bi"
cosf(), sinf(), powf() ...
or
#undef cos
#undef sin
#include "crt.bi"
#define cos cos_
#define sin sin_
...
only an idea or workaround
Joshy
wasm-ld: error: symbol type mismatch: sinf
Re: What happened to the Emscripten branch?
Seems related to this, perhaps? https://stackoverflow.com/questions/610 ... -functions
Re: What happened to the Emscripten branch?
Unfortunately for me this is a dark forest. I do not know the specifics of compilers, interpreters, etc.angros47 wrote:Seems related to this, perhaps?
Re: What happened to the Emscripten branch?
Looks like it's possible to see the symbols of the .o file using llvm-nm, that is located in emsdk/upstream/bin/llvm-nm