The first step in programming the Virtual Boy is to get your working environment up and running. Here's a description how to set up a text editor called UltraEdit as a powerful frontend for the gccVB Compiler. If you follow these instructions, you'll be able to go from coding to emulating, quickly, without messing with a command line!
First, download the following files:
-
Reality Boy or another emulator of your choice (To run and test the compiled *.vb file)
UltraEdit (This is the frontend where we'll write our code)
make.bat (The batch file which we will call from UEdit, it will do all the work)
After getting those, unpack the archives and install UltraEdit. If you want to use another editor, you'll have to adapt these instructions to your own editor. There are others with the features we need, but this is the one we use, so live with it! :D You won't be disappointed, trust me. Go ahead, I'll wait.
…
Welcome back!
Now, this thing will do almost anything you would ever want to do to ASCII text (in this case, our source code).
One of the things we want is syntax highlighting. This will color certain words/symbols so our code is easier to read. The built-in C word file should work okay with gccVB, but feel free to modify it. Also, be sure to setup the colors the way you like them.
The other ability we need is that of running external programs and passing the file we're currently editing as an argument. In this case, we'll use it to call gccVB to compile our source, then call Reality Boy to emulate the resulting ROM image, all with two mouse clicks!
Here's how to set up the compiler as a User Tool:
1) Click the menu: "Advanced | Tool Configuration". A box will open for editing the tools.
2) Click "Browse…" next to the text box under "Command Line:". Use the dialog to find make.bat. For example: C:\gccvb\bin\make.bat.
3) Add a space to the end of the text box, then "%P%N".
4) For the name, choose "&GCCVB", this will make the G into an underlined accelerator in the menu.
5) Check the "Check if Windows Program" and "Save all files first" boxes. Optionally, click "Advanced…" and browse to a tool-bar icon of your choice (see the end of this howto for some downloadable ones).
6) Click "Insert" to insert it in the menu.
Note that make.bat assumes that your gccvb is in C:\gccvb\, so if you have it at another location, you need to change the paths in make.bat.
Now, repeat the above instructions for the emulator, but change the Command Line to that of your emulator. For example, if you use Reality Boy with two seperate screens for left and right eye as well as a red palette, it's:
C:\rboy\rboy.exe %P%N.vb -dspmode side -pallet red
This will most likely be different from yours. The only constant should be that the ROM file is always referred to as "%P%N.vb". To make a proper command line for your needs, use the following table (taken from Reality Boy's readme.txt):
-display (320, 640, 640v2, 800, 800v2, 1024, 1024v2)
The screen resolution, v2 means VESA2 Linear Frame Buffer. 640×480 is the default resolution.
-dspmode (normal, red_blue, interlace, over_under, side, cscope)
Normal is default. If you want red/green glasses, use red_blue and pass in rg for the palette. Interlaced should support most shutter glasses as well as I-glasses (read your manual).
-frmskp (0-9)
Number of frames to skip (not display) before refreshing the display.
-pallet (normal, red, rb, rg, rbg)
rb, rg, rbg are the options for the Red/Blue glasses (there red-blue, red-green, red-bluegreen).
-brite (0-127)
Lighten or darken the display, 64 is default, bigger numbers lighten, smaller numbers darken.
-flip
flip the 3D efects (you can hit '[' and ']' while in the game to do this as well).
-debug
go into debug mode.
-fixpal
force a fixed palette; ignore the brightness registers.
Next, uncheck the "Save All Files" box. Whether the "Windows Program" box is checked or not depends on which emulator you have. For MS-DOS versions of Reality Boy and Red Dragon, it should be cleared. For Windows versions it should, of course, be checked.
Here are some buttons for you to use: RBoy: rboy.bmp RD: rd.bmp gccVB: gccvb.bmp, type an appropriate name, and click insert.
To see those icons, you have to edit the tool bar. To do so, right click the tool bar and select "Customize…", a box will pop up. Click "Toolbars" on the left side, then "New Toolbar" on the right side, directly under "Operations". You'll then have to give it name, for example "VBDev", but actually it's unimportant how you call it. Place the new tool bar in the menu, preferably left of the File Tabs, which hold the names of the files you are editing, and add the RBoy and gccVB Tools to it. To do this just click "Commands" on the left side and drag&drop "Tool 1" and "Tool 2" from "Commands | Advanced" to the new tool-bar. The default tool-bar is lacking the "Redo" and "Undo" buttons, so you should add them as well (from "Commands | Edit").
You might also want to add a function list by clicking "View | Views/Lists | Function List", so you can easily get to every single function in your program without searching the whole code again and again.
Now, you should be able to edit your VB C source code in purty colors, compile it, and emulate the ROM, all right from the editor. Continue with the next tutorials to actually start programming for Virtual Boy.
Happy Coding :)
Discussion