diff --git a/src/main/resources/assets/opencomputers/loot/openos/lib/core/lua_shell.lua b/src/main/resources/assets/opencomputers/loot/openos/lib/core/lua_shell.lua index 12cf51f94..ab07bd6a3 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/lib/core/lua_shell.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/lib/core/lua_shell.lua @@ -116,15 +116,12 @@ while term.isAvailable() do else local ok, why = pcall(function() for i = 2, result.n do - io.write(require("serialization").serialize(result[i], true) .. "\t") + io.write(require("serialization").serialize(result[i], true), i < result.n and "\t" or "\n") end end) if not ok then io.stderr:write("crashed serializing result: ", tostring(why)) end - if term.getCursor() > 1 then - io.write("\n") - end end else io.stderr:write(tostring(reason) .. "\n") diff --git a/src/main/scala/li/cil/oc/server/component/GraphicsCard.scala b/src/main/scala/li/cil/oc/server/component/GraphicsCard.scala index e9ba824ad..eea6bc4c8 100644 --- a/src/main/scala/li/cil/oc/server/component/GraphicsCard.scala +++ b/src/main/scala/li/cil/oc/server/component/GraphicsCard.scala @@ -70,8 +70,12 @@ class GraphicsCard(val tier: Int) extends prefab.ManagedEnvironment with DeviceI final val setCosts = Array(1.0 / 64, 1.0 / 128, 1.0 / 256) final val copyCosts = Array(1.0 / 16, 1.0 / 32, 1.0 / 64) final val fillCosts = Array(1.0 / 32, 1.0 / 64, 1.0 / 128) - final val bitbltCosts = Array(32, 16, 8) - final val totalVRAM: Int = (maxResolution._1 * maxResolution._2) * Settings.get.vramSizes(0 max tier min Settings.get.vramSizes.length) + // These are dirty page bitblt budget costs + // a single bitblt can send a screen of data, which is n*set calls where set is writing an entire line + // So for each tier, we multiple the set cost with the number of lines the screen may have + // Additionally, we multiply by 4 for the packet size which is generally 4x larger than a set call + final val bitbltCosts = Array(setCosts(0) * 16 * 4, setCosts(1) * 25 * 4, setCosts(1) * 50 * 4) + final val totalVRAM: Int = (maxResolution._1 * maxResolution._2) * Settings.get.vramSizes(0 max tier min Settings.get.vramSizes.length) * 1000 // ----------------------------------------------------------------------- // @@ -208,7 +212,7 @@ class GraphicsCard(val tier: Int) extends prefab.ManagedEnvironment with DeviceI // rasterizing to the screen has the same cost as copy (in fact, screen-to-screen blt _is_ a copy dst match { case _: GpuTextBuffer => 0 - case _ => Settings.get.gpuCopyCost / (maxResolution._1 * maxResolution._2) + case _ => Settings.get.gpuCopyCost } }