mirror of
https://github.com/Interlisp/maiko.git
synced 2026-03-30 11:04:37 +00:00
Compare commits
1 Commits
fgh_fix-21
...
mth38--sup
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
966290ff4d |
@@ -71,6 +71,8 @@ extern DspInterface currentdsp;
|
|||||||
extern int LispKbdFd;
|
extern int LispKbdFd;
|
||||||
int LispKbdFd = -1;
|
int LispKbdFd = -1;
|
||||||
|
|
||||||
|
extern int runtime_debug_level;
|
||||||
|
|
||||||
extern fd_set LispReadFds;
|
extern fd_set LispReadFds;
|
||||||
|
|
||||||
extern DLword *EmMouseX68K;
|
extern DLword *EmMouseX68K;
|
||||||
@@ -375,6 +377,20 @@ static u_char *make_X_keymap(void) {
|
|||||||
table[xcode - 7] = code;
|
table[xcode - 7] = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (runtime_debug_level > 0) {
|
||||||
|
printf("*********************************************************************\n");
|
||||||
|
printf("(DEFINE-FILE-INFO \036PACKAGE \"INTERLISP\" \036READTABLE \"XCL\" \036 BASE 10)\n");
|
||||||
|
printf("(SETQ XGetKeyboardMappingTable '(\n");
|
||||||
|
for (i = 0; i < codecount * symspercode; i += symspercode) {
|
||||||
|
printf("(%d (", minkey + (i / symspercode));
|
||||||
|
for (int j = 0; j < symspercode; j++) {
|
||||||
|
printf(" #X%lx", (unsigned long)mapping[i+j]);
|
||||||
|
}
|
||||||
|
printf(" ))\n");
|
||||||
|
}
|
||||||
|
printf("\n))\nSTOP\n");
|
||||||
|
printf("*********************************************************************\n");
|
||||||
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("\n\n\tXGetKeyboardMapping table\n\n");
|
printf("\n\n\tXGetKeyboardMapping table\n\n");
|
||||||
for (i = 0; i < codecount * symspercode; i += symspercode) {
|
for (i = 0; i < codecount * symspercode; i += symspercode) {
|
||||||
|
|||||||
15
src/main.c
15
src/main.c
@@ -226,6 +226,8 @@ int save_argc;
|
|||||||
char **save_argv;
|
char **save_argv;
|
||||||
int display_max = 65536 * 16 * 2;
|
int display_max = 65536 * 16 * 2;
|
||||||
|
|
||||||
|
long runtime_debug_level = 0;
|
||||||
|
|
||||||
/* diagnostic flag for sysout dumping */
|
/* diagnostic flag for sysout dumping */
|
||||||
extern unsigned maxpages;
|
extern unsigned maxpages;
|
||||||
|
|
||||||
@@ -315,7 +317,7 @@ const char *nethubHelpstring =
|
|||||||
const char *nethubHelpstring = "";
|
const char *nethubHelpstring = "";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MAIKO_OS_LINUX || defined(MAIKO_EMULATE_TIMER_INTERRUPTS) || defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
|
#if defined(MAIKO_EMULATE_TIMER_INTERRUPTS) || defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
|
||||||
extern int insnsCountdownForTimerAsyncEmulation;
|
extern int insnsCountdownForTimerAsyncEmulation;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -345,6 +347,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *envname;
|
char *envname;
|
||||||
|
char *rtdebug;
|
||||||
extern int TIMER_INTERVAL;
|
extern int TIMER_INTERVAL;
|
||||||
extern fd_set LispReadFds;
|
extern fd_set LispReadFds;
|
||||||
long tmpint;
|
long tmpint;
|
||||||
@@ -601,7 +604,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
#endif /* MAIKO_ENABLE_NETHUB */
|
#endif /* MAIKO_ENABLE_NETHUB */
|
||||||
|
|
||||||
#if MAIKO_OS_LINUX || defined(MAIKO_EMULATE_TIMER_INTERRUPTS) || defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
|
#if defined(MAIKO_EMULATE_TIMER_INTERRUPTS) || defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
|
||||||
else if (!strcmp(argv[i], "-intr-emu-insns")) {
|
else if (!strcmp(argv[i], "-intr-emu-insns")) {
|
||||||
if (argc > ++i) {
|
if (argc > ++i) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
@@ -677,6 +680,14 @@ int main(int argc, char *argv[])
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
|
if ((rtdebug = getenv("LDERUNTIMEDEBUG")) != NULL) {
|
||||||
|
errno = 0;
|
||||||
|
runtime_debug_level = strtol(rtdebug, (char **)NULL, 10);
|
||||||
|
if (errno != 0) {
|
||||||
|
runtime_debug_level = 0; // default to OFF if erroneous value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Sanity checks. */
|
/* Sanity checks. */
|
||||||
#ifdef DOS
|
#ifdef DOS
|
||||||
|
|||||||
12
src/timer.c
12
src/timer.c
@@ -454,11 +454,6 @@ static void int_timer_service(int sig)
|
|||||||
/* */
|
/* */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
#if MAIKO_OS_LINUX
|
|
||||||
// for WSL1, which doesn't support setitimer(ITIMER_VIRTUAL ...)
|
|
||||||
int linux_emulate_timer = 0;
|
|
||||||
#endif /* MAIKO_OS_LINUX */
|
|
||||||
|
|
||||||
static void int_timer_init(void)
|
static void int_timer_init(void)
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -494,11 +489,6 @@ static void int_timer_init(void)
|
|||||||
/* then attach a timer to it and turn it loose */
|
/* then attach a timer to it and turn it loose */
|
||||||
timert.it_interval.tv_sec = timert.it_value.tv_sec = 0;
|
timert.it_interval.tv_sec = timert.it_value.tv_sec = 0;
|
||||||
timert.it_interval.tv_usec = timert.it_value.tv_usec = TIMER_INTERVAL;
|
timert.it_interval.tv_usec = timert.it_value.tv_usec = TIMER_INTERVAL;
|
||||||
|
|
||||||
#if MAIKO_OS_LINUX
|
|
||||||
// (For WSL1) Capture error output from setittimer to indicate need to emulate timer
|
|
||||||
linux_emulate_timer =
|
|
||||||
#endif /* MAIKO_OS_LINUX */
|
|
||||||
setitimer(ITIMER_VIRTUAL, &timert, NULL);
|
setitimer(ITIMER_VIRTUAL, &timert, NULL);
|
||||||
|
|
||||||
DBPRINT(("Timer interval set to %ld usec\n", (long)timert.it_value.tv_usec));
|
DBPRINT(("Timer interval set to %ld usec\n", (long)timert.it_value.tv_usec));
|
||||||
@@ -509,7 +499,7 @@ static void int_timer_init(void)
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/*
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
|
|||||||
19
src/xc.c
19
src/xc.c
@@ -173,7 +173,7 @@ static const int n_mask_array[16] = {
|
|||||||
|
|
||||||
extern int TIMER_INTERVAL;
|
extern int TIMER_INTERVAL;
|
||||||
|
|
||||||
#if MAIKO_OS_LINUX || defined(MAIKO_EMULATE_TIMER_INTERRUPTS) || defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
|
#if defined(MAIKO_EMULATE_TIMER_INTERRUPTS) || defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
|
||||||
|
|
||||||
# if !defined(MAIKO_TIMER_ASYNC_EMULATION_INSNS_COUNTDOWN)
|
# if !defined(MAIKO_TIMER_ASYNC_EMULATION_INSNS_COUNTDOWN)
|
||||||
# define MAIKO_TIMER_ASYNC_EMULATION_INSNS_COUNTDOWN 20000
|
# define MAIKO_TIMER_ASYNC_EMULATION_INSNS_COUNTDOWN 20000
|
||||||
@@ -181,9 +181,7 @@ extern int TIMER_INTERVAL;
|
|||||||
|
|
||||||
int insnsCountdownForTimerAsyncEmulation = MAIKO_TIMER_ASYNC_EMULATION_INSNS_COUNTDOWN;
|
int insnsCountdownForTimerAsyncEmulation = MAIKO_TIMER_ASYNC_EMULATION_INSNS_COUNTDOWN;
|
||||||
static int pseudoTimerAsyncCountdown = MAIKO_TIMER_ASYNC_EMULATION_INSNS_COUNTDOWN;
|
static int pseudoTimerAsyncCountdown = MAIKO_TIMER_ASYNC_EMULATION_INSNS_COUNTDOWN;
|
||||||
#if MAIKO_OS_LINUX
|
|
||||||
extern int linux_emulate_timer;
|
|
||||||
#endif /* MAIKO_OS_LINUX */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void dispatch(void) {
|
void dispatch(void) {
|
||||||
@@ -284,12 +282,10 @@ nextopcode:
|
|||||||
#endif /* PCTRACE */
|
#endif /* PCTRACE */
|
||||||
|
|
||||||
/* quick_stack_check();*/ /* JDS 2/12/98 */
|
/* quick_stack_check();*/ /* JDS 2/12/98 */
|
||||||
#if MAIKO_OS_LINUX || defined(MAIKO_EMULATE_TIMER_INTERRUPTS) || defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
|
|
||||||
#if MAIKO_OS_LINUX
|
#if defined(MAIKO_EMULATE_TIMER_INTERRUPTS) || defined(MAIKO_EMULATE_ASYNC_INTERRUPTS)
|
||||||
if (linux_emulate_timer) {
|
if (--pseudoTimerAsyncCountdown <= 0) {
|
||||||
#endif /* MAIKO_OS_LINUX */
|
Irq_Stk_Check = 0;
|
||||||
if (--pseudoTimerAsyncCountdown <= 0) {
|
|
||||||
Irq_Stk_Check = 0;
|
|
||||||
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;
|
||||||
@@ -298,9 +294,6 @@ nextopcode:
|
|||||||
emscripten_sleep(1);
|
emscripten_sleep(1);
|
||||||
#endif
|
#endif
|
||||||
pseudoTimerAsyncCountdown = insnsCountdownForTimerAsyncEmulation;
|
pseudoTimerAsyncCountdown = insnsCountdownForTimerAsyncEmulation;
|
||||||
#if MAIKO_OS_LINUX
|
|
||||||
}
|
|
||||||
#endif /* MAIKO_OS_LINUX */
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user