A proof-of-conecpt application the emulates a 6502 based microcontroller for use in Minecraft. You are able to program the MCU in assembly and run the code in real-time with the help of vasm, a 6502 assembler. The MCU is able to interact with four redstone wires and handle interrupts.
- Emulation of a 6502 microcontroller.
- Control of MCU and four redstone wires connected to it.
- CPU and memory status display.
- Built code editor with syntax highlighting (sort-of).
- Ability to load and save code.
- Utilizes vasm to assemble code.
- Upload code to the MCU and run it in real-time.
- Official microcontroller documentation can be found here: CodeNode Microcontroller Documentation.
- Instruction set of the 6502: Ultimate Commodore 64 Reference.
- This application allows you to view a table of registers and memory locations:
Goto CodeNode Nano Demo
> Help
> Documentation
.
This works for most operating systems, but you need to have CMake installed.
First, clone the repository recursively:
git clone https://github.com/elmfrain/cnmcu-nano-demo.git --recursive
Create a build directory
mkdir build && cd build
Run CMake
cmake ..
Build the project
make cnmcu-nano-demo
On Windows, you can use Visual Studio to build the project. Open the project in the build
directory and build the cnmcu-nano-demo
target.
Before running the application, you must download and/or build the vasm assembler. Some prebuilt binaries are avaiable here, but you may need to build them yourself on some platforms.
You must put vasm6502_oldstyle
and vobjdump
(and cywin.dll
for Windows) binaries in the toolchain
folder.
/ cnmcu-nano-demo
/ toolchain
/ vasm6502_oldstyle
/ vobjdump
/ cywin.dll
If you've built the project yourself, chances are that you need to be in the build
directory, the structure should look like this:
/ cnmcu-nano-demo
/ build
/ toolchain
/ vasm6502_oldstyle
/ vobjdump
/ cywin.dll
The application will use these binaries to assemble the code.
Then run the application:
./cnmcu-nano-demo
If you wish to use a different assembler, you can change the compile_command
in the textbox besides the Upload
button.
res/program.s
should be set as the input file for your assembler.
Then the output flag should be set at the end of the command, for example:
vasm6502_oldstyle -Fbin -dotdir -wdc02 res/program.s -o <the app fills this in>
because the application expects rom.bin
to be the output file.
Prebuilt binaries for Windows, Linux, and MacOS x86_64 systems can be found in the releases section.
- GLFW - Windowing and input handling.
- GLAD - OpenGL loader.
- GLM - Math library for OpenGL.
- Dear ImGui - GUI library.
- stb_image - Image loading library.
- Assimp - Model loading library.
- Lua C API - For loading the scene.
- mos6502 - 6502 emulator.
This project uses code from this tiny game-engine used in SARE Logo Visualizer that uses Lua to load assets and setup scene composition. Created assets and planned scene composition using Blender.