From b2e79697933106d9fa027d36273cfff043350c2b Mon Sep 17 00:00:00 2001 From: Alessandro Proto Date: Fri, 10 Mar 2023 16:02:42 +0100 Subject: [PATCH] Fixes --- Capy64/Assets/bios.lua | 18 +++++++----------- Capy64/Runtime/PanicScreen.cs | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Capy64/Assets/bios.lua b/Capy64/Assets/bios.lua index 0410836..21918ea 100644 --- a/Capy64/Assets/bios.lua +++ b/Capy64/Assets/bios.lua @@ -96,19 +96,15 @@ local function printError( text ) end local function hget(url, headers) - local requestId = http.requestAsync(url, nil, headers, {binary = true}) + local response, err = http.requestAsync(url, nul, headers, {binary = true}):await() - local ev, rId, par, info - repeat - ev, rId, par, info = event.pull("http_response", "http_failure") - until rId == requestId - - if ev == "http_failure" then - return nil, par + if not response then + return nil, err end - local content = par:read("a") - par:close() - return content, info + + local content = response.content:read("a") + response.content:close() + return content, response end local function promptKey() diff --git a/Capy64/Runtime/PanicScreen.cs b/Capy64/Runtime/PanicScreen.cs index 1362a57..a8f4204 100644 --- a/Capy64/Runtime/PanicScreen.cs +++ b/Capy64/Runtime/PanicScreen.cs @@ -28,7 +28,7 @@ public class PanicScreen Term.ForegroundColor = ForegroundColor; Term.BackgroundColor = BackgroundColor; Term.SetCursorBlink(false); - Term.SetSize(53, 20); + Term.SetSize(57, 23); Term.Clear(); var title = " Capy64 ";