Game Boy Development Environment
- November 6, 2023
- Posted by: MainInstructor
- Category: Assembly Game Development Go Java Software Development Tools VSCode
![](https://i0.wp.com/allprowebdesigns.com/wp-content/uploads/2023/11/1699257815_maxresdefault.jpg?resize=840%2C430&ssl=1)
Video Title: Game Boy Development Environment
This is a game I wrote running on real hardware and in this episode I’m going to show you how to set up a development environment so you can start making your own Game Boy games the best way to program the system is to use a language called Game Boy z80
Assembly if you’ve never coded an assembly before don’t worry it does take a little getting used to but it’s not nearly as bad as some folks make it out to be that said even if you are well versed in the language you’re not going to get far unless you have an assembler
And a Linker to turn your code into a functioning ROM in this episode I’ll show you the tools that I use when writing games and step you through how to use those tools to build an open source demo project I put up on the NES haacker GitHub additionally I’ll cover a
Little bit about how to use flashrom cards like the everdrive to get your games running on real Hardware all right with that covered let’s start by taking a closer look at Game Boy z80 assembly the Game Boy is a weird system for a lot of reasons but one of the more esoteric
Ones is that its central processing unit is kind of a hybrid the processor known as the sharp LR 35902 was built collaboratively by Nintendo and sharp specifically for the Game Boy and it’s sort of a melding between the Intel 8080 and the zylog z80 processors at an
Instruction level it’s more like the z80 but it doesn’t Implement all of that processor’s features so that’s why it has its own language now when it comes to building your own ROMs you’ll need an assembler and a Linker that understands this specialized Game Boy assembly and
As far as I’m concerned the best option is rgbs it works on all major operating systems has been in development for nearly 30 years and has everything you need to turn your source code into a playable Game Boy game rgbs is basically a small collection of command line tools
Including an assembler a Linker and something called a fixer but I’m not going to get into the details of how that works in this episode getting rgbs is pretty simple just go to the Project’s website find the install page and follow the instructions for your particular operating system but if
You’re having trouble and you need more detailed installation instructions I created some additional videos showing how to install and configure most of the tools for this video for all major operating systems the links are pinned at the top of the comment section with the build tools out of the way I think
We should talk a little bit about code editors now you can use whatever editor you’re most comfortable with but I think there’s a case to be made that Visual Studio code is just excellent for Game Boy development let me explain vs code is a great option for a lot of reasons
It has a good build system built-in Source control and fluid modern navigation but while all that’s great I think its killer feature is actually telesense which provides context sensitive information about code as you’re programming okay so opening up a Game Boy assembly file from the demo in vanilla vs code isn’t particularly
Impressive it kind of just treats it like a plain text file but if I go and install the rgbs z80 extension things get way better first you’ll probably notice that the file now has syntax highlighting which makes the assembly code slightly more readable but one of
My favorite features is that if I hover over a variable in the file I’ll get any documentation associated with that variable variable this one in particular is a hardware register used to toggle the system’s audio Hardware on and off and if I control-click the register the
Editor will take me to its definition in the hardware. Inc file a freely available include file that’s used in most Homebrew games anyway the documentation that the editor showed was provided using the comments right above the symbols definition and you can document all of your own code in the
Same way by pressing the back button to return the editor to the demo code you can see that I’ve documented pretty PR much everything here like this V blank macro and all these sub routines speaking of sub routines sometimes when I’m coding I need to take a look at
What’s going on inside a routine but I really don’t want to leave my current spot to handle this kind of situation the plug-in also implements vs code’s Peak feature which lets you see the definition for a routine or a variable without having to leave the code you’re
Currently working on if you’re new to Game Boy assembly then one of the best intellisense features that this plugin implements is automatic code and symbol completion for instance I can start typing out an instruction and it will give me a list of all the possible ways that I can use that instruction further
I can click to show more information and I’ll get inline documentation about what that instruction does and all the processor flags that it affects this is super useful because I don’t want to stop my train of thought and go searching through the rgbs documentation every time I forget exactly how a
Subtract with carry works if you want to try this all out installing vs code is dead simple just head to code. visual studio.com look for the big blue download button and it shows automatically give you the appropriate download link depending on your operating system anyway let’s switch to a potentially even more contentious
Topic which emulator you should use now for game development you don’t want to use just any old emulator you’ll want one that’s faithful to the Game Boy hardware and comes with tools that are useful when programming games given these two criteria it’s my opinion you really only have two options for your
Development environment you’ll either use bgb or ulicious bgb is a minimalist Hardware accurate window window native emulator that boasts an excellent debugger it also has a bunch of tools that make it easy to figure out what’s happening with things like Sprites and backgrounds as a game is running
Ulicious is a multi-stem emulator with similar debugging tools that’s written in Java meaning it works on pretty much all major operating systems by default it also has a VSS code extension that allows you to do all of your debugging right inside the editor as far as which
One you should choose I’d say that really depends on your operating system Windows users can absolutely use both so if you like the debugging with ulicious but want to check your rounds for Hardware compatibility in bgb knock yourself out if you’re not on Windows I highly suggest using ulicious you can
Get bgb running with utilities like wine and whiskey but the process can be kind of convoluted that said if you really want to run it and you’re not on Windows the most reliable way I know is to use a virtual machine if you don’t like either of these options that’s okay to there
Are a plethora of emulators to choose from the important thing is that they have decent debugging and memory inspection tools as those are really important when you’re making a game a couple Alternatives that come to mind here are gear boy and mgba both of which are crossplatform so excluding audio and
Graphics which are topics that could fill their own entire videos that’s pretty much all the software tooling you need to start writing and building your own games but if you’re looking to get your games running on real Hardware you’ll need a few more things thankfully the process isn’t all that complicated
First you’ll need some sort of flash ROM card like the everdrive X 7 that I use nowadays these cards generally require a Micro SD card so you’ll need to buy one of those as well you don’t need anything fancy here a cheapo 8 GB card will more
Than suffice you’ll likely also need an SD card reader that you can get for really cheap on Amazon though I would avoid the absolute cheapest options as they can be buggy and malfunction a lesson I learned the hard way another gotcha if you decide to go with the ever
Drive is that it requires the SD card to be formatted using the fat 32 file system system a kind of old Windows standard hilariously I could find no way of formatting the card to use that file system with the default tools on Windows
11 so I had to use my Mac to format it instead once your SD card is set up and you’ve installed any of the files required by the carts manufacturer go ahead and drag your custom built. GB files into the appropriate place and you should be good to go okay that’s it
That’s all the tools that I use in my personal Game Boy development environment so with all of that covered let’s jump into the demo project really quick and I’ll show you how to use the those tools to build some real code to start if you haven’t already done so
Head over to the NES hacker GitHub and download the demo project with the project downloaded unzip it to your computer somewhere and open up the main project folder in Visual Studio code to build the project open up vscode command pallet and execute the Run build task
Command this will open up a new terminal window in the editor and run the make command to build the ROM from Source remember you have to have both rgbs and make installed in order for this to work so if you’re having trouble setting these up make sure to check out those
Videos pinned in the comment below I have detailed instructions for all the major operating systems once the task finishes that’s pretty much it the ROM has been built simply launch the emulator of your choice load it up and test it out a bit at this point you can
Start diving into the code and making some changes and if you’re feeling adventurous even download a binary pixel art tool like YY CHR to add some Custom Graphics then when you’re happy with the result go ahead and load it up on an ever drive slide into your Game Boy and
Show it off to your friends the next time you’re all together this video was not only supported but it was selected by the paid members on the NES haacker patreon if you want to support the channel while getting access to behind the-scenes updates bonus content and occasionally helping me make decisions you should
Sign up on patreon.com NES haacker today thanks for watching NES haacker if you enjoyed this episode please hit the like button and subscribe to the channel click the Bell icon if you want to be notified when I post new videos on the channel and if you have any questions or
Feedback let me know in the comments
Video Keywords: Software Development Tools, Game Boy,Development,Programming,Assembly,Build Tools,Game Development,Games,Z80,Coding,Dev Environment,Game Boy Dev,Game Boy Programming,Game Boy Coding
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99
macOS Install Guide – https://www.youtube.com/watch?v=WLRq-FcuiPo
Ubuntu Install Guide – https://www.youtube.com/watch?v=5qg7I3Sfmu8
Windows Install Guide – https://www.youtube.com/watch?v=F4eRZeuFwCA
Well now I know what am going to be doing next weekend lol
Very interesting project,
Holy crap. The RGBDS Z80 extension would be great for just looking through code and seeing just what everything does. That just amazes me.
Keep it up! Just Subbed, and it’s exactly the info I’ve been looking for.
Nice Video ! Sub & Big Like ! Love Retro Games !
Would love more of this if it was a series!
I kinda want to sit down and write an emulator/sprite-editor/whatever now
Hmm, interesting video – Me who will never program anything in Assembly nor make a GameBoy game.
Any reason for using assembly with RGBDS as opposed to C with GBDK-2020?
For debugging emulators, I'd like to also suggest Mesen. It was originally a NES/SNES emulator, but it recently added support for GB/C and even PC Engine, and it has universal debugging tools for all of them. Plus it has versions for both Windows and Linux.
VS Code is my go-to editor for almost any coding project.
It's free, has lots of useful extensions, and is (generally) fast and light on system resources (depending on how many extensions you have running).
It's always nice to see fellow programmers keep the old systems alive with new games every year.
I wish all fellow developers all the best with their projects!
Since Microsoft forced their proprietary exFAT format into the SDXC standard, they made it so Windows won't show the fat32 option if your SD card is larger than 32 GB. In the 3DS and Switch hacking scene, the recommended tool for SD formatting on Windows is the venerable Guiformat (fat32format) by Ridgecrop Consultants Ltd.
For those who dont know how to code, or dont want the hard work, you can create game boy games with GB Studio.
Where can I get a shirt like that!?! Awesome video!
Great intro into GB DEV using assembly code, look forward to future installments. Have played around using "C" with GBDK – 2020 and got some reasonable 'Mario' style side scrolling and 'Zelda' style scrolling roms for the GB, for a non programmer. When I get some spare time I have been trying to get my head around assembly coding, as you have said, not that hard but you do need to practice it to get a handle on the nuances of the language. The book "Game Boy Coding Adventure" has been an excellent resource tool for me.
Where the fudge have you been? My processor and I were worried sick. Your trimmer must still be broken, but that's ok I forgive you. Game on… nice video
A couple minor errata:
FAT (and FAT32) aren't windows formats, they were just used by windows by default for a while.
The UEFI partition on your modern computer uses FAT32 to this day 😉
Diskpart on Windows can make FAT32 disks, but it's a command line utility, so be careful!
Where do I get the t shiiiiiiiiirt ❤