GithubHelp home page GithubHelp logo

yksoft1 / dosbox-x-vanilla-sdl Goto Github PK

View Code? Open in Web Editor NEW
31.0 2.0 4.0 5.66 MB

A test fork of joncampbell123's DosBox-X that should be able to build with vanilla SDL1 and SDL2.

License: GNU General Public License v2.0

Makefile 0.19% M4 0.27% Shell 0.01% C++ 80.19% C 18.76% Objective-C 0.51% Objective-C++ 0.03% MAXScript 0.05%

dosbox-x-vanilla-sdl's Introduction

dosbox-x-vanilla-sdl

A test fork of joncampbell123's DosBox-X (https://github.com/joncampbell123/dosbox-x/) that should be able to build with vanilla SDL1 and SDL2.

Why this?

I always build DosBox-X from source code and use either MinGW+MSYS or mingw-w64 environment. Some of other programs rely on features removed from DosBox-X's in-tree SDL to work best in some older PCs, and I'm bored to build the in-tree SDL everytime I build DosBox-X. I'll try to cherry-pick most PC-98 related features from joncampbell123's as I mainly use DosBox-X as a PC-98 emulator.

dosbox-x-vanilla-sdl's People

Contributors

yksoft1 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

Watchers

 avatar  avatar

dosbox-x-vanilla-sdl's Issues

compile error

opensuse 15 , fairly new emscripten i get a ./core_dynrec/../../fpu/fpu_instructions_x86.h:972:2: error: invalid output constraint '=&am' in asm
FPUD_LOAD(fld,DWORD,s)

i read online somewhere emscripten cannot handle inline assembly ?

also had to add #include <endian.h> to the mem.h file

Find more calls that should be Emterpretified.

Currently, if we build Emscripten target with Emterpretify, DOS shell in DOSBox-X runs but there are still random errors of hitting emscripten_sleep_with_yield from non-Emterpretified routines and other desync-related problems when working in DOS shell.
There must be some more calls that should be Emterpretified, but sadly when the program crashes at such offending code, their names didn't show in the Javascript call stack even with --profiling-funcs on.

Internal compiler error under GCC 4.5

Under this environment:

$ gcc -v
Using built-in specs.
COLLECT_GCC=e:\mingw10\bin\gcc.exe
COLLECT_LTO_WRAPPER=e:/mingw10/bin/../libexec/gcc/mingw32/4.5.0/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.5.0/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.5.0 (GCC)

It ICEs in bios_disk.cpp.

bios_disk.cpp: In constructor 'imageDiskNFD::imageDiskNFD(FILE*, Bit8u*, Bit32u, bool, unsigned int)':
bios_disk.cpp:2016:41: internal compiler error: in make_decl_rtl, at varasm.c:1317
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.
make[3]: *** [bios_disk.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory /f/dosbox-x-vanilla-sdl/src/ints' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory /f/dosbox-x-vanilla-sdl/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/f/dosbox-x-vanilla-sdl'
make: *** [all] Error 2

svga_s3 and other modes not working

I tried to change the machine type (svga_s3 and other). apparently only pc98* works.

When I try to use the svga_s3 mode (Browser Console output):

LOG: Early LOG Init complete
LOG: Logging init: beginning logging proper. This is the end of the early init logging
LOG: Logging: No logfile was given. All further logging will be discarded.
LOG: DOSBox-X version 0.82.7
LOG: Host keyboard layout is now us (US English)
LOG: Mapper keyboard layout is now us (US English)
LOG: SDL:Current window pixel format: SDL_PIXELFORMAT_RGB888
LOG: SDL: You are running in 24 bpp mode, this will slow down things!
LOG: USING AVI+ZMBV
LOG: Pentium CMPXCHG8B emulation is enabled
LOG: VOODOO LFB now at d0000000
LOG: ISA Plug & Play BIOS enabled
2 LOG: VGA ROM BIOS init callback
2 LOG: 12 ERROR BIOS:Keyboard layout file auto not found
LOG: XMS: 50 handles allocated for use by the DOS environment
LOG: EMS page frame at 0xe000-0xefff
LOG: COMMAND.COM env size: 720 bytes
LOG: COMMAND.COM environment block: 0x01e9 sz=0x002d
LOG: COMMAND.COM main body (PSP): 0x0217 sz=0x009a
LOG: COMMAND.COM stack: 0x0231
LOG: pixratio 1.350, dw false, dh false
2 Assertion failed: undefined

EDIT:
Hello, it's me again, I have now used your first build commands, but when I run dosbox-x I get the following in the Browser Console:

wasm streaming compile failed: LinkError: import object field '___cxa_call_unexpected' is not a Function
falling back to ArrayBuffer instantiation
failed to asynchronously prepare wasm: LinkError: import object field '___cxa_call_unexpected' is not a Function
LinkError: "import object field '___cxa_call_unexpected' is not a Function"
LinkError: "import object field '___cxa_call_unexpected' is not a Function"

EDIT:
Okay I fixed this error by setting emscripten sdk, clang etc. to incoming.
Now the problem is this:

Uncaught SimulateInfiniteLoop

SDL2 Problems under Emscripten 1.38.30+

The Emscripten branch had problems with SDL2 from Emscripten 1.38.30 or later.
SDL2 surface will not be shown if you switch to fullscreen or resize browser window.

I believe this breaking change on Emscripten side was for multiple canvas support.
Don't know if em-dosbox or other users of Emscripten SDL2 had the same problem.

Various compile issues and SDL errors with SDL1/SDL2

Hi @yksoft1 - I posted some info here on this joncampbell123/dosbox-x#882 - but wanted to post on your fork as I'm testing both with no success. My goal is to have an emscripten dosbox build with mt32 support.

FWIW - I'm able to build em-dosbox just fine. However - it does not have the MT-32 support that I'm looking for ;) I'd love to be able to use my Boxer installs 1:1 with either MT-32, GUS, or Adlib setup. Right now em-dosbox only provides GUS and Adlib (also some sounds are kinda strange .... shall we say "off-sounding". Not huge deal, but it would be cool if dosbox-x didn't experience that issue.

➜  dosbox-x-vanilla-sdl git:(emscripten) ✗ cat build-emscripten-sdl2
#!/bin/bash

# make sure you use ". ./emsdk_set_env.sh"

# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1

echo Compiling DOSBox-X
chmod +x configure

# for sdl2-config and sdl-config
export PATH=/root/emsdk/emscripten/1.38.27/system/bin:$PATH

# build command borrowed from Yksoft1 vanilla DOSBox-X port with modifications
CC="emcc" CXX="em++" LD="emcc" LD_CXX="em++" CFLAGS="-DEMTERPRETER_SYNC" CXXFLAGS="-DEMSCRIPTEN=1 -DEMTERPRETER_SYNC" ./configure --host=x86_64-linux --disable-dynamic-x86 --enable-sdl2 --with-sdl-prefix=/root/emsdk/emscripten/1.38.27/system --disable-opengl --enable-force-menu-sdldraw "$@"
make -j3 || exit 1
#emcc -O1 -s USE_SDL=2 -s TOTAL_MEMORY=104857600 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 -s [email protected] dosbox-x.bc --memory-init-file 0 -o th5e.html --preload-file d:/tmpp/th5x@/

^^ I've tried with --disable-mt32 and without (ideally this is mandatory for me else I'm wasting my time..)

I have tried with the default sdl2-config file, and I've also had success (I think it was the scummvm-emscripten github that suggested copying your system sdl2-config and modifying the path):

➜  dosbox-x-vanilla-sdl git:(emscripten) ✗ cat /root/emsdk/emscripten/1.38.27/system/bin/sdl2-config
#!/bin/sh

prefix=/root/emsdk/emscripten/1.38.27/system
exec_prefix=${prefix}
exec_prefix_set=no
libdir=${prefix}/lib/x86_64-linux-gnu

#usage="\
#Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
usage="\
Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"

if test $# -eq 0; then
      echo "${usage}" 1>&2
      exit 1
fi

while test $# -gt 0; do
  case "$1" in
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  case $1 in
    --prefix=*)
      prefix=$optarg
      if test $exec_prefix_set = no ; then
        exec_prefix=$optarg
      fi
      ;;
    --prefix)
      echo $prefix
      ;;
    --exec-prefix=*)
      exec_prefix=$optarg
      exec_prefix_set=yes
      ;;
    --exec-prefix)
      echo $exec_prefix
      ;;
    --version)
      echo 2.0.4
      ;;
    --cflags)
      echo -I${prefix}/include/SDL2   -D_REENTRANT
      ;;
    --libs)
      echo -L${prefix}/lib/x86_64-linux-gnu  -lSDL2
      ;;
    --static-libs)
#    --libs|--static-libs)
      echo -L${prefix}/lib/x86_64-linux-gnu  -lSDL2   -Wl,--no-undefined -lm -ldl  -lasound -lm -ldl -lpthread -lpulse-simple -lpulse -lsndio  -lX11 -lXext -lXcursor -lXinerama -lXi -lXrandr -lXss -lXxf86vm -lwayland-egl -lwayland-client -lwayland-cursor -lxkbcommon -lpthread -lrt
      ;;
    *)
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done

Paths that I can find that have SDL stuff...

/root/.emscripten_ports/sdl2/SDL2-version_17/include/SDL.h
/root/SDL-emscripten/include/SDL.h
/root/emscripten/system/include/SDL/SDL.h
/root/emsdk/emscripten/1.38.27/system/include/SDL/SDL.h
/usr/share/emscripten/system/include/SDL/SDL.h

emsdk environment variables:

➜  emsdk git:(master) ✗ cat emsdk_set_env.sh
export PATH="/root/emsdk:/root/emsdk/clang/e1.38.27_64bit:/root/emsdk/node/8.9.1_64bit/bin:/root/emsdk/emscripten/1.38.27:/usr/include/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/src/linux-headers-4.15.0-45/"
export EMSDK="/root/emsdk"
export LLVM_ROOT="/root/emsdk/clang/e1.38.27_64bit"
export EMSCRIPTEN_NATIVE_OPTIMIZER="/root/emsdk/clang/e1.38.27_64bit/optimizer"
export BINARYEN_ROOT="/root/emsdk/clang/e1.38.27_64bit/binaryen"
export EMSDK_NODE="/root/emsdk/node/8.9.1_64bit/bin/node"
export EMSCRIPTEN="/root/emsdk/emscripten/1.38.27"

OS:
Linux 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I've installed using emsdk following the instructions on the emscripten website.

./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh

I've been trying for weeks at this point...any help is super-duper appreciated 😅

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.