Revert to master

This commit is contained in:
zenith391 2020-06-19 00:09:39 +02:00
parent 9d5182abc1
commit 13b763995c
3 changed files with 1 additions and 65 deletions

View File

@ -1,13 +1,6 @@
OCEmu - OpenComputers Emulator 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 Installation
------------ ------------
@ -95,6 +88,3 @@ If you want to use a custom path (for example, for running multiple machines wit
cd src cd src
lua boot.lua /path/to/my/emulated/machine_a 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.

View File

@ -55,16 +55,5 @@ function env.os.date(format, ...)
if format:sub(1, 1) == "!" then if format:sub(1, 1) == "!" then
format = format:sub(2) format = format:sub(2)
end end
local ok, err = pcall(function(format, ...) return os.date(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
end end

View File

@ -96,10 +96,6 @@ if settings.components == nil then
config.set("emulator.components",settings.components) config.set("emulator.components",settings.components)
end end
if settings.profiler then
end
local maxCallBudget = (1.5 + 1.5 + 1.5) / 3 -- T3 CPU and 2 T3+ memory local maxCallBudget = (1.5 + 1.5 + 1.5) / 3 -- T3 CPU and 2 T3+ memory
machine = { machine = {
@ -109,7 +105,6 @@ machine = {
totalMemory = 2*1024*1024, totalMemory = 2*1024*1024,
insynccall = false, insynccall = false,
} }
--maxCallBudget = 0.0--5
function machine.consumeCallBudget(callCost) function machine.consumeCallBudget(callCost)
if not settings.fast and not machine.insynccall then if not settings.fast and not machine.insynccall then
@ -378,43 +373,8 @@ elsa.filesystem.load("apis/component.lua")(env)
config.save() 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() function boot_machine()
-- load machine.lua -- 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") local machine_data, err = elsa.filesystem.read("lua/machine.lua")
if machine_data == nil then if machine_data == nil then
error("Failed to load machine.lua:\n\t" .. tostring(err)) 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 elseif elsa.timer.getTime() >= machine.deadline then
resume_thread() resume_thread()
end end
if settings.profiler then
draw_profiler_window()
end
end end