RSSAmplifier

Blog

Austin Morlan

Recent content on Austin Morlan

austinmorlan.comRSS feed ↗37 posts

Latest posts

The Joy of Retro Gaming

I’ve owned a lot of gaming hardware throughout my life. The NES was technically my first gaming console but the SNES is where my gaming journey really began. I had a Sega Genesis at one point but barely played it. After that came the N64 and the PS1. I had a GameCube but was more interested in the PS2, Xbox, and Dreamcast. And finally the Xbox 360, PS3, Wii, and Wii U.

Building an FPGA Computer: VGA

When I set out to build a simple computer with an FPGA ( here, here, and here), my end goal was always to display something on a computer monitor.
VGA was a natural choice because it’s simple and analog, rather than the complex digital nature of something like HDMI. All you have to do is place voltages on some pins at a specific frequency and the monitor is able to interpret it as colors…

Building an FPGA Computer: SAP-3

Previously I built the SAP-1 and SAP-2 in Verilog based on a design laid out in the book Digital Computer Electronics by Malvino and Brown. Now it’s time to build the final evolution of the computer from that book, the SAP-3.
The SAP-1 was very simplistic but very well-explained. The SAP-2 was a big step up from the SAP-1 but explained rather poorly, and it required me to do a lot of…

Building an FPGA Computer: SAP-2

Previously I built the SAP-1 on an FPGA based on a design laid out in the book Digital Computer Electronics by Malvino and Brown. Now it’s time to build the SAP-2, also from the book, which is quite a large step up from the SAP-1.
While the SAP-1 was explained in great detail in the book, the SAP-2 is much more vague and undefined. They don’t go into implementation details, provide…

Building an FPGA Computer: SAP-1

I’ve been getting into FPGAs lately. Last year I built an FPGA version of Ben Eater’s breadboard computer, but I’ve been wanting to do a more advanced project to help me gain experience with Verilog and FPGAs in general.
For his breadboard computer, Ben Eater followed the design laid out in a book called Digital Computer Electronics by Malvino and Brown. The book builds what…

About Me

Repos LinkedIn

Pass by Value vs Pass by Pointer

When I was in college, our computer science instructor introduced us to the struct and then gave us the following rule: when you pass a struct into or out of a function, you should use a pointer. The reason being that a struct is full of other values and you don’t want to pass all of that on the stack.
I followed that rule for a long time, and I see a lot of other programmers…

Working with Jumbo/Unity Builds (Single Translation Unit)

There’s been a lot of talk in recent years about something called a “jumbo build” or “unity build” or sometimes “single translation unit build”. Essentially it’s an alternate way of compiling C/C++ by putting all of the code (headers and source both) into a single file.
Some people love them. Some people think they’re evil. I’ve been…

Pac-Man: Final

It’s now been two months since my last update and I’ve since discovered I get more enjoyment out of working on the engine side of things than the gameplay and design side. A valuable lesson because it frees me from the burden of thinking I need to make a good game. Instead I can make toy games while working on engine features.
With that understanding, I no longer have the goal of…

Pac-Man: Week Eight

Progress Alternate Powerup Coin Counter More Atmosphere Stereo Audio Creepier Skulls Engine Demonstration Thoughts The Game Isn’t Fun What’s Next Finding the Fun Progress A month ago I posted a video of my progress to Reddit and was surprised to see that it got a lot of positive feedback. I expected maybe 30 upvotes and a comment or two. Instead it received 500+ upvotes and 50+…

Pac-Man: Week Four

Progress Thoughts Keeping Perspective Lack of an Engine Resisting Temptation Developing an Art Style What’s Next Progress My efforts over the past four weeks have been: engine programming, gameplay programming, art, and music. But the only things that can easily be shown are visuals and audio, so here they are.
There are coins that line the grungy corridors. You must pick all of them up…

Pac-Man: The Idea

I’ve many abandoned solo projects, and I’ve worked at many different companies, but I’ve never built a complete game (or any piece of software) by myself and released it before. Knowing that the odds of my first attempt out the gate being a winner are low, I decided to dip my toes into the water by first focusing on something that I could reasonably finish within one or two…

Temporary Memory Allocator [C/C++]

While programming you often need some memory to do something but you don’t know at compile-time how much you need. Instead you have to use malloc from C or new from C++ (or more commonly std::vector) to request a certain amount of memory to be allocated for you on the heap. That’s just how it works.
You might not question this sort of pattern while doing normal programming but once…

Building an 8-Bit CPU on an FPGA

I recently finished building Ben Eater’s 8-bit Breadboard Computer but near the end of it I realized that much of the fun was in the design and the learning, but the act of actually cutting wire was an exercise in tedium.
I wasn’t quite ready to put the 8-bit computer behind me, but I didn’t want to cut or bend wire anymore.
I then emulated the 8bit CPU on the original…

Building an 8-Bit CPU on a Game Boy

I recently finished building Ben Eater’s 8-bit Breadboard Computer but near the end of it I realized that much of the fun was in the design and the learning, but the act of actually cutting wire was an exercise in tedium.
I wasn’t quite ready to put the 8-bit computer behind me, but I didn’t want to cut or bend wire anymore.
Another thing that’s been on my to-do…

Building an 8-Bit CPU on a Breadboard

Years ago I came upon Ben Eater’s series of YouTube videos about building an 8-bit computer on a series of breadboards. I watched the entire series but didn’t have the energy to complete the project myself. Then a few months ago I decided to finally give it a go.
After toiling away with wires for around three months, spending way too much money, and starting over twice, I finally…

Deriving the 3D Rotation Matrix

It took me longer than necessary to understand how a rotation transform matrix rotates a vector through three-dimensional space. Not because it’s a difficult concept but because it is often poorly explained in textbooks. Even the most explanatory book might derive the matrix for a rotation around one axis (e.g., x) but then present the other two matrices without showing their…

Shading a Triangle in Software [C++]

I find it fun to reimplement GPU behaviors in software for learning purposes and wanted to share my intuition for how the shading of a triangle can be done with some simple linear algebra.
Defining a Triangle The Edge Function Drawing a Triangle Shading a Triangle Results Conclusion Defining a Triangle A triangle can be defined by three points or vertices. Each vertex has various attributes…

Programming the ODROID-GO: Tile System (Part 8)

As mentioned in Part 7, we’re going to build our backgrounds out of reusable tiles. The dynamic objects in front of the background are sprites, which will be touched on later. Enemies, projectiles, and the player character are examples of sprites.
For the tiles, we’ll fix them to a grid. We’ll use tiles that are 16x16 and our display is 320x240, so that gives us 20x15 tiles…

Programming the ODROID-GO: Text (Part 7)

With the ODROID-GO layer wrapped up, we can begin to write code for the actual game.
We’ll start with drawing text to the screen because it’s a gentle introduction to a few topics that will serve us well later.
This post will be slightly different than the others in that there will be very little code added that will run on the ODROID-GO. The bulk of the code will be for our…

Programming the ODROID-GO: Audio (Part 6)

The final step to having a full interface to all of the ODROID-GO’s hardware is to write an audio layer. Once that’s finished we’ll be able to start doing more generic game programming and less Odroid-specific programming. Any interaction with the peripherals will be through the Odroid functions.
Getting the sound working took the longest of everything done so far due to my…

Programming the ODROID-GO: Battery (Part 5)

The ODROID-GO has a lithium-ion battery so we can create a game that can be played on the go. That’s an intriguing concept for someone who grew up playing the original Gameboy.
We thus need a way to be able to query the ODROID-GO’s battery level. The battery is connected to a pin on the ESP32 so we can read the voltage to get a rough estimate of the life remaining.

Programming the ODROID-GO: Storage (Part 4)

The ODROID-GO has a MicroSD card slot that would be useful to be able to load assets from (sprites, sound files, fonts) and possibly even save game state to.
The card reader is connected via SPI, but the IDF makes it simple to interact with the SD card by abstracting away the SPI calls and allowing us to use standard POSIX function calls like fopen, fread, and fwrite. Underneath it all is the…

Programming the ODROID-GO: Display (Part 3)

We need to be able to draw pixels onto the LCD screen of the ODROID-GO.
Getting colors onto the screen will be more complicated than reading the state of the input buttons because the LCD actually has brains. The screen is driven by an ILI9341 which is a (very popular) “TFT LCD Single Chip Driver”.
In other words, we communicate with the ILI9341 which then responds to our…

Programming the ODROID-GO: Input (Part 2)

We need to be able to get player input from the buttons and D-pad on the ODROID-GO.
The Buttons GPIO Initialization Reading the Buttons D-pad ADC Configuration Reading the D-pad Polling Demo Source Code Further Reading The Buttons GPIO The ODROID-GO has six buttons: A, B, Select, Start, Menu, and Volume.
The buttons are each connected to an individual General Purpose IO (GPIO) pin. GPIO…

Programming the ODROID-GO: Build System (Part 1)

Before we can write any code for the ODROID-GO, we first need to get the ESP32’s SDK set up. It contains the code that actually gets the ESP32 to boot and call into our main function, as well as code for peripherals like SPI which we’ll need to use when we write our LCD driver.
Espressif calls the SDK the ESP-IDF and we’ll be using the latest stable version which is v4.

Programming the ODROID-GO: Motivation (Part 0)

I’ve been looking for a side project to work on outside of my day job to distract me from the state of the world. My primary interest is game programming but I also enjoy working with embedded systems. My current job is at a game company but most of my jobs before that were working with microcontrollers. While I eventually decided to change gears and join the game industry, I still enjoy…

Sending Matrices to OpenGL

Sending matrix data to OpenGL can be confusing, but it doesn’t have to be.
The confusion arises due to misunderstanding two things: row vector / column vector and row-major / column-major.
Row Vector / Column Vector Row-Order / Column-Order OpenGL’s Assumptions What To Do? Example Conclusion Row Vector / Column Vector Let’s look at a 4x4 matrix (0-indexed to be…

An Overview of NES Rendering

I’m in the midst of creating an NES emulator and struggled at first to understand how the rendering worked at a high level. Nametable, attribute table, pattern table, background, sprites, palettes. The Nesdev Wiki has all of the info necessary but it isn’t presented in a way that clicked with me. The details were abundant but the big picture view was missing.
Cross-referencing the…

Building a CHIP-8 Emulator [C++]

I’ve always loved emulators because they let me play old games that I enjoyed as a kid, so I thought it might be fun to learn how they work and how to build one. My real goal is to build an NES emulator, but after doing some research, I decided to take the advice of the internet and start by building an emulator for the much less complex CHIP-8 instead. It’s a good stepping stone to…

Creating a Pong Clone [C++]

Sometimes it’s helpful to go back to the beginning. Of course we all have some dream game in our heads that we yearn to have the skills to bring to fruition, but we have to learn to walk before we can run, and recreating an old game from scratch can help us get there.
Pong is useful because it’s simple (and classic), but it also has many elements that are perennial in game dev:

A Simple Entity Component System (ECS) [C++]

Ever since first hearing about Entity Component Systems and their implications in game development, I’ve wanted to build one for my own usage and knowledge. There are a few examples that people have built and posted online (1, 2), and there are a few full-fledged ones that can be used to build real games (3 , 4).
I liked different aspects of each of them that I studied, but I wanted to…

Remote C++ Development with Docker and CLion (with X11)

My preferred Linux distribution of choice is Arch Linux, but many development SDKs that I need to use at work and at home are built for and tested for an Ubuntu environment. I could figure out how to get them to work in my native package manager, or I could just use Ubuntu (not happening), or use an Ubuntu VM (problematic for something like embedded development where I need solid USB access).

Neverending 2D Side-scrolling Background [Unity]

My team and I are in the early stages of developing a 2D side-scroller set inside of a Chinese handscroll, and so we wanted to ensure the game’s art looked like ink set on top of a paper background. Unlike a paper camera filter where the paper would appear to be attached to the camera and in the same location relative to the camera regardless of the camera’s position, we wanted the…

Easy SSL Websites with Docker and LetsEncrypt

Like I mentioned in the previous post about a self-hosted life, I’ve grown fond of Docker for website management. There’s something very satisfying about running some commands and getting the same result every time (i.e., purely functional) and knowing there’s no stateful cruft hanging around from previous iterations. Enter Docker.
Docker creates containers that are…

Switching to a Self-Hosted Life

I used to be all-in on the Google ecosystem. I used Android, Gmail, Drive, Project Fi, and Google Docs. But it always bothered me that all of my data was sitting on a server somewhere that I couldn’t control.
I also subscribed to You Need a Budget (YNAB) to track my spending. But it always bugged me that I was paying ~$50 per year for a service that was supposed to help me spend less,…

Arch Linux - UEFI, systemd-boot, LUKS, and btrfs

I recently purchased a new laptop (Dell XPS 13 9370) and needed to install Arch onto it. I thought I’d finally document the steps I took because I always seem to forget what I did the last time (one of the joys of Arch is that it rarely needs to be reinstalled).
There are a lot of helpful guides online about different installation setups, but I could never find one that met all of my…