Visual batariBasic (vbB) - 2008
In Jan 2008 I saw this thread about 2600 IDE not supporting .bas files > 64K. That got me thinking about developing an integrated development environment for batariBasic. So I guess Atar2600land should get credit for inspiring VisualbB because if I hadn’t read that post I would have never thought about it. Anyway I figured that it was a limitation of the COM control being used. I vaguely remember that being a limitation in Visual Studio 6. Since I was getting into writing some games using bB I thought it would be nice to create an IDE without limitation. I also liked the idea of visually editing sprites and playfields so late on a Sunday night I set out to recreate 2600IDE using Visual Basic 2008. It took about 2 days to create sprite and playfield editors like 2600IDE.
One I got the basics working though I decided it needed to be a bit more sophisticated. I noticed that game authors were creating a lot of different games and that reuse of sprites and playfields might be convenient. I also like Visual Studio (using it since VS5) so I wanted to create a complete development environment for batari Basic. Why should bB users be limited to notepad like environments?
I spent another 2 weeks coding at night to mimic a Visual Studio-like experience. At that point everything was done except for compilation. I figured I could just call the same set of executables in 2600.bat and capture standard output into a message window. Unfortunately the way the bB compiler works that doesn’t work for errors!! I spent a good week trying to find a way to do it, but in the end if there is a compilation error I call the batch file, write to a temp file and parse the temp file. It’s ugly but it gives the illusion of being compiled in the IDE.
Probably about a month or so in I gave a copy to Random Terrain. A great number of features were direct feedback from RT, too many to even list. Redo/Undo was a pretty big one, because there are so many actions that can be completed in the sprite/playfield editors that it probably took 2 weeks to implement that. The color coding was probably the single biggest RT feature request to implement. That required building a comprehensive dictionary of bB terms along with keeping track of user defined variables, functions, labels, etc… Because I am just using a standard Rich Text Box Control I have to detect a term, select it, and color code it appropriately. Because code files can be relatively big, remember the inspiration was to support > 64K (I believe vBB is limited to 1M characters), I do the color coding in a background thread. For multi-core systems this allows one of the CPUs to do the text searching while allowing the user to also use vbB. Ever open multiple .bas files at once? You’ll notice the CPU usage spike and shorter codes will load faster. Yes that load time is all color coding. Disable color coding and files should open instantaneously.
Once color coding was done it was logical to develop a runtime code checking and intellisense. It seemed simple enough. Another month later that was done…
One feature I started at the very begging, but never finished, allowed you to change a sprite/playfield then automatically update all the code files using that sprite/playfield. In the end it was a dumb idea as it was impossible to detect if a sprite changed so I ditched it, even though a majority of the code is still there. If sprites/playfields had a naming scheme it would be possible!
vbB has so many features that unless you read RT’s manual you probably one of them. One of the coolest is generate items from code. Let’s say you like an author’s playfield or sprite and all you have is their .bas file. You can right click on the .bas file in vBB and choose generate code. It will parse the code and create the corresponding sprites, playfields, or data blocks. It’s not perfect, but there is a ton of logic in there looking for code patterns. For the most part it will allow you to generate these items. It’s also really nice if you wrote your code prior to using vbB and you don’t want to recreate items by hand.
I still have some improvements I’d like to make, but for the most part it’s complete. You can download the latest here.

0 Comments
Recommended Comments
There are no comments to display.