-/* Characters codes (CBM charset) */
-#define CH_HLINE 96
-#define CH_VLINE 125
-#define CH_ULCORNER 176
-#define CH_URCORNER 174
-#define CH_LLCORNER 173
-#define CH_LRCORNER 189
-#define CH_TTEE 178
-#define CH_RTEE 179
-#define CH_BTEE 177
-#define CH_LTEE 171
-#define CH_CROSS 123
-#define CH_CURS_UP 145
-#define CH_CURS_DOWN 17
-#define CH_CURS_LEFT 157
-#define CH_CURS_RIGHT 29
-#define CH_PI 126
-#define CH_DEL 20
-#define CH_INS 148
-#define CH_ESC 95
-
-/* constants to use with cbm_open() for opening a file for reading or
- * writing without the need to append ",r" or ",w" to the filename.
- *
- * e.g.: cbm_open(2, 8, CBM_READ, "data,s");
- */
-#define CBM_READ 0
-#define CBM_WRITE 1
-
-/* Kernel level functions */
+
+#define TV_NTSC 0
+#define TV_PAL 1
+#define TV_OTHER 2
+
+unsigned char get_tv (void);
+/* Return the video mode the machine is using. */
+
+#define KBREPEAT_CURSOR 0x00
+#define KBREPEAT_NONE 0x40
+#define KBREPEAT_ALL 0x80
+
+unsigned char __fastcall__ kbrepeat (unsigned char mode);
+/* Changes which keys have automatic repeat. */
+
+#if !defined(__CBM610__) && !defined(__PET__)
+void waitvsync (void);
+/* Wait for the start of the next frame */
+#endif
+
+/*****************************************************************************/
+/* CBM kernal functions */
+/*****************************************************************************/
+
+
+
+/* Constants to use with cbm_open() for openning a file for reading or
+** writing without the need to append ",r" or ",w" to the filename.
+**
+** e.g., cbm_open(2, 8, CBM_READ, "0:data,s");
+*/
+#define CBM_READ 0 /* default is ",p" */
+#define CBM_WRITE 1 /* ditto */
+#define CBM_SEQ 2 /* default is ",r" -- or ",s" when writing */
+
+/* Kernal-level functions */
+unsigned char cbm_k_acptr (void);
+unsigned char cbm_k_basin (void);
+void __fastcall__ cbm_k_bsout (unsigned char C);
+unsigned char __fastcall__ cbm_k_chkin (unsigned char FN);
+void __fastcall__ cbm_k_ciout (unsigned char C);
+unsigned char __fastcall__ cbm_k_ckout (unsigned char FN);
+void cbm_k_clall (void);
+void __fastcall__ cbm_k_close (unsigned char FN);
+void cbm_k_clrch (void);
+unsigned char cbm_k_getin (void);
+unsigned cbm_k_iobase (void);
+void __fastcall__ cbm_k_listen (unsigned char dev);
+unsigned int __fastcall__ cbm_k_load(unsigned char flag, unsigned addr);
+unsigned char cbm_k_open (void);
+unsigned char cbm_k_readst (void);
+unsigned char __fastcall__ cbm_k_save(unsigned int start, unsigned int end);
+void cbm_k_scnkey (void);
+void __fastcall__ cbm_k_second (unsigned char addr);