Greetings from scenic "No GIS Position Available"!

HOWTO Play With Your Old QBasic Programs on Linux

Date/Time Permalink: 03/31/07 01:21:43 pm
Category: HOWTOs and Guides

Most any geek who was a kid in the 80's played with BASIC at some point. And the BASIC language with one of the biggest followings is Microsoft QBasic - Microsoft's sole nod to the hobbyist programmer community. Dozens of online sites exist today that are devoted to QBasic, Quick Basic, and Basica, existing in much the same spheres as the surviving BBS/ ANSI art culture. If you still have some old floppies with archives of BASIC programs from your juvenile years which you'd like to revisit, here's how to do it on a Linux box:

Step 1: Get a copy of DOSbox. DOSbox is a no-brainer to install and set up, with its main dependency being the SDL library. Once you have that in, I recommend creating a directory named /DOS/ under your home directory - note that this is a plain old ext2 (or whatever you have set up) file system directory, you don't need to create a special FAT or DOS partition. Thereafter, starting your simulated DOS environment will involve starting DOSbox, typing "mount c ~/DOS/", then typing "c:", and you can then type "dir" to see that you're in your simulated "C:\" drive. Wasn't that easy?

Step 2: Find a QBasic version to download! Here's one. This is tricky - these sites come and go, and Microsoft, which hasn't supported QBasic for centuries, plays peek-a-boo with these DOS legacy program downloads all the time - it's a 50/50 break whether you can get the Microsoft site or an MS Windows system to admit that QBasic ever existed. Rumors abound of hidden folders on install disks. The last version goes by the string "QB45.ZIP" and when you've hunted it down, unzip it to a folder in your /DOS/ directory.

Next you have to format two floppies as DOS and write the disk packages to each. After that, mount the disks in the usual way in Linux, then 'mount' them in DOSbox with "mount a" and your floppy directory, then mount your "C:\" drive, cd to the A:\ directory and run "SETUP.EXE". Follow directions from there. NOTE: As Max Atkin points out in the comments, you can also have the disk images in your directory path and mount them that way without physical floppies.

Step 3: I didn't even bother with installing the second disk, since I'm not interested in making any more binary .EXE files, and the second disk is mainly support for the compiler. QB.EXE runs just fine with the install from disk one, and will be able to read your .BAS files. You can try out the demo BASIC programs included in the "EXAMPLES" directory. Everything works just like you remember, with your embarrassing old graphics demos and munchkin hax running in glorious 640x480 16 mode.

QB screenshot 1
A Mandelbrot demo from the example programs.

QB screenshot 2
One of my graphic demos.

QB screenshot 3
A hilarious drawing program I did, because I missed the old Apple MacDraw drawing mirrors feature so much.

QB screenshot 4
The splash screen to an old tank shooter game I did. You aren't missing a thing by not playing it, believe me!

QB screenshot 5
Who didn't do a hangman game in their learning days?

QB screenshot 6
A draw poker demo game I did. Yes, I drew each card in my own invented bitmap format, saved as plain data files, because QBasic back then didn't have a way to display bitmaps that I was aware of.

Step 4: Thank your lucky stars that you've come a long way since these days!

3 feedbacks Follow me on Twitter for an update every time this blog gets a post.
Stumble it Digg this Reddit this add to Delicious share on Facebook

Comments:

Comment from: Roy Schestowitz [Visitor] · http://schestowitz.com
Nice to see that while closed and proprietary platforms embrace obsolescence, GNU/Linux brings the past back (no, not exclusively in this context). Nice blog BTW.
Comment from: Max Atkin [Visitor]
You don't need to create actual floppies. Once you have unzipped the QB45.zip just mount the DISK1 directory with mount a /path/to/DISK1 and run setup from A: in dosbox
Comment from: Graham L. Wilson [Visitor] · http://piga.yoll.net
Yeah, I run my old QBasic programs from Dosbox a lot. Though I actually still use it for development as it is the development tool of choice in many occasions for FreeDOS for example and can be easily ported to GNU/Linux versions of BASIC such as FreeBASIC or in my case command-line Gambas.

Also playing through the many wonders of the QB golden age between 1997-2003 or thereabouts and am quite impressed what people did with ol' QB - even Doom-clones as well as many RPG, platform, adventure and even strategy games!

Sadly things that use certain user-hacked library extensions (QB by default didn't support libraries) like the infamous DirectX wrapper "DirectQB" don't work in Dosbox under GNU/Linux.

Posting here now in case someone else comes here from the QBasic Wikipedia article.


Your URL will be displayed.
Allowed XHTML tags:
p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, a,
span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite,
abbr, acronym, q, sub, sup, tt, i, b, big, small, pre
Options:
 
(Line breaks become <br />)
(Set cookies for name & url)
images required for CAPTCHA viewing

Alphabet letters and digits 2,3,4,6,7,8,9. The digits 0,1, and 5 are NOT used.

Enter the letters/numbers in the CAPTCHA picture above:
My apology to readers for the hassle. I don't like CAPTCHAs any more
than you do. But we all hate spam even more, and this seems to be an
effective way to stop it.
suddenly the moon