mirror of
https://github.com/Interlisp/maiko.git
synced 2026-05-03 23:09:34 +00:00
Merge remote-tracking branch 'wasm-updates/master' into incorporate-wasm-changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# Options for Emscripten, WASM and SDL
|
# Options for Emscripten, WASM and SDL
|
||||||
|
|
||||||
CC = emcc -sUSE_SDL=2 -sASYNCIFY -sALLOW_MEMORY_GROWTH $(CLANG_CFLAGS)
|
CC = emcc $(CLANG_CFLAGS)
|
||||||
|
|
||||||
XFILES = $(OBJECTDIR)sdl.o
|
XFILES = $(OBJECTDIR)sdl.o
|
||||||
|
|
||||||
@@ -11,9 +11,9 @@ OPTFLAGS = -O2 -g3
|
|||||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||||
|
|
||||||
LD = emcc
|
LD = emcc
|
||||||
LDFLAGS = -sUSE_SDL=2 --preload-file $(SYSOUT)@full.sysout
|
LDFLAGS = -sUSE_SDL=2 -sASYNCIFY -sALLOW_MEMORY_GROWTH --preload-file $(SYSOUT)@full.sysout
|
||||||
LDELDFLAGS =
|
LDELDFLAGS =
|
||||||
|
|
||||||
OBJECTDIR = ../$(RELEASENAME)/
|
OBJECTDIR = ../$(RELEASENAME)/
|
||||||
|
|
||||||
default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldesdl.js
|
default : ../$(OSARCHNAME)/ldesdl.js
|
||||||
|
|||||||
@@ -73,11 +73,6 @@ extern int ether_fd;
|
|||||||
extern DspInterface currentdsp;
|
extern DspInterface currentdsp;
|
||||||
#endif /* XWINDOW */
|
#endif /* XWINDOW */
|
||||||
|
|
||||||
#ifdef MAIKO_OS_EMSCRIPTEN
|
|
||||||
/* We can't touch the system clock */
|
|
||||||
#define settimeofday(tv, tz)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LISP_UNIX_TIME_DIFF 29969152
|
#define LISP_UNIX_TIME_DIFF 29969152
|
||||||
#define LISP_ALTO_TIME_MASK 0x80000000
|
#define LISP_ALTO_TIME_MASK 0x80000000
|
||||||
#define UNIX_ALTO_TIME_DIFF 2177452800U
|
#define UNIX_ALTO_TIME_DIFF 2177452800U
|
||||||
@@ -293,6 +288,8 @@ void subr_settime(LispPTR args[])
|
|||||||
dosday.year = uxtime.tm_year;
|
dosday.year = uxtime.tm_year;
|
||||||
dosday.dayofweek = uxtime.tm_wday;
|
dosday.dayofweek = uxtime.tm_wday;
|
||||||
_dos_setdate(&dosday);
|
_dos_setdate(&dosday);
|
||||||
|
#elif defined(MAIKO_OS_EMSCRIPTEN)
|
||||||
|
(void)args[0];
|
||||||
#else
|
#else
|
||||||
struct timeval timev;
|
struct timeval timev;
|
||||||
timev.tv_sec = *((int *)NativeAligned4FromLAddr(args[0])) - UNIX_ALTO_TIME_DIFF;
|
timev.tv_sec = *((int *)NativeAligned4FromLAddr(args[0])) - UNIX_ALTO_TIME_DIFF;
|
||||||
|
|||||||
@@ -45,11 +45,6 @@
|
|||||||
int flushing = 0;
|
int flushing = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MAIKO_OS_EMSCRIPTEN
|
|
||||||
/* We don't have any shell */
|
|
||||||
#define getusershell() NULL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Used to communicate between Unix subprocesses and LISP */
|
/* Used to communicate between Unix subprocesses and LISP */
|
||||||
|
|
||||||
static long StartTime; /* Time, for creating pipe filenames */
|
static long StartTime; /* Time, for creating pipe filenames */
|
||||||
|
|||||||
16
src/xc.c
16
src/xc.c
@@ -20,6 +20,9 @@
|
|||||||
/* */
|
/* */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
|
#ifdef MAIKO_OS_EMSCRIPTEN
|
||||||
|
#include <emscripten.h>
|
||||||
|
#endif
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -33,10 +36,6 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif /* DOS */
|
#endif /* DOS */
|
||||||
|
|
||||||
#ifdef __EMSCRIPTEN__
|
|
||||||
#include <emscripten.h> /* Defines emscripten_sleep */
|
|
||||||
#endif /* __EMSCRIPTEN__ */
|
|
||||||
|
|
||||||
#include "lispemul.h"
|
#include "lispemul.h"
|
||||||
#include "emlglob.h"
|
#include "emlglob.h"
|
||||||
#include "address.h"
|
#include "address.h"
|
||||||
@@ -187,9 +186,6 @@ static int pseudoTimerAsyncCountdown = MAIKO_TIMER_ASYNC_EMULATION_INSNS_COUNTDO
|
|||||||
|
|
||||||
void dispatch(void) {
|
void dispatch(void) {
|
||||||
InstPtr pccache;
|
InstPtr pccache;
|
||||||
#ifdef __EMSCRIPTEN__
|
|
||||||
int cycles = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(OPDISP)
|
#if defined(OPDISP)
|
||||||
static const void* optable[256] = {
|
static const void* optable[256] = {
|
||||||
@@ -268,9 +264,6 @@ op_ufn : {
|
|||||||
/* DISPATCH "LOOP" */
|
/* DISPATCH "LOOP" */
|
||||||
|
|
||||||
nextopcode:
|
nextopcode:
|
||||||
#ifdef __EMSCRIPTEN__
|
|
||||||
if (++cycles % 1000000 == 0) emscripten_sleep(1);
|
|
||||||
#endif
|
|
||||||
#ifdef MYOPTRACE
|
#ifdef MYOPTRACE
|
||||||
if ((struct fnhead *)NativeAligned4FromLAddr(0x2ed600) == FuncObj) {
|
if ((struct fnhead *)NativeAligned4FromLAddr(0x2ed600) == FuncObj) {
|
||||||
quick_stack_check();
|
quick_stack_check();
|
||||||
@@ -296,6 +289,9 @@ nextopcode:
|
|||||||
Irq_Stk_End = 0;
|
Irq_Stk_End = 0;
|
||||||
#if defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
|
#if defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
|
||||||
IO_Signalled = TRUE;
|
IO_Signalled = TRUE;
|
||||||
|
#endif
|
||||||
|
#ifdef MAIKO_OS_EMSCRIPTEN
|
||||||
|
emscripten_sleep(1);
|
||||||
#endif
|
#endif
|
||||||
pseudoTimerAsyncCountdown = insnsCountdownForTimerAsyncEmulation;
|
pseudoTimerAsyncCountdown = insnsCountdownForTimerAsyncEmulation;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user