Chip8 is a common first emulation project. I had a friend who was messing with it and wanted to explore some options related to displaying the machine state at runtime, in order to be able to be able to see everything it was doing. Because the scale of chip8 as a computer system is very constrained, it is possible to do so visually, and in fact see every bit of the memory. This type of task is commonly done with a hex dump, where you would visualize bytes as two 4-bit nibbles, which can be mapped to a hex char between 0 and F. I wanted to try something a little different - the arrangment you can see here is inspired by the design of the Connection Machine series of supercomputers and their arrays of external status indicator lights.
The actual underlying emulator project is not done, but I laid out this simple visualization with the SDL 2d renderer. It maps everything in pixel coordinates, and uses some base points + square spacing and separation values. The display for chip8 is specified as 64x32 1-bit pixels, and there are some other clearly specified state values, registers, stack, and 4k of memory. You can see above, the state of every bit is represented for every byte in this 4k. The full display updates every frame from the emulated machine state in under 2ms with the SDL2 2d renderer, so it ends up being very practical to use for realtime visualization. It happens to only show the final state of the machine the frame presents, which is something of a limitation - it might make sense to keep a history for every rectangle and average out state over the entire frame, or else just keep records on toggling so you can get the ratio of time on to time off, in order to support varying levels of illumination in areas of memory that would be be updating multiple times between frames. You could do some stuff with creating varying response curves per square, if you wanted to add some interest to the display, maybe interesting. Will update if this ever progresses.
Last updated 12/28/2022