s-macke / jor1k

Online OR1K Emulator running Linux
http://jor1k.com
BSD 2-Clause "Simplified" License
1.73k stars 193 forks source link

3D rendering support (edited from: Can it run Minecraft?) #172

Open Alex-A137 opened 2 years ago

Alex-A137 commented 2 years ago

can it run minecraft

iocmet commented 2 years ago

i cant install java it says ./java: cannot execute binary file: Exec format error :(((((((((( i really want to play minecraft on this((

benjamincburns commented 2 years ago

I think it's possible, but it would take a large, large amount of work. The official game would definitely be a struggle too, as it likely would need OpenGL or Vulkan. Jor1k doesn't have any kind of emulated GPU support, so they'd need to be set up with a software rendering pipeline that writes to the framebuffer device.

If anyone would actually want to take this on, you'd want to start off by getting an OR1K toolchain running in a proper dev environment. You'll then want to go through and test each dependency one-by-one until the whole thing works.

If you wanted decent graphics support, you'd probably also want to look into writing a custom mesa driver that could render to WebGL.

Alternatively, you could also try hacking together a WASM build of the LLVMPipe driver. That code would run natively in the browser, so there'd be no emulation overhead, but it'd still be software rendering. You'd of course still need to add a custom device and mesa driver shim to jor1k however, so that processes within jor1k had some way to communicate with it.

You could also try LLVMPipe within jor1k, but you'd need to build your own OR1K-hosted llvm, which is likely going to be a challenge all to itself, as I don't know if there are any well-maintained OR1K LLVM backend implementations. You might try searching forks of skristiansson/llvm-or1k to see if you can find one.

Suffice to say, it'd be a lot of work. You'd probably have more success and less frustration with a minimal minecraft clone that can run as a statically-linked build w/ its own software rasterization.

iocmet commented 1 year ago

Btw my comment from 2022 is joke

benjamincburns commented 1 year ago

FWIW, I understood that to be the case, but having 3D acceleration via mesa and co has been something I've thought about for a while. I figured it was worth writing it up in case it piques someone's interest. As I understand it, something piquing someone's interest has been the primary driver behind pretty much every major development on this project.