]> git.pld-linux.org Git - packages/aavga.git/blame - aavga-update.patch
- mass commit: cosmetics (removed trailing white spaces)
[packages/aavga.git] / aavga-update.patch
CommitLineData
25004395
JB
1diff -Nur aavga-1.0.orig/aavga.c aavga-1.0/aavga.c
2--- aavga-1.0.orig/aavga.c Mon Feb 12 23:35:30 2001
3+++ aavga-1.0/aavga.c Sat Jun 23 20:15:59 2001
4@@ -58,9 +58,10 @@
5 { 320, 400, 1, 256, 320, 320, 0, 320 * 400, 0, IS_LINEAR, 0, 320 * 400, 0, NULL, 1024 * 1024, NULL, NULL } , /*7 */
6 { 360, 480, 1, 256, 360, 360, 0, 260 * 480, 0, IS_LINEAR, 0, 360 * 480, 0, NULL, 1024 * 1024, NULL, NULL } , /*8 */
7 { 0, 0 } , /*9 */
8- { 640, 480, 1, 256, 640, 480, 0, 640 * 480, 0, IS_LINEAR, 0, 640 * 480, 0, NULL, 1024 * 1024, NULL, NULL } , /*11 */
9- { 800, 600, 1, 256, 800, 600, 0, 800 * 600, 0, IS_LINEAR, 0, 800 * 600, 0, NULL, 1024 * 1024, NULL, NULL } , /*12 */
10- { 1024, 768, 1, 256, 1024, 768, 0, 1024 * 768, 0, IS_LINEAR, 0, 1024*768, 0, NULL, 1024 * 1024, NULL, NULL } , /*13 */
11+ { 640, 480, 1, 256, 640, 480, 0, 640 * 480, 0, IS_LINEAR, 0, 640 * 480, 0, NULL, 1024 * 1024, NULL, NULL } , /*10 */
12+ { 800, 600, 1, 256, 800, 600, 0, 800 * 600, 0, IS_LINEAR, 0, 800 * 600, 0, NULL, 1024 * 1024, NULL, NULL } , /*11 */
13+ { 1024, 768, 1, 256, 1024, 768, 0, 1024 * 768, 0, IS_LINEAR, 0, 1024*768, 0, NULL, 1024 * 1024, NULL, NULL } , /*12 */
14+ { 1280, 1024, 1, 256, 1280, 1024, 0, 1280 * 1024, 0, IS_LINEAR, 0, 1280*1024, 0, NULL, 2048 * 1024, NULL, NULL } , /*13 */
15
16 };
17 #define MAXMODE 13
18@@ -92,7 +93,8 @@
19 vga_setmode (int x)
20 {
21 int initialized = 0;
22- fprintf (stderr, " AA-lib SVGA emulation mode:%i\n", x);
23+ if(debug)
24+ fprintf (stderr, " AA-lib SVGA emulation mode:%i\n", x);
25 aa_parseoptions (NULL, NULL, NULL, NULL);
26 cmode = x;
27 if (x == 0 && context)
28@@ -115,7 +117,8 @@
29 if (!aa_autoinitmouse (context, AA_SENDRELEASE))
30 return fprintf (stderr, "Error in aa_autoinitmouse!\n"), 1;
31 }
32- fprintf (stderr, " AA-lib initialized\n");
33+ if(debug)
34+ fprintf (stderr, " AA-lib initialized\n");
35 return 0;
36 }
37 else
38@@ -648,4 +651,74 @@
39 pos1 += pitch;
40 pos2 += vpitch;
41 }
42+}
43+
44+/* svgalib >= 1.2.11 functions */
45+static char*
46+_aavga_modenamestab[]={
47+"","","","","",
48+"G320x200x256",
49+"G320x240x256",
50+"G320x400x256",
51+"G360x480x256",
52+"",
53+"G640x480x256",
54+"G800x600x256",
55+"G1024x768x256",
56+"G1280x1024x256"};
57+#define _aavga_modenum (sizeof(_aavga_modenamestab)/sizeof(char*))
58+char *
59+vga_getmodename(int mode)
60+{
61+ if(mode>=_aavga_modenum)
62+ return "";
63+ return _aavga_modenamestab[mode];
64+}
65+
66+int
67+vga_runinbackground_version(void)
68+{
69+ return 0;
70+}
71+
72+int
73+vga_clear(void)
74+{
75+ memset(buffer,0,mode[cmode].maxpixels);
76+ return 0;
77+}
78+
79+int
80+vga_drawscansegment(unsigned char *colors, int x, int y, int length)
81+{
82+ memcpy(buffer+y*mode[cmode].width+x,colors,length);
83+ return 0;
84+}
85+
86+int
87+vga_drawscanline(int line, unsigned char *color)
88+{
89+ return vga_drawscansegment(color,0,line,mode[cmode].width);
90+}
91+
92+void
93+vga_lockvc(void) {}
94+void
95+vga_unlockvc(void) {}
96+void
97+vga_disabledriverreport(void) {}
98+
99+/* svgalib >= 1.3.0 functions */
100+int vga_getdefaultmode(void)
101+{ int m;
102+ char *ms;
103+ if((ms=getenv("SVGALIB_DEFAULT_MODE"))==NULL)
104+ return -1;
105+ if(ms[0]=='G') {
106+ for(m=0;m<_aavga_modenum;m++)
107+ if(!strcmp(ms,_aavga_modenamestab[m]))
108+ return m;
109+ return -1;
110+ } else
111+ return atoi(ms)>0 ? atoi(ms) : -1;
112 }
This page took 0.175815 seconds and 4 git commands to generate.