Skip to content

Instantly share code, notes, and snippets.

@Sgeo
Created September 5, 2018 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sgeo/6ba0f642fda09fc8627223f8461af6d1 to your computer and use it in GitHub Desktop.
Save Sgeo/6ba0f642fda09fc8627223f8461af6d1 to your computer and use it in GitHub Desktop.
Index: configure.proto
===================================================================
--- configure.proto (revision 35456)
+++ configure.proto (working copy)
@@ -2847,89 +2847,6 @@
fi
dnl check for opengl libs.
- AC_MSG_CHECKING(whether we can use the GL library)
-
- old_LIBS="$LIBS"
- LIBS="$LIBS -lGL"
- if test x"$use_sdl2_prefix" = "xyes"; then
- AC_DEFINE(HAVE_HWSCALE,,[Enable arbitrary window scaling])
- HAVE_HWSCALE_SUPPORT="yes"
- LIBS="$old_LIBS"
- else
- if test x"$use_sdl_prefix" = "xyes"; then
- AC_TRY_LINK([#include <SDL/SDL_opengl.h>],
- [glViewport(1,2,3,4)],
- [AC_MSG_RESULT(yes);
- have_opengl_lib=yes],
- [AC_MSG_RESULT(no);
- LIBS="$old_LIBS"])
- else
- AC_TRY_LINK([#include <SDL_opengl.h>],
- [glViewport(1,2,3,4)],
- [AC_MSG_RESULT(yes);
- have_opengl_lib=yes],
- [AC_MSG_RESULT(no);
- LIBS="$old_LIBS"])
- fi
- fi
-
- if test x"$have_opengl_lib" != "xyes"; then
- AC_MSG_CHECKING(whether we can use the opengl32 library)
- old_LIBS="$LIBS"
- LIBS="$LIBS -lopengl32"
- if test x"$use_sdl2_prefix" = "xyes"; then
- AC_TRY_LINK([#include <SDL2/SDL_opengl.h>],
- [glViewport(1,2,3,4)],
- [AC_MSG_RESULT(yes);
- have_opengl_lib=yes],
- [AC_MSG_RESULT(no);
- LIBS="$old_LIBS"])
- else
- if test x"$use_sdl_prefix" = "xyes"; then
- AC_TRY_LINK([#include <SDL/SDL_opengl.h>],
- [glViewport(1,2,3,4)],
- [AC_MSG_RESULT(yes);
- have_opengl_lib=yes],
- [AC_MSG_RESULT(no);
- LIBS="$old_LIBS"])
- else
- AC_TRY_LINK([#include <SDL_opengl.h>],
- [glViewport(1,2,3,4)],
- [AC_MSG_RESULT(yes);
- have_opengl_lib=yes],
- [AC_MSG_RESULT(no);
- LIBS="$old_LIBS"])
- fi
- fi
- fi
-
- if test x"$have_opengl_lib" != "xyes" -a x"enable_sdlui2" != "xyes" -a x"$is_unix_macosx" = "xyes"; then
- AC_MSG_CHECKING(whether we can use the OpenGL Framework)
- old_LIBS="$LIBS"
- LIBS="$LIBS -framework OpenGL"
-
- if test x"$use_sdl_prefix" = "xyes"; then
- AC_TRY_LINK([#include <SDL/SDL_opengl.h>],
- [glViewport(1,2,3,4)],
- [AC_MSG_RESULT(yes);
- have_opengl_lib=yes],
- [AC_MSG_RESULT(no);
- LIBS="$old_LIBS"])
- else
- AC_TRY_LINK([#include <SDL_opengl.h>],
- [glViewport(1,2,3,4)],
- [AC_MSG_RESULT(yes);
- have_opengl_lib=yes],
- [AC_MSG_RESULT(no);
- LIBS="$old_LIBS"])
- fi
- fi
-
- if test x"$have_opengl_lib" = "xyes"; then
- AC_DEFINE(HAVE_HWSCALE,,[Enable arbitrary window scaling])
- HAVE_HWSCALE_SUPPORT="yes"
- fi
-
dnl check for the SDL_main.h header
if test x"$use_sdl2_prefix" = "xyes"; then
AC_CHECK_HEADERS(SDL2/SDL_main.h)
Index: src/arch/sdl/Makefile.am
===================================================================
--- src/arch/sdl/Makefile.am (revision 35456)
+++ src/arch/sdl/Makefile.am (working copy)
@@ -46,7 +46,6 @@
archdep.c \
archdep.h \
blockdev.c \
- console.c \
console_unix.c \
coproc.c \
coproc.h \
Index: src/arch/sdl/emscripten/coroutine.h
===================================================================
--- src/arch/sdl/emscripten/coroutine.h (nonexistent)
+++ src/arch/sdl/emscripten/coroutine.h (working copy)
@@ -0,0 +1,181 @@
+/* coroutine.h
+ *
+ * Coroutine mechanics, implemented on top of standard ANSI C. See
+ * http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html for
+ * a full discussion of the theory behind this.
+ *
+ * To use these macros to define a coroutine, you need to write a
+ * function that looks something like this.
+ *
+ * [Simple version using static variables (scr macros)]
+ * int ascending (void) {
+ * static int i;
+ *
+ * scrBegin;
+ * for (i=0; i<10; i++) {
+ * scrReturn(i);
+ * }
+ * scrFinish(-1);
+ * }
+ *
+ * [Re-entrant version using an explicit context structure (ccr macros)]
+ * int ascending (ccrContParam) {
+ * ccrBeginContext;
+ * int i;
+ * ccrEndContext(foo);
+ *
+ * ccrBegin(foo);
+ * for (foo->i=0; foo->i<10; foo->i++) {
+ * ccrReturn(foo->i);
+ * }
+ * ccrFinish(-1);
+ * }
+ *
+ * In the static version, you need only surround the function body
+ * with `scrBegin' and `scrFinish', and then you can do `scrReturn'
+ * within the function and on the next call control will resume
+ * just after the scrReturn statement. Any local variables you need
+ * to be persistent across an `scrReturn' must be declared static.
+ *
+ * In the re-entrant version, you need to declare your persistent
+ * variables between `ccrBeginContext' and `ccrEndContext'. These
+ * will be members of a structure whose name you specify in the
+ * parameter to `ccrEndContext'.
+ *
+ * The re-entrant macros will malloc() the state structure on first
+ * call, and free() it when `ccrFinish' is reached. If you want to
+ * abort in the middle, you can use `ccrStop' to free the state
+ * structure immediately (equivalent to an explicit return() in a
+ * caller-type routine).
+ *
+ * A coroutine returning void type may call `ccrReturnV',
+ * `ccrFinishV' and `ccrStopV', or `scrReturnV', to avoid having to
+ * specify an empty parameter to the ordinary return macros.
+ *
+ * Ground rules:
+ * - never put `ccrReturn' or `scrReturn' within an explicit `switch'.
+ * - never put two `ccrReturn' or `scrReturn' statements on the same
+ * source line.
+ *
+ * The caller of a static coroutine calls it just as if it were an
+ * ordinary function:
+ *
+ * void main(void) {
+ * int i;
+ * do {
+ * i = ascending();
+ * printf("got number %d\n", i);
+ * } while (i != -1);
+ * }
+ *
+ * The caller of a re-entrant coroutine must provide a context
+ * variable:
+ *
+ * void main(void) {
+ * ccrContext z = 0;
+ * do {
+ * printf("got number %d\n", ascending (&z));
+ * } while (z);
+ * }
+ *
+ * Note that the context variable is set back to zero when the
+ * coroutine terminates (by crStop, or by control reaching
+ * crFinish). This can make the re-entrant coroutines more useful
+ * than the static ones, because you can tell when they have
+ * finished.
+ *
+ * If you need to dispose of a crContext when it is non-zero (that
+ * is, if you want to stop calling a coroutine without suffering a
+ * memory leak), the caller should call `ccrAbort(ctx)' where `ctx'
+ * is the context variable.
+ *
+ * This mechanism could have been better implemented using GNU C
+ * and its ability to store pointers to labels, but sadly this is
+ * not part of the ANSI C standard and so the mechanism is done by
+ * case statements instead. That's why you can't put a crReturn()
+ * inside a switch() statement.
+ */
+
+/*
+ * coroutine.h is copyright 1995,2000 Simon Tatham.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * $Id$
+ */
+
+#ifndef COROUTINE_H
+#define COROUTINE_H
+
+#include <stdlib.h>
+
+/*
+ * `scr' macros for static coroutines.
+ */
+
+#define scrBegin static int scrLine = 0; switch(scrLine) { case 0:;
+#define scrFinish(z) } return (z)
+#define scrFinishV } return
+
+#define scrReturn(z) \
+ do {\
+ scrLine=__LINE__;\
+ return (z); case __LINE__:;\
+ } while (0)
+#define scrReturnV \
+ do {\
+ scrLine=__LINE__;\
+ return; case __LINE__:;\
+ } while (0)
+
+/*
+ * `ccr' macros for re-entrant coroutines.
+ */
+
+#define ccrContParam void **ccrParam
+
+#define ccrBeginContext struct ccrContextTag { int ccrLine
+#define ccrEndContext(x) } *x = (struct ccrContextTag *)*ccrParam
+
+#define ccrBegin(x) if(!x) {x= *ccrParam=malloc(sizeof(*x)); x->ccrLine=0;}\
+ if (x) switch(x->ccrLine) { case 0:;
+#define ccrFinish(z) } free(*ccrParam); *ccrParam=0; return (z)
+#define ccrFinishV } free(*ccrParam); *ccrParam=0; return
+
+#define ccrReturn(z) \
+ do {\
+ ((struct ccrContextTag *)*ccrParam)->ccrLine=__LINE__;\
+ return (z); case __LINE__:;\
+ } while (0)
+#define ccrReturnV \
+ do {\
+ ((struct ccrContextTag *)*ccrParam)->ccrLine=__LINE__;\
+ return; case __LINE__:;\
+ } while (0)
+
+#define ccrStop(z) do{ free(*ccrParam); *ccrParam=0; return (z); }while(0)
+#define ccrStopV do{ free(*ccrParam); *ccrParam=0; return; }while(0)
+
+#define ccrContext void *
+#define ccrAbort(ctx) do { free (ctx); ctx = 0; } while (0)
+
+#endif /* COROUTINE_H */
Index: src/arch/sdl/emscripten/coroutine.h
===================================================================
--- src/arch/sdl/emscripten/coroutine.h (nonexistent)
+++ src/arch/sdl/emscripten/coroutine.h (working copy)
@@ -0,0 +1,181 @@
+/* coroutine.h
+ *
+ * Coroutine mechanics, implemented on top of standard ANSI C. See
+ * http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html for
+ * a full discussion of the theory behind this.
+ *
+ * To use these macros to define a coroutine, you need to write a
+ * function that looks something like this.
+ *
+ * [Simple version using static variables (scr macros)]
+ * int ascending (void) {
+ * static int i;
+ *
+ * scrBegin;
+ * for (i=0; i<10; i++) {
+ * scrReturn(i);
+ * }
+ * scrFinish(-1);
+ * }
+ *
+ * [Re-entrant version using an explicit context structure (ccr macros)]
+ * int ascending (ccrContParam) {
+ * ccrBeginContext;
+ * int i;
+ * ccrEndContext(foo);
+ *
+ * ccrBegin(foo);
+ * for (foo->i=0; foo->i<10; foo->i++) {
+ * ccrReturn(foo->i);
+ * }
+ * ccrFinish(-1);
+ * }
+ *
+ * In the static version, you need only surround the function body
+ * with `scrBegin' and `scrFinish', and then you can do `scrReturn'
+ * within the function and on the next call control will resume
+ * just after the scrReturn statement. Any local variables you need
+ * to be persistent across an `scrReturn' must be declared static.
+ *
+ * In the re-entrant version, you need to declare your persistent
+ * variables between `ccrBeginContext' and `ccrEndContext'. These
+ * will be members of a structure whose name you specify in the
+ * parameter to `ccrEndContext'.
+ *
+ * The re-entrant macros will malloc() the state structure on first
+ * call, and free() it when `ccrFinish' is reached. If you want to
+ * abort in the middle, you can use `ccrStop' to free the state
+ * structure immediately (equivalent to an explicit return() in a
+ * caller-type routine).
+ *
+ * A coroutine returning void type may call `ccrReturnV',
+ * `ccrFinishV' and `ccrStopV', or `scrReturnV', to avoid having to
+ * specify an empty parameter to the ordinary return macros.
+ *
+ * Ground rules:
+ * - never put `ccrReturn' or `scrReturn' within an explicit `switch'.
+ * - never put two `ccrReturn' or `scrReturn' statements on the same
+ * source line.
+ *
+ * The caller of a static coroutine calls it just as if it were an
+ * ordinary function:
+ *
+ * void main(void) {
+ * int i;
+ * do {
+ * i = ascending();
+ * printf("got number %d\n", i);
+ * } while (i != -1);
+ * }
+ *
+ * The caller of a re-entrant coroutine must provide a context
+ * variable:
+ *
+ * void main(void) {
+ * ccrContext z = 0;
+ * do {
+ * printf("got number %d\n", ascending (&z));
+ * } while (z);
+ * }
+ *
+ * Note that the context variable is set back to zero when the
+ * coroutine terminates (by crStop, or by control reaching
+ * crFinish). This can make the re-entrant coroutines more useful
+ * than the static ones, because you can tell when they have
+ * finished.
+ *
+ * If you need to dispose of a crContext when it is non-zero (that
+ * is, if you want to stop calling a coroutine without suffering a
+ * memory leak), the caller should call `ccrAbort(ctx)' where `ctx'
+ * is the context variable.
+ *
+ * This mechanism could have been better implemented using GNU C
+ * and its ability to store pointers to labels, but sadly this is
+ * not part of the ANSI C standard and so the mechanism is done by
+ * case statements instead. That's why you can't put a crReturn()
+ * inside a switch() statement.
+ */
+
+/*
+ * coroutine.h is copyright 1995,2000 Simon Tatham.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * $Id$
+ */
+
+#ifndef COROUTINE_H
+#define COROUTINE_H
+
+#include <stdlib.h>
+
+/*
+ * `scr' macros for static coroutines.
+ */
+
+#define scrBegin static int scrLine = 0; switch(scrLine) { case 0:;
+#define scrFinish(z) } return (z)
+#define scrFinishV } return
+
+#define scrReturn(z) \
+ do {\
+ scrLine=__LINE__;\
+ return (z); case __LINE__:;\
+ } while (0)
+#define scrReturnV \
+ do {\
+ scrLine=__LINE__;\
+ return; case __LINE__:;\
+ } while (0)
+
+/*
+ * `ccr' macros for re-entrant coroutines.
+ */
+
+#define ccrContParam void **ccrParam
+
+#define ccrBeginContext struct ccrContextTag { int ccrLine
+#define ccrEndContext(x) } *x = (struct ccrContextTag *)*ccrParam
+
+#define ccrBegin(x) if(!x) {x= *ccrParam=malloc(sizeof(*x)); x->ccrLine=0;}\
+ if (x) switch(x->ccrLine) { case 0:;
+#define ccrFinish(z) } free(*ccrParam); *ccrParam=0; return (z)
+#define ccrFinishV } free(*ccrParam); *ccrParam=0; return
+
+#define ccrReturn(z) \
+ do {\
+ ((struct ccrContextTag *)*ccrParam)->ccrLine=__LINE__;\
+ return (z); case __LINE__:;\
+ } while (0)
+#define ccrReturnV \
+ do {\
+ ((struct ccrContextTag *)*ccrParam)->ccrLine=__LINE__;\
+ return; case __LINE__:;\
+ } while (0)
+
+#define ccrStop(z) do{ free(*ccrParam); *ccrParam=0; return (z); }while(0)
+#define ccrStopV do{ free(*ccrParam); *ccrParam=0; return; }while(0)
+
+#define ccrContext void *
+#define ccrAbort(ctx) do { free (ctx); ctx = 0; } while (0)
+
+#endif /* COROUTINE_H */
Index: src/arch/sdl/menu_help.c
===================================================================
--- src/arch/sdl/menu_help.c (revision 35456)
+++ src/arch/sdl/menu_help.c (working copy)
@@ -46,6 +46,8 @@
#include "svnversion.h"
#endif
+
+
#ifdef WINMIPS
static char *concat_all(char **text)
{
Index: src/arch/sdl/video.c
===================================================================
--- src/arch/sdl/video.c (revision 35456)
+++ src/arch/sdl/video.c (working copy)
@@ -790,7 +790,7 @@
if (canvas == sdl_active_canvas) {
#ifndef ANDROID_COMPILE
- SDL_EventState(SDL_VIDEORESIZE, SDL_IGNORE);
+// SDL_EventState(SDL_VIDEORESIZE, SDL_IGNORE);
#endif
#ifndef HAVE_HWSCALE
new_screen = SDL_SetVideoMode(actual_width, actual_height, sdl_bitdepth, flags);
@@ -836,9 +836,7 @@
}
}
#endif
-#ifndef ANDROID_COMPILE
- SDL_EventState(SDL_VIDEORESIZE, SDL_ENABLE);
-#endif
+// SDL_EventState(SDL_VIDEORESIZE, SDL_ENABLE);
} else {
#ifdef HAVE_HWSCALE
/* free the old hwscale screen when hwscaled screen is switched away */
@@ -1421,11 +1419,11 @@
}
#ifndef ANDROID_COMPILE
- SDL_EventState(SDL_VIDEORESIZE, SDL_IGNORE);
+// SDL_EventState(SDL_VIDEORESIZE, SDL_IGNORE);
#endif
sdl_active_canvas->hwscale_screen = SDL_SetVideoMode((int)w, (int)h, sdl_bitdepth, flags);
#ifndef ANDROID_COMPILE
- SDL_EventState(SDL_VIDEORESIZE, SDL_ENABLE);
+// SDL_EventState(SDL_VIDEORESIZE, SDL_ENABLE);
#endif
#ifdef SDL_DEBUG
Index: src/arch/sdl/vsyncarch.c
===================================================================
--- src/arch/sdl/vsyncarch.c (revision 35456)
+++ src/arch/sdl/vsyncarch.c (working copy)
@@ -44,6 +44,10 @@
#include "vice_sdl.h"
+#ifdef EMSCRIPTEN
+ #include <emscripten.h>
+#endif
+
/* ------------------------------------------------------------------------- */
/* SDL_Delay & GetTicks have 1ms resolution, while VICE needs 1us */
@@ -77,10 +81,24 @@
ui_display_speed((float)speed, (float)frame_rate, warp_enabled);
}
+#ifdef EMSCRIPTEN
+/* Wrap the resume main loop function to prevent a pointer cast making it safe for asm.js */
+void emscripten_resume_main_loop_wrapper(void *arg)
+{
+ emscripten_resume_main_loop();
+}
+#endif
+
+
/* Sleep a number of timer units. */
void vsyncarch_sleep(unsigned long delay)
{
- SDL_Delay(delay / VICE_SDL_TICKS_SCALE);
+#ifdef EMSCRIPTEN
+ emscripten_pause_main_loop();
+ emscripten_async_call(emscripten_resume_main_loop_wrapper, NULL, delay/VICE_SDL_TICKS_SCALE);
+#else
+ SDL_Delay(delay/VICE_SDL_TICKS_SCALE);
+#endif
}
void vsyncarch_presync(void)
Index: src/main.c
===================================================================
--- src/main.c (revision 35456)
+++ src/main.c (working copy)
@@ -75,6 +75,10 @@
#include "svnversion.h"
#endif
+#ifdef EMSCRIPTEN
+ #include <emscripten.h>
+#endif
+
#ifdef DEBUG_MAIN
#define DBG(x) printf x
#else
@@ -286,7 +290,11 @@
/* Let's go... */
log_message(LOG_DEFAULT, "Main CPU: starting at ($FFFC).");
+#ifdef EMSCRIPTEN
+ emscripten_set_main_loop(maincpu_mainloop, 0, 0);
+#else
maincpu_mainloop();
+#endif
log_error(LOG_DEFAULT, "perkele!");
Index: src/maincpu.c
===================================================================
--- src/maincpu.c (revision 35456)
+++ src/maincpu.c (working copy)
@@ -50,6 +50,11 @@
#include "traps.h"
#include "types.h"
+#ifdef EMSCRIPTEN
+ #include "arch/sdl/emscripten/coroutine.h"
+ #include "vsync.h"
+#endif
+
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif
@@ -402,8 +407,8 @@
}
}
-void maincpu_mainloop(void)
-{
+
+
#ifndef C64DTV
/* Notice that using a struct for these would make it a lot slower (at
least, on gcc 2.7.2.x). */
@@ -453,13 +458,31 @@
int bank_start = 0;
int bank_limit = 0;
+void maincpu_mainloop(void)
+{
+#ifdef EMSCRIPTEN
+ scrBegin;
+#endif
+
o_bank_base = &bank_base;
o_bank_start = &bank_start;
o_bank_limit = &bank_limit;
- machine_trigger_reset(MACHINE_RESET_MODE_SOFT);
+
+ int machine_reset_triggered = 0;
+ if(!machine_reset_triggered) {
+ machine_trigger_reset(MACHINE_RESET_MODE_SOFT);
+ machine_reset_triggered = 1;
+ }
while (1) {
+#ifdef EMSCRIPTEN
+ /* Loop until next frame */
+ int startFrame = vsync_frame_counter;
+ while (vsync_frame_counter == startFrame) {
+#endif
+
+
#define CLK maincpu_clk
#define RMW_FLAG maincpu_rmw_flag
#define LAST_OPCODE_INFO last_opcode_info
@@ -520,7 +543,15 @@
debug.maincpu_traceflg = 1;
}
#endif
+#ifdef EMSCRIPTEN
+ }
+ scrReturnV;
+
+#endif
}
+#ifdef EMSCRIPTEN
+ scrFinishV;
+#endif
}
/* ------------------------------------------------------------------------- */
Index: src/opencbm.h
===================================================================
--- src/opencbm.h (revision 35456)
+++ src/opencbm.h (working copy)
@@ -123,6 +123,10 @@
typedef unsigned char __u_char;
#endif
+#ifdef EMSCRIPTEN
+typedef unsigned char __u_char;
+#endif
+
#if defined(__minix) || defined(OPENSERVER5_COMPILE) || defined(__QNXNTO__)
typedef unsigned char __u_char;
#endif
Index: src/sounddrv/soundsdl.c
===================================================================
--- src/sounddrv/soundsdl.c (revision 35456)
+++ src/sounddrv/soundsdl.c (working copy)
@@ -43,6 +43,8 @@
#include "loader.h"
#endif
+
+
static int16_t *sdl_buf = NULL;
static SDL_AudioSpec sdl_spec;
static volatile int sdl_inptr = 0;
Index: src/vice.h
===================================================================
--- src/vice.h (revision 35456)
+++ src/vice.h (working copy)
@@ -30,6 +30,7 @@
#ifndef VICE_VICE_H
#define VICE_VICE_H
+#include <string.h>
/* We use <config.h> instead of "config.h" so that a compilation using
-I. -I$srcdir will use ./config.h rather than $srcdir/config.h
Index: src/vice_sdl.h
===================================================================
--- src/vice_sdl.h (revision 35456)
+++ src/vice_sdl.h (working copy)
@@ -56,7 +56,7 @@
#else
# ifdef USE_SDL_PREFIX
# include <SDL/SDL.h>
-# include <SDL/SDL_keysym.h>
+# include <SDL/SDL_keycode.h>
# ifdef INCLUDE_SDL_SYSWM_H
# include <SDL/SDL_syswm.h>
# endif
@@ -68,7 +68,7 @@
# endif
# else
# include <SDL.h>
-# include <SDL_keysym.h>
+# include <SDL_keycode.h>
# ifdef INCLUDE_SDL_SYSWM_H
# include <SDL_syswm.h>
# endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment