You are browsing as a guest. Sign up (or log in) to start making projects!

GEMU

  • 9 Devlogs
  • 11 Total hours

An emulator for a custom designed 16bit CPU.

Ship #1 Changes requested

I made an emulator designed around a 16bit CPU I designed called the GRAVY 16. I coded this predominantly in c++ with some minor areas in python. The CPU has an address and data width of 16bits and a RAM and ROM size of 64kb. It has a custom designed instruction set which is based off Harvard architecture and even a mini programming language to make programs in. Graphics were also added using Raylib to simulate a 64x64 screen that relies on a video buffer in memory to draw to. When making this project I faced several problems. First of all I had to learn how CPUs work on an extremely low level and how to design one. This was not easy and it took me a long time to grasp various concepts. Then I had to learn how to design an ISA for it. This was also difficult as I had to think about what core instructions the CPU needed and how I could allocate bits of data to that. I found myself updating and refining it as I went along and discovered new inconveniences. On top of all of this I had to learn the c++ language to program it in as it is significantly faster than one like python and a popular choice in the industry I want to work in. I learnt so much when making this project. I now know a wide range of computing and programming concepts I can use in my career and day to day life. You can check this out on my GitHub (github.com/Maxogravo). You will have to compile it yourself if you want to run it which may not be so accessible for many people but I have included loads of documents explaining how it works and showing examples of programs I've made for those who can't. I hope you like my project (it took me way longer than 10hrs but I only joined Stardance like a week ago)!!! Attached below is a program that draws a cube and prints an output of the current instruction.

  • 8 devlogs
  • 10h
Try project → See source code →
Open comments for this post

1h 2m 6s logged

I created a new refined document on how the emulator works. I also programmed a 3d cube graphics demote show off the latest features.

0
0
7
Open comments for this post

34m 38s logged

I spent my time formatting some code and also making it so that, when plotting pixels, you can specify coordinates to plot using registers.

0
0
2
Open comments for this post

46m 54s logged

I expanded the amount of registers to 15. Registers like pc, acc, ir etc are all standalone variables. Also you can now specify FPS. I also made this mini cube spinner with help from chatgpt. It doesn’t use any math just plots pixels so that why I just got Ai to do it. Cool demo tho. The gif doesn’t really do it justice as the gif appears much slower than the program really is.

0
0
1
Open comments for this post

2h 9m 50s logged

I added a lot of new features today. Just features that make it nicer to use. You can now do arithmetic with immediates, calculations are saved in the first register, you can store and load using reigister values to determine the address, a clear screen feature has been added and a pixel plotter which makes drawing pixels a lot more intuitive than storing values manually in different locations of memory.

0
0
2
Open comments for this post

52m 38s logged

I added a store immediate instruction to make writing pixels to memory more optimised. I had to update the Isa document and also the compiler to accommodate this.

0
0
1
Open comments for this post

3h 37m 1s logged

I have finished implementing graphics to my emulator. It works by using a frame buffer and assigning a set amount of ram to video. It then uses ray lib to render it (I suck at c++ and graphics programming so it’s not sdl or anything). The demo shows a red pixel and a blue pixel at the first and last location in video memory its small but if you suint you can probably see it.

0
0
1
Open comments for this post

44m 1s logged

I finished writing my emulator for my own 16bit cpu. It is written in c++ and comes with a mini language as well, the compiler was written in python. I am new to c++ and used this as a learning project.

0
0
1

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…