Small tool to showcase BLUE CPU emulator I wrote some time ago. Uses Raylib as renderer. BLUE CPU is a digital automatic computer described in the Computer Architecture book by Caxton C. Foster (1970). BLUE CPU has uint16 words, 16 commands and 4096 memory cells. For more info check page #95 of said book.

Loaded machine code is the test program that jumps to a subroutine and then reconstructs pointer to the main code. Nothing fancy.

Guess it's kinda OK project if you want to see one of the ways to implement CPU emulator. And how to make graphics tool for it. Or how to build raylib projects for web. 

Controls:
- St: "Step" - emulates one cycle
- Pr: "Process" - togless process
- Cl: "Clear" - Clears RAM and registers, switches switches to its default state
- Co: "Corrupt" - Fills RAM with random values
- Re: "Reset" - frees and initialises CPU
- PC: "Program Counter" - Toggles program counter render as the red border on the currently executed cell.

- How to read the field?
- Uhm. The logic behind colors is: since CPU word is a uint16 its divided in half and split acroos green and blue channels. Red is not used. Alpha is 0xFF always. Empty cells drawn as grey dots. 
Huge square is the current RAM. 3 squares below are the switches and 10 squares below that are registers.
Honestly, not as readable as I hoped.

The only thing missing is its own assembly language and the ability to load your own code. I guess you can just reset -> corrupt -> enable process and watch program counter jump around and register light up and down.

Source code for renderer: https://github.com/msun-dev/blue-cpu-renderer
Source code for CPU: https://github.com/msun-dev/blue-cpu

See you soon!

Published 15 hours ago
StatusReleased
CategoryTool
PlatformsHTML5
Authormsun_
Tagscpu-emulator, Emulator, raylib
ContentNo generative AI was used

Leave a comment

Log in with itch.io to leave a comment.