some stuff

This commit is contained in:
2026-03-15 22:51:09 +01:00
parent 9c1062c076
commit 83fd3ba2c8
3 changed files with 13 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
# For MVP functionality
- stop doing linear scans and do hashmaps smh (ls /dev is awfully slow and this MIGHT be why)
- volatile filesystem
- device info

View File

@@ -65,7 +65,11 @@ function component.list(ctype, exact)
return desired
end
local allInvoks = 0
function component.invoke(address, method, ...)
allInvoks = allInvoks + 1
print(allInvoks)
local t = {pcall(cinvoke, address, method, ...)}
if computer.energy() <= 0 then sysyield() end -- out of power
if computer.isOverused() then sysyield() end -- overused

View File

@@ -769,7 +769,7 @@ nn_Computer *nn_createComputer(nn_Universe *universe, void *userdata, const char
c->desiredArch.name = NULL;
c->archState = NULL;
c->totalCallBudget = 1000;
c->totalCallBudget = 50000;
c->callBudget = c->totalCallBudget;
c->componentCap = maxComponents;
@@ -2221,15 +2221,15 @@ nn_ComponentState *nn_createEEPROM(nn_Universe *universe, const nn_EEPROM *eepro
{"getDataSize", "function(): number - Get the storage capacity of the EEPROM data.", NN_DIRECT},
{"getLabel", "function(): string - Get the EEPROM label", NN_INDIRECT},
{"setLabel", "function(label: string): string - Set the EEPROM label and return what was actually set, which may be truncated.", NN_INDIRECT},
{"get", "function(): string - Get the current EEPROM contents.", NN_INDIRECT},
{"getData", "function(): string - Get the current EEPROM data contents.", NN_INDIRECT},
{"set", "function(data: string) - Set the current EEPROM contents.", NN_INDIRECT},
{"setData", "function(data: string) - Set the current EEPROM data contents.", NN_INDIRECT},
{"getArchitecture", "function(): string - Get the current EEPROM architecture intended.", NN_INDIRECT},
{"setArchitecture", "function(data: string) - Set the current EEPROM architecture intended.", NN_INDIRECT},
{"get", "function(): string - Get the current EEPROM contents.", NN_DIRECT},
{"getData", "function(): string - Get the current EEPROM data contents.", NN_DIRECT},
{"set", "function(data: string) - Set the current EEPROM contents.", NN_DIRECT},
{"setData", "function(data: string) - Set the current EEPROM data contents.", NN_DIRECT},
{"getArchitecture", "function(): string - Get the current EEPROM architecture intended.", NN_DIRECT},
{"setArchitecture", "function(data: string) - Set the current EEPROM architecture intended.", NN_DIRECT},
{"isReadOnly", "function(): boolean - Returns whether the EEPROM is read-only.", NN_DIRECT},
{"makeReadonly", "function(checksum: string) - Makes the EEPROM read-only, this cannot be undone.", NN_INDIRECT},
{"getChecksum", "function(): string - Returns a simple checksum of the EEPROM's contents and data.", NN_INDIRECT},
{"getChecksum", "function(): string - Returns a simple checksum of the EEPROM's contents and data.", NN_DIRECT},
{NULL, NULL, NN_INDIRECT},
};
nn_ComponentState *t = nn_createComponentState(universe, "eeprom", state, methods, nn_eeprom_handler);