Added fetch image content.
Ok so i tryed to add a function that is triggered when the page is loaded. It checks if is on local storage, if no or if it is but the date is different it fetches a new one to update and overwrite the old one. After that, the code is injected into a reactive property of vue so the image will render again in any change. The app will be a todo app with a custom background.
I had a lot of headache as this is my first time working seriouslly with typescript. It obligated me to handle a case weather the image is not on local storage and it couldn’t be fetched… i just returned a empty object lol
I’m not gonna change that but i will ask AI if this was a good practice. prob not, but lets seee
Added basic window and linked libraries!
So i spent some time adding CMAKE to the project. I do not like the semantics of these metabuild system but it is necessary and useful. I downloaded the GLAD loader and put in a external/folder. I also put by FetchContent the GLFW module so it is not on the source tree.
I now have a basic window. But yall may think that this is strange, if it is ascii why would i have a window?
My objective is to use the GPU to process the pixels but instead of putting it on the screen, it writes to a buffer and then my code prints using these ANSI escape codes to do RGB.
I will disable the window, that’s called offscreen rendering. But to my next tests i will do the framebuffer (i changed the previous class name to ascii buffer because it’s goal is to only print on the terminal. The framebuffer shall be the OpenGL target. The framebuffer functions shall also optimize the asciibuffer by compressing those ANSI scape codes)
If it works i can develop the entire game into a big screen and at the last time try to put it on the terminal. Do not know if this is a good idea.
Forever
Just started the project!
I wanna make a minecraft in C that runs on the terminal. I know that will be hard as terminals were not supposed to do that kind of work but this is exactly the reason i’m using C
I started developing basic framebuffer functions and got the baaasic pixel rendering.
Finally finished!
So i spent the last times just doing the README, improving the docs and speccially habndling some errors like jumping to a unexistant label or simply errors like file not found. Without it the app did not crash, it started to read garbage which is kinda dangerous.
Note: I can’t build a windows release because i’m on Linux. I made this demo video if you do not want to install it from source!
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
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.
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.
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)
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.
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 🙏
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.
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)
Devlog #015
Deployed!!
I deployed the calculator and pushed the README to the repository. Everything is great to work now!
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.
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.
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:
Hope y’all are finding thiss new style a little better :)
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!!!