This commit is contained in:
Helloyunho 2025-07-03 17:13:29 +09:00
commit b4b9f6ccb5
17 changed files with 196 additions and 88 deletions

View File

@ -1,3 +1,16 @@
diff --git a/src/lib/libpthread.js b/src/lib/libpthread.js
index 6d979627e..97e3f8684 100644
--- a/src/lib/libpthread.js
+++ b/src/lib/libpthread.js
@@ -697,7 +697,7 @@ var LibraryPThread = {
{
transferredCanvasNames = UTF8ToString(transferredCanvasNames).trim();
}
- transferredCanvasNames = transferredCanvasNames ? transferredCanvasNames.split(',') : [];
+ transferredCanvasNames = transferredCanvasNames && !Module['disableOffscreenCanvases'] ? transferredCanvasNames.split(',') : [];
#if GL_DEBUG
dbg(`pthread_create: transferredCanvasNames="${transferredCanvasNames}"`);
#endif
diff --git a/src/lib/libwasmfs_fetch.js b/src/lib/libwasmfs_fetch.js
index e8c9f7e21..caf1971d2 100644
--- a/src/lib/libwasmfs_fetch.js

View File

@ -740,7 +740,6 @@ MxResult IsleApp::SetupWindow()
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, g_targetWidth);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, g_targetHeight);
SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN, m_fullScreen);
SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN, true);
SDL_SetStringProperty(props, SDL_PROP_WINDOW_CREATE_TITLE_STRING, WINDOW_TITLE);
#if defined(MINIWIN) && !defined(__3DS__) && !defined(WINDOWS_STORE)
SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, true);

View File

@ -52,13 +52,13 @@ class CarRace : public LegoRace {
return !strcmp(p_name, CarRace::ClassName()) || LegoRace::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxLong HandleType0Notification(MxNotificationParam&) override; // vtable+0x78
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleControl(LegoControlManagerNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxLong HandleType0Notification(MxNotificationParam&) override; // vtable+0x78
// FUNCTION: BETA10 0x100cd060
RaceSkel* GetSkeleton() { return m_skeleton; }

View File

@ -29,12 +29,12 @@ class JetskiRace : public LegoRace {
return !strcmp(p_name, JetskiRace::ClassName()) || LegoRace::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleControl(LegoControlManagerNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
void FUN_10016930(MxS32 p_param1, MxS16 p_param2);

View File

@ -11,7 +11,7 @@
#include "mxtypes.h"
class Act1State;
class LegoEventNotificationParam;
class LegoControlManagerNotificationParam;
class LegoPathActor;
class MxEndActionNotificationParam;
class MxNotificationParam;
@ -117,7 +117,7 @@ class LegoRace : public LegoWorld {
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual MxLong HandleClick(LegoEventNotificationParam&) = 0; // vtable+0x6c
virtual MxLong HandleControl(LegoControlManagerNotificationParam&) = 0; // vtable+0x6c
// FUNCTION: LEGO1 0x10015b70
virtual MxLong HandlePathStruct(LegoPathStructNotificationParam&) { return 0; } // vtable+0x70

View File

@ -708,19 +708,19 @@ void WriteDefaultTexture(LegoStorage* p_storage, const char* p_name)
memset(&desc, 0, sizeof(desc));
desc.dwSize = sizeof(desc);
if (surface->Lock(NULL, &desc, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY, NULL) == DD_OK) {
if (surface->Lock(NULL, &desc, DDLOCK_SURFACEMEMORYPTR, NULL) == DD_OK) {
LegoImage* image = new LegoImage(desc.dwWidth, desc.dwHeight);
if (image != NULL) {
if (desc.dwWidth == desc.lPitch) {
memcpy(desc.lpSurface, image->GetBits(), desc.dwWidth * desc.dwHeight);
memcpy(image->GetBits(), desc.lpSurface, desc.dwWidth * desc.dwHeight);
}
else {
MxU8* surface = (MxU8*) desc.lpSurface;
const LegoU8* bits = image->GetBits();
LegoU8* bits = image->GetBits();
for (MxS32 i = 0; i < desc.dwHeight; i++) {
memcpy(surface, bits, desc.dwWidth);
memcpy(bits, surface, desc.dwWidth);
surface += desc.lPitch;
bits += desc.dwWidth;
}

View File

@ -248,7 +248,7 @@ void MxTransitionManager::DissolveTransition()
}
else {
MxU8* surf = (MxU8*) ddsd.lpSurface + ddsd.lPitch * row + xShift * 4;
*(MxU32*) surf = 0;
*(MxU32*) surf = 0xFF000000;
}
}
}
@ -416,10 +416,25 @@ void MxTransitionManager::WipeDownTransition()
// For each of the 240 animation ticks, blank out two scanlines
// starting at the top of the screen.
MxU8* line = (MxU8*) ddsd.lpSurface + 2 * ddsd.lPitch * m_animationTimer;
memset(line, 0, ddsd.lPitch);
line += ddsd.lPitch;
memset(line, 0, ddsd.lPitch);
if (ddsd.ddpfPixelFormat.dwRGBBitCount == 32) {
MxU32* pixels = (MxU32*) line;
int pixelsPerLine = ddsd.lPitch / 4;
for (int i = 0; i < pixelsPerLine; i++) {
pixels[i] = 0xFF000000;
}
line += ddsd.lPitch;
pixels = (MxU32*) line;
for (int i = 0; i < pixelsPerLine; i++) {
pixels[i] = 0xFF000000;
}
}
else {
memset(line, 0, ddsd.lPitch);
line += ddsd.lPitch;
memset(line, 0, ddsd.lPitch);
}
SetupCopyRect(&ddsd);
m_ddSurface->Unlock(ddsd.lpSurface);
@ -454,17 +469,42 @@ void MxTransitionManager::WindowsTransition()
MxS32 bytesPerPixel = ddsd.ddpfPixelFormat.dwRGBBitCount / 8;
memset(line, 0, ddsd.lPitch);
if (bytesPerPixel == 4) {
MxU32* pixels = (MxU32*) line;
for (int i = 0; i < 640; i++) {
pixels[i] = 0xFF000000;
}
for (MxS32 i = m_animationTimer + 1; i < 480 - m_animationTimer; i++) {
line += ddsd.lPitch;
for (MxS32 i = m_animationTimer + 1; i < 480 - m_animationTimer - 1; i++) {
line += ddsd.lPitch;
pixels = (MxU32*) line;
pixels[m_animationTimer] = 0xFF000000;
pixels[639 - m_animationTimer] = 0xFF000000;
}
memset(line + m_animationTimer * bytesPerPixel, 0, bytesPerPixel);
memset(line + 640 + (-1 - m_animationTimer) * bytesPerPixel, 0, bytesPerPixel);
if (m_animationTimer < 240 - 1) {
line += ddsd.lPitch;
pixels = (MxU32*) line;
for (int i = 0; i < 640; i++) {
pixels[i] = 0xFF000000;
}
}
}
else {
memset(line, 0, 640 * bytesPerPixel);
line += ddsd.lPitch;
memset(line, 0, ddsd.lPitch);
for (MxS32 i = m_animationTimer + 1; i < 480 - m_animationTimer - 1; i++) {
line += ddsd.lPitch;
memset(line + m_animationTimer * bytesPerPixel, 0, bytesPerPixel);
memset(line + (639 - m_animationTimer) * bytesPerPixel, 0, bytesPerPixel);
}
if (m_animationTimer < 240 - 1) {
line += ddsd.lPitch;
memset(line, 0, 640 * bytesPerPixel);
}
}
SetupCopyRect(&ddsd);
m_ddSurface->Unlock(ddsd.lpSurface);

View File

@ -337,12 +337,10 @@ MxLong CarRace::HandlePathStruct(LegoPathStructNotificationParam& p_param)
}
// FUNCTION: LEGO1 0x10017650
MxLong CarRace::HandleClick(LegoEventNotificationParam& p_param)
MxLong CarRace::HandleControl(LegoControlManagerNotificationParam& p_param)
{
LegoControlManagerNotificationParam* param = (LegoControlManagerNotificationParam*) &p_param;
if (param->m_unk0x28 == 1) {
switch (param->m_clickedObjectId) {
if (p_param.m_unk0x28 == 1) {
switch (p_param.m_clickedObjectId) {
case 3:
InvokeAction(Extra::e_stop, *g_carraceScript, CarraceScript::c_irtx08ra_PlayWav, NULL);
m_act1State->m_unk0x018 = 0;

View File

@ -124,12 +124,12 @@ MxLong JetskiRace::HandleEndAction(MxEndActionNotificationParam& p_param)
}
// FUNCTION: LEGO1 0x100165a0
MxLong JetskiRace::HandleClick(LegoEventNotificationParam& p_param)
MxLong JetskiRace::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxLong result = 0;
if (((LegoControlManagerNotificationParam*) &p_param)->m_unk0x28 == 1) {
switch (((LegoControlManagerNotificationParam*) &p_param)->m_clickedObjectId) {
if (p_param.m_unk0x28 == 1) {
switch (p_param.m_clickedObjectId) {
case JetraceScript::c_JetskiArms_Ctl:
m_act1State->m_unk0x018 = 0;
VariableTable()->SetVariable(g_raceState, "");

View File

@ -82,8 +82,8 @@ MxLong LegoRace::Notify(MxParam& p_param)
case c_notificationEndAction:
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
break;
case c_notificationClick:
result = HandleClick((LegoEventNotificationParam&) p_param);
case c_notificationControl:
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
break;
case c_notificationPathStruct:
result = HandlePathStruct((LegoPathStructNotificationParam&) p_param);

View File

@ -46,7 +46,7 @@ class LegoImage {
{
m_palette->colors[p_i] = p_paletteEntry.GetColor();
}
const LegoU8* GetBits() const { return (LegoU8*) m_surface->pixels; }
LegoU8* GetBits() const { return (LegoU8*) m_surface->pixels; }
LegoResult Read(LegoStorage* p_storage, LegoU32 p_square);
LegoResult Write(LegoStorage* p_storage);

View File

@ -170,39 +170,16 @@ BOOL MxDirect3D::D3DSetMode()
LPDIRECTDRAWSURFACE frontBuffer = FrontBuffer();
LPDIRECTDRAWSURFACE backBuffer = BackBuffer();
DDSURFACEDESC desc;
memset(&desc, 0, sizeof(desc));
desc.dwSize = sizeof(desc);
DDBLTFX ddBltFx = {};
ddBltFx.dwSize = sizeof(DDBLTFX);
ddBltFx.dwFillColor = 0;
if (backBuffer->Lock(NULL, &desc, DDLOCK_WAIT | DDLOCK_WRITEONLY, NULL) == DD_OK) {
unsigned char* surface = (unsigned char*) desc.lpSurface;
for (int i = 0; i < mode.height; i++) {
memset(surface, 0, desc.lPitch);
surface += desc.lPitch;
}
backBuffer->Unlock(desc.lpSurface);
}
else {
SDL_Log("MxDirect3D::D3DSetMode() back lock failed\n");
if (backBuffer->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &ddBltFx) != DD_OK) {
SDL_Log("MxDirect3D::D3DSetMode() color fill failed\n");
}
if (IsFullScreen()) {
memset(&desc, 0, sizeof(desc));
desc.dwSize = sizeof(desc);
if (frontBuffer->Lock(NULL, &desc, DDLOCK_WAIT | DDLOCK_WRITEONLY, NULL) == DD_OK) {
unsigned char* surface = (unsigned char*) desc.lpSurface;
for (int i = 0; i < mode.height; i++) {
memset(surface, 0, desc.lPitch);
surface += desc.lPitch;
}
frontBuffer->Unlock(desc.lpSurface);
}
else {
if (frontBuffer->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &ddBltFx) != DD_OK) {
SDL_Log("MxDirect3D::D3DSetMode() front lock failed\n");
}
}

View File

@ -64,8 +64,6 @@ void MxDisplaySurface::ClearScreen()
MxS32 width = m_videoParam.GetRect().GetWidth();
MxS32 height = m_videoParam.GetRect().GetHeight();
RECT rc = {0, 0, width, height};
memset(&desc, 0, sizeof(desc));
desc.dwSize = sizeof(desc);
if (m_ddSurface2->GetSurfaceDesc(&desc) != DD_OK) {
@ -77,9 +75,9 @@ void MxDisplaySurface::ClearScreen()
ddBltFx.dwFillColor = 0;
for (MxS32 i = 0; i < backBuffers; i++) {
if (m_ddSurface2->Blt(&rc, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddBltFx) == DDERR_SURFACELOST) {
if (m_ddSurface2->Blt(NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddBltFx) == DDERR_SURFACELOST) {
m_ddSurface2->Restore();
m_ddSurface2->Blt(&rc, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddBltFx);
m_ddSurface2->Blt(NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddBltFx);
}
if (m_videoParam.Flags().GetFlipSurfaces()) {

View File

@ -16,12 +16,19 @@ RUN chown -R emscripten:emscripten /src
USER emscripten
COPY ISLE/emscripten/libwasmfs_fetch.js.patch /tmp/
COPY ISLE/emscripten/emscripten.patch /tmp/
RUN cd /emsdk/upstream/emscripten && \
git apply --check /tmp/libwasmfs_fetch.js.patch && \
git apply /tmp/libwasmfs_fetch.js.patch
git apply --check /tmp/emscripten.patch && \
git apply /tmp/emscripten.patch
COPY --chown=emscripten:emscripten . .
COPY --chown=emscripten:emscripten 3rdparty/ ./3rdparty/
COPY --chown=emscripten:emscripten LEGO1/ ./LEGO1/
COPY --chown=emscripten:emscripten ISLE/ ./ISLE/
COPY --chown=emscripten:emscripten miniwin/ ./miniwin/
COPY --chown=emscripten:emscripten util/ ./util/
COPY --chown=emscripten:emscripten CMake/ ./CMake/
COPY --chown=emscripten:emscripten packaging/ ./packaging/
COPY --chown=emscripten:emscripten CMakeLists.txt .
RUN emcmake cmake -S . -B build -DISLE_BUILD_CONFIG=OFF -DISLE_DEBUG=OFF -DCMAKE_BUILD_TYPE=Release -DISLE_EMSCRIPTEN_HOST=/assets && \
emmake cmake --build build -j 32
@ -29,9 +36,9 @@ RUN emcmake cmake -S . -B build -DISLE_BUILD_CONFIG=OFF -DISLE_DEBUG=OFF -DCMAKE
RUN echo "Fetching isle.pizza frontend..."; \
git clone --depth 1 https://github.com/isledecomp/isle.pizza /tmp/isle.pizza;
FROM nginx:alpine
FROM openresty/openresty:alpine
COPY docker/emscripten/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /tmp/isle.pizza /usr/share/nginx/html
COPY --from=builder /src/build/isle.* /usr/share/nginx/html
COPY docker/emscripten/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
COPY --from=builder /tmp/isle.pizza /usr/local/openresty/nginx/html
COPY --from=builder /src/build/isle.* /usr/local/openresty/nginx/html
EXPOSE 6931

View File

@ -3,7 +3,43 @@ events {
}
http {
include /etc/nginx/mime.types;
init_by_lua_block {
function find_entry_in_dir(parent_dir, name_to_find)
local safe_parent_dir = string.gsub(parent_dir, "'", "'\\''")
local lower_name_to_find = string.lower(name_to_find)
local pipe = io.popen("ls -A '" .. safe_parent_dir .. "' 2>/dev/null")
if not pipe then return nil end
for entry in pipe:lines() do
if string.lower(entry) == lower_name_to_find then
pipe:close()
return entry
end
end
pipe:close()
return nil
end
function find_recursive_path(path_to_check)
local current_resolved_path = "/"
for component in string.gmatch(path_to_check, "([^/]+)") do
local found_entry = find_entry_in_dir(current_resolved_path, component)
if not found_entry then
return nil
end
if current_resolved_path == "/" then
current_resolved_path = current_resolved_path .. found_entry
else
current_resolved_path = current_resolved_path .. "/" .. found_entry
end
end
return current_resolved_path
end
}
include /usr/local/openresty/nginx/conf/mime.types;
server {
listen 6931;
@ -14,14 +50,33 @@ http {
add_header 'Cross-Origin-Resource-Policy' 'cross-origin';
location / {
root /usr/share/nginx/html;
root /usr/local/openresty/nginx/html;
index index.html isle.html;
try_files $uri $uri/ =404;
}
location ~* ^/assets/(.*)$ {
alias /assets/;
try_files /$1 /DATA/disk/$1 =404;
location /assets/ {
content_by_lua_block {
local request_uri = ngx.var.uri
local resolved_path = find_recursive_path(request_uri)
if not resolved_path then
local fallback_uri = ngx.re.sub(request_uri, [[^/assets/]], "/assets/DATA/disk/", "i")
resolved_path = find_recursive_path(fallback_uri)
end
if resolved_path then
ngx.exec("/internal" .. resolved_path)
else
ngx.exit(ngx.HTTP_NOT_FOUND)
end
}
}
location /internal/assets/ {
internal;
root /;
rewrite ^/internal(.*)$ $1 break;
}
}
}

View File

@ -0,0 +1,3 @@
https://localhost:6932 {
reverse_proxy app:6931
}

View File

@ -0,0 +1,18 @@
services:
app:
image: ghcr.io/isledecomp/isle-portable-emscripten:master
ports:
- "6931:6931"
volumes:
- ${ASSETS_PATH}:/assets
caddy:
image: caddy:latest
ports:
- "6932:6932"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
volumes:
caddy_data: