Next Previous Contents

4. Platform specific header files

Programs containing C128 specific code may use the c128.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 c128.h and declares several functions common to all CBM platforms.

4.1 C128 specific functions

The functions listed below are special for the C128. See the function reference for declaration and usage.

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 c128.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.

VIC

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

SID

The SID structure allows access to the SID (the sound interface device). See the _sid.h header file located in the include directory for the declaration of the structure.

VDC

The VDC structure allows access to the VDC (the video display controller). See the _vdc.h header file located in the include directory for the declaration of the structure.

CIA1, CIA2

Access to the two CIA (complex interface adapter) chips is available via the CIA1 and CIA2 variables. The structure behind these variables is explained in _6526.h.

COLOR_RAM

A character array that mirrors the color RAM of the C64 at $D800.


Next Previous Contents