Jump to content
Zendocon

Portable IntyBASIC Development Environment

Recommended Posts

Instructions on how to do all future Intellivision programming through IntyBASIC using only an Android device and a physical keyboard.

 

Most of what I wanted to say are in the musings at the end of the document. What I want to emphasize here, is what the purpose of the document is, and what it isn't.

 

This is just meant to help people who might not know anything about Linux to create a simple Linux environment to do IntyBASIC development using nothing more than a phone/tablet and a physical keyboard.

 

I am by no means an expert in Linux. There are a lot of technical inaccuracies and possible falsehoods I left in place on purpose, because the intended audience here are people who aren't interested in the technical details.

 

What that means is, I know there are probably some revisions that will need to be made, but for any Linux "power users" here, stick to the point of getting a simple Linux environment going for Inty Development and nothing else. I certainly want to alter this document in the direction of making the process easier and more failsafe though.

 

Anyhow, I hope this is helpful to all of you.

Portable Development Environment.pdf

Edited by Zendocon
  • Like 4

Share this post


Link to post
Share on other sites

Just as a comment, you can avoid getting a Github account if you download the IntyBASIC distribution ZIP to your cellphone using the button Desktop View directly from https://github.com/nanochess/IntyBASIC.

 

At least in my phone, clicking that ZIP file uncompresses it, and then using My Files, you move the *.cpp and *.h files to the root of Downloads folder, and copy them individually to your termux folder.

 

cp /storage/downloads/*.cpp .
cp /storage/downloads/*.h .

Share this post


Link to post
Share on other sites

Great write up, but why don't you use the built-in compile functionality in Emacs, or would that not work in the Termux environment? If you want, I have previously posted intybasic-mode.el which I configure with the paths to the compiler and assembler and don't have to exit the editor.

  • Like 2

Share this post


Link to post
Share on other sites

Great write up, but why don't you use the built-in compile functionality in Emacs, or would that not work in the Termux environment? If you want, I have previously posted intybasic-mode.el which I configure with the paths to the compiler and assembler and don't have to exit the editor.

I wanted to allow the end user to choose any text editor. I haven't been active on Atariage lately, but yes, I would personally love to have any emacs script and syntax-highlighting files you've got.

  • Like 1

Share this post


Link to post
Share on other sites

While the script has support for syntax highlighting, I never bothered implementing the IntyBASIC keywords into it. Instead it currently uses syntax highlighting for 6502 assembly code, which was the origin of my script... feel free to improve upon that if you like.

 

At the very least, you need to configure intyb-ccpath and intyb-aspath.

 

Also note that if the compiler is successful, it moves directly to the assembler stage. I saw from your build scripts that you have more complex setups with multiple input files, more like a make file, where my approach might be better suited for projects with a single source file that includes other sources and ready made binaries.

 

intybasic-mode.zip

  • Like 2

Share this post


Link to post
Share on other sites

Thank you very much for this! Although compilation and assembly within emacs is useful as well, the one thing I wanted is syntax highlighting.

 

I didn't immediately get it working though. I did modify the two lines you mentioned. I assume the file just goes into the Home directory. Maybe I need to set permissions, like I did with my .emacs file?

 

I looked at a .asm file from an earlier project, and emacs colored the syntax and added an "Asm" menu. I'll see if I can tweak it to do the same thing in the existing environment.

Share this post


Link to post
Share on other sites

You would have to M-x load-library and the file must be in a library folder like ~/site-lisp/ or whatever it is called. Or all the Elisp code evaluated manually of course.

Edited by carlsson

Share this post


Link to post
Share on other sites

The path to site-lisp is "/data/data/com.termux/files/usr/share/emacs/site-lisp" in this environment. I put the file there and tried M-x load-library as well as M-x load-file (I kept a copy in the home directory), but I keep getting the message that the variable values are void. Any idea why?

Share this post


Link to post
Share on other sites

Not really. I've got a very old Android tablet with an USB keyboard that I haven't used for a couple of years. Maybe I'll have a look to see if it is recent enough to install the environment and have a try.

(And yes, even back then I installed a mostly read-only environment of Emacs on the tablet to at least have an IRC client...)

Share this post


Link to post
Share on other sites

I discovered my problem from earlier. I forgot to wrap quotes around the path names. It was an elisp syntax issue.

 

Now I can use M-x file-load and get emacs to read the file, but still nothing happens in the way of syntax highlighting. Also, with my phone and the keyboard bound to it, neither the Alt nor Cmd keys seem to be bound to Meta, so for that I would be forced to write a script to make emacs do the syntax highlighting automatically for *.bas files.

  • Like 1

Share this post


Link to post
Share on other sites

The syntax highlighting lies in the (defvar intyb-font-lock-keywords) but as I wrote, I never really added the IntyBASIC keywords to the list. At the very least, labels at the leftmost column and code indented by a tab should have different colours.

 

Funny, for most part I find syntax highlighting a form of decorating the Christmas tree while I have good use of all the other functionality but YMMV.

Share this post


Link to post
Share on other sites

If you don't like having to go in and out of the text editor each time you want to run the Make script, you can swipe from the left edge of the screen and start a New Session. That way, you have one session with your editor always open, and another one with just a prompt.

 

I made a few modifications to the original document, which includes an addendum with the above information. I'll wait a little bit before posting it though. I don't want too many revisions floating around.

Share this post


Link to post
Share on other sites

I got the syntax highlighting working yesterday! The next step was to modify the .emacs file to add these two lines at the end:

 

(load-file "~/intybasic-mode.el")

(setq major-mode 'intybasic-mode)

 

In addition to that, I modified the one chunk of code within intybasic-mode.el to define the IntyBASIC syntax. It's probably not perfect, but it works. Also, keep in mind that words that begin at the leftmost column of a line are treated as labels.

 



(defvar intyb-font-lock-keywords

'(

("\\(;.*\\|'.*\\)$" . font-lock-comment-face)

("[ \t]+\\(rem\\)\\b" . font-lock-comment-face)

("^\\([a-zA-Z0-9_:]+\\)\\b" . font-lock-constant-face)

("[ \t]+\\(d[csv].[bwl]?\\|signed\\|unsigned\\|const\\|dim\\|packed\\|varptr\\|bitmap\\|music\\)\\b" . font-lock-type-face)

("[ \t]+\\(org\\|stack_check\\)\\b" . font-lock-warning-face)

("[ \t]+\\(include\\|goto\\|gosub\\|return\\|if\\|then\\|elseif\\|else\\|end\\|for\\|to\\|step\\|next\\|while\\|wend\\|do\\|until\\|loop\\|exit\\|on\\|wait\\|restore\\|read\\|data\\|define\\|alternate\\|sound\\|sprite\\|cls\\|print\\|at\\|color\\|scroll\\|border\\|mode\\|screen\\|play\\|simple\\|full\\|no\\|drums\\|none\\|volume\\|repeat\\|stop\\|jump\\|voice\\|init\\|number\\|flash\\|erase\\|write\\|peek\\|poke\\)\\b" . font-lock-variable-name-face)

("[ \t]+\\(option\\|warnings\\|off\\|explicit\\|procedure\\|def\\|fn\\|asm\\|call\\|name\\|usr\\)\\b" . font-lock-builtin-face)

("[ \t]+\\(and\\|or\\|xor\\|not\\|abs\\|sgn\\|cont1\\|cont2\\|col0\\|col1\\|col2\\|col3\\|col4\\|col5\\|col6\\|col7\\|rand\\|random\\|frame\\|ntsc\\|backtab\\|up\\|down\\|left\\|right\\|button\\|b0\\|b1\\|b2\\|key\\|cont3\\|cont4\\|len\\|pos\\|mobshadow\\|first\\|last\\|playing\\|available\\)\\b" . font-lock-keyword-face)

)

"Expressions to highlight in intyb-mode.")

Edited by Zendocon
Hide the highlighting text
  • Like 1

Share this post


Link to post
Share on other sites

I believe it is good practise to indent with at least 1-2 spaces or a tab character, even if it may not be strictly required.¨

 

If you remove the regexp [ \t]+ at the start of the expression, you should get highlighting even without indented code.

Share this post


Link to post
Share on other sites

I didn't want to post too many revisions to the original document, but I think now is a good time.

 

Changes include:

 

An addendum for a few extra things like a Source Backup script as well as making the change to the Path permanent.

 

A semantic correction: in several places I referred to the Home folder as the Root folder.

Portable Development Environment.pdf

Share this post


Link to post
Share on other sites

Here is one of two Companion Volumes I created to supplement the original volume. This one is about easily maintaining multiple projects in this Linux environment. The filename ends in "3" only because I created the other Companion Volume first. That other Companion Volume discusses having a graphical environment with jzintv running in it. I've had that finished for a while now, but I'm waiting to release it until I know whether I can post somewhere the build of jzintv that works in this environment. For now though, I think this will be helpful for those of you that want to have more than one project concurrently.

Portable Development Environment 3.pdf

Share this post


Link to post
Share on other sites

Okay. At long last, here is the Companion Volume to create a graphical environment for Termux that runs jzintv. This is necessary if you want to add JLP support to your game, since jzintv4droid doesn't support JLP.

 

Also included here is an update to the other Companion Volume. I had to make corrections to the Run script.

 

Finally, here are the builds of jzintv that are working in Termux. I included the modified source, the Makefile, and also the pre-compiled binaries for jzintv and as1600. Run "uname -m" to determine your device's architecture. The two devices I am using are "arm" and "aarch64."

 

If there are any issues, do let me know right away. Enjoy!

jzintv-20181014-1791-arm.zip

jzintv-20181014-1791-aarch64.zip

Portable Development Environment 3.pdf

Portable Development Environment 2.pdf

  • Like 1

Share this post


Link to post
Share on other sites

It's time for an update to these documents, now that I'm done finishing FUBAR.

 

I had been meaning to combine the three volumes into a single volume since I posted all this originally. That and I made some more changes to the environment that I think are useful.

 

Any questions or feedback, just let me know.

Portable Development Environment Complete.pdf

Share this post


Link to post
Share on other sites

I made an update a couple weeks ago. Just after the Table Of Contents, I list the changes I made. There was a correction and a typo to fix, plus a few things to add.

 

The most significant change is the Play script, to easily play all your other games in this environment. I guess I was too busy having fun with this to get around to posting the update sooner.

Portable Development Environment Complete.pdf

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...