1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-14 19:56:28 +00:00

Merge remote-tracking branch 'wasm-updates/master' into incorporate-wasm-changes

This commit is contained in:
Nick Briggs
2023-12-22 19:18:56 -08:00
5 changed files with 11 additions and 23 deletions

20
src/lde.html Normal file
View File

@@ -0,0 +1,20 @@
<!doctype html>
<!-- Based on https://github.com/timhutton/sdl-canvas-wasm/blob/main/index.html -->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div style="text-align: center;">
<canvas id="canvas" oncontextmenu="event.preventDefault()"></canvas>
</div>
<script type="text/javascript">
var Module = {
arguments: ["full.sysout"],
canvas: (function() { return document.getElementById('canvas'); })()
};
</script>
<script src="ldesdl.js"></script>
</body>
</html>

View File

@@ -73,11 +73,6 @@ extern int ether_fd;
extern DspInterface currentdsp;
#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_ALTO_TIME_MASK 0x80000000
#define UNIX_ALTO_TIME_DIFF 2177452800U
@@ -293,6 +288,8 @@ void subr_settime(LispPTR args[])
dosday.year = uxtime.tm_year;
dosday.dayofweek = uxtime.tm_wday;
_dos_setdate(&dosday);
#elif defined(MAIKO_OS_EMSCRIPTEN)
(void)args[0];
#else
struct timeval timev;
timev.tv_sec = *((int *)NativeAligned4FromLAddr(args[0])) - UNIX_ALTO_TIME_DIFF;

View File

@@ -45,11 +45,6 @@
int flushing = 0;
#endif
#ifdef MAIKO_OS_EMSCRIPTEN
/* We don't have any shell */
#define getusershell() NULL
#endif
/* Used to communicate between Unix subprocesses and LISP */
static long StartTime; /* Time, for creating pipe filenames */

View File

@@ -20,6 +20,9 @@
/* */
/************************************************************************/
#ifdef MAIKO_OS_EMSCRIPTEN
#include <emscripten.h>
#endif
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
@@ -33,10 +36,6 @@
#include <sys/time.h>
#endif /* DOS */
#ifdef __EMSCRIPTEN__
#include <emscripten.h> /* Defines emscripten_sleep */
#endif /* __EMSCRIPTEN__ */
#include "lispemul.h"
#include "emlglob.h"
#include "address.h"
@@ -187,9 +186,6 @@ static int pseudoTimerAsyncCountdown = MAIKO_TIMER_ASYNC_EMULATION_INSNS_COUNTDO
void dispatch(void) {
InstPtr pccache;
#ifdef __EMSCRIPTEN__
int cycles = 0;
#endif
#if defined(OPDISP)
static const void* optable[256] = {
@@ -268,9 +264,6 @@ op_ufn : {
/* DISPATCH "LOOP" */
nextopcode:
#ifdef __EMSCRIPTEN__
if (++cycles % 1000000 == 0) emscripten_sleep(1);
#endif
#ifdef MYOPTRACE
if ((struct fnhead *)NativeAligned4FromLAddr(0x2ed600) == FuncObj) {
quick_stack_check();
@@ -296,6 +289,9 @@ nextopcode:
Irq_Stk_End = 0;
#if defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
IO_Signalled = TRUE;
#endif
#ifdef MAIKO_OS_EMSCRIPTEN
emscripten_sleep(1);
#endif
pseudoTimerAsyncCountdown = insnsCountdownForTimerAsyncEmulation;
}