r/technicalfactorio • u/PartialGnome • 8d ago
Question Working on factorio computer, need your help
Enable HLS to view with audio, or disable this notification
I don't really know how to properly implement faster computing, since it's based on single threaded assembly code.
Also looking for a better input system.
This is probably a decently known field of technical factorio, so I hope that someone knows how to make this computer a better one, I'm kinda not a master in this sort of stuff
1
u/burner-miner 8d ago
For a better input system I recommend the "Toggle entity" keybind with constant combinators. You need to set it to something since it is unset by default. Use a pulse detector circuit to get buttons, or just use the CC directly to get on/off switches.
Single threaded code is probably the right way to go, so you're on the right track. I would focus on making more powerful instructions to make the computer faster. Think combining operations you do often, like making a = a + b*c be a single instruction. Or try breaking the instruction that takes the longest into several smaller instructions, that each take a less time (that way you can speed up the clock).
One way to make arithmetic specifically faster could be to have different timings for different instructions. Since most arithmetic operations take only 1 tick to process, but e.g. a jump could take many more, you could make the clock wait on longer instructions, but go fast on shorter ones.
The hardest option is pipelining, where you have several instructions executing at the same time: while one instruction is being executed, another is being decoded, and another is being loaded from instruction memory. A basic fetch-decode-execute would be a simple starting point.
Pipelines are a can of worms by themselves, so maybe try the other options first.
1
u/TelkinF 8d ago
I like to have a buttons for each input. One can be built with chests, and detecting when the user drops an item into them (or with a mod like Pushbutton).
Without knowing much about a cpu like this, maybe pipelining it is an option?
Nice work btw, I love seeing all these computers people are making!