llvm-mos-sdk
Macros | Functions
c128.h File Reference
#include <_vic2.h>
#include <_sid.h>
#include <_vdc.h>
#include <_6526.h>
Include dependency graph for c128.h:

Go to the source code of this file.

Macros

#define CH_F1   133
 
#define CH_F2   137
 
#define CH_F3   134
 
#define CH_F4   138
 
#define CH_F5   135
 
#define CH_F6   139
 
#define CH_F7   136
 
#define CH_F8   140
 
#define COLOR_BLACK   0x00
 
#define COLOR_WHITE   0x01
 
#define COLOR_RED   0x02
 
#define COLOR_CYAN   0x03
 
#define COLOR_PURPLE   0x04
 
#define COLOR_GREEN   0x05
 
#define COLOR_BLUE   0x06
 
#define COLOR_YELLOW   0x07
 
#define COLOR_ORANGE   0x08
 
#define COLOR_BROWN   0x09
 
#define COLOR_LIGHTRED   0x0A
 
#define COLOR_GRAY1   0x0B
 
#define COLOR_GRAY2   0x0C
 
#define COLOR_LIGHTGREEN   0x0D
 
#define COLOR_LIGHTBLUE   0x0E
 
#define COLOR_GRAY3   0x0F
 
#define JOY_UP_MASK   0x01
 
#define JOY_DOWN_MASK   0x02
 
#define JOY_LEFT_MASK   0x04
 
#define JOY_RIGHT_MASK   0x08
 
#define JOY_BTN_1_MASK   0x10
 
#define VIDEOMODE_40x25   0x00
 
#define VIDEOMODE_80x25   0x80
 
#define VIDEOMODE_40COL   VIDEOMODE_40x25
 
#define VIDEOMODE_80COL   VIDEOMODE_80x25
 
#define VIC   (*(volatile struct __vic2*)0xD000)
 
#define SID   (*(volatile struct __sid*)0xD400)
 
#define VDC   (*(volatile struct __vdc*)0xD600)
 
#define CIA1   (*(volatile struct __6526*)0xDC00)
 
#define CIA2   (*(volatile struct __6526*)0xDD00)
 
#define COLOR_RAM   ((volatile unsigned char*)0xD800)
 

Functions

unsigned char videomode (unsigned char mode)
 Set the video mode, return the old mode. More...
 
void fast (void)
 Switch the CPU into 2MHz mode. Note: This will disable video when in 40 column mode. More...
 
void slow (void)
 Switch the CPU into 1MHz mode. More...
 
unsigned char isfast (void)
 Check CPU clock mode. More...
 

Macro Definition Documentation

◆ CH_F1

#define CH_F1   133

◆ CH_F2

#define CH_F2   137

◆ CH_F3

#define CH_F3   134

◆ CH_F4

#define CH_F4   138

◆ CH_F5

#define CH_F5   135

◆ CH_F6

#define CH_F6   139

◆ CH_F7

#define CH_F7   136

◆ CH_F8

#define CH_F8   140

◆ CIA1

#define CIA1   (*(volatile struct __6526*)0xDC00)

◆ CIA2

#define CIA2   (*(volatile struct __6526*)0xDD00)

◆ COLOR_BLACK

#define COLOR_BLACK   0x00

◆ COLOR_BLUE

#define COLOR_BLUE   0x06

◆ COLOR_BROWN

#define COLOR_BROWN   0x09

◆ COLOR_CYAN

#define COLOR_CYAN   0x03

◆ COLOR_GRAY1

#define COLOR_GRAY1   0x0B

◆ COLOR_GRAY2

#define COLOR_GRAY2   0x0C

◆ COLOR_GRAY3

#define COLOR_GRAY3   0x0F

◆ COLOR_GREEN

#define COLOR_GREEN   0x05

◆ COLOR_LIGHTBLUE

#define COLOR_LIGHTBLUE   0x0E

◆ COLOR_LIGHTGREEN

#define COLOR_LIGHTGREEN   0x0D

◆ COLOR_LIGHTRED

#define COLOR_LIGHTRED   0x0A

◆ COLOR_ORANGE

#define COLOR_ORANGE   0x08

◆ COLOR_PURPLE

#define COLOR_PURPLE   0x04

◆ COLOR_RAM

#define COLOR_RAM   ((volatile unsigned char*)0xD800)

◆ COLOR_RED

#define COLOR_RED   0x02

◆ COLOR_WHITE

#define COLOR_WHITE   0x01

◆ COLOR_YELLOW

#define COLOR_YELLOW   0x07

◆ JOY_BTN_1_MASK

#define JOY_BTN_1_MASK   0x10

◆ JOY_DOWN_MASK

#define JOY_DOWN_MASK   0x02

◆ JOY_LEFT_MASK

#define JOY_LEFT_MASK   0x04

◆ JOY_RIGHT_MASK

#define JOY_RIGHT_MASK   0x08

◆ JOY_UP_MASK

#define JOY_UP_MASK   0x01

◆ SID

#define SID   (*(volatile struct __sid*)0xD400)

◆ VDC

#define VDC   (*(volatile struct __vdc*)0xD600)

◆ VIC

#define VIC   (*(volatile struct __vic2*)0xD000)

◆ VIDEOMODE_40COL

#define VIDEOMODE_40COL   VIDEOMODE_40x25

◆ VIDEOMODE_40x25

#define VIDEOMODE_40x25   0x00

◆ VIDEOMODE_80COL

#define VIDEOMODE_80COL   VIDEOMODE_80x25

◆ VIDEOMODE_80x25

#define VIDEOMODE_80x25   0x80

Function Documentation

◆ fast()

void fast ( void  )

Switch the CPU into 2MHz mode. Note: This will disable video when in 40 column mode.

◆ isfast()

unsigned char isfast ( void  )

Check CPU clock mode.

Returns
unsigned char 1 if the CPU is in 2MHz mode.

◆ slow()

void slow ( void  )

Switch the CPU into 1MHz mode.

◆ videomode()

unsigned char videomode ( unsigned char  mode)

Set the video mode, return the old mode.

Parameters
modeThe video mode. Use one of the VIDEOMODE_xx constants.
Returns
unsigned char The old mode.