How to switch graphic modes on the Commodore C128

Commodore LogoThe C128 had various chips to display different kinds of graphics that man just stuck to the standard 40 column text display for “ease of use” and let their software handle the rest.

To appreciate why these modes existed one had to understand what was happening behind the scenes. Here are the various modes and how to enter them, followed by a brief explanation of why they came to be:

GRAPHIC 0 // switch to 40 column display
GRAPHIC 1 // switch to VIC graphics mode (standard, full screen)
GRAPHIC 2 // switch to VIC graphics mode (standard, split screen)
GRAPHIC 3 // switch to VIC graphics mode (colour, full screen)
GRAPHIC 4 // switch to VIC graphics mode (colour, split screen)
GRAPHIC 5 // switch to 80 column display

Optionally you could add a “clear graphics” parameter by adding a comma (like GRAPHIC 1,0 or GRAPHIC 5,1). 1 would clear the graphic portion while 0 would leave it in memory.

Split screen mode could be used when you wanted the top part of the 40 column display to show graphics and the bottom part text – much like the Magnetic Scrolls text adventures did on the C64:

Lab

You could define where this split would occur with another optional parameter between 0 and 25 (0 being no text, and 25 being all text). When no optional parameter was given the split would occur at line 20, leaving 5 lines of text underneath the “super high resolution multimedia graphics” (and an ugly flickering line where said split occured).

For example:

GRAPHIC 4,1,12 // would set colour graphics mode at line 12

The 80 Column Display

While the VIC chip would take care of the 40 column text and graphic display just like it did on the C64, the 80 coilumn display was powered by a MOS 8563 chip which wasn’t officially supposed to display anything other than text. Even though the hardware did support graphics, BASIC 7 commands did not.

The good news was that this made a dual monitor setup possible – and thanks to VICE we can emulate exactly that. This makes it possible to write programmes on the 80 column display, while creating graphics “live” on the 40 column display. Back in the day with Commodore’s “Dual Monitor” you had to press a button to switch between modes and see your results (most of us just didn’t have two different monitors at our disposal).

Switch to the 80 column display by executing GRAPHIC 5, and type GRAPHIC 0 to switch back to 40 column mode.





Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices. He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.