comparison osdep/vbelib.c @ 12660:430a71a762b4

neomagic tv out support throught vesa vbe, patch by Rudolf Marek
author alex
date Fri, 25 Jun 2004 17:29:18 +0000
parents 22f8732b5d97
children 166a12bd5470
comparison
equal deleted inserted replaced
12659:2cb92251da72 12660:430a71a762b4
4 So it's not an emulator - it calls real int 10h handler under Linux. 4 So it's not an emulator - it calls real int 10h handler under Linux.
5 Note: VESA is available only on x86 systems. 5 Note: VESA is available only on x86 systems.
6 You can redistribute this file under terms and conditions 6 You can redistribute this file under terms and conditions
7 of GNU General Public licence v2. 7 of GNU General Public licence v2.
8 Written by Nick Kurshev <nickols_k@mail.ru> 8 Written by Nick Kurshev <nickols_k@mail.ru>
9 Neomagic TV out support by Rudolf Marek <r.marek et sh.cvut.cz>
9 */ 10 */
10 11
11 #include <../config.h> 12 #include <../config.h>
12 #ifdef HAVE_VESA 13 #ifdef HAVE_VESA
13 14
334 } 335 }
335 LRMI_free_real(rm_space); 336 LRMI_free_real(rm_space);
336 return retval; 337 return retval;
337 } 338 }
338 339
340
341 int vbeSetTV(unsigned int vesa_mode,unsigned int TV_mode) {
342
343 #define NR_MODES 8
344
345 unsigned int mode_table[NR_MODES] =
346 {0x101,0x103,0x111,0x114,0x120,0x121,0x122,0x123};
347 unsigned int tv_table[][NR_MODES] = {
348 {0x201,0x202,0x211,0x212,0x221,0x231,0x222,0x232},
349 {0x200,0x203,0x210,0x213,0x220,0x230,0xFFFF,0xFFFF}};
350
351 /*
352
353 Alternate mode map. If modes like 320x240 and 400x300 does not work, but
354 640x480 and 800x600 work, then try to replace above two lines with this
355 lines and write email to me if it works.
356 r.marek et sh.cvut.cz
357
358 {0x201,0x202,0x211,0x212,0x222,0x223,0x224,0x225},
359 {0x200,0x203,0x210,0x213,0x220,0x221,0xFFFF,0xFFFF}};
360
361 */
362 int i,retval;
363 struct LRMI_regs r;
364
365 memset(&r,0,sizeof(struct LRMI_regs));
366 for (i=0;((mode_table[i]!=(vesa_mode&0x3FF))&&(i<NR_MODES));i++) ;
367
368 if (i==NR_MODES) return 0;
369 if(verbose > 1) printf("vbelib: Trying to set TV mode %x\n",tv_table[TV_mode][i]);
370 r.eax = 0x4f14;
371 r.ebx = 0x20;
372 r.edx = 0;
373 r.edi = 0;
374 r.ecx = tv_table[TV_mode][i];
375 retval = VBE_LRMI_int(0x10,&r);
376 if(!retval) return VBE_VM86_FAIL;
377 return r.eax & 0xffff;
378
379 }
339 int vbeSetMode(unsigned mode,struct VesaCRTCInfoBlock *data) 380 int vbeSetMode(unsigned mode,struct VesaCRTCInfoBlock *data)
340 { 381 {
341 struct LRMI_regs r; 382 struct LRMI_regs r;
342 void *rm_space = NULL; 383 void *rm_space = NULL;
343 int retval; 384 int retval;