GithubHelp home page GithubHelp logo

juj / emscripten-scummvm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scummvm/scummvm

133.0 12.0 15.0 129.13 MB

Emscripten fork of the ScummVM engine.

Home Page: http://clb.demon.fi/html5scummvm/

License: GNU General Public License v2.0

C++ 87.70% C 4.62% Objective-C 5.17% Assembly 1.10% Java 0.09% Shell 0.07% Perl 0.24% Python 0.27% Visual Basic 0.04% Makefile 0.34% Batchfile 0.03% Objective-C++ 0.12% GDB 0.01% HTML 0.16% Roff 0.01% Inno Setup 0.01% NSIS 0.03% Component Pascal 0.01% sed 0.01%

emscripten-scummvm's Introduction

Emscripten-ScummVM README
------------------------------------------------------------------------

This is a fork of the upstream ScummVM repository at https://github.com/scummvm/scummvm 
focused on building ScummVM as HTML5.

Build Instructions
------------------

1. Clone emscripten. Check out the branch incoming. The guide assumes emscripten is checked out to ~/emscripten.

2. Clone emscripten-scummvm. Check out the branch emscripten.

3. Download a ScummVM game demo, e.g. one of https://scummvm.org/demos/ and unzip it to the local filesystem.

4. Configure build with the game data.

export PATH=$PATH:~/emscripten
export CXX=~/emscripten/em++
export LDFLAGS="-O2 -s TOTAL_MEMORY=268435456 --preload-file ~/path/to/monkey1-amiga-demo-en/@/monkey/"

Change the path above to point to where you downloaded the game to. Note that the destination path is important and depends on the ScummVM game you are running. The TOTAL_MEMORY statement specifices how much of HEAP space to allocate in the generated emscripten application at startup.

5. Copy /usr/bin/sdl-config to emscripten root directory. (find the location of sdl and sdl-config on your system if it doesn't exist in that place)

6. Edit the sdl-config file you copied, and replace the line

prefix=/usr

with the line

prefix=~/emscripten/system

This will configure the build to use the emscripten version of SDL, and not the one installed to the system.

7. Configure the build by invoking in the emscripten-scummvm root directory:

   emconfigure ./configure --with-sdl-prefix=~/emscripten --disable-all-engines --enable-engine-static=scumm --backend=sdl --disable-bink --disable-mt32emu --disable-16bit --disable-scalers --disable-hq-scalers --disable-alsa --disable-vorbis --disable-tremor --disable-mad --disable-flac --disable-zlib --disable-opengl --disable-png --disable-theoradec --disable-faad --disable-fluidsynth --disable-nasm --disable-readline --disable-libunity --disable-sndio --disable-timidity
   
8. Run the build by invoking in the emscripten-scummvm root directory:

   emmake make

After the build finishes, two files 'scummvm.html' and 'scummvm.data' should have appeared. They are the two required files that need to be hosted by a web server for the game to run.

emscripten-scummvm's People

Contributors

ajax16384 avatar aquadran avatar athrxx avatar bgk avatar bluddy avatar bluegr avatar clone2727 avatar criezy avatar cyxx avatar digitall avatar dreammaster avatar drmccoy avatar enderboi avatar fingolfin avatar fuzzie avatar hkzlab avatar johndoe123 avatar jonathangray avatar joostp avatar jvprat avatar peres avatar sev- avatar somaen avatar strangerke avatar templier avatar tramboi avatar tsoliman avatar waltervn avatar whoozle avatar wjp 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

emscripten-scummvm's Issues

fatal error: SDL.h: No such file or directory

I've been trying to follow the tutorial, and I've been running into a lot of problems.

I think I've done everything correctly in steps 1-7. I resolved some issues by using the full path name instead of ~.

Trying to run emmake make results in the following output:

    C++      backends/platform/sdl/sdl.o
In file included from ./backends/platform/sdl/sdl.h:26:0,
                 from backends/platform/sdl/sdl.cpp:31:
./backends/platform/sdl/sdl-sys.h:55:17: fatal error: SDL.h: No such file or directory
 #include <SDL.h>
                 ^
compilation terminated.
make: *** [backends/platform/sdl/sdl.o] Error 1

I'm not sure how to debug this. I'm on a fresh install of Ubuntu 14.04, and might be missing packages. I think I'm supposed to load the SDL.h that is included in emscripten, but don't know how to point it there. I've edited the copy of sdl-config in the emscripten folder and ran configure with the sdl argument pointing t the emscripten folder as well.

How to play your own games?

It is not possible to play your own games with the current web version. This is a copyright/hosting issue, since we cannot put copyrighted games up on the web servers. Investigate other solutions for this (perhaps user locally adds the game files to the web app, or similar).

Not a big priority at the moment, we are more interested in polishing the experience across browsers and increasing performance to make it smooth for all.

Constant regeneration of the NoScript menu preventing the user from whitelisting audio

Something about how this is implemented makes it impossible to allow audio on Firefox if "Apply these restrictions to whitelisted sites too" is checked in NoScript's Embeddings tab. (It allows me to keep YouTube whitelisted while reliably preventing autoplay)

Specifically, it keeps forcing NoScript to regenerate its menu so quickly that I can't keep the submenu open for more than a split second.

(While I can't read anything in the menu, would it be correct to guess that you're using an <audio> element which receives new data URIs almost constantly? NoScript does regenerate its menu whenever the list of blocked elements or the URIs they reference change.)

If so, my suggestion would be to add a test which detects that the audio element has been blocked and pauses during the interval after the element has been added but before the runtime starts to offer the user the option to select Allow *@domain from the NoScript menu.

Audio does not work in other browsers than Firefox.

Currently emscripten SDL api only implements audio for the Firefox browser, which is why audio doesn't work in other browsers.

After emscripten SDL audio adds support for other browsers, rebuild emscripten-scummvm to add audio support in the games to other browsers as well.

No audio in Internet Explorer 10 (or older).

IE 10 supports neither Mozilla Audio Data API or Web Audio API, and therefore audio does not play back at all when run in IE10.

Possible fixes to this are probably quite exotic in nature. Very low priority at the moment.

Building with Windows . . . Stuck at Step 4

It is probably due to my little knowledge of linux but I can't set the Variables in step 4 on Windows 10.
Are they environment variables, need to be entered into the .emscripten file or entered from the command prompt?
Sometimes I'd get a BINARYEN_ROOT is not defined or my PATH=$PATH:~/emscripten is wrong.
Thanks

Stepping on plank outside Scumm Bar Kitchen

Tried this twice in Chrome on the Mac and once Guybrush steps on the plank he keeps stepping on it in an infinite loop.

(This is the best bug report I've ever had to write by the way, thanks!)

"emmake make" fails

Hey,

when I try to build my own emscripten-scummvm, it fails at "emmake make" with this error message:

C++      base/main.o
base/main.cpp: In function ‘void mainLoop()’:
base/main.cpp:364:46: error: ‘emscripten_async_call’ was not declared in this scope
base/main.cpp: In function ‘int scummvm_main(int, const char* const*)’:
base/main.cpp:373:29: error: ‘directoryExists’ was not declared in this scope
base/main.cpp:374:38: error: ‘directoryExists’ was not declared in this scope
base/main.cpp:375:39: error: ‘directoryExists’ was not declared in this scope
base/main.cpp:376:40: error: ‘directoryExists’ was not declared in this scope
base/main.cpp:377:37: error: ‘directoryExists’ was not declared in this scope
base/main.cpp:378:36: error: ‘directoryExists’ was not declared in this scope
base/main.cpp:379:29: error: ‘directoryExists’ was not declared in this scope
base/main.cpp:380:31: error: ‘directoryExists’ was not declared in this scope
make: *** [base/main.o] Fehler 1

What exactly is wrong and how can I fix it?

Write build instructions.

Once emscripten upstream gets all the necessary code so that it is possible to build scummvm with stock emscripten, write a build instruction page for anyone interested in contributing or hacking with emscripten-scummvm.

Maniac Mansion fails to run.

On a chrome 27.0.1453.110 m, windows 7 system running Maniac Mansion gave

Uncaught Assertion failed: _mixerReady, at: audio/mixer.cpp,238,virtual void Audio::MixerImpl::playStream(Audio::Mixer::SoundType, Audio::SoundHandle *, Audio::AudioStream *, int, byte, int8, DisposeAfterUse::Flag, bool, bool) at Error

Other games seem to run fine.

Firefox Stable 21 occasionally pauses for 5-10 second in the DOTT demo.

Now consistently reproduced, the latest Firefox stable hangs on Windows 7 systems at least momentarily in the start of the DOTT cutscene where purple tentacle drinks the water. Audio also stops.

Waiting for 5-10 seconds resolves the block and the playback and audio continues.

Tested the latest Firefox nightly on the same computer, and it works without pauses, so this might be fixed in Firefox.

Add support for ScummVM image scalers.

The advanced image scalers were disabled since Emscripten SDL support does not have proper 16-bit SDL surface support (but treats all surfaces as 32-bit internally). Add back support to the more advanced scalers for better graphics effects.

This is related to issue #12.

Add support to Curse of Monkey Island.

Comi uses the scumm7-8 engine, which is slightly different to compile than the scumm0-6 engine set.

I have this partially working, video doesn't play back, and audio doesn't work, and some other stuff seems to be broken.

Add support for this.

Clean up changes to upstream emscripten.

Parts of the functionality have been done in a straighest-route-to-victory manner, adding workarounds first to get a clear picture of the amount of hurdles that lie ahead.

Now that the system is actually functional and the set of obstacles known, go back and report all issues and fixes to upstream emscripten, and see proper fixes for the workarounds, if possible.

High memory consumption compared to native.

In mobile Nexus 7 tablet device with Android 4.2.2 and Firefox 21.0:

Starting up, baseline Firefox takes up 100MB of memory.
While playing Monkey 1, Firefox consumes 200MB - 261 MB of memory.
While playing Sam & Max 1, Firefox consumes 271MB - 290 MB of memory.

The same device with the Opera 14.0.1074.56201 browser:
baseline: 108 MB,
Monkey 1: 221 MB (in two different processes)

The same device with the Chrome 27.0.1453.90 browser:
baseline: 72MB
Monkey 1: 189 MB

In native Win32 exe:
baseline: 8 MB,
while playing Monkey 1: 20MB,
Sam & Max 1: 21MB.

In both games, Firefox gives about 8-10x memory consumption compared to native.

Looking for sdl-config... none found!

Anyway, I'm doing my best to try and compile this on a Debian sid chroot, and the main hold up appears to be when I try to compile with emscripten, it cannot find any version of sdl-config, where as attempting to configure as normal gives me no issues whatso ever. Are the build intructions out of date in regards to emscripten changing around where some things are? Or would I have better luck with Retroarch in regards to compiling Scumm around emscripten?

SDL Build errors under Mac OS X 10.9 Mavericks

Trying to compile emscripten-scummvm under Mac OS X 10.9 yields the following errors.

Am I assuming correctly that it requires older SDL headers I might be lacking or is this something entirely different?

I've also tried building this with an older emscripten fork (the one hosted in one of your repositories), hoping this was simply an architectural change in the newer releases of emscripten.

Unfortunately, to no avail.

C++      backends/platform/sdl/sdl.o
In file included from backends/platform/sdl/sdl.cpp:31:
In file included from ./backends/platform/sdl/sdl.h:26:
./backends/platform/sdl/sdl-sys.h:55:10: error: 'SDL.h' file not found with
      <angled> include; use "quotes" instead
#include <SDL.h>
         ^~~~~~~
         "SDL.h"
In file included from backends/platform/sdl/sdl.cpp:31:
In file included from ./backends/platform/sdl/sdl.h:28:
In file included from ./backends/modular-backend.h:26:
In file included from ./backends/base-backend.h:31:
In file included from ./common/events.h:28:
In file included from ./common/rect.h:27:
In file included from ./common/util.h:26:
./common/str.h:83:3: warning: anonymous types declared in an anonymous union are
      an extension [-Wnested-anon-types]
                struct {
                ^
In file included from backends/platform/sdl/sdl.cpp:31:
In file included from ./backends/platform/sdl/sdl.h:29:
./backends/mixer/sdl/sdl-mixer.h:70:2: error: unknown type name 'SDL_AudioSpec'
        SDL_AudioSpec _obtained;
        ^
./backends/mixer/sdl/sdl-mixer.h:78:10: error: unknown type name 'SDL_AudioSpec'
        virtual SDL_AudioSpec getAudioSpec(uint32 rate);
                ^
In file included from backends/platform/sdl/sdl.cpp:31:
In file included from ./backends/platform/sdl/sdl.h:30:
./backends/events/sdl/sdl-events.h:77:2: error: unknown type name 'SDL_Joystick'
        SDL_Joystick *_joystick;
        ^
./backends/events/sdl/sdl-events.h:90:32: error: unknown type name 'SDL_Event'
        virtual void preprocessEvents(SDL_Event *event) {}
                                      ^
./backends/events/sdl/sdl-events.h:95:32: error: unknown type name 'SDL_Event'
        virtual bool dispatchSDLEvent(SDL_Event &ev, Common::Event &event);
                                      ^
./backends/events/sdl/sdl-events.h:106:29: error: unknown type name 'SDL_Event'
        virtual bool handleKeyDown(SDL_Event &ev, Common::Event &event);
                                   ^
./backends/events/sdl/sdl-events.h:107:27: error: unknown type name 'SDL_Event'
        virtual bool handleKeyUp(SDL_Event &ev, Common::Event &event);
                                 ^
./backends/events/sdl/sdl-events.h:108:33: error: unknown type name 'SDL_Event'
        virtual bool handleMouseMotion(SDL_Event &ev, Common::Event &event);
                                       ^
./backends/events/sdl/sdl-events.h:109:37: error: unknown type name 'SDL_Event'
        virtual bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event);
                                           ^
./backends/events/sdl/sdl-events.h:110:35: error: unknown type name 'SDL_Event'
        virtual bool handleMouseButtonUp(SDL_Event &ev, Common::Event &event);
                                         ^
./backends/events/sdl/sdl-events.h:111:35: error: unknown type name 'SDL_Event'
        virtual bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event);
                                         ^
./backends/events/sdl/sdl-events.h:112:33: error: unknown type name 'SDL_Event'
        virtual bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event);
                                       ^
./backends/events/sdl/sdl-events.h:113:35: error: unknown type name 'SDL_Event'
        virtual bool handleJoyAxisMotion(SDL_Event &ev, Common::Event &event);
                                         ^
./backends/events/sdl/sdl-events.h:128:24: error: unknown type name 'SDL_Event'
        virtual bool remapKey(SDL_Event &ev, Common::Event &event);
                              ^
./backends/events/sdl/sdl-events.h:133:21: error: unknown type name 'SDLKey'
        virtual int mapKey(SDLKey key, SDLMod mod, Uint16 unicode);
                           ^
./backends/events/sdl/sdl-events.h:133:33: error: unknown type name 'SDLMod'
        virtual int mapKey(SDLKey key, SDLMod mod, Uint16 unicode);
                                       ^
./backends/events/sdl/sdl-events.h:133:45: error: unknown type name 'Uint16'
        virtual int mapKey(SDLKey key, SDLMod mod, Uint16 unicode);
                                                   ^
./backends/events/sdl/sdl-events.h:138:39: error: unknown type name 'SDLMod'
        virtual void SDLModToOSystemKeyFlags(SDLMod mod, Common::Event &event);
                                             ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [backends/platform/sdl/sdl.o] Error 1

Compiled but scummvm: Stray argument '' when running scummvm.html

Hi there,

I had to hackup the configure script to compiled on Ubuntu 18.04 with Emscripten 1.38.27. It was giving an error about GCC version > 2.7 required as I recall. All said and done I finally got it to generate the scummvm.html .data .js and .wasm files. It seems to be working but all I see is this:

scummvm: Stray argument ''
Usage: scummvm [OPTIONS]... [GAME]

Try 'scummvm --help' for more options.

It clearly seems that scummvm is running without any arguments...problem is where are these defined?

i used the pre-load path in the export and I DO see the files being packaged...Am I missing a scummvm.ini or something else to tell it it's "Zak" or "Maniac"? I put a scummvm.ini in the game folder but that doesn't seem to make a difference.

I've compiled dosbox-x emscripten fork and that required me to have an entry in dosbox.conf to mount the packaged game folder and execute a BAT (or EXE) to start the game.

Any hints to complete this (I really want to get Zak FM-Towns working hehe) is greatly appreciated please and thank you for the fork! :)

EDIT: I removed some checks from the configure script I mentioned above - testing again on new source folder - this is the error:

emconfigure ./configure --disable-all-engines --enable-engine-static=scumm --backend=sdl --disable-bink --disable-mt32emu --disable-16bit --disable-scalers --disable-hq-scalers --disable-alsa --disable-vorbis --disable-tremor --disable-mad --disable-flac --disable-zlib --disable-opengl --disable-png --disable-theoradec --disable-faad --disable-fluidsynth --disable-nasm --disable-readline --disable-libunity --disable-sndio --disable-timidity --with-sdl-prefix=/root/emsdk/emscripten/1.38.27/system
Running ScummVM configure...
Looking for C++ compiler... CXX: /root/emsdk/emscripten/1.38.27/em++
In test compiler for /root/emsdk/emscripten/1.38.27/em++
/root/emsdk/emscripten/1.38.27/em++
Checking for compiler version... shared:ERROR: no input files
note that input files without a known suffix are ignored, make sure your input files end with one of: ('.c', '.C', '.i', '.cpp', '.cxx', '.cc', '.c++', '.CPP', '.CXX', '.CC', '.C++', '.ii', '.m', '.mi', '.mm', '.mii', '/dev/null', '.bc', '.o', '.obj', '.lo', '.dylib', '.so', '.a', '.ll', '.h', '.hxx', '.hpp', '.hh', '.H', '.HXX', '.HPP', '.HH')
shared:ERROR: no input files
note that input files without a known suffix are ignored, make sure your input files end with one of: ('.c', '.C', '.i', '.cpp', '.cxx', '.cc', '.c++', '.CPP', '.CXX', '.CC', '.C++', '.ii', '.m', '.mi', '.mm', '.mii', '/dev/null', '.bc', '.o', '.obj', '.lo', '.dylib', '.so', '.a', '.ll', '.h', '.hxx', '.hpp', '.hh', '.H', '.HXX', '.HPP', '.HH')
shared:ERROR: no input files
note that input files without a known suffix are ignored, make sure your input files end with one of: ('.c', '.C', '.i', '.cpp', '.cxx', '.cc', '.c++', '.CPP', '.CXX', '.CC', '.C++', '.ii', '.m', '.mi', '.mm', '.mii', '/dev/null', '.bc', '.o', '.obj', '.lo', '.dylib', '.so', '.a', '.ll', '.h', '.hxx', '.hpp', '.hh', '.H', '.HXX', '.HPP', '.HH')
./configure: 1649: test: Illegal number:
./configure: 1650: test: Illegal number:
1.38.27, bad

The version of your compiler is not supported at this time
Please ensure you are using GCC >= 2.95
shared:ERROR: Configure step failed with non-zero return code: 1.  Command line: ./configure --disable-all-engines --enable-engine-static=scumm --backend=sdl --disable-bink --disable-mt32emu --disable-16bit --disable-scalers --disable-hq-scalers --disable-alsa --disable-vorbis --disable-tremor --disable-mad --disable-flac --disable-zlib --disable-opengl --disable-png --disable-theoradec --disable-faad --disable-fluidsynth --disable-nasm --disable-readline --disable-libunity --disable-sndio --disable-timidity --with-sdl-prefix=/root/emsdk/emscripten/1.38.27/system at /root/test/emscripten-scummvm

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.