Menu

Welcome to the Intellivision Revolution!

Portable Intybasic development environment document

Setting up a Portable Intellivision Development Environment on Your Android Phone
Written by Michael Hayes
intylab@yahoo.com
Date of Last Modification: December 27, 2019


(Note: don’t let the length of this document intimidate you. It’s designed to be easy-to follow, not concise. Also, this is something you will only have to do once.)


Introduction You have a portable Android phone and a physical keyboard connected to it. You now have some experience developing in IntyBASIC. You would like to do future development using only your phone and keyboard, so you can develop anywhere you’re at in the cracks of time in your busy schedule. You may not know a darn thing about Linux and can’t be bothered to “root” your phone. This document is for you.
Disclaimer I feel it is imperative to put this on the first page: Neither I nor Midnight Blue International, LLC are responsible for anything bad that happens to you or your phone for the use of any of the information in this text. Neither I nor Midnight Blue International, LLC are responsible if you get fired from your job because you got caught writing games on company time. Neither I nor Midnight Blue International, LLC are responsible if your Life Partner walks out on you because you’re too busy making games anymore. Standard data rates apply with your mobile carrier, blah blah blah.
You will need:
A phone with Android 7 or higher and about 550M internal storage space.
A physical keyboard for your phone.
A MicroSD card is not required, but recommended.


 Step 1: Install some apps onto your phone.
You should at least be familiar enough with Android to be able to install apps
onto your phone, all the more so if you could figure out IntyBASIC
development.
Option 1: Using F-Droid

A. Go to https://www.f-droid.org and click on the “Download F-Droid” button.

B. When finished downloading, you should be prompted to install it. If not, find the .apk file in your Downloads folder and run it manually.

C. You will probably get a warning about trying to install an app from an unknown source. Make the necessary changes to allow it to install.

D. When it is finished installing, you should be prompted to Open / Launch / Run it. Do that now.

E. Wait for it to finish Updating Repositories, and then tap on the Search button (a magnifying glass symbol within a round green button in the bottom right corner, just above the selection bar across the bottom) and type “Termux”.

F. Follow the prompts to install Termux. Don’t worry about launching it just yet.

G. Search for “XServer” in the same manner as before and install that. If you can’t find it, then install a VNC client instead.


Option 2: via Google Play Store A. Go to the Google Play Store and install the following apps: I. Termux II. XServer XSDL

 

Step 2: Install the text editor of your choice.
Before opening Termux, first you can take a moment to “shop around” for a
text editor of your choice that you will use within the Termux environment.
This is a decision I am leaving up to you. I had to choose one myself, and emacs is what I chose, since I have been using it since my college years. It’s about 100M in size though. Plus you’ll need to spend some time with the built-in tutorial until you become familiar with the keyboard shortcuts. If storage space is an issue, then I can recommend micro. It’s only 10M in size. There’s also vi, which is pre-installed on Termux, so if you’re familiar with it and don’t want to install something else, then you can skip ahead to the next step.

A. Open your web browser.

B. Go to https://wiki.termux.com/. This is the official Termux Wiki page.

C. Scroll down to “Software” and select that.

D. Select “Editors”.

E. Select “Text Editors”.

F. Decide on a text editor you like best.

G. Most of the available text editors have instructions on how to install them within Termux. Open Termux now and enter the command. For example, to install emacs, enter the command
pkg install emacs

H. You’ll be prompted during the installation how much additional space will be allocated. Enter “y” to confirm.

 

Step 3: Enable Android API calls.
This is necessary for future steps.
If you don’t know what “API” means, take a moment to look it up if you
prefer. Bear in mind though, the purpose of this manual is just to get you up
and running doing Intellivision development on an Android phone, not to give
you a full lecture about Linux.

A. Go back to the Google Play Store or F-Droid and install Termux:API
Note: you need to install Termux:API from the same source that you installed Termux from.

B. Go into Termux again (the session continues running until you tell it to stop) and enter the command
pkg install termux-api

Step 4: Establish contact with the outside world.
Because we’re creating a Linux environment without rooting, there are a few
workarounds we’ll have to implement so we can import files into the “Linux
filesystem” and also export files to the Android filesystem.

A. Enter the command
termux-setup-storage

B. Your phone will ask you to grant Storage permission to Termux at this point.


So what did this do? If you enter the command “ls”, you will notice there is now a folder called “storage” which didn’t exist before. (You know it’s a folder because Termux colors it violet by default.) Within this folder are multiple symbolic links, which Termux colors cyan. There is a link called “shared” which points to your phone’s Internal Storage. The link called “external-1” points to your phone’s External Storage, starting at path “/Android/data/com.termux/files”. From the Linux filesystem, you can now export files to your phone’s /sdcard folder via /storage/shared. You can also update and delete files out there. What you probably can’t do is import files, not directly anyhow. That’s where the next steps come into play.

 

Step 5: Download IntyBASIC.
We are going to get the latest version of IntyBASIC (v1.4.1 at this time of
writing) right from the source, and put it directly into our Linux filesystem. A. Enter these commands:

pkg update && pkg upgrade
pkg install git
pkg install proot
pkg install wget
git clone https://github.com/nanochess/IntyBASIC


You now have a folder called “IntyBASIC” with IntyBASIC in it. In case you don’t know, file and folder names in Linux are case-sensitive. “IntyBASIC” and “intybasic” are not the same, for example, and both can exist within the same folder.

 

Step 6: Install IntyBASIC.
For those of you who are new to Linux, get used to the idea of having to
compile the source code for software packages and not having pre-compiled
binaries (executable files). If a software package is available as an installable
package (such as the text editor from earlier), count it a blessing.
Fortunately, I created this document to hand-hold you through this process. A. Enter these commands:

pkg install clang
cd IntyBASIC/intybasic
clang++ IntyBASIC.cpp code.cpp microcode.cpp node.cpp
-o intybasic_termux
Note: the above command here is a single line, as I mentioned earlier. It doesn’t fit into a single line in this document. Make sure there’s a space between “node.cpp” and “-o”.
cp intybasic_* ~
cd
You might get a warning during compilation here, but it should successfully create
the executable file “intybasic_termux”, which is what you’ll be using.

 

Step 7: Download and Install jzintv/as1600.
We will use a different method than before to get it into the Linux filesystem.
Also, because jzintv is the actual emulator and provides graphics and sound,
you will have to install it yourself, as you did with IntyBASIC.

A. First, enter the command
uname -m This will display your phone’s architecture.

B. Open your phone’s web browser and go here:
atariage.com/forums/topic/283347-portable-intybasic-development-environment

C. Scroll down a bit and find a copy of jzintv that matches your architecture.

D. Go back to Termux and enter the command
termux-storage-get jzintv.zip

E. Android should now pop up a File Selector window. Go to your Downloads folder and select the file you downloaded. It doesn’t matter that the filename of the downloaded .zip file is not “jzintv.zip”; that’s just what it will be called in the Linux filesystem.

F. Enter these commands
unzip jzintv.zip
pkg install make
pkg install x11-repo
pkg install sdl
cd jzintv-20181014-1791/src
make -f Makefile.termux

This is the first big moment of Truth: does jzintv compile? It’s going to take about 10-15 minutes to Make, but I strongly suggest you don’t allow your phone to lock or open up a screensaver while this is happening.

G. Finally, with jzintv compiled, enter these commands
cd
cp jzintv-20181014-1791/bin/as1600 .
cp jzintv-20181014-1791/bin/jzintv .

 

Step 8: Get the rest of the files you need.
Among those files are exec.bin, grom.bin, and ecs.bin, as you probably
already know. You should know how to get them onto your phone, along
with any source files from your current project if you are working on one.

A. Enter the command
termux-storage-get exec.bin

Once again, you will be taken to the File Selector. Select the exec.bin file from wherever you have it.

B. Enter the command
termux-storage-get grom.bin

Select the grom.bin as before. Note we are naming the imported files in all lower case. Remember, file names are case-sensitive in this environment.

C. If you have ecs.bin and want to import that as well, you may do so.

D. If you have any existing projects you want to import, then get out of Termux for a moment and perform the following steps:

I. Using your phone’s built-in Storage app (probably called “My Files”, but it varies across devices), create a folder called “Archive” in your internal storage. (This is where we’ll back up project files outside of the Linux environment, using a script we’ll create later.)

II. Within this Archive folder, create another folder called “IntyBASIC”.

III. Within the Archive folder, create subfolders for each project you are importing.

IV. Use any means (mini USB stick, cloud storage, etc.) to copy all your files from each project into the appropriate project subfolder.

V. From each project folder, zip all the files within that folder into a .zip file.

E. Back in Termux, run these commands:
mkdir projects
cd projects

F. The “mkdir” command was to “MaKe a DIRectory” and the “cd” command was to Change into that Directory. Now, for each project you are importing:

I. Use the “mkdir” command to create a subfolder for that project, same as what you did at step 8D-III above with the Archive folder in your Android filesystem. If your project is named “FUBAR”, it will look like this:
mkdir fubar

II. Go into that subfolder with the command
cd fubar

III. Run the command
termux-storage-get fubar.zip

and select the zip file for that project from your Android filesystem. It should be in the Archive folder you created at step 8D-I.

IV. Run the command
unzip fubar.zip

V. Run the command
cd .. to return to the “projects” folder.

VI. Repeat for any additional projects you are importing.

G. Since we are leaving the IntyBASIC binary in the Home folder, take some time now to modify the INCLUDE statements in your source file(s).
This is a good time to become familiar with your text editor. Install a different one
if you prefer. Because of the limited interchange allowed between the two filesystems, you will want to use one of these text editors instead of one available as a separate Android app. If you choose to do your work in a text environment and you don’t want to keep opening and closing your text editor each time you want to compile and assemble your project, then you can follow these steps to have multiple Termux sessions running concurrently: A. Swipe from the left edge of the screen. B. Tap “New Session”. You can use one session to keep the text editor open, and another session handy to run scripts. I personally keep three sessions open, the third one to have another instance of emacs running to modify scripts or other files as needed. C. To alternate between sessions, swipe from the left and tap the number of the session you want. D. To close a session, enter the command “exit”.

 

future steps to be uploaded soon