From 7dac79859c1d70fd3574b91102a7e7d80c132386 Mon Sep 17 00:00:00 2001 From: MCJack123 Date: Sun, 31 Dec 2023 16:53:56 -0500 Subject: [PATCH] Fixed standards mode `load` --- .github/workflows/main.yml | 12 ++++++------ CraftOS-PC 2.vcxproj | 1 - CraftOS-PC 2.vcxproj.filters | 3 --- craftos2-lua | 2 +- src/Computer.cpp | 4 ++-- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 39d93f48..8a37566c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Download ROM - run: sudo git clone --branch lua-5.2 https://github.com/MCJack123/craftos2-rom /usr/local/share/craftos + run: sudo git clone https://github.com/MCJack123/craftos2-rom /usr/local/share/craftos - name: Install dependencies run: | sudo apt update @@ -55,7 +55,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Download ROM - run: sudo git clone --branch lua-5.2 https://github.com/MCJack123/craftos2-rom /usr/local/share/craftos + run: sudo git clone https://github.com/MCJack123/craftos2-rom /usr/local/share/craftos - name: Install dependencies run: | sudo apt update @@ -88,7 +88,7 @@ jobs: sudo apt install -y libsdl2-dev libsdl2-mixer-dev libhpdf-dev libpng++-dev libwebp-dev libpoco-dev libncurses5-dev nodejs - name: Build standalone ROM run: | - git clone --branch lua-5.2 https://github.com/MCJack123/craftos2-rom + git clone https://github.com/MCJack123/craftos2-rom cd craftos2-rom node ../resources/packStandaloneROM.js cd .. @@ -116,8 +116,8 @@ jobs: - uses: actions/checkout@v1 - name: Download ROM & CC:T run: | - sudo git clone --branch lua-5.2 https://github.com/MCJack123/craftos2-rom /usr/local/share/craftos - git clone --branch v1.20.1-1.109.0 https://github.com/cc-tweaked/CC-Tweaked ../CC-Tweaked + sudo git clone https://github.com/MCJack123/craftos2-rom /usr/local/share/craftos + git clone --branch v1.20.1-1.109.2 https://github.com/cc-tweaked/CC-Tweaked ../CC-Tweaked patch -p1 -d ../CC-Tweaked < resources/CCT-Tests.patch - name: Install dependencies run: | @@ -146,7 +146,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Download ROM - run: git clone --branch lua-5.2 https://github.com/MCJack123/craftos2-rom "C:\Program Files\CraftOS-PC" + run: git clone https://github.com/MCJack123/craftos2-rom "C:\Program Files\CraftOS-PC" - name: Restore vcpkg cache uses: lukka/run-vcpkg@v10 with: diff --git a/CraftOS-PC 2.vcxproj b/CraftOS-PC 2.vcxproj index 0a1164e8..f26cac05 100644 --- a/CraftOS-PC 2.vcxproj +++ b/CraftOS-PC 2.vcxproj @@ -563,7 +563,6 @@ - diff --git a/CraftOS-PC 2.vcxproj.filters b/CraftOS-PC 2.vcxproj.filters index ae7bb6ad..74bbcac3 100644 --- a/CraftOS-PC 2.vcxproj.filters +++ b/CraftOS-PC 2.vcxproj.filters @@ -48,9 +48,6 @@ - - Other Files - Other Files diff --git a/craftos2-lua b/craftos2-lua index 23a41108..2f93fd9c 160000 --- a/craftos2-lua +++ b/craftos2-lua @@ -1 +1 @@ -Subproject commit 23a41108e84c59a28c542a5ef5306ef79a849fbe +Subproject commit 2f93fd9cf113b9e85fda93c90076484f8c7b2586 diff --git a/src/Computer.cpp b/src/Computer.cpp index 91ca8560..6f793558 100644 --- a/src/Computer.cpp +++ b/src/Computer.cpp @@ -307,7 +307,7 @@ static int yieldable_load(lua_State *L) { if (status == 0) { /* OK? */ if (env != 0) { /* 'env' parameter? */ lua_pushvalue(L, env); /* environment for loaded function */ - if (!lua_setupvalue(L, 1, -2)) /* set it as 1st upvalue */ + if (!lua_setupvalue(L, -2, 1)) /* set it as 1st upvalue */ lua_pop(L, 1); /* remove 'env' if not used by previous call */ } return 1; @@ -354,7 +354,7 @@ static int yieldable_load(lua_State *L) { } if (ctx->argcount == 1 && ctx->envidx != 0) { /* OK? */ lua_pushvalue(L, ctx->envidx); /* environment for loaded function */ - if (!lua_setupvalue(L, 1, -2)) /* set it as 1st upvalue */ + if (!lua_setupvalue(L, -2, 1)) /* set it as 1st upvalue */ lua_pop(L, 1); /* remove 'env' if not used by previous call */ } return ctx->argcount;