]> git.sur5r.net Git - cc65/blob - include/pce.h
Only for jumps, the lib uses named asm labels in branches
[cc65] / include / pce.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                   pce.h                                   */
4 /*                                                                           */
5 /*                   PC-Engine system-specific definitions                   */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 2015, Groepaz/Hitmen                                                  */
10 /*                                                                           */
11 /*                                                                           */
12 /* This software is provided 'as-is', without any expressed or implied       */
13 /* warranty.  In no event will the authors be held liable for any damages    */
14 /* arising from the use of this software.                                    */
15 /*                                                                           */
16 /* Permission is granted to anyone to use this software for any purpose,     */
17 /* including commercial applications, and to alter it and redistribute it    */
18 /* freely, subject to the following restrictions:                            */
19 /*                                                                           */
20 /* 1. The origin of this software must not be misrepresented; you must not   */
21 /*    claim that you wrote the original software. If you use this software   */
22 /*    in a product, an acknowledgment in the product documentation would be  */
23 /*    appreciated but is not required.                                       */
24 /* 2. Altered source versions must be plainly marked as such, and must not   */
25 /*    be misrepresented as being the original software.                      */
26 /* 3. This notice may not be removed or altered from any source              */
27 /*    distribution.                                                          */
28 /*                                                                           */
29 /*****************************************************************************/
30
31 #ifndef _PCE_H
32 #define _PCE_H
33
34 /* Check for errors */
35 #if !defined(__PCE__)
36 #  error This module may only be used when compiling for the PCE!
37 #endif
38
39 #define CH_HLINE                1
40 #define CH_VLINE                2
41 #define CH_CROSS                3
42 #define CH_ULCORNER             4
43 #define CH_URCORNER             5
44 #define CH_LLCORNER             6
45 #define CH_LRCORNER             7
46 #define CH_TTEE                 8
47 #define CH_BTEE                 9
48 #define CH_LTEE                 10
49 #define CH_RTEE                 11
50
51 #define CH_ENTER                13
52 #define CH_PI                   18
53
54 /* Color defines (CBM-compatible, for conio) */
55 #define COLOR_BLACK             0x00
56 #define COLOR_WHITE             0x01
57 #define COLOR_RED               0x02
58 #define COLOR_CYAN              0x03
59 #define COLOR_VIOLET            0x04
60 #define COLOR_GREEN             0x05
61 #define COLOR_BLUE              0x06
62 #define COLOR_YELLOW            0x07
63 #define COLOR_ORANGE            0x08
64 #define COLOR_BROWN             0x09
65 #define COLOR_LIGHTRED          0x0A
66 #define COLOR_GRAY1             0x0B
67 #define COLOR_GRAY2             0x0C
68 #define COLOR_LIGHTGREEN        0x0D
69 #define COLOR_LIGHTBLUE         0x0E
70 #define COLOR_GRAY3             0x0F
71
72 #define TV_NTSC                 0
73 #define TV_PAL                  1
74 #define TV_OTHER                2
75
76 /* Masks for joy_read */
77 #define JOY_UP_MASK             0x10
78 #define JOY_DOWN_MASK           0x40
79 #define JOY_LEFT_MASK           0x80
80 #define JOY_RIGHT_MASK          0x20
81 #define JOY_BTN_1_MASK          0x01
82 #define JOY_BTN_2_MASK          0x02
83 #define JOY_BTN_3_MASK          0x04
84 #define JOY_BTN_4_MASK          0x08
85
86 #define JOY_BTN_I_MASK          JOY_BTN_1_MASK
87 #define JOY_BTN_II_MASK         JOY_BTN_2_MASK
88 #define JOY_SELECT_MASK         JOY_BTN_3_MASK
89 #define JOY_RUN_MASK            JOY_BTN_4_MASK
90
91 #define JOY_BTN_I(v)            ((v) & JOY_BTN_I_MASK)
92 #define JOY_BTN_II(v)           ((v) & JOY_BTN_II_MASK)
93 #define JOY_SELECT(v)           ((v) & JOY_SELECT_MASK)
94 #define JOY_RUN(v)              ((v) & JOY_RUN_MASK)
95
96 /* No support for dynamically loadable drivers */
97 #define DYN_DRV                 0
98
99 /* The addresses of the static drivers */
100 extern void pce_stdjoy_joy[];   /* Referred to by joy_static_stddrv[] */
101
102 void waitvsync (void);
103 /* Wait for start of the next frame */
104
105 /* NOTE: all PCEs are NTSC. */
106 #define get_tv()                TV_NTSC
107 /* Return the video mode the machine is using. */
108
109 /* End of pce.h */
110 #endif