Despite there being a lot of better, cross-platform options, I went with using WinAPI for my UI elements. This was a decision I made, because I didn’t want to implement another library at that moment, and wanted to keep the emulator itself lightweight, so I would be able to port and use it for some later projects (projects that I will announce and talk about here, soon).
As I want to be able to load my ROMs, without having to change the String in the code every time, I added a simple file selection dialog, to have an “load rom” option. To load a new ROM, we need to reset our emulator of course (clearing the memory and the flags, pc, etc.), so why not adding it as a feature to the menu as well. The obligatory “exit” function of course was added as well.
Of course we want to let the user regulate the volume in 10% increments.
WinAPI let’s you make use of the native Windows components of windows and menus. Pretty early in the development process, I wanted to have the ability to check my memory without having to use breakpoints and watchdogs in my IDE, and check if my according layers from my PPU were correct. That’s why I implemented a few debugging features.
The graphical debugging was just setting up more windows with SDL, and printing only the individual single layer to it (or just the blank VRAM data, for the tiledata window).
The actual debugger, consists out of simple elements from WinAPI, that are filled with values of registers, flags, and important memory addresses. Additionally, I implemented a complete memory map.