Commodore‎ > ‎C128‎ > ‎

BASIC 7.80

BASIC 7.80 is a language extension for BASIC version 7.0 on the Commodore 128.  It makes all of the bitmap commands run on the 80-column (VDC) screen!  If you have ever used a Plus/4 or the 40-column mode of the C128, then you've probably seen how useful the bitmap commands are for various software (applications, games, etc.) but until now it was not possible to use these commands in the 80-column mode.
Going off-topic for historical reasons, there is a well-known BASIC 8 which adds many commands to BASIC v7 for use on the 80-column screen.  Some of them are unique to BASIC 8, but most of them duplicate v7 commands using a 100% incompatible Syntax!  Personally this annoys me.  Besides my own preferences, other (more serious) issues with BASIC 8 include the fact that using any 40-column bitmap command or the cassette will crash the system!  Also, the kludge BASIC 8 uses to implement new commands means that error trapping is working differently (I would say "broken").  Anyway, my BASIC 7.80 is 99.9% compatible with BASIC versions 3.5 and 7.0.  This means it is very easy to port software from Plus/4 or 40-column C128 (it would be a huge nightmare with BASIC 8).
  What Works  
BASIC 7.80 does not add any new commands.  It just makes existing v3.5 and v7.0 bitmap commands work on the 80-column display:
Note the links above are to standard Commodore BASIC, not my enhanced BASIC 7.80.  So some of the parameters will be different; see the section "Differences" below for details.
Download the BASIC 7.80 distribution here.  It includes a D64 disk image with program BASIC 7.80; just RUN it.  It will auto-boot if in drive 8 when the C128 is turned on.  The BASIC 7.80 program is also included as a raw "prg" type file if you like to use hard drive / SD2IEC.  It includes a ReadMe file in HTML format that duplicates a lot of the stuff said here (but gives a few more details and some history).  It also includes the source code, in case you want to see how it works or try to add the missing features... (see blow)
The download includes four (4) BASIC programs that were rather simply converted from a 40-column version.  The Mandelbrot program should not be tried unless you have a SuperCPU or are prepared to let the software run for several hours!!  Yes, BASIC 7.80 works fine with SuperCPU (in which case, Mandelbrot runs in less than 30 minutes).

If you only have 16K VDC RAM, then only monochrome bitmap mode (GRAPHIC 6) is possible.  With 64K VDC RAM, either monochrome or "standard" 8x8 color cells is possible (with GRAPHIC 8).

I am thanking Mirkosoft who motivated me to finish this (I've been working on it since 1992?); he also peformed several tests.  He tested it on 64K V-RAM (I only have 16K) and he tested it with a SuperCPU (which I do not own).  This software would not be "bullet proof" without his contributions, so thanks again to Miro!  (If it should fail, I'll take the blame because I wrote the code.)
  Not Working  
Due to hardware differences between VDC and VIC-IIe chips, not everything works. These are:
  • Multi-color bitmap modes. The VDC can not display 4 colors in a single cell. You might be able to emulate this with interlace mode.
  • Split-screen modes.  The VDC does not have a raster interrupt.  Should be possible with synchronized CIA interrupt.
  • Sprites.  The VDC does not have hardware sprites.  In bitmap mode, you could (slowly) emulate them in software.  More tricky in text mode!
  • Some colors.  The VDC does not have medium gray or orange.  I recommend substition of dark cyan and brown.

There are several reasons why the above do not work in BASIC 7.80, described briefly above.  But mainly this is for performance.  Implementing most of them in software would be potentially slow or unreliable.  In any case, it would make the code more complex, and likely (as a consequence) slow down BASIC.  As I said before, the source code is included if you would like to try making any of those features work.  If you succeed, please contact me so we can let everybody know about your amazing achievement!

As you might expect, there are some differences between the 40-column and 80-column versions of the same BASIC command/function/statement!  In summary, these are:
  • The default (no SCALE) bitmap width is 640 pixels (the height is still 200 pixels)
  • GRAPHIC 6 is used for monochrome (comparable to GRAPHIC 1 in standard BASIC)
  • GRAPHIC 8 is used for color bitmaps (comparable to GRAPHIC 3 in standard BASIC)
  • COLOR 6, n is used to set bitmap background (COLOR 1, n is still used to set bitmap foreground)
  • A few of the COLORs are numbered differently or not possible at all (same values as standard 80-column text colors)
Probably the most confusing is the RGR (return graphic mode) function.  In standard BASIC, this returns a value of 0 to 4 (when using the 40-column screen).  In standard BASIC, it may also return 5 to 9 which means the 80-column text screen is active (5 or more) and a 40-column bitmap is active (more than 5).  In BASIC 7.80, there are more values which may be returned.  These are values of 10 or more when an 80-column bitmap screen is active... I will list them below, but the general idea is each 80-column mode is multiplied by 5 and then added to the 40-column mode.  So the list of values returned by RGR are now:
RGR return value VDC Mode VIC-IIe Mode
0 Text Text
1 Text High-resolution bitmap
2 Text High-resolution split-screen
3 Text Multi-color bitmap
4 Text Multi-color split-screen
5 Text Text
6* Text High-resolution bitmap
7* Text High-resolution split-screen
8* Text Multi-color bitmap
9* Text Multi-color split-screen
10* Monochrome Text
11* Monochrome High-resolution bitmap
12* Monochrome High-resolution split-screen
13* Monochrome Multi-color bitmap
14* Monochrome Multi-color split-screen
15** Monochrome split-screen Text
16** Monochrome split-screen High-resolution bitmap
17** Monochrome split-screen High-resolution split-screen
18** Monochrome split-screen Multi-color bitmap
19** Monochrome split-screen Multi-color split-screen
20* Color bitmap Text
21* Color bitmap High-resolution bitmap
22* Color bitmap High-resolution split-screen
23* Color bitmap Multi-color bitmap
24* Color bitmap Multi-color split-screen
25** Color split-screen Text
26** Color split-screen High-resolution bitmap
27** Color split-screen High-resolution split-screen
28** Color split-screen Multi-color bitmap
29** Color split-screen Multi-color split-screen

The values marked with any asterisk (*) are unique to my BASIC 7.80.  Those with 1 asterisk are really possible.  Those with 2 asterisks (**) are resevered for future versions (i.e., split-screen).  Some table entries use Text (bold font) to indicate which of the two full-screen text editors are active (via the KERNAL / Editor).  For example, if RGR returns 0, then both 40- and 80-column displays are in text mode, but the 40-column screen is active (the word Text is bold under VIC-IIe).  In contrast, when RGR returns 5 then both 40- and 80-column displays are in text mode, but the 80-column screen is active (the word Text is bold under VDC).  Sorry if that is confusing, but I did not make this up!  This is standard behavior of BASIC 7.0; I just extended the idea for 80-column bitmap modes.

  The Future...  
Several people have already asked/suggested more features, such as color bitmap for 16K VRAM users, or smaller cells (like 8x2) for 64K VRAM users.  In both cases, this would require re-definition of the standard 8x8 cell size or the standard 80x25 cell count (i.e. 640x200 bitmap pixels).  Because standard BASIC does not allow such things, BASIC 7.80 can not allow such things because, by design, BASIC 7.80 adds no new features!  (BASIC 7.80 only allows old/existing commands to work on the 80-column screen.)
However, I think those are worthy goals.  In particular, I personally only have 16K VRAM, so allowing the use of full color (besides simple monochrome) would be very nice.  But that would require a smaller cell count (such as 79x24 cells or 78x23 cells).  Also, smaller cells (like 8x2) is very important because the VDC can not handle more than 2 colors in a single cell.  Another cool feature would be interlace bitmap mode!  Well, hopefully one day I will find the time to add such features, and call that new version 7.85 (or something like that).  But right now I am busy with other projects so don't hold your breath!!  Of course if you have the time and skill, go ahead and do it and let me know.  You can be confident I'll let everyone know how awesome you are (check out my other pages if you have any doubt how I credit others).

© H2Obsession, 2006, 2014, 2015