From 13b763995c0a7d9d89bd884a371c544e5300d804 Mon Sep 17 00:00:00 2001 From: zenith391 Date: Fri, 19 Jun 2020 00:09:39 +0200 Subject: [PATCH] Revert to master --- README.md | 10 ---------- src/apis/os.lua | 13 +------------ src/main.lua | 43 ------------------------------------------- 3 files changed, 1 insertion(+), 65 deletions(-) diff --git a/README.md b/README.md index b3aafdd..fe98f68 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,6 @@ OCEmu - OpenComputers Emulator ============================== -# Features added compared to original -* 95% - (Optional) Filesystem size limitation -* 100% - Paste with mouse wheel -* TODO- Debugger mode. Useful for coding OSes -* TODO- Profiler -* TODO- Automatic unit tests - Installation ------------ @@ -95,6 +88,3 @@ If you want to use a custom path (for example, for running multiple machines wit cd src lua boot.lua /path/to/my/emulated/machine_a ``` - -## The fork on itself -The fork on itself is a update of the, now to seem, not working on project by gamax92. In this fork i'm going to try to fix all known bugs and to verify and add existing pull requests, and also treat issues on my own. diff --git a/src/apis/os.lua b/src/apis/os.lua index b08e057..3360439 100644 --- a/src/apis/os.lua +++ b/src/apis/os.lua @@ -55,16 +55,5 @@ function env.os.date(format, ...) if format:sub(1, 1) == "!" then format = format:sub(2) end - local ok, err = pcall(function(format, ...) - return os.date(format, ...) - end, format, ...) - if ok then - return err - else - if format == "*t" then - return {year=0,month=1,day=1,hour=0,min=0,sec=0,wday=1,yday=1,isdst=false} - else - return "No date" - end - end + return os.date(format, ...) end diff --git a/src/main.lua b/src/main.lua index b818636..16f2372 100644 --- a/src/main.lua +++ b/src/main.lua @@ -96,10 +96,6 @@ if settings.components == nil then config.set("emulator.components",settings.components) end -if settings.profiler then - -end - local maxCallBudget = (1.5 + 1.5 + 1.5) / 3 -- T3 CPU and 2 T3+ memory machine = { @@ -109,7 +105,6 @@ machine = { totalMemory = 2*1024*1024, insynccall = false, } ---maxCallBudget = 0.0--5 function machine.consumeCallBudget(callCost) if not settings.fast and not machine.insynccall then @@ -378,43 +373,8 @@ elsa.filesystem.load("apis/component.lua")(env) config.save() -local profilerWindow -local profilerWindowID -local profilerRenderer -local profilerTexture -local SDL = elsa.SDL - -local highdpi=(elsa.args.options.highdpi and 2 or 1) - -function draw_profiler_window() - SDL.setRenderTarget(profilerRenderer, ffi.NULL); - SDL.renderCopy(profilerRenderer, profilerTexture, ffi.NULL, ffi.NULL) - SDL.renderPresent(profilerRenderer) - SDL.setRenderTarget(profilerRenderer, profilerTexture); - -- Actually draw - -end - function boot_machine() -- load machine.lua - if settings.profiler then - profilerWindow = SDL.createWindow("OCEmu - Profiler", 0, 0, 400*highdpi, 200*highdpi, bit32.bor(SDL.WINDOW_SHOWN, SDL.WINDOW_ALLOW_HIGHDPI)) - if profilerWindow == ffi.NULL then - error(ffi.string(SDL.getError())) - end - profilerWindowID = SDL.getWindowID(profilerWindow) - SDL.setWindowFullscreen(profilerWindow, 0) - SDL.restoreWindow(profilerWindow) - SDL.setWindowSize(profilerWindow, 400*highdpi, 200*highdpi) - SDL.setWindowPosition(profilerWindow, 0, 0) - SDL.setWindowGrab(profilerWindow, SDL.FALSE) - profilerRenderer = SDL.createRenderer(profilerWindow, -1, SDL.RENDERER_TARGETTEXTURE) - SDL.setRenderDrawBlendMode(profilerRenderer, SDL.BLENDMODE_BLEND) - profilerTexture = SDL.createTexture(profilerRenderer, SDL.PIXELFORMAT_ARGB8888, SDL.TEXTUREACCESS_TARGET, 400, 200); - if profilerTexture == ffi.NULL then - error(ffi.string(SDL.getError())) - end - end local machine_data, err = elsa.filesystem.read("lua/machine.lua") if machine_data == nil then error("Failed to load machine.lua:\n\t" .. tostring(err)) @@ -516,7 +476,4 @@ function elsa.update(dt) elseif elsa.timer.getTime() >= machine.deadline then resume_thread() end - if settings.profiler then - draw_profiler_window() - end end