Mercurial > mplayer.hg
annotate libvo/vo_svga.c @ 9588:b57a0f03627f
add MODULE_LICENSE
based on patch by Kronos <kronos@kronoz.cjb.net>
author | arpi |
---|---|
date | Fri, 14 Mar 2003 23:22:35 +0000 |
parents | a076d22664b5 |
children | 3ef467aac4a1 |
rev | line source |
---|---|
285 | 1 /* |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
2 Video driver for SVGAlib |
285 | 3 by Zoltan Mark Vician <se7en@sch.bme.hu> |
381 | 4 Code started: Mon Apr 1 23:25:47 2001 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
5 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
6 Some changes by Matan Ziv-Av <matan@svgalib.org> |
285 | 7 */ |
8 | |
9 #include <stdio.h> | |
10 #include <stdlib.h> | |
7472
c4434bdf6e51
tons of warning fixes, also some 10l bugfixes, including Dominik's PVA bug
arpi
parents:
7124
diff
changeset
|
11 #include <string.h> |
285 | 12 |
13 #include <vga.h> | |
14 | |
485 | 15 #include <limits.h> |
16 | |
285 | 17 #include "config.h" |
18 #include "video_out.h" | |
19 #include "video_out_internal.h" | |
20 | |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
21 #ifdef CONFIG_VIDIX |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
22 #include "vosub_vidix.h" |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
23 #endif |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
24 |
616 | 25 #include "sub.h" |
2556 | 26 #include "../postproc/rgb2rgb.h" |
616 | 27 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
28 #include "../mp_msg.h" |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
29 //#include "../mp_image.h" |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
30 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
31 extern int vo_directrendering; |
485 | 32 extern int vo_dbpp; |
504 | 33 extern int verbose; |
407 | 34 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
35 static uint32_t query_format(uint32_t format); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
36 static int checksupportedmodes(); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
37 static void putbox(int x, int y, int w, int h, uint8_t *buf,int prog); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
38 static void fillbox(int x, int y, int w, int h, uint32_t c); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
39 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
40 unsigned char *srca, int stride); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
41 static uint32_t get_image(mp_image_t *mpi); |
285 | 42 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
43 static uint8_t *yuvbuf = NULL, *bppbuf = NULL; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
44 static uint8_t *GRAPH_MEM; |
285 | 45 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
46 static int BYTESPERPIXEL, WIDTH, HEIGHT, LINEWIDTH; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
47 static int frame, maxframes, oldmethod=0; |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
48 static int directrender; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
49 |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
50 static int force_vm=0; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
51 static int squarepix=0; |
285 | 52 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
53 static uint32_t pformat; |
285 | 54 static uint32_t orig_w, orig_h, maxw, maxh; // Width, height |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
55 static uint8_t buf0[8192]; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
56 static uint8_t *buffer; |
285 | 57 |
483 | 58 typedef struct vga_modelist_s { |
59 uint16_t modenum; | |
60 vga_modeinfo modeinfo; | |
61 struct vga_modelist_s *next; | |
62 } vga_modelist_t; | |
447 | 63 |
483 | 64 vga_modelist_t *modelist = NULL; |
65 | |
327 | 66 static uint8_t bpp; |
483 | 67 static uint8_t bpp_conv = 0; |
448
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
447
diff
changeset
|
68 static uint32_t pformat; |
447 | 69 |
483 | 70 #define BPP_15 1 |
71 #define BPP_16 2 | |
72 #define BPP_24 4 | |
73 #define BPP_32 8 | |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
74 #define BPP_8 16 |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
75 #define BPP_4 32 |
6453 | 76 #define BPP_1 64 |
483 | 77 static uint8_t bpp_avail = 0; |
78 | |
285 | 79 static uint8_t checked = 0; |
483 | 80 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
81 static uint32_t x_pos, y_pos; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
82 |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7691
diff
changeset
|
83 static vo_info_t info = { |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
84 "SVGAlib", |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
85 "svga", |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
86 "Zoltan Mark Vician <se7en@sch.bme.hu>", |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
87 "" |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
88 }; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
89 |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
90 #ifdef CONFIG_VIDIX |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
91 static char vidix_name[32] = ""; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
92 #endif |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
93 |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7691
diff
changeset
|
94 LIBVO_EXTERN(svga) |
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7691
diff
changeset
|
95 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
96 static uint32_t preinit(const char *arg) |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
97 { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
98 int i; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
99 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
100 for(i=0;i<8192;i++) buf0[i]=0; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
101 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
102 if(vo_directrendering) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
103 maxframes=0; |
483 | 104 } else { |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
105 maxframes=1; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
106 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
107 |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
108 if(arg)while(*arg) { |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
109 if(!strncmp(arg,"old",3)) { |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
110 oldmethod=1; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
111 arg+=3; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
112 if( *arg == ':' ) arg++; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
113 } |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
114 |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
115 #ifdef CONFIG_VIDIX |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
116 if(memcmp(arg,"vidix",5)==0) { |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
117 int i; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
118 i=6; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
119 while(arg[i] && arg[i]!=':') i++; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
120 strncpy(vidix_name, arg+6, i-6); |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
121 vidix_name[i-5]=0; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
122 if(arg[i]==':')i++; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
123 arg+=i; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
124 vidix_preinit(vidix_name, &video_out_svga); |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
125 } |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
126 #endif |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
127 if(!strncmp(arg,"sq",2)) { |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
128 squarepix=1; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
129 arg+=2; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
130 if( *arg == ':' ) arg++; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
131 } |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
132 |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
133 if(*arg) { |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
134 int i; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
135 char s[64]; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
136 printf("arg is %s\n",arg); |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
137 i=0; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
138 while(arg[i] && arg[i]!=':')i++; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
139 strncpy(s, arg, i); |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
140 s[i]=0; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
141 arg+=i; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
142 if(*arg==':')arg++; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
143 printf("i=%i new arg is %s\n",i, arg); |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
144 i=vga_getmodenumber(s); |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
145 if(i>0) { |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
146 force_vm = i; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
147 if(verbose)printf("vo_svga: Forcing mode %i\n",force_vm); |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
148 } |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
149 } |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
150 } |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
151 |
7675 | 152 if (!checked) { |
153 if (checksupportedmodes()) // Looking for available video modes | |
154 return(1); | |
155 } | |
156 | |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
157 return 0; |
483 | 158 } |
159 | |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
160 static uint32_t control(uint32_t request, void *data, ...) |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
161 { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
162 switch (request) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
163 case VOCTRL_QUERY_FORMAT: |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
164 return query_format(*((uint32_t*)data)); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
165 case VOCTRL_GET_IMAGE: |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
166 return get_image(data); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
167 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
168 return VO_NOTIMPL; |
285 | 169 } |
170 | |
4433 | 171 static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
172 uint32_t d_height, uint32_t flags, char *title, |
7124
eca7dbad0166
finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents:
6579
diff
changeset
|
173 uint32_t format) { |
483 | 174 uint32_t req_w = (d_width > 0 ? d_width : width); |
175 uint32_t req_h = (d_height > 0 ? d_height : height); | |
176 uint16_t vid_mode = 0; | |
976 | 177 uint8_t res_widescr, vid_widescr = (((req_w*1.0)/req_h) > (4.0/3)) ? 1 : 0; |
485 | 178 uint16_t buf_w = USHRT_MAX, buf_h = USHRT_MAX; |
483 | 179 vga_modelist_t *list = modelist; |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
180 |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
181 if(verbose) |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
182 printf("vo_svga: config(%i, %i, %i, %i, %08x, %s, %08x)\n", width, height, |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
183 d_width, d_height, flags, title, format); |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
184 |
483 | 185 bpp_avail = 0; |
186 while (list != NULL) { | |
187 if ((list->modeinfo.width >= req_w) && (list->modeinfo.height >= req_h)) { | |
188 switch (list->modeinfo.colors) { | |
189 case 32768: bpp_avail |= BPP_15; break; | |
190 case 65536: bpp_avail |= BPP_16; break; | |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
191 case 256 : bpp_avail |= BPP_8; break; |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
192 case 16 : bpp_avail |= BPP_4; break; |
6453 | 193 case 2 : bpp_avail |= BPP_1; break; |
483 | 194 } |
195 switch (list->modeinfo.bytesperpixel) { | |
196 case 3: bpp_avail |= BPP_24; break; | |
197 case 4: bpp_avail |= BPP_32; break; | |
198 } | |
199 } | |
200 list = list->next; | |
201 } | |
202 | |
285 | 203 pformat = format; |
411 | 204 |
483 | 205 // bpp check |
206 bpp_conv = 0; | |
411 | 207 if (!vo_dbpp) { |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
208 if (!IMGFMT_IS_RGB(format) && !IMGFMT_IS_BGR(format)) bpp = 32; |
411 | 209 else bpp = format & 255; |
504 | 210 if (verbose) |
211 printf("vo_svga: vo_dbpp == 0, bpp: %d\n",bpp); | |
483 | 212 switch (bpp) { |
213 case 32: if (!(bpp_avail & BPP_32)) { | |
214 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
485 | 215 printf("vo_svga: Maybe you should try -bpp\n"); |
483 | 216 return(1); |
217 } | |
218 break; | |
619 | 219 case 24: if (!(bpp_avail & BPP_24)) { |
483 | 220 if (!(bpp_avail & BPP_32)) { |
221 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
485 | 222 printf("vo_svga: Maybe you should try -bpp\n"); |
483 | 223 return(1); |
224 } else { | |
225 bpp = 32; | |
226 bpp_conv = 1; | |
617 | 227 printf("vo_svga: BPP conversion 24->32\n"); |
619 | 228 } |
229 } | |
483 | 230 break; |
231 case 16: if (!(bpp_avail & BPP_16)) { | |
232 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
233 printf("vo_svga: Maybe you should try -bpp\n"); | |
234 return(1); | |
235 } | |
236 break; | |
619 | 237 case 15: if (!(bpp_avail & BPP_15)) { |
483 | 238 if (!(bpp_avail & BPP_16)) { |
239 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
240 printf("vo_svga: Maybe you should try -bpp\n"); | |
241 return(1); | |
242 } else { | |
243 bpp = 16; | |
244 bpp_conv = 1; | |
617 | 245 printf("vo_svga: BPP conversion 15->16\n"); |
483 | 246 } |
619 | 247 } |
483 | 248 break; |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
249 case 8: if (!(bpp_avail & BPP_8)) { |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
250 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
251 printf("vo_svga: Maybe you should try -bpp\n"); |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
252 return(1); |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
253 } |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
254 break; |
6453 | 255 case 4: if (!(bpp_avail & BPP_4)) { |
256 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
257 printf("vo_svga: Maybe you should try -bpp\n"); | |
258 return(1); | |
259 } | |
260 break; | |
261 case 1: if (!(bpp_avail & BPP_1)) { | |
262 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
263 printf("vo_svga: Maybe you should try -bpp\n"); | |
264 return(1); | |
265 } | |
266 break; | |
483 | 267 } |
411 | 268 } else { |
269 bpp = vo_dbpp; | |
504 | 270 if (verbose) |
271 printf("vo_svga: vo_dbpp == %d\n",bpp); | |
411 | 272 switch (bpp) { |
483 | 273 case 32: if (!(bpp_avail & BPP_32)) { |
9085 | 274 printf("vo_svga: %dbpp not supported in %dx%d (or larger resolution) by HW or SVGAlib\n",bpp,req_w,req_h); |
411 | 275 return(1); |
276 } | |
485 | 277 break; |
483 | 278 case 24: if (!(bpp_avail & BPP_24)) { |
9085 | 279 printf("vo_svga: %dbpp not supported in %dx%d (or larger resolution) by HW or SVGAlib\n",bpp,req_w,req_h); |
411 | 280 return(1); |
281 } | |
485 | 282 break; |
483 | 283 case 16: if (!(bpp_avail & BPP_16)) { |
9085 | 284 printf("vo_svga: %dbpp not supported in %dx%d (or larger resolution) by HW or SVGAlib\n",bpp,req_w,req_h); |
411 | 285 return(1); |
286 } | |
485 | 287 break; |
483 | 288 case 15: if (!(bpp_avail & BPP_15)) { |
9085 | 289 printf("vo_svga: %dbpp not supported in %dx%d (or larger resolution) by HW or SVGAlib\n",bpp,req_w,req_h); |
411 | 290 return(1); |
291 } | |
485 | 292 break; |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
293 case 8: if (!(bpp_avail & BPP_8)) { |
9085 | 294 printf("vo_svga: %dbpp not supported in %dx%d (or larger resolution) by HW or SVGAlib\n",bpp,req_w,req_h); |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
295 return(1); |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
296 } |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
297 break; |
6453 | 298 case 4: if (!(bpp_avail & BPP_4)) { |
9085 | 299 printf("vo_svga: %dbpp not supported in %dx%d (or larger resolution) by HW or SVGAlib\n",bpp,req_w,req_h); |
6453 | 300 return(1); |
301 } | |
302 break; | |
303 case 1: if (!(bpp_avail & BPP_1)) { | |
9085 | 304 printf("vo_svga: %dbpp not supported in %dx%d (or larger resolution) by HW or SVGAlib\n",bpp,req_w,req_h); |
6453 | 305 return(1); |
306 } | |
307 break; | |
411 | 308 } |
309 } | |
483 | 310 |
311 list = modelist; | |
504 | 312 if (verbose) { |
313 printf("vo_svga: Looking for the best resolution...\n"); | |
314 printf("vo_svga: req_w: %d, req_h: %d, bpp: %d\n",req_w,req_h,bpp); | |
315 } | |
485 | 316 while (list != NULL) { |
483 | 317 if ((list->modeinfo.width >= req_w) && (list->modeinfo.height >= req_h)) { |
504 | 318 if (verbose) { |
319 switch (list->modeinfo.colors) { | |
6453 | 320 case 2 : printf("vo_svga: vid_mode: %d, %dx%d 1bpp\n", |
321 list->modenum,list->modeinfo.width,list->modeinfo.height); | |
322 break; | |
323 case 16 : printf("vo_svga: vid_mode: %d, %dx%d 4bpp\n", | |
324 list->modenum,list->modeinfo.width,list->modeinfo.height); | |
325 break; | |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
326 case 256 : printf("vo_svga: vid_mode: %d, %dx%d 8bpp\n", |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
327 list->modenum,list->modeinfo.width,list->modeinfo.height); |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
328 break; |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
329 case 32768: printf("vo_svga: vid_mode: %d, %dx%d 15bpp\n", |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
330 list->modenum,list->modeinfo.width,list->modeinfo.height); |
504 | 331 break; |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
332 case 65536: printf("vo_svga: vid_mode: %d, %dx%d 16bpp\n", |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
333 list->modenum,list->modeinfo.width,list->modeinfo.height); |
504 | 334 break; |
335 } | |
336 switch (list->modeinfo.bytesperpixel) { | |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
337 case 3: printf("vo_svga: vid_mode: %d, %dx%d 24bpp\n", |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
338 list->modenum,list->modeinfo.width,list->modeinfo.height); |
504 | 339 break; |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
340 case 4: printf("vo_svga: vid_mode: %d, %dx%d 32bpp\n", |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
341 list->modenum,list->modeinfo.width,list->modeinfo.height); |
504 | 342 break; |
343 } | |
344 } | |
285 | 345 switch (bpp) { |
483 | 346 case 32: if (list->modeinfo.bytesperpixel == 4) |
485 | 347 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { |
348 vid_mode = list->modenum; | |
349 buf_w = list->modeinfo.width; | |
350 buf_h = list->modeinfo.height; | |
976 | 351 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0; |
485 | 352 } |
353 break; | |
483 | 354 case 24: if (list->modeinfo.bytesperpixel == 3) |
485 | 355 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { |
356 vid_mode = list->modenum; | |
357 buf_w = list->modeinfo.width; | |
358 buf_h = list->modeinfo.height; | |
976 | 359 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0; |
485 | 360 } |
361 break; | |
483 | 362 case 16: if (list->modeinfo.colors == 65536) |
485 | 363 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { |
364 vid_mode = list->modenum; | |
365 buf_w = list->modeinfo.width; | |
366 buf_h = list->modeinfo.height; | |
976 | 367 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0; |
485 | 368 } |
369 break; | |
483 | 370 case 15: if (list->modeinfo.colors == 32768) |
485 | 371 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { |
372 vid_mode = list->modenum; | |
373 buf_w = list->modeinfo.width; | |
374 buf_h = list->modeinfo.height; | |
976 | 375 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0; |
485 | 376 } |
377 break; | |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
378 case 8: if (list->modeinfo.colors == 256) |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
379 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
380 vid_mode = list->modenum; |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
381 buf_w = list->modeinfo.width; |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
382 buf_h = list->modeinfo.height; |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
383 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0; |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
384 } |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
385 break; |
6453 | 386 case 4: if (list->modeinfo.colors ==16) |
387 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { | |
388 vid_mode = list->modenum; | |
389 buf_w = list->modeinfo.width; | |
390 buf_h = list->modeinfo.height; | |
391 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0; | |
392 } | |
393 break; | |
394 case 1: if (list->modeinfo.colors == 2) | |
395 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { | |
396 vid_mode = list->modenum; | |
397 buf_w = list->modeinfo.width; | |
398 buf_h = list->modeinfo.height; | |
399 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0; | |
400 } | |
401 break; | |
285 | 402 } |
483 | 403 } |
404 list = list->next; | |
407 | 405 } |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
406 |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
407 if(force_vm) { |
2982
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
408 list=modelist; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
409 while(list) { |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
410 if(list->modenum == force_vm) { |
2982
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
411 buf_w = list->modeinfo.width; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
412 buf_h = list->modeinfo.height; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
413 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
414 switch(list->modeinfo.colors) { |
6453 | 415 case 2: |
416 bpp=1; | |
417 bpp_conv=0; | |
418 break; | |
419 case 16: | |
420 bpp=4; | |
421 bpp_conv=0; | |
422 break; | |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
423 case 256: |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
424 bpp=8; |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
425 bpp_conv=0; |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
426 break; |
2982
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
427 case 32768: |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
428 bpp=16; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
429 bpp_conv=1; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
430 break; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
431 case 65536: |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
432 bpp=16; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
433 bpp_conv=0; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
434 break; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
435 case (1<<24): |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
436 if(list->modeinfo.bytesperpixel == 3) { |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
437 bpp=32; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
438 bpp_conv=1; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
439 } else { |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
440 bpp=32; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
441 bpp_conv=0; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
442 } |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
443 break; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
444 } |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
445 vid_mode=force_vm; |
2982
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
446 list=NULL; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
447 } else list=list->next; |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
448 } |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
449 } |
32638add0dc8
mode selection (subdev) fix by Matan Ziv-Av matan@svgalib.org
arpi
parents:
2732
diff
changeset
|
450 |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
451 |
504 | 452 if (verbose) |
453 printf("vo_svga: vid_mode: %d\n",vid_mode); | |
485 | 454 if (vga_setmode(vid_mode) == -1) { |
286 | 455 printf("vo_svga: vga_setmode(%d) failed.\n",vid_mode); |
483 | 456 uninit(); |
285 | 457 return(1); // error |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
458 } |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
459 |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
460 /* set 332 palette for 8 bpp */ |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
461 if(bpp==8){ |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
462 int i; |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
463 for(i=0; i<256; i++) |
6453 | 464 vga_setpalette(i, ((i>>5)&7)*9, ((i>>2)&7)*9, (i&3)*21); |
465 } | |
466 /* set 121 palette for 4 bpp */ | |
467 else if(bpp==4){ | |
468 int i; | |
469 for(i=0; i<16; i++) | |
470 vga_setpalette(i, ((i>>3)&1)*63, ((i>>1)&3)*21, (i&1)*63); | |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
471 } |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
472 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
473 WIDTH=vga_getxdim(); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
474 HEIGHT=vga_getydim(); |
6453 | 475 BYTESPERPIXEL=(bpp+4)>>3; |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
476 LINEWIDTH=vga_getmodeinfo(vid_mode)->linewidth; |
6456 | 477 |
9237
a076d22664b5
disable auto oldmethod, directrendering for linear modes only
iive
parents:
9171
diff
changeset
|
478 if( (vid_mode<10 || vid_mode==145) && (bpp==8 || bpp==4)) LINEWIDTH*=8; |
a076d22664b5
disable auto oldmethod, directrendering for linear modes only
iive
parents:
9171
diff
changeset
|
479 else |
a076d22664b5
disable auto oldmethod, directrendering for linear modes only
iive
parents:
9171
diff
changeset
|
480 if(vga_getmodeinfo(vid_mode)->flags & CAPABLE_LINEAR) |
a076d22664b5
disable auto oldmethod, directrendering for linear modes only
iive
parents:
9171
diff
changeset
|
481 // if (vga_version>0x1430)//remove this to get more speed (or black screen) |
a076d22664b5
disable auto oldmethod, directrendering for linear modes only
iive
parents:
9171
diff
changeset
|
482 vga_setlinearaddressing(); |
9046
13b7ad16f278
This patch should fix the display problem with 4bpp and 8bpp modes.
arpi
parents:
8673
diff
changeset
|
483 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
484 if(oldmethod) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
485 buffer=malloc(HEIGHT*LINEWIDTH); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
486 maxframes=0; |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
487 } else if ((vga_getmodeinfo(vid_mode)->flags&IS_LINEAR)) { |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
488 directrender=1; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
489 if(verbose) printf("vo_svga: Using direct rendering to linear video ram.\n"); |
286 | 490 } |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
491 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
492 vga_claimvideomemory((maxframes+1)*HEIGHT*LINEWIDTH); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
493 GRAPH_MEM=vga_getgraphmem(); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
494 frame=0; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
495 fillbox(0,0,WIDTH,HEIGHT*(maxframes+1),0); |
285 | 496 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
497 orig_w = width; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
498 orig_h = height; |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
499 maxw = req_w; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
500 maxh = req_h; |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
501 |
485 | 502 if (bpp_conv) { |
483 | 503 bppbuf = malloc(maxw * maxh * BYTESPERPIXEL); |
485 | 504 if (bppbuf == NULL) { |
505 printf("vo_svga: bppbuf -> Not enough memory for buffering!\n"); | |
506 uninit(); | |
507 return (1); | |
508 } | |
483 | 509 } |
8520 | 510 |
511 #ifdef CONFIG_VIDIX | |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
512 if(!vidix_name[0]){ |
8520 | 513 #endif |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
514 maxw = width; /* No scaling */ |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
515 maxh = height; |
8520 | 516 #ifdef CONFIG_VIDIX |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
517 } |
8520 | 518 #endif |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
519 if (pformat == IMGFMT_YV12) { |
9171 | 520 if(bpp==4) |
521 yuv2rgb_init(bpp|128, MODE_RGB); | |
522 else | |
523 yuv2rgb_init(bpp, MODE_RGB); | |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
524 } |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
525 |
285 | 526 x_pos = (WIDTH - maxw) / 2; |
527 y_pos = (HEIGHT - maxh) / 2; | |
528 | |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
529 #ifdef CONFIG_VIDIX |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
530 if(vidix_name[0]){ |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
531 vidix_init(width, height, x_pos, y_pos, maxw, maxh, format, bpp, |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
532 WIDTH, HEIGHT); |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
533 printf("vo_svga: Using VIDIX. w=%i h=%i mw=%i mh=%i\n",width,height,maxw,maxh); |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
534 vidix_start(); |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
535 } |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
536 #endif |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
537 |
6456 | 538 if(bpp==1) |
539 yuvbuf = malloc((maxw+7)/8 * maxh); | |
540 else | |
541 yuvbuf = malloc(maxw * maxh * BYTESPERPIXEL); | |
542 | |
483 | 543 if (yuvbuf == NULL) { |
485 | 544 printf("vo_svga: yuvbuf -> Not enough memory for buffering!\n"); |
407 | 545 uninit(); |
546 return (1); | |
547 } | |
504 | 548 printf("vo_svga: SVGAlib resolution: %dx%d %dbpp - ", WIDTH, HEIGHT, bpp); |
293 | 549 if (maxw != orig_w || maxh != orig_h) printf("Video scaled to: %dx%d\n",maxw,maxh); |
285 | 550 else printf("No video scaling\n"); |
551 | |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
552 vga_setdisplaystart(0); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
553 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
554 return (0); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
555 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
556 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
557 static uint32_t draw_frame(uint8_t *src[]) { |
7691
5381fb575552
10l fix & cleanup of draw_frame(), still NO support for stride :(
arpi
parents:
7675
diff
changeset
|
558 uint8_t *s=src[0]; |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
559 if (bpp_conv) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
560 switch(bpp) { |
7691
5381fb575552
10l fix & cleanup of draw_frame(), still NO support for stride :(
arpi
parents:
7675
diff
changeset
|
561 case 32: |
5381fb575552
10l fix & cleanup of draw_frame(), still NO support for stride :(
arpi
parents:
7675
diff
changeset
|
562 rgb24to32(src[0],bppbuf,maxw * maxh * 3); |
5381fb575552
10l fix & cleanup of draw_frame(), still NO support for stride :(
arpi
parents:
7675
diff
changeset
|
563 break; |
5381fb575552
10l fix & cleanup of draw_frame(), still NO support for stride :(
arpi
parents:
7675
diff
changeset
|
564 case 16: |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
565 rgb15to16(src[0],bppbuf,maxw * maxh * 2); |
7691
5381fb575552
10l fix & cleanup of draw_frame(), still NO support for stride :(
arpi
parents:
7675
diff
changeset
|
566 break; |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
567 } |
7691
5381fb575552
10l fix & cleanup of draw_frame(), still NO support for stride :(
arpi
parents:
7675
diff
changeset
|
568 s = bppbuf; |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
569 } |
7691
5381fb575552
10l fix & cleanup of draw_frame(), still NO support for stride :(
arpi
parents:
7675
diff
changeset
|
570 putbox(x_pos, y_pos, maxw, maxh, s, 1); |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
571 return (0); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
572 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
573 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
574 static uint32_t draw_slice(uint8_t *image[], int stride[], |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
575 int w, int h, int x, int y) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
576 uint8_t *src = yuvbuf; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
577 uint32_t sw, sh; |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
578 |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
579 if(directrender) { |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
580 yuv2rgb(GRAPH_MEM+(frame*HEIGHT+y+y_pos)*LINEWIDTH+(x+x_pos)*BYTESPERPIXEL, |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
581 image[0], image[1], image[2], w, h, LINEWIDTH, stride[0], stride[1]); |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
582 } else { |
6456 | 583 if(bpp==1) |
584 yuv2rgb(yuvbuf, image[0], image[1], image[2], w, h, (orig_w+7)/8, stride[0], stride[1]); | |
585 else | |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
586 yuv2rgb(yuvbuf, image[0], image[1], image[2], w, h, orig_w * BYTESPERPIXEL, |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
587 stride[0], stride[1]); |
6456 | 588 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
589 putbox(x + x_pos, y + y_pos, w, h, src, 1); |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
590 } |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
591 |
285 | 592 return (0); |
593 } | |
594 | |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
595 static void draw_osd(void) |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
596 { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
597 if(oldmethod) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
598 if (y_pos) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
599 fillbox(0, 0, WIDTH, y_pos, 0); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
600 fillbox(0, HEIGHT - y_pos, WIDTH, y_pos, 0); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
601 if (x_pos) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
602 int hmy=HEIGHT - (y_pos<<1); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
603 fillbox(0, y_pos, x_pos, hmy, 0); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
604 fillbox(WIDTH - x_pos, y_pos, x_pos, hmy, 0); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
605 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
606 } else if (x_pos) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
607 fillbox(0, y_pos, x_pos, HEIGHT, 0); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
608 fillbox(WIDTH - x_pos, y_pos, x_pos, HEIGHT, 0); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
609 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
610 vo_draw_text(WIDTH, HEIGHT, draw_alpha); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
611 } else |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
612 vo_draw_text(maxw, maxh, draw_alpha); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
613 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
614 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
615 static void flip_page(void) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
616 if(oldmethod) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
617 int i; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
618 uint8_t *b; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
619 b=buffer; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
620 for(i=0;i<HEIGHT;i++){ |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
621 vga_drawscansegment(b,0,i,LINEWIDTH); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
622 b+=LINEWIDTH; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
623 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
624 } else { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
625 if(maxframes) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
626 vga_setdisplaystart(frame*HEIGHT*LINEWIDTH); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
627 frame++; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
628 if(frame>maxframes)frame=0; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
629 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
630 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
631 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
632 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
633 static void check_events(void) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
634 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
635 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
636 static void uninit(void) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
637 vga_modelist_t *list = modelist; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
638 |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
639 #ifdef CONFIG_VIDIX |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
640 if(vidix_name[0])vidix_term(); |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
641 #endif |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
642 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
643 vga_setmode(TEXT); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
644 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
645 if (bppbuf != NULL) |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
646 free(bppbuf); |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
647 bppbuf=NULL; |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
648 if (yuvbuf != NULL) |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
649 free(yuvbuf); |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
650 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
651 while (modelist != NULL) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
652 list=modelist; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
653 modelist=modelist->next; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
654 free(list); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
655 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
656 checked = 0; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
657 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
658 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
659 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
660 /* --------------------------------------------------------------------- */ |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
661 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
662 static uint32_t add_mode(uint16_t mode, vga_modeinfo minfo) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
663 vga_modelist_t *list; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
664 |
8515
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
665 if(squarepix && (minfo.height*4 != minfo.width*3)) return 0; |
b4e5d87b878b
vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents:
8148
diff
changeset
|
666 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
667 if (modelist == NULL) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
668 modelist = (vga_modelist_t *) malloc(sizeof(vga_modelist_t)); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
669 if (modelist == NULL) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
670 printf("vo_svga: add_mode() failed. Not enough memory for modelist."); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
671 return(1); // error |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
672 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
673 modelist->modenum = mode; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
674 modelist->modeinfo = minfo; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
675 modelist->next = NULL; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
676 } else { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
677 list = modelist; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
678 while (list->next != NULL) |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
679 list = list->next; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
680 list->next = (vga_modelist_t *) malloc(sizeof(vga_modelist_t)); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
681 if (list->next == NULL) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
682 printf("vo_svga: add_mode() failed. Not enough memory for modelist."); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
683 return(1); // error |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
684 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
685 list = list->next; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
686 list->modenum = mode; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
687 list->modeinfo = minfo; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
688 list->next = NULL; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
689 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
690 return (0); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
691 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
692 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
693 static int checksupportedmodes() { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
694 uint16_t i, max; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
695 vga_modeinfo *minfo; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
696 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
697 checked = 1; |
6052 | 698 getch2_disable(); |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
699 vga_init(); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
700 vga_disabledriverreport(); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
701 max = vga_lastmodenumber(); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
702 if (verbose >= 2) |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
703 printf("vo_svga: Max mode : %i\n",max); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
704 for (i = 1; i <= max; i++) |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
705 if (vga_hasmode(i) > 0) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
706 minfo = vga_getmodeinfo(i); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
707 switch (minfo->colors) { |
6453 | 708 case 2 : bpp_avail |= BPP_1 ; break; |
709 case 16 : bpp_avail |= BPP_4 ; break; | |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
710 case 256 : bpp_avail |= BPP_8 ; break; |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
711 case 32768: bpp_avail |= BPP_15; break; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
712 case 65536: bpp_avail |= BPP_16; break; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
713 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
714 switch (minfo->bytesperpixel) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
715 case 3: bpp_avail |= BPP_24; break; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
716 case 4: bpp_avail |= BPP_32; break; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
717 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
718 if (verbose >= 2) |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
719 printf("vo_svga: Mode found: %s\n",vga_getmodename(i)); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
720 if (add_mode(i, *minfo)) |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
721 return(1); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
722 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
723 return(0); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
724 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
725 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
726 |
285 | 727 static uint32_t query_format(uint32_t format) { |
485 | 728 uint32_t res = 0; |
407 | 729 |
483 | 730 if (!checked) { |
731 if (checksupportedmodes()) // Looking for available video modes | |
732 return(0); | |
733 } | |
485 | 734 |
735 // if (vo_dbpp) => There is NO conversion!!! | |
736 if (vo_dbpp) { | |
712 | 737 if (format == IMGFMT_YV12) return (1); |
485 | 738 switch (vo_dbpp) { |
488 | 739 case 32: if ((format == IMGFMT_RGB32) || (format == IMGFMT_BGR32)) |
485 | 740 return ((bpp_avail & BPP_32) ? 1 : 0); |
741 break; | |
488 | 742 case 24: if ((format == IMGFMT_RGB24) || (format == IMGFMT_BGR24)) |
485 | 743 return ((bpp_avail & BPP_24) ? 1 : 0); |
744 break; | |
488 | 745 case 16: if ((format == IMGFMT_RGB16) || (format == IMGFMT_BGR16)) |
485 | 746 return ((bpp_avail & BPP_16) ? 1 : 0); |
747 break; | |
488 | 748 case 15: if ((format == IMGFMT_RGB15) || (format == IMGFMT_BGR15)) |
485 | 749 return ((bpp_avail & BPP_15) ? 1 : 0); |
750 break; | |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
751 case 8 : if ((format == IMGFMT_RGB8 ) || (format == IMGFMT_BGR8)) |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
752 return ((bpp_avail & BPP_8 ) ? 1 : 0); |
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
753 break; |
9171 | 754 case 4 : if ((format == IMGFMT_RG4B ) || (format == IMGFMT_BG4B)) |
6579 | 755 return ((bpp_avail & BPP_4 ) ? 1 : 0); |
756 break; | |
757 case 1 : if ((format == IMGFMT_RGB1 ) || (format == IMGFMT_BGR1)) | |
758 return ((bpp_avail & BPP_1 ) ? 1 : 0); | |
759 break; | |
407 | 760 } |
488 | 761 } else { |
485 | 762 switch (format) { |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
763 case IMGFMT_RGB32: |
488 | 764 case IMGFMT_BGR32: return ((bpp_avail & BPP_32) ? 1 : 0); break; |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
765 case IMGFMT_RGB24: |
488 | 766 case IMGFMT_BGR24: { |
485 | 767 res = (bpp_avail & BPP_24) ? 1 : 0; |
768 if (!res) | |
769 res = (bpp_avail & BPP_32) ? 1 : 0; | |
770 return (res); | |
771 } break; | |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
772 case IMGFMT_RGB16: |
488 | 773 case IMGFMT_BGR16: return ((bpp_avail & BPP_16) ? 1 : 0); break; |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
774 case IMGFMT_RGB15: |
488 | 775 case IMGFMT_BGR15: { |
485 | 776 res = (bpp_avail & BPP_15) ? 1 : 0; |
777 if (!res) | |
778 res = (bpp_avail & BPP_16) ? 1 : 0; | |
779 return (res); | |
780 } break; | |
781 case IMGFMT_YV12: return (1); break; | |
285 | 782 } |
488 | 783 } |
285 | 784 return (0); |
785 } | |
786 | |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
787 static void putbox(int x, int y, int w, int h, uint8_t *buf, int prog) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
788 int base, add, wid; |
6456 | 789 if(bpp==1) |
790 wid=(w+7)/8; | |
791 else | |
792 wid=w*BYTESPERPIXEL; | |
793 | |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
794 if(oldmethod) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
795 add=wid*prog; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
796 while( (h--) > 0 ) { |
6456 | 797 if(bpp==1) |
798 memcpy(buffer+(x+7)/8+(y++)*LINEWIDTH, buf, wid); | |
799 else | |
800 memcpy(buffer+x*BYTESPERPIXEL+(y++)*LINEWIDTH, buf, wid); | |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
801 buf+=add; |
6451
ed906af317da
8bpp support (no dithering yet, use -vop noise for now)
michael
parents:
6052
diff
changeset
|
802 } |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
803 } else { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
804 add=wid*prog; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
805 base=frame*HEIGHT; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
806 while( (h--) > 0 ) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
807 vga_drawscansegment(buf, x, (y++)+base, wid); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
808 buf+=add; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
809 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
810 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
811 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
812 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
813 static void fillbox(int x, int y, int w, int h, uint32_t c) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
814 putbox(x,y,w,h,buf0,0); |
285 | 815 } |
816 | |
817 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, | |
818 unsigned char *srca, int stride) { | |
7558 | 819 char* base; |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
820 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
821 if(oldmethod) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
822 base=buffer; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
823 } else |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
824 base=((frame*HEIGHT+y_pos)*WIDTH+x_pos)*BYTESPERPIXEL + GRAPH_MEM ; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
825 |
327 | 826 switch (bpp) { |
827 case 32: | |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
828 vo_draw_alpha_rgb32(w, h, src, srca, stride, base+4*(y0*WIDTH+x0), 4*WIDTH); |
327 | 829 break; |
830 case 24: | |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
831 vo_draw_alpha_rgb24(w, h, src, srca, stride, base+3*(y0*WIDTH+x0), 3*WIDTH); |
327 | 832 break; |
833 case 16: | |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
834 vo_draw_alpha_rgb16(w, h, src, srca, stride, base+2*(y0*WIDTH+x0), 2*WIDTH); |
327 | 835 break; |
836 case 15: | |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
837 vo_draw_alpha_rgb15(w, h, src, srca, stride, base+2*(y0*WIDTH+x0), 2*WIDTH); |
327 | 838 break; |
839 } | |
285 | 840 } |
4352 | 841 |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
842 static uint32_t get_image(mp_image_t *mpi) |
4352 | 843 { |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
844 if (/* zoomFlag || */ |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
845 !IMGFMT_IS_BGR(mpi->imgfmt) || |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
846 ((mpi->type != MP_IMGTYPE_STATIC) && (mpi->type != MP_IMGTYPE_TEMP)) || |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
847 (mpi->flags & MP_IMGFLAG_PLANAR) || |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
848 (mpi->flags & MP_IMGFLAG_YUV) /* |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
849 (mpi->width != image_width) || |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
850 (mpi->height != image_height) */ |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
851 ) |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
852 return(VO_FALSE); |
9237
a076d22664b5
disable auto oldmethod, directrendering for linear modes only
iive
parents:
9171
diff
changeset
|
853 if(!directrender) |
a076d22664b5
disable auto oldmethod, directrendering for linear modes only
iive
parents:
9171
diff
changeset
|
854 return (VO_FALSE); |
5679
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
855 /* |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
856 if (Flip_Flag) |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
857 { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
858 mpi->stride[0] = -image_width*((bpp+7)/8); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
859 mpi->planes[0] = ImageData - mpi->stride[0]*(image_height-1); |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
860 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
861 else |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
862 */ |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
863 { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
864 mpi->stride[0] = LINEWIDTH; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
865 if(oldmethod) { |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
866 mpi->planes[0] = buffer; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
867 } else |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
868 mpi->planes[0] = GRAPH_MEM; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
869 } |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
870 mpi->flags |= MP_IMGFLAG_DIRECT; |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
871 |
30f196ff3bec
This patch replaces vo_svga.c with an improved version that does not use
arpi
parents:
4596
diff
changeset
|
872 return(VO_TRUE); |
4352 | 873 } |
874 |