diff --git a/src/machine.lua b/src/machine.lua index df605b8..777e755 100644 --- a/src/machine.lua +++ b/src/machine.lua @@ -187,7 +187,7 @@ end function computer.pullSignal(timeout) timeout = timeout or math.huge - timeout = math.max(timeout, 0.05) + timeout = math.max(timeout, 0.001) local deadline = computer.uptime() + timeout while true do if computer.uptime() >= deadline then return end diff --git a/src/main.c b/src/main.c index 05b4552..3b0b8fd 100644 --- a/src/main.c +++ b/src/main.c @@ -6,6 +6,7 @@ #include "neonucleus.h" #include "ncomplib.h" #include "glyphcache.h" +#include #include #include #include @@ -494,6 +495,7 @@ int main(int argc, char **argv) { nn_mountComponent(c, testDrive, 4, false); nn_mountComponent(c, testFlash, 5, false); int ltx = 0, lty = 0; + double scrollBuf = 0; while(true) { if(WindowShouldClose()) break; @@ -555,9 +557,14 @@ int main(int argc, char **argv) { if(ltx != tx || lty != ty) { ltx = tx; lty = ty; + //scrollBuf = 0; 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(); + scrollBuf += GetMouseWheelMove(); + // keyboard input // 1: clipboard