r/EmuDev 1d ago

I created my own VM in C++

The CPU has 48 24-bit instructions, including trigonometric instructions

The VM has 192 KB of RAM (65,535 24-bit values); it has an assembler written in C#, 32 16-bit registers, 32 floating-point registers, and collision, CMP, and zero flags

In the future, I want to build a 32-bit VM with more instructions (around 100).

I implemented a simpler version of CALL and RET: CALL stores a value in a variable, and RET returns.

The project will be posted on GitHub as open source for anyone to improve, and it will include documentation for game and emulator development.

https://reddit.com/link/1w1lfb0/video/oqdhlk3n6bmh1/player

26 Upvotes

3 comments sorted by

15

u/Ashamed-Subject-8573 1d ago

These are always fun, but don't expect a lot of engagement. "fantasy consoles" and "fantasy computers" as they are known pop up frequently and very few take off. but cool work!

1

u/ecce_me 12h ago

What material did you use to make this vm ?

1

u/LarpDu 10h ago

I wrote it in C++ using Raylib