GWBASIC1GWBASIC for C64 startup screen opening up a whole new world for the C64

There have been two or three different approaches to fixing the totally inadequate, crappy Commodore BASIC V2 on the C64. These involve extending BASIC or replacing it completely. Extended BASIC packages usually, but not always, choose to prefix each extended command with a character usually not used in BASIC commands, such as an @ symbol, or an exclamation mark. The crappy Commodore BASIC V2 interpreter could be copied from ROM to RAM and modified to look out for these characters, then go to a new routine to deal with them. One method is to rewrite an error vector to point to your new code, but of course I have no real idea how this is done. This is because it shouldn’t be necessary in the first place. Other alternative BASICs, such as Simons’ BASIC and Laser BASIC totally replace Commodore BASIC V2, not requiring their commands to be prefixed by any special characters, but Simons’ BASIC keeps the Commodore abbreviations for commands, while Laser BASIC doesn’t. Some extended BASICs for the C64, such as Applesoft BASIC on , don’t require special characters, but don’t totally replace Commodore BASIC V2, because the Commodore abbreviated commands still work.

GWBASIC2GWBASIC for C64 with a white on black colour scheme

Now read on for details of a quick fix for the Commodore 64.

I was pleasantly surprised, or even shocked when I recently found and downloaded a copy of something called “GWBASIC VER 1.0” by Mariani G & Sorgato F on the website . This enables people to program computers even if they’re not good at maths. I demand this right! According to the details listed, it’s been there since September 2009, but I’ve found out it was originally created in 1987! It has 26111 bytes free. The function keys are already defined and can be redefined with the KEY [n],[string] command, although the strings can’t be very long. Unfortunately, the list of function key definitions don’t get their own window and only the keys F1 (LIST), F3 (LOAD”), F5 (CONT+CHR$(13)), and F7 (TROFF+CHR$(13)) are displayed, because the display doesn’t change when you press the Shift key. The other key definitions are F2 (RUN+CHR$(13)), F4 (SAVE”), F6 (TRON+CHR$(13)), and F8 (KEY). I started to type in some of the amazing Microsoft Extended BASIC commands I originally learnt from reading MSX magazines in 1984, because MSX BASIC is heavily influenced by and an update to Microsoft’s GW BASIC for MS-DOS, as well as their Tandy Color BASIC/Dragon BASIC. These commands include SCREEN [n] and LINE (x1,y1)-(x2,y2). Unfortunately, I found out I couldn’t clear the C64 graphics screen with a simple SCREEN 1 command, so this version of GWBASIC isn’t all I’d hoped for. It may require the routine from my “DRAWING THE LINE” series. The Commodore abbreviated commands still work as well. Further investigation revealed that it was originally released by an Italian company called Systems or Systems something who produced Commodore 64 specialist magazines such as “Commodore Computer Club” which were actually in Italian! This means TMR thinks they’re “totally irrelevant”. Not only that, but I found this out, as well as news of their MS-DOS simulator from , a page which is written in German, so that makes it even more irrelevant, as far as TMR is concerned!

GWBASIC4A GWBASIC program to draw a line from the top left to bottom right hand corner of the C64 hires screen

I investigated further and found out that there were later versions of this GWBASIC software for the Commodore 64! I downloaded V2 from to see what improvements there were, hoping it would clear the graphics screen with just a SCREEN 1 or even SCREEN 1:CLS. I tried this and it worked! It has 23295 BASIC bytes free at startup, but the potential this gives you is amazing! LOCATE [y,x] also works to position the text cursor. I was soon able to have it drawing a line from the top left hand corner to the bottom right hand corner of the screen, just like on an MSX computer and in roughly the MSX default colours! Congratulations, Microsoft! Here’s how I did it, without a PEEK or POKE in sight…

GWBASIC5The result of the line drawing program

10 SCREEN 1:COLOR 15,1,1:CLS
20 LINE (0,0)-(319,199),1
30 GOTO 30

The C64 colours have been renumbered to make them similar to GW BASIC. Line 30 just stops the program returning to the text screen, the same as MSX BASIC would always automatically do, then print an error message if there was one. You need to hit RUN STOP and RESTORE to break out of this, similar to MSX CTRL and STOP. The screen numbers SCREEN 0 (text) and SCREEN 1 up to 15 (graphics) seem to be available, but are mainly the same hires or lores C64 graphics display modes, compared to SCREEN 0 (mono text with up to 40 columns), SCREEN 1 (multicolour text in up to 32 columns with sprites), SCREEN 2 (hires graphics with sprites), and SCREEN 3 (blocky graphics with sprites) on MSX. Apart from this, the number 1 following the comma at the end of the LINE command selects the colour, but it seems only the colours 0 and 1 are available, otherwise you get an ILLEGAL QUANTITY error, so I’ll have to investigate further. Giving another COLOR command only succeeded in changing the colour of the line already there, as well as drawing another line in the same colour. Unfortunately, when I tried to SAVE the program listed above I got the error message “Disk not ready”, but I think that copying the relevant GWBASIC file or files onto another disk image, or a real floppy disk will probably fix that. Now it looks like people reading this can have all the fun of typing in lots of GW BASIC listings, such as for the IBM PC and the short lived IBM PC Jr (which was killed off partly by biased Commodore ads) from books, as well as for these and the Tandy “Coco” from “Compute!” magazine, and even Dragon/Tandy “Coco” BASIC listings from INPUT magazine with slight modifications! The changes you need to make include multiplying or dividing the screen coordinates, as well as replacing the Tandy/Dragon PRINT@[n] with LOCATE [y,x]:PRINT , but I’m not sure what other alterations may be needed at the moment. PMODE n,n and PCLS are commands I never read in MSX BASIC listings, and they don’t work in this implementation of GWBASIC for the C64 either. Obviously, PEEKs and POKEs for Dragon, Tandy, and PCs won’t work with GWBASIC for the C64.

Don’t forget there’s also a Spectrum emulator which enables you to have all the fun of programming in Sinclair BASIC on your C64! You can find it on the “totally irrelevant” .

I think that what all of this shows is how powerful the classic GW BASIC is, as well as the fairly compatible QBASIC. Unfortunately, Visual BASIC isn’t really BASIC at all.

That’s all for now! I think I’ll go and play with my Atari Assembler Editor and study some more Polish.


Posted July 16, 2014 by C64hater in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: