And I'm not just talking about putting an emulator in a specially designed box, you could obviously do such a thing. Rather, what I'm talking about is having all of the consoles hardware implemented in discrete logical chips, effectively removing the "fantasy" from the phrase "fantasy console". This might sound like a daunting, if not impossible task, but I have reason to believe it is quite possible!
You see, the official implementation of the Lua programming language doesn't just interpret it's source code by analyzing the program tree. Rather, it compiles it into a bytecode which is then emulated as a virtual machine. In fact, this virtual machine is the reason why some code takes longer to run than other code, because the program is also emulating the amount of time the CPU needs to process it.
With this in mind, it seems like it should be entirely possible to create a physical version of one, assuming that a Lua bytecode CPU actually existed. Slap it together with some RAM and a BIOS, and a surprising form of merchandise just might be born! What some of your thoughts?
"In fact, this virtual machine is the reason why some code takes longer to run than other code" <-- this is not quite correct.
Having a virtual machine makes code in general take longer, due to the need for an interpreter loop, but the choice to make some things take longer is a separate and deliberate one. This is demonstrated by the fact that standard Lua is fast enough to run modern styles of games with.
Beyond that, I think it's naive to assume the bytecode helps make a physical version easier. The reason for the bytecode is because parsing raw tokens would be ungodly slow. However, pico-8 is based on Lua 5.2, which includes among its opcodes an instruction to prep a generic for loop and an instruction to go through with a generic for loop. I've only seen a bit of what the world of chip design is like, and I doubt those instructions would be the hardest instructions to make chips for (modern ALU's are like magic), but they don't seem like the types of instructions that normally get included when designing base machine instructions.
Beyond that, there's extra considerations that would need to be arbitrarily decided beyond the pico-8 specs. The biggest one I think would be whether to include a hard disk and/or a number of slots for physical cartridges. As far as I'm aware, real life consoles generally had 1 or 2 slots for cartridges/hard disks (the more obscure late 80's stuff got weird), but pico-8 doesn't have a limit on such things. As a result there are games like Poom that have as many as 20 cartridges.
Now, you mentioned both "RAM" and a "BIOS", but it's worth remembering that the latter isn't defined in the specs, nor in the program itself. pico-8 as released is the devkit. As such, there's also the question of if a physical console would also be the devkit version or a theoretical release version.
I think an actual device is possible, but you’d need to find the perfect hardware for the job. IMO an OS or kernel for a raspberry pi model would be your best bet, maybe running something like the pico8 command line to run games off a micro sd (and perhaps have a floppy slot as well)
[Please log in to post a comment]