Compare commits

...

2 Commits

Author SHA1 Message Date
2b09e5a4f0 frostos works 2026-05-01 14:44:15 +03:00
6834318639 scrolling events 2026-05-01 14:27:29 +03:00
3 changed files with 19 additions and 5 deletions

View File

@@ -1,7 +1,6 @@
# For MVP functionality # For MVP functionality
- fix coloring issue in UlOS 2 beta 5 (and in OpenOS `dmesg`, it appears color-mapper is wrong) - fix coloring issue in UlOS 2 beta 5 (and in OpenOS `dmesg`, it appears color-mapper is wrong)
- fix FrostOS crash due to empty syscalls table (unsure what is happening)
- make `computer` component use callbacks - make `computer` component use callbacks
- make a lot of stuff which likely will need to be indirect actually be indirect (modem comms, computer funcs) - make a lot of stuff which likely will need to be indirect actually be indirect (modem comms, computer funcs)
- make beeps, power, etc. be callbacks on one shared local state (computer environment) - make beeps, power, etc. be callbacks on one shared local state (computer environment)

View File

@@ -187,7 +187,7 @@ end
function computer.pullSignal(timeout) function computer.pullSignal(timeout)
timeout = timeout or math.huge timeout = timeout or math.huge
timeout = math.max(timeout, 0.05) timeout = math.max(timeout, 0.001)
local deadline = computer.uptime() + timeout local deadline = computer.uptime() + timeout
while true do while true do
if computer.uptime() >= deadline then return end if computer.uptime() >= deadline then return end
@@ -286,7 +286,13 @@ sandbox = {
rawlen = rawlen, rawlen = rawlen,
rawset = rawset, rawset = rawset,
select = select, select = select,
setmetatable = setmetatable, setmetatable = function(t, meta)
if type(meta) == "table" then
-- nope
rawset(meta, "__gc", nil)
end
return setmetatable(t, meta)
end,
tonumber = tonumber, tonumber = tonumber,
tostring = tostring, tostring = tostring,
type = type, type = type,
@@ -308,8 +314,8 @@ sandbox = {
debug = { debug = {
getinfo = debug.getinfo, getinfo = debug.getinfo,
traceback = debug.traceback, traceback = debug.traceback,
getlocal = debug.getlocal, getlocal = function(...) return (debug.getlocal(...)) end,
getupvalue = debug.getupvalue, getupvalue = function(...) return (debug.getupvalue(...)) end,
print = debug.print, print = debug.print,
}, },

View File

@@ -6,6 +6,7 @@
#include "neonucleus.h" #include "neonucleus.h"
#include "ncomplib.h" #include "ncomplib.h"
#include "glyphcache.h" #include "glyphcache.h"
#include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -494,6 +495,7 @@ int main(int argc, char **argv) {
nn_mountComponent(c, testDrive, 4, false); nn_mountComponent(c, testDrive, 4, false);
nn_mountComponent(c, testFlash, 5, false); nn_mountComponent(c, testFlash, 5, false);
int ltx = 0, lty = 0; int ltx = 0, lty = 0;
double scrollBuf = 0;
while(true) { while(true) {
if(WindowShouldClose()) break; if(WindowShouldClose()) break;
@@ -555,9 +557,14 @@ int main(int argc, char **argv) {
if(ltx != tx || lty != ty) { if(ltx != tx || lty != ty) {
ltx = tx; ltx = tx;
lty = ty; lty = ty;
//scrollBuf = 0;
nn_pushDrag(c, scraddr, tx, ty, 0, player); nn_pushDrag(c, scraddr, tx, ty, 0, player);
} }
} }
if(fabs(scrollBuf) >= 1) {
nn_pushScroll(c, scraddr, tx, ty, scrollBuf, player);
scrollBuf = 0;
}
} }
} }
@@ -578,6 +585,8 @@ int main(int argc, char **argv) {
EndDrawing(); EndDrawing();
scrollBuf += GetMouseWheelMove();
// keyboard input // keyboard input
// 1: clipboard // 1: clipboard