Next Previous Contents

## 4. Platform specific header files

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

## 4.1 CBM 510 specific functions

The functions listed below are special for the CBM 510. 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 `cbm510.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!

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

`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