Commit Graph

229 Commits

Author SHA1 Message Date
shorekeeper
d41e110cdf Fix some GPU bugs and add clamping 2026-04-03 00:44:00 +03:00
3e5a979331 2 more coding rules 2026-04-02 23:30:20 +02:00
a2069eea74 minor tweaks 2026-04-02 21:26:38 +02:00
97a2e34f2e realtime clock 2026-04-02 15:37:01 +02:00
ac2a05efdb MSVC is horrendous 2026-04-02 15:19:51 +02:00
a6a31d2b64 that wasnt meant to be there 2026-04-02 10:57:48 +02:00
13fc83b20b we now have a coding guide 2026-04-01 19:45:59 +02:00
shorekeeper
3943b7d584 push unicode changes lol 2026-04-01 19:28:15 +03: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
9291d81d41 small tweak 2026-03-31 18:54:19 +02:00
2a31dc838d perfectly accurate fs
turns out, file cost is 0 for loot disks, so there was never an actual
discrepancy
2026-03-31 18:00:18 +02:00
917427c2e1 initial work on GPU 2026-03-31 14:43:10 +02:00
76b14524c5 more work on FS 2026-03-31 13:13:11 +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
2b72e47ba5 mkdir 2026-03-30 11:42:28 +02:00
ad76ae2375 completed veeprom implementation 2026-03-30 11:22:20 +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
d5622d8009 bugfixes 2026-03-19 18:58:29 +01:00
1a6a008331 minor fixes 2026-03-19 18:48:58 +01:00
b1fc23ab5a made the default call budget more realistic 2026-03-19 16:43:39 +01:00
a6b5a52723 made it match OC more 2026-03-19 16:34:55 +01:00
e2c30afde5 made the API more complete 2026-03-19 16:33:24 +01:00
f1c7fe6cdf small fix 2026-03-19 10:23:41 +01:00
aaa91a8d94 bugfix 2026-03-18 20:18:28 +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
bb1307900a initial work on a hashmap 2026-03-16 00:36:03 +01:00
83fd3ba2c8 some stuff 2026-03-15 22:51:09 +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
9c2c90d8e6 fixed a doc bug 2025-12-03 11:44:01 +01:00
b46c6f6dc8 fixed a massive bug 2025-10-01 16:53:49 +02:00
d9ec88dd51 removed debug thing 2025-08-01 15:18:57 +02:00
4bf2ec40a9 oops 2025-08-01 01:35:09 +02:00
8b9029e687 oops 2025-08-01 00:42:59 +02:00
6e58a20200 nn_intptr_t to nn_integer_t 2025-07-31 23:33:49 +02:00
f868465f88 yet another segfault fixed 2025-07-31 23:00:11 +02:00
6c30b81b9e oops 2025-07-31 22:57:48 +02:00
3cc5c162b4 oops, forgot something 2025-07-31 16:47:29 +02:00
a0bd37a213 progress on external computers 2025-07-31 16:41:04 +02:00
4bcafba98a experimental new beeps 2025-07-30 23:11:46 +02:00
16127040f4 implemented some useful functions 2025-07-30 22:48:27 +02:00
9913af75f1 experimental implementation of very unsafe function
this needs to be heavily audieted
2025-07-30 22:29:45 +02:00