Next Previous Contents

## 4. Platform specific header files

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

## 4.1 CBM 610 specific functions

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

- peekbsys
- peekwsys
- pokebsys
- pokewsys

## 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 `cbm610.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.

Note: All I/O chips are located in the system bank (bank 15) and can therefore not be accessed like on other platforms. Please use one of the `peekbsys`, `peekwsys`, `pokebsys` and `pokewsys` functions to access the I/O chips. Direct reads and writes to the structures named below will not work!

`CRTC`

  The `CRTC` structure allows access to the CRTC (the video controller). See the `_6545.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.

`ACIA`

  Access to the ACIA (the RS232 chip) is available via the `ACIA` variable. See the `_6551.h` header file located in the include directory for the declaration of the structure.

`CIA`

  Access to the CIA chip is available via the `CIA` variable. See the `_6526.h` header file located in the include directory for the declaration of the structure.

`TPI1, TPI2`

  The two 6525 triport chips may be accessed by using this variable. See the `_6525.h` header file located in the include directory for the declaration of the structure.

Next Previous Contents