In this lab, you will be installing the software to write, compile, and run GBA games for this class. It is broken up into various parts. If any part does not produce the expected outcome, alert a TA and fix the problem before continuing.
- Part One Cygwin
Cygwin is what students running Windows will use as a C Compiler. This is the biggest difference between the Windows and Mac installations, since the Mac folk (usually) already have a C Compiler installed.
- Go to the project website, https://www.cygwin.com/
- If your computer is 64-bit, click on setup-x86_64.exe. Otherwise, click on setup-x86.exe.
- Open the folder where it downloaded and run that file.
- On the first popup, click next. Then, select Install from the Internet and click next.
- Choose the directory where you want Cygwin to install. This must be somewhere that you will not move or delete until this class is over. Make note of this location, because you will have to find it in a later step. Then click next.
- This next part doesnt matter. You can just accept the default and click next.
- Select Use System Proxy Settings and click next.
- Select the first mirror site in the list, the click next.
- This part is complicated, so pay close attention. In the search bar, type
gcc-core. Click the plus next to the category All and the category
Devel and find the package titled exactly gcc-core. Find the arrow to the right of the Skip for that package, and click it. Select the latest version that does not say (test) by it.
- Back in the search bar, type gcc-g++. Find the package titled exactly gcc-g++. Find the arrow to the right of the Skip for that package, and click it. Select the latest version that does not say (test) by it.
- Again, in the search bar, type gdb. Find the package titled exactly gdb.
Find the arrow to the right of the Skip for that package, and click it. Select the latest version that does not say (test) by it.
- One last time, in the search bar, type make. Find the package titled exactly make. Find the arrow to the right of the Skip for that package, and click it. Select the latest version that does not say (test) by it.
- Click next, then next again, then wait quite a while for everything to finish.
- Uncheck the two boxes (or dont; its your clutter, not mine) and then click finish.
- The last thing we need to do is add Cygwins bin folder to our System path. Open Control Panel, then go to System and Security, then System, then Advanced System Settings.
- In the dialog, click Environmental Variables.
- In the new dialog, under System Variables (not User Variables), select Path and click Edit.
- This new screen will depend on which version of Windows you are running.
- If it is an organized list of items (like in the picture below), click New, and in the blank that opens up, copy the exact path to where you installed Cygwin (the location I told you to remember earlier) and add bin to the end. Then press Enter.
- If it is a singular text box, move the cursor all the way to the end, type a semicolon, and then copy the exact path to where you installed Cygwin (the location I told you to remember earlier) and add bin to the end. If it has any spaces in it, surround the whole thing in quotes (not including the semicolon you added before).
- Press OK on all of the Control Panel dialogs you have opened thus far.
- Open Command Prompt.
- Type gcc and press enter. If what you see is something like the picture below, you installed Cygwin correctly. If not, alert a TA.
Congrats! You have completed the hard part. You are free to delete all of the things associated with this part in your Downloads folder (unless of course you were crazy enough to install Cygwin there).
- Part Two devkitARM
DevkitARM is your development kit for the Game Boy Advance, created by a group called devkitPro. Without it, we can compile C code, but not actually format the result for the Gameboy. So lets fix that.
- Go to the project website, https://github.com/devkitPro/installer/releases
- Click on devkitProUpdater-3.0.3.exe to download it.
- When the download finishes, open it, then hit Next.
- Click Download and install/ install from downloaded files and hit Next.
- Select Remove downloaded files and hit Next.
- During this step, deselect everything in the list except GBA, and hit Next.
- Select a destination folder somewhere that you will not move or delete until this class is over. The same folder where you put Cygwin will usually suffice. Make note of this location, because you will have to find it in a later step.
- When asked to choose the Start Menu Folder, put whatever you want. The default is fine. Hit Next, wait for the install to finish (it will take a long time, and open a bunch of strange terminal windows, and look like its going to fail, but it wont).
Thats all you have to do for devkitARM. Easy, right?
- Part Three VisualBoyAdvance-M
VisualBoyAdvance-M is your emulator. Since we can now compile and format our code, it would be useless if we couldnt actually run it. So lets fix that.
- Note: if you already have a GBA emulator that you are comfortable with, I still highly recommend you use this one for this class. It has some special features that will come in handy for debugging.
- Downloading this from its website requires having 7-Zip installed, so I provided it to you in a .zip Extract this file.
- Find the folder it creates once unzipped, and move it somewhere that you will not move or delete until this class is over. The same folder where you put Cygwin and devkitARM will usually suffice. Make note of this location, because you will have to find it in a later step.
Thats all have to do for VisualBoyAdvance-M. Even easier.
- Part Four Makefile
Now that we have installed everything, we need to set up the compilation process so that we dont have to run 1,000 commands every time we want to compile our code. C uses Makefiles for this. I have provided one for you, but it needs to know where to find the things you just installed.
- In the provided Sample Project, find Makefile and open with a text editor (like Notepad or Sublime Text). Near the beginning, you will see three lines that end in =.
- After the = next to CCPATH, type the exact path to the cygwin (or cygwin64) folder, and add bin to the end. If there are any spaces in the path, surround it in quotes.
- After the = next to DKPATH, type the exact path to the devkitPro folder (you dont need to add anything to the end for this one). If there are any spaces in the path, surround it in quotes.
- After the = next to VBASIM, type the exact path to the vbam-2.0.1 folder, add bin to the end, then add visualboyadvance-m.exe. If there are any spaces in the path, surround it in quotes.
- Make sure the result looks something like the following picture.
- Save and close the file.
Congrats. We now officially have everything it takes to simply compile, format, and run GBA games. Now lets make it simpler.
- Part Five Sublime Text
We can make the process even more streamlined by incorporating the compilation process into our text editor. For this class, we highly encourage Sublime Text. Even if you have Sublime Text installed, do not skip these steps.
- If you dont have Sublime Text installed, download it from the project website, https://www.sublimetext.com/3. I dont need to walk you through this installation process; its user-friendly enough.
- Once you have Sublime Text installed, open it, then go to Tools, then Build System, then click New Build System
- It will open a new file. Delete everything in it, then paste in everything from the provided txt.
- Save it in the folder it suggests when you hit save, and title it
GBA.sublime-build.
- Close everything in Sublime Text, and then close Sublime Text.
- Reopen Sublime Text, then use it to open Makefile in the Sample Project folder.
- Go to Tools, then Build System, and make sure GBA is selected.
- Go to Tools, then Build With, then select Run.
After completing all of these steps, you should see output in the console at the bottom of Sublime Text that looks something like the following picture.
You should also see a GBA game running that looks something like the following picture.
If so, you are done with the lab. If not, there is an issue somewhere
Reviews
There are no reviews yet.