If you want another, slightly more feaureful toy platform to emulate, consider uxn / varvara .
The Adventures of Writing a CHIP8 Emulator
11–17 of 17 posts
Re: The Adventures of Writing a CHIP8 Emulator
#12That made my day!
Re: The Adventures of Writing a CHIP8 Emulator
#13> I decided to use C. Wait a minute, isn't that illegal? This might surprise you but, it is not! You are not forced to use Rust for all new projects henceforth! That made my day!
The C language looks like it simple but it's not, it's just a wonderful deception. C has quite an amount of invisible sharp edges and footguns and its standard library has even more footguns and sharp edges of its own design. And with the approach modern C compilers take to UB, the "It's the access and control that it gives me!" is simply not true; it's the compiler that has all the control which the programmer unwittingly gave to it: "unwittingly", because UB is invisible and since "no diagnostic is required", none is provided unless the programmer specifies -Wall -Wextra -Wpedantic; but of course, those options for some reason are unpopular between those former frontend programmers that recently discovered that they love C.
Re: The Adventures of Writing a CHIP8 Emulator
#14What stack is this blog using? It looks like plain HTML/CSS/JS. It's very nice. I'm asking because the choice of stack to use is keeping me away from starting my own blog.
Is 11ty with this theme: https://github.com/arpitbatra123/eleventy-blog-mnml Choice of stack also kept me away so I decided to just keep it simple! 11ty is pretty close to html/css, but it has the niceties of being able to reuse html where you want. I recommend to start without a theme, Just make a html file named layout and add {{ content }} And then an md file and put on the top matter layout: It’s really all is ne…
Re: The Adventures of Writing a CHIP8 Emulator
#15Re: The Adventures of Writing a CHIP8 Emulator
#16> I decided to use C. Wait a minute, isn't that illegal? This might surprise you but, it is not! You are not forced to use Rust for all new projects henceforth! That made my day!
And then in part 2, he spends 5 day figuring out that fgetc returns int, not int8_t, and that apparently this design has consequences. So much for "a simple language that fits in my head". Just as a personal anecdote: I still can't get all the "usual arithmetic conversions" to fit inside my head. But that's just me being stupid and/or forgetful, for sure. The C language looks like it simple but it's not, it's just a…
Normally I’d do something like a simple prefix lookup table with function pointers in C for this but chip8 opcodes require parsing the postfix to fully determine the operation (I.e. 8xy[0..e], where x and y are registers) which requires further parsing than a simple lookup table based on prefix.
Re: The Adventures of Writing a CHIP8 Emulator
#17> I decided to use C. Wait a minute, isn't that illegal? This might surprise you but, it is not! You are not forced to use Rust for all new projects henceforth! That made my day!
And then in part 2, he spends 5 day figuring out that fgetc returns int, not int8_t, and that apparently this design has consequences. So much for "a simple language that fits in my head". Just as a personal anecdote: I still can't get all the "usual arithmetic conversions" to fit inside my head. But that's just me being stupid and/or forgetful, for sure. The C language looks like it simple but it's not, it's just a…