== So... why BASIC? ==

In the demoscene where you're supposed to show off your coding skills and efficiency, BASIC makes little to no sense.
In the PC/DOS demo world, Assembly language is king, followed by C, C++, and Pascal (which is quite small and efficient
when compiled, and allows for inline ASM).  BASIC was established at the birth of the home computer market to allow
anyone to program something, anything, with their computer of choice.  Graphics functions were usually as generic as
possible and didn't dive deep into the computer's unique hardware features.

To answer this question, I have to dig deep into my personal history with computers.

My dad was a hardcore computer hobbyist.  Divorcing when I was very young, he set up a collection of computers
available at the time, including kits he built himself.  When he had my brother and I on the weekends, we'd have
access to all the machinery in the barn and upstairs of his tiny house.  In the mid 80s, there were probably around
ten up-and-running computers total.

My brother and I got our first computer, a Commodore Vic20, in 1983.  It was low spec even for the time but
had a RAM expansion cartridge when needed.  Like the C64 and other home computers, you turned it on, and poof, BASIC
was ready to be programmed.  My dad subscribed to Compute! magazine, among others, which featured neat illustrations
on the cover of games and utilities you could enter into your computer yourself!  Multiple platforms were included,
like C64, Apple II, Atari 8-bit, and IBM PC.  Whenever a game had a Vic20 code list, I'd spend my time entering the
BASIC code, checking I got everything right including the special characters to change color or reverse, and saved
them to the cassette recorder.  It was a fun time for 7-9 year old me.

In elementary school, we had a decent collection of Apple II machines, and a teacher who gave a special programming
class.  I joined that in 3rd grade, and one of the things we learned was lo-res graphics, in a super-blocky 40x40
resolution but at least it allowed 16 colors.  It was good and simple enough for us kids to make pictures, and still 
nicer looking than the monochrome lines and circles of Turtle.  At one point we even made animations.  I made one of
an airplane landing and taking off at an airport.  Around 1985, we were invited to a computer fair which took place 
at the mall in our town (you see, kids, back in my day we had these indoor shopping malls, and they served as a 
community center, with weekly events such as car shows, art shows, and sports cards/collectible trading).  They not 
only showed off the Apple IIs running our animations in the halls while people shopped, but invited us there to work 
on animations, and even gave away prizes.  I consider this my first demo party experience, with a big wink.  I 
remember winning an Apple II t-shirt with the old rainbow logo, which sadly was lost long ago.  At one point I put 
some Transformers iron-ons on it.  It was the most 80s t-shirt I ever owned.

While my dad had several PCs at his house in the 80s, I got my first PC for Christmas 1988, an 8088 XT (or clone) 
with a 10 MB hard drive.  Like the Vic, if you turned it on without a disk, you got ROM BASIC, but in my case I 
could just run it off the HD.  I played with it a little, but without the type-in magazines we had before, didn't do
much.  Getting a copy of Microsoft QuickBasic 4.5 around 1991 renewed my interest, mainly due to the user interface
and not having to number every line.  Inspired by a program called GAGS, I created my own text-adventure game
interpreter called STACK (an equally uninspired acronym for Super Text Adventure Construction Kit).  You entered data
for rooms, items, creatures, and events in a text file, and you got a Zork-style text adventure game.  I went so far
as to include a screen "painter" where you could even change the color palette, and "music"/sound effects which used
the BASIC Play command.  Was it a resounding commercial success? No, but I got a lot of software development and
documentation experience out of it, something my high school didn't have at the time (seriously, they still had
mostly Apple IIs up until my graduation in 1994 - of course the year after, they replaced them all with PCs).

In 1992, I got the Microsoft Basic Professional Development System, aka BasicPDS, which was really an extended
version of QuickBasic, with more capabilities and compiler options.  I also won a copy of Borland Turbo C++ through
a local computer programming contest held by PC (in which, sure enough, we used BASIC, in this case HP's own Business 
Basic), and got my hands on Turbo Pascal as well, but by this point I was hooked on BASIC, so the other two didn't
get as much use.  By chance, this was also the year I was introduced to the (PC) demoscene by a high school classmate,
and the year I got my first sound card, a Sound Blaster Pro.  I got a book which showed how to program the SB in 
C and Pascal, and included the MOD format, but in BASIC I didn't get very far in the sound and graphics department.
I started with some simple VGA routines in 1993, such as a "Scribbler" which drew out dots moving in random directions
in different colors, with a text writer at the bottom.  But by the time I started college with a serious degree in
Computer Science, I knew the BASIC I used in my grade school years was a dead end.

Fast forward to 1996, when we started the fun group DC5 (The Dennis Courtney Five).  Inspired by TPOLM, Rectum Cauda,
and other joke/non-serious groups, our first real production was Beef, a weekend production at the Half-Impulse
house party with Deluxe Paint doodles, live guitar, singing, and a bit of laughter.  In the fall, we had the silly
idea on IRC to hold a QuickBasic coding competition.  I was happy to dig out my copy of QBX and came up with a couple
fast effects.  Afterward, we had the idea to put them together in a demo, and I volunteered.  For music, I found
BWSB (Bells, Whistles and Soundboards) which included BasicPDS libraries.  I wrote music, bundled it together, and
the rather sloppy mini-demo "Cack" was born.  I forgot if that was the compo name but it definitely came from IRC
(maybe Dennis himself).

I realized that QuickBasic was stress relief from the C and C++ I had to use in most of my Computer Science courses.
DC5 taught me not to take the demoscene hobby too seriously, so I felt enabled to keep using it.  The next year, I
made a musicdisk of the tunes I made for a cassette album in 1995, called "Whiplash" with a title pic and minimal 
interface.  That was followed by an Amiga-insipred intro "Fresh Scent" celebrating DennisC's birthday, and Cack 2,
a more ambitious demo than the first, with mostly code by me but some from Basehead as well.  I even got some well-
respected artists and musicians to contribute.  It was intended to be entered at The Party 7 in Denmark, but I 
think Axl forgot.  

For 1998, I took my QuickBasic endeavors further, creating the UI for the Restless 2 diskmag.  I found an SVGA library
that allowed for 640x480x256 colors, and mouse routines as well.  With vertical scrolling and even hyperlinks, it
worked more like a website than the traditional horizontal-scrolling diskmags.  After that I graduated, moved, and
started a career, so QuickBasic was put on hold, but not for long.  In 1999 I came up with a couple intros, Gun and
Gun Remix, the latter for the Spring Break party in California which I visited.  I think that was my first compo
entry I saw on a big screen.  This was a transition year for the PC scene, with DOS demos and trackers giving way to
Windows and MP3s.  Nevertheless, in 2000 I gave QuickBasic one more round with Smackdown, a demo for the Coma 2 party 
in Montreal.  I was able to get it done mainly because I'd quit my first job and had a few weeks of downtime.  The
compo machine ran Windows, but they were still able to run Smackdown, but with SB sound instead of GUS, I believe. 
Also, the projector stalled between graphics mode changes, so that caused a few issues, especially toward the end.
Still, everyone found it entertaining like I hoped they would.  A shame it only placed 6th out of 12, but it went up
against Windows, non-BASIC demos, so I couldn't have expected much more.

I decided to start this collection *after* Smackdown, because I felt the older code was messier, less useful, and
didn't fit in with the newer code.  There's more than enough here to look through. :) 

So, to answer the question, why BASIC, the short answer is, why not?  The long answer is, the demoscene is what you
make of it.  I wanted it to be fun, a diversion from work, and learned that as long as you make something that 
people enjoy, you can consider it successful.  Plus it helped that others felt QuickBasic added novelty and a sense of
talent, like "oh, I didn't know you could do that in QB!".  I want to make one thing clear: I am *not* a talented
coder.  I'm not coding in BASIC because I mastered the other languages and wanted a new challenge.  For what it's 
worth, I actually used Visual Basic a lot in my second job, from 2000-2015, so knowing the language served me well 
both ways.


== Using the code ==

You will need to get Microsoft Basic PDS (Professional Development System) v7.1, which includes the QuickBasic 
Extended (QBX) environment.  If you don't already have it, I won't tell you how to get it, but I'm sure you can
find it if you look hard enough.

Alternatively, you can get Microsoft Visual Basic v1.0 for DOS.  Yes, such a thing existed!  It's actually very
similar to BasicPDS/QBX, just with routines for a textmode GUI (sure, it's kind of like Windows!) and other
concepts which stuck with later versions of VB.  Most code here will compile with very few changes (changing "QBX"
to "VBDOS" in the source and compile .bat being one).  It also adds a 386 instruction set option to the compiler, 
which might get you an extra frame or two per second.

QuickBasic v4.5 might work, but I never bothered to try it, and I'm sure a lot of tweaking would be necessary.
QBasic is right out.

To compile each demo, copy the library files in the root of this zip to your Basic folder, and also copy the files
in the demo folder to your Basic folder, and run the included batch file there.  You will also need a BWSB subfolder 
(see Libraries below) under your Basic folder with those files.  


== Libraries ==

I have included the libraries needed to compile and run the demos in the root folder. .LIB files are used for
compiling with BC, and .QLB files are used for runtime in the QBX environment.  I never used them that way,
however, since running with more than one .QLB can be difficult/impossible.

AdvBas - This is an OLD (1988!) library I only use for the BlockMove function, which I use to copy the frame buffer 
to the screen.  There may be a way to do this using Call Interrupt or such, but the function works for me so I
stuck with it.  I included the doc for it as well.

BasWiz (aka BW, not to be confused with BWSB below) - this is a slightly newer library I only use for the QuickTimer
(QT) functions as a millisecond timer.  I included the doc for it as well.

Bells Whistles & SoundBoards (BWSB) - The music and sound library by OverThrow Machine (OTM) which includes support
for QuickBasic, BasicPDS/QBX, and PowerBasic.  I mostly used v1.20, or 1.21 for more recent demos.  Both can be found
on scene.org, including documentation.

XMS2 - For extended memory.  I don't have the doc for this anymore, but you should have everything you need in the 
code that uses it.

You will also find makelib.bas there.  That's actually for making the .dat files that contain all the assets in the
Data subfolder.  I usually only used it for final versions, since whenever any of the assets changed I'd need to run 
it again.


== Abort Retry Fail - 2009 ==

After a couple of mediocre Windows demos using .werkkzeug, I felt the time was right to return to QuickBasic.  I 
figured what was once behind the times could now be retro-cool.  Embracing the DOS motif, I used a classic VGA text
font, Commander Keen sprites, classic Sound Blaster apps including the talking parrot and Dr. Sbaitso, and ended it 
with a barrage of actual QuickBasic error messages.  A hidden part paying homage to the NVScene 2008 winner Stargazer 
was added after the party.

This was my first attempt at synchronizing and scripting.  Data statements at the end held transform values and times.
It just uses simple linear interpolation, no bezier curves here.  I think the spiked torus shows it off the best.

I also added XMS support in the final version to pre-load everything, and that allowed me to use 320x200 frames for
the meme animation, rather than the blocky ones in the compo version.


== Scroll-o-rama - 2010 ==

I actually lost the code to this one.  Not a huge loss though.  Calculate an x and y value corresponding to a bitmap
for every scrollable pixel on the screen, then add to the x value over time.  The scrollers are just long bitmaps,
and I tried showing that off a little bit on the first one.


== That's the Spirit - 2011 ==

This is just a big mish-mash of simple effects.  Some effects repeat using different parameters, but I didn't put
them into Subs or Functions, so the .bas file got really big.  It actually got too big for the BC compiler, so I
ended up splitting the code into two .bas files, with separate music for each.  I ended up simply using the Run
command to connect them, with a simple config file for part 2 to read.  I later learned that the Common statement
can be used to store arrays and free up base memory while compiling.  Oh well.

Since there were no planned bitmaps other than the font, I added an aspect ratio option that allowed the 320x200
screen to be stretched to 4:3, 16:10, or 16:9.  In the case of the first two, it shrunk the vertical row count,
with the visual space a constant 16:9.  Additional "graphics" were then drawn with circles and boxes according to
the aspect ratio.


== Tranq - 2012 ==

Wanting to shrink the code down, I set a fixed number of effects and moved them into Subs/Functions, with parameters.
Credit must go to Ken Silverman, of "Build" engine fame, for his Quickbasic Wolf3D-style raycaster code, which I 
grabbed and "enhanced" with some extra features.  I wanted to add floor mapping but didn't figure it out in time, so
simple bitmaps were added.  There's an "interactive" mode where you can run around the map and turn features on and
off.  Making the whole (well, almost) demo in grayscale allowed me to add a simple bitmap fader, which is just one of
the parameters in the effects.

I used Call Interrupt to directly switch to VGA mode and back instead of Screen 13.  Thus, the compile .bat includes
qbx.lib (you'd use vbdos.lib instead under Visual Basic 1.0).  It saves some .exe size and is only slightly faster,
but I wanted to squeeze out as many FPS as possible.


== Illegal Telepathy - 2014 ==

It was a Pouet.net meme, which I exploited for laughs. I was just getting too serious with the previous releases.
Everything was kept simple, and effects are reused but not even put in Subs or Functions.  No graphics, I just called
DOS fonts direct from ROM and RAM.  This is a good place to start looking at my code.

The soundtrack is mostly playing back samples at randomly scaling pitch and speed, with consonant/vowel samples
taken from "A Big Bad Robot" from an Assembly oldskool music entry.  I was missing the "L" sample but they were
crappy enough to not notice.  In fact, most of the demo's appeal comes from its randomness, where the effect
parameters are random and the effects themselves are played in random order.

I used OverLink (OL) to append the data files to the .EXE, instead of using my own MakeLib to make a .dat file.  You
can find it in the BWSB Util folder.  Adjust the path in the compile .bat as needed.


== Permanent Damage - 2019 ==

Again, using a limited number of parameterized effects, but the trick here is showing two effects at once.  I noticed
that I changed it so it didn't move all 64000 bytes of the blank or working frame buffer at once.  I think that's
because it caused an overflow on a real DOS PC (or PCem).  I used DOSBox during development which is much more
forgiving of overflows and divide by zeros.


== Exclusive Content - 2020 ==

Somewhat similar concept, only this time it's multiple fill routines each frame, using the same 3D object.  The QT 
timer uses only a 2-byte signed integer, so after 32 seconds, it's done.  I needed to reset the thing and add a "lap" 
variable to handle timing events after the first half-minute. :P