CHIP-8 emulator with a debug server
I wrote this back in 2019 as a course project so I'd be allowed to skip a very basic class on C programming. I might've overdone it a bit on the complexity of my little "C 101" course project :)).
It builds and the code doesn't look too horrible, so I'm taking it over from my old and lost github account for preservation.
The only dependency is glfw
.
Not very tested under Windows, so be wary.
To build a debug build:
make debug
To build a release build:
make release
To build under Windows:
make -f Makefile.win
To cross-compile for Windows
make -f Makefile.win CC=x86_64-w64-mingw32-gcc
./hnc8 rom.ch8
./hnc8 -md rom.ch8
./hnc8 -ms
Select mode of operation.
Valid modes are "emu", "server" and "disasm".
Display help text.
Output version information.
Display memory addresses before assembly.
Display raw instruction bytes before assembly.
Set clock multiplier for the emulator core.
Timers are still ticked at 60hz.
Set graphical output scale.
Set debug server listen port.
Chip8 keypad.
Reset emulator.
Quit emulator.
Turbo mode.
Launch the emulator in debug server mode:
./hnc8 -ms
Use netcat to connect to it:
nc localhost 8888
To disconnect send the command shutdown
and disconnct from the server.
Display help.
Shut down the server after client disconnect.
Load a file into the emulator core.
Set a breakpoint on specified address or current PC.
List all breakpoints.
Remove breakpoint at index or remove most recently added breakpoint.
Continue execution after a breakpoint.
Display the stack values.
Execute count number of instructions from current PC.
If count is none then a single instruction is executed.
Examine memory contents at address. Displays count bytes.
List all commands
No arguments:
Display contents of all registers.
Register argument set:
Display contents of specified register.
Register and value arguments set:
Set contents of register to value.
Toggle state of key keynum.
Display keypad state.
Disassemble count opcodes starting at address.
If address is not specified then from current PC.
Display VM screen contents.