2 GEOS graphic (non icon/menu/sprite) functions
4 by Maciej 'YTM/Elysium' Witkowiak
11 #include <geos/gstruct.h>
14 void __fastcall__ cpputs(char *s);
15 void __fastcall__ cpputsxy(unsigned x, unsigned y, char *s);
17 void __fastcall__ SetPattern(char newpattern);
19 void __fastcall__ HorizontalLine(char pattern, char y, unsigned xstart, unsigned xend);
20 void __fastcall__ InvertLine(char y, unsigned xstart, unsigned xend);
21 void __fastcall__ RecoverLine(char y, unsigned xstart, unsigned xend);
22 void __fastcall__ VerticalLine(char pattern, char ystart, char yend, unsigned x);
24 void __fastcall__ InitDrawWindow(struct window *myRectangle);
26 void __fastcall__ FrameRectangle(char pattern);
27 void InvertRectangle(void);
28 void ImprintRectangle(void);
29 void RecoverRectangle(void);
31 void __fastcall__ DrawLine(char mode, struct window *topBotCoords);
33 void __fastcall__ DrawPoint(char mode, struct pixel *myPixel);
34 char __fastcall__ TestPoint(struct pixel *myPixel);
36 void __fastcall__ PutChar(char character, char y, unsigned x);
37 void __fastcall__ PutString(char *myString, char y, unsigned x);
38 void __fastcall__ PutDecimal(char style, unsigned value, char y, unsigned x);
40 char __fastcall__ GetCharWidth(char character);
41 void __fastcall__ LoadCharSet(struct fontdesc *myFont);
42 void UseSystemFont(void);
44 void __fastcall__ BitmapUp(struct iconpic *myIcon);
45 void __fastcall__ BitmapClip(char skipl, char skipr, unsigned skiptop,
46 struct iconpic *myIcon);
47 void __fastcall__ BitOtherClip(void *proc1, void *proc2, char skipl,
48 char skipr, unsigned skiptop,
49 struct iconpic *myIcon);
51 void __fastcall__ GraphicsString(char *myGfxString);
53 /* VIC colour constants */
71 /* once again for cc65 compatibility */
72 #define COLOR_BLACK 0x00
73 #define COLOR_WHITE 0x01
74 #define COLOR_RED 0x02
75 #define COLOR_CYAN 0x03
76 #define COLOR_VIOLET 0x04
77 #define COLOR_GREEN 0x05
78 #define COLOR_BLUE 0x06
79 #define COLOR_YELLOW 0x07
80 #define COLOR_ORANGE 0x08
81 #define COLOR_BROWN 0x09
82 #define COLOR_LIGHTRED 0x0A
83 #define COLOR_GRAY1 0x0B
84 #define COLOR_GRAY2 0x0C
85 #define COLOR_LIGHTGREEN 0x0D
86 #define COLOR_LIGHTBLUE 0x0E
87 #define COLOR_GRAY3 0x0F
88 /* VIC memory banks - lowest 2 bits of cia2base+0 */
93 /* VIC screen sizes */
94 #define VIC_X_POS_OFF 24
95 #define VIC_Y_POS_OFF 50
96 #define SC_BYTE_WIDTH 40
97 #define SC_PIX_HEIGHT 200
98 #define SC_PIX_WIDTH 320
100 /* VDC screen constants */
101 #define SCREENBYTEWIDTH 80
102 #define SCREENPIXELWIDTH 640
103 /* control characters for use as numbers, not characters */
105 #define FORWARDSPACE 9
109 #define PAGE_BREAK 12
114 #define ESC_GRAPHICS 16
121 #define NEWCARDSET 23
126 /* control characters for use in
127 strings: eg: str[10]=CBOLDON "Hello"; */
129 #define CULINEON "\016"
130 #define CULINEOFF "\017"
131 #define CREV_ON "\022"
132 #define CREV_OFF "\023"
133 #define CBOLDON "\030"
134 #define CITALICON "\031"
135 #define COUTLINEON "\032"
136 #define CPLAINTEXT "\033"
138 /*values of currentMode */
140 #define UNDERLINE_BIT 7
142 #define REVERSE_BIT 5
144 #define OUTLINE_BIT 3
145 #define SUPERSCRIPT_BIT 2
146 #define SUBSCRIPT_BIT 1
148 #define SET_UNDERLINE 0x80
149 #define SET_BOLD 0x40
150 #define SET_REVERSE 0x20
151 #define SET_ITALIC 0x10
152 #define SET_OUTLINE 0x08
153 #define SET_SUPERSCRIPT 0x04
154 #define SET_SUBSCRIPT 0x02
155 #define SET_PLAINTEXT 0
156 /* values of dispBufferOn */
157 #define ST_WRGS_FORE 0x20
158 #define ST_WR_BACK 0x40
159 #define ST_WR_FORE 0x80
160 /* PutDecimal parameters */
162 #define SET_NOSURPRESS 0
163 #define SET_SURPRESS 0x40
165 #define SET_RIGHTJUST 0
166 #define SET_LEFTJUST 0x80
167 /* C128 x-extension flags */
168 #define ADD1_W 0x2000
169 #define DOUBLE_B 0x80
170 #define DOUBLE_W 0x8000
171 /* DrawLine/DrawPoint mode values */
172 #define DRAW_ERASE 0x00
173 #define DRAW_DRAW 0x40
174 #define DRAW_COPY 0x80
176 typedef void graphicStr;
178 #define MOVEPENTO(x,y) (char)1, (unsigned)(x), (char)(y)
179 #define LINETO(x,y) (char)2, (unsigned)(x), (char)(y)
180 #define RECTANGLETO(x,y) (char)3, (unsigned)(x), (char)(y)
181 #define NEWPATTERN(p) (char)5, (char)(p)
182 #define FRAME_RECTO(x,y) (char)7, (unsigned)(x), (char)(y)
183 #define PEN_X_DELTA(x) (char)8, (unsigned)(x)
184 #define PEN_Y_DELTA(y) (char)9, (char)(y)
185 #define PEN_XY_DELTA(x,y) (char)10, (unsigned)(x), (char)(y)
186 #define GSTR_END (char)NULL
187 /* ESC_PUTSTRING can't be implemented - it needs text, not pointer to it
188 #define ESC_PUTSTRING(x,y,text) (char)6, (unsigned)(x), (char)(y), (text), (char)NULL