Blog

  • Android Adventures

    I don’t have much experience with Android. I use iOS for my mobile device, MacOS and Linux for my computing, Roku for my TV. I briefly owned a Meta Quest VR headset, which ran some version of Android, but I didn’t get deep down into it. I’ve also done a very minimal bit of Android app development, but that was nearly ten years ago (and I only ever ran the apps on a simulator).

    I’ve got a new hobby, though: home automation. I’ve replaced some of my overhead lights with Philips Hues, I’ve got a few fancy Zigbee dimmers with an extra button, and I’m working on some custom firmware for some cheaper wifi-enabled switches, but there are certain things that are a much better experience with a screen involved, especially when it comes to customization like adjusting the color of lights.

    So I thought I’d look into getting a touch-screen based controller. Home Assistant has a very full-featured web view, so really any tablet with a web browser would work.

    (more…)
  • An Arduous Endeavor (Part 7): Automated Builds

    An Arduous Endeavor (Part 7): Automated Builds

    This entry is part 7 of 7 in the series An Arduous Endeavor

    My core is finally in a semi-usable state, at least on my local machine. Before I get down to fixing bugs and improving performance, I’d like to get the project built and released so others can use it. And since I’m lazy efficient, I’d like to make this process as automated as possible. It’s time to set up automated builds.

    (more…)
  • An Arduous Endeavor (Part 6): Save States and Rewind

    An Arduous Endeavor (Part 6): Save States and Rewind

    This entry is part 6 of 7 in the series An Arduous Endeavor

    Two emulator features that have made my gaming experience much more comfortable are save states and rewind functionality. Save states let you take a snapshot of a game at any point in time, and then come back to it – whether that is after attempting and failing to complete some task, or maybe after leaving the game for a bit to take care of things in real life. Rewind takes that feature to the extreme, essentially performing a snapshot after every video frame, making it very convenient to “undo” a misstep or bad random number generator without even having to plan for it.

    Libretro enables both of these features via the retro_serialize and retro_deserialize functions. Once you have these functions implemented, a Libretro frontend is capable of saving/loading any number of save files.

    (more…)
  • An Arduous Endeavor (Part 5): Buzzes and Beeps

    An Arduous Endeavor (Part 5): Buzzes and Beeps

    This entry is part 5 of 7 in the series An Arduous Endeavor

    Sound generation is probably the aspect of emulation that I am least familiar with. As part of my undergrad, I wrote simulators of simple computer architectures and interacted directly with framebuffers to display 2D graphics. But when it came to sound stuff, my experience was strictly at a high level, buffering WAV/MP3 files and relying on some mixing libraries written by others.

    Sound emulation in Libretro, though, appears to require passing through integers at the “sample” level. In other words, the raw amplitude values for whatever sample rate we’re running the emulator at.

    (more…)
  • An Arduous Endeavor (Part 4): Input Handling

    An Arduous Endeavor (Part 4): Input Handling

    This entry is part 4 of 7 in the series An Arduous Endeavor

    Playing games usually requires pressing buttons. I thought this part would take longer, but it turned out to be almost too simple.

    (more…)
  • An Arduous Endeavor (Part 3): CPU Emulation

    An Arduous Endeavor (Part 3): CPU Emulation

    This entry is part 3 of 7 in the series An Arduous Endeavor

    Next up was to emulate the CPU: an ATmega32U4 for standard Arduboy units. I started to implement this in a similar fashion to how I implemented the display because “It’s an 8-bit RISC processor, how hard can it be?” And then I saw how many opcodes there were – or rather, how many opcodes there might be, because it’s not totally clear what differentiates one opcode from the other – and I decided that maybe I should rely on someone else’s work for this part.

    Then I discovered there were a number of AVR emulators, written with some degree of intended integration into other projects. simavr seemed the most promising for my intended use – I just had to figure out how to integrate it. So I figured it was time to learn a little bit more about CMake.

    (more…)