Code Monkey home page Code Monkey logo

em-dosbox's People

Contributors

bartekbp avatar derkoun avatar dreamlayers avatar hikari-no-yume avatar jbaicoianu avatar jbanes avatar mkulke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

em-dosbox's Issues

Making a dosbox.js file with errors

I try to build a dosbox.js file. Platform of my PC is Ubuntu_14.04.02_x64.
I write in the console next:

  1. git clone https://github.com/dreamlayers/em-dosbox.git

    done

  2. cd em-dosbox

    done

  3. sudo ./autogen.sh

    done. Now you are ready to run ./configure

  4. sudo emconfigure ./configure

    done

  5. sudo make

    errors, the result below:

make all-recursive
make[1]: Entering directory /home/vladimir/Documents/em-dosbox' Making all in src make[2]: Entering directory/home/vladimir/Documents/em-dosbox/src'
python version.py ../include/version.h .. /usr/share/emscripten/em++
make all-recursive
make[3]: Entering directory /home/vladimir/Documents/em-dosbox/src' Making all in cpu make[4]: Entering directory/home/vladimir/Documents/em-dosbox/src/cpu'
make all-recursive
make[5]: Entering directory /home/vladimir/Documents/em-dosbox/src/cpu' Making all in core_full make[6]: Entering directory/home/vladimir/Documents/em-dosbox/src/cpu/core_full'
make[6]: Nothing to be done for all'. make[6]: Leaving directory/home/vladimir/Documents/em-dosbox/src/cpu/core_full'
Making all in core_normal
make[6]: Entering directory /home/vladimir/Documents/em-dosbox/src/cpu/core_normal' make[6]: Nothing to be done forall'.
make[6]: Leaving directory /home/vladimir/Documents/em-dosbox/src/cpu/core_normal' Making all in core_dyn_x86 make[6]: Entering directory/home/vladimir/Documents/em-dosbox/src/cpu/core_dyn_x86'
make[6]: Nothing to be done for all'. make[6]: Leaving directory/home/vladimir/Documents/em-dosbox/src/cpu/core_dyn_x86'
Making all in core_dynrec
make[6]: Entering directory /home/vladimir/Documents/em-dosbox/src/cpu/core_dynrec' make[6]: Nothing to be done forall'.
make[6]: Leaving directory /home/vladimir/Documents/em-dosbox/src/cpu/core_dynrec' make[6]: Entering directory/home/vladimir/Documents/em-dosbox/src/cpu'
make[6]: Nothing to be done for all-am'. make[6]: Leaving directory/home/vladimir/Documents/em-dosbox/src/cpu'
make[5]: Leaving directory /home/vladimir/Documents/em-dosbox/src/cpu' make[4]: Leaving directory/home/vladimir/Documents/em-dosbox/src/cpu'
Making all in debug
make[4]: Entering directory /home/vladimir/Documents/em-dosbox/src/debug' make[4]: Nothing to be done forall'.
make[4]: Leaving directory /home/vladimir/Documents/em-dosbox/src/debug' Making all in dos make[4]: Entering directory/home/vladimir/Documents/em-dosbox/src/dos'
make[4]: Nothing to be done for all'. make[4]: Leaving directory/home/vladimir/Documents/em-dosbox/src/dos'
Making all in fpu
make[4]: Entering directory /home/vladimir/Documents/em-dosbox/src/fpu' make[4]: Nothing to be done forall'.
make[4]: Leaving directory /home/vladimir/Documents/em-dosbox/src/fpu' Making all in gui make[4]: Entering directory/home/vladimir/Documents/em-dosbox/src/gui'
/usr/share/emscripten/em++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -O3 -s USE_SDL=2 -MT sdlmain.o -MD -MP -MF .deps/sdlmain.Tpo -c -o sdlmain.o sdlmain.cpp
sdlmain.cpp:2022:4: error: use of undeclared identifier
'emscripten_sleep_with_yield'
emscripten_sleep_with_yield(1);
^
sdlmain.cpp:2157:16: warning: implicit conversion from 'SDL_EventType' to
'Bit8u' (aka 'unsigned char') changes value from 769 to 1
[-Wconstant-conversion]
sdl.laltstate=SDL_KEYUP;
~^~~~~~~~~
sdlmain.cpp:2158:16: warning: implicit conversion from 'SDL_EventType' to
'Bit8u' (aka 'unsigned char') changes value from 769 to 1
[-Wconstant-conversion]
sdl.raltstate=SDL_KEYUP;
~^~~~~~~~~
sdlmain.cpp:2845:18: warning: implicit conversion from 'SDL_EventType' to
'Bit8u' (aka 'unsigned char') changes value from 769 to 1
[-Wconstant-conversion]
sdl.laltstate = SDL_KEYUP;
~ ^~~~~~~~~
sdlmain.cpp:2846:18: warning: implicit conversion from 'SDL_EventType' to
'Bit8u' (aka 'unsigned char') changes value from 769 to 1
[-Wconstant-conversion]
sdl.raltstate = SDL_KEYUP;
~ ^~~~~~~~~
4 warnings and 1 error generated.
ERROR root: compiler frontend failed to generate LLVM bitcode, halting
make[4]: *** [sdlmain.o] Error 1
make[4]: Leaving directory /home/vladimir/Documents/em-dosbox/src/gui' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory/home/vladimir/Documents/em-dosbox/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory /home/vladimir/Documents/em-dosbox/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/vladimir/Documents/em-dosbox'
make: *** [all] Error 2

What did I do wrong?

Ability to save files?

I tried to figure out a way to make the saved games persistent. After extensive documentation searching, I realized the root filesystem is always MEMFS mounted from the data. Would it be possible to merge/remount(?) the root with IDBFS? If is possible with emscripten it should be configured in this repo right?

The alternatives I could think of is to create custom shell.html for this project and point emcc to it, and try to talk to FS API from JavaScript. A nicer em-dosbox UI can be created as a bonus with this approach. I would love to contribute to that as well :)

Cap on available memory?

Hi guys are there imposed caps on the available emulated memory to programs? Regardless of my configurations the maximum available extended/expanded free memory is always at most 14912 Kb. DOSBox is normally quite happy to make up to 63296 Kb available.

friendlier window title

I came across this playing the excellent MS-DOS Game collection at the Internet Archive, great work! I was confused by the games there putting, e.g. "DOSBox SVN, CPU speed: 3000 cycles, Frameskip 0, Program: STUNT" in the window title (thus browser tab and browser history). Tabs and dropdowns cut off the end of this so you don't see what program you're running and it's quite confusing.

Em-DOSBox's GFX_SetTitle() in src/gui/sdlmain.cpp sets the title to the nerdy
"DOSBox %s, CPU speed: %8d cycles, Frameskip %2d, Program: %8s",VERSION,internal_cycles,internal_frameskip,RunningProgram)
a friendlier layout with the key information first would be
"STUNT running in Em-DOSBox v. SVN (CPU speed: 3000 cycles, Frameskip 0)

(the misleading version "number" SVN comes from src/platform/visualc/config.h).

MP3 CUE

bin/cue with CDAudio work fine. Possible mount with MP3 files?
Example cue file:
FILE "Horde.iso" BINARY
TRACK 01 MODE1/2048
INDEX 01 00:00:00
FILE "Track02.mp3" MP3
TRACK 02 AUDIO
PREGAP 00:02:00
INDEX 01 00:00:00
FILE "Track03.mp3" MP3
TRACK 03 AUDIO
INDEX 01 00:00:00
FILE "Track04.mp3" MP3
TRACK 04 AUDIO
INDEX 01 00:00:00

Unable to press Escape

Hello,

This project is awesome, thanks for creating it!

I followed the instructions in README.md to the best of my ability, and tried to package an old DOS application of mine with em-dosbox. Here it is: http://roboticoverlords.org/burn (press space several times when it's loading to enter the draw mode where you can use the arrow keys and space to draw and z, x, c and v to perform various effects).

Everything works surprisingly well, but pressing Escape to exit the drawing mode does not seem to work.

Escape has code 283 and is read with ah=00h, int 16h, which is fairly common. Unfortunately, the status of the Caps Lock key is also read first, using ah=01h, al=00h, int 16h. I suspect that it is this interrupt call that is disrupting the key handling somehow.

The pascal/assembly source code is available here. It's not terribly clever (I was 16 at the time).

Perhaps this will have to be fixed in dosbox itself?

Any advice for how to move forward on this is appreciated. The drawing program is pure nostalgia for me.

Best regards,
Alexander F Rødseth

working offline html?

HTML Js dos in a folder drag into browser?
How can i do this.
before you give me npx commands where do i inject those when i do it on npm its says i does not have permission to install stuff

dosbox.js and dosbox.html packaging problem.

I would like to question regarding em-scripten.
I do not speak much English.Please understand.

I want use em-dosbox very strongly.
but, im cannot this program. Im not programmer.
That(em-scripten) is so hard to me.

I tried packaging with em-scripten.(my step below)

  1. install em-scripten. (*cf : my system : windows7)
  2. download and extract em-dosbox0.74 to "C:\temp\em-dosbox-dosbox-0.74"
  3. run cmd , and prompt move "C:\temp\em-dosbox-dosbox-0.74"
  4. typing "emconfigure ./configure"

then, error code printed.(below)


D:\Temp\em-dosbox-dosbox-0.74>emconfigure ./configure
ERROR root: Exception thrown when invoking Popen in configure with args: "./configure"!
Traceback (most recent call last):
File "C:\Program Files\Emscripten\emscripten\1.12.0\emconfigure", line 24, in
shared.Building.configure(sys.argv[1:])
File "C:\Program Files\Emscripten\emscripten\1.12.0\tools\shared.py", line 1087, in configure
process = Popen(args, stdout=stdout, stderr=stderr, env=env)
File "C:\Program Files\Emscripten\python\2.7.5.3_32bit\lib\subprocess.py", line 711, in init
errread, errwrite)
File "C:\Program Files\Emscripten\python\2.7.5.3_32bit\lib\subprocess.py", line 948, in _execute_child
startupinfo)
WindowsError: [Error 2]

D:\Temp\em-dosbox-dosbox-0.74>


I was so confused right now.
I can not imagine what the error is resolved at all, whether to do.

Can you provide an easy guide for beginners?

em-dosbox slows down after a few seconds

Latest version, that works fine: 648bf07dM (November 2016) / First version with this problem: 8fedaa0 (March 2017). In these examples, the colors should switch every 22 seconds (the first time after 37 seconds):
[links removed]
The time of "8fedaa0c " is almost two minutes. The current version has the same problem. I tested it with Firefox and Chrome.

Simple html

nfs
nfs2
How to to display only the game? You can place a ready dosbox.html template?
Thanks

Internet Explorer 11: Exception thrown - 'isScreen' is undefined

I compiled em-dosbox according to the instructions in the Wiki. After that I tried to run a pure instance of DOSBox (without any additional software), just using the default dosbox.html file. It will run without any problem in Chrome or Firefox, however an Exception will be thrown when using Internet Explorer 11 in Windows 7.

"isScreen" is undefined
dosbox.js Line 1 Column 28211

The status bar just displays that an Exception had been thrown, the DOSBox canvas will remain empty.

WebExtension?

It would be nice if we could package this up as a webextension and then use the file api to load local files. I know there already is a dosbox webextension, but it looks like nobody has done anything with it in a few years.

Broken resolution (scaling artifacts or something)

With empty dosbox.conf and otherwise default settings of anything:

Screenshot

Somehow output resolution of canvas does not match internal resolution. Please help identify cause. This is not due to scaling on CSS/DOM side, because Module.SDL2.image.data contains these artifacts too. Therefore it happens somewhere before..

emdosbox boot from a diskette image is possible?

Hello! I am following your project and I am very excited to be more advanced tests!

First, I need to know if I can boot en-dosbox with an image of floppy or hard drive? If possible which way to do this? as emdosbox upload a file "dosbox.conf"?
I tested and I could not success. I created a folder "/boot" and inside copied an image of floppy (BOOT98.IMG) and dosbox.conf also. But to try to compile I get an error that is missing a third parameter?

My command is: ./packager.py novoboot boot ("novoboot" is a folder compiled, "boot" is a folder name.)

root@em-dosbox:/em-dosbox/src# ls
1Feitos dosbox.cpp fpu Makefile.am pre.js
1loader dosbox.html gui Makefile.in repackager.py
boot dosbox.ico hardware misc shell
cpu dosbox.js ints packager.py version.py
debug dosbox.o libs packager.py
winres.rc
dos emterpretify.txt Makefile platform

root@em-dosbox:~/em-dosbox/src# ./packager.py novoboot boot

When packaging directory, supply file to run as 3rd argument.

The dosbox.conf file is:

[dosbox]
memsize=64
machine=svga_s3
[cpu]
cycles=max
core=auto
[autoexec]
imgmount a "BOOT98.IMG" -t floppy
boot -l a

I test it under dosbox-0.74 official release and run ok! My intention is load under emdosbox small hard-disk image with vintage OS´s.
If possible, I can create the packages (using packager.py) under Windows 7 64?
Sorry for my writing, I am using the translator. Thank you in advance!

Setting "image-rendering: pixelated" on the canvas?

I gave "image-rendering: pixelated" a try on archive.org via the Chrome dev tools and IMO it improves the quality of low res games in full screen significantly. (By default they look pixelated and blurry at the same time.) [note: currently works only in Chrome and Opera, but support should improve]

I wonder what others think: would setting this on the em-dosbox canvas by default or optionally be a worthwhile improvement?

If there is interest I'd put together a pull request

save the state of a running application/game

Seen in the code there are methods 'pause MainLoop', 'resume MainLoop'.
Is it possible to save the state of a running application/game to the next start DOSBOX be able to start from the same place?

Trying to manually control pointerlock

I'm trying to use em-dosbox in a situation where I want to be able to manually enable or disable pointerlock when a system is in use. I'm embedding this into another app which has its own pointerlock handling, so I'd like to only lock to the em-dosbox canvas element when it's been clicked directly, or focused in code.

It seems that as it is now, either em-dosbox or emscripten itself is calling emscripten_request_pointerlock() in response to keydown events, regardless of what I try to do to restrict mouse capture.

Things I've tried so far:

  • ENV['SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT'] = '#canvas';
  • Module.elementPointerLock = true (tried false too, no difference)
  • autolock=false in the [SDL] section of dosbox.conf

I looked into the code to try to trace this, I see two possible places which could be triggering it:

em-dosbox/src/gui/sdlmain.cpp

Lines 1213 to 1225 in 1f46d1d

void GFX_CaptureMouse(void) {
if (use_capture_callback) {
if (sdl.mouse.locked) {
emscripten_exit_pointerlock();
} else {
//This only raises a request. A callback will notify when pointer
// lock starts. The user may need to confirm a browser dialog.
emscripten_request_pointerlock(NULL, true);
}
} else {
doGFX_CaptureMouse();
}
}

which is called from several places, but I wonder if

em-dosbox/src/gui/sdlmain.cpp

Lines 1279 to 1289 in 1f46d1d

EM_BOOL em_pointerlock_callback(int eventType,
const EmscriptenPointerlockChangeEvent *keyEvent,
void *userData) {
if (eventType == EMSCRIPTEN_EVENT_POINTERLOCKCHANGE) {
if ((!keyEvent->isActive && sdl.mouse.locked) ||
(keyEvent->isActive && !sdl.mouse.locked)) {
doGFX_CaptureMouse();
}
}
return false;
}
is causing issues, for example, if I already have the pointer locked when the emscripten module boots, when I exit from my own app's pointerlock, maybe this is triggering?

The other place that looks suspicious is Emscripten's deferred fullscreen/pointerlock requesting code, https://github.com/kripken/emscripten/blob/master/src/library_html5.js#L69-L97 - this queues up any requests to requestPointerLock() which may have happened and forces them to be executed on a qualifying user interaction event. So it's possible some code somewhere is requesting pointerlock and it's not being applied until I start trying to press keys (in this case, WASD to move around my virtual world)

Any hints on how to disable the built-in pointerlock logic and handle it myself?

OSError: [Errno 2] No such file or directory: '/Users/XX/.emscripten_ports/sdl2/SDL2-version_9/include'

OS - Mac Siera

i've followed all the instruction, but when i try "make" i am receiving the following errors:
$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in src
python version.py ../include/version.h .. /Users/davidnelband/Sites/emsdk_portable/emscripten/1.35.0/em++
fatal: Not a git repository (or any of the parent directories): .git
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in cpu
/Users/davidnelband/Sites/emsdk_portable/emscripten/1.35.0/em++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -DGET_X86_FUNCTIONS -O3 -s USE_SDL=2 -MT libextfun_a-core_normal.o -MD -MP -MF .deps/libextfun_a-core_normal.Tpo -c -o libextfun_a-core_normal.o test -f 'core_normal.cpp' || echo './'core_normal.cpp
WARNING:root:generating port: sdl2.bc...
Traceback (most recent call last):
File "/Users/davidnelband/Sites/emsdk_portable/emscripten/1.35.0/emcc", line 1128, in
args = get_bitcode_args([input_file]) + ['-emit-llvm', '-c', '-o', output_file]
File "/Users/davidnelband/Sites/emsdk_portable/emscripten/1.35.0/emcc", line 1108, in get_bitcode_args
args = system_libs.process_args(args, shared.Settings)
File "/Users/davidnelband/Sites/emsdk_portable/emscripten/1.35.0/tools/system_libs.py", line 527, in process_args
args = port.process_args(Ports, args, settings, shared)
File "/Users/davidnelband/Sites/emsdk_portable/emscripten/1.35.0/tools/ports/sdl.py", line 57, in process_args
get(ports, settings, shared)
File "/Users/davidnelband/Sites/emsdk_portable/emscripten/1.35.0/tools/ports/sdl.py", line 49, in get
return [shared.Cache.get('sdl2', create, what='port')]
File "/Users/davidnelband/Sites/emsdk_portable/emscripten/1.35.0/tools/cache.py", line 41, in get
temp = creator()
File "/Users/davidnelband/Sites/emsdk_portable/emscripten/1.35.0/tools/ports/sdl.py", line 31, in create
shutil.copytree(source_include_path, dest_include_path)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 171, in copytree
names = os.listdir(src)
OSError: [Errno 2] No such file or directory: '/Users/davidnelband/.emscripten_ports/sdl2/SDL2-version_9/include'
make[4]: *** [libextfun_a-core_normal.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

what did i miss / what should i do to solve this?

Mount cdrom and local directory

Hi,
I have a problem with some games, which need cdrom. These games need mount drive as cdrom and also mount drive as local directory. Mount drive as cdrom works great, if it is alone. But together, it is end of program. It is working in dosbox program, but not in browser. And there is no special errors, only ordinary errors in console log, which there are every time, when program ends.

this is screenshot from program:
heroes2 new

And here are commands from dosbox.conf:
[autoexec]
mount f "cdtest" -t cdrom
mount C "." (here program ends)
C:
GAME.EXE

console log:
heroes2-new.html:1245 pre-main prep time: 1621 msModule.printErr @ heroes2-new.html:1245
heroes2-new.html:1233 DOSBox version af1fa29 built with Emscripten 1.29.6 80d92c0
heroes2-new.html:1233 Copyright 2002-2015 DOSBox Team, published under GNU GPL.
heroes2-new.html:1233 ---
3heroes2-new.html:1245 Calling stub instead of sigaction()Module.printErr @ heroes2-new.html:1245
heroes2-new.html:1233 CONFIG:Loading primary settings from config file dosbox.conf
heroes2-new.html:1233 SDL:Current window pixel format: SDL_PIXELFORMAT_RGB888
heroes2-new.html:1233 MIXER:Got different values from SDL: freq 48000, blocksize 2048
heroes2-new.html:1233 MIDI:Opened device:none
heroes2-new.html:1233 Emulation ended because program exited.
dosbox.js:1 Uncaught SimulateInfiniteLoop

Thanks for your help

Keys sending non-US characters don't work in Firefox

This was examined in Windows 7 using a SDL 2 build of Em-DOSBox.

In Chrome 57.0.2987.98 (Official Build) (32-bit), when I use the Croatian keyboard layout, keys which would send non-US characters ([];') send US keyboard layout characters for those keys. This is like the official 0.74 build. However, z and y do get swapped to their Croatian layout places, unlike in the official 0.74 build

In Firefox 52.0 (32-bit), keys which send non-US characters have no effect. This is not okay. Z and y also get swapped.

Note that you can set keyboard layouts inside DOSBox, independently of the OS. To get a Croatian layout, you could use keyb yu for the Yugoslavian layout. The keys which send non-US characters have no effect in Firefox even after keyb yu. With both the Croatian layout set in Windows and keyb yu in DOSBox, the z and y are also swapped twice, back to their original US position. In Firefox, the workaround would be to use the US keyboard layout in the OS and set the keyboard layout in DOSBox if you need those characters. It would be nice to simply use the OS keyboard layout.

SDL2

Hi @dreamlayers! Sorry for this issue, I will close it immediately. I write it because, I can't find any way to ask you in private message. I'am maintainer of js-dos.com, it is based on your great job of porting dosbox to js. I have question, could you please help me. Why in latest build you switched to SDL2 for porting? Is it better or what? I want to update my project with latest version, but I am not sure which is better, I think SDL1 is less in terms of size. Thank you very much, for your great job!

Exception thrown, see JavaScript console

Hi,
I have a problem with running DOS app other then dosbox.html
When I use ./packager.py u2k UCZN2000.EXE
Result is : "Remember to build the main file with -s FORCE_FILESYSTEM=1 so that it includes support for loading this file package" I dont have any idea what is meaning of this.

And when I run python -m SimpleHTTPServer. And go to u2k.html
I see somthing like this:
image

Please help.

Package multiple executables?

How would I package a game that requires installation before running?
For example, I would like to package both INSTALL.EXE and GAME.EXE.

Now, for the arguments, I would like to run the command 'INSTALL.EXE & GAME.EXE' so that after the user finishes the installation and exits, GAME.EXE would be run immediately after.

Is this possible?

[Chrome] XMLHttpRequest. Cannot load file

I'm trying to load a game offline.
Firefox plays it with no problem
Chromium/e says that the game file cannot be loaded.

In the console, the error is:
loader.js:1135 XMLHttpRequest cannot load file:///MyGame/game.zip Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

What can I do?

Exception thrown, see JavaScript console

Help please, compile em-dosbox for armv7 system.
Steps:

LLVM
sudo mkdir -p /usr/local; cd /usr/local
sudo wget http://llvm.org/releases/3.7.1/clang+llvm-3.7.1-armv7a-linux-gnueabihf.tar.xz
sudo tar xvf clang+llvm-3.7.1-armv7a-linux-gnueabihf.tar.xz
sudo mv clang+llvm-3.7.1-armv7a-linux-gnueabihf llvm-3.7.1
export PATH="$PATH:/usr/local/llvm-3.7.1/bin"

Node
wget http://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz
tar xvf node-v0.12.7.tar.gz
cd node-v0.12.7
./configure
make -j4
sudo make install

git clone git://github.com/kripken/emscripten.git

Building Fastcomp
cd && mkdir myfastcomp && cd myfastcomp && git clone https://github.com/kripken/emscripten-fastcomp && cd emscripten-fastcomp && git clone https://github.com/kripken/emscripten-fastcomp-clang tools/clang
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="ARM;JSBackend" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DCLANG_INCLUDE_EXAMPLES=OFF -DCLANG_INCLUDE_TESTS=OFF
make -j4

SDL2
wget http://www.libsdl.org/release/SDL2-2.0.4.zip && unzip SDL2-2.0.4.zip && cd SDL2-2.0.4
./configure && make -j6 && make install && cd
Emscriptten works good

Em-dosbox
git clone https://github.com/dreamlayers/em-dosbox.git
cd em-dosbox
./autogen.sh
~/emscripten/emconfigure ./configure
make -j4

Packaging program
python src/packager.py dune2 ~/dune2 dune2.exe

On web-server 5 files
dosbox dosbox.conf dosbox.html dosbox.js dune2.data index.html

https://yadi.sk/d/tG1amH1Qp2fF5

Unhandled Promise Rejection: TypeError: Module['addRunDependency'] is not a function

First-time user here. Trying to get ProComm going, but loading the package results in this error in the JS console:

Unhandled Promise Rejection: TypeError: Module['addRunDependency'] is not a function. (In 'Module['addRunDependency']('fp ' + this.name)', 'Module['addRunDependency']' is undefined) open -- procomm.html:1407

I've installed Emscripten from brew on my Mac, and compilation appears to work without errors. I've tried with both emconfigure ./configure --enable-wasm and emconfigure ./configure, but get the same error message. I'm serving the files with python -m SimpleHTTPServer 8000.

I've tried in current versions of Safari, Chrome, and Firefox.

In Firefox, I also get:

wasm streaming compile failed: TypeError: Response has unsupported MIME type procomm.html:1246:11
printErr
http://localhost:8000/procomm.html:1246:11
doNativeWasm/<
http://localhost:8000/dosbox.js:1:18385
falling back to ArrayBuffer instantiation procomm.html:1246:11
printErr
http://localhost:8000/procomm.html:1246:11
doNativeWasm/<
http://localhost:8000/dosbox.js:1:18431

dosbox.js and dosbox.html not created?

I have installed and configured the script but the files are not created. The only errors/warnings I got were
python version.py ../include/version.h .. g++
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
[--exec-path[=]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=] [--work-tree=] [--namespace=]
[]

and
sdlmain.cpp: In function ‘void GFX_LosingFocus()’:
sdlmain.cpp:2157:15: warning: large integer implicitly truncated to unsigned type [-Woverflow]
sdl.laltstate=SDL_KEYUP;
^
sdlmain.cpp:2158:15: warning: large integer implicitly truncated to unsigned type [-Woverflow]
sdl.raltstate=SDL_KEYUP;
^
sdlmain.cpp: In function ‘int main(int, char**)’:
sdlmain.cpp:2845:16: warning: large integer implicitly truncated to unsigned type [-Woverflow]
sdl.laltstate = SDL_KEYUP;
^
sdlmain.cpp:2846:16: warning: large integer implicitly truncated to unsigned type [-Woverflow]
sdl.raltstate = SDL_KEYUP;

tricky problem with "Blink" - Engine Browser

It is very easy to reproduce the problem, but it does not seem easy to solve it. I tested it under Windows 7 and 8 on i3 and i5 PCs with Chrome, Iron and Opera (portable versions).
The problem is a buzzing after several games were started, or more times a page has been reloaded with a game in browser.

For Example:

  1. Open successively different games. It does not matter if the Tab after opening is closed again. After four or five times, it is buzzing constantly and the sound output is disturbed.
    or
  2. Open a game and reload it again via the browser several times. Also after four to five times the sound is distorted.

If another new tab will be opened, the URL copied in it and the game is started, the sound is accurately. Even if, for example, the same game in a different tab is buzzing.

To temporarily eliminate the problem is the browser cache can be cleared.
Another possibility is strange. First close the tab with the game. Now only "auswahl.htm" is open. Open a completely different website, www.google.com, for example. Now go back to "auswahl.htm". If a game starts now, the sound is again accurately.

em-dosbox: outdated?

Here on Github, it says "forked from Henne/dosbox-svn". But when I visit that, I see the last DOSBox SVN commit they mirrored was from 2012 (specifically r3798)

Current DOSBox SVN is on r3989 (2016-06-24 21:21). Any plans to sync to latest? Or am I misunderstanding the situation?

If you're looking for a current one to sync against, svn2github's is pretty nice: https://github.com/svn2github/dosbox

Problem running packager.py - dosbox.html seems to have changed

I followed the instructions to install emscripten on ubuntu, so pretty sure I have the latest version of that:

$ emcc --version
emcc (Emscripten gcc/clang-like replacement) 1.34.10 ()

When I copied my files into src/ and ran ./packager.py target source_files target.exe it generated target.html but no target.data.

Examining the code, I could see it was looking for src="dosbox.js" which isn't present in my dosbox.html - it appears that it now tries to load dosbox.js asynchronously.

I replaced the last few lines of dosbox.html as follows and re-ran ./packager.py and it worked as expected.

         })();

-        var script = document.createElement('script');
-        script.src = "dosbox.js";
-        document.body.appendChild(script);

 </script>
+<script src="dosbox.js"></script>
   </body>
 </html>

I don't know what the correct approach to fix this is - changing dosbox.html isn't right, unless I've done something wrong when building em-dosbox, so the code in packager.py should probably be altered to call inject_files before the new async loading of dosbox.js.

How are keyboard events sent to dosbox?

I want to create some buttons that can be clicked on, and when these buttons are clicked, I want to send keyboard events to dosbox. I can't find a place to add this logic. I tried adding window.onkeypress. I get events before dosbox is loaded, after it's loaded I don't get any events anymore. Can you point out where I should be looking at?

Thanks

Corrupt visuals with new emscripten

screenshot showing corrupt characters, and the fact the drive wasn't mounted

I upgraded to emscripten 1.35.0 because I wanted to see if that would mean better performance etc.

This lead to corrupt onscreen characters. Is this perhaps an issue with emscripten itself?

Ability to access mounted CD images via XHR

Howdy!

I'm hunting for a way to use ranged HTTP requests via XHR as a means to let em-dosbox access CD images from a local network endpoint without forcing a browser to download the entire image.

I know this touches on several things, including the fact that DOSBox's cdrom logic works with sync file access, and sync XHR on the main thread of a browser is deprecated / unavailable.

Now that SharedArrayBuffer and OffscreenCanvas are close to reality, I suppose some combination of them might support moving em-dosbox over to a web worker and permit using sync XHR there, while not blocking the main browser thread.

Any thoughts on what would need to be done to make something like this work?

Alternatively, would it be possible to rewrite the cdrom logic in DOSBox to permit this type of access?

I'd be happy to take a stab at it, but looking for a bit of guidance first.

PS Thanks for putting together em-dosbox -- I've been playing around with it for the past week and am floored at how well it works.

Archjs, Virtjs

Hi,

I've started the Virtjs project, which aims to provide a modular way to specify how should an opaque core interact with an external webpage (think of it as a generic audio/video/input interface, that can be filled by multiple implementations, called "devices", some of them available straight away). For example, here is the base Screen interface, and here is the WebGL device.

For instance, Archjs is another project of mine that links these interfaces with emscripted libretro emulation cores, so that the emulators are wrote using C/C++, but the communication with the webpage is actually done with raw Javascript (avoiding any extraneous abstraction).

Using this system, there is no really need of a "template" html page: everything can be instancied with only very few lines of code. Bonus, it can also be used to run an emulator with Node (since we only need to provide a different device implementation, compatible with Node APIs).

Would you be interested in using it? I'd happy to exchange with you on this subject.

"FETCH not yet compatible with wasm" build failure with emscripten 1.38.4

Environment:
OS: Ubuntu 16.04 LTS, 32-bit (VM)
Emscripten: freshly built, tag-1.38.4
em-dosbox: git clone as of 2018-06-03
python: 2.7.12
Java: openjdk version "1.8.0_171"

[myPath]/emsdk/emscripten/tag-1.38.4/em++  -O3  -s TOTAL_MEMORY=134217728 -s ALLOW_MEMORY_GROWTH=0 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 -s [email protected] -s FETCH=1  -s WASM=1  -o dosbox.html dosbox.o  cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a  hardware/libhardware.a gui/libgui.a ints/libints.a misc/libmisc.a shell/libshell.a hardware/serialport/libserial.a libs/gui_tk/libgui_tk.a
ERROR:root:FETCH not yet compatible with wasm (shared.make_fetch_worker is asm.js-specific)

This error occurs with or without --enable-wasm (I think the latest Emscripten may default to WASM even without it being specified, though.) and with or without --without-sdl2

configure's understanding of the environment:

configure: auto-detected use of Emscripten
checking build system type... i686-pc-linux-gnu
checking host system type... none-none-none
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... [myPath]/emsdk/emscripten/tag-1.38.4/emcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... .html
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether [myPath]/emsdk/emscripten/tag-1.38.4/emcc accepts -g... yes
checking for [myPath]/emsdk/emscripten/tag-1.38.4/emcc option to accept ISO C89... none needed
checking whether [myPath]/emsdk/emscripten/tag-1.38.4/emcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of [myPath]/emsdk/emscripten/tag-1.38.4/emcc... gcc3
checking how to run the C preprocessor... [myPath]/emsdk/emscripten/tag-1.38.4/emcc -E
checking whether we are using the GNU C++ compiler... yes
checking whether [myPath]/emsdk/emscripten/tag-1.38.4/em++ accepts -g... yes
checking dependency style of [myPath]/emsdk/emscripten/tag-1.38.4/em++... gcc3
checking for ranlib... [myPath]/emsdk/emscripten/tag-1.38.4/emranlib
checking the archiver ([myPath]/emsdk/emscripten/tag-1.38.4/emar) interface... ar
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking size of unsigned char... 1
checking size of unsigned short... 2
checking size of unsigned int... 4
checking size of unsigned long... 4
checking size of unsigned long long... 8
checking size of int *... 4
checking for stdlib.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... yes
checking for netinet/in.h... yes
checking for pwd.h... yes
checking if environ can be included... no
checking if environ can be linked... yes
checking if dirent includes d_type... yes
checking for powf in libm... yes
checking for library containing clock_gettime... none required
checking if compiler allows __attribute__... yes
checking if compiler allows __attribute__((always_inline)) ... yes
checking if compiler allows __attribute__((fastcall)) ... no
checking if compiler allows __builtin_expect... yes
checking for ALSA CFLAGS... 
checking for ALSA LDFLAGS...  -lasound -lm -ldl -lpthread
checking for libasound headers version >= 0.9.0... not present.
checking for snd_ctl_open in -lasound... no
checking whether byte ordering is bigendian... no
checking for target cpu type... unknown
checking whether x86 dynamic cpu core will be enabled... no
checking whether recompiling cpu core will be enabled... no
checking whether fpu emulation will be enabled... yes
checking whether the x86/x64 assembly fpu core will be enabled... no
checking whether to enable unaligned memory access... no
checking SDL_net.h usability... no
checking SDL_net.h presence... no
checking for SDL_net.h... no
checking for SDLNet_Init in -lSDL_net... no
configure: WARNING: Can't find SDL_net, internal modem and ipx disabled
checking SDL_sound.h usability... no
checking SDL_sound.h presence... no
checking for SDL_sound.h... no
checking for Sound_Init in -lSDL_sound... no
checking for Sound_Seek in -lSDL_sound... no
configure: WARNING: Can't find libSDL_sound, libSDL_sound support disabled
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for mprotect... yes
checking for setpriority support... no
checking that generated files are newer than configure... done

make -j4 error while building.. need help compiling

on 14.04 trusty taher
sudo apt-get install emscripten llvm
sudo apt-get install cmake gcc autogen automake autotools git
git clone https://github.com/dreamlayers/em-dosbox.git
cd em-dosbox/
./autogen.sh
emconfigure ./configure
make -j4
when will i make it to sudo make install ????
help needed compiling
or the error explained

mv -f .deps/dos_misc.Tpo .deps/dos_misc.Po
/usr/share/emscripten/em++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -O3 -s USE_SDL=2 -MT drives.o -MD -MP -MF .deps/drives.Tpo -c -o drives.o drives.cpp
mv -f .deps/dos_classes.Tpo .deps/dos_classes.Po
/usr/share/emscripten/em++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -O3 -s USE_SDL=2 -MT drive_virtual.o -MD -MP -MF .deps/drive_virtual.Tpo -c -o drive_virtual.o drive_virtual.cpp
dos_programs.cpp:28:10: fatal error: 'emscripten/fetch.h' file not found
#include <emscripten/fetch.h>
^
mv -f .deps/dos_tables.Tpo .deps/dos_tables.Po
/usr/share/emscripten/em++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -O3 -s USE_SDL=2 -MT drive_local.o -MD -MP -MF .deps/drive_local.Tpo -c -o drive_local.o drive_local.cpp
mv -f .deps/drives.Tpo .deps/drives.Po
/usr/share/emscripten/em++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -O3 -s USE_SDL=2 -MT drive_cache.o -MD -MP -MF .deps/drive_cache.Tpo -c -o drive_cache.o drive_cache.cpp
mv -f .deps/drive_virtual.Tpo .deps/drive_virtual.Po
/usr/share/emscripten/em++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -O3 -s USE_SDL=2 -MT drive_fat.o -MD -MP -MF .deps/drive_fat.Tpo -c -o drive_fat.o drive_fat.cpp
1 error generated.
ERROR root: compiler frontend failed to generate LLVM bitcode, halting
make[4]: *** [dos_programs.o] Error 1
make[4]: *** Waiting for unfinished jobs....
mv -f .deps/drive_local.Tpo .deps/drive_local.Po
mv -f .deps/drive_fat.Tpo .deps/drive_fat.Po
mv -f .deps/drive_cache.Tpo .deps/drive_cache.Po
make[4]: Leaving directory /home/verhoeve/em-dosbox/src/dos' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory /home/verhoeve/em-dosbox/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory /home/verhoeve/em-dosbox/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /home/verhoeve/em-dosbox'
make: *** [all] Error 2
verhoeve@XM44T:~/em-dosbox$

please help on error

Uncaught SimulateInfiniteLoop

This project is very surprising.

When I try to start IE in win95 in Chrome, I don't know it's because win95 or dosbox.js.

_emscripten_set_main_loop @ dosbox.js:1
ji  @ dosbox.js:17
lp  @ dosbox.js:13
ji  @ dosbox.js:17
sRa @ dosbox.js:16
vl  @ dosbox.js:8
M5  @ dosbox.js:5
oi  @ dosbox.js:14
OW  @ dosbox.js:5
ji  @ dosbox.js:17
lp  @ dosbox.js:13
ji  @ dosbox.js:17
sRa @ dosbox.js:16
vl  @ dosbox.js:8
M5  @ dosbox.js:5
oi  @ dosbox.js:14
OW  @ dosbox.js:5
ji  @ dosbox.js:17
lp  @ dosbox.js:13
ji  @ dosbox.js:17
sRa @ dosbox.js:16
vl  @ dosbox.js:8
M5  @ dosbox.js:5
oi  @ dosbox.js:14
OW  @ dosbox.js:5
ji  @ dosbox.js:17
lp  @ dosbox.js:13
ji  @ dosbox.js:17
sRa @ dosbox.js:16
vl  @ dosbox.js:8
M5  @ dosbox.js:5
Z9  @ dosbox.js:5
So  @ dosbox.js:13
kL  @ dosbox.js:6
ji  @ dosbox.js:17
lp  @ dosbox.js:13
ji  @ dosbox.js:17
ji  @ dosbox.js:17
ji  @ dosbox.js:17
ji  @ dosbox.js:17
ji  @ dosbox.js:17
ji  @ dosbox.js:17
ji  @ dosbox.js:17
Im  @ dosbox.js:8
ji  @ dosbox.js:17
ji  @ dosbox.js:17
resume  @ dosbox.js:1
(anonymous function)  @ dosbox.js:1

btw, this is amazing.

Python 3 support?

Not comparable with Python 3 running on Manjaro Linux.

[main@Admim em-dosbox]$ make -j
make all-recursive
make[1]: Entering directory '/home/main/Downloads/em-dosbox'
Making all in src
make[2]: Entering directory '/home/main/Downloads/em-dosbox/src'
python version.py ../include/version.h .. g++
File "version.py", line 56
print "Usage: python", argv[0],
^
SyntaxError: Missing parentheses in call to 'print'
Makefile:735: recipe for target 'version.stamp' failed
make[2]: *** [version.stamp] Error 1
make[2]: Leaving directory '/home/main/Downloads/em-dosbox/src'
Makefile:378: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/main/Downloads/em-dosbox'
Makefile:319: recipe for target 'all' failed
make: *** [all] Error 2
[main@Admim em-dosbox]$ emconfigure ./configure
Traceback (most recent call last):
File "/usr/lib/emscripten/emconfigure", line 21, in
from tools import shared
File "/usr/lib/emscripten/tools/shared.py", line 284, in
COMPILER_ENGINE = listify(COMPILER_ENGINE)
NameError: name 'COMPILER_ENGINE' is not defined
[main@Admim em-dosbox]$

Recipe for target 'dosbox.html' failed

I got Emscripten using emsdk.

I have confirmed that Emscripten works fine via a test that Emscripten has.

The exact error looks likes this:
ERROR:root:'/home/user/emsdk/emsdk/clang/e1.38.12_64bit/binaryen/bin/asm2wasm dosbox.temp.asm.js --total-memory=134217728 --trap-mode=allow -03 --mem-init=dosbox.html.mem --mem-base=1024 -o dosbox.wasm' failed

It is able to output dosbox.js but after the error message appears the file is deleted.

The directory contains dosbox.html.mem, and dosbox.js.orig.js as well.

Edit: I'm using the latest LTS version of Ubuntu (64bit).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.