11_G ._OSNAME = " miniOS"
2- _G ._OSVER = " 0.6.1.2 "
2+ _G ._OSVER = " 0.6.1.3 "
33_G ._OSVERSION = _OSNAME .. " " .. _OSVER
44
55-- component code
@@ -14,7 +14,7 @@ local primaries = {}
1414-- component.getPrimary("modem").open(123), which may be nicer to read.
1515setmetatable (component , { __index = function (_ , key )
1616 return component .getPrimary (key )
17- end })
17+ end })
1818
1919function component .get (address , componentType )
2020 checkArg (1 , address , " string" )
@@ -542,7 +542,8 @@ function fs_code()
542542 local drive , handle , proxy
543543 drive , path = fs .drive .drivepathSplit (file )
544544 proxy = fs .drive .letterToProxy (drive )
545- handle = proxy .open (path , mode or ' r' )
545+ handle , reason = proxy .open (path , mode or ' r' )
546+ if not handle then return nil , reason end
546547 return {_handle = handle , _proxy = proxy }
547548 end
548549 function fs .write (handle , data ) return handle ._proxy .write (handle ._handle , data ) end
@@ -651,8 +652,16 @@ function terminal_code()
651652 local term = {}
652653 local cursorX , cursorY = 1 , 1
653654 local cursorBlink = nil
654-
655+ --- quick and dirty hacks that allow newer programs to run while not actually writing new code
655656 term .gpu = function () return component .gpu end
657+ term .getViewport = function () return 0 , 0 , component .gpu .getResolution () end
658+ term .getGlobalArea = function (ignored )
659+ local w ,h ,dx ,dy = term .getViewport (window )
660+ return dx + 1 ,dy + 1 ,w ,h
661+ end
662+ term .pull = event .pull
663+ term .keyboard = function () return component .keyboard end
664+ term .screen = function () return term .gpu ().getScreen () end
656665
657666 local function toggleBlink ()
658667 if term .isAvailable () then
0 commit comments