Decades old Low level concepts are still haunting.. (Chip 8 Interpreter)
- This is my first time building a proper low level project.(Strong Man Crying 😭)
- its tough i had to study new architechures, understand memory bottlenecks, i spent aout 10% time writing code and rest learing , reading Chip8 technical references, banging head to AI to explain the low level memory concepts (So Exciting its an Automatic All-Nighter puller)
And .. heres what i learnt
waht is chip 8?
chip 8 basically a a interpreted programing language of ancient times (70s). It kind of mimics a small computer
(8 bit), limiting its max memory to4KB. But the special thing is, its not just a language, it mimics a CPU architecture, making it like a different computer system which doesnt exists phycally, but uses other physical computer to run its own acrhitecture.
What is Emulator
Well think of emulator as a extra added layer between the software and low level computer systems. which does some magic to run a software which is not ment to run on that system.
Windows Application –> macOS (Won’t Run)
Windows Application –>
Emulator–> macOS (Will Run)
Flow
- Lets say we have a software S, designed to run on System of type C1, but now we want to run the same software on a different system lets say C2,
- S –> C1 RUNs properly
- S –> C2 Fails as C2 cant understand the instruction that software S is trying to give to C2
Emulator in the picture
- Software S (instruction codes for C1 ) –>
Emulator(Translates Instruction code for C1 to C2) –> now C2 can run (Translated instructions).
Now Chip8 Emulator
Lets say you have a program which was designed in and for Chip8, but now you dont have a chip8 system, how do you run this program?
We basically use an emulator to trick the software to thing that its running in the old Chip8 system but its acctually running on moder computers.
Howwwwww? well
Chip8has 35 standard instructions and only4096bytes of memory, so its faily easy to map each and every of its instruction and instead do it in the modern langauges (like i have used C++).
We store the data in modern
C++ Data Structures, but we trick the target software to thing that it has dorect acces to theRAMof the computer.
Current Status
- implemnted the basic template to mimic real RAM for chip 8, which is basicaly an array of size
4096, weher first200are reserved for the chip8 system use, rest is opent to softwares running on it. - I have translated some basic codes, more on this in next devlog
- A black window with
raylibfor now
Comments 1
I am still learning, if wrong anywhere please correct me, you will be preventing a huge universe threatening disaster
Sign in to join the conversation.