$29
Provided Files
Installation Files
tasks.json
devkitProUpdater-3.0.3.exe
vbam-2.1.0.zip
Sample Project
main.c
Makefile
Files to Edit/Add
● Makefile
Instructions
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 doesn’t matter. You can just accept the defaults and click Next.
Select “Use System Proxy Settings” and click next.
Select the first mirror site in the list, then click next.
This part is complicated, so pay close attention. In the search bar, type“gcc-core”. Click the plus next to the category “Devel” and find the package titled exactly “gcc-core”. Find the icon to the left of the “Skip” for that package, and click it. The word “Skip” will transform into the version number for the package. Pick version 7.4.0-1 (this version differs from the version highlighted in the picture below, but trust us, you want 7.4.0-1).
Back in the search bar, type “gcc-g++”. Click the plus next to the category “Devel” and find the package titled exactly “gcc-g++”. Click on the word “skip”, and it will
transform into the version number for the package. Select the same version as before.
Again, in the search bar, type “gdb”. Click the plus next to the category “Devel” and find the package titled exactly “gdb”. Click on the word “skip”, and it will transform into the version number for the package.
One last time, in the search bar, type “make”. Click the plus next to the category “Devel” and find the package titled exactly “make”. Click on the word “skip”, and it will transform into the version number for the package.
Click next, then next again, then wait quite a while for everything to finish.
14. Uncheck the two boxes (or don’t; it’s your clutter, not mine) and then click finish.
The last thing we need to do is add Cygwin’s 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. For example, the default should be “C:\cygwin64\bin”. 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 – VisualBoyAdvance-M
VisualBoyAdvance-M is your emulator. Since we can now compile and format our code, it would be useless if we couldn’t actually run it. So let’s 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 file. Extract the vbam-2.0.1.zip file.
Find the folder it creates once unzipped, and move it somewhere that you will not move or delete until this class is over. Next to the Cygwin folder will usually suffice.
Make note of this location, because you will have to find it in a later step.
That’s all have to do for VisualBoyAdvance-M.
● Part Three – devkitARM
Click on “devkitProUpdater-3.0.3.exe” provided in the Lab00 folder and hit next.
Click “Download and install/ install from downloaded files” and hit Next.
3. 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 it looks like it’s going to fail, but it won’t).
After the install finishes, the last thing we need to do is add devkitARM’s bin folder to our System path, just like we did with Cygwin. 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 devkitPro (the location I told you to remember earlier) and add “\devkitARM\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 devkitPro (the location I told you to remember earlier) and add “\devkitARM\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.
If you have any terminal windows (or text editors) open right now, close and reopen them.
Part Four – Makefile
Open the Makefile in the provided files with a text editor. Near the beginning of this file, 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 new devkitPro folder (you don’t 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.1.0 folder, add “\bin” to the end, then add “\visualboyadvance-m.exe”. If there are any spaces in the path, surround it in quotes.
Type “ctrl + shift + p” and in the box that pops up, type “Convert Indentation to Tabs”, as seen in the picture below. Select the “Convert Indentation to Tabs” option.
Make sure the result looks something like the following picture
Save the file.
Part Five – VS Code
We can make the process even more streamlined by incorporating the
compilation process into our text editor. For this class, we are now encouraging you to use VSCode. Even if you have VSCode installed, do not skip these steps.
If you don’t have VSCode installed, download it from the project website, https://code.visualstudio.com/download
Pick the "User Installer" for Windows 7/8/10 for your system (32 vs 64-bit)
Once you have it installed, open the Lab00 folder from VS code. This will open the Lab00 folder as a VS Code workspace folder.
Click “TerminalConfigure Default Build Tasks”, and replace the default code with the code provided in the Lab00.zip (tasks.json).
Restart VS Code. Open main.c and then hit ctrl+shift+b. You should see output in the console that looks something like the following picture.
Then, you should also see a GBA game running that looks something like the following picture.If so, you are done with the lab and may follow the submission instructions! :D If not, there is an issue somewhere, so notify a TA!
Submission Instructions
Zip up the entire sample project folder, including all source files, the Makefile, and everything produced during compilation (including the .gba file). Submit this zip on Canvas.
Name your submission Lab00_FirstnameLastname, for example:“Lab00_MarieZimmerman.zip”.