Lesson 0 - Setting up the development environment

In the beginning, I'll try to make it easy for you to setup a framework under Windows that hopefully does compile a very simple example code and ends up building the encrypted ISO after the whole process. There is a bit of nuisance to make things work at first and more steps than in other retro platforms, that I have automated and provided the necessary tools inside the project folder for you. I'll try to explain few things, even if I don't know everything about the 3DO System files provided (which I have copied from Doom ISO as this version seems to have better support for some peripherals like the mouse, than the original one I used from an old homebrew example). If we need to add some files in the future, I'll be providing them in the next tutorials. For now, if you succeed in compiling this one, this will be your base to copy later source code from the next tutorials.

I will be providing three archives that you will extract as is on the root. The ARM C compiler, the 3DO SDK and the project framework all ready with code, makefile, CD System files and the necessary tools. I prefer to do it this way than tell you to go to different links and download them on your own. Sometimes links are broken or are more cumbersome to extract (for example, the ARM C compiler I found in some old archive was an install executable that had to be run in an old version of Windows, so I rather ZIPed mine so that you can extract all the necessary files easily).

Necessary files


Installation

Extract ARM251.zip and 3DODev.zip as they are directly at the root of your HD. You would expect two directories, C:\ARM251 and C:\3DODev to be created. You can then extract 3DObaseProject.zip wherever you want, so if you had a folder C:\Projects\3DO then you could just extract it there and have C:\Projects\3DO\3DObaseProject inside created. But the Compiler and 3DO API folders have to be extracted exactly like they are prepared in the C: root, for the project to compile based on the provided makefile. However, it's easy to edit the first two lines of the makefile if you just want to place those two anywhere else.

One more step necessary, might be to change the windows enviroment variables, so that make will be visible from anywhere. Unless you have already previously setup make for other projects, you need to find the environment variables for your system and edit the path to include C:\3DODev\bin where I have copied make for windows. In Windows 10, you can click on the start button and start typing "Environment variables" till "Edit the system environment variables" will appear. Then click the down right button Environment Variables, double click on the PATH variable in your User Variables and in the new window that opens, you can click New and type C:\3DODev\bin or whatever path you have installed make if you prefer.

In previous Windows it might be different, but usually you can right click on My Computer->Properties->Advance System Settings->Environment Variables and there you have it. If you need help with that part, you can ask me, but I think if you have used makefiles in windows before, you might be familiar with this process already.

Testing

Enter the 3DO base project folder and click on the compile.bat batchfile. This will run make and pause the output under windows, so that you can see if everything went alright. If it is so, then you should see something like this output.



This has build a binary named LaunchMe inside src. That's your main executable and what will have to be in the root of your CD. You can run now the buildAndSign.bat batch file for the whole process of copying LaunchMe on the prepared CD folder, convert to Opera file system (the CD file system used by 3DO) and encrypt it. There are two tools used here and they are all prepared for you. 3DOIso by nikk is a command line tool that takes the CD folder and creates the ISO file. This will sit outside on the root of the project folder as demo.iso. This ISO will fail to run on a real 3DO (and on emulators unless you have a hacked BIOS) as there is an encryption that prevents you to simply create your own ISO and run it as it is without a signing tool. That was bad news for homebrew (the irony is that meanwhile a direct copy of a commercial CD would just work, so you were given the green light for piracy but not homebrew) and it wasn't that long time ago it was hacked (another reason the 3DO doesn't have as much homebrew history, something I wish to change :). So, now the tool 3DOEncrypt.exe by Charles Doty will do the work. You can see if everything went allright by looking at the output of this batch file (too long to include as a picture) but try running it on a 3DO emulator and see if it's running or booting back to the 3DO logo after a crash.

You should expect to see this opening screen. Followed by the main demo which simply will randomly flash the background color.




One final thing to say here, this banner screen is obligatory. It seems to be tied in with the loading process (The OS expects it on the root of the CD as the file BannerScreen) and if you don't add it, the CD ISO will fail to load even if you signed it with the encryption tool. At least trying to remove it always failed for me, but in worse case, if you don't want it then you can replace it with a black screen. Have a look at tools/banner folder where a 3rd tool is there, that takes a BMP picture (this one is 320*240*24bpp) and converts it to the BannerScreen file and then copies it inside CD folder. You can carefully open this with a painting program and edit it or replace it with your own banner as you desire.

There are still things that I don't know about the 3DO file system, OS and how all of these come together, so if I have more information I'll talk about it in the future (even the provided files on the CD folder are taken from other places without knowing much yet about some of the files inside), but now I've prepared an as easy as possible framework to make the introduction to new developers easier. In the next lesson I will explain the main code in this test hello world example, which currently erases the framebuffer using the CPU, but I will provide with a much faster hardware method to clean the background fast, and I will also explain how to initialize the screen and a main rendering loop before we draw anything.