I learned programming in 1977, age 12, on an RCA VIP (CDP1802 cpu) with 2K RAM, a hex keypad, composite video out (thru an RF modulator) and cassettes. None of that fancy ASCII stuff, and floppy drives were an unimaginable luxury.
CHIP-8 was a fun, approachable language. "Hacking" was hand-disassembling the CHIP-8 programs in the user manual.
It was easy to understand how computers were simply more complex TTL and CMOS projects like my father and I built each month from Popular Electronics and Radio Electronics. Dad worked at RCA, programmed in IBM 360 Assembler, FORTRAN, and at that time was helping write the ATLAS language (IEEE 416). Together we learned Tiny BASIC, and this launched my computer business for forty years.
Kudos to all the folks keeping CHIP-8 alive as a vital link from Boole and Shannon thru machine code to the "modern" world.
> 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!
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 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.
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.
The C standard library certainly has warts (errno, anyone?) but surely you can't begin to use fgetc() without knowing about EOF… even if you forget that int8_t is not required to exist (people writing int8_t usually mean int_least8_t).
Nice to see someone implementing a chip8 emulator.
This is always a great learning project.
However, I do not think that he needs to go so far to explain what a stack does.
If you can understand the rest of the text you probably have enough context and knowledge to know that already.
I had a friend over while I was playing with chip8, and I’d need to explain to him how to implement a stack… I probably had him in mind while writing ¯\_(ツ)_/¯
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: <name-of-your-layout>
It’s really all is needed and it’s good to understand how it works (as opposed to jekyll or hugo that I couldn’t figure out because they have a bunch of undocumented assumptions and requirements…)
Typo indeed. I think I was using a diffuser ROM to illustrate something and then I decided to use a more simpler one but forgot to update the text… will fix soon :)
CHIP-8 was a fun, approachable language. "Hacking" was hand-disassembling the CHIP-8 programs in the user manual.
It was easy to understand how computers were simply more complex TTL and CMOS projects like my father and I built each month from Popular Electronics and Radio Electronics. Dad worked at RCA, programmed in IBM 360 Assembler, FORTRAN, and at that time was helping write the ATLAS language (IEEE 416). Together we learned Tiny BASIC, and this launched my computer business for forty years.
Kudos to all the folks keeping CHIP-8 alive as a vital link from Boole and Shannon thru machine code to the "modern" world.