935: CJ Made a Sega Game in 2025

## Metadata
- Author: [[Syntax - Tasty Web Development Treats]]
- Full Title: 935: CJ Made a Sega Game in 2025
- Category: #podcasts
- URL: https://share.snipd.com/episode/f057c7f1-cc42-425b-8c0f-98cc524b6396
## Document Notes
## Highlights
- **Hack Week Sparked A Sega Project**
- CJ used Sentry Hack Week to build a custom Sega Genesis game from scratch during a week-long company hack event.
- He chose Genesis/Mega Drive as a nostalgic challenge and to explore retro hardware development.
Transcript:
CJ Reynolds
So Hack Week is put on every year by Sentry. Essentially everyone at the company gets an entire week to work on whatever they want. And this year I decided I wanted to try to create a Sega Genesis game. So with me today is Scott and Wes. What's up, guys? Nope. Hey. Yeah.
Wes Bos
No, don't care about us. You made a freaking Sega game. Yes. Yes.
Scott Tolinski
I got to say, why Sega? We all know that Nintendo does what Sega don't. Or no, wait. No, Sega does what Nintendo don't. Does what Nintendo don't. Oh. Uh-oh.
CJ Reynolds
But that's my first question for you guys. And first, some backstory here for all the Gen Z people watching that don't know what a Sega Genesis is. This is a 16-bit game ([Time 0:00:21](https://share.snipd.com/snip/5784e692-9f06-4088-920a-21e7ee9db212))
- **Demoed A Cartridge On A CRT**
- CJ shows a working cartridge ROM running his game on a CRT using an EverDrive cartridge that loads binaries from an SD card.
- He demonstrated the game: a single level where you play Sentry as a pyramid-robot collecting traces.
Transcript:
Scott Tolinski
Oh, that's so dope.
CJ Reynolds
I guess I'll also say that the modern world of retro gaming is kind of amazing. So I actually use this wireless 8-bit do controller and it works with my Sega. So I can literally be wireless and on my Sega. So this is the game I made. Right now, it's just a single level and you are the AI debugger called Sentry. So you're this little pyramid guy. And my idea with the first level is you go through collecting these little balls and these are traces. So if you use Sentry, you know that you get traces in terms of like what's happening in your app. Like, was there a request on the front end or the back end? Was there a database request? All of that is traced. So the idea is you collect these traces as a ai agent and then there would be another level where you can then use these traces to throw at a bug that you're trying to kill unfortunately
Scott Tolinski
I only got this one level working which is um it's still dang impressive yeah i gotta say uh for people who are not watching this if you're listening to this on the radio, CJ's not only just Playing on a normal Sega Genesis, he's playing on a CRT monitor that has like refresh scrolling going on on the camera. It is like, it's such an experience. So if you feel like you'll get more out of this in video, this is on YouTube, youtube.com forward slash at syntax FM, we will be showing things as well. So definitely.
CJ Reynolds
And this will be the last time I show you on the CRT because it's really hard to see. The nice thing is you can actually develop inside of an emulator. I'll show you that. But basically, I was scrambling. This was like 20 minutes before we needed to turn in our Hack Week videos. And so I was like, okay, I have one level. Now I'm just going to add some text. And so this says, this is where you'd go through all the other levels and then battle a boss, but I ran out of time. And so that shows up on the screen. That's the game that I built and ([Time 0:04:05](https://share.snipd.com/snip/21d31ac1-e959-4715-9b81-518d6a3e1122))
- **SGDK Bridges C To Genesis Hardware**
- The SGDK (Sega Genesis Dev Kit) lets you write C that compiles down to 68000 machine code, massively lowering the barrier.
- That modern tooling makes retro console development approachable for developers familiar with higher-level languages.
Transcript:
CJ Reynolds
So this is the Sega development kit created by Stefan DeLongville, and he's a wizard. So he created Gens, which is a emulator for the Sega Genesis, Mega Drive, Sega CD, and the Sega 32X. And then he also created the Sega Genesis dev kit. And essentially, this is a C code dev kit that allows you to write C code that at the end of the day will get compiled into the Motorola 68000 assembly, which then gets turned into a binary. So the SGDK is what allows me to write higher level code to make the games. ([Time 0:10:16](https://share.snipd.com/snip/afe73ba0-3222-48c0-abb7-79a308523d40))
- **Use Debug-Friendly Emulators**
- Use emulators with debug features (like Gens KMod) to get console debug logs and sprite/VRAM inspection.
- Prefer these emulators during development to avoid slow compile-to-hardware cycles.
Transcript:
CJ Reynolds
Are a lot of different emulators out there. And I would say probably the one hurdle I had all of last week is everybody doing this is doing it for Windows. Like there's barely any resources for doing it on a Mac. Yeah. And then like a few for like doing it on Linux. And a lot of times the Linux stuff can technically run on a Mac if you like recompile it. But that was my biggest issue. And so I actually am running an emulator using Wine. So Wine was originally developed for Linux. It's the Windows something layer. But basically, you can run Windows applications on Linux, and you can use Brew to install Wine on a Mac. So this is running an emulator called Gens. This is the one that Stefan made. But the nice thing about this one, it's called Kmod. And this actually gives you debug messages. And that's the main thing is like a lot of the other emulators, you just load the ramen, your game crashes, what happens? This literally has the debug messages window. ([Time 0:12:28](https://share.snipd.com/snip/4a129911-c1ac-483d-8416-236d0e139494))
- **Fixed Resolution Simplifies Layout**
- The Genesis uses a fixed canvas (320x224 NTSC) so UI positions are deterministic across devices.
- That fixed resolution simplifies layout compared with responsive web design challenges.
Transcript:
CJ Reynolds
Holy smokes. Yeah, so let me pull up the, because I have a globals file where I store all of that. 320 by 224 is the screen width and screen height. So you're working with a very small area. ([Time 0:15:11](https://share.snipd.com/snip/2cbd886f-4cfa-47da-9c2e-906d4a7ffb20))
- **Convert Assets With ResComp**
- Use SGDK's resource composer (rescomp) to convert PNGs, tilesets, and audio into Genesis-friendly assets automatically.
- Let rescomp generate C headers so your code can reference compiled images and music directly.
Transcript:
CJ Reynolds
And thegdk makes this so easy uh so built into the sgdk is a sub program called res comp or uh resource composer it's always funny how something like a resource composer can get a cool ass Name like res comp yeah also these these docs are where i spent a lot of my time last week because they have all of the descriptions of the functions you can call and everything else. But res comp is just a separate program that gets run whenever you build the program. So part of this generated make file inside of there, it has instructions that say, hey, let's look at the res file in this directory for any resources like images or maps or sounds. We're then going to run those through the res comp tool. And you can see that res comp supports bitmaps, tile sets, images, sprites, and then various types of audio like wave, which is like sampled audio, but they also support XGM, which is Kind of like MIDI in that it's music that describes the notes and the instruments. ([Time 0:18:28](https://share.snipd.com/snip/d542517f-6300-4a00-b247-013f0ab68600))
- **Graphics Are Tiles, Not PNGs**
- Genesis graphics are built from 8x8 pixel tiles and loaded into VRAM as tilesets and tilemaps.
- SGDK abstracts the tile splitting and provides APIs to load tiles and set tilemaps to planes.
Transcript:
CJ Reynolds
So the Sega itself works on eight by eight pixel tiles. So any image you have, if it's eight by eight pixels, there is assembly code that says like load that eight by eight pixel data into a specific tile on the screen. And so SGDK is basically abstracted all of that away. It's basically like, okay, take this PNG, turn it into multiple tiles. That's all going to be available in the compiled program. And then in our C code, we now have access to the tile set, which points to an array that has all of those tiles inside of it. And then we can load it onto the screen. ([Time 0:21:34](https://share.snipd.com/snip/0cd22eaf-38f2-4b00-961e-89ad33598031))
- **Leveraged A Community Platformer Engine**
- CJ reused a community platformer engine (by Jared Gascon) to avoid building camera, physics, and level loading from scratch.
- That saved him significant time and became 80% of his game codebase.
Transcript:
CJ Reynolds
Platformer engine by Jared Gascon. So they wrote this for the SGDK about three years ago. If you look in their GitHub repo, they have this folder called platformer engine. And this is basically just the source code for a Sega ROM. And inside of there is where they have all the hard stuff. So working with a camera, physics, having a player, being able to load a level tile set onto the scroll pane. So all of the hard work was done already. I didn't have to figure out how to do any of that because you could do all of this manually, right? You know, basically what scroll planes you have access to and you can put stuff into them, but it's a lot of work to figure out, okay, now we need a camera system and different stuff like That. ([Time 0:27:59](https://share.snipd.com/snip/e6300e91-130c-4b77-b118-5cdcebbd4986))
- **Design Levels In Tiled, Export TMX**
- Use modern tile editors like Tiled to design maps and export TMX files for rescomp to ingest.
- Automate map-to-ROM builds so you edit tiles in Tiled and recompile to see changes fast.
Transcript:
CJ Reynolds
And I found out that this is for a tool called LDTK. And so this is a level designer toolkit file that you can actually load in. I think I uninstalled LDTK. Yeah. Cause I, I didn't like it and it was very frustrating to work with.
Scott Tolinski
I currently have LDK, LDTK installed and also had a very similar experience where it's like, it's cool as hell. And it's like, I want it to work so badly because of the promise of it. For me, it was connecting to Godot. I was having a hard time with that.
CJ Reynolds
It's cool. It's modern. I'll say that. The one that a lot of people use is called Tiled. And it works in a very similar way, but it's supported in a lot of other places. And spoiler, that's what I ended up using instead. But I started here because I saw that their example was using this LDTK file, and it had this tiles export file. So this one file here basically describes what all the tiles are. So if I want to turn this into my own custom game, it's just a matter of loading this into an image editor and changing what each of these tiles are, and then reloading the game and see, do Those assets get applied? ([Time 0:30:51](https://share.snipd.com/snip/dc0e5032-a05c-4e15-922a-d07897d60b38))
- **Export Collisions As A Tile Matrix**
- Provide collision data explicitly (tile collision layer or ID map) so the engine can use an easy boolean matrix for physics.
- If tools don't export collisions well, write an importer that produces an in-by matrix used by your runtime.
Transcript:
CJ Reynolds
But the next thing that you'll run into is, okay, well, now I need collisions as well. So the fact that the player, when he goes to these specific platforms, is not falling through them, that means there's some collision data somewhere as well. And this example did not have that. If you look in the source code it's literally just a hard-coded uh in by in array why that's i don't know that's what i like that's why my first day was like okay now i'm gonna build a tool That can turn ldtk into collision app this map.c file is just a giant uh 48 by 48 matrix that describes where all of the collisions are. So everywhere you see a one in here is where this this player is colliding with a specific platform. Oh, my God.
Wes Bos
What's crazy is I have CJ's video zoomed out right now. And I can if you just look at that array, you can see the collision areas just by glancing at the array because the ones and zeros are like an ASCII one.
CJ Reynolds
So honestly, if I was a better planner, I would have just gotten this working first. I would have just been like, okay, let me just put a bunch of ones and zeros to design my own level and then get that loaded in. But I wanted something better. I wanted to be able to just directly modify the tile map and then recompile my game and everything's good to go. ([Time 0:32:10](https://share.snipd.com/snip/e34709af-e275-417c-8bdf-4344d76c7249))
- **Emulator Logs Reveal VRAM Problems**
- Emulators can snapshot full RAM and provide console logs (SGDK's Klog) for debugging and diagnosing VRAM/DMA issues.
- That visibility speeds development versus blind compile-to-hardware cycles.
Transcript:
CJ Reynolds
Yes, but also we have logging. We basically have console logs, which I'll show you. But you're right about that, Wes.
Scott Tolinski
It is just RAM. And here's something really cool. Any video game that saved your progress on the Nintendo or any system that didn't have a memory card system, if the system doesn't have a memory card system, the way that video games saved Your progress when you shut them off was by having a literal battery inside of the cartridge. Yep. So that the game wouldn't shut off. Isn't that crazy? Before that, they did passcodes, which the passcodes then reset the RAM values.
Wes Bos
And that's how motherboards work still. There's a coin cell that keeps time.
CJ Reynolds
First of all, I'll show you what I ran into also and why this game isn't finished. If we open up the debug logs on here, I am running into DMA temporary buffer full errors because I'm trying to load too many tiles onto the screen. I know there's a there's like a smart way to do it, but basically I have overloaded the video RAM with too many tiles because I have background tiles, foreground tiles, sprites. But this is the debug message log area. So you can see I actually have some debug logs when the game loads up. So the size of the map that has the collectibles and then those circles, I'm calling them traces, this is what your character is collecting. You can see the specific positions that I got registered from. These were my debug logs when I was figuring out how to load in that layer with the collisions and then positioning them in the right spot. And then inside of SGDK, there's a method called Klog. And this lets you just write things to that console that'll show up here as debug messages. ([Time 0:38:05](https://share.snipd.com/snip/e5a1f4be-5f1d-4671-a1ae-e2b26c55e207))
- **Strict Palette Limits Shape Art Decisions**
- Genesis VDP limits colors tightly: 256 total colors, 16 per tile, four palettes, and ~64 colors per screen.
- Designers must plan palettes or unify assets to fit palette constraints for correct rendering.
Transcript:
CJ Reynolds
The main thing is that it was also super hard and probably what took me the most time is just graphics. So I talked about like the different scroll panes and everything else. But the other thing to think to know about is your VDP color RAM. So the Sega Genesis supports 256 colors in total. So 256 unique colors. You can put any one of those colors on the screen. But for any given tile, you can only use up to 16 colors in that one tile. And you can only have up to four palettes loaded at a time. So on one single screen, you can only have up to 64 different colors being drawn on the screen. What that kind of boils down to is to make it super simple, I just made it so that all of my assets use the same 16 colors. Because beyond that, you'd have to be swapping palettes and coming up with it. Well, actually I have, no, I have two palettes. I have a palette for the tile set. I have a palette for the player and then three palettes and then a palette for the traces themselves. ([Time 0:43:58](https://share.snipd.com/snip/6894afe5-34b6-42dc-804d-782f839f03a9))
- **Automate Palette Quantization**
- Build small tools to quantize images to a 16-color palette and export formats rescomp expects.
- Use ImageMagick and simple web UIs to batch-convert art into proper bit-depth and palettes.
Transcript:
CJ Reynolds
So this basically allows you to load a file in and then generate a palette. So you can see here, here is my tile set. This is the original tile set as it was inside of Figma. And then my tool extracts out the 15 best colors plus transparency. So left-hand side is the original image. Basically what I did inside of Figma is I overlaid my own things on top of that original player tile set that was in the example game so I'm putting my pixels on my tiles on top of that to make Sure they're like aligned where they should be and then I have various images that I use mid-journey to generate and I'm kind of like placing them there. So work inside of Figma. But then once I have it inside of Figma, load it into my tool, generate the color palette, and then I can go in and decide, okay, that color there, I actually want that to be like a pink color. On the right-hand side is an image that is only using 16 colors in total. And how did you build this? Purely vibe-coded. I did not look at the at the same time. So this was made using a clod code. I was like, I had a whole prompt of like, I've got images. They need to be 16 colors. We need to extract the most commonly used colors. And then I just vibed my way into a UI that at this point would let me export it. And then that file is ready to go for ResComp. ResComp will read this uh file that only has 16 colors in exactly it won't even error out because it's just 16 colors and then i can use it inside of my game man see yeah yeah this is what vibe
Wes Bos
Coding is good for yeah dang building tools that you need quick and dirty because you could have spent all week just building this tool alone right exactly exactly or the res comp extension
CJ Reynolds
Um or i haven't showed you this but i i basically these bash scripts that also use ImageMagic to convert images. So like technically the exported image here is fine, but it's not the exact format. ([Time 0:45:25](https://share.snipd.com/snip/cdeab396-5879-4fa2-b8ff-9c7b2eb8a8bf))
- **Explore Hardware Mods For Connectivity**
- Consider hardware interfaces (Arduino/Raspberry Pi) and custom flash carts to add connectivity or push ROMs to cartridges.
- People have implemented Wi‑Fi/Bluetooth-enabled carts and serial controller hacks to extend Genesis hardware.
Transcript:
CJ Reynolds
I wanted to do that. Also, you could create a fully custom ROM. So there are these flash carts that have empty memory. And instead of like inserting an SD card, you could buy one of these by a flashing tool and then just put the ROM directly onto the cart itself. Oh, man. And then it'll boot into the game. So yeah, I want to do that in the future and then get it connected to the internet. Initially, I thought it would have been so cool to like see your Sentry issues listed out on a Sega Genesis, but I didn't get there.
Wes Bos
Wait, how would you connect it to the internet?
CJ Reynolds
Well, either the Arduino or on the other side, you have like a Raspberry Pi. It's connected to the internet. And then it could communicate over serial to like push data to the ROM. It would send the data over serial. Yeah. The thing is, there is Mega Drive Wi-Fi. People have created a custom cart. So basically, this is the thing that gets inserted into the Sega. They've created a custom one that has like a Bluetooth and Wi-Fi module on it.
Scott Tolinski
Wow.
CJ Reynolds
Yeah. People have done some crazy stuff with this thing. ([Time 0:48:12](https://share.snipd.com/snip/3a0e33a4-24a1-4b85-adc3-32289c79950e))
- **Modern Music Playing On Genesis**
- CJ used Suno to generate music and then loaded WAV samples via rescomp so modern compositions play on original Genesis audio hardware.
- He integrated sound effects like jump and collect into the ROM.
Transcript:
CJ Reynolds
Because of ResComp, I could just load WAV files in. So I used Suno, which is like a music generator, to come up with some 8-bit sounding music, turn that into a WAV file, and then ResComp was able to load it into the game. I do want to play it for you because this was the other cool thing is like, just like modern, cool electronic music actually playing on the Sega. Because back then we didn't know about dubstep or like drops or anything like that. Oh, yeah. Modern cool music.
Scott Tolinski
We didn't know about dubstep. No, no.
CJ Reynolds
So being able to hear that kind of music on the Sega itself is also a trip. ([Time 0:49:59](https://share.snipd.com/snip/6d5773c3-fbc0-4620-a8a6-6e77a1a713db))