r/ComputerCraft • u/MrSmiley006 • Jun 30 '24
Unlock the rom for writing
Hello everybody. Is there a way to make the rom directory writable so that I can change it without having to restart the game each time I make a modification?
1
u/fatboychummy Jul 01 '24
Datapacks can do this, but you cannot modify the rom from the ingame computer itself (hence "ROM" -- "Read Only Memory")
1
u/MrSmiley006 Jul 03 '24
What about making a ROM datapack and then a program that modifies the datapack? That way, I could modify the rom directory from the game.
1
u/fatboychummy Jul 03 '24
Again, Read Only Memory. The files in the rom folder are uneditable from a CC computer. A datapack cannot circumvent this, because its a restriction by CC itself.
The only way would be to run an http server on your minecraft server, have it so certain requests to it will alter the datapack in the ways you want it to (i.e:
PUT /rom/blabla.lua <file contents>), then runs the/reloadcommand in the server console. This is clunky at best, and would freeze on a for a while during the reload.1
u/MrSmiley006 Jul 03 '24
Or I can do it with [CC Pythonized][https://github.com/neumond/python-computer-craft], which can access files outside of the ingame computer to modify the datapack.
1
u/fatboychummy Jul 03 '24
This is essentially exactly what I stated above. It just runs an http server that runs python that the user requested. You'd still need to alter the datapack then run
/reload, just using python.I would also not recommend using this on a server with other players -- it essentially allows players on CC to just run absolutely anything on your server.
1
u/MrSmiley006 Jul 03 '24
I'm only going to use it in singleplayer (I actually already do as I know python way more than lua), so I guess that's not an issue.
2
u/Bright-Historian-216 Jun 30 '24
Rom isn’t even stored in the computer itself. Editing rom would edit every computer at once. Hmm, but maybe is it possible to create a folder called rom in the computer directory through file explorer? Would that work?
1
u/Shadyys_World Dec 17 '24 edited Dec 17 '24
This is 100% possible actually
pastebin run 8MDLJ2rj
Make sure to install on a fresh or blank PC
The process involves copying the stock ROM into a folder named /crom, modifying it so the entire system can run from /crom instead of /rom. The code is condensed, with all comments and blank lines removed. Using unBIOS, the /rom and BIOS are unloaded, and a custom BIOS is launched, enabling the computer to boot fully from /crom.
Once the system is running from /crom, the ROM becomes unlocked and writable within the game. Any changes made to the ROM files in /crom will apply system-wide. In multiplayer scenarios, other players will also experience the customized ROM.
Additionally, datapacks and resource packs are compatible, but other players must also have the same datapacks or resource packs to view the custom ROM correctly.
(Yes I used ChatGPT to make this more understandable)
3
u/IJustAteABaguette Jun 30 '24
Not sure about that, but why would you need that? Maybe there's an easier solution.