Creating A 6502 Microcontroller for Minecraft!
ฝัง
- เผยแพร่เมื่อ 12 พ.ค. 2024
- I am currently creating a mod for Minecraft that adds in a microcontroller into Minecraft. Inspired by The 8-Bit Guy and Ben Eaters' videos, this prompted me to use a 6502 processor as a core to manipulate Redstone signals in your game.
In this video, I am creating the "back-bone" (backend) for the mod in C++. Therefore, in the future, I will have code ready to deploy into Minecraft by bridging C++ code into Java.
Stay tuned for the second part of this mod development journey!
Try this out yourself: github.com/elmfrain/cnmcu-nan...
Discord: / discord
Thank you guys so much for everyone's interest! There are a lot of future plans for this mod, and I'll keep you guys updated on that.
Edit: The mod is officially released in its Alpha state, now you can try it yourself:
modrinth.com/mod/cnmcu
Discord: discord.gg/ThKw2sjJrC
This guy saw Computer Craft and said "Nah, that's too easy" xD
When you get bored of lua XD
@@elmferGoing from lua to emulating a CPU in minecraft is insane...
@@ngspace9829Nah, that's perfectly normal.
I miss redpower 2 with its computer running FORTH, I only know of two computer mods that is being maintained which is computer craft and open computers, both of which use lua
@@AlbySilly FORTH? lol, also there is a mod that adds a microcontroller that runs assembly
This is absolutely amazing!
-Microcontrollers and assembly
-Ben Eater
-Minecraft
This deserves more than 3.2k views
it now has doubke that
All my favourite things in one 😆
Deserves more then 200k views and subs
Is 27K Views enough?
If this could be made to optionally work with a mod like Project Red, then this baby could have up to 64 Redstone lines available to it.
4 pins is already 16^4 variations of input/output so you can get creative with such limitations.
If you want to go all binary (high/low) then sure 64 pins gonna help.
But 16^64 is I think a lil too much for what this mod / microcontroller can offer 💀
i would recommend a mod called project red to integrate with this
Yes
I wonder what uses this could have in actual minecraft. Autocrafter that can make any recipe?
you can already do that with new crafter block, also some mods have that functionality, like refined storage or AE2@@spacenoodles5570
You wouldn't even need to have another mod. A 6502 could be fabricated using the integrated circuits provided by that mod...
You should look up the 65el02 CPU, the 65el02 was in a mincraft mod many years ago in a mod called Redpower 2. Redpower 2 had tons of Redstone related stuff. In fact Redpower 2 is what ProjectRed is based off of. ProjectRed is redstone stuff from Redpower 2.
I can see this being used in a highschool class, amazing video!
Exactly! This is something I would like to have had before
This is amazing
How does this video only have 2 views? It's great!!
Thank you! Currently a small channel so probably that XD
@@elmfer Welp, you just got 3198 more
Dude you gotta continue, this is one of the best project ive seen in a while, keep at it!
I think this is VERY COOL! I would like to see this further developed as an independent project from Minecraft. Doing basic 6502 assembly on an emulator with similar functions to Minecraft is cool!
I was literally looking for a mod like this not even two months ago!! I'm really looking forward to this!
This is so cool!! I can't wait to see where this project goes in the future!
This is sick. Super underviewed
I have been a long time watcher of Ben Eaters content, He is the Jesus of computing.
Dude this is absolutely amazing! Building all this in a month is more than impressive... I have to agree, this channel deserves way more views
That was amazing to see, i wish i had the patience to get back to programming but my way of thinking makes me not very skilled at this. Amazing work and a really cool display of your skills
this is so cool!! really hope the algorithm picks this up
Dude I've been wanting to make something like this forever! Please don't give this up. I need this.
this is so cool, please keep working on it
I thought you were crazy, but what you did and tried to make it happen was amazing. I look forward to the great things you will do in the future.
This is totally awesome, you're so underrated!
awesome video and project, looking forward to this
i am excited. this combined with create will be amazing
this great stuff, you're sure to blow up man
I need this in my life man, well done!
This guy deserve 100k subscribers. Broo, you've earned my subscription, you earned it!!
Dude, amazing work.
Holy crap! This is incredible! I'm amazed you got all those separate libraries talking to each other, this is a complex issue! Bravo, I'm excited to see where this goes in the future. You've earned my subscription 10x over!
Thank you! It took alot of practice but it was worth it!
Is it going to only support vasm? Would it require an entire overhaul to use something like nasm? Or other assembly flavors?
this is awesome, and dear imgui makes it look even better
Amazing. I love projects like this. Very well done.
Thank you very much!
That's pretty frickin impressive man.
Wonderful video. Throughout the entire video I felt like I was on a call with a very good, passionate buddy. Keep rocking 🎸
Before you get super deep into that, make sure that the thread is synchronized correctly with the Minecraft threads. That way, when the game is paused or saved or whatever, you can keep track of the CPU state correctly and then restore it. That'll be really important.
For sure! I do have to take that into account, especially when the MCU goes out of view and back into view, all its state needs to be saved correctly
I think this is awesome! Super cool project
Thats a really cool project 👍👍
Such an amazing mod. The UI is incredible, such nice work! One idea that I think could add to the mod well is some kind of "Breakout" block, that gives the processor more IO to some extent. Maybe it could work placing a straight string of blocks on one of the processors axies.
Yeah for sure! I'd like to have that too, so I do plan to implement that functionality upon full-release
I love this mod! I'd find it to be a fun and beneficial way to learn for computer scientists!
This is amazing!
I watched for a full minute expecting an April Fools video, but he kept speaking seriously and I started worrying it was for real.
it is for real. this is confirmed awesome.
Unexpected plot twist XD
Eloraam did this years ago in RedPower, but it's nice to see people doing similar things all these years later!
You just reached 400 subs! Congrats
🎉
I love this! Thanks!
this is awesome dude, what a pro
For more usage, you could have a redstone input on the bottom as a clock cycle power input.
We need it ❤... Woud love to have this mod on Servers so you can code Minigames. 😊
this is awesome!!
Great video!! It looks like your channel is pretty new so i wanted to leave feedback. I found it hard to keep watching this at times as the pacing really struggled to stay consistent - be ruthless with the details you get across, even a technical video like this cant afford to get bogged down explaining things like redstone is like wires - we know! You are still very entertaining and i hope you keep making videos, ive subbed and look forward to whats next :)
Visuals were great by the way I loved seeing all the electronics creators!
Thank you! And thanks for the constructive criticism, I for sure need to know my target audience to set the level of detail and pace of my commentary
really nice to see projects like these. there is a mod in minetest that implements FPGAs, logic gates, and Lua-programmed microcontrollers (Mesecons), but something specific like signature processor architecture shows its unique legacy.
You are an amazing youtuber!
The original RedPower mod by Eloram back in the day had a 6502 based computer block, and a couple of disks you could get that ran on it - Direwolf20's run back then used the Forth one but I think there was also Basic, but as it was a full 6502 emulator, you could make your own disks with whatever you liked on them...
YES, I have been waiting so long for a mod similar to Computercraft that isnt Lua.
Congrats, hardware emulation is always super fun to code, and very impressive to watch !
For porting it to an actual Minecraft mod, you could also have used Java, as a JNI binding already exists for ImGui (imgui-java), I have used it in the past for the debugging UI of a GameBoy emulator, and it works like a charm.
It would probably also make the actual sync with the game a bit easier ?
I was originally going to code the entire UI in C++ and create a few bindings for it, but others suggested it will be a better developer experience to code the UI in Java rather than having to switch back and forth many times. I do agree on that, so I will definitely look into it.
very cool! one word of caution - GUIs sometimes are very picky about what thread they're run on. it might be challenging to get Minecraft's own gui to run alongside your GUI happily. May be worth investigating that and making a prototype before investing more time into it.
yeah, also minecraft's own gui code isn't too dissimilar from imgui so you might find it not too hard to work with by comparison?
We code in 6502 assembly at my uni, and I've been searching for this stuff on Minecraft out of fun. Imagine my surprise when I saw this video, good shit!
Yeah bro! This is intriguing stuff, I've always wanted to try out 6502 assembly in a cool way
Very cool! Besides the old RedPower 2 mod which had computers based on the 6502, there's also Open Computers which supports custom architectures besides the default Lua one. There's an implementation of the 6502 for OC, Thistle, but it looks like it's no longer maintained. It would be amazing to be able to program Minecraft computers with assembly, I always thought that the Lua computers don't really fit into Minecraft as they feel a bit too magical.
IIRC RP2 used Forth for it's computers.
@@thebloxxer22The computers actually used a variant of the 6502, I remember there being a webpage that lists all available instructions. Eloraam wrote (or maybe ported) Forth in 6502 assembly to run on the RP computers. I think she might have wanted to originally use Microsoft BASIC but couldn't get the licensing rights or something.
Ah yes, computercraft at home.
This is super cool, might be worth also looking into project red's processor thingies.
if you keep making videos like this, your channel will blow up :)
this channel is about to blow up isn't it
Thank you for share!
oh my goodness this is amazing. may the youtube algorithm be kind to you.
this is pretty good for prototyping cause i haven't found any simulators for chips like the 6502, pic, and the atmega328
Investing in this channel I love all your videos so far
That's incredibly cool! That would probably be a lot of afford, but a C Compiler inside of Minecraft for this processor would be really powerful, especially with more ports and some utitlity blocks!
For sure! That is definitely a must because you can use similar functions as when programming an Arduino in C which aids in development
I will be watching with interest to see how this develops, ComputerCraft is the mod I use when I have too, it is capable of doing so much.......problem is I use it so infrequently I basically need to re-learn it every time. So all the capabilities and easy to use would be great.
That's cool! I have a few more ideas. You could have some sort of cables in minecraft that would connect to the MCU and to something else, which would allow transfer much more data per tick than a regular redstone. If that would be possible, then you could add a display, connect it to the mcu and draw things on the display. Another thing that would be cool is to have a sensor that would read data about block or item, because more possible inputs and outputs -> more intersting stuff we can do with it.
Of course! This allows users to make more complex projects, so at some point I would like to add those features too
Super cool project
This is amazing
good stuff dude! any plan on open sourcing? i would love to contribute. this is really cool!
Of course! The program shown in the video will be published this week in a post. The mod will also be open-sourced under GNU GPLv3, but it is still in its very early stages so I won't publish yet until its first alpha release
That's so cool!!
It would be really cool if you had a "processor" block, where you can build the cpu how you want it, and do stuff with inputs and outputs there aswell
that's awesome. I've wanted to make something like this for so many years now. yours looks much better than my ideas, but this gives me inspiration to finally make something. I still wont finish it, but... great inspiration! actually, I do have a computer I made that does work, but it runs javascript, not 6502 assembly. it uses an item frame map to display the screen and does 20 fps. I made it for arcade games, for my backrooms project.
Awesome! Bro keep it up because that it actually interesting!
@@elmfersubbed, I look forward to seeing more from you 😀
edit: I assume what you made is a mod? because in vanilla minecraft you can't detect or output a redstone signal like you do in the video. sad this is the case, but there are workarounds. I've never made a client side mod, everything I make works with a vanilla client.
@@lorenzo42pYup! The program I showed in the video is a proof of concept, but I am currently migrating the code into a mod
Really cool! Think you could make some extendor blocks that would extend the number of faces you have to interfere with?
Sure thing! It is one of the features I'd like to add too
@@elmfer that would be super cool and could lead to many opportunities for automating systems! Can't wait to see what you accomplish
There used to be a computer back in 1.2.5 that had the 6502 microprocessor that was apart of the Redpower 2 mod.
Remember to share with us the entire memory map of this thing when you're done. I also noticed at the end of the video, that numbers in the cpu reg preview are prefixed with 0x (suggesting that №s are intended to be hex), but the numbers themselves are decimal
Yeah I had the intention to print out hex, but I ultimately forgot to format it correctly. But yeah the memory map, registers, and overviews of this MCU will be well documented
Very cool!
some constructive criticism: please dont cut the voice in the middle of saying a word, its kinda annoying (at least for me), but the vid was great !
Yup other has criticized that too, but no worries I will improve on it
This looks really cool actually. I have a minor interest in low level coding, and this looks like it'd be a beginner friendly way to learn it
You are really underrated
This is cool, good job
But 4 GPIO is kinda limited, consider making it a multiblock structure (like chests for example)
I can think of expanding it with several such controllers connected together, but it's not very convenient
it would be pretty cool if you could make a multiblock proccessor with more outputs! looking foward to this mod! :D
Of course! There will be more variants with more I/O and better specs
@@elmfer Glad to hear! Hope everything goes smoothly :D even though thats not the case with programming most of the time :D
Great video
awesome! keep it up! subscribed :)
Awesome, thank you!
I've seen other comments and there are great ideas, but i have idea myself maybe add cables ("Cable x1", "Cable x2", ..., "Cable x7", "Cable x8")(x + number means how many there are wires in a cable) and when connecting cable x7 to cable x8 you get the 7bits but when adding cable x1 next to that cable x8 you get the bit you lost when connecting the cable x7 (and the same with x7, x6, x5, x4, x3, x2) and the cables gave out 15 redstone value when bit is set and 0 when not set and maybe cables don't lose strength with each block they go
PS: I think my idea is cool, but i don't really know how to make Minecraft mods so just saying you do you
For bridging C++ and Java you could use Natives and then in Java use the native keyword in a void for example
cool! really cool!
I cant wait
That is quite the program, i would recommend adding blocks that are placed near the microcontroller which just give it more pins and give a higher level language for coding it than access because learning access is... you know. so that is all i've got i would wish for you to continue to do this and share a public mod for minecraft. Edit: i would also recommend a in-game ide that shows up when you right click on the microcontroller
For sure! In future, I was thinking of adding ability to code it in C just like coding an Arduino because assembly is kinda hard. Also, I do have plans for adding pins either by adding a bigger MCU or like what you said. The code editor shown at the end would be the UI that will be added to the mod
@@elmfercc65 compiler would be an idea. Another idea is having the pins displayed on a clock so that it displays pins 0-4 then 4-8 and so on before looping and the interfacing red stone can read these pins by ANDing the value with some sort of clock.
Gotcha, this is similar to memory banking that allows the 6502 to have access to more memory, but this would be used for the I/O registers instead
@@elmfer yea but you would need like something that prevents redstone from connecting when placed side by side or else it would get shorted out and wouldnt work
MY HERO, ive been using a mod called "redstone control", it's been totally abandoned though.
Yeah, I can see a direct emulation of a Attniy10 in Minecraft (Finally a mod that use assembly)
The window displaying the X register has a 0x prefix but a decimal output.
Hey there, you might want to look into the old Redpower 2 Mod for minecrafts older versions, it used a modified version of the 6502 and had a display and such.
Will do!
@@elmferthe modified version is known as the 65el02
Maybe make a mod that allows you to design redstone circuits, and then get a blueprint and produce it (using a simple process). It would also be useful if you added some other redstone gates (diode, waitless repeater, transistor, gates) Importing circuits from JSON files would also be nice. Imagine downloading a 386!
Sheesh, imagine! That would be cool! There is a mod that allows you to make redstone circuits though, I suggest looking at the Super Circuit Maker mod
Pretty sure there are already implementations of a HDL like concept but for minecraft, it translates code into Redstone schematics
I presume that compatibility with 65EL02 is not planned? Most of the RedPower2 programs were probably written in FORTH but there must be some in assembly programs still floating around and would be cool to see those old codes working in more modern Minecraft than 1.4
Not yet, I do plan to integrate this with other mods though
Love it
GET THIS MAN TO 1K-2K SUBSCRIBERS HE NEEDS MORE
pretty cool mod btw!!!!! i've actually tried making a 6502 emulator myself in lua without any other libraries. can't wait for the release of this mod
the commodore 64 uses an special version with the number 6510
It’s just a slightly modified version, not very special.
That
Is
Amazing
WTF
I WANT IT
NO
I NEED IT.
I'm looking forward to part 2 so muuuuch please this is amazing
Don't worry dude! I want this as much as you dude!
I mean this is Awesome! But I think only 4 I/O it's a bit limited, you could Add an IO expander or something maybe a bus wire that can talk to other peripherals
Yeah your right! Others have also recommended an I/O expander too, so that is definitely a feature I want to add for release.
@@elmfer thats Great man
Awesome
This is prettry cool
Joooooo, this is so cool