Clean up include, autoboot, split windows, shorten start.

Drop startup timeout to 100ms.
Clean up exceptions in include.
Cleanup stack in autoboot.
Split out windows into a second string, to work around overflow issue.
This commit is contained in:
Brad Nelson
2023-01-22 16:44:42 -08:00
parent 40400b873e
commit 9ef1ea9f90
7 changed files with 48 additions and 12 deletions

16
windows/load_extra.fs Normal file
View File

@ -0,0 +1,16 @@
\ Copyright 2023 Bradley D. Nelson
\
\ Licensed under the Apache License, Version 2.0 (the "License");
\ you may not use this file except in compliance with the License.
\ You may obtain a copy of the License at
\
\ http://www.apache.org/licenses/LICENSE-2.0
\
\ Unless required by applicable law or agreed to in writing, software
\ distributed under the License is distributed on an "AS IS" BASIS,
\ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\ See the License for the specific language governing permissions and
\ limitations under the License.
( Load extra things that didn't fit in main boot string. )
windows boot_extra forth evaluate

View File

@ -38,6 +38,7 @@
static LRESULT WindowProcShim(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static void SetupCtrlBreakHandler(void);
static cell_t GetBootExtra(cell_t *start);
#define PLATFORM_OPCODE_LIST \
YV(windows, GetProcAddress, \
@ -45,6 +46,7 @@ static void SetupCtrlBreakHandler(void);
YV(windows, LoadLibraryA, tos = (cell_t) LoadLibraryA((LPCSTR) tos)) \
YV(windows, WindowProcShim, DUP; tos = (cell_t) &WindowProcShim) \
YV(windows, SetupCtrlBreakHandler, SetupCtrlBreakHandler()) \
YV(windows, boot_extra, DUP; DUP; tos = GetBootExtra(sp)) \
CALLING_OPCODE_LIST \
FLOATING_POINT_LIST
@ -56,6 +58,7 @@ static void SetupCtrlBreakHandler(void);
#include "windows/interp.h"
#include "gen/windows_boot.h"
#include "gen/windows_boot_extra.h"
static DWORD forth_main_thread_id;
static uintptr_t forth_main_thread_resume_sp;
@ -108,6 +111,11 @@ static void SetupCtrlBreakHandler(void) {
#endif
}
static cell_t GetBootExtra(cell_t *start) {
*start = (cell_t) boot_extra;
return (cell_t) sizeof(boot_extra) - 1;
}
static LRESULT WindowProcShim(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
if (msg == WM_NCCREATE) {
SetWindowLongPtr(