BAM's interpreter is a modified version of wwwBASIC embedded in the BAM single file. (So that BAM does not have external dependencies, i.e. fully self-contained.)
One of the many enhancements to wwwBASIC in BAM: vertical upward scrolling of the screen when PRINTING has reached the bottom of the screen. (As of this writing, I'm in the midst of some technical reorganization of the documentation, sothis archived version, might be useful.)
I want "alpha-blending" (is that the right word?), but I don't want to modify everything in the interpreter to handle "rgba" colors.
So I'm thinking I should instead put together an "Alpha-Blending" include library with BASIC subroutines and functions.
To test the idea, I've got this "RgbaPset" subroutine, and I think it is working correctly. This test program draws a blue square, and two smaller yellow squares on top, both yellow, but one with no opacity at all (i.e. opaque = 255), the other with semi-opacity (full opacity = 0).
I think I've got this right. Might need to sleep on it:
BASIC Anywhere Machine being a TiddlyWiki instance, we have available to us TiddlyWiki scripting as a metaprogramming/macro language.
Before the text for our BASIC program gets bound to the interpreter into an HTML page fed to an iframe which displays the running program, the BASIC program gets processed by TiddlyWiki (TiddlyWiki acting as a preprocessor). Any TiddlyWiki scripting is rendered into text.
Further below, you'll find an image of the resulting BASIC code, followed by the TiddlyWiki scripting code.
Note that if we were to use the scripting in a BASIC program, we'd only need to add lines like:
<<AREA "...">>("..." being the string of coordinates.)
The scripting that does the work, it would be TiddlyWiki stuff hidden way behind the scenes, triggered to do the magic when that <<AREA "...">> macro reference is encountered during "preprocessing" when we RUN the program.
The code in dark red is what we would have in our program, and the in black is what would be generated, replacing the code in red.
And the TiddlyWiki scripting going on behind the scenes (stuff you never need to know about, and only look at if you are interested):
My greatest goal with BAM is to easily give good old BASIC programs from the 70's, 80's, and early 90's a new lease on life, to celebrate the good stuff folk created back in the day.
I love the ideas of getting these old programs running again in the web browser (offline as well as online), so that pretty much anybody with any kind of device with a standards compliant web browser can run these BASIC programs without having to install any software of any kind, or have any special hardware requirements or particular operating system.
So multi-platform to the max.
Although this reddit is about anything BAM including retro-programming, retro-programming stuff specific to BAM I also share programs and discuss over at the RetroCoders Community.
If you are interested in BAM-specific retro-programming or anything else retro-programming, come over and visit the RetroCoders Community. I think a little bit of community "cross-pollination" would be a cool and great thing.
Please make sure to view the BAM source code for some notes regarding how I've altered the code a bit, one to address something to keep in mind regarding BAM (there are certain TiddlyWiki markup symbols that our BAM programs should never use, documentation pending), and I changed a couple of RND statements that I think need to also be done to the QB port. (PENDING SOME TESTING !!!)
How cool is that? A program written for the ATARI 2600 SpectraVideo CompuMate, ported without too much futzing to QB, and then from QB to BAM with even less futzing. Resurrecting old code like that, what awesome fun!
This has a long way to go before it gets to where I want it. Also, I'm reviewing the bits I had done and making some changes, so you might find some bits and pieces a little bit broken .
However, the following topics in the "BAM Language Reference" subject are stable (these are direct links to the pages):
The topics and content in the subject Bibliography
The draft Demonstration Programs and Runs page. (This page showcases something I've always wanted in documentation: the ability to run example programs "right there", and to try your own code "right there" too. )
BASIC, because it is for programming in that programming language. The "why BASIC", I'll tackle that in a separate post.
Anywhere, because of simple requirements:
An instance of BASIC Anywhere Machine is just one HTML file (a "quine"), so everything that makes BASIC Anywhere Machine work and any program you create with it: they are all in that one file; every time you save your program(s), you are saving your program(s) along with everything that makes BASIC Anywhere Machine work to new HTML file, or overwriting the original file; all of that to say, it is an easy-peasy no-install-required file.
you only need a standards-compliant web browser
you can use it offline if you download it and store it locally (thumbdrive, SD card, hard drive ...)
This reddit is for anything at all related to BASIC Anywhere Machine (short name: "BAM").
If you are the kind of person who excitedly celebrates BASIC (anything and everything BASIC, without any judgement and any discrimination), you will definitely fit in here.