Commit Graph

98 Commits

Author SHA1 Message Date
13fc83b20b we now have a coding guide 2026-04-01 19:45:59 +02:00
shorekeeper
8d37628ae7 Fix Windows build and several cross-platform bugs
Cross-platform bugs:

- ncomplib.c: fseek was called as fseek(f, whence, offset) instead of
  fseek(f, offset, whence). Seeks only worked correctly when offset
  happened to numerically equal a valid whence constant.

- neonucleus.c: nn_realloc passed memory pointer instead of ctx to
  nn_alloc in the NULL and sentinel paths. Any call with memory=NULL
  dereferences NULL as a context struct and crashes. Confirmed by
  test_realloc.c which crashes before fix and passes after.

- neonucleus.h: NN_TiB was defined as (1024 * NN_TiB), referencing
  itself. Fixed to ((size_t)1024 * NN_GiB).

- luaarch.c: unicode functions were registered on the component Lua
  table instead of the unicode table. Wrong stack index variable was
  used in all five lua_setfield calls.

- neonucleus.c: NN_ATOMIC_NONE versions of nn_incRef/nn_decRef took
  1 argument but were called with 2 everywhere. Added the missing
  size_t n parameter.

Windows build:

- neonucleus.c: NN_LOCK_CREATE in NN_THREAD_WINDOWS was missing a
  return statement, falling through into NN_LOCK_DESTROY and
  immediately closing the freshly created mutex handle.

- ncomplib.c: Added Windows implementations for opendir, readdir,
  closedir, stat, mkdir and directory removal using FindFirstFileA,
  FindNextFileA, _stat, _mkdir and _rmdir.

- main.c: Fall back to USERNAME env var when USER is not set.

- neonucleus.h: Added NN_VLA macro. Expands to a plain VLA on
  GCC/Clang, uses _alloca on MSVC. Applied in luaarch.c and
  neonucleus.c where VLAs were used.

- neonucleus.h: Added NN_INIT macro. Expands to a compound literal
  cast on GCC/Clang, expands to nothing on MSVC which does not
  support compound literals as constant initializers at file scope.
  Applied to all global struct initializers in neonucleus.c.

- neonucleus.c: Auto-define NN_ATOMIC_NONE on MSVC in C mode since
  MSVC does not provide stdatomic.h outside of C++ mode.
2026-04-01 19:18:00 +03:00
3f6ef63737 small rework 2026-04-01 14:40:12 +02:00
d95726cbf6 slight bugfix and work on drive 2026-04-01 12:34:57 +02:00
917427c2e1 initial work on GPU 2026-03-31 14:43:10 +02:00
5c854e5c4a extremely primitive screen impl 2026-03-30 23:25:56 +02:00
6086208879 more complete fs impl 2026-03-30 18:05:16 +02:00
b39e379e95 eeprom stuff 2026-03-29 23:23:38 +02:00
d7ca929a5f a useful option 2026-03-29 20:31:58 +02:00
37cc73a21c huge progress on ncomplib 2026-03-29 19:50:16 +02:00
30547b2dc8 reworking a large part of the architecture 2026-03-28 22:38:00 +01:00
e2c30afde5 made the API more complete 2026-03-19 16:33:24 +01:00
23e02652d7 strcmp warfare 2026-03-18 18:57:06 +01:00
3045a86cd9 fixed simplifyPath 2026-03-16 21:57:18 +01:00
841241833d hashmapification 2026-03-16 12:48:37 +01:00
9c1062c076 bugfixes and a temporary optimization
indirect is way too aggressive. It needs to be reworked
2026-03-15 22:32:35 +01:00
59f7dd1492 erase the old version 2026-03-15 18:22:01 +01:00
6e58a20200 nn_intptr_t to nn_integer_t 2025-07-31 23:33:49 +02:00
a0bd37a213 progress on external computers 2025-07-31 16:41:04 +02:00
16127040f4 implemented some useful functions 2025-07-30 22:48:27 +02:00
d1ad9d0be3 changes 2025-07-30 21:49:34 +02:00
be89f6a960 minor changes 2025-07-29 19:01:34 +02:00
93206a536d completed device info 2025-07-29 17:39:38 +02:00
9e33d5a1d2 device info 2025-07-29 16:41:22 +02:00
cd02f31368 tunnels 2025-07-28 20:20:34 +02:00
b7ddf9c34e minor changes to the serialization process 2025-07-28 19:03:22 +02:00
6a90d6306d color mapping changes 2025-07-26 16:45:08 +02:00
eb6037ee27 minor changes 2025-07-26 14:11:56 +02:00
905a5a25fa started hologram 2025-07-25 23:28:29 +02:00
0c3a3f0d75 disk drives and resources 2025-07-25 18:10:16 +02:00
0d9a59bfc7 VRAM buffers! 2025-07-24 19:09:16 +02:00
9320a19d1c tmpfs loading an image 2025-07-23 12:58:18 +02:00
b25f830f3b VRAM progress and fixed a dumb Windows-only issue 2025-07-22 19:20:45 +02:00
b30a180c90 actually finished loopback modems 2025-07-20 17:26:05 +02:00
2cd485b355 loopback modems 2025-07-20 15:28:16 +02:00
820e63aa83 initial progress on modems 2025-07-19 01:23:57 +02:00
bb61776b44 tmpfs is almost fully done 2025-07-18 14:06:43 +02:00
361c1b29e3 reworked how methods are defined 2025-07-17 21:23:38 +02:00
4581c59f4d more work on fs
NOTE: tree / broke again
2025-07-16 16:41:10 +02:00
8e59ab6070 work on some fs stuff 2025-07-15 21:45:34 +02:00
bb45b99e8a enabled stricter warnings and improved error handling in eeproms 2025-07-15 18:54:44 +02:00
3d5c8f2bfc early work on modems 2025-07-13 19:57:17 +02:00
db28d03f3c work on modems 2025-07-13 15:27:15 +02:00
79e9a8ac2f progress on volatileFilesystem and fixed a file descriptor leak 2025-07-13 13:31:26 +02:00
64a6b84b30 unicode now allows invalid unicode 2025-07-13 11:58:25 +02:00
2621554165 stuff 2025-07-12 21:09:39 +02:00
aa8bdfb88c volatile stuff 2025-07-12 19:22:49 +02:00
863e04f19e the sound of progress
- Medic TF2
2025-07-12 18:42:38 +02:00
af1244b829 improved filesystem interface 2025-07-12 16:29:48 +02:00
d9670610f8 improved EEPROM system 2025-07-12 13:13:46 +02:00