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

renanfartes

@renanfartes

Joined June 8th, 2026

  • 52Devlogs
  • 8Projects
  • 7Ships
  • 75Votes
Open comments for this post

1h 47m 40s logged

Devlog 07

FINALLY I DEBBUGED THIS THING

So i was having a weird bug with the Jump instruction. I first thought maybe is endiannes opr something. I passed howurs on the paper trying to understand how the stack would be compressed and decompressed. At the end i searched if the bitwise operations changes with the endiannes. I read that no so all this effort was not applied.

Then i corrected it and it still not working. I debugged with the GNU debugger (GDB) and learned a lot about it. The bug was that in the label mapping i was changing 2 times the byteoffset when expanding a string litteral and the label setting. So i fixed that and it worked just as fine!

I think it is almost ready for shipping. I just need to make some adjustments with security to prevent the user accessing invalid memory. XD

0
0
4
Open comments for this post

1h 15m 5s logged

Devlog #005

Style changes!

I chanched the style so the site looks more professional, with these intercalating themes, centralizing things.
Added my new project, Chip8Emulator.
Alsop i removed those ugly icons and added some animations to the headers.

0
0
11
Open comments for this post

4h 8m 21s logged

Devlog 06

IMMM tired :(

I took the tripple of the time i thought i would do. I added the label system to the compiler but i needed to re-write all teh compiling logic. I’ve drawn on the paper 4 times trying to see with a solution to map the bytecode addresses before actually compiling and failed those 4 times.

I asked AI to know how could i implement this and it suggested adding a byteoffset, and then i did that, i’m not happy of needing that.

Now the last things that the language needs to be complete is to improve the error system, improve the code quality, maybe add an opcode to read user input.

0
0
9
Open comments for this post

2h 55m 43s logged

Devlog 05

THIS WAS ANNOYING
I had a lot of headache just writing this lexer. Firstly i thought about studying and it helped, but was confusing what exactly the lexer should take as input and output.

As in modern compilers it is common to have this separation and i want to add this functionality to implement labels i coded it. The code is just awful, the error handling and the finite state machine are kinda bad.

But i think the interface is good enough so in the future i can make this code more mantainable and stuff. I also think i’m understanding more how to read documentation correctly without AI helping me.

Now the app will be able to receive strings instead of manually pushing values.
Hope y’all like it!
(Note: I did not implemented the glue on the compiler. The lexer is isolated by now because i will need to re-write the code generation in order to connect the lexer as the first ‘middleware’ if you can call that way)

0
0
12
Open comments for this post

1h 40m 29s logged

Devlog 04

Added JMP Instructions!
So finally the language is turing complete. It has complete instructions, conditions, loops and so on. But it is a pain to code in this language so i’ll add some syntax sugar such as JMP_LABEL like instructions.

I didn’t added this later because i actually need to refactor the code. The app dont actually know which is the line address that it is compiling and i need to divide responsabilities such as an normal compiler (lexer and parser).

This will took a time but it is nice to see the things working. “Make it work” as said by Kent Beck is complete i just need to make it right and then make it fast.

0
0
21
Open comments for this post

39m 40s logged

Devlog 03

Comments and stack underflow detection!

So i added the comments feature and a stack underflow handling. Firstly i decided to use c++ exceptions because barelly used this c++ feature. But i thought it could be weird as exceptions usually tend to be avoided to performance issues and be more like a feature of C++ and not of my language. So i used AI to question and yes it was a bad decision, so i switched to IF statements. (I asked, the code was not coppied or anything)

Also i am very happy to open cppreference (this absolute monster documentation) and find that substrings searching in C++ are not complicated with iterators 🙏

0
0
39
Open comments for this post

1h 37m 14s logged

Devlog 002

I started to develop the virtual machine! It has no complete commands yet but it can pop and manipulate the stack as it wants. It can interpret the commands PUSH ADD PRINT and HALT.

I am going to suffer a little by handling all edge casesm such as trying to pop the stack even when it is already empty.

I’ll fix this later. As seen on the video, it can sum the numbers. I plan to add the Hello world example (it need to exist!) and adding more functions such as input taking, jumps and loops.

0
0
8
Open comments for this post

2h 17m 40s logged

Devlog 01

Ok! So i was bored in a time so i decided that write a language would be cool. It is a fast project but kinda hard so i started with that in midn

First i opened draw.io just for sketching a liitle architecture,

I wrote:
The CLI usage
The File Reader module (Working as seen on screenshot!)
The basis for the compiler
The Initial OPCODE table

But i still need to write a tokenizer and think better in what opcodes i should implement. I want it to be fast and not really fancy. (The screenshot shows the dump of the main file because i forgot to write an example)

0
0
2
Ship

[EPILEPSY WARNING - Chip8 due to hardware limitation issues, may have some image-flickering that are considered flashing lights. If you have some issue, please skip this project]

I published this project with thee goal of learning how a emulator works, and i learned a lot. I coded trying to not use any AI but i used as described on the devlogs and on the tag described bellow.

I learned how to handle when nothing works, search on raw google and stack overflow while handling with UI issues and registers, CPU fetch-decode-execute cycle etc.

Mobile note: The app works fine on firefox mobile, but in chrome the keyboard may be buggy. In desktop any browser works.

  • 15 devlogs
  • 19h
  • 15.53x multiplier
  • 295 Stardust
Try project → See source code →
Open comments for this post

52m 9s logged

Devlog #014 [EPILEPSY ALLERT - Chip 8 xor logic flickers the image blazzingly fast so it may cause some visual discomfort]

Sound implemented!

All the chip8 logic was ready but the sound was missing, so i took some time to think. I searched and found the MDN p[age about the browser audio api.

It is complicated, it is like an opengl with pipes but for sound processing. I created Also the classes name does not help
I read and found a liiitle solution tha isn’t ideal and wrapped it into a Speakers class.

But makes sense. That architecture allows complex audio processing and is useful at all. You create an oscilator node, makes it point to a gain node to change volume and then point the gain’s node output to the computer.

0
0
4
Open comments for this post

41m 56s logged

Devlog #013 [EPILEPSY ALERT - The video contains flickering images since CHIP 8 uses XOR sprite rendering]

FInnally bug corrected!!

I was having a strange bug with the CHIP 8 engine where the pong logic was inverted. I passed almost 40 minutes trying to rewrite the code to the canvas (since the VF register is used to descrive collisions). But the bug had nothing to deal with collisions, was a underflow flag that i inversed the logic without wanting.
I pasted some part of the code onto the AI to debug after that and after this it took me only 1 minute to fix it. I’m sad to break the streak of not using AI.

0
0
6
Open comments for this post

59m 12s logged

Devlog #012

Streched up the ROM cards and added this little about-me section. I also updated the Page’s title and i drawed this weird icon that someway feels off.

I plan to make the final adjustments like:

  • Fix: Pong ROM not loading
  • add: Sound implementation
  • add: Some mobile support (The keys of the keyboard are not capable of handling multiple pressed strokes and that makes undefined behavior as the keyboard forget what key to clear)

Hope y’all are finding thiss new style a little better :)

0
0
3
Open comments for this post

2h 20m 43s logged

Devlog #011

Sooo Now the project is getting a liiitle less weird

I added this white borders, refactored the file input style, added this ROMs section and all the components necessary to make this whole thing work.

I also added a raw coded console-printing of the ROM in base64 at the terminal for uploading this ROMs.

Some of them are actually weeird because the console of chip8 wasn’t created actually. Chip8 was never a reaaal console, it is more like an entire programming lang. So i tried my best making the keyboard, but some games were designed in another layouts.

I hope this retro-style looks great!!!

0
0
3
Open comments for this post

1h 21m 56s logged

Devlog #010

FINNALLY A PRESENTABLE STYLE

It still ugly, but i refactored the fonts, the buttons and speccially the colors. I also added a reactivity-based system that tracks the current rom and display it’s names.

I also added the ROM template so the examples will be displayed soon.

My next steps is probably to organize some ready-to-use ROMS, a LocalStorage system to allow ROM uploading persistance, the sound system and some historical context of this virtual console

0
0
4
Open comments for this post

1h 13m 50s logged

Devlog #009 [EPILEPSY ALERT - Since Chip 8 uses XOR rendering logic, the images are flickering]
Console remade!

I added some fonts and forked into this braanch for refactoring the visual components.

I moved a lot of components, and it stills ugly.

I reaally tryed to make height the same as width but i didn’t find in stack overflow or any website, and i didn’t wanted to use AI.

So i changed the screen size, the button, alll the keyboard was re-written and i thiink it will eventually be working fine in mobile screens.

0
0
2
Open comments for this post

50m 9s logged

Devlog #008
Speed and bug fix

I made the game repond faster by splitting it in 3 timers. I also added a clearInterval feat so the button “InitGame” doesn’t speed the game more and more.
I tried optimizing the canvas by only updating the changed pixels. Was a total failure. So i forget about it.

I also added keyboard mapping so clicking on the UI layer at the right isn’t needed.

I also corrected the bitshifiting bug thsat were buggin all the draw. The game is already playable!! :)

But this website is a crap of UI

Idk if i try to style it or use vuetify componnt lib.

0
0
4
Open comments for this post

1h 9m 14s logged

Devlog #007

FINALLY IT WORKS

I had a lot of headache fixing bugs. The first one was a opcode that wasn’t being captured (0xF007, which gives the timer, so the game was being paused becs i wasn’t capturing it)

After, i realized none of the sprites were beign rendered correctly (as is seen at my previous devlogs). But debbugging on the browser i saw that the getAsset() function were returning the entire rom, not the sprites.

So i fixed it using a simple slice.

I don’t why, but everything seens to be rendering by inverse. Probably is some crazy bitshift that i made and need to fix. Also, the game runs at 60 fps, but that’s slow to the time. Only the timers shall run at 60 fps as i saw.

XD

0
0
4
Open comments for this post

5h 8m 50s logged

Devlog #006
FINALLUYYSIJKURFHYIUADSHJIUFKLHJNDJLKOFH

After 5 hours of pure and incessive headaache,without any clue about why nothing was being rendered, i finally make up to render my first rom in chip8

That took me the most painful experience i’ve saw in my life. Not even kidding, Binary in JS is like harder than assembly.

After 2 hours i realized that trhe Mdn docs on my language was also not updated. So my file reader wasn’t even using promises. I realized only when i took the entire html to gemini and asked how i would figure it out without using AI?

I also used ai to help me debug because i was 4 hours without seeiing anything on the screen, is just like a blind pinata write a big switch in js

But i used AI only at the end, on the past 10 minutes. And none of any other code was written by ai. Every single opcode was weirtten by hand. I used to exactly: know about endianness (why in my machine the bytes were in x-order and in the file api of my btowser was in y order, detect rom loading bugs and for the text fonts. Only)

I am so stressed that neither the keyboard was done neither the loading window are styled.

0
0
2
Open comments for this post

35m 44s logged

Devlog #005

ROM loading added!

I added this raw-styled rom loader so the user can input their own files(none ready-to-use rom added yet). I’ll probably make fetch to a chip8 repo in github for that.

Handling with promises is always complicated, but i think the most difficult part is done./ I created a ROM Loader helper class that will Receive a FIle object, load inside it and will have methods stream-like (getByte) etc.

0
0
5
Loading more…

Followers

Loading…