SlowCoder Posted September 17, 2011 Share Posted September 17, 2011 Tutorial: batari Basic on Ubuntu 11.04 Here's how to do it: 1. Open a terminal window. 2. Create a directory in the root of your home directory called "bB": $ mkdir ~/bB 3. Download both the Linux static binary 1.0, and the Windows/DOS 1.0 packages from here: http://bataribasic.com/download.html, and save both of them to your desktop. On this date, the Linux package is called bB_Linux_binaries_version_1.0.zip, and the Windows/DOS package is called batari_Basic_version_1.0.zip. 4. Right-click each zipped package and choose "Extract here". Two new directories will be created, one for each package. 5. Back in the terminal window, copy the entire Linux binaries package to your bB directory: $ cp -v ~/Desktop/bB_Linux_binaries_version_1.0/* ~/bB 6. Copy ONLY the include files from the includes directory of the Windows/DOS package: $ cp -v ~/Desktop/batari_Basic_version_1.0/includes/* ~/bB Note that there is a difference in the Windows/DOS, and Linux packages, and the relative locations of the include files. In the Windows/DOS package, the files are in an includes subdirectory, whereas the Linux package wants the include files in the root of the bB directory. The last thing we need to do is create the bB environment variable, and add the bB directory to the PATH environment variable. 7. While still in the terminal window, open the ~/.bashrc file for editing: $ gedit ~/.bashrc 8. Insert (copy/paste or type) the following commands to the END of the .bashrc file: bB="$HOME/bB" export bB PATH="$PATH:$bB" export PATH At this point the install/config of the batari Basic compiler is completed. In order to properly compile your source to binary, you will need to copy your source .bas file to the ~/bB directory, and run $ ./2600basic.sh filename.bas from within the ~/bB directory to compile your code. Hopefully you will get something like this: $ ./2600basic.sh MyGame.bas Starting build of MyGame.bas 2600 Basic compilation complete. DASM V2.20.09, Macro Assembler (C)1988-2003 bytes of ROM space left 2737 bytes of ROM space left Complete. Build complete. Upon successful compile, 2 new files will be created with names similar to the original source file. If your source file was called MyGame.bas, you will find a file called MyGame.bas.asm, and MyGame.bin. MyGame.bin is your finished ROM, and you should be able to play it in a 2600 emulator such as Stella, or copy it to your Harmony cart and play on your real console! You can delete the .asm file. Some errors you might see: Starting build of MyGame.bas 2600basic: option requires an argument -- i usage: 2600basic -r <variable redefs file> -i <includes path> Compilation failed. This is caused by incorrectly configured bB environment variable. Check that you have correctly performed step 8 of the install procedure above. Default for this tutorial is $HOME/bB. If you chose to have your directory elsewhere, you need to make sure that change is reflected in step 8. Cannot open [filename].inc for reading 1. This is an indication that the include files did not get copied correctly. Remember that the include files need to be copied from the includes subdirectory of the Windows/DOS package, and into the root of the bB directory. In the Linux install, ALL files reside in the root of the bB directory. 2. You will also get this error if you attempt to compile from outside the bB directory. You need to copy your .bas file to the bB directory, enter the directory using the terminal and run $ cd ~/bB $ ./2600basic.sh filename.bas 2 Quote Link to comment Share on other sites More sharing options...
STGraves Posted June 3, 2015 Share Posted June 3, 2015 I keep getting the same error: (1) Parse error: unrecognized character: ";" what I'm I doing wrong? Quote Link to comment Share on other sites More sharing options...
RevEng Posted June 3, 2015 Share Posted June 3, 2015 The 1.0 version at bataribasic.com is pretty old, and missing several bug fixes and DPC support. The version referenced here has Linux x86 binaries, updated dasm, and an install script to update your profile. If you prefer compiling your own binaries, just "make" in the bB directory. Quote Link to comment Share on other sites More sharing options...
STGraves Posted June 3, 2015 Share Posted June 3, 2015 Thanks RevEng it worked perfectly on ubuntu 12.04¡¡¡¡¡ Quote Link to comment Share on other sites More sharing options...
STGraves Posted June 5, 2015 Share Posted June 5, 2015 I have encountered a problem, when I compile a .bas file on terminal but on a past compiling had a assembly error it doesn't allow to compile the file anymore, what can I do? Quote Link to comment Share on other sites More sharing options...
RevEng Posted June 5, 2015 Share Posted June 5, 2015 Never saw that before. Try posting the terminal output, the .bas, and the list file produced too. Quote Link to comment Share on other sites More sharing options...
STGraves Posted June 5, 2015 Share Posted June 5, 2015 Ok, the list file?, and how can I paste the terminal output I'm kind of new on ubuntu xD. Quote Link to comment Share on other sites More sharing options...
RevEng Posted June 5, 2015 Share Posted June 5, 2015 Look for a file named [YOURPROJECTNAME].bas.list.txt. Its a troubleshooting file that this version of bB produces by default when assembling the binary. If it's not present in the directory, it will indicate the problem happened prior to dasm taking bB's output. For copying and pasting from a term window in Ubuntu, the quick way is to drag across all of the text, and then click in the place you want to paste it with your middle mouse button. This works in most Unix GUI environments. If you don't have a 3 button mouse or don't like that style, you can also drag across the text, right-click on the highlighted text and choose copy, right-click in the AA submission area and choose paste. Quote Link to comment Share on other sites More sharing options...
STGraves Posted June 6, 2015 Share Posted June 6, 2015 (edited) This happens to me every time I try to compile, the error here was a assembly code I added to the game code but I deleted it, and it still says it. stgraves@stgraves-laptop:~/bB$ ./2600basic.sh etsrev3.bas Found dasm version: DASM 2.20.11 unofficial 20140202a Starting build of etsrev3.bas batari Basic v1.01dreveng37 ©2005-2014 2600 Basic compilation complete. etsrev3.bas.asm (2245): error: Syntax Error ''. etsrev3.bas.asm (2245): error: Illegal Addressing mode 'lda ='. Unrecoverable error(s) in pass, aborting assembly! Complete. Build complete. etsrev3.bas.list.txt Edited June 6, 2015 by STGraves Quote Link to comment Share on other sites More sharing options...
STGraves Posted June 6, 2015 Share Posted June 6, 2015 I've solved the problem, I was calling the same function twice in the same loop, thanks for the help though 1 Quote Link to comment Share on other sites More sharing options...
STGraves Posted June 8, 2015 Share Posted June 8, 2015 Can I run img2code on ubuntu? Quote Link to comment Share on other sites More sharing options...
RevEng Posted June 8, 2015 Share Posted June 8, 2015 I was able to successfully run img2code using wine a few times in the past. Quote Link to comment Share on other sites More sharing options...
STGraves Posted June 8, 2015 Share Posted June 8, 2015 Really? I couldn't, and really tried a lot Quote Link to comment Share on other sites More sharing options...
RevEng Posted June 8, 2015 Share Posted June 8, 2015 Dunno. That was a while back. Maybe later versions don't run under Wine. Quote Link to comment Share on other sites More sharing options...
STGraves Posted June 8, 2015 Share Posted June 8, 2015 Yeah because it asks for .net framework, I tried to install it, but no success at all Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 11, 2015 Share Posted November 11, 2015 Hi I have one question why it tells me "cannot open bankswitch.inc for reading"? Quote Link to comment Share on other sites More sharing options...
RevEng Posted November 12, 2015 Share Posted November 12, 2015 Can't say exactly, with just the one error, but it sounds like it can't find the bB include directory. Try re-running the install_ux.sh file in the bB directory, and close+reopen all your terminal windows. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.