Next Previous Contents

4. Platform specific header files

Programs containing VIC20 specific code may use the vic20.h or cbm.h header files. Using the later may be an option when writing code for more than one CBM platform, since it includes vic20.h and declares several functions common to all CBM platforms.

4.1 VIC20 specific functions

There are currently no special VIC20 functions.

4.2 CBM specific functions

Some functions are available for all (or at least most) of the Commodore machines. See the function reference for declaration and usage.

4.3 Hardware access

The following pseudo variables declared in the vic20.h header file do allow access to hardware located in the address space. Some variables are structures, accessing the struct fields will access the chip registers.


The VIC structure allows access to the VIC (the graphics controller). See the _vic.h header file located in the include directory for the declaration of the structure.


Access to the two VIA (versatile interface adapter) chips is available via the VIA1 and VIA2 variables. The structure behind these variables is explained in _6522.h.


A character array that mirrors the color RAM of the VIC20 at $9600.

Next Previous Contents