Browse Source

emscripten build

master
Mister Hat 2 months ago
parent
commit
092b3669d9
7 changed files with 29 additions and 35 deletions
  1. +12
    -0
      build-emscripten.sh
  2. +2
    -1
      build-mingw.sh
  3. +13
    -0
      build-mingw32.sh
  4. +1
    -1
      build.sh
  5. +0
    -0
      emscripten-sdl.diff
  6. +1
    -33
      mudclient204-headless/mudclient.java
  7. BIN
      tinygc-tinygc-2_6/tinygcmt.o

+ 12
- 0
build-emscripten.sh View File

@ -0,0 +1,12 @@
java -jar ./JCGO/jcgo.jar mudclient -src ./mudclient204-threadless \
@JCGO/stdpaths.in
patch -p0 -i sdl.diff
emcc -O2 -I ./JCGO/include -I ./JCGO/native -I \
-fno-strict-aliasing \
-DJCGO_NOGC -DJCGO_FPFAST -DJCGO_FASTMATH -DJCGO_INET \
-DJCGO_INTFIT -DJCGO_UNIX -D_FPU_CONTROL_H -D_IEEEFP_H -DJCGO_UNIFSYS \
-o mudclient.html jcgo_Out/Main.c -lm -lSDL2 \
-s ALLOW_MEMORY_GROWTH=1 -s USE_SDL=2 -s ASYNCIFY \
--preload-file ./data204

+ 2
- 1
build-mingw.sh View File

@ -6,7 +6,8 @@ patch -p0 -i sdl.diff
x86_64-w64-mingw32-gcc -O2 -I ./JCGO/include -I ./JCGO/native \
-I ./JCGO/include/tinygc -I ./SDL2-2.0.14/x86_64-w64-mingw32/include \
-fno-strict-aliasing \
-DGC_THREADS -DJCGO_USEGCJ -DJCGO_FPFAST -DJCGO_FASTMATH -DJCGO_INET \
-DGC_THREADS -DGC_GCJ_SUPPORT -DJCGO_USEGCJ -DJCGO_PARALLEL -DJCGO_FPFAST \
-DJCGO_FASTMATH -DJCGO_INET \
-DJCGO_INTFIT -DJCGO_THREADS -D_IEEEFP_H -DJCGO_WIN32 \
-o mudclient.exe jcgo_Out/Main.c -lm \
-L ./SDL2-2.0.14/x86_64-w64-mingw32/lib -lSDL2 -lwsock32 \


+ 13
- 0
build-mingw32.sh View File

@ -0,0 +1,13 @@
#java -jar ./JCGO/jcgo.jar mudclient -src ./mudclient204-headless \
# @JCGO/stdpaths.in
#patch -p0 -i sdl.diff
#x86_64-w64-mingw32-gcc -g -I ./JCGO/include -I ./JCGO/native \
i686-w64-mingw32-gcc -g -I ./JCGO/include -I ./JCGO/native \
-I ./JCGO/include/boehmgc -I ./SDL2-2.0.14/i686-w64-mingw32/include \
-DJCGO_NOGC -DJCGO_USEGCJ -DJCGO_FPFAST -DJCGO_FASTMATH -DJCGO_INET \
-DJCGO_INTFIT -DJCGO_THREADS -D_IEEEFP_H -DJCGO_WIN32 \
-o mudclient.exe jcgo_Out/Main.c -lm \
-L ./SDL2-2.0.14/i686-w64-mingw32/lib -lSDL2 -lwsock32 \
./JCGO/libs/x86/mingw/libgcmt.a -no-pie

+ 1
- 1
build.sh View File

@ -7,7 +7,7 @@ patch -p0 -i sdl.diff
#-DJCGO_NOGJ
gcc -O2 -I ./JCGO/include -I ./JCGO/native -I ./JCGO/include/boehmgc \
-fno-strict-aliasing \
-DJCGO_USEGCJ -DJCGO_FPFAST -DJCGO_FASTMATH -DJCGO_INET \
-DJCGO_USEGCJ -DJGCO_PARALLEL -DJCGO_FPFAST -DJCGO_FASTMATH -DJCGO_INET \
-DJCGO_INTFIT -DJCGO_THREADS -DJCGO_UNIX -D_IEEEFP_H -DJCGO_UNIFSYS \
-o mudclient jcgo_Out/Main.c -lm -lpthread -lSDL2 \
./JCGO/libs/amd64/linux/libgcmt.a -no-pie

+ 0
- 0
emscripten-sdl.diff View File


+ 1
- 33
mudclient204-headless/mudclient.java View File

@ -3887,14 +3887,6 @@ public class mudclient extends GameConnection {
}
protected void startGame() {
/*
if (appletMode) {
String s = getDocumentBase().getHost().toLowerCase();
if (!s.endsWith("jagex.com") && !s.endsWith("jagex.co.uk") && !s.endsWith("runescape.com") && !s.endsWith("runescape.co.uk") && !s.endsWith("runescape.net") && !s.endsWith("runescape.org") && !s.endsWith("penguin") && !s.endsWith("puffin")) {
errorLoadingCodebase = true;
return;
}
}*/
int total_exp = 0;
for (int level = 0; level < 99; level++) {
int level_1 = level + 1;
@ -3903,35 +3895,11 @@ public class mudclient extends GameConnection {
experienceArray[level] = total_exp & 0xffffffc;
}
/*
try {
String s1 = getParameter("referid");
referid = Integer.parseInt(s1);
} catch (Exception Ex) {
}
try {
String s2 = getParameter("member");
int j1 = Integer.parseInt(s2);
if (j1 == 1)
members = true;
} catch (Exception Ex) {
}
*/
if (appletMode)
super.port = 43594;
maxReadTries = 1000;
clientVersion = Version.CLIENT;
/*
try {
String s3 = getParameter("poff");
int k1 = Integer.parseInt(s3);
super.port += k1;
System.out.println("Offset: " + k1);
} catch (Exception Ex) {
}
*/
loadGameConfig();
if (errorLoadingData)
return;


BIN
tinygc-tinygc-2_6/tinygcmt.o View File


Loading…
Cancel
Save