Next Previous Contents

## 4. Platform specific header files

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

## 4.1 PET specific functions

There are currently no special PET 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.

- cbm_close
- cbm_closedir
- cbm_k_setlfs
- cbm_k_setnam
- cbm_k_load
- cbm_k_save
- cbm_k_open
- cbm_k_close
- cbm_k_readst
- cbm_k_chkin
- cbm_k_ckout
- cbm_k_basin
- cbm_k_bsout
- cbm_k_clrch
- cbm_load
- cbm_open
- cbm_opendir
- cbm_read
- cbm_readdir
- cbm_save
- cbm_write
- get_tv

## 4.3 Hardware access

The following pseudo variables declared in the `pet.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.

`PIA1, PIA2`

  Access to the two PIA (peripheral interface adapter) chips is available via the `PIA1` and `PIA2` variables. The structure behind these variables is explained in `_pia.h`.

`VIA`

  The `VIA` structure allows access to the VIA (versatile interface adapter). See the `_6522.h` header file located in the include directory for the declaration of the structure.

Next Previous Contents