Hi all:
I have found the problem, but not solved yet :-(
This is the init code in the svgalib.c video driver:
----------------
static int init(char *options) { if(detect()) { char *frame = NULL; vga_modeinfo *mdinfo; GrVideoMode mode,*modep = &modes[1]; GrVideoModeExt ext, *extp = &exts[0]; int mindex; memzero(modep,(sizeof(modes) - sizeof(modes[0]))); for(mindex = G320x200x16; mindex <= GLASTMODE; mindex++) { if(!(vga_hasmode(mindex))) continue; if(!(mdinfo = vga_getmodeinfo(mindex))) continue; if(!(build_video_mode(mdinfo,&mode,&ext))) continue; if(frame == NULL) { #if 0 /* paranoid hack to really make sure... */ long endmem = (long)(sbrk(0)); if((endmem & 0xffffL) != 0) { brk((void *)((endmem + 0xffffL) & ~0xffffL)); } #endif vga_setmode(mindex); if (ext.flags & GR_VMODEF_LINEAR) vga_setlinearaddressing(); frame = (char *)vga_getgraphmem(); vga_setmode(initmode); } mode.mode = mindex; ext.frame = frame; add_video_mode(&mode,&ext,&modep,&extp); } _GrVideoDriverSVGALIB.adapter = isEGA ? GR_EGA : GR_VGA; return(TRUE); } return(FALSE); }
--------------------
The problem:
GRX needs ext.frame to be set in advance for all video modes. But with Svgalib GRX needs to set the videomode to get the pointer. GRX assumes ext.frame is the same for all modes, but is not true for the newest video cards.
I had make a try, setting the videomode (vga_setmode) for every mode and getting the frame pointer. It works, and "demogrx" runs in 16bpp OK. But it takes a lot to start, and probably is not a good idea to set all video modes consecutive.
So, any one knows how to get the frame pointer without set the video mode?
Mariano Alvarez Fernandez wrote:
I had make a try, setting the videomode (vga_setmode) for every mode and getting the frame pointer. It works, and "demogrx" runs in 16bpp OK. But it takes a lot to start, and probably is not a good idea to set all video modes consecutive.
So, any one knows how to get the frame pointer without set the video mode?
Is it really necessary to set the frame pointer for each (even unused) video mode at the beginning? What about delaying to set the frame pointer until the mode is really used?
Just an idea,
Peter
Peter Gerwinski escribió:
Mariano Alvarez Fernandez wrote:
I had make a try, setting the videomode (vga_setmode) for every mode and getting the frame pointer. It works, and "demogrx" runs in 16bpp OK. But it takes a lot to start, and probably is not a good idea to set all video modes consecutive.
So, any one knows how to get the frame pointer without set the video mode?
Is it really necessary to set the frame pointer for each (even unused) video mode at the beginning? What about delaying to set the frame pointer until the mode is really used?
Just an idea,
The problem is this code in src/setup/setmode.c:
if((t || buildframedriver(&vmd,&fdr)) && (t || buildcontext(&vmd,&fdr,&cxt)) && (*vmd.extinfo->setup)(&vmd,noclear)) {
We can set the frame pointer in the setup routine, but buildcontext uses it in advance, I can change the code to:
if((*vmd.extinfo->setup)(&vmd,noclear)) && (t || buildframedriver(&vmd,&fdr)) && (t || buildcontext(&vmd,&fdr,&cxt))){
but I don't know if we break any other driver with it.
Hartmut if you can, your opinion will be unvaluable here.
On Mon, 26 Feb 2001, Mariano Alvarez Fernandez wrote:
The problem is this code in src/setup/setmode.c:
if((t || buildframedriver(&vmd,&fdr)) && (t || buildcontext(&vmd,&fdr,&cxt)) && (*vmd.extinfo->setup)(&vmd,noclear)) {
We can set the frame pointer in the setup routine, but buildcontext uses it in advance, I can change the code to:
if((*vmd.extinfo->setup)(&vmd,noclear)) && (t || buildframedriver(&vmd,&fdr)) && (t || buildcontext(&vmd,&fdr,&cxt))){
but I don't know if we break any other driver with it.
Hartmut if you can, your opinion will be unvaluable here.
You should try
if((t || buildframedriver(&vmd,&fdr)) && (*vmd.extinfo->setup)(&vmd,noclear) && (t || buildcontext(&vmd,&fdr,&cxt)) )
instead. builddriver should stay before setup() since it doesnŽt use the frame address.
Note, this code is nearly unchanged since Csaba wrote it and I never really got through all details.
Hartmut
Hartmut Schirmer escribió:
You should try
if((t || buildframedriver(&vmd,&fdr)) && (*vmd.extinfo->setup)(&vmd,noclear) && (t || buildcontext(&vmd,&fdr,&cxt)) )
instead. builddriver should stay before setup() since it doesn´t use the frame address.
Note, this code is nearly unchanged since Csaba wrote it and I never really got through all details.
Thanks, I will try it.