1 /* OpenCP Module Player
2  * copyright (c) '94-'10 Niklas Beisert <nbeisert@physik.tu-muenchen.de>
3  * copyright (c) '11-'21 Stian Skjelstad <stian.skjelstad@gmail.com>
4  *
5  * Variables that are needed globally, and even by the very basic libs.
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  * revision history: (please note changes here)
22  *  -ss040613   Stian Skjelstad <stian@nixia.no>
23  *    -first release
24  */
25 
26 #include "config.h"
27 #include "types.h"
28 #include "console.h"
29 #include "stuff/poutput.h"
30 
31 void (*_vga13)(void);
32 void (*_plSetTextMode)(uint8_t size) = 0;
33 void (*_plSetBarFont)(void);
34 void (*_plDisplaySetupTextMode)(void);
35 const char *(*_plGetDisplayTextModeName)(void);
36 
37 void (*_displaystr)(uint16_t y, uint16_t x, uint8_t attr, const char *str, uint16_t len);
38 void (*_displaystrattr)(uint16_t y, uint16_t x, const uint16_t *buf, uint16_t len);
39 void (*_displayvoid)(uint16_t y, uint16_t x, uint16_t len);
40 
41 void (*_displaystr_iso8859latin1)(uint16_t y, uint16_t x, uint8_t attr, const char *str, uint16_t len);
42 void (*_displaystrattr_iso8859latin1)(uint16_t y, uint16_t x, const uint16_t *buf, uint16_t len);
43 
44 void (*_displaystr_utf8)(uint16_t y, uint16_t x, uint8_t attr, const char *str, uint16_t len);
45 int  (*_measurestr_utf8)(const char *src, int srclen);
46 
47 
48 int (*_plSetGraphMode)(int); /* -1 reset, 0 640x480 1 1024x768 */
49 void (*_gdrawchar)(uint16_t x, uint16_t y, uint8_t c, uint8_t f, uint8_t b);
50 void (*_gdrawchart)(uint16_t x, uint16_t y, uint8_t c, uint8_t f);
51 void (*_gdrawcharp)(uint16_t x, uint16_t y, uint8_t c, uint8_t f, void *picp);
52 void (*_gdrawchar8)(uint16_t x, uint16_t y, uint8_t c, uint8_t f, uint8_t b);
53 void (*_gdrawchar8t)(uint16_t x, uint16_t y, uint8_t c, uint8_t f);
54 void (*_gdrawchar8p)(uint16_t x, uint16_t y, uint8_t c, uint8_t f, void *picp);
55 void (*_gdrawstr)(uint16_t y, uint16_t x, const char *s, uint16_t len, uint8_t f, uint8_t b);
56 void (*_gupdatestr)(uint16_t y, uint16_t x, const uint16_t *str, uint16_t len, uint16_t *old);
57 void (*_gupdatepal)(uint8_t color, uint8_t red, uint8_t green, uint8_t blue);
58 void (*_gflushpal)(void);
59 
60 int (*_ekbhit)(void);
61 int (*_egetch)(void);
62 int (*_validkey)(uint16_t);
63 
64 void (*_drawbar)(uint16_t x, uint16_t yb, uint16_t yh, uint32_t hgt, uint32_t c);
65 void (*_idrawbar)(uint16_t x, uint16_t yb, uint16_t yh, uint32_t hgt, uint32_t c);
66 
67 
68 void (*_Screenshot)(void);
69 void (*_TextScreenshot)(int scrType);
70 
71 void (*_setcur)(uint16_t y, uint16_t x) ;
72 void (*_setcurshape)(uint16_t shape);
73 
74 int (*_conRestore)(void);
75 void (*_conSave)(void);
76 
77 void (*_plDosShell)(void);
78 
79 unsigned int plScrHeight;
80 unsigned int plScrWidth;
81 enum vidType plVidType;
82 unsigned char plScrType;
83 int plScrMode;
84 uint8_t *plVidMem;
85 
86 int plScrTextGUIOverlay;
87 void *(*plScrTextGUIOverlayAddBGRA)(unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int pitch, uint8_t *data_bgra);
88 void (*plScrTextGUIOverlayRemove)(void *handle);
89